UNPKG

@uva-glass/component-library

Version:

React components UvA

1,273 lines (1,244 loc) 303 kB
var scope = (() => { let pt; return typeof window < "u" ? pt = window : typeof globalThis < "u" ? pt = globalThis : typeof global < "u" ? pt = global : typeof self < "u" ? pt = self : pt = {}, pt; })(), oe$1 = Object.defineProperty, t$2 = (pt, ne) => oe$1(pt, "name", { value: ne, configurable: !0 }); function r$2(pt) { for (var ne = [], yt = 1; yt < arguments.length; yt++) ne[yt - 1] = arguments[yt]; var ir = Array.from(typeof pt == "string" ? [pt] : pt); ir[ir.length - 1] = ir[ir.length - 1].replace(/\r?\n([\t ]*)$/, ""); var io = ir.reduce(function(Co, xo) { var Oo = xo.match(/\n([\t ]+|(?!\s).)/g); return Oo ? Co.concat(Oo.map(function(Io) { var _o, Po; return (Po = (_o = Io.match(/[\t ]/g)) === null || _o === void 0 ? void 0 : _o.length) !== null && Po !== void 0 ? Po : 0; })) : Co; }, []); if (io.length) { var uo = new RegExp(` [ ]{` + Math.min.apply(Math, io) + "}", "g"); ir = ir.map(function(Co) { return Co.replace(uo, ` `); }); } ir[0] = ir[0].replace(/^\r?\n/, ""); var fo = ir[0]; return ne.forEach(function(Co, xo) { var Oo = fo.match(/(?:^|\n)( *)$/), Io = Oo ? Oo[1] : "", _o = Co; typeof Co == "string" && Co.includes(` `) && (_o = String(Co).split(` `).map(function(Po, Lo) { return Lo === 0 ? Po : "" + Io + Po; }).join(` `)), fo += _o + ir[xo + 1]; }), fo; } t$2(r$2, "dedent"); function C$2({ code: pt, category: ne }) { let yt = String(pt).padStart(4, "0"); return `SB_${ne}_${yt}`; } t$2(C$2, "parseErrorCode"); var p$1 = class oa extends Error { constructor(ne) { super(oa.getFullMessage(ne)), this.data = {}, this.fromStorybook = !0, this.category = ne.category, this.documentation = ne.documentation ?? !1, this.code = ne.code; } get fullErrorCode() { return C$2({ code: this.code, category: this.category }); } /** Overrides the default `Error.name` property in the format: SB_<CATEGORY>_<CODE>. */ get name() { let ne = this.constructor.name; return `${this.fullErrorCode} (${ne})`; } /** Generates the error message along with additional documentation link (if applicable). */ static getFullMessage({ documentation: ne, code: yt, category: ir, message: io }) { let uo; return ne === !0 ? uo = `https://storybook.js.org/error/${C$2({ code: yt, category: ir })}` : typeof ne == "string" ? uo = ne : Array.isArray(ne) && (uo = ` ${ne.map((fo) => ` - ${fo}`).join(` `)}`), `${io}${uo != null ? ` More info: ${uo} ` : ""}`; } }; t$2(p$1, "StorybookError"); var o$1 = p$1, f$2 = class extends o$1 { constructor(ne) { super({ category: "PREVIEW_API", code: 1, message: r$2` Couldn't find story matching id '${ne.storyId}' after HMR. - Did you just rename a story? - Did you remove it from your CSF file? - Are you sure a story with the id '${ne.storyId}' exists? - Please check the values in the stories field of your main.js config and see if they would match your CSF File. - Also check the browser console and terminal for potential error messages.` }), this.data = ne; } }; t$2(f$2, "MissingStoryAfterHmrError"); var D$2 = f$2, R$2 = class extends o$1 { constructor(ne) { super({ category: "PREVIEW_API", code: 2, documentation: "https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#using-implicit-actions-during-rendering-is-deprecated-for-example-in-the-play-function", message: r$2` We detected that you use an implicit action arg while ${ne.phase} of your story. ${ne.deprecated ? ` This is deprecated and won't work in Storybook 8 anymore. ` : ""} Please provide an explicit spy to your args like this: import { fn } from '@storybook/test'; ... args: { ${ne.name}: fn() }` }), this.data = ne; } }; t$2(R$2, "ImplicitActionsDuringRendering"); var j$3 = R$2, b$3 = class extends o$1 { constructor() { super({ category: "PREVIEW_API", code: 3, message: r$2` Cannot call \`storyStore.extract()\` without calling \`storyStore.cacheAllCsfFiles()\` first. You probably meant to call \`await preview.extract()\` which does the above for you.` }); } }; t$2(b$3, "CalledExtractOnStoreError"); var L$4 = b$3, I$3 = class extends o$1 { constructor() { super({ category: "PREVIEW_API", code: 4, message: r$2` Expected your framework's preset to export a \`renderToCanvas\` field. Perhaps it needs to be upgraded for Storybook 7.0?`, documentation: "https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#mainjs-framework-field" }); } }; t$2(I$3, "MissingRenderToCanvasError"); var G$3 = I$3, P$4 = class extends o$1 { constructor(ne) { super({ category: "PREVIEW_API", code: 5, message: r$2` Called \`Preview.${ne.methodName}()\` before initialization. The preview needs to load the story index before most methods can be called. If you want to call \`${ne.methodName}\`, try \`await preview.initializationPromise;\` first. If you didn't call the above code, then likely it was called by an addon that needs to do the above.` }), this.data = ne; } }; t$2(P$4, "CalledPreviewMethodBeforeInitializationError"); var Y$3 = P$4, x$3 = class extends o$1 { constructor(ne) { super({ category: "PREVIEW_API", code: 6, message: r$2` Error fetching \`/index.json\`: ${ne.text} If you are in development, this likely indicates a problem with your Storybook process, check the terminal for errors. If you are in a deployed Storybook, there may have been an issue deploying the full Storybook build.` }), this.data = ne; } }; t$2(x$3, "StoryIndexFetchError"); var M$2 = x$3, T$3 = class extends o$1 { constructor(ne) { super({ category: "PREVIEW_API", code: 7, message: r$2` Tried to render docs entry ${ne.storyId} but it is a MDX file that has no CSF references, or autodocs for a CSF file that some doesn't refer to itself. This likely is an internal error in Storybook's indexing, or you've attached the \`attached-mdx\` tag to an MDX file that is not attached.` }), this.data = ne; } }; t$2(T$3, "MdxFileWithNoCsfReferencesError"); var H$3 = T$3, w$2 = class extends o$1 { constructor() { super({ category: "PREVIEW_API", code: 8, message: r$2` Couldn't find any stories in your Storybook. - Please check your stories field of your main.js config: does it match correctly? - Also check the browser console and terminal for error messages.` }); } }; t$2(w$2, "EmptyIndexError"); var F$3 = w$2, k$3 = class extends o$1 { constructor(ne) { super({ category: "PREVIEW_API", code: 9, message: r$2` Couldn't find story matching '${ne.storySpecifier}'. - Are you sure a story with that id exists? - Please check your stories field of your main.js config. - Also check the browser console and terminal for error messages.` }), this.data = ne; } }; t$2(k$3, "NoStoryMatchError"); var K$3 = k$3, S$3 = class extends o$1 { constructor(ne) { super({ category: "PREVIEW_API", code: 10, message: r$2` Couldn't find story matching id '${ne.storyId}' after importing a CSF file. The file was indexed as if the story was there, but then after importing the file in the browser we didn't find the story. Possible reasons: - You are using a custom story indexer that is misbehaving. - You have a custom file loader that is removing or renaming exports. Please check your browser console and terminal for errors that may explain the issue.` }), this.data = ne; } }; t$2(S$3, "MissingStoryFromCsfFileError"); var X$2 = S$3, v$2 = class extends o$1 { constructor() { super({ category: "PREVIEW_API", code: 11, message: r$2` Cannot access the Story Store until the index is ready. It is not recommended to use methods directly on the Story Store anyway, in Storybook 9 we will remove access to the store entirely` }); } }; t$2(v$2, "StoryStoreAccessedBeforeInitializationError"); var U$3 = v$2, _$2 = class extends o$1 { constructor(ne) { super({ category: "PREVIEW_API", code: 12, message: r$2` Incorrect use of mount in the play function. To use mount in the play function, you must satisfy the following two requirements: 1. You *must* destructure the mount property from the \`context\` (the argument passed to your play function). This makes sure that Storybook does not start rendering the story before the play function begins. 2. Your Storybook framework or builder must be configured to transpile to ES2017 or newer. This is because destructuring statements and async/await usages are otherwise transpiled away, which prevents Storybook from recognizing your usage of \`mount\`. Note that Angular is not supported. As async/await is transpiled to support the zone.js polyfill. More info: https://storybook.js.org/docs/writing-tests/interaction-testing#run-code-before-the-component-gets-rendered Received the following play function: ${ne.playFunction}` }), this.data = ne; } }; t$2(_$2, "MountMustBeDestructuredError"); var J$3 = _$2, V$3 = class extends o$1 { constructor(ne) { super({ category: "PREVIEW_API", code: 14, message: r$2` No render function available for storyId '${ne.id}' ` }), this.data = ne; } }; t$2(V$3, "NoRenderFunctionError"); var q$3 = V$3, N$1 = class extends o$1 { constructor() { super({ category: "PREVIEW_API", code: 15, message: r$2` No component is mounted in your story. This usually occurs when you destructure mount in the play function, but forget to call it. For example: async play({ mount, canvasElement }) { // 👈 mount should be called: await mount(); const canvas = within(canvasElement); const button = await canvas.findByRole('button'); await userEvent.click(button); }; Make sure to either remove it or call mount in your play function. ` }); } }; t$2(N$1, "NoStoryMountedError"); var z$2 = N$1, A$1 = class extends o$1 { constructor() { super({ category: "FRAMEWORK_NEXTJS", code: 1, documentation: "https://storybook.js.org/docs/get-started/nextjs#faq", message: r$2` You are importing avif images, but you don't have sharp installed. You have to install sharp in order to use image optimization features in Next.js. ` }); } }; t$2(A$1, "NextJsSharpError"); var W$3 = class extends o$1 { constructor(ne) { super({ category: "FRAMEWORK_NEXTJS", code: 2, message: r$2` Tried to access router mocks from "${ne.importType}" but they were not created yet. You might be running code in an unsupported environment. ` }), this.data = ne; } }; t$2(W$3, "NextjsRouterMocksNotAvailable"); var $$3 = class extends o$1 { constructor(ne) { super({ category: "DOCS-TOOLS", code: 1, documentation: "https://github.com/storybookjs/storybook/issues/26606", message: r$2` There was a failure when generating detailed ArgTypes in ${ne.language} for: ${JSON.stringify(ne.type, null, 2)} Storybook will fall back to use a generic type description instead. This type is either not supported or it is a bug in the docgen generation in Storybook. If you think this is a bug, please detail it as much as possible in the Github issue. ` }), this.data = ne; } }; t$2($$3, "UnknownArgTypesError"); var Z$2 = $$3, O$2 = class extends o$1 { constructor(ne) { super({ category: "ADDON_VITEST", code: 1, // TODO: Add documentation about viewports support // documentation: '', message: r$2` Encountered an unsupported value "${ne.value}" when setting the viewport ${ne.dimension} dimension. The Storybook plugin only supports values in the following units: - px, vh, vw, em, rem and %. You can either change the viewport for this story to use one of the supported units or skip the test by adding '!test' to the story's tags per https://storybook.js.org/docs/writing-stories/tags ` }), this.data = ne; } }; t$2(O$2, "UnsupportedViewportDimensionError"); var u$1 = Object.defineProperty, a$2 = (pt, ne) => u$1(pt, "name", { value: ne, configurable: !0 }), y$2 = (() => { let pt; return typeof window < "u" ? pt = window : typeof globalThis < "u" ? pt = globalThis : typeof global < "u" ? pt = global : typeof self < "u" ? pt = self : pt = {}, pt; })(), { LOGLEVEL: b$2 } = y$2, t$1 = { trace: 1, debug: 2, info: 3, warn: 4, error: 5, silent: 10 }, L$3 = b$2, i$1 = t$1[L$3] || t$1.info, s$3 = { trace: /* @__PURE__ */ a$2((pt, ...ne) => { i$1 <= t$1.trace && console.trace(pt, ...ne); }, "trace"), debug: /* @__PURE__ */ a$2((pt, ...ne) => { i$1 <= t$1.debug && console.debug(pt, ...ne); }, "debug"), info: /* @__PURE__ */ a$2((pt, ...ne) => { i$1 <= t$1.info && console.info(pt, ...ne); }, "info"), warn: /* @__PURE__ */ a$2((pt, ...ne) => { i$1 <= t$1.warn && console.warn(pt, ...ne); }, "warn"), error: /* @__PURE__ */ a$2((pt, ...ne) => { i$1 <= t$1.error && console.error(pt, ...ne); }, "error"), log: /* @__PURE__ */ a$2((pt, ...ne) => { i$1 < t$1.silent && console.log(pt, ...ne); }, "log") }, c$1 = /* @__PURE__ */ new Set(), n$1 = /* @__PURE__ */ a$2((pt) => (ne, ...yt) => { if (!c$1.has(ne)) return c$1.add(ne), s$3[pt](ne, ...yt); }, "once"); n$1.clear = () => c$1.clear(); n$1.trace = n$1("trace"); n$1.debug = n$1("debug"); n$1.info = n$1("info"); n$1.warn = n$1("warn"); n$1.error = n$1("error"); n$1.log = n$1("log"); var m$1 = n$1("warn"), r$1 = /* @__PURE__ */ a$2((pt) => (...ne) => { let yt = []; if (ne.length) { let ir = /<span\s+style=(['"])([^'"]*)\1\s*>/gi, io = /<\/span>/gi, uo; for (yt.push(ne[0].replace(ir, "%c").replace(io, "%c")); uo = ir.exec(ne[0]); ) yt.push(uo[2]), yt.push(""); for (let fo = 1; fo < ne.length; fo++) yt.push(ne[fo]); } s$3[pt].apply(s$3, yt); }, "pretty"); r$1.trace = r$1("trace"); r$1.debug = r$1("debug"); r$1.info = r$1("info"); r$1.warn = r$1("warn"); r$1.error = r$1("error"); var R$1 = /* @__PURE__ */ ((pt) => (pt.CHANNEL_WS_DISCONNECT = "channelWSDisconnect", pt.CHANNEL_CREATED = "channelCreated", pt.CONFIG_ERROR = "configError", pt.STORY_INDEX_INVALIDATED = "storyIndexInvalidated", pt.STORY_SPECIFIED = "storySpecified", pt.SET_CONFIG = "setConfig", pt.SET_STORIES = "setStories", pt.SET_INDEX = "setIndex", pt.SET_CURRENT_STORY = "setCurrentStory", pt.CURRENT_STORY_WAS_SET = "currentStoryWasSet", pt.FORCE_RE_RENDER = "forceReRender", pt.FORCE_REMOUNT = "forceRemount", pt.PRELOAD_ENTRIES = "preloadStories", pt.STORY_PREPARED = "storyPrepared", pt.DOCS_PREPARED = "docsPrepared", pt.STORY_CHANGED = "storyChanged", pt.STORY_UNCHANGED = "storyUnchanged", pt.STORY_RENDERED = "storyRendered", pt.STORY_FINISHED = "storyFinished", pt.STORY_MISSING = "storyMissing", pt.STORY_ERRORED = "storyErrored", pt.STORY_THREW_EXCEPTION = "storyThrewException", pt.STORY_RENDER_PHASE_CHANGED = "storyRenderPhaseChanged", pt.PLAY_FUNCTION_THREW_EXCEPTION = "playFunctionThrewException", pt.UNHANDLED_ERRORS_WHILE_PLAYING = "unhandledErrorsWhilePlaying", pt.UPDATE_STORY_ARGS = "updateStoryArgs", pt.STORY_ARGS_UPDATED = "storyArgsUpdated", pt.RESET_STORY_ARGS = "resetStoryArgs", pt.SET_FILTER = "setFilter", pt.SET_GLOBALS = "setGlobals", pt.UPDATE_GLOBALS = "updateGlobals", pt.GLOBALS_UPDATED = "globalsUpdated", pt.REGISTER_SUBSCRIPTION = "registerSubscription", pt.PREVIEW_KEYDOWN = "previewKeydown", pt.PREVIEW_BUILDER_PROGRESS = "preview_builder_progress", pt.SELECT_STORY = "selectStory", pt.STORIES_COLLAPSE_ALL = "storiesCollapseAll", pt.STORIES_EXPAND_ALL = "storiesExpandAll", pt.DOCS_RENDERED = "docsRendered", pt.SHARED_STATE_CHANGED = "sharedStateChanged", pt.SHARED_STATE_SET = "sharedStateSet", pt.NAVIGATE_URL = "navigateUrl", pt.UPDATE_QUERY_PARAMS = "updateQueryParams", pt.REQUEST_WHATS_NEW_DATA = "requestWhatsNewData", pt.RESULT_WHATS_NEW_DATA = "resultWhatsNewData", pt.SET_WHATS_NEW_CACHE = "setWhatsNewCache", pt.TOGGLE_WHATS_NEW_NOTIFICATIONS = "toggleWhatsNewNotifications", pt.TELEMETRY_ERROR = "telemetryError", pt.FILE_COMPONENT_SEARCH_REQUEST = "fileComponentSearchRequest", pt.FILE_COMPONENT_SEARCH_RESPONSE = "fileComponentSearchResponse", pt.SAVE_STORY_REQUEST = "saveStoryRequest", pt.SAVE_STORY_RESPONSE = "saveStoryResponse", pt.ARGTYPES_INFO_REQUEST = "argtypesInfoRequest", pt.ARGTYPES_INFO_RESPONSE = "argtypesInfoResponse", pt.CREATE_NEW_STORYFILE_REQUEST = "createNewStoryfileRequest", pt.CREATE_NEW_STORYFILE_RESPONSE = "createNewStoryfileResponse", pt.TESTING_MODULE_CRASH_REPORT = "testingModuleCrashReport", pt.TESTING_MODULE_PROGRESS_REPORT = "testingModuleProgressReport", pt.TESTING_MODULE_RUN_REQUEST = "testingModuleRunRequest", pt.TESTING_MODULE_RUN_ALL_REQUEST = "testingModuleRunAllRequest", pt.TESTING_MODULE_CANCEL_TEST_RUN_REQUEST = "testingModuleCancelTestRunRequest", pt.TESTING_MODULE_CANCEL_TEST_RUN_RESPONSE = "testingModuleCancelTestRunResponse", pt))(R$1 || {}), _$1 = R$1, { CHANNEL_WS_DISCONNECT: S$2, CHANNEL_CREATED: T$2, CONFIG_ERROR: N, CREATE_NEW_STORYFILE_REQUEST: O$1, CREATE_NEW_STORYFILE_RESPONSE: A, CURRENT_STORY_WAS_SET: r, DOCS_PREPARED: D$1, DOCS_RENDERED: I$2, FILE_COMPONENT_SEARCH_REQUEST: o, FILE_COMPONENT_SEARCH_RESPONSE: C$1, FORCE_RE_RENDER: L$2, FORCE_REMOUNT: P$3, GLOBALS_UPDATED: U$2, NAVIGATE_URL: G$2, PLAY_FUNCTION_THREW_EXCEPTION: a$1, UNHANDLED_ERRORS_WHILE_PLAYING: Y$2, PRELOAD_ENTRIES: t, PREVIEW_BUILDER_PROGRESS: d, PREVIEW_KEYDOWN: e, REGISTER_SUBSCRIPTION: H$2, RESET_STORY_ARGS: W$2, SELECT_STORY: l, SET_CONFIG: i, SET_CURRENT_STORY: p, SET_FILTER: F$2, SET_GLOBALS: u, SET_INDEX: M$1, SET_STORIES: s$2, SHARED_STATE_CHANGED: y$1, SHARED_STATE_SET: c, STORIES_COLLAPSE_ALL: g, STORIES_EXPAND_ALL: h$1, STORY_ARGS_UPDATED: f$1, STORY_CHANGED: Q$1, STORY_ERRORED: x$2, STORY_INDEX_INVALIDATED: m, STORY_MISSING: V$2, STORY_PREPARED: w$1, STORY_RENDER_PHASE_CHANGED: B$1, STORY_RENDERED: X$1, STORY_FINISHED: q$2, STORY_SPECIFIED: b$1, STORY_THREW_EXCEPTION: K$2, STORY_UNCHANGED: j$2, UPDATE_GLOBALS: k$2, UPDATE_QUERY_PARAMS: n, UPDATE_STORY_ARGS: z$1, REQUEST_WHATS_NEW_DATA: J$2, RESULT_WHATS_NEW_DATA: Z$1, SET_WHATS_NEW_CACHE: $$2, TOGGLE_WHATS_NEW_NOTIFICATIONS: v$1, TELEMETRY_ERROR: EE, SAVE_STORY_REQUEST: RE, SAVE_STORY_RESPONSE: _E, ARGTYPES_INFO_REQUEST: SE, ARGTYPES_INFO_RESPONSE: TE, TESTING_MODULE_CRASH_REPORT: NE, TESTING_MODULE_PROGRESS_REPORT: OE, TESTING_MODULE_RUN_REQUEST: AE, TESTING_MODULE_RUN_ALL_REQUEST: rE, TESTING_MODULE_CANCEL_TEST_RUN_REQUEST: DE, TESTING_MODULE_CANCEL_TEST_RUN_RESPONSE: IE } = R$1; const so$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, ARGTYPES_INFO_REQUEST: SE, ARGTYPES_INFO_RESPONSE: TE, CHANNEL_CREATED: T$2, CHANNEL_WS_DISCONNECT: S$2, CONFIG_ERROR: N, CREATE_NEW_STORYFILE_REQUEST: O$1, CREATE_NEW_STORYFILE_RESPONSE: A, CURRENT_STORY_WAS_SET: r, DOCS_PREPARED: D$1, DOCS_RENDERED: I$2, FILE_COMPONENT_SEARCH_REQUEST: o, FILE_COMPONENT_SEARCH_RESPONSE: C$1, FORCE_REMOUNT: P$3, FORCE_RE_RENDER: L$2, GLOBALS_UPDATED: U$2, NAVIGATE_URL: G$2, PLAY_FUNCTION_THREW_EXCEPTION: a$1, PRELOAD_ENTRIES: t, PREVIEW_BUILDER_PROGRESS: d, PREVIEW_KEYDOWN: e, REGISTER_SUBSCRIPTION: H$2, REQUEST_WHATS_NEW_DATA: J$2, RESET_STORY_ARGS: W$2, RESULT_WHATS_NEW_DATA: Z$1, SAVE_STORY_REQUEST: RE, SAVE_STORY_RESPONSE: _E, SELECT_STORY: l, SET_CONFIG: i, SET_CURRENT_STORY: p, SET_FILTER: F$2, SET_GLOBALS: u, SET_INDEX: M$1, SET_STORIES: s$2, SET_WHATS_NEW_CACHE: $$2, SHARED_STATE_CHANGED: y$1, SHARED_STATE_SET: c, STORIES_COLLAPSE_ALL: g, STORIES_EXPAND_ALL: h$1, STORY_ARGS_UPDATED: f$1, STORY_CHANGED: Q$1, STORY_ERRORED: x$2, STORY_FINISHED: q$2, STORY_INDEX_INVALIDATED: m, STORY_MISSING: V$2, STORY_PREPARED: w$1, STORY_RENDERED: X$1, STORY_RENDER_PHASE_CHANGED: B$1, STORY_SPECIFIED: b$1, STORY_THREW_EXCEPTION: K$2, STORY_UNCHANGED: j$2, TELEMETRY_ERROR: EE, TESTING_MODULE_CANCEL_TEST_RUN_REQUEST: DE, TESTING_MODULE_CANCEL_TEST_RUN_RESPONSE: IE, TESTING_MODULE_CRASH_REPORT: NE, TESTING_MODULE_PROGRESS_REPORT: OE, TESTING_MODULE_RUN_ALL_REQUEST: rE, TESTING_MODULE_RUN_REQUEST: AE, TOGGLE_WHATS_NEW_NOTIFICATIONS: v$1, UNHANDLED_ERRORS_WHILE_PLAYING: Y$2, UPDATE_GLOBALS: k$2, UPDATE_QUERY_PARAMS: n, UPDATE_STORY_ARGS: z$1, default: _$1 }, Symbol.toStringTag, { value: "Module" })); var ae$1 = Object.create, ut$1 = Object.defineProperty, se$1 = Object.getOwnPropertyDescriptor, le$1 = Object.getOwnPropertyNames, ce$1 = Object.getPrototypeOf, pe = Object.prototype.hasOwnProperty, a = (pt, ne) => ut$1(pt, "name", { value: ne, configurable: !0 }), H$1 = /* @__PURE__ */ ((pt) => typeof require < "u" ? require : typeof Proxy < "u" ? new Proxy(pt, { get: (ne, yt) => (typeof require < "u" ? require : ne)[yt] }) : pt)(function(pt) { if (typeof require < "u") return require.apply(this, arguments); throw Error('Dynamic require of "' + pt + '" is not supported'); }), ue = (pt, ne) => () => (ne || pt((ne = { exports: {} }).exports, ne), ne.exports), fe$1 = (pt, ne, yt, ir) => { if (ne && typeof ne == "object" || typeof ne == "function") for (let io of le$1(ne)) !pe.call(pt, io) && io !== yt && ut$1(pt, io, { get: () => ne[io], enumerable: !(ir = se$1(ne, io)) || ir.enumerable }); return pt; }, he$1 = (pt, ne, yt) => (yt = pt != null ? ae$1(ce$1(pt)) : {}, fe$1( // If the importer is in node compatibility mode or this is not an ESM // file that has been converted to a CommonJS file using a Babel- // compatible transform (i.e. "__esModule" has not been set), then set // "default" to the CommonJS "module.exports" for node compatibility. ut$1(yt, "default", { value: pt, enumerable: !0 }), pt )), xt$1 = ue((pt, ne) => { (function(yt) { if (typeof pt == "object" && typeof ne < "u") ne.exports = yt(); else if (typeof define == "function" && define.amd) define([], yt); else { var ir; typeof window < "u" ? ir = window : typeof global < "u" ? ir = global : typeof self < "u" ? ir = self : ir = this, ir.memoizerific = yt(); } })(function() { return (/* @__PURE__ */ a(function yt(ir, io, uo) { function fo(Oo, Io) { if (!io[Oo]) { if (!ir[Oo]) { var _o = typeof H$1 == "function" && H$1; if (!Io && _o) return _o(Oo, !0); if (Co) return Co(Oo, !0); var Po = new Error("Cannot find module '" + Oo + "'"); throw Po.code = "MODULE_NOT_FOUND", Po; } var Lo = io[Oo] = { exports: {} }; ir[Oo][0].call(Lo.exports, function(Mo) { var Ho = ir[Oo][1][Mo]; return fo(Ho || Mo); }, Lo, Lo.exports, yt, ir, io, uo); } return io[Oo].exports; } a(fo, "s"); for (var Co = typeof H$1 == "function" && H$1, xo = 0; xo < uo.length; xo++) fo(uo[xo]); return fo; }, "e"))({ 1: [function(yt, ir, io) { ir.exports = function(uo) { if (typeof Map != "function" || uo) { var fo = yt("./similar"); return new fo(); } else return /* @__PURE__ */ new Map(); }; }, { "./similar": 2 }], 2: [function(yt, ir, io) { function uo() { return this.list = [], this.lastItem = void 0, this.size = 0, this; } a(uo, "Similar"), uo.prototype.get = function(fo) { var Co; if (this.lastItem && this.isEqual(this.lastItem.key, fo)) return this.lastItem.val; if (Co = this.indexOf(fo), Co >= 0) return this.lastItem = this.list[Co], this.list[Co].val; }, uo.prototype.set = function(fo, Co) { var xo; return this.lastItem && this.isEqual(this.lastItem.key, fo) ? (this.lastItem.val = Co, this) : (xo = this.indexOf(fo), xo >= 0 ? (this.lastItem = this.list[xo], this.list[xo].val = Co, this) : (this.lastItem = { key: fo, val: Co }, this.list.push(this.lastItem), this.size++, this)); }, uo.prototype.delete = function(fo) { var Co; if (this.lastItem && this.isEqual(this.lastItem.key, fo) && (this.lastItem = void 0), Co = this.indexOf(fo), Co >= 0) return this.size--, this.list.splice(Co, 1)[0]; }, uo.prototype.has = function(fo) { var Co; return this.lastItem && this.isEqual(this.lastItem.key, fo) ? !0 : (Co = this.indexOf(fo), Co >= 0 ? (this.lastItem = this.list[Co], !0) : !1); }, uo.prototype.forEach = function(fo, Co) { var xo; for (xo = 0; xo < this.size; xo++) fo.call(Co || this, this.list[xo].val, this.list[xo].key, this); }, uo.prototype.indexOf = function(fo) { var Co; for (Co = 0; Co < this.size; Co++) if (this.isEqual(this.list[Co].key, fo)) return Co; return -1; }, uo.prototype.isEqual = function(fo, Co) { return fo === Co || fo !== fo && Co !== Co; }, ir.exports = uo; }, {}], 3: [function(yt, ir, io) { var uo = yt("map-or-similar"); ir.exports = function(Oo) { var Io = new uo(!1), _o = []; return function(Po) { var Lo = /* @__PURE__ */ a(function() { var Mo = Io, Ho, qo, Vo = arguments.length - 1, jo = Array(Vo + 1), Uo = !0, zo; if ((Lo.numArgs || Lo.numArgs === 0) && Lo.numArgs !== Vo + 1) throw new Error("Memoizerific functions should always be called with the same number of arguments"); for (zo = 0; zo < Vo; zo++) { if (jo[zo] = { cacheItem: Mo, arg: arguments[zo] }, Mo.has(arguments[zo])) { Mo = Mo.get(arguments[zo]); continue; } Uo = !1, Ho = new uo(!1), Mo.set(arguments[zo], Ho), Mo = Ho; } return Uo && (Mo.has(arguments[Vo]) ? qo = Mo.get(arguments[Vo]) : Uo = !1), Uo || (qo = Po.apply(null, arguments), Mo.set(arguments[Vo], qo)), Oo > 0 && (jo[Vo] = { cacheItem: Mo, arg: arguments[Vo] }, Uo ? fo(_o, jo) : _o.push(jo), _o.length > Oo && Co(_o.shift())), Lo.wasMemoized = Uo, Lo.numArgs = Vo + 1, qo; }, "memoizerific"); return Lo.limit = Oo, Lo.wasMemoized = !1, Lo.cache = Io, Lo.lru = _o, Lo; }; }; function fo(Oo, Io) { var _o = Oo.length, Po = Io.length, Lo, Mo, Ho; for (Mo = 0; Mo < _o; Mo++) { for (Lo = !0, Ho = 0; Ho < Po; Ho++) if (!xo(Oo[Mo][Ho].arg, Io[Ho].arg)) { Lo = !1; break; } if (Lo) break; } Oo.push(Oo.splice(Mo, 1)[0]); } a(fo, "moveToMostRecentLru"); function Co(Oo) { var Io = Oo.length, _o = Oo[Io - 1], Po, Lo; for (_o.cacheItem.delete(_o.arg), Lo = Io - 2; Lo >= 0 && (_o = Oo[Lo], Po = _o.cacheItem.get(_o.arg), !Po || !Po.size); Lo--) _o.cacheItem.delete(_o.arg); } a(Co, "removeCachedResult"); function xo(Oo, Io) { return Oo === Io || Oo !== Oo && Io !== Io; } a(xo, "isEqual"); }, { "map-or-similar": 1 }] }, {}, [3])(3); }); }), S$1 = (() => { let pt; return typeof window < "u" ? pt = window : typeof globalThis < "u" ? pt = globalThis : typeof global < "u" ? pt = global : typeof self < "u" ? pt = self : pt = {}, pt; })(); function F$1(pt) { for (var ne = [], yt = 1; yt < arguments.length; yt++) ne[yt - 1] = arguments[yt]; var ir = Array.from(typeof pt == "string" ? [pt] : pt); ir[ir.length - 1] = ir[ir.length - 1].replace(/\r?\n([\t ]*)$/, ""); var io = ir.reduce(function(Co, xo) { var Oo = xo.match(/\n([\t ]+|(?!\s).)/g); return Oo ? Co.concat(Oo.map(function(Io) { var _o, Po; return (Po = (_o = Io.match(/[\t ]/g)) === null || _o === void 0 ? void 0 : _o.length) !== null && Po !== void 0 ? Po : 0; })) : Co; }, []); if (io.length) { var uo = new RegExp(` [ ]{` + Math.min.apply(Math, io) + "}", "g"); ir = ir.map(function(Co) { return Co.replace(uo, ` `); }); } ir[0] = ir[0].replace(/^\r?\n/, ""); var fo = ir[0]; return ne.forEach(function(Co, xo) { var Oo = fo.match(/(?:^|\n)( *)$/), Io = Oo ? Oo[1] : "", _o = Co; typeof Co == "string" && Co.includes(` `) && (_o = String(Co).split(` `).map(function(Po, Lo) { return Lo === 0 ? Po : "" + Io + Po; }).join(` `)), fo += _o + ir[xo + 1]; }), fo; } a(F$1, "dedent"); var ft = /* @__PURE__ */ new Map(), ye = "UNIVERSAL_STORE:", x$1 = { PENDING: "PENDING", RESOLVED: "RESOLVED", REJECTED: "REJECTED" }, h = class rs { constructor(ne, yt) { if (this.debugging = !1, this.listeners = /* @__PURE__ */ new Map([["*", /* @__PURE__ */ new Set()]]), this.getState = /* @__PURE__ */ a(() => (this.debug("getState", { state: this.state }), this.state), "getState"), this.subscribe = /* @__PURE__ */ a((ir, io) => { let uo = typeof ir == "function", fo = uo ? "*" : ir, Co = uo ? ir : io; if (this.debug("subscribe", { eventType: fo, listener: Co }), !Co) throw new TypeError( `Missing first subscribe argument, or second if first is the event type, when subscribing to a UniversalStore with id '${this.id}'` ); return this.listeners.has(fo) || this.listeners.set(fo, /* @__PURE__ */ new Set()), this.listeners.get(fo).add(Co), () => { var xo; this.debug("unsubscribe", { eventType: fo, listener: Co }), this.listeners.has(fo) && (this.listeners.get(fo).delete(Co), ((xo = this.listeners.get(fo)) == null ? void 0 : xo.size) === 0 && this.listeners.delete(fo)); }; }, "subscribe"), this.send = /* @__PURE__ */ a((ir) => { if (this.debug("send", { event: ir }), this.status !== rs.Status.READY) throw new TypeError( F$1`Cannot send event before store is ready. You can get the current status with store.status, or await store.readyPromise to wait for the store to be ready before sending events. ${JSON.stringify( { event: ir, id: this.id, actor: this.actor, environment: this.environment }, null, 2 )}` ); this.emitToListeners(ir, { actor: this.actor }), this.emitToChannel(ir, { actor: this.actor }); }, "send"), this.debugging = ne.debug ?? !1, !rs.isInternalConstructing) throw new TypeError( "UniversalStore is not constructable - use UniversalStore.create() instead" ); if (rs.isInternalConstructing = !1, this.id = ne.id, this.actorId = Date.now().toString(36) + Math.random().toString(36).substring(2), this.actorType = ne.leader ? rs.ActorType.LEADER : rs.ActorType.FOLLOWER, this.state = ne.initialState, this.channelEventName = `${ye}${this.id}`, this.debug("constructor", { options: ne, environmentOverrides: yt, channelEventName: this.channelEventName }), this.actor.type === rs.ActorType.LEADER) this.syncing = { state: x$1.RESOLVED, promise: Promise.resolve() }; else { let ir, io, uo = new Promise((fo, Co) => { ir = /* @__PURE__ */ a(() => { this.syncing.state === x$1.PENDING && (this.syncing.state = x$1.RESOLVED, fo()); }, "syncingResolve"), io = /* @__PURE__ */ a((xo) => { this.syncing.state === x$1.PENDING && (this.syncing.state = x$1.REJECTED, Co(xo)); }, "syncingReject"); }); this.syncing = { state: x$1.PENDING, promise: uo, resolve: ir, reject: io }; } 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 = (yt == null ? void 0 : yt.channel) ?? rs.preparation.channel, this.environment = (yt == null ? void 0 : yt.environment) ?? rs.preparation.environment, this.channel && this.environment ? this.prepareThis({ channel: this.channel, environment: this.environment }) : rs.preparation.promise.then(this.prepareThis); } static setupPreparationPromise() { let ne, yt, ir = new Promise( (io, uo) => { ne = /* @__PURE__ */ a((fo) => { io(fo); }, "resolveRef"), yt = /* @__PURE__ */ a((...fo) => { uo(fo); }, "rejectRef"); } ); rs.preparation = { resolve: ne, reject: yt, promise: ir }; } /** The actor object representing the store instance with a unique ID and a type */ get actor() { return Object.freeze({ id: this.actorId, type: this.actorType, environment: this.environment ?? rs.Environment.UNKNOWN }); } /** * The current state of the store, that signals both if the store is prepared by Storybook and * also - in the case of a follower - if the state has been synced with the leader's state. */ get status() { var ne; if (!this.channel || !this.environment) return rs.Status.UNPREPARED; switch ((ne = this.syncing) == null ? void 0 : ne.state) { case x$1.PENDING: case void 0: return rs.Status.SYNCING; case x$1.REJECTED: return rs.Status.ERROR; case x$1.RESOLVED: default: return rs.Status.READY; } } /** * A promise that resolves when the store is fully ready. A leader will be ready when the store * has been prepared by Storybook, which is almost instantly. * * A follower will be ready when the state has been synced with the leader's state, within a few * hundred milliseconds. */ untilReady() { var ne; return Promise.all([rs.preparation.promise, (ne = this.syncing) == null ? void 0 : ne.promise]); } /** Creates a new instance of UniversalStore */ static create(ne) { if (!ne || typeof (ne == null ? void 0 : ne.id) != "string") throw new TypeError("id is required and must be a string, when creating a UniversalStore"); ne.debug && console.debug( F$1`[UniversalStore] create`, { options: ne } ); let yt = ft.get(ne.id); if (yt) return console.warn(F$1`UniversalStore with id "${ne.id}" already exists in this environment, re-using existing. You should reuse the existing instance instead of trying to create a new one.`), yt; rs.isInternalConstructing = !0; let ir = new rs(ne); return ft.set(ne.id, ir), ir; } /** * Used by Storybook to set the channel for all instances of UniversalStore in the given * environment. * * @internal */ static __prepare(ne, yt) { rs.preparation.channel = ne, rs.preparation.environment = yt, rs.preparation.resolve({ channel: ne, environment: yt }); } /** * Updates the store's state * * Either a new state or a state updater function can be passed to the method. */ setState(ne) { let yt = this.state, ir = typeof ne == "function" ? ne(yt) : ne; if (this.debug("setState", { newState: ir, previousState: yt, updater: ne }), this.status !== rs.Status.READY) throw new TypeError( F$1`Cannot set state before store is ready. You can get the current status with store.status, or await store.readyPromise to wait for the store to be ready before sending events. ${JSON.stringify( { newState: ir, id: this.id, actor: this.actor, environment: this.environment }, null, 2 )}` ); this.state = ir; let io = { type: rs.InternalEventType.SET_STATE, payload: { state: ir, previousState: yt } }; this.emitToChannel(io, { actor: this.actor }), this.emitToListeners(io, { actor: this.actor }); } /** * Subscribes to state changes * * @returns Unsubscribe function */ onStateChange(ne) { return this.debug("onStateChange", { listener: ne }), this.subscribe( rs.InternalEventType.SET_STATE, ({ payload: yt }, ir) => { ne(yt.state, yt.previousState, ir); } ); } emitToChannel(ne, yt) { var ir; this.debug("emitToChannel", { event: ne, eventInfo: yt, channel: this.channel }), (ir = this.channel) == null || ir.emit(this.channelEventName, { event: ne, eventInfo: yt }); } prepareThis({ channel: ne, environment: yt }) { this.channel = ne, this.environment = yt, this.debug("prepared", { channel: ne, environment: yt }), this.channel.on(this.channelEventName, this.handleChannelEvents), this.actor.type === rs.ActorType.LEADER ? this.emitToChannel( { type: rs.InternalEventType.LEADER_CREATED }, { actor: this.actor } ) : (this.emitToChannel( { type: rs.InternalEventType.FOLLOWER_CREATED }, { actor: this.actor } ), this.emitToChannel( { type: rs.InternalEventType.EXISTING_STATE_REQUEST }, { actor: this.actor } ), setTimeout(() => { this.syncing.reject( new TypeError( `No existing state found for follower with id: '${this.id}'. Make sure a leader with the same id exists before creating a follower.` ) ); }, 1e3)); } emitToListeners(ne, yt) { let ir = this.listeners.get(ne.type), io = this.listeners.get("*"); this.debug("emitToListeners", { event: ne, eventInfo: yt, eventTypeListeners: ir, everythingListeners: io }), [...ir ?? [], ...io ?? []].forEach( (uo) => uo(ne, yt) ); } handleChannelEvents(ne) { var io, uo, fo, Co, xo; let { event: yt, eventInfo: ir } = ne; if ([ir.actor.id, (io = ir.forwardingActor) == null ? void 0 : io.id].includes(this.actor.id)) { this.debug("handleChannelEvents: Ignoring event from self", { channelEvent: ne }); return; } else if (((uo = this.syncing) == null ? void 0 : uo.state) === x$1.PENDING && yt.type !== rs.InternalEventType.EXISTING_STATE_RESPONSE) { this.debug("handleChannelEvents: Ignoring event while syncing", { channelEvent: ne }); return; } if (this.debug("handleChannelEvents", { channelEvent: ne }), this.actor.type === rs.ActorType.LEADER) { let Oo = !0; switch (yt.type) { case rs.InternalEventType.EXISTING_STATE_REQUEST: Oo = !1; let Io = { type: rs.InternalEventType.EXISTING_STATE_RESPONSE, payload: this.state }; this.debug("handleChannelEvents: responding to existing state request", { responseEvent: Io }), this.emitToChannel(Io, { actor: this.actor }); break; case rs.InternalEventType.LEADER_CREATED: Oo = !1, this.syncing.state = x$1.REJECTED, this.debug("handleChannelEvents: erroring due to second leader being created", { event: yt }), console.error( F$1`Detected multiple UniversalStore leaders created with the same id "${this.id}". Only one leader can exists at a time, your stores are now in an invalid state. Leaders detected: this: ${JSON.stringify(this.actor, null, 2)} other: ${JSON.stringify(ir.actor, null, 2)}` ); break; } Oo && (this.debug("handleChannelEvents: forwarding event", { channelEvent: ne }), this.emitToChannel(yt, { actor: ir.actor, forwardingActor: this.actor })); } if (this.actor.type === rs.ActorType.FOLLOWER) switch (yt.type) { case rs.InternalEventType.EXISTING_STATE_RESPONSE: if (this.debug("handleChannelEvents: Setting state from leader's existing state response", { event: yt }), ((fo = this.syncing) == null ? void 0 : fo.state) !== x$1.PENDING) break; (xo = (Co = this.syncing).resolve) == null || xo.call(Co); let Oo = { type: rs.InternalEventType.SET_STATE, payload: { state: yt.payload, previousState: this.state } }; this.state = yt.payload, this.emitToListeners(Oo, ir); break; } switch (yt.type) { case rs.InternalEventType.SET_STATE: this.debug("handleChannelEvents: Setting state", { event: yt }), this.state = yt.payload.state; break; } this.emitToListeners(yt, { actor: ir.actor }); } debug(ne, yt) { this.debugging && console.debug( F$1`[UniversalStore::${this.id}::${this.environment ?? rs.Environment.UNKNOWN}] ${ne}`, JSON.stringify( { data: yt, actor: this.actor, state: this.state, status: this.status }, null, 2 ) ); } /** * Used to reset the static fields of the UniversalStore class when cleaning up tests * * @internal */ static __reset() { rs.preparation.reject(new Error("reset")), rs.setupPreparationPromise(), rs.isInternalConstructing = !1; } }; a(h, "UniversalStore"), /** * Defines the possible actor types in the store system * * @readonly */ h.ActorType = { LEADER: "LEADER", FOLLOWER: "FOLLOWER" }, /** * Defines the possible environments the store can run in * * @readonly */ h.Environment = { SERVER: "SERVER", MANAGER: "MANAGER", PREVIEW: "PREVIEW", UNKNOWN: "UNKNOWN", MOCK: "MOCK" }, /** * Internal event types used for store synchronization * * @readonly */ h.InternalEventType = { EXISTING_STATE_REQUEST: "__EXISTING_STATE_REQUEST", EXISTING_STATE_RESPONSE: "__EXISTING_STATE_RESPONSE", SET_STATE: "__SET_STATE", LEADER_CREATED: "__LEADER_CREATED", FOLLOWER_CREATED: "__FOLLOWER_CREATED" }, h.Status = { UNPREPARED: "UNPREPARED", SYNCING: "SYNCING", READY: "READY", ERROR: "ERROR" }, // This is used to check if constructor was called from the static factory create() h.isInternalConstructing = !1, h.setupPreparationPromise(); var $$1 = h, de = /* @__PURE__ */ a((pt) => pt.transports !== void 0, "isMulti"), ge$1 = /* @__PURE__ */ a(() => Math.random().toString(16).slice(2), "generateRandomId"), ht$1 = class { constructor(ne = {}) { this.sender = ge$1(), this.events = {}, this.data = {}, this.transports = [], this.isAsync = ne.async || !1, de(ne) ? (this.transports = ne.transports || [], this.transports.forEach((yt) => { yt.setHandler((ir) => this.handleEvent(ir)); })) : this.transports = ne.transport ? [ne.transport] : [], this.transports.forEach((yt) => { yt.setHandler((ir) => this.handleEvent(ir)); }); } get hasTransport() { return this.transports.length > 0; } addListener(ne, yt) { this.events[ne] = this.events[ne] || [], this.events[ne].push(yt); } emit(ne, ...yt) { let ir = { type: ne, args: yt, from: this.sender }, io = {}; yt.length >= 1 && yt[0] && yt[0].options && (io = yt[0].options); let uo = /* @__PURE__ */ a(() => { this.transports.forEach((fo) => { fo.send(ir, io); }), this.handleEvent(ir); }, "handler"); this.isAsync ? setImmediate(uo) : uo(); } last(ne) { return this.data[ne]; } eventNames() { return Object.keys(this.events); } listenerCount(ne) { let yt = this.listeners(ne); return yt ? yt.length : 0; } listeners(ne) { return this.events[ne] || void 0; } once(ne, yt) { let ir = this.onceListener(ne, yt); this.addListener(ne, ir); } removeAllListeners(ne) { ne ? this.events[ne] && delete this.events[ne] : this.events = {}; } removeListener(ne, yt) { let ir = this.listeners(ne); ir && (this.events[ne] = ir.filter((io) => io !== yt)); } on(ne, yt) { this.addListener(ne, yt); } off(ne, yt) { this.removeListener(ne, yt); } handleEvent(ne) { let yt = this.listeners(ne.type); yt && yt.length && yt.forEach((ir) => { ir.apply(ne, ne.args); }), this.data[ne.type] = ne.args; } onceListener(ne, yt) { let ir = /* @__PURE__ */ a((...io) => (this.removeListener(ne, ir), yt(...io)), "onceListener"); return ir; } }; a(ht$1, "Channel"); var B = ht$1, ve$1 = Object.create, Ot$1 = Object.defineProperty, me$1 = Object.getOwnPropertyDescriptor, Ct$1 = Object.getOwnPropertyNames, Ee$1 = Object.getPrototypeOf, be$1 = Object.prototype.hasOwnProperty, P$2 = /* @__PURE__ */ a((pt, ne) => /* @__PURE__ */ a(function() { return ne || (0, pt[Ct$1(pt)[0]])((ne = { exports: {} }).exports, ne), ne.exports; }, "__require"), "__commonJS"), Se$1 = /* @__PURE__ */ a((pt, ne, yt, ir) => { if (ne && typeof ne == "object" || typeof ne == "function") for (let io of Ct$1(ne)) !be$1.call(pt, io) && io !== yt && Ot$1(pt, io, { get: /* @__PURE__ */ a(() => ne[io], "get"), enumerable: !(ir = me$1(ne, io)) || ir.enumerable }); return pt; }, "__copyProps"), ot$1 = /* @__PURE__ */ a((pt, ne, yt) => (yt = pt != null ? ve$1(Ee$1(pt)) : {}, Se$1( ne || !pt || !pt.__esModule ? Ot$1(yt, "default", { value: pt, enumerable: !0 }) : yt, pt )), "__toESM"), _e$1 = [ "bubbles", "cancelBubble", "cancelable", "composed", "currentTarget", "defaultPrevented", "eventPhase", "isTrusted", "returnValue", "srcElement", "target", "timeStamp", "type" ], Te$1 = ["detail"]; function Pt(pt) { let ne = _e$1.filter((yt) => pt[yt] !== void 0).reduce((yt, ir) => ({ ...yt, [ir]: pt[ir] }), {}); return pt instanceof CustomEvent && Te$1.filter((yt) => pt[yt] !== void 0).forEach((yt) => { ne[yt] = pt[yt]; }), ne; } a(Pt, "extractEventHiddenProperties"); var Bt$1 = he$1(xt$1()), Ft = P$2({ "node_modules/has-symbols/shams.js"(pt, ne) { ne.exports = /* @__PURE__ */ a(function() { if (typeof Symbol != "function" || typeof Object.getOwnPropertySymbols != "function") return !1; if (typeof Symbol.iterator == "symbol") return !0; var yt = {}, ir = Symbol("test"), io = Object(ir); if (typeof ir == "string" || Object.prototype.toString.call(ir) !== "[object Symbol]" || Object.prototype.toString.call(io) !== "[object Symbol]") return !1; var uo = 42; yt[ir] = uo; for (ir in yt) return !1; if (typeof Object.keys == "function" && Object.keys(yt).length !== 0 || typeof Object.getOwnPropertyNames == "function" && Object.getOwnPropertyNames( yt ).length !== 0) return !1; var fo = Object.getOwnPropertySymbols(yt); if (fo.length !== 1 || fo[0] !== ir || !Object.prototype.propertyIsEnumerable.call(yt, ir)) return !1; if (typeof Object.getOwnPropertyDescriptor == "function") { var Co = Object.getOwnPropertyDescriptor(yt, ir); if (Co.value !== uo || Co.enumerable !== !0) return !1; } return !0; }, "hasSymbols"); } }), Mt$1 = P$2({ "node_modules/has-symbols/index.js"(pt, ne) { var yt = typeof Symbol < "u" && Symbol, ir = Ft(); ne.exports = /* @__PURE__ */ a(function() { return typeof yt != "function" || typeof Symbol != "function" || typeof yt("foo") != "symbol" || typeof Symbol("bar") != "symbol" ? !1 : ir(); }, "hasNativeSymbols"); } }), Ae$1 = P$2({ "node_modules/function-bind/implementation.js"(pt, ne) { var yt = "Function.prototype.bind called on incompatible ", ir = Array.prototype.slice, io = Object.prototype.toString, uo = "[object Function]"; ne.exports = /* @__PURE__ */ a(function(fo) { var Co = this; if (typeof Co != "function" || io.call(Co) !== uo) throw new TypeError(yt + Co); for (var xo = ir.call(arguments, 1), Oo, Io = /* @__PURE__ */ a(function() { if (this instanceof Oo) { var Ho = Co.apply( this, xo.concat(ir.call(arguments)) ); return Object(Ho) === Ho ? Ho : this; } else return Co.apply( fo, xo.concat(ir.call(arguments)) ); }, "binder"), _o = Math.max(0, Co.length - xo.length), Po = [], Lo = 0; Lo < _o; Lo++) Po.push("$" + Lo); if (Oo = Function("binder", "return function (" + Po.join(",") + "){ return binder.apply(this,arguments); }")(Io), Co.prototype) { var Mo = /* @__PURE__ */ a(function() { }, "Empty2"); Mo.prototype = Co.prototype, Oo.prototype = new Mo(), Mo.prototype = null; } return Oo; }, "bind"); } }), gt$1 = P$2({ "node_modules/function-bind/index.js"(pt, ne) { var yt = Ae$1(); ne.exports = Function.prototype.bind || yt; } }), we$1 = P$2({ "node_modules/has/src/index.js"(pt, ne) { var yt = gt$1(); ne.exports = yt.call(Function.call, Object.prototype.hasOwnProperty); } }), $t$1 = P$2({ "node_modules/get-intrinsic/index.js"(