@stonecrop/stonecrop 0.4.37 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. package/README.md +92 -3
  2. package/dist/src/composable.d.ts +74 -8
  3. package/dist/src/composable.d.ts.map +1 -1
  4. package/dist/src/composable.js +348 -0
  5. package/dist/src/composables/operation-log.d.ts +136 -0
  6. package/dist/src/composables/operation-log.d.ts.map +1 -0
  7. package/dist/src/composables/operation-log.js +221 -0
  8. package/dist/src/doctype.d.ts +9 -1
  9. package/dist/src/doctype.d.ts.map +1 -1
  10. package/dist/{doctype.js → src/doctype.js} +9 -3
  11. package/dist/src/field-triggers.d.ts +178 -0
  12. package/dist/src/field-triggers.d.ts.map +1 -0
  13. package/dist/src/field-triggers.js +564 -0
  14. package/dist/src/index.d.ts +12 -4
  15. package/dist/src/index.d.ts.map +1 -1
  16. package/dist/src/index.js +18 -0
  17. package/dist/src/plugins/index.d.ts +11 -13
  18. package/dist/src/plugins/index.d.ts.map +1 -1
  19. package/dist/src/plugins/index.js +90 -0
  20. package/dist/src/registry.d.ts +9 -3
  21. package/dist/src/registry.d.ts.map +1 -1
  22. package/dist/{registry.js → src/registry.js} +14 -1
  23. package/dist/src/stonecrop.d.ts +350 -114
  24. package/dist/src/stonecrop.d.ts.map +1 -1
  25. package/dist/src/stonecrop.js +251 -0
  26. package/dist/src/stores/hst.d.ts +157 -0
  27. package/dist/src/stores/hst.d.ts.map +1 -0
  28. package/dist/src/stores/hst.js +483 -0
  29. package/dist/src/stores/index.d.ts +5 -1
  30. package/dist/src/stores/index.d.ts.map +1 -1
  31. package/dist/{stores → src/stores}/index.js +4 -1
  32. package/dist/src/stores/operation-log.d.ts +268 -0
  33. package/dist/src/stores/operation-log.d.ts.map +1 -0
  34. package/dist/src/stores/operation-log.js +571 -0
  35. package/dist/src/types/field-triggers.d.ts +186 -0
  36. package/dist/src/types/field-triggers.d.ts.map +1 -0
  37. package/dist/src/types/field-triggers.js +4 -0
  38. package/dist/src/types/index.d.ts +13 -2
  39. package/dist/src/types/index.d.ts.map +1 -1
  40. package/dist/src/types/index.js +4 -0
  41. package/dist/src/types/operation-log.d.ts +165 -0
  42. package/dist/src/types/operation-log.d.ts.map +1 -0
  43. package/dist/src/types/registry.d.ts +11 -0
  44. package/dist/src/types/registry.d.ts.map +1 -0
  45. package/dist/src/types/registry.js +0 -0
  46. package/dist/stonecrop.d.ts +1555 -159
  47. package/dist/stonecrop.js +1974 -7028
  48. package/dist/stonecrop.js.map +1 -1
  49. package/dist/stonecrop.umd.cjs +4 -8
  50. package/dist/stonecrop.umd.cjs.map +1 -1
  51. package/dist/tests/setup.d.ts +5 -0
  52. package/dist/tests/setup.d.ts.map +1 -0
  53. package/dist/tests/setup.js +15 -0
  54. package/package.json +6 -5
  55. package/src/composable.ts +481 -31
  56. package/src/composables/operation-log.ts +254 -0
  57. package/src/doctype.ts +9 -3
  58. package/src/field-triggers.ts +671 -0
  59. package/src/index.ts +50 -4
  60. package/src/plugins/index.ts +70 -22
  61. package/src/registry.ts +18 -3
  62. package/src/stonecrop.ts +246 -155
  63. package/src/stores/hst.ts +703 -0
  64. package/src/stores/index.ts +6 -1
  65. package/src/stores/operation-log.ts +671 -0
  66. package/src/types/field-triggers.ts +201 -0
  67. package/src/types/index.ts +17 -6
  68. package/src/types/operation-log.ts +205 -0
  69. package/src/types/registry.ts +10 -0
  70. package/dist/composable.js +0 -50
  71. package/dist/index.js +0 -6
  72. package/dist/plugins/index.js +0 -49
  73. package/dist/src/stores/data.d.ts +0 -11
  74. package/dist/src/stores/data.d.ts.map +0 -1
  75. package/dist/stores/data.js +0 -7
  76. package/src/stores/data.ts +0 -8
  77. /package/dist/{exceptions.js → src/exceptions.js} +0 -0
  78. /package/dist/{types/index.js → src/types/operation-log.js} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"stonecrop.js","sources":["../../common/temp/node_modules/.pnpm/xstate@5.20.1/node_modules/xstate/dev/dist/xstate-dev.esm.js","../../common/temp/node_modules/.pnpm/xstate@5.20.1/node_modules/xstate/dist/raise-b0a4e862.esm.js","../../common/temp/node_modules/.pnpm/xstate@5.20.1/node_modules/xstate/dist/assign-c3259787.esm.js","../../common/temp/node_modules/.pnpm/xstate@5.20.1/node_modules/xstate/dist/StateMachine-c88ea5dd.esm.js","../../common/temp/node_modules/.pnpm/xstate@5.20.1/node_modules/xstate/dist/xstate.esm.js","../src/exceptions.ts","../src/stonecrop.ts","../../common/temp/node_modules/.pnpm/@vue+devtools-shared@7.7.7/node_modules/@vue/devtools-shared/dist/index.js","../../common/temp/node_modules/.pnpm/perfect-debounce@1.0.0/node_modules/perfect-debounce/dist/index.mjs","../../common/temp/node_modules/.pnpm/hookable@5.5.3/node_modules/hookable/dist/index.mjs","../../common/temp/node_modules/.pnpm/@vue+devtools-kit@7.7.7/node_modules/@vue/devtools-kit/dist/index.js","../../common/temp/node_modules/.pnpm/pinia@3.0.3_typescript@5.9.3_vue@3.5.22_typescript@5.9.3_/node_modules/pinia/dist/pinia.mjs","../src/stores/data.ts","../src/composable.ts","../src/doctype.ts","../src/registry.ts","../../common/temp/node_modules/.pnpm/broadcast-channel@7.1.0/node_modules/broadcast-channel/dist/esbrowser/util.js","../../common/temp/node_modules/.pnpm/broadcast-channel@7.1.0/node_modules/broadcast-channel/dist/esbrowser/methods/native.js","../../common/temp/node_modules/.pnpm/oblivious-set@1.4.0/node_modules/oblivious-set/dist/esm/src/index.js","../../common/temp/node_modules/.pnpm/broadcast-channel@7.1.0/node_modules/broadcast-channel/dist/esbrowser/options.js","../../common/temp/node_modules/.pnpm/broadcast-channel@7.1.0/node_modules/broadcast-channel/dist/esbrowser/methods/indexed-db.js","../../common/temp/node_modules/.pnpm/broadcast-channel@7.1.0/node_modules/broadcast-channel/dist/esbrowser/methods/localstorage.js","../../common/temp/node_modules/.pnpm/broadcast-channel@7.1.0/node_modules/broadcast-channel/dist/esbrowser/methods/simulate.js","../../common/temp/node_modules/.pnpm/broadcast-channel@7.1.0/node_modules/broadcast-channel/dist/esbrowser/method-chooser.js","../../common/temp/node_modules/.pnpm/broadcast-channel@7.1.0/node_modules/broadcast-channel/dist/esbrowser/broadcast-channel.js","../../common/temp/node_modules/.pnpm/pinia-shared-state@1.0.1_pinia@3.0.3_typescript@5.9.3_vue@3.5.22_typescript@5.9.3__/node_modules/pinia-shared-state/dist/index.js","../src/stores/index.ts","../src/plugins/index.ts"],"sourcesContent":["// From https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/globalThis\nfunction getGlobal() {\n if (typeof globalThis !== 'undefined') {\n return globalThis;\n }\n if (typeof self !== 'undefined') {\n return self;\n }\n if (typeof window !== 'undefined') {\n return window;\n }\n if (typeof global !== 'undefined') {\n return global;\n }\n}\nfunction getDevTools() {\n const w = getGlobal();\n if (w.__xstate__) {\n return w.__xstate__;\n }\n return undefined;\n}\nfunction registerService(service) {\n if (typeof window === 'undefined') {\n return;\n }\n const devTools = getDevTools();\n if (devTools) {\n devTools.register(service);\n }\n}\nconst devToolsAdapter = service => {\n if (typeof window === 'undefined') {\n return;\n }\n const devTools = getDevTools();\n if (devTools) {\n devTools.register(service);\n }\n};\n\nexport { devToolsAdapter, getGlobal, registerService };\n","import { devToolsAdapter } from '../dev/dist/xstate-dev.esm.js';\n\nclass Mailbox {\n constructor(_process) {\n this._process = _process;\n this._active = false;\n this._current = null;\n this._last = null;\n }\n start() {\n this._active = true;\n this.flush();\n }\n clear() {\n // we can't set _current to null because we might be currently processing\n // and enqueue following clear shouldn't start processing the enqueued item immediately\n if (this._current) {\n this._current.next = null;\n this._last = this._current;\n }\n }\n enqueue(event) {\n const enqueued = {\n value: event,\n next: null\n };\n if (this._current) {\n this._last.next = enqueued;\n this._last = enqueued;\n return;\n }\n this._current = enqueued;\n this._last = enqueued;\n if (this._active) {\n this.flush();\n }\n }\n flush() {\n while (this._current) {\n // atm the given _process is responsible for implementing proper try/catch handling\n // we assume here that this won't throw in a way that can affect this mailbox\n const consumed = this._current;\n this._process(consumed.value);\n this._current = consumed.next;\n }\n this._last = null;\n }\n}\n\nconst STATE_DELIMITER = '.';\nconst TARGETLESS_KEY = '';\nconst NULL_EVENT = '';\nconst STATE_IDENTIFIER = '#';\nconst WILDCARD = '*';\nconst XSTATE_INIT = 'xstate.init';\nconst XSTATE_ERROR = 'xstate.error';\nconst XSTATE_STOP = 'xstate.stop';\n\n/**\n * Returns an event that represents an implicit event that is sent after the\n * specified `delay`.\n *\n * @param delayRef The delay in milliseconds\n * @param id The state node ID where this event is handled\n */\nfunction createAfterEvent(delayRef, id) {\n return {\n type: `xstate.after.${delayRef}.${id}`\n };\n}\n\n/**\n * Returns an event that represents that a final state node has been reached in\n * the parent state node.\n *\n * @param id The final state node's parent state node `id`\n * @param output The data to pass into the event\n */\nfunction createDoneStateEvent(id, output) {\n return {\n type: `xstate.done.state.${id}`,\n output\n };\n}\n\n/**\n * Returns an event that represents that an invoked service has terminated.\n *\n * An invoked service is terminated when it has reached a top-level final state\n * node, but not when it is canceled.\n *\n * @param invokeId The invoked service ID\n * @param output The data to pass into the event\n */\nfunction createDoneActorEvent(invokeId, output) {\n return {\n type: `xstate.done.actor.${invokeId}`,\n output,\n actorId: invokeId\n };\n}\nfunction createErrorActorEvent(id, error) {\n return {\n type: `xstate.error.actor.${id}`,\n error,\n actorId: id\n };\n}\nfunction createInitEvent(input) {\n return {\n type: XSTATE_INIT,\n input\n };\n}\n\n/**\n * This function makes sure that unhandled errors are thrown in a separate\n * macrotask. It allows those errors to be detected by global error handlers and\n * reported to bug tracking services without interrupting our own stack of\n * execution.\n *\n * @param err Error to be thrown\n */\nfunction reportUnhandledError(err) {\n setTimeout(() => {\n throw err;\n });\n}\n\nconst symbolObservable = (() => typeof Symbol === 'function' && Symbol.observable || '@@observable')();\n\nfunction matchesState(parentStateId, childStateId) {\n const parentStateValue = toStateValue(parentStateId);\n const childStateValue = toStateValue(childStateId);\n if (typeof childStateValue === 'string') {\n if (typeof parentStateValue === 'string') {\n return childStateValue === parentStateValue;\n }\n\n // Parent more specific than child\n return false;\n }\n if (typeof parentStateValue === 'string') {\n return parentStateValue in childStateValue;\n }\n return Object.keys(parentStateValue).every(key => {\n if (!(key in childStateValue)) {\n return false;\n }\n return matchesState(parentStateValue[key], childStateValue[key]);\n });\n}\nfunction toStatePath(stateId) {\n if (isArray(stateId)) {\n return stateId;\n }\n const result = [];\n let segment = '';\n for (let i = 0; i < stateId.length; i++) {\n const char = stateId.charCodeAt(i);\n switch (char) {\n // \\\n case 92:\n // consume the next character\n segment += stateId[i + 1];\n // and skip over it\n i++;\n continue;\n // .\n case 46:\n result.push(segment);\n segment = '';\n continue;\n }\n segment += stateId[i];\n }\n result.push(segment);\n return result;\n}\nfunction toStateValue(stateValue) {\n if (isMachineSnapshot(stateValue)) {\n return stateValue.value;\n }\n if (typeof stateValue !== 'string') {\n return stateValue;\n }\n const statePath = toStatePath(stateValue);\n return pathToStateValue(statePath);\n}\nfunction pathToStateValue(statePath) {\n if (statePath.length === 1) {\n return statePath[0];\n }\n const value = {};\n let marker = value;\n for (let i = 0; i < statePath.length - 1; i++) {\n if (i === statePath.length - 2) {\n marker[statePath[i]] = statePath[i + 1];\n } else {\n const previous = marker;\n marker = {};\n previous[statePath[i]] = marker;\n }\n }\n return value;\n}\nfunction mapValues(collection, iteratee) {\n const result = {};\n const collectionKeys = Object.keys(collection);\n for (let i = 0; i < collectionKeys.length; i++) {\n const key = collectionKeys[i];\n result[key] = iteratee(collection[key], key, collection, i);\n }\n return result;\n}\nfunction toArrayStrict(value) {\n if (isArray(value)) {\n return value;\n }\n return [value];\n}\nfunction toArray(value) {\n if (value === undefined) {\n return [];\n }\n return toArrayStrict(value);\n}\nfunction resolveOutput(mapper, context, event, self) {\n if (typeof mapper === 'function') {\n return mapper({\n context,\n event,\n self\n });\n }\n return mapper;\n}\nfunction isArray(value) {\n return Array.isArray(value);\n}\nfunction isErrorActorEvent(event) {\n return event.type.startsWith('xstate.error.actor');\n}\nfunction toTransitionConfigArray(configLike) {\n return toArrayStrict(configLike).map(transitionLike => {\n if (typeof transitionLike === 'undefined' || typeof transitionLike === 'string') {\n return {\n target: transitionLike\n };\n }\n return transitionLike;\n });\n}\nfunction normalizeTarget(target) {\n if (target === undefined || target === TARGETLESS_KEY) {\n return undefined;\n }\n return toArray(target);\n}\nfunction toObserver(nextHandler, errorHandler, completionHandler) {\n const isObserver = typeof nextHandler === 'object';\n const self = isObserver ? nextHandler : undefined;\n return {\n next: (isObserver ? nextHandler.next : nextHandler)?.bind(self),\n error: (isObserver ? nextHandler.error : errorHandler)?.bind(self),\n complete: (isObserver ? nextHandler.complete : completionHandler)?.bind(self)\n };\n}\nfunction createInvokeId(stateNodeId, index) {\n return `${index}.${stateNodeId}`;\n}\nfunction resolveReferencedActor(machine, src) {\n const match = src.match(/^xstate\\.invoke\\.(\\d+)\\.(.*)/);\n if (!match) {\n return machine.implementations.actors[src];\n }\n const [, indexStr, nodeId] = match;\n const node = machine.getStateNodeById(nodeId);\n const invokeConfig = node.config.invoke;\n return (Array.isArray(invokeConfig) ? invokeConfig[indexStr] : invokeConfig).src;\n}\nfunction getAllOwnEventDescriptors(snapshot) {\n return [...new Set([...snapshot._nodes.flatMap(sn => sn.ownEvents)])];\n}\n\nfunction createScheduledEventId(actorRef, id) {\n return `${actorRef.sessionId}.${id}`;\n}\nlet idCounter = 0;\nfunction createSystem(rootActor, options) {\n const children = new Map();\n const keyedActors = new Map();\n const reverseKeyedActors = new WeakMap();\n const inspectionObservers = new Set();\n const timerMap = {};\n const {\n clock,\n logger\n } = options;\n const scheduler = {\n schedule: (source, target, event, delay, id = Math.random().toString(36).slice(2)) => {\n const scheduledEvent = {\n source,\n target,\n event,\n delay,\n id,\n startedAt: Date.now()\n };\n const scheduledEventId = createScheduledEventId(source, id);\n system._snapshot._scheduledEvents[scheduledEventId] = scheduledEvent;\n const timeout = clock.setTimeout(() => {\n delete timerMap[scheduledEventId];\n delete system._snapshot._scheduledEvents[scheduledEventId];\n system._relay(source, target, event);\n }, delay);\n timerMap[scheduledEventId] = timeout;\n },\n cancel: (source, id) => {\n const scheduledEventId = createScheduledEventId(source, id);\n const timeout = timerMap[scheduledEventId];\n delete timerMap[scheduledEventId];\n delete system._snapshot._scheduledEvents[scheduledEventId];\n if (timeout !== undefined) {\n clock.clearTimeout(timeout);\n }\n },\n cancelAll: actorRef => {\n for (const scheduledEventId in system._snapshot._scheduledEvents) {\n const scheduledEvent = system._snapshot._scheduledEvents[scheduledEventId];\n if (scheduledEvent.source === actorRef) {\n scheduler.cancel(actorRef, scheduledEvent.id);\n }\n }\n }\n };\n const sendInspectionEvent = event => {\n if (!inspectionObservers.size) {\n return;\n }\n const resolvedInspectionEvent = {\n ...event,\n rootId: rootActor.sessionId\n };\n inspectionObservers.forEach(observer => observer.next?.(resolvedInspectionEvent));\n };\n const system = {\n _snapshot: {\n _scheduledEvents: (options?.snapshot && options.snapshot.scheduler) ?? {}\n },\n _bookId: () => `x:${idCounter++}`,\n _register: (sessionId, actorRef) => {\n children.set(sessionId, actorRef);\n return sessionId;\n },\n _unregister: actorRef => {\n children.delete(actorRef.sessionId);\n const systemId = reverseKeyedActors.get(actorRef);\n if (systemId !== undefined) {\n keyedActors.delete(systemId);\n reverseKeyedActors.delete(actorRef);\n }\n },\n get: systemId => {\n return keyedActors.get(systemId);\n },\n _set: (systemId, actorRef) => {\n const existing = keyedActors.get(systemId);\n if (existing && existing !== actorRef) {\n throw new Error(`Actor with system ID '${systemId}' already exists.`);\n }\n keyedActors.set(systemId, actorRef);\n reverseKeyedActors.set(actorRef, systemId);\n },\n inspect: observerOrFn => {\n const observer = toObserver(observerOrFn);\n inspectionObservers.add(observer);\n return {\n unsubscribe() {\n inspectionObservers.delete(observer);\n }\n };\n },\n _sendInspectionEvent: sendInspectionEvent,\n _relay: (source, target, event) => {\n system._sendInspectionEvent({\n type: '@xstate.event',\n sourceRef: source,\n actorRef: target,\n event\n });\n target._send(event);\n },\n scheduler,\n getSnapshot: () => {\n return {\n _scheduledEvents: {\n ...system._snapshot._scheduledEvents\n }\n };\n },\n start: () => {\n const scheduledEvents = system._snapshot._scheduledEvents;\n system._snapshot._scheduledEvents = {};\n for (const scheduledId in scheduledEvents) {\n const {\n source,\n target,\n event,\n delay,\n id\n } = scheduledEvents[scheduledId];\n scheduler.schedule(source, target, event, delay, id);\n }\n },\n _clock: clock,\n _logger: logger\n };\n return system;\n}\n\n// those are needed to make JSDoc `@link` work properly\n\nlet executingCustomAction = false;\nconst $$ACTOR_TYPE = 1;\n\n// those values are currently used by @xstate/react directly so it's important to keep the assigned values in sync\nlet ProcessingStatus = /*#__PURE__*/function (ProcessingStatus) {\n ProcessingStatus[ProcessingStatus[\"NotStarted\"] = 0] = \"NotStarted\";\n ProcessingStatus[ProcessingStatus[\"Running\"] = 1] = \"Running\";\n ProcessingStatus[ProcessingStatus[\"Stopped\"] = 2] = \"Stopped\";\n return ProcessingStatus;\n}({});\nconst defaultOptions = {\n clock: {\n setTimeout: (fn, ms) => {\n return setTimeout(fn, ms);\n },\n clearTimeout: id => {\n return clearTimeout(id);\n }\n },\n logger: console.log.bind(console),\n devTools: false\n};\n\n/**\n * An Actor is a running process that can receive events, send events and change\n * its behavior based on the events it receives, which can cause effects outside\n * of the actor. When you run a state machine, it becomes an actor.\n */\nclass Actor {\n /**\n * Creates a new actor instance for the given logic with the provided options,\n * if any.\n *\n * @param logic The logic to create an actor from\n * @param options Actor options\n */\n constructor(logic, options) {\n this.logic = logic;\n /** The current internal state of the actor. */\n this._snapshot = void 0;\n /**\n * The clock that is responsible for setting and clearing timeouts, such as\n * delayed events and transitions.\n */\n this.clock = void 0;\n this.options = void 0;\n /** The unique identifier for this actor relative to its parent. */\n this.id = void 0;\n this.mailbox = new Mailbox(this._process.bind(this));\n this.observers = new Set();\n this.eventListeners = new Map();\n this.logger = void 0;\n /** @internal */\n this._processingStatus = ProcessingStatus.NotStarted;\n // Actor Ref\n this._parent = void 0;\n /** @internal */\n this._syncSnapshot = void 0;\n this.ref = void 0;\n // TODO: add typings for system\n this._actorScope = void 0;\n this._systemId = void 0;\n /** The globally unique process ID for this invocation. */\n this.sessionId = void 0;\n /** The system to which this actor belongs. */\n this.system = void 0;\n this._doneEvent = void 0;\n this.src = void 0;\n // array of functions to defer\n this._deferred = [];\n const resolvedOptions = {\n ...defaultOptions,\n ...options\n };\n const {\n clock,\n logger,\n parent,\n syncSnapshot,\n id,\n systemId,\n inspect\n } = resolvedOptions;\n this.system = parent ? parent.system : createSystem(this, {\n clock,\n logger\n });\n if (inspect && !parent) {\n // Always inspect at the system-level\n this.system.inspect(toObserver(inspect));\n }\n this.sessionId = this.system._bookId();\n this.id = id ?? this.sessionId;\n this.logger = options?.logger ?? this.system._logger;\n this.clock = options?.clock ?? this.system._clock;\n this._parent = parent;\n this._syncSnapshot = syncSnapshot;\n this.options = resolvedOptions;\n this.src = resolvedOptions.src ?? logic;\n this.ref = this;\n this._actorScope = {\n self: this,\n id: this.id,\n sessionId: this.sessionId,\n logger: this.logger,\n defer: fn => {\n this._deferred.push(fn);\n },\n system: this.system,\n stopChild: child => {\n if (child._parent !== this) {\n throw new Error(`Cannot stop child actor ${child.id} of ${this.id} because it is not a child`);\n }\n child._stop();\n },\n emit: emittedEvent => {\n const listeners = this.eventListeners.get(emittedEvent.type);\n const wildcardListener = this.eventListeners.get('*');\n if (!listeners && !wildcardListener) {\n return;\n }\n const allListeners = [...(listeners ? listeners.values() : []), ...(wildcardListener ? wildcardListener.values() : [])];\n for (const handler of allListeners) {\n handler(emittedEvent);\n }\n },\n actionExecutor: action => {\n const exec = () => {\n this._actorScope.system._sendInspectionEvent({\n type: '@xstate.action',\n actorRef: this,\n action: {\n type: action.type,\n params: action.params\n }\n });\n if (!action.exec) {\n return;\n }\n const saveExecutingCustomAction = executingCustomAction;\n try {\n executingCustomAction = true;\n action.exec(action.info, action.params);\n } finally {\n executingCustomAction = saveExecutingCustomAction;\n }\n };\n if (this._processingStatus === ProcessingStatus.Running) {\n exec();\n } else {\n this._deferred.push(exec);\n }\n }\n };\n\n // Ensure that the send method is bound to this Actor instance\n // if destructured\n this.send = this.send.bind(this);\n this.system._sendInspectionEvent({\n type: '@xstate.actor',\n actorRef: this\n });\n if (systemId) {\n this._systemId = systemId;\n this.system._set(systemId, this);\n }\n this._initState(options?.snapshot ?? options?.state);\n if (systemId && this._snapshot.status !== 'active') {\n this.system._unregister(this);\n }\n }\n _initState(persistedState) {\n try {\n this._snapshot = persistedState ? this.logic.restoreSnapshot ? this.logic.restoreSnapshot(persistedState, this._actorScope) : persistedState : this.logic.getInitialSnapshot(this._actorScope, this.options?.input);\n } catch (err) {\n // if we get here then it means that we assign a value to this._snapshot that is not of the correct type\n // we can't get the true `TSnapshot & { status: 'error'; }`, it's impossible\n // so right now this is a lie of sorts\n this._snapshot = {\n status: 'error',\n output: undefined,\n error: err\n };\n }\n }\n update(snapshot, event) {\n // Update state\n this._snapshot = snapshot;\n\n // Execute deferred effects\n let deferredFn;\n while (deferredFn = this._deferred.shift()) {\n try {\n deferredFn();\n } catch (err) {\n // this error can only be caught when executing *initial* actions\n // it's the only time when we call actions provided by the user through those deferreds\n // when the actor is already running we always execute them synchronously while transitioning\n // no \"builtin deferred\" should actually throw an error since they are either safe\n // or the control flow is passed through the mailbox and errors should be caught by the `_process` used by the mailbox\n this._deferred.length = 0;\n this._snapshot = {\n ...snapshot,\n status: 'error',\n error: err\n };\n }\n }\n switch (this._snapshot.status) {\n case 'active':\n for (const observer of this.observers) {\n try {\n observer.next?.(snapshot);\n } catch (err) {\n reportUnhandledError(err);\n }\n }\n break;\n case 'done':\n // next observers are meant to be notified about done snapshots\n // this can be seen as something that is different from how observable work\n // but with observables `complete` callback is called without any arguments\n // it's more ergonomic for XState to treat a done snapshot as a \"next\" value\n // and the completion event as something that is separate,\n // something that merely follows emitting that done snapshot\n for (const observer of this.observers) {\n try {\n observer.next?.(snapshot);\n } catch (err) {\n reportUnhandledError(err);\n }\n }\n this._stopProcedure();\n this._complete();\n this._doneEvent = createDoneActorEvent(this.id, this._snapshot.output);\n if (this._parent) {\n this.system._relay(this, this._parent, this._doneEvent);\n }\n break;\n case 'error':\n this._error(this._snapshot.error);\n break;\n }\n this.system._sendInspectionEvent({\n type: '@xstate.snapshot',\n actorRef: this,\n event,\n snapshot\n });\n }\n\n /**\n * Subscribe an observer to an actor’s snapshot values.\n *\n * @remarks\n * The observer will receive the actor’s snapshot value when it is emitted.\n * The observer can be:\n *\n * - A plain function that receives the latest snapshot, or\n * - An observer object whose `.next(snapshot)` method receives the latest\n * snapshot\n *\n * @example\n *\n * ```ts\n * // Observer as a plain function\n * const subscription = actor.subscribe((snapshot) => {\n * console.log(snapshot);\n * });\n * ```\n *\n * @example\n *\n * ```ts\n * // Observer as an object\n * const subscription = actor.subscribe({\n * next(snapshot) {\n * console.log(snapshot);\n * },\n * error(err) {\n * // ...\n * },\n * complete() {\n * // ...\n * }\n * });\n * ```\n *\n * The return value of `actor.subscribe(observer)` is a subscription object\n * that has an `.unsubscribe()` method. You can call\n * `subscription.unsubscribe()` to unsubscribe the observer:\n *\n * @example\n *\n * ```ts\n * const subscription = actor.subscribe((snapshot) => {\n * // ...\n * });\n *\n * // Unsubscribe the observer\n * subscription.unsubscribe();\n * ```\n *\n * When the actor is stopped, all of its observers will automatically be\n * unsubscribed.\n *\n * @param observer - Either a plain function that receives the latest\n * snapshot, or an observer object whose `.next(snapshot)` method receives\n * the latest snapshot\n */\n\n subscribe(nextListenerOrObserver, errorListener, completeListener) {\n const observer = toObserver(nextListenerOrObserver, errorListener, completeListener);\n if (this._processingStatus !== ProcessingStatus.Stopped) {\n this.observers.add(observer);\n } else {\n switch (this._snapshot.status) {\n case 'done':\n try {\n observer.complete?.();\n } catch (err) {\n reportUnhandledError(err);\n }\n break;\n case 'error':\n {\n const err = this._snapshot.error;\n if (!observer.error) {\n reportUnhandledError(err);\n } else {\n try {\n observer.error(err);\n } catch (err) {\n reportUnhandledError(err);\n }\n }\n break;\n }\n }\n }\n return {\n unsubscribe: () => {\n this.observers.delete(observer);\n }\n };\n }\n on(type, handler) {\n let listeners = this.eventListeners.get(type);\n if (!listeners) {\n listeners = new Set();\n this.eventListeners.set(type, listeners);\n }\n const wrappedHandler = handler.bind(undefined);\n listeners.add(wrappedHandler);\n return {\n unsubscribe: () => {\n listeners.delete(wrappedHandler);\n }\n };\n }\n\n /** Starts the Actor from the initial state */\n start() {\n if (this._processingStatus === ProcessingStatus.Running) {\n // Do not restart the service if it is already started\n return this;\n }\n if (this._syncSnapshot) {\n this.subscribe({\n next: snapshot => {\n if (snapshot.status === 'active') {\n this.system._relay(this, this._parent, {\n type: `xstate.snapshot.${this.id}`,\n snapshot\n });\n }\n },\n error: () => {}\n });\n }\n this.system._register(this.sessionId, this);\n if (this._systemId) {\n this.system._set(this._systemId, this);\n }\n this._processingStatus = ProcessingStatus.Running;\n\n // TODO: this isn't correct when rehydrating\n const initEvent = createInitEvent(this.options.input);\n this.system._sendInspectionEvent({\n type: '@xstate.event',\n sourceRef: this._parent,\n actorRef: this,\n event: initEvent\n });\n const status = this._snapshot.status;\n switch (status) {\n case 'done':\n // a state machine can be \"done\" upon initialization (it could reach a final state using initial microsteps)\n // we still need to complete observers, flush deferreds etc\n this.update(this._snapshot, initEvent);\n // TODO: rethink cleanup of observers, mailbox, etc\n return this;\n case 'error':\n this._error(this._snapshot.error);\n return this;\n }\n if (!this._parent) {\n this.system.start();\n }\n if (this.logic.start) {\n try {\n this.logic.start(this._snapshot, this._actorScope);\n } catch (err) {\n this._snapshot = {\n ...this._snapshot,\n status: 'error',\n error: err\n };\n this._error(err);\n return this;\n }\n }\n\n // TODO: this notifies all subscribers but usually this is redundant\n // there is no real change happening here\n // we need to rethink if this needs to be refactored\n this.update(this._snapshot, initEvent);\n if (this.options.devTools) {\n this.attachDevTools();\n }\n this.mailbox.start();\n return this;\n }\n _process(event) {\n let nextState;\n let caughtError;\n try {\n nextState = this.logic.transition(this._snapshot, event, this._actorScope);\n } catch (err) {\n // we wrap it in a box so we can rethrow it later even if falsy value gets caught here\n caughtError = {\n err\n };\n }\n if (caughtError) {\n const {\n err\n } = caughtError;\n this._snapshot = {\n ...this._snapshot,\n status: 'error',\n error: err\n };\n this._error(err);\n return;\n }\n this.update(nextState, event);\n if (event.type === XSTATE_STOP) {\n this._stopProcedure();\n this._complete();\n }\n }\n _stop() {\n if (this._processingStatus === ProcessingStatus.Stopped) {\n return this;\n }\n this.mailbox.clear();\n if (this._processingStatus === ProcessingStatus.NotStarted) {\n this._processingStatus = ProcessingStatus.Stopped;\n return this;\n }\n this.mailbox.enqueue({\n type: XSTATE_STOP\n });\n return this;\n }\n\n /** Stops the Actor and unsubscribe all listeners. */\n stop() {\n if (this._parent) {\n throw new Error('A non-root actor cannot be stopped directly.');\n }\n return this._stop();\n }\n _complete() {\n for (const observer of this.observers) {\n try {\n observer.complete?.();\n } catch (err) {\n reportUnhandledError(err);\n }\n }\n this.observers.clear();\n }\n _reportError(err) {\n if (!this.observers.size) {\n if (!this._parent) {\n reportUnhandledError(err);\n }\n return;\n }\n let reportError = false;\n for (const observer of this.observers) {\n const errorListener = observer.error;\n reportError ||= !errorListener;\n try {\n errorListener?.(err);\n } catch (err2) {\n reportUnhandledError(err2);\n }\n }\n this.observers.clear();\n if (reportError) {\n reportUnhandledError(err);\n }\n }\n _error(err) {\n this._stopProcedure();\n this._reportError(err);\n if (this._parent) {\n this.system._relay(this, this._parent, createErrorActorEvent(this.id, err));\n }\n }\n // TODO: atm children don't belong entirely to the actor so\n // in a way - it's not even super aware of them\n // so we can't stop them from here but we really should!\n // right now, they are being stopped within the machine's transition\n // but that could throw and leave us with \"orphaned\" active actors\n _stopProcedure() {\n if (this._processingStatus !== ProcessingStatus.Running) {\n // Actor already stopped; do nothing\n return this;\n }\n\n // Cancel all delayed events\n this.system.scheduler.cancelAll(this);\n\n // TODO: mailbox.reset\n this.mailbox.clear();\n // TODO: after `stop` we must prepare ourselves for receiving events again\n // events sent *after* stop signal must be queued\n // it seems like this should be the common behavior for all of our consumers\n // so perhaps this should be unified somehow for all of them\n this.mailbox = new Mailbox(this._process.bind(this));\n this._processingStatus = ProcessingStatus.Stopped;\n this.system._unregister(this);\n return this;\n }\n\n /** @internal */\n _send(event) {\n if (this._processingStatus === ProcessingStatus.Stopped) {\n return;\n }\n this.mailbox.enqueue(event);\n }\n\n /**\n * Sends an event to the running Actor to trigger a transition.\n *\n * @param event The event to send\n */\n send(event) {\n this.system._relay(undefined, this, event);\n }\n attachDevTools() {\n const {\n devTools\n } = this.options;\n if (devTools) {\n const resolvedDevToolsAdapter = typeof devTools === 'function' ? devTools : devToolsAdapter;\n resolvedDevToolsAdapter(this);\n }\n }\n toJSON() {\n return {\n xstate$$type: $$ACTOR_TYPE,\n id: this.id\n };\n }\n\n /**\n * Obtain the internal state of the actor, which can be persisted.\n *\n * @remarks\n * The internal state can be persisted from any actor, not only machines.\n *\n * Note that the persisted state is not the same as the snapshot from\n * {@link Actor.getSnapshot}. Persisted state represents the internal state of\n * the actor, while snapshots represent the actor's last emitted value.\n *\n * Can be restored with {@link ActorOptions.state}\n * @see https://stately.ai/docs/persistence\n */\n\n getPersistedSnapshot(options) {\n return this.logic.getPersistedSnapshot(this._snapshot, options);\n }\n [symbolObservable]() {\n return this;\n }\n\n /**\n * Read an actor’s snapshot synchronously.\n *\n * @remarks\n * The snapshot represent an actor's last emitted value.\n *\n * When an actor receives an event, its internal state may change. An actor\n * may emit a snapshot when a state transition occurs.\n *\n * Note that some actors, such as callback actors generated with\n * `fromCallback`, will not emit snapshots.\n * @see {@link Actor.subscribe} to subscribe to an actor’s snapshot values.\n * @see {@link Actor.getPersistedSnapshot} to persist the internal state of an actor (which is more than just a snapshot).\n */\n getSnapshot() {\n return this._snapshot;\n }\n}\n/**\n * Creates a new actor instance for the given actor logic with the provided\n * options, if any.\n *\n * @remarks\n * When you create an actor from actor logic via `createActor(logic)`, you\n * implicitly create an actor system where the created actor is the root actor.\n * Any actors spawned from this root actor and its descendants are part of that\n * actor system.\n * @example\n *\n * ```ts\n * import { createActor } from 'xstate';\n * import { someActorLogic } from './someActorLogic.ts';\n *\n * // Creating the actor, which implicitly creates an actor system with itself as the root actor\n * const actor = createActor(someActorLogic);\n *\n * actor.subscribe((snapshot) => {\n * console.log(snapshot);\n * });\n *\n * // Actors must be started by calling `actor.start()`, which will also start the actor system.\n * actor.start();\n *\n * // Actors can receive events\n * actor.send({ type: 'someEvent' });\n *\n * // You can stop root actors by calling `actor.stop()`, which will also stop the actor system and all actors in that system.\n * actor.stop();\n * ```\n *\n * @param logic - The actor logic to create an actor from. For a state machine\n * actor logic creator, see {@link createMachine}. Other actor logic creators\n * include {@link fromCallback}, {@link fromEventObservable},\n * {@link fromObservable}, {@link fromPromise}, and {@link fromTransition}.\n * @param options - Actor options\n */\nfunction createActor(logic, ...[options]) {\n return new Actor(logic, options);\n}\n\n/**\n * Creates a new Interpreter instance for the given machine with the provided\n * options, if any.\n *\n * @deprecated Use `createActor` instead\n * @alias\n */\nconst interpret = createActor;\n\n/**\n * @deprecated Use `Actor` instead.\n * @alias\n */\n\nfunction resolveCancel(_, snapshot, actionArgs, actionParams, {\n sendId\n}) {\n const resolvedSendId = typeof sendId === 'function' ? sendId(actionArgs, actionParams) : sendId;\n return [snapshot, {\n sendId: resolvedSendId\n }, undefined];\n}\nfunction executeCancel(actorScope, params) {\n actorScope.defer(() => {\n actorScope.system.scheduler.cancel(actorScope.self, params.sendId);\n });\n}\n/**\n * Cancels a delayed `sendTo(...)` action that is waiting to be executed. The\n * canceled `sendTo(...)` action will not send its event or execute, unless the\n * `delay` has already elapsed before `cancel(...)` is called.\n *\n * @example\n *\n * ```ts\n * import { createMachine, sendTo, cancel } from 'xstate';\n *\n * const machine = createMachine({\n * // ...\n * on: {\n * sendEvent: {\n * actions: sendTo(\n * 'some-actor',\n * { type: 'someEvent' },\n * {\n * id: 'some-id',\n * delay: 1000\n * }\n * )\n * },\n * cancelEvent: {\n * actions: cancel('some-id')\n * }\n * }\n * });\n * ```\n *\n * @param sendId The `id` of the `sendTo(...)` action to cancel.\n */\nfunction cancel(sendId) {\n function cancel(_args, _params) {\n }\n cancel.type = 'xstate.cancel';\n cancel.sendId = sendId;\n cancel.resolve = resolveCancel;\n cancel.execute = executeCancel;\n return cancel;\n}\n\nfunction resolveSpawn(actorScope, snapshot, actionArgs, _actionParams, {\n id,\n systemId,\n src,\n input,\n syncSnapshot\n}) {\n const logic = typeof src === 'string' ? resolveReferencedActor(snapshot.machine, src) : src;\n const resolvedId = typeof id === 'function' ? id(actionArgs) : id;\n let actorRef;\n let resolvedInput = undefined;\n if (logic) {\n resolvedInput = typeof input === 'function' ? input({\n context: snapshot.context,\n event: actionArgs.event,\n self: actorScope.self\n }) : input;\n actorRef = createActor(logic, {\n id: resolvedId,\n src,\n parent: actorScope.self,\n syncSnapshot,\n systemId,\n input: resolvedInput\n });\n }\n return [cloneMachineSnapshot(snapshot, {\n children: {\n ...snapshot.children,\n [resolvedId]: actorRef\n }\n }), {\n id,\n systemId,\n actorRef,\n src,\n input: resolvedInput\n }, undefined];\n}\nfunction executeSpawn(actorScope, {\n actorRef\n}) {\n if (!actorRef) {\n return;\n }\n actorScope.defer(() => {\n if (actorRef._processingStatus === ProcessingStatus.Stopped) {\n return;\n }\n actorRef.start();\n });\n}\nfunction spawnChild(...[src, {\n id,\n systemId,\n input,\n syncSnapshot = false\n} = {}]) {\n function spawnChild(_args, _params) {\n }\n spawnChild.type = 'xstate.spawnChild';\n spawnChild.id = id;\n spawnChild.systemId = systemId;\n spawnChild.src = src;\n spawnChild.input = input;\n spawnChild.syncSnapshot = syncSnapshot;\n spawnChild.resolve = resolveSpawn;\n spawnChild.execute = executeSpawn;\n return spawnChild;\n}\n\nfunction resolveStop(_, snapshot, args, actionParams, {\n actorRef\n}) {\n const actorRefOrString = typeof actorRef === 'function' ? actorRef(args, actionParams) : actorRef;\n const resolvedActorRef = typeof actorRefOrString === 'string' ? snapshot.children[actorRefOrString] : actorRefOrString;\n let children = snapshot.children;\n if (resolvedActorRef) {\n children = {\n ...children\n };\n delete children[resolvedActorRef.id];\n }\n return [cloneMachineSnapshot(snapshot, {\n children\n }), resolvedActorRef, undefined];\n}\nfunction executeStop(actorScope, actorRef) {\n if (!actorRef) {\n return;\n }\n\n // we need to eagerly unregister it here so a new actor with the same systemId can be registered immediately\n // since we defer actual stopping of the actor but we don't defer actor creations (and we can't do that)\n // this could throw on `systemId` collision, for example, when dealing with reentering transitions\n actorScope.system._unregister(actorRef);\n\n // this allows us to prevent an actor from being started if it gets stopped within the same macrostep\n // this can happen, for example, when the invoking state is being exited immediately by an always transition\n if (actorRef._processingStatus !== ProcessingStatus.Running) {\n actorScope.stopChild(actorRef);\n return;\n }\n // stopping a child enqueues a stop event in the child actor's mailbox\n // we need for all of the already enqueued events to be processed before we stop the child\n // the parent itself might want to send some events to a child (for example from exit actions on the invoking state)\n // and we don't want to ignore those events\n actorScope.defer(() => {\n actorScope.stopChild(actorRef);\n });\n}\n/**\n * Stops a child actor.\n *\n * @param actorRef The actor to stop.\n */\nfunction stopChild(actorRef) {\n function stop(_args, _params) {\n }\n stop.type = 'xstate.stopChild';\n stop.actorRef = actorRef;\n stop.resolve = resolveStop;\n stop.execute = executeStop;\n return stop;\n}\n\n/**\n * Stops a child actor.\n *\n * @deprecated Use `stopChild(...)` instead\n * @alias\n */\nconst stop = stopChild;\n\nfunction checkStateIn(snapshot, _, {\n stateValue\n}) {\n if (typeof stateValue === 'string' && isStateId(stateValue)) {\n const target = snapshot.machine.getStateNodeById(stateValue);\n return snapshot._nodes.some(sn => sn === target);\n }\n return snapshot.matches(stateValue);\n}\nfunction stateIn(stateValue) {\n function stateIn() {\n return false;\n }\n stateIn.check = checkStateIn;\n stateIn.stateValue = stateValue;\n return stateIn;\n}\nfunction checkNot(snapshot, {\n context,\n event\n}, {\n guards\n}) {\n return !evaluateGuard(guards[0], context, event, snapshot);\n}\n\n/**\n * Higher-order guard that evaluates to `true` if the `guard` passed to it\n * evaluates to `false`.\n *\n * @category Guards\n * @example\n *\n * ```ts\n * import { setup, not } from 'xstate';\n *\n * const machine = setup({\n * guards: {\n * someNamedGuard: () => false\n * }\n * }).createMachine({\n * on: {\n * someEvent: {\n * guard: not('someNamedGuard'),\n * actions: () => {\n * // will be executed if guard in `not(...)`\n * // evaluates to `false`\n * }\n * }\n * }\n * });\n * ```\n *\n * @returns A guard\n */\nfunction not(guard) {\n function not(_args, _params) {\n return false;\n }\n not.check = checkNot;\n not.guards = [guard];\n return not;\n}\nfunction checkAnd(snapshot, {\n context,\n event\n}, {\n guards\n}) {\n return guards.every(guard => evaluateGuard(guard, context, event, snapshot));\n}\n\n/**\n * Higher-order guard that evaluates to `true` if all `guards` passed to it\n * evaluate to `true`.\n *\n * @category Guards\n * @example\n *\n * ```ts\n * import { setup, and } from 'xstate';\n *\n * const machine = setup({\n * guards: {\n * someNamedGuard: () => true\n * }\n * }).createMachine({\n * on: {\n * someEvent: {\n * guard: and([({ context }) => context.value > 0, 'someNamedGuard']),\n * actions: () => {\n * // will be executed if all guards in `and(...)`\n * // evaluate to true\n * }\n * }\n * }\n * });\n * ```\n *\n * @returns A guard action object\n */\nfunction and(guards) {\n function and(_args, _params) {\n return false;\n }\n and.check = checkAnd;\n and.guards = guards;\n return and;\n}\nfunction checkOr(snapshot, {\n context,\n event\n}, {\n guards\n}) {\n return guards.some(guard => evaluateGuard(guard, context, event, snapshot));\n}\n\n/**\n * Higher-order guard that evaluates to `true` if any of the `guards` passed to\n * it evaluate to `true`.\n *\n * @category Guards\n * @example\n *\n * ```ts\n * import { setup, or } from 'xstate';\n *\n * const machine = setup({\n * guards: {\n * someNamedGuard: () => true\n * }\n * }).createMachine({\n * on: {\n * someEvent: {\n * guard: or([({ context }) => context.value > 0, 'someNamedGuard']),\n * actions: () => {\n * // will be executed if any of the guards in `or(...)`\n * // evaluate to true\n * }\n * }\n * }\n * });\n * ```\n *\n * @returns A guard action object\n */\nfunction or(guards) {\n function or(_args, _params) {\n return false;\n }\n or.check = checkOr;\n or.guards = guards;\n return or;\n}\n\n// TODO: throw on cycles (depth check should be enough)\nfunction evaluateGuard(guard, context, event, snapshot) {\n const {\n machine\n } = snapshot;\n const isInline = typeof guard === 'function';\n const resolved = isInline ? guard : machine.implementations.guards[typeof guard === 'string' ? guard : guard.type];\n if (!isInline && !resolved) {\n throw new Error(`Guard '${typeof guard === 'string' ? guard : guard.type}' is not implemented.'.`);\n }\n if (typeof resolved !== 'function') {\n return evaluateGuard(resolved, context, event, snapshot);\n }\n const guardArgs = {\n context,\n event\n };\n const guardParams = isInline || typeof guard === 'string' ? undefined : 'params' in guard ? typeof guard.params === 'function' ? guard.params({\n context,\n event\n }) : guard.params : undefined;\n if (!('check' in resolved)) {\n // the existing type of `.guards` assumes non-nullable `TExpressionGuard`\n // inline guards expect `TExpressionGuard` to be set to `undefined`\n // it's fine to cast this here, our logic makes sure that we call those 2 \"variants\" correctly\n return resolved(guardArgs, guardParams);\n }\n const builtinGuard = resolved;\n return builtinGuard.check(snapshot, guardArgs, resolved // this holds all params\n );\n}\n\nconst isAtomicStateNode = stateNode => stateNode.type === 'atomic' || stateNode.type === 'final';\nfunction getChildren(stateNode) {\n return Object.values(stateNode.states).filter(sn => sn.type !== 'history');\n}\nfunction getProperAncestors(stateNode, toStateNode) {\n const ancestors = [];\n if (toStateNode === stateNode) {\n return ancestors;\n }\n\n // add all ancestors\n let m = stateNode.parent;\n while (m && m !== toStateNode) {\n ancestors.push(m);\n m = m.parent;\n }\n return ancestors;\n}\nfunction getAllStateNodes(stateNodes) {\n const nodeSet = new Set(stateNodes);\n const adjList = getAdjList(nodeSet);\n\n // add descendants\n for (const s of nodeSet) {\n // if previously active, add existing child nodes\n if (s.type === 'compound' && (!adjList.get(s) || !adjList.get(s).length)) {\n getInitialStateNodesWithTheirAncestors(s).forEach(sn => nodeSet.add(sn));\n } else {\n if (s.type === 'parallel') {\n for (const child of getChildren(s)) {\n if (child.type === 'history') {\n continue;\n }\n if (!nodeSet.has(child)) {\n const initialStates = getInitialStateNodesWithTheirAncestors(child);\n for (const initialStateNode of initialStates) {\n nodeSet.add(initialStateNode);\n }\n }\n }\n }\n }\n }\n\n // add all ancestors\n for (const s of nodeSet) {\n let m = s.parent;\n while (m) {\n nodeSet.add(m);\n m = m.parent;\n }\n }\n return nodeSet;\n}\nfunction getValueFromAdj(baseNode, adjList) {\n const childStateNodes = adjList.get(baseNode);\n if (!childStateNodes) {\n return {}; // todo: fix?\n }\n if (baseNode.type === 'compound') {\n const childStateNode = childStateNodes[0];\n if (childStateNode) {\n if (isAtomicStateNode(childStateNode)) {\n return childStateNode.key;\n }\n } else {\n return {};\n }\n }\n const stateValue = {};\n for (const childStateNode of childStateNodes) {\n stateValue[childStateNode.key] = getValueFromAdj(childStateNode, adjList);\n }\n return stateValue;\n}\nfunction getAdjList(stateNodes) {\n const adjList = new Map();\n for (const s of stateNodes) {\n if (!adjList.has(s)) {\n adjList.set(s, []);\n }\n if (s.parent) {\n if (!adjList.has(s.parent)) {\n adjList.set(s.parent, []);\n }\n adjList.get(s.parent).push(s);\n }\n }\n return adjList;\n}\nfunction getStateValue(rootNode, stateNodes) {\n const config = getAllStateNodes(stateNodes);\n return getValueFromAdj(rootNode, getAdjList(config));\n}\nfunction isInFinalState(stateNodeSet, stateNode) {\n if (stateNode.type === 'compound') {\n return getChildren(stateNode).some(s => s.type === 'final' && stateNodeSet.has(s));\n }\n if (stateNode.type === 'parallel') {\n return getChildren(stateNode).every(sn => isInFinalState(stateNodeSet, sn));\n }\n return stateNode.type === 'final';\n}\nconst isStateId = str => str[0] === STATE_IDENTIFIER;\nfunction getCandidates(stateNode, receivedEventType) {\n const candidates = stateNode.transitions.get(receivedEventType) || [...stateNode.transitions.keys()].filter(eventDescriptor => {\n // check if transition is a wildcard transition,\n // which matches any non-transient events\n if (eventDescriptor === WILDCARD) {\n return true;\n }\n if (!eventDescriptor.endsWith('.*')) {\n return false;\n }\n const partialEventTokens = eventDescriptor.split('.');\n const eventTokens = receivedEventType.split('.');\n for (let tokenIndex = 0; tokenIndex < partialEventTokens.length; tokenIndex++) {\n const partialEventToken = partialEventTokens[tokenIndex];\n const eventToken = eventTokens[tokenIndex];\n if (partialEventToken === '*') {\n const isLastToken = tokenIndex === partialEventTokens.length - 1;\n return isLastToken;\n }\n if (partialEventToken !== eventToken) {\n return false;\n }\n }\n return true;\n }).sort((a, b) => b.length - a.length).flatMap(key => stateNode.transitions.get(key));\n return candidates;\n}\n\n/** All delayed transitions from the config. */\nfunction getDelayedTransitions(stateNode) {\n const afterConfig = stateNode.config.after;\n if (!afterConfig) {\n return [];\n }\n const mutateEntryExit = delay => {\n const afterEvent = createAfterEvent(delay, stateNode.id);\n const eventType = afterEvent.type;\n stateNode.entry.push(raise(afterEvent, {\n id: eventType,\n delay\n }));\n stateNode.exit.push(cancel(eventType));\n return eventType;\n };\n const delayedTransitions = Object.keys(afterConfig).flatMap(delay => {\n const configTransition = afterConfig[delay];\n const resolvedTransition = typeof configTransition === 'string' ? {\n target: configTransition\n } : configTransition;\n const resolvedDelay = Number.isNaN(+delay) ? delay : +delay;\n const eventType = mutateEntryExit(resolvedDelay);\n return toArray(resolvedTransition).map(transition => ({\n ...transition,\n event: eventType,\n delay: resolvedDelay\n }));\n });\n return delayedTransitions.map(delayedTransition => {\n const {\n delay\n } = delayedTransition;\n return {\n ...formatTransition(stateNode, delayedTransition.event, delayedTransition),\n delay\n };\n });\n}\nfunction formatTransition(stateNode, descriptor, transitionConfig) {\n const normalizedTarget = normalizeTarget(transitionConfig.target);\n const reenter = transitionConfig.reenter ?? false;\n const target = resolveTarget(stateNode, normalizedTarget);\n const transition = {\n ...transitionConfig,\n actions: toArray(transitionConfig.actions),\n guard: transitionConfig.guard,\n target,\n source: stateNode,\n reenter,\n eventType: descriptor,\n toJSON: () => ({\n ...transition,\n source: `#${stateNode.id}`,\n target: target ? target.map(t => `#${t.id}`) : undefined\n })\n };\n return transition;\n}\nfunction formatTransitions(stateNode) {\n const transitions = new Map();\n if (stateNode.config.on) {\n for (const descriptor of Object.keys(stateNode.config.on)) {\n if (descriptor === NULL_EVENT) {\n throw new Error('Null events (\"\") cannot be specified as a transition key. Use `always: { ... }` instead.');\n }\n const transitionsConfig = stateNode.config.on[descriptor];\n transitions.set(descriptor, toTransitionConfigArray(transitionsConfig).map(t => formatTransition(stateNode, descriptor, t)));\n }\n }\n if (stateNode.config.onDone) {\n const descriptor = `xstate.done.state.${stateNode.id}`;\n transitions.set(descriptor, toTransitionConfigArray(stateNode.config.onDone).map(t => formatTransition(stateNode, descriptor, t)));\n }\n for (const invokeDef of stateNode.invoke) {\n if (invokeDef.onDone) {\n const descriptor = `xstate.done.actor.${invokeDef.id}`;\n transitions.set(descriptor, toTransitionConfigArray(invokeDef.onDone).map(t => formatTransition(stateNode, descriptor, t)));\n }\n if (invokeDef.onError) {\n const descriptor = `xstate.error.actor.${invokeDef.id}`;\n transitions.set(descriptor, toTransitionConfigArray(invokeDef.onError).map(t => formatTransition(stateNode, descriptor, t)));\n }\n if (invokeDef.onSnapshot) {\n const descriptor = `xstate.snapshot.${invokeDef.id}`;\n transitions.set(descriptor, toTransitionConfigArray(invokeDef.onSnapshot).map(t => formatTransition(stateNode, descriptor, t)));\n }\n }\n for (const delayedTransition of stateNode.after) {\n let existing = transitions.get(delayedTransition.eventType);\n if (!existing) {\n existing = [];\n transitions.set(delayedTransition.eventType, existing);\n }\n existing.push(delayedTransition);\n }\n return transitions;\n}\nfunction formatInitialTransition(stateNode, _target) {\n const resolvedTarget = typeof _target === 'string' ? stateNode.states[_target] : _target ? stateNode.states[_target.target] : undefined;\n if (!resolvedTarget && _target) {\n throw new Error(\n // eslint-disable-next-line @typescript-eslint/restrict-template-expressions, @typescript-eslint/no-base-to-string\n `Initial state node \"${_target}\" not found on parent state node #${stateNode.id}`);\n }\n const transition = {\n source: stateNode,\n actions: !_target || typeof _target === 'string' ? [] : toArray(_target.actions),\n eventType: null,\n reenter: false,\n target: resolvedTarget ? [resolvedTarget] : [],\n toJSON: () => ({\n ...transition,\n source: `#${stateNode.id}`,\n target: resolvedTarget ? [`#${resolvedTarget.id}`] : []\n })\n };\n return transition;\n}\nfunction resolveTarget(stateNode, targets) {\n if (targets === undefined) {\n // an undefined target signals that the state node should not transition from that state when receiving that event\n return undefined;\n }\n return targets.map(target => {\n if (typeof target !== 'string') {\n return target;\n }\n if (isStateId(target)) {\n return stateNode.machine.getStateNodeById(target);\n }\n const isInternalTarget = target[0] === STATE_DELIMITER;\n // If internal target is defined on machine,\n // do not include machine key on target\n if (isInternalTarget && !stateNode.parent) {\n return getStateNodeByPath(stateNode, target.slice(1));\n }\n const resolvedTarget = isInternalTarget ? stateNode.key + target : target;\n if (stateNode.parent) {\n try {\n const targetStateNode = getStateNodeByPath(stateNode.parent, resolvedTarget);\n return targetStateNode;\n } catch (err) {\n throw new Error(`Invalid transition definition for state node '${stateNode.id}':\\n${err.message}`);\n }\n } else {\n throw new Error(`Invalid target: \"${target}\" is not a valid target from the root node. Did you mean \".${target}\"?`);\n }\n });\n}\nfunction resolveHistoryDefaultTransition(stateNode) {\n const normalizedTarget = normalizeTarget(stateNode.config.target);\n if (!normalizedTarget) {\n return stateNode.parent.initial;\n }\n return {\n target: normalizedTarget.map(t => typeof t === 'string' ? getStateNodeByPath(stateNode.parent, t) : t)\n };\n}\nfunction isHistoryNode(stateNode) {\n return stateNode.type === 'history';\n}\nfunction getInitialStateNodesWithTheirAncestors(stateNode) {\n const states = getInitialStateNodes(stateNode);\n for (const initialState of states) {\n for (const ancestor of getProperAncestors(initialState, stateNode)) {\n states.add(ancestor);\n }\n }\n return states;\n}\nfunction getInitialStateNodes(stateNode) {\n const set = new Set();\n function iter(descStateNode) {\n if (set.has(descStateNode)) {\n return;\n }\n set.add(descStateNode);\n if (descStateNode.type === 'compound') {\n iter(descStateNode.initial.target[0]);\n } else if (descStateNode.type === 'parallel') {\n for (const child of getChildren(descStateNode)) {\n iter(child);\n }\n }\n }\n iter(stateNode);\n return set;\n}\n/** Returns the child state node from its relative `stateKey`, or throws. */\nfunction getStateNode(stateNode, stateKey) {\n if (isStateId(stateKey)) {\n return stateNode.machine.getStateNodeById(stateKey);\n }\n if (!stateNode.states) {\n throw new Error(`Unable to retrieve child state '${stateKey}' from '${stateNode.id}'; no child states exist.`);\n }\n const result = stateNode.states[stateKey];\n if (!result) {\n throw new Error(`Child state '${stateKey}' does not exist on '${stateNode.id}'`);\n }\n return result;\n}\n\n/**\n * Returns the relative state node from the given `statePath`, or throws.\n *\n * @param statePath The string or string array relative path to the state node.\n */\nfunction getStateNodeByPath(stateNode, statePath) {\n if (typeof statePath === 'string' && isStateId(statePath)) {\n try {\n return stateNode.machine.getStateNodeById(statePath);\n } catch {\n // try individual paths\n // throw e;\n }\n }\n const arrayStatePath = toStatePath(statePath).slice();\n let currentStateNode = stateNode;\n while (arrayStatePath.length) {\n const key = arrayStatePath.shift();\n if (!key.length) {\n break;\n }\n currentStateNode = getStateNode(currentStateNode, key);\n }\n return currentStateNode;\n}\n\n/**\n * Returns the state nodes represented by the current state value.\n *\n * @param stateValue The state value or State instance\n */\nfunction getStateNodes(stateNode, stateValue) {\n if (typeof stateValue === 'string') {\n const childStateNode = stateNode.states[stateValue];\n if (!childStateNode) {\n throw new Error(`State '${stateValue}' does not exist on '${stateNode.id}'`);\n }\n return [stateNode, childStateNode];\n }\n const childStateKeys = Object.keys(stateValue);\n const childStateNodes = childStateKeys.map(subStateKey => getStateNode(stateNode, subStateKey)).filter(Boolean);\n return [stateNode.machine.root, stateNode].concat(childStateNodes, childStateKeys.reduce((allSubStateNodes, subStateKey) => {\n const subStateNode = getStateNode(stateNode, subStateKey);\n if (!subStateNode) {\n return allSubStateNodes;\n }\n const subStateNodes = getStateNodes(subStateNode, stateValue[subStateKey]);\n return allSubStateNodes.concat(subStateNodes);\n }, []));\n}\nfunction transitionAtomicNode(stateNode, stateValue, snapshot, event) {\n const childStateNode = getStateNode(stateNode, stateValue);\n const next = childStateNode.next(snapshot, event);\n if (!next || !next.length) {\n return stateNode.next(snapshot, event);\n }\n return next;\n}\nfunction transitionCompoundNode(stateNode, stateValue, snapshot, event) {\n const subStateKeys = Object.keys(stateValue);\n const childStateNode = getStateNode(stateNode, subStateKeys[0]);\n const next = transitionNode(childStateNode, stateValue[subStateKeys[0]], snapshot, event);\n if (!next || !next.length) {\n return stateNode.next(snapshot, event);\n }\n return next;\n}\nfunction transitionParallelNode(stateNode, stateValue, snapshot, event) {\n const allInnerTransitions = [];\n for (const subStateKey of Object.keys(stateValue)) {\n const subStateValue = stateValue[subStateKey];\n if (!subStateValue) {\n continue;\n }\n const subStateNode = getStateNode(stateNode, subStateKey);\n const innerTransitions = transitionNode(subStateNode, subStateValue, snapshot, event);\n if (innerTransitions) {\n allInnerTransitions.push(...innerTransitions);\n }\n }\n if (!allInnerTransitions.length) {\n return stateNode.next(snapshot, event);\n }\n return allInnerTransitions;\n}\nfunction transitionNode(stateNode, stateValue, snapshot, event) {\n // leaf node\n if (typeof stateValue === 'string') {\n return transitionAtomicNode(stateNode, stateValue, snapshot, event);\n }\n\n // compound node\n if (Object.keys(stateValue).length === 1) {\n return transitionCompoundNode(stateNode, stateValue, snapshot, event);\n }\n\n // parallel node\n return transitionParallelNode(stateNode, stateValue, snapshot, event);\n}\nfunction getHistoryNodes(stateNode) {\n return Object.keys(stateNode.states).map(key => stateNode.states[key]).filter(sn => sn.type === 'history');\n}\nfunction isDescendant(childStateNode, parentStateNode) {\n let marker = childStateNode;\n while (marker.parent && marker.parent !== parentStateNode) {\n marker = marker.parent;\n }\n return marker.parent === parentStateNode;\n}\nfunction hasIntersection(s1, s2) {\n const set1 = new Set(s1);\n const set2 = new Set(s2);\n for (const item of set1) {\n if (set2.has(item)) {\n return true;\n }\n }\n for (const item of set2) {\n if (set1.has(item)) {\n return true;\n }\n }\n return false;\n}\nfunction removeConflictingTransitions(enabledTransitions, stateNodeSet, historyValue) {\n const filteredTransitions = new Set();\n for (const t1 of enabledTransitions) {\n let t1Preempted = false;\n const transitionsToRemove = new Set();\n for (const t2 of filteredTransitions) {\n if (hasIntersection(computeExitSet([t1], stateNodeSet, historyValue), computeExitSet([t2], stateNodeSet, historyValue))) {\n if (isDescendant(t1.source, t2.source)) {\n transitionsToRemove.add(t2);\n } else {\n t1Preempted = true;\n break;\n }\n }\n }\n if (!t1Preempted) {\n for (const t3 of transitionsToRemove) {\n filteredTransitions.delete(t3);\n }\n filteredTransitions.add(t1);\n }\n }\n return Array.from(filteredTransitions);\n}\nfunction findLeastCommonAncestor(stateNodes) {\n const [head, ...tail] = stateNodes;\n for (const ancestor of getProperAncestors(head, undefined)) {\n if (tail.every(sn => isDescendant(sn, ancestor))) {\n return ancestor;\n }\n }\n}\nfunction getEffectiveTargetStates(transition, historyValue) {\n if (!transition.target) {\n return [];\n }\n const targets = new Set();\n for (const targetNode of transition.target) {\n if (isHistoryNode(targetNode)) {\n if (historyValue[targetNode.id]) {\n for (const node of historyValue[targetNode.id]) {\n targets.add(node);\n }\n } else {\n for (const node of getEffectiveTargetStates(resolveHistoryDefaultTransition(targetNode), historyValue)) {\n targets.add(node);\n }\n }\n } else {\n targets.add(targetNode);\n }\n }\n return [...targets];\n}\nfunction getTransitionDomain(transition, historyValue) {\n const targetStates = getEffectiveTargetStates(transition, historyValue);\n if (!targetStates) {\n return;\n }\n if (!transition.reenter && targetStates.every(target => target === transition.source || isDescendant(target, transition.source))) {\n return transition.source;\n }\n const lca = findLeastCommonAncestor(targetStates.concat(transition.source));\n if (lca) {\n return lca;\n }\n\n // at this point we know that it's a root transition since LCA couldn't be found\n if (transition.reenter) {\n return;\n }\n return transition.source.machine.root;\n}\nfunction computeExitSet(transitions, stateNodeSet, historyValue) {\n const statesToExit = new Set();\n for (const t of transitions) {\n if (t.target?.length) {\n const domain = getTransitionDomain(t, historyValue);\n if (t.reenter && t.source === domain) {\n statesToExit.add(domain);\n }\n for (const stateNode of stateNodeSet) {\n if (isDescendant(stateNode, domain)) {\n statesToExit.add(stateNode);\n }\n }\n }\n }\n return [...statesToExit];\n}\nfunction areStateNodeCollectionsEqual(prevStateNodes, nextStateNodeSet) {\n if (prevStateNodes.length !== nextStateNodeSet.size) {\n return false;\n }\n for (const node of prevStateNodes) {\n if (!nextStateNodeSet.has(node)) {\n return false;\n }\n }\n return true;\n}\n\n/** https://www.w3.org/TR/scxml/#microstepProcedure */\nfunction microstep(transitions, currentSnapshot, actorScope, event, isInitial, internalQueue) {\n if (!transitions.length) {\n return currentSnapshot;\n }\n const mutStateNodeSet = new Set(currentSnapshot._nodes);\n let historyValue = currentSnapshot.historyValue;\n const filteredTransitions = removeConflictingTransitions(transitions, mutStateNodeSet, historyValue);\n let nextState = currentSnapshot;\n\n // Exit states\n if (!isInitial) {\n [nextState, historyValue] = exitStates(nextState, event, actorScope, filteredTransitions, mutStateNodeSet, historyValue, internalQueue, actorScope.actionExecutor);\n }\n\n // Execute transition content\n nextState = resolveActionsAndContext(nextState, event, actorScope, filteredTransitions.flatMap(t => t.actions), internalQueue, undefined);\n\n // Enter states\n nextState = enterStates(nextState, event, actorScope, filteredTransitions, mutStateNodeSet, internalQueue, historyValue, isInitial);\n const nextStateNodes = [...mutStateNodeSet];\n if (nextState.status === 'done') {\n nextState = resolveActionsAndContext(nextState, event, actorScope, nextStateNodes.sort((a, b) => b.order - a.order).flatMap(state => state.exit), internalQueue, undefined);\n }\n\n // eslint-disable-next-line no-useless-catch\n try {\n if (historyValue === currentSnapshot.historyValue && areStateNodeCollectionsEqual(currentSnapshot._nodes, mutStateNodeSet)) {\n return nextState;\n }\n return cloneMachineSnapshot(nextState, {\n _nodes: nextStateNodes,\n historyValue\n });\n } catch (e) {\n // TODO: Refactor this once proper error handling is implemented.\n // See https://github.com/statelyai/rfcs/pull/4\n throw e;\n }\n}\nfunction getMachineOutput(snapshot, event, actorScope, rootNode, rootCompletionNode) {\n if (rootNode.output === undefined) {\n return;\n }\n const doneStateEvent = createDoneStateEvent(rootCompletionNode.id, rootCompletionNode.output !== undefined && rootCompletionNode.parent ? resolveOutput(rootCompletionNode.output, snapshot.context, event, actorScope.self) : undefined);\n return resolveOutput(rootNode.output, snapshot.context, doneStateEvent, actorScope.self);\n}\nfunction enterStates(currentSnapshot, event, actorScope, filteredTransitions, mutStateNodeSet, internalQueue, historyValue, isInitial) {\n let nextSnapshot = currentSnapshot;\n const statesToEnter = new Set();\n // those are states that were directly targeted or indirectly targeted by the explicit target\n // in other words, those are states for which initial actions should be executed\n // when we target `#deep_child` initial actions of its ancestors shouldn't be executed\n const statesForDefaultEntry = new Set();\n computeEntrySet(filteredTransitions, historyValue, statesForDefaultEntry, statesToEnter);\n\n // In the initial state, the root state node is \"entered\".\n if (isInitial) {\n statesForDefaultEntry.add(currentSnapshot.machine.root);\n }\n const completedNodes = new Set();\n for (const stateNodeToEnter of [...statesToEnter].sort((a, b) => a.order - b.order)) {\n mutStateNodeSet.add(stateNodeToEnter);\n const actions = [];\n\n // Add entry actions\n actions.push(...stateNodeToEnter.entry);\n for (const invokeDef of stateNodeToEnter.invoke) {\n actions.push(spawnChild(invokeDef.src, {\n ...invokeDef,\n syncSnapshot: !!invokeDef.onSnapshot\n }));\n }\n if (statesForDefaultEntry.has(stateNodeToEnter)) {\n const initialActions = stateNodeToEnter.initial.actions;\n actions.push(...initialActions);\n }\n nextSnapshot = resolveActionsAndContext(nextSnapshot, event, actorScope, actions, internalQueue, stateNodeToEnter.invoke.map(invokeDef => invokeDef.id));\n if (stateNodeToEnter.type === 'final') {\n const parent = stateNodeToEnter.parent;\n let ancestorMarker = parent?.type === 'parallel' ? parent : parent?.parent;\n let rootCompletionNode = ancestorMarker || stateNodeToEnter;\n if (parent?.type === 'compound') {\n internalQueue.push(createDoneStateEvent(parent.id, stateNodeToEnter.output !== undefined ? resolveOutput(stateNodeToEnter.output, nextSnapshot.context, event, actorScope.self) : undefined));\n }\n while (ancestorMarker?.type === 'parallel' && !completedNodes.has(ancestorMarker) && isInFinalState(mutStateNodeSet, ancestorMarker)) {\n completedNodes.add(ancestorMarker);\n internalQueue.push(createDoneStateEvent(ancestorMarker.id));\n rootCompletionNode = ancestorMarker;\n ancestorMarker = ancestorMarker.parent;\n }\n if (ancestorMarker) {\n continue;\n }\n nextSnapshot = cloneMachineSnapshot(nextSnapshot, {\n status: 'done',\n output: getMachineOutput(nextSnapshot, event, actorScope, nextSnapshot.machine.root, rootCompletionNode)\n });\n }\n }\n return nextSnapshot;\n}\nfunction computeEntrySet(transitions, historyValue, statesForDefaultEntry, statesToEnter) {\n for (const t of transitions) {\n const domain = getTransitionDomain(t, historyValue);\n for (const s of t.target || []) {\n if (!isHistoryNode(s) && (\n // if the target is different than the source then it will *definitely* be entered\n t.source !== s ||\n // we know that the domain can't lie within the source\n // if it's different than the source then it's outside of it and it means that the target has to be entered as well\n t.source !== domain ||\n // reentering transitions always enter the target, even if it's the source itself\n t.reenter)) {\n statesToEnter.add(s);\n statesForDefaultEntry.add(s);\n }\n addDescendantStatesToEnter(s, historyValue, statesForDefaultEntry, statesToEnter);\n }\n const targetStates = getEffectiveTargetStates(t, historyValue);\n for (const s of targetStates) {\n const ancestors = getProperAncestors(s, domain);\n if (domain?.type === 'parallel') {\n ancestors.push(domain);\n }\n addAncestorStatesToEnter(statesToEnter, historyValue, statesForDefaultEntry, ancestors, !t.source.parent && t.reenter ? undefined : domain);\n }\n }\n}\nfunction addDescendantStatesToEnter(stateNode, historyValue, statesForDefaultEntry, statesToEnter) {\n if (isHistoryNode(stateNode)) {\n if (historyValue[stateNode.id]) {\n const historyStateNodes = historyValue[stateNode.id];\n for (const s of historyStateNodes) {\n statesToEnter.add(s);\n addDescendantStatesToEnter(s, historyValue, statesForDefaultEntry, statesToEnter);\n }\n for (const s of historyStateNodes) {\n addProperAncestorStatesToEnter(s, stateNode.parent, statesToEnter, historyValue, statesForDefaultEntry);\n }\n } else {\n const historyDefaultTransition = resolveHistoryDefaultTransition(stateNode);\n for (const s of historyDefaultTransition.target) {\n statesToEnter.add(s);\n if (historyDefaultTransition === stateNode.parent?.initial) {\n statesForDefaultEntry.add(stateNode.parent);\n }\n addDescendantStatesToEnter(s, historyValue, statesForDefaultEntry, statesToEnter);\n }\n for (const s of historyDefaultTransition.target) {\n addProperAncestorStatesToEnter(s, stateNode.parent, statesToEnter, historyValue, statesForDefaultEntry);\n }\n }\n } else {\n if (stateNode.type === 'compound') {\n const [initialState] = stateNode.initial.target;\n if (!isHistoryNode(initialState)) {\n statesToEnter.add(initialState);\n statesForDefaultEntry.add(initialState);\n }\n addDescendantStatesToEnter(initialState, historyValue, statesForDefaultEntry, statesToEnter);\n addProperAncestorStatesToEnter(initialState, stateNode, statesToEnter, historyValue, statesForDefaultEntry);\n } else {\n if (stateNode.type === 'parallel') {\n for (const child of getChildren(stateNode).filter(sn => !isHistoryNode(sn))) {\n if (![...statesToEnter].some(s => isDescendant(s, child))) {\n if (!isHistoryNode(child)) {\n statesToEnter.add(child);\n statesForDefaultEntry.add(child);\n }\n addDescendantStatesToEnter(child, historyValue, statesForDefaultEntry, statesToEnter);\n }\n }\n }\n }\n }\n}\nfunction addAncestorStatesToEnter(statesToEnter, historyValue, statesForDefaultEntry, ancestors, reentrancyDomain) {\n for (const anc of ancestors) {\n if (!reentrancyDomain || isDescendant(anc, reentrancyDomain)) {\n statesToEnter.add(anc);\n }\n if (anc.type === 'parallel') {\n for (const child of getChildren(anc).filter(sn => !isHistoryNode(sn))) {\n if (![...statesToEnter].some(s => isDescendant(s, child))) {\n statesToEnter.add(child);\n addDescendantStatesToEnter(child, historyValue, statesForDefaultEntry, statesToEnter);\n }\n }\n }\n }\n}\nfunction addProperAncestorStatesToEnter(stateNode, toStateNode, statesToEnter, historyValue, statesForDefaultEntry) {\n addAncestorStatesToEnter(statesToEnter, historyValue, statesForDefaultEntry, getProperAncestors(stateNode, toStateNode));\n}\nfunction exitStates(currentSnapshot, event, actorScope, transitions, mutStateNodeSet, historyValue, internalQueue, _actionExecutor) {\n let nextSnapshot = currentSnapshot;\n const statesToExit = computeExitSet(transitions, mutStateNodeSet, historyValue);\n statesToExit.sort((a, b) => b.order - a.order);\n let changedHistory;\n\n // From SCXML algorithm: https://www.w3.org/TR/scxml/#exitStates\n for (const exitStateNode of statesToExit) {\n for (const historyNode of getHistoryNodes(exitStateNode)) {\n let predicate;\n if (historyNode.history === 'deep') {\n predicate = sn => isAtomicStateNode(sn) && isDescendant(sn, exitStateNode);\n } else {\n predicate = sn => {\n return sn.parent === exitStateNode;\n };\n }\n changedHistory ??= {\n ...historyValue\n };\n changedHistory[historyNode.id] = Array.from(mutStateNodeSet).filter(predicate);\n }\n }\n for (const s of statesToExit) {\n nextSnapshot = resolveActionsAndContext(nextSnapshot, event, actorScope, [...s.exit, ...s.invoke.map(def => stopChild(def.id))], internalQueue, undefined);\n mutStateNodeSet.delete(s);\n }\n return [nextSnapshot, changedHistory || historyValue];\n}\nfunction getAction(machine, actionType) {\n return machine.implementations.actions[actionType];\n}\nfunction resolveAndExecuteActionsWithContext(currentSnapshot, event, actorScope, actions, extra, retries) {\n const {\n machine\n } = currentSnapshot;\n let intermediateSnapshot = currentSnapshot;\n for (const action of actions) {\n const isInline = typeof action === 'function';\n const resolvedAction = isInline ? action :\n // the existing type of `.actions` assumes non-nullable `TExpressionAction`\n // it's fine to cast this here to get a common type and lack of errors in the rest of the code\n // our logic below makes sure that we call those 2 \"variants\" correctly\n\n getAction(machine, typeof action === 'string' ? action : action.type);\n const actionArgs = {\n context: intermediateSnapshot.context,\n event,\n self: actorScope.self,\n system: actorScope.system\n };\n const actionParams = isInline || typeof action === 'string' ? undefined : 'params' in action ? typeof action.params === 'function' ? action.params({\n context: intermediateSnapshot.context,\n event\n }) : action.params : undefined;\n if (!resolvedAction || !('resolve' in resolvedAction)) {\n actorScope.actionExecutor({\n type: typeof action === 'string' ? action : typeof action === 'object' ? action.type : action.name || '(anonymous)',\n info: actionArgs,\n params: actionParams,\n exec: resolvedAction\n });\n continue;\n }\n const builtinAction = resolvedAction;\n const [nextState, params, actions] = builtinAction.resolve(actorScope, intermediateSnapshot, actionArgs, actionParams, resolvedAction,\n // this holds all params\n extra);\n intermediateSnapshot = nextState;\n if ('retryResolve' in builtinAction) {\n retries?.push([builtinAction, params]);\n }\n if ('execute' in builtinAction) {\n actorScope.actionExecutor({\n type: builtinAction.type,\n info: actionArgs,\n params,\n exec: builtinAction.execute.bind(null, actorScope, params)\n });\n }\n if (actions) {\n intermediateSnapshot = resolveAndExecuteActionsWithContext(intermediateSnapshot, event, actorScope, actions, extra, retries);\n }\n }\n return intermediateSnapshot;\n}\nfunction resolveActionsAndContext(currentSnapshot, event, actorScope, actions, internalQueue, deferredActorIds) {\n const retries = deferredActorIds ? [] : undefined;\n const nextState = resolveAndExecuteActionsWithContext(currentSnapshot, event, actorScope, actions, {\n internalQueue,\n deferredActorIds\n }, retries);\n retries?.forEach(([builtinAction, params]) => {\n builtinAction.retryResolve(actorScope, nextState, params);\n });\n return nextState;\n}\nfunction macrostep(snapshot, event, actorScope, internalQueue) {\n let nextSnapshot = snapshot;\n const microstates = [];\n function addMicrostate(microstate, event, transitions) {\n actorScope.system._sendInspectionEvent({\n type: '@xstate.microstep',\n actorRef: actorScope.self,\n event,\n snapshot: microstate,\n _transitions: transitions\n });\n microstates.push(microstate);\n }\n\n // Handle stop event\n if (event.type === XSTATE_STOP) {\n nextSnapshot = cloneMachineSnapshot(stopChildren(nextSnapshot, event, actorScope), {\n status: 'stopped'\n });\n addMicrostate(nextSnapshot, event, []);\n return {\n snapshot: nextSnapshot,\n microstates\n };\n }\n let nextEvent = event;\n\n // Assume the state is at rest (no raised events)\n // Determine the next state based on the next microstep\n if (nextEvent.type !== XSTATE_INIT) {\n const currentEvent = nextEvent;\n const isErr = isErrorActorEvent(currentEvent);\n const transitions = selectTransitions(currentEvent, nextSnapshot);\n if (isErr && !transitions.length) {\n // TODO: we should likely only allow transitions selected by very explicit descriptors\n // `*` shouldn't be matched, likely `xstate.error.*` shouldn't be either\n // similarly `xstate.error.actor.*` and `xstate.error.actor.todo.*` have to be considered too\n nextSnapshot = cloneMachineSnapshot(snapshot, {\n status: 'error',\n error: currentEvent.error\n });\n addMicrostate(nextSnapshot, currentEvent, []);\n return {\n snapshot: nextSnapshot,\n microstates\n };\n }\n nextSnapshot = microstep(transitions, snapshot, actorScope, nextEvent, false,\n // isInitial\n internalQueue);\n addMicrostate(nextSnapshot, currentEvent, transitions);\n }\n let shouldSelectEventlessTransitions = true;\n while (nextSnapshot.status === 'active') {\n let enabledTransitions = shouldSelectEventlessTransitions ? selectEventlessTransitions(nextSnapshot, nextEvent) : [];\n\n // eventless transitions should always be selected after selecting *regular* transitions\n // by assigning `undefined` to `previousState` we ensure that `shouldSelectEventlessTransitions` gets always computed to true in such a case\n const previousState = enabledTransitions.length ? nextSnapshot : undefined;\n if (!enabledTransitions.length) {\n if (!internalQueue.length) {\n break;\n }\n nextEvent = internalQueue.shift();\n enabledTransitions = selectTransitions(nextEvent, nextSnapshot);\n }\n nextSnapshot = microstep(enabledTransitions, nextSnapshot, actorScope, nextEvent, false, internalQueue);\n shouldSelectEventlessTransitions = nextSnapshot !== previousState;\n addMicrostate(nextSnapshot, nextEvent, enabledTransitions);\n }\n if (nextSnapshot.status !== 'active') {\n stopChildren(nextSnapshot, nextEvent, actorScope);\n }\n return {\n snapshot: nextSnapshot,\n microstates\n };\n}\nfunction stopChildren(nextState, event, actorScope) {\n return resolveActionsAndContext(nextState, event, actorScope, Object.values(nextState.children).map(child => stopChild(child)), [], undefined);\n}\nfunction selectTransitions(event, nextState) {\n return nextState.machine.getTransitionData(nextState, event);\n}\nfunction selectEventlessTransitions(nextState, event) {\n const enabledTransitionSet = new Set();\n const atomicStates = nextState._nodes.filter(isAtomicStateNode);\n for (const stateNode of atomicStates) {\n loop: for (const s of [stateNode].concat(getProperAncestors(stateNode, undefined))) {\n if (!s.always) {\n continue;\n }\n for (const transition of s.always) {\n if (transition.guard === undefined || evaluateGuard(transition.guard, nextState.context, event, nextState)) {\n enabledTransitionSet.add(transition);\n break loop;\n }\n }\n }\n }\n return removeConflictingTransitions(Array.from(enabledTransitionSet), new Set(nextState._nodes), nextState.historyValue);\n}\n\n/**\n * Resolves a partial state value with its full representation in the state\n * node's machine.\n *\n * @param stateValue The partial state value to resolve.\n */\nfunction resolveStateValue(rootNode, stateValue) {\n const allStateNodes = getAllStateNodes(getStateNodes(rootNode, stateValue));\n return getStateValue(rootNode, [...allStateNodes]);\n}\n\nfunction isMachineSnapshot(value) {\n return !!value && typeof value === 'object' && 'machine' in value && 'value' in value;\n}\nconst machineSnapshotMatches = function matches(testValue) {\n return matchesState(testValue, this.value);\n};\nconst machineSnapshotHasTag = function hasTag(tag) {\n return this.tags.has(tag);\n};\nconst machineSnapshotCan = function can(event) {\n const transitionData = this.machine.getTransitionData(this, event);\n return !!transitionData?.length &&\n // Check that at least one transition is not forbidden\n transitionData.some(t => t.target !== undefined || t.actions.length);\n};\nconst machineSnapshotToJSON = function toJSON() {\n const {\n _nodes: nodes,\n tags,\n machine,\n getMeta,\n toJSON,\n can,\n hasTag,\n matches,\n ...jsonValues\n } = this;\n return {\n ...jsonValues,\n tags: Array.from(tags)\n };\n};\nconst machineSnapshotGetMeta = function getMeta() {\n return this._nodes.reduce((acc, stateNode) => {\n if (stateNode.meta !== undefined) {\n acc[stateNode.id] = stateNode.meta;\n }\n return acc;\n }, {});\n};\nfunction createMachineSnapshot(config, machine) {\n return {\n status: config.status,\n output: config.output,\n error: config.error,\n machine,\n context: config.context,\n _nodes: config._nodes,\n value: getStateValue(machine.root, config._nodes),\n tags: new Set(config._nodes.flatMap(sn => sn.tags)),\n children: config.children,\n historyValue: config.historyValue || {},\n matches: machineSnapshotMatches,\n hasTag: machineSnapshotHasTag,\n can: machineSnapshotCan,\n getMeta: machineSnapshotGetMeta,\n toJSON: machineSnapshotToJSON\n };\n}\nfunction cloneMachineSnapshot(snapshot, config = {}) {\n return createMachineSnapshot({\n ...snapshot,\n ...config\n }, snapshot.machine);\n}\nfunction serializeHistoryValue(historyValue) {\n if (typeof historyValue !== 'object' || historyValue === null) {\n return {};\n }\n const result = {};\n for (const key in historyValue) {\n const value = historyValue[key];\n if (Array.isArray(value)) {\n result[key] = value.map(item => ({\n id: item.id\n }));\n }\n }\n return result;\n}\nfunction getPersistedSnapshot(snapshot, options) {\n const {\n _nodes: nodes,\n tags,\n machine,\n children,\n context,\n can,\n hasTag,\n matches,\n getMeta,\n toJSON,\n ...jsonValues\n } = snapshot;\n const childrenJson = {};\n for (const id in children) {\n const child = children[id];\n childrenJson[id] = {\n snapshot: child.getPersistedSnapshot(options),\n src: child.src,\n systemId: child._systemId,\n syncSnapshot: child._syncSnapshot\n };\n }\n const persisted = {\n ...jsonValues,\n context: persistContext(context),\n children: childrenJson,\n historyValue: serializeHistoryValue(jsonValues.historyValue)\n };\n return persisted;\n}\nfunction persistContext(contextPart) {\n let copy;\n for (const key in contextPart) {\n const value = contextPart[key];\n if (value && typeof value === 'object') {\n if ('sessionId' in value && 'send' in value && 'ref' in value) {\n copy ??= Array.isArray(contextPart) ? contextPart.slice() : {\n ...contextPart\n };\n copy[key] = {\n xstate$$type: $$ACTOR_TYPE,\n id: value.id\n };\n } else {\n const result = persistContext(value);\n if (result !== value) {\n copy ??= Array.isArray(contextPart) ? contextPart.slice() : {\n ...contextPart\n };\n copy[key] = result;\n }\n }\n }\n }\n return copy ?? contextPart;\n}\n\nfunction resolveRaise(_, snapshot, args, actionParams, {\n event: eventOrExpr,\n id,\n delay\n}, {\n internalQueue\n}) {\n const delaysMap = snapshot.machine.implementations.delays;\n if (typeof eventOrExpr === 'string') {\n throw new Error(\n // eslint-disable-next-line @typescript-eslint/restrict-template-expressions\n `Only event objects may be used with raise; use raise({ type: \"${eventOrExpr}\" }) instead`);\n }\n const resolvedEvent = typeof eventOrExpr === 'function' ? eventOrExpr(args, actionParams) : eventOrExpr;\n let resolvedDelay;\n if (typeof delay === 'string') {\n const configDelay = delaysMap && delaysMap[delay];\n resolvedDelay = typeof configDelay === 'function' ? configDelay(args, actionParams) : configDelay;\n } else {\n resolvedDelay = typeof delay === 'function' ? delay(args, actionParams) : delay;\n }\n if (typeof resolvedDelay !== 'number') {\n internalQueue.push(resolvedEvent);\n }\n return [snapshot, {\n event: resolvedEvent,\n id,\n delay: resolvedDelay\n }, undefined];\n}\nfunction executeRaise(actorScope, params) {\n const {\n event,\n delay,\n id\n } = params;\n if (typeof delay === 'number') {\n actorScope.defer(() => {\n const self = actorScope.self;\n actorScope.system.scheduler.schedule(self, self, event, delay, id);\n });\n return;\n }\n}\n/**\n * Raises an event. This places the event in the internal event queue, so that\n * the event is immediately consumed by the machine in the current step.\n *\n * @param eventType The event to raise.\n */\nfunction raise(eventOrExpr, options) {\n function raise(_args, _params) {\n }\n raise.type = 'xstate.raise';\n raise.event = eventOrExpr;\n raise.id = options?.id;\n raise.delay = options?.delay;\n raise.resolve = resolveRaise;\n raise.execute = executeRaise;\n return raise;\n}\n\nexport { $$ACTOR_TYPE as $, Actor as A, getCandidates as B, resolveStateValue as C, getAllStateNodes as D, createMachineSnapshot as E, isInFinalState as F, macrostep as G, transitionNode as H, resolveActionsAndContext as I, createInitEvent as J, microstep as K, getInitialStateNodes as L, toStatePath as M, NULL_EVENT as N, isStateId as O, getStateNodeByPath as P, getPersistedSnapshot as Q, resolveReferencedActor as R, STATE_DELIMITER as S, XSTATE_ERROR as T, createErrorActorEvent as U, ProcessingStatus as V, cloneMachineSnapshot as W, XSTATE_STOP as X, and as a, isMachineSnapshot as b, createActor as c, getAllOwnEventDescriptors as d, toObserver as e, cancel as f, getStateNodes as g, spawnChild as h, interpret as i, stop as j, stopChild as k, mapValues as l, matchesState as m, not as n, or as o, pathToStateValue as p, formatTransitions as q, raise as r, stateIn as s, toArray as t, toTransitionConfigArray as u, formatTransition as v, evaluateGuard as w, createInvokeId as x, getDelayedTransitions as y, formatInitialTransition as z };\n","import { V as ProcessingStatus, R as resolveReferencedActor, c as createActor, W as cloneMachineSnapshot } from './raise-b0a4e862.esm.js';\n\nfunction createSpawner(actorScope, {\n machine,\n context\n}, event, spawnedChildren) {\n const spawn = (src, options) => {\n if (typeof src === 'string') {\n const logic = resolveReferencedActor(machine, src);\n if (!logic) {\n throw new Error(`Actor logic '${src}' not implemented in machine '${machine.id}'`);\n }\n const actorRef = createActor(logic, {\n id: options?.id,\n parent: actorScope.self,\n syncSnapshot: options?.syncSnapshot,\n input: typeof options?.input === 'function' ? options.input({\n context,\n event,\n self: actorScope.self\n }) : options?.input,\n src,\n systemId: options?.systemId\n });\n spawnedChildren[actorRef.id] = actorRef;\n return actorRef;\n } else {\n const actorRef = createActor(src, {\n id: options?.id,\n parent: actorScope.self,\n syncSnapshot: options?.syncSnapshot,\n input: options?.input,\n src,\n systemId: options?.systemId\n });\n return actorRef;\n }\n };\n return (src, options) => {\n const actorRef = spawn(src, options); // TODO: fix types\n spawnedChildren[actorRef.id] = actorRef;\n actorScope.defer(() => {\n if (actorRef._processingStatus === ProcessingStatus.Stopped) {\n return;\n }\n actorRef.start();\n });\n return actorRef;\n };\n}\n\nfunction resolveAssign(actorScope, snapshot, actionArgs, actionParams, {\n assignment\n}) {\n if (!snapshot.context) {\n throw new Error('Cannot assign to undefined `context`. Ensure that `context` is defined in the machine config.');\n }\n const spawnedChildren = {};\n const assignArgs = {\n context: snapshot.context,\n event: actionArgs.event,\n spawn: createSpawner(actorScope, snapshot, actionArgs.event, spawnedChildren),\n self: actorScope.self,\n system: actorScope.system\n };\n let partialUpdate = {};\n if (typeof assignment === 'function') {\n partialUpdate = assignment(assignArgs, actionParams);\n } else {\n for (const key of Object.keys(assignment)) {\n const propAssignment = assignment[key];\n partialUpdate[key] = typeof propAssignment === 'function' ? propAssignment(assignArgs, actionParams) : propAssignment;\n }\n }\n const updatedContext = Object.assign({}, snapshot.context, partialUpdate);\n return [cloneMachineSnapshot(snapshot, {\n context: updatedContext,\n children: Object.keys(spawnedChildren).length ? {\n ...snapshot.children,\n ...spawnedChildren\n } : snapshot.children\n }), undefined, undefined];\n}\n/**\n * Updates the current context of the machine.\n *\n * @example\n *\n * ```ts\n * import { createMachine, assign } from 'xstate';\n *\n * const countMachine = createMachine({\n * context: {\n * count: 0,\n * message: ''\n * },\n * on: {\n * inc: {\n * actions: assign({\n * count: ({ context }) => context.count + 1\n * })\n * },\n * updateMessage: {\n * actions: assign(({ context, event }) => {\n * return {\n * message: event.message.trim()\n * };\n * })\n * }\n * }\n * });\n * ```\n *\n * @param assignment An object that represents the partial context to update, or\n * a function that returns an object that represents the partial context to\n * update.\n */\nfunction assign(assignment) {\n function assign(_args, _params) {\n }\n assign.type = 'xstate.assign';\n assign.assignment = assignment;\n assign.resolve = resolveAssign;\n return assign;\n}\n\nexport { assign as a };\n","import { S as STATE_DELIMITER, l as mapValues, t as toArray, q as formatTransitions, u as toTransitionConfigArray, v as formatTransition, N as NULL_EVENT, w as evaluateGuard, x as createInvokeId, y as getDelayedTransitions, z as formatInitialTransition, B as getCandidates, C as resolveStateValue, D as getAllStateNodes, g as getStateNodes, E as createMachineSnapshot, F as isInFinalState, G as macrostep, H as transitionNode, I as resolveActionsAndContext, J as createInitEvent, K as microstep, L as getInitialStateNodes, M as toStatePath, O as isStateId, P as getStateNodeByPath, Q as getPersistedSnapshot, R as resolveReferencedActor, c as createActor, $ as $$ACTOR_TYPE } from './raise-b0a4e862.esm.js';\nimport { a as assign } from './assign-c3259787.esm.js';\n\nconst cache = new WeakMap();\nfunction memo(object, key, fn) {\n let memoizedData = cache.get(object);\n if (!memoizedData) {\n memoizedData = {\n [key]: fn()\n };\n cache.set(object, memoizedData);\n } else if (!(key in memoizedData)) {\n memoizedData[key] = fn();\n }\n return memoizedData[key];\n}\n\nconst EMPTY_OBJECT = {};\nconst toSerializableAction = action => {\n if (typeof action === 'string') {\n return {\n type: action\n };\n }\n if (typeof action === 'function') {\n if ('resolve' in action) {\n return {\n type: action.type\n };\n }\n return {\n type: action.name\n };\n }\n return action;\n};\nclass StateNode {\n constructor(/** The raw config used to create the machine. */\n config, options) {\n this.config = config;\n /**\n * The relative key of the state node, which represents its location in the\n * overall state value.\n */\n this.key = void 0;\n /** The unique ID of the state node. */\n this.id = void 0;\n /**\n * The type of this state node:\n *\n * - `'atomic'` - no child state nodes\n * - `'compound'` - nested child state nodes (XOR)\n * - `'parallel'` - orthogonal nested child state nodes (AND)\n * - `'history'` - history state node\n * - `'final'` - final state node\n */\n this.type = void 0;\n /** The string path from the root machine node to this node. */\n this.path = void 0;\n /** The child state nodes. */\n this.states = void 0;\n /**\n * The type of history on this state node. Can be:\n *\n * - `'shallow'` - recalls only top-level historical state value\n * - `'deep'` - recalls historical state value at all levels\n */\n this.history = void 0;\n /** The action(s) to be executed upon entering the state node. */\n this.entry = void 0;\n /** The action(s) to be executed upon exiting the state node. */\n this.exit = void 0;\n /** The parent state node. */\n this.parent = void 0;\n /** The root machine node. */\n this.machine = void 0;\n /**\n * The meta data associated with this state node, which will be returned in\n * State instances.\n */\n this.meta = void 0;\n /**\n * The output data sent with the \"xstate.done.state._id_\" event if this is a\n * final state node.\n */\n this.output = void 0;\n /**\n * The order this state node appears. Corresponds to the implicit document\n * order.\n */\n this.order = -1;\n this.description = void 0;\n this.tags = [];\n this.transitions = void 0;\n this.always = void 0;\n this.parent = options._parent;\n this.key = options._key;\n this.machine = options._machine;\n this.path = this.parent ? this.parent.path.concat(this.key) : [];\n this.id = this.config.id || [this.machine.id, ...this.path].join(STATE_DELIMITER);\n this.type = this.config.type || (this.config.states && Object.keys(this.config.states).length ? 'compound' : this.config.history ? 'history' : 'atomic');\n this.description = this.config.description;\n this.order = this.machine.idMap.size;\n this.machine.idMap.set(this.id, this);\n this.states = this.config.states ? mapValues(this.config.states, (stateConfig, key) => {\n const stateNode = new StateNode(stateConfig, {\n _parent: this,\n _key: key,\n _machine: this.machine\n });\n return stateNode;\n }) : EMPTY_OBJECT;\n if (this.type === 'compound' && !this.config.initial) {\n throw new Error(`No initial state specified for compound state node \"#${this.id}\". Try adding { initial: \"${Object.keys(this.states)[0]}\" } to the state config.`);\n }\n\n // History config\n this.history = this.config.history === true ? 'shallow' : this.config.history || false;\n this.entry = toArray(this.config.entry).slice();\n this.exit = toArray(this.config.exit).slice();\n this.meta = this.config.meta;\n this.output = this.type === 'final' || !this.parent ? this.config.output : undefined;\n this.tags = toArray(config.tags).slice();\n }\n\n /** @internal */\n _initialize() {\n this.transitions = formatTransitions(this);\n if (this.config.always) {\n this.always = toTransitionConfigArray(this.config.always).map(t => formatTransition(this, NULL_EVENT, t));\n }\n Object.keys(this.states).forEach(key => {\n this.states[key]._initialize();\n });\n }\n\n /** The well-structured state node definition. */\n get definition() {\n return {\n id: this.id,\n key: this.key,\n version: this.machine.version,\n type: this.type,\n initial: this.initial ? {\n target: this.initial.target,\n source: this,\n actions: this.initial.actions.map(toSerializableAction),\n eventType: null,\n reenter: false,\n toJSON: () => ({\n target: this.initial.target.map(t => `#${t.id}`),\n source: `#${this.id}`,\n actions: this.initial.actions.map(toSerializableAction),\n eventType: null\n })\n } : undefined,\n history: this.history,\n states: mapValues(this.states, state => {\n return state.definition;\n }),\n on: this.on,\n transitions: [...this.transitions.values()].flat().map(t => ({\n ...t,\n actions: t.actions.map(toSerializableAction)\n })),\n entry: this.entry.map(toSerializableAction),\n exit: this.exit.map(toSerializableAction),\n meta: this.meta,\n order: this.order || -1,\n output: this.output,\n invoke: this.invoke,\n description: this.description,\n tags: this.tags\n };\n }\n\n /** @internal */\n toJSON() {\n return this.definition;\n }\n\n /** The logic invoked as actors by this state node. */\n get invoke() {\n return memo(this, 'invoke', () => toArray(this.config.invoke).map((invokeConfig, i) => {\n const {\n src,\n systemId\n } = invokeConfig;\n const resolvedId = invokeConfig.id ?? createInvokeId(this.id, i);\n const sourceName = typeof src === 'string' ? src : `xstate.invoke.${createInvokeId(this.id, i)}`;\n return {\n ...invokeConfig,\n src: sourceName,\n id: resolvedId,\n systemId: systemId,\n toJSON() {\n const {\n onDone,\n onError,\n ...invokeDefValues\n } = invokeConfig;\n return {\n ...invokeDefValues,\n type: 'xstate.invoke',\n src: sourceName,\n id: resolvedId\n };\n }\n };\n }));\n }\n\n /** The mapping of events to transitions. */\n get on() {\n return memo(this, 'on', () => {\n const transitions = this.transitions;\n return [...transitions].flatMap(([descriptor, t]) => t.map(t => [descriptor, t])).reduce((map, [descriptor, transition]) => {\n map[descriptor] = map[descriptor] || [];\n map[descriptor].push(transition);\n return map;\n }, {});\n });\n }\n get after() {\n return memo(this, 'delayedTransitions', () => getDelayedTransitions(this));\n }\n get initial() {\n return memo(this, 'initial', () => formatInitialTransition(this, this.config.initial));\n }\n\n /** @internal */\n next(snapshot, event) {\n const eventType = event.type;\n const actions = [];\n let selectedTransition;\n const candidates = memo(this, `candidates-${eventType}`, () => getCandidates(this, eventType));\n for (const candidate of candidates) {\n const {\n guard\n } = candidate;\n const resolvedContext = snapshot.context;\n let guardPassed = false;\n try {\n guardPassed = !guard || evaluateGuard(guard, resolvedContext, event, snapshot);\n } catch (err) {\n const guardType = typeof guard === 'string' ? guard : typeof guard === 'object' ? guard.type : undefined;\n throw new Error(`Unable to evaluate guard ${guardType ? `'${guardType}' ` : ''}in transition for event '${eventType}' in state node '${this.id}':\\n${err.message}`);\n }\n if (guardPassed) {\n actions.push(...candidate.actions);\n selectedTransition = candidate;\n break;\n }\n }\n return selectedTransition ? [selectedTransition] : undefined;\n }\n\n /** All the event types accepted by this state node and its descendants. */\n get events() {\n return memo(this, 'events', () => {\n const {\n states\n } = this;\n const events = new Set(this.ownEvents);\n if (states) {\n for (const stateId of Object.keys(states)) {\n const state = states[stateId];\n if (state.states) {\n for (const event of state.events) {\n events.add(`${event}`);\n }\n }\n }\n }\n return Array.from(events);\n });\n }\n\n /**\n * All the events that have transitions directly from this state node.\n *\n * Excludes any inert events.\n */\n get ownEvents() {\n const events = new Set([...this.transitions.keys()].filter(descriptor => {\n return this.transitions.get(descriptor).some(transition => !(!transition.target && !transition.actions.length && !transition.reenter));\n }));\n return Array.from(events);\n }\n}\n\nconst STATE_IDENTIFIER = '#';\nclass StateMachine {\n constructor(/** The raw config used to create the machine. */\n config, implementations) {\n this.config = config;\n /** The machine's own version. */\n this.version = void 0;\n this.schemas = void 0;\n this.implementations = void 0;\n /** @internal */\n this.__xstatenode = true;\n /** @internal */\n this.idMap = new Map();\n this.root = void 0;\n this.id = void 0;\n this.states = void 0;\n this.events = void 0;\n this.id = config.id || '(machine)';\n this.implementations = {\n actors: implementations?.actors ?? {},\n actions: implementations?.actions ?? {},\n delays: implementations?.delays ?? {},\n guards: implementations?.guards ?? {}\n };\n this.version = this.config.version;\n this.schemas = this.config.schemas;\n this.transition = this.transition.bind(this);\n this.getInitialSnapshot = this.getInitialSnapshot.bind(this);\n this.getPersistedSnapshot = this.getPersistedSnapshot.bind(this);\n this.restoreSnapshot = this.restoreSnapshot.bind(this);\n this.start = this.start.bind(this);\n this.root = new StateNode(config, {\n _key: this.id,\n _machine: this\n });\n this.root._initialize();\n this.states = this.root.states; // TODO: remove!\n this.events = this.root.events;\n }\n\n /**\n * Clones this state machine with the provided implementations.\n *\n * @param implementations Options (`actions`, `guards`, `actors`, `delays`) to\n * recursively merge with the existing options.\n * @returns A new `StateMachine` instance with the provided implementations.\n */\n provide(implementations) {\n const {\n actions,\n guards,\n actors,\n delays\n } = this.implementations;\n return new StateMachine(this.config, {\n actions: {\n ...actions,\n ...implementations.actions\n },\n guards: {\n ...guards,\n ...implementations.guards\n },\n actors: {\n ...actors,\n ...implementations.actors\n },\n delays: {\n ...delays,\n ...implementations.delays\n }\n });\n }\n resolveState(config) {\n const resolvedStateValue = resolveStateValue(this.root, config.value);\n const nodeSet = getAllStateNodes(getStateNodes(this.root, resolvedStateValue));\n return createMachineSnapshot({\n _nodes: [...nodeSet],\n context: config.context || {},\n children: {},\n status: isInFinalState(nodeSet, this.root) ? 'done' : config.status || 'active',\n output: config.output,\n error: config.error,\n historyValue: config.historyValue\n }, this);\n }\n\n /**\n * Determines the next snapshot given the current `snapshot` and received\n * `event`. Calculates a full macrostep from all microsteps.\n *\n * @param snapshot The current snapshot\n * @param event The received event\n */\n transition(snapshot, event, actorScope) {\n return macrostep(snapshot, event, actorScope, []).snapshot;\n }\n\n /**\n * Determines the next state given the current `state` and `event`. Calculates\n * a microstep.\n *\n * @param state The current state\n * @param event The received event\n */\n microstep(snapshot, event, actorScope) {\n return macrostep(snapshot, event, actorScope, []).microstates;\n }\n getTransitionData(snapshot, event) {\n return transitionNode(this.root, snapshot.value, snapshot, event) || [];\n }\n\n /**\n * The initial state _before_ evaluating any microsteps. This \"pre-initial\"\n * state is provided to initial actions executed in the initial state.\n */\n getPreInitialState(actorScope, initEvent, internalQueue) {\n const {\n context\n } = this.config;\n const preInitial = createMachineSnapshot({\n context: typeof context !== 'function' && context ? context : {},\n _nodes: [this.root],\n children: {},\n status: 'active'\n }, this);\n if (typeof context === 'function') {\n const assignment = ({\n spawn,\n event,\n self\n }) => context({\n spawn,\n input: event.input,\n self\n });\n return resolveActionsAndContext(preInitial, initEvent, actorScope, [assign(assignment)], internalQueue, undefined);\n }\n return preInitial;\n }\n\n /**\n * Returns the initial `State` instance, with reference to `self` as an\n * `ActorRef`.\n */\n getInitialSnapshot(actorScope, input) {\n const initEvent = createInitEvent(input); // TODO: fix;\n const internalQueue = [];\n const preInitialState = this.getPreInitialState(actorScope, initEvent, internalQueue);\n const nextState = microstep([{\n target: [...getInitialStateNodes(this.root)],\n source: this.root,\n reenter: true,\n actions: [],\n eventType: null,\n toJSON: null // TODO: fix\n }], preInitialState, actorScope, initEvent, true, internalQueue);\n const {\n snapshot: macroState\n } = macrostep(nextState, initEvent, actorScope, internalQueue);\n return macroState;\n }\n start(snapshot) {\n Object.values(snapshot.children).forEach(child => {\n if (child.getSnapshot().status === 'active') {\n child.start();\n }\n });\n }\n getStateNodeById(stateId) {\n const fullPath = toStatePath(stateId);\n const relativePath = fullPath.slice(1);\n const resolvedStateId = isStateId(fullPath[0]) ? fullPath[0].slice(STATE_IDENTIFIER.length) : fullPath[0];\n const stateNode = this.idMap.get(resolvedStateId);\n if (!stateNode) {\n throw new Error(`Child state node '#${resolvedStateId}' does not exist on machine '${this.id}'`);\n }\n return getStateNodeByPath(stateNode, relativePath);\n }\n get definition() {\n return this.root.definition;\n }\n toJSON() {\n return this.definition;\n }\n getPersistedSnapshot(snapshot, options) {\n return getPersistedSnapshot(snapshot, options);\n }\n restoreSnapshot(snapshot, _actorScope) {\n const children = {};\n const snapshotChildren = snapshot.children;\n Object.keys(snapshotChildren).forEach(actorId => {\n const actorData = snapshotChildren[actorId];\n const childState = actorData.snapshot;\n const src = actorData.src;\n const logic = typeof src === 'string' ? resolveReferencedActor(this, src) : src;\n if (!logic) {\n return;\n }\n const actorRef = createActor(logic, {\n id: actorId,\n parent: _actorScope.self,\n syncSnapshot: actorData.syncSnapshot,\n snapshot: childState,\n src,\n systemId: actorData.systemId\n });\n children[actorId] = actorRef;\n });\n function resolveHistoryReferencedState(root, referenced) {\n if (referenced instanceof StateNode) {\n return referenced;\n }\n try {\n return root.machine.getStateNodeById(referenced.id);\n } catch {\n }\n }\n function reviveHistoryValue(root, historyValue) {\n if (!historyValue || typeof historyValue !== 'object') {\n return {};\n }\n const revived = {};\n for (const key in historyValue) {\n const arr = historyValue[key];\n for (const item of arr) {\n const resolved = resolveHistoryReferencedState(root, item);\n if (!resolved) {\n continue;\n }\n revived[key] ??= [];\n revived[key].push(resolved);\n }\n }\n return revived;\n }\n const revivedHistoryValue = reviveHistoryValue(this.root, snapshot.historyValue);\n const restoredSnapshot = createMachineSnapshot({\n ...snapshot,\n children,\n _nodes: Array.from(getAllStateNodes(getStateNodes(this.root, snapshot.value))),\n historyValue: revivedHistoryValue\n }, this);\n const seen = new Set();\n function reviveContext(contextPart, children) {\n if (seen.has(contextPart)) {\n return;\n }\n seen.add(contextPart);\n for (const key in contextPart) {\n const value = contextPart[key];\n if (value && typeof value === 'object') {\n if ('xstate$$type' in value && value.xstate$$type === $$ACTOR_TYPE) {\n contextPart[key] = children[value.id];\n continue;\n }\n reviveContext(value, children);\n }\n }\n }\n reviveContext(restoredSnapshot.context, children);\n return restoredSnapshot;\n }\n}\n\nexport { StateMachine as S, StateNode as a };\n","export { createEmptyActor, fromCallback, fromEventObservable, fromObservable, fromPromise, fromTransition } from '../actors/dist/xstate-actors.esm.js';\nimport { t as toArray, c as createActor } from './raise-b0a4e862.esm.js';\nexport { A as Actor, d as __unsafe_getAllOwnEventDescriptors, a as and, f as cancel, c as createActor, g as getStateNodes, i as interpret, b as isMachineSnapshot, m as matchesState, n as not, o as or, p as pathToStateValue, r as raise, h as spawnChild, s as stateIn, j as stop, k as stopChild, e as toObserver } from './raise-b0a4e862.esm.js';\nimport { S as StateMachine } from './StateMachine-c88ea5dd.esm.js';\nexport { S as StateMachine, a as StateNode } from './StateMachine-c88ea5dd.esm.js';\nexport { S as SpecialTargets, e as emit, a as enqueueActions, f as forwardTo, l as log, s as sendParent, b as sendTo } from './log-1c257a58.esm.js';\nexport { a as assign } from './assign-c3259787.esm.js';\nimport '../dev/dist/xstate-dev.esm.js';\n\n/**\n * Asserts that the given event object is of the specified type or types. Throws\n * an error if the event object is not of the specified types.\n *\n * @example\n *\n * ```ts\n * // ...\n * entry: ({ event }) => {\n * assertEvent(event, 'doNothing');\n * // event is { type: 'doNothing' }\n * },\n * // ...\n * exit: ({ event }) => {\n * assertEvent(event, 'greet');\n * // event is { type: 'greet'; message: string }\n *\n * assertEvent(event, ['greet', 'notify']);\n * // event is { type: 'greet'; message: string }\n * // or { type: 'notify'; message: string; level: 'info' | 'error' }\n * },\n * ```\n */\nfunction assertEvent(event, type) {\n const types = toArray(type);\n if (!types.includes(event.type)) {\n const typesText = types.length === 1 ? `type \"${types[0]}\"` : `one of types \"${types.join('\", \"')}\"`;\n throw new Error(`Expected event ${JSON.stringify(event)} to have ${typesText}`);\n }\n}\n\n/**\n * Creates a state machine (statechart) with the given configuration.\n *\n * The state machine represents the pure logic of a state machine actor.\n *\n * @example\n *\n * ```ts\n * import { createMachine } from 'xstate';\n *\n * const lightMachine = createMachine({\n * id: 'light',\n * initial: 'green',\n * states: {\n * green: {\n * on: {\n * TIMER: { target: 'yellow' }\n * }\n * },\n * yellow: {\n * on: {\n * TIMER: { target: 'red' }\n * }\n * },\n * red: {\n * on: {\n * TIMER: { target: 'green' }\n * }\n * }\n * }\n * });\n *\n * const lightActor = createActor(lightMachine);\n * lightActor.start();\n *\n * lightActor.send({ type: 'TIMER' });\n * ```\n *\n * @param config The state machine configuration.\n * @param options DEPRECATED: use `setup({ ... })` or `machine.provide({ ... })`\n * to provide machine implementations instead.\n */\nfunction createMachine(config, implementations) {\n return new StateMachine(config, implementations);\n}\n\n/** @internal */\nfunction createInertActorScope(actorLogic) {\n const self = createActor(actorLogic);\n const inertActorScope = {\n self,\n defer: () => {},\n id: '',\n logger: () => {},\n sessionId: '',\n stopChild: () => {},\n system: self.system,\n emit: () => {},\n actionExecutor: () => {}\n };\n return inertActorScope;\n}\n\n/** @deprecated Use `initialTransition(…)` instead. */\nfunction getInitialSnapshot(actorLogic, ...[input]) {\n const actorScope = createInertActorScope(actorLogic);\n return actorLogic.getInitialSnapshot(actorScope, input);\n}\n\n/**\n * Determines the next snapshot for the given `actorLogic` based on the given\n * `snapshot` and `event`.\n *\n * If the `snapshot` is `undefined`, the initial snapshot of the `actorLogic` is\n * used.\n *\n * @deprecated Use `transition(…)` instead.\n * @example\n *\n * ```ts\n * import { getNextSnapshot } from 'xstate';\n * import { trafficLightMachine } from './trafficLightMachine.ts';\n *\n * const nextSnapshot = getNextSnapshot(\n * trafficLightMachine, // actor logic\n * undefined, // snapshot (or initial state if undefined)\n * { type: 'TIMER' }\n * ); // event object\n *\n * console.log(nextSnapshot.value);\n * // => 'yellow'\n *\n * const nextSnapshot2 = getNextSnapshot(\n * trafficLightMachine, // actor logic\n * nextSnapshot, // snapshot\n * { type: 'TIMER' }\n * ); // event object\n *\n * console.log(nextSnapshot2.value);\n * // =>'red'\n * ```\n */\nfunction getNextSnapshot(actorLogic, snapshot, event) {\n const inertActorScope = createInertActorScope(actorLogic);\n inertActorScope.self._snapshot = snapshot;\n return actorLogic.transition(snapshot, event, inertActorScope);\n}\n\n// at the moment we allow extra actors - ones that are not specified by `children`\n// this could be reconsidered in the future\n\nfunction setup({\n schemas,\n actors,\n actions,\n guards,\n delays\n}) {\n return {\n createMachine: config => createMachine({\n ...config,\n schemas\n }, {\n actors,\n actions,\n guards,\n delays\n })\n };\n}\n\n// eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging\n\n// eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging\nclass SimulatedClock {\n constructor() {\n this.timeouts = new Map();\n this._now = 0;\n this._id = 0;\n this._flushing = false;\n this._flushingInvalidated = false;\n }\n now() {\n return this._now;\n }\n getId() {\n return this._id++;\n }\n setTimeout(fn, timeout) {\n this._flushingInvalidated = this._flushing;\n const id = this.getId();\n this.timeouts.set(id, {\n start: this.now(),\n timeout,\n fn\n });\n return id;\n }\n clearTimeout(id) {\n this._flushingInvalidated = this._flushing;\n this.timeouts.delete(id);\n }\n set(time) {\n if (this._now > time) {\n throw new Error('Unable to travel back in time');\n }\n this._now = time;\n this.flushTimeouts();\n }\n flushTimeouts() {\n if (this._flushing) {\n this._flushingInvalidated = true;\n return;\n }\n this._flushing = true;\n const sorted = [...this.timeouts].sort(([_idA, timeoutA], [_idB, timeoutB]) => {\n const endA = timeoutA.start + timeoutA.timeout;\n const endB = timeoutB.start + timeoutB.timeout;\n return endB > endA ? -1 : 1;\n });\n for (const [id, timeout] of sorted) {\n if (this._flushingInvalidated) {\n this._flushingInvalidated = false;\n this._flushing = false;\n this.flushTimeouts();\n return;\n }\n if (this.now() - timeout.start >= timeout.timeout) {\n this.timeouts.delete(id);\n timeout.fn.call(null);\n }\n }\n this._flushing = false;\n }\n increment(ms) {\n this._now += ms;\n this.flushTimeouts();\n }\n}\n\n/**\n * Returns a promise that resolves to the `output` of the actor when it is done.\n *\n * @example\n *\n * ```ts\n * const machine = createMachine({\n * // ...\n * output: {\n * count: 42\n * }\n * });\n *\n * const actor = createActor(machine);\n *\n * actor.start();\n *\n * const output = await toPromise(actor);\n *\n * console.log(output);\n * // logs { count: 42 }\n * ```\n */\nfunction toPromise(actor) {\n return new Promise((resolve, reject) => {\n actor.subscribe({\n complete: () => {\n resolve(actor.getSnapshot().output);\n },\n error: reject\n });\n });\n}\n\n/**\n * Given actor `logic`, a `snapshot`, and an `event`, returns a tuple of the\n * `nextSnapshot` and `actions` to execute.\n *\n * This is a pure function that does not execute `actions`.\n */\nfunction transition(logic, snapshot, event) {\n const executableActions = [];\n const actorScope = createInertActorScope(logic);\n actorScope.actionExecutor = action => {\n executableActions.push(action);\n };\n const nextSnapshot = logic.transition(snapshot, event, actorScope);\n return [nextSnapshot, executableActions];\n}\n\n/**\n * Given actor `logic` and optional `input`, returns a tuple of the\n * `nextSnapshot` and `actions` to execute from the initial transition (no\n * previous state).\n *\n * This is a pure function that does not execute `actions`.\n */\nfunction initialTransition(logic, ...[input]) {\n const executableActions = [];\n const actorScope = createInertActorScope(logic);\n actorScope.actionExecutor = action => {\n executableActions.push(action);\n };\n const nextSnapshot = logic.getInitialSnapshot(actorScope, input);\n return [nextSnapshot, executableActions];\n}\n\nconst defaultWaitForOptions = {\n timeout: Infinity // much more than 10 seconds\n};\n\n/**\n * Subscribes to an actor ref and waits for its emitted value to satisfy a\n * predicate, and then resolves with that value. Will throw if the desired state\n * is not reached after an optional timeout. (defaults to Infinity).\n *\n * @example\n *\n * ```js\n * const state = await waitFor(someService, (state) => {\n * return state.hasTag('loaded');\n * });\n *\n * state.hasTag('loaded'); // true\n * ```\n *\n * @param actorRef The actor ref to subscribe to\n * @param predicate Determines if a value matches the condition to wait for\n * @param options\n * @returns A promise that eventually resolves to the emitted value that matches\n * the condition\n */\nfunction waitFor(actorRef, predicate, options) {\n const resolvedOptions = {\n ...defaultWaitForOptions,\n ...options\n };\n return new Promise((res, rej) => {\n const {\n signal\n } = resolvedOptions;\n if (signal?.aborted) {\n // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors\n rej(signal.reason);\n return;\n }\n let done = false;\n const handle = resolvedOptions.timeout === Infinity ? undefined : setTimeout(() => {\n dispose();\n rej(new Error(`Timeout of ${resolvedOptions.timeout} ms exceeded`));\n }, resolvedOptions.timeout);\n const dispose = () => {\n clearTimeout(handle);\n done = true;\n sub?.unsubscribe();\n if (abortListener) {\n signal.removeEventListener('abort', abortListener);\n }\n };\n function checkEmitted(emitted) {\n if (predicate(emitted)) {\n dispose();\n res(emitted);\n }\n }\n\n /**\n * If the `signal` option is provided, this will be the listener for its\n * `abort` event\n */\n let abortListener;\n // eslint-disable-next-line prefer-const\n let sub; // avoid TDZ when disposing synchronously\n\n // See if the current snapshot already matches the predicate\n checkEmitted(actorRef.getSnapshot());\n if (done) {\n return;\n }\n\n // only define the `abortListener` if the `signal` option is provided\n if (signal) {\n abortListener = () => {\n dispose();\n // XState does not \"own\" the signal, so we should reject with its reason (if any)\n // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors\n rej(signal.reason);\n };\n signal.addEventListener('abort', abortListener);\n }\n sub = actorRef.subscribe({\n next: checkEmitted,\n error: err => {\n dispose();\n // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors\n rej(err);\n },\n complete: () => {\n dispose();\n rej(new Error(`Actor terminated without satisfying predicate`));\n }\n });\n if (done) {\n sub.unsubscribe();\n }\n });\n}\n\nexport { SimulatedClock, assertEvent, createMachine, getInitialSnapshot, getNextSnapshot, initialTransition, setup, toPromise, transition, waitFor };\n","/**\n * NotImplementedError\n * @param message {string} - The error message\n * @class\n * @description This error is thrown when a method has not been implemented\n * @example\n * throw new NotImplementedError('Method not implemented')\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error|Error}\n * @public\n */\nexport class NotImplementedError extends Error {\n\tconstructor(message: string = '') {\n\t\tsuper(message)\n\t\tthis.name = 'NotImplemented'\n\t}\n}\n","import { createActor, createMachine } from 'xstate'\n\nimport DoctypeMeta from './doctype'\nimport { NotImplementedError } from './exceptions'\nimport Registry from './registry'\nimport { useDataStore } from './stores/data'\n\n/**\n * Stonecrop class\n * @public\n */\nexport class Stonecrop {\n\t/**\n\t * The root Stonecrop instance\n\t */\n\tstatic _root: Stonecrop\n\n\t/**\n\t * The name of the Stonecrop instance\n\t * @readonly\n\t *\n\t * @defaultValue 'Stonecrop'\n\t */\n\treadonly name = 'Stonecrop'\n\n\t/**\n\t * The registry is an immutable collection of doctypes\n\t * @example\n\t * ```ts\n\t * {\n\t * \t'task': {\n\t * \t\tdoctype: 'Task',\n\t * \t\tschema: {\n\t * \t\t\ttitle: 'string',\n\t * \t\t\tdescription: 'string',\n\t * \t\t\t...\n\t * \t\t}\n\t * \t},\n\t * \t...\n\t * }\n\t * ```\n\t * @see {@link Registry}\n\t * @see {@link DoctypeMeta}\n\t */\n\treadonly registry: Registry\n\n\t/**\n\t * The Pinia store that manages the mutable records\n\t */\n\tstore: ReturnType<typeof useDataStore>\n\n\t/**\n\t * @param registry - The immutable registry\n\t * @param store - The mutable Pinia store\n\t * @returns The Stonecrop instance with the given registry and store. If a Stonecrop instance has already been created, it returns the existing instance instead of creating a new one.\n\t * @example\n\t * ```ts\n\t * const registry = new Registry()\n\t * const store = useDataStore()\n\t * const stonecrop = new Stonecrop(registry, store)\n\t * ```\n\t */\n\tconstructor(registry: Registry, store: ReturnType<typeof useDataStore>) {\n\t\tif (Stonecrop._root) {\n\t\t\treturn Stonecrop._root\n\t\t}\n\t\tStonecrop._root = this\n\t\tthis.registry = registry\n\t\tthis.store = store\n\t}\n\n\t/**\n\t * Sets up the Stonecrop instance with the given doctype\n\t * @param doctype - The doctype to setup\n\t * @example\n\t * ```ts\n\t * const doctype = await registry.getMeta('Task')\n\t * stonecrop.setup(doctype)\n\t * ```\n\t */\n\tsetup(doctype: DoctypeMeta): void {\n\t\tvoid this.getMeta(doctype.doctype)\n\t}\n\n\t/**\n\t * Gets the meta for the given doctype\n\t * @param doctype - The doctype to get meta for\n\t * @returns The meta for the given doctype\n\t * @throws `NotImplementedError` if the `getMeta` function is not implemented for the doctype in the registry\n\t * @example\n\t * ```ts\n\t * const doctype = await registry.getMeta('Task')\n\t * const meta = stonecrop.getMeta(doctype)\n\t * ```\n\t * @see {@link DoctypeMeta}\n\t */\n\tasync getMeta(doctype: string): Promise<DoctypeMeta> | never {\n\t\tif (!this.registry.getMeta) {\n\t\t\tthrow new NotImplementedError(`getMeta function is not implemented for ${doctype} in the registry`)\n\t\t}\n\t\treturn await this.registry.getMeta(doctype)\n\t}\n\n\t/**\n\t * Gets the records for the given doctype\n\t * @param doctype - The doctype to get records for\n\t * @param filters - The filters to apply to the records\n\t * @example\n\t * ```ts\n\t * const doctype = await registry.getMeta('Task')\n\t * await stonecrop.getRecords(doctype)\n\t * ```\n\t * @example\n\t * ```ts\n\t * const doctype = await registry.getMeta('Task')\n\t * const filters = JSON.stringify({ status: 'Open' })\n\t * await stonecrop.getRecords(doctype, { body: filters })\n\t * ```\n\t */\n\tasync getRecords(doctype: DoctypeMeta, filters?: RequestInit): Promise<void> {\n\t\tthis.store.$patch({ records: [] })\n\t\tconst records = await fetch(`/${doctype.slug}`, filters)\n\t\tconst data: Record<string, any>[] = await records.json()\n\t\tthis.store.$patch({ records: data })\n\t}\n\n\t/**\n\t * Gets the record for the given doctype and id\n\t * @param doctype - The doctype to get record for\n\t * @param id - The id of the record to get\n\t * @example\n\t * ```ts\n\t * const doctype = await registry.getMeta('Task')\n\t * await stonecrop.getRecord(doctype, 'TASK-00001')\n\t * ```\n\t */\n\tasync getRecord(doctype: DoctypeMeta, id: string): Promise<void> {\n\t\tthis.store.$patch({ record: {} })\n\t\tconst record = await fetch(`/${doctype.slug}/${id}`)\n\t\tconst data: Record<string, any> = await record.json()\n\t\tthis.store.$patch({ record: data })\n\t}\n\n\t/**\n\t * Runs the action for the given doctype and id\n\t * @param doctype - The doctype to run action for\n\t * @param action - The action to run\n\t * @param id - The id(s) of the record(s) to run action on\n\t * @example\n\t * ```ts\n\t * const doctype = await registry.getMeta('Task')\n\t * stonecrop.runAction(doctype, 'create')\n\t * ```\n\t * @example\n\t * ```ts\n\t * const doctype = await registry.getMeta('Task')\n\t * stonecrop.runAction(doctype, 'update', ['TASK-00001'])\n\t * ```\n\t * @example\n\t * ```ts\n\t * const doctype = await registry.getMeta('Task')\n\t * stonecrop.runAction(doctype, 'delete', ['TASK-00001'])\n\t * ```\n\t * @example\n\t * ```ts\n\t * const doctype = await registry.getMeta('Task')\n\t * stonecrop.runAction(doctype, 'merge', ['TASK-00001', 'TASK-00002'])\n\t * ```\n\t */\n\trunAction(doctype: DoctypeMeta, action: string, id?: string[]): void {\n\t\tconst registry = this.registry.registry[doctype.slug]\n\t\tconst actions = registry.actions?.get(action)\n\t\tconst workflow = registry.workflow\n\n\t\t// trigger the action on the state machine\n\t\tif (workflow) {\n\t\t\tconst machine = createMachine(workflow)\n\t\t\tconst actor = createActor(machine)\n\n\t\t\t// TODO: this shouldn't spawn an actor at the initial state always; look into persistence\n\t\t\tactor.start()\n\t\t\tactor.send({ type: action, id })\n\n\t\t\t// run actions after state machine transition\n\t\t\t// TODO: should this happen with or without the workflow?\n\t\t\tif (actions && actions.length > 0) {\n\t\t\t\tactions.forEach(action => {\n\t\t\t\t\t// TODO: Replace Function constructor with a safer action execution mechanism\n\t\t\t\t\t// This is currently flagged as a security risk (implied eval)\n\t\t\t\t\t// Consider using a registry of pre-defined action functions instead\n\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-implied-eval\n\t\t\t\t\tconst actionFn = new Function(action)\n\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-call\n\t\t\t\t\tactionFn(id)\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\t}\n}\n","var __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __esm = (fn, res) => function __init() {\n return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;\n};\nvar __commonJS = (cb, mod) => function __require() {\n return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toESM = (mod, isNodeMode, target2) => (target2 = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n // If the importer is in node compatibility mode or this is not an ESM\n // file that has been converted to a CommonJS file using a Babel-\n // compatible transform (i.e. \"__esModule\" has not been set), then set\n // \"default\" to the CommonJS \"module.exports\" for node compatibility.\n isNodeMode || !mod || !mod.__esModule ? __defProp(target2, \"default\", { value: mod, enumerable: true }) : target2,\n mod\n));\n\n// ../../node_modules/.pnpm/tsup@8.4.0_@microsoft+api-extractor@7.51.1_@types+node@22.13.14__jiti@2.4.2_postcss@8.5_96eb05a9d65343021e53791dd83f3773/node_modules/tsup/assets/esm_shims.js\nvar init_esm_shims = __esm({\n \"../../node_modules/.pnpm/tsup@8.4.0_@microsoft+api-extractor@7.51.1_@types+node@22.13.14__jiti@2.4.2_postcss@8.5_96eb05a9d65343021e53791dd83f3773/node_modules/tsup/assets/esm_shims.js\"() {\n \"use strict\";\n }\n});\n\n// ../../node_modules/.pnpm/rfdc@1.4.1/node_modules/rfdc/index.js\nvar require_rfdc = __commonJS({\n \"../../node_modules/.pnpm/rfdc@1.4.1/node_modules/rfdc/index.js\"(exports, module) {\n \"use strict\";\n init_esm_shims();\n module.exports = rfdc2;\n function copyBuffer(cur) {\n if (cur instanceof Buffer) {\n return Buffer.from(cur);\n }\n return new cur.constructor(cur.buffer.slice(), cur.byteOffset, cur.length);\n }\n function rfdc2(opts) {\n opts = opts || {};\n if (opts.circles) return rfdcCircles(opts);\n const constructorHandlers = /* @__PURE__ */ new Map();\n constructorHandlers.set(Date, (o) => new Date(o));\n constructorHandlers.set(Map, (o, fn) => new Map(cloneArray(Array.from(o), fn)));\n constructorHandlers.set(Set, (o, fn) => new Set(cloneArray(Array.from(o), fn)));\n if (opts.constructorHandlers) {\n for (const handler2 of opts.constructorHandlers) {\n constructorHandlers.set(handler2[0], handler2[1]);\n }\n }\n let handler = null;\n return opts.proto ? cloneProto : clone;\n function cloneArray(a, fn) {\n const keys = Object.keys(a);\n const a2 = new Array(keys.length);\n for (let i = 0; i < keys.length; i++) {\n const k = keys[i];\n const cur = a[k];\n if (typeof cur !== \"object\" || cur === null) {\n a2[k] = cur;\n } else if (cur.constructor !== Object && (handler = constructorHandlers.get(cur.constructor))) {\n a2[k] = handler(cur, fn);\n } else if (ArrayBuffer.isView(cur)) {\n a2[k] = copyBuffer(cur);\n } else {\n a2[k] = fn(cur);\n }\n }\n return a2;\n }\n function clone(o) {\n if (typeof o !== \"object\" || o === null) return o;\n if (Array.isArray(o)) return cloneArray(o, clone);\n if (o.constructor !== Object && (handler = constructorHandlers.get(o.constructor))) {\n return handler(o, clone);\n }\n const o2 = {};\n for (const k in o) {\n if (Object.hasOwnProperty.call(o, k) === false) continue;\n const cur = o[k];\n if (typeof cur !== \"object\" || cur === null) {\n o2[k] = cur;\n } else if (cur.constructor !== Object && (handler = constructorHandlers.get(cur.constructor))) {\n o2[k] = handler(cur, clone);\n } else if (ArrayBuffer.isView(cur)) {\n o2[k] = copyBuffer(cur);\n } else {\n o2[k] = clone(cur);\n }\n }\n return o2;\n }\n function cloneProto(o) {\n if (typeof o !== \"object\" || o === null) return o;\n if (Array.isArray(o)) return cloneArray(o, cloneProto);\n if (o.constructor !== Object && (handler = constructorHandlers.get(o.constructor))) {\n return handler(o, cloneProto);\n }\n const o2 = {};\n for (const k in o) {\n const cur = o[k];\n if (typeof cur !== \"object\" || cur === null) {\n o2[k] = cur;\n } else if (cur.constructor !== Object && (handler = constructorHandlers.get(cur.constructor))) {\n o2[k] = handler(cur, cloneProto);\n } else if (ArrayBuffer.isView(cur)) {\n o2[k] = copyBuffer(cur);\n } else {\n o2[k] = cloneProto(cur);\n }\n }\n return o2;\n }\n }\n function rfdcCircles(opts) {\n const refs = [];\n const refsNew = [];\n const constructorHandlers = /* @__PURE__ */ new Map();\n constructorHandlers.set(Date, (o) => new Date(o));\n constructorHandlers.set(Map, (o, fn) => new Map(cloneArray(Array.from(o), fn)));\n constructorHandlers.set(Set, (o, fn) => new Set(cloneArray(Array.from(o), fn)));\n if (opts.constructorHandlers) {\n for (const handler2 of opts.constructorHandlers) {\n constructorHandlers.set(handler2[0], handler2[1]);\n }\n }\n let handler = null;\n return opts.proto ? cloneProto : clone;\n function cloneArray(a, fn) {\n const keys = Object.keys(a);\n const a2 = new Array(keys.length);\n for (let i = 0; i < keys.length; i++) {\n const k = keys[i];\n const cur = a[k];\n if (typeof cur !== \"object\" || cur === null) {\n a2[k] = cur;\n } else if (cur.constructor !== Object && (handler = constructorHandlers.get(cur.constructor))) {\n a2[k] = handler(cur, fn);\n } else if (ArrayBuffer.isView(cur)) {\n a2[k] = copyBuffer(cur);\n } else {\n const index = refs.indexOf(cur);\n if (index !== -1) {\n a2[k] = refsNew[index];\n } else {\n a2[k] = fn(cur);\n }\n }\n }\n return a2;\n }\n function clone(o) {\n if (typeof o !== \"object\" || o === null) return o;\n if (Array.isArray(o)) return cloneArray(o, clone);\n if (o.constructor !== Object && (handler = constructorHandlers.get(o.constructor))) {\n return handler(o, clone);\n }\n const o2 = {};\n refs.push(o);\n refsNew.push(o2);\n for (const k in o) {\n if (Object.hasOwnProperty.call(o, k) === false) continue;\n const cur = o[k];\n if (typeof cur !== \"object\" || cur === null) {\n o2[k] = cur;\n } else if (cur.constructor !== Object && (handler = constructorHandlers.get(cur.constructor))) {\n o2[k] = handler(cur, clone);\n } else if (ArrayBuffer.isView(cur)) {\n o2[k] = copyBuffer(cur);\n } else {\n const i = refs.indexOf(cur);\n if (i !== -1) {\n o2[k] = refsNew[i];\n } else {\n o2[k] = clone(cur);\n }\n }\n }\n refs.pop();\n refsNew.pop();\n return o2;\n }\n function cloneProto(o) {\n if (typeof o !== \"object\" || o === null) return o;\n if (Array.isArray(o)) return cloneArray(o, cloneProto);\n if (o.constructor !== Object && (handler = constructorHandlers.get(o.constructor))) {\n return handler(o, cloneProto);\n }\n const o2 = {};\n refs.push(o);\n refsNew.push(o2);\n for (const k in o) {\n const cur = o[k];\n if (typeof cur !== \"object\" || cur === null) {\n o2[k] = cur;\n } else if (cur.constructor !== Object && (handler = constructorHandlers.get(cur.constructor))) {\n o2[k] = handler(cur, cloneProto);\n } else if (ArrayBuffer.isView(cur)) {\n o2[k] = copyBuffer(cur);\n } else {\n const i = refs.indexOf(cur);\n if (i !== -1) {\n o2[k] = refsNew[i];\n } else {\n o2[k] = cloneProto(cur);\n }\n }\n }\n refs.pop();\n refsNew.pop();\n return o2;\n }\n }\n }\n});\n\n// src/index.ts\ninit_esm_shims();\n\n// src/constants.ts\ninit_esm_shims();\nvar VIEW_MODE_STORAGE_KEY = \"__vue-devtools-view-mode__\";\nvar VITE_PLUGIN_DETECTED_STORAGE_KEY = \"__vue-devtools-vite-plugin-detected__\";\nvar VITE_PLUGIN_CLIENT_URL_STORAGE_KEY = \"__vue-devtools-vite-plugin-client-url__\";\nvar BROADCAST_CHANNEL_NAME = \"__vue-devtools-broadcast-channel__\";\n\n// src/env.ts\ninit_esm_shims();\nvar isBrowser = typeof navigator !== \"undefined\";\nvar target = typeof window !== \"undefined\" ? window : typeof globalThis !== \"undefined\" ? globalThis : typeof global !== \"undefined\" ? global : {};\nvar isInChromePanel = typeof target.chrome !== \"undefined\" && !!target.chrome.devtools;\nvar isInIframe = isBrowser && target.self !== target.top;\nvar _a;\nvar isInElectron = typeof navigator !== \"undefined\" && ((_a = navigator.userAgent) == null ? void 0 : _a.toLowerCase().includes(\"electron\"));\nvar isNuxtApp = typeof window !== \"undefined\" && !!window.__NUXT__;\nvar isInSeparateWindow = !isInIframe && !isInChromePanel && !isInElectron;\n\n// src/general.ts\ninit_esm_shims();\nvar import_rfdc = __toESM(require_rfdc(), 1);\nfunction NOOP() {\n}\nvar isNumeric = (str) => `${+str}` === str;\nvar isMacOS = () => (navigator == null ? void 0 : navigator.platform) ? navigator == null ? void 0 : navigator.platform.toLowerCase().includes(\"mac\") : /Macintosh/.test(navigator.userAgent);\nvar classifyRE = /(?:^|[-_/])(\\w)/g;\nvar camelizeRE = /-(\\w)/g;\nvar kebabizeRE = /([a-z0-9])([A-Z])/g;\nfunction toUpper(_, c) {\n return c ? c.toUpperCase() : \"\";\n}\nfunction classify(str) {\n return str && `${str}`.replace(classifyRE, toUpper);\n}\nfunction camelize(str) {\n return str && str.replace(camelizeRE, toUpper);\n}\nfunction kebabize(str) {\n return str && str.replace(kebabizeRE, (_, lowerCaseCharacter, upperCaseLetter) => {\n return `${lowerCaseCharacter}-${upperCaseLetter}`;\n }).toLowerCase();\n}\nfunction basename(filename, ext) {\n let normalizedFilename = filename.replace(/^[a-z]:/i, \"\").replace(/\\\\/g, \"/\");\n if (normalizedFilename.endsWith(`index${ext}`)) {\n normalizedFilename = normalizedFilename.replace(`/index${ext}`, ext);\n }\n const lastSlashIndex = normalizedFilename.lastIndexOf(\"/\");\n const baseNameWithExt = normalizedFilename.substring(lastSlashIndex + 1);\n if (ext) {\n const extIndex = baseNameWithExt.lastIndexOf(ext);\n return baseNameWithExt.substring(0, extIndex);\n }\n return \"\";\n}\nfunction sortByKey(state) {\n return state && state.slice().sort((a, b) => {\n if (a.key < b.key)\n return -1;\n if (a.key > b.key)\n return 1;\n return 0;\n });\n}\nvar HTTP_URL_RE = /^https?:\\/\\//;\nfunction isUrlString(str) {\n return str.startsWith(\"/\") || HTTP_URL_RE.test(str);\n}\nvar deepClone = (0, import_rfdc.default)({ circles: true });\nfunction randomStr() {\n return Math.random().toString(36).slice(2);\n}\nfunction isObject(value) {\n return typeof value === \"object\" && !Array.isArray(value) && value !== null;\n}\nfunction isArray(value) {\n return Array.isArray(value);\n}\nfunction isSet(value) {\n return value instanceof Set;\n}\nfunction isMap(value) {\n return value instanceof Map;\n}\nexport {\n BROADCAST_CHANNEL_NAME,\n NOOP,\n VIEW_MODE_STORAGE_KEY,\n VITE_PLUGIN_CLIENT_URL_STORAGE_KEY,\n VITE_PLUGIN_DETECTED_STORAGE_KEY,\n basename,\n camelize,\n classify,\n deepClone,\n isArray,\n isBrowser,\n isInChromePanel,\n isInElectron,\n isInIframe,\n isInSeparateWindow,\n isMacOS,\n isMap,\n isNumeric,\n isNuxtApp,\n isObject,\n isSet,\n isUrlString,\n kebabize,\n randomStr,\n sortByKey,\n target\n};\n","const DEBOUNCE_DEFAULTS = {\n trailing: true\n};\nfunction debounce(fn, wait = 25, options = {}) {\n options = { ...DEBOUNCE_DEFAULTS, ...options };\n if (!Number.isFinite(wait)) {\n throw new TypeError(\"Expected `wait` to be a finite number\");\n }\n let leadingValue;\n let timeout;\n let resolveList = [];\n let currentPromise;\n let trailingArgs;\n const applyFn = (_this, args) => {\n currentPromise = _applyPromised(fn, _this, args);\n currentPromise.finally(() => {\n currentPromise = null;\n if (options.trailing && trailingArgs && !timeout) {\n const promise = applyFn(_this, trailingArgs);\n trailingArgs = null;\n return promise;\n }\n });\n return currentPromise;\n };\n return function(...args) {\n if (currentPromise) {\n if (options.trailing) {\n trailingArgs = args;\n }\n return currentPromise;\n }\n return new Promise((resolve) => {\n const shouldCallNow = !timeout && options.leading;\n clearTimeout(timeout);\n timeout = setTimeout(() => {\n timeout = null;\n const promise = options.leading ? leadingValue : applyFn(this, args);\n for (const _resolve of resolveList) {\n _resolve(promise);\n }\n resolveList = [];\n }, wait);\n if (shouldCallNow) {\n leadingValue = applyFn(this, args);\n resolve(leadingValue);\n } else {\n resolveList.push(resolve);\n }\n });\n };\n}\nasync function _applyPromised(fn, _this, args) {\n return await fn.apply(_this, args);\n}\n\nexport { debounce };\n","function flatHooks(configHooks, hooks = {}, parentName) {\n for (const key in configHooks) {\n const subHook = configHooks[key];\n const name = parentName ? `${parentName}:${key}` : key;\n if (typeof subHook === \"object\" && subHook !== null) {\n flatHooks(subHook, hooks, name);\n } else if (typeof subHook === \"function\") {\n hooks[name] = subHook;\n }\n }\n return hooks;\n}\nfunction mergeHooks(...hooks) {\n const finalHooks = {};\n for (const hook of hooks) {\n const flatenHook = flatHooks(hook);\n for (const key in flatenHook) {\n if (finalHooks[key]) {\n finalHooks[key].push(flatenHook[key]);\n } else {\n finalHooks[key] = [flatenHook[key]];\n }\n }\n }\n for (const key in finalHooks) {\n if (finalHooks[key].length > 1) {\n const array = finalHooks[key];\n finalHooks[key] = (...arguments_) => serial(array, (function_) => function_(...arguments_));\n } else {\n finalHooks[key] = finalHooks[key][0];\n }\n }\n return finalHooks;\n}\nfunction serial(tasks, function_) {\n return tasks.reduce(\n (promise, task) => promise.then(() => function_(task)),\n Promise.resolve()\n );\n}\nconst defaultTask = { run: (function_) => function_() };\nconst _createTask = () => defaultTask;\nconst createTask = typeof console.createTask !== \"undefined\" ? console.createTask : _createTask;\nfunction serialTaskCaller(hooks, args) {\n const name = args.shift();\n const task = createTask(name);\n return hooks.reduce(\n (promise, hookFunction) => promise.then(() => task.run(() => hookFunction(...args))),\n Promise.resolve()\n );\n}\nfunction parallelTaskCaller(hooks, args) {\n const name = args.shift();\n const task = createTask(name);\n return Promise.all(hooks.map((hook) => task.run(() => hook(...args))));\n}\nfunction serialCaller(hooks, arguments_) {\n return hooks.reduce(\n (promise, hookFunction) => promise.then(() => hookFunction(...arguments_ || [])),\n Promise.resolve()\n );\n}\nfunction parallelCaller(hooks, args) {\n return Promise.all(hooks.map((hook) => hook(...args || [])));\n}\nfunction callEachWith(callbacks, arg0) {\n for (const callback of [...callbacks]) {\n callback(arg0);\n }\n}\n\nclass Hookable {\n constructor() {\n this._hooks = {};\n this._before = void 0;\n this._after = void 0;\n this._deprecatedMessages = void 0;\n this._deprecatedHooks = {};\n this.hook = this.hook.bind(this);\n this.callHook = this.callHook.bind(this);\n this.callHookWith = this.callHookWith.bind(this);\n }\n hook(name, function_, options = {}) {\n if (!name || typeof function_ !== \"function\") {\n return () => {\n };\n }\n const originalName = name;\n let dep;\n while (this._deprecatedHooks[name]) {\n dep = this._deprecatedHooks[name];\n name = dep.to;\n }\n if (dep && !options.allowDeprecated) {\n let message = dep.message;\n if (!message) {\n message = `${originalName} hook has been deprecated` + (dep.to ? `, please use ${dep.to}` : \"\");\n }\n if (!this._deprecatedMessages) {\n this._deprecatedMessages = /* @__PURE__ */ new Set();\n }\n if (!this._deprecatedMessages.has(message)) {\n console.warn(message);\n this._deprecatedMessages.add(message);\n }\n }\n if (!function_.name) {\n try {\n Object.defineProperty(function_, \"name\", {\n get: () => \"_\" + name.replace(/\\W+/g, \"_\") + \"_hook_cb\",\n configurable: true\n });\n } catch {\n }\n }\n this._hooks[name] = this._hooks[name] || [];\n this._hooks[name].push(function_);\n return () => {\n if (function_) {\n this.removeHook(name, function_);\n function_ = void 0;\n }\n };\n }\n hookOnce(name, function_) {\n let _unreg;\n let _function = (...arguments_) => {\n if (typeof _unreg === \"function\") {\n _unreg();\n }\n _unreg = void 0;\n _function = void 0;\n return function_(...arguments_);\n };\n _unreg = this.hook(name, _function);\n return _unreg;\n }\n removeHook(name, function_) {\n if (this._hooks[name]) {\n const index = this._hooks[name].indexOf(function_);\n if (index !== -1) {\n this._hooks[name].splice(index, 1);\n }\n if (this._hooks[name].length === 0) {\n delete this._hooks[name];\n }\n }\n }\n deprecateHook(name, deprecated) {\n this._deprecatedHooks[name] = typeof deprecated === \"string\" ? { to: deprecated } : deprecated;\n const _hooks = this._hooks[name] || [];\n delete this._hooks[name];\n for (const hook of _hooks) {\n this.hook(name, hook);\n }\n }\n deprecateHooks(deprecatedHooks) {\n Object.assign(this._deprecatedHooks, deprecatedHooks);\n for (const name in deprecatedHooks) {\n this.deprecateHook(name, deprecatedHooks[name]);\n }\n }\n addHooks(configHooks) {\n const hooks = flatHooks(configHooks);\n const removeFns = Object.keys(hooks).map(\n (key) => this.hook(key, hooks[key])\n );\n return () => {\n for (const unreg of removeFns.splice(0, removeFns.length)) {\n unreg();\n }\n };\n }\n removeHooks(configHooks) {\n const hooks = flatHooks(configHooks);\n for (const key in hooks) {\n this.removeHook(key, hooks[key]);\n }\n }\n removeAllHooks() {\n for (const key in this._hooks) {\n delete this._hooks[key];\n }\n }\n callHook(name, ...arguments_) {\n arguments_.unshift(name);\n return this.callHookWith(serialTaskCaller, name, ...arguments_);\n }\n callHookParallel(name, ...arguments_) {\n arguments_.unshift(name);\n return this.callHookWith(parallelTaskCaller, name, ...arguments_);\n }\n callHookWith(caller, name, ...arguments_) {\n const event = this._before || this._after ? { name, args: arguments_, context: {} } : void 0;\n if (this._before) {\n callEachWith(this._before, event);\n }\n const result = caller(\n name in this._hooks ? [...this._hooks[name]] : [],\n arguments_\n );\n if (result instanceof Promise) {\n return result.finally(() => {\n if (this._after && event) {\n callEachWith(this._after, event);\n }\n });\n }\n if (this._after && event) {\n callEachWith(this._after, event);\n }\n return result;\n }\n beforeEach(function_) {\n this._before = this._before || [];\n this._before.push(function_);\n return () => {\n if (this._before !== void 0) {\n const index = this._before.indexOf(function_);\n if (index !== -1) {\n this._before.splice(index, 1);\n }\n }\n };\n }\n afterEach(function_) {\n this._after = this._after || [];\n this._after.push(function_);\n return () => {\n if (this._after !== void 0) {\n const index = this._after.indexOf(function_);\n if (index !== -1) {\n this._after.splice(index, 1);\n }\n }\n };\n }\n}\nfunction createHooks() {\n return new Hookable();\n}\n\nconst isBrowser = typeof window !== \"undefined\";\nfunction createDebugger(hooks, _options = {}) {\n const options = {\n inspect: isBrowser,\n group: isBrowser,\n filter: () => true,\n ..._options\n };\n const _filter = options.filter;\n const filter = typeof _filter === \"string\" ? (name) => name.startsWith(_filter) : _filter;\n const _tag = options.tag ? `[${options.tag}] ` : \"\";\n const logPrefix = (event) => _tag + event.name + \"\".padEnd(event._id, \"\\0\");\n const _idCtr = {};\n const unsubscribeBefore = hooks.beforeEach((event) => {\n if (filter !== void 0 && !filter(event.name)) {\n return;\n }\n _idCtr[event.name] = _idCtr[event.name] || 0;\n event._id = _idCtr[event.name]++;\n console.time(logPrefix(event));\n });\n const unsubscribeAfter = hooks.afterEach((event) => {\n if (filter !== void 0 && !filter(event.name)) {\n return;\n }\n if (options.group) {\n console.groupCollapsed(event.name);\n }\n if (options.inspect) {\n console.timeLog(logPrefix(event), event.args);\n } else {\n console.timeEnd(logPrefix(event));\n }\n if (options.group) {\n console.groupEnd();\n }\n _idCtr[event.name]--;\n });\n return {\n /** Stop debugging and remove listeners */\n close: () => {\n unsubscribeBefore();\n unsubscribeAfter();\n }\n };\n}\n\nexport { Hookable, createDebugger, createHooks, flatHooks, mergeHooks, parallelCaller, serial, serialCaller };\n","var __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __esm = (fn, res) => function __init() {\n return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;\n};\nvar __commonJS = (cb, mod) => function __require() {\n return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toESM = (mod, isNodeMode, target22) => (target22 = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n // If the importer is in node compatibility mode or this is not an ESM\n // file that has been converted to a CommonJS file using a Babel-\n // compatible transform (i.e. \"__esModule\" has not been set), then set\n // \"default\" to the CommonJS \"module.exports\" for node compatibility.\n isNodeMode || !mod || !mod.__esModule ? __defProp(target22, \"default\", { value: mod, enumerable: true }) : target22,\n mod\n));\n\n// ../../node_modules/.pnpm/tsup@8.4.0_@microsoft+api-extractor@7.51.1_@types+node@22.13.14__jiti@2.4.2_postcss@8.5_96eb05a9d65343021e53791dd83f3773/node_modules/tsup/assets/esm_shims.js\nvar init_esm_shims = __esm({\n \"../../node_modules/.pnpm/tsup@8.4.0_@microsoft+api-extractor@7.51.1_@types+node@22.13.14__jiti@2.4.2_postcss@8.5_96eb05a9d65343021e53791dd83f3773/node_modules/tsup/assets/esm_shims.js\"() {\n \"use strict\";\n }\n});\n\n// ../../node_modules/.pnpm/speakingurl@14.0.1/node_modules/speakingurl/lib/speakingurl.js\nvar require_speakingurl = __commonJS({\n \"../../node_modules/.pnpm/speakingurl@14.0.1/node_modules/speakingurl/lib/speakingurl.js\"(exports, module) {\n \"use strict\";\n init_esm_shims();\n (function(root) {\n \"use strict\";\n var charMap = {\n // latin\n \"\\xC0\": \"A\",\n \"\\xC1\": \"A\",\n \"\\xC2\": \"A\",\n \"\\xC3\": \"A\",\n \"\\xC4\": \"Ae\",\n \"\\xC5\": \"A\",\n \"\\xC6\": \"AE\",\n \"\\xC7\": \"C\",\n \"\\xC8\": \"E\",\n \"\\xC9\": \"E\",\n \"\\xCA\": \"E\",\n \"\\xCB\": \"E\",\n \"\\xCC\": \"I\",\n \"\\xCD\": \"I\",\n \"\\xCE\": \"I\",\n \"\\xCF\": \"I\",\n \"\\xD0\": \"D\",\n \"\\xD1\": \"N\",\n \"\\xD2\": \"O\",\n \"\\xD3\": \"O\",\n \"\\xD4\": \"O\",\n \"\\xD5\": \"O\",\n \"\\xD6\": \"Oe\",\n \"\\u0150\": \"O\",\n \"\\xD8\": \"O\",\n \"\\xD9\": \"U\",\n \"\\xDA\": \"U\",\n \"\\xDB\": \"U\",\n \"\\xDC\": \"Ue\",\n \"\\u0170\": \"U\",\n \"\\xDD\": \"Y\",\n \"\\xDE\": \"TH\",\n \"\\xDF\": \"ss\",\n \"\\xE0\": \"a\",\n \"\\xE1\": \"a\",\n \"\\xE2\": \"a\",\n \"\\xE3\": \"a\",\n \"\\xE4\": \"ae\",\n \"\\xE5\": \"a\",\n \"\\xE6\": \"ae\",\n \"\\xE7\": \"c\",\n \"\\xE8\": \"e\",\n \"\\xE9\": \"e\",\n \"\\xEA\": \"e\",\n \"\\xEB\": \"e\",\n \"\\xEC\": \"i\",\n \"\\xED\": \"i\",\n \"\\xEE\": \"i\",\n \"\\xEF\": \"i\",\n \"\\xF0\": \"d\",\n \"\\xF1\": \"n\",\n \"\\xF2\": \"o\",\n \"\\xF3\": \"o\",\n \"\\xF4\": \"o\",\n \"\\xF5\": \"o\",\n \"\\xF6\": \"oe\",\n \"\\u0151\": \"o\",\n \"\\xF8\": \"o\",\n \"\\xF9\": \"u\",\n \"\\xFA\": \"u\",\n \"\\xFB\": \"u\",\n \"\\xFC\": \"ue\",\n \"\\u0171\": \"u\",\n \"\\xFD\": \"y\",\n \"\\xFE\": \"th\",\n \"\\xFF\": \"y\",\n \"\\u1E9E\": \"SS\",\n // language specific\n // Arabic\n \"\\u0627\": \"a\",\n \"\\u0623\": \"a\",\n \"\\u0625\": \"i\",\n \"\\u0622\": \"aa\",\n \"\\u0624\": \"u\",\n \"\\u0626\": \"e\",\n \"\\u0621\": \"a\",\n \"\\u0628\": \"b\",\n \"\\u062A\": \"t\",\n \"\\u062B\": \"th\",\n \"\\u062C\": \"j\",\n \"\\u062D\": \"h\",\n \"\\u062E\": \"kh\",\n \"\\u062F\": \"d\",\n \"\\u0630\": \"th\",\n \"\\u0631\": \"r\",\n \"\\u0632\": \"z\",\n \"\\u0633\": \"s\",\n \"\\u0634\": \"sh\",\n \"\\u0635\": \"s\",\n \"\\u0636\": \"dh\",\n \"\\u0637\": \"t\",\n \"\\u0638\": \"z\",\n \"\\u0639\": \"a\",\n \"\\u063A\": \"gh\",\n \"\\u0641\": \"f\",\n \"\\u0642\": \"q\",\n \"\\u0643\": \"k\",\n \"\\u0644\": \"l\",\n \"\\u0645\": \"m\",\n \"\\u0646\": \"n\",\n \"\\u0647\": \"h\",\n \"\\u0648\": \"w\",\n \"\\u064A\": \"y\",\n \"\\u0649\": \"a\",\n \"\\u0629\": \"h\",\n \"\\uFEFB\": \"la\",\n \"\\uFEF7\": \"laa\",\n \"\\uFEF9\": \"lai\",\n \"\\uFEF5\": \"laa\",\n // Persian additional characters than Arabic\n \"\\u06AF\": \"g\",\n \"\\u0686\": \"ch\",\n \"\\u067E\": \"p\",\n \"\\u0698\": \"zh\",\n \"\\u06A9\": \"k\",\n \"\\u06CC\": \"y\",\n // Arabic diactrics\n \"\\u064E\": \"a\",\n \"\\u064B\": \"an\",\n \"\\u0650\": \"e\",\n \"\\u064D\": \"en\",\n \"\\u064F\": \"u\",\n \"\\u064C\": \"on\",\n \"\\u0652\": \"\",\n // Arabic numbers\n \"\\u0660\": \"0\",\n \"\\u0661\": \"1\",\n \"\\u0662\": \"2\",\n \"\\u0663\": \"3\",\n \"\\u0664\": \"4\",\n \"\\u0665\": \"5\",\n \"\\u0666\": \"6\",\n \"\\u0667\": \"7\",\n \"\\u0668\": \"8\",\n \"\\u0669\": \"9\",\n // Persian numbers\n \"\\u06F0\": \"0\",\n \"\\u06F1\": \"1\",\n \"\\u06F2\": \"2\",\n \"\\u06F3\": \"3\",\n \"\\u06F4\": \"4\",\n \"\\u06F5\": \"5\",\n \"\\u06F6\": \"6\",\n \"\\u06F7\": \"7\",\n \"\\u06F8\": \"8\",\n \"\\u06F9\": \"9\",\n // Burmese consonants\n \"\\u1000\": \"k\",\n \"\\u1001\": \"kh\",\n \"\\u1002\": \"g\",\n \"\\u1003\": \"ga\",\n \"\\u1004\": \"ng\",\n \"\\u1005\": \"s\",\n \"\\u1006\": \"sa\",\n \"\\u1007\": \"z\",\n \"\\u1005\\u103B\": \"za\",\n \"\\u100A\": \"ny\",\n \"\\u100B\": \"t\",\n \"\\u100C\": \"ta\",\n \"\\u100D\": \"d\",\n \"\\u100E\": \"da\",\n \"\\u100F\": \"na\",\n \"\\u1010\": \"t\",\n \"\\u1011\": \"ta\",\n \"\\u1012\": \"d\",\n \"\\u1013\": \"da\",\n \"\\u1014\": \"n\",\n \"\\u1015\": \"p\",\n \"\\u1016\": \"pa\",\n \"\\u1017\": \"b\",\n \"\\u1018\": \"ba\",\n \"\\u1019\": \"m\",\n \"\\u101A\": \"y\",\n \"\\u101B\": \"ya\",\n \"\\u101C\": \"l\",\n \"\\u101D\": \"w\",\n \"\\u101E\": \"th\",\n \"\\u101F\": \"h\",\n \"\\u1020\": \"la\",\n \"\\u1021\": \"a\",\n // consonant character combos\n \"\\u103C\": \"y\",\n \"\\u103B\": \"ya\",\n \"\\u103D\": \"w\",\n \"\\u103C\\u103D\": \"yw\",\n \"\\u103B\\u103D\": \"ywa\",\n \"\\u103E\": \"h\",\n // independent vowels\n \"\\u1027\": \"e\",\n \"\\u104F\": \"-e\",\n \"\\u1023\": \"i\",\n \"\\u1024\": \"-i\",\n \"\\u1009\": \"u\",\n \"\\u1026\": \"-u\",\n \"\\u1029\": \"aw\",\n \"\\u101E\\u103C\\u1031\\u102C\": \"aw\",\n \"\\u102A\": \"aw\",\n // numbers\n \"\\u1040\": \"0\",\n \"\\u1041\": \"1\",\n \"\\u1042\": \"2\",\n \"\\u1043\": \"3\",\n \"\\u1044\": \"4\",\n \"\\u1045\": \"5\",\n \"\\u1046\": \"6\",\n \"\\u1047\": \"7\",\n \"\\u1048\": \"8\",\n \"\\u1049\": \"9\",\n // virama and tone marks which are silent in transliteration\n \"\\u1039\": \"\",\n \"\\u1037\": \"\",\n \"\\u1038\": \"\",\n // Czech\n \"\\u010D\": \"c\",\n \"\\u010F\": \"d\",\n \"\\u011B\": \"e\",\n \"\\u0148\": \"n\",\n \"\\u0159\": \"r\",\n \"\\u0161\": \"s\",\n \"\\u0165\": \"t\",\n \"\\u016F\": \"u\",\n \"\\u017E\": \"z\",\n \"\\u010C\": \"C\",\n \"\\u010E\": \"D\",\n \"\\u011A\": \"E\",\n \"\\u0147\": \"N\",\n \"\\u0158\": \"R\",\n \"\\u0160\": \"S\",\n \"\\u0164\": \"T\",\n \"\\u016E\": \"U\",\n \"\\u017D\": \"Z\",\n // Dhivehi\n \"\\u0780\": \"h\",\n \"\\u0781\": \"sh\",\n \"\\u0782\": \"n\",\n \"\\u0783\": \"r\",\n \"\\u0784\": \"b\",\n \"\\u0785\": \"lh\",\n \"\\u0786\": \"k\",\n \"\\u0787\": \"a\",\n \"\\u0788\": \"v\",\n \"\\u0789\": \"m\",\n \"\\u078A\": \"f\",\n \"\\u078B\": \"dh\",\n \"\\u078C\": \"th\",\n \"\\u078D\": \"l\",\n \"\\u078E\": \"g\",\n \"\\u078F\": \"gn\",\n \"\\u0790\": \"s\",\n \"\\u0791\": \"d\",\n \"\\u0792\": \"z\",\n \"\\u0793\": \"t\",\n \"\\u0794\": \"y\",\n \"\\u0795\": \"p\",\n \"\\u0796\": \"j\",\n \"\\u0797\": \"ch\",\n \"\\u0798\": \"tt\",\n \"\\u0799\": \"hh\",\n \"\\u079A\": \"kh\",\n \"\\u079B\": \"th\",\n \"\\u079C\": \"z\",\n \"\\u079D\": \"sh\",\n \"\\u079E\": \"s\",\n \"\\u079F\": \"d\",\n \"\\u07A0\": \"t\",\n \"\\u07A1\": \"z\",\n \"\\u07A2\": \"a\",\n \"\\u07A3\": \"gh\",\n \"\\u07A4\": \"q\",\n \"\\u07A5\": \"w\",\n \"\\u07A6\": \"a\",\n \"\\u07A7\": \"aa\",\n \"\\u07A8\": \"i\",\n \"\\u07A9\": \"ee\",\n \"\\u07AA\": \"u\",\n \"\\u07AB\": \"oo\",\n \"\\u07AC\": \"e\",\n \"\\u07AD\": \"ey\",\n \"\\u07AE\": \"o\",\n \"\\u07AF\": \"oa\",\n \"\\u07B0\": \"\",\n // Georgian https://en.wikipedia.org/wiki/Romanization_of_Georgian\n // National system (2002)\n \"\\u10D0\": \"a\",\n \"\\u10D1\": \"b\",\n \"\\u10D2\": \"g\",\n \"\\u10D3\": \"d\",\n \"\\u10D4\": \"e\",\n \"\\u10D5\": \"v\",\n \"\\u10D6\": \"z\",\n \"\\u10D7\": \"t\",\n \"\\u10D8\": \"i\",\n \"\\u10D9\": \"k\",\n \"\\u10DA\": \"l\",\n \"\\u10DB\": \"m\",\n \"\\u10DC\": \"n\",\n \"\\u10DD\": \"o\",\n \"\\u10DE\": \"p\",\n \"\\u10DF\": \"zh\",\n \"\\u10E0\": \"r\",\n \"\\u10E1\": \"s\",\n \"\\u10E2\": \"t\",\n \"\\u10E3\": \"u\",\n \"\\u10E4\": \"p\",\n \"\\u10E5\": \"k\",\n \"\\u10E6\": \"gh\",\n \"\\u10E7\": \"q\",\n \"\\u10E8\": \"sh\",\n \"\\u10E9\": \"ch\",\n \"\\u10EA\": \"ts\",\n \"\\u10EB\": \"dz\",\n \"\\u10EC\": \"ts\",\n \"\\u10ED\": \"ch\",\n \"\\u10EE\": \"kh\",\n \"\\u10EF\": \"j\",\n \"\\u10F0\": \"h\",\n // Greek\n \"\\u03B1\": \"a\",\n \"\\u03B2\": \"v\",\n \"\\u03B3\": \"g\",\n \"\\u03B4\": \"d\",\n \"\\u03B5\": \"e\",\n \"\\u03B6\": \"z\",\n \"\\u03B7\": \"i\",\n \"\\u03B8\": \"th\",\n \"\\u03B9\": \"i\",\n \"\\u03BA\": \"k\",\n \"\\u03BB\": \"l\",\n \"\\u03BC\": \"m\",\n \"\\u03BD\": \"n\",\n \"\\u03BE\": \"ks\",\n \"\\u03BF\": \"o\",\n \"\\u03C0\": \"p\",\n \"\\u03C1\": \"r\",\n \"\\u03C3\": \"s\",\n \"\\u03C4\": \"t\",\n \"\\u03C5\": \"y\",\n \"\\u03C6\": \"f\",\n \"\\u03C7\": \"x\",\n \"\\u03C8\": \"ps\",\n \"\\u03C9\": \"o\",\n \"\\u03AC\": \"a\",\n \"\\u03AD\": \"e\",\n \"\\u03AF\": \"i\",\n \"\\u03CC\": \"o\",\n \"\\u03CD\": \"y\",\n \"\\u03AE\": \"i\",\n \"\\u03CE\": \"o\",\n \"\\u03C2\": \"s\",\n \"\\u03CA\": \"i\",\n \"\\u03B0\": \"y\",\n \"\\u03CB\": \"y\",\n \"\\u0390\": \"i\",\n \"\\u0391\": \"A\",\n \"\\u0392\": \"B\",\n \"\\u0393\": \"G\",\n \"\\u0394\": \"D\",\n \"\\u0395\": \"E\",\n \"\\u0396\": \"Z\",\n \"\\u0397\": \"I\",\n \"\\u0398\": \"TH\",\n \"\\u0399\": \"I\",\n \"\\u039A\": \"K\",\n \"\\u039B\": \"L\",\n \"\\u039C\": \"M\",\n \"\\u039D\": \"N\",\n \"\\u039E\": \"KS\",\n \"\\u039F\": \"O\",\n \"\\u03A0\": \"P\",\n \"\\u03A1\": \"R\",\n \"\\u03A3\": \"S\",\n \"\\u03A4\": \"T\",\n \"\\u03A5\": \"Y\",\n \"\\u03A6\": \"F\",\n \"\\u03A7\": \"X\",\n \"\\u03A8\": \"PS\",\n \"\\u03A9\": \"O\",\n \"\\u0386\": \"A\",\n \"\\u0388\": \"E\",\n \"\\u038A\": \"I\",\n \"\\u038C\": \"O\",\n \"\\u038E\": \"Y\",\n \"\\u0389\": \"I\",\n \"\\u038F\": \"O\",\n \"\\u03AA\": \"I\",\n \"\\u03AB\": \"Y\",\n // Latvian\n \"\\u0101\": \"a\",\n // 'č': 'c', // duplicate\n \"\\u0113\": \"e\",\n \"\\u0123\": \"g\",\n \"\\u012B\": \"i\",\n \"\\u0137\": \"k\",\n \"\\u013C\": \"l\",\n \"\\u0146\": \"n\",\n // 'š': 's', // duplicate\n \"\\u016B\": \"u\",\n // 'ž': 'z', // duplicate\n \"\\u0100\": \"A\",\n // 'Č': 'C', // duplicate\n \"\\u0112\": \"E\",\n \"\\u0122\": \"G\",\n \"\\u012A\": \"I\",\n \"\\u0136\": \"k\",\n \"\\u013B\": \"L\",\n \"\\u0145\": \"N\",\n // 'Š': 'S', // duplicate\n \"\\u016A\": \"U\",\n // 'Ž': 'Z', // duplicate\n // Macedonian\n \"\\u040C\": \"Kj\",\n \"\\u045C\": \"kj\",\n \"\\u0409\": \"Lj\",\n \"\\u0459\": \"lj\",\n \"\\u040A\": \"Nj\",\n \"\\u045A\": \"nj\",\n \"\\u0422\\u0441\": \"Ts\",\n \"\\u0442\\u0441\": \"ts\",\n // Polish\n \"\\u0105\": \"a\",\n \"\\u0107\": \"c\",\n \"\\u0119\": \"e\",\n \"\\u0142\": \"l\",\n \"\\u0144\": \"n\",\n // 'ó': 'o', // duplicate\n \"\\u015B\": \"s\",\n \"\\u017A\": \"z\",\n \"\\u017C\": \"z\",\n \"\\u0104\": \"A\",\n \"\\u0106\": \"C\",\n \"\\u0118\": \"E\",\n \"\\u0141\": \"L\",\n \"\\u0143\": \"N\",\n \"\\u015A\": \"S\",\n \"\\u0179\": \"Z\",\n \"\\u017B\": \"Z\",\n // Ukranian\n \"\\u0404\": \"Ye\",\n \"\\u0406\": \"I\",\n \"\\u0407\": \"Yi\",\n \"\\u0490\": \"G\",\n \"\\u0454\": \"ye\",\n \"\\u0456\": \"i\",\n \"\\u0457\": \"yi\",\n \"\\u0491\": \"g\",\n // Romanian\n \"\\u0103\": \"a\",\n \"\\u0102\": \"A\",\n \"\\u0219\": \"s\",\n \"\\u0218\": \"S\",\n // 'ş': 's', // duplicate\n // 'Ş': 'S', // duplicate\n \"\\u021B\": \"t\",\n \"\\u021A\": \"T\",\n \"\\u0163\": \"t\",\n \"\\u0162\": \"T\",\n // Russian https://en.wikipedia.org/wiki/Romanization_of_Russian\n // ICAO\n \"\\u0430\": \"a\",\n \"\\u0431\": \"b\",\n \"\\u0432\": \"v\",\n \"\\u0433\": \"g\",\n \"\\u0434\": \"d\",\n \"\\u0435\": \"e\",\n \"\\u0451\": \"yo\",\n \"\\u0436\": \"zh\",\n \"\\u0437\": \"z\",\n \"\\u0438\": \"i\",\n \"\\u0439\": \"i\",\n \"\\u043A\": \"k\",\n \"\\u043B\": \"l\",\n \"\\u043C\": \"m\",\n \"\\u043D\": \"n\",\n \"\\u043E\": \"o\",\n \"\\u043F\": \"p\",\n \"\\u0440\": \"r\",\n \"\\u0441\": \"s\",\n \"\\u0442\": \"t\",\n \"\\u0443\": \"u\",\n \"\\u0444\": \"f\",\n \"\\u0445\": \"kh\",\n \"\\u0446\": \"c\",\n \"\\u0447\": \"ch\",\n \"\\u0448\": \"sh\",\n \"\\u0449\": \"sh\",\n \"\\u044A\": \"\",\n \"\\u044B\": \"y\",\n \"\\u044C\": \"\",\n \"\\u044D\": \"e\",\n \"\\u044E\": \"yu\",\n \"\\u044F\": \"ya\",\n \"\\u0410\": \"A\",\n \"\\u0411\": \"B\",\n \"\\u0412\": \"V\",\n \"\\u0413\": \"G\",\n \"\\u0414\": \"D\",\n \"\\u0415\": \"E\",\n \"\\u0401\": \"Yo\",\n \"\\u0416\": \"Zh\",\n \"\\u0417\": \"Z\",\n \"\\u0418\": \"I\",\n \"\\u0419\": \"I\",\n \"\\u041A\": \"K\",\n \"\\u041B\": \"L\",\n \"\\u041C\": \"M\",\n \"\\u041D\": \"N\",\n \"\\u041E\": \"O\",\n \"\\u041F\": \"P\",\n \"\\u0420\": \"R\",\n \"\\u0421\": \"S\",\n \"\\u0422\": \"T\",\n \"\\u0423\": \"U\",\n \"\\u0424\": \"F\",\n \"\\u0425\": \"Kh\",\n \"\\u0426\": \"C\",\n \"\\u0427\": \"Ch\",\n \"\\u0428\": \"Sh\",\n \"\\u0429\": \"Sh\",\n \"\\u042A\": \"\",\n \"\\u042B\": \"Y\",\n \"\\u042C\": \"\",\n \"\\u042D\": \"E\",\n \"\\u042E\": \"Yu\",\n \"\\u042F\": \"Ya\",\n // Serbian\n \"\\u0452\": \"dj\",\n \"\\u0458\": \"j\",\n // 'љ': 'lj', // duplicate\n // 'њ': 'nj', // duplicate\n \"\\u045B\": \"c\",\n \"\\u045F\": \"dz\",\n \"\\u0402\": \"Dj\",\n \"\\u0408\": \"j\",\n // 'Љ': 'Lj', // duplicate\n // 'Њ': 'Nj', // duplicate\n \"\\u040B\": \"C\",\n \"\\u040F\": \"Dz\",\n // Slovak\n \"\\u013E\": \"l\",\n \"\\u013A\": \"l\",\n \"\\u0155\": \"r\",\n \"\\u013D\": \"L\",\n \"\\u0139\": \"L\",\n \"\\u0154\": \"R\",\n // Turkish\n \"\\u015F\": \"s\",\n \"\\u015E\": \"S\",\n \"\\u0131\": \"i\",\n \"\\u0130\": \"I\",\n // 'ç': 'c', // duplicate\n // 'Ç': 'C', // duplicate\n // 'ü': 'u', // duplicate, see langCharMap\n // 'Ü': 'U', // duplicate, see langCharMap\n // 'ö': 'o', // duplicate, see langCharMap\n // 'Ö': 'O', // duplicate, see langCharMap\n \"\\u011F\": \"g\",\n \"\\u011E\": \"G\",\n // Vietnamese\n \"\\u1EA3\": \"a\",\n \"\\u1EA2\": \"A\",\n \"\\u1EB3\": \"a\",\n \"\\u1EB2\": \"A\",\n \"\\u1EA9\": \"a\",\n \"\\u1EA8\": \"A\",\n \"\\u0111\": \"d\",\n \"\\u0110\": \"D\",\n \"\\u1EB9\": \"e\",\n \"\\u1EB8\": \"E\",\n \"\\u1EBD\": \"e\",\n \"\\u1EBC\": \"E\",\n \"\\u1EBB\": \"e\",\n \"\\u1EBA\": \"E\",\n \"\\u1EBF\": \"e\",\n \"\\u1EBE\": \"E\",\n \"\\u1EC1\": \"e\",\n \"\\u1EC0\": \"E\",\n \"\\u1EC7\": \"e\",\n \"\\u1EC6\": \"E\",\n \"\\u1EC5\": \"e\",\n \"\\u1EC4\": \"E\",\n \"\\u1EC3\": \"e\",\n \"\\u1EC2\": \"E\",\n \"\\u1ECF\": \"o\",\n \"\\u1ECD\": \"o\",\n \"\\u1ECC\": \"o\",\n \"\\u1ED1\": \"o\",\n \"\\u1ED0\": \"O\",\n \"\\u1ED3\": \"o\",\n \"\\u1ED2\": \"O\",\n \"\\u1ED5\": \"o\",\n \"\\u1ED4\": \"O\",\n \"\\u1ED9\": \"o\",\n \"\\u1ED8\": \"O\",\n \"\\u1ED7\": \"o\",\n \"\\u1ED6\": \"O\",\n \"\\u01A1\": \"o\",\n \"\\u01A0\": \"O\",\n \"\\u1EDB\": \"o\",\n \"\\u1EDA\": \"O\",\n \"\\u1EDD\": \"o\",\n \"\\u1EDC\": \"O\",\n \"\\u1EE3\": \"o\",\n \"\\u1EE2\": \"O\",\n \"\\u1EE1\": \"o\",\n \"\\u1EE0\": \"O\",\n \"\\u1EDE\": \"o\",\n \"\\u1EDF\": \"o\",\n \"\\u1ECB\": \"i\",\n \"\\u1ECA\": \"I\",\n \"\\u0129\": \"i\",\n \"\\u0128\": \"I\",\n \"\\u1EC9\": \"i\",\n \"\\u1EC8\": \"i\",\n \"\\u1EE7\": \"u\",\n \"\\u1EE6\": \"U\",\n \"\\u1EE5\": \"u\",\n \"\\u1EE4\": \"U\",\n \"\\u0169\": \"u\",\n \"\\u0168\": \"U\",\n \"\\u01B0\": \"u\",\n \"\\u01AF\": \"U\",\n \"\\u1EE9\": \"u\",\n \"\\u1EE8\": \"U\",\n \"\\u1EEB\": \"u\",\n \"\\u1EEA\": \"U\",\n \"\\u1EF1\": \"u\",\n \"\\u1EF0\": \"U\",\n \"\\u1EEF\": \"u\",\n \"\\u1EEE\": \"U\",\n \"\\u1EED\": \"u\",\n \"\\u1EEC\": \"\\u01B0\",\n \"\\u1EF7\": \"y\",\n \"\\u1EF6\": \"y\",\n \"\\u1EF3\": \"y\",\n \"\\u1EF2\": \"Y\",\n \"\\u1EF5\": \"y\",\n \"\\u1EF4\": \"Y\",\n \"\\u1EF9\": \"y\",\n \"\\u1EF8\": \"Y\",\n \"\\u1EA1\": \"a\",\n \"\\u1EA0\": \"A\",\n \"\\u1EA5\": \"a\",\n \"\\u1EA4\": \"A\",\n \"\\u1EA7\": \"a\",\n \"\\u1EA6\": \"A\",\n \"\\u1EAD\": \"a\",\n \"\\u1EAC\": \"A\",\n \"\\u1EAB\": \"a\",\n \"\\u1EAA\": \"A\",\n // 'ă': 'a', // duplicate\n // 'Ă': 'A', // duplicate\n \"\\u1EAF\": \"a\",\n \"\\u1EAE\": \"A\",\n \"\\u1EB1\": \"a\",\n \"\\u1EB0\": \"A\",\n \"\\u1EB7\": \"a\",\n \"\\u1EB6\": \"A\",\n \"\\u1EB5\": \"a\",\n \"\\u1EB4\": \"A\",\n \"\\u24EA\": \"0\",\n \"\\u2460\": \"1\",\n \"\\u2461\": \"2\",\n \"\\u2462\": \"3\",\n \"\\u2463\": \"4\",\n \"\\u2464\": \"5\",\n \"\\u2465\": \"6\",\n \"\\u2466\": \"7\",\n \"\\u2467\": \"8\",\n \"\\u2468\": \"9\",\n \"\\u2469\": \"10\",\n \"\\u246A\": \"11\",\n \"\\u246B\": \"12\",\n \"\\u246C\": \"13\",\n \"\\u246D\": \"14\",\n \"\\u246E\": \"15\",\n \"\\u246F\": \"16\",\n \"\\u2470\": \"17\",\n \"\\u2471\": \"18\",\n \"\\u2472\": \"18\",\n \"\\u2473\": \"18\",\n \"\\u24F5\": \"1\",\n \"\\u24F6\": \"2\",\n \"\\u24F7\": \"3\",\n \"\\u24F8\": \"4\",\n \"\\u24F9\": \"5\",\n \"\\u24FA\": \"6\",\n \"\\u24FB\": \"7\",\n \"\\u24FC\": \"8\",\n \"\\u24FD\": \"9\",\n \"\\u24FE\": \"10\",\n \"\\u24FF\": \"0\",\n \"\\u24EB\": \"11\",\n \"\\u24EC\": \"12\",\n \"\\u24ED\": \"13\",\n \"\\u24EE\": \"14\",\n \"\\u24EF\": \"15\",\n \"\\u24F0\": \"16\",\n \"\\u24F1\": \"17\",\n \"\\u24F2\": \"18\",\n \"\\u24F3\": \"19\",\n \"\\u24F4\": \"20\",\n \"\\u24B6\": \"A\",\n \"\\u24B7\": \"B\",\n \"\\u24B8\": \"C\",\n \"\\u24B9\": \"D\",\n \"\\u24BA\": \"E\",\n \"\\u24BB\": \"F\",\n \"\\u24BC\": \"G\",\n \"\\u24BD\": \"H\",\n \"\\u24BE\": \"I\",\n \"\\u24BF\": \"J\",\n \"\\u24C0\": \"K\",\n \"\\u24C1\": \"L\",\n \"\\u24C2\": \"M\",\n \"\\u24C3\": \"N\",\n \"\\u24C4\": \"O\",\n \"\\u24C5\": \"P\",\n \"\\u24C6\": \"Q\",\n \"\\u24C7\": \"R\",\n \"\\u24C8\": \"S\",\n \"\\u24C9\": \"T\",\n \"\\u24CA\": \"U\",\n \"\\u24CB\": \"V\",\n \"\\u24CC\": \"W\",\n \"\\u24CD\": \"X\",\n \"\\u24CE\": \"Y\",\n \"\\u24CF\": \"Z\",\n \"\\u24D0\": \"a\",\n \"\\u24D1\": \"b\",\n \"\\u24D2\": \"c\",\n \"\\u24D3\": \"d\",\n \"\\u24D4\": \"e\",\n \"\\u24D5\": \"f\",\n \"\\u24D6\": \"g\",\n \"\\u24D7\": \"h\",\n \"\\u24D8\": \"i\",\n \"\\u24D9\": \"j\",\n \"\\u24DA\": \"k\",\n \"\\u24DB\": \"l\",\n \"\\u24DC\": \"m\",\n \"\\u24DD\": \"n\",\n \"\\u24DE\": \"o\",\n \"\\u24DF\": \"p\",\n \"\\u24E0\": \"q\",\n \"\\u24E1\": \"r\",\n \"\\u24E2\": \"s\",\n \"\\u24E3\": \"t\",\n \"\\u24E4\": \"u\",\n \"\\u24E6\": \"v\",\n \"\\u24E5\": \"w\",\n \"\\u24E7\": \"x\",\n \"\\u24E8\": \"y\",\n \"\\u24E9\": \"z\",\n // symbols\n \"\\u201C\": '\"',\n \"\\u201D\": '\"',\n \"\\u2018\": \"'\",\n \"\\u2019\": \"'\",\n \"\\u2202\": \"d\",\n \"\\u0192\": \"f\",\n \"\\u2122\": \"(TM)\",\n \"\\xA9\": \"(C)\",\n \"\\u0153\": \"oe\",\n \"\\u0152\": \"OE\",\n \"\\xAE\": \"(R)\",\n \"\\u2020\": \"+\",\n \"\\u2120\": \"(SM)\",\n \"\\u2026\": \"...\",\n \"\\u02DA\": \"o\",\n \"\\xBA\": \"o\",\n \"\\xAA\": \"a\",\n \"\\u2022\": \"*\",\n \"\\u104A\": \",\",\n \"\\u104B\": \".\",\n // currency\n \"$\": \"USD\",\n \"\\u20AC\": \"EUR\",\n \"\\u20A2\": \"BRN\",\n \"\\u20A3\": \"FRF\",\n \"\\xA3\": \"GBP\",\n \"\\u20A4\": \"ITL\",\n \"\\u20A6\": \"NGN\",\n \"\\u20A7\": \"ESP\",\n \"\\u20A9\": \"KRW\",\n \"\\u20AA\": \"ILS\",\n \"\\u20AB\": \"VND\",\n \"\\u20AD\": \"LAK\",\n \"\\u20AE\": \"MNT\",\n \"\\u20AF\": \"GRD\",\n \"\\u20B1\": \"ARS\",\n \"\\u20B2\": \"PYG\",\n \"\\u20B3\": \"ARA\",\n \"\\u20B4\": \"UAH\",\n \"\\u20B5\": \"GHS\",\n \"\\xA2\": \"cent\",\n \"\\xA5\": \"CNY\",\n \"\\u5143\": \"CNY\",\n \"\\u5186\": \"YEN\",\n \"\\uFDFC\": \"IRR\",\n \"\\u20A0\": \"EWE\",\n \"\\u0E3F\": \"THB\",\n \"\\u20A8\": \"INR\",\n \"\\u20B9\": \"INR\",\n \"\\u20B0\": \"PF\",\n \"\\u20BA\": \"TRY\",\n \"\\u060B\": \"AFN\",\n \"\\u20BC\": \"AZN\",\n \"\\u043B\\u0432\": \"BGN\",\n \"\\u17DB\": \"KHR\",\n \"\\u20A1\": \"CRC\",\n \"\\u20B8\": \"KZT\",\n \"\\u0434\\u0435\\u043D\": \"MKD\",\n \"z\\u0142\": \"PLN\",\n \"\\u20BD\": \"RUB\",\n \"\\u20BE\": \"GEL\"\n };\n var lookAheadCharArray = [\n // burmese\n \"\\u103A\",\n // Dhivehi\n \"\\u07B0\"\n ];\n var diatricMap = {\n // Burmese\n // dependent vowels\n \"\\u102C\": \"a\",\n \"\\u102B\": \"a\",\n \"\\u1031\": \"e\",\n \"\\u1032\": \"e\",\n \"\\u102D\": \"i\",\n \"\\u102E\": \"i\",\n \"\\u102D\\u102F\": \"o\",\n \"\\u102F\": \"u\",\n \"\\u1030\": \"u\",\n \"\\u1031\\u102B\\u1004\\u103A\": \"aung\",\n \"\\u1031\\u102C\": \"aw\",\n \"\\u1031\\u102C\\u103A\": \"aw\",\n \"\\u1031\\u102B\": \"aw\",\n \"\\u1031\\u102B\\u103A\": \"aw\",\n \"\\u103A\": \"\\u103A\",\n // this is special case but the character will be converted to latin in the code\n \"\\u1000\\u103A\": \"et\",\n \"\\u102D\\u102F\\u1000\\u103A\": \"aik\",\n \"\\u1031\\u102C\\u1000\\u103A\": \"auk\",\n \"\\u1004\\u103A\": \"in\",\n \"\\u102D\\u102F\\u1004\\u103A\": \"aing\",\n \"\\u1031\\u102C\\u1004\\u103A\": \"aung\",\n \"\\u1005\\u103A\": \"it\",\n \"\\u100A\\u103A\": \"i\",\n \"\\u1010\\u103A\": \"at\",\n \"\\u102D\\u1010\\u103A\": \"eik\",\n \"\\u102F\\u1010\\u103A\": \"ok\",\n \"\\u103D\\u1010\\u103A\": \"ut\",\n \"\\u1031\\u1010\\u103A\": \"it\",\n \"\\u1012\\u103A\": \"d\",\n \"\\u102D\\u102F\\u1012\\u103A\": \"ok\",\n \"\\u102F\\u1012\\u103A\": \"ait\",\n \"\\u1014\\u103A\": \"an\",\n \"\\u102C\\u1014\\u103A\": \"an\",\n \"\\u102D\\u1014\\u103A\": \"ein\",\n \"\\u102F\\u1014\\u103A\": \"on\",\n \"\\u103D\\u1014\\u103A\": \"un\",\n \"\\u1015\\u103A\": \"at\",\n \"\\u102D\\u1015\\u103A\": \"eik\",\n \"\\u102F\\u1015\\u103A\": \"ok\",\n \"\\u103D\\u1015\\u103A\": \"ut\",\n \"\\u1014\\u103A\\u102F\\u1015\\u103A\": \"nub\",\n \"\\u1019\\u103A\": \"an\",\n \"\\u102D\\u1019\\u103A\": \"ein\",\n \"\\u102F\\u1019\\u103A\": \"on\",\n \"\\u103D\\u1019\\u103A\": \"un\",\n \"\\u101A\\u103A\": \"e\",\n \"\\u102D\\u102F\\u101C\\u103A\": \"ol\",\n \"\\u1009\\u103A\": \"in\",\n \"\\u1036\": \"an\",\n \"\\u102D\\u1036\": \"ein\",\n \"\\u102F\\u1036\": \"on\",\n // Dhivehi\n \"\\u07A6\\u0787\\u07B0\": \"ah\",\n \"\\u07A6\\u0781\\u07B0\": \"ah\"\n };\n var langCharMap = {\n \"en\": {},\n // default language\n \"az\": {\n // Azerbaijani\n \"\\xE7\": \"c\",\n \"\\u0259\": \"e\",\n \"\\u011F\": \"g\",\n \"\\u0131\": \"i\",\n \"\\xF6\": \"o\",\n \"\\u015F\": \"s\",\n \"\\xFC\": \"u\",\n \"\\xC7\": \"C\",\n \"\\u018F\": \"E\",\n \"\\u011E\": \"G\",\n \"\\u0130\": \"I\",\n \"\\xD6\": \"O\",\n \"\\u015E\": \"S\",\n \"\\xDC\": \"U\"\n },\n \"cs\": {\n // Czech\n \"\\u010D\": \"c\",\n \"\\u010F\": \"d\",\n \"\\u011B\": \"e\",\n \"\\u0148\": \"n\",\n \"\\u0159\": \"r\",\n \"\\u0161\": \"s\",\n \"\\u0165\": \"t\",\n \"\\u016F\": \"u\",\n \"\\u017E\": \"z\",\n \"\\u010C\": \"C\",\n \"\\u010E\": \"D\",\n \"\\u011A\": \"E\",\n \"\\u0147\": \"N\",\n \"\\u0158\": \"R\",\n \"\\u0160\": \"S\",\n \"\\u0164\": \"T\",\n \"\\u016E\": \"U\",\n \"\\u017D\": \"Z\"\n },\n \"fi\": {\n // Finnish\n // 'å': 'a', duplicate see charMap/latin\n // 'Å': 'A', duplicate see charMap/latin\n \"\\xE4\": \"a\",\n // ok\n \"\\xC4\": \"A\",\n // ok\n \"\\xF6\": \"o\",\n // ok\n \"\\xD6\": \"O\"\n // ok\n },\n \"hu\": {\n // Hungarian\n \"\\xE4\": \"a\",\n // ok\n \"\\xC4\": \"A\",\n // ok\n // 'á': 'a', duplicate see charMap/latin\n // 'Á': 'A', duplicate see charMap/latin\n \"\\xF6\": \"o\",\n // ok\n \"\\xD6\": \"O\",\n // ok\n // 'ő': 'o', duplicate see charMap/latin\n // 'Ő': 'O', duplicate see charMap/latin\n \"\\xFC\": \"u\",\n \"\\xDC\": \"U\",\n \"\\u0171\": \"u\",\n \"\\u0170\": \"U\"\n },\n \"lt\": {\n // Lithuanian\n \"\\u0105\": \"a\",\n \"\\u010D\": \"c\",\n \"\\u0119\": \"e\",\n \"\\u0117\": \"e\",\n \"\\u012F\": \"i\",\n \"\\u0161\": \"s\",\n \"\\u0173\": \"u\",\n \"\\u016B\": \"u\",\n \"\\u017E\": \"z\",\n \"\\u0104\": \"A\",\n \"\\u010C\": \"C\",\n \"\\u0118\": \"E\",\n \"\\u0116\": \"E\",\n \"\\u012E\": \"I\",\n \"\\u0160\": \"S\",\n \"\\u0172\": \"U\",\n \"\\u016A\": \"U\"\n },\n \"lv\": {\n // Latvian\n \"\\u0101\": \"a\",\n \"\\u010D\": \"c\",\n \"\\u0113\": \"e\",\n \"\\u0123\": \"g\",\n \"\\u012B\": \"i\",\n \"\\u0137\": \"k\",\n \"\\u013C\": \"l\",\n \"\\u0146\": \"n\",\n \"\\u0161\": \"s\",\n \"\\u016B\": \"u\",\n \"\\u017E\": \"z\",\n \"\\u0100\": \"A\",\n \"\\u010C\": \"C\",\n \"\\u0112\": \"E\",\n \"\\u0122\": \"G\",\n \"\\u012A\": \"i\",\n \"\\u0136\": \"k\",\n \"\\u013B\": \"L\",\n \"\\u0145\": \"N\",\n \"\\u0160\": \"S\",\n \"\\u016A\": \"u\",\n \"\\u017D\": \"Z\"\n },\n \"pl\": {\n // Polish\n \"\\u0105\": \"a\",\n \"\\u0107\": \"c\",\n \"\\u0119\": \"e\",\n \"\\u0142\": \"l\",\n \"\\u0144\": \"n\",\n \"\\xF3\": \"o\",\n \"\\u015B\": \"s\",\n \"\\u017A\": \"z\",\n \"\\u017C\": \"z\",\n \"\\u0104\": \"A\",\n \"\\u0106\": \"C\",\n \"\\u0118\": \"e\",\n \"\\u0141\": \"L\",\n \"\\u0143\": \"N\",\n \"\\xD3\": \"O\",\n \"\\u015A\": \"S\",\n \"\\u0179\": \"Z\",\n \"\\u017B\": \"Z\"\n },\n \"sv\": {\n // Swedish\n // 'å': 'a', duplicate see charMap/latin\n // 'Å': 'A', duplicate see charMap/latin\n \"\\xE4\": \"a\",\n // ok\n \"\\xC4\": \"A\",\n // ok\n \"\\xF6\": \"o\",\n // ok\n \"\\xD6\": \"O\"\n // ok\n },\n \"sk\": {\n // Slovak\n \"\\xE4\": \"a\",\n \"\\xC4\": \"A\"\n },\n \"sr\": {\n // Serbian\n \"\\u0459\": \"lj\",\n \"\\u045A\": \"nj\",\n \"\\u0409\": \"Lj\",\n \"\\u040A\": \"Nj\",\n \"\\u0111\": \"dj\",\n \"\\u0110\": \"Dj\"\n },\n \"tr\": {\n // Turkish\n \"\\xDC\": \"U\",\n \"\\xD6\": \"O\",\n \"\\xFC\": \"u\",\n \"\\xF6\": \"o\"\n }\n };\n var symbolMap = {\n \"ar\": {\n \"\\u2206\": \"delta\",\n \"\\u221E\": \"la-nihaya\",\n \"\\u2665\": \"hob\",\n \"&\": \"wa\",\n \"|\": \"aw\",\n \"<\": \"aqal-men\",\n \">\": \"akbar-men\",\n \"\\u2211\": \"majmou\",\n \"\\xA4\": \"omla\"\n },\n \"az\": {},\n \"ca\": {\n \"\\u2206\": \"delta\",\n \"\\u221E\": \"infinit\",\n \"\\u2665\": \"amor\",\n \"&\": \"i\",\n \"|\": \"o\",\n \"<\": \"menys que\",\n \">\": \"mes que\",\n \"\\u2211\": \"suma dels\",\n \"\\xA4\": \"moneda\"\n },\n \"cs\": {\n \"\\u2206\": \"delta\",\n \"\\u221E\": \"nekonecno\",\n \"\\u2665\": \"laska\",\n \"&\": \"a\",\n \"|\": \"nebo\",\n \"<\": \"mensi nez\",\n \">\": \"vetsi nez\",\n \"\\u2211\": \"soucet\",\n \"\\xA4\": \"mena\"\n },\n \"de\": {\n \"\\u2206\": \"delta\",\n \"\\u221E\": \"unendlich\",\n \"\\u2665\": \"Liebe\",\n \"&\": \"und\",\n \"|\": \"oder\",\n \"<\": \"kleiner als\",\n \">\": \"groesser als\",\n \"\\u2211\": \"Summe von\",\n \"\\xA4\": \"Waehrung\"\n },\n \"dv\": {\n \"\\u2206\": \"delta\",\n \"\\u221E\": \"kolunulaa\",\n \"\\u2665\": \"loabi\",\n \"&\": \"aai\",\n \"|\": \"noonee\",\n \"<\": \"ah vure kuda\",\n \">\": \"ah vure bodu\",\n \"\\u2211\": \"jumula\",\n \"\\xA4\": \"faisaa\"\n },\n \"en\": {\n \"\\u2206\": \"delta\",\n \"\\u221E\": \"infinity\",\n \"\\u2665\": \"love\",\n \"&\": \"and\",\n \"|\": \"or\",\n \"<\": \"less than\",\n \">\": \"greater than\",\n \"\\u2211\": \"sum\",\n \"\\xA4\": \"currency\"\n },\n \"es\": {\n \"\\u2206\": \"delta\",\n \"\\u221E\": \"infinito\",\n \"\\u2665\": \"amor\",\n \"&\": \"y\",\n \"|\": \"u\",\n \"<\": \"menos que\",\n \">\": \"mas que\",\n \"\\u2211\": \"suma de los\",\n \"\\xA4\": \"moneda\"\n },\n \"fa\": {\n \"\\u2206\": \"delta\",\n \"\\u221E\": \"bi-nahayat\",\n \"\\u2665\": \"eshgh\",\n \"&\": \"va\",\n \"|\": \"ya\",\n \"<\": \"kamtar-az\",\n \">\": \"bishtar-az\",\n \"\\u2211\": \"majmooe\",\n \"\\xA4\": \"vahed\"\n },\n \"fi\": {\n \"\\u2206\": \"delta\",\n \"\\u221E\": \"aarettomyys\",\n \"\\u2665\": \"rakkaus\",\n \"&\": \"ja\",\n \"|\": \"tai\",\n \"<\": \"pienempi kuin\",\n \">\": \"suurempi kuin\",\n \"\\u2211\": \"summa\",\n \"\\xA4\": \"valuutta\"\n },\n \"fr\": {\n \"\\u2206\": \"delta\",\n \"\\u221E\": \"infiniment\",\n \"\\u2665\": \"Amour\",\n \"&\": \"et\",\n \"|\": \"ou\",\n \"<\": \"moins que\",\n \">\": \"superieure a\",\n \"\\u2211\": \"somme des\",\n \"\\xA4\": \"monnaie\"\n },\n \"ge\": {\n \"\\u2206\": \"delta\",\n \"\\u221E\": \"usasruloba\",\n \"\\u2665\": \"siqvaruli\",\n \"&\": \"da\",\n \"|\": \"an\",\n \"<\": \"naklebi\",\n \">\": \"meti\",\n \"\\u2211\": \"jami\",\n \"\\xA4\": \"valuta\"\n },\n \"gr\": {},\n \"hu\": {\n \"\\u2206\": \"delta\",\n \"\\u221E\": \"vegtelen\",\n \"\\u2665\": \"szerelem\",\n \"&\": \"es\",\n \"|\": \"vagy\",\n \"<\": \"kisebb mint\",\n \">\": \"nagyobb mint\",\n \"\\u2211\": \"szumma\",\n \"\\xA4\": \"penznem\"\n },\n \"it\": {\n \"\\u2206\": \"delta\",\n \"\\u221E\": \"infinito\",\n \"\\u2665\": \"amore\",\n \"&\": \"e\",\n \"|\": \"o\",\n \"<\": \"minore di\",\n \">\": \"maggiore di\",\n \"\\u2211\": \"somma\",\n \"\\xA4\": \"moneta\"\n },\n \"lt\": {\n \"\\u2206\": \"delta\",\n \"\\u221E\": \"begalybe\",\n \"\\u2665\": \"meile\",\n \"&\": \"ir\",\n \"|\": \"ar\",\n \"<\": \"maziau nei\",\n \">\": \"daugiau nei\",\n \"\\u2211\": \"suma\",\n \"\\xA4\": \"valiuta\"\n },\n \"lv\": {\n \"\\u2206\": \"delta\",\n \"\\u221E\": \"bezgaliba\",\n \"\\u2665\": \"milestiba\",\n \"&\": \"un\",\n \"|\": \"vai\",\n \"<\": \"mazak neka\",\n \">\": \"lielaks neka\",\n \"\\u2211\": \"summa\",\n \"\\xA4\": \"valuta\"\n },\n \"my\": {\n \"\\u2206\": \"kwahkhyaet\",\n \"\\u221E\": \"asaonasme\",\n \"\\u2665\": \"akhyait\",\n \"&\": \"nhin\",\n \"|\": \"tho\",\n \"<\": \"ngethaw\",\n \">\": \"kyithaw\",\n \"\\u2211\": \"paungld\",\n \"\\xA4\": \"ngwekye\"\n },\n \"mk\": {},\n \"nl\": {\n \"\\u2206\": \"delta\",\n \"\\u221E\": \"oneindig\",\n \"\\u2665\": \"liefde\",\n \"&\": \"en\",\n \"|\": \"of\",\n \"<\": \"kleiner dan\",\n \">\": \"groter dan\",\n \"\\u2211\": \"som\",\n \"\\xA4\": \"valuta\"\n },\n \"pl\": {\n \"\\u2206\": \"delta\",\n \"\\u221E\": \"nieskonczonosc\",\n \"\\u2665\": \"milosc\",\n \"&\": \"i\",\n \"|\": \"lub\",\n \"<\": \"mniejsze niz\",\n \">\": \"wieksze niz\",\n \"\\u2211\": \"suma\",\n \"\\xA4\": \"waluta\"\n },\n \"pt\": {\n \"\\u2206\": \"delta\",\n \"\\u221E\": \"infinito\",\n \"\\u2665\": \"amor\",\n \"&\": \"e\",\n \"|\": \"ou\",\n \"<\": \"menor que\",\n \">\": \"maior que\",\n \"\\u2211\": \"soma\",\n \"\\xA4\": \"moeda\"\n },\n \"ro\": {\n \"\\u2206\": \"delta\",\n \"\\u221E\": \"infinit\",\n \"\\u2665\": \"dragoste\",\n \"&\": \"si\",\n \"|\": \"sau\",\n \"<\": \"mai mic ca\",\n \">\": \"mai mare ca\",\n \"\\u2211\": \"suma\",\n \"\\xA4\": \"valuta\"\n },\n \"ru\": {\n \"\\u2206\": \"delta\",\n \"\\u221E\": \"beskonechno\",\n \"\\u2665\": \"lubov\",\n \"&\": \"i\",\n \"|\": \"ili\",\n \"<\": \"menshe\",\n \">\": \"bolshe\",\n \"\\u2211\": \"summa\",\n \"\\xA4\": \"valjuta\"\n },\n \"sk\": {\n \"\\u2206\": \"delta\",\n \"\\u221E\": \"nekonecno\",\n \"\\u2665\": \"laska\",\n \"&\": \"a\",\n \"|\": \"alebo\",\n \"<\": \"menej ako\",\n \">\": \"viac ako\",\n \"\\u2211\": \"sucet\",\n \"\\xA4\": \"mena\"\n },\n \"sr\": {},\n \"tr\": {\n \"\\u2206\": \"delta\",\n \"\\u221E\": \"sonsuzluk\",\n \"\\u2665\": \"ask\",\n \"&\": \"ve\",\n \"|\": \"veya\",\n \"<\": \"kucuktur\",\n \">\": \"buyuktur\",\n \"\\u2211\": \"toplam\",\n \"\\xA4\": \"para birimi\"\n },\n \"uk\": {\n \"\\u2206\": \"delta\",\n \"\\u221E\": \"bezkinechnist\",\n \"\\u2665\": \"lubov\",\n \"&\": \"i\",\n \"|\": \"abo\",\n \"<\": \"menshe\",\n \">\": \"bilshe\",\n \"\\u2211\": \"suma\",\n \"\\xA4\": \"valjuta\"\n },\n \"vn\": {\n \"\\u2206\": \"delta\",\n \"\\u221E\": \"vo cuc\",\n \"\\u2665\": \"yeu\",\n \"&\": \"va\",\n \"|\": \"hoac\",\n \"<\": \"nho hon\",\n \">\": \"lon hon\",\n \"\\u2211\": \"tong\",\n \"\\xA4\": \"tien te\"\n }\n };\n var uricChars = [\";\", \"?\", \":\", \"@\", \"&\", \"=\", \"+\", \"$\", \",\", \"/\"].join(\"\");\n var uricNoSlashChars = [\";\", \"?\", \":\", \"@\", \"&\", \"=\", \"+\", \"$\", \",\"].join(\"\");\n var markChars = [\".\", \"!\", \"~\", \"*\", \"'\", \"(\", \")\"].join(\"\");\n var getSlug = function getSlug2(input, opts) {\n var separator = \"-\";\n var result = \"\";\n var diatricString = \"\";\n var convertSymbols = true;\n var customReplacements = {};\n var maintainCase;\n var titleCase;\n var truncate;\n var uricFlag;\n var uricNoSlashFlag;\n var markFlag;\n var symbol;\n var langChar;\n var lucky;\n var i;\n var ch;\n var l;\n var lastCharWasSymbol;\n var lastCharWasDiatric;\n var allowedChars = \"\";\n if (typeof input !== \"string\") {\n return \"\";\n }\n if (typeof opts === \"string\") {\n separator = opts;\n }\n symbol = symbolMap.en;\n langChar = langCharMap.en;\n if (typeof opts === \"object\") {\n maintainCase = opts.maintainCase || false;\n customReplacements = opts.custom && typeof opts.custom === \"object\" ? opts.custom : customReplacements;\n truncate = +opts.truncate > 1 && opts.truncate || false;\n uricFlag = opts.uric || false;\n uricNoSlashFlag = opts.uricNoSlash || false;\n markFlag = opts.mark || false;\n convertSymbols = opts.symbols === false || opts.lang === false ? false : true;\n separator = opts.separator || separator;\n if (uricFlag) {\n allowedChars += uricChars;\n }\n if (uricNoSlashFlag) {\n allowedChars += uricNoSlashChars;\n }\n if (markFlag) {\n allowedChars += markChars;\n }\n symbol = opts.lang && symbolMap[opts.lang] && convertSymbols ? symbolMap[opts.lang] : convertSymbols ? symbolMap.en : {};\n langChar = opts.lang && langCharMap[opts.lang] ? langCharMap[opts.lang] : opts.lang === false || opts.lang === true ? {} : langCharMap.en;\n if (opts.titleCase && typeof opts.titleCase.length === \"number\" && Array.prototype.toString.call(opts.titleCase)) {\n opts.titleCase.forEach(function(v) {\n customReplacements[v + \"\"] = v + \"\";\n });\n titleCase = true;\n } else {\n titleCase = !!opts.titleCase;\n }\n if (opts.custom && typeof opts.custom.length === \"number\" && Array.prototype.toString.call(opts.custom)) {\n opts.custom.forEach(function(v) {\n customReplacements[v + \"\"] = v + \"\";\n });\n }\n Object.keys(customReplacements).forEach(function(v) {\n var r;\n if (v.length > 1) {\n r = new RegExp(\"\\\\b\" + escapeChars(v) + \"\\\\b\", \"gi\");\n } else {\n r = new RegExp(escapeChars(v), \"gi\");\n }\n input = input.replace(r, customReplacements[v]);\n });\n for (ch in customReplacements) {\n allowedChars += ch;\n }\n }\n allowedChars += separator;\n allowedChars = escapeChars(allowedChars);\n input = input.replace(/(^\\s+|\\s+$)/g, \"\");\n lastCharWasSymbol = false;\n lastCharWasDiatric = false;\n for (i = 0, l = input.length; i < l; i++) {\n ch = input[i];\n if (isReplacedCustomChar(ch, customReplacements)) {\n lastCharWasSymbol = false;\n } else if (langChar[ch]) {\n ch = lastCharWasSymbol && langChar[ch].match(/[A-Za-z0-9]/) ? \" \" + langChar[ch] : langChar[ch];\n lastCharWasSymbol = false;\n } else if (ch in charMap) {\n if (i + 1 < l && lookAheadCharArray.indexOf(input[i + 1]) >= 0) {\n diatricString += ch;\n ch = \"\";\n } else if (lastCharWasDiatric === true) {\n ch = diatricMap[diatricString] + charMap[ch];\n diatricString = \"\";\n } else {\n ch = lastCharWasSymbol && charMap[ch].match(/[A-Za-z0-9]/) ? \" \" + charMap[ch] : charMap[ch];\n }\n lastCharWasSymbol = false;\n lastCharWasDiatric = false;\n } else if (ch in diatricMap) {\n diatricString += ch;\n ch = \"\";\n if (i === l - 1) {\n ch = diatricMap[diatricString];\n }\n lastCharWasDiatric = true;\n } else if (\n // process symbol chars\n symbol[ch] && !(uricFlag && uricChars.indexOf(ch) !== -1) && !(uricNoSlashFlag && uricNoSlashChars.indexOf(ch) !== -1)\n ) {\n ch = lastCharWasSymbol || result.substr(-1).match(/[A-Za-z0-9]/) ? separator + symbol[ch] : symbol[ch];\n ch += input[i + 1] !== void 0 && input[i + 1].match(/[A-Za-z0-9]/) ? separator : \"\";\n lastCharWasSymbol = true;\n } else {\n if (lastCharWasDiatric === true) {\n ch = diatricMap[diatricString] + ch;\n diatricString = \"\";\n lastCharWasDiatric = false;\n } else if (lastCharWasSymbol && (/[A-Za-z0-9]/.test(ch) || result.substr(-1).match(/A-Za-z0-9]/))) {\n ch = \" \" + ch;\n }\n lastCharWasSymbol = false;\n }\n result += ch.replace(new RegExp(\"[^\\\\w\\\\s\" + allowedChars + \"_-]\", \"g\"), separator);\n }\n if (titleCase) {\n result = result.replace(/(\\w)(\\S*)/g, function(_, i2, r) {\n var j = i2.toUpperCase() + (r !== null ? r : \"\");\n return Object.keys(customReplacements).indexOf(j.toLowerCase()) < 0 ? j : j.toLowerCase();\n });\n }\n result = result.replace(/\\s+/g, separator).replace(new RegExp(\"\\\\\" + separator + \"+\", \"g\"), separator).replace(new RegExp(\"(^\\\\\" + separator + \"+|\\\\\" + separator + \"+$)\", \"g\"), \"\");\n if (truncate && result.length > truncate) {\n lucky = result.charAt(truncate) === separator;\n result = result.slice(0, truncate);\n if (!lucky) {\n result = result.slice(0, result.lastIndexOf(separator));\n }\n }\n if (!maintainCase && !titleCase) {\n result = result.toLowerCase();\n }\n return result;\n };\n var createSlug = function createSlug2(opts) {\n return function getSlugWithConfig(input) {\n return getSlug(input, opts);\n };\n };\n var escapeChars = function escapeChars2(input) {\n return input.replace(/[-\\\\^$*+?.()|[\\]{}\\/]/g, \"\\\\$&\");\n };\n var isReplacedCustomChar = function(ch, customReplacements) {\n for (var c in customReplacements) {\n if (customReplacements[c] === ch) {\n return true;\n }\n }\n };\n if (typeof module !== \"undefined\" && module.exports) {\n module.exports = getSlug;\n module.exports.createSlug = createSlug;\n } else if (typeof define !== \"undefined\" && define.amd) {\n define([], function() {\n return getSlug;\n });\n } else {\n try {\n if (root.getSlug || root.createSlug) {\n throw \"speakingurl: globals exists /(getSlug|createSlug)/\";\n } else {\n root.getSlug = getSlug;\n root.createSlug = createSlug;\n }\n } catch (e) {\n }\n }\n })(exports);\n }\n});\n\n// ../../node_modules/.pnpm/speakingurl@14.0.1/node_modules/speakingurl/index.js\nvar require_speakingurl2 = __commonJS({\n \"../../node_modules/.pnpm/speakingurl@14.0.1/node_modules/speakingurl/index.js\"(exports, module) {\n \"use strict\";\n init_esm_shims();\n module.exports = require_speakingurl();\n }\n});\n\n// src/index.ts\ninit_esm_shims();\n\n// src/core/index.ts\ninit_esm_shims();\nimport { isNuxtApp, target as target13 } from \"@vue/devtools-shared\";\n\n// src/compat/index.ts\ninit_esm_shims();\nimport { target } from \"@vue/devtools-shared\";\nfunction onLegacyDevToolsPluginApiAvailable(cb) {\n if (target.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__) {\n cb();\n return;\n }\n Object.defineProperty(target, \"__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__\", {\n set(value) {\n if (value)\n cb();\n },\n configurable: true\n });\n}\n\n// src/ctx/index.ts\ninit_esm_shims();\nimport { target as target11 } from \"@vue/devtools-shared\";\n\n// src/ctx/api.ts\ninit_esm_shims();\nimport { target as target9 } from \"@vue/devtools-shared\";\n\n// src/core/component-highlighter/index.ts\ninit_esm_shims();\n\n// src/core/component/state/bounding-rect.ts\ninit_esm_shims();\n\n// src/core/component/utils/index.ts\ninit_esm_shims();\nimport { basename, classify } from \"@vue/devtools-shared\";\nfunction getComponentTypeName(options) {\n var _a25;\n const name = options.name || options._componentTag || options.__VUE_DEVTOOLS_COMPONENT_GUSSED_NAME__ || options.__name;\n if (name === \"index\" && ((_a25 = options.__file) == null ? void 0 : _a25.endsWith(\"index.vue\"))) {\n return \"\";\n }\n return name;\n}\nfunction getComponentFileName(options) {\n const file = options.__file;\n if (file)\n return classify(basename(file, \".vue\"));\n}\nfunction getComponentName(options) {\n const name = options.displayName || options.name || options._componentTag;\n if (name)\n return name;\n return getComponentFileName(options);\n}\nfunction saveComponentGussedName(instance, name) {\n instance.type.__VUE_DEVTOOLS_COMPONENT_GUSSED_NAME__ = name;\n return name;\n}\nfunction getAppRecord(instance) {\n if (instance.__VUE_DEVTOOLS_NEXT_APP_RECORD__)\n return instance.__VUE_DEVTOOLS_NEXT_APP_RECORD__;\n else if (instance.root)\n return instance.appContext.app.__VUE_DEVTOOLS_NEXT_APP_RECORD__;\n}\nasync function getComponentId(options) {\n const { app, uid, instance } = options;\n try {\n if (instance.__VUE_DEVTOOLS_NEXT_UID__)\n return instance.__VUE_DEVTOOLS_NEXT_UID__;\n const appRecord = await getAppRecord(app);\n if (!appRecord)\n return null;\n const isRoot = appRecord.rootInstance === instance;\n return `${appRecord.id}:${isRoot ? \"root\" : uid}`;\n } catch (e) {\n }\n}\nfunction isFragment(instance) {\n var _a25, _b25;\n const subTreeType = (_a25 = instance.subTree) == null ? void 0 : _a25.type;\n const appRecord = getAppRecord(instance);\n if (appRecord) {\n return ((_b25 = appRecord == null ? void 0 : appRecord.types) == null ? void 0 : _b25.Fragment) === subTreeType;\n }\n return false;\n}\nfunction isBeingDestroyed(instance) {\n return instance._isBeingDestroyed || instance.isUnmounted;\n}\nfunction getInstanceName(instance) {\n var _a25, _b25, _c;\n const name = getComponentTypeName((instance == null ? void 0 : instance.type) || {});\n if (name)\n return name;\n if ((instance == null ? void 0 : instance.root) === instance)\n return \"Root\";\n for (const key in (_b25 = (_a25 = instance.parent) == null ? void 0 : _a25.type) == null ? void 0 : _b25.components) {\n if (instance.parent.type.components[key] === (instance == null ? void 0 : instance.type))\n return saveComponentGussedName(instance, key);\n }\n for (const key in (_c = instance.appContext) == null ? void 0 : _c.components) {\n if (instance.appContext.components[key] === (instance == null ? void 0 : instance.type))\n return saveComponentGussedName(instance, key);\n }\n const fileName = getComponentFileName((instance == null ? void 0 : instance.type) || {});\n if (fileName)\n return fileName;\n return \"Anonymous Component\";\n}\nfunction getUniqueComponentId(instance) {\n var _a25, _b25, _c;\n const appId = (_c = (_b25 = (_a25 = instance == null ? void 0 : instance.appContext) == null ? void 0 : _a25.app) == null ? void 0 : _b25.__VUE_DEVTOOLS_NEXT_APP_RECORD_ID__) != null ? _c : 0;\n const instanceId = instance === (instance == null ? void 0 : instance.root) ? \"root\" : instance.uid;\n return `${appId}:${instanceId}`;\n}\nfunction getRenderKey(value) {\n if (value == null)\n return \"\";\n if (typeof value === \"number\")\n return value;\n else if (typeof value === \"string\")\n return `'${value}'`;\n else if (Array.isArray(value))\n return \"Array\";\n else\n return \"Object\";\n}\nfunction returnError(cb) {\n try {\n return cb();\n } catch (e) {\n return e;\n }\n}\nfunction getComponentInstance(appRecord, instanceId) {\n instanceId = instanceId || `${appRecord.id}:root`;\n const instance = appRecord.instanceMap.get(instanceId);\n return instance || appRecord.instanceMap.get(\":root\");\n}\nfunction ensurePropertyExists(obj, key, skipObjCheck = false) {\n return skipObjCheck ? key in obj : typeof obj === \"object\" && obj !== null ? key in obj : false;\n}\n\n// src/core/component/state/bounding-rect.ts\nfunction createRect() {\n const rect = {\n top: 0,\n bottom: 0,\n left: 0,\n right: 0,\n get width() {\n return rect.right - rect.left;\n },\n get height() {\n return rect.bottom - rect.top;\n }\n };\n return rect;\n}\nvar range;\nfunction getTextRect(node) {\n if (!range)\n range = document.createRange();\n range.selectNode(node);\n return range.getBoundingClientRect();\n}\nfunction getFragmentRect(vnode) {\n const rect = createRect();\n if (!vnode.children)\n return rect;\n for (let i = 0, l = vnode.children.length; i < l; i++) {\n const childVnode = vnode.children[i];\n let childRect;\n if (childVnode.component) {\n childRect = getComponentBoundingRect(childVnode.component);\n } else if (childVnode.el) {\n const el = childVnode.el;\n if (el.nodeType === 1 || el.getBoundingClientRect)\n childRect = el.getBoundingClientRect();\n else if (el.nodeType === 3 && el.data.trim())\n childRect = getTextRect(el);\n }\n if (childRect)\n mergeRects(rect, childRect);\n }\n return rect;\n}\nfunction mergeRects(a, b) {\n if (!a.top || b.top < a.top)\n a.top = b.top;\n if (!a.bottom || b.bottom > a.bottom)\n a.bottom = b.bottom;\n if (!a.left || b.left < a.left)\n a.left = b.left;\n if (!a.right || b.right > a.right)\n a.right = b.right;\n return a;\n}\nvar DEFAULT_RECT = {\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n width: 0,\n height: 0\n};\nfunction getComponentBoundingRect(instance) {\n const el = instance.subTree.el;\n if (typeof window === \"undefined\") {\n return DEFAULT_RECT;\n }\n if (isFragment(instance))\n return getFragmentRect(instance.subTree);\n else if ((el == null ? void 0 : el.nodeType) === 1)\n return el == null ? void 0 : el.getBoundingClientRect();\n else if (instance.subTree.component)\n return getComponentBoundingRect(instance.subTree.component);\n else\n return DEFAULT_RECT;\n}\n\n// src/core/component/tree/el.ts\ninit_esm_shims();\nfunction getRootElementsFromComponentInstance(instance) {\n if (isFragment(instance))\n return getFragmentRootElements(instance.subTree);\n if (!instance.subTree)\n return [];\n return [instance.subTree.el];\n}\nfunction getFragmentRootElements(vnode) {\n if (!vnode.children)\n return [];\n const list = [];\n vnode.children.forEach((childVnode) => {\n if (childVnode.component)\n list.push(...getRootElementsFromComponentInstance(childVnode.component));\n else if (childVnode == null ? void 0 : childVnode.el)\n list.push(childVnode.el);\n });\n return list;\n}\n\n// src/core/component-highlighter/index.ts\nvar CONTAINER_ELEMENT_ID = \"__vue-devtools-component-inspector__\";\nvar CARD_ELEMENT_ID = \"__vue-devtools-component-inspector__card__\";\nvar COMPONENT_NAME_ELEMENT_ID = \"__vue-devtools-component-inspector__name__\";\nvar INDICATOR_ELEMENT_ID = \"__vue-devtools-component-inspector__indicator__\";\nvar containerStyles = {\n display: \"block\",\n zIndex: 2147483640,\n position: \"fixed\",\n backgroundColor: \"#42b88325\",\n border: \"1px solid #42b88350\",\n borderRadius: \"5px\",\n transition: \"all 0.1s ease-in\",\n pointerEvents: \"none\"\n};\nvar cardStyles = {\n fontFamily: \"Arial, Helvetica, sans-serif\",\n padding: \"5px 8px\",\n borderRadius: \"4px\",\n textAlign: \"left\",\n position: \"absolute\",\n left: 0,\n color: \"#e9e9e9\",\n fontSize: \"14px\",\n fontWeight: 600,\n lineHeight: \"24px\",\n backgroundColor: \"#42b883\",\n boxShadow: \"0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1)\"\n};\nvar indicatorStyles = {\n display: \"inline-block\",\n fontWeight: 400,\n fontStyle: \"normal\",\n fontSize: \"12px\",\n opacity: 0.7\n};\nfunction getContainerElement() {\n return document.getElementById(CONTAINER_ELEMENT_ID);\n}\nfunction getCardElement() {\n return document.getElementById(CARD_ELEMENT_ID);\n}\nfunction getIndicatorElement() {\n return document.getElementById(INDICATOR_ELEMENT_ID);\n}\nfunction getNameElement() {\n return document.getElementById(COMPONENT_NAME_ELEMENT_ID);\n}\nfunction getStyles(bounds) {\n return {\n left: `${Math.round(bounds.left * 100) / 100}px`,\n top: `${Math.round(bounds.top * 100) / 100}px`,\n width: `${Math.round(bounds.width * 100) / 100}px`,\n height: `${Math.round(bounds.height * 100) / 100}px`\n };\n}\nfunction create(options) {\n var _a25;\n const containerEl = document.createElement(\"div\");\n containerEl.id = (_a25 = options.elementId) != null ? _a25 : CONTAINER_ELEMENT_ID;\n Object.assign(containerEl.style, {\n ...containerStyles,\n ...getStyles(options.bounds),\n ...options.style\n });\n const cardEl = document.createElement(\"span\");\n cardEl.id = CARD_ELEMENT_ID;\n Object.assign(cardEl.style, {\n ...cardStyles,\n top: options.bounds.top < 35 ? 0 : \"-35px\"\n });\n const nameEl = document.createElement(\"span\");\n nameEl.id = COMPONENT_NAME_ELEMENT_ID;\n nameEl.innerHTML = `&lt;${options.name}&gt;&nbsp;&nbsp;`;\n const indicatorEl = document.createElement(\"i\");\n indicatorEl.id = INDICATOR_ELEMENT_ID;\n indicatorEl.innerHTML = `${Math.round(options.bounds.width * 100) / 100} x ${Math.round(options.bounds.height * 100) / 100}`;\n Object.assign(indicatorEl.style, indicatorStyles);\n cardEl.appendChild(nameEl);\n cardEl.appendChild(indicatorEl);\n containerEl.appendChild(cardEl);\n document.body.appendChild(containerEl);\n return containerEl;\n}\nfunction update(options) {\n const containerEl = getContainerElement();\n const cardEl = getCardElement();\n const nameEl = getNameElement();\n const indicatorEl = getIndicatorElement();\n if (containerEl) {\n Object.assign(containerEl.style, {\n ...containerStyles,\n ...getStyles(options.bounds)\n });\n Object.assign(cardEl.style, {\n top: options.bounds.top < 35 ? 0 : \"-35px\"\n });\n nameEl.innerHTML = `&lt;${options.name}&gt;&nbsp;&nbsp;`;\n indicatorEl.innerHTML = `${Math.round(options.bounds.width * 100) / 100} x ${Math.round(options.bounds.height * 100) / 100}`;\n }\n}\nfunction highlight(instance) {\n const bounds = getComponentBoundingRect(instance);\n if (!bounds.width && !bounds.height)\n return;\n const name = getInstanceName(instance);\n const container = getContainerElement();\n container ? update({ bounds, name }) : create({ bounds, name });\n}\nfunction unhighlight() {\n const el = getContainerElement();\n if (el)\n el.style.display = \"none\";\n}\nvar inspectInstance = null;\nfunction inspectFn(e) {\n const target22 = e.target;\n if (target22) {\n const instance = target22.__vueParentComponent;\n if (instance) {\n inspectInstance = instance;\n const el = instance.vnode.el;\n if (el) {\n const bounds = getComponentBoundingRect(instance);\n const name = getInstanceName(instance);\n const container = getContainerElement();\n container ? update({ bounds, name }) : create({ bounds, name });\n }\n }\n }\n}\nfunction selectComponentFn(e, cb) {\n e.preventDefault();\n e.stopPropagation();\n if (inspectInstance) {\n const uniqueComponentId = getUniqueComponentId(inspectInstance);\n cb(uniqueComponentId);\n }\n}\nvar inspectComponentHighLighterSelectFn = null;\nfunction cancelInspectComponentHighLighter() {\n unhighlight();\n window.removeEventListener(\"mouseover\", inspectFn);\n window.removeEventListener(\"click\", inspectComponentHighLighterSelectFn, true);\n inspectComponentHighLighterSelectFn = null;\n}\nfunction inspectComponentHighLighter() {\n window.addEventListener(\"mouseover\", inspectFn);\n return new Promise((resolve) => {\n function onSelect(e) {\n e.preventDefault();\n e.stopPropagation();\n selectComponentFn(e, (id) => {\n window.removeEventListener(\"click\", onSelect, true);\n inspectComponentHighLighterSelectFn = null;\n window.removeEventListener(\"mouseover\", inspectFn);\n const el = getContainerElement();\n if (el)\n el.style.display = \"none\";\n resolve(JSON.stringify({ id }));\n });\n }\n inspectComponentHighLighterSelectFn = onSelect;\n window.addEventListener(\"click\", onSelect, true);\n });\n}\nfunction scrollToComponent(options) {\n const instance = getComponentInstance(activeAppRecord.value, options.id);\n if (instance) {\n const [el] = getRootElementsFromComponentInstance(instance);\n if (typeof el.scrollIntoView === \"function\") {\n el.scrollIntoView({\n behavior: \"smooth\"\n });\n } else {\n const bounds = getComponentBoundingRect(instance);\n const scrollTarget = document.createElement(\"div\");\n const styles = {\n ...getStyles(bounds),\n position: \"absolute\"\n };\n Object.assign(scrollTarget.style, styles);\n document.body.appendChild(scrollTarget);\n scrollTarget.scrollIntoView({\n behavior: \"smooth\"\n });\n setTimeout(() => {\n document.body.removeChild(scrollTarget);\n }, 2e3);\n }\n setTimeout(() => {\n const bounds = getComponentBoundingRect(instance);\n if (bounds.width || bounds.height) {\n const name = getInstanceName(instance);\n const el2 = getContainerElement();\n el2 ? update({ ...options, name, bounds }) : create({ ...options, name, bounds });\n setTimeout(() => {\n if (el2)\n el2.style.display = \"none\";\n }, 1500);\n }\n }, 1200);\n }\n}\n\n// src/core/component-inspector/index.ts\ninit_esm_shims();\nimport { target as target2 } from \"@vue/devtools-shared\";\nvar _a, _b;\n(_b = (_a = target2).__VUE_DEVTOOLS_COMPONENT_INSPECTOR_ENABLED__) != null ? _b : _a.__VUE_DEVTOOLS_COMPONENT_INSPECTOR_ENABLED__ = true;\nfunction toggleComponentInspectorEnabled(enabled) {\n target2.__VUE_DEVTOOLS_COMPONENT_INSPECTOR_ENABLED__ = enabled;\n}\nfunction waitForInspectorInit(cb) {\n let total = 0;\n const timer = setInterval(() => {\n if (target2.__VUE_INSPECTOR__) {\n clearInterval(timer);\n total += 30;\n cb();\n }\n if (total >= /* 5s */\n 5e3)\n clearInterval(timer);\n }, 30);\n}\nfunction setupInspector() {\n const inspector = target2.__VUE_INSPECTOR__;\n const _openInEditor = inspector.openInEditor;\n inspector.openInEditor = async (...params) => {\n inspector.disable();\n _openInEditor(...params);\n };\n}\nfunction getComponentInspector() {\n return new Promise((resolve) => {\n function setup() {\n setupInspector();\n resolve(target2.__VUE_INSPECTOR__);\n }\n if (!target2.__VUE_INSPECTOR__) {\n waitForInspectorInit(() => {\n setup();\n });\n } else {\n setup();\n }\n });\n}\n\n// src/core/component/state/editor.ts\ninit_esm_shims();\n\n// src/shared/stub-vue.ts\ninit_esm_shims();\nfunction isReadonly(value) {\n return !!(value && value[\"__v_isReadonly\" /* IS_READONLY */]);\n}\nfunction isReactive(value) {\n if (isReadonly(value)) {\n return isReactive(value[\"__v_raw\" /* RAW */]);\n }\n return !!(value && value[\"__v_isReactive\" /* IS_REACTIVE */]);\n}\nfunction isRef(r) {\n return !!(r && r.__v_isRef === true);\n}\nfunction toRaw(observed) {\n const raw = observed && observed[\"__v_raw\" /* RAW */];\n return raw ? toRaw(raw) : observed;\n}\nvar Fragment = Symbol.for(\"v-fgt\");\n\n// src/core/component/state/editor.ts\nvar StateEditor = class {\n constructor() {\n this.refEditor = new RefStateEditor();\n }\n set(object, path, value, cb) {\n const sections = Array.isArray(path) ? path : path.split(\".\");\n const markRef = false;\n while (sections.length > 1) {\n const section = sections.shift();\n if (object instanceof Map)\n object = object.get(section);\n else if (object instanceof Set)\n object = Array.from(object.values())[section];\n else object = object[section];\n if (this.refEditor.isRef(object))\n object = this.refEditor.get(object);\n }\n const field = sections[0];\n const item = this.refEditor.get(object)[field];\n if (cb) {\n cb(object, field, value);\n } else {\n if (this.refEditor.isRef(item))\n this.refEditor.set(item, value);\n else if (markRef)\n object[field] = value;\n else\n object[field] = value;\n }\n }\n get(object, path) {\n const sections = Array.isArray(path) ? path : path.split(\".\");\n for (let i = 0; i < sections.length; i++) {\n if (object instanceof Map)\n object = object.get(sections[i]);\n else\n object = object[sections[i]];\n if (this.refEditor.isRef(object))\n object = this.refEditor.get(object);\n if (!object)\n return void 0;\n }\n return object;\n }\n has(object, path, parent = false) {\n if (typeof object === \"undefined\")\n return false;\n const sections = Array.isArray(path) ? path.slice() : path.split(\".\");\n const size = !parent ? 1 : 2;\n while (object && sections.length > size) {\n const section = sections.shift();\n object = object[section];\n if (this.refEditor.isRef(object))\n object = this.refEditor.get(object);\n }\n return object != null && Object.prototype.hasOwnProperty.call(object, sections[0]);\n }\n createDefaultSetCallback(state) {\n return (object, field, value) => {\n if (state.remove || state.newKey) {\n if (Array.isArray(object))\n object.splice(field, 1);\n else if (toRaw(object) instanceof Map)\n object.delete(field);\n else if (toRaw(object) instanceof Set)\n object.delete(Array.from(object.values())[field]);\n else Reflect.deleteProperty(object, field);\n }\n if (!state.remove) {\n const target22 = object[state.newKey || field];\n if (this.refEditor.isRef(target22))\n this.refEditor.set(target22, value);\n else if (toRaw(object) instanceof Map)\n object.set(state.newKey || field, value);\n else if (toRaw(object) instanceof Set)\n object.add(value);\n else\n object[state.newKey || field] = value;\n }\n };\n }\n};\nvar RefStateEditor = class {\n set(ref, value) {\n if (isRef(ref)) {\n ref.value = value;\n } else {\n if (ref instanceof Set && Array.isArray(value)) {\n ref.clear();\n value.forEach((v) => ref.add(v));\n return;\n }\n const currentKeys = Object.keys(value);\n if (ref instanceof Map) {\n const previousKeysSet2 = new Set(ref.keys());\n currentKeys.forEach((key) => {\n ref.set(key, Reflect.get(value, key));\n previousKeysSet2.delete(key);\n });\n previousKeysSet2.forEach((key) => ref.delete(key));\n return;\n }\n const previousKeysSet = new Set(Object.keys(ref));\n currentKeys.forEach((key) => {\n Reflect.set(ref, key, Reflect.get(value, key));\n previousKeysSet.delete(key);\n });\n previousKeysSet.forEach((key) => Reflect.deleteProperty(ref, key));\n }\n }\n get(ref) {\n return isRef(ref) ? ref.value : ref;\n }\n isRef(ref) {\n return isRef(ref) || isReactive(ref);\n }\n};\nasync function editComponentState(payload, stateEditor2) {\n const { path, nodeId, state, type } = payload;\n const instance = getComponentInstance(activeAppRecord.value, nodeId);\n if (!instance)\n return;\n const targetPath = path.slice();\n let target22;\n if (Object.keys(instance.props).includes(path[0])) {\n target22 = instance.props;\n } else if (instance.devtoolsRawSetupState && Object.keys(instance.devtoolsRawSetupState).includes(path[0])) {\n target22 = instance.devtoolsRawSetupState;\n } else if (instance.data && Object.keys(instance.data).includes(path[0])) {\n target22 = instance.data;\n } else {\n target22 = instance.proxy;\n }\n if (target22 && targetPath) {\n if (state.type === \"object\" && type === \"reactive\") {\n }\n stateEditor2.set(target22, targetPath, state.value, stateEditor2.createDefaultSetCallback(state));\n }\n}\nvar stateEditor = new StateEditor();\nasync function editState(payload) {\n editComponentState(payload, stateEditor);\n}\n\n// src/core/open-in-editor/index.ts\ninit_esm_shims();\nimport { target as target5 } from \"@vue/devtools-shared\";\n\n// src/ctx/state.ts\ninit_esm_shims();\nimport { target as global, isUrlString } from \"@vue/devtools-shared\";\nimport { debounce as debounce3 } from \"perfect-debounce\";\n\n// src/core/timeline/storage.ts\ninit_esm_shims();\nimport { isBrowser } from \"@vue/devtools-shared\";\nvar TIMELINE_LAYERS_STATE_STORAGE_ID = \"__VUE_DEVTOOLS_KIT_TIMELINE_LAYERS_STATE__\";\nfunction addTimelineLayersStateToStorage(state) {\n if (!isBrowser || typeof localStorage === \"undefined\" || localStorage === null) {\n return;\n }\n localStorage.setItem(TIMELINE_LAYERS_STATE_STORAGE_ID, JSON.stringify(state));\n}\nfunction getTimelineLayersStateFromStorage() {\n if (!isBrowser || typeof localStorage === \"undefined\" || localStorage === null) {\n return {\n recordingState: false,\n mouseEventEnabled: false,\n keyboardEventEnabled: false,\n componentEventEnabled: false,\n performanceEventEnabled: false,\n selected: \"\"\n };\n }\n const state = localStorage.getItem(TIMELINE_LAYERS_STATE_STORAGE_ID);\n return state ? JSON.parse(state) : {\n recordingState: false,\n mouseEventEnabled: false,\n keyboardEventEnabled: false,\n componentEventEnabled: false,\n performanceEventEnabled: false,\n selected: \"\"\n };\n}\n\n// src/ctx/hook.ts\ninit_esm_shims();\nimport { createHooks } from \"hookable\";\nimport { debounce as debounce2 } from \"perfect-debounce\";\n\n// src/ctx/inspector.ts\ninit_esm_shims();\nimport { target as target4 } from \"@vue/devtools-shared\";\nimport { debounce } from \"perfect-debounce\";\n\n// src/ctx/timeline.ts\ninit_esm_shims();\nimport { target as target3 } from \"@vue/devtools-shared\";\nvar _a2, _b2;\n(_b2 = (_a2 = target3).__VUE_DEVTOOLS_KIT_TIMELINE_LAYERS) != null ? _b2 : _a2.__VUE_DEVTOOLS_KIT_TIMELINE_LAYERS = [];\nvar devtoolsTimelineLayers = new Proxy(target3.__VUE_DEVTOOLS_KIT_TIMELINE_LAYERS, {\n get(target22, prop, receiver) {\n return Reflect.get(target22, prop, receiver);\n }\n});\nfunction addTimelineLayer(options, descriptor) {\n devtoolsState.timelineLayersState[descriptor.id] = false;\n devtoolsTimelineLayers.push({\n ...options,\n descriptorId: descriptor.id,\n appRecord: getAppRecord(descriptor.app)\n });\n}\nfunction updateTimelineLayersState(state) {\n const updatedState = {\n ...devtoolsState.timelineLayersState,\n ...state\n };\n addTimelineLayersStateToStorage(updatedState);\n updateDevToolsState({\n timelineLayersState: updatedState\n });\n}\n\n// src/ctx/inspector.ts\nvar _a3, _b3;\n(_b3 = (_a3 = target4).__VUE_DEVTOOLS_KIT_INSPECTOR__) != null ? _b3 : _a3.__VUE_DEVTOOLS_KIT_INSPECTOR__ = [];\nvar devtoolsInspector = new Proxy(target4.__VUE_DEVTOOLS_KIT_INSPECTOR__, {\n get(target22, prop, receiver) {\n return Reflect.get(target22, prop, receiver);\n }\n});\nvar callInspectorUpdatedHook = debounce(() => {\n devtoolsContext.hooks.callHook(\"sendInspectorToClient\" /* SEND_INSPECTOR_TO_CLIENT */, getActiveInspectors());\n});\nfunction addInspector(inspector, descriptor) {\n var _a25, _b25;\n devtoolsInspector.push({\n options: inspector,\n descriptor,\n treeFilterPlaceholder: (_a25 = inspector.treeFilterPlaceholder) != null ? _a25 : \"Search tree...\",\n stateFilterPlaceholder: (_b25 = inspector.stateFilterPlaceholder) != null ? _b25 : \"Search state...\",\n treeFilter: \"\",\n selectedNodeId: \"\",\n appRecord: getAppRecord(descriptor.app)\n });\n callInspectorUpdatedHook();\n}\nfunction getActiveInspectors() {\n return devtoolsInspector.filter((inspector) => inspector.descriptor.app === activeAppRecord.value.app).filter((inspector) => inspector.descriptor.id !== \"components\").map((inspector) => {\n var _a25;\n const descriptor = inspector.descriptor;\n const options = inspector.options;\n return {\n id: options.id,\n label: options.label,\n logo: descriptor.logo,\n icon: `custom-ic-baseline-${(_a25 = options == null ? void 0 : options.icon) == null ? void 0 : _a25.replace(/_/g, \"-\")}`,\n packageName: descriptor.packageName,\n homepage: descriptor.homepage,\n pluginId: descriptor.id\n };\n });\n}\nfunction getInspectorInfo(id) {\n const inspector = getInspector(id, activeAppRecord.value.app);\n if (!inspector)\n return;\n const descriptor = inspector.descriptor;\n const options = inspector.options;\n const timelineLayers = devtoolsTimelineLayers.filter((layer) => layer.descriptorId === descriptor.id).map((item) => ({\n id: item.id,\n label: item.label,\n color: item.color\n }));\n return {\n id: options.id,\n label: options.label,\n logo: descriptor.logo,\n packageName: descriptor.packageName,\n homepage: descriptor.homepage,\n timelineLayers,\n treeFilterPlaceholder: inspector.treeFilterPlaceholder,\n stateFilterPlaceholder: inspector.stateFilterPlaceholder\n };\n}\nfunction getInspector(id, app) {\n return devtoolsInspector.find((inspector) => inspector.options.id === id && (app ? inspector.descriptor.app === app : true));\n}\nfunction getInspectorActions(id) {\n const inspector = getInspector(id);\n return inspector == null ? void 0 : inspector.options.actions;\n}\nfunction getInspectorNodeActions(id) {\n const inspector = getInspector(id);\n return inspector == null ? void 0 : inspector.options.nodeActions;\n}\n\n// src/ctx/hook.ts\nvar DevToolsV6PluginAPIHookKeys = /* @__PURE__ */ ((DevToolsV6PluginAPIHookKeys2) => {\n DevToolsV6PluginAPIHookKeys2[\"VISIT_COMPONENT_TREE\"] = \"visitComponentTree\";\n DevToolsV6PluginAPIHookKeys2[\"INSPECT_COMPONENT\"] = \"inspectComponent\";\n DevToolsV6PluginAPIHookKeys2[\"EDIT_COMPONENT_STATE\"] = \"editComponentState\";\n DevToolsV6PluginAPIHookKeys2[\"GET_INSPECTOR_TREE\"] = \"getInspectorTree\";\n DevToolsV6PluginAPIHookKeys2[\"GET_INSPECTOR_STATE\"] = \"getInspectorState\";\n DevToolsV6PluginAPIHookKeys2[\"EDIT_INSPECTOR_STATE\"] = \"editInspectorState\";\n DevToolsV6PluginAPIHookKeys2[\"INSPECT_TIMELINE_EVENT\"] = \"inspectTimelineEvent\";\n DevToolsV6PluginAPIHookKeys2[\"TIMELINE_CLEARED\"] = \"timelineCleared\";\n DevToolsV6PluginAPIHookKeys2[\"SET_PLUGIN_SETTINGS\"] = \"setPluginSettings\";\n return DevToolsV6PluginAPIHookKeys2;\n})(DevToolsV6PluginAPIHookKeys || {});\nvar DevToolsContextHookKeys = /* @__PURE__ */ ((DevToolsContextHookKeys2) => {\n DevToolsContextHookKeys2[\"ADD_INSPECTOR\"] = \"addInspector\";\n DevToolsContextHookKeys2[\"SEND_INSPECTOR_TREE\"] = \"sendInspectorTree\";\n DevToolsContextHookKeys2[\"SEND_INSPECTOR_STATE\"] = \"sendInspectorState\";\n DevToolsContextHookKeys2[\"CUSTOM_INSPECTOR_SELECT_NODE\"] = \"customInspectorSelectNode\";\n DevToolsContextHookKeys2[\"TIMELINE_LAYER_ADDED\"] = \"timelineLayerAdded\";\n DevToolsContextHookKeys2[\"TIMELINE_EVENT_ADDED\"] = \"timelineEventAdded\";\n DevToolsContextHookKeys2[\"GET_COMPONENT_INSTANCES\"] = \"getComponentInstances\";\n DevToolsContextHookKeys2[\"GET_COMPONENT_BOUNDS\"] = \"getComponentBounds\";\n DevToolsContextHookKeys2[\"GET_COMPONENT_NAME\"] = \"getComponentName\";\n DevToolsContextHookKeys2[\"COMPONENT_HIGHLIGHT\"] = \"componentHighlight\";\n DevToolsContextHookKeys2[\"COMPONENT_UNHIGHLIGHT\"] = \"componentUnhighlight\";\n return DevToolsContextHookKeys2;\n})(DevToolsContextHookKeys || {});\nvar DevToolsMessagingHookKeys = /* @__PURE__ */ ((DevToolsMessagingHookKeys2) => {\n DevToolsMessagingHookKeys2[\"SEND_INSPECTOR_TREE_TO_CLIENT\"] = \"sendInspectorTreeToClient\";\n DevToolsMessagingHookKeys2[\"SEND_INSPECTOR_STATE_TO_CLIENT\"] = \"sendInspectorStateToClient\";\n DevToolsMessagingHookKeys2[\"SEND_TIMELINE_EVENT_TO_CLIENT\"] = \"sendTimelineEventToClient\";\n DevToolsMessagingHookKeys2[\"SEND_INSPECTOR_TO_CLIENT\"] = \"sendInspectorToClient\";\n DevToolsMessagingHookKeys2[\"SEND_ACTIVE_APP_UNMOUNTED_TO_CLIENT\"] = \"sendActiveAppUpdatedToClient\";\n DevToolsMessagingHookKeys2[\"DEVTOOLS_STATE_UPDATED\"] = \"devtoolsStateUpdated\";\n DevToolsMessagingHookKeys2[\"DEVTOOLS_CONNECTED_UPDATED\"] = \"devtoolsConnectedUpdated\";\n DevToolsMessagingHookKeys2[\"ROUTER_INFO_UPDATED\"] = \"routerInfoUpdated\";\n return DevToolsMessagingHookKeys2;\n})(DevToolsMessagingHookKeys || {});\nfunction createDevToolsCtxHooks() {\n const hooks2 = createHooks();\n hooks2.hook(\"addInspector\" /* ADD_INSPECTOR */, ({ inspector, plugin }) => {\n addInspector(inspector, plugin.descriptor);\n });\n const debounceSendInspectorTree = debounce2(async ({ inspectorId, plugin }) => {\n var _a25;\n if (!inspectorId || !((_a25 = plugin == null ? void 0 : plugin.descriptor) == null ? void 0 : _a25.app) || devtoolsState.highPerfModeEnabled)\n return;\n const inspector = getInspector(inspectorId, plugin.descriptor.app);\n const _payload = {\n app: plugin.descriptor.app,\n inspectorId,\n filter: (inspector == null ? void 0 : inspector.treeFilter) || \"\",\n rootNodes: []\n };\n await new Promise((resolve) => {\n hooks2.callHookWith(async (callbacks) => {\n await Promise.all(callbacks.map((cb) => cb(_payload)));\n resolve();\n }, \"getInspectorTree\" /* GET_INSPECTOR_TREE */);\n });\n hooks2.callHookWith(async (callbacks) => {\n await Promise.all(callbacks.map((cb) => cb({\n inspectorId,\n rootNodes: _payload.rootNodes\n })));\n }, \"sendInspectorTreeToClient\" /* SEND_INSPECTOR_TREE_TO_CLIENT */);\n }, 120);\n hooks2.hook(\"sendInspectorTree\" /* SEND_INSPECTOR_TREE */, debounceSendInspectorTree);\n const debounceSendInspectorState = debounce2(async ({ inspectorId, plugin }) => {\n var _a25;\n if (!inspectorId || !((_a25 = plugin == null ? void 0 : plugin.descriptor) == null ? void 0 : _a25.app) || devtoolsState.highPerfModeEnabled)\n return;\n const inspector = getInspector(inspectorId, plugin.descriptor.app);\n const _payload = {\n app: plugin.descriptor.app,\n inspectorId,\n nodeId: (inspector == null ? void 0 : inspector.selectedNodeId) || \"\",\n state: null\n };\n const ctx = {\n currentTab: `custom-inspector:${inspectorId}`\n };\n if (_payload.nodeId) {\n await new Promise((resolve) => {\n hooks2.callHookWith(async (callbacks) => {\n await Promise.all(callbacks.map((cb) => cb(_payload, ctx)));\n resolve();\n }, \"getInspectorState\" /* GET_INSPECTOR_STATE */);\n });\n }\n hooks2.callHookWith(async (callbacks) => {\n await Promise.all(callbacks.map((cb) => cb({\n inspectorId,\n nodeId: _payload.nodeId,\n state: _payload.state\n })));\n }, \"sendInspectorStateToClient\" /* SEND_INSPECTOR_STATE_TO_CLIENT */);\n }, 120);\n hooks2.hook(\"sendInspectorState\" /* SEND_INSPECTOR_STATE */, debounceSendInspectorState);\n hooks2.hook(\"customInspectorSelectNode\" /* CUSTOM_INSPECTOR_SELECT_NODE */, ({ inspectorId, nodeId, plugin }) => {\n const inspector = getInspector(inspectorId, plugin.descriptor.app);\n if (!inspector)\n return;\n inspector.selectedNodeId = nodeId;\n });\n hooks2.hook(\"timelineLayerAdded\" /* TIMELINE_LAYER_ADDED */, ({ options, plugin }) => {\n addTimelineLayer(options, plugin.descriptor);\n });\n hooks2.hook(\"timelineEventAdded\" /* TIMELINE_EVENT_ADDED */, ({ options, plugin }) => {\n var _a25;\n const internalLayerIds = [\"performance\", \"component-event\", \"keyboard\", \"mouse\"];\n if (devtoolsState.highPerfModeEnabled || !((_a25 = devtoolsState.timelineLayersState) == null ? void 0 : _a25[plugin.descriptor.id]) && !internalLayerIds.includes(options.layerId))\n return;\n hooks2.callHookWith(async (callbacks) => {\n await Promise.all(callbacks.map((cb) => cb(options)));\n }, \"sendTimelineEventToClient\" /* SEND_TIMELINE_EVENT_TO_CLIENT */);\n });\n hooks2.hook(\"getComponentInstances\" /* GET_COMPONENT_INSTANCES */, async ({ app }) => {\n const appRecord = app.__VUE_DEVTOOLS_NEXT_APP_RECORD__;\n if (!appRecord)\n return null;\n const appId = appRecord.id.toString();\n const instances = [...appRecord.instanceMap].filter(([key]) => key.split(\":\")[0] === appId).map(([, instance]) => instance);\n return instances;\n });\n hooks2.hook(\"getComponentBounds\" /* GET_COMPONENT_BOUNDS */, async ({ instance }) => {\n const bounds = getComponentBoundingRect(instance);\n return bounds;\n });\n hooks2.hook(\"getComponentName\" /* GET_COMPONENT_NAME */, ({ instance }) => {\n const name = getInstanceName(instance);\n return name;\n });\n hooks2.hook(\"componentHighlight\" /* COMPONENT_HIGHLIGHT */, ({ uid }) => {\n const instance = activeAppRecord.value.instanceMap.get(uid);\n if (instance) {\n highlight(instance);\n }\n });\n hooks2.hook(\"componentUnhighlight\" /* COMPONENT_UNHIGHLIGHT */, () => {\n unhighlight();\n });\n return hooks2;\n}\n\n// src/ctx/state.ts\nvar _a4, _b4;\n(_b4 = (_a4 = global).__VUE_DEVTOOLS_KIT_APP_RECORDS__) != null ? _b4 : _a4.__VUE_DEVTOOLS_KIT_APP_RECORDS__ = [];\nvar _a5, _b5;\n(_b5 = (_a5 = global).__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD__) != null ? _b5 : _a5.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD__ = {};\nvar _a6, _b6;\n(_b6 = (_a6 = global).__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD_ID__) != null ? _b6 : _a6.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD_ID__ = \"\";\nvar _a7, _b7;\n(_b7 = (_a7 = global).__VUE_DEVTOOLS_KIT_CUSTOM_TABS__) != null ? _b7 : _a7.__VUE_DEVTOOLS_KIT_CUSTOM_TABS__ = [];\nvar _a8, _b8;\n(_b8 = (_a8 = global).__VUE_DEVTOOLS_KIT_CUSTOM_COMMANDS__) != null ? _b8 : _a8.__VUE_DEVTOOLS_KIT_CUSTOM_COMMANDS__ = [];\nvar STATE_KEY = \"__VUE_DEVTOOLS_KIT_GLOBAL_STATE__\";\nfunction initStateFactory() {\n return {\n connected: false,\n clientConnected: false,\n vitePluginDetected: true,\n appRecords: [],\n activeAppRecordId: \"\",\n tabs: [],\n commands: [],\n highPerfModeEnabled: true,\n devtoolsClientDetected: {},\n perfUniqueGroupId: 0,\n timelineLayersState: getTimelineLayersStateFromStorage()\n };\n}\nvar _a9, _b9;\n(_b9 = (_a9 = global)[STATE_KEY]) != null ? _b9 : _a9[STATE_KEY] = initStateFactory();\nvar callStateUpdatedHook = debounce3((state) => {\n devtoolsContext.hooks.callHook(\"devtoolsStateUpdated\" /* DEVTOOLS_STATE_UPDATED */, { state });\n});\nvar callConnectedUpdatedHook = debounce3((state, oldState) => {\n devtoolsContext.hooks.callHook(\"devtoolsConnectedUpdated\" /* DEVTOOLS_CONNECTED_UPDATED */, { state, oldState });\n});\nvar devtoolsAppRecords = new Proxy(global.__VUE_DEVTOOLS_KIT_APP_RECORDS__, {\n get(_target, prop, receiver) {\n if (prop === \"value\")\n return global.__VUE_DEVTOOLS_KIT_APP_RECORDS__;\n return global.__VUE_DEVTOOLS_KIT_APP_RECORDS__[prop];\n }\n});\nvar addDevToolsAppRecord = (app) => {\n global.__VUE_DEVTOOLS_KIT_APP_RECORDS__ = [\n ...global.__VUE_DEVTOOLS_KIT_APP_RECORDS__,\n app\n ];\n};\nvar removeDevToolsAppRecord = (app) => {\n global.__VUE_DEVTOOLS_KIT_APP_RECORDS__ = devtoolsAppRecords.value.filter((record) => record.app !== app);\n};\nvar activeAppRecord = new Proxy(global.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD__, {\n get(_target, prop, receiver) {\n if (prop === \"value\")\n return global.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD__;\n else if (prop === \"id\")\n return global.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD_ID__;\n return global.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD__[prop];\n }\n});\nfunction updateAllStates() {\n callStateUpdatedHook({\n ...global[STATE_KEY],\n appRecords: devtoolsAppRecords.value,\n activeAppRecordId: activeAppRecord.id,\n tabs: global.__VUE_DEVTOOLS_KIT_CUSTOM_TABS__,\n commands: global.__VUE_DEVTOOLS_KIT_CUSTOM_COMMANDS__\n });\n}\nfunction setActiveAppRecord(app) {\n global.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD__ = app;\n updateAllStates();\n}\nfunction setActiveAppRecordId(id) {\n global.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD_ID__ = id;\n updateAllStates();\n}\nvar devtoolsState = new Proxy(global[STATE_KEY], {\n get(target22, property) {\n if (property === \"appRecords\") {\n return devtoolsAppRecords;\n } else if (property === \"activeAppRecordId\") {\n return activeAppRecord.id;\n } else if (property === \"tabs\") {\n return global.__VUE_DEVTOOLS_KIT_CUSTOM_TABS__;\n } else if (property === \"commands\") {\n return global.__VUE_DEVTOOLS_KIT_CUSTOM_COMMANDS__;\n }\n return global[STATE_KEY][property];\n },\n deleteProperty(target22, property) {\n delete target22[property];\n return true;\n },\n set(target22, property, value) {\n const oldState = { ...global[STATE_KEY] };\n target22[property] = value;\n global[STATE_KEY][property] = value;\n return true;\n }\n});\nfunction resetDevToolsState() {\n Object.assign(global[STATE_KEY], initStateFactory());\n}\nfunction updateDevToolsState(state) {\n const oldState = {\n ...global[STATE_KEY],\n appRecords: devtoolsAppRecords.value,\n activeAppRecordId: activeAppRecord.id\n };\n if (oldState.connected !== state.connected && state.connected || oldState.clientConnected !== state.clientConnected && state.clientConnected) {\n callConnectedUpdatedHook(global[STATE_KEY], oldState);\n }\n Object.assign(global[STATE_KEY], state);\n updateAllStates();\n}\nfunction onDevToolsConnected(fn) {\n return new Promise((resolve) => {\n if (devtoolsState.connected) {\n fn();\n resolve();\n }\n devtoolsContext.hooks.hook(\"devtoolsConnectedUpdated\" /* DEVTOOLS_CONNECTED_UPDATED */, ({ state }) => {\n if (state.connected) {\n fn();\n resolve();\n }\n });\n });\n}\nvar resolveIcon = (icon) => {\n if (!icon)\n return;\n if (icon.startsWith(\"baseline-\")) {\n return `custom-ic-${icon}`;\n }\n if (icon.startsWith(\"i-\") || isUrlString(icon))\n return icon;\n return `custom-ic-baseline-${icon}`;\n};\nfunction addCustomTab(tab) {\n const tabs = global.__VUE_DEVTOOLS_KIT_CUSTOM_TABS__;\n if (tabs.some((t) => t.name === tab.name))\n return;\n tabs.push({\n ...tab,\n icon: resolveIcon(tab.icon)\n });\n updateAllStates();\n}\nfunction addCustomCommand(action) {\n const commands = global.__VUE_DEVTOOLS_KIT_CUSTOM_COMMANDS__;\n if (commands.some((t) => t.id === action.id))\n return;\n commands.push({\n ...action,\n icon: resolveIcon(action.icon),\n children: action.children ? action.children.map((child) => ({\n ...child,\n icon: resolveIcon(child.icon)\n })) : void 0\n });\n updateAllStates();\n}\nfunction removeCustomCommand(actionId) {\n const commands = global.__VUE_DEVTOOLS_KIT_CUSTOM_COMMANDS__;\n const index = commands.findIndex((t) => t.id === actionId);\n if (index === -1)\n return;\n commands.splice(index, 1);\n updateAllStates();\n}\nfunction toggleClientConnected(state) {\n updateDevToolsState({ clientConnected: state });\n}\n\n// src/core/open-in-editor/index.ts\nfunction setOpenInEditorBaseUrl(url) {\n target5.__VUE_DEVTOOLS_OPEN_IN_EDITOR_BASE_URL__ = url;\n}\nfunction openInEditor(options = {}) {\n var _a25, _b25, _c;\n const { file, host, baseUrl = window.location.origin, line = 0, column = 0 } = options;\n if (file) {\n if (host === \"chrome-extension\") {\n const fileName = file.replace(/\\\\/g, \"\\\\\\\\\");\n const _baseUrl = (_b25 = (_a25 = window.VUE_DEVTOOLS_CONFIG) == null ? void 0 : _a25.openInEditorHost) != null ? _b25 : \"/\";\n fetch(`${_baseUrl}__open-in-editor?file=${encodeURI(file)}`).then((response) => {\n if (!response.ok) {\n const msg = `Opening component ${fileName} failed`;\n console.log(`%c${msg}`, \"color:red\");\n }\n });\n } else if (devtoolsState.vitePluginDetected) {\n const _baseUrl = (_c = target5.__VUE_DEVTOOLS_OPEN_IN_EDITOR_BASE_URL__) != null ? _c : baseUrl;\n target5.__VUE_INSPECTOR__.openInEditor(_baseUrl, file, line, column);\n }\n }\n}\n\n// src/core/plugin/index.ts\ninit_esm_shims();\nimport { target as target8 } from \"@vue/devtools-shared\";\n\n// src/api/index.ts\ninit_esm_shims();\n\n// src/api/v6/index.ts\ninit_esm_shims();\n\n// src/core/plugin/plugin-settings.ts\ninit_esm_shims();\n\n// src/ctx/plugin.ts\ninit_esm_shims();\nimport { target as target6 } from \"@vue/devtools-shared\";\nvar _a10, _b10;\n(_b10 = (_a10 = target6).__VUE_DEVTOOLS_KIT_PLUGIN_BUFFER__) != null ? _b10 : _a10.__VUE_DEVTOOLS_KIT_PLUGIN_BUFFER__ = [];\nvar devtoolsPluginBuffer = new Proxy(target6.__VUE_DEVTOOLS_KIT_PLUGIN_BUFFER__, {\n get(target22, prop, receiver) {\n return Reflect.get(target22, prop, receiver);\n }\n});\nfunction addDevToolsPluginToBuffer(pluginDescriptor, setupFn) {\n devtoolsPluginBuffer.push([pluginDescriptor, setupFn]);\n}\n\n// src/core/plugin/plugin-settings.ts\nfunction _getSettings(settings) {\n const _settings = {};\n Object.keys(settings).forEach((key) => {\n _settings[key] = settings[key].defaultValue;\n });\n return _settings;\n}\nfunction getPluginLocalKey(pluginId) {\n return `__VUE_DEVTOOLS_NEXT_PLUGIN_SETTINGS__${pluginId}__`;\n}\nfunction getPluginSettingsOptions(pluginId) {\n var _a25, _b25, _c;\n const item = (_b25 = (_a25 = devtoolsPluginBuffer.find((item2) => {\n var _a26;\n return item2[0].id === pluginId && !!((_a26 = item2[0]) == null ? void 0 : _a26.settings);\n })) == null ? void 0 : _a25[0]) != null ? _b25 : null;\n return (_c = item == null ? void 0 : item.settings) != null ? _c : null;\n}\nfunction getPluginSettings(pluginId, fallbackValue) {\n var _a25, _b25, _c;\n const localKey = getPluginLocalKey(pluginId);\n if (localKey) {\n const localSettings = localStorage.getItem(localKey);\n if (localSettings) {\n return JSON.parse(localSettings);\n }\n }\n if (pluginId) {\n const item = (_b25 = (_a25 = devtoolsPluginBuffer.find((item2) => item2[0].id === pluginId)) == null ? void 0 : _a25[0]) != null ? _b25 : null;\n return _getSettings((_c = item == null ? void 0 : item.settings) != null ? _c : {});\n }\n return _getSettings(fallbackValue);\n}\nfunction initPluginSettings(pluginId, settings) {\n const localKey = getPluginLocalKey(pluginId);\n const localSettings = localStorage.getItem(localKey);\n if (!localSettings) {\n localStorage.setItem(localKey, JSON.stringify(_getSettings(settings)));\n }\n}\nfunction setPluginSettings(pluginId, key, value) {\n const localKey = getPluginLocalKey(pluginId);\n const localSettings = localStorage.getItem(localKey);\n const parsedLocalSettings = JSON.parse(localSettings || \"{}\");\n const updated = {\n ...parsedLocalSettings,\n [key]: value\n };\n localStorage.setItem(localKey, JSON.stringify(updated));\n devtoolsContext.hooks.callHookWith((callbacks) => {\n callbacks.forEach((cb) => cb({\n pluginId,\n key,\n oldValue: parsedLocalSettings[key],\n newValue: value,\n settings: updated\n }));\n }, \"setPluginSettings\" /* SET_PLUGIN_SETTINGS */);\n}\n\n// src/hook/index.ts\ninit_esm_shims();\nimport { target as target7 } from \"@vue/devtools-shared\";\nimport { createHooks as createHooks2 } from \"hookable\";\n\n// src/types/index.ts\ninit_esm_shims();\n\n// src/types/app.ts\ninit_esm_shims();\n\n// src/types/command.ts\ninit_esm_shims();\n\n// src/types/component.ts\ninit_esm_shims();\n\n// src/types/hook.ts\ninit_esm_shims();\n\n// src/types/inspector.ts\ninit_esm_shims();\n\n// src/types/plugin.ts\ninit_esm_shims();\n\n// src/types/router.ts\ninit_esm_shims();\n\n// src/types/tab.ts\ninit_esm_shims();\n\n// src/types/timeline.ts\ninit_esm_shims();\n\n// src/hook/index.ts\nvar _a11, _b11;\nvar devtoolsHooks = (_b11 = (_a11 = target7).__VUE_DEVTOOLS_HOOK) != null ? _b11 : _a11.__VUE_DEVTOOLS_HOOK = createHooks2();\nvar on = {\n vueAppInit(fn) {\n devtoolsHooks.hook(\"app:init\" /* APP_INIT */, fn);\n },\n vueAppUnmount(fn) {\n devtoolsHooks.hook(\"app:unmount\" /* APP_UNMOUNT */, fn);\n },\n vueAppConnected(fn) {\n devtoolsHooks.hook(\"app:connected\" /* APP_CONNECTED */, fn);\n },\n componentAdded(fn) {\n return devtoolsHooks.hook(\"component:added\" /* COMPONENT_ADDED */, fn);\n },\n componentEmit(fn) {\n return devtoolsHooks.hook(\"component:emit\" /* COMPONENT_EMIT */, fn);\n },\n componentUpdated(fn) {\n return devtoolsHooks.hook(\"component:updated\" /* COMPONENT_UPDATED */, fn);\n },\n componentRemoved(fn) {\n return devtoolsHooks.hook(\"component:removed\" /* COMPONENT_REMOVED */, fn);\n },\n setupDevtoolsPlugin(fn) {\n devtoolsHooks.hook(\"devtools-plugin:setup\" /* SETUP_DEVTOOLS_PLUGIN */, fn);\n },\n perfStart(fn) {\n return devtoolsHooks.hook(\"perf:start\" /* PERFORMANCE_START */, fn);\n },\n perfEnd(fn) {\n return devtoolsHooks.hook(\"perf:end\" /* PERFORMANCE_END */, fn);\n }\n};\nfunction createDevToolsHook() {\n return {\n id: \"vue-devtools-next\",\n devtoolsVersion: \"7.0\",\n enabled: false,\n appRecords: [],\n apps: [],\n events: /* @__PURE__ */ new Map(),\n on(event, fn) {\n var _a25;\n if (!this.events.has(event))\n this.events.set(event, []);\n (_a25 = this.events.get(event)) == null ? void 0 : _a25.push(fn);\n return () => this.off(event, fn);\n },\n once(event, fn) {\n const onceFn = (...args) => {\n this.off(event, onceFn);\n fn(...args);\n };\n this.on(event, onceFn);\n return [event, onceFn];\n },\n off(event, fn) {\n if (this.events.has(event)) {\n const eventCallbacks = this.events.get(event);\n const index = eventCallbacks.indexOf(fn);\n if (index !== -1)\n eventCallbacks.splice(index, 1);\n }\n },\n emit(event, ...payload) {\n if (this.events.has(event))\n this.events.get(event).forEach((fn) => fn(...payload));\n }\n };\n}\nfunction subscribeDevToolsHook(hook2) {\n hook2.on(\"app:init\" /* APP_INIT */, (app, version, types) => {\n var _a25, _b25, _c;\n if ((_c = (_b25 = (_a25 = app == null ? void 0 : app._instance) == null ? void 0 : _a25.type) == null ? void 0 : _b25.devtools) == null ? void 0 : _c.hide)\n return;\n devtoolsHooks.callHook(\"app:init\" /* APP_INIT */, app, version, types);\n });\n hook2.on(\"app:unmount\" /* APP_UNMOUNT */, (app) => {\n devtoolsHooks.callHook(\"app:unmount\" /* APP_UNMOUNT */, app);\n });\n hook2.on(\"component:added\" /* COMPONENT_ADDED */, async (app, uid, parentUid, component) => {\n var _a25, _b25, _c;\n if (((_c = (_b25 = (_a25 = app == null ? void 0 : app._instance) == null ? void 0 : _a25.type) == null ? void 0 : _b25.devtools) == null ? void 0 : _c.hide) || devtoolsState.highPerfModeEnabled)\n return;\n if (!app || typeof uid !== \"number\" && !uid || !component)\n return;\n devtoolsHooks.callHook(\"component:added\" /* COMPONENT_ADDED */, app, uid, parentUid, component);\n });\n hook2.on(\"component:updated\" /* COMPONENT_UPDATED */, (app, uid, parentUid, component) => {\n if (!app || typeof uid !== \"number\" && !uid || !component || devtoolsState.highPerfModeEnabled)\n return;\n devtoolsHooks.callHook(\"component:updated\" /* COMPONENT_UPDATED */, app, uid, parentUid, component);\n });\n hook2.on(\"component:removed\" /* COMPONENT_REMOVED */, async (app, uid, parentUid, component) => {\n if (!app || typeof uid !== \"number\" && !uid || !component || devtoolsState.highPerfModeEnabled)\n return;\n devtoolsHooks.callHook(\"component:removed\" /* COMPONENT_REMOVED */, app, uid, parentUid, component);\n });\n hook2.on(\"component:emit\" /* COMPONENT_EMIT */, async (app, instance, event, params) => {\n if (!app || !instance || devtoolsState.highPerfModeEnabled)\n return;\n devtoolsHooks.callHook(\"component:emit\" /* COMPONENT_EMIT */, app, instance, event, params);\n });\n hook2.on(\"perf:start\" /* PERFORMANCE_START */, (app, uid, vm, type, time) => {\n if (!app || devtoolsState.highPerfModeEnabled)\n return;\n devtoolsHooks.callHook(\"perf:start\" /* PERFORMANCE_START */, app, uid, vm, type, time);\n });\n hook2.on(\"perf:end\" /* PERFORMANCE_END */, (app, uid, vm, type, time) => {\n if (!app || devtoolsState.highPerfModeEnabled)\n return;\n devtoolsHooks.callHook(\"perf:end\" /* PERFORMANCE_END */, app, uid, vm, type, time);\n });\n hook2.on(\"devtools-plugin:setup\" /* SETUP_DEVTOOLS_PLUGIN */, (pluginDescriptor, setupFn, options) => {\n if ((options == null ? void 0 : options.target) === \"legacy\")\n return;\n devtoolsHooks.callHook(\"devtools-plugin:setup\" /* SETUP_DEVTOOLS_PLUGIN */, pluginDescriptor, setupFn);\n });\n}\nvar hook = {\n on,\n setupDevToolsPlugin(pluginDescriptor, setupFn) {\n return devtoolsHooks.callHook(\"devtools-plugin:setup\" /* SETUP_DEVTOOLS_PLUGIN */, pluginDescriptor, setupFn);\n }\n};\n\n// src/api/v6/index.ts\nvar DevToolsV6PluginAPI = class {\n constructor({ plugin, ctx }) {\n this.hooks = ctx.hooks;\n this.plugin = plugin;\n }\n get on() {\n return {\n // component inspector\n visitComponentTree: (handler) => {\n this.hooks.hook(\"visitComponentTree\" /* VISIT_COMPONENT_TREE */, handler);\n },\n inspectComponent: (handler) => {\n this.hooks.hook(\"inspectComponent\" /* INSPECT_COMPONENT */, handler);\n },\n editComponentState: (handler) => {\n this.hooks.hook(\"editComponentState\" /* EDIT_COMPONENT_STATE */, handler);\n },\n // custom inspector\n getInspectorTree: (handler) => {\n this.hooks.hook(\"getInspectorTree\" /* GET_INSPECTOR_TREE */, handler);\n },\n getInspectorState: (handler) => {\n this.hooks.hook(\"getInspectorState\" /* GET_INSPECTOR_STATE */, handler);\n },\n editInspectorState: (handler) => {\n this.hooks.hook(\"editInspectorState\" /* EDIT_INSPECTOR_STATE */, handler);\n },\n // timeline\n inspectTimelineEvent: (handler) => {\n this.hooks.hook(\"inspectTimelineEvent\" /* INSPECT_TIMELINE_EVENT */, handler);\n },\n timelineCleared: (handler) => {\n this.hooks.hook(\"timelineCleared\" /* TIMELINE_CLEARED */, handler);\n },\n // settings\n setPluginSettings: (handler) => {\n this.hooks.hook(\"setPluginSettings\" /* SET_PLUGIN_SETTINGS */, handler);\n }\n };\n }\n // component inspector\n notifyComponentUpdate(instance) {\n var _a25;\n if (devtoolsState.highPerfModeEnabled) {\n return;\n }\n const inspector = getActiveInspectors().find((i) => i.packageName === this.plugin.descriptor.packageName);\n if (inspector == null ? void 0 : inspector.id) {\n if (instance) {\n const args = [\n instance.appContext.app,\n instance.uid,\n (_a25 = instance.parent) == null ? void 0 : _a25.uid,\n instance\n ];\n devtoolsHooks.callHook(\"component:updated\" /* COMPONENT_UPDATED */, ...args);\n } else {\n devtoolsHooks.callHook(\"component:updated\" /* COMPONENT_UPDATED */);\n }\n this.hooks.callHook(\"sendInspectorState\" /* SEND_INSPECTOR_STATE */, { inspectorId: inspector.id, plugin: this.plugin });\n }\n }\n // custom inspector\n addInspector(options) {\n this.hooks.callHook(\"addInspector\" /* ADD_INSPECTOR */, { inspector: options, plugin: this.plugin });\n if (this.plugin.descriptor.settings) {\n initPluginSettings(options.id, this.plugin.descriptor.settings);\n }\n }\n sendInspectorTree(inspectorId) {\n if (devtoolsState.highPerfModeEnabled) {\n return;\n }\n this.hooks.callHook(\"sendInspectorTree\" /* SEND_INSPECTOR_TREE */, { inspectorId, plugin: this.plugin });\n }\n sendInspectorState(inspectorId) {\n if (devtoolsState.highPerfModeEnabled) {\n return;\n }\n this.hooks.callHook(\"sendInspectorState\" /* SEND_INSPECTOR_STATE */, { inspectorId, plugin: this.plugin });\n }\n selectInspectorNode(inspectorId, nodeId) {\n this.hooks.callHook(\"customInspectorSelectNode\" /* CUSTOM_INSPECTOR_SELECT_NODE */, { inspectorId, nodeId, plugin: this.plugin });\n }\n visitComponentTree(payload) {\n return this.hooks.callHook(\"visitComponentTree\" /* VISIT_COMPONENT_TREE */, payload);\n }\n // timeline\n now() {\n if (devtoolsState.highPerfModeEnabled) {\n return 0;\n }\n return Date.now();\n }\n addTimelineLayer(options) {\n this.hooks.callHook(\"timelineLayerAdded\" /* TIMELINE_LAYER_ADDED */, { options, plugin: this.plugin });\n }\n addTimelineEvent(options) {\n if (devtoolsState.highPerfModeEnabled) {\n return;\n }\n this.hooks.callHook(\"timelineEventAdded\" /* TIMELINE_EVENT_ADDED */, { options, plugin: this.plugin });\n }\n // settings\n getSettings(pluginId) {\n return getPluginSettings(pluginId != null ? pluginId : this.plugin.descriptor.id, this.plugin.descriptor.settings);\n }\n // utilities\n getComponentInstances(app) {\n return this.hooks.callHook(\"getComponentInstances\" /* GET_COMPONENT_INSTANCES */, { app });\n }\n getComponentBounds(instance) {\n return this.hooks.callHook(\"getComponentBounds\" /* GET_COMPONENT_BOUNDS */, { instance });\n }\n getComponentName(instance) {\n return this.hooks.callHook(\"getComponentName\" /* GET_COMPONENT_NAME */, { instance });\n }\n highlightElement(instance) {\n const uid = instance.__VUE_DEVTOOLS_NEXT_UID__;\n return this.hooks.callHook(\"componentHighlight\" /* COMPONENT_HIGHLIGHT */, { uid });\n }\n unhighlightElement() {\n return this.hooks.callHook(\"componentUnhighlight\" /* COMPONENT_UNHIGHLIGHT */);\n }\n};\n\n// src/api/index.ts\nvar DevToolsPluginAPI = DevToolsV6PluginAPI;\n\n// src/core/plugin/components.ts\ninit_esm_shims();\nimport { debounce as debounce4 } from \"perfect-debounce\";\n\n// src/core/component/state/index.ts\ninit_esm_shims();\n\n// src/core/component/state/process.ts\ninit_esm_shims();\nimport { camelize } from \"@vue/devtools-shared\";\n\n// src/core/component/state/constants.ts\ninit_esm_shims();\nvar vueBuiltins = /* @__PURE__ */ new Set([\n \"nextTick\",\n \"defineComponent\",\n \"defineAsyncComponent\",\n \"defineCustomElement\",\n \"ref\",\n \"computed\",\n \"reactive\",\n \"readonly\",\n \"watchEffect\",\n \"watchPostEffect\",\n \"watchSyncEffect\",\n \"watch\",\n \"isRef\",\n \"unref\",\n \"toRef\",\n \"toRefs\",\n \"isProxy\",\n \"isReactive\",\n \"isReadonly\",\n \"shallowRef\",\n \"triggerRef\",\n \"customRef\",\n \"shallowReactive\",\n \"shallowReadonly\",\n \"toRaw\",\n \"markRaw\",\n \"effectScope\",\n \"getCurrentScope\",\n \"onScopeDispose\",\n \"onMounted\",\n \"onUpdated\",\n \"onUnmounted\",\n \"onBeforeMount\",\n \"onBeforeUpdate\",\n \"onBeforeUnmount\",\n \"onErrorCaptured\",\n \"onRenderTracked\",\n \"onRenderTriggered\",\n \"onActivated\",\n \"onDeactivated\",\n \"onServerPrefetch\",\n \"provide\",\n \"inject\",\n \"h\",\n \"mergeProps\",\n \"cloneVNode\",\n \"isVNode\",\n \"resolveComponent\",\n \"resolveDirective\",\n \"withDirectives\",\n \"withModifiers\"\n]);\nvar symbolRE = /^\\[native Symbol Symbol\\((.*)\\)\\]$/;\nvar rawTypeRE = /^\\[object (\\w+)\\]$/;\nvar specialTypeRE = /^\\[native (\\w+) (.*?)(<>(([\\s\\S])*))?\\]$/;\nvar fnTypeRE = /^(?:function|class) (\\w+)/;\nvar MAX_STRING_SIZE = 1e4;\nvar MAX_ARRAY_SIZE = 5e3;\nvar UNDEFINED = \"__vue_devtool_undefined__\";\nvar INFINITY = \"__vue_devtool_infinity__\";\nvar NEGATIVE_INFINITY = \"__vue_devtool_negative_infinity__\";\nvar NAN = \"__vue_devtool_nan__\";\nvar ESC = {\n \"<\": \"&lt;\",\n \">\": \"&gt;\",\n '\"': \"&quot;\",\n \"&\": \"&amp;\"\n};\n\n// src/core/component/state/util.ts\ninit_esm_shims();\n\n// src/core/component/state/is.ts\ninit_esm_shims();\nfunction isVueInstance(value) {\n if (!ensurePropertyExists(value, \"_\")) {\n return false;\n }\n if (!isPlainObject(value._)) {\n return false;\n }\n return Object.keys(value._).includes(\"vnode\");\n}\nfunction isPlainObject(obj) {\n return Object.prototype.toString.call(obj) === \"[object Object]\";\n}\nfunction isPrimitive(data) {\n if (data == null)\n return true;\n const type = typeof data;\n return type === \"string\" || type === \"number\" || type === \"boolean\";\n}\nfunction isRef2(raw) {\n return !!raw.__v_isRef;\n}\nfunction isComputed(raw) {\n return isRef2(raw) && !!raw.effect;\n}\nfunction isReactive2(raw) {\n return !!raw.__v_isReactive;\n}\nfunction isReadOnly(raw) {\n return !!raw.__v_isReadonly;\n}\n\n// src/core/component/state/util.ts\nvar tokenMap = {\n [UNDEFINED]: \"undefined\",\n [NAN]: \"NaN\",\n [INFINITY]: \"Infinity\",\n [NEGATIVE_INFINITY]: \"-Infinity\"\n};\nvar reversedTokenMap = Object.entries(tokenMap).reduce((acc, [key, value]) => {\n acc[value] = key;\n return acc;\n}, {});\nfunction internalStateTokenToString(value) {\n if (value === null)\n return \"null\";\n return typeof value === \"string\" && tokenMap[value] || false;\n}\nfunction replaceTokenToString(value) {\n const replaceRegex = new RegExp(`\"(${Object.keys(tokenMap).join(\"|\")})\"`, \"g\");\n return value.replace(replaceRegex, (_, g1) => tokenMap[g1]);\n}\nfunction replaceStringToToken(value) {\n const literalValue = reversedTokenMap[value.trim()];\n if (literalValue)\n return `\"${literalValue}\"`;\n const replaceRegex = new RegExp(`:\\\\s*(${Object.keys(reversedTokenMap).join(\"|\")})`, \"g\");\n return value.replace(replaceRegex, (_, g1) => `:\"${reversedTokenMap[g1]}\"`);\n}\nfunction getPropType(type) {\n if (Array.isArray(type))\n return type.map((t) => getPropType(t)).join(\" or \");\n if (type == null)\n return \"null\";\n const match = type.toString().match(fnTypeRE);\n return typeof type === \"function\" ? match && match[1] || \"any\" : \"any\";\n}\nfunction sanitize(data) {\n if (!isPrimitive(data) && !Array.isArray(data) && !isPlainObject(data)) {\n return Object.prototype.toString.call(data);\n } else {\n return data;\n }\n}\nfunction getSetupStateType(raw) {\n try {\n return {\n ref: isRef2(raw),\n computed: isComputed(raw),\n reactive: isReactive2(raw),\n readonly: isReadOnly(raw)\n };\n } catch (e) {\n return {\n ref: false,\n computed: false,\n reactive: false,\n readonly: false\n };\n }\n}\nfunction toRaw2(value) {\n if (value == null ? void 0 : value.__v_raw)\n return value.__v_raw;\n return value;\n}\nfunction escape(s) {\n return s.replace(/[<>\"&]/g, (s2) => {\n return ESC[s2] || s2;\n });\n}\n\n// src/core/component/state/process.ts\nfunction mergeOptions(to, from, instance) {\n if (typeof from === \"function\")\n from = from.options;\n if (!from)\n return to;\n const { mixins, extends: extendsOptions } = from;\n extendsOptions && mergeOptions(to, extendsOptions, instance);\n mixins && mixins.forEach(\n (m) => mergeOptions(to, m, instance)\n );\n for (const key of [\"computed\", \"inject\"]) {\n if (Object.prototype.hasOwnProperty.call(from, key)) {\n if (!to[key])\n to[key] = from[key];\n else\n Object.assign(to[key], from[key]);\n }\n }\n return to;\n}\nfunction resolveMergedOptions(instance) {\n const raw = instance == null ? void 0 : instance.type;\n if (!raw)\n return {};\n const { mixins, extends: extendsOptions } = raw;\n const globalMixins = instance.appContext.mixins;\n if (!globalMixins.length && !mixins && !extendsOptions)\n return raw;\n const options = {};\n globalMixins.forEach((m) => mergeOptions(options, m, instance));\n mergeOptions(options, raw, instance);\n return options;\n}\nfunction processProps(instance) {\n var _a25;\n const props = [];\n const propDefinitions = (_a25 = instance == null ? void 0 : instance.type) == null ? void 0 : _a25.props;\n for (const key in instance == null ? void 0 : instance.props) {\n const propDefinition = propDefinitions ? propDefinitions[key] : null;\n const camelizeKey = camelize(key);\n props.push({\n type: \"props\",\n key: camelizeKey,\n value: returnError(() => instance.props[key]),\n editable: true,\n meta: propDefinition ? {\n type: propDefinition.type ? getPropType(propDefinition.type) : \"any\",\n required: !!propDefinition.required,\n ...propDefinition.default ? {\n default: propDefinition.default.toString()\n } : {}\n } : { type: \"invalid\" }\n });\n }\n return props;\n}\nfunction processState(instance) {\n const type = instance.type;\n const props = type == null ? void 0 : type.props;\n const getters = type.vuex && type.vuex.getters;\n const computedDefs = type.computed;\n const data = {\n ...instance.data,\n ...instance.renderContext\n };\n return Object.keys(data).filter((key) => !(props && key in props) && !(getters && key in getters) && !(computedDefs && key in computedDefs)).map((key) => ({\n key,\n type: \"data\",\n value: returnError(() => data[key]),\n editable: true\n }));\n}\nfunction getStateTypeAndName(info) {\n const stateType = info.computed ? \"computed\" : info.ref ? \"ref\" : info.reactive ? \"reactive\" : null;\n const stateTypeName = stateType ? `${stateType.charAt(0).toUpperCase()}${stateType.slice(1)}` : null;\n return {\n stateType,\n stateTypeName\n };\n}\nfunction processSetupState(instance) {\n const raw = instance.devtoolsRawSetupState || {};\n return Object.keys(instance.setupState).filter((key) => !vueBuiltins.has(key) && key.split(/(?=[A-Z])/)[0] !== \"use\").map((key) => {\n var _a25, _b25, _c, _d;\n const value = returnError(() => toRaw2(instance.setupState[key]));\n const accessError = value instanceof Error;\n const rawData = raw[key];\n let result;\n let isOtherType = accessError || typeof value === \"function\" || ensurePropertyExists(value, \"render\") && typeof value.render === \"function\" || ensurePropertyExists(value, \"__asyncLoader\") && typeof value.__asyncLoader === \"function\" || typeof value === \"object\" && value && (\"setup\" in value || \"props\" in value) || /^v[A-Z]/.test(key);\n if (rawData && !accessError) {\n const info = getSetupStateType(rawData);\n const { stateType, stateTypeName } = getStateTypeAndName(info);\n const isState = info.ref || info.computed || info.reactive;\n const raw2 = ensurePropertyExists(rawData, \"effect\") ? ((_b25 = (_a25 = rawData.effect) == null ? void 0 : _a25.raw) == null ? void 0 : _b25.toString()) || ((_d = (_c = rawData.effect) == null ? void 0 : _c.fn) == null ? void 0 : _d.toString()) : null;\n if (stateType)\n isOtherType = false;\n result = {\n ...stateType ? { stateType, stateTypeName } : {},\n ...raw2 ? { raw: raw2 } : {},\n editable: isState && !info.readonly\n };\n }\n const type = isOtherType ? \"setup (other)\" : \"setup\";\n return {\n key,\n value,\n type,\n // @ts-expect-error ignore\n ...result\n };\n });\n}\nfunction processComputed(instance, mergedType) {\n const type = mergedType;\n const computed = [];\n const defs = type.computed || {};\n for (const key in defs) {\n const def = defs[key];\n const type2 = typeof def === \"function\" && def.vuex ? \"vuex bindings\" : \"computed\";\n computed.push({\n type: type2,\n key,\n value: returnError(() => {\n var _a25;\n return (_a25 = instance == null ? void 0 : instance.proxy) == null ? void 0 : _a25[key];\n }),\n editable: typeof def.set === \"function\"\n });\n }\n return computed;\n}\nfunction processAttrs(instance) {\n return Object.keys(instance.attrs).map((key) => ({\n type: \"attrs\",\n key,\n value: returnError(() => instance.attrs[key])\n }));\n}\nfunction processProvide(instance) {\n return Reflect.ownKeys(instance.provides).map((key) => ({\n type: \"provided\",\n key: key.toString(),\n value: returnError(() => instance.provides[key])\n }));\n}\nfunction processInject(instance, mergedType) {\n if (!(mergedType == null ? void 0 : mergedType.inject))\n return [];\n let keys = [];\n let defaultValue;\n if (Array.isArray(mergedType.inject)) {\n keys = mergedType.inject.map((key) => ({\n key,\n originalKey: key\n }));\n } else {\n keys = Reflect.ownKeys(mergedType.inject).map((key) => {\n const value = mergedType.inject[key];\n let originalKey;\n if (typeof value === \"string\" || typeof value === \"symbol\") {\n originalKey = value;\n } else {\n originalKey = value.from;\n defaultValue = value.default;\n }\n return {\n key,\n originalKey\n };\n });\n }\n return keys.map(({ key, originalKey }) => ({\n type: \"injected\",\n key: originalKey && key !== originalKey ? `${originalKey.toString()} \\u279E ${key.toString()}` : key.toString(),\n // eslint-disable-next-line no-prototype-builtins\n value: returnError(() => instance.ctx.hasOwnProperty(key) ? instance.ctx[key] : instance.provides.hasOwnProperty(originalKey) ? instance.provides[originalKey] : defaultValue)\n }));\n}\nfunction processRefs(instance) {\n return Object.keys(instance.refs).map((key) => ({\n type: \"template refs\",\n key,\n value: returnError(() => instance.refs[key])\n }));\n}\nfunction processEventListeners(instance) {\n var _a25, _b25;\n const emitsDefinition = instance.type.emits;\n const declaredEmits = Array.isArray(emitsDefinition) ? emitsDefinition : Object.keys(emitsDefinition != null ? emitsDefinition : {});\n const keys = Object.keys((_b25 = (_a25 = instance == null ? void 0 : instance.vnode) == null ? void 0 : _a25.props) != null ? _b25 : {});\n const result = [];\n for (const key of keys) {\n const [prefix, ...eventNameParts] = key.split(/(?=[A-Z])/);\n if (prefix === \"on\") {\n const eventName = eventNameParts.join(\"-\").toLowerCase();\n const isDeclared = declaredEmits.includes(eventName);\n result.push({\n type: \"event listeners\",\n key: eventName,\n value: {\n _custom: {\n displayText: isDeclared ? \"\\u2705 Declared\" : \"\\u26A0\\uFE0F Not declared\",\n key: isDeclared ? \"\\u2705 Declared\" : \"\\u26A0\\uFE0F Not declared\",\n value: isDeclared ? \"\\u2705 Declared\" : \"\\u26A0\\uFE0F Not declared\",\n tooltipText: !isDeclared ? `The event <code>${eventName}</code> is not declared in the <code>emits</code> option. It will leak into the component's attributes (<code>$attrs</code>).` : null\n }\n }\n });\n }\n }\n return result;\n}\nfunction processInstanceState(instance) {\n const mergedType = resolveMergedOptions(instance);\n return processProps(instance).concat(\n processState(instance),\n processSetupState(instance),\n processComputed(instance, mergedType),\n processAttrs(instance),\n processProvide(instance),\n processInject(instance, mergedType),\n processRefs(instance),\n processEventListeners(instance)\n );\n}\n\n// src/core/component/state/index.ts\nfunction getInstanceState(params) {\n var _a25;\n const instance = getComponentInstance(activeAppRecord.value, params.instanceId);\n const id = getUniqueComponentId(instance);\n const name = getInstanceName(instance);\n const file = (_a25 = instance == null ? void 0 : instance.type) == null ? void 0 : _a25.__file;\n const state = processInstanceState(instance);\n return {\n id,\n name,\n file,\n state,\n instance\n };\n}\n\n// src/core/component/tree/walker.ts\ninit_esm_shims();\n\n// src/core/component/tree/filter.ts\ninit_esm_shims();\nimport { classify as classify2, kebabize } from \"@vue/devtools-shared\";\nvar ComponentFilter = class {\n constructor(filter) {\n this.filter = filter || \"\";\n }\n /**\n * Check if an instance is qualified.\n *\n * @param {Vue|Vnode} instance\n * @return {boolean}\n */\n isQualified(instance) {\n const name = getInstanceName(instance);\n return classify2(name).toLowerCase().includes(this.filter) || kebabize(name).toLowerCase().includes(this.filter);\n }\n};\nfunction createComponentFilter(filterText) {\n return new ComponentFilter(filterText);\n}\n\n// src/core/component/tree/walker.ts\nvar ComponentWalker = class {\n constructor(options) {\n // Dedupe instances (Some instances may be both on a component and on a child abstract/functional component)\n this.captureIds = /* @__PURE__ */ new Map();\n const { filterText = \"\", maxDepth, recursively, api } = options;\n this.componentFilter = createComponentFilter(filterText);\n this.maxDepth = maxDepth;\n this.recursively = recursively;\n this.api = api;\n }\n getComponentTree(instance) {\n this.captureIds = /* @__PURE__ */ new Map();\n return this.findQualifiedChildren(instance, 0);\n }\n getComponentParents(instance) {\n this.captureIds = /* @__PURE__ */ new Map();\n const parents = [];\n this.captureId(instance);\n let parent = instance;\n while (parent = parent.parent) {\n this.captureId(parent);\n parents.push(parent);\n }\n return parents;\n }\n captureId(instance) {\n if (!instance)\n return null;\n const id = instance.__VUE_DEVTOOLS_NEXT_UID__ != null ? instance.__VUE_DEVTOOLS_NEXT_UID__ : getUniqueComponentId(instance);\n instance.__VUE_DEVTOOLS_NEXT_UID__ = id;\n if (this.captureIds.has(id))\n return null;\n else\n this.captureIds.set(id, void 0);\n this.mark(instance);\n return id;\n }\n /**\n * Capture the meta information of an instance. (recursive)\n *\n * @param {Vue} instance\n * @return {object}\n */\n async capture(instance, depth) {\n var _a25;\n if (!instance)\n return null;\n const id = this.captureId(instance);\n const name = getInstanceName(instance);\n const children = this.getInternalInstanceChildren(instance.subTree).filter((child) => !isBeingDestroyed(child));\n const parents = this.getComponentParents(instance) || [];\n const inactive = !!instance.isDeactivated || parents.some((parent) => parent.isDeactivated);\n const treeNode = {\n uid: instance.uid,\n id,\n name,\n renderKey: getRenderKey(instance.vnode ? instance.vnode.key : null),\n inactive,\n children: [],\n isFragment: isFragment(instance),\n tags: typeof instance.type !== \"function\" ? [] : [\n {\n label: \"functional\",\n textColor: 5592405,\n backgroundColor: 15658734\n }\n ],\n autoOpen: this.recursively,\n file: instance.type.__file || \"\"\n };\n if (depth < this.maxDepth || instance.type.__isKeepAlive || parents.some((parent) => parent.type.__isKeepAlive)) {\n treeNode.children = await Promise.all(children.map((child) => this.capture(child, depth + 1)).filter(Boolean));\n }\n if (this.isKeepAlive(instance)) {\n const cachedComponents = this.getKeepAliveCachedInstances(instance);\n const childrenIds = children.map((child) => child.__VUE_DEVTOOLS_NEXT_UID__);\n for (const cachedChild of cachedComponents) {\n if (!childrenIds.includes(cachedChild.__VUE_DEVTOOLS_NEXT_UID__)) {\n const node = await this.capture({ ...cachedChild, isDeactivated: true }, depth + 1);\n if (node)\n treeNode.children.push(node);\n }\n }\n }\n const rootElements = getRootElementsFromComponentInstance(instance);\n const firstElement = rootElements[0];\n if (firstElement == null ? void 0 : firstElement.parentElement) {\n const parentInstance = instance.parent;\n const parentRootElements = parentInstance ? getRootElementsFromComponentInstance(parentInstance) : [];\n let el = firstElement;\n const indexList = [];\n do {\n indexList.push(Array.from(el.parentElement.childNodes).indexOf(el));\n el = el.parentElement;\n } while (el.parentElement && parentRootElements.length && !parentRootElements.includes(el));\n treeNode.domOrder = indexList.reverse();\n } else {\n treeNode.domOrder = [-1];\n }\n if ((_a25 = instance.suspense) == null ? void 0 : _a25.suspenseKey) {\n treeNode.tags.push({\n label: instance.suspense.suspenseKey,\n backgroundColor: 14979812,\n textColor: 16777215\n });\n this.mark(instance, true);\n }\n this.api.visitComponentTree({\n treeNode,\n componentInstance: instance,\n app: instance.appContext.app,\n filter: this.componentFilter.filter\n });\n return treeNode;\n }\n /**\n * Find qualified children from a single instance.\n * If the instance itself is qualified, just return itself.\n * This is ok because [].concat works in both cases.\n *\n * @param {Vue|Vnode} instance\n * @return {Vue|Array}\n */\n async findQualifiedChildren(instance, depth) {\n var _a25;\n if (this.componentFilter.isQualified(instance) && !((_a25 = instance.type.devtools) == null ? void 0 : _a25.hide)) {\n return [await this.capture(instance, depth)];\n } else if (instance.subTree) {\n const list = this.isKeepAlive(instance) ? this.getKeepAliveCachedInstances(instance) : this.getInternalInstanceChildren(instance.subTree);\n return this.findQualifiedChildrenFromList(list, depth);\n } else {\n return [];\n }\n }\n /**\n * Iterate through an array of instances and flatten it into\n * an array of qualified instances. This is a depth-first\n * traversal - e.g. if an instance is not matched, we will\n * recursively go deeper until a qualified child is found.\n *\n * @param {Array} instances\n * @return {Array}\n */\n async findQualifiedChildrenFromList(instances, depth) {\n instances = instances.filter((child) => {\n var _a25;\n return !isBeingDestroyed(child) && !((_a25 = child.type.devtools) == null ? void 0 : _a25.hide);\n });\n if (!this.componentFilter.filter)\n return Promise.all(instances.map((child) => this.capture(child, depth)));\n else\n return Array.prototype.concat.apply([], await Promise.all(instances.map((i) => this.findQualifiedChildren(i, depth))));\n }\n /**\n * Get children from a component instance.\n */\n getInternalInstanceChildren(subTree, suspense = null) {\n const list = [];\n if (subTree) {\n if (subTree.component) {\n !suspense ? list.push(subTree.component) : list.push({ ...subTree.component, suspense });\n } else if (subTree.suspense) {\n const suspenseKey = !subTree.suspense.isInFallback ? \"suspense default\" : \"suspense fallback\";\n list.push(...this.getInternalInstanceChildren(subTree.suspense.activeBranch, { ...subTree.suspense, suspenseKey }));\n } else if (Array.isArray(subTree.children)) {\n subTree.children.forEach((childSubTree) => {\n if (childSubTree.component)\n !suspense ? list.push(childSubTree.component) : list.push({ ...childSubTree.component, suspense });\n else\n list.push(...this.getInternalInstanceChildren(childSubTree, suspense));\n });\n }\n }\n return list.filter((child) => {\n var _a25;\n return !isBeingDestroyed(child) && !((_a25 = child.type.devtools) == null ? void 0 : _a25.hide);\n });\n }\n /**\n * Mark an instance as captured and store it in the instance map.\n *\n * @param {Vue} instance\n */\n mark(instance, force = false) {\n const instanceMap = getAppRecord(instance).instanceMap;\n if (force || !instanceMap.has(instance.__VUE_DEVTOOLS_NEXT_UID__)) {\n instanceMap.set(instance.__VUE_DEVTOOLS_NEXT_UID__, instance);\n activeAppRecord.value.instanceMap = instanceMap;\n }\n }\n isKeepAlive(instance) {\n return instance.type.__isKeepAlive && instance.__v_cache;\n }\n getKeepAliveCachedInstances(instance) {\n return Array.from(instance.__v_cache.values()).map((vnode) => vnode.component).filter(Boolean);\n }\n};\n\n// src/core/timeline/index.ts\ninit_esm_shims();\nimport { isBrowser as isBrowser2 } from \"@vue/devtools-shared\";\n\n// src/core/timeline/perf.ts\ninit_esm_shims();\nvar markEndQueue = /* @__PURE__ */ new Map();\nvar PERFORMANCE_EVENT_LAYER_ID = \"performance\";\nasync function performanceMarkStart(api, app, uid, vm, type, time) {\n const appRecord = await getAppRecord(app);\n if (!appRecord) {\n return;\n }\n const componentName = getInstanceName(vm) || \"Unknown Component\";\n const groupId = devtoolsState.perfUniqueGroupId++;\n const groupKey = `${uid}-${type}`;\n appRecord.perfGroupIds.set(groupKey, { groupId, time });\n await api.addTimelineEvent({\n layerId: PERFORMANCE_EVENT_LAYER_ID,\n event: {\n time: Date.now(),\n data: {\n component: componentName,\n type,\n measure: \"start\"\n },\n title: componentName,\n subtitle: type,\n groupId\n }\n });\n if (markEndQueue.has(groupKey)) {\n const {\n app: app2,\n uid: uid2,\n instance,\n type: type2,\n time: time2\n } = markEndQueue.get(groupKey);\n markEndQueue.delete(groupKey);\n await performanceMarkEnd(\n api,\n app2,\n uid2,\n instance,\n type2,\n time2\n );\n }\n}\nfunction performanceMarkEnd(api, app, uid, vm, type, time) {\n const appRecord = getAppRecord(app);\n if (!appRecord)\n return;\n const componentName = getInstanceName(vm) || \"Unknown Component\";\n const groupKey = `${uid}-${type}`;\n const groupInfo = appRecord.perfGroupIds.get(groupKey);\n if (groupInfo) {\n const groupId = groupInfo.groupId;\n const startTime = groupInfo.time;\n const duration = time - startTime;\n api.addTimelineEvent({\n layerId: PERFORMANCE_EVENT_LAYER_ID,\n event: {\n time: Date.now(),\n data: {\n component: componentName,\n type,\n measure: \"end\",\n duration: {\n _custom: {\n type: \"Duration\",\n value: duration,\n display: `${duration} ms`\n }\n }\n },\n title: componentName,\n subtitle: type,\n groupId\n }\n });\n } else {\n markEndQueue.set(groupKey, { app, uid, instance: vm, type, time });\n }\n}\n\n// src/core/timeline/index.ts\nvar COMPONENT_EVENT_LAYER_ID = \"component-event\";\nfunction setupBuiltinTimelineLayers(api) {\n if (!isBrowser2)\n return;\n api.addTimelineLayer({\n id: \"mouse\",\n label: \"Mouse\",\n color: 10768815\n });\n [\"mousedown\", \"mouseup\", \"click\", \"dblclick\"].forEach((eventType) => {\n if (!devtoolsState.timelineLayersState.recordingState || !devtoolsState.timelineLayersState.mouseEventEnabled)\n return;\n window.addEventListener(eventType, async (event) => {\n await api.addTimelineEvent({\n layerId: \"mouse\",\n event: {\n time: Date.now(),\n data: {\n type: eventType,\n x: event.clientX,\n y: event.clientY\n },\n title: eventType\n }\n });\n }, {\n capture: true,\n passive: true\n });\n });\n api.addTimelineLayer({\n id: \"keyboard\",\n label: \"Keyboard\",\n color: 8475055\n });\n [\"keyup\", \"keydown\", \"keypress\"].forEach((eventType) => {\n window.addEventListener(eventType, async (event) => {\n if (!devtoolsState.timelineLayersState.recordingState || !devtoolsState.timelineLayersState.keyboardEventEnabled)\n return;\n await api.addTimelineEvent({\n layerId: \"keyboard\",\n event: {\n time: Date.now(),\n data: {\n type: eventType,\n key: event.key,\n ctrlKey: event.ctrlKey,\n shiftKey: event.shiftKey,\n altKey: event.altKey,\n metaKey: event.metaKey\n },\n title: event.key\n }\n });\n }, {\n capture: true,\n passive: true\n });\n });\n api.addTimelineLayer({\n id: COMPONENT_EVENT_LAYER_ID,\n label: \"Component events\",\n color: 5226637\n });\n hook.on.componentEmit(async (app, instance, event, params) => {\n if (!devtoolsState.timelineLayersState.recordingState || !devtoolsState.timelineLayersState.componentEventEnabled)\n return;\n const appRecord = await getAppRecord(app);\n if (!appRecord)\n return;\n const componentId = `${appRecord.id}:${instance.uid}`;\n const componentName = getInstanceName(instance) || \"Unknown Component\";\n api.addTimelineEvent({\n layerId: COMPONENT_EVENT_LAYER_ID,\n event: {\n time: Date.now(),\n data: {\n component: {\n _custom: {\n type: \"component-definition\",\n display: componentName\n }\n },\n event,\n params\n },\n title: event,\n subtitle: `by ${componentName}`,\n meta: {\n componentId\n }\n }\n });\n });\n api.addTimelineLayer({\n id: \"performance\",\n label: PERFORMANCE_EVENT_LAYER_ID,\n color: 4307050\n });\n hook.on.perfStart((app, uid, vm, type, time) => {\n if (!devtoolsState.timelineLayersState.recordingState || !devtoolsState.timelineLayersState.performanceEventEnabled)\n return;\n performanceMarkStart(api, app, uid, vm, type, time);\n });\n hook.on.perfEnd((app, uid, vm, type, time) => {\n if (!devtoolsState.timelineLayersState.recordingState || !devtoolsState.timelineLayersState.performanceEventEnabled)\n return;\n performanceMarkEnd(api, app, uid, vm, type, time);\n });\n}\n\n// src/core/vm/index.ts\ninit_esm_shims();\nvar MAX_$VM = 10;\nvar $vmQueue = [];\nfunction exposeInstanceToWindow(componentInstance) {\n if (typeof window === \"undefined\")\n return;\n const win = window;\n if (!componentInstance)\n return;\n win.$vm = componentInstance;\n if ($vmQueue[0] !== componentInstance) {\n if ($vmQueue.length >= MAX_$VM) {\n $vmQueue.pop();\n }\n for (let i = $vmQueue.length; i > 0; i--) {\n win[`$vm${i}`] = $vmQueue[i] = $vmQueue[i - 1];\n }\n win.$vm0 = $vmQueue[0] = componentInstance;\n }\n}\n\n// src/core/plugin/components.ts\nvar INSPECTOR_ID = \"components\";\nfunction createComponentsDevToolsPlugin(app) {\n const descriptor = {\n id: INSPECTOR_ID,\n label: \"Components\",\n app\n };\n const setupFn = (api) => {\n api.addInspector({\n id: INSPECTOR_ID,\n label: \"Components\",\n treeFilterPlaceholder: \"Search components\"\n });\n setupBuiltinTimelineLayers(api);\n api.on.getInspectorTree(async (payload) => {\n if (payload.app === app && payload.inspectorId === INSPECTOR_ID) {\n const instance = getComponentInstance(activeAppRecord.value, payload.instanceId);\n if (instance) {\n const walker2 = new ComponentWalker({\n filterText: payload.filter,\n // @TODO: should make this configurable?\n maxDepth: 100,\n recursively: false,\n api\n });\n payload.rootNodes = await walker2.getComponentTree(instance);\n }\n }\n });\n api.on.getInspectorState(async (payload) => {\n var _a25;\n if (payload.app === app && payload.inspectorId === INSPECTOR_ID) {\n const result = getInstanceState({\n instanceId: payload.nodeId\n });\n const componentInstance = result.instance;\n const app2 = (_a25 = result.instance) == null ? void 0 : _a25.appContext.app;\n const _payload = {\n componentInstance,\n app: app2,\n instanceData: result\n };\n devtoolsContext.hooks.callHookWith((callbacks) => {\n callbacks.forEach((cb) => cb(_payload));\n }, \"inspectComponent\" /* INSPECT_COMPONENT */);\n payload.state = result;\n exposeInstanceToWindow(componentInstance);\n }\n });\n api.on.editInspectorState(async (payload) => {\n if (payload.app === app && payload.inspectorId === INSPECTOR_ID) {\n editState(payload);\n await api.sendInspectorState(\"components\");\n }\n });\n const debounceSendInspectorTree = debounce4(() => {\n api.sendInspectorTree(INSPECTOR_ID);\n }, 120);\n const debounceSendInspectorState = debounce4(() => {\n api.sendInspectorState(INSPECTOR_ID);\n }, 120);\n const componentAddedCleanup = hook.on.componentAdded(async (app2, uid, parentUid, component) => {\n var _a25, _b25, _c;\n if (devtoolsState.highPerfModeEnabled)\n return;\n if ((_c = (_b25 = (_a25 = app2 == null ? void 0 : app2._instance) == null ? void 0 : _a25.type) == null ? void 0 : _b25.devtools) == null ? void 0 : _c.hide)\n return;\n if (!app2 || typeof uid !== \"number\" && !uid || !component)\n return;\n const id = await getComponentId({\n app: app2,\n uid,\n instance: component\n });\n const appRecord = await getAppRecord(app2);\n if (component) {\n if (component.__VUE_DEVTOOLS_NEXT_UID__ == null)\n component.__VUE_DEVTOOLS_NEXT_UID__ = id;\n if (!(appRecord == null ? void 0 : appRecord.instanceMap.has(id))) {\n appRecord == null ? void 0 : appRecord.instanceMap.set(id, component);\n if (activeAppRecord.value.id === (appRecord == null ? void 0 : appRecord.id))\n activeAppRecord.value.instanceMap = appRecord.instanceMap;\n }\n }\n if (!appRecord)\n return;\n debounceSendInspectorTree();\n });\n const componentUpdatedCleanup = hook.on.componentUpdated(async (app2, uid, parentUid, component) => {\n var _a25, _b25, _c;\n if (devtoolsState.highPerfModeEnabled)\n return;\n if ((_c = (_b25 = (_a25 = app2 == null ? void 0 : app2._instance) == null ? void 0 : _a25.type) == null ? void 0 : _b25.devtools) == null ? void 0 : _c.hide)\n return;\n if (!app2 || typeof uid !== \"number\" && !uid || !component)\n return;\n const id = await getComponentId({\n app: app2,\n uid,\n instance: component\n });\n const appRecord = await getAppRecord(app2);\n if (component) {\n if (component.__VUE_DEVTOOLS_NEXT_UID__ == null)\n component.__VUE_DEVTOOLS_NEXT_UID__ = id;\n if (!(appRecord == null ? void 0 : appRecord.instanceMap.has(id))) {\n appRecord == null ? void 0 : appRecord.instanceMap.set(id, component);\n if (activeAppRecord.value.id === (appRecord == null ? void 0 : appRecord.id))\n activeAppRecord.value.instanceMap = appRecord.instanceMap;\n }\n }\n if (!appRecord)\n return;\n debounceSendInspectorTree();\n debounceSendInspectorState();\n });\n const componentRemovedCleanup = hook.on.componentRemoved(async (app2, uid, parentUid, component) => {\n var _a25, _b25, _c;\n if (devtoolsState.highPerfModeEnabled)\n return;\n if ((_c = (_b25 = (_a25 = app2 == null ? void 0 : app2._instance) == null ? void 0 : _a25.type) == null ? void 0 : _b25.devtools) == null ? void 0 : _c.hide)\n return;\n if (!app2 || typeof uid !== \"number\" && !uid || !component)\n return;\n const appRecord = await getAppRecord(app2);\n if (!appRecord)\n return;\n const id = await getComponentId({\n app: app2,\n uid,\n instance: component\n });\n appRecord == null ? void 0 : appRecord.instanceMap.delete(id);\n if (activeAppRecord.value.id === (appRecord == null ? void 0 : appRecord.id))\n activeAppRecord.value.instanceMap = appRecord.instanceMap;\n debounceSendInspectorTree();\n });\n };\n return [descriptor, setupFn];\n}\n\n// src/core/plugin/index.ts\nvar _a12, _b12;\n(_b12 = (_a12 = target8).__VUE_DEVTOOLS_KIT__REGISTERED_PLUGIN_APPS__) != null ? _b12 : _a12.__VUE_DEVTOOLS_KIT__REGISTERED_PLUGIN_APPS__ = /* @__PURE__ */ new Set();\nfunction setupDevToolsPlugin(pluginDescriptor, setupFn) {\n return hook.setupDevToolsPlugin(pluginDescriptor, setupFn);\n}\nfunction callDevToolsPluginSetupFn(plugin, app) {\n const [pluginDescriptor, setupFn] = plugin;\n if (pluginDescriptor.app !== app)\n return;\n const api = new DevToolsPluginAPI({\n plugin: {\n setupFn,\n descriptor: pluginDescriptor\n },\n ctx: devtoolsContext\n });\n if (pluginDescriptor.packageName === \"vuex\") {\n api.on.editInspectorState((payload) => {\n api.sendInspectorState(payload.inspectorId);\n });\n }\n setupFn(api);\n}\nfunction removeRegisteredPluginApp(app) {\n target8.__VUE_DEVTOOLS_KIT__REGISTERED_PLUGIN_APPS__.delete(app);\n}\nfunction registerDevToolsPlugin(app, options) {\n if (target8.__VUE_DEVTOOLS_KIT__REGISTERED_PLUGIN_APPS__.has(app)) {\n return;\n }\n if (devtoolsState.highPerfModeEnabled && !(options == null ? void 0 : options.inspectingComponent)) {\n return;\n }\n target8.__VUE_DEVTOOLS_KIT__REGISTERED_PLUGIN_APPS__.add(app);\n devtoolsPluginBuffer.forEach((plugin) => {\n callDevToolsPluginSetupFn(plugin, app);\n });\n}\n\n// src/core/router/index.ts\ninit_esm_shims();\nimport { deepClone, target as global3 } from \"@vue/devtools-shared\";\nimport { debounce as debounce5 } from \"perfect-debounce\";\n\n// src/ctx/router.ts\ninit_esm_shims();\nimport { target as global2 } from \"@vue/devtools-shared\";\nvar ROUTER_KEY = \"__VUE_DEVTOOLS_ROUTER__\";\nvar ROUTER_INFO_KEY = \"__VUE_DEVTOOLS_ROUTER_INFO__\";\nvar _a13, _b13;\n(_b13 = (_a13 = global2)[ROUTER_INFO_KEY]) != null ? _b13 : _a13[ROUTER_INFO_KEY] = {\n currentRoute: null,\n routes: []\n};\nvar _a14, _b14;\n(_b14 = (_a14 = global2)[ROUTER_KEY]) != null ? _b14 : _a14[ROUTER_KEY] = {};\nvar devtoolsRouterInfo = new Proxy(global2[ROUTER_INFO_KEY], {\n get(target22, property) {\n return global2[ROUTER_INFO_KEY][property];\n }\n});\nvar devtoolsRouter = new Proxy(global2[ROUTER_KEY], {\n get(target22, property) {\n if (property === \"value\") {\n return global2[ROUTER_KEY];\n }\n }\n});\n\n// src/core/router/index.ts\nfunction getRoutes(router) {\n const routesMap = /* @__PURE__ */ new Map();\n return ((router == null ? void 0 : router.getRoutes()) || []).filter((i) => !routesMap.has(i.path) && routesMap.set(i.path, 1));\n}\nfunction filterRoutes(routes) {\n return routes.map((item) => {\n let { path, name, children, meta } = item;\n if (children == null ? void 0 : children.length)\n children = filterRoutes(children);\n return {\n path,\n name,\n children,\n meta\n };\n });\n}\nfunction filterCurrentRoute(route) {\n if (route) {\n const { fullPath, hash, href, path, name, matched, params, query } = route;\n return {\n fullPath,\n hash,\n href,\n path,\n name,\n params,\n query,\n matched: filterRoutes(matched)\n };\n }\n return route;\n}\nfunction normalizeRouterInfo(appRecord, activeAppRecord2) {\n function init() {\n var _a25;\n const router = (_a25 = appRecord.app) == null ? void 0 : _a25.config.globalProperties.$router;\n const currentRoute = filterCurrentRoute(router == null ? void 0 : router.currentRoute.value);\n const routes = filterRoutes(getRoutes(router));\n const c = console.warn;\n console.warn = () => {\n };\n global3[ROUTER_INFO_KEY] = {\n currentRoute: currentRoute ? deepClone(currentRoute) : {},\n routes: deepClone(routes)\n };\n global3[ROUTER_KEY] = router;\n console.warn = c;\n }\n init();\n hook.on.componentUpdated(debounce5(() => {\n var _a25;\n if (((_a25 = activeAppRecord2.value) == null ? void 0 : _a25.app) !== appRecord.app)\n return;\n init();\n if (devtoolsState.highPerfModeEnabled)\n return;\n devtoolsContext.hooks.callHook(\"routerInfoUpdated\" /* ROUTER_INFO_UPDATED */, { state: global3[ROUTER_INFO_KEY] });\n }, 200));\n}\n\n// src/ctx/api.ts\nfunction createDevToolsApi(hooks2) {\n return {\n // get inspector tree\n async getInspectorTree(payload) {\n const _payload = {\n ...payload,\n app: activeAppRecord.value.app,\n rootNodes: []\n };\n await new Promise((resolve) => {\n hooks2.callHookWith(async (callbacks) => {\n await Promise.all(callbacks.map((cb) => cb(_payload)));\n resolve();\n }, \"getInspectorTree\" /* GET_INSPECTOR_TREE */);\n });\n return _payload.rootNodes;\n },\n // get inspector state\n async getInspectorState(payload) {\n const _payload = {\n ...payload,\n app: activeAppRecord.value.app,\n state: null\n };\n const ctx = {\n currentTab: `custom-inspector:${payload.inspectorId}`\n };\n await new Promise((resolve) => {\n hooks2.callHookWith(async (callbacks) => {\n await Promise.all(callbacks.map((cb) => cb(_payload, ctx)));\n resolve();\n }, \"getInspectorState\" /* GET_INSPECTOR_STATE */);\n });\n return _payload.state;\n },\n // edit inspector state\n editInspectorState(payload) {\n const stateEditor2 = new StateEditor();\n const _payload = {\n ...payload,\n app: activeAppRecord.value.app,\n set: (obj, path = payload.path, value = payload.state.value, cb) => {\n stateEditor2.set(obj, path, value, cb || stateEditor2.createDefaultSetCallback(payload.state));\n }\n };\n hooks2.callHookWith((callbacks) => {\n callbacks.forEach((cb) => cb(_payload));\n }, \"editInspectorState\" /* EDIT_INSPECTOR_STATE */);\n },\n // send inspector state\n sendInspectorState(inspectorId) {\n const inspector = getInspector(inspectorId);\n hooks2.callHook(\"sendInspectorState\" /* SEND_INSPECTOR_STATE */, { inspectorId, plugin: {\n descriptor: inspector.descriptor,\n setupFn: () => ({})\n } });\n },\n // inspect component inspector\n inspectComponentInspector() {\n return inspectComponentHighLighter();\n },\n // cancel inspect component inspector\n cancelInspectComponentInspector() {\n return cancelInspectComponentHighLighter();\n },\n // get component render code\n getComponentRenderCode(id) {\n const instance = getComponentInstance(activeAppRecord.value, id);\n if (instance)\n return !(typeof (instance == null ? void 0 : instance.type) === \"function\") ? instance.render.toString() : instance.type.toString();\n },\n // scroll to component\n scrollToComponent(id) {\n return scrollToComponent({ id });\n },\n // open in editor\n openInEditor,\n // get vue inspector\n getVueInspector: getComponentInspector,\n // toggle app\n toggleApp(id, options) {\n const appRecord = devtoolsAppRecords.value.find((record) => record.id === id);\n if (appRecord) {\n setActiveAppRecordId(id);\n setActiveAppRecord(appRecord);\n normalizeRouterInfo(appRecord, activeAppRecord);\n callInspectorUpdatedHook();\n registerDevToolsPlugin(appRecord.app, options);\n }\n },\n // inspect dom\n inspectDOM(instanceId) {\n const instance = getComponentInstance(activeAppRecord.value, instanceId);\n if (instance) {\n const [el] = getRootElementsFromComponentInstance(instance);\n if (el) {\n target9.__VUE_DEVTOOLS_INSPECT_DOM_TARGET__ = el;\n }\n }\n },\n updatePluginSettings(pluginId, key, value) {\n setPluginSettings(pluginId, key, value);\n },\n getPluginSettings(pluginId) {\n return {\n options: getPluginSettingsOptions(pluginId),\n values: getPluginSettings(pluginId)\n };\n }\n };\n}\n\n// src/ctx/env.ts\ninit_esm_shims();\nimport { target as target10 } from \"@vue/devtools-shared\";\nvar _a15, _b15;\n(_b15 = (_a15 = target10).__VUE_DEVTOOLS_ENV__) != null ? _b15 : _a15.__VUE_DEVTOOLS_ENV__ = {\n vitePluginDetected: false\n};\nfunction getDevToolsEnv() {\n return target10.__VUE_DEVTOOLS_ENV__;\n}\nfunction setDevToolsEnv(env) {\n target10.__VUE_DEVTOOLS_ENV__ = {\n ...target10.__VUE_DEVTOOLS_ENV__,\n ...env\n };\n}\n\n// src/ctx/index.ts\nvar hooks = createDevToolsCtxHooks();\nvar _a16, _b16;\n(_b16 = (_a16 = target11).__VUE_DEVTOOLS_KIT_CONTEXT__) != null ? _b16 : _a16.__VUE_DEVTOOLS_KIT_CONTEXT__ = {\n hooks,\n get state() {\n return {\n ...devtoolsState,\n activeAppRecordId: activeAppRecord.id,\n activeAppRecord: activeAppRecord.value,\n appRecords: devtoolsAppRecords.value\n };\n },\n api: createDevToolsApi(hooks)\n};\nvar devtoolsContext = target11.__VUE_DEVTOOLS_KIT_CONTEXT__;\n\n// src/core/app/index.ts\ninit_esm_shims();\nvar import_speakingurl = __toESM(require_speakingurl2(), 1);\nimport { isBrowser as isBrowser3, target as target12 } from \"@vue/devtools-shared\";\nvar _a17, _b17;\nvar appRecordInfo = (_b17 = (_a17 = target12).__VUE_DEVTOOLS_NEXT_APP_RECORD_INFO__) != null ? _b17 : _a17.__VUE_DEVTOOLS_NEXT_APP_RECORD_INFO__ = {\n id: 0,\n appIds: /* @__PURE__ */ new Set()\n};\nfunction getAppRecordName(app, fallbackName) {\n var _a25;\n return ((_a25 = app == null ? void 0 : app._component) == null ? void 0 : _a25.name) || `App ${fallbackName}`;\n}\nfunction getAppRootInstance(app) {\n var _a25, _b25, _c, _d;\n if (app._instance)\n return app._instance;\n else if ((_b25 = (_a25 = app._container) == null ? void 0 : _a25._vnode) == null ? void 0 : _b25.component)\n return (_d = (_c = app._container) == null ? void 0 : _c._vnode) == null ? void 0 : _d.component;\n}\nfunction removeAppRecordId(app) {\n const id = app.__VUE_DEVTOOLS_NEXT_APP_RECORD_ID__;\n if (id != null) {\n appRecordInfo.appIds.delete(id);\n appRecordInfo.id--;\n }\n}\nfunction getAppRecordId(app, defaultId) {\n if (app.__VUE_DEVTOOLS_NEXT_APP_RECORD_ID__ != null)\n return app.__VUE_DEVTOOLS_NEXT_APP_RECORD_ID__;\n let id = defaultId != null ? defaultId : (appRecordInfo.id++).toString();\n if (defaultId && appRecordInfo.appIds.has(id)) {\n let count = 1;\n while (appRecordInfo.appIds.has(`${defaultId}_${count}`))\n count++;\n id = `${defaultId}_${count}`;\n }\n appRecordInfo.appIds.add(id);\n app.__VUE_DEVTOOLS_NEXT_APP_RECORD_ID__ = id;\n return id;\n}\nfunction createAppRecord(app, types) {\n var _a25, _b25;\n const rootInstance = getAppRootInstance(app);\n if (rootInstance) {\n appRecordInfo.id++;\n const name = getAppRecordName(app, appRecordInfo.id.toString());\n const id = getAppRecordId(app, (0, import_speakingurl.default)(name));\n const [el] = getRootElementsFromComponentInstance(rootInstance);\n const record = {\n id,\n name,\n types,\n instanceMap: /* @__PURE__ */ new Map(),\n perfGroupIds: /* @__PURE__ */ new Map(),\n rootInstance,\n iframe: isBrowser3 && document !== (el == null ? void 0 : el.ownerDocument) ? (_b25 = (_a25 = el == null ? void 0 : el.ownerDocument) == null ? void 0 : _a25.location) == null ? void 0 : _b25.pathname : void 0\n };\n app.__VUE_DEVTOOLS_NEXT_APP_RECORD__ = record;\n const rootId = `${record.id}:root`;\n record.instanceMap.set(rootId, record.rootInstance);\n record.rootInstance.__VUE_DEVTOOLS_NEXT_UID__ = rootId;\n return record;\n } else {\n return {};\n }\n}\n\n// src/core/iframe/index.ts\ninit_esm_shims();\nfunction detectIframeApp(target22, inIframe = false) {\n if (inIframe) {\n let sendEventToParent2 = function(cb) {\n try {\n const hook3 = window.parent.__VUE_DEVTOOLS_GLOBAL_HOOK__;\n if (hook3) {\n cb(hook3);\n }\n } catch (e) {\n }\n };\n var sendEventToParent = sendEventToParent2;\n const hook2 = {\n id: \"vue-devtools-next\",\n devtoolsVersion: \"7.0\",\n on: (event, cb) => {\n sendEventToParent2((hook3) => {\n hook3.on(event, cb);\n });\n },\n once: (event, cb) => {\n sendEventToParent2((hook3) => {\n hook3.once(event, cb);\n });\n },\n off: (event, cb) => {\n sendEventToParent2((hook3) => {\n hook3.off(event, cb);\n });\n },\n emit: (event, ...payload) => {\n sendEventToParent2((hook3) => {\n hook3.emit(event, ...payload);\n });\n }\n };\n Object.defineProperty(target22, \"__VUE_DEVTOOLS_GLOBAL_HOOK__\", {\n get() {\n return hook2;\n },\n configurable: true\n });\n }\n function injectVueHookToIframe(iframe) {\n if (iframe.__vdevtools__injected) {\n return;\n }\n try {\n iframe.__vdevtools__injected = true;\n const inject = () => {\n try {\n iframe.contentWindow.__VUE_DEVTOOLS_IFRAME__ = iframe;\n const script = iframe.contentDocument.createElement(\"script\");\n script.textContent = `;(${detectIframeApp.toString()})(window, true)`;\n iframe.contentDocument.documentElement.appendChild(script);\n script.parentNode.removeChild(script);\n } catch (e) {\n }\n };\n inject();\n iframe.addEventListener(\"load\", () => inject());\n } catch (e) {\n }\n }\n function injectVueHookToIframes() {\n if (typeof window === \"undefined\") {\n return;\n }\n const iframes = Array.from(document.querySelectorAll(\"iframe:not([data-vue-devtools-ignore])\"));\n for (const iframe of iframes) {\n injectVueHookToIframe(iframe);\n }\n }\n injectVueHookToIframes();\n let iframeAppChecks = 0;\n const iframeAppCheckTimer = setInterval(() => {\n injectVueHookToIframes();\n iframeAppChecks++;\n if (iframeAppChecks >= 5) {\n clearInterval(iframeAppCheckTimer);\n }\n }, 1e3);\n}\n\n// src/core/index.ts\nfunction initDevTools() {\n var _a25;\n detectIframeApp(target13);\n updateDevToolsState({\n vitePluginDetected: getDevToolsEnv().vitePluginDetected\n });\n const isDevToolsNext = ((_a25 = target13.__VUE_DEVTOOLS_GLOBAL_HOOK__) == null ? void 0 : _a25.id) === \"vue-devtools-next\";\n if (target13.__VUE_DEVTOOLS_GLOBAL_HOOK__ && isDevToolsNext)\n return;\n const _devtoolsHook = createDevToolsHook();\n if (target13.__VUE_DEVTOOLS_HOOK_REPLAY__) {\n try {\n target13.__VUE_DEVTOOLS_HOOK_REPLAY__.forEach((cb) => cb(_devtoolsHook));\n target13.__VUE_DEVTOOLS_HOOK_REPLAY__ = [];\n } catch (e) {\n console.error(\"[vue-devtools] Error during hook replay\", e);\n }\n }\n _devtoolsHook.once(\"init\", (Vue) => {\n target13.__VUE_DEVTOOLS_VUE2_APP_DETECTED__ = true;\n console.log(\"%c[_____Vue DevTools v7 log_____]\", \"color: red; font-bold: 600; font-size: 16px;\");\n console.log(\"%cVue DevTools v7 detected in your Vue2 project. v7 only supports Vue3 and will not work.\", \"font-bold: 500; font-size: 14px;\");\n const legacyChromeUrl = \"https://chromewebstore.google.com/detail/vuejs-devtools/iaajmlceplecbljialhhkmedjlpdblhp\";\n const legacyFirefoxUrl = \"https://addons.mozilla.org/firefox/addon/vue-js-devtools-v6-legacy\";\n console.log(`%cThe legacy version of chrome extension that supports both Vue 2 and Vue 3 has been moved to %c ${legacyChromeUrl}`, \"font-size: 14px;\", \"text-decoration: underline; cursor: pointer;font-size: 14px;\");\n console.log(`%cThe legacy version of firefox extension that supports both Vue 2 and Vue 3 has been moved to %c ${legacyFirefoxUrl}`, \"font-size: 14px;\", \"text-decoration: underline; cursor: pointer;font-size: 14px;\");\n console.log(\"%cPlease install and enable only the legacy version for your Vue2 app.\", \"font-bold: 500; font-size: 14px;\");\n console.log(\"%c[_____Vue DevTools v7 log_____]\", \"color: red; font-bold: 600; font-size: 16px;\");\n });\n hook.on.setupDevtoolsPlugin((pluginDescriptor, setupFn) => {\n var _a26;\n addDevToolsPluginToBuffer(pluginDescriptor, setupFn);\n const { app } = (_a26 = activeAppRecord) != null ? _a26 : {};\n if (pluginDescriptor.settings) {\n initPluginSettings(pluginDescriptor.id, pluginDescriptor.settings);\n }\n if (!app)\n return;\n callDevToolsPluginSetupFn([pluginDescriptor, setupFn], app);\n });\n onLegacyDevToolsPluginApiAvailable(() => {\n const normalizedPluginBuffer = devtoolsPluginBuffer.filter(([item]) => item.id !== \"components\");\n normalizedPluginBuffer.forEach(([pluginDescriptor, setupFn]) => {\n _devtoolsHook.emit(\"devtools-plugin:setup\" /* SETUP_DEVTOOLS_PLUGIN */, pluginDescriptor, setupFn, { target: \"legacy\" });\n });\n });\n hook.on.vueAppInit(async (app, version, types) => {\n const appRecord = createAppRecord(app, types);\n const normalizedAppRecord = {\n ...appRecord,\n app,\n version\n };\n addDevToolsAppRecord(normalizedAppRecord);\n if (devtoolsAppRecords.value.length === 1) {\n setActiveAppRecord(normalizedAppRecord);\n setActiveAppRecordId(normalizedAppRecord.id);\n normalizeRouterInfo(normalizedAppRecord, activeAppRecord);\n registerDevToolsPlugin(normalizedAppRecord.app);\n }\n setupDevToolsPlugin(...createComponentsDevToolsPlugin(normalizedAppRecord.app));\n updateDevToolsState({\n connected: true\n });\n _devtoolsHook.apps.push(app);\n });\n hook.on.vueAppUnmount(async (app) => {\n const activeRecords = devtoolsAppRecords.value.filter((appRecord) => appRecord.app !== app);\n if (activeRecords.length === 0) {\n updateDevToolsState({\n connected: false\n });\n }\n removeDevToolsAppRecord(app);\n removeAppRecordId(app);\n if (activeAppRecord.value.app === app) {\n setActiveAppRecord(activeRecords[0]);\n devtoolsContext.hooks.callHook(\"sendActiveAppUpdatedToClient\" /* SEND_ACTIVE_APP_UNMOUNTED_TO_CLIENT */);\n }\n target13.__VUE_DEVTOOLS_GLOBAL_HOOK__.apps.splice(target13.__VUE_DEVTOOLS_GLOBAL_HOOK__.apps.indexOf(app), 1);\n removeRegisteredPluginApp(app);\n });\n subscribeDevToolsHook(_devtoolsHook);\n if (!target13.__VUE_DEVTOOLS_GLOBAL_HOOK__) {\n Object.defineProperty(target13, \"__VUE_DEVTOOLS_GLOBAL_HOOK__\", {\n get() {\n return _devtoolsHook;\n },\n configurable: true\n });\n } else {\n if (!isNuxtApp) {\n Object.assign(__VUE_DEVTOOLS_GLOBAL_HOOK__, _devtoolsHook);\n }\n }\n}\nfunction onDevToolsClientConnected(fn) {\n return new Promise((resolve) => {\n if (devtoolsState.connected && devtoolsState.clientConnected) {\n fn();\n resolve();\n return;\n }\n devtoolsContext.hooks.hook(\"devtoolsConnectedUpdated\" /* DEVTOOLS_CONNECTED_UPDATED */, ({ state }) => {\n if (state.connected && state.clientConnected) {\n fn();\n resolve();\n }\n });\n });\n}\n\n// src/core/high-perf-mode/index.ts\ninit_esm_shims();\nfunction toggleHighPerfMode(state) {\n devtoolsState.highPerfModeEnabled = state != null ? state : !devtoolsState.highPerfModeEnabled;\n if (!state && activeAppRecord.value) {\n registerDevToolsPlugin(activeAppRecord.value.app);\n }\n}\n\n// src/core/component/state/format.ts\ninit_esm_shims();\n\n// src/core/component/state/reviver.ts\ninit_esm_shims();\nimport { target as target14 } from \"@vue/devtools-shared\";\nfunction reviveSet(val) {\n const result = /* @__PURE__ */ new Set();\n const list = val._custom.value;\n for (let i = 0; i < list.length; i++) {\n const value = list[i];\n result.add(revive(value));\n }\n return result;\n}\nfunction reviveMap(val) {\n const result = /* @__PURE__ */ new Map();\n const list = val._custom.value;\n for (let i = 0; i < list.length; i++) {\n const { key, value } = list[i];\n result.set(key, revive(value));\n }\n return result;\n}\nfunction revive(val) {\n if (val === UNDEFINED) {\n return void 0;\n } else if (val === INFINITY) {\n return Number.POSITIVE_INFINITY;\n } else if (val === NEGATIVE_INFINITY) {\n return Number.NEGATIVE_INFINITY;\n } else if (val === NAN) {\n return Number.NaN;\n } else if (val && val._custom) {\n const { _custom: custom } = val;\n if (custom.type === \"component\")\n return activeAppRecord.value.instanceMap.get(custom.id);\n else if (custom.type === \"map\")\n return reviveMap(val);\n else if (custom.type === \"set\")\n return reviveSet(val);\n else if (custom.type === \"bigint\")\n return BigInt(custom.value);\n else\n return revive(custom.value);\n } else if (symbolRE.test(val)) {\n const [, string] = symbolRE.exec(val);\n return Symbol.for(string);\n } else if (specialTypeRE.test(val)) {\n const [, type, string, , details] = specialTypeRE.exec(val);\n const result = new target14[type](string);\n if (type === \"Error\" && details)\n result.stack = details;\n return result;\n } else {\n return val;\n }\n}\nfunction reviver(key, value) {\n return revive(value);\n}\n\n// src/core/component/state/format.ts\nfunction getInspectorStateValueType(value, raw = true) {\n const type = typeof value;\n if (value == null || value === UNDEFINED || value === \"undefined\") {\n return \"null\";\n } else if (type === \"boolean\" || type === \"number\" || value === INFINITY || value === NEGATIVE_INFINITY || value === NAN) {\n return \"literal\";\n } else if (value == null ? void 0 : value._custom) {\n if (raw || value._custom.display != null || value._custom.displayText != null)\n return \"custom\";\n else\n return getInspectorStateValueType(value._custom.value);\n } else if (typeof value === \"string\") {\n const typeMatch = specialTypeRE.exec(value);\n if (typeMatch) {\n const [, type2] = typeMatch;\n return `native ${type2}`;\n } else {\n return \"string\";\n }\n } else if (Array.isArray(value) || (value == null ? void 0 : value._isArray)) {\n return \"array\";\n } else if (isPlainObject(value)) {\n return \"plain-object\";\n } else {\n return \"unknown\";\n }\n}\nfunction formatInspectorStateValue(value, quotes = false, options) {\n var _a25, _b25, _c;\n const { customClass } = options != null ? options : {};\n let result;\n const type = getInspectorStateValueType(value, false);\n if (type !== \"custom\" && (value == null ? void 0 : value._custom))\n value = value._custom.value;\n if (result = internalStateTokenToString(value)) {\n return result;\n } else if (type === \"custom\") {\n const nestedName = ((_a25 = value._custom.value) == null ? void 0 : _a25._custom) && formatInspectorStateValue(value._custom.value, quotes, options);\n return nestedName || value._custom.displayText || value._custom.display;\n } else if (type === \"array\") {\n return `Array[${value.length}]`;\n } else if (type === \"plain-object\") {\n return `Object${Object.keys(value).length ? \"\" : \" (empty)\"}`;\n } else if (type == null ? void 0 : type.includes(\"native\")) {\n return escape((_b25 = specialTypeRE.exec(value)) == null ? void 0 : _b25[2]);\n } else if (typeof value === \"string\") {\n const typeMatch = value.match(rawTypeRE);\n if (typeMatch) {\n value = escapeString(typeMatch[1]);\n } else if (quotes) {\n value = `<span>\"</span>${(customClass == null ? void 0 : customClass.string) ? `<span class=${customClass.string}>${escapeString(value)}</span>` : escapeString(value)}<span>\"</span>`;\n } else {\n value = (customClass == null ? void 0 : customClass.string) ? `<span class=\"${(_c = customClass == null ? void 0 : customClass.string) != null ? _c : \"\"}\">${escapeString(value)}</span>` : escapeString(value);\n }\n }\n return value;\n}\nfunction escapeString(value) {\n return escape(value).replace(/ /g, \"&nbsp;\").replace(/\\n/g, \"<span>\\\\n</span>\");\n}\nfunction getRaw(value) {\n var _a25, _b25, _c;\n let customType;\n const isCustom = getInspectorStateValueType(value) === \"custom\";\n let inherit = {};\n if (isCustom) {\n const data = value;\n const customValue = (_a25 = data._custom) == null ? void 0 : _a25.value;\n const currentCustomType = (_b25 = data._custom) == null ? void 0 : _b25.type;\n const nestedCustom = typeof customValue === \"object\" && customValue !== null && \"_custom\" in customValue ? getRaw(customValue) : { inherit: void 0, value: void 0, customType: void 0 };\n inherit = nestedCustom.inherit || ((_c = data._custom) == null ? void 0 : _c.fields) || {};\n value = nestedCustom.value || customValue;\n customType = nestedCustom.customType || currentCustomType;\n }\n if (value && value._isArray)\n value = value.items;\n return { value, inherit, customType };\n}\nfunction toEdit(value, customType) {\n if (customType === \"bigint\")\n return value;\n if (customType === \"date\")\n return value;\n return replaceTokenToString(JSON.stringify(value));\n}\nfunction toSubmit(value, customType) {\n if (customType === \"bigint\")\n return BigInt(value);\n if (customType === \"date\")\n return new Date(value);\n return JSON.parse(replaceStringToToken(value), reviver);\n}\n\n// src/core/devtools-client/detected.ts\ninit_esm_shims();\nimport { target as target15 } from \"@vue/devtools-shared\";\nfunction updateDevToolsClientDetected(params) {\n devtoolsState.devtoolsClientDetected = {\n ...devtoolsState.devtoolsClientDetected,\n ...params\n };\n const devtoolsClientVisible = Object.values(devtoolsState.devtoolsClientDetected).some(Boolean);\n toggleHighPerfMode(!devtoolsClientVisible);\n}\nvar _a18, _b18;\n(_b18 = (_a18 = target15).__VUE_DEVTOOLS_UPDATE_CLIENT_DETECTED__) != null ? _b18 : _a18.__VUE_DEVTOOLS_UPDATE_CLIENT_DETECTED__ = updateDevToolsClientDetected;\n\n// src/messaging/index.ts\ninit_esm_shims();\nimport { target as target21 } from \"@vue/devtools-shared\";\nimport { createBirpc, createBirpcGroup } from \"birpc\";\n\n// src/messaging/presets/index.ts\ninit_esm_shims();\n\n// src/messaging/presets/broadcast-channel/index.ts\ninit_esm_shims();\n\n// ../../node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/index.js\ninit_esm_shims();\n\n// ../../node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/class-registry.js\ninit_esm_shims();\n\n// ../../node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/registry.js\ninit_esm_shims();\n\n// ../../node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/double-indexed-kv.js\ninit_esm_shims();\nvar DoubleIndexedKV = class {\n constructor() {\n this.keyToValue = /* @__PURE__ */ new Map();\n this.valueToKey = /* @__PURE__ */ new Map();\n }\n set(key, value) {\n this.keyToValue.set(key, value);\n this.valueToKey.set(value, key);\n }\n getByKey(key) {\n return this.keyToValue.get(key);\n }\n getByValue(value) {\n return this.valueToKey.get(value);\n }\n clear() {\n this.keyToValue.clear();\n this.valueToKey.clear();\n }\n};\n\n// ../../node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/registry.js\nvar Registry = class {\n constructor(generateIdentifier) {\n this.generateIdentifier = generateIdentifier;\n this.kv = new DoubleIndexedKV();\n }\n register(value, identifier) {\n if (this.kv.getByValue(value)) {\n return;\n }\n if (!identifier) {\n identifier = this.generateIdentifier(value);\n }\n this.kv.set(identifier, value);\n }\n clear() {\n this.kv.clear();\n }\n getIdentifier(value) {\n return this.kv.getByValue(value);\n }\n getValue(identifier) {\n return this.kv.getByKey(identifier);\n }\n};\n\n// ../../node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/class-registry.js\nvar ClassRegistry = class extends Registry {\n constructor() {\n super((c) => c.name);\n this.classToAllowedProps = /* @__PURE__ */ new Map();\n }\n register(value, options) {\n if (typeof options === \"object\") {\n if (options.allowProps) {\n this.classToAllowedProps.set(value, options.allowProps);\n }\n super.register(value, options.identifier);\n } else {\n super.register(value, options);\n }\n }\n getAllowedProps(value) {\n return this.classToAllowedProps.get(value);\n }\n};\n\n// ../../node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/custom-transformer-registry.js\ninit_esm_shims();\n\n// ../../node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/util.js\ninit_esm_shims();\nfunction valuesOfObj(record) {\n if (\"values\" in Object) {\n return Object.values(record);\n }\n const values = [];\n for (const key in record) {\n if (record.hasOwnProperty(key)) {\n values.push(record[key]);\n }\n }\n return values;\n}\nfunction find(record, predicate) {\n const values = valuesOfObj(record);\n if (\"find\" in values) {\n return values.find(predicate);\n }\n const valuesNotNever = values;\n for (let i = 0; i < valuesNotNever.length; i++) {\n const value = valuesNotNever[i];\n if (predicate(value)) {\n return value;\n }\n }\n return void 0;\n}\nfunction forEach(record, run) {\n Object.entries(record).forEach(([key, value]) => run(value, key));\n}\nfunction includes(arr, value) {\n return arr.indexOf(value) !== -1;\n}\nfunction findArr(record, predicate) {\n for (let i = 0; i < record.length; i++) {\n const value = record[i];\n if (predicate(value)) {\n return value;\n }\n }\n return void 0;\n}\n\n// ../../node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/custom-transformer-registry.js\nvar CustomTransformerRegistry = class {\n constructor() {\n this.transfomers = {};\n }\n register(transformer) {\n this.transfomers[transformer.name] = transformer;\n }\n findApplicable(v) {\n return find(this.transfomers, (transformer) => transformer.isApplicable(v));\n }\n findByName(name) {\n return this.transfomers[name];\n }\n};\n\n// ../../node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/plainer.js\ninit_esm_shims();\n\n// ../../node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/is.js\ninit_esm_shims();\nvar getType = (payload) => Object.prototype.toString.call(payload).slice(8, -1);\nvar isUndefined = (payload) => typeof payload === \"undefined\";\nvar isNull = (payload) => payload === null;\nvar isPlainObject2 = (payload) => {\n if (typeof payload !== \"object\" || payload === null)\n return false;\n if (payload === Object.prototype)\n return false;\n if (Object.getPrototypeOf(payload) === null)\n return true;\n return Object.getPrototypeOf(payload) === Object.prototype;\n};\nvar isEmptyObject = (payload) => isPlainObject2(payload) && Object.keys(payload).length === 0;\nvar isArray = (payload) => Array.isArray(payload);\nvar isString = (payload) => typeof payload === \"string\";\nvar isNumber = (payload) => typeof payload === \"number\" && !isNaN(payload);\nvar isBoolean = (payload) => typeof payload === \"boolean\";\nvar isRegExp = (payload) => payload instanceof RegExp;\nvar isMap = (payload) => payload instanceof Map;\nvar isSet = (payload) => payload instanceof Set;\nvar isSymbol = (payload) => getType(payload) === \"Symbol\";\nvar isDate = (payload) => payload instanceof Date && !isNaN(payload.valueOf());\nvar isError = (payload) => payload instanceof Error;\nvar isNaNValue = (payload) => typeof payload === \"number\" && isNaN(payload);\nvar isPrimitive2 = (payload) => isBoolean(payload) || isNull(payload) || isUndefined(payload) || isNumber(payload) || isString(payload) || isSymbol(payload);\nvar isBigint = (payload) => typeof payload === \"bigint\";\nvar isInfinite = (payload) => payload === Infinity || payload === -Infinity;\nvar isTypedArray = (payload) => ArrayBuffer.isView(payload) && !(payload instanceof DataView);\nvar isURL = (payload) => payload instanceof URL;\n\n// ../../node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/pathstringifier.js\ninit_esm_shims();\nvar escapeKey = (key) => key.replace(/\\./g, \"\\\\.\");\nvar stringifyPath = (path) => path.map(String).map(escapeKey).join(\".\");\nvar parsePath = (string) => {\n const result = [];\n let segment = \"\";\n for (let i = 0; i < string.length; i++) {\n let char = string.charAt(i);\n const isEscapedDot = char === \"\\\\\" && string.charAt(i + 1) === \".\";\n if (isEscapedDot) {\n segment += \".\";\n i++;\n continue;\n }\n const isEndOfSegment = char === \".\";\n if (isEndOfSegment) {\n result.push(segment);\n segment = \"\";\n continue;\n }\n segment += char;\n }\n const lastSegment = segment;\n result.push(lastSegment);\n return result;\n};\n\n// ../../node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/transformer.js\ninit_esm_shims();\nfunction simpleTransformation(isApplicable, annotation, transform, untransform) {\n return {\n isApplicable,\n annotation,\n transform,\n untransform\n };\n}\nvar simpleRules = [\n simpleTransformation(isUndefined, \"undefined\", () => null, () => void 0),\n simpleTransformation(isBigint, \"bigint\", (v) => v.toString(), (v) => {\n if (typeof BigInt !== \"undefined\") {\n return BigInt(v);\n }\n console.error(\"Please add a BigInt polyfill.\");\n return v;\n }),\n simpleTransformation(isDate, \"Date\", (v) => v.toISOString(), (v) => new Date(v)),\n simpleTransformation(isError, \"Error\", (v, superJson) => {\n const baseError = {\n name: v.name,\n message: v.message\n };\n superJson.allowedErrorProps.forEach((prop) => {\n baseError[prop] = v[prop];\n });\n return baseError;\n }, (v, superJson) => {\n const e = new Error(v.message);\n e.name = v.name;\n e.stack = v.stack;\n superJson.allowedErrorProps.forEach((prop) => {\n e[prop] = v[prop];\n });\n return e;\n }),\n simpleTransformation(isRegExp, \"regexp\", (v) => \"\" + v, (regex) => {\n const body = regex.slice(1, regex.lastIndexOf(\"/\"));\n const flags = regex.slice(regex.lastIndexOf(\"/\") + 1);\n return new RegExp(body, flags);\n }),\n simpleTransformation(\n isSet,\n \"set\",\n // (sets only exist in es6+)\n // eslint-disable-next-line es5/no-es6-methods\n (v) => [...v.values()],\n (v) => new Set(v)\n ),\n simpleTransformation(isMap, \"map\", (v) => [...v.entries()], (v) => new Map(v)),\n simpleTransformation((v) => isNaNValue(v) || isInfinite(v), \"number\", (v) => {\n if (isNaNValue(v)) {\n return \"NaN\";\n }\n if (v > 0) {\n return \"Infinity\";\n } else {\n return \"-Infinity\";\n }\n }, Number),\n simpleTransformation((v) => v === 0 && 1 / v === -Infinity, \"number\", () => {\n return \"-0\";\n }, Number),\n simpleTransformation(isURL, \"URL\", (v) => v.toString(), (v) => new URL(v))\n];\nfunction compositeTransformation(isApplicable, annotation, transform, untransform) {\n return {\n isApplicable,\n annotation,\n transform,\n untransform\n };\n}\nvar symbolRule = compositeTransformation((s, superJson) => {\n if (isSymbol(s)) {\n const isRegistered = !!superJson.symbolRegistry.getIdentifier(s);\n return isRegistered;\n }\n return false;\n}, (s, superJson) => {\n const identifier = superJson.symbolRegistry.getIdentifier(s);\n return [\"symbol\", identifier];\n}, (v) => v.description, (_, a, superJson) => {\n const value = superJson.symbolRegistry.getValue(a[1]);\n if (!value) {\n throw new Error(\"Trying to deserialize unknown symbol\");\n }\n return value;\n});\nvar constructorToName = [\n Int8Array,\n Uint8Array,\n Int16Array,\n Uint16Array,\n Int32Array,\n Uint32Array,\n Float32Array,\n Float64Array,\n Uint8ClampedArray\n].reduce((obj, ctor) => {\n obj[ctor.name] = ctor;\n return obj;\n}, {});\nvar typedArrayRule = compositeTransformation(isTypedArray, (v) => [\"typed-array\", v.constructor.name], (v) => [...v], (v, a) => {\n const ctor = constructorToName[a[1]];\n if (!ctor) {\n throw new Error(\"Trying to deserialize unknown typed array\");\n }\n return new ctor(v);\n});\nfunction isInstanceOfRegisteredClass(potentialClass, superJson) {\n if (potentialClass == null ? void 0 : potentialClass.constructor) {\n const isRegistered = !!superJson.classRegistry.getIdentifier(potentialClass.constructor);\n return isRegistered;\n }\n return false;\n}\nvar classRule = compositeTransformation(isInstanceOfRegisteredClass, (clazz, superJson) => {\n const identifier = superJson.classRegistry.getIdentifier(clazz.constructor);\n return [\"class\", identifier];\n}, (clazz, superJson) => {\n const allowedProps = superJson.classRegistry.getAllowedProps(clazz.constructor);\n if (!allowedProps) {\n return { ...clazz };\n }\n const result = {};\n allowedProps.forEach((prop) => {\n result[prop] = clazz[prop];\n });\n return result;\n}, (v, a, superJson) => {\n const clazz = superJson.classRegistry.getValue(a[1]);\n if (!clazz) {\n throw new Error(`Trying to deserialize unknown class '${a[1]}' - check https://github.com/blitz-js/superjson/issues/116#issuecomment-773996564`);\n }\n return Object.assign(Object.create(clazz.prototype), v);\n});\nvar customRule = compositeTransformation((value, superJson) => {\n return !!superJson.customTransformerRegistry.findApplicable(value);\n}, (value, superJson) => {\n const transformer = superJson.customTransformerRegistry.findApplicable(value);\n return [\"custom\", transformer.name];\n}, (value, superJson) => {\n const transformer = superJson.customTransformerRegistry.findApplicable(value);\n return transformer.serialize(value);\n}, (v, a, superJson) => {\n const transformer = superJson.customTransformerRegistry.findByName(a[1]);\n if (!transformer) {\n throw new Error(\"Trying to deserialize unknown custom value\");\n }\n return transformer.deserialize(v);\n});\nvar compositeRules = [classRule, symbolRule, customRule, typedArrayRule];\nvar transformValue = (value, superJson) => {\n const applicableCompositeRule = findArr(compositeRules, (rule) => rule.isApplicable(value, superJson));\n if (applicableCompositeRule) {\n return {\n value: applicableCompositeRule.transform(value, superJson),\n type: applicableCompositeRule.annotation(value, superJson)\n };\n }\n const applicableSimpleRule = findArr(simpleRules, (rule) => rule.isApplicable(value, superJson));\n if (applicableSimpleRule) {\n return {\n value: applicableSimpleRule.transform(value, superJson),\n type: applicableSimpleRule.annotation\n };\n }\n return void 0;\n};\nvar simpleRulesByAnnotation = {};\nsimpleRules.forEach((rule) => {\n simpleRulesByAnnotation[rule.annotation] = rule;\n});\nvar untransformValue = (json, type, superJson) => {\n if (isArray(type)) {\n switch (type[0]) {\n case \"symbol\":\n return symbolRule.untransform(json, type, superJson);\n case \"class\":\n return classRule.untransform(json, type, superJson);\n case \"custom\":\n return customRule.untransform(json, type, superJson);\n case \"typed-array\":\n return typedArrayRule.untransform(json, type, superJson);\n default:\n throw new Error(\"Unknown transformation: \" + type);\n }\n } else {\n const transformation = simpleRulesByAnnotation[type];\n if (!transformation) {\n throw new Error(\"Unknown transformation: \" + type);\n }\n return transformation.untransform(json, superJson);\n }\n};\n\n// ../../node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/accessDeep.js\ninit_esm_shims();\nvar getNthKey = (value, n) => {\n if (n > value.size)\n throw new Error(\"index out of bounds\");\n const keys = value.keys();\n while (n > 0) {\n keys.next();\n n--;\n }\n return keys.next().value;\n};\nfunction validatePath(path) {\n if (includes(path, \"__proto__\")) {\n throw new Error(\"__proto__ is not allowed as a property\");\n }\n if (includes(path, \"prototype\")) {\n throw new Error(\"prototype is not allowed as a property\");\n }\n if (includes(path, \"constructor\")) {\n throw new Error(\"constructor is not allowed as a property\");\n }\n}\nvar getDeep = (object, path) => {\n validatePath(path);\n for (let i = 0; i < path.length; i++) {\n const key = path[i];\n if (isSet(object)) {\n object = getNthKey(object, +key);\n } else if (isMap(object)) {\n const row = +key;\n const type = +path[++i] === 0 ? \"key\" : \"value\";\n const keyOfRow = getNthKey(object, row);\n switch (type) {\n case \"key\":\n object = keyOfRow;\n break;\n case \"value\":\n object = object.get(keyOfRow);\n break;\n }\n } else {\n object = object[key];\n }\n }\n return object;\n};\nvar setDeep = (object, path, mapper) => {\n validatePath(path);\n if (path.length === 0) {\n return mapper(object);\n }\n let parent = object;\n for (let i = 0; i < path.length - 1; i++) {\n const key = path[i];\n if (isArray(parent)) {\n const index = +key;\n parent = parent[index];\n } else if (isPlainObject2(parent)) {\n parent = parent[key];\n } else if (isSet(parent)) {\n const row = +key;\n parent = getNthKey(parent, row);\n } else if (isMap(parent)) {\n const isEnd = i === path.length - 2;\n if (isEnd) {\n break;\n }\n const row = +key;\n const type = +path[++i] === 0 ? \"key\" : \"value\";\n const keyOfRow = getNthKey(parent, row);\n switch (type) {\n case \"key\":\n parent = keyOfRow;\n break;\n case \"value\":\n parent = parent.get(keyOfRow);\n break;\n }\n }\n }\n const lastKey = path[path.length - 1];\n if (isArray(parent)) {\n parent[+lastKey] = mapper(parent[+lastKey]);\n } else if (isPlainObject2(parent)) {\n parent[lastKey] = mapper(parent[lastKey]);\n }\n if (isSet(parent)) {\n const oldValue = getNthKey(parent, +lastKey);\n const newValue = mapper(oldValue);\n if (oldValue !== newValue) {\n parent.delete(oldValue);\n parent.add(newValue);\n }\n }\n if (isMap(parent)) {\n const row = +path[path.length - 2];\n const keyToRow = getNthKey(parent, row);\n const type = +lastKey === 0 ? \"key\" : \"value\";\n switch (type) {\n case \"key\": {\n const newKey = mapper(keyToRow);\n parent.set(newKey, parent.get(keyToRow));\n if (newKey !== keyToRow) {\n parent.delete(keyToRow);\n }\n break;\n }\n case \"value\": {\n parent.set(keyToRow, mapper(parent.get(keyToRow)));\n break;\n }\n }\n }\n return object;\n};\n\n// ../../node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/plainer.js\nfunction traverse(tree, walker2, origin = []) {\n if (!tree) {\n return;\n }\n if (!isArray(tree)) {\n forEach(tree, (subtree, key) => traverse(subtree, walker2, [...origin, ...parsePath(key)]));\n return;\n }\n const [nodeValue, children] = tree;\n if (children) {\n forEach(children, (child, key) => {\n traverse(child, walker2, [...origin, ...parsePath(key)]);\n });\n }\n walker2(nodeValue, origin);\n}\nfunction applyValueAnnotations(plain, annotations, superJson) {\n traverse(annotations, (type, path) => {\n plain = setDeep(plain, path, (v) => untransformValue(v, type, superJson));\n });\n return plain;\n}\nfunction applyReferentialEqualityAnnotations(plain, annotations) {\n function apply(identicalPaths, path) {\n const object = getDeep(plain, parsePath(path));\n identicalPaths.map(parsePath).forEach((identicalObjectPath) => {\n plain = setDeep(plain, identicalObjectPath, () => object);\n });\n }\n if (isArray(annotations)) {\n const [root, other] = annotations;\n root.forEach((identicalPath) => {\n plain = setDeep(plain, parsePath(identicalPath), () => plain);\n });\n if (other) {\n forEach(other, apply);\n }\n } else {\n forEach(annotations, apply);\n }\n return plain;\n}\nvar isDeep = (object, superJson) => isPlainObject2(object) || isArray(object) || isMap(object) || isSet(object) || isInstanceOfRegisteredClass(object, superJson);\nfunction addIdentity(object, path, identities) {\n const existingSet = identities.get(object);\n if (existingSet) {\n existingSet.push(path);\n } else {\n identities.set(object, [path]);\n }\n}\nfunction generateReferentialEqualityAnnotations(identitites, dedupe) {\n const result = {};\n let rootEqualityPaths = void 0;\n identitites.forEach((paths) => {\n if (paths.length <= 1) {\n return;\n }\n if (!dedupe) {\n paths = paths.map((path) => path.map(String)).sort((a, b) => a.length - b.length);\n }\n const [representativePath, ...identicalPaths] = paths;\n if (representativePath.length === 0) {\n rootEqualityPaths = identicalPaths.map(stringifyPath);\n } else {\n result[stringifyPath(representativePath)] = identicalPaths.map(stringifyPath);\n }\n });\n if (rootEqualityPaths) {\n if (isEmptyObject(result)) {\n return [rootEqualityPaths];\n } else {\n return [rootEqualityPaths, result];\n }\n } else {\n return isEmptyObject(result) ? void 0 : result;\n }\n}\nvar walker = (object, identities, superJson, dedupe, path = [], objectsInThisPath = [], seenObjects = /* @__PURE__ */ new Map()) => {\n var _a25;\n const primitive = isPrimitive2(object);\n if (!primitive) {\n addIdentity(object, path, identities);\n const seen = seenObjects.get(object);\n if (seen) {\n return dedupe ? {\n transformedValue: null\n } : seen;\n }\n }\n if (!isDeep(object, superJson)) {\n const transformed2 = transformValue(object, superJson);\n const result2 = transformed2 ? {\n transformedValue: transformed2.value,\n annotations: [transformed2.type]\n } : {\n transformedValue: object\n };\n if (!primitive) {\n seenObjects.set(object, result2);\n }\n return result2;\n }\n if (includes(objectsInThisPath, object)) {\n return {\n transformedValue: null\n };\n }\n const transformationResult = transformValue(object, superJson);\n const transformed = (_a25 = transformationResult == null ? void 0 : transformationResult.value) != null ? _a25 : object;\n const transformedValue = isArray(transformed) ? [] : {};\n const innerAnnotations = {};\n forEach(transformed, (value, index) => {\n if (index === \"__proto__\" || index === \"constructor\" || index === \"prototype\") {\n throw new Error(`Detected property ${index}. This is a prototype pollution risk, please remove it from your object.`);\n }\n const recursiveResult = walker(value, identities, superJson, dedupe, [...path, index], [...objectsInThisPath, object], seenObjects);\n transformedValue[index] = recursiveResult.transformedValue;\n if (isArray(recursiveResult.annotations)) {\n innerAnnotations[index] = recursiveResult.annotations;\n } else if (isPlainObject2(recursiveResult.annotations)) {\n forEach(recursiveResult.annotations, (tree, key) => {\n innerAnnotations[escapeKey(index) + \".\" + key] = tree;\n });\n }\n });\n const result = isEmptyObject(innerAnnotations) ? {\n transformedValue,\n annotations: !!transformationResult ? [transformationResult.type] : void 0\n } : {\n transformedValue,\n annotations: !!transformationResult ? [transformationResult.type, innerAnnotations] : innerAnnotations\n };\n if (!primitive) {\n seenObjects.set(object, result);\n }\n return result;\n};\n\n// ../../node_modules/.pnpm/copy-anything@3.0.5/node_modules/copy-anything/dist/index.js\ninit_esm_shims();\n\n// ../../node_modules/.pnpm/is-what@4.1.16/node_modules/is-what/dist/index.js\ninit_esm_shims();\nfunction getType2(payload) {\n return Object.prototype.toString.call(payload).slice(8, -1);\n}\nfunction isArray2(payload) {\n return getType2(payload) === \"Array\";\n}\nfunction isPlainObject3(payload) {\n if (getType2(payload) !== \"Object\")\n return false;\n const prototype = Object.getPrototypeOf(payload);\n return !!prototype && prototype.constructor === Object && prototype === Object.prototype;\n}\nfunction isNull2(payload) {\n return getType2(payload) === \"Null\";\n}\nfunction isOneOf(a, b, c, d, e) {\n return (value) => a(value) || b(value) || !!c && c(value) || !!d && d(value) || !!e && e(value);\n}\nfunction isUndefined2(payload) {\n return getType2(payload) === \"Undefined\";\n}\nvar isNullOrUndefined = isOneOf(isNull2, isUndefined2);\n\n// ../../node_modules/.pnpm/copy-anything@3.0.5/node_modules/copy-anything/dist/index.js\nfunction assignProp(carry, key, newVal, originalObject, includeNonenumerable) {\n const propType = {}.propertyIsEnumerable.call(originalObject, key) ? \"enumerable\" : \"nonenumerable\";\n if (propType === \"enumerable\")\n carry[key] = newVal;\n if (includeNonenumerable && propType === \"nonenumerable\") {\n Object.defineProperty(carry, key, {\n value: newVal,\n enumerable: false,\n writable: true,\n configurable: true\n });\n }\n}\nfunction copy(target22, options = {}) {\n if (isArray2(target22)) {\n return target22.map((item) => copy(item, options));\n }\n if (!isPlainObject3(target22)) {\n return target22;\n }\n const props = Object.getOwnPropertyNames(target22);\n const symbols = Object.getOwnPropertySymbols(target22);\n return [...props, ...symbols].reduce((carry, key) => {\n if (isArray2(options.props) && !options.props.includes(key)) {\n return carry;\n }\n const val = target22[key];\n const newVal = copy(val, options);\n assignProp(carry, key, newVal, target22, options.nonenumerable);\n return carry;\n }, {});\n}\n\n// ../../node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/index.js\nvar SuperJSON = class {\n /**\n * @param dedupeReferentialEqualities If true, SuperJSON will make sure only one instance of referentially equal objects are serialized and the rest are replaced with `null`.\n */\n constructor({ dedupe = false } = {}) {\n this.classRegistry = new ClassRegistry();\n this.symbolRegistry = new Registry((s) => {\n var _a25;\n return (_a25 = s.description) != null ? _a25 : \"\";\n });\n this.customTransformerRegistry = new CustomTransformerRegistry();\n this.allowedErrorProps = [];\n this.dedupe = dedupe;\n }\n serialize(object) {\n const identities = /* @__PURE__ */ new Map();\n const output = walker(object, identities, this, this.dedupe);\n const res = {\n json: output.transformedValue\n };\n if (output.annotations) {\n res.meta = {\n ...res.meta,\n values: output.annotations\n };\n }\n const equalityAnnotations = generateReferentialEqualityAnnotations(identities, this.dedupe);\n if (equalityAnnotations) {\n res.meta = {\n ...res.meta,\n referentialEqualities: equalityAnnotations\n };\n }\n return res;\n }\n deserialize(payload) {\n const { json, meta } = payload;\n let result = copy(json);\n if (meta == null ? void 0 : meta.values) {\n result = applyValueAnnotations(result, meta.values, this);\n }\n if (meta == null ? void 0 : meta.referentialEqualities) {\n result = applyReferentialEqualityAnnotations(result, meta.referentialEqualities);\n }\n return result;\n }\n stringify(object) {\n return JSON.stringify(this.serialize(object));\n }\n parse(string) {\n return this.deserialize(JSON.parse(string));\n }\n registerClass(v, options) {\n this.classRegistry.register(v, options);\n }\n registerSymbol(v, identifier) {\n this.symbolRegistry.register(v, identifier);\n }\n registerCustom(transformer, name) {\n this.customTransformerRegistry.register({\n name,\n ...transformer\n });\n }\n allowErrorProps(...props) {\n this.allowedErrorProps.push(...props);\n }\n};\nSuperJSON.defaultInstance = new SuperJSON();\nSuperJSON.serialize = SuperJSON.defaultInstance.serialize.bind(SuperJSON.defaultInstance);\nSuperJSON.deserialize = SuperJSON.defaultInstance.deserialize.bind(SuperJSON.defaultInstance);\nSuperJSON.stringify = SuperJSON.defaultInstance.stringify.bind(SuperJSON.defaultInstance);\nSuperJSON.parse = SuperJSON.defaultInstance.parse.bind(SuperJSON.defaultInstance);\nSuperJSON.registerClass = SuperJSON.defaultInstance.registerClass.bind(SuperJSON.defaultInstance);\nSuperJSON.registerSymbol = SuperJSON.defaultInstance.registerSymbol.bind(SuperJSON.defaultInstance);\nSuperJSON.registerCustom = SuperJSON.defaultInstance.registerCustom.bind(SuperJSON.defaultInstance);\nSuperJSON.allowErrorProps = SuperJSON.defaultInstance.allowErrorProps.bind(SuperJSON.defaultInstance);\nvar serialize = SuperJSON.serialize;\nvar deserialize = SuperJSON.deserialize;\nvar stringify = SuperJSON.stringify;\nvar parse = SuperJSON.parse;\nvar registerClass = SuperJSON.registerClass;\nvar registerCustom = SuperJSON.registerCustom;\nvar registerSymbol = SuperJSON.registerSymbol;\nvar allowErrorProps = SuperJSON.allowErrorProps;\n\n// src/messaging/presets/broadcast-channel/context.ts\ninit_esm_shims();\nvar __DEVTOOLS_KIT_BROADCAST_MESSAGING_EVENT_KEY = \"__devtools-kit-broadcast-messaging-event-key__\";\n\n// src/messaging/presets/broadcast-channel/index.ts\nvar BROADCAST_CHANNEL_NAME = \"__devtools-kit:broadcast-channel__\";\nfunction createBroadcastChannel() {\n const channel = new BroadcastChannel(BROADCAST_CHANNEL_NAME);\n return {\n post: (data) => {\n channel.postMessage(SuperJSON.stringify({\n event: __DEVTOOLS_KIT_BROADCAST_MESSAGING_EVENT_KEY,\n data\n }));\n },\n on: (handler) => {\n channel.onmessage = (event) => {\n const parsed = SuperJSON.parse(event.data);\n if (parsed.event === __DEVTOOLS_KIT_BROADCAST_MESSAGING_EVENT_KEY) {\n handler(parsed.data);\n }\n };\n }\n };\n}\n\n// src/messaging/presets/electron/index.ts\ninit_esm_shims();\n\n// src/messaging/presets/electron/client.ts\ninit_esm_shims();\n\n// src/messaging/presets/electron/context.ts\ninit_esm_shims();\nimport { target as target16 } from \"@vue/devtools-shared\";\nvar __ELECTRON_CLIENT_CONTEXT__ = \"electron:client-context\";\nvar __ELECTRON_RPOXY_CONTEXT__ = \"electron:proxy-context\";\nvar __ELECTRON_SERVER_CONTEXT__ = \"electron:server-context\";\nvar __DEVTOOLS_KIT_ELECTRON_MESSAGING_EVENT_KEY__ = {\n // client\n CLIENT_TO_PROXY: \"client->proxy\",\n // on: proxy->client\n // proxy\n PROXY_TO_CLIENT: \"proxy->client\",\n // on: server->proxy\n PROXY_TO_SERVER: \"proxy->server\",\n // on: client->proxy\n // server\n SERVER_TO_PROXY: \"server->proxy\"\n // on: proxy->server\n};\nfunction getElectronClientContext() {\n return target16[__ELECTRON_CLIENT_CONTEXT__];\n}\nfunction setElectronClientContext(context) {\n target16[__ELECTRON_CLIENT_CONTEXT__] = context;\n}\nfunction getElectronProxyContext() {\n return target16[__ELECTRON_RPOXY_CONTEXT__];\n}\nfunction setElectronProxyContext(context) {\n target16[__ELECTRON_RPOXY_CONTEXT__] = context;\n}\nfunction getElectronServerContext() {\n return target16[__ELECTRON_SERVER_CONTEXT__];\n}\nfunction setElectronServerContext(context) {\n target16[__ELECTRON_SERVER_CONTEXT__] = context;\n}\n\n// src/messaging/presets/electron/client.ts\nfunction createElectronClientChannel() {\n const socket = getElectronClientContext();\n return {\n post: (data) => {\n socket.emit(__DEVTOOLS_KIT_ELECTRON_MESSAGING_EVENT_KEY__.CLIENT_TO_PROXY, SuperJSON.stringify(data));\n },\n on: (handler) => {\n socket.on(__DEVTOOLS_KIT_ELECTRON_MESSAGING_EVENT_KEY__.PROXY_TO_CLIENT, (e) => {\n handler(SuperJSON.parse(e));\n });\n }\n };\n}\n\n// src/messaging/presets/electron/proxy.ts\ninit_esm_shims();\nfunction createElectronProxyChannel() {\n const socket = getElectronProxyContext();\n return {\n post: (data) => {\n },\n on: (handler) => {\n socket.on(__DEVTOOLS_KIT_ELECTRON_MESSAGING_EVENT_KEY__.SERVER_TO_PROXY, (data) => {\n socket.broadcast.emit(__DEVTOOLS_KIT_ELECTRON_MESSAGING_EVENT_KEY__.PROXY_TO_CLIENT, data);\n });\n socket.on(__DEVTOOLS_KIT_ELECTRON_MESSAGING_EVENT_KEY__.CLIENT_TO_PROXY, (data) => {\n socket.broadcast.emit(__DEVTOOLS_KIT_ELECTRON_MESSAGING_EVENT_KEY__.PROXY_TO_SERVER, data);\n });\n }\n };\n}\n\n// src/messaging/presets/electron/server.ts\ninit_esm_shims();\nfunction createElectronServerChannel() {\n const socket = getElectronServerContext();\n return {\n post: (data) => {\n socket.emit(__DEVTOOLS_KIT_ELECTRON_MESSAGING_EVENT_KEY__.SERVER_TO_PROXY, SuperJSON.stringify(data));\n },\n on: (handler) => {\n socket.on(__DEVTOOLS_KIT_ELECTRON_MESSAGING_EVENT_KEY__.PROXY_TO_SERVER, (data) => {\n handler(SuperJSON.parse(data));\n });\n }\n };\n}\n\n// src/messaging/presets/extension/index.ts\ninit_esm_shims();\n\n// src/messaging/presets/extension/client.ts\ninit_esm_shims();\n\n// src/messaging/presets/extension/context.ts\ninit_esm_shims();\nimport { target as target17 } from \"@vue/devtools-shared\";\nvar __EXTENSION_CLIENT_CONTEXT__ = \"electron:client-context\";\nvar __DEVTOOLS_KIT_EXTENSION_MESSAGING_EVENT_KEY__ = {\n // client\n CLIENT_TO_PROXY: \"client->proxy\",\n // on: proxy->client\n // proxy\n PROXY_TO_CLIENT: \"proxy->client\",\n // on: server->proxy\n PROXY_TO_SERVER: \"proxy->server\",\n // on: client->proxy\n // server\n SERVER_TO_PROXY: \"server->proxy\"\n // on: proxy->server\n};\nfunction getExtensionClientContext() {\n return target17[__EXTENSION_CLIENT_CONTEXT__];\n}\nfunction setExtensionClientContext(context) {\n target17[__EXTENSION_CLIENT_CONTEXT__] = context;\n}\n\n// src/messaging/presets/extension/client.ts\nfunction createExtensionClientChannel() {\n let disconnected = false;\n let port = null;\n let reconnectTimer = null;\n let onMessageHandler = null;\n function connect() {\n try {\n clearTimeout(reconnectTimer);\n port = chrome.runtime.connect({\n name: `${chrome.devtools.inspectedWindow.tabId}`\n });\n setExtensionClientContext(port);\n disconnected = false;\n port == null ? void 0 : port.onMessage.addListener(onMessageHandler);\n port.onDisconnect.addListener(() => {\n disconnected = true;\n port == null ? void 0 : port.onMessage.removeListener(onMessageHandler);\n reconnectTimer = setTimeout(connect, 1e3);\n });\n } catch (e) {\n disconnected = true;\n }\n }\n connect();\n return {\n post: (data) => {\n if (disconnected) {\n return;\n }\n port == null ? void 0 : port.postMessage(SuperJSON.stringify(data));\n },\n on: (handler) => {\n onMessageHandler = (data) => {\n if (disconnected) {\n return;\n }\n handler(SuperJSON.parse(data));\n };\n port == null ? void 0 : port.onMessage.addListener(onMessageHandler);\n }\n };\n}\n\n// src/messaging/presets/extension/proxy.ts\ninit_esm_shims();\nfunction createExtensionProxyChannel() {\n const port = chrome.runtime.connect({\n name: \"content-script\"\n });\n function sendMessageToUserApp(payload) {\n window.postMessage({\n source: __DEVTOOLS_KIT_EXTENSION_MESSAGING_EVENT_KEY__.PROXY_TO_SERVER,\n payload\n }, \"*\");\n }\n function sendMessageToDevToolsClient(e) {\n if (e.data && e.data.source === __DEVTOOLS_KIT_EXTENSION_MESSAGING_EVENT_KEY__.SERVER_TO_PROXY) {\n try {\n port.postMessage(e.data.payload);\n } catch (e2) {\n }\n }\n }\n port.onMessage.addListener(sendMessageToUserApp);\n window.addEventListener(\"message\", sendMessageToDevToolsClient);\n port.onDisconnect.addListener(() => {\n window.removeEventListener(\"message\", sendMessageToDevToolsClient);\n sendMessageToUserApp(SuperJSON.stringify({\n event: \"shutdown\"\n }));\n });\n sendMessageToUserApp(SuperJSON.stringify({\n event: \"init\"\n }));\n return {\n post: (data) => {\n },\n on: (handler) => {\n }\n };\n}\n\n// src/messaging/presets/extension/server.ts\ninit_esm_shims();\nfunction createExtensionServerChannel() {\n return {\n post: (data) => {\n window.postMessage({\n source: __DEVTOOLS_KIT_EXTENSION_MESSAGING_EVENT_KEY__.SERVER_TO_PROXY,\n payload: SuperJSON.stringify(data)\n }, \"*\");\n },\n on: (handler) => {\n const listener = (event) => {\n if (event.data.source === __DEVTOOLS_KIT_EXTENSION_MESSAGING_EVENT_KEY__.PROXY_TO_SERVER && event.data.payload) {\n handler(SuperJSON.parse(event.data.payload));\n }\n };\n window.addEventListener(\"message\", listener);\n return () => {\n window.removeEventListener(\"message\", listener);\n };\n }\n };\n}\n\n// src/messaging/presets/iframe/index.ts\ninit_esm_shims();\n\n// src/messaging/presets/iframe/client.ts\ninit_esm_shims();\nimport { isBrowser as isBrowser4 } from \"@vue/devtools-shared\";\n\n// src/messaging/presets/iframe/context.ts\ninit_esm_shims();\nimport { target as target18 } from \"@vue/devtools-shared\";\nvar __DEVTOOLS_KIT_IFRAME_MESSAGING_EVENT_KEY = \"__devtools-kit-iframe-messaging-event-key__\";\nvar __IFRAME_SERVER_CONTEXT__ = \"iframe:server-context\";\nfunction getIframeServerContext() {\n return target18[__IFRAME_SERVER_CONTEXT__];\n}\nfunction setIframeServerContext(context) {\n target18[__IFRAME_SERVER_CONTEXT__] = context;\n}\n\n// src/messaging/presets/iframe/client.ts\nfunction createIframeClientChannel() {\n if (!isBrowser4) {\n return {\n post: (data) => {\n },\n on: (handler) => {\n }\n };\n }\n return {\n post: (data) => window.parent.postMessage(SuperJSON.stringify({\n event: __DEVTOOLS_KIT_IFRAME_MESSAGING_EVENT_KEY,\n data\n }), \"*\"),\n on: (handler) => window.addEventListener(\"message\", (event) => {\n try {\n const parsed = SuperJSON.parse(event.data);\n if (event.source === window.parent && parsed.event === __DEVTOOLS_KIT_IFRAME_MESSAGING_EVENT_KEY) {\n handler(parsed.data);\n }\n } catch (e) {\n }\n })\n };\n}\n\n// src/messaging/presets/iframe/server.ts\ninit_esm_shims();\nimport { isBrowser as isBrowser5 } from \"@vue/devtools-shared\";\nfunction createIframeServerChannel() {\n if (!isBrowser5) {\n return {\n post: (data) => {\n },\n on: (handler) => {\n }\n };\n }\n return {\n post: (data) => {\n var _a25;\n const iframe = getIframeServerContext();\n (_a25 = iframe == null ? void 0 : iframe.contentWindow) == null ? void 0 : _a25.postMessage(SuperJSON.stringify({\n event: __DEVTOOLS_KIT_IFRAME_MESSAGING_EVENT_KEY,\n data\n }), \"*\");\n },\n on: (handler) => {\n window.addEventListener(\"message\", (event) => {\n const iframe = getIframeServerContext();\n try {\n const parsed = SuperJSON.parse(event.data);\n if (event.source === (iframe == null ? void 0 : iframe.contentWindow) && parsed.event === __DEVTOOLS_KIT_IFRAME_MESSAGING_EVENT_KEY) {\n handler(parsed.data);\n }\n } catch (e) {\n }\n });\n }\n };\n}\n\n// src/messaging/presets/vite/index.ts\ninit_esm_shims();\n\n// src/messaging/presets/vite/client.ts\ninit_esm_shims();\n\n// src/messaging/presets/vite/context.ts\ninit_esm_shims();\nimport { target as target19 } from \"@vue/devtools-shared\";\nvar __DEVTOOLS_KIT_VITE_MESSAGING_EVENT_KEY = \"__devtools-kit-vite-messaging-event-key__\";\nvar __VITE_CLIENT_CONTEXT__ = \"vite:client-context\";\nvar __VITE_SERVER_CONTEXT__ = \"vite:server-context\";\nfunction getViteClientContext() {\n return target19[__VITE_CLIENT_CONTEXT__];\n}\nfunction setViteClientContext(context) {\n target19[__VITE_CLIENT_CONTEXT__] = context;\n}\nfunction getViteServerContext() {\n return target19[__VITE_SERVER_CONTEXT__];\n}\nfunction setViteServerContext(context) {\n target19[__VITE_SERVER_CONTEXT__] = context;\n}\n\n// src/messaging/presets/vite/client.ts\nfunction createViteClientChannel() {\n const client = getViteClientContext();\n return {\n post: (data) => {\n client == null ? void 0 : client.send(__DEVTOOLS_KIT_VITE_MESSAGING_EVENT_KEY, SuperJSON.stringify(data));\n },\n on: (handler) => {\n client == null ? void 0 : client.on(__DEVTOOLS_KIT_VITE_MESSAGING_EVENT_KEY, (event) => {\n handler(SuperJSON.parse(event));\n });\n }\n };\n}\n\n// src/messaging/presets/vite/server.ts\ninit_esm_shims();\nfunction createViteServerChannel() {\n var _a25;\n const viteServer = getViteServerContext();\n const ws = (_a25 = viteServer.hot) != null ? _a25 : viteServer.ws;\n return {\n post: (data) => ws == null ? void 0 : ws.send(__DEVTOOLS_KIT_VITE_MESSAGING_EVENT_KEY, SuperJSON.stringify(data)),\n on: (handler) => ws == null ? void 0 : ws.on(__DEVTOOLS_KIT_VITE_MESSAGING_EVENT_KEY, (event) => {\n handler(SuperJSON.parse(event));\n })\n };\n}\n\n// src/messaging/presets/ws/index.ts\ninit_esm_shims();\n\n// src/messaging/presets/ws/client.ts\ninit_esm_shims();\n\n// src/messaging/presets/ws/context.ts\ninit_esm_shims();\nimport { target as target20 } from \"@vue/devtools-shared\";\n\n// src/messaging/presets/ws/server.ts\ninit_esm_shims();\n\n// src/messaging/index.ts\nvar _a19, _b19;\n(_b19 = (_a19 = target21).__VUE_DEVTOOLS_KIT_MESSAGE_CHANNELS__) != null ? _b19 : _a19.__VUE_DEVTOOLS_KIT_MESSAGE_CHANNELS__ = [];\nvar _a20, _b20;\n(_b20 = (_a20 = target21).__VUE_DEVTOOLS_KIT_RPC_CLIENT__) != null ? _b20 : _a20.__VUE_DEVTOOLS_KIT_RPC_CLIENT__ = null;\nvar _a21, _b21;\n(_b21 = (_a21 = target21).__VUE_DEVTOOLS_KIT_RPC_SERVER__) != null ? _b21 : _a21.__VUE_DEVTOOLS_KIT_RPC_SERVER__ = null;\nvar _a22, _b22;\n(_b22 = (_a22 = target21).__VUE_DEVTOOLS_KIT_VITE_RPC_CLIENT__) != null ? _b22 : _a22.__VUE_DEVTOOLS_KIT_VITE_RPC_CLIENT__ = null;\nvar _a23, _b23;\n(_b23 = (_a23 = target21).__VUE_DEVTOOLS_KIT_VITE_RPC_SERVER__) != null ? _b23 : _a23.__VUE_DEVTOOLS_KIT_VITE_RPC_SERVER__ = null;\nvar _a24, _b24;\n(_b24 = (_a24 = target21).__VUE_DEVTOOLS_KIT_BROADCAST_RPC_SERVER__) != null ? _b24 : _a24.__VUE_DEVTOOLS_KIT_BROADCAST_RPC_SERVER__ = null;\nfunction setRpcClientToGlobal(rpc) {\n target21.__VUE_DEVTOOLS_KIT_RPC_CLIENT__ = rpc;\n}\nfunction setRpcServerToGlobal(rpc) {\n target21.__VUE_DEVTOOLS_KIT_RPC_SERVER__ = rpc;\n}\nfunction getRpcClient() {\n return target21.__VUE_DEVTOOLS_KIT_RPC_CLIENT__;\n}\nfunction getRpcServer() {\n return target21.__VUE_DEVTOOLS_KIT_RPC_SERVER__;\n}\nfunction setViteRpcClientToGlobal(rpc) {\n target21.__VUE_DEVTOOLS_KIT_VITE_RPC_CLIENT__ = rpc;\n}\nfunction setViteRpcServerToGlobal(rpc) {\n target21.__VUE_DEVTOOLS_KIT_VITE_RPC_SERVER__ = rpc;\n}\nfunction getViteRpcClient() {\n return target21.__VUE_DEVTOOLS_KIT_VITE_RPC_CLIENT__;\n}\nfunction getViteRpcServer() {\n return target21.__VUE_DEVTOOLS_KIT_VITE_RPC_SERVER__;\n}\nfunction getChannel(preset, host = \"client\") {\n const channel = {\n iframe: {\n client: createIframeClientChannel,\n server: createIframeServerChannel\n }[host],\n electron: {\n client: createElectronClientChannel,\n proxy: createElectronProxyChannel,\n server: createElectronServerChannel\n }[host],\n vite: {\n client: createViteClientChannel,\n server: createViteServerChannel\n }[host],\n broadcast: {\n client: createBroadcastChannel,\n server: createBroadcastChannel\n }[host],\n extension: {\n client: createExtensionClientChannel,\n proxy: createExtensionProxyChannel,\n server: createExtensionServerChannel\n }[host]\n }[preset];\n return channel();\n}\nfunction createRpcClient(functions, options = {}) {\n const { channel: _channel, options: _options, preset } = options;\n const channel = preset ? getChannel(preset) : _channel;\n const rpc = createBirpc(functions, {\n ..._options,\n ...channel,\n timeout: -1\n });\n if (preset === \"vite\") {\n setViteRpcClientToGlobal(rpc);\n return;\n }\n setRpcClientToGlobal(rpc);\n return rpc;\n}\nfunction createRpcServer(functions, options = {}) {\n const { channel: _channel, options: _options, preset } = options;\n const channel = preset ? getChannel(preset, \"server\") : _channel;\n const rpcServer = getRpcServer();\n if (!rpcServer) {\n const group = createBirpcGroup(functions, [channel], {\n ..._options,\n timeout: -1\n });\n if (preset === \"vite\") {\n setViteRpcServerToGlobal(group);\n return;\n }\n setRpcServerToGlobal(group);\n } else {\n rpcServer.updateChannels((channels) => {\n channels.push(channel);\n });\n }\n}\nfunction createRpcProxy(options = {}) {\n const { channel: _channel, options: _options, preset } = options;\n const channel = preset ? getChannel(preset, \"proxy\") : _channel;\n return createBirpc({}, {\n ..._options,\n ...channel,\n timeout: -1\n });\n}\n\n// src/shared/index.ts\ninit_esm_shims();\n\n// src/shared/env.ts\ninit_esm_shims();\n\n// src/shared/time.ts\ninit_esm_shims();\n\n// src/shared/util.ts\ninit_esm_shims();\n\n// src/core/component/state/replacer.ts\ninit_esm_shims();\n\n// src/core/component/state/custom.ts\ninit_esm_shims();\nfunction getFunctionDetails(func) {\n let string = \"\";\n let matches = null;\n try {\n string = Function.prototype.toString.call(func);\n matches = String.prototype.match.call(string, /\\([\\s\\S]*?\\)/);\n } catch (e) {\n }\n const match = matches && matches[0];\n const args = typeof match === \"string\" ? match : \"(?)\";\n const name = typeof func.name === \"string\" ? func.name : \"\";\n return {\n _custom: {\n type: \"function\",\n displayText: `<span style=\"opacity:.8;margin-right:5px;\">function</span> <span style=\"white-space:nowrap;\">${escape(name)}${args}</span>`,\n tooltipText: string.trim() ? `<pre>${string}</pre>` : null\n }\n };\n}\nfunction getBigIntDetails(val) {\n const stringifiedBigInt = BigInt.prototype.toString.call(val);\n return {\n _custom: {\n type: \"bigint\",\n displayText: `BigInt(${stringifiedBigInt})`,\n value: stringifiedBigInt\n }\n };\n}\nfunction getDateDetails(val) {\n const date = new Date(val.getTime());\n date.setMinutes(date.getMinutes() - date.getTimezoneOffset());\n return {\n _custom: {\n type: \"date\",\n displayText: Date.prototype.toString.call(val),\n value: date.toISOString().slice(0, -1)\n }\n };\n}\nfunction getMapDetails(val) {\n const list = Object.fromEntries(val);\n return {\n _custom: {\n type: \"map\",\n displayText: \"Map\",\n value: list,\n readOnly: true,\n fields: {\n abstract: true\n }\n }\n };\n}\nfunction getSetDetails(val) {\n const list = Array.from(val);\n return {\n _custom: {\n type: \"set\",\n displayText: `Set[${list.length}]`,\n value: list,\n readOnly: true\n }\n };\n}\nfunction getCaughtGetters(store) {\n const getters = {};\n const origGetters = store.getters || {};\n const keys = Object.keys(origGetters);\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i];\n Object.defineProperty(getters, key, {\n enumerable: true,\n get: () => {\n try {\n return origGetters[key];\n } catch (e) {\n return e;\n }\n }\n });\n }\n return getters;\n}\nfunction reduceStateList(list) {\n if (!list.length)\n return void 0;\n return list.reduce((map, item) => {\n const key = item.type || \"data\";\n const obj = map[key] = map[key] || {};\n obj[item.key] = item.value;\n return map;\n }, {});\n}\nfunction namedNodeMapToObject(map) {\n const result = {};\n const l = map.length;\n for (let i = 0; i < l; i++) {\n const node = map.item(i);\n result[node.name] = node.value;\n }\n return result;\n}\nfunction getStoreDetails(store) {\n return {\n _custom: {\n type: \"store\",\n displayText: \"Store\",\n value: {\n state: store.state,\n getters: getCaughtGetters(store)\n },\n fields: {\n abstract: true\n }\n }\n };\n}\nfunction getRouterDetails(router) {\n return {\n _custom: {\n type: \"router\",\n displayText: \"VueRouter\",\n value: {\n options: router.options,\n currentRoute: router.currentRoute\n },\n fields: {\n abstract: true\n }\n }\n };\n}\nfunction getInstanceDetails(instance) {\n if (instance._)\n instance = instance._;\n const state = processInstanceState(instance);\n return {\n _custom: {\n type: \"component\",\n id: instance.__VUE_DEVTOOLS_NEXT_UID__,\n displayText: getInstanceName(instance),\n tooltipText: \"Component instance\",\n value: reduceStateList(state),\n fields: {\n abstract: true\n }\n }\n };\n}\nfunction getComponentDefinitionDetails(definition) {\n let display = getComponentName(definition);\n if (display) {\n if (definition.name && definition.__file)\n display += ` <span>(${definition.__file})</span>`;\n } else {\n display = \"<i>Unknown Component</i>\";\n }\n return {\n _custom: {\n type: \"component-definition\",\n displayText: display,\n tooltipText: \"Component definition\",\n ...definition.__file ? {\n file: definition.__file\n } : {}\n }\n };\n}\nfunction getHTMLElementDetails(value) {\n try {\n return {\n _custom: {\n type: \"HTMLElement\",\n displayText: `<span class=\"opacity-30\">&lt;</span><span class=\"text-blue-500\">${value.tagName.toLowerCase()}</span><span class=\"opacity-30\">&gt;</span>`,\n value: namedNodeMapToObject(value.attributes)\n }\n };\n } catch (e) {\n return {\n _custom: {\n type: \"HTMLElement\",\n displayText: `<span class=\"text-blue-500\">${String(value)}</span>`\n }\n };\n }\n}\nfunction tryGetRefValue(ref) {\n if (ensurePropertyExists(ref, \"_value\", true)) {\n return ref._value;\n }\n if (ensurePropertyExists(ref, \"value\", true)) {\n return ref.value;\n }\n}\nfunction getObjectDetails(object) {\n var _a25, _b25, _c, _d;\n const info = getSetupStateType(object);\n const isState = info.ref || info.computed || info.reactive;\n if (isState) {\n const stateTypeName = info.computed ? \"Computed\" : info.ref ? \"Ref\" : info.reactive ? \"Reactive\" : null;\n const value = toRaw2(info.reactive ? object : tryGetRefValue(object));\n const raw = ensurePropertyExists(object, \"effect\") ? ((_b25 = (_a25 = object.effect) == null ? void 0 : _a25.raw) == null ? void 0 : _b25.toString()) || ((_d = (_c = object.effect) == null ? void 0 : _c.fn) == null ? void 0 : _d.toString()) : null;\n return {\n _custom: {\n type: stateTypeName == null ? void 0 : stateTypeName.toLowerCase(),\n stateTypeName,\n value,\n ...raw ? { tooltipText: `<span class=\"font-mono\">${raw}</span>` } : {}\n }\n };\n }\n if (ensurePropertyExists(object, \"__asyncLoader\") && typeof object.__asyncLoader === \"function\") {\n return {\n _custom: {\n type: \"component-definition\",\n display: \"Async component definition\"\n }\n };\n }\n}\n\n// src/core/component/state/replacer.ts\nfunction stringifyReplacer(key, _value, depth, seenInstance) {\n var _a25;\n if (key === \"compilerOptions\")\n return;\n const val = this[key];\n const type = typeof val;\n if (Array.isArray(val)) {\n const l = val.length;\n if (l > MAX_ARRAY_SIZE) {\n return {\n _isArray: true,\n length: l,\n items: val.slice(0, MAX_ARRAY_SIZE)\n };\n }\n return val;\n } else if (typeof val === \"string\") {\n if (val.length > MAX_STRING_SIZE)\n return `${val.substring(0, MAX_STRING_SIZE)}... (${val.length} total length)`;\n else\n return val;\n } else if (type === \"undefined\") {\n return UNDEFINED;\n } else if (val === Number.POSITIVE_INFINITY) {\n return INFINITY;\n } else if (val === Number.NEGATIVE_INFINITY) {\n return NEGATIVE_INFINITY;\n } else if (typeof val === \"function\") {\n return getFunctionDetails(val);\n } else if (type === \"symbol\") {\n return `[native Symbol ${Symbol.prototype.toString.call(val)}]`;\n } else if (typeof val === \"bigint\") {\n return getBigIntDetails(val);\n } else if (val !== null && typeof val === \"object\") {\n const proto = Object.prototype.toString.call(val);\n if (proto === \"[object Map]\") {\n return getMapDetails(val);\n } else if (proto === \"[object Set]\") {\n return getSetDetails(val);\n } else if (proto === \"[object RegExp]\") {\n return `[native RegExp ${RegExp.prototype.toString.call(val)}]`;\n } else if (proto === \"[object Date]\") {\n return getDateDetails(val);\n } else if (proto === \"[object Error]\") {\n return `[native Error ${val.message}<>${val.stack}]`;\n } else if (ensurePropertyExists(val, \"state\", true) && ensurePropertyExists(val, \"_vm\", true)) {\n return getStoreDetails(val);\n } else if (val.constructor && val.constructor.name === \"VueRouter\") {\n return getRouterDetails(val);\n } else if (isVueInstance(val)) {\n const componentVal = getInstanceDetails(val);\n const parentInstanceDepth = seenInstance == null ? void 0 : seenInstance.get(val);\n if (parentInstanceDepth && parentInstanceDepth < depth) {\n return `[[CircularRef]] <${componentVal._custom.displayText}>`;\n }\n seenInstance == null ? void 0 : seenInstance.set(val, depth);\n return componentVal;\n } else if (ensurePropertyExists(val, \"render\", true) && typeof val.render === \"function\") {\n return getComponentDefinitionDetails(val);\n } else if (val.constructor && val.constructor.name === \"VNode\") {\n return `[native VNode <${val.tag}>]`;\n } else if (typeof HTMLElement !== \"undefined\" && val instanceof HTMLElement) {\n return getHTMLElementDetails(val);\n } else if (((_a25 = val.constructor) == null ? void 0 : _a25.name) === \"Store\" && \"_wrappedGetters\" in val) {\n return \"[object Store]\";\n } else if (ensurePropertyExists(val, \"currentRoute\", true)) {\n return \"[object Router]\";\n }\n const customDetails = getObjectDetails(val);\n if (customDetails != null)\n return customDetails;\n } else if (Number.isNaN(val)) {\n return NAN;\n }\n return sanitize(val);\n}\n\n// src/shared/transfer.ts\ninit_esm_shims();\nvar MAX_SERIALIZED_SIZE = 2 * 1024 * 1024;\nfunction isObject(_data, proto) {\n return proto === \"[object Object]\";\n}\nfunction isArray3(_data, proto) {\n return proto === \"[object Array]\";\n}\nfunction isVueReactiveLinkNode(node) {\n var _a25;\n const constructorName = (_a25 = node == null ? void 0 : node.constructor) == null ? void 0 : _a25.name;\n return constructorName === \"Dep\" && \"activeLink\" in node || constructorName === \"Link\" && \"dep\" in node;\n}\nfunction encode(data, replacer, list, seen, depth = 0, seenVueInstance = /* @__PURE__ */ new Map()) {\n let stored;\n let key;\n let value;\n let i;\n let l;\n const seenIndex = seen.get(data);\n if (seenIndex != null)\n return seenIndex;\n const index = list.length;\n const proto = Object.prototype.toString.call(data);\n if (isObject(data, proto)) {\n if (isVueReactiveLinkNode(data)) {\n return index;\n }\n stored = {};\n seen.set(data, index);\n list.push(stored);\n const keys = Object.keys(data);\n for (i = 0, l = keys.length; i < l; i++) {\n key = keys[i];\n if (key === \"compilerOptions\")\n return index;\n value = data[key];\n const isVm = value != null && isObject(value, Object.prototype.toString.call(data)) && isVueInstance(value);\n try {\n if (replacer) {\n value = replacer.call(data, key, value, depth, seenVueInstance);\n }\n } catch (e) {\n value = e;\n }\n stored[key] = encode(value, replacer, list, seen, depth + 1, seenVueInstance);\n if (isVm) {\n seenVueInstance.delete(value);\n }\n }\n } else if (isArray3(data, proto)) {\n stored = [];\n seen.set(data, index);\n list.push(stored);\n for (i = 0, l = data.length; i < l; i++) {\n try {\n value = data[i];\n if (replacer)\n value = replacer.call(data, i, value, depth, seenVueInstance);\n } catch (e) {\n value = e;\n }\n stored[i] = encode(value, replacer, list, seen, depth + 1, seenVueInstance);\n }\n } else {\n list.push(data);\n }\n return index;\n}\nfunction decode(list, reviver2 = null) {\n let i = list.length;\n let j, k, data, key, value, proto;\n while (i--) {\n data = list[i];\n proto = Object.prototype.toString.call(data);\n if (proto === \"[object Object]\") {\n const keys = Object.keys(data);\n for (j = 0, k = keys.length; j < k; j++) {\n key = keys[j];\n value = list[data[key]];\n if (reviver2)\n value = reviver2.call(data, key, value);\n data[key] = value;\n }\n } else if (proto === \"[object Array]\") {\n for (j = 0, k = data.length; j < k; j++) {\n value = list[data[j]];\n if (reviver2)\n value = reviver2.call(data, j, value);\n data[j] = value;\n }\n }\n }\n}\nfunction stringifyCircularAutoChunks(data, replacer = null, space = null) {\n let result;\n try {\n result = arguments.length === 1 ? JSON.stringify(data) : JSON.stringify(data, (k, v) => {\n var _a25;\n return (_a25 = replacer == null ? void 0 : replacer(k, v)) == null ? void 0 : _a25.call(this);\n }, space);\n } catch (e) {\n result = stringifyStrictCircularAutoChunks(data, replacer, space);\n }\n if (result.length > MAX_SERIALIZED_SIZE) {\n const chunkCount = Math.ceil(result.length / MAX_SERIALIZED_SIZE);\n const chunks = [];\n for (let i = 0; i < chunkCount; i++)\n chunks.push(result.slice(i * MAX_SERIALIZED_SIZE, (i + 1) * MAX_SERIALIZED_SIZE));\n return chunks;\n }\n return result;\n}\nfunction stringifyStrictCircularAutoChunks(data, replacer = null, space = null) {\n const list = [];\n encode(data, replacer, list, /* @__PURE__ */ new Map());\n return space ? ` ${JSON.stringify(list, null, space)}` : ` ${JSON.stringify(list)}`;\n}\nfunction parseCircularAutoChunks(data, reviver2 = null) {\n if (Array.isArray(data))\n data = data.join(\"\");\n const hasCircular = /^\\s/.test(data);\n if (!hasCircular) {\n return arguments.length === 1 ? JSON.parse(data) : JSON.parse(data, reviver2);\n } else {\n const list = JSON.parse(data);\n decode(list, reviver2);\n return list[0];\n }\n}\n\n// src/shared/util.ts\nfunction stringify2(data) {\n return stringifyCircularAutoChunks(data, stringifyReplacer);\n}\nfunction parse2(data, revive2 = false) {\n if (data == void 0)\n return {};\n return revive2 ? parseCircularAutoChunks(data, reviver) : parseCircularAutoChunks(data);\n}\n\n// src/index.ts\nvar devtools = {\n hook,\n init: () => {\n initDevTools();\n },\n get ctx() {\n return devtoolsContext;\n },\n get api() {\n return devtoolsContext.api;\n }\n};\nexport {\n DevToolsContextHookKeys,\n DevToolsMessagingHookKeys,\n DevToolsV6PluginAPIHookKeys,\n INFINITY,\n NAN,\n NEGATIVE_INFINITY,\n ROUTER_INFO_KEY,\n ROUTER_KEY,\n UNDEFINED,\n activeAppRecord,\n addCustomCommand,\n addCustomTab,\n addDevToolsAppRecord,\n addDevToolsPluginToBuffer,\n addInspector,\n callConnectedUpdatedHook,\n callDevToolsPluginSetupFn,\n callInspectorUpdatedHook,\n callStateUpdatedHook,\n createComponentsDevToolsPlugin,\n createDevToolsApi,\n createDevToolsCtxHooks,\n createRpcClient,\n createRpcProxy,\n createRpcServer,\n devtools,\n devtoolsAppRecords,\n devtoolsContext,\n devtoolsInspector,\n devtoolsPluginBuffer,\n devtoolsRouter,\n devtoolsRouterInfo,\n devtoolsState,\n escape,\n formatInspectorStateValue,\n getActiveInspectors,\n getDevToolsEnv,\n getExtensionClientContext,\n getInspector,\n getInspectorActions,\n getInspectorInfo,\n getInspectorNodeActions,\n getInspectorStateValueType,\n getRaw,\n getRpcClient,\n getRpcServer,\n getViteRpcClient,\n getViteRpcServer,\n initDevTools,\n isPlainObject,\n onDevToolsClientConnected,\n onDevToolsConnected,\n parse2 as parse,\n registerDevToolsPlugin,\n removeCustomCommand,\n removeDevToolsAppRecord,\n removeRegisteredPluginApp,\n resetDevToolsState,\n setActiveAppRecord,\n setActiveAppRecordId,\n setDevToolsEnv,\n setElectronClientContext,\n setElectronProxyContext,\n setElectronServerContext,\n setExtensionClientContext,\n setIframeServerContext,\n setOpenInEditorBaseUrl,\n setRpcServerToGlobal,\n setViteClientContext,\n setViteRpcClientToGlobal,\n setViteRpcServerToGlobal,\n setViteServerContext,\n setupDevToolsPlugin,\n stringify2 as stringify,\n toEdit,\n toSubmit,\n toggleClientConnected,\n toggleComponentInspectorEnabled,\n toggleHighPerfMode,\n updateDevToolsClientDetected,\n updateDevToolsState,\n updateTimelineLayersState\n};\n","/*!\n * pinia v3.0.3\n * (c) 2025 Eduardo San Martin Morote\n * @license MIT\n */\nimport { hasInjectionContext, inject, toRaw, watch, unref, markRaw, effectScope, ref, isRef, isReactive, getCurrentScope, onScopeDispose, getCurrentInstance, reactive, toRef, nextTick, computed, toRefs } from 'vue';\nimport { setupDevtoolsPlugin } from '@vue/devtools-api';\n\n/**\n * setActivePinia must be called to handle SSR at the top of functions like\n * `fetch`, `setup`, `serverPrefetch` and others\n */\nlet activePinia;\n/**\n * Sets or unsets the active pinia. Used in SSR and internally when calling\n * actions and getters\n *\n * @param pinia - Pinia instance\n */\n// @ts-expect-error: cannot constrain the type of the return\nconst setActivePinia = (pinia) => (activePinia = pinia);\n/**\n * Get the currently active pinia if there is any.\n */\nconst getActivePinia = () => (hasInjectionContext() && inject(piniaSymbol)) || activePinia;\nconst piniaSymbol = ((process.env.NODE_ENV !== 'production') ? Symbol('pinia') : /* istanbul ignore next */ Symbol());\n\nfunction isPlainObject(\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\no) {\n return (o &&\n typeof o === 'object' &&\n Object.prototype.toString.call(o) === '[object Object]' &&\n typeof o.toJSON !== 'function');\n}\n// type DeepReadonly<T> = { readonly [P in keyof T]: DeepReadonly<T[P]> }\n// TODO: can we change these to numbers?\n/**\n * Possible types for SubscriptionCallback\n */\nvar MutationType;\n(function (MutationType) {\n /**\n * Direct mutation of the state:\n *\n * - `store.name = 'new name'`\n * - `store.$state.name = 'new name'`\n * - `store.list.push('new item')`\n */\n MutationType[\"direct\"] = \"direct\";\n /**\n * Mutated the state with `$patch` and an object\n *\n * - `store.$patch({ name: 'newName' })`\n */\n MutationType[\"patchObject\"] = \"patch object\";\n /**\n * Mutated the state with `$patch` and a function\n *\n * - `store.$patch(state => state.name = 'newName')`\n */\n MutationType[\"patchFunction\"] = \"patch function\";\n // maybe reset? for $state = {} and $reset\n})(MutationType || (MutationType = {}));\n\nconst IS_CLIENT = typeof window !== 'undefined';\n\n/*\n * FileSaver.js A saveAs() FileSaver implementation.\n *\n * Originally by Eli Grey, adapted as an ESM module by Eduardo San Martin\n * Morote.\n *\n * License : MIT\n */\n// The one and only way of getting global scope in all environments\n// https://stackoverflow.com/q/3277182/1008999\nconst _global = /*#__PURE__*/ (() => typeof window === 'object' && window.window === window\n ? window\n : typeof self === 'object' && self.self === self\n ? self\n : typeof global === 'object' && global.global === global\n ? global\n : typeof globalThis === 'object'\n ? globalThis\n : { HTMLElement: null })();\nfunction bom(blob, { autoBom = false } = {}) {\n // prepend BOM for UTF-8 XML and text/* types (including HTML)\n // note: your browser will automatically convert UTF-16 U+FEFF to EF BB BF\n if (autoBom &&\n /^\\s*(?:text\\/\\S*|application\\/xml|\\S*\\/\\S*\\+xml)\\s*;.*charset\\s*=\\s*utf-8/i.test(blob.type)) {\n return new Blob([String.fromCharCode(0xfeff), blob], { type: blob.type });\n }\n return blob;\n}\nfunction download(url, name, opts) {\n const xhr = new XMLHttpRequest();\n xhr.open('GET', url);\n xhr.responseType = 'blob';\n xhr.onload = function () {\n saveAs(xhr.response, name, opts);\n };\n xhr.onerror = function () {\n console.error('could not download file');\n };\n xhr.send();\n}\nfunction corsEnabled(url) {\n const xhr = new XMLHttpRequest();\n // use sync to avoid popup blocker\n xhr.open('HEAD', url, false);\n try {\n xhr.send();\n }\n catch (e) { }\n return xhr.status >= 200 && xhr.status <= 299;\n}\n// `a.click()` doesn't work for all browsers (#465)\nfunction click(node) {\n try {\n node.dispatchEvent(new MouseEvent('click'));\n }\n catch (e) {\n const evt = new MouseEvent('click', {\n bubbles: true,\n cancelable: true,\n view: window,\n detail: 0,\n screenX: 80,\n screenY: 20,\n clientX: 80,\n clientY: 20,\n ctrlKey: false,\n altKey: false,\n shiftKey: false,\n metaKey: false,\n button: 0,\n relatedTarget: null,\n });\n node.dispatchEvent(evt);\n }\n}\nconst _navigator = typeof navigator === 'object' ? navigator : { userAgent: '' };\n// Detect WebView inside a native macOS app by ruling out all browsers\n// We just need to check for 'Safari' because all other browsers (besides Firefox) include that too\n// https://www.whatismybrowser.com/guides/the-latest-user-agent/macos\nconst isMacOSWebView = /*#__PURE__*/ (() => /Macintosh/.test(_navigator.userAgent) &&\n /AppleWebKit/.test(_navigator.userAgent) &&\n !/Safari/.test(_navigator.userAgent))();\nconst saveAs = !IS_CLIENT\n ? () => { } // noop\n : // Use download attribute first if possible (#193 Lumia mobile) unless this is a macOS WebView or mini program\n typeof HTMLAnchorElement !== 'undefined' &&\n 'download' in HTMLAnchorElement.prototype &&\n !isMacOSWebView\n ? downloadSaveAs\n : // Use msSaveOrOpenBlob as a second approach\n 'msSaveOrOpenBlob' in _navigator\n ? msSaveAs\n : // Fallback to using FileReader and a popup\n fileSaverSaveAs;\nfunction downloadSaveAs(blob, name = 'download', opts) {\n const a = document.createElement('a');\n a.download = name;\n a.rel = 'noopener'; // tabnabbing\n // TODO: detect chrome extensions & packaged apps\n // a.target = '_blank'\n if (typeof blob === 'string') {\n // Support regular links\n a.href = blob;\n if (a.origin !== location.origin) {\n if (corsEnabled(a.href)) {\n download(blob, name, opts);\n }\n else {\n a.target = '_blank';\n click(a);\n }\n }\n else {\n click(a);\n }\n }\n else {\n // Support blobs\n a.href = URL.createObjectURL(blob);\n setTimeout(function () {\n URL.revokeObjectURL(a.href);\n }, 4e4); // 40s\n setTimeout(function () {\n click(a);\n }, 0);\n }\n}\nfunction msSaveAs(blob, name = 'download', opts) {\n if (typeof blob === 'string') {\n if (corsEnabled(blob)) {\n download(blob, name, opts);\n }\n else {\n const a = document.createElement('a');\n a.href = blob;\n a.target = '_blank';\n setTimeout(function () {\n click(a);\n });\n }\n }\n else {\n // @ts-ignore: works on windows\n navigator.msSaveOrOpenBlob(bom(blob, opts), name);\n }\n}\nfunction fileSaverSaveAs(blob, name, opts, popup) {\n // Open a popup immediately do go around popup blocker\n // Mostly only available on user interaction and the fileReader is async so...\n popup = popup || open('', '_blank');\n if (popup) {\n popup.document.title = popup.document.body.innerText = 'downloading...';\n }\n if (typeof blob === 'string')\n return download(blob, name, opts);\n const force = blob.type === 'application/octet-stream';\n const isSafari = /constructor/i.test(String(_global.HTMLElement)) || 'safari' in _global;\n const isChromeIOS = /CriOS\\/[\\d]+/.test(navigator.userAgent);\n if ((isChromeIOS || (force && isSafari) || isMacOSWebView) &&\n typeof FileReader !== 'undefined') {\n // Safari doesn't allow downloading of blob URLs\n const reader = new FileReader();\n reader.onloadend = function () {\n let url = reader.result;\n if (typeof url !== 'string') {\n popup = null;\n throw new Error('Wrong reader.result type');\n }\n url = isChromeIOS\n ? url\n : url.replace(/^data:[^;]*;/, 'data:attachment/file;');\n if (popup) {\n popup.location.href = url;\n }\n else {\n location.assign(url);\n }\n popup = null; // reverse-tabnabbing #460\n };\n reader.readAsDataURL(blob);\n }\n else {\n const url = URL.createObjectURL(blob);\n if (popup)\n popup.location.assign(url);\n else\n location.href = url;\n popup = null; // reverse-tabnabbing #460\n setTimeout(function () {\n URL.revokeObjectURL(url);\n }, 4e4); // 40s\n }\n}\n\n/**\n * Shows a toast or console.log\n *\n * @param message - message to log\n * @param type - different color of the tooltip\n */\nfunction toastMessage(message, type) {\n const piniaMessage = '🍍 ' + message;\n if (typeof __VUE_DEVTOOLS_TOAST__ === 'function') {\n // No longer available :(\n __VUE_DEVTOOLS_TOAST__(piniaMessage, type);\n }\n else if (type === 'error') {\n console.error(piniaMessage);\n }\n else if (type === 'warn') {\n console.warn(piniaMessage);\n }\n else {\n console.log(piniaMessage);\n }\n}\nfunction isPinia(o) {\n return '_a' in o && 'install' in o;\n}\n\n/**\n * This file contain devtools actions, they are not Pinia actions.\n */\n// ---\nfunction checkClipboardAccess() {\n if (!('clipboard' in navigator)) {\n toastMessage(`Your browser doesn't support the Clipboard API`, 'error');\n return true;\n }\n}\nfunction checkNotFocusedError(error) {\n if (error instanceof Error &&\n error.message.toLowerCase().includes('document is not focused')) {\n toastMessage('You need to activate the \"Emulate a focused page\" setting in the \"Rendering\" panel of devtools.', 'warn');\n return true;\n }\n return false;\n}\nasync function actionGlobalCopyState(pinia) {\n if (checkClipboardAccess())\n return;\n try {\n await navigator.clipboard.writeText(JSON.stringify(pinia.state.value));\n toastMessage('Global state copied to clipboard.');\n }\n catch (error) {\n if (checkNotFocusedError(error))\n return;\n toastMessage(`Failed to serialize the state. Check the console for more details.`, 'error');\n console.error(error);\n }\n}\nasync function actionGlobalPasteState(pinia) {\n if (checkClipboardAccess())\n return;\n try {\n loadStoresState(pinia, JSON.parse(await navigator.clipboard.readText()));\n toastMessage('Global state pasted from clipboard.');\n }\n catch (error) {\n if (checkNotFocusedError(error))\n return;\n toastMessage(`Failed to deserialize the state from clipboard. Check the console for more details.`, 'error');\n console.error(error);\n }\n}\nasync function actionGlobalSaveState(pinia) {\n try {\n saveAs(new Blob([JSON.stringify(pinia.state.value)], {\n type: 'text/plain;charset=utf-8',\n }), 'pinia-state.json');\n }\n catch (error) {\n toastMessage(`Failed to export the state as JSON. Check the console for more details.`, 'error');\n console.error(error);\n }\n}\nlet fileInput;\nfunction getFileOpener() {\n if (!fileInput) {\n fileInput = document.createElement('input');\n fileInput.type = 'file';\n fileInput.accept = '.json';\n }\n function openFile() {\n return new Promise((resolve, reject) => {\n fileInput.onchange = async () => {\n const files = fileInput.files;\n if (!files)\n return resolve(null);\n const file = files.item(0);\n if (!file)\n return resolve(null);\n return resolve({ text: await file.text(), file });\n };\n // @ts-ignore: TODO: changed from 4.3 to 4.4\n fileInput.oncancel = () => resolve(null);\n fileInput.onerror = reject;\n fileInput.click();\n });\n }\n return openFile;\n}\nasync function actionGlobalOpenStateFile(pinia) {\n try {\n const open = getFileOpener();\n const result = await open();\n if (!result)\n return;\n const { text, file } = result;\n loadStoresState(pinia, JSON.parse(text));\n toastMessage(`Global state imported from \"${file.name}\".`);\n }\n catch (error) {\n toastMessage(`Failed to import the state from JSON. Check the console for more details.`, 'error');\n console.error(error);\n }\n}\nfunction loadStoresState(pinia, state) {\n for (const key in state) {\n const storeState = pinia.state.value[key];\n // store is already instantiated, patch it\n if (storeState) {\n Object.assign(storeState, state[key]);\n }\n else {\n // store is not instantiated, set the initial state\n pinia.state.value[key] = state[key];\n }\n }\n}\n\nfunction formatDisplay(display) {\n return {\n _custom: {\n display,\n },\n };\n}\nconst PINIA_ROOT_LABEL = '🍍 Pinia (root)';\nconst PINIA_ROOT_ID = '_root';\nfunction formatStoreForInspectorTree(store) {\n return isPinia(store)\n ? {\n id: PINIA_ROOT_ID,\n label: PINIA_ROOT_LABEL,\n }\n : {\n id: store.$id,\n label: store.$id,\n };\n}\nfunction formatStoreForInspectorState(store) {\n if (isPinia(store)) {\n const storeNames = Array.from(store._s.keys());\n const storeMap = store._s;\n const state = {\n state: storeNames.map((storeId) => ({\n editable: true,\n key: storeId,\n value: store.state.value[storeId],\n })),\n getters: storeNames\n .filter((id) => storeMap.get(id)._getters)\n .map((id) => {\n const store = storeMap.get(id);\n return {\n editable: false,\n key: id,\n value: store._getters.reduce((getters, key) => {\n getters[key] = store[key];\n return getters;\n }, {}),\n };\n }),\n };\n return state;\n }\n const state = {\n state: Object.keys(store.$state).map((key) => ({\n editable: true,\n key,\n value: store.$state[key],\n })),\n };\n // avoid adding empty getters\n if (store._getters && store._getters.length) {\n state.getters = store._getters.map((getterName) => ({\n editable: false,\n key: getterName,\n value: store[getterName],\n }));\n }\n if (store._customProperties.size) {\n state.customProperties = Array.from(store._customProperties).map((key) => ({\n editable: true,\n key,\n value: store[key],\n }));\n }\n return state;\n}\nfunction formatEventData(events) {\n if (!events)\n return {};\n if (Array.isArray(events)) {\n // TODO: handle add and delete for arrays and objects\n return events.reduce((data, event) => {\n data.keys.push(event.key);\n data.operations.push(event.type);\n data.oldValue[event.key] = event.oldValue;\n data.newValue[event.key] = event.newValue;\n return data;\n }, {\n oldValue: {},\n keys: [],\n operations: [],\n newValue: {},\n });\n }\n else {\n return {\n operation: formatDisplay(events.type),\n key: formatDisplay(events.key),\n oldValue: events.oldValue,\n newValue: events.newValue,\n };\n }\n}\nfunction formatMutationType(type) {\n switch (type) {\n case MutationType.direct:\n return 'mutation';\n case MutationType.patchFunction:\n return '$patch';\n case MutationType.patchObject:\n return '$patch';\n default:\n return 'unknown';\n }\n}\n\n// timeline can be paused when directly changing the state\nlet isTimelineActive = true;\nconst componentStateTypes = [];\nconst MUTATIONS_LAYER_ID = 'pinia:mutations';\nconst INSPECTOR_ID = 'pinia';\nconst { assign: assign$1 } = Object;\n/**\n * Gets the displayed name of a store in devtools\n *\n * @param id - id of the store\n * @returns a formatted string\n */\nconst getStoreType = (id) => '🍍 ' + id;\n/**\n * Add the pinia plugin without any store. Allows displaying a Pinia plugin tab\n * as soon as it is added to the application.\n *\n * @param app - Vue application\n * @param pinia - pinia instance\n */\nfunction registerPiniaDevtools(app, pinia) {\n setupDevtoolsPlugin({\n id: 'dev.esm.pinia',\n label: 'Pinia 🍍',\n logo: 'https://pinia.vuejs.org/logo.svg',\n packageName: 'pinia',\n homepage: 'https://pinia.vuejs.org',\n componentStateTypes,\n app,\n }, (api) => {\n if (typeof api.now !== 'function') {\n toastMessage('You seem to be using an outdated version of Vue Devtools. Are you still using the Beta release instead of the stable one? You can find the links at https://devtools.vuejs.org/guide/installation.html.');\n }\n api.addTimelineLayer({\n id: MUTATIONS_LAYER_ID,\n label: `Pinia 🍍`,\n color: 0xe5df88,\n });\n api.addInspector({\n id: INSPECTOR_ID,\n label: 'Pinia 🍍',\n icon: 'storage',\n treeFilterPlaceholder: 'Search stores',\n actions: [\n {\n icon: 'content_copy',\n action: () => {\n actionGlobalCopyState(pinia);\n },\n tooltip: 'Serialize and copy the state',\n },\n {\n icon: 'content_paste',\n action: async () => {\n await actionGlobalPasteState(pinia);\n api.sendInspectorTree(INSPECTOR_ID);\n api.sendInspectorState(INSPECTOR_ID);\n },\n tooltip: 'Replace the state with the content of your clipboard',\n },\n {\n icon: 'save',\n action: () => {\n actionGlobalSaveState(pinia);\n },\n tooltip: 'Save the state as a JSON file',\n },\n {\n icon: 'folder_open',\n action: async () => {\n await actionGlobalOpenStateFile(pinia);\n api.sendInspectorTree(INSPECTOR_ID);\n api.sendInspectorState(INSPECTOR_ID);\n },\n tooltip: 'Import the state from a JSON file',\n },\n ],\n nodeActions: [\n {\n icon: 'restore',\n tooltip: 'Reset the state (with \"$reset\")',\n action: (nodeId) => {\n const store = pinia._s.get(nodeId);\n if (!store) {\n toastMessage(`Cannot reset \"${nodeId}\" store because it wasn't found.`, 'warn');\n }\n else if (typeof store.$reset !== 'function') {\n toastMessage(`Cannot reset \"${nodeId}\" store because it doesn't have a \"$reset\" method implemented.`, 'warn');\n }\n else {\n store.$reset();\n toastMessage(`Store \"${nodeId}\" reset.`);\n }\n },\n },\n ],\n });\n api.on.inspectComponent((payload) => {\n const proxy = (payload.componentInstance &&\n payload.componentInstance.proxy);\n if (proxy && proxy._pStores) {\n const piniaStores = payload.componentInstance.proxy._pStores;\n Object.values(piniaStores).forEach((store) => {\n payload.instanceData.state.push({\n type: getStoreType(store.$id),\n key: 'state',\n editable: true,\n value: store._isOptionsAPI\n ? {\n _custom: {\n value: toRaw(store.$state),\n actions: [\n {\n icon: 'restore',\n tooltip: 'Reset the state of this store',\n action: () => store.$reset(),\n },\n ],\n },\n }\n : // NOTE: workaround to unwrap transferred refs\n Object.keys(store.$state).reduce((state, key) => {\n state[key] = store.$state[key];\n return state;\n }, {}),\n });\n if (store._getters && store._getters.length) {\n payload.instanceData.state.push({\n type: getStoreType(store.$id),\n key: 'getters',\n editable: false,\n value: store._getters.reduce((getters, key) => {\n try {\n getters[key] = store[key];\n }\n catch (error) {\n // @ts-expect-error: we just want to show it in devtools\n getters[key] = error;\n }\n return getters;\n }, {}),\n });\n }\n });\n }\n });\n api.on.getInspectorTree((payload) => {\n if (payload.app === app && payload.inspectorId === INSPECTOR_ID) {\n let stores = [pinia];\n stores = stores.concat(Array.from(pinia._s.values()));\n payload.rootNodes = (payload.filter\n ? stores.filter((store) => '$id' in store\n ? store.$id\n .toLowerCase()\n .includes(payload.filter.toLowerCase())\n : PINIA_ROOT_LABEL.toLowerCase().includes(payload.filter.toLowerCase()))\n : stores).map(formatStoreForInspectorTree);\n }\n });\n // Expose pinia instance as $pinia to window\n globalThis.$pinia = pinia;\n api.on.getInspectorState((payload) => {\n if (payload.app === app && payload.inspectorId === INSPECTOR_ID) {\n const inspectedStore = payload.nodeId === PINIA_ROOT_ID\n ? pinia\n : pinia._s.get(payload.nodeId);\n if (!inspectedStore) {\n // this could be the selected store restored for a different project\n // so it's better not to say anything here\n return;\n }\n if (inspectedStore) {\n // Expose selected store as $store to window\n if (payload.nodeId !== PINIA_ROOT_ID)\n globalThis.$store = toRaw(inspectedStore);\n payload.state = formatStoreForInspectorState(inspectedStore);\n }\n }\n });\n api.on.editInspectorState((payload) => {\n if (payload.app === app && payload.inspectorId === INSPECTOR_ID) {\n const inspectedStore = payload.nodeId === PINIA_ROOT_ID\n ? pinia\n : pinia._s.get(payload.nodeId);\n if (!inspectedStore) {\n return toastMessage(`store \"${payload.nodeId}\" not found`, 'error');\n }\n const { path } = payload;\n if (!isPinia(inspectedStore)) {\n // access only the state\n if (path.length !== 1 ||\n !inspectedStore._customProperties.has(path[0]) ||\n path[0] in inspectedStore.$state) {\n path.unshift('$state');\n }\n }\n else {\n // Root access, we can omit the `.value` because the devtools API does it for us\n path.unshift('state');\n }\n isTimelineActive = false;\n payload.set(inspectedStore, path, payload.state.value);\n isTimelineActive = true;\n }\n });\n api.on.editComponentState((payload) => {\n if (payload.type.startsWith('🍍')) {\n const storeId = payload.type.replace(/^🍍\\s*/, '');\n const store = pinia._s.get(storeId);\n if (!store) {\n return toastMessage(`store \"${storeId}\" not found`, 'error');\n }\n const { path } = payload;\n if (path[0] !== 'state') {\n return toastMessage(`Invalid path for store \"${storeId}\":\\n${path}\\nOnly state can be modified.`);\n }\n // rewrite the first entry to be able to directly set the state as\n // well as any other path\n path[0] = '$state';\n isTimelineActive = false;\n payload.set(store, path, payload.state.value);\n isTimelineActive = true;\n }\n });\n });\n}\nfunction addStoreToDevtools(app, store) {\n if (!componentStateTypes.includes(getStoreType(store.$id))) {\n componentStateTypes.push(getStoreType(store.$id));\n }\n setupDevtoolsPlugin({\n id: 'dev.esm.pinia',\n label: 'Pinia 🍍',\n logo: 'https://pinia.vuejs.org/logo.svg',\n packageName: 'pinia',\n homepage: 'https://pinia.vuejs.org',\n componentStateTypes,\n app,\n settings: {\n logStoreChanges: {\n label: 'Notify about new/deleted stores',\n type: 'boolean',\n defaultValue: true,\n },\n // useEmojis: {\n // label: 'Use emojis in messages ⚡️',\n // type: 'boolean',\n // defaultValue: true,\n // },\n },\n }, (api) => {\n // gracefully handle errors\n const now = typeof api.now === 'function' ? api.now.bind(api) : Date.now;\n store.$onAction(({ after, onError, name, args }) => {\n const groupId = runningActionId++;\n api.addTimelineEvent({\n layerId: MUTATIONS_LAYER_ID,\n event: {\n time: now(),\n title: '🛫 ' + name,\n subtitle: 'start',\n data: {\n store: formatDisplay(store.$id),\n action: formatDisplay(name),\n args,\n },\n groupId,\n },\n });\n after((result) => {\n activeAction = undefined;\n api.addTimelineEvent({\n layerId: MUTATIONS_LAYER_ID,\n event: {\n time: now(),\n title: '🛬 ' + name,\n subtitle: 'end',\n data: {\n store: formatDisplay(store.$id),\n action: formatDisplay(name),\n args,\n result,\n },\n groupId,\n },\n });\n });\n onError((error) => {\n activeAction = undefined;\n api.addTimelineEvent({\n layerId: MUTATIONS_LAYER_ID,\n event: {\n time: now(),\n logType: 'error',\n title: '💥 ' + name,\n subtitle: 'end',\n data: {\n store: formatDisplay(store.$id),\n action: formatDisplay(name),\n args,\n error,\n },\n groupId,\n },\n });\n });\n }, true);\n store._customProperties.forEach((name) => {\n watch(() => unref(store[name]), (newValue, oldValue) => {\n api.notifyComponentUpdate();\n api.sendInspectorState(INSPECTOR_ID);\n if (isTimelineActive) {\n api.addTimelineEvent({\n layerId: MUTATIONS_LAYER_ID,\n event: {\n time: now(),\n title: 'Change',\n subtitle: name,\n data: {\n newValue,\n oldValue,\n },\n groupId: activeAction,\n },\n });\n }\n }, { deep: true });\n });\n store.$subscribe(({ events, type }, state) => {\n api.notifyComponentUpdate();\n api.sendInspectorState(INSPECTOR_ID);\n if (!isTimelineActive)\n return;\n // rootStore.state[store.id] = state\n const eventData = {\n time: now(),\n title: formatMutationType(type),\n data: assign$1({ store: formatDisplay(store.$id) }, formatEventData(events)),\n groupId: activeAction,\n };\n if (type === MutationType.patchFunction) {\n eventData.subtitle = '⤵️';\n }\n else if (type === MutationType.patchObject) {\n eventData.subtitle = '🧩';\n }\n else if (events && !Array.isArray(events)) {\n eventData.subtitle = events.type;\n }\n if (events) {\n eventData.data['rawEvent(s)'] = {\n _custom: {\n display: 'DebuggerEvent',\n type: 'object',\n tooltip: 'raw DebuggerEvent[]',\n value: events,\n },\n };\n }\n api.addTimelineEvent({\n layerId: MUTATIONS_LAYER_ID,\n event: eventData,\n });\n }, { detached: true, flush: 'sync' });\n const hotUpdate = store._hotUpdate;\n store._hotUpdate = markRaw((newStore) => {\n hotUpdate(newStore);\n api.addTimelineEvent({\n layerId: MUTATIONS_LAYER_ID,\n event: {\n time: now(),\n title: '🔥 ' + store.$id,\n subtitle: 'HMR update',\n data: {\n store: formatDisplay(store.$id),\n info: formatDisplay(`HMR update`),\n },\n },\n });\n // update the devtools too\n api.notifyComponentUpdate();\n api.sendInspectorTree(INSPECTOR_ID);\n api.sendInspectorState(INSPECTOR_ID);\n });\n const { $dispose } = store;\n store.$dispose = () => {\n $dispose();\n api.notifyComponentUpdate();\n api.sendInspectorTree(INSPECTOR_ID);\n api.sendInspectorState(INSPECTOR_ID);\n api.getSettings().logStoreChanges &&\n toastMessage(`Disposed \"${store.$id}\" store 🗑`);\n };\n // trigger an update so it can display new registered stores\n api.notifyComponentUpdate();\n api.sendInspectorTree(INSPECTOR_ID);\n api.sendInspectorState(INSPECTOR_ID);\n api.getSettings().logStoreChanges &&\n toastMessage(`\"${store.$id}\" store installed 🆕`);\n });\n}\nlet runningActionId = 0;\nlet activeAction;\n/**\n * Patches a store to enable action grouping in devtools by wrapping the store with a Proxy that is passed as the\n * context of all actions, allowing us to set `runningAction` on each access and effectively associating any state\n * mutation to the action.\n *\n * @param store - store to patch\n * @param actionNames - list of actionst to patch\n */\nfunction patchActionForGrouping(store, actionNames, wrapWithProxy) {\n // original actions of the store as they are given by pinia. We are going to override them\n const actions = actionNames.reduce((storeActions, actionName) => {\n // use toRaw to avoid tracking #541\n storeActions[actionName] = toRaw(store)[actionName];\n return storeActions;\n }, {});\n for (const actionName in actions) {\n store[actionName] = function () {\n // the running action id is incremented in a before action hook\n const _actionId = runningActionId;\n const trackedStore = wrapWithProxy\n ? new Proxy(store, {\n get(...args) {\n activeAction = _actionId;\n return Reflect.get(...args);\n },\n set(...args) {\n activeAction = _actionId;\n return Reflect.set(...args);\n },\n })\n : store;\n // For Setup Stores we need https://github.com/tc39/proposal-async-context\n activeAction = _actionId;\n const retValue = actions[actionName].apply(trackedStore, arguments);\n // this is safer as async actions in Setup Stores would associate mutations done outside of the action\n activeAction = undefined;\n return retValue;\n };\n }\n}\n/**\n * pinia.use(devtoolsPlugin)\n */\nfunction devtoolsPlugin({ app, store, options }) {\n // HMR module\n if (store.$id.startsWith('__hot:')) {\n return;\n }\n // detect option api vs setup api\n store._isOptionsAPI = !!options.state;\n // Do not overwrite actions mocked by @pinia/testing (#2298)\n if (!store._p._testing) {\n patchActionForGrouping(store, Object.keys(options.actions), store._isOptionsAPI);\n // Upgrade the HMR to also update the new actions\n const originalHotUpdate = store._hotUpdate;\n toRaw(store)._hotUpdate = function (newStore) {\n originalHotUpdate.apply(this, arguments);\n patchActionForGrouping(store, Object.keys(newStore._hmrPayload.actions), !!store._isOptionsAPI);\n };\n }\n addStoreToDevtools(app, \n // FIXME: is there a way to allow the assignment from Store<Id, S, G, A> to StoreGeneric?\n store);\n}\n\n/**\n * Creates a Pinia instance to be used by the application\n */\nfunction createPinia() {\n const scope = effectScope(true);\n // NOTE: here we could check the window object for a state and directly set it\n // if there is anything like it with Vue 3 SSR\n const state = scope.run(() => ref({}));\n let _p = [];\n // plugins added before calling app.use(pinia)\n let toBeInstalled = [];\n const pinia = markRaw({\n install(app) {\n // this allows calling useStore() outside of a component setup after\n // installing pinia's plugin\n setActivePinia(pinia);\n pinia._a = app;\n app.provide(piniaSymbol, pinia);\n app.config.globalProperties.$pinia = pinia;\n /* istanbul ignore else */\n if ((((process.env.NODE_ENV !== 'production') || (typeof __VUE_PROD_DEVTOOLS__ !== 'undefined' && __VUE_PROD_DEVTOOLS__)) && !(process.env.NODE_ENV === 'test')) && IS_CLIENT) {\n registerPiniaDevtools(app, pinia);\n }\n toBeInstalled.forEach((plugin) => _p.push(plugin));\n toBeInstalled = [];\n },\n use(plugin) {\n if (!this._a) {\n toBeInstalled.push(plugin);\n }\n else {\n _p.push(plugin);\n }\n return this;\n },\n _p,\n // it's actually undefined here\n // @ts-expect-error\n _a: null,\n _e: scope,\n _s: new Map(),\n state,\n });\n // pinia devtools rely on dev only features so they cannot be forced unless\n // the dev build of Vue is used. Avoid old browsers like IE11.\n if ((((process.env.NODE_ENV !== 'production') || (typeof __VUE_PROD_DEVTOOLS__ !== 'undefined' && __VUE_PROD_DEVTOOLS__)) && !(process.env.NODE_ENV === 'test')) && IS_CLIENT && typeof Proxy !== 'undefined') {\n pinia.use(devtoolsPlugin);\n }\n return pinia;\n}\n/**\n * Dispose a Pinia instance by stopping its effectScope and removing the state, plugins and stores. This is mostly\n * useful in tests, with both a testing pinia or a regular pinia and in applications that use multiple pinia instances.\n * Once disposed, the pinia instance cannot be used anymore.\n *\n * @param pinia - pinia instance\n */\nfunction disposePinia(pinia) {\n pinia._e.stop();\n pinia._s.clear();\n pinia._p.splice(0);\n pinia.state.value = {};\n // @ts-expect-error: non valid\n pinia._a = null;\n}\n\n/**\n * Checks if a function is a `StoreDefinition`.\n *\n * @param fn - object to test\n * @returns true if `fn` is a StoreDefinition\n */\nconst isUseStore = (fn) => {\n return typeof fn === 'function' && typeof fn.$id === 'string';\n};\n/**\n * Mutates in place `newState` with `oldState` to _hot update_ it. It will\n * remove any key not existing in `newState` and recursively merge plain\n * objects.\n *\n * @param newState - new state object to be patched\n * @param oldState - old state that should be used to patch newState\n * @returns - newState\n */\nfunction patchObject(newState, oldState) {\n // no need to go through symbols because they cannot be serialized anyway\n for (const key in oldState) {\n const subPatch = oldState[key];\n // skip the whole sub tree\n if (!(key in newState)) {\n continue;\n }\n const targetValue = newState[key];\n if (isPlainObject(targetValue) &&\n isPlainObject(subPatch) &&\n !isRef(subPatch) &&\n !isReactive(subPatch)) {\n newState[key] = patchObject(targetValue, subPatch);\n }\n else {\n // objects are either a bit more complex (e.g. refs) or primitives, so we\n // just set the whole thing\n newState[key] = subPatch;\n }\n }\n return newState;\n}\n/**\n * Creates an _accept_ function to pass to `import.meta.hot` in Vite applications.\n *\n * @example\n * ```js\n * const useUser = defineStore(...)\n * if (import.meta.hot) {\n * import.meta.hot.accept(acceptHMRUpdate(useUser, import.meta.hot))\n * }\n * ```\n *\n * @param initialUseStore - return of the defineStore to hot update\n * @param hot - `import.meta.hot`\n */\nfunction acceptHMRUpdate(initialUseStore, hot) {\n // strip as much as possible from iife.prod\n if (!(process.env.NODE_ENV !== 'production')) {\n return () => { };\n }\n return (newModule) => {\n const pinia = hot.data.pinia || initialUseStore._pinia;\n if (!pinia) {\n // this store is still not used\n return;\n }\n // preserve the pinia instance across loads\n hot.data.pinia = pinia;\n // console.log('got data', newStore)\n for (const exportName in newModule) {\n const useStore = newModule[exportName];\n // console.log('checking for', exportName)\n if (isUseStore(useStore) && pinia._s.has(useStore.$id)) {\n // console.log('Accepting update for', useStore.$id)\n const id = useStore.$id;\n if (id !== initialUseStore.$id) {\n console.warn(`The id of the store changed from \"${initialUseStore.$id}\" to \"${id}\". Reloading.`);\n // return import.meta.hot.invalidate()\n return hot.invalidate();\n }\n const existingStore = pinia._s.get(id);\n if (!existingStore) {\n console.log(`[Pinia]: skipping hmr because store doesn't exist yet`);\n return;\n }\n useStore(pinia, existingStore);\n }\n }\n };\n}\n\nconst noop = () => { };\nfunction addSubscription(subscriptions, callback, detached, onCleanup = noop) {\n subscriptions.push(callback);\n const removeSubscription = () => {\n const idx = subscriptions.indexOf(callback);\n if (idx > -1) {\n subscriptions.splice(idx, 1);\n onCleanup();\n }\n };\n if (!detached && getCurrentScope()) {\n onScopeDispose(removeSubscription);\n }\n return removeSubscription;\n}\nfunction triggerSubscriptions(subscriptions, ...args) {\n subscriptions.slice().forEach((callback) => {\n callback(...args);\n });\n}\n\nconst fallbackRunWithContext = (fn) => fn();\n/**\n * Marks a function as an action for `$onAction`\n * @internal\n */\nconst ACTION_MARKER = Symbol();\n/**\n * Action name symbol. Allows to add a name to an action after defining it\n * @internal\n */\nconst ACTION_NAME = Symbol();\nfunction mergeReactiveObjects(target, patchToApply) {\n // Handle Map instances\n if (target instanceof Map && patchToApply instanceof Map) {\n patchToApply.forEach((value, key) => target.set(key, value));\n }\n else if (target instanceof Set && patchToApply instanceof Set) {\n // Handle Set instances\n patchToApply.forEach(target.add, target);\n }\n // no need to go through symbols because they cannot be serialized anyway\n for (const key in patchToApply) {\n if (!patchToApply.hasOwnProperty(key))\n continue;\n const subPatch = patchToApply[key];\n const targetValue = target[key];\n if (isPlainObject(targetValue) &&\n isPlainObject(subPatch) &&\n target.hasOwnProperty(key) &&\n !isRef(subPatch) &&\n !isReactive(subPatch)) {\n // NOTE: here I wanted to warn about inconsistent types but it's not possible because in setup stores one might\n // start the value of a property as a certain type e.g. a Map, and then for some reason, during SSR, change that\n // to `undefined`. When trying to hydrate, we want to override the Map with `undefined`.\n target[key] = mergeReactiveObjects(targetValue, subPatch);\n }\n else {\n // @ts-expect-error: subPatch is a valid value\n target[key] = subPatch;\n }\n }\n return target;\n}\nconst skipHydrateSymbol = (process.env.NODE_ENV !== 'production')\n ? Symbol('pinia:skipHydration')\n : /* istanbul ignore next */ Symbol();\n/**\n * Tells Pinia to skip the hydration process of a given object. This is useful in setup stores (only) when you return a\n * stateful object in the store but it isn't really state. e.g. returning a router instance in a setup store.\n *\n * @param obj - target object\n * @returns obj\n */\nfunction skipHydrate(obj) {\n return Object.defineProperty(obj, skipHydrateSymbol, {});\n}\n/**\n * Returns whether a value should be hydrated\n *\n * @param obj - target variable\n * @returns true if `obj` should be hydrated\n */\nfunction shouldHydrate(obj) {\n return (!isPlainObject(obj) ||\n !Object.prototype.hasOwnProperty.call(obj, skipHydrateSymbol));\n}\nconst { assign } = Object;\nfunction isComputed(o) {\n return !!(isRef(o) && o.effect);\n}\nfunction createOptionsStore(id, options, pinia, hot) {\n const { state, actions, getters } = options;\n const initialState = pinia.state.value[id];\n let store;\n function setup() {\n if (!initialState && (!(process.env.NODE_ENV !== 'production') || !hot)) {\n /* istanbul ignore if */\n pinia.state.value[id] = state ? state() : {};\n }\n // avoid creating a state in pinia.state.value\n const localState = (process.env.NODE_ENV !== 'production') && hot\n ? // use ref() to unwrap refs inside state TODO: check if this is still necessary\n toRefs(ref(state ? state() : {}).value)\n : toRefs(pinia.state.value[id]);\n return assign(localState, actions, Object.keys(getters || {}).reduce((computedGetters, name) => {\n if ((process.env.NODE_ENV !== 'production') && name in localState) {\n console.warn(`[🍍]: A getter cannot have the same name as another state property. Rename one of them. Found with \"${name}\" in store \"${id}\".`);\n }\n computedGetters[name] = markRaw(computed(() => {\n setActivePinia(pinia);\n // it was created just before\n const store = pinia._s.get(id);\n // allow cross using stores\n // @ts-expect-error\n // return getters![name].call(context, context)\n // TODO: avoid reading the getter while assigning with a global variable\n return getters[name].call(store, store);\n }));\n return computedGetters;\n }, {}));\n }\n store = createSetupStore(id, setup, options, pinia, hot, true);\n return store;\n}\nfunction createSetupStore($id, setup, options = {}, pinia, hot, isOptionsStore) {\n let scope;\n const optionsForPlugin = assign({ actions: {} }, options);\n /* istanbul ignore if */\n if ((process.env.NODE_ENV !== 'production') && !pinia._e.active) {\n throw new Error('Pinia destroyed');\n }\n // watcher options for $subscribe\n const $subscribeOptions = { deep: true };\n /* istanbul ignore else */\n if ((process.env.NODE_ENV !== 'production')) {\n $subscribeOptions.onTrigger = (event) => {\n /* istanbul ignore else */\n if (isListening) {\n debuggerEvents = event;\n // avoid triggering this while the store is being built and the state is being set in pinia\n }\n else if (isListening == false && !store._hotUpdating) {\n // let patch send all the events together later\n /* istanbul ignore else */\n if (Array.isArray(debuggerEvents)) {\n debuggerEvents.push(event);\n }\n else {\n console.error('🍍 debuggerEvents should be an array. This is most likely an internal Pinia bug.');\n }\n }\n };\n }\n // internal state\n let isListening; // set to true at the end\n let isSyncListening; // set to true at the end\n let subscriptions = [];\n let actionSubscriptions = [];\n let debuggerEvents;\n const initialState = pinia.state.value[$id];\n // avoid setting the state for option stores if it is set\n // by the setup\n if (!isOptionsStore && !initialState && (!(process.env.NODE_ENV !== 'production') || !hot)) {\n /* istanbul ignore if */\n pinia.state.value[$id] = {};\n }\n const hotState = ref({});\n // avoid triggering too many listeners\n // https://github.com/vuejs/pinia/issues/1129\n let activeListener;\n function $patch(partialStateOrMutator) {\n let subscriptionMutation;\n isListening = isSyncListening = false;\n // reset the debugger events since patches are sync\n /* istanbul ignore else */\n if ((process.env.NODE_ENV !== 'production')) {\n debuggerEvents = [];\n }\n if (typeof partialStateOrMutator === 'function') {\n partialStateOrMutator(pinia.state.value[$id]);\n subscriptionMutation = {\n type: MutationType.patchFunction,\n storeId: $id,\n events: debuggerEvents,\n };\n }\n else {\n mergeReactiveObjects(pinia.state.value[$id], partialStateOrMutator);\n subscriptionMutation = {\n type: MutationType.patchObject,\n payload: partialStateOrMutator,\n storeId: $id,\n events: debuggerEvents,\n };\n }\n const myListenerId = (activeListener = Symbol());\n nextTick().then(() => {\n if (activeListener === myListenerId) {\n isListening = true;\n }\n });\n isSyncListening = true;\n // because we paused the watcher, we need to manually call the subscriptions\n triggerSubscriptions(subscriptions, subscriptionMutation, pinia.state.value[$id]);\n }\n const $reset = isOptionsStore\n ? function $reset() {\n const { state } = options;\n const newState = state ? state() : {};\n // we use a patch to group all changes into one single subscription\n this.$patch(($state) => {\n // @ts-expect-error: FIXME: shouldn't error?\n assign($state, newState);\n });\n }\n : /* istanbul ignore next */\n (process.env.NODE_ENV !== 'production')\n ? () => {\n throw new Error(`🍍: Store \"${$id}\" is built using the setup syntax and does not implement $reset().`);\n }\n : noop;\n function $dispose() {\n scope.stop();\n subscriptions = [];\n actionSubscriptions = [];\n pinia._s.delete($id);\n }\n /**\n * Helper that wraps function so it can be tracked with $onAction\n * @param fn - action to wrap\n * @param name - name of the action\n */\n const action = (fn, name = '') => {\n if (ACTION_MARKER in fn) {\n fn[ACTION_NAME] = name;\n return fn;\n }\n const wrappedAction = function () {\n setActivePinia(pinia);\n const args = Array.from(arguments);\n const afterCallbackList = [];\n const onErrorCallbackList = [];\n function after(callback) {\n afterCallbackList.push(callback);\n }\n function onError(callback) {\n onErrorCallbackList.push(callback);\n }\n // @ts-expect-error\n triggerSubscriptions(actionSubscriptions, {\n args,\n name: wrappedAction[ACTION_NAME],\n store,\n after,\n onError,\n });\n let ret;\n try {\n ret = fn.apply(this && this.$id === $id ? this : store, args);\n // handle sync errors\n }\n catch (error) {\n triggerSubscriptions(onErrorCallbackList, error);\n throw error;\n }\n if (ret instanceof Promise) {\n return ret\n .then((value) => {\n triggerSubscriptions(afterCallbackList, value);\n return value;\n })\n .catch((error) => {\n triggerSubscriptions(onErrorCallbackList, error);\n return Promise.reject(error);\n });\n }\n // trigger after callbacks\n triggerSubscriptions(afterCallbackList, ret);\n return ret;\n };\n wrappedAction[ACTION_MARKER] = true;\n wrappedAction[ACTION_NAME] = name; // will be set later\n // @ts-expect-error: we are intentionally limiting the returned type to just Fn\n // because all the added properties are internals that are exposed through `$onAction()` only\n return wrappedAction;\n };\n const _hmrPayload = /*#__PURE__*/ markRaw({\n actions: {},\n getters: {},\n state: [],\n hotState,\n });\n const partialStore = {\n _p: pinia,\n // _s: scope,\n $id,\n $onAction: addSubscription.bind(null, actionSubscriptions),\n $patch,\n $reset,\n $subscribe(callback, options = {}) {\n const removeSubscription = addSubscription(subscriptions, callback, options.detached, () => stopWatcher());\n const stopWatcher = scope.run(() => watch(() => pinia.state.value[$id], (state) => {\n if (options.flush === 'sync' ? isSyncListening : isListening) {\n callback({\n storeId: $id,\n type: MutationType.direct,\n events: debuggerEvents,\n }, state);\n }\n }, assign({}, $subscribeOptions, options)));\n return removeSubscription;\n },\n $dispose,\n };\n const store = reactive((process.env.NODE_ENV !== 'production') || ((((process.env.NODE_ENV !== 'production') || (typeof __VUE_PROD_DEVTOOLS__ !== 'undefined' && __VUE_PROD_DEVTOOLS__)) && !(process.env.NODE_ENV === 'test')) && IS_CLIENT)\n ? assign({\n _hmrPayload,\n _customProperties: markRaw(new Set()), // devtools custom properties\n }, partialStore\n // must be added later\n // setupStore\n )\n : partialStore);\n // store the partial store now so the setup of stores can instantiate each other before they are finished without\n // creating infinite loops.\n pinia._s.set($id, store);\n const runWithContext = (pinia._a && pinia._a.runWithContext) || fallbackRunWithContext;\n // TODO: idea create skipSerialize that marks properties as non serializable and they are skipped\n const setupStore = runWithContext(() => pinia._e.run(() => (scope = effectScope()).run(() => setup({ action }))));\n // overwrite existing actions to support $onAction\n for (const key in setupStore) {\n const prop = setupStore[key];\n if ((isRef(prop) && !isComputed(prop)) || isReactive(prop)) {\n // mark it as a piece of state to be serialized\n if ((process.env.NODE_ENV !== 'production') && hot) {\n hotState.value[key] = toRef(setupStore, key);\n // createOptionStore directly sets the state in pinia.state.value so we\n // can just skip that\n }\n else if (!isOptionsStore) {\n // in setup stores we must hydrate the state and sync pinia state tree with the refs the user just created\n if (initialState && shouldHydrate(prop)) {\n if (isRef(prop)) {\n prop.value = initialState[key];\n }\n else {\n // probably a reactive object, lets recursively assign\n // @ts-expect-error: prop is unknown\n mergeReactiveObjects(prop, initialState[key]);\n }\n }\n // transfer the ref to the pinia state to keep everything in sync\n pinia.state.value[$id][key] = prop;\n }\n /* istanbul ignore else */\n if ((process.env.NODE_ENV !== 'production')) {\n _hmrPayload.state.push(key);\n }\n // action\n }\n else if (typeof prop === 'function') {\n const actionValue = (process.env.NODE_ENV !== 'production') && hot ? prop : action(prop, key);\n // this a hot module replacement store because the hotUpdate method needs\n // to do it with the right context\n // @ts-expect-error\n setupStore[key] = actionValue;\n /* istanbul ignore else */\n if ((process.env.NODE_ENV !== 'production')) {\n _hmrPayload.actions[key] = prop;\n }\n // list actions so they can be used in plugins\n // @ts-expect-error\n optionsForPlugin.actions[key] = prop;\n }\n else if ((process.env.NODE_ENV !== 'production')) {\n // add getters for devtools\n if (isComputed(prop)) {\n _hmrPayload.getters[key] = isOptionsStore\n ? // @ts-expect-error\n options.getters[key]\n : prop;\n if (IS_CLIENT) {\n const getters = setupStore._getters ||\n // @ts-expect-error: same\n (setupStore._getters = markRaw([]));\n getters.push(key);\n }\n }\n }\n }\n // add the state, getters, and action properties\n /* istanbul ignore if */\n assign(store, setupStore);\n // allows retrieving reactive objects with `storeToRefs()`. Must be called after assigning to the reactive object.\n // Make `storeToRefs()` work with `reactive()` #799\n assign(toRaw(store), setupStore);\n // use this instead of a computed with setter to be able to create it anywhere\n // without linking the computed lifespan to wherever the store is first\n // created.\n Object.defineProperty(store, '$state', {\n get: () => ((process.env.NODE_ENV !== 'production') && hot ? hotState.value : pinia.state.value[$id]),\n set: (state) => {\n /* istanbul ignore if */\n if ((process.env.NODE_ENV !== 'production') && hot) {\n throw new Error('cannot set hotState');\n }\n $patch(($state) => {\n // @ts-expect-error: FIXME: shouldn't error?\n assign($state, state);\n });\n },\n });\n // add the hotUpdate before plugins to allow them to override it\n /* istanbul ignore else */\n if ((process.env.NODE_ENV !== 'production')) {\n store._hotUpdate = markRaw((newStore) => {\n store._hotUpdating = true;\n newStore._hmrPayload.state.forEach((stateKey) => {\n if (stateKey in store.$state) {\n const newStateTarget = newStore.$state[stateKey];\n const oldStateSource = store.$state[stateKey];\n if (typeof newStateTarget === 'object' &&\n isPlainObject(newStateTarget) &&\n isPlainObject(oldStateSource)) {\n patchObject(newStateTarget, oldStateSource);\n }\n else {\n // transfer the ref\n newStore.$state[stateKey] = oldStateSource;\n }\n }\n // patch direct access properties to allow store.stateProperty to work as\n // store.$state.stateProperty\n // @ts-expect-error: any type\n store[stateKey] = toRef(newStore.$state, stateKey);\n });\n // remove deleted state properties\n Object.keys(store.$state).forEach((stateKey) => {\n if (!(stateKey in newStore.$state)) {\n // @ts-expect-error: noop if doesn't exist\n delete store[stateKey];\n }\n });\n // avoid devtools logging this as a mutation\n isListening = false;\n isSyncListening = false;\n pinia.state.value[$id] = toRef(newStore._hmrPayload, 'hotState');\n isSyncListening = true;\n nextTick().then(() => {\n isListening = true;\n });\n for (const actionName in newStore._hmrPayload.actions) {\n const actionFn = newStore[actionName];\n // @ts-expect-error: actionName is a string\n store[actionName] =\n //\n action(actionFn, actionName);\n }\n // TODO: does this work in both setup and option store?\n for (const getterName in newStore._hmrPayload.getters) {\n const getter = newStore._hmrPayload.getters[getterName];\n const getterValue = isOptionsStore\n ? // special handling of options api\n computed(() => {\n setActivePinia(pinia);\n return getter.call(store, store);\n })\n : getter;\n // @ts-expect-error: getterName is a string\n store[getterName] =\n //\n getterValue;\n }\n // remove deleted getters\n Object.keys(store._hmrPayload.getters).forEach((key) => {\n if (!(key in newStore._hmrPayload.getters)) {\n // @ts-expect-error: noop if doesn't exist\n delete store[key];\n }\n });\n // remove old actions\n Object.keys(store._hmrPayload.actions).forEach((key) => {\n if (!(key in newStore._hmrPayload.actions)) {\n // @ts-expect-error: noop if doesn't exist\n delete store[key];\n }\n });\n // update the values used in devtools and to allow deleting new properties later on\n store._hmrPayload = newStore._hmrPayload;\n store._getters = newStore._getters;\n store._hotUpdating = false;\n });\n }\n if ((((process.env.NODE_ENV !== 'production') || (typeof __VUE_PROD_DEVTOOLS__ !== 'undefined' && __VUE_PROD_DEVTOOLS__)) && !(process.env.NODE_ENV === 'test')) && IS_CLIENT) {\n const nonEnumerable = {\n writable: true,\n configurable: true,\n // avoid warning on devtools trying to display this property\n enumerable: false,\n };\n ['_p', '_hmrPayload', '_getters', '_customProperties'].forEach((p) => {\n Object.defineProperty(store, p, assign({ value: store[p] }, nonEnumerable));\n });\n }\n // apply all plugins\n pinia._p.forEach((extender) => {\n /* istanbul ignore else */\n if ((((process.env.NODE_ENV !== 'production') || (typeof __VUE_PROD_DEVTOOLS__ !== 'undefined' && __VUE_PROD_DEVTOOLS__)) && !(process.env.NODE_ENV === 'test')) && IS_CLIENT) {\n const extensions = scope.run(() => extender({\n store: store,\n app: pinia._a,\n pinia,\n options: optionsForPlugin,\n }));\n Object.keys(extensions || {}).forEach((key) => store._customProperties.add(key));\n assign(store, extensions);\n }\n else {\n assign(store, scope.run(() => extender({\n store: store,\n app: pinia._a,\n pinia,\n options: optionsForPlugin,\n })));\n }\n });\n if ((process.env.NODE_ENV !== 'production') &&\n store.$state &&\n typeof store.$state === 'object' &&\n typeof store.$state.constructor === 'function' &&\n !store.$state.constructor.toString().includes('[native code]')) {\n console.warn(`[🍍]: The \"state\" must be a plain object. It cannot be\\n` +\n `\\tstate: () => new MyClass()\\n` +\n `Found in store \"${store.$id}\".`);\n }\n // only apply hydrate to option stores with an initial state in pinia\n if (initialState &&\n isOptionsStore &&\n options.hydrate) {\n options.hydrate(store.$state, initialState);\n }\n isListening = true;\n isSyncListening = true;\n return store;\n}\n// allows unused stores to be tree shaken\n/*! #__NO_SIDE_EFFECTS__ */\nfunction defineStore(\n// TODO: add proper types from above\nid, setup, setupOptions) {\n let options;\n const isSetupStore = typeof setup === 'function';\n // the option store setup will contain the actual options in this case\n options = isSetupStore ? setupOptions : setup;\n function useStore(pinia, hot) {\n const hasContext = hasInjectionContext();\n pinia =\n // in test mode, ignore the argument provided as we can always retrieve a\n // pinia instance with getActivePinia()\n ((process.env.NODE_ENV === 'test') && activePinia && activePinia._testing ? null : pinia) ||\n (hasContext ? inject(piniaSymbol, null) : null);\n if (pinia)\n setActivePinia(pinia);\n if ((process.env.NODE_ENV !== 'production') && !activePinia) {\n throw new Error(`[🍍]: \"getActivePinia()\" was called but there was no active Pinia. Are you trying to use a store before calling \"app.use(pinia)\"?\\n` +\n `See https://pinia.vuejs.org/core-concepts/outside-component-usage.html for help.\\n` +\n `This will fail in production.`);\n }\n pinia = activePinia;\n if (!pinia._s.has(id)) {\n // creating the store registers it in `pinia._s`\n if (isSetupStore) {\n createSetupStore(id, setup, options, pinia);\n }\n else {\n createOptionsStore(id, options, pinia);\n }\n /* istanbul ignore else */\n if ((process.env.NODE_ENV !== 'production')) {\n // @ts-expect-error: not the right inferred type\n useStore._pinia = pinia;\n }\n }\n const store = pinia._s.get(id);\n if ((process.env.NODE_ENV !== 'production') && hot) {\n const hotId = '__hot:' + id;\n const newStore = isSetupStore\n ? createSetupStore(hotId, setup, options, pinia, true)\n : createOptionsStore(hotId, assign({}, options), pinia, true);\n hot._hotUpdate(newStore);\n // cleanup the state properties and the store from the cache\n delete pinia.state.value[hotId];\n pinia._s.delete(hotId);\n }\n if ((process.env.NODE_ENV !== 'production') && IS_CLIENT) {\n const currentInstance = getCurrentInstance();\n // save stores in instances to access them devtools\n if (currentInstance &&\n currentInstance.proxy &&\n // avoid adding stores that are just built for hot module replacement\n !hot) {\n const vm = currentInstance.proxy;\n const cache = '_pStores' in vm ? vm._pStores : (vm._pStores = {});\n cache[id] = store;\n }\n }\n // StoreGeneric cannot be casted towards Store\n return store;\n }\n useStore.$id = id;\n return useStore;\n}\n\nlet mapStoreSuffix = 'Store';\n/**\n * Changes the suffix added by `mapStores()`. Can be set to an empty string.\n * Defaults to `\"Store\"`. Make sure to extend the MapStoresCustomization\n * interface if you are using TypeScript.\n *\n * @param suffix - new suffix\n */\nfunction setMapStoreSuffix(suffix // could be 'Store' but that would be annoying for JS\n) {\n mapStoreSuffix = suffix;\n}\n/**\n * Allows using stores without the composition API (`setup()`) by generating an\n * object to be spread in the `computed` field of a component. It accepts a list\n * of store definitions.\n *\n * @example\n * ```js\n * export default {\n * computed: {\n * // other computed properties\n * ...mapStores(useUserStore, useCartStore)\n * },\n *\n * created() {\n * this.userStore // store with id \"user\"\n * this.cartStore // store with id \"cart\"\n * }\n * }\n * ```\n *\n * @param stores - list of stores to map to an object\n */\nfunction mapStores(...stores) {\n if ((process.env.NODE_ENV !== 'production') && Array.isArray(stores[0])) {\n console.warn(`[🍍]: Directly pass all stores to \"mapStores()\" without putting them in an array:\\n` +\n `Replace\\n` +\n `\\tmapStores([useAuthStore, useCartStore])\\n` +\n `with\\n` +\n `\\tmapStores(useAuthStore, useCartStore)\\n` +\n `This will fail in production if not fixed.`);\n stores = stores[0];\n }\n return stores.reduce((reduced, useStore) => {\n // @ts-expect-error: $id is added by defineStore\n reduced[useStore.$id + mapStoreSuffix] = function () {\n return useStore(this.$pinia);\n };\n return reduced;\n }, {});\n}\n/**\n * Allows using state and getters from one store without using the composition\n * API (`setup()`) by generating an object to be spread in the `computed` field\n * of a component.\n *\n * @param useStore - store to map from\n * @param keysOrMapper - array or object\n */\nfunction mapState(useStore, keysOrMapper) {\n return Array.isArray(keysOrMapper)\n ? keysOrMapper.reduce((reduced, key) => {\n reduced[key] = function () {\n // @ts-expect-error: FIXME: should work?\n return useStore(this.$pinia)[key];\n };\n return reduced;\n }, {})\n : Object.keys(keysOrMapper).reduce((reduced, key) => {\n // @ts-expect-error\n reduced[key] = function () {\n const store = useStore(this.$pinia);\n const storeKey = keysOrMapper[key];\n // for some reason TS is unable to infer the type of storeKey to be a\n // function\n return typeof storeKey === 'function'\n ? storeKey.call(this, store)\n : // @ts-expect-error: FIXME: should work?\n store[storeKey];\n };\n return reduced;\n }, {});\n}\n/**\n * Alias for `mapState()`. You should use `mapState()` instead.\n * @deprecated use `mapState()` instead.\n */\nconst mapGetters = mapState;\n/**\n * Allows directly using actions from your store without using the composition\n * API (`setup()`) by generating an object to be spread in the `methods` field\n * of a component.\n *\n * @param useStore - store to map from\n * @param keysOrMapper - array or object\n */\nfunction mapActions(useStore, keysOrMapper) {\n return Array.isArray(keysOrMapper)\n ? keysOrMapper.reduce((reduced, key) => {\n // @ts-expect-error\n reduced[key] = function (...args) {\n // @ts-expect-error: FIXME: should work?\n return useStore(this.$pinia)[key](...args);\n };\n return reduced;\n }, {})\n : Object.keys(keysOrMapper).reduce((reduced, key) => {\n // @ts-expect-error\n reduced[key] = function (...args) {\n // @ts-expect-error: FIXME: should work?\n return useStore(this.$pinia)[keysOrMapper[key]](...args);\n };\n return reduced;\n }, {});\n}\n/**\n * Allows using state and getters from one store without using the composition\n * API (`setup()`) by generating an object to be spread in the `computed` field\n * of a component.\n *\n * @param useStore - store to map from\n * @param keysOrMapper - array or object\n */\nfunction mapWritableState(useStore, keysOrMapper) {\n return Array.isArray(keysOrMapper)\n ? keysOrMapper.reduce((reduced, key) => {\n reduced[key] = {\n get() {\n return useStore(this.$pinia)[key];\n },\n set(value) {\n return (useStore(this.$pinia)[key] = value);\n },\n };\n return reduced;\n }, {})\n : Object.keys(keysOrMapper).reduce((reduced, key) => {\n reduced[key] = {\n get() {\n return useStore(this.$pinia)[keysOrMapper[key]];\n },\n set(value) {\n return (useStore(this.$pinia)[keysOrMapper[key]] = value);\n },\n };\n return reduced;\n }, {});\n}\n\n/**\n * Creates an object of references with all the state, getters, and plugin-added\n * state properties of the store. Similar to `toRefs()` but specifically\n * designed for Pinia stores so methods and non reactive properties are\n * completely ignored.\n *\n * @param store - store to extract the refs from\n */\nfunction storeToRefs(store) {\n const rawStore = toRaw(store);\n const refs = {};\n for (const key in rawStore) {\n const value = rawStore[key];\n // There is no native method to check for a computed\n // https://github.com/vuejs/core/pull/4165\n if (value.effect) {\n // @ts-expect-error: too hard to type correctly\n refs[key] =\n // ...\n computed({\n get: () => store[key],\n set(value) {\n store[key] = value;\n },\n });\n }\n else if (isRef(value) || isReactive(value)) {\n // @ts-expect-error: the key is state or getter\n refs[key] =\n // ---\n toRef(store, key);\n }\n }\n return refs;\n}\n\nexport { MutationType, acceptHMRUpdate, createPinia, defineStore, disposePinia, getActivePinia, mapActions, mapGetters, mapState, mapStores, mapWritableState, setActivePinia, setMapStoreSuffix, shouldHydrate, skipHydrate, storeToRefs };\n","import { defineStore } from 'pinia'\nimport { ref } from 'vue'\n\nexport const useDataStore = defineStore('data', () => {\n\tconst records = ref<Record<string, any>[]>([])\n\tconst record = ref<Record<string, any>>({})\n\treturn { records, record }\n})\n","import { inject, onMounted, Ref, ref } from 'vue'\n\nimport Registry from './registry'\nimport { Stonecrop } from './stonecrop'\nimport { useDataStore } from './stores/data'\n\n/**\n * Stonecrop composable return type\n * @public\n */\nexport type StonecropReturn = {\n\tstonecrop: Ref<Stonecrop | undefined>\n}\n\n/**\n * Stonecrop composable\n * @param registry - An existing Stonecrop Registry instance\n * @returns The Stonecrop instance and a boolean indicating if Stonecrop is setup and ready\n * @throws Error if the Stonecrop plugin is not enabled before using the composable\n * @public\n */\nexport function useStonecrop(registry?: Registry): StonecropReturn {\n\tconst stonecrop = ref<Stonecrop>()\n\n\tonMounted(async () => {\n\t\tif (!registry) {\n\t\t\tregistry = inject<Registry>('$registry')\n\t\t}\n\n\t\tif (!registry || !registry.router) return\n\n\t\tlet store: ReturnType<typeof useDataStore>\n\t\ttry {\n\t\t\tstore = useDataStore()\n\t\t} catch {\n\t\t\tthrow new Error('Please enable the Stonecrop plugin before using the Stonecrop composable')\n\t\t}\n\n\t\tstonecrop.value = new Stonecrop(registry, store)\n\t\tconst route = registry.router.currentRoute.value\n\t\tconst doctypeSlug = route.params.records?.toString().toLowerCase()\n\t\tconst recordId = route.params.record?.toString().toLowerCase() // TODO: handle views other than list and form views?\n\t\tif (!doctypeSlug && !recordId) {\n\t\t\treturn\n\t\t}\n\n\t\t// setup doctype via registry\n\t\tconst doctype = await registry.getMeta?.(doctypeSlug)\n\t\tif (doctype) {\n\t\t\tregistry.addDoctype(doctype)\n\t\t\tstonecrop.value.setup(doctype)\n\n\t\t\tif (doctypeSlug) {\n\t\t\t\tif (recordId) {\n\t\t\t\t\tawait stonecrop.value.getRecord(doctype, recordId)\n\t\t\t\t} else {\n\t\t\t\t\tawait stonecrop.value.getRecords(doctype)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tstonecrop.value.runAction(doctype, 'load', recordId ? [recordId] : undefined)\n\t\t}\n\t})\n\n\treturn { stonecrop }\n}\n","import { Component } from 'vue'\n\nimport type { ImmutableDoctype } from './types'\n\n/**\n * Doctype Meta class\n * @public\n */\nexport default class DoctypeMeta {\n\t/**\n\t * The doctype name\n\t * @public\n\t * @readonly\n\t */\n\treadonly doctype: string\n\n\t/**\n\t * The doctype schema\n\t * @public\n\t * @readonly\n\t */\n\treadonly schema: ImmutableDoctype['schema']\n\n\t/**\n\t * The doctype workflow\n\t * @public\n\t * @readonly\n\t */\n\treadonly workflow: ImmutableDoctype['workflow']\n\n\t/**\n\t * The doctype actions\n\t * @public\n\t * @readonly\n\t */\n\treadonly actions: ImmutableDoctype['actions']\n\n\t/**\n\t * The doctype component\n\t * @public\n\t * @readonly\n\t */\n\treadonly component?: Component\n\t// TODO: allow different components for different views; probably\n\t// should be defined in the schema instead?\n\n\tconstructor(\n\t\tdoctype: string,\n\t\tschema: ImmutableDoctype['schema'],\n\t\tworkflow: ImmutableDoctype['workflow'],\n\t\tactions: ImmutableDoctype['actions'],\n\t\tcomponent?: Component\n\t) {\n\t\tthis.doctype = doctype\n\t\tthis.schema = schema\n\t\tthis.workflow = workflow\n\t\tthis.actions = actions\n\t\tthis.component = component\n\t}\n\n\t/**\n\t * Converts the registered doctype string to a slug (kebab-case). The following conversions are made:\n\t * - It replaces camelCase and PascalCase with kebab-case strings\n\t * - It replaces spaces and underscores with hyphens\n\t * - It converts the string to lowercase\n\t *\n\t * @returns The slugified doctype string\n\t *\n\t * @example\n\t * ```ts\n\t * const doctype = new DoctypeMeta('TaskItem', schema, workflow, actions\n\t * console.log(doctype.slug) // 'task-item'\n\t * ```\n\t *\n\t * @public\n\t */\n\tget slug() {\n\t\treturn this.doctype\n\t\t\t.replace(/([a-z])([A-Z])/g, '$1-$2')\n\t\t\t.replace(/[\\s_]+/g, '-')\n\t\t\t.toLowerCase()\n\t}\n}\n","import { Router } from 'vue-router'\n\nimport DoctypeMeta from './doctype'\n\n/**\n * Stonecrop Registry class\n * @public\n */\nexport default class Registry {\n\t/**\n\t * The root Registry instance\n\t */\n\tstatic _root: Registry\n\n\t/**\n\t * The name of the Registry instance\n\t *\n\t * @defaultValue 'Registry'\n\t */\n\treadonly name: string\n\n\t/**\n\t * The registry property contains a collection of doctypes\n\t * @see {@link DoctypeMeta}\n\t */\n\treadonly registry: Record<string, DoctypeMeta>\n\n\t/**\n\t * The Vue router instance\n\t * @see {@link https://router.vuejs.org/}\n\t */\n\treadonly router?: Router\n\n\tconstructor(router?: Router, getMeta?: (doctype: string) => DoctypeMeta | Promise<DoctypeMeta>) {\n\t\tif (Registry._root) {\n\t\t\treturn Registry._root\n\t\t}\n\t\tRegistry._root = this\n\t\tthis.name = 'Registry'\n\t\tthis.registry = {}\n\t\tthis.router = router\n\t\tthis.getMeta = getMeta\n\t}\n\n\t/**\n\t * The getMeta function fetches doctype metadata from an API\n\t * @see {@link DoctypeMeta}\n\t */\n\tgetMeta?: (doctype: string) => DoctypeMeta | Promise<DoctypeMeta>\n\n\t/**\n\t * Get doctype metadata\n\t * @param doctype - The doctype to fetch metadata for\n\t * @returns The doctype metadata\n\t * @see {@link DoctypeMeta}\n\t */\n\taddDoctype(doctype: DoctypeMeta) {\n\t\tif (!(doctype.doctype in Object.keys(this.registry))) {\n\t\t\tthis.registry[doctype.slug] = doctype\n\t\t}\n\n\t\tif (doctype.component && this.router && !this.router.hasRoute(doctype.doctype)) {\n\t\t\tthis.router.addRoute({\n\t\t\t\tpath: `/${doctype.slug}`,\n\t\t\t\tname: doctype.slug,\n\t\t\t\tcomponent: doctype.component,\n\t\t\t})\n\t\t}\n\t}\n\n\t// TODO: should we allow clearing the registry at all?\n\t// clear() {\n\t// \tthis.registry = {}\n\t// \tif (this.router) {\n\t// \t\tconst routes = this.router.getRoutes()\n\t// \t\tfor (const route of routes) {\n\t// \t\t\tif (route.name) {\n\t// \t\t\t\tthis.router.removeRoute(route.name)\n\t// \t\t\t}\n\t// \t\t}\n\t// \t}\n\t// }\n}\n","/**\n * returns true if the given object is a promise\n */\nexport function isPromise(obj) {\n return obj && typeof obj.then === 'function';\n}\nexport var PROMISE_RESOLVED_FALSE = Promise.resolve(false);\nexport var PROMISE_RESOLVED_TRUE = Promise.resolve(true);\nexport var PROMISE_RESOLVED_VOID = Promise.resolve();\nexport function sleep(time, resolveWith) {\n if (!time) time = 0;\n return new Promise(function (res) {\n return setTimeout(function () {\n return res(resolveWith);\n }, time);\n });\n}\nexport function randomInt(min, max) {\n return Math.floor(Math.random() * (max - min + 1) + min);\n}\n\n/**\n * https://stackoverflow.com/a/8084248\n */\nexport function randomToken() {\n return Math.random().toString(36).substring(2);\n}\nvar lastMs = 0;\n\n/**\n * Returns the current unix time in micro-seconds,\n * WARNING: This is a pseudo-function\n * Performance.now is not reliable in webworkers, so we just make sure to never return the same time.\n * This is enough in browsers, and this function will not be used in nodejs.\n * The main reason for this hack is to ensure that BroadcastChannel behaves equal to production when it is used in fast-running unit tests.\n */\nexport function microSeconds() {\n var ret = Date.now() * 1000; // milliseconds to microseconds\n if (ret <= lastMs) {\n ret = lastMs + 1;\n }\n lastMs = ret;\n return ret;\n}\n\n/**\n * Check if WebLock API is supported.\n * @link https://developer.mozilla.org/en-US/docs/Web/API/Web_Locks_API\n */\nexport function supportsWebLockAPI() {\n if (typeof navigator !== 'undefined' && typeof navigator.locks !== 'undefined' && typeof navigator.locks.request === 'function') {\n return true;\n } else {\n return false;\n }\n}","import { microSeconds as micro, PROMISE_RESOLVED_VOID } from '../util.js';\nexport var microSeconds = micro;\nexport var type = 'native';\nexport function create(channelName) {\n var state = {\n time: micro(),\n messagesCallback: null,\n bc: new BroadcastChannel(channelName),\n subFns: [] // subscriberFunctions\n };\n state.bc.onmessage = function (msgEvent) {\n if (state.messagesCallback) {\n state.messagesCallback(msgEvent.data);\n }\n };\n return state;\n}\nexport function close(channelState) {\n channelState.bc.close();\n channelState.subFns = [];\n}\nexport function postMessage(channelState, messageJson) {\n try {\n channelState.bc.postMessage(messageJson, false);\n return PROMISE_RESOLVED_VOID;\n } catch (err) {\n return Promise.reject(err);\n }\n}\nexport function onMessage(channelState, fn) {\n channelState.messagesCallback = fn;\n}\nexport function canBeUsed() {\n // Deno runtime\n // eslint-disable-next-line\n if (typeof globalThis !== 'undefined' && globalThis.Deno && globalThis.Deno.args) {\n return true;\n }\n\n // Browser runtime\n if ((typeof window !== 'undefined' || typeof self !== 'undefined') && typeof BroadcastChannel === 'function') {\n if (BroadcastChannel._pubkey) {\n throw new Error('BroadcastChannel: Do not overwrite window.BroadcastChannel with this module, this is not a polyfill');\n }\n return true;\n } else {\n return false;\n }\n}\nexport function averageResponseTime() {\n return 150;\n}\nexport var NativeMethod = {\n create: create,\n close: close,\n onMessage: onMessage,\n postMessage: postMessage,\n canBeUsed: canBeUsed,\n type: type,\n averageResponseTime: averageResponseTime,\n microSeconds: microSeconds\n};","/**\n * this is a set which automatically forgets\n * a given entry when a new entry is set and the ttl\n * of the old one is over\n */\nexport class ObliviousSet {\n ttl;\n map = new Map();\n /**\n * Creating calls to setTimeout() is expensive,\n * so we only do that if there is not timeout already open.\n */\n _to = false;\n constructor(ttl) {\n this.ttl = ttl;\n }\n has(value) {\n return this.map.has(value);\n }\n add(value) {\n this.map.set(value, now());\n /**\n * When a new value is added,\n * start the cleanup at the next tick\n * to not block the cpu for more important stuff\n * that might happen.\n */\n if (!this._to) {\n this._to = true;\n setTimeout(() => {\n this._to = false;\n removeTooOldValues(this);\n }, 0);\n }\n }\n clear() {\n this.map.clear();\n }\n}\n/**\n * Removes all entries from the set\n * where the TTL has expired\n */\nexport function removeTooOldValues(obliviousSet) {\n const olderThen = now() - obliviousSet.ttl;\n const iterator = obliviousSet.map[Symbol.iterator]();\n /**\n * Because we can assume the new values are added at the bottom,\n * we start from the top and stop as soon as we reach a non-too-old value.\n */\n while (true) {\n const next = iterator.next().value;\n if (!next) {\n return; // no more elements\n }\n const value = next[0];\n const time = next[1];\n if (time < olderThen) {\n obliviousSet.map.delete(value);\n }\n else {\n // We reached a value that is not old enough\n return;\n }\n }\n}\nexport function now() {\n return Date.now();\n}\n//# sourceMappingURL=index.js.map","export function fillOptionsWithDefaults() {\n var originalOptions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var options = JSON.parse(JSON.stringify(originalOptions));\n\n // main\n if (typeof options.webWorkerSupport === 'undefined') options.webWorkerSupport = true;\n\n // indexed-db\n if (!options.idb) options.idb = {};\n // after this time the messages get deleted\n if (!options.idb.ttl) options.idb.ttl = 1000 * 45;\n if (!options.idb.fallbackInterval) options.idb.fallbackInterval = 150;\n // handles abrupt db onclose events.\n if (originalOptions.idb && typeof originalOptions.idb.onclose === 'function') options.idb.onclose = originalOptions.idb.onclose;\n\n // localstorage\n if (!options.localstorage) options.localstorage = {};\n if (!options.localstorage.removeTimeout) options.localstorage.removeTimeout = 1000 * 60;\n\n // custom methods\n if (originalOptions.methods) options.methods = originalOptions.methods;\n\n // node\n if (!options.node) options.node = {};\n if (!options.node.ttl) options.node.ttl = 1000 * 60 * 2; // 2 minutes;\n /**\n * On linux use 'ulimit -Hn' to get the limit of open files.\n * On ubuntu this was 4096 for me, so we use half of that as maxParallelWrites default.\n */\n if (!options.node.maxParallelWrites) options.node.maxParallelWrites = 2048;\n if (typeof options.node.useFastPath === 'undefined') options.node.useFastPath = true;\n return options;\n}","/**\n * this method uses indexeddb to store the messages\n * There is currently no observerAPI for idb\n * @link https://github.com/w3c/IndexedDB/issues/51\n * \n * When working on this, ensure to use these performance optimizations:\n * @link https://rxdb.info/slow-indexeddb.html\n */\n\nimport { sleep, randomInt, randomToken, microSeconds as micro, PROMISE_RESOLVED_VOID } from '../util.js';\nexport var microSeconds = micro;\nimport { ObliviousSet } from 'oblivious-set';\nimport { fillOptionsWithDefaults } from '../options.js';\nvar DB_PREFIX = 'pubkey.broadcast-channel-0-';\nvar OBJECT_STORE_ID = 'messages';\n\n/**\n * Use relaxed durability for faster performance on all transactions.\n * @link https://nolanlawson.com/2021/08/22/speeding-up-indexeddb-reads-and-writes/\n */\nexport var TRANSACTION_SETTINGS = {\n durability: 'relaxed'\n};\nexport var type = 'idb';\nexport function getIdb() {\n if (typeof indexedDB !== 'undefined') return indexedDB;\n if (typeof window !== 'undefined') {\n if (typeof window.mozIndexedDB !== 'undefined') return window.mozIndexedDB;\n if (typeof window.webkitIndexedDB !== 'undefined') return window.webkitIndexedDB;\n if (typeof window.msIndexedDB !== 'undefined') return window.msIndexedDB;\n }\n return false;\n}\n\n/**\n * If possible, we should explicitly commit IndexedDB transactions\n * for better performance.\n * @link https://nolanlawson.com/2021/08/22/speeding-up-indexeddb-reads-and-writes/\n */\nexport function commitIndexedDBTransaction(tx) {\n if (tx.commit) {\n tx.commit();\n }\n}\nexport function createDatabase(channelName) {\n var IndexedDB = getIdb();\n\n // create table\n var dbName = DB_PREFIX + channelName;\n\n /**\n * All IndexedDB databases are opened without version\n * because it is a bit faster, especially on firefox\n * @link http://nparashuram.com/IndexedDB/perf/#Open%20Database%20with%20version\n */\n var openRequest = IndexedDB.open(dbName);\n openRequest.onupgradeneeded = function (ev) {\n var db = ev.target.result;\n db.createObjectStore(OBJECT_STORE_ID, {\n keyPath: 'id',\n autoIncrement: true\n });\n };\n return new Promise(function (res, rej) {\n openRequest.onerror = function (ev) {\n return rej(ev);\n };\n openRequest.onsuccess = function () {\n res(openRequest.result);\n };\n });\n}\n\n/**\n * writes the new message to the database\n * so other readers can find it\n */\nexport function writeMessage(db, readerUuid, messageJson) {\n var time = Date.now();\n var writeObject = {\n uuid: readerUuid,\n time: time,\n data: messageJson\n };\n var tx = db.transaction([OBJECT_STORE_ID], 'readwrite', TRANSACTION_SETTINGS);\n return new Promise(function (res, rej) {\n tx.oncomplete = function () {\n return res();\n };\n tx.onerror = function (ev) {\n return rej(ev);\n };\n var objectStore = tx.objectStore(OBJECT_STORE_ID);\n objectStore.add(writeObject);\n commitIndexedDBTransaction(tx);\n });\n}\nexport function getAllMessages(db) {\n var tx = db.transaction(OBJECT_STORE_ID, 'readonly', TRANSACTION_SETTINGS);\n var objectStore = tx.objectStore(OBJECT_STORE_ID);\n var ret = [];\n return new Promise(function (res) {\n objectStore.openCursor().onsuccess = function (ev) {\n var cursor = ev.target.result;\n if (cursor) {\n ret.push(cursor.value);\n //alert(\"Name for SSN \" + cursor.key + \" is \" + cursor.value.name);\n cursor[\"continue\"]();\n } else {\n commitIndexedDBTransaction(tx);\n res(ret);\n }\n };\n });\n}\nexport function getMessagesHigherThan(db, lastCursorId) {\n var tx = db.transaction(OBJECT_STORE_ID, 'readonly', TRANSACTION_SETTINGS);\n var objectStore = tx.objectStore(OBJECT_STORE_ID);\n var ret = [];\n var keyRangeValue = IDBKeyRange.bound(lastCursorId + 1, Infinity);\n\n /**\n * Optimization shortcut,\n * if getAll() can be used, do not use a cursor.\n * @link https://rxdb.info/slow-indexeddb.html\n */\n if (objectStore.getAll) {\n var getAllRequest = objectStore.getAll(keyRangeValue);\n return new Promise(function (res, rej) {\n getAllRequest.onerror = function (err) {\n return rej(err);\n };\n getAllRequest.onsuccess = function (e) {\n res(e.target.result);\n };\n });\n }\n function openCursor() {\n // Occasionally Safari will fail on IDBKeyRange.bound, this\n // catches that error, having it open the cursor to the first\n // item. When it gets data it will advance to the desired key.\n try {\n keyRangeValue = IDBKeyRange.bound(lastCursorId + 1, Infinity);\n return objectStore.openCursor(keyRangeValue);\n } catch (e) {\n return objectStore.openCursor();\n }\n }\n return new Promise(function (res, rej) {\n var openCursorRequest = openCursor();\n openCursorRequest.onerror = function (err) {\n return rej(err);\n };\n openCursorRequest.onsuccess = function (ev) {\n var cursor = ev.target.result;\n if (cursor) {\n if (cursor.value.id < lastCursorId + 1) {\n cursor[\"continue\"](lastCursorId + 1);\n } else {\n ret.push(cursor.value);\n cursor[\"continue\"]();\n }\n } else {\n commitIndexedDBTransaction(tx);\n res(ret);\n }\n };\n });\n}\nexport function removeMessagesById(channelState, ids) {\n if (channelState.closed) {\n return Promise.resolve([]);\n }\n var tx = channelState.db.transaction(OBJECT_STORE_ID, 'readwrite', TRANSACTION_SETTINGS);\n var objectStore = tx.objectStore(OBJECT_STORE_ID);\n return Promise.all(ids.map(function (id) {\n var deleteRequest = objectStore[\"delete\"](id);\n return new Promise(function (res) {\n deleteRequest.onsuccess = function () {\n return res();\n };\n });\n }));\n}\nexport function getOldMessages(db, ttl) {\n var olderThen = Date.now() - ttl;\n var tx = db.transaction(OBJECT_STORE_ID, 'readonly', TRANSACTION_SETTINGS);\n var objectStore = tx.objectStore(OBJECT_STORE_ID);\n var ret = [];\n return new Promise(function (res) {\n objectStore.openCursor().onsuccess = function (ev) {\n var cursor = ev.target.result;\n if (cursor) {\n var msgObk = cursor.value;\n if (msgObk.time < olderThen) {\n ret.push(msgObk);\n //alert(\"Name for SSN \" + cursor.key + \" is \" + cursor.value.name);\n cursor[\"continue\"]();\n } else {\n // no more old messages,\n commitIndexedDBTransaction(tx);\n res(ret);\n }\n } else {\n res(ret);\n }\n };\n });\n}\nexport function cleanOldMessages(channelState) {\n return getOldMessages(channelState.db, channelState.options.idb.ttl).then(function (tooOld) {\n return removeMessagesById(channelState, tooOld.map(function (msg) {\n return msg.id;\n }));\n });\n}\nexport function create(channelName, options) {\n options = fillOptionsWithDefaults(options);\n return createDatabase(channelName).then(function (db) {\n var state = {\n closed: false,\n lastCursorId: 0,\n channelName: channelName,\n options: options,\n uuid: randomToken(),\n /**\n * emittedMessagesIds\n * contains all messages that have been emitted before\n * @type {ObliviousSet}\n */\n eMIs: new ObliviousSet(options.idb.ttl * 2),\n // ensures we do not read messages in parallel\n writeBlockPromise: PROMISE_RESOLVED_VOID,\n messagesCallback: null,\n readQueuePromises: [],\n db: db\n };\n\n /**\n * Handle abrupt closes that do not originate from db.close().\n * This could happen, for example, if the underlying storage is\n * removed or if the user clears the database in the browser's\n * history preferences.\n */\n db.onclose = function () {\n state.closed = true;\n if (options.idb.onclose) options.idb.onclose();\n };\n\n /**\n * if service-workers are used,\n * we have no 'storage'-event if they post a message,\n * therefore we also have to set an interval\n */\n _readLoop(state);\n return state;\n });\n}\nfunction _readLoop(state) {\n if (state.closed) return;\n readNewMessages(state).then(function () {\n return sleep(state.options.idb.fallbackInterval);\n }).then(function () {\n return _readLoop(state);\n });\n}\nfunction _filterMessage(msgObj, state) {\n if (msgObj.uuid === state.uuid) return false; // send by own\n if (state.eMIs.has(msgObj.id)) return false; // already emitted\n if (msgObj.data.time < state.messagesCallbackTime) return false; // older then onMessageCallback\n return true;\n}\n\n/**\n * reads all new messages from the database and emits them\n */\nfunction readNewMessages(state) {\n // channel already closed\n if (state.closed) return PROMISE_RESOLVED_VOID;\n\n // if no one is listening, we do not need to scan for new messages\n if (!state.messagesCallback) return PROMISE_RESOLVED_VOID;\n return getMessagesHigherThan(state.db, state.lastCursorId).then(function (newerMessages) {\n var useMessages = newerMessages\n /**\n * there is a bug in iOS where the msgObj can be undefined sometimes\n * so we filter them out\n * @link https://github.com/pubkey/broadcast-channel/issues/19\n */.filter(function (msgObj) {\n return !!msgObj;\n }).map(function (msgObj) {\n if (msgObj.id > state.lastCursorId) {\n state.lastCursorId = msgObj.id;\n }\n return msgObj;\n }).filter(function (msgObj) {\n return _filterMessage(msgObj, state);\n }).sort(function (msgObjA, msgObjB) {\n return msgObjA.time - msgObjB.time;\n }); // sort by time\n useMessages.forEach(function (msgObj) {\n if (state.messagesCallback) {\n state.eMIs.add(msgObj.id);\n state.messagesCallback(msgObj.data);\n }\n });\n return PROMISE_RESOLVED_VOID;\n });\n}\nexport function close(channelState) {\n channelState.closed = true;\n channelState.db.close();\n}\nexport function postMessage(channelState, messageJson) {\n channelState.writeBlockPromise = channelState.writeBlockPromise.then(function () {\n return writeMessage(channelState.db, channelState.uuid, messageJson);\n }).then(function () {\n if (randomInt(0, 10) === 0) {\n /* await (do not await) */\n cleanOldMessages(channelState);\n }\n });\n return channelState.writeBlockPromise;\n}\nexport function onMessage(channelState, fn, time) {\n channelState.messagesCallbackTime = time;\n channelState.messagesCallback = fn;\n readNewMessages(channelState);\n}\nexport function canBeUsed() {\n return !!getIdb();\n}\nexport function averageResponseTime(options) {\n return options.idb.fallbackInterval * 2;\n}\nexport var IndexedDBMethod = {\n create: create,\n close: close,\n onMessage: onMessage,\n postMessage: postMessage,\n canBeUsed: canBeUsed,\n type: type,\n averageResponseTime: averageResponseTime,\n microSeconds: microSeconds\n};","/**\n * A localStorage-only method which uses localstorage and its 'storage'-event\n * This does not work inside webworkers because they have no access to localstorage\n * This is basically implemented to support IE9 or your grandmother's toaster.\n * @link https://caniuse.com/#feat=namevalue-storage\n * @link https://caniuse.com/#feat=indexeddb\n */\n\nimport { ObliviousSet } from 'oblivious-set';\nimport { fillOptionsWithDefaults } from '../options.js';\nimport { sleep, randomToken, microSeconds as micro } from '../util.js';\nexport var microSeconds = micro;\nvar KEY_PREFIX = 'pubkey.broadcastChannel-';\nexport var type = 'localstorage';\n\n/**\n * copied from crosstab\n * @link https://github.com/tejacques/crosstab/blob/master/src/crosstab.js#L32\n */\nexport function getLocalStorage() {\n var localStorage;\n if (typeof window === 'undefined') return null;\n try {\n localStorage = window.localStorage;\n localStorage = window['ie8-eventlistener/storage'] || window.localStorage;\n } catch (e) {\n // New versions of Firefox throw a Security exception\n // if cookies are disabled. See\n // https://bugzilla.mozilla.org/show_bug.cgi?id=1028153\n }\n return localStorage;\n}\nexport function storageKey(channelName) {\n return KEY_PREFIX + channelName;\n}\n\n/**\n* writes the new message to the storage\n* and fires the storage-event so other readers can find it\n*/\nexport function postMessage(channelState, messageJson) {\n return new Promise(function (res) {\n sleep().then(function () {\n var key = storageKey(channelState.channelName);\n var writeObj = {\n token: randomToken(),\n time: Date.now(),\n data: messageJson,\n uuid: channelState.uuid\n };\n var value = JSON.stringify(writeObj);\n getLocalStorage().setItem(key, value);\n\n /**\n * StorageEvent does not fire the 'storage' event\n * in the window that changes the state of the local storage.\n * So we fire it manually\n */\n var ev = document.createEvent('Event');\n ev.initEvent('storage', true, true);\n ev.key = key;\n ev.newValue = value;\n window.dispatchEvent(ev);\n res();\n });\n });\n}\nexport function addStorageEventListener(channelName, fn) {\n var key = storageKey(channelName);\n var listener = function listener(ev) {\n if (ev.key === key) {\n fn(JSON.parse(ev.newValue));\n }\n };\n window.addEventListener('storage', listener);\n return listener;\n}\nexport function removeStorageEventListener(listener) {\n window.removeEventListener('storage', listener);\n}\nexport function create(channelName, options) {\n options = fillOptionsWithDefaults(options);\n if (!canBeUsed()) {\n throw new Error('BroadcastChannel: localstorage cannot be used');\n }\n var uuid = randomToken();\n\n /**\n * eMIs\n * contains all messages that have been emitted before\n * @type {ObliviousSet}\n */\n var eMIs = new ObliviousSet(options.localstorage.removeTimeout);\n var state = {\n channelName: channelName,\n uuid: uuid,\n eMIs: eMIs // emittedMessagesIds\n };\n state.listener = addStorageEventListener(channelName, function (msgObj) {\n if (!state.messagesCallback) return; // no listener\n if (msgObj.uuid === uuid) return; // own message\n if (!msgObj.token || eMIs.has(msgObj.token)) return; // already emitted\n if (msgObj.data.time && msgObj.data.time < state.messagesCallbackTime) return; // too old\n\n eMIs.add(msgObj.token);\n state.messagesCallback(msgObj.data);\n });\n return state;\n}\nexport function close(channelState) {\n removeStorageEventListener(channelState.listener);\n}\nexport function onMessage(channelState, fn, time) {\n channelState.messagesCallbackTime = time;\n channelState.messagesCallback = fn;\n}\nexport function canBeUsed() {\n var ls = getLocalStorage();\n if (!ls) return false;\n try {\n var key = '__broadcastchannel_check';\n ls.setItem(key, 'works');\n ls.removeItem(key);\n } catch (e) {\n // Safari 10 in private mode will not allow write access to local\n // storage and fail with a QuotaExceededError. See\n // https://developer.mozilla.org/en-US/docs/Web/API/Web_Storage_API#Private_Browsing_Incognito_modes\n return false;\n }\n return true;\n}\nexport function averageResponseTime() {\n var defaultTime = 120;\n var userAgent = navigator.userAgent.toLowerCase();\n if (userAgent.includes('safari') && !userAgent.includes('chrome')) {\n // safari is much slower so this time is higher\n return defaultTime * 2;\n }\n return defaultTime;\n}\nexport var LocalstorageMethod = {\n create: create,\n close: close,\n onMessage: onMessage,\n postMessage: postMessage,\n canBeUsed: canBeUsed,\n type: type,\n averageResponseTime: averageResponseTime,\n microSeconds: microSeconds\n};","import { microSeconds as micro } from '../util.js';\nexport var microSeconds = micro;\nexport var type = 'simulate';\nvar SIMULATE_CHANNELS = new Set();\nexport function create(channelName) {\n var state = {\n time: microSeconds(),\n name: channelName,\n messagesCallback: null\n };\n SIMULATE_CHANNELS.add(state);\n return state;\n}\nexport function close(channelState) {\n SIMULATE_CHANNELS[\"delete\"](channelState);\n}\nexport var SIMULATE_DELAY_TIME = 5;\nexport function postMessage(channelState, messageJson) {\n return new Promise(function (res) {\n return setTimeout(function () {\n var channelArray = Array.from(SIMULATE_CHANNELS);\n channelArray.forEach(function (channel) {\n if (channel.name === channelState.name &&\n // has same name\n channel !== channelState &&\n // not own channel\n !!channel.messagesCallback &&\n // has subscribers\n channel.time < messageJson.time // channel not created after postMessage() call\n ) {\n channel.messagesCallback(messageJson);\n }\n });\n res();\n }, SIMULATE_DELAY_TIME);\n });\n}\nexport function onMessage(channelState, fn) {\n channelState.messagesCallback = fn;\n}\nexport function canBeUsed() {\n return true;\n}\nexport function averageResponseTime() {\n return SIMULATE_DELAY_TIME;\n}\nexport var SimulateMethod = {\n create: create,\n close: close,\n onMessage: onMessage,\n postMessage: postMessage,\n canBeUsed: canBeUsed,\n type: type,\n averageResponseTime: averageResponseTime,\n microSeconds: microSeconds\n};","import { NativeMethod } from './methods/native.js';\nimport { IndexedDBMethod } from './methods/indexed-db.js';\nimport { LocalstorageMethod } from './methods/localstorage.js';\nimport { SimulateMethod } from './methods/simulate.js';\n// the line below will be removed from es5/browser builds\n\n// order is important\nvar METHODS = [NativeMethod,\n// fastest\nIndexedDBMethod, LocalstorageMethod];\nexport function chooseMethod(options) {\n var chooseMethods = [].concat(options.methods, METHODS).filter(Boolean);\n\n // the line below will be removed from es5/browser builds\n\n // directly chosen\n if (options.type) {\n if (options.type === 'simulate') {\n // only use simulate-method if directly chosen\n return SimulateMethod;\n }\n var ret = chooseMethods.find(function (m) {\n return m.type === options.type;\n });\n if (!ret) throw new Error('method-type ' + options.type + ' not found');else return ret;\n }\n\n /**\n * if no webworker support is needed,\n * remove idb from the list so that localstorage will be chosen\n */\n if (!options.webWorkerSupport) {\n chooseMethods = chooseMethods.filter(function (m) {\n return m.type !== 'idb';\n });\n }\n var useMethod = chooseMethods.find(function (method) {\n return method.canBeUsed();\n });\n if (!useMethod) {\n throw new Error(\"No usable method found in \" + JSON.stringify(METHODS.map(function (m) {\n return m.type;\n })));\n } else {\n return useMethod;\n }\n}","import { isPromise, PROMISE_RESOLVED_FALSE, PROMISE_RESOLVED_VOID } from './util.js';\nimport { chooseMethod } from './method-chooser.js';\nimport { fillOptionsWithDefaults } from './options.js';\n\n/**\n * Contains all open channels,\n * used in tests to ensure everything is closed.\n */\nexport var OPEN_BROADCAST_CHANNELS = new Set();\nvar lastId = 0;\nexport var BroadcastChannel = function BroadcastChannel(name, options) {\n // identifier of the channel to debug stuff\n this.id = lastId++;\n OPEN_BROADCAST_CHANNELS.add(this);\n this.name = name;\n if (ENFORCED_OPTIONS) {\n options = ENFORCED_OPTIONS;\n }\n this.options = fillOptionsWithDefaults(options);\n this.method = chooseMethod(this.options);\n\n // isListening\n this._iL = false;\n\n /**\n * _onMessageListener\n * setting onmessage twice,\n * will overwrite the first listener\n */\n this._onML = null;\n\n /**\n * _addEventListeners\n */\n this._addEL = {\n message: [],\n internal: []\n };\n\n /**\n * Unsent message promises\n * where the sending is still in progress\n * @type {Set<Promise>}\n */\n this._uMP = new Set();\n\n /**\n * _beforeClose\n * array of promises that will be awaited\n * before the channel is closed\n */\n this._befC = [];\n\n /**\n * _preparePromise\n */\n this._prepP = null;\n _prepareChannel(this);\n};\n\n// STATICS\n\n/**\n * used to identify if someone overwrites\n * window.BroadcastChannel with this\n * See methods/native.js\n */\nBroadcastChannel._pubkey = true;\n\n/**\n * clears the tmp-folder if is node\n * @return {Promise<boolean>} true if has run, false if not node\n */\nexport function clearNodeFolder(options) {\n options = fillOptionsWithDefaults(options);\n var method = chooseMethod(options);\n if (method.type === 'node') {\n return method.clearNodeFolder().then(function () {\n return true;\n });\n } else {\n return PROMISE_RESOLVED_FALSE;\n }\n}\n\n/**\n * if set, this method is enforced,\n * no mather what the options are\n */\nvar ENFORCED_OPTIONS;\nexport function enforceOptions(options) {\n ENFORCED_OPTIONS = options;\n}\n\n// PROTOTYPE\nBroadcastChannel.prototype = {\n postMessage: function postMessage(msg) {\n if (this.closed) {\n throw new Error('BroadcastChannel.postMessage(): ' + 'Cannot post message after channel has closed ' +\n /**\n * In the past when this error appeared, it was really hard to debug.\n * So now we log the msg together with the error so it at least\n * gives some clue about where in your application this happens.\n */\n JSON.stringify(msg));\n }\n return _post(this, 'message', msg);\n },\n postInternal: function postInternal(msg) {\n return _post(this, 'internal', msg);\n },\n set onmessage(fn) {\n var time = this.method.microSeconds();\n var listenObj = {\n time: time,\n fn: fn\n };\n _removeListenerObject(this, 'message', this._onML);\n if (fn && typeof fn === 'function') {\n this._onML = listenObj;\n _addListenerObject(this, 'message', listenObj);\n } else {\n this._onML = null;\n }\n },\n addEventListener: function addEventListener(type, fn) {\n var time = this.method.microSeconds();\n var listenObj = {\n time: time,\n fn: fn\n };\n _addListenerObject(this, type, listenObj);\n },\n removeEventListener: function removeEventListener(type, fn) {\n var obj = this._addEL[type].find(function (obj) {\n return obj.fn === fn;\n });\n _removeListenerObject(this, type, obj);\n },\n close: function close() {\n var _this = this;\n if (this.closed) {\n return;\n }\n OPEN_BROADCAST_CHANNELS[\"delete\"](this);\n this.closed = true;\n var awaitPrepare = this._prepP ? this._prepP : PROMISE_RESOLVED_VOID;\n this._onML = null;\n this._addEL.message = [];\n return awaitPrepare\n // wait until all current sending are processed\n .then(function () {\n return Promise.all(Array.from(_this._uMP));\n })\n // run before-close hooks\n .then(function () {\n return Promise.all(_this._befC.map(function (fn) {\n return fn();\n }));\n })\n // close the channel\n .then(function () {\n return _this.method.close(_this._state);\n });\n },\n get type() {\n return this.method.type;\n },\n get isClosed() {\n return this.closed;\n }\n};\n\n/**\n * Post a message over the channel\n * @returns {Promise} that resolved when the message sending is done\n */\nfunction _post(broadcastChannel, type, msg) {\n var time = broadcastChannel.method.microSeconds();\n var msgObj = {\n time: time,\n type: type,\n data: msg\n };\n var awaitPrepare = broadcastChannel._prepP ? broadcastChannel._prepP : PROMISE_RESOLVED_VOID;\n return awaitPrepare.then(function () {\n var sendPromise = broadcastChannel.method.postMessage(broadcastChannel._state, msgObj);\n\n // add/remove to unsent messages list\n broadcastChannel._uMP.add(sendPromise);\n sendPromise[\"catch\"]().then(function () {\n return broadcastChannel._uMP[\"delete\"](sendPromise);\n });\n return sendPromise;\n });\n}\nfunction _prepareChannel(channel) {\n var maybePromise = channel.method.create(channel.name, channel.options);\n if (isPromise(maybePromise)) {\n channel._prepP = maybePromise;\n maybePromise.then(function (s) {\n // used in tests to simulate slow runtime\n /*if (channel.options.prepareDelay) {\n await new Promise(res => setTimeout(res, this.options.prepareDelay));\n }*/\n channel._state = s;\n });\n } else {\n channel._state = maybePromise;\n }\n}\nfunction _hasMessageListeners(channel) {\n if (channel._addEL.message.length > 0) return true;\n if (channel._addEL.internal.length > 0) return true;\n return false;\n}\nfunction _addListenerObject(channel, type, obj) {\n channel._addEL[type].push(obj);\n _startListening(channel);\n}\nfunction _removeListenerObject(channel, type, obj) {\n channel._addEL[type] = channel._addEL[type].filter(function (o) {\n return o !== obj;\n });\n _stopListening(channel);\n}\nfunction _startListening(channel) {\n if (!channel._iL && _hasMessageListeners(channel)) {\n // someone is listening, start subscribing\n\n var listenerFn = function listenerFn(msgObj) {\n channel._addEL[msgObj.type].forEach(function (listenerObject) {\n if (msgObj.time >= listenerObject.time) {\n listenerObject.fn(msgObj.data);\n }\n });\n };\n var time = channel.method.microSeconds();\n if (channel._prepP) {\n channel._prepP.then(function () {\n channel._iL = true;\n channel.method.onMessage(channel._state, listenerFn, time);\n });\n } else {\n channel._iL = true;\n channel.method.onMessage(channel._state, listenerFn, time);\n }\n }\n}\nfunction _stopListening(channel) {\n if (channel._iL && !_hasMessageListeners(channel)) {\n // no one is listening, stop subscribing\n channel._iL = false;\n var time = channel.method.microSeconds();\n channel.method.onMessage(channel._state, null, time);\n }\n}","// src/index.ts\nimport { BroadcastChannel as BroadcastChannelImpl2 } from \"broadcast-channel\";\n\n// src/utils.ts\nfunction serialize(obj, serializer = { serialize: JSON.stringify, deserialize: JSON.parse }) {\n return serializer.deserialize(serializer.serialize(obj));\n}\n\n// src/vanilla.ts\nimport { BroadcastChannel as BroadcastChannelImpl } from \"broadcast-channel\";\nfunction share(key, store, { initialize, serializer, type }) {\n const channelName = `${store.$id}-${key.toString()}`;\n const channel = new BroadcastChannelImpl(channelName, {\n type\n });\n let externalUpdate = false;\n let timestamp = 0;\n store.$subscribe((_, state) => {\n if (!externalUpdate) {\n timestamp = Date.now();\n channel.postMessage({\n timestamp,\n newValue: serialize(state, serializer)[key]\n });\n }\n externalUpdate = false;\n });\n channel.onmessage = (evt) => {\n if (evt === void 0) {\n channel.postMessage({\n timestamp,\n // @ts-expect-error: TODO\n newValue: serialize(store.$state, serializer)[key]\n });\n return;\n }\n if (evt.timestamp <= timestamp)\n return;\n externalUpdate = true;\n timestamp = evt.timestamp;\n store[key] = evt.newValue;\n };\n const sync = () => channel.postMessage(void 0);\n const unshare = () => {\n return channel.close();\n };\n if (initialize)\n sync();\n return { sync, unshare };\n}\n\n// src/index.ts\nfunction stateHasKey(key, $state) {\n return Object.keys($state).includes(key);\n}\nfunction PiniaSharedState({\n enable = true,\n initialize = true,\n type,\n serializer\n}) {\n return ({ store, options }) => {\n const isEnabled = options?.share?.enable ?? enable;\n const omittedKeys = options?.share?.omit ?? [];\n if (!isEnabled)\n return;\n const channel = new BroadcastChannelImpl2(store.$id, {\n type\n });\n let timestamp = 0;\n let externalUpdate = false;\n const keysToUpdate = Object.keys(store.$state).filter((key) => !omittedKeys.includes(key) && stateHasKey(key, store.$state));\n channel.onmessage = (newState) => {\n if (newState === void 0) {\n channel.postMessage({\n timestamp,\n state: serialize(store.$state, serializer)\n });\n return;\n }\n if (newState.timestamp <= timestamp)\n return;\n externalUpdate = true;\n timestamp = newState.timestamp;\n store.$patch((state) => {\n keysToUpdate.forEach((key) => {\n state[key] = newState.state[key];\n });\n });\n };\n const shouldInitialize = options?.share?.initialize ?? initialize;\n if (shouldInitialize)\n channel.postMessage(void 0);\n store.$subscribe((_, state) => {\n if (!externalUpdate) {\n timestamp = Date.now();\n channel.postMessage({\n timestamp,\n state: serialize(state, serializer)\n });\n }\n externalUpdate = false;\n });\n };\n}\nexport {\n PiniaSharedState,\n share\n};\n//# sourceMappingURL=index.js.map","import { createPinia } from 'pinia'\nimport { PiniaSharedState } from 'pinia-shared-state'\n\nconst pinia = createPinia()\n\n// Pass the plugin to your application's pinia plugin\npinia.use(\n\tPiniaSharedState({\n\t\tenable: true,\n\t\tinitialize: true,\n\t})\n)\n\nexport { pinia }\n","import { App, type Plugin } from 'vue'\n\nimport Registry from '../registry'\nimport { pinia } from '../stores'\nimport type { InstallOptions } from '../types'\n\n/**\n * Stonecrop Vue plugin\n * @param app - The Vue app instance\n * @param options - The plugin options\n * @example\n * ```ts\n *\n * import { createApp } from 'vue'\n * import Stonecrop from 'stonecrop'\n *\n * import App from './App.vue'\n *\n * const app = createApp(App)\n * app.use(Stonecrop, {\n * router,\n * components: {\n * // register custom components\n * },\n * getMeta: async (doctype: string) => {\n * // fetch doctype meta from API\n * },\n * })\n *\n * app.mount('#app')\n * ```\n *\n * @public\n */\nconst plugin: Plugin = {\n\tinstall: (app: App, options?: InstallOptions) => {\n\t\t// check if the router is already installed via another plugin\n\t\tconst existingRouter = app.config.globalProperties.$router\n\t\tconst appRouter = existingRouter || options?.router\n\t\tconst registry = new Registry(appRouter, options?.getMeta)\n\n\t\tif (!existingRouter && appRouter) {\n\t\t\tapp.use(appRouter)\n\t\t}\n\n\t\tapp.use(pinia)\n\t\tapp.provide('$registry', registry)\n\n\t\tif (options?.components) {\n\t\t\tfor (const [tag, component] of Object.entries(options.components)) {\n\t\t\t\tapp.component(tag, component)\n\t\t\t}\n\t\t}\n\t},\n}\n\nexport default plugin\n"],"names":["getGlobal","getDevTools","w","devToolsAdapter","service","devTools","Mailbox","_process","event","enqueued","consumed","STATE_DELIMITER","TARGETLESS_KEY","NULL_EVENT","STATE_IDENTIFIER","WILDCARD","XSTATE_INIT","XSTATE_STOP","createAfterEvent","delayRef","id","createDoneStateEvent","output","createDoneActorEvent","invokeId","createErrorActorEvent","error","createInitEvent","input","reportUnhandledError","err","symbolObservable","matchesState","parentStateId","childStateId","parentStateValue","toStateValue","childStateValue","key","toStatePath","stateId","isArray","result","segment","i","stateValue","isMachineSnapshot","statePath","pathToStateValue","value","marker","previous","mapValues","collection","iteratee","collectionKeys","toArrayStrict","toArray","resolveOutput","mapper","context","self","isErrorActorEvent","toTransitionConfigArray","configLike","transitionLike","normalizeTarget","target","toObserver","nextHandler","errorHandler","completionHandler","isObserver","createInvokeId","stateNodeId","index","resolveReferencedActor","machine","src","match","indexStr","nodeId","invokeConfig","createScheduledEventId","actorRef","idCounter","createSystem","rootActor","options","children","keyedActors","reverseKeyedActors","inspectionObservers","timerMap","clock","logger","scheduler","source","delay","scheduledEvent","scheduledEventId","system","timeout","sendInspectionEvent","resolvedInspectionEvent","observer","sessionId","systemId","existing","observerOrFn","scheduledEvents","scheduledId","executingCustomAction","$$ACTOR_TYPE","ProcessingStatus","defaultOptions","fn","ms","Actor","logic","resolvedOptions","parent","syncSnapshot","inspect","child","emittedEvent","listeners","wildcardListener","allListeners","handler","action","exec","saveExecutingCustomAction","persistedState","snapshot","deferredFn","nextListenerOrObserver","errorListener","completeListener","type","wrappedHandler","initEvent","nextState","caughtError","reportError","err2","createActor","resolveCancel","_","actionArgs","actionParams","sendId","resolvedSendId","executeCancel","actorScope","params","cancel","_args","_params","resolveSpawn","_actionParams","resolvedId","resolvedInput","cloneMachineSnapshot","executeSpawn","spawnChild","resolveStop","args","actorRefOrString","resolvedActorRef","executeStop","stopChild","stop","evaluateGuard","guard","isInline","resolved","guardArgs","guardParams","isAtomicStateNode","stateNode","getChildren","sn","getProperAncestors","toStateNode","ancestors","m","getAllStateNodes","stateNodes","nodeSet","adjList","getAdjList","s","getInitialStateNodesWithTheirAncestors","initialStates","initialStateNode","getValueFromAdj","baseNode","childStateNodes","childStateNode","getStateValue","rootNode","config","isInFinalState","stateNodeSet","isStateId","str","getCandidates","receivedEventType","eventDescriptor","partialEventTokens","eventTokens","tokenIndex","partialEventToken","eventToken","a","b","getDelayedTransitions","afterConfig","mutateEntryExit","afterEvent","eventType","raise","configTransition","resolvedTransition","resolvedDelay","transition","delayedTransition","formatTransition","descriptor","transitionConfig","normalizedTarget","reenter","resolveTarget","t","formatTransitions","transitions","transitionsConfig","invokeDef","formatInitialTransition","_target","resolvedTarget","targets","isInternalTarget","getStateNodeByPath","resolveHistoryDefaultTransition","isHistoryNode","states","getInitialStateNodes","initialState","ancestor","set","iter","descStateNode","getStateNode","stateKey","arrayStatePath","currentStateNode","getStateNodes","childStateKeys","subStateKey","allSubStateNodes","subStateNode","subStateNodes","transitionAtomicNode","next","transitionCompoundNode","subStateKeys","transitionNode","transitionParallelNode","allInnerTransitions","subStateValue","innerTransitions","getHistoryNodes","isDescendant","parentStateNode","hasIntersection","s1","s2","set1","set2","item","removeConflictingTransitions","enabledTransitions","historyValue","filteredTransitions","t1","t1Preempted","transitionsToRemove","t2","computeExitSet","t3","findLeastCommonAncestor","head","tail","getEffectiveTargetStates","targetNode","node","getTransitionDomain","targetStates","lca","statesToExit","domain","areStateNodeCollectionsEqual","prevStateNodes","nextStateNodeSet","microstep","currentSnapshot","isInitial","internalQueue","mutStateNodeSet","exitStates","resolveActionsAndContext","enterStates","nextStateNodes","state","e","getMachineOutput","rootCompletionNode","doneStateEvent","nextSnapshot","statesToEnter","statesForDefaultEntry","computeEntrySet","completedNodes","stateNodeToEnter","actions","initialActions","ancestorMarker","addDescendantStatesToEnter","addAncestorStatesToEnter","historyStateNodes","addProperAncestorStatesToEnter","historyDefaultTransition","reentrancyDomain","anc","_actionExecutor","changedHistory","exitStateNode","historyNode","predicate","def","getAction","actionType","resolveAndExecuteActionsWithContext","extra","retries","intermediateSnapshot","resolvedAction","builtinAction","deferredActorIds","macrostep","microstates","addMicrostate","microstate","stopChildren","nextEvent","currentEvent","isErr","selectTransitions","shouldSelectEventlessTransitions","selectEventlessTransitions","previousState","enabledTransitionSet","atomicStates","loop","resolveStateValue","allStateNodes","machineSnapshotMatches","testValue","machineSnapshotHasTag","tag","machineSnapshotCan","transitionData","machineSnapshotToJSON","nodes","tags","getMeta","toJSON","can","hasTag","matches","jsonValues","machineSnapshotGetMeta","acc","createMachineSnapshot","serializeHistoryValue","getPersistedSnapshot","childrenJson","persistContext","contextPart","copy","resolveRaise","eventOrExpr","delaysMap","resolvedEvent","configDelay","executeRaise","createSpawner","spawnedChildren","spawn","resolveAssign","assignment","assignArgs","partialUpdate","propAssignment","updatedContext","assign","cache","memo","object","memoizedData","EMPTY_OBJECT","toSerializableAction","StateNode","stateConfig","sourceName","onDone","onError","invokeDefValues","map","selectedTransition","candidates","candidate","resolvedContext","guardPassed","guardType","events","StateMachine","implementations","guards","actors","delays","resolvedStateValue","preInitial","preInitialState","macroState","fullPath","relativePath","resolvedStateId","_actorScope","snapshotChildren","actorId","actorData","childState","resolveHistoryReferencedState","root","referenced","reviveHistoryValue","revived","arr","revivedHistoryValue","restoredSnapshot","seen","reviveContext","createMachine","NotImplementedError","message","Stonecrop","registry","store","doctype","filters","data","workflow","actor","__create","__defProp","__getOwnPropDesc","__getOwnPropNames","__getProtoOf","__hasOwnProp","__esm","res","__commonJS","cb","mod","__copyProps","to","from","except","desc","__toESM","isNodeMode","target2","init_esm_shims","require_rfdc","exports","module","rfdc2","copyBuffer","cur","opts","rfdcCircles","constructorHandlers","o","cloneArray","handler2","cloneProto","clone","keys","a2","k","o2","refs","refsNew","isBrowser","_a","import_rfdc","classifyRE","toUpper","c","classify","basename","filename","ext","normalizedFilename","lastSlashIndex","baseNameWithExt","extIndex","deepClone","DEBOUNCE_DEFAULTS","debounce","wait","leadingValue","resolveList","currentPromise","trailingArgs","applyFn","_this","_applyPromised","promise","resolve","shouldCallNow","_resolve","flatHooks","configHooks","hooks","parentName","subHook","name","defaultTask","function_","_createTask","createTask","serialTaskCaller","task","hookFunction","parallelTaskCaller","hook","callEachWith","callbacks","arg0","callback","Hookable","originalName","dep","_unreg","_function","arguments_","deprecated","_hooks","deprecatedHooks","removeFns","unreg","caller","createHooks","target22","require_speakingurl","charMap","lookAheadCharArray","diatricMap","langCharMap","symbolMap","uricChars","uricNoSlashChars","markChars","getSlug","separator","diatricString","convertSymbols","customReplacements","maintainCase","titleCase","truncate","uricFlag","uricNoSlashFlag","markFlag","symbol","langChar","lucky","ch","l","lastCharWasSymbol","lastCharWasDiatric","allowedChars","v","r","escapeChars","isReplacedCustomChar","i2","j","createSlug","require_speakingurl2","getComponentTypeName","_a25","getComponentFileName","file","saveComponentGussedName","instance","getAppRecord","isFragment","_b25","subTreeType","appRecord","getInstanceName","_c","fileName","getUniqueComponentId","appId","instanceId","getComponentInstance","createRect","rect","range","getTextRect","getFragmentRect","vnode","childVnode","childRect","getComponentBoundingRect","el","mergeRects","DEFAULT_RECT","getRootElementsFromComponentInstance","getFragmentRootElements","list","CONTAINER_ELEMENT_ID","CARD_ELEMENT_ID","COMPONENT_NAME_ELEMENT_ID","INDICATOR_ELEMENT_ID","containerStyles","cardStyles","indicatorStyles","getContainerElement","getCardElement","getIndicatorElement","getNameElement","getStyles","bounds","create","containerEl","cardEl","nameEl","indicatorEl","update","highlight","unhighlight","inspectInstance","inspectFn","selectComponentFn","uniqueComponentId","inspectComponentHighLighterSelectFn","cancelInspectComponentHighLighter","inspectComponentHighLighter","onSelect","scrollToComponent","activeAppRecord","scrollTarget","styles","el2","_b","waitForInspectorInit","total","timer","setupInspector","inspector","_openInEditor","getComponentInspector","setup","isReadonly","isReactive","isRef","toRaw","observed","raw","StateEditor","RefStateEditor","path","sections","section","field","size","ref","currentKeys","previousKeysSet2","previousKeysSet","TIMELINE_LAYERS_STATE_STORAGE_ID","getTimelineLayersStateFromStorage","_a2","_b2","target3","devtoolsTimelineLayers","prop","receiver","addTimelineLayer","devtoolsState","_a3","_b3","target4","devtoolsInspector","callInspectorUpdatedHook","devtoolsContext","getActiveInspectors","addInspector","getInspector","app","createDevToolsCtxHooks","hooks2","plugin","debounceSendInspectorTree","debounce2","inspectorId","_payload","debounceSendInspectorState","ctx","internalLayerIds","uid","_a4","_b4","global","_a5","_b5","_a6","_b6","_a7","_b7","_a8","_b8","STATE_KEY","initStateFactory","_a9","_b9","callStateUpdatedHook","debounce3","oldState","devtoolsAppRecords","updateAllStates","setActiveAppRecord","setActiveAppRecordId","property","openInEditor","host","baseUrl","line","column","_baseUrl","response","msg","target5","_a10","_b10","target6","devtoolsPluginBuffer","_getSettings","settings","_settings","getPluginLocalKey","pluginId","getPluginSettingsOptions","item2","_a26","getPluginSettings","fallbackValue","localKey","localSettings","initPluginSettings","setPluginSettings","parsedLocalSettings","updated","_a11","_b11","devtoolsHooks","target7","createHooks2","on","pluginDescriptor","setupFn","DevToolsV6PluginAPI","payload","DevToolsPluginAPI","UNDEFINED","INFINITY","NEGATIVE_INFINITY","NAN","tokenMap","_a12","_b12","target8","setupDevToolsPlugin","callDevToolsPluginSetupFn","api","registerDevToolsPlugin","ROUTER_KEY","ROUTER_INFO_KEY","_a13","_b13","global2","_a14","_b14","getRoutes","router","routesMap","filterRoutes","routes","meta","filterCurrentRoute","route","hash","href","matched","query","normalizeRouterInfo","activeAppRecord2","init","currentRoute","global3","debounce5","createDevToolsApi","stateEditor2","obj","record","target9","_a15","_b15","target10","_a16","_b16","target11","_a17","_b17","target12","toggleHighPerfMode","updateDevToolsClientDetected","devtoolsClientVisible","_a18","_b18","target15","DoubleIndexedKV","Registry","generateIdentifier","identifier","ClassRegistry","valuesOfObj","values","find","valuesNotNever","forEach","run","includes","findArr","CustomTransformerRegistry","transformer","getType","isUndefined","isNull","isPlainObject2","isEmptyObject","isString","isNumber","isBoolean","isRegExp","isMap","isSet","isSymbol","isDate","isError","isNaNValue","isPrimitive2","isBigint","isInfinite","isTypedArray","isURL","escapeKey","stringifyPath","parsePath","string","char","lastSegment","simpleTransformation","isApplicable","annotation","transform","untransform","simpleRules","superJson","baseError","regex","body","flags","compositeTransformation","symbolRule","constructorToName","ctor","typedArrayRule","isInstanceOfRegisteredClass","potentialClass","classRule","clazz","allowedProps","customRule","compositeRules","transformValue","applicableCompositeRule","rule","applicableSimpleRule","simpleRulesByAnnotation","untransformValue","json","transformation","getNthKey","n","validatePath","getDeep","row","keyOfRow","setDeep","lastKey","oldValue","newValue","keyToRow","newKey","traverse","tree","walker2","origin","subtree","nodeValue","applyValueAnnotations","plain","annotations","applyReferentialEqualityAnnotations","apply","identicalPaths","identicalObjectPath","other","identicalPath","isDeep","addIdentity","identities","existingSet","generateReferentialEqualityAnnotations","identitites","dedupe","rootEqualityPaths","paths","representativePath","walker","objectsInThisPath","seenObjects","primitive","transformed2","result2","transformationResult","transformed","transformedValue","innerAnnotations","recursiveResult","getType2","isArray2","isPlainObject3","prototype","assignProp","carry","newVal","originalObject","includeNonenumerable","propType","props","symbols","val","SuperJSON","equalityAnnotations","_a19","_b19","target21","_a20","_b20","_a21","_b21","_a22","_b22","_a23","_b23","_a24","_b24","activePinia","setActivePinia","pinia","piniaSymbol","isPlainObject","MutationType","IS_CLIENT","_global","bom","blob","autoBom","download","url","xhr","saveAs","corsEnabled","click","evt","_navigator","isMacOSWebView","downloadSaveAs","msSaveAs","fileSaverSaveAs","popup","force","isSafari","isChromeIOS","reader","toastMessage","piniaMessage","isPinia","checkClipboardAccess","checkNotFocusedError","actionGlobalCopyState","actionGlobalPasteState","loadStoresState","actionGlobalSaveState","fileInput","getFileOpener","openFile","reject","files","actionGlobalOpenStateFile","open","text","storeState","formatDisplay","display","PINIA_ROOT_LABEL","PINIA_ROOT_ID","formatStoreForInspectorTree","formatStoreForInspectorState","storeNames","storeMap","storeId","getters","getterName","formatEventData","formatMutationType","isTimelineActive","componentStateTypes","MUTATIONS_LAYER_ID","INSPECTOR_ID","assign$1","getStoreType","registerPiniaDevtools","setupDevtoolsPlugin","proxy","piniaStores","stores","inspectedStore","addStoreToDevtools","now","after","groupId","runningActionId","activeAction","watch","unref","eventData","hotUpdate","markRaw","newStore","$dispose","patchActionForGrouping","actionNames","wrapWithProxy","storeActions","actionName","_actionId","trackedStore","retValue","devtoolsPlugin","originalHotUpdate","createPinia","scope","effectScope","_p","toBeInstalled","patchObject","newState","subPatch","targetValue","noop","addSubscription","subscriptions","detached","onCleanup","removeSubscription","idx","getCurrentScope","onScopeDispose","triggerSubscriptions","fallbackRunWithContext","ACTION_MARKER","ACTION_NAME","mergeReactiveObjects","patchToApply","skipHydrateSymbol","shouldHydrate","isComputed","createOptionsStore","hot","localState","toRefs","computedGetters","computed","createSetupStore","$id","isOptionsStore","optionsForPlugin","$subscribeOptions","isListening","debuggerEvents","isSyncListening","actionSubscriptions","hotState","activeListener","$patch","partialStateOrMutator","subscriptionMutation","myListenerId","nextTick","$reset","$state","wrappedAction","afterCallbackList","onErrorCallbackList","ret","_hmrPayload","partialStore","stopWatcher","reactive","setupStore","toRef","actionValue","newStateTarget","oldStateSource","actionFn","getter","getterValue","nonEnumerable","p","extender","extensions","defineStore","setupOptions","isSetupStore","useStore","hasContext","hasInjectionContext","inject","hotId","currentInstance","getCurrentInstance","vm","useDataStore","records","useStonecrop","stonecrop","onMounted","doctypeSlug","recordId","DoctypeMeta","schema","component","isPromise","PROMISE_RESOLVED_VOID","sleep","time","resolveWith","randomInt","min","max","randomToken","lastMs","microSeconds","micro","channelName","msgEvent","close","channelState","postMessage","messageJson","onMessage","canBeUsed","averageResponseTime","NativeMethod","ObliviousSet","ttl","removeTooOldValues","obliviousSet","olderThen","iterator","fillOptionsWithDefaults","originalOptions","DB_PREFIX","OBJECT_STORE_ID","TRANSACTION_SETTINGS","getIdb","commitIndexedDBTransaction","tx","createDatabase","IndexedDB","dbName","openRequest","ev","db","rej","writeMessage","readerUuid","writeObject","objectStore","getMessagesHigherThan","lastCursorId","keyRangeValue","getAllRequest","openCursor","openCursorRequest","cursor","removeMessagesById","ids","deleteRequest","getOldMessages","msgObk","cleanOldMessages","tooOld","_readLoop","readNewMessages","_filterMessage","msgObj","newerMessages","useMessages","msgObjA","msgObjB","IndexedDBMethod","KEY_PREFIX","getLocalStorage","localStorage","storageKey","writeObj","addStorageEventListener","listener","removeStorageEventListener","uuid","eMIs","ls","defaultTime","userAgent","LocalstorageMethod","SIMULATE_CHANNELS","SIMULATE_DELAY_TIME","channelArray","channel","SimulateMethod","METHODS","chooseMethod","chooseMethods","useMethod","method","OPEN_BROADCAST_CHANNELS","lastId","BroadcastChannel","_prepareChannel","_post","listenObj","_removeListenerObject","_addListenerObject","awaitPrepare","broadcastChannel","sendPromise","maybePromise","_hasMessageListeners","_startListening","_stopListening","listenerFn","listenerObject","serialize","serializer","stateHasKey","PiniaSharedState","enable","initialize","isEnabled","omittedKeys","BroadcastChannelImpl2","timestamp","externalUpdate","keysToUpdate","existingRouter","appRouter"],"mappings":";AACA,SAASA,KAAY;AACnB,MAAI,OAAO,aAAe;AACxB,WAAO;AAET,MAAI,OAAO,OAAS;AAClB,WAAO;AAET,MAAI,OAAO,SAAW;AACpB,WAAO;AAET,MAAI,OAAO,SAAW;AACpB,WAAO;AAEX;AACA,SAASC,KAAc;AACrB,QAAMC,IAAIF,GAAS;AACnB,MAAIE,EAAE;AACJ,WAAOA,EAAE;AAGb;AAUA,MAAMC,KAAkB,CAAAC,MAAW;AACjC,MAAI,OAAO,SAAW;AACpB;AAEF,QAAMC,IAAWJ,GAAW;AAC5B,EAAII,KACFA,EAAS,SAASD,CAAO;AAE7B;ACrCA,MAAME,GAAQ;AAAA,EACZ,YAAYC,GAAU;AACpB,SAAK,WAAWA,GAChB,KAAK,UAAU,IACf,KAAK,WAAW,MAChB,KAAK,QAAQ;AAAA,EACf;AAAA,EACA,Q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CAAC;AAAA,MACH,CAAC;AAAA,IACH,IACyBkD,GAAS,OAAO,cAAc0rC,MAErD7B,EAAQ,YAAY,MAAM,GAC5BzyB,EAAM,WAAW,CAACxT,GAAGuK,MAAU;AAC7B,MAAK49B,MACHD,IAAY,KAAK,IAAG,GACpBjC,EAAQ,YAAY;AAAA,QAClB,WAAAiC;AAAA,QACA,OAAOT,GAAUl9B,GAAOm9B,CAAU;AAAA,MAC5C,CAAS,IAEHS,IAAiB;AAAA,IACnB,CAAC;AAAA,EACH;AACF;ACrGA,MAAMjT,KAAQ4F,GAAA;AAGd5F,GAAM;AAAA,EACL0S,GAAiB;AAAA,IAChB,QAAQ;AAAA,IACR,YAAY;AAAA,EAAA,CACZ;AACF;ACuBA,MAAMjkB,KAAiB;AAAA,EACtB,SAAS,CAACH,GAAUpnB,MAA6B;AAEhD,UAAMisC,IAAiB7kB,EAAI,OAAO,iBAAiB,SAC7C8kB,IAAYD,KAAkBjsC,GAAS,QACvCmX,IAAW,IAAIsY,GAASyc,GAAWlsC,GAAS,OAAO;AASzD,QAPI,CAACisC,KAAkBC,KACtB9kB,EAAI,IAAI8kB,CAAS,GAGlB9kB,EAAI,IAAI0R,EAAK,GACb1R,EAAI,QAAQ,aAAajQ,CAAQ,GAE7BnX,GAAS;AACZ,iBAAW,CAAC2R,GAAK0yB,CAAS,KAAK,OAAO,QAAQrkC,EAAQ,UAAU;AAC/D,QAAAonB,EAAI,UAAUzV,GAAK0yB,CAAS;AAAA,EAG/B;AACD;","x_google_ignoreList":[0,1,2,3,4,7,8,9,10,11,16,17,18,19,20,21,22,23,24,25]}
1
+ {"version":3,"file":"stonecrop.js","sources":["../../common/temp/node_modules/.pnpm/pinia@3.0.3_typescript@5.9.3_vue@3.5.22_typescript@5.9.3_/node_modules/pinia/dist/pinia.mjs","../../common/temp/node_modules/.pnpm/@vueuse+shared@14.0.0_vue@3.5.22_typescript@5.9.3_/node_modules/@vueuse/shared/dist/index.js","../../common/temp/node_modules/.pnpm/@vueuse+core@14.0.0_vue@3.5.22_typescript@5.9.3_/node_modules/@vueuse/core/dist/index.js","../src/stores/operation-log.ts","../src/field-triggers.ts","../src/stores/hst.ts","../src/stonecrop.ts","../src/composable.ts","../src/composables/operation-log.ts","../src/doctype.ts","../src/registry.ts","../src/plugins/index.ts"],"sourcesContent":["/*!\n * pinia v3.0.3\n * (c) 2025 Eduardo San Martin Morote\n * @license MIT\n */\nimport { hasInjectionContext, inject, toRaw, watch, unref, markRaw, effectScope, ref, isRef, isReactive, getCurrentScope, onScopeDispose, getCurrentInstance, reactive, toRef, nextTick, computed, toRefs } from 'vue';\nimport { setupDevtoolsPlugin } from '@vue/devtools-api';\n\n/**\n * setActivePinia must be called to handle SSR at the top of functions like\n * `fetch`, `setup`, `serverPrefetch` and others\n */\nlet activePinia;\n/**\n * Sets or unsets the active pinia. Used in SSR and internally when calling\n * actions and getters\n *\n * @param pinia - Pinia instance\n */\n// @ts-expect-error: cannot constrain the type of the return\nconst setActivePinia = (pinia) => (activePinia = pinia);\n/**\n * Get the currently active pinia if there is any.\n */\nconst getActivePinia = () => (hasInjectionContext() && inject(piniaSymbol)) || activePinia;\nconst piniaSymbol = ((process.env.NODE_ENV !== 'production') ? Symbol('pinia') : /* istanbul ignore next */ Symbol());\n\nfunction isPlainObject(\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\no) {\n return (o &&\n typeof o === 'object' &&\n Object.prototype.toString.call(o) === '[object Object]' &&\n typeof o.toJSON !== 'function');\n}\n// type DeepReadonly<T> = { readonly [P in keyof T]: DeepReadonly<T[P]> }\n// TODO: can we change these to numbers?\n/**\n * Possible types for SubscriptionCallback\n */\nvar MutationType;\n(function (MutationType) {\n /**\n * Direct mutation of the state:\n *\n * - `store.name = 'new name'`\n * - `store.$state.name = 'new name'`\n * - `store.list.push('new item')`\n */\n MutationType[\"direct\"] = \"direct\";\n /**\n * Mutated the state with `$patch` and an object\n *\n * - `store.$patch({ name: 'newName' })`\n */\n MutationType[\"patchObject\"] = \"patch object\";\n /**\n * Mutated the state with `$patch` and a function\n *\n * - `store.$patch(state => state.name = 'newName')`\n */\n MutationType[\"patchFunction\"] = \"patch function\";\n // maybe reset? for $state = {} and $reset\n})(MutationType || (MutationType = {}));\n\nconst IS_CLIENT = typeof window !== 'undefined';\n\n/*\n * FileSaver.js A saveAs() FileSaver implementation.\n *\n * Originally by Eli Grey, adapted as an ESM module by Eduardo San Martin\n * Morote.\n *\n * License : MIT\n */\n// The one and only way of getting global scope in all environments\n// https://stackoverflow.com/q/3277182/1008999\nconst _global = /*#__PURE__*/ (() => typeof window === 'object' && window.window === window\n ? window\n : typeof self === 'object' && self.self === self\n ? self\n : typeof global === 'object' && global.global === global\n ? global\n : typeof globalThis === 'object'\n ? globalThis\n : { HTMLElement: null })();\nfunction bom(blob, { autoBom = false } = {}) {\n // prepend BOM for UTF-8 XML and text/* types (including HTML)\n // note: your browser will automatically convert UTF-16 U+FEFF to EF BB BF\n if (autoBom &&\n /^\\s*(?:text\\/\\S*|application\\/xml|\\S*\\/\\S*\\+xml)\\s*;.*charset\\s*=\\s*utf-8/i.test(blob.type)) {\n return new Blob([String.fromCharCode(0xfeff), blob], { type: blob.type });\n }\n return blob;\n}\nfunction download(url, name, opts) {\n const xhr = new XMLHttpRequest();\n xhr.open('GET', url);\n xhr.responseType = 'blob';\n xhr.onload = function () {\n saveAs(xhr.response, name, opts);\n };\n xhr.onerror = function () {\n console.error('could not download file');\n };\n xhr.send();\n}\nfunction corsEnabled(url) {\n const xhr = new XMLHttpRequest();\n // use sync to avoid popup blocker\n xhr.open('HEAD', url, false);\n try {\n xhr.send();\n }\n catch (e) { }\n return xhr.status >= 200 && xhr.status <= 299;\n}\n// `a.click()` doesn't work for all browsers (#465)\nfunction click(node) {\n try {\n node.dispatchEvent(new MouseEvent('click'));\n }\n catch (e) {\n const evt = new MouseEvent('click', {\n bubbles: true,\n cancelable: true,\n view: window,\n detail: 0,\n screenX: 80,\n screenY: 20,\n clientX: 80,\n clientY: 20,\n ctrlKey: false,\n altKey: false,\n shiftKey: false,\n metaKey: false,\n button: 0,\n relatedTarget: null,\n });\n node.dispatchEvent(evt);\n }\n}\nconst _navigator = typeof navigator === 'object' ? navigator : { userAgent: '' };\n// Detect WebView inside a native macOS app by ruling out all browsers\n// We just need to check for 'Safari' because all other browsers (besides Firefox) include that too\n// https://www.whatismybrowser.com/guides/the-latest-user-agent/macos\nconst isMacOSWebView = /*#__PURE__*/ (() => /Macintosh/.test(_navigator.userAgent) &&\n /AppleWebKit/.test(_navigator.userAgent) &&\n !/Safari/.test(_navigator.userAgent))();\nconst saveAs = !IS_CLIENT\n ? () => { } // noop\n : // Use download attribute first if possible (#193 Lumia mobile) unless this is a macOS WebView or mini program\n typeof HTMLAnchorElement !== 'undefined' &&\n 'download' in HTMLAnchorElement.prototype &&\n !isMacOSWebView\n ? downloadSaveAs\n : // Use msSaveOrOpenBlob as a second approach\n 'msSaveOrOpenBlob' in _navigator\n ? msSaveAs\n : // Fallback to using FileReader and a popup\n fileSaverSaveAs;\nfunction downloadSaveAs(blob, name = 'download', opts) {\n const a = document.createElement('a');\n a.download = name;\n a.rel = 'noopener'; // tabnabbing\n // TODO: detect chrome extensions & packaged apps\n // a.target = '_blank'\n if (typeof blob === 'string') {\n // Support regular links\n a.href = blob;\n if (a.origin !== location.origin) {\n if (corsEnabled(a.href)) {\n download(blob, name, opts);\n }\n else {\n a.target = '_blank';\n click(a);\n }\n }\n else {\n click(a);\n }\n }\n else {\n // Support blobs\n a.href = URL.createObjectURL(blob);\n setTimeout(function () {\n URL.revokeObjectURL(a.href);\n }, 4e4); // 40s\n setTimeout(function () {\n click(a);\n }, 0);\n }\n}\nfunction msSaveAs(blob, name = 'download', opts) {\n if (typeof blob === 'string') {\n if (corsEnabled(blob)) {\n download(blob, name, opts);\n }\n else {\n const a = document.createElement('a');\n a.href = blob;\n a.target = '_blank';\n setTimeout(function () {\n click(a);\n });\n }\n }\n else {\n // @ts-ignore: works on windows\n navigator.msSaveOrOpenBlob(bom(blob, opts), name);\n }\n}\nfunction fileSaverSaveAs(blob, name, opts, popup) {\n // Open a popup immediately do go around popup blocker\n // Mostly only available on user interaction and the fileReader is async so...\n popup = popup || open('', '_blank');\n if (popup) {\n popup.document.title = popup.document.body.innerText = 'downloading...';\n }\n if (typeof blob === 'string')\n return download(blob, name, opts);\n const force = blob.type === 'application/octet-stream';\n const isSafari = /constructor/i.test(String(_global.HTMLElement)) || 'safari' in _global;\n const isChromeIOS = /CriOS\\/[\\d]+/.test(navigator.userAgent);\n if ((isChromeIOS || (force && isSafari) || isMacOSWebView) &&\n typeof FileReader !== 'undefined') {\n // Safari doesn't allow downloading of blob URLs\n const reader = new FileReader();\n reader.onloadend = function () {\n let url = reader.result;\n if (typeof url !== 'string') {\n popup = null;\n throw new Error('Wrong reader.result type');\n }\n url = isChromeIOS\n ? url\n : url.replace(/^data:[^;]*;/, 'data:attachment/file;');\n if (popup) {\n popup.location.href = url;\n }\n else {\n location.assign(url);\n }\n popup = null; // reverse-tabnabbing #460\n };\n reader.readAsDataURL(blob);\n }\n else {\n const url = URL.createObjectURL(blob);\n if (popup)\n popup.location.assign(url);\n else\n location.href = url;\n popup = null; // reverse-tabnabbing #460\n setTimeout(function () {\n URL.revokeObjectURL(url);\n }, 4e4); // 40s\n }\n}\n\n/**\n * Shows a toast or console.log\n *\n * @param message - message to log\n * @param type - different color of the tooltip\n */\nfunction toastMessage(message, type) {\n const piniaMessage = '🍍 ' + message;\n if (typeof __VUE_DEVTOOLS_TOAST__ === 'function') {\n // No longer available :(\n __VUE_DEVTOOLS_TOAST__(piniaMessage, type);\n }\n else if (type === 'error') {\n console.error(piniaMessage);\n }\n else if (type === 'warn') {\n console.warn(piniaMessage);\n }\n else {\n console.log(piniaMessage);\n }\n}\nfunction isPinia(o) {\n return '_a' in o && 'install' in o;\n}\n\n/**\n * This file contain devtools actions, they are not Pinia actions.\n */\n// ---\nfunction checkClipboardAccess() {\n if (!('clipboard' in navigator)) {\n toastMessage(`Your browser doesn't support the Clipboard API`, 'error');\n return true;\n }\n}\nfunction checkNotFocusedError(error) {\n if (error instanceof Error &&\n error.message.toLowerCase().includes('document is not focused')) {\n toastMessage('You need to activate the \"Emulate a focused page\" setting in the \"Rendering\" panel of devtools.', 'warn');\n return true;\n }\n return false;\n}\nasync function actionGlobalCopyState(pinia) {\n if (checkClipboardAccess())\n return;\n try {\n await navigator.clipboard.writeText(JSON.stringify(pinia.state.value));\n toastMessage('Global state copied to clipboard.');\n }\n catch (error) {\n if (checkNotFocusedError(error))\n return;\n toastMessage(`Failed to serialize the state. Check the console for more details.`, 'error');\n console.error(error);\n }\n}\nasync function actionGlobalPasteState(pinia) {\n if (checkClipboardAccess())\n return;\n try {\n loadStoresState(pinia, JSON.parse(await navigator.clipboard.readText()));\n toastMessage('Global state pasted from clipboard.');\n }\n catch (error) {\n if (checkNotFocusedError(error))\n return;\n toastMessage(`Failed to deserialize the state from clipboard. Check the console for more details.`, 'error');\n console.error(error);\n }\n}\nasync function actionGlobalSaveState(pinia) {\n try {\n saveAs(new Blob([JSON.stringify(pinia.state.value)], {\n type: 'text/plain;charset=utf-8',\n }), 'pinia-state.json');\n }\n catch (error) {\n toastMessage(`Failed to export the state as JSON. Check the console for more details.`, 'error');\n console.error(error);\n }\n}\nlet fileInput;\nfunction getFileOpener() {\n if (!fileInput) {\n fileInput = document.createElement('input');\n fileInput.type = 'file';\n fileInput.accept = '.json';\n }\n function openFile() {\n return new Promise((resolve, reject) => {\n fileInput.onchange = async () => {\n const files = fileInput.files;\n if (!files)\n return resolve(null);\n const file = files.item(0);\n if (!file)\n return resolve(null);\n return resolve({ text: await file.text(), file });\n };\n // @ts-ignore: TODO: changed from 4.3 to 4.4\n fileInput.oncancel = () => resolve(null);\n fileInput.onerror = reject;\n fileInput.click();\n });\n }\n return openFile;\n}\nasync function actionGlobalOpenStateFile(pinia) {\n try {\n const open = getFileOpener();\n const result = await open();\n if (!result)\n return;\n const { text, file } = result;\n loadStoresState(pinia, JSON.parse(text));\n toastMessage(`Global state imported from \"${file.name}\".`);\n }\n catch (error) {\n toastMessage(`Failed to import the state from JSON. Check the console for more details.`, 'error');\n console.error(error);\n }\n}\nfunction loadStoresState(pinia, state) {\n for (const key in state) {\n const storeState = pinia.state.value[key];\n // store is already instantiated, patch it\n if (storeState) {\n Object.assign(storeState, state[key]);\n }\n else {\n // store is not instantiated, set the initial state\n pinia.state.value[key] = state[key];\n }\n }\n}\n\nfunction formatDisplay(display) {\n return {\n _custom: {\n display,\n },\n };\n}\nconst PINIA_ROOT_LABEL = '🍍 Pinia (root)';\nconst PINIA_ROOT_ID = '_root';\nfunction formatStoreForInspectorTree(store) {\n return isPinia(store)\n ? {\n id: PINIA_ROOT_ID,\n label: PINIA_ROOT_LABEL,\n }\n : {\n id: store.$id,\n label: store.$id,\n };\n}\nfunction formatStoreForInspectorState(store) {\n if (isPinia(store)) {\n const storeNames = Array.from(store._s.keys());\n const storeMap = store._s;\n const state = {\n state: storeNames.map((storeId) => ({\n editable: true,\n key: storeId,\n value: store.state.value[storeId],\n })),\n getters: storeNames\n .filter((id) => storeMap.get(id)._getters)\n .map((id) => {\n const store = storeMap.get(id);\n return {\n editable: false,\n key: id,\n value: store._getters.reduce((getters, key) => {\n getters[key] = store[key];\n return getters;\n }, {}),\n };\n }),\n };\n return state;\n }\n const state = {\n state: Object.keys(store.$state).map((key) => ({\n editable: true,\n key,\n value: store.$state[key],\n })),\n };\n // avoid adding empty getters\n if (store._getters && store._getters.length) {\n state.getters = store._getters.map((getterName) => ({\n editable: false,\n key: getterName,\n value: store[getterName],\n }));\n }\n if (store._customProperties.size) {\n state.customProperties = Array.from(store._customProperties).map((key) => ({\n editable: true,\n key,\n value: store[key],\n }));\n }\n return state;\n}\nfunction formatEventData(events) {\n if (!events)\n return {};\n if (Array.isArray(events)) {\n // TODO: handle add and delete for arrays and objects\n return events.reduce((data, event) => {\n data.keys.push(event.key);\n data.operations.push(event.type);\n data.oldValue[event.key] = event.oldValue;\n data.newValue[event.key] = event.newValue;\n return data;\n }, {\n oldValue: {},\n keys: [],\n operations: [],\n newValue: {},\n });\n }\n else {\n return {\n operation: formatDisplay(events.type),\n key: formatDisplay(events.key),\n oldValue: events.oldValue,\n newValue: events.newValue,\n };\n }\n}\nfunction formatMutationType(type) {\n switch (type) {\n case MutationType.direct:\n return 'mutation';\n case MutationType.patchFunction:\n return '$patch';\n case MutationType.patchObject:\n return '$patch';\n default:\n return 'unknown';\n }\n}\n\n// timeline can be paused when directly changing the state\nlet isTimelineActive = true;\nconst componentStateTypes = [];\nconst MUTATIONS_LAYER_ID = 'pinia:mutations';\nconst INSPECTOR_ID = 'pinia';\nconst { assign: assign$1 } = Object;\n/**\n * Gets the displayed name of a store in devtools\n *\n * @param id - id of the store\n * @returns a formatted string\n */\nconst getStoreType = (id) => '🍍 ' + id;\n/**\n * Add the pinia plugin without any store. Allows displaying a Pinia plugin tab\n * as soon as it is added to the application.\n *\n * @param app - Vue application\n * @param pinia - pinia instance\n */\nfunction registerPiniaDevtools(app, pinia) {\n setupDevtoolsPlugin({\n id: 'dev.esm.pinia',\n label: 'Pinia 🍍',\n logo: 'https://pinia.vuejs.org/logo.svg',\n packageName: 'pinia',\n homepage: 'https://pinia.vuejs.org',\n componentStateTypes,\n app,\n }, (api) => {\n if (typeof api.now !== 'function') {\n toastMessage('You seem to be using an outdated version of Vue Devtools. Are you still using the Beta release instead of the stable one? You can find the links at https://devtools.vuejs.org/guide/installation.html.');\n }\n api.addTimelineLayer({\n id: MUTATIONS_LAYER_ID,\n label: `Pinia 🍍`,\n color: 0xe5df88,\n });\n api.addInspector({\n id: INSPECTOR_ID,\n label: 'Pinia 🍍',\n icon: 'storage',\n treeFilterPlaceholder: 'Search stores',\n actions: [\n {\n icon: 'content_copy',\n action: () => {\n actionGlobalCopyState(pinia);\n },\n tooltip: 'Serialize and copy the state',\n },\n {\n icon: 'content_paste',\n action: async () => {\n await actionGlobalPasteState(pinia);\n api.sendInspectorTree(INSPECTOR_ID);\n api.sendInspectorState(INSPECTOR_ID);\n },\n tooltip: 'Replace the state with the content of your clipboard',\n },\n {\n icon: 'save',\n action: () => {\n actionGlobalSaveState(pinia);\n },\n tooltip: 'Save the state as a JSON file',\n },\n {\n icon: 'folder_open',\n action: async () => {\n await actionGlobalOpenStateFile(pinia);\n api.sendInspectorTree(INSPECTOR_ID);\n api.sendInspectorState(INSPECTOR_ID);\n },\n tooltip: 'Import the state from a JSON file',\n },\n ],\n nodeActions: [\n {\n icon: 'restore',\n tooltip: 'Reset the state (with \"$reset\")',\n action: (nodeId) => {\n const store = pinia._s.get(nodeId);\n if (!store) {\n toastMessage(`Cannot reset \"${nodeId}\" store because it wasn't found.`, 'warn');\n }\n else if (typeof store.$reset !== 'function') {\n toastMessage(`Cannot reset \"${nodeId}\" store because it doesn't have a \"$reset\" method implemented.`, 'warn');\n }\n else {\n store.$reset();\n toastMessage(`Store \"${nodeId}\" reset.`);\n }\n },\n },\n ],\n });\n api.on.inspectComponent((payload) => {\n const proxy = (payload.componentInstance &&\n payload.componentInstance.proxy);\n if (proxy && proxy._pStores) {\n const piniaStores = payload.componentInstance.proxy._pStores;\n Object.values(piniaStores).forEach((store) => {\n payload.instanceData.state.push({\n type: getStoreType(store.$id),\n key: 'state',\n editable: true,\n value: store._isOptionsAPI\n ? {\n _custom: {\n value: toRaw(store.$state),\n actions: [\n {\n icon: 'restore',\n tooltip: 'Reset the state of this store',\n action: () => store.$reset(),\n },\n ],\n },\n }\n : // NOTE: workaround to unwrap transferred refs\n Object.keys(store.$state).reduce((state, key) => {\n state[key] = store.$state[key];\n return state;\n }, {}),\n });\n if (store._getters && store._getters.length) {\n payload.instanceData.state.push({\n type: getStoreType(store.$id),\n key: 'getters',\n editable: false,\n value: store._getters.reduce((getters, key) => {\n try {\n getters[key] = store[key];\n }\n catch (error) {\n // @ts-expect-error: we just want to show it in devtools\n getters[key] = error;\n }\n return getters;\n }, {}),\n });\n }\n });\n }\n });\n api.on.getInspectorTree((payload) => {\n if (payload.app === app && payload.inspectorId === INSPECTOR_ID) {\n let stores = [pinia];\n stores = stores.concat(Array.from(pinia._s.values()));\n payload.rootNodes = (payload.filter\n ? stores.filter((store) => '$id' in store\n ? store.$id\n .toLowerCase()\n .includes(payload.filter.toLowerCase())\n : PINIA_ROOT_LABEL.toLowerCase().includes(payload.filter.toLowerCase()))\n : stores).map(formatStoreForInspectorTree);\n }\n });\n // Expose pinia instance as $pinia to window\n globalThis.$pinia = pinia;\n api.on.getInspectorState((payload) => {\n if (payload.app === app && payload.inspectorId === INSPECTOR_ID) {\n const inspectedStore = payload.nodeId === PINIA_ROOT_ID\n ? pinia\n : pinia._s.get(payload.nodeId);\n if (!inspectedStore) {\n // this could be the selected store restored for a different project\n // so it's better not to say anything here\n return;\n }\n if (inspectedStore) {\n // Expose selected store as $store to window\n if (payload.nodeId !== PINIA_ROOT_ID)\n globalThis.$store = toRaw(inspectedStore);\n payload.state = formatStoreForInspectorState(inspectedStore);\n }\n }\n });\n api.on.editInspectorState((payload) => {\n if (payload.app === app && payload.inspectorId === INSPECTOR_ID) {\n const inspectedStore = payload.nodeId === PINIA_ROOT_ID\n ? pinia\n : pinia._s.get(payload.nodeId);\n if (!inspectedStore) {\n return toastMessage(`store \"${payload.nodeId}\" not found`, 'error');\n }\n const { path } = payload;\n if (!isPinia(inspectedStore)) {\n // access only the state\n if (path.length !== 1 ||\n !inspectedStore._customProperties.has(path[0]) ||\n path[0] in inspectedStore.$state) {\n path.unshift('$state');\n }\n }\n else {\n // Root access, we can omit the `.value` because the devtools API does it for us\n path.unshift('state');\n }\n isTimelineActive = false;\n payload.set(inspectedStore, path, payload.state.value);\n isTimelineActive = true;\n }\n });\n api.on.editComponentState((payload) => {\n if (payload.type.startsWith('🍍')) {\n const storeId = payload.type.replace(/^🍍\\s*/, '');\n const store = pinia._s.get(storeId);\n if (!store) {\n return toastMessage(`store \"${storeId}\" not found`, 'error');\n }\n const { path } = payload;\n if (path[0] !== 'state') {\n return toastMessage(`Invalid path for store \"${storeId}\":\\n${path}\\nOnly state can be modified.`);\n }\n // rewrite the first entry to be able to directly set the state as\n // well as any other path\n path[0] = '$state';\n isTimelineActive = false;\n payload.set(store, path, payload.state.value);\n isTimelineActive = true;\n }\n });\n });\n}\nfunction addStoreToDevtools(app, store) {\n if (!componentStateTypes.includes(getStoreType(store.$id))) {\n componentStateTypes.push(getStoreType(store.$id));\n }\n setupDevtoolsPlugin({\n id: 'dev.esm.pinia',\n label: 'Pinia 🍍',\n logo: 'https://pinia.vuejs.org/logo.svg',\n packageName: 'pinia',\n homepage: 'https://pinia.vuejs.org',\n componentStateTypes,\n app,\n settings: {\n logStoreChanges: {\n label: 'Notify about new/deleted stores',\n type: 'boolean',\n defaultValue: true,\n },\n // useEmojis: {\n // label: 'Use emojis in messages ⚡️',\n // type: 'boolean',\n // defaultValue: true,\n // },\n },\n }, (api) => {\n // gracefully handle errors\n const now = typeof api.now === 'function' ? api.now.bind(api) : Date.now;\n store.$onAction(({ after, onError, name, args }) => {\n const groupId = runningActionId++;\n api.addTimelineEvent({\n layerId: MUTATIONS_LAYER_ID,\n event: {\n time: now(),\n title: '🛫 ' + name,\n subtitle: 'start',\n data: {\n store: formatDisplay(store.$id),\n action: formatDisplay(name),\n args,\n },\n groupId,\n },\n });\n after((result) => {\n activeAction = undefined;\n api.addTimelineEvent({\n layerId: MUTATIONS_LAYER_ID,\n event: {\n time: now(),\n title: '🛬 ' + name,\n subtitle: 'end',\n data: {\n store: formatDisplay(store.$id),\n action: formatDisplay(name),\n args,\n result,\n },\n groupId,\n },\n });\n });\n onError((error) => {\n activeAction = undefined;\n api.addTimelineEvent({\n layerId: MUTATIONS_LAYER_ID,\n event: {\n time: now(),\n logType: 'error',\n title: '💥 ' + name,\n subtitle: 'end',\n data: {\n store: formatDisplay(store.$id),\n action: formatDisplay(name),\n args,\n error,\n },\n groupId,\n },\n });\n });\n }, true);\n store._customProperties.forEach((name) => {\n watch(() => unref(store[name]), (newValue, oldValue) => {\n api.notifyComponentUpdate();\n api.sendInspectorState(INSPECTOR_ID);\n if (isTimelineActive) {\n api.addTimelineEvent({\n layerId: MUTATIONS_LAYER_ID,\n event: {\n time: now(),\n title: 'Change',\n subtitle: name,\n data: {\n newValue,\n oldValue,\n },\n groupId: activeAction,\n },\n });\n }\n }, { deep: true });\n });\n store.$subscribe(({ events, type }, state) => {\n api.notifyComponentUpdate();\n api.sendInspectorState(INSPECTOR_ID);\n if (!isTimelineActive)\n return;\n // rootStore.state[store.id] = state\n const eventData = {\n time: now(),\n title: formatMutationType(type),\n data: assign$1({ store: formatDisplay(store.$id) }, formatEventData(events)),\n groupId: activeAction,\n };\n if (type === MutationType.patchFunction) {\n eventData.subtitle = '⤵️';\n }\n else if (type === MutationType.patchObject) {\n eventData.subtitle = '🧩';\n }\n else if (events && !Array.isArray(events)) {\n eventData.subtitle = events.type;\n }\n if (events) {\n eventData.data['rawEvent(s)'] = {\n _custom: {\n display: 'DebuggerEvent',\n type: 'object',\n tooltip: 'raw DebuggerEvent[]',\n value: events,\n },\n };\n }\n api.addTimelineEvent({\n layerId: MUTATIONS_LAYER_ID,\n event: eventData,\n });\n }, { detached: true, flush: 'sync' });\n const hotUpdate = store._hotUpdate;\n store._hotUpdate = markRaw((newStore) => {\n hotUpdate(newStore);\n api.addTimelineEvent({\n layerId: MUTATIONS_LAYER_ID,\n event: {\n time: now(),\n title: '🔥 ' + store.$id,\n subtitle: 'HMR update',\n data: {\n store: formatDisplay(store.$id),\n info: formatDisplay(`HMR update`),\n },\n },\n });\n // update the devtools too\n api.notifyComponentUpdate();\n api.sendInspectorTree(INSPECTOR_ID);\n api.sendInspectorState(INSPECTOR_ID);\n });\n const { $dispose } = store;\n store.$dispose = () => {\n $dispose();\n api.notifyComponentUpdate();\n api.sendInspectorTree(INSPECTOR_ID);\n api.sendInspectorState(INSPECTOR_ID);\n api.getSettings().logStoreChanges &&\n toastMessage(`Disposed \"${store.$id}\" store 🗑`);\n };\n // trigger an update so it can display new registered stores\n api.notifyComponentUpdate();\n api.sendInspectorTree(INSPECTOR_ID);\n api.sendInspectorState(INSPECTOR_ID);\n api.getSettings().logStoreChanges &&\n toastMessage(`\"${store.$id}\" store installed 🆕`);\n });\n}\nlet runningActionId = 0;\nlet activeAction;\n/**\n * Patches a store to enable action grouping in devtools by wrapping the store with a Proxy that is passed as the\n * context of all actions, allowing us to set `runningAction` on each access and effectively associating any state\n * mutation to the action.\n *\n * @param store - store to patch\n * @param actionNames - list of actionst to patch\n */\nfunction patchActionForGrouping(store, actionNames, wrapWithProxy) {\n // original actions of the store as they are given by pinia. We are going to override them\n const actions = actionNames.reduce((storeActions, actionName) => {\n // use toRaw to avoid tracking #541\n storeActions[actionName] = toRaw(store)[actionName];\n return storeActions;\n }, {});\n for (const actionName in actions) {\n store[actionName] = function () {\n // the running action id is incremented in a before action hook\n const _actionId = runningActionId;\n const trackedStore = wrapWithProxy\n ? new Proxy(store, {\n get(...args) {\n activeAction = _actionId;\n return Reflect.get(...args);\n },\n set(...args) {\n activeAction = _actionId;\n return Reflect.set(...args);\n },\n })\n : store;\n // For Setup Stores we need https://github.com/tc39/proposal-async-context\n activeAction = _actionId;\n const retValue = actions[actionName].apply(trackedStore, arguments);\n // this is safer as async actions in Setup Stores would associate mutations done outside of the action\n activeAction = undefined;\n return retValue;\n };\n }\n}\n/**\n * pinia.use(devtoolsPlugin)\n */\nfunction devtoolsPlugin({ app, store, options }) {\n // HMR module\n if (store.$id.startsWith('__hot:')) {\n return;\n }\n // detect option api vs setup api\n store._isOptionsAPI = !!options.state;\n // Do not overwrite actions mocked by @pinia/testing (#2298)\n if (!store._p._testing) {\n patchActionForGrouping(store, Object.keys(options.actions), store._isOptionsAPI);\n // Upgrade the HMR to also update the new actions\n const originalHotUpdate = store._hotUpdate;\n toRaw(store)._hotUpdate = function (newStore) {\n originalHotUpdate.apply(this, arguments);\n patchActionForGrouping(store, Object.keys(newStore._hmrPayload.actions), !!store._isOptionsAPI);\n };\n }\n addStoreToDevtools(app, \n // FIXME: is there a way to allow the assignment from Store<Id, S, G, A> to StoreGeneric?\n store);\n}\n\n/**\n * Creates a Pinia instance to be used by the application\n */\nfunction createPinia() {\n const scope = effectScope(true);\n // NOTE: here we could check the window object for a state and directly set it\n // if there is anything like it with Vue 3 SSR\n const state = scope.run(() => ref({}));\n let _p = [];\n // plugins added before calling app.use(pinia)\n let toBeInstalled = [];\n const pinia = markRaw({\n install(app) {\n // this allows calling useStore() outside of a component setup after\n // installing pinia's plugin\n setActivePinia(pinia);\n pinia._a = app;\n app.provide(piniaSymbol, pinia);\n app.config.globalProperties.$pinia = pinia;\n /* istanbul ignore else */\n if ((((process.env.NODE_ENV !== 'production') || (typeof __VUE_PROD_DEVTOOLS__ !== 'undefined' && __VUE_PROD_DEVTOOLS__)) && !(process.env.NODE_ENV === 'test')) && IS_CLIENT) {\n registerPiniaDevtools(app, pinia);\n }\n toBeInstalled.forEach((plugin) => _p.push(plugin));\n toBeInstalled = [];\n },\n use(plugin) {\n if (!this._a) {\n toBeInstalled.push(plugin);\n }\n else {\n _p.push(plugin);\n }\n return this;\n },\n _p,\n // it's actually undefined here\n // @ts-expect-error\n _a: null,\n _e: scope,\n _s: new Map(),\n state,\n });\n // pinia devtools rely on dev only features so they cannot be forced unless\n // the dev build of Vue is used. Avoid old browsers like IE11.\n if ((((process.env.NODE_ENV !== 'production') || (typeof __VUE_PROD_DEVTOOLS__ !== 'undefined' && __VUE_PROD_DEVTOOLS__)) && !(process.env.NODE_ENV === 'test')) && IS_CLIENT && typeof Proxy !== 'undefined') {\n pinia.use(devtoolsPlugin);\n }\n return pinia;\n}\n/**\n * Dispose a Pinia instance by stopping its effectScope and removing the state, plugins and stores. This is mostly\n * useful in tests, with both a testing pinia or a regular pinia and in applications that use multiple pinia instances.\n * Once disposed, the pinia instance cannot be used anymore.\n *\n * @param pinia - pinia instance\n */\nfunction disposePinia(pinia) {\n pinia._e.stop();\n pinia._s.clear();\n pinia._p.splice(0);\n pinia.state.value = {};\n // @ts-expect-error: non valid\n pinia._a = null;\n}\n\n/**\n * Checks if a function is a `StoreDefinition`.\n *\n * @param fn - object to test\n * @returns true if `fn` is a StoreDefinition\n */\nconst isUseStore = (fn) => {\n return typeof fn === 'function' && typeof fn.$id === 'string';\n};\n/**\n * Mutates in place `newState` with `oldState` to _hot update_ it. It will\n * remove any key not existing in `newState` and recursively merge plain\n * objects.\n *\n * @param newState - new state object to be patched\n * @param oldState - old state that should be used to patch newState\n * @returns - newState\n */\nfunction patchObject(newState, oldState) {\n // no need to go through symbols because they cannot be serialized anyway\n for (const key in oldState) {\n const subPatch = oldState[key];\n // skip the whole sub tree\n if (!(key in newState)) {\n continue;\n }\n const targetValue = newState[key];\n if (isPlainObject(targetValue) &&\n isPlainObject(subPatch) &&\n !isRef(subPatch) &&\n !isReactive(subPatch)) {\n newState[key] = patchObject(targetValue, subPatch);\n }\n else {\n // objects are either a bit more complex (e.g. refs) or primitives, so we\n // just set the whole thing\n newState[key] = subPatch;\n }\n }\n return newState;\n}\n/**\n * Creates an _accept_ function to pass to `import.meta.hot` in Vite applications.\n *\n * @example\n * ```js\n * const useUser = defineStore(...)\n * if (import.meta.hot) {\n * import.meta.hot.accept(acceptHMRUpdate(useUser, import.meta.hot))\n * }\n * ```\n *\n * @param initialUseStore - return of the defineStore to hot update\n * @param hot - `import.meta.hot`\n */\nfunction acceptHMRUpdate(initialUseStore, hot) {\n // strip as much as possible from iife.prod\n if (!(process.env.NODE_ENV !== 'production')) {\n return () => { };\n }\n return (newModule) => {\n const pinia = hot.data.pinia || initialUseStore._pinia;\n if (!pinia) {\n // this store is still not used\n return;\n }\n // preserve the pinia instance across loads\n hot.data.pinia = pinia;\n // console.log('got data', newStore)\n for (const exportName in newModule) {\n const useStore = newModule[exportName];\n // console.log('checking for', exportName)\n if (isUseStore(useStore) && pinia._s.has(useStore.$id)) {\n // console.log('Accepting update for', useStore.$id)\n const id = useStore.$id;\n if (id !== initialUseStore.$id) {\n console.warn(`The id of the store changed from \"${initialUseStore.$id}\" to \"${id}\". Reloading.`);\n // return import.meta.hot.invalidate()\n return hot.invalidate();\n }\n const existingStore = pinia._s.get(id);\n if (!existingStore) {\n console.log(`[Pinia]: skipping hmr because store doesn't exist yet`);\n return;\n }\n useStore(pinia, existingStore);\n }\n }\n };\n}\n\nconst noop = () => { };\nfunction addSubscription(subscriptions, callback, detached, onCleanup = noop) {\n subscriptions.push(callback);\n const removeSubscription = () => {\n const idx = subscriptions.indexOf(callback);\n if (idx > -1) {\n subscriptions.splice(idx, 1);\n onCleanup();\n }\n };\n if (!detached && getCurrentScope()) {\n onScopeDispose(removeSubscription);\n }\n return removeSubscription;\n}\nfunction triggerSubscriptions(subscriptions, ...args) {\n subscriptions.slice().forEach((callback) => {\n callback(...args);\n });\n}\n\nconst fallbackRunWithContext = (fn) => fn();\n/**\n * Marks a function as an action for `$onAction`\n * @internal\n */\nconst ACTION_MARKER = Symbol();\n/**\n * Action name symbol. Allows to add a name to an action after defining it\n * @internal\n */\nconst ACTION_NAME = Symbol();\nfunction mergeReactiveObjects(target, patchToApply) {\n // Handle Map instances\n if (target instanceof Map && patchToApply instanceof Map) {\n patchToApply.forEach((value, key) => target.set(key, value));\n }\n else if (target instanceof Set && patchToApply instanceof Set) {\n // Handle Set instances\n patchToApply.forEach(target.add, target);\n }\n // no need to go through symbols because they cannot be serialized anyway\n for (const key in patchToApply) {\n if (!patchToApply.hasOwnProperty(key))\n continue;\n const subPatch = patchToApply[key];\n const targetValue = target[key];\n if (isPlainObject(targetValue) &&\n isPlainObject(subPatch) &&\n target.hasOwnProperty(key) &&\n !isRef(subPatch) &&\n !isReactive(subPatch)) {\n // NOTE: here I wanted to warn about inconsistent types but it's not possible because in setup stores one might\n // start the value of a property as a certain type e.g. a Map, and then for some reason, during SSR, change that\n // to `undefined`. When trying to hydrate, we want to override the Map with `undefined`.\n target[key] = mergeReactiveObjects(targetValue, subPatch);\n }\n else {\n // @ts-expect-error: subPatch is a valid value\n target[key] = subPatch;\n }\n }\n return target;\n}\nconst skipHydrateSymbol = (process.env.NODE_ENV !== 'production')\n ? Symbol('pinia:skipHydration')\n : /* istanbul ignore next */ Symbol();\n/**\n * Tells Pinia to skip the hydration process of a given object. This is useful in setup stores (only) when you return a\n * stateful object in the store but it isn't really state. e.g. returning a router instance in a setup store.\n *\n * @param obj - target object\n * @returns obj\n */\nfunction skipHydrate(obj) {\n return Object.defineProperty(obj, skipHydrateSymbol, {});\n}\n/**\n * Returns whether a value should be hydrated\n *\n * @param obj - target variable\n * @returns true if `obj` should be hydrated\n */\nfunction shouldHydrate(obj) {\n return (!isPlainObject(obj) ||\n !Object.prototype.hasOwnProperty.call(obj, skipHydrateSymbol));\n}\nconst { assign } = Object;\nfunction isComputed(o) {\n return !!(isRef(o) && o.effect);\n}\nfunction createOptionsStore(id, options, pinia, hot) {\n const { state, actions, getters } = options;\n const initialState = pinia.state.value[id];\n let store;\n function setup() {\n if (!initialState && (!(process.env.NODE_ENV !== 'production') || !hot)) {\n /* istanbul ignore if */\n pinia.state.value[id] = state ? state() : {};\n }\n // avoid creating a state in pinia.state.value\n const localState = (process.env.NODE_ENV !== 'production') && hot\n ? // use ref() to unwrap refs inside state TODO: check if this is still necessary\n toRefs(ref(state ? state() : {}).value)\n : toRefs(pinia.state.value[id]);\n return assign(localState, actions, Object.keys(getters || {}).reduce((computedGetters, name) => {\n if ((process.env.NODE_ENV !== 'production') && name in localState) {\n console.warn(`[🍍]: A getter cannot have the same name as another state property. Rename one of them. Found with \"${name}\" in store \"${id}\".`);\n }\n computedGetters[name] = markRaw(computed(() => {\n setActivePinia(pinia);\n // it was created just before\n const store = pinia._s.get(id);\n // allow cross using stores\n // @ts-expect-error\n // return getters![name].call(context, context)\n // TODO: avoid reading the getter while assigning with a global variable\n return getters[name].call(store, store);\n }));\n return computedGetters;\n }, {}));\n }\n store = createSetupStore(id, setup, options, pinia, hot, true);\n return store;\n}\nfunction createSetupStore($id, setup, options = {}, pinia, hot, isOptionsStore) {\n let scope;\n const optionsForPlugin = assign({ actions: {} }, options);\n /* istanbul ignore if */\n if ((process.env.NODE_ENV !== 'production') && !pinia._e.active) {\n throw new Error('Pinia destroyed');\n }\n // watcher options for $subscribe\n const $subscribeOptions = { deep: true };\n /* istanbul ignore else */\n if ((process.env.NODE_ENV !== 'production')) {\n $subscribeOptions.onTrigger = (event) => {\n /* istanbul ignore else */\n if (isListening) {\n debuggerEvents = event;\n // avoid triggering this while the store is being built and the state is being set in pinia\n }\n else if (isListening == false && !store._hotUpdating) {\n // let patch send all the events together later\n /* istanbul ignore else */\n if (Array.isArray(debuggerEvents)) {\n debuggerEvents.push(event);\n }\n else {\n console.error('🍍 debuggerEvents should be an array. This is most likely an internal Pinia bug.');\n }\n }\n };\n }\n // internal state\n let isListening; // set to true at the end\n let isSyncListening; // set to true at the end\n let subscriptions = [];\n let actionSubscriptions = [];\n let debuggerEvents;\n const initialState = pinia.state.value[$id];\n // avoid setting the state for option stores if it is set\n // by the setup\n if (!isOptionsStore && !initialState && (!(process.env.NODE_ENV !== 'production') || !hot)) {\n /* istanbul ignore if */\n pinia.state.value[$id] = {};\n }\n const hotState = ref({});\n // avoid triggering too many listeners\n // https://github.com/vuejs/pinia/issues/1129\n let activeListener;\n function $patch(partialStateOrMutator) {\n let subscriptionMutation;\n isListening = isSyncListening = false;\n // reset the debugger events since patches are sync\n /* istanbul ignore else */\n if ((process.env.NODE_ENV !== 'production')) {\n debuggerEvents = [];\n }\n if (typeof partialStateOrMutator === 'function') {\n partialStateOrMutator(pinia.state.value[$id]);\n subscriptionMutation = {\n type: MutationType.patchFunction,\n storeId: $id,\n events: debuggerEvents,\n };\n }\n else {\n mergeReactiveObjects(pinia.state.value[$id], partialStateOrMutator);\n subscriptionMutation = {\n type: MutationType.patchObject,\n payload: partialStateOrMutator,\n storeId: $id,\n events: debuggerEvents,\n };\n }\n const myListenerId = (activeListener = Symbol());\n nextTick().then(() => {\n if (activeListener === myListenerId) {\n isListening = true;\n }\n });\n isSyncListening = true;\n // because we paused the watcher, we need to manually call the subscriptions\n triggerSubscriptions(subscriptions, subscriptionMutation, pinia.state.value[$id]);\n }\n const $reset = isOptionsStore\n ? function $reset() {\n const { state } = options;\n const newState = state ? state() : {};\n // we use a patch to group all changes into one single subscription\n this.$patch(($state) => {\n // @ts-expect-error: FIXME: shouldn't error?\n assign($state, newState);\n });\n }\n : /* istanbul ignore next */\n (process.env.NODE_ENV !== 'production')\n ? () => {\n throw new Error(`🍍: Store \"${$id}\" is built using the setup syntax and does not implement $reset().`);\n }\n : noop;\n function $dispose() {\n scope.stop();\n subscriptions = [];\n actionSubscriptions = [];\n pinia._s.delete($id);\n }\n /**\n * Helper that wraps function so it can be tracked with $onAction\n * @param fn - action to wrap\n * @param name - name of the action\n */\n const action = (fn, name = '') => {\n if (ACTION_MARKER in fn) {\n fn[ACTION_NAME] = name;\n return fn;\n }\n const wrappedAction = function () {\n setActivePinia(pinia);\n const args = Array.from(arguments);\n const afterCallbackList = [];\n const onErrorCallbackList = [];\n function after(callback) {\n afterCallbackList.push(callback);\n }\n function onError(callback) {\n onErrorCallbackList.push(callback);\n }\n // @ts-expect-error\n triggerSubscriptions(actionSubscriptions, {\n args,\n name: wrappedAction[ACTION_NAME],\n store,\n after,\n onError,\n });\n let ret;\n try {\n ret = fn.apply(this && this.$id === $id ? this : store, args);\n // handle sync errors\n }\n catch (error) {\n triggerSubscriptions(onErrorCallbackList, error);\n throw error;\n }\n if (ret instanceof Promise) {\n return ret\n .then((value) => {\n triggerSubscriptions(afterCallbackList, value);\n return value;\n })\n .catch((error) => {\n triggerSubscriptions(onErrorCallbackList, error);\n return Promise.reject(error);\n });\n }\n // trigger after callbacks\n triggerSubscriptions(afterCallbackList, ret);\n return ret;\n };\n wrappedAction[ACTION_MARKER] = true;\n wrappedAction[ACTION_NAME] = name; // will be set later\n // @ts-expect-error: we are intentionally limiting the returned type to just Fn\n // because all the added properties are internals that are exposed through `$onAction()` only\n return wrappedAction;\n };\n const _hmrPayload = /*#__PURE__*/ markRaw({\n actions: {},\n getters: {},\n state: [],\n hotState,\n });\n const partialStore = {\n _p: pinia,\n // _s: scope,\n $id,\n $onAction: addSubscription.bind(null, actionSubscriptions),\n $patch,\n $reset,\n $subscribe(callback, options = {}) {\n const removeSubscription = addSubscription(subscriptions, callback, options.detached, () => stopWatcher());\n const stopWatcher = scope.run(() => watch(() => pinia.state.value[$id], (state) => {\n if (options.flush === 'sync' ? isSyncListening : isListening) {\n callback({\n storeId: $id,\n type: MutationType.direct,\n events: debuggerEvents,\n }, state);\n }\n }, assign({}, $subscribeOptions, options)));\n return removeSubscription;\n },\n $dispose,\n };\n const store = reactive((process.env.NODE_ENV !== 'production') || ((((process.env.NODE_ENV !== 'production') || (typeof __VUE_PROD_DEVTOOLS__ !== 'undefined' && __VUE_PROD_DEVTOOLS__)) && !(process.env.NODE_ENV === 'test')) && IS_CLIENT)\n ? assign({\n _hmrPayload,\n _customProperties: markRaw(new Set()), // devtools custom properties\n }, partialStore\n // must be added later\n // setupStore\n )\n : partialStore);\n // store the partial store now so the setup of stores can instantiate each other before they are finished without\n // creating infinite loops.\n pinia._s.set($id, store);\n const runWithContext = (pinia._a && pinia._a.runWithContext) || fallbackRunWithContext;\n // TODO: idea create skipSerialize that marks properties as non serializable and they are skipped\n const setupStore = runWithContext(() => pinia._e.run(() => (scope = effectScope()).run(() => setup({ action }))));\n // overwrite existing actions to support $onAction\n for (const key in setupStore) {\n const prop = setupStore[key];\n if ((isRef(prop) && !isComputed(prop)) || isReactive(prop)) {\n // mark it as a piece of state to be serialized\n if ((process.env.NODE_ENV !== 'production') && hot) {\n hotState.value[key] = toRef(setupStore, key);\n // createOptionStore directly sets the state in pinia.state.value so we\n // can just skip that\n }\n else if (!isOptionsStore) {\n // in setup stores we must hydrate the state and sync pinia state tree with the refs the user just created\n if (initialState && shouldHydrate(prop)) {\n if (isRef(prop)) {\n prop.value = initialState[key];\n }\n else {\n // probably a reactive object, lets recursively assign\n // @ts-expect-error: prop is unknown\n mergeReactiveObjects(prop, initialState[key]);\n }\n }\n // transfer the ref to the pinia state to keep everything in sync\n pinia.state.value[$id][key] = prop;\n }\n /* istanbul ignore else */\n if ((process.env.NODE_ENV !== 'production')) {\n _hmrPayload.state.push(key);\n }\n // action\n }\n else if (typeof prop === 'function') {\n const actionValue = (process.env.NODE_ENV !== 'production') && hot ? prop : action(prop, key);\n // this a hot module replacement store because the hotUpdate method needs\n // to do it with the right context\n // @ts-expect-error\n setupStore[key] = actionValue;\n /* istanbul ignore else */\n if ((process.env.NODE_ENV !== 'production')) {\n _hmrPayload.actions[key] = prop;\n }\n // list actions so they can be used in plugins\n // @ts-expect-error\n optionsForPlugin.actions[key] = prop;\n }\n else if ((process.env.NODE_ENV !== 'production')) {\n // add getters for devtools\n if (isComputed(prop)) {\n _hmrPayload.getters[key] = isOptionsStore\n ? // @ts-expect-error\n options.getters[key]\n : prop;\n if (IS_CLIENT) {\n const getters = setupStore._getters ||\n // @ts-expect-error: same\n (setupStore._getters = markRaw([]));\n getters.push(key);\n }\n }\n }\n }\n // add the state, getters, and action properties\n /* istanbul ignore if */\n assign(store, setupStore);\n // allows retrieving reactive objects with `storeToRefs()`. Must be called after assigning to the reactive object.\n // Make `storeToRefs()` work with `reactive()` #799\n assign(toRaw(store), setupStore);\n // use this instead of a computed with setter to be able to create it anywhere\n // without linking the computed lifespan to wherever the store is first\n // created.\n Object.defineProperty(store, '$state', {\n get: () => ((process.env.NODE_ENV !== 'production') && hot ? hotState.value : pinia.state.value[$id]),\n set: (state) => {\n /* istanbul ignore if */\n if ((process.env.NODE_ENV !== 'production') && hot) {\n throw new Error('cannot set hotState');\n }\n $patch(($state) => {\n // @ts-expect-error: FIXME: shouldn't error?\n assign($state, state);\n });\n },\n });\n // add the hotUpdate before plugins to allow them to override it\n /* istanbul ignore else */\n if ((process.env.NODE_ENV !== 'production')) {\n store._hotUpdate = markRaw((newStore) => {\n store._hotUpdating = true;\n newStore._hmrPayload.state.forEach((stateKey) => {\n if (stateKey in store.$state) {\n const newStateTarget = newStore.$state[stateKey];\n const oldStateSource = store.$state[stateKey];\n if (typeof newStateTarget === 'object' &&\n isPlainObject(newStateTarget) &&\n isPlainObject(oldStateSource)) {\n patchObject(newStateTarget, oldStateSource);\n }\n else {\n // transfer the ref\n newStore.$state[stateKey] = oldStateSource;\n }\n }\n // patch direct access properties to allow store.stateProperty to work as\n // store.$state.stateProperty\n // @ts-expect-error: any type\n store[stateKey] = toRef(newStore.$state, stateKey);\n });\n // remove deleted state properties\n Object.keys(store.$state).forEach((stateKey) => {\n if (!(stateKey in newStore.$state)) {\n // @ts-expect-error: noop if doesn't exist\n delete store[stateKey];\n }\n });\n // avoid devtools logging this as a mutation\n isListening = false;\n isSyncListening = false;\n pinia.state.value[$id] = toRef(newStore._hmrPayload, 'hotState');\n isSyncListening = true;\n nextTick().then(() => {\n isListening = true;\n });\n for (const actionName in newStore._hmrPayload.actions) {\n const actionFn = newStore[actionName];\n // @ts-expect-error: actionName is a string\n store[actionName] =\n //\n action(actionFn, actionName);\n }\n // TODO: does this work in both setup and option store?\n for (const getterName in newStore._hmrPayload.getters) {\n const getter = newStore._hmrPayload.getters[getterName];\n const getterValue = isOptionsStore\n ? // special handling of options api\n computed(() => {\n setActivePinia(pinia);\n return getter.call(store, store);\n })\n : getter;\n // @ts-expect-error: getterName is a string\n store[getterName] =\n //\n getterValue;\n }\n // remove deleted getters\n Object.keys(store._hmrPayload.getters).forEach((key) => {\n if (!(key in newStore._hmrPayload.getters)) {\n // @ts-expect-error: noop if doesn't exist\n delete store[key];\n }\n });\n // remove old actions\n Object.keys(store._hmrPayload.actions).forEach((key) => {\n if (!(key in newStore._hmrPayload.actions)) {\n // @ts-expect-error: noop if doesn't exist\n delete store[key];\n }\n });\n // update the values used in devtools and to allow deleting new properties later on\n store._hmrPayload = newStore._hmrPayload;\n store._getters = newStore._getters;\n store._hotUpdating = false;\n });\n }\n if ((((process.env.NODE_ENV !== 'production') || (typeof __VUE_PROD_DEVTOOLS__ !== 'undefined' && __VUE_PROD_DEVTOOLS__)) && !(process.env.NODE_ENV === 'test')) && IS_CLIENT) {\n const nonEnumerable = {\n writable: true,\n configurable: true,\n // avoid warning on devtools trying to display this property\n enumerable: false,\n };\n ['_p', '_hmrPayload', '_getters', '_customProperties'].forEach((p) => {\n Object.defineProperty(store, p, assign({ value: store[p] }, nonEnumerable));\n });\n }\n // apply all plugins\n pinia._p.forEach((extender) => {\n /* istanbul ignore else */\n if ((((process.env.NODE_ENV !== 'production') || (typeof __VUE_PROD_DEVTOOLS__ !== 'undefined' && __VUE_PROD_DEVTOOLS__)) && !(process.env.NODE_ENV === 'test')) && IS_CLIENT) {\n const extensions = scope.run(() => extender({\n store: store,\n app: pinia._a,\n pinia,\n options: optionsForPlugin,\n }));\n Object.keys(extensions || {}).forEach((key) => store._customProperties.add(key));\n assign(store, extensions);\n }\n else {\n assign(store, scope.run(() => extender({\n store: store,\n app: pinia._a,\n pinia,\n options: optionsForPlugin,\n })));\n }\n });\n if ((process.env.NODE_ENV !== 'production') &&\n store.$state &&\n typeof store.$state === 'object' &&\n typeof store.$state.constructor === 'function' &&\n !store.$state.constructor.toString().includes('[native code]')) {\n console.warn(`[🍍]: The \"state\" must be a plain object. It cannot be\\n` +\n `\\tstate: () => new MyClass()\\n` +\n `Found in store \"${store.$id}\".`);\n }\n // only apply hydrate to option stores with an initial state in pinia\n if (initialState &&\n isOptionsStore &&\n options.hydrate) {\n options.hydrate(store.$state, initialState);\n }\n isListening = true;\n isSyncListening = true;\n return store;\n}\n// allows unused stores to be tree shaken\n/*! #__NO_SIDE_EFFECTS__ */\nfunction defineStore(\n// TODO: add proper types from above\nid, setup, setupOptions) {\n let options;\n const isSetupStore = typeof setup === 'function';\n // the option store setup will contain the actual options in this case\n options = isSetupStore ? setupOptions : setup;\n function useStore(pinia, hot) {\n const hasContext = hasInjectionContext();\n pinia =\n // in test mode, ignore the argument provided as we can always retrieve a\n // pinia instance with getActivePinia()\n ((process.env.NODE_ENV === 'test') && activePinia && activePinia._testing ? null : pinia) ||\n (hasContext ? inject(piniaSymbol, null) : null);\n if (pinia)\n setActivePinia(pinia);\n if ((process.env.NODE_ENV !== 'production') && !activePinia) {\n throw new Error(`[🍍]: \"getActivePinia()\" was called but there was no active Pinia. Are you trying to use a store before calling \"app.use(pinia)\"?\\n` +\n `See https://pinia.vuejs.org/core-concepts/outside-component-usage.html for help.\\n` +\n `This will fail in production.`);\n }\n pinia = activePinia;\n if (!pinia._s.has(id)) {\n // creating the store registers it in `pinia._s`\n if (isSetupStore) {\n createSetupStore(id, setup, options, pinia);\n }\n else {\n createOptionsStore(id, options, pinia);\n }\n /* istanbul ignore else */\n if ((process.env.NODE_ENV !== 'production')) {\n // @ts-expect-error: not the right inferred type\n useStore._pinia = pinia;\n }\n }\n const store = pinia._s.get(id);\n if ((process.env.NODE_ENV !== 'production') && hot) {\n const hotId = '__hot:' + id;\n const newStore = isSetupStore\n ? createSetupStore(hotId, setup, options, pinia, true)\n : createOptionsStore(hotId, assign({}, options), pinia, true);\n hot._hotUpdate(newStore);\n // cleanup the state properties and the store from the cache\n delete pinia.state.value[hotId];\n pinia._s.delete(hotId);\n }\n if ((process.env.NODE_ENV !== 'production') && IS_CLIENT) {\n const currentInstance = getCurrentInstance();\n // save stores in instances to access them devtools\n if (currentInstance &&\n currentInstance.proxy &&\n // avoid adding stores that are just built for hot module replacement\n !hot) {\n const vm = currentInstance.proxy;\n const cache = '_pStores' in vm ? vm._pStores : (vm._pStores = {});\n cache[id] = store;\n }\n }\n // StoreGeneric cannot be casted towards Store\n return store;\n }\n useStore.$id = id;\n return useStore;\n}\n\nlet mapStoreSuffix = 'Store';\n/**\n * Changes the suffix added by `mapStores()`. Can be set to an empty string.\n * Defaults to `\"Store\"`. Make sure to extend the MapStoresCustomization\n * interface if you are using TypeScript.\n *\n * @param suffix - new suffix\n */\nfunction setMapStoreSuffix(suffix // could be 'Store' but that would be annoying for JS\n) {\n mapStoreSuffix = suffix;\n}\n/**\n * Allows using stores without the composition API (`setup()`) by generating an\n * object to be spread in the `computed` field of a component. It accepts a list\n * of store definitions.\n *\n * @example\n * ```js\n * export default {\n * computed: {\n * // other computed properties\n * ...mapStores(useUserStore, useCartStore)\n * },\n *\n * created() {\n * this.userStore // store with id \"user\"\n * this.cartStore // store with id \"cart\"\n * }\n * }\n * ```\n *\n * @param stores - list of stores to map to an object\n */\nfunction mapStores(...stores) {\n if ((process.env.NODE_ENV !== 'production') && Array.isArray(stores[0])) {\n console.warn(`[🍍]: Directly pass all stores to \"mapStores()\" without putting them in an array:\\n` +\n `Replace\\n` +\n `\\tmapStores([useAuthStore, useCartStore])\\n` +\n `with\\n` +\n `\\tmapStores(useAuthStore, useCartStore)\\n` +\n `This will fail in production if not fixed.`);\n stores = stores[0];\n }\n return stores.reduce((reduced, useStore) => {\n // @ts-expect-error: $id is added by defineStore\n reduced[useStore.$id + mapStoreSuffix] = function () {\n return useStore(this.$pinia);\n };\n return reduced;\n }, {});\n}\n/**\n * Allows using state and getters from one store without using the composition\n * API (`setup()`) by generating an object to be spread in the `computed` field\n * of a component.\n *\n * @param useStore - store to map from\n * @param keysOrMapper - array or object\n */\nfunction mapState(useStore, keysOrMapper) {\n return Array.isArray(keysOrMapper)\n ? keysOrMapper.reduce((reduced, key) => {\n reduced[key] = function () {\n // @ts-expect-error: FIXME: should work?\n return useStore(this.$pinia)[key];\n };\n return reduced;\n }, {})\n : Object.keys(keysOrMapper).reduce((reduced, key) => {\n // @ts-expect-error\n reduced[key] = function () {\n const store = useStore(this.$pinia);\n const storeKey = keysOrMapper[key];\n // for some reason TS is unable to infer the type of storeKey to be a\n // function\n return typeof storeKey === 'function'\n ? storeKey.call(this, store)\n : // @ts-expect-error: FIXME: should work?\n store[storeKey];\n };\n return reduced;\n }, {});\n}\n/**\n * Alias for `mapState()`. You should use `mapState()` instead.\n * @deprecated use `mapState()` instead.\n */\nconst mapGetters = mapState;\n/**\n * Allows directly using actions from your store without using the composition\n * API (`setup()`) by generating an object to be spread in the `methods` field\n * of a component.\n *\n * @param useStore - store to map from\n * @param keysOrMapper - array or object\n */\nfunction mapActions(useStore, keysOrMapper) {\n return Array.isArray(keysOrMapper)\n ? keysOrMapper.reduce((reduced, key) => {\n // @ts-expect-error\n reduced[key] = function (...args) {\n // @ts-expect-error: FIXME: should work?\n return useStore(this.$pinia)[key](...args);\n };\n return reduced;\n }, {})\n : Object.keys(keysOrMapper).reduce((reduced, key) => {\n // @ts-expect-error\n reduced[key] = function (...args) {\n // @ts-expect-error: FIXME: should work?\n return useStore(this.$pinia)[keysOrMapper[key]](...args);\n };\n return reduced;\n }, {});\n}\n/**\n * Allows using state and getters from one store without using the composition\n * API (`setup()`) by generating an object to be spread in the `computed` field\n * of a component.\n *\n * @param useStore - store to map from\n * @param keysOrMapper - array or object\n */\nfunction mapWritableState(useStore, keysOrMapper) {\n return Array.isArray(keysOrMapper)\n ? keysOrMapper.reduce((reduced, key) => {\n reduced[key] = {\n get() {\n return useStore(this.$pinia)[key];\n },\n set(value) {\n return (useStore(this.$pinia)[key] = value);\n },\n };\n return reduced;\n }, {})\n : Object.keys(keysOrMapper).reduce((reduced, key) => {\n reduced[key] = {\n get() {\n return useStore(this.$pinia)[keysOrMapper[key]];\n },\n set(value) {\n return (useStore(this.$pinia)[keysOrMapper[key]] = value);\n },\n };\n return reduced;\n }, {});\n}\n\n/**\n * Creates an object of references with all the state, getters, and plugin-added\n * state properties of the store. Similar to `toRefs()` but specifically\n * designed for Pinia stores so methods and non reactive properties are\n * completely ignored.\n *\n * @param store - store to extract the refs from\n */\nfunction storeToRefs(store) {\n const rawStore = toRaw(store);\n const refs = {};\n for (const key in rawStore) {\n const value = rawStore[key];\n // There is no native method to check for a computed\n // https://github.com/vuejs/core/pull/4165\n if (value.effect) {\n // @ts-expect-error: too hard to type correctly\n refs[key] =\n // ...\n computed({\n get: () => store[key],\n set(value) {\n store[key] = value;\n },\n });\n }\n else if (isRef(value) || isReactive(value)) {\n // @ts-expect-error: the key is state or getter\n refs[key] =\n // ---\n toRef(store, key);\n }\n }\n return refs;\n}\n\nexport { MutationType, acceptHMRUpdate, createPinia, defineStore, disposePinia, getActivePinia, mapActions, mapGetters, mapState, mapStores, mapWritableState, setActivePinia, setMapStoreSuffix, shouldHydrate, skipHydrate, storeToRefs };\n","import { computed, customRef, effectScope, getCurrentInstance, getCurrentScope, hasInjectionContext, inject, isReactive, isRef, nextTick, onBeforeMount, onBeforeUnmount, onMounted, onScopeDispose, onUnmounted, provide, reactive, readonly, ref, shallowReadonly, shallowRef, toRef as toRef$1, toRefs as toRefs$1, toValue, unref, watch, watchEffect } from \"vue\";\n\n//#region computedEager/index.ts\n/**\n*\n* @deprecated This function will be removed in future version.\n*\n* Note: If you are using Vue 3.4+, you can straight use computed instead.\n* Because in Vue 3.4+, if computed new value does not change,\n* computed, effect, watch, watchEffect, render dependencies will not be triggered.\n* refer: https://github.com/vuejs/core/pull/5912\n*\n* @param fn effect function\n* @param options WatchOptionsBase\n* @returns readonly shallowRef\n*/\nfunction computedEager(fn, options) {\n\tvar _options$flush;\n\tconst result = shallowRef();\n\twatchEffect(() => {\n\t\tresult.value = fn();\n\t}, {\n\t\t...options,\n\t\tflush: (_options$flush = options === null || options === void 0 ? void 0 : options.flush) !== null && _options$flush !== void 0 ? _options$flush : \"sync\"\n\t});\n\treturn readonly(result);\n}\n/** @deprecated use `computedEager` instead */\nconst eagerComputed = computedEager;\n\n//#endregion\n//#region computedWithControl/index.ts\n/**\n* Explicitly define the deps of computed.\n*\n* @param source\n* @param fn\n*/\nfunction computedWithControl(source, fn, options = {}) {\n\tlet v = void 0;\n\tlet track;\n\tlet trigger;\n\tlet dirty = true;\n\tconst update = () => {\n\t\tdirty = true;\n\t\ttrigger();\n\t};\n\twatch(source, update, {\n\t\tflush: \"sync\",\n\t\t...options\n\t});\n\tconst get$1 = typeof fn === \"function\" ? fn : fn.get;\n\tconst set$1 = typeof fn === \"function\" ? void 0 : fn.set;\n\tconst result = customRef((_track, _trigger) => {\n\t\ttrack = _track;\n\t\ttrigger = _trigger;\n\t\treturn {\n\t\t\tget() {\n\t\t\t\tif (dirty) {\n\t\t\t\t\tv = get$1(v);\n\t\t\t\t\tdirty = false;\n\t\t\t\t}\n\t\t\t\ttrack();\n\t\t\t\treturn v;\n\t\t\t},\n\t\t\tset(v$1) {\n\t\t\t\tset$1 === null || set$1 === void 0 || set$1(v$1);\n\t\t\t}\n\t\t};\n\t});\n\tresult.trigger = update;\n\treturn result;\n}\n/** @deprecated use `computedWithControl` instead */\nconst controlledComputed = computedWithControl;\n\n//#endregion\n//#region tryOnScopeDispose/index.ts\n/**\n* Call onScopeDispose() if it's inside an effect scope lifecycle, if not, do nothing\n*\n* @param fn\n*/\nfunction tryOnScopeDispose(fn, failSilently) {\n\tif (getCurrentScope()) {\n\t\tonScopeDispose(fn, failSilently);\n\t\treturn true;\n\t}\n\treturn false;\n}\n\n//#endregion\n//#region createEventHook/index.ts\n/**\n* Utility for creating event hooks\n*\n* @see https://vueuse.org/createEventHook\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction createEventHook() {\n\tconst fns = /* @__PURE__ */ new Set();\n\tconst off = (fn) => {\n\t\tfns.delete(fn);\n\t};\n\tconst clear = () => {\n\t\tfns.clear();\n\t};\n\tconst on = (fn) => {\n\t\tfns.add(fn);\n\t\tconst offFn = () => off(fn);\n\t\ttryOnScopeDispose(offFn);\n\t\treturn { off: offFn };\n\t};\n\tconst trigger = (...args) => {\n\t\treturn Promise.all(Array.from(fns).map((fn) => fn(...args)));\n\t};\n\treturn {\n\t\ton,\n\t\toff,\n\t\ttrigger,\n\t\tclear\n\t};\n}\n\n//#endregion\n//#region createGlobalState/index.ts\n/**\n* Keep states in the global scope to be reusable across Vue instances.\n*\n* @see https://vueuse.org/createGlobalState\n* @param stateFactory A factory function to create the state\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction createGlobalState(stateFactory) {\n\tlet initialized = false;\n\tlet state;\n\tconst scope = effectScope(true);\n\treturn ((...args) => {\n\t\tif (!initialized) {\n\t\t\tstate = scope.run(() => stateFactory(...args));\n\t\t\tinitialized = true;\n\t\t}\n\t\treturn state;\n\t});\n}\n\n//#endregion\n//#region provideLocal/map.ts\nconst localProvidedStateMap = /* @__PURE__ */ new WeakMap();\n\n//#endregion\n//#region injectLocal/index.ts\n/**\n* On the basis of `inject`, it is allowed to directly call inject to obtain the value after call provide in the same component.\n*\n* @example\n* ```ts\n* injectLocal('MyInjectionKey', 1)\n* const injectedValue = injectLocal('MyInjectionKey') // injectedValue === 1\n* ```\n*\n* @__NO_SIDE_EFFECTS__\n*/\nconst injectLocal = (...args) => {\n\tvar _getCurrentInstance;\n\tconst key = args[0];\n\tconst instance = (_getCurrentInstance = getCurrentInstance()) === null || _getCurrentInstance === void 0 ? void 0 : _getCurrentInstance.proxy;\n\tconst owner = instance !== null && instance !== void 0 ? instance : getCurrentScope();\n\tif (owner == null && !hasInjectionContext()) throw new Error(\"injectLocal must be called in setup\");\n\tif (owner && localProvidedStateMap.has(owner) && key in localProvidedStateMap.get(owner)) return localProvidedStateMap.get(owner)[key];\n\treturn inject(...args);\n};\n\n//#endregion\n//#region provideLocal/index.ts\n/**\n* On the basis of `provide`, it is allowed to directly call inject to obtain the value after call provide in the same component.\n*\n* @example\n* ```ts\n* provideLocal('MyInjectionKey', 1)\n* const injectedValue = injectLocal('MyInjectionKey') // injectedValue === 1\n* ```\n*/\nfunction provideLocal(key, value) {\n\tvar _getCurrentInstance;\n\tconst instance = (_getCurrentInstance = getCurrentInstance()) === null || _getCurrentInstance === void 0 ? void 0 : _getCurrentInstance.proxy;\n\tconst owner = instance !== null && instance !== void 0 ? instance : getCurrentScope();\n\tif (owner == null) throw new Error(\"provideLocal must be called in setup\");\n\tif (!localProvidedStateMap.has(owner)) localProvidedStateMap.set(owner, Object.create(null));\n\tconst localProvidedState = localProvidedStateMap.get(owner);\n\tlocalProvidedState[key] = value;\n\treturn provide(key, value);\n}\n\n//#endregion\n//#region createInjectionState/index.ts\n/**\n* Create global state that can be injected into components.\n*\n* @see https://vueuse.org/createInjectionState\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction createInjectionState(composable, options) {\n\tconst key = (options === null || options === void 0 ? void 0 : options.injectionKey) || Symbol(composable.name || \"InjectionState\");\n\tconst defaultValue = options === null || options === void 0 ? void 0 : options.defaultValue;\n\tconst useProvidingState = (...args) => {\n\t\tconst state = composable(...args);\n\t\tprovideLocal(key, state);\n\t\treturn state;\n\t};\n\tconst useInjectedState = () => injectLocal(key, defaultValue);\n\treturn [useProvidingState, useInjectedState];\n}\n\n//#endregion\n//#region createRef/index.ts\n/**\n* Returns a `deepRef` or `shallowRef` depending on the `deep` param.\n*\n* @example createRef(1) // ShallowRef<number>\n* @example createRef(1, false) // ShallowRef<number>\n* @example createRef(1, true) // Ref<number>\n* @example createRef(\"string\") // ShallowRef<string>\n* @example createRef<\"A\"|\"B\">(\"A\", true) // Ref<\"A\"|\"B\">\n*\n* @param value\n* @param deep\n* @returns the `deepRef` or `shallowRef`\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction createRef(value, deep) {\n\tif (deep === true) return ref(value);\n\telse return shallowRef(value);\n}\n\n//#endregion\n//#region utils/is.ts\nconst isClient = typeof window !== \"undefined\" && typeof document !== \"undefined\";\nconst isWorker = typeof WorkerGlobalScope !== \"undefined\" && globalThis instanceof WorkerGlobalScope;\nconst isDef = (val) => typeof val !== \"undefined\";\nconst notNullish = (val) => val != null;\nconst assert = (condition, ...infos) => {\n\tif (!condition) console.warn(...infos);\n};\nconst toString = Object.prototype.toString;\nconst isObject = (val) => toString.call(val) === \"[object Object]\";\nconst now = () => Date.now();\nconst timestamp = () => +Date.now();\nconst clamp = (n, min, max) => Math.min(max, Math.max(min, n));\nconst noop = () => {};\nconst rand = (min, max) => {\n\tmin = Math.ceil(min);\n\tmax = Math.floor(max);\n\treturn Math.floor(Math.random() * (max - min + 1)) + min;\n};\nconst hasOwn = (val, key) => Object.prototype.hasOwnProperty.call(val, key);\nconst isIOS = /* @__PURE__ */ getIsIOS();\nfunction getIsIOS() {\n\tvar _window, _window2, _window3;\n\treturn isClient && ((_window = window) === null || _window === void 0 || (_window = _window.navigator) === null || _window === void 0 ? void 0 : _window.userAgent) && (/iP(?:ad|hone|od)/.test(window.navigator.userAgent) || ((_window2 = window) === null || _window2 === void 0 || (_window2 = _window2.navigator) === null || _window2 === void 0 ? void 0 : _window2.maxTouchPoints) > 2 && /iPad|Macintosh/.test((_window3 = window) === null || _window3 === void 0 ? void 0 : _window3.navigator.userAgent));\n}\n\n//#endregion\n//#region toRef/index.ts\nfunction toRef(...args) {\n\tif (args.length !== 1) return toRef$1(...args);\n\tconst r = args[0];\n\treturn typeof r === \"function\" ? readonly(customRef(() => ({\n\t\tget: r,\n\t\tset: noop\n\t}))) : ref(r);\n}\n\n//#endregion\n//#region utils/filters.ts\n/**\n* @internal\n*/\nfunction createFilterWrapper(filter, fn) {\n\tfunction wrapper(...args) {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tPromise.resolve(filter(() => fn.apply(this, args), {\n\t\t\t\tfn,\n\t\t\t\tthisArg: this,\n\t\t\t\targs\n\t\t\t})).then(resolve).catch(reject);\n\t\t});\n\t}\n\treturn wrapper;\n}\nconst bypassFilter = (invoke$1) => {\n\treturn invoke$1();\n};\n/**\n* Create an EventFilter that debounce the events\n*/\nfunction debounceFilter(ms, options = {}) {\n\tlet timer;\n\tlet maxTimer;\n\tlet lastRejector = noop;\n\tconst _clearTimeout = (timer$1) => {\n\t\tclearTimeout(timer$1);\n\t\tlastRejector();\n\t\tlastRejector = noop;\n\t};\n\tlet lastInvoker;\n\tconst filter = (invoke$1) => {\n\t\tconst duration = toValue(ms);\n\t\tconst maxDuration = toValue(options.maxWait);\n\t\tif (timer) _clearTimeout(timer);\n\t\tif (duration <= 0 || maxDuration !== void 0 && maxDuration <= 0) {\n\t\t\tif (maxTimer) {\n\t\t\t\t_clearTimeout(maxTimer);\n\t\t\t\tmaxTimer = void 0;\n\t\t\t}\n\t\t\treturn Promise.resolve(invoke$1());\n\t\t}\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tlastRejector = options.rejectOnCancel ? reject : resolve;\n\t\t\tlastInvoker = invoke$1;\n\t\t\tif (maxDuration && !maxTimer) maxTimer = setTimeout(() => {\n\t\t\t\tif (timer) _clearTimeout(timer);\n\t\t\t\tmaxTimer = void 0;\n\t\t\t\tresolve(lastInvoker());\n\t\t\t}, maxDuration);\n\t\t\ttimer = setTimeout(() => {\n\t\t\t\tif (maxTimer) _clearTimeout(maxTimer);\n\t\t\t\tmaxTimer = void 0;\n\t\t\t\tresolve(invoke$1());\n\t\t\t}, duration);\n\t\t});\n\t};\n\treturn filter;\n}\nfunction throttleFilter(...args) {\n\tlet lastExec = 0;\n\tlet timer;\n\tlet isLeading = true;\n\tlet lastRejector = noop;\n\tlet lastValue;\n\tlet ms;\n\tlet trailing;\n\tlet leading;\n\tlet rejectOnCancel;\n\tif (!isRef(args[0]) && typeof args[0] === \"object\") ({delay: ms, trailing = true, leading = true, rejectOnCancel = false} = args[0]);\n\telse [ms, trailing = true, leading = true, rejectOnCancel = false] = args;\n\tconst clear = () => {\n\t\tif (timer) {\n\t\t\tclearTimeout(timer);\n\t\t\ttimer = void 0;\n\t\t\tlastRejector();\n\t\t\tlastRejector = noop;\n\t\t}\n\t};\n\tconst filter = (_invoke) => {\n\t\tconst duration = toValue(ms);\n\t\tconst elapsed = Date.now() - lastExec;\n\t\tconst invoke$1 = () => {\n\t\t\treturn lastValue = _invoke();\n\t\t};\n\t\tclear();\n\t\tif (duration <= 0) {\n\t\t\tlastExec = Date.now();\n\t\t\treturn invoke$1();\n\t\t}\n\t\tif (elapsed > duration) {\n\t\t\tlastExec = Date.now();\n\t\t\tif (leading || !isLeading) invoke$1();\n\t\t} else if (trailing) lastValue = new Promise((resolve, reject) => {\n\t\t\tlastRejector = rejectOnCancel ? reject : resolve;\n\t\t\ttimer = setTimeout(() => {\n\t\t\t\tlastExec = Date.now();\n\t\t\t\tisLeading = true;\n\t\t\t\tresolve(invoke$1());\n\t\t\t\tclear();\n\t\t\t}, Math.max(0, duration - elapsed));\n\t\t});\n\t\tif (!leading && !timer) timer = setTimeout(() => isLeading = true, duration);\n\t\tisLeading = false;\n\t\treturn lastValue;\n\t};\n\treturn filter;\n}\n/**\n* EventFilter that gives extra controls to pause and resume the filter\n*\n* @param extendFilter Extra filter to apply when the PausableFilter is active, default to none\n* @param options Options to configure the filter\n*/\nfunction pausableFilter(extendFilter = bypassFilter, options = {}) {\n\tconst { initialState = \"active\" } = options;\n\tconst isActive = toRef(initialState === \"active\");\n\tfunction pause() {\n\t\tisActive.value = false;\n\t}\n\tfunction resume() {\n\t\tisActive.value = true;\n\t}\n\tconst eventFilter = (...args) => {\n\t\tif (isActive.value) extendFilter(...args);\n\t};\n\treturn {\n\t\tisActive: readonly(isActive),\n\t\tpause,\n\t\tresume,\n\t\teventFilter\n\t};\n}\n\n//#endregion\n//#region utils/general.ts\nfunction promiseTimeout(ms, throwOnTimeout = false, reason = \"Timeout\") {\n\treturn new Promise((resolve, reject) => {\n\t\tif (throwOnTimeout) setTimeout(() => reject(reason), ms);\n\t\telse setTimeout(resolve, ms);\n\t});\n}\nfunction identity(arg) {\n\treturn arg;\n}\n/**\n* Create singleton promise function\n*\n* @example\n* ```\n* const promise = createSingletonPromise(async () => { ... })\n*\n* await promise()\n* await promise() // all of them will be bind to a single promise instance\n* await promise() // and be resolved together\n* ```\n*/\nfunction createSingletonPromise(fn) {\n\tlet _promise;\n\tfunction wrapper() {\n\t\tif (!_promise) _promise = fn();\n\t\treturn _promise;\n\t}\n\twrapper.reset = async () => {\n\t\tconst _prev = _promise;\n\t\t_promise = void 0;\n\t\tif (_prev) await _prev;\n\t};\n\treturn wrapper;\n}\nfunction invoke(fn) {\n\treturn fn();\n}\nfunction containsProp(obj, ...props) {\n\treturn props.some((k) => k in obj);\n}\nfunction increaseWithUnit(target, delta) {\n\tvar _target$match;\n\tif (typeof target === \"number\") return target + delta;\n\tconst value = ((_target$match = target.match(/^-?\\d+\\.?\\d*/)) === null || _target$match === void 0 ? void 0 : _target$match[0]) || \"\";\n\tconst unit = target.slice(value.length);\n\tconst result = Number.parseFloat(value) + delta;\n\tif (Number.isNaN(result)) return target;\n\treturn result + unit;\n}\n/**\n* Get a px value for SSR use, do not rely on this method outside of SSR as REM unit is assumed at 16px, which might not be the case on the client\n*/\nfunction pxValue(px) {\n\treturn px.endsWith(\"rem\") ? Number.parseFloat(px) * 16 : Number.parseFloat(px);\n}\n/**\n* Create a new subset object by giving keys\n*/\nfunction objectPick(obj, keys, omitUndefined = false) {\n\treturn keys.reduce((n, k) => {\n\t\tif (k in obj) {\n\t\t\tif (!omitUndefined || obj[k] !== void 0) n[k] = obj[k];\n\t\t}\n\t\treturn n;\n\t}, {});\n}\n/**\n* Create a new subset object by omit giving keys\n*/\nfunction objectOmit(obj, keys, omitUndefined = false) {\n\treturn Object.fromEntries(Object.entries(obj).filter(([key, value]) => {\n\t\treturn (!omitUndefined || value !== void 0) && !keys.includes(key);\n\t}));\n}\nfunction objectEntries(obj) {\n\treturn Object.entries(obj);\n}\nfunction toArray(value) {\n\treturn Array.isArray(value) ? value : [value];\n}\n\n//#endregion\n//#region utils/port.ts\nfunction cacheStringFunction(fn) {\n\tconst cache = Object.create(null);\n\treturn ((str) => {\n\t\treturn cache[str] || (cache[str] = fn(str));\n\t});\n}\nconst hyphenateRE = /\\B([A-Z])/g;\nconst hyphenate = cacheStringFunction((str) => str.replace(hyphenateRE, \"-$1\").toLowerCase());\nconst camelizeRE = /-(\\w)/g;\nconst camelize = cacheStringFunction((str) => {\n\treturn str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : \"\");\n});\n\n//#endregion\n//#region utils/vue.ts\nfunction getLifeCycleTarget(target) {\n\treturn target || getCurrentInstance();\n}\n\n//#endregion\n//#region createSharedComposable/index.ts\n/**\n* Make a composable function usable with multiple Vue instances.\n*\n* @see https://vueuse.org/createSharedComposable\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction createSharedComposable(composable) {\n\tif (!isClient) return composable;\n\tlet subscribers = 0;\n\tlet state;\n\tlet scope;\n\tconst dispose = () => {\n\t\tsubscribers -= 1;\n\t\tif (scope && subscribers <= 0) {\n\t\t\tscope.stop();\n\t\t\tstate = void 0;\n\t\t\tscope = void 0;\n\t\t}\n\t};\n\treturn ((...args) => {\n\t\tsubscribers += 1;\n\t\tif (!scope) {\n\t\t\tscope = effectScope(true);\n\t\t\tstate = scope.run(() => composable(...args));\n\t\t}\n\t\ttryOnScopeDispose(dispose);\n\t\treturn state;\n\t});\n}\n\n//#endregion\n//#region extendRef/index.ts\nfunction extendRef(ref$1, extend, { enumerable = false, unwrap = true } = {}) {\n\tfor (const [key, value] of Object.entries(extend)) {\n\t\tif (key === \"value\") continue;\n\t\tif (isRef(value) && unwrap) Object.defineProperty(ref$1, key, {\n\t\t\tget() {\n\t\t\t\treturn value.value;\n\t\t\t},\n\t\t\tset(v) {\n\t\t\t\tvalue.value = v;\n\t\t\t},\n\t\t\tenumerable\n\t\t});\n\t\telse Object.defineProperty(ref$1, key, {\n\t\t\tvalue,\n\t\t\tenumerable\n\t\t});\n\t}\n\treturn ref$1;\n}\n\n//#endregion\n//#region get/index.ts\nfunction get(obj, key) {\n\tif (key == null) return unref(obj);\n\treturn unref(obj)[key];\n}\n\n//#endregion\n//#region isDefined/index.ts\nfunction isDefined(v) {\n\treturn unref(v) != null;\n}\n\n//#endregion\n//#region makeDestructurable/index.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction makeDestructurable(obj, arr) {\n\tif (typeof Symbol !== \"undefined\") {\n\t\tconst clone = { ...obj };\n\t\tObject.defineProperty(clone, Symbol.iterator, {\n\t\t\tenumerable: false,\n\t\t\tvalue() {\n\t\t\t\tlet index = 0;\n\t\t\t\treturn { next: () => ({\n\t\t\t\t\tvalue: arr[index++],\n\t\t\t\t\tdone: index > arr.length\n\t\t\t\t}) };\n\t\t\t}\n\t\t});\n\t\treturn clone;\n\t} else return Object.assign([...arr], obj);\n}\n\n//#endregion\n//#region reactify/index.ts\n/**\n* Converts plain function into a reactive function.\n* The converted function accepts refs as it's arguments\n* and returns a ComputedRef, with proper typing.\n*\n* @param fn - Source function\n* @param options - Options\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction reactify(fn, options) {\n\tconst unrefFn = (options === null || options === void 0 ? void 0 : options.computedGetter) === false ? unref : toValue;\n\treturn function(...args) {\n\t\treturn computed(() => fn.apply(this, args.map((i) => unrefFn(i))));\n\t};\n}\n/** @deprecated use `reactify` instead */\nconst createReactiveFn = reactify;\n\n//#endregion\n//#region reactifyObject/index.ts\n/**\n* Apply `reactify` to an object\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction reactifyObject(obj, optionsOrKeys = {}) {\n\tlet keys = [];\n\tlet options;\n\tif (Array.isArray(optionsOrKeys)) keys = optionsOrKeys;\n\telse {\n\t\toptions = optionsOrKeys;\n\t\tconst { includeOwnProperties = true } = optionsOrKeys;\n\t\tkeys.push(...Object.keys(obj));\n\t\tif (includeOwnProperties) keys.push(...Object.getOwnPropertyNames(obj));\n\t}\n\treturn Object.fromEntries(keys.map((key) => {\n\t\tconst value = obj[key];\n\t\treturn [key, typeof value === \"function\" ? reactify(value.bind(obj), options) : value];\n\t}));\n}\n\n//#endregion\n//#region toReactive/index.ts\n/**\n* Converts ref to reactive.\n*\n* @see https://vueuse.org/toReactive\n* @param objectRef A ref of object\n*/\nfunction toReactive(objectRef) {\n\tif (!isRef(objectRef)) return reactive(objectRef);\n\treturn reactive(new Proxy({}, {\n\t\tget(_, p, receiver) {\n\t\t\treturn unref(Reflect.get(objectRef.value, p, receiver));\n\t\t},\n\t\tset(_, p, value) {\n\t\t\tif (isRef(objectRef.value[p]) && !isRef(value)) objectRef.value[p].value = value;\n\t\t\telse objectRef.value[p] = value;\n\t\t\treturn true;\n\t\t},\n\t\tdeleteProperty(_, p) {\n\t\t\treturn Reflect.deleteProperty(objectRef.value, p);\n\t\t},\n\t\thas(_, p) {\n\t\t\treturn Reflect.has(objectRef.value, p);\n\t\t},\n\t\townKeys() {\n\t\t\treturn Object.keys(objectRef.value);\n\t\t},\n\t\tgetOwnPropertyDescriptor() {\n\t\t\treturn {\n\t\t\t\tenumerable: true,\n\t\t\t\tconfigurable: true\n\t\t\t};\n\t\t}\n\t}));\n}\n\n//#endregion\n//#region reactiveComputed/index.ts\n/**\n* Computed reactive object.\n*/\nfunction reactiveComputed(fn) {\n\treturn toReactive(computed(fn));\n}\n\n//#endregion\n//#region reactiveOmit/index.ts\n/**\n* Reactively omit fields from a reactive object\n*\n* @see https://vueuse.org/reactiveOmit\n*/\nfunction reactiveOmit(obj, ...keys) {\n\tconst flatKeys = keys.flat();\n\tconst predicate = flatKeys[0];\n\treturn reactiveComputed(() => typeof predicate === \"function\" ? Object.fromEntries(Object.entries(toRefs$1(obj)).filter(([k, v]) => !predicate(toValue(v), k))) : Object.fromEntries(Object.entries(toRefs$1(obj)).filter((e) => !flatKeys.includes(e[0]))));\n}\n\n//#endregion\n//#region reactivePick/index.ts\n/**\n* Reactively pick fields from a reactive object\n*\n* @see https://vueuse.org/reactivePick\n*/\nfunction reactivePick(obj, ...keys) {\n\tconst flatKeys = keys.flat();\n\tconst predicate = flatKeys[0];\n\treturn reactiveComputed(() => typeof predicate === \"function\" ? Object.fromEntries(Object.entries(toRefs$1(obj)).filter(([k, v]) => predicate(toValue(v), k))) : Object.fromEntries(flatKeys.map((k) => [k, toRef(obj, k)])));\n}\n\n//#endregion\n//#region refAutoReset/index.ts\n/**\n* Create a ref which will be reset to the default value after some time.\n*\n* @see https://vueuse.org/refAutoReset\n* @param defaultValue The value which will be set.\n* @param afterMs A zero-or-greater delay in milliseconds.\n*/\nfunction refAutoReset(defaultValue, afterMs = 1e4) {\n\treturn customRef((track, trigger) => {\n\t\tlet value = toValue(defaultValue);\n\t\tlet timer;\n\t\tconst resetAfter = () => setTimeout(() => {\n\t\t\tvalue = toValue(defaultValue);\n\t\t\ttrigger();\n\t\t}, toValue(afterMs));\n\t\ttryOnScopeDispose(() => {\n\t\t\tclearTimeout(timer);\n\t\t});\n\t\treturn {\n\t\t\tget() {\n\t\t\t\ttrack();\n\t\t\t\treturn value;\n\t\t\t},\n\t\t\tset(newValue) {\n\t\t\t\tvalue = newValue;\n\t\t\t\ttrigger();\n\t\t\t\tclearTimeout(timer);\n\t\t\t\ttimer = resetAfter();\n\t\t\t}\n\t\t};\n\t});\n}\n/** @deprecated use `refAutoReset` instead */\nconst autoResetRef = refAutoReset;\n\n//#endregion\n//#region useDebounceFn/index.ts\n/**\n* Debounce execution of a function.\n*\n* @see https://vueuse.org/useDebounceFn\n* @param fn A function to be executed after delay milliseconds debounced.\n* @param ms A zero-or-greater delay in milliseconds. For event callbacks, values around 100 or 250 (or even higher) are most useful.\n* @param options Options\n*\n* @return A new, debounce, function.\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useDebounceFn(fn, ms = 200, options = {}) {\n\treturn createFilterWrapper(debounceFilter(ms, options), fn);\n}\n\n//#endregion\n//#region refDebounced/index.ts\n/**\n* Debounce updates of a ref.\n*\n* @return A new debounced ref.\n*/\nfunction refDebounced(value, ms = 200, options = {}) {\n\tconst debounced = ref(toValue(value));\n\tconst updater = useDebounceFn(() => {\n\t\tdebounced.value = value.value;\n\t}, ms, options);\n\twatch(value, () => updater());\n\treturn shallowReadonly(debounced);\n}\n/** @deprecated use `refDebounced` instead */\nconst debouncedRef = refDebounced;\n/** @deprecated use `refDebounced` instead */\nconst useDebounce = refDebounced;\n\n//#endregion\n//#region refDefault/index.ts\n/**\n* Apply default value to a ref.\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction refDefault(source, defaultValue) {\n\treturn computed({\n\t\tget() {\n\t\t\tvar _source$value;\n\t\t\treturn (_source$value = source.value) !== null && _source$value !== void 0 ? _source$value : defaultValue;\n\t\t},\n\t\tset(value) {\n\t\t\tsource.value = value;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region refManualReset/index.ts\n/**\n* Create a ref with manual reset functionality.\n*\n* @see https://vueuse.org/refManualReset\n* @param defaultValue The value which will be set.\n*/\nfunction refManualReset(defaultValue) {\n\tlet value = toValue(defaultValue);\n\tlet trigger;\n\tconst reset = () => {\n\t\tvalue = toValue(defaultValue);\n\t\ttrigger();\n\t};\n\tconst refValue = customRef((track, _trigger) => {\n\t\ttrigger = _trigger;\n\t\treturn {\n\t\t\tget() {\n\t\t\t\ttrack();\n\t\t\t\treturn value;\n\t\t\t},\n\t\t\tset(newValue) {\n\t\t\t\tvalue = newValue;\n\t\t\t\ttrigger();\n\t\t\t}\n\t\t};\n\t});\n\trefValue.reset = reset;\n\treturn refValue;\n}\n\n//#endregion\n//#region useThrottleFn/index.ts\n/**\n* Throttle execution of a function. Especially useful for rate limiting\n* execution of handlers on events like resize and scroll.\n*\n* @param fn A function to be executed after delay milliseconds. The `this` context and all arguments are passed through, as-is,\n* to `callback` when the throttled-function is executed.\n* @param ms A zero-or-greater delay in milliseconds. For event callbacks, values around 100 or 250 (or even higher) are most useful.\n* (default value: 200)\n*\n* @param [trailing] if true, call fn again after the time is up (default value: false)\n*\n* @param [leading] if true, call fn on the leading edge of the ms timeout (default value: true)\n*\n* @param [rejectOnCancel] if true, reject the last call if it's been cancel (default value: false)\n*\n* @return A new, throttled, function.\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useThrottleFn(fn, ms = 200, trailing = false, leading = true, rejectOnCancel = false) {\n\treturn createFilterWrapper(throttleFilter(ms, trailing, leading, rejectOnCancel), fn);\n}\n\n//#endregion\n//#region refThrottled/index.ts\n/**\n* Throttle execution of a function. Especially useful for rate limiting\n* execution of handlers on events like resize and scroll.\n*\n* @param value Ref value to be watched with throttle effect\n* @param delay A zero-or-greater delay in milliseconds. For event callbacks, values around 100 or 250 (or even higher) are most useful.\n* @param trailing if true, update the value again after the delay time is up\n* @param leading if true, update the value on the leading edge of the ms timeout\n*/\nfunction refThrottled(value, delay = 200, trailing = true, leading = true) {\n\tif (delay <= 0) return value;\n\tconst throttled = ref(toValue(value));\n\tconst updater = useThrottleFn(() => {\n\t\tthrottled.value = value.value;\n\t}, delay, trailing, leading);\n\twatch(value, () => updater());\n\treturn throttled;\n}\n/** @deprecated use `refThrottled` instead */\nconst throttledRef = refThrottled;\n/** @deprecated use `refThrottled` instead */\nconst useThrottle = refThrottled;\n\n//#endregion\n//#region refWithControl/index.ts\n/**\n* Fine-grained controls over ref and its reactivity.\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction refWithControl(initial, options = {}) {\n\tlet source = initial;\n\tlet track;\n\tlet trigger;\n\tconst ref$1 = customRef((_track, _trigger) => {\n\t\ttrack = _track;\n\t\ttrigger = _trigger;\n\t\treturn {\n\t\t\tget() {\n\t\t\t\treturn get$1();\n\t\t\t},\n\t\t\tset(v) {\n\t\t\t\tset$1(v);\n\t\t\t}\n\t\t};\n\t});\n\tfunction get$1(tracking = true) {\n\t\tif (tracking) track();\n\t\treturn source;\n\t}\n\tfunction set$1(value, triggering = true) {\n\t\tvar _options$onBeforeChan, _options$onChanged;\n\t\tif (value === source) return;\n\t\tconst old = source;\n\t\tif (((_options$onBeforeChan = options.onBeforeChange) === null || _options$onBeforeChan === void 0 ? void 0 : _options$onBeforeChan.call(options, value, old)) === false) return;\n\t\tsource = value;\n\t\t(_options$onChanged = options.onChanged) === null || _options$onChanged === void 0 || _options$onChanged.call(options, value, old);\n\t\tif (triggering) trigger();\n\t}\n\t/**\n\t* Get the value without tracked in the reactivity system\n\t*/\n\tconst untrackedGet = () => get$1(false);\n\t/**\n\t* Set the value without triggering the reactivity system\n\t*/\n\tconst silentSet = (v) => set$1(v, false);\n\t/**\n\t* Get the value without tracked in the reactivity system.\n\t*\n\t* Alias for `untrackedGet()`\n\t*/\n\tconst peek = () => get$1(false);\n\t/**\n\t* Set the value without triggering the reactivity system\n\t*\n\t* Alias for `silentSet(v)`\n\t*/\n\tconst lay = (v) => set$1(v, false);\n\treturn extendRef(ref$1, {\n\t\tget: get$1,\n\t\tset: set$1,\n\t\tuntrackedGet,\n\t\tsilentSet,\n\t\tpeek,\n\t\tlay\n\t}, { enumerable: true });\n}\n/** @deprecated use `refWithControl` instead */\nconst controlledRef = refWithControl;\n\n//#endregion\n//#region set/index.ts\n/**\n* Shorthand for `ref.value = x`\n*/\nfunction set(...args) {\n\tif (args.length === 2) {\n\t\tconst [ref$1, value] = args;\n\t\tref$1.value = value;\n\t}\n\tif (args.length === 3) {\n\t\tconst [target, key, value] = args;\n\t\ttarget[key] = value;\n\t}\n}\n\n//#endregion\n//#region watchWithFilter/index.ts\nfunction watchWithFilter(source, cb, options = {}) {\n\tconst { eventFilter = bypassFilter,...watchOptions } = options;\n\treturn watch(source, createFilterWrapper(eventFilter, cb), watchOptions);\n}\n\n//#endregion\n//#region watchPausable/index.ts\nfunction watchPausable(source, cb, options = {}) {\n\tconst { eventFilter: filter, initialState = \"active\",...watchOptions } = options;\n\tconst { eventFilter, pause, resume, isActive } = pausableFilter(filter, { initialState });\n\treturn {\n\t\tstop: watchWithFilter(source, cb, {\n\t\t\t...watchOptions,\n\t\t\teventFilter\n\t\t}),\n\t\tpause,\n\t\tresume,\n\t\tisActive\n\t};\n}\n/** @deprecated use `watchPausable` instead */\nconst pausableWatch = watchPausable;\n\n//#endregion\n//#region syncRef/index.ts\n/**\n* Two-way refs synchronization.\n* From the set theory perspective to restrict the option's type\n* Check in the following order:\n* 1. L = R\n* 2. L ∩ R ≠ ∅\n* 3. L ⊆ R\n* 4. L ∩ R = ∅\n*/\nfunction syncRef(left, right, ...[options]) {\n\tconst { flush = \"sync\", deep = false, immediate = true, direction = \"both\", transform = {} } = options || {};\n\tconst watchers = [];\n\tconst transformLTR = \"ltr\" in transform && transform.ltr || ((v) => v);\n\tconst transformRTL = \"rtl\" in transform && transform.rtl || ((v) => v);\n\tif (direction === \"both\" || direction === \"ltr\") watchers.push(pausableWatch(left, (newValue) => {\n\t\twatchers.forEach((w) => w.pause());\n\t\tright.value = transformLTR(newValue);\n\t\twatchers.forEach((w) => w.resume());\n\t}, {\n\t\tflush,\n\t\tdeep,\n\t\timmediate\n\t}));\n\tif (direction === \"both\" || direction === \"rtl\") watchers.push(pausableWatch(right, (newValue) => {\n\t\twatchers.forEach((w) => w.pause());\n\t\tleft.value = transformRTL(newValue);\n\t\twatchers.forEach((w) => w.resume());\n\t}, {\n\t\tflush,\n\t\tdeep,\n\t\timmediate\n\t}));\n\tconst stop = () => {\n\t\twatchers.forEach((w) => w.stop());\n\t};\n\treturn stop;\n}\n\n//#endregion\n//#region syncRefs/index.ts\n/**\n* Keep target ref(s) in sync with the source ref\n*\n* @param source source ref\n* @param targets\n*/\nfunction syncRefs(source, targets, options = {}) {\n\tconst { flush = \"sync\", deep = false, immediate = true } = options;\n\tconst targetsArray = toArray(targets);\n\treturn watch(source, (newValue) => targetsArray.forEach((target) => target.value = newValue), {\n\t\tflush,\n\t\tdeep,\n\t\timmediate\n\t});\n}\n\n//#endregion\n//#region toRefs/index.ts\n/**\n* Extended `toRefs` that also accepts refs of an object.\n*\n* @see https://vueuse.org/toRefs\n* @param objectRef A ref or normal object or array.\n* @param options Options\n*/\nfunction toRefs(objectRef, options = {}) {\n\tif (!isRef(objectRef)) return toRefs$1(objectRef);\n\tconst result = Array.isArray(objectRef.value) ? Array.from({ length: objectRef.value.length }) : {};\n\tfor (const key in objectRef.value) result[key] = customRef(() => ({\n\t\tget() {\n\t\t\treturn objectRef.value[key];\n\t\t},\n\t\tset(v) {\n\t\t\tvar _toValue;\n\t\t\tif ((_toValue = toValue(options.replaceRef)) !== null && _toValue !== void 0 ? _toValue : true) if (Array.isArray(objectRef.value)) {\n\t\t\t\tconst copy = [...objectRef.value];\n\t\t\t\tcopy[key] = v;\n\t\t\t\tobjectRef.value = copy;\n\t\t\t} else {\n\t\t\t\tconst newObject = {\n\t\t\t\t\t...objectRef.value,\n\t\t\t\t\t[key]: v\n\t\t\t\t};\n\t\t\t\tObject.setPrototypeOf(newObject, Object.getPrototypeOf(objectRef.value));\n\t\t\t\tobjectRef.value = newObject;\n\t\t\t}\n\t\t\telse objectRef.value[key] = v;\n\t\t}\n\t}));\n\treturn result;\n}\n\n//#endregion\n//#region tryOnBeforeMount/index.ts\n/**\n* Call onBeforeMount() if it's inside a component lifecycle, if not, just call the function\n*\n* @param fn\n* @param sync if set to false, it will run in the nextTick() of Vue\n* @param target\n*/\nfunction tryOnBeforeMount(fn, sync = true, target) {\n\tif (getLifeCycleTarget(target)) onBeforeMount(fn, target);\n\telse if (sync) fn();\n\telse nextTick(fn);\n}\n\n//#endregion\n//#region tryOnBeforeUnmount/index.ts\n/**\n* Call onBeforeUnmount() if it's inside a component lifecycle, if not, do nothing\n*\n* @param fn\n* @param target\n*/\nfunction tryOnBeforeUnmount(fn, target) {\n\tif (getLifeCycleTarget(target)) onBeforeUnmount(fn, target);\n}\n\n//#endregion\n//#region tryOnMounted/index.ts\n/**\n* Call onMounted() if it's inside a component lifecycle, if not, just call the function\n*\n* @param fn\n* @param sync if set to false, it will run in the nextTick() of Vue\n* @param target\n*/\nfunction tryOnMounted(fn, sync = true, target) {\n\tif (getLifeCycleTarget(target)) onMounted(fn, target);\n\telse if (sync) fn();\n\telse nextTick(fn);\n}\n\n//#endregion\n//#region tryOnUnmounted/index.ts\n/**\n* Call onUnmounted() if it's inside a component lifecycle, if not, do nothing\n*\n* @param fn\n* @param target\n*/\nfunction tryOnUnmounted(fn, target) {\n\tif (getLifeCycleTarget(target)) onUnmounted(fn, target);\n}\n\n//#endregion\n//#region until/index.ts\nfunction createUntil(r, isNot = false) {\n\tfunction toMatch(condition, { flush = \"sync\", deep = false, timeout, throwOnTimeout } = {}) {\n\t\tlet stop = null;\n\t\tconst promises = [new Promise((resolve) => {\n\t\t\tstop = watch(r, (v) => {\n\t\t\t\tif (condition(v) !== isNot) {\n\t\t\t\t\tif (stop) stop();\n\t\t\t\t\telse nextTick(() => stop === null || stop === void 0 ? void 0 : stop());\n\t\t\t\t\tresolve(v);\n\t\t\t\t}\n\t\t\t}, {\n\t\t\t\tflush,\n\t\t\t\tdeep,\n\t\t\t\timmediate: true\n\t\t\t});\n\t\t})];\n\t\tif (timeout != null) promises.push(promiseTimeout(timeout, throwOnTimeout).then(() => toValue(r)).finally(() => stop === null || stop === void 0 ? void 0 : stop()));\n\t\treturn Promise.race(promises);\n\t}\n\tfunction toBe(value, options) {\n\t\tif (!isRef(value)) return toMatch((v) => v === value, options);\n\t\tconst { flush = \"sync\", deep = false, timeout, throwOnTimeout } = options !== null && options !== void 0 ? options : {};\n\t\tlet stop = null;\n\t\tconst promises = [new Promise((resolve) => {\n\t\t\tstop = watch([r, value], ([v1, v2]) => {\n\t\t\t\tif (isNot !== (v1 === v2)) {\n\t\t\t\t\tif (stop) stop();\n\t\t\t\t\telse nextTick(() => stop === null || stop === void 0 ? void 0 : stop());\n\t\t\t\t\tresolve(v1);\n\t\t\t\t}\n\t\t\t}, {\n\t\t\t\tflush,\n\t\t\t\tdeep,\n\t\t\t\timmediate: true\n\t\t\t});\n\t\t})];\n\t\tif (timeout != null) promises.push(promiseTimeout(timeout, throwOnTimeout).then(() => toValue(r)).finally(() => {\n\t\t\tstop === null || stop === void 0 || stop();\n\t\t\treturn toValue(r);\n\t\t}));\n\t\treturn Promise.race(promises);\n\t}\n\tfunction toBeTruthy(options) {\n\t\treturn toMatch((v) => Boolean(v), options);\n\t}\n\tfunction toBeNull(options) {\n\t\treturn toBe(null, options);\n\t}\n\tfunction toBeUndefined(options) {\n\t\treturn toBe(void 0, options);\n\t}\n\tfunction toBeNaN(options) {\n\t\treturn toMatch(Number.isNaN, options);\n\t}\n\tfunction toContains(value, options) {\n\t\treturn toMatch((v) => {\n\t\t\tconst array = Array.from(v);\n\t\t\treturn array.includes(value) || array.includes(toValue(value));\n\t\t}, options);\n\t}\n\tfunction changed(options) {\n\t\treturn changedTimes(1, options);\n\t}\n\tfunction changedTimes(n = 1, options) {\n\t\tlet count = -1;\n\t\treturn toMatch(() => {\n\t\t\tcount += 1;\n\t\t\treturn count >= n;\n\t\t}, options);\n\t}\n\tif (Array.isArray(toValue(r))) return {\n\t\ttoMatch,\n\t\ttoContains,\n\t\tchanged,\n\t\tchangedTimes,\n\t\tget not() {\n\t\t\treturn createUntil(r, !isNot);\n\t\t}\n\t};\n\telse return {\n\t\ttoMatch,\n\t\ttoBe,\n\t\ttoBeTruthy,\n\t\ttoBeNull,\n\t\ttoBeNaN,\n\t\ttoBeUndefined,\n\t\tchanged,\n\t\tchangedTimes,\n\t\tget not() {\n\t\t\treturn createUntil(r, !isNot);\n\t\t}\n\t};\n}\nfunction until(r) {\n\treturn createUntil(r);\n}\n\n//#endregion\n//#region useArrayDifference/index.ts\nfunction defaultComparator(value, othVal) {\n\treturn value === othVal;\n}\n/**\n* Reactive get array difference of two array\n* @see https://vueuse.org/useArrayDifference\n* @returns - the difference of two array\n* @param args\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useArrayDifference(...args) {\n\tvar _args$, _args$2;\n\tconst list = args[0];\n\tconst values = args[1];\n\tlet compareFn = (_args$ = args[2]) !== null && _args$ !== void 0 ? _args$ : defaultComparator;\n\tconst { symmetric = false } = (_args$2 = args[3]) !== null && _args$2 !== void 0 ? _args$2 : {};\n\tif (typeof compareFn === \"string\") {\n\t\tconst key = compareFn;\n\t\tcompareFn = (value, othVal) => value[key] === othVal[key];\n\t}\n\tconst diff1 = computed(() => toValue(list).filter((x) => toValue(values).findIndex((y) => compareFn(x, y)) === -1));\n\tif (symmetric) {\n\t\tconst diff2 = computed(() => toValue(values).filter((x) => toValue(list).findIndex((y) => compareFn(x, y)) === -1));\n\t\treturn computed(() => symmetric ? [...toValue(diff1), ...toValue(diff2)] : toValue(diff1));\n\t} else return diff1;\n}\n\n//#endregion\n//#region useArrayEvery/index.ts\n/**\n* Reactive `Array.every`\n*\n* @see https://vueuse.org/useArrayEvery\n* @param list - the array was called upon.\n* @param fn - a function to test each element.\n*\n* @returns **true** if the `fn` function returns a **truthy** value for every element from the array. Otherwise, **false**.\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useArrayEvery(list, fn) {\n\treturn computed(() => toValue(list).every((element, index, array) => fn(toValue(element), index, array)));\n}\n\n//#endregion\n//#region useArrayFilter/index.ts\n/**\n* Reactive `Array.filter`\n*\n* @see https://vueuse.org/useArrayFilter\n* @param list - the array was called upon.\n* @param fn - a function that is called for every element of the given `list`. Each time `fn` executes, the returned value is added to the new array.\n*\n* @returns a shallow copy of a portion of the given array, filtered down to just the elements from the given array that pass the test implemented by the provided function. If no elements pass the test, an empty array will be returned.\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useArrayFilter(list, fn) {\n\treturn computed(() => toValue(list).map((i) => toValue(i)).filter(fn));\n}\n\n//#endregion\n//#region useArrayFind/index.ts\n/**\n* Reactive `Array.find`\n*\n* @see https://vueuse.org/useArrayFind\n* @param list - the array was called upon.\n* @param fn - a function to test each element.\n*\n* @returns the first element in the array that satisfies the provided testing function. Otherwise, undefined is returned.\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useArrayFind(list, fn) {\n\treturn computed(() => toValue(toValue(list).find((element, index, array) => fn(toValue(element), index, array))));\n}\n\n//#endregion\n//#region useArrayFindIndex/index.ts\n/**\n* Reactive `Array.findIndex`\n*\n* @see https://vueuse.org/useArrayFindIndex\n* @param list - the array was called upon.\n* @param fn - a function to test each element.\n*\n* @returns the index of the first element in the array that passes the test. Otherwise, \"-1\".\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useArrayFindIndex(list, fn) {\n\treturn computed(() => toValue(list).findIndex((element, index, array) => fn(toValue(element), index, array)));\n}\n\n//#endregion\n//#region useArrayFindLast/index.ts\nfunction findLast(arr, cb) {\n\tlet index = arr.length;\n\twhile (index-- > 0) if (cb(arr[index], index, arr)) return arr[index];\n}\n/**\n* Reactive `Array.findLast`\n*\n* @see https://vueuse.org/useArrayFindLast\n* @param list - the array was called upon.\n* @param fn - a function to test each element.\n*\n* @returns the last element in the array that satisfies the provided testing function. Otherwise, undefined is returned.\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useArrayFindLast(list, fn) {\n\treturn computed(() => toValue(!Array.prototype.findLast ? findLast(toValue(list), (element, index, array) => fn(toValue(element), index, array)) : toValue(list).findLast((element, index, array) => fn(toValue(element), index, array))));\n}\n\n//#endregion\n//#region useArrayIncludes/index.ts\nfunction isArrayIncludesOptions(obj) {\n\treturn isObject(obj) && containsProp(obj, \"formIndex\", \"comparator\");\n}\n/**\n* Reactive `Array.includes`\n*\n* @see https://vueuse.org/useArrayIncludes\n*\n* @returns true if the `value` is found in the array. Otherwise, false.\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useArrayIncludes(...args) {\n\tvar _comparator;\n\tconst list = args[0];\n\tconst value = args[1];\n\tlet comparator = args[2];\n\tlet formIndex = 0;\n\tif (isArrayIncludesOptions(comparator)) {\n\t\tvar _comparator$fromIndex;\n\t\tformIndex = (_comparator$fromIndex = comparator.fromIndex) !== null && _comparator$fromIndex !== void 0 ? _comparator$fromIndex : 0;\n\t\tcomparator = comparator.comparator;\n\t}\n\tif (typeof comparator === \"string\") {\n\t\tconst key = comparator;\n\t\tcomparator = (element, value$1) => element[key] === toValue(value$1);\n\t}\n\tcomparator = (_comparator = comparator) !== null && _comparator !== void 0 ? _comparator : ((element, value$1) => element === toValue(value$1));\n\treturn computed(() => toValue(list).slice(formIndex).some((element, index, array) => comparator(toValue(element), toValue(value), index, toValue(array))));\n}\n\n//#endregion\n//#region useArrayJoin/index.ts\n/**\n* Reactive `Array.join`\n*\n* @see https://vueuse.org/useArrayJoin\n* @param list - the array was called upon.\n* @param separator - a string to separate each pair of adjacent elements of the array. If omitted, the array elements are separated with a comma (\",\").\n*\n* @returns a string with all array elements joined. If arr.length is 0, the empty string is returned.\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useArrayJoin(list, separator) {\n\treturn computed(() => toValue(list).map((i) => toValue(i)).join(toValue(separator)));\n}\n\n//#endregion\n//#region useArrayMap/index.ts\n/**\n* Reactive `Array.map`\n*\n* @see https://vueuse.org/useArrayMap\n* @param list - the array was called upon.\n* @param fn - a function that is called for every element of the given `list`. Each time `fn` executes, the returned value is added to the new array.\n*\n* @returns a new array with each element being the result of the callback function.\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useArrayMap(list, fn) {\n\treturn computed(() => toValue(list).map((i) => toValue(i)).map(fn));\n}\n\n//#endregion\n//#region useArrayReduce/index.ts\n/**\n* Reactive `Array.reduce`\n*\n* @see https://vueuse.org/useArrayReduce\n* @param list - the array was called upon.\n* @param reducer - a \"reducer\" function.\n* @param args\n*\n* @returns the value that results from running the \"reducer\" callback function to completion over the entire array.\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useArrayReduce(list, reducer, ...args) {\n\tconst reduceCallback = (sum, value, index) => reducer(toValue(sum), toValue(value), index);\n\treturn computed(() => {\n\t\tconst resolved = toValue(list);\n\t\treturn args.length ? resolved.reduce(reduceCallback, typeof args[0] === \"function\" ? toValue(args[0]()) : toValue(args[0])) : resolved.reduce(reduceCallback);\n\t});\n}\n\n//#endregion\n//#region useArraySome/index.ts\n/**\n* Reactive `Array.some`\n*\n* @see https://vueuse.org/useArraySome\n* @param list - the array was called upon.\n* @param fn - a function to test each element.\n*\n* @returns **true** if the `fn` function returns a **truthy** value for any element from the array. Otherwise, **false**.\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useArraySome(list, fn) {\n\treturn computed(() => toValue(list).some((element, index, array) => fn(toValue(element), index, array)));\n}\n\n//#endregion\n//#region useArrayUnique/index.ts\nfunction uniq(array) {\n\treturn Array.from(new Set(array));\n}\nfunction uniqueElementsBy(array, fn) {\n\treturn array.reduce((acc, v) => {\n\t\tif (!acc.some((x) => fn(v, x, array))) acc.push(v);\n\t\treturn acc;\n\t}, []);\n}\n/**\n* reactive unique array\n* @see https://vueuse.org/useArrayUnique\n* @param list - the array was called upon.\n* @param compareFn\n* @returns A computed ref that returns a unique array of items.\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useArrayUnique(list, compareFn) {\n\treturn computed(() => {\n\t\tconst resolvedList = toValue(list).map((element) => toValue(element));\n\t\treturn compareFn ? uniqueElementsBy(resolvedList, compareFn) : uniq(resolvedList);\n\t});\n}\n\n//#endregion\n//#region useCounter/index.ts\n/**\n* Basic counter with utility functions.\n*\n* @see https://vueuse.org/useCounter\n* @param [initialValue]\n* @param options\n*/\nfunction useCounter(initialValue = 0, options = {}) {\n\tlet _initialValue = unref(initialValue);\n\tconst count = shallowRef(initialValue);\n\tconst { max = Number.POSITIVE_INFINITY, min = Number.NEGATIVE_INFINITY } = options;\n\tconst inc = (delta = 1) => count.value = Math.max(Math.min(max, count.value + delta), min);\n\tconst dec = (delta = 1) => count.value = Math.min(Math.max(min, count.value - delta), max);\n\tconst get$1 = () => count.value;\n\tconst set$1 = (val) => count.value = Math.max(min, Math.min(max, val));\n\tconst reset = (val = _initialValue) => {\n\t\t_initialValue = val;\n\t\treturn set$1(val);\n\t};\n\treturn {\n\t\tcount: shallowReadonly(count),\n\t\tinc,\n\t\tdec,\n\t\tget: get$1,\n\t\tset: set$1,\n\t\treset\n\t};\n}\n\n//#endregion\n//#region useDateFormat/index.ts\nconst REGEX_PARSE = /^(\\d{4})[-/]?(\\d{1,2})?[-/]?(\\d{0,2})[T\\s]*(\\d{1,2})?:?(\\d{1,2})?:?(\\d{1,2})?[.:]?(\\d+)?$/i;\nconst REGEX_FORMAT = /[YMDHhms]o|\\[([^\\]]+)\\]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a{1,2}|A{1,2}|m{1,2}|s{1,2}|Z{1,2}|z{1,4}|SSS/g;\nfunction defaultMeridiem(hours, minutes, isLowercase, hasPeriod) {\n\tlet m = hours < 12 ? \"AM\" : \"PM\";\n\tif (hasPeriod) m = m.split(\"\").reduce((acc, curr) => acc += `${curr}.`, \"\");\n\treturn isLowercase ? m.toLowerCase() : m;\n}\nfunction formatOrdinal(num) {\n\tconst suffixes = [\n\t\t\"th\",\n\t\t\"st\",\n\t\t\"nd\",\n\t\t\"rd\"\n\t];\n\tconst v = num % 100;\n\treturn num + (suffixes[(v - 20) % 10] || suffixes[v] || suffixes[0]);\n}\nfunction formatDate(date, formatStr, options = {}) {\n\tvar _options$customMeridi;\n\tconst years = date.getFullYear();\n\tconst month = date.getMonth();\n\tconst days = date.getDate();\n\tconst hours = date.getHours();\n\tconst minutes = date.getMinutes();\n\tconst seconds = date.getSeconds();\n\tconst milliseconds = date.getMilliseconds();\n\tconst day = date.getDay();\n\tconst meridiem = (_options$customMeridi = options.customMeridiem) !== null && _options$customMeridi !== void 0 ? _options$customMeridi : defaultMeridiem;\n\tconst stripTimeZone = (dateString) => {\n\t\tvar _dateString$split$;\n\t\treturn (_dateString$split$ = dateString.split(\" \")[1]) !== null && _dateString$split$ !== void 0 ? _dateString$split$ : \"\";\n\t};\n\tconst matches = {\n\t\tYo: () => formatOrdinal(years),\n\t\tYY: () => String(years).slice(-2),\n\t\tYYYY: () => years,\n\t\tM: () => month + 1,\n\t\tMo: () => formatOrdinal(month + 1),\n\t\tMM: () => `${month + 1}`.padStart(2, \"0\"),\n\t\tMMM: () => date.toLocaleDateString(toValue(options.locales), { month: \"short\" }),\n\t\tMMMM: () => date.toLocaleDateString(toValue(options.locales), { month: \"long\" }),\n\t\tD: () => String(days),\n\t\tDo: () => formatOrdinal(days),\n\t\tDD: () => `${days}`.padStart(2, \"0\"),\n\t\tH: () => String(hours),\n\t\tHo: () => formatOrdinal(hours),\n\t\tHH: () => `${hours}`.padStart(2, \"0\"),\n\t\th: () => `${hours % 12 || 12}`.padStart(1, \"0\"),\n\t\tho: () => formatOrdinal(hours % 12 || 12),\n\t\thh: () => `${hours % 12 || 12}`.padStart(2, \"0\"),\n\t\tm: () => String(minutes),\n\t\tmo: () => formatOrdinal(minutes),\n\t\tmm: () => `${minutes}`.padStart(2, \"0\"),\n\t\ts: () => String(seconds),\n\t\tso: () => formatOrdinal(seconds),\n\t\tss: () => `${seconds}`.padStart(2, \"0\"),\n\t\tSSS: () => `${milliseconds}`.padStart(3, \"0\"),\n\t\td: () => day,\n\t\tdd: () => date.toLocaleDateString(toValue(options.locales), { weekday: \"narrow\" }),\n\t\tddd: () => date.toLocaleDateString(toValue(options.locales), { weekday: \"short\" }),\n\t\tdddd: () => date.toLocaleDateString(toValue(options.locales), { weekday: \"long\" }),\n\t\tA: () => meridiem(hours, minutes),\n\t\tAA: () => meridiem(hours, minutes, false, true),\n\t\ta: () => meridiem(hours, minutes, true),\n\t\taa: () => meridiem(hours, minutes, true, true),\n\t\tz: () => stripTimeZone(date.toLocaleDateString(toValue(options.locales), { timeZoneName: \"shortOffset\" })),\n\t\tzz: () => stripTimeZone(date.toLocaleDateString(toValue(options.locales), { timeZoneName: \"shortOffset\" })),\n\t\tzzz: () => stripTimeZone(date.toLocaleDateString(toValue(options.locales), { timeZoneName: \"shortOffset\" })),\n\t\tzzzz: () => stripTimeZone(date.toLocaleDateString(toValue(options.locales), { timeZoneName: \"longOffset\" }))\n\t};\n\treturn formatStr.replace(REGEX_FORMAT, (match, $1) => {\n\t\tvar _ref, _matches$match;\n\t\treturn (_ref = $1 !== null && $1 !== void 0 ? $1 : (_matches$match = matches[match]) === null || _matches$match === void 0 ? void 0 : _matches$match.call(matches)) !== null && _ref !== void 0 ? _ref : match;\n\t});\n}\nfunction normalizeDate(date) {\n\tif (date === null) return /* @__PURE__ */ new Date(NaN);\n\tif (date === void 0) return /* @__PURE__ */ new Date();\n\tif (date instanceof Date) return new Date(date);\n\tif (typeof date === \"string\" && !/Z$/i.test(date)) {\n\t\tconst d = date.match(REGEX_PARSE);\n\t\tif (d) {\n\t\t\tconst m = d[2] - 1 || 0;\n\t\t\tconst ms = (d[7] || \"0\").substring(0, 3);\n\t\t\treturn new Date(d[1], m, d[3] || 1, d[4] || 0, d[5] || 0, d[6] || 0, ms);\n\t\t}\n\t}\n\treturn new Date(date);\n}\n/**\n* Get the formatted date according to the string of tokens passed in.\n*\n* @see https://vueuse.org/useDateFormat\n* @param date - The date to format, can either be a `Date` object, a timestamp, or a string\n* @param formatStr - The combination of tokens to format the date\n* @param options - UseDateFormatOptions\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useDateFormat(date, formatStr = \"HH:mm:ss\", options = {}) {\n\treturn computed(() => formatDate(normalizeDate(toValue(date)), toValue(formatStr), options));\n}\n\n//#endregion\n//#region useIntervalFn/index.ts\n/**\n* Wrapper for `setInterval` with controls\n*\n* @see https://vueuse.org/useIntervalFn\n* @param cb\n* @param interval\n* @param options\n*/\nfunction useIntervalFn(cb, interval = 1e3, options = {}) {\n\tconst { immediate = true, immediateCallback = false } = options;\n\tlet timer = null;\n\tconst isActive = shallowRef(false);\n\tfunction clean() {\n\t\tif (timer) {\n\t\t\tclearInterval(timer);\n\t\t\ttimer = null;\n\t\t}\n\t}\n\tfunction pause() {\n\t\tisActive.value = false;\n\t\tclean();\n\t}\n\tfunction resume() {\n\t\tconst intervalValue = toValue(interval);\n\t\tif (intervalValue <= 0) return;\n\t\tisActive.value = true;\n\t\tif (immediateCallback) cb();\n\t\tclean();\n\t\tif (isActive.value) timer = setInterval(cb, intervalValue);\n\t}\n\tif (immediate && isClient) resume();\n\tif (isRef(interval) || typeof interval === \"function\") tryOnScopeDispose(watch(interval, () => {\n\t\tif (isActive.value && isClient) resume();\n\t}));\n\ttryOnScopeDispose(pause);\n\treturn {\n\t\tisActive: shallowReadonly(isActive),\n\t\tpause,\n\t\tresume\n\t};\n}\n\n//#endregion\n//#region useInterval/index.ts\nfunction useInterval(interval = 1e3, options = {}) {\n\tconst { controls: exposeControls = false, immediate = true, callback } = options;\n\tconst counter = shallowRef(0);\n\tconst update = () => counter.value += 1;\n\tconst reset = () => {\n\t\tcounter.value = 0;\n\t};\n\tconst controls = useIntervalFn(callback ? () => {\n\t\tupdate();\n\t\tcallback(counter.value);\n\t} : update, interval, { immediate });\n\tif (exposeControls) return {\n\t\tcounter: shallowReadonly(counter),\n\t\treset,\n\t\t...controls\n\t};\n\telse return shallowReadonly(counter);\n}\n\n//#endregion\n//#region useLastChanged/index.ts\nfunction useLastChanged(source, options = {}) {\n\tvar _options$initialValue;\n\tconst ms = shallowRef((_options$initialValue = options.initialValue) !== null && _options$initialValue !== void 0 ? _options$initialValue : null);\n\twatch(source, () => ms.value = timestamp(), options);\n\treturn shallowReadonly(ms);\n}\n\n//#endregion\n//#region useTimeoutFn/index.ts\n/**\n* Wrapper for `setTimeout` with controls.\n*\n* @param cb\n* @param interval\n* @param options\n*/\nfunction useTimeoutFn(cb, interval, options = {}) {\n\tconst { immediate = true, immediateCallback = false } = options;\n\tconst isPending = shallowRef(false);\n\tlet timer;\n\tfunction clear() {\n\t\tif (timer) {\n\t\t\tclearTimeout(timer);\n\t\t\ttimer = void 0;\n\t\t}\n\t}\n\tfunction stop() {\n\t\tisPending.value = false;\n\t\tclear();\n\t}\n\tfunction start(...args) {\n\t\tif (immediateCallback) cb();\n\t\tclear();\n\t\tisPending.value = true;\n\t\ttimer = setTimeout(() => {\n\t\t\tisPending.value = false;\n\t\t\ttimer = void 0;\n\t\t\tcb(...args);\n\t\t}, toValue(interval));\n\t}\n\tif (immediate) {\n\t\tisPending.value = true;\n\t\tif (isClient) start();\n\t}\n\ttryOnScopeDispose(stop);\n\treturn {\n\t\tisPending: shallowReadonly(isPending),\n\t\tstart,\n\t\tstop\n\t};\n}\n\n//#endregion\n//#region useTimeout/index.ts\nfunction useTimeout(interval = 1e3, options = {}) {\n\tconst { controls: exposeControls = false, callback } = options;\n\tconst controls = useTimeoutFn(callback !== null && callback !== void 0 ? callback : noop, interval, options);\n\tconst ready = computed(() => !controls.isPending.value);\n\tif (exposeControls) return {\n\t\tready,\n\t\t...controls\n\t};\n\telse return ready;\n}\n\n//#endregion\n//#region useToNumber/index.ts\n/**\n* Reactively convert a string ref to number.\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useToNumber(value, options = {}) {\n\tconst { method = \"parseFloat\", radix, nanToZero } = options;\n\treturn computed(() => {\n\t\tlet resolved = toValue(value);\n\t\tif (typeof method === \"function\") resolved = method(resolved);\n\t\telse if (typeof resolved === \"string\") resolved = Number[method](resolved, radix);\n\t\tif (nanToZero && Number.isNaN(resolved)) resolved = 0;\n\t\treturn resolved;\n\t});\n}\n\n//#endregion\n//#region useToString/index.ts\n/**\n* Reactively convert a ref to string.\n*\n* @see https://vueuse.org/useToString\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useToString(value) {\n\treturn computed(() => `${toValue(value)}`);\n}\n\n//#endregion\n//#region useToggle/index.ts\n/**\n* A boolean ref with a toggler\n*\n* @see https://vueuse.org/useToggle\n* @param [initialValue]\n* @param options\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useToggle(initialValue = false, options = {}) {\n\tconst { truthyValue = true, falsyValue = false } = options;\n\tconst valueIsRef = isRef(initialValue);\n\tconst _value = shallowRef(initialValue);\n\tfunction toggle(value) {\n\t\tif (arguments.length) {\n\t\t\t_value.value = value;\n\t\t\treturn _value.value;\n\t\t} else {\n\t\t\tconst truthy = toValue(truthyValue);\n\t\t\t_value.value = _value.value === truthy ? toValue(falsyValue) : truthy;\n\t\t\treturn _value.value;\n\t\t}\n\t}\n\tif (valueIsRef) return toggle;\n\telse return [_value, toggle];\n}\n\n//#endregion\n//#region watchArray/index.ts\n/**\n* Watch for an array with additions and removals.\n*\n* @see https://vueuse.org/watchArray\n*/\nfunction watchArray(source, cb, options) {\n\tlet oldList = (options === null || options === void 0 ? void 0 : options.immediate) ? [] : [...typeof source === \"function\" ? source() : Array.isArray(source) ? source : toValue(source)];\n\treturn watch(source, (newList, _, onCleanup) => {\n\t\tconst oldListRemains = Array.from({ length: oldList.length });\n\t\tconst added = [];\n\t\tfor (const obj of newList) {\n\t\t\tlet found = false;\n\t\t\tfor (let i = 0; i < oldList.length; i++) if (!oldListRemains[i] && obj === oldList[i]) {\n\t\t\t\toldListRemains[i] = true;\n\t\t\t\tfound = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (!found) added.push(obj);\n\t\t}\n\t\tconst removed = oldList.filter((_$1, i) => !oldListRemains[i]);\n\t\tcb(newList, oldList, added, removed, onCleanup);\n\t\toldList = [...newList];\n\t}, options);\n}\n\n//#endregion\n//#region watchAtMost/index.ts\nfunction watchAtMost(source, cb, options) {\n\tconst { count,...watchOptions } = options;\n\tconst current = shallowRef(0);\n\tconst { stop, resume, pause } = watchWithFilter(source, (...args) => {\n\t\tcurrent.value += 1;\n\t\tif (current.value >= toValue(count)) nextTick(() => stop());\n\t\tcb(...args);\n\t}, watchOptions);\n\treturn {\n\t\tcount: current,\n\t\tstop,\n\t\tresume,\n\t\tpause\n\t};\n}\n\n//#endregion\n//#region watchDebounced/index.ts\nfunction watchDebounced(source, cb, options = {}) {\n\tconst { debounce = 0, maxWait = void 0,...watchOptions } = options;\n\treturn watchWithFilter(source, cb, {\n\t\t...watchOptions,\n\t\teventFilter: debounceFilter(debounce, { maxWait })\n\t});\n}\n/** @deprecated use `watchDebounced` instead */\nconst debouncedWatch = watchDebounced;\n\n//#endregion\n//#region watchDeep/index.ts\n/**\n* Shorthand for watching value with {deep: true}\n*\n* @see https://vueuse.org/watchDeep\n*/\nfunction watchDeep(source, cb, options) {\n\treturn watch(source, cb, {\n\t\t...options,\n\t\tdeep: true\n\t});\n}\n\n//#endregion\n//#region watchIgnorable/index.ts\nfunction watchIgnorable(source, cb, options = {}) {\n\tconst { eventFilter = bypassFilter,...watchOptions } = options;\n\tconst filteredCb = createFilterWrapper(eventFilter, cb);\n\tlet ignoreUpdates;\n\tlet ignorePrevAsyncUpdates;\n\tlet stop;\n\tif (watchOptions.flush === \"sync\") {\n\t\tlet ignore = false;\n\t\tignorePrevAsyncUpdates = () => {};\n\t\tignoreUpdates = (updater) => {\n\t\t\tignore = true;\n\t\t\tupdater();\n\t\t\tignore = false;\n\t\t};\n\t\tstop = watch(source, (...args) => {\n\t\t\tif (!ignore) filteredCb(...args);\n\t\t}, watchOptions);\n\t} else {\n\t\tconst disposables = [];\n\t\tlet ignoreCounter = 0;\n\t\tlet syncCounter = 0;\n\t\tignorePrevAsyncUpdates = () => {\n\t\t\tignoreCounter = syncCounter;\n\t\t};\n\t\tdisposables.push(watch(source, () => {\n\t\t\tsyncCounter++;\n\t\t}, {\n\t\t\t...watchOptions,\n\t\t\tflush: \"sync\"\n\t\t}));\n\t\tignoreUpdates = (updater) => {\n\t\t\tconst syncCounterPrev = syncCounter;\n\t\t\tupdater();\n\t\t\tignoreCounter += syncCounter - syncCounterPrev;\n\t\t};\n\t\tdisposables.push(watch(source, (...args) => {\n\t\t\tconst ignore = ignoreCounter > 0 && ignoreCounter === syncCounter;\n\t\t\tignoreCounter = 0;\n\t\t\tsyncCounter = 0;\n\t\t\tif (ignore) return;\n\t\t\tfilteredCb(...args);\n\t\t}, watchOptions));\n\t\tstop = () => {\n\t\t\tdisposables.forEach((fn) => fn());\n\t\t};\n\t}\n\treturn {\n\t\tstop,\n\t\tignoreUpdates,\n\t\tignorePrevAsyncUpdates\n\t};\n}\n/** @deprecated use `watchIgnorable` instead */\nconst ignorableWatch = watchIgnorable;\n\n//#endregion\n//#region watchImmediate/index.ts\n/**\n* Shorthand for watching value with {immediate: true}\n*\n* @see https://vueuse.org/watchImmediate\n*/\nfunction watchImmediate(source, cb, options) {\n\treturn watch(source, cb, {\n\t\t...options,\n\t\timmediate: true\n\t});\n}\n\n//#endregion\n//#region watchOnce/index.ts\n/**\n* Shorthand for watching value with { once: true }\n*\n* @see https://vueuse.org/watchOnce\n*/\nfunction watchOnce(source, cb, options) {\n\treturn watch(source, cb, {\n\t\t...options,\n\t\tonce: true\n\t});\n}\n\n//#endregion\n//#region watchThrottled/index.ts\nfunction watchThrottled(source, cb, options = {}) {\n\tconst { throttle = 0, trailing = true, leading = true,...watchOptions } = options;\n\treturn watchWithFilter(source, cb, {\n\t\t...watchOptions,\n\t\teventFilter: throttleFilter(throttle, trailing, leading)\n\t});\n}\n/** @deprecated use `watchThrottled` instead */\nconst throttledWatch = watchThrottled;\n\n//#endregion\n//#region watchTriggerable/index.ts\nfunction watchTriggerable(source, cb, options = {}) {\n\tlet cleanupFn;\n\tfunction onEffect() {\n\t\tif (!cleanupFn) return;\n\t\tconst fn = cleanupFn;\n\t\tcleanupFn = void 0;\n\t\tfn();\n\t}\n\t/** Register the function `cleanupFn` */\n\tfunction onCleanup(callback) {\n\t\tcleanupFn = callback;\n\t}\n\tconst _cb = (value, oldValue) => {\n\t\tonEffect();\n\t\treturn cb(value, oldValue, onCleanup);\n\t};\n\tconst res = watchIgnorable(source, _cb, options);\n\tconst { ignoreUpdates } = res;\n\tconst trigger = () => {\n\t\tlet res$1;\n\t\tignoreUpdates(() => {\n\t\t\tres$1 = _cb(getWatchSources(source), getOldValue(source));\n\t\t});\n\t\treturn res$1;\n\t};\n\treturn {\n\t\t...res,\n\t\ttrigger\n\t};\n}\nfunction getWatchSources(sources) {\n\tif (isReactive(sources)) return sources;\n\tif (Array.isArray(sources)) return sources.map((item) => toValue(item));\n\treturn toValue(sources);\n}\nfunction getOldValue(source) {\n\treturn Array.isArray(source) ? source.map(() => void 0) : void 0;\n}\n\n//#endregion\n//#region whenever/index.ts\n/**\n* Shorthand for watching value to be truthy\n*\n* @see https://vueuse.org/whenever\n*/\nfunction whenever(source, cb, options) {\n\tconst stop = watch(source, (v, ov, onInvalidate) => {\n\t\tif (v) {\n\t\t\tif (options === null || options === void 0 ? void 0 : options.once) nextTick(() => stop());\n\t\t\tcb(v, ov, onInvalidate);\n\t\t}\n\t}, {\n\t\t...options,\n\t\tonce: false\n\t});\n\treturn stop;\n}\n\n//#endregion\nexport { assert, autoResetRef, bypassFilter, camelize, clamp, computedEager, computedWithControl, containsProp, controlledComputed, controlledRef, createEventHook, createFilterWrapper, createGlobalState, createInjectionState, createReactiveFn, createRef, createSharedComposable, createSingletonPromise, debounceFilter, debouncedRef, debouncedWatch, eagerComputed, extendRef, formatDate, get, getLifeCycleTarget, hasOwn, hyphenate, identity, ignorableWatch, increaseWithUnit, injectLocal, invoke, isClient, isDef, isDefined, isIOS, isObject, isWorker, makeDestructurable, noop, normalizeDate, notNullish, now, objectEntries, objectOmit, objectPick, pausableFilter, pausableWatch, promiseTimeout, provideLocal, pxValue, rand, reactify, reactifyObject, reactiveComputed, reactiveOmit, reactivePick, refAutoReset, refDebounced, refDefault, refManualReset, refThrottled, refWithControl, set, syncRef, syncRefs, throttleFilter, throttledRef, throttledWatch, timestamp, toArray, toReactive, toRef, toRefs, tryOnBeforeMount, tryOnBeforeUnmount, tryOnMounted, tryOnScopeDispose, tryOnUnmounted, until, useArrayDifference, useArrayEvery, useArrayFilter, useArrayFind, useArrayFindIndex, useArrayFindLast, useArrayIncludes, useArrayJoin, useArrayMap, useArrayReduce, useArraySome, useArrayUnique, useCounter, useDateFormat, useDebounce, useDebounceFn, useInterval, useIntervalFn, useLastChanged, useThrottle, useThrottleFn, useTimeout, useTimeoutFn, useToNumber, useToString, useToggle, watchArray, watchAtMost, watchDebounced, watchDeep, watchIgnorable, watchImmediate, watchOnce, watchPausable, watchThrottled, watchTriggerable, watchWithFilter, whenever };","import { bypassFilter, camelize, clamp, computedWithControl, containsProp, createEventHook, createFilterWrapper, createRef, createSingletonPromise, debounceFilter, hasOwn, identity, increaseWithUnit, injectLocal, isClient, isDef, isIOS, isObject, isWorker, makeDestructurable, noop, notNullish, objectEntries, objectOmit, objectPick, pausableFilter, pausableWatch, promiseTimeout, provideLocal, pxValue, syncRef, throttleFilter, timestamp, toArray, toRef, toRefs, tryOnMounted, tryOnScopeDispose, tryOnUnmounted, until, useDebounceFn, useIntervalFn, useThrottleFn, useTimeoutFn, watchIgnorable, watchImmediate, watchOnce, watchWithFilter, whenever } from \"@vueuse/shared\";\nimport { Fragment, TransitionGroup, computed, customRef, defineComponent, getCurrentInstance, getCurrentScope, h, hasInjectionContext, inject, isReadonly, isRef, markRaw, nextTick, onBeforeUpdate, onMounted, onUpdated, reactive, readonly, ref, shallowReactive, shallowReadonly, shallowRef, toRaw, toValue, unref, watch, watchEffect } from \"vue\";\n\nexport * from \"@vueuse/shared\"\n\n//#region computedAsync/index.ts\nfunction computedAsync(evaluationCallback, initialState, optionsOrRef) {\n\tvar _globalThis$reportErr;\n\tlet options;\n\tif (isRef(optionsOrRef)) options = { evaluating: optionsOrRef };\n\telse options = optionsOrRef || {};\n\tconst { lazy = false, flush = \"sync\", evaluating = void 0, shallow = true, onError = (_globalThis$reportErr = globalThis.reportError) !== null && _globalThis$reportErr !== void 0 ? _globalThis$reportErr : noop } = options;\n\tconst started = shallowRef(!lazy);\n\tconst current = shallow ? shallowRef(initialState) : ref(initialState);\n\tlet counter = 0;\n\twatchEffect(async (onInvalidate) => {\n\t\tif (!started.value) return;\n\t\tcounter++;\n\t\tconst counterAtBeginning = counter;\n\t\tlet hasFinished = false;\n\t\tif (evaluating) Promise.resolve().then(() => {\n\t\t\tevaluating.value = true;\n\t\t});\n\t\ttry {\n\t\t\tconst result = await evaluationCallback((cancelCallback) => {\n\t\t\t\tonInvalidate(() => {\n\t\t\t\t\tif (evaluating) evaluating.value = false;\n\t\t\t\t\tif (!hasFinished) cancelCallback();\n\t\t\t\t});\n\t\t\t});\n\t\t\tif (counterAtBeginning === counter) current.value = result;\n\t\t} catch (e) {\n\t\t\tonError(e);\n\t\t} finally {\n\t\t\tif (evaluating && counterAtBeginning === counter) evaluating.value = false;\n\t\t\thasFinished = true;\n\t\t}\n\t}, { flush });\n\tif (lazy) return computed(() => {\n\t\tstarted.value = true;\n\t\treturn current.value;\n\t});\n\telse return current;\n}\n/** @deprecated use `computedAsync` instead */\nconst asyncComputed = computedAsync;\n\n//#endregion\n//#region computedInject/index.ts\nfunction computedInject(key, options, defaultSource, treatDefaultAsFactory) {\n\tlet source = inject(key);\n\tif (defaultSource) source = inject(key, defaultSource);\n\tif (treatDefaultAsFactory) source = inject(key, defaultSource, treatDefaultAsFactory);\n\tif (typeof options === \"function\") return computed((oldValue) => options(source, oldValue));\n\telse return computed({\n\t\tget: (oldValue) => options.get(source, oldValue),\n\t\tset: options.set\n\t});\n}\n\n//#endregion\n//#region createReusableTemplate/index.ts\n/**\n* This function creates `define` and `reuse` components in pair,\n* It also allow to pass a generic to bind with type.\n*\n* @see https://vueuse.org/createReusableTemplate\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction createReusableTemplate(options = {}) {\n\tconst { inheritAttrs = true } = options;\n\tconst render = shallowRef();\n\tconst define = defineComponent({ setup(_, { slots }) {\n\t\treturn () => {\n\t\t\trender.value = slots.default;\n\t\t};\n\t} });\n\tconst reuse = defineComponent({\n\t\tinheritAttrs,\n\t\tprops: options.props,\n\t\tsetup(props, { attrs, slots }) {\n\t\t\treturn () => {\n\t\t\t\tvar _render$value;\n\t\t\t\tif (!render.value && true) throw new Error(\"[VueUse] Failed to find the definition of reusable template\");\n\t\t\t\tconst vnode = (_render$value = render.value) === null || _render$value === void 0 ? void 0 : _render$value.call(render, {\n\t\t\t\t\t...options.props == null ? keysToCamelKebabCase(attrs) : props,\n\t\t\t\t\t$slots: slots\n\t\t\t\t});\n\t\t\t\treturn inheritAttrs && (vnode === null || vnode === void 0 ? void 0 : vnode.length) === 1 ? vnode[0] : vnode;\n\t\t\t};\n\t\t}\n\t});\n\treturn makeDestructurable({\n\t\tdefine,\n\t\treuse\n\t}, [define, reuse]);\n}\nfunction keysToCamelKebabCase(obj) {\n\tconst newObj = {};\n\tfor (const key in obj) newObj[camelize(key)] = obj[key];\n\treturn newObj;\n}\n\n//#endregion\n//#region createTemplatePromise/index.ts\n/**\n* Creates a template promise component.\n*\n* @see https://vueuse.org/createTemplatePromise\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction createTemplatePromise(options = {}) {\n\tlet index = 0;\n\tconst instances = ref([]);\n\tfunction create(...args) {\n\t\tconst props = shallowReactive({\n\t\t\tkey: index++,\n\t\t\targs,\n\t\t\tpromise: void 0,\n\t\t\tresolve: () => {},\n\t\t\treject: () => {},\n\t\t\tisResolving: false,\n\t\t\toptions\n\t\t});\n\t\tinstances.value.push(props);\n\t\tprops.promise = new Promise((_resolve, _reject) => {\n\t\t\tprops.resolve = (v) => {\n\t\t\t\tprops.isResolving = true;\n\t\t\t\treturn _resolve(v);\n\t\t\t};\n\t\t\tprops.reject = _reject;\n\t\t}).finally(() => {\n\t\t\tprops.promise = void 0;\n\t\t\tconst index$1 = instances.value.indexOf(props);\n\t\t\tif (index$1 !== -1) instances.value.splice(index$1, 1);\n\t\t});\n\t\treturn props.promise;\n\t}\n\tfunction start(...args) {\n\t\tif (options.singleton && instances.value.length > 0) return instances.value[0].promise;\n\t\treturn create(...args);\n\t}\n\tconst component = defineComponent((_, { slots }) => {\n\t\tconst renderList = () => instances.value.map((props) => {\n\t\t\tvar _slots$default;\n\t\t\treturn h(Fragment, { key: props.key }, (_slots$default = slots.default) === null || _slots$default === void 0 ? void 0 : _slots$default.call(slots, props));\n\t\t});\n\t\tif (options.transition) return () => h(TransitionGroup, options.transition, renderList);\n\t\treturn renderList;\n\t});\n\tcomponent.start = start;\n\treturn component;\n}\n\n//#endregion\n//#region createUnrefFn/index.ts\n/**\n* Make a plain function accepting ref and raw values as arguments.\n* Returns the same value the unconverted function returns, with proper typing.\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction createUnrefFn(fn) {\n\treturn function(...args) {\n\t\treturn fn.apply(this, args.map((i) => toValue(i)));\n\t};\n}\n\n//#endregion\n//#region _configurable.ts\nconst defaultWindow = isClient ? window : void 0;\nconst defaultDocument = isClient ? window.document : void 0;\nconst defaultNavigator = isClient ? window.navigator : void 0;\nconst defaultLocation = isClient ? window.location : void 0;\n\n//#endregion\n//#region unrefElement/index.ts\n/**\n* Get the dom element of a ref of element or Vue component instance\n*\n* @param elRef\n*/\nfunction unrefElement(elRef) {\n\tvar _$el;\n\tconst plain = toValue(elRef);\n\treturn (_$el = plain === null || plain === void 0 ? void 0 : plain.$el) !== null && _$el !== void 0 ? _$el : plain;\n}\n\n//#endregion\n//#region useEventListener/index.ts\nfunction useEventListener(...args) {\n\tconst cleanups = [];\n\tconst cleanup = () => {\n\t\tcleanups.forEach((fn) => fn());\n\t\tcleanups.length = 0;\n\t};\n\tconst register = (el, event, listener, options) => {\n\t\tel.addEventListener(event, listener, options);\n\t\treturn () => el.removeEventListener(event, listener, options);\n\t};\n\tconst firstParamTargets = computed(() => {\n\t\tconst test = toArray(toValue(args[0])).filter((e) => e != null);\n\t\treturn test.every((e) => typeof e !== \"string\") ? test : void 0;\n\t});\n\tconst stopWatch = watchImmediate(() => {\n\t\tvar _firstParamTargets$va, _firstParamTargets$va2;\n\t\treturn [\n\t\t\t(_firstParamTargets$va = (_firstParamTargets$va2 = firstParamTargets.value) === null || _firstParamTargets$va2 === void 0 ? void 0 : _firstParamTargets$va2.map((e) => unrefElement(e))) !== null && _firstParamTargets$va !== void 0 ? _firstParamTargets$va : [defaultWindow].filter((e) => e != null),\n\t\t\ttoArray(toValue(firstParamTargets.value ? args[1] : args[0])),\n\t\t\ttoArray(unref(firstParamTargets.value ? args[2] : args[1])),\n\t\t\ttoValue(firstParamTargets.value ? args[3] : args[2])\n\t\t];\n\t}, ([raw_targets, raw_events, raw_listeners, raw_options]) => {\n\t\tcleanup();\n\t\tif (!(raw_targets === null || raw_targets === void 0 ? void 0 : raw_targets.length) || !(raw_events === null || raw_events === void 0 ? void 0 : raw_events.length) || !(raw_listeners === null || raw_listeners === void 0 ? void 0 : raw_listeners.length)) return;\n\t\tconst optionsClone = isObject(raw_options) ? { ...raw_options } : raw_options;\n\t\tcleanups.push(...raw_targets.flatMap((el) => raw_events.flatMap((event) => raw_listeners.map((listener) => register(el, event, listener, optionsClone)))));\n\t}, { flush: \"post\" });\n\tconst stop = () => {\n\t\tstopWatch();\n\t\tcleanup();\n\t};\n\ttryOnScopeDispose(cleanup);\n\treturn stop;\n}\n\n//#endregion\n//#region onClickOutside/index.ts\nlet _iOSWorkaround = false;\nfunction onClickOutside(target, handler, options = {}) {\n\tconst { window: window$1 = defaultWindow, ignore = [], capture = true, detectIframe = false, controls = false } = options;\n\tif (!window$1) return controls ? {\n\t\tstop: noop,\n\t\tcancel: noop,\n\t\ttrigger: noop\n\t} : noop;\n\tif (isIOS && !_iOSWorkaround) {\n\t\t_iOSWorkaround = true;\n\t\tconst listenerOptions = { passive: true };\n\t\tArray.from(window$1.document.body.children).forEach((el) => el.addEventListener(\"click\", noop, listenerOptions));\n\t\twindow$1.document.documentElement.addEventListener(\"click\", noop, listenerOptions);\n\t}\n\tlet shouldListen = true;\n\tconst shouldIgnore = (event) => {\n\t\treturn toValue(ignore).some((target$1) => {\n\t\t\tif (typeof target$1 === \"string\") return Array.from(window$1.document.querySelectorAll(target$1)).some((el) => el === event.target || event.composedPath().includes(el));\n\t\t\telse {\n\t\t\t\tconst el = unrefElement(target$1);\n\t\t\t\treturn el && (event.target === el || event.composedPath().includes(el));\n\t\t\t}\n\t\t});\n\t};\n\t/**\n\t* Determines if the given target has multiple root elements.\n\t* Referenced from: https://github.com/vuejs/test-utils/blob/ccb460be55f9f6be05ab708500a41ec8adf6f4bc/src/vue-wrapper.ts#L21\n\t*/\n\tfunction hasMultipleRoots(target$1) {\n\t\tconst vm = toValue(target$1);\n\t\treturn vm && vm.$.subTree.shapeFlag === 16;\n\t}\n\tfunction checkMultipleRoots(target$1, event) {\n\t\tconst vm = toValue(target$1);\n\t\tconst children = vm.$.subTree && vm.$.subTree.children;\n\t\tif (children == null || !Array.isArray(children)) return false;\n\t\treturn children.some((child) => child.el === event.target || event.composedPath().includes(child.el));\n\t}\n\tconst listener = (event) => {\n\t\tconst el = unrefElement(target);\n\t\tif (event.target == null) return;\n\t\tif (!(el instanceof Element) && hasMultipleRoots(target) && checkMultipleRoots(target, event)) return;\n\t\tif (!el || el === event.target || event.composedPath().includes(el)) return;\n\t\tif (\"detail\" in event && event.detail === 0) shouldListen = !shouldIgnore(event);\n\t\tif (!shouldListen) {\n\t\t\tshouldListen = true;\n\t\t\treturn;\n\t\t}\n\t\thandler(event);\n\t};\n\tlet isProcessingClick = false;\n\tconst cleanup = [\n\t\tuseEventListener(window$1, \"click\", (event) => {\n\t\t\tif (!isProcessingClick) {\n\t\t\t\tisProcessingClick = true;\n\t\t\t\tsetTimeout(() => {\n\t\t\t\t\tisProcessingClick = false;\n\t\t\t\t}, 0);\n\t\t\t\tlistener(event);\n\t\t\t}\n\t\t}, {\n\t\t\tpassive: true,\n\t\t\tcapture\n\t\t}),\n\t\tuseEventListener(window$1, \"pointerdown\", (e) => {\n\t\t\tconst el = unrefElement(target);\n\t\t\tshouldListen = !shouldIgnore(e) && !!(el && !e.composedPath().includes(el));\n\t\t}, { passive: true }),\n\t\tdetectIframe && useEventListener(window$1, \"blur\", (event) => {\n\t\t\tsetTimeout(() => {\n\t\t\t\tvar _window$document$acti;\n\t\t\t\tconst el = unrefElement(target);\n\t\t\t\tif (((_window$document$acti = window$1.document.activeElement) === null || _window$document$acti === void 0 ? void 0 : _window$document$acti.tagName) === \"IFRAME\" && !(el === null || el === void 0 ? void 0 : el.contains(window$1.document.activeElement))) handler(event);\n\t\t\t}, 0);\n\t\t}, { passive: true })\n\t].filter(Boolean);\n\tconst stop = () => cleanup.forEach((fn) => fn());\n\tif (controls) return {\n\t\tstop,\n\t\tcancel: () => {\n\t\t\tshouldListen = false;\n\t\t},\n\t\ttrigger: (event) => {\n\t\t\tshouldListen = true;\n\t\t\tlistener(event);\n\t\t\tshouldListen = false;\n\t\t}\n\t};\n\treturn stop;\n}\n\n//#endregion\n//#region useMounted/index.ts\n/**\n* Mounted state in ref.\n*\n* @see https://vueuse.org/useMounted\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useMounted() {\n\tconst isMounted = shallowRef(false);\n\tconst instance = getCurrentInstance();\n\tif (instance) onMounted(() => {\n\t\tisMounted.value = true;\n\t}, instance);\n\treturn isMounted;\n}\n\n//#endregion\n//#region useSupported/index.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction useSupported(callback) {\n\tconst isMounted = useMounted();\n\treturn computed(() => {\n\t\tisMounted.value;\n\t\treturn Boolean(callback());\n\t});\n}\n\n//#endregion\n//#region useMutationObserver/index.ts\n/**\n* Watch for changes being made to the DOM tree.\n*\n* @see https://vueuse.org/useMutationObserver\n* @see https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver MutationObserver MDN\n* @param target\n* @param callback\n* @param options\n*/\nfunction useMutationObserver(target, callback, options = {}) {\n\tconst { window: window$1 = defaultWindow,...mutationOptions } = options;\n\tlet observer;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => window$1 && \"MutationObserver\" in window$1);\n\tconst cleanup = () => {\n\t\tif (observer) {\n\t\t\tobserver.disconnect();\n\t\t\tobserver = void 0;\n\t\t}\n\t};\n\tconst stopWatch = watch(computed(() => {\n\t\tconst items = toArray(toValue(target)).map(unrefElement).filter(notNullish);\n\t\treturn new Set(items);\n\t}), (newTargets) => {\n\t\tcleanup();\n\t\tif (isSupported.value && newTargets.size) {\n\t\t\tobserver = new MutationObserver(callback);\n\t\t\tnewTargets.forEach((el) => observer.observe(el, mutationOptions));\n\t\t}\n\t}, {\n\t\timmediate: true,\n\t\tflush: \"post\"\n\t});\n\tconst takeRecords = () => {\n\t\treturn observer === null || observer === void 0 ? void 0 : observer.takeRecords();\n\t};\n\tconst stop = () => {\n\t\tstopWatch();\n\t\tcleanup();\n\t};\n\ttryOnScopeDispose(stop);\n\treturn {\n\t\tisSupported,\n\t\tstop,\n\t\ttakeRecords\n\t};\n}\n\n//#endregion\n//#region onElementRemoval/index.ts\n/**\n* Fires when the element or any element containing it is removed.\n*\n* @param target\n* @param callback\n* @param options\n*/\nfunction onElementRemoval(target, callback, options = {}) {\n\tconst { window: window$1 = defaultWindow, document: document$1 = window$1 === null || window$1 === void 0 ? void 0 : window$1.document, flush = \"sync\" } = options;\n\tif (!window$1 || !document$1) return noop;\n\tlet stopFn;\n\tconst cleanupAndUpdate = (fn) => {\n\t\tstopFn === null || stopFn === void 0 || stopFn();\n\t\tstopFn = fn;\n\t};\n\tconst stopWatch = watchEffect(() => {\n\t\tconst el = unrefElement(target);\n\t\tif (el) {\n\t\t\tconst { stop } = useMutationObserver(document$1, (mutationsList) => {\n\t\t\t\tif (mutationsList.map((mutation) => [...mutation.removedNodes]).flat().some((node) => node === el || node.contains(el))) callback(mutationsList);\n\t\t\t}, {\n\t\t\t\twindow: window$1,\n\t\t\t\tchildList: true,\n\t\t\t\tsubtree: true\n\t\t\t});\n\t\t\tcleanupAndUpdate(stop);\n\t\t}\n\t}, { flush });\n\tconst stopHandle = () => {\n\t\tstopWatch();\n\t\tcleanupAndUpdate();\n\t};\n\ttryOnScopeDispose(stopHandle);\n\treturn stopHandle;\n}\n\n//#endregion\n//#region onKeyStroke/index.ts\nfunction createKeyPredicate(keyFilter) {\n\tif (typeof keyFilter === \"function\") return keyFilter;\n\telse if (typeof keyFilter === \"string\") return (event) => event.key === keyFilter;\n\telse if (Array.isArray(keyFilter)) return (event) => keyFilter.includes(event.key);\n\treturn () => true;\n}\nfunction onKeyStroke(...args) {\n\tlet key;\n\tlet handler;\n\tlet options = {};\n\tif (args.length === 3) {\n\t\tkey = args[0];\n\t\thandler = args[1];\n\t\toptions = args[2];\n\t} else if (args.length === 2) if (typeof args[1] === \"object\") {\n\t\tkey = true;\n\t\thandler = args[0];\n\t\toptions = args[1];\n\t} else {\n\t\tkey = args[0];\n\t\thandler = args[1];\n\t}\n\telse {\n\t\tkey = true;\n\t\thandler = args[0];\n\t}\n\tconst { target = defaultWindow, eventName = \"keydown\", passive = false, dedupe = false } = options;\n\tconst predicate = createKeyPredicate(key);\n\tconst listener = (e) => {\n\t\tif (e.repeat && toValue(dedupe)) return;\n\t\tif (predicate(e)) handler(e);\n\t};\n\treturn useEventListener(target, eventName, listener, passive);\n}\n/**\n* Listen to the keydown event of the given key.\n*\n* @see https://vueuse.org/onKeyStroke\n* @param key\n* @param handler\n* @param options\n*/\nfunction onKeyDown(key, handler, options = {}) {\n\treturn onKeyStroke(key, handler, {\n\t\t...options,\n\t\teventName: \"keydown\"\n\t});\n}\n/**\n* Listen to the keypress event of the given key.\n*\n* @see https://vueuse.org/onKeyStroke\n* @param key\n* @param handler\n* @param options\n*/\nfunction onKeyPressed(key, handler, options = {}) {\n\treturn onKeyStroke(key, handler, {\n\t\t...options,\n\t\teventName: \"keypress\"\n\t});\n}\n/**\n* Listen to the keyup event of the given key.\n*\n* @see https://vueuse.org/onKeyStroke\n* @param key\n* @param handler\n* @param options\n*/\nfunction onKeyUp(key, handler, options = {}) {\n\treturn onKeyStroke(key, handler, {\n\t\t...options,\n\t\teventName: \"keyup\"\n\t});\n}\n\n//#endregion\n//#region onLongPress/index.ts\nconst DEFAULT_DELAY = 500;\nconst DEFAULT_THRESHOLD = 10;\nfunction onLongPress(target, handler, options) {\n\tvar _options$modifiers10, _options$modifiers11;\n\tconst elementRef = computed(() => unrefElement(target));\n\tlet timeout;\n\tlet posStart;\n\tlet startTimestamp;\n\tlet hasLongPressed = false;\n\tfunction clear() {\n\t\tif (timeout) {\n\t\t\tclearTimeout(timeout);\n\t\t\ttimeout = void 0;\n\t\t}\n\t\tposStart = void 0;\n\t\tstartTimestamp = void 0;\n\t\thasLongPressed = false;\n\t}\n\tfunction getDelay(ev) {\n\t\tconst delay = options === null || options === void 0 ? void 0 : options.delay;\n\t\tif (typeof delay === \"function\") return delay(ev);\n\t\treturn delay !== null && delay !== void 0 ? delay : DEFAULT_DELAY;\n\t}\n\tfunction onRelease(ev) {\n\t\tvar _options$modifiers, _options$modifiers2, _options$modifiers3;\n\t\tconst [_startTimestamp, _posStart, _hasLongPressed] = [\n\t\t\tstartTimestamp,\n\t\t\tposStart,\n\t\t\thasLongPressed\n\t\t];\n\t\tclear();\n\t\tif (!(options === null || options === void 0 ? void 0 : options.onMouseUp) || !_posStart || !_startTimestamp) return;\n\t\tif ((options === null || options === void 0 || (_options$modifiers = options.modifiers) === null || _options$modifiers === void 0 ? void 0 : _options$modifiers.self) && ev.target !== elementRef.value) return;\n\t\tif (options === null || options === void 0 || (_options$modifiers2 = options.modifiers) === null || _options$modifiers2 === void 0 ? void 0 : _options$modifiers2.prevent) ev.preventDefault();\n\t\tif (options === null || options === void 0 || (_options$modifiers3 = options.modifiers) === null || _options$modifiers3 === void 0 ? void 0 : _options$modifiers3.stop) ev.stopPropagation();\n\t\tconst dx = ev.x - _posStart.x;\n\t\tconst dy = ev.y - _posStart.y;\n\t\tconst distance = Math.sqrt(dx * dx + dy * dy);\n\t\toptions.onMouseUp(ev.timeStamp - _startTimestamp, distance, _hasLongPressed);\n\t}\n\tfunction onDown(ev) {\n\t\tvar _options$modifiers4, _options$modifiers5, _options$modifiers6;\n\t\tif ((options === null || options === void 0 || (_options$modifiers4 = options.modifiers) === null || _options$modifiers4 === void 0 ? void 0 : _options$modifiers4.self) && ev.target !== elementRef.value) return;\n\t\tclear();\n\t\tif (options === null || options === void 0 || (_options$modifiers5 = options.modifiers) === null || _options$modifiers5 === void 0 ? void 0 : _options$modifiers5.prevent) ev.preventDefault();\n\t\tif (options === null || options === void 0 || (_options$modifiers6 = options.modifiers) === null || _options$modifiers6 === void 0 ? void 0 : _options$modifiers6.stop) ev.stopPropagation();\n\t\tposStart = {\n\t\t\tx: ev.x,\n\t\t\ty: ev.y\n\t\t};\n\t\tstartTimestamp = ev.timeStamp;\n\t\ttimeout = setTimeout(() => {\n\t\t\thasLongPressed = true;\n\t\t\thandler(ev);\n\t\t}, getDelay(ev));\n\t}\n\tfunction onMove(ev) {\n\t\tvar _options$modifiers7, _options$modifiers8, _options$modifiers9, _options$distanceThre;\n\t\tif ((options === null || options === void 0 || (_options$modifiers7 = options.modifiers) === null || _options$modifiers7 === void 0 ? void 0 : _options$modifiers7.self) && ev.target !== elementRef.value) return;\n\t\tif (!posStart || (options === null || options === void 0 ? void 0 : options.distanceThreshold) === false) return;\n\t\tif (options === null || options === void 0 || (_options$modifiers8 = options.modifiers) === null || _options$modifiers8 === void 0 ? void 0 : _options$modifiers8.prevent) ev.preventDefault();\n\t\tif (options === null || options === void 0 || (_options$modifiers9 = options.modifiers) === null || _options$modifiers9 === void 0 ? void 0 : _options$modifiers9.stop) ev.stopPropagation();\n\t\tconst dx = ev.x - posStart.x;\n\t\tconst dy = ev.y - posStart.y;\n\t\tif (Math.sqrt(dx * dx + dy * dy) >= ((_options$distanceThre = options === null || options === void 0 ? void 0 : options.distanceThreshold) !== null && _options$distanceThre !== void 0 ? _options$distanceThre : DEFAULT_THRESHOLD)) clear();\n\t}\n\tconst listenerOptions = {\n\t\tcapture: options === null || options === void 0 || (_options$modifiers10 = options.modifiers) === null || _options$modifiers10 === void 0 ? void 0 : _options$modifiers10.capture,\n\t\tonce: options === null || options === void 0 || (_options$modifiers11 = options.modifiers) === null || _options$modifiers11 === void 0 ? void 0 : _options$modifiers11.once\n\t};\n\tconst cleanup = [\n\t\tuseEventListener(elementRef, \"pointerdown\", onDown, listenerOptions),\n\t\tuseEventListener(elementRef, \"pointermove\", onMove, listenerOptions),\n\t\tuseEventListener(elementRef, [\"pointerup\", \"pointerleave\"], onRelease, listenerOptions)\n\t];\n\tconst stop = () => cleanup.forEach((fn) => fn());\n\treturn stop;\n}\n\n//#endregion\n//#region onStartTyping/index.ts\nfunction isFocusedElementEditable() {\n\tconst { activeElement, body } = document;\n\tif (!activeElement) return false;\n\tif (activeElement === body) return false;\n\tswitch (activeElement.tagName) {\n\t\tcase \"INPUT\":\n\t\tcase \"TEXTAREA\": return true;\n\t}\n\treturn activeElement.hasAttribute(\"contenteditable\");\n}\nfunction isTypedCharValid({ keyCode, metaKey, ctrlKey, altKey }) {\n\tif (metaKey || ctrlKey || altKey) return false;\n\tif (keyCode >= 48 && keyCode <= 57 || keyCode >= 96 && keyCode <= 105) return true;\n\tif (keyCode >= 65 && keyCode <= 90) return true;\n\treturn false;\n}\n/**\n* Fires when users start typing on non-editable elements.\n*\n* @see https://vueuse.org/onStartTyping\n* @param callback\n* @param options\n*/\nfunction onStartTyping(callback, options = {}) {\n\tconst { document: document$1 = defaultDocument } = options;\n\tconst keydown = (event) => {\n\t\tif (!isFocusedElementEditable() && isTypedCharValid(event)) callback(event);\n\t};\n\tif (document$1) useEventListener(document$1, \"keydown\", keydown, { passive: true });\n}\n\n//#endregion\n//#region templateRef/index.ts\n/**\n* @deprecated Use Vue's built-in `useTemplateRef` instead.\n*\n* Shorthand for binding ref to template element.\n*\n* @see https://vueuse.org/templateRef\n* @param key\n* @param initialValue\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction templateRef(key, initialValue = null) {\n\tconst instance = getCurrentInstance();\n\tlet _trigger = () => {};\n\tconst element = customRef((track, trigger) => {\n\t\t_trigger = trigger;\n\t\treturn {\n\t\t\tget() {\n\t\t\t\tvar _instance$proxy$$refs, _instance$proxy;\n\t\t\t\ttrack();\n\t\t\t\treturn (_instance$proxy$$refs = instance === null || instance === void 0 || (_instance$proxy = instance.proxy) === null || _instance$proxy === void 0 ? void 0 : _instance$proxy.$refs[key]) !== null && _instance$proxy$$refs !== void 0 ? _instance$proxy$$refs : initialValue;\n\t\t\t},\n\t\t\tset() {}\n\t\t};\n\t});\n\ttryOnMounted(_trigger);\n\tonUpdated(_trigger);\n\treturn element;\n}\n\n//#endregion\n//#region useActiveElement/index.ts\n/**\n* Reactive `document.activeElement`\n*\n* @see https://vueuse.org/useActiveElement\n* @param options\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useActiveElement(options = {}) {\n\tvar _options$document;\n\tconst { window: window$1 = defaultWindow, deep = true, triggerOnRemoval = false } = options;\n\tconst document$1 = (_options$document = options.document) !== null && _options$document !== void 0 ? _options$document : window$1 === null || window$1 === void 0 ? void 0 : window$1.document;\n\tconst getDeepActiveElement = () => {\n\t\tlet element = document$1 === null || document$1 === void 0 ? void 0 : document$1.activeElement;\n\t\tif (deep) {\n\t\t\tvar _element$shadowRoot;\n\t\t\twhile (element === null || element === void 0 ? void 0 : element.shadowRoot) element = element === null || element === void 0 || (_element$shadowRoot = element.shadowRoot) === null || _element$shadowRoot === void 0 ? void 0 : _element$shadowRoot.activeElement;\n\t\t}\n\t\treturn element;\n\t};\n\tconst activeElement = shallowRef();\n\tconst trigger = () => {\n\t\tactiveElement.value = getDeepActiveElement();\n\t};\n\tif (window$1) {\n\t\tconst listenerOptions = {\n\t\t\tcapture: true,\n\t\t\tpassive: true\n\t\t};\n\t\tuseEventListener(window$1, \"blur\", (event) => {\n\t\t\tif (event.relatedTarget !== null) return;\n\t\t\ttrigger();\n\t\t}, listenerOptions);\n\t\tuseEventListener(window$1, \"focus\", trigger, listenerOptions);\n\t}\n\tif (triggerOnRemoval) onElementRemoval(activeElement, trigger, { document: document$1 });\n\ttrigger();\n\treturn activeElement;\n}\n\n//#endregion\n//#region useRafFn/index.ts\n/**\n* Call function on every `requestAnimationFrame`. With controls of pausing and resuming.\n*\n* @see https://vueuse.org/useRafFn\n* @param fn\n* @param options\n*/\nfunction useRafFn(fn, options = {}) {\n\tconst { immediate = true, fpsLimit = void 0, window: window$1 = defaultWindow, once = false } = options;\n\tconst isActive = shallowRef(false);\n\tconst intervalLimit = computed(() => {\n\t\treturn fpsLimit ? 1e3 / toValue(fpsLimit) : null;\n\t});\n\tlet previousFrameTimestamp = 0;\n\tlet rafId = null;\n\tfunction loop(timestamp$1) {\n\t\tif (!isActive.value || !window$1) return;\n\t\tif (!previousFrameTimestamp) previousFrameTimestamp = timestamp$1;\n\t\tconst delta = timestamp$1 - previousFrameTimestamp;\n\t\tif (intervalLimit.value && delta < intervalLimit.value) {\n\t\t\trafId = window$1.requestAnimationFrame(loop);\n\t\t\treturn;\n\t\t}\n\t\tpreviousFrameTimestamp = timestamp$1;\n\t\tfn({\n\t\t\tdelta,\n\t\t\ttimestamp: timestamp$1\n\t\t});\n\t\tif (once) {\n\t\t\tisActive.value = false;\n\t\t\trafId = null;\n\t\t\treturn;\n\t\t}\n\t\trafId = window$1.requestAnimationFrame(loop);\n\t}\n\tfunction resume() {\n\t\tif (!isActive.value && window$1) {\n\t\t\tisActive.value = true;\n\t\t\tpreviousFrameTimestamp = 0;\n\t\t\trafId = window$1.requestAnimationFrame(loop);\n\t\t}\n\t}\n\tfunction pause() {\n\t\tisActive.value = false;\n\t\tif (rafId != null && window$1) {\n\t\t\twindow$1.cancelAnimationFrame(rafId);\n\t\t\trafId = null;\n\t\t}\n\t}\n\tif (immediate) resume();\n\ttryOnScopeDispose(pause);\n\treturn {\n\t\tisActive: readonly(isActive),\n\t\tpause,\n\t\tresume\n\t};\n}\n\n//#endregion\n//#region useAnimate/index.ts\n/**\n* Reactive Web Animations API\n*\n* @see https://vueuse.org/useAnimate\n* @param target\n* @param keyframes\n* @param options\n*/\nfunction useAnimate(target, keyframes, options) {\n\tlet config;\n\tlet animateOptions;\n\tif (isObject(options)) {\n\t\tconfig = options;\n\t\tanimateOptions = objectOmit(options, [\n\t\t\t\"window\",\n\t\t\t\"immediate\",\n\t\t\t\"commitStyles\",\n\t\t\t\"persist\",\n\t\t\t\"onReady\",\n\t\t\t\"onError\"\n\t\t]);\n\t} else {\n\t\tconfig = { duration: options };\n\t\tanimateOptions = options;\n\t}\n\tconst { window: window$1 = defaultWindow, immediate = true, commitStyles, persist, playbackRate: _playbackRate = 1, onReady, onError = (e) => {\n\t\tconsole.error(e);\n\t} } = config;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => window$1 && HTMLElement && \"animate\" in HTMLElement.prototype);\n\tconst animate = shallowRef(void 0);\n\tconst store = shallowReactive({\n\t\tstartTime: null,\n\t\tcurrentTime: null,\n\t\ttimeline: null,\n\t\tplaybackRate: _playbackRate,\n\t\tpending: false,\n\t\tplayState: immediate ? \"idle\" : \"paused\",\n\t\treplaceState: \"active\"\n\t});\n\tconst pending = computed(() => store.pending);\n\tconst playState = computed(() => store.playState);\n\tconst replaceState = computed(() => store.replaceState);\n\tconst startTime = computed({\n\t\tget() {\n\t\t\treturn store.startTime;\n\t\t},\n\t\tset(value) {\n\t\t\tstore.startTime = value;\n\t\t\tif (animate.value) animate.value.startTime = value;\n\t\t}\n\t});\n\tconst currentTime = computed({\n\t\tget() {\n\t\t\treturn store.currentTime;\n\t\t},\n\t\tset(value) {\n\t\t\tstore.currentTime = value;\n\t\t\tif (animate.value) {\n\t\t\t\tanimate.value.currentTime = value;\n\t\t\t\tsyncResume();\n\t\t\t}\n\t\t}\n\t});\n\tconst timeline = computed({\n\t\tget() {\n\t\t\treturn store.timeline;\n\t\t},\n\t\tset(value) {\n\t\t\tstore.timeline = value;\n\t\t\tif (animate.value) animate.value.timeline = value;\n\t\t}\n\t});\n\tconst playbackRate = computed({\n\t\tget() {\n\t\t\treturn store.playbackRate;\n\t\t},\n\t\tset(value) {\n\t\t\tstore.playbackRate = value;\n\t\t\tif (animate.value) animate.value.playbackRate = value;\n\t\t}\n\t});\n\tconst play = () => {\n\t\tif (animate.value) try {\n\t\t\tanimate.value.play();\n\t\t\tsyncResume();\n\t\t} catch (e) {\n\t\t\tsyncPause();\n\t\t\tonError(e);\n\t\t}\n\t\telse update();\n\t};\n\tconst pause = () => {\n\t\ttry {\n\t\t\tvar _animate$value;\n\t\t\t(_animate$value = animate.value) === null || _animate$value === void 0 || _animate$value.pause();\n\t\t\tsyncPause();\n\t\t} catch (e) {\n\t\t\tonError(e);\n\t\t}\n\t};\n\tconst reverse = () => {\n\t\tif (!animate.value) update();\n\t\ttry {\n\t\t\tvar _animate$value2;\n\t\t\t(_animate$value2 = animate.value) === null || _animate$value2 === void 0 || _animate$value2.reverse();\n\t\t\tsyncResume();\n\t\t} catch (e) {\n\t\t\tsyncPause();\n\t\t\tonError(e);\n\t\t}\n\t};\n\tconst finish = () => {\n\t\ttry {\n\t\t\tvar _animate$value3;\n\t\t\t(_animate$value3 = animate.value) === null || _animate$value3 === void 0 || _animate$value3.finish();\n\t\t\tsyncPause();\n\t\t} catch (e) {\n\t\t\tonError(e);\n\t\t}\n\t};\n\tconst cancel = () => {\n\t\ttry {\n\t\t\tvar _animate$value4;\n\t\t\t(_animate$value4 = animate.value) === null || _animate$value4 === void 0 || _animate$value4.cancel();\n\t\t\tsyncPause();\n\t\t} catch (e) {\n\t\t\tonError(e);\n\t\t}\n\t};\n\twatch(() => unrefElement(target), (el) => {\n\t\tif (el) update(true);\n\t\telse animate.value = void 0;\n\t});\n\twatch(() => keyframes, (value) => {\n\t\tif (animate.value) {\n\t\t\tupdate();\n\t\t\tconst targetEl = unrefElement(target);\n\t\t\tif (targetEl) animate.value.effect = new KeyframeEffect(targetEl, toValue(value), animateOptions);\n\t\t}\n\t}, { deep: true });\n\ttryOnMounted(() => update(true), false);\n\ttryOnScopeDispose(cancel);\n\tfunction update(init) {\n\t\tconst el = unrefElement(target);\n\t\tif (!isSupported.value || !el) return;\n\t\tif (!animate.value) animate.value = el.animate(toValue(keyframes), animateOptions);\n\t\tif (persist) animate.value.persist();\n\t\tif (_playbackRate !== 1) animate.value.playbackRate = _playbackRate;\n\t\tif (init && !immediate) animate.value.pause();\n\t\telse syncResume();\n\t\tonReady === null || onReady === void 0 || onReady(animate.value);\n\t}\n\tconst listenerOptions = { passive: true };\n\tuseEventListener(animate, [\n\t\t\"cancel\",\n\t\t\"finish\",\n\t\t\"remove\"\n\t], syncPause, listenerOptions);\n\tuseEventListener(animate, \"finish\", () => {\n\t\tvar _animate$value5;\n\t\tif (commitStyles) (_animate$value5 = animate.value) === null || _animate$value5 === void 0 || _animate$value5.commitStyles();\n\t}, listenerOptions);\n\tconst { resume: resumeRef, pause: pauseRef } = useRafFn(() => {\n\t\tif (!animate.value) return;\n\t\tstore.pending = animate.value.pending;\n\t\tstore.playState = animate.value.playState;\n\t\tstore.replaceState = animate.value.replaceState;\n\t\tstore.startTime = animate.value.startTime;\n\t\tstore.currentTime = animate.value.currentTime;\n\t\tstore.timeline = animate.value.timeline;\n\t\tstore.playbackRate = animate.value.playbackRate;\n\t}, { immediate: false });\n\tfunction syncResume() {\n\t\tif (isSupported.value) resumeRef();\n\t}\n\tfunction syncPause() {\n\t\tif (isSupported.value && window$1) window$1.requestAnimationFrame(pauseRef);\n\t}\n\treturn {\n\t\tisSupported,\n\t\tanimate,\n\t\tplay,\n\t\tpause,\n\t\treverse,\n\t\tfinish,\n\t\tcancel,\n\t\tpending,\n\t\tplayState,\n\t\treplaceState,\n\t\tstartTime,\n\t\tcurrentTime,\n\t\ttimeline,\n\t\tplaybackRate\n\t};\n}\n\n//#endregion\n//#region useAsyncQueue/index.ts\n/**\n* Asynchronous queue task controller.\n*\n* @see https://vueuse.org/useAsyncQueue\n* @param tasks\n* @param options\n*/\nfunction useAsyncQueue(tasks, options) {\n\tconst { interrupt = true, onError = noop, onFinished = noop, signal } = options || {};\n\tconst promiseState = {\n\t\taborted: \"aborted\",\n\t\tfulfilled: \"fulfilled\",\n\t\tpending: \"pending\",\n\t\trejected: \"rejected\"\n\t};\n\tconst result = reactive(Array.from(Array.from({ length: tasks.length }), () => ({\n\t\tstate: promiseState.pending,\n\t\tdata: null\n\t})));\n\tconst activeIndex = shallowRef(-1);\n\tif (!tasks || tasks.length === 0) {\n\t\tonFinished();\n\t\treturn {\n\t\t\tactiveIndex,\n\t\t\tresult\n\t\t};\n\t}\n\tfunction updateResult(state, res) {\n\t\tactiveIndex.value++;\n\t\tresult[activeIndex.value].data = res;\n\t\tresult[activeIndex.value].state = state;\n\t}\n\ttasks.reduce((prev, curr) => {\n\t\treturn prev.then((prevRes) => {\n\t\t\tvar _result$activeIndex$v;\n\t\t\tif (signal === null || signal === void 0 ? void 0 : signal.aborted) {\n\t\t\t\tupdateResult(promiseState.aborted, /* @__PURE__ */ new Error(\"aborted\"));\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (((_result$activeIndex$v = result[activeIndex.value]) === null || _result$activeIndex$v === void 0 ? void 0 : _result$activeIndex$v.state) === promiseState.rejected && interrupt) {\n\t\t\t\tonFinished();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst done = curr(prevRes).then((currentRes) => {\n\t\t\t\tupdateResult(promiseState.fulfilled, currentRes);\n\t\t\t\tif (activeIndex.value === tasks.length - 1) onFinished();\n\t\t\t\treturn currentRes;\n\t\t\t});\n\t\t\tif (!signal) return done;\n\t\t\treturn Promise.race([done, whenAborted(signal)]);\n\t\t}).catch((e) => {\n\t\t\tif (signal === null || signal === void 0 ? void 0 : signal.aborted) {\n\t\t\t\tupdateResult(promiseState.aborted, e);\n\t\t\t\treturn e;\n\t\t\t}\n\t\t\tupdateResult(promiseState.rejected, e);\n\t\t\tonError();\n\t\t\treturn e;\n\t\t});\n\t}, Promise.resolve());\n\treturn {\n\t\tactiveIndex,\n\t\tresult\n\t};\n}\nfunction whenAborted(signal) {\n\treturn new Promise((resolve, reject) => {\n\t\tconst error = /* @__PURE__ */ new Error(\"aborted\");\n\t\tif (signal.aborted) reject(error);\n\t\telse signal.addEventListener(\"abort\", () => reject(error), { once: true });\n\t});\n}\n\n//#endregion\n//#region useAsyncState/index.ts\n/**\n* Reactive async state. Will not block your setup function and will trigger changes once\n* the promise is ready.\n*\n* @see https://vueuse.org/useAsyncState\n* @param promise The promise / async function to be resolved\n* @param initialState The initial state, used until the first evaluation finishes\n* @param options\n*/\nfunction useAsyncState(promise, initialState, options) {\n\tvar _globalThis$reportErr;\n\tconst { immediate = true, delay = 0, onError = (_globalThis$reportErr = globalThis.reportError) !== null && _globalThis$reportErr !== void 0 ? _globalThis$reportErr : noop, onSuccess = noop, resetOnExecute = true, shallow = true, throwError } = options !== null && options !== void 0 ? options : {};\n\tconst state = shallow ? shallowRef(initialState) : ref(initialState);\n\tconst isReady = shallowRef(false);\n\tconst isLoading = shallowRef(false);\n\tconst error = shallowRef(void 0);\n\tlet executionsCount = 0;\n\tasync function execute(delay$1 = 0, ...args) {\n\t\tconst executionId = executionsCount += 1;\n\t\tif (resetOnExecute) state.value = toValue(initialState);\n\t\terror.value = void 0;\n\t\tisReady.value = false;\n\t\tisLoading.value = true;\n\t\tif (delay$1 > 0) await promiseTimeout(delay$1);\n\t\tconst _promise = typeof promise === \"function\" ? promise(...args) : promise;\n\t\ttry {\n\t\t\tconst data = await _promise;\n\t\t\tif (executionId === executionsCount) {\n\t\t\t\tstate.value = data;\n\t\t\t\tisReady.value = true;\n\t\t\t}\n\t\t\tonSuccess(data);\n\t\t} catch (e) {\n\t\t\tif (executionId === executionsCount) error.value = e;\n\t\t\tonError(e);\n\t\t\tif (throwError) throw e;\n\t\t} finally {\n\t\t\tif (executionId === executionsCount) isLoading.value = false;\n\t\t}\n\t\treturn state.value;\n\t}\n\tif (immediate) execute(delay);\n\tconst shell = {\n\t\tstate,\n\t\tisReady,\n\t\tisLoading,\n\t\terror,\n\t\texecute,\n\t\texecuteImmediate: (...args) => execute(0, ...args)\n\t};\n\tfunction waitUntilIsLoaded() {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tuntil(isLoading).toBe(false).then(() => resolve(shell)).catch(reject);\n\t\t});\n\t}\n\treturn {\n\t\t...shell,\n\t\tthen(onFulfilled, onRejected) {\n\t\t\treturn waitUntilIsLoaded().then(onFulfilled, onRejected);\n\t\t}\n\t};\n}\n\n//#endregion\n//#region useBase64/serialization.ts\nconst defaults = {\n\tarray: (v) => JSON.stringify(v),\n\tobject: (v) => JSON.stringify(v),\n\tset: (v) => JSON.stringify(Array.from(v)),\n\tmap: (v) => JSON.stringify(Object.fromEntries(v)),\n\tnull: () => \"\"\n};\nfunction getDefaultSerialization(target) {\n\tif (!target) return defaults.null;\n\tif (target instanceof Map) return defaults.map;\n\telse if (target instanceof Set) return defaults.set;\n\telse if (Array.isArray(target)) return defaults.array;\n\telse return defaults.object;\n}\n\n//#endregion\n//#region useBase64/index.ts\nfunction useBase64(target, options) {\n\tconst base64 = shallowRef(\"\");\n\tconst promise = shallowRef();\n\tfunction execute() {\n\t\tif (!isClient) return;\n\t\tpromise.value = new Promise((resolve, reject) => {\n\t\t\ttry {\n\t\t\t\tconst _target = toValue(target);\n\t\t\t\tif (_target == null) resolve(\"\");\n\t\t\t\telse if (typeof _target === \"string\") resolve(blobToBase64(new Blob([_target], { type: \"text/plain\" })));\n\t\t\t\telse if (_target instanceof Blob) resolve(blobToBase64(_target));\n\t\t\t\telse if (_target instanceof ArrayBuffer) resolve(window.btoa(String.fromCharCode(...new Uint8Array(_target))));\n\t\t\t\telse if (_target instanceof HTMLCanvasElement) resolve(_target.toDataURL(options === null || options === void 0 ? void 0 : options.type, options === null || options === void 0 ? void 0 : options.quality));\n\t\t\t\telse if (_target instanceof HTMLImageElement) {\n\t\t\t\t\tconst img = _target.cloneNode(false);\n\t\t\t\t\timg.crossOrigin = \"Anonymous\";\n\t\t\t\t\timgLoaded(img).then(() => {\n\t\t\t\t\t\tconst canvas = document.createElement(\"canvas\");\n\t\t\t\t\t\tconst ctx = canvas.getContext(\"2d\");\n\t\t\t\t\t\tcanvas.width = img.width;\n\t\t\t\t\t\tcanvas.height = img.height;\n\t\t\t\t\t\tctx.drawImage(img, 0, 0, canvas.width, canvas.height);\n\t\t\t\t\t\tresolve(canvas.toDataURL(options === null || options === void 0 ? void 0 : options.type, options === null || options === void 0 ? void 0 : options.quality));\n\t\t\t\t\t}).catch(reject);\n\t\t\t\t} else if (typeof _target === \"object\") {\n\t\t\t\t\tconst serialized = ((options === null || options === void 0 ? void 0 : options.serializer) || getDefaultSerialization(_target))(_target);\n\t\t\t\t\treturn resolve(blobToBase64(new Blob([serialized], { type: \"application/json\" })));\n\t\t\t\t} else reject(/* @__PURE__ */ new Error(\"target is unsupported types\"));\n\t\t\t} catch (error) {\n\t\t\t\treject(error);\n\t\t\t}\n\t\t});\n\t\tpromise.value.then((res) => {\n\t\t\tbase64.value = (options === null || options === void 0 ? void 0 : options.dataUrl) === false ? res.replace(/^data:.*?;base64,/, \"\") : res;\n\t\t});\n\t\treturn promise.value;\n\t}\n\tif (isRef(target) || typeof target === \"function\") watch(target, execute, { immediate: true });\n\telse execute();\n\treturn {\n\t\tbase64,\n\t\tpromise,\n\t\texecute\n\t};\n}\nfunction imgLoaded(img) {\n\treturn new Promise((resolve, reject) => {\n\t\tif (!img.complete) {\n\t\t\timg.onload = () => {\n\t\t\t\tresolve();\n\t\t\t};\n\t\t\timg.onerror = reject;\n\t\t} else resolve();\n\t});\n}\nfunction blobToBase64(blob) {\n\treturn new Promise((resolve, reject) => {\n\t\tconst fr = new FileReader();\n\t\tfr.onload = (e) => {\n\t\t\tresolve(e.target.result);\n\t\t};\n\t\tfr.onerror = reject;\n\t\tfr.readAsDataURL(blob);\n\t});\n}\n\n//#endregion\n//#region useBattery/index.ts\n/**\n* Reactive Battery Status API.\n*\n* @see https://vueuse.org/useBattery\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useBattery(options = {}) {\n\tconst { navigator: navigator$1 = defaultNavigator } = options;\n\tconst events$1 = [\n\t\t\"chargingchange\",\n\t\t\"chargingtimechange\",\n\t\t\"dischargingtimechange\",\n\t\t\"levelchange\"\n\t];\n\tconst isSupported = /* @__PURE__ */ useSupported(() => navigator$1 && \"getBattery\" in navigator$1 && typeof navigator$1.getBattery === \"function\");\n\tconst charging = shallowRef(false);\n\tconst chargingTime = shallowRef(0);\n\tconst dischargingTime = shallowRef(0);\n\tconst level = shallowRef(1);\n\tlet battery;\n\tfunction updateBatteryInfo() {\n\t\tcharging.value = this.charging;\n\t\tchargingTime.value = this.chargingTime || 0;\n\t\tdischargingTime.value = this.dischargingTime || 0;\n\t\tlevel.value = this.level;\n\t}\n\tif (isSupported.value) navigator$1.getBattery().then((_battery) => {\n\t\tbattery = _battery;\n\t\tupdateBatteryInfo.call(battery);\n\t\tuseEventListener(battery, events$1, updateBatteryInfo, { passive: true });\n\t});\n\treturn {\n\t\tisSupported,\n\t\tcharging,\n\t\tchargingTime,\n\t\tdischargingTime,\n\t\tlevel\n\t};\n}\n\n//#endregion\n//#region useBluetooth/index.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction useBluetooth(options) {\n\tlet { acceptAllDevices = false } = options || {};\n\tconst { filters = void 0, optionalServices = void 0, navigator: navigator$1 = defaultNavigator } = options || {};\n\tconst isSupported = /* @__PURE__ */ useSupported(() => navigator$1 && \"bluetooth\" in navigator$1);\n\tconst device = shallowRef();\n\tconst error = shallowRef(null);\n\twatch(device, () => {\n\t\tconnectToBluetoothGATTServer();\n\t});\n\tasync function requestDevice() {\n\t\tif (!isSupported.value) return;\n\t\terror.value = null;\n\t\tif (filters && filters.length > 0) acceptAllDevices = false;\n\t\ttry {\n\t\t\tdevice.value = await (navigator$1 === null || navigator$1 === void 0 ? void 0 : navigator$1.bluetooth.requestDevice({\n\t\t\t\tacceptAllDevices,\n\t\t\t\tfilters,\n\t\t\t\toptionalServices\n\t\t\t}));\n\t\t} catch (err) {\n\t\t\terror.value = err;\n\t\t}\n\t}\n\tconst server = shallowRef();\n\tconst isConnected = shallowRef(false);\n\tfunction reset() {\n\t\tisConnected.value = false;\n\t\tdevice.value = void 0;\n\t\tserver.value = void 0;\n\t}\n\tasync function connectToBluetoothGATTServer() {\n\t\terror.value = null;\n\t\tif (device.value && device.value.gatt) {\n\t\t\tuseEventListener(device, \"gattserverdisconnected\", reset, { passive: true });\n\t\t\ttry {\n\t\t\t\tserver.value = await device.value.gatt.connect();\n\t\t\t\tisConnected.value = server.value.connected;\n\t\t\t} catch (err) {\n\t\t\t\terror.value = err;\n\t\t\t}\n\t\t}\n\t}\n\ttryOnMounted(() => {\n\t\tvar _device$value$gatt;\n\t\tif (device.value) (_device$value$gatt = device.value.gatt) === null || _device$value$gatt === void 0 || _device$value$gatt.connect();\n\t});\n\ttryOnScopeDispose(() => {\n\t\tvar _device$value$gatt2;\n\t\tif (device.value) (_device$value$gatt2 = device.value.gatt) === null || _device$value$gatt2 === void 0 || _device$value$gatt2.disconnect();\n\t});\n\treturn {\n\t\tisSupported,\n\t\tisConnected: readonly(isConnected),\n\t\tdevice,\n\t\trequestDevice,\n\t\tserver,\n\t\terror\n\t};\n}\n\n//#endregion\n//#region useSSRWidth/index.ts\nconst ssrWidthSymbol = Symbol(\"vueuse-ssr-width\");\n/* @__NO_SIDE_EFFECTS__ */\nfunction useSSRWidth() {\n\tconst ssrWidth = hasInjectionContext() ? injectLocal(ssrWidthSymbol, null) : null;\n\treturn typeof ssrWidth === \"number\" ? ssrWidth : void 0;\n}\nfunction provideSSRWidth(width, app) {\n\tif (app !== void 0) app.provide(ssrWidthSymbol, width);\n\telse provideLocal(ssrWidthSymbol, width);\n}\n\n//#endregion\n//#region useMediaQuery/index.ts\n/**\n* Reactive Media Query.\n*\n* @see https://vueuse.org/useMediaQuery\n* @param query\n* @param options\n*/\nfunction useMediaQuery(query, options = {}) {\n\tconst { window: window$1 = defaultWindow, ssrWidth = /* @__PURE__ */ useSSRWidth() } = options;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => window$1 && \"matchMedia\" in window$1 && typeof window$1.matchMedia === \"function\");\n\tconst ssrSupport = shallowRef(typeof ssrWidth === \"number\");\n\tconst mediaQuery = shallowRef();\n\tconst matches = shallowRef(false);\n\tconst handler = (event) => {\n\t\tmatches.value = event.matches;\n\t};\n\twatchEffect(() => {\n\t\tif (ssrSupport.value) {\n\t\t\tssrSupport.value = !isSupported.value;\n\t\t\tmatches.value = toValue(query).split(\",\").some((queryString) => {\n\t\t\t\tconst not = queryString.includes(\"not all\");\n\t\t\t\tconst minWidth = queryString.match(/\\(\\s*min-width:\\s*(-?\\d+(?:\\.\\d*)?[a-z]+\\s*)\\)/);\n\t\t\t\tconst maxWidth = queryString.match(/\\(\\s*max-width:\\s*(-?\\d+(?:\\.\\d*)?[a-z]+\\s*)\\)/);\n\t\t\t\tlet res = Boolean(minWidth || maxWidth);\n\t\t\t\tif (minWidth && res) res = ssrWidth >= pxValue(minWidth[1]);\n\t\t\t\tif (maxWidth && res) res = ssrWidth <= pxValue(maxWidth[1]);\n\t\t\t\treturn not ? !res : res;\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\tif (!isSupported.value) return;\n\t\tmediaQuery.value = window$1.matchMedia(toValue(query));\n\t\tmatches.value = mediaQuery.value.matches;\n\t});\n\tuseEventListener(mediaQuery, \"change\", handler, { passive: true });\n\treturn computed(() => matches.value);\n}\n\n//#endregion\n//#region useBreakpoints/breakpoints.ts\n/**\n* Breakpoints from Tailwind V2\n*\n* @see https://tailwindcss.com/docs/breakpoints\n*/\nconst breakpointsTailwind = {\n\t\"sm\": 640,\n\t\"md\": 768,\n\t\"lg\": 1024,\n\t\"xl\": 1280,\n\t\"2xl\": 1536\n};\n/**\n* Breakpoints from Bootstrap V5\n*\n* @see https://getbootstrap.com/docs/5.0/layout/breakpoints\n*/\nconst breakpointsBootstrapV5 = {\n\txs: 0,\n\tsm: 576,\n\tmd: 768,\n\tlg: 992,\n\txl: 1200,\n\txxl: 1400\n};\n/**\n* Breakpoints from Vuetify V2\n*\n* @see https://v2.vuetifyjs.com/en/features/breakpoints/\n*/\nconst breakpointsVuetifyV2 = {\n\txs: 0,\n\tsm: 600,\n\tmd: 960,\n\tlg: 1264,\n\txl: 1904\n};\n/**\n* Breakpoints from Vuetify V3\n*\n* @see https://vuetifyjs.com/en/styles/float/#overview\n*/\nconst breakpointsVuetifyV3 = {\n\txs: 0,\n\tsm: 600,\n\tmd: 960,\n\tlg: 1280,\n\txl: 1920,\n\txxl: 2560\n};\n/**\n* Alias to `breakpointsVuetifyV2`\n*\n* @deprecated explictly use `breakpointsVuetifyV2` or `breakpointsVuetifyV3` instead\n*/\nconst breakpointsVuetify = breakpointsVuetifyV2;\n/**\n* Breakpoints from Ant Design\n*\n* @see https://ant.design/components/layout/#breakpoint-width\n*/\nconst breakpointsAntDesign = {\n\txs: 480,\n\tsm: 576,\n\tmd: 768,\n\tlg: 992,\n\txl: 1200,\n\txxl: 1600\n};\n/**\n* Breakpoints from Quasar V2\n*\n* @see https://quasar.dev/style/breakpoints\n*/\nconst breakpointsQuasar = {\n\txs: 0,\n\tsm: 600,\n\tmd: 1024,\n\tlg: 1440,\n\txl: 1920\n};\n/**\n* Sematic Breakpoints\n*/\nconst breakpointsSematic = {\n\tmobileS: 320,\n\tmobileM: 375,\n\tmobileL: 425,\n\ttablet: 768,\n\tlaptop: 1024,\n\tlaptopL: 1440,\n\tdesktop4K: 2560\n};\n/**\n* Breakpoints from Master CSS\n*\n* @see https://docs.master.co/css/breakpoints\n*/\nconst breakpointsMasterCss = {\n\t\"3xs\": 360,\n\t\"2xs\": 480,\n\t\"xs\": 600,\n\t\"sm\": 768,\n\t\"md\": 1024,\n\t\"lg\": 1280,\n\t\"xl\": 1440,\n\t\"2xl\": 1600,\n\t\"3xl\": 1920,\n\t\"4xl\": 2560\n};\n/**\n* Breakpoints from PrimeFlex\n*\n* @see https://primeflex.org/installation\n*/\nconst breakpointsPrimeFlex = {\n\tsm: 576,\n\tmd: 768,\n\tlg: 992,\n\txl: 1200\n};\n/**\n* Breakpoints from ElementUI/ElementPlus\n*\n* @see https://element.eleme.io/#/en-US/component/layout\n* @see https://element-plus.org/en-US/component/layout.html\n*/\nconst breakpointsElement = {\n\txs: 0,\n\tsm: 768,\n\tmd: 992,\n\tlg: 1200,\n\txl: 1920\n};\n\n//#endregion\n//#region useBreakpoints/index.ts\n/**\n* Reactively viewport breakpoints\n*\n* @see https://vueuse.org/useBreakpoints\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useBreakpoints(breakpoints, options = {}) {\n\tfunction getValue$1(k, delta) {\n\t\tlet v = toValue(breakpoints[toValue(k)]);\n\t\tif (delta != null) v = increaseWithUnit(v, delta);\n\t\tif (typeof v === \"number\") v = `${v}px`;\n\t\treturn v;\n\t}\n\tconst { window: window$1 = defaultWindow, strategy = \"min-width\", ssrWidth = /* @__PURE__ */ useSSRWidth() } = options;\n\tconst ssrSupport = typeof ssrWidth === \"number\";\n\tconst mounted = ssrSupport ? shallowRef(false) : { value: true };\n\tif (ssrSupport) tryOnMounted(() => mounted.value = !!window$1);\n\tfunction match(query, size) {\n\t\tif (!mounted.value && ssrSupport) return query === \"min\" ? ssrWidth >= pxValue(size) : ssrWidth <= pxValue(size);\n\t\tif (!window$1) return false;\n\t\treturn window$1.matchMedia(`(${query}-width: ${size})`).matches;\n\t}\n\tconst greaterOrEqual = (k) => {\n\t\treturn useMediaQuery(() => `(min-width: ${getValue$1(k)})`, options);\n\t};\n\tconst smallerOrEqual = (k) => {\n\t\treturn useMediaQuery(() => `(max-width: ${getValue$1(k)})`, options);\n\t};\n\tconst shortcutMethods = Object.keys(breakpoints).reduce((shortcuts, k) => {\n\t\tObject.defineProperty(shortcuts, k, {\n\t\t\tget: () => strategy === \"min-width\" ? greaterOrEqual(k) : smallerOrEqual(k),\n\t\t\tenumerable: true,\n\t\t\tconfigurable: true\n\t\t});\n\t\treturn shortcuts;\n\t}, {});\n\tfunction current() {\n\t\tconst points = Object.keys(breakpoints).map((k) => [\n\t\t\tk,\n\t\t\tshortcutMethods[k],\n\t\t\tpxValue(getValue$1(k))\n\t\t]).sort((a, b) => a[2] - b[2]);\n\t\treturn computed(() => points.filter(([, v]) => v.value).map(([k]) => k));\n\t}\n\treturn Object.assign(shortcutMethods, {\n\t\tgreaterOrEqual,\n\t\tsmallerOrEqual,\n\t\tgreater(k) {\n\t\t\treturn useMediaQuery(() => `(min-width: ${getValue$1(k, .1)})`, options);\n\t\t},\n\t\tsmaller(k) {\n\t\t\treturn useMediaQuery(() => `(max-width: ${getValue$1(k, -.1)})`, options);\n\t\t},\n\t\tbetween(a, b) {\n\t\t\treturn useMediaQuery(() => `(min-width: ${getValue$1(a)}) and (max-width: ${getValue$1(b, -.1)})`, options);\n\t\t},\n\t\tisGreater(k) {\n\t\t\treturn match(\"min\", getValue$1(k, .1));\n\t\t},\n\t\tisGreaterOrEqual(k) {\n\t\t\treturn match(\"min\", getValue$1(k));\n\t\t},\n\t\tisSmaller(k) {\n\t\t\treturn match(\"max\", getValue$1(k, -.1));\n\t\t},\n\t\tisSmallerOrEqual(k) {\n\t\t\treturn match(\"max\", getValue$1(k));\n\t\t},\n\t\tisInBetween(a, b) {\n\t\t\treturn match(\"min\", getValue$1(a)) && match(\"max\", getValue$1(b, -.1));\n\t\t},\n\t\tcurrent,\n\t\tactive() {\n\t\t\tconst bps = current();\n\t\t\treturn computed(() => bps.value.length === 0 ? \"\" : bps.value.at(strategy === \"min-width\" ? -1 : 0));\n\t\t}\n\t});\n}\n\n//#endregion\n//#region useBroadcastChannel/index.ts\n/**\n* Reactive BroadcastChannel\n*\n* @see https://vueuse.org/useBroadcastChannel\n* @see https://developer.mozilla.org/en-US/docs/Web/API/BroadcastChannel\n* @param options\n*\n*/\nfunction useBroadcastChannel(options) {\n\tconst { name, window: window$1 = defaultWindow } = options;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => window$1 && \"BroadcastChannel\" in window$1);\n\tconst isClosed = shallowRef(false);\n\tconst channel = ref();\n\tconst data = ref();\n\tconst error = shallowRef(null);\n\tconst post = (data$1) => {\n\t\tif (channel.value) channel.value.postMessage(data$1);\n\t};\n\tconst close = () => {\n\t\tif (channel.value) channel.value.close();\n\t\tisClosed.value = true;\n\t};\n\tif (isSupported.value) tryOnMounted(() => {\n\t\terror.value = null;\n\t\tchannel.value = new BroadcastChannel(name);\n\t\tconst listenerOptions = { passive: true };\n\t\tuseEventListener(channel, \"message\", (e) => {\n\t\t\tdata.value = e.data;\n\t\t}, listenerOptions);\n\t\tuseEventListener(channel, \"messageerror\", (e) => {\n\t\t\terror.value = e;\n\t\t}, listenerOptions);\n\t\tuseEventListener(channel, \"close\", () => {\n\t\t\tisClosed.value = true;\n\t\t}, listenerOptions);\n\t});\n\ttryOnScopeDispose(() => {\n\t\tclose();\n\t});\n\treturn {\n\t\tisSupported,\n\t\tchannel,\n\t\tdata,\n\t\tpost,\n\t\tclose,\n\t\terror,\n\t\tisClosed\n\t};\n}\n\n//#endregion\n//#region useBrowserLocation/index.ts\nconst WRITABLE_PROPERTIES = [\n\t\"hash\",\n\t\"host\",\n\t\"hostname\",\n\t\"href\",\n\t\"pathname\",\n\t\"port\",\n\t\"protocol\",\n\t\"search\"\n];\n/**\n* Reactive browser location.\n*\n* @see https://vueuse.org/useBrowserLocation\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useBrowserLocation(options = {}) {\n\tconst { window: window$1 = defaultWindow } = options;\n\tconst refs = Object.fromEntries(WRITABLE_PROPERTIES.map((key) => [key, ref()]));\n\tfor (const [key, ref$1] of objectEntries(refs)) watch(ref$1, (value) => {\n\t\tif (!(window$1 === null || window$1 === void 0 ? void 0 : window$1.location) || window$1.location[key] === value) return;\n\t\twindow$1.location[key] = value;\n\t});\n\tconst buildState = (trigger) => {\n\t\tvar _window$location;\n\t\tconst { state: state$1, length } = (window$1 === null || window$1 === void 0 ? void 0 : window$1.history) || {};\n\t\tconst { origin } = (window$1 === null || window$1 === void 0 ? void 0 : window$1.location) || {};\n\t\tfor (const key of WRITABLE_PROPERTIES) refs[key].value = window$1 === null || window$1 === void 0 || (_window$location = window$1.location) === null || _window$location === void 0 ? void 0 : _window$location[key];\n\t\treturn reactive({\n\t\t\ttrigger,\n\t\t\tstate: state$1,\n\t\t\tlength,\n\t\t\torigin,\n\t\t\t...refs\n\t\t});\n\t};\n\tconst state = ref(buildState(\"load\"));\n\tif (window$1) {\n\t\tconst listenerOptions = { passive: true };\n\t\tuseEventListener(window$1, \"popstate\", () => state.value = buildState(\"popstate\"), listenerOptions);\n\t\tuseEventListener(window$1, \"hashchange\", () => state.value = buildState(\"hashchange\"), listenerOptions);\n\t}\n\treturn state;\n}\n\n//#endregion\n//#region useCached/index.ts\nfunction useCached(refValue, comparator = (a, b) => a === b, options) {\n\tconst { deepRefs = true,...watchOptions } = options || {};\n\tconst cachedValue = createRef(refValue.value, deepRefs);\n\twatch(() => refValue.value, (value) => {\n\t\tif (!comparator(value, cachedValue.value)) cachedValue.value = value;\n\t}, watchOptions);\n\treturn cachedValue;\n}\n\n//#endregion\n//#region usePermission/index.ts\n/**\n* Reactive Permissions API.\n*\n* @see https://vueuse.org/usePermission\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction usePermission(permissionDesc, options = {}) {\n\tconst { controls = false, navigator: navigator$1 = defaultNavigator } = options;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => navigator$1 && \"permissions\" in navigator$1);\n\tconst permissionStatus = shallowRef();\n\tconst desc = typeof permissionDesc === \"string\" ? { name: permissionDesc } : permissionDesc;\n\tconst state = shallowRef();\n\tconst update = () => {\n\t\tvar _permissionStatus$val, _permissionStatus$val2;\n\t\tstate.value = (_permissionStatus$val = (_permissionStatus$val2 = permissionStatus.value) === null || _permissionStatus$val2 === void 0 ? void 0 : _permissionStatus$val2.state) !== null && _permissionStatus$val !== void 0 ? _permissionStatus$val : \"prompt\";\n\t};\n\tuseEventListener(permissionStatus, \"change\", update, { passive: true });\n\tconst query = createSingletonPromise(async () => {\n\t\tif (!isSupported.value) return;\n\t\tif (!permissionStatus.value) try {\n\t\t\tpermissionStatus.value = await navigator$1.permissions.query(desc);\n\t\t} catch (_unused) {\n\t\t\tpermissionStatus.value = void 0;\n\t\t} finally {\n\t\t\tupdate();\n\t\t}\n\t\tif (controls) return toRaw(permissionStatus.value);\n\t});\n\tquery();\n\tif (controls) return {\n\t\tstate,\n\t\tisSupported,\n\t\tquery\n\t};\n\telse return state;\n}\n\n//#endregion\n//#region useClipboard/index.ts\nfunction useClipboard(options = {}) {\n\tconst { navigator: navigator$1 = defaultNavigator, read = false, source, copiedDuring = 1500, legacy = false } = options;\n\tconst isClipboardApiSupported = /* @__PURE__ */ useSupported(() => navigator$1 && \"clipboard\" in navigator$1);\n\tconst permissionRead = usePermission(\"clipboard-read\");\n\tconst permissionWrite = usePermission(\"clipboard-write\");\n\tconst isSupported = computed(() => isClipboardApiSupported.value || legacy);\n\tconst text = shallowRef(\"\");\n\tconst copied = shallowRef(false);\n\tconst timeout = useTimeoutFn(() => copied.value = false, copiedDuring, { immediate: false });\n\tasync function updateText() {\n\t\tlet useLegacy = !(isClipboardApiSupported.value && isAllowed(permissionRead.value));\n\t\tif (!useLegacy) try {\n\t\t\ttext.value = await navigator$1.clipboard.readText();\n\t\t} catch (_unused) {\n\t\t\tuseLegacy = true;\n\t\t}\n\t\tif (useLegacy) text.value = legacyRead();\n\t}\n\tif (isSupported.value && read) useEventListener([\"copy\", \"cut\"], updateText, { passive: true });\n\tasync function copy(value = toValue(source)) {\n\t\tif (isSupported.value && value != null) {\n\t\t\tlet useLegacy = !(isClipboardApiSupported.value && isAllowed(permissionWrite.value));\n\t\t\tif (!useLegacy) try {\n\t\t\t\tawait navigator$1.clipboard.writeText(value);\n\t\t\t} catch (_unused2) {\n\t\t\t\tuseLegacy = true;\n\t\t\t}\n\t\t\tif (useLegacy) legacyCopy(value);\n\t\t\ttext.value = value;\n\t\t\tcopied.value = true;\n\t\t\ttimeout.start();\n\t\t}\n\t}\n\tfunction legacyCopy(value) {\n\t\tconst ta = document.createElement(\"textarea\");\n\t\tta.value = value;\n\t\tta.style.position = \"absolute\";\n\t\tta.style.opacity = \"0\";\n\t\tdocument.body.appendChild(ta);\n\t\tta.select();\n\t\tdocument.execCommand(\"copy\");\n\t\tta.remove();\n\t}\n\tfunction legacyRead() {\n\t\tvar _document$getSelectio, _document, _document$getSelectio2;\n\t\treturn (_document$getSelectio = (_document = document) === null || _document === void 0 || (_document$getSelectio2 = _document.getSelection) === null || _document$getSelectio2 === void 0 || (_document$getSelectio2 = _document$getSelectio2.call(_document)) === null || _document$getSelectio2 === void 0 ? void 0 : _document$getSelectio2.toString()) !== null && _document$getSelectio !== void 0 ? _document$getSelectio : \"\";\n\t}\n\tfunction isAllowed(status) {\n\t\treturn status === \"granted\" || status === \"prompt\";\n\t}\n\treturn {\n\t\tisSupported,\n\t\ttext: readonly(text),\n\t\tcopied: readonly(copied),\n\t\tcopy\n\t};\n}\n\n//#endregion\n//#region useClipboardItems/index.ts\nfunction useClipboardItems(options = {}) {\n\tconst { navigator: navigator$1 = defaultNavigator, read = false, source, copiedDuring = 1500 } = options;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => navigator$1 && \"clipboard\" in navigator$1);\n\tconst content = ref([]);\n\tconst copied = shallowRef(false);\n\tconst timeout = useTimeoutFn(() => copied.value = false, copiedDuring, { immediate: false });\n\tfunction updateContent() {\n\t\tif (isSupported.value) navigator$1.clipboard.read().then((items) => {\n\t\t\tcontent.value = items;\n\t\t});\n\t}\n\tif (isSupported.value && read) useEventListener([\"copy\", \"cut\"], updateContent, { passive: true });\n\tasync function copy(value = toValue(source)) {\n\t\tif (isSupported.value && value != null) {\n\t\t\tawait navigator$1.clipboard.write(value);\n\t\t\tcontent.value = value;\n\t\t\tcopied.value = true;\n\t\t\ttimeout.start();\n\t\t}\n\t}\n\treturn {\n\t\tisSupported,\n\t\tcontent: shallowReadonly(content),\n\t\tcopied: readonly(copied),\n\t\tcopy,\n\t\tread: updateContent\n\t};\n}\n\n//#endregion\n//#region useCloned/index.ts\nfunction cloneFnJSON(source) {\n\treturn JSON.parse(JSON.stringify(source));\n}\nfunction useCloned(source, options = {}) {\n\tconst cloned = ref({});\n\tconst isModified = shallowRef(false);\n\tlet _lastSync = false;\n\tconst { manual, clone = cloneFnJSON, deep = true, immediate = true } = options;\n\twatch(cloned, () => {\n\t\tif (_lastSync) {\n\t\t\t_lastSync = false;\n\t\t\treturn;\n\t\t}\n\t\tisModified.value = true;\n\t}, {\n\t\tdeep: true,\n\t\tflush: \"sync\"\n\t});\n\tfunction sync() {\n\t\t_lastSync = true;\n\t\tisModified.value = false;\n\t\tcloned.value = clone(toValue(source));\n\t}\n\tif (!manual && (isRef(source) || typeof source === \"function\")) watch(source, sync, {\n\t\t...options,\n\t\tdeep,\n\t\timmediate\n\t});\n\telse sync();\n\treturn {\n\t\tcloned,\n\t\tisModified,\n\t\tsync\n\t};\n}\n\n//#endregion\n//#region ssr-handlers.ts\nconst _global = typeof globalThis !== \"undefined\" ? globalThis : typeof window !== \"undefined\" ? window : typeof global !== \"undefined\" ? global : typeof self !== \"undefined\" ? self : {};\nconst globalKey = \"__vueuse_ssr_handlers__\";\nconst handlers = /* @__PURE__ */ getHandlers();\nfunction getHandlers() {\n\tif (!(globalKey in _global)) _global[globalKey] = _global[globalKey] || {};\n\treturn _global[globalKey];\n}\nfunction getSSRHandler(key, fallback) {\n\treturn handlers[key] || fallback;\n}\nfunction setSSRHandler(key, fn) {\n\thandlers[key] = fn;\n}\n\n//#endregion\n//#region usePreferredDark/index.ts\n/**\n* Reactive dark theme preference.\n*\n* @see https://vueuse.org/usePreferredDark\n* @param [options]\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction usePreferredDark(options) {\n\treturn useMediaQuery(\"(prefers-color-scheme: dark)\", options);\n}\n\n//#endregion\n//#region useStorage/guess.ts\nfunction guessSerializerType(rawInit) {\n\treturn rawInit == null ? \"any\" : rawInit instanceof Set ? \"set\" : rawInit instanceof Map ? \"map\" : rawInit instanceof Date ? \"date\" : typeof rawInit === \"boolean\" ? \"boolean\" : typeof rawInit === \"string\" ? \"string\" : typeof rawInit === \"object\" ? \"object\" : !Number.isNaN(rawInit) ? \"number\" : \"any\";\n}\n\n//#endregion\n//#region useStorage/index.ts\nconst StorageSerializers = {\n\tboolean: {\n\t\tread: (v) => v === \"true\",\n\t\twrite: (v) => String(v)\n\t},\n\tobject: {\n\t\tread: (v) => JSON.parse(v),\n\t\twrite: (v) => JSON.stringify(v)\n\t},\n\tnumber: {\n\t\tread: (v) => Number.parseFloat(v),\n\t\twrite: (v) => String(v)\n\t},\n\tany: {\n\t\tread: (v) => v,\n\t\twrite: (v) => String(v)\n\t},\n\tstring: {\n\t\tread: (v) => v,\n\t\twrite: (v) => String(v)\n\t},\n\tmap: {\n\t\tread: (v) => new Map(JSON.parse(v)),\n\t\twrite: (v) => JSON.stringify(Array.from(v.entries()))\n\t},\n\tset: {\n\t\tread: (v) => new Set(JSON.parse(v)),\n\t\twrite: (v) => JSON.stringify(Array.from(v))\n\t},\n\tdate: {\n\t\tread: (v) => new Date(v),\n\t\twrite: (v) => v.toISOString()\n\t}\n};\nconst customStorageEventName = \"vueuse-storage\";\n/**\n* Reactive LocalStorage/SessionStorage.\n*\n* @see https://vueuse.org/useStorage\n*/\nfunction useStorage(key, defaults$1, storage, options = {}) {\n\tvar _options$serializer;\n\tconst { flush = \"pre\", deep = true, listenToStorageChanges = true, writeDefaults = true, mergeDefaults = false, shallow, window: window$1 = defaultWindow, eventFilter, onError = (e) => {\n\t\tconsole.error(e);\n\t}, initOnMounted } = options;\n\tconst data = (shallow ? shallowRef : ref)(typeof defaults$1 === \"function\" ? defaults$1() : defaults$1);\n\tconst keyComputed = computed(() => toValue(key));\n\tif (!storage) try {\n\t\tstorage = getSSRHandler(\"getDefaultStorage\", () => defaultWindow === null || defaultWindow === void 0 ? void 0 : defaultWindow.localStorage)();\n\t} catch (e) {\n\t\tonError(e);\n\t}\n\tif (!storage) return data;\n\tconst rawInit = toValue(defaults$1);\n\tconst type = guessSerializerType(rawInit);\n\tconst serializer = (_options$serializer = options.serializer) !== null && _options$serializer !== void 0 ? _options$serializer : StorageSerializers[type];\n\tconst { pause: pauseWatch, resume: resumeWatch } = pausableWatch(data, (newValue) => write(newValue), {\n\t\tflush,\n\t\tdeep,\n\t\teventFilter\n\t});\n\twatch(keyComputed, () => update(), { flush });\n\tlet firstMounted = false;\n\tconst onStorageEvent = (ev) => {\n\t\tif (initOnMounted && !firstMounted) return;\n\t\tupdate(ev);\n\t};\n\tconst onStorageCustomEvent = (ev) => {\n\t\tif (initOnMounted && !firstMounted) return;\n\t\tupdateFromCustomEvent(ev);\n\t};\n\t/**\n\t* The custom event is needed for same-document syncing when using custom\n\t* storage backends, but it doesn't work across different documents.\n\t*\n\t* TODO: Consider implementing a BroadcastChannel-based solution that fixes this.\n\t*/\n\tif (window$1 && listenToStorageChanges) if (storage instanceof Storage) useEventListener(window$1, \"storage\", onStorageEvent, { passive: true });\n\telse useEventListener(window$1, customStorageEventName, onStorageCustomEvent);\n\tif (initOnMounted) tryOnMounted(() => {\n\t\tfirstMounted = true;\n\t\tupdate();\n\t});\n\telse update();\n\tfunction dispatchWriteEvent(oldValue, newValue) {\n\t\tif (window$1) {\n\t\t\tconst payload = {\n\t\t\t\tkey: keyComputed.value,\n\t\t\t\toldValue,\n\t\t\t\tnewValue,\n\t\t\t\tstorageArea: storage\n\t\t\t};\n\t\t\twindow$1.dispatchEvent(storage instanceof Storage ? new StorageEvent(\"storage\", payload) : new CustomEvent(customStorageEventName, { detail: payload }));\n\t\t}\n\t}\n\tfunction write(v) {\n\t\ttry {\n\t\t\tconst oldValue = storage.getItem(keyComputed.value);\n\t\t\tif (v == null) {\n\t\t\t\tdispatchWriteEvent(oldValue, null);\n\t\t\t\tstorage.removeItem(keyComputed.value);\n\t\t\t} else {\n\t\t\t\tconst serialized = serializer.write(v);\n\t\t\t\tif (oldValue !== serialized) {\n\t\t\t\t\tstorage.setItem(keyComputed.value, serialized);\n\t\t\t\t\tdispatchWriteEvent(oldValue, serialized);\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tonError(e);\n\t\t}\n\t}\n\tfunction read(event) {\n\t\tconst rawValue = event ? event.newValue : storage.getItem(keyComputed.value);\n\t\tif (rawValue == null) {\n\t\t\tif (writeDefaults && rawInit != null) storage.setItem(keyComputed.value, serializer.write(rawInit));\n\t\t\treturn rawInit;\n\t\t} else if (!event && mergeDefaults) {\n\t\t\tconst value = serializer.read(rawValue);\n\t\t\tif (typeof mergeDefaults === \"function\") return mergeDefaults(value, rawInit);\n\t\t\telse if (type === \"object\" && !Array.isArray(value)) return {\n\t\t\t\t...rawInit,\n\t\t\t\t...value\n\t\t\t};\n\t\t\treturn value;\n\t\t} else if (typeof rawValue !== \"string\") return rawValue;\n\t\telse return serializer.read(rawValue);\n\t}\n\tfunction update(event) {\n\t\tif (event && event.storageArea !== storage) return;\n\t\tif (event && event.key == null) {\n\t\t\tdata.value = rawInit;\n\t\t\treturn;\n\t\t}\n\t\tif (event && event.key !== keyComputed.value) return;\n\t\tpauseWatch();\n\t\ttry {\n\t\t\tconst serializedData = serializer.write(data.value);\n\t\t\tif (event === void 0 || (event === null || event === void 0 ? void 0 : event.newValue) !== serializedData) data.value = read(event);\n\t\t} catch (e) {\n\t\t\tonError(e);\n\t\t} finally {\n\t\t\tif (event) nextTick(resumeWatch);\n\t\t\telse resumeWatch();\n\t\t}\n\t}\n\tfunction updateFromCustomEvent(event) {\n\t\tupdate(event.detail);\n\t}\n\treturn data;\n}\n\n//#endregion\n//#region useColorMode/index.ts\nconst CSS_DISABLE_TRANS = \"*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}\";\n/**\n* Reactive color mode with auto data persistence.\n*\n* @see https://vueuse.org/useColorMode\n* @param options\n*/\nfunction useColorMode(options = {}) {\n\tconst { selector = \"html\", attribute = \"class\", initialValue = \"auto\", window: window$1 = defaultWindow, storage, storageKey = \"vueuse-color-scheme\", listenToStorageChanges = true, storageRef, emitAuto, disableTransition = true } = options;\n\tconst modes = {\n\t\tauto: \"\",\n\t\tlight: \"light\",\n\t\tdark: \"dark\",\n\t\t...options.modes || {}\n\t};\n\tconst preferredDark = usePreferredDark({ window: window$1 });\n\tconst system = computed(() => preferredDark.value ? \"dark\" : \"light\");\n\tconst store = storageRef || (storageKey == null ? toRef(initialValue) : useStorage(storageKey, initialValue, storage, {\n\t\twindow: window$1,\n\t\tlistenToStorageChanges\n\t}));\n\tconst state = computed(() => store.value === \"auto\" ? system.value : store.value);\n\tconst updateHTMLAttrs = getSSRHandler(\"updateHTMLAttrs\", (selector$1, attribute$1, value) => {\n\t\tconst el = typeof selector$1 === \"string\" ? window$1 === null || window$1 === void 0 ? void 0 : window$1.document.querySelector(selector$1) : unrefElement(selector$1);\n\t\tif (!el) return;\n\t\tconst classesToAdd = /* @__PURE__ */ new Set();\n\t\tconst classesToRemove = /* @__PURE__ */ new Set();\n\t\tlet attributeToChange = null;\n\t\tif (attribute$1 === \"class\") {\n\t\t\tconst current = value.split(/\\s/g);\n\t\t\tObject.values(modes).flatMap((i) => (i || \"\").split(/\\s/g)).filter(Boolean).forEach((v) => {\n\t\t\t\tif (current.includes(v)) classesToAdd.add(v);\n\t\t\t\telse classesToRemove.add(v);\n\t\t\t});\n\t\t} else attributeToChange = {\n\t\t\tkey: attribute$1,\n\t\t\tvalue\n\t\t};\n\t\tif (classesToAdd.size === 0 && classesToRemove.size === 0 && attributeToChange === null) return;\n\t\tlet style;\n\t\tif (disableTransition) {\n\t\t\tstyle = window$1.document.createElement(\"style\");\n\t\t\tstyle.appendChild(document.createTextNode(CSS_DISABLE_TRANS));\n\t\t\twindow$1.document.head.appendChild(style);\n\t\t}\n\t\tfor (const c of classesToAdd) el.classList.add(c);\n\t\tfor (const c of classesToRemove) el.classList.remove(c);\n\t\tif (attributeToChange) el.setAttribute(attributeToChange.key, attributeToChange.value);\n\t\tif (disableTransition) {\n\t\t\twindow$1.getComputedStyle(style).opacity;\n\t\t\tdocument.head.removeChild(style);\n\t\t}\n\t});\n\tfunction defaultOnChanged(mode) {\n\t\tvar _modes$mode;\n\t\tupdateHTMLAttrs(selector, attribute, (_modes$mode = modes[mode]) !== null && _modes$mode !== void 0 ? _modes$mode : mode);\n\t}\n\tfunction onChanged(mode) {\n\t\tif (options.onChanged) options.onChanged(mode, defaultOnChanged);\n\t\telse defaultOnChanged(mode);\n\t}\n\twatch(state, onChanged, {\n\t\tflush: \"post\",\n\t\timmediate: true\n\t});\n\ttryOnMounted(() => onChanged(state.value));\n\tconst auto = computed({\n\t\tget() {\n\t\t\treturn emitAuto ? store.value : state.value;\n\t\t},\n\t\tset(v) {\n\t\t\tstore.value = v;\n\t\t}\n\t});\n\treturn Object.assign(auto, {\n\t\tstore,\n\t\tsystem,\n\t\tstate\n\t});\n}\n\n//#endregion\n//#region useConfirmDialog/index.ts\n/**\n* Hooks for creating confirm dialogs. Useful for modal windows, popups and logins.\n*\n* @see https://vueuse.org/useConfirmDialog/\n* @param revealed `boolean` `ref` that handles a modal window\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useConfirmDialog(revealed = shallowRef(false)) {\n\tconst confirmHook = createEventHook();\n\tconst cancelHook = createEventHook();\n\tconst revealHook = createEventHook();\n\tlet _resolve = noop;\n\tconst reveal = (data) => {\n\t\trevealHook.trigger(data);\n\t\trevealed.value = true;\n\t\treturn new Promise((resolve) => {\n\t\t\t_resolve = resolve;\n\t\t});\n\t};\n\tconst confirm = (data) => {\n\t\trevealed.value = false;\n\t\tconfirmHook.trigger(data);\n\t\t_resolve({\n\t\t\tdata,\n\t\t\tisCanceled: false\n\t\t});\n\t};\n\tconst cancel = (data) => {\n\t\trevealed.value = false;\n\t\tcancelHook.trigger(data);\n\t\t_resolve({\n\t\t\tdata,\n\t\t\tisCanceled: true\n\t\t});\n\t};\n\treturn {\n\t\tisRevealed: computed(() => revealed.value),\n\t\treveal,\n\t\tconfirm,\n\t\tcancel,\n\t\tonReveal: revealHook.on,\n\t\tonConfirm: confirmHook.on,\n\t\tonCancel: cancelHook.on\n\t};\n}\n\n//#endregion\n//#region useCountdown/index.ts\n/**\n* Wrapper for `useIntervalFn` that provides a countdown timer in seconds.\n*\n* @param initialCountdown\n* @param options\n*\n* @see https://vueuse.org/useCountdown\n*/\nfunction useCountdown(initialCountdown, options) {\n\tvar _options$interval, _options$immediate;\n\tconst remaining = shallowRef(toValue(initialCountdown));\n\tconst intervalController = useIntervalFn(() => {\n\t\tvar _options$onTick;\n\t\tconst value = remaining.value - 1;\n\t\tremaining.value = value < 0 ? 0 : value;\n\t\toptions === null || options === void 0 || (_options$onTick = options.onTick) === null || _options$onTick === void 0 || _options$onTick.call(options);\n\t\tif (remaining.value <= 0) {\n\t\t\tvar _options$onComplete;\n\t\t\tintervalController.pause();\n\t\t\toptions === null || options === void 0 || (_options$onComplete = options.onComplete) === null || _options$onComplete === void 0 || _options$onComplete.call(options);\n\t\t}\n\t}, (_options$interval = options === null || options === void 0 ? void 0 : options.interval) !== null && _options$interval !== void 0 ? _options$interval : 1e3, { immediate: (_options$immediate = options === null || options === void 0 ? void 0 : options.immediate) !== null && _options$immediate !== void 0 ? _options$immediate : false });\n\tconst reset = (countdown) => {\n\t\tvar _toValue;\n\t\tremaining.value = (_toValue = toValue(countdown)) !== null && _toValue !== void 0 ? _toValue : toValue(initialCountdown);\n\t};\n\tconst stop = () => {\n\t\tintervalController.pause();\n\t\treset();\n\t};\n\tconst resume = () => {\n\t\tif (!intervalController.isActive.value) {\n\t\t\tif (remaining.value > 0) intervalController.resume();\n\t\t}\n\t};\n\tconst start = (countdown) => {\n\t\treset(countdown);\n\t\tintervalController.resume();\n\t};\n\treturn {\n\t\tremaining,\n\t\treset,\n\t\tstop,\n\t\tstart,\n\t\tpause: intervalController.pause,\n\t\tresume,\n\t\tisActive: intervalController.isActive\n\t};\n}\n\n//#endregion\n//#region useCssVar/index.ts\n/**\n* Manipulate CSS variables.\n*\n* @see https://vueuse.org/useCssVar\n* @param prop\n* @param target\n* @param options\n*/\nfunction useCssVar(prop, target, options = {}) {\n\tconst { window: window$1 = defaultWindow, initialValue, observe = false } = options;\n\tconst variable = shallowRef(initialValue);\n\tconst elRef = computed(() => {\n\t\tvar _window$document;\n\t\treturn unrefElement(target) || (window$1 === null || window$1 === void 0 || (_window$document = window$1.document) === null || _window$document === void 0 ? void 0 : _window$document.documentElement);\n\t});\n\tfunction updateCssVar() {\n\t\tconst key = toValue(prop);\n\t\tconst el = toValue(elRef);\n\t\tif (el && window$1 && key) {\n\t\t\tvar _window$getComputedSt;\n\t\t\tvariable.value = ((_window$getComputedSt = window$1.getComputedStyle(el).getPropertyValue(key)) === null || _window$getComputedSt === void 0 ? void 0 : _window$getComputedSt.trim()) || variable.value || initialValue;\n\t\t}\n\t}\n\tif (observe) useMutationObserver(elRef, updateCssVar, {\n\t\tattributeFilter: [\"style\", \"class\"],\n\t\twindow: window$1\n\t});\n\twatch([elRef, () => toValue(prop)], (_, old) => {\n\t\tif (old[0] && old[1]) old[0].style.removeProperty(old[1]);\n\t\tupdateCssVar();\n\t}, { immediate: true });\n\twatch([variable, elRef], ([val, el]) => {\n\t\tconst raw_prop = toValue(prop);\n\t\tif ((el === null || el === void 0 ? void 0 : el.style) && raw_prop) if (val == null) el.style.removeProperty(raw_prop);\n\t\telse el.style.setProperty(raw_prop, val);\n\t}, { immediate: true });\n\treturn variable;\n}\n\n//#endregion\n//#region useCurrentElement/index.ts\nfunction useCurrentElement(rootComponent) {\n\tconst vm = getCurrentInstance();\n\tconst currentElement = computedWithControl(() => null, () => rootComponent ? unrefElement(rootComponent) : vm.proxy.$el);\n\tonUpdated(currentElement.trigger);\n\tonMounted(currentElement.trigger);\n\treturn currentElement;\n}\n\n//#endregion\n//#region useCycleList/index.ts\n/**\n* Cycle through a list of items\n*\n* @see https://vueuse.org/useCycleList\n*/\nfunction useCycleList(list, options) {\n\tconst state = shallowRef(getInitialValue());\n\tconst listRef = toRef(list);\n\tconst index = computed({\n\t\tget() {\n\t\t\tvar _options$fallbackInde;\n\t\t\tconst targetList = listRef.value;\n\t\t\tlet index$1 = (options === null || options === void 0 ? void 0 : options.getIndexOf) ? options.getIndexOf(state.value, targetList) : targetList.indexOf(state.value);\n\t\t\tif (index$1 < 0) index$1 = (_options$fallbackInde = options === null || options === void 0 ? void 0 : options.fallbackIndex) !== null && _options$fallbackInde !== void 0 ? _options$fallbackInde : 0;\n\t\t\treturn index$1;\n\t\t},\n\t\tset(v) {\n\t\t\tset(v);\n\t\t}\n\t});\n\tfunction set(i) {\n\t\tconst targetList = listRef.value;\n\t\tconst length = targetList.length;\n\t\tconst value = targetList[(i % length + length) % length];\n\t\tstate.value = value;\n\t\treturn value;\n\t}\n\tfunction shift(delta = 1) {\n\t\treturn set(index.value + delta);\n\t}\n\tfunction next(n = 1) {\n\t\treturn shift(n);\n\t}\n\tfunction prev(n = 1) {\n\t\treturn shift(-n);\n\t}\n\tfunction getInitialValue() {\n\t\tvar _toValue, _options$initialValue;\n\t\treturn (_toValue = toValue((_options$initialValue = options === null || options === void 0 ? void 0 : options.initialValue) !== null && _options$initialValue !== void 0 ? _options$initialValue : toValue(list)[0])) !== null && _toValue !== void 0 ? _toValue : void 0;\n\t}\n\twatch(listRef, () => set(index.value));\n\treturn {\n\t\tstate,\n\t\tindex,\n\t\tnext,\n\t\tprev,\n\t\tgo: set\n\t};\n}\n\n//#endregion\n//#region useDark/index.ts\n/**\n* Reactive dark mode with auto data persistence.\n*\n* @see https://vueuse.org/useDark\n* @param options\n*/\nfunction useDark(options = {}) {\n\tconst { valueDark = \"dark\", valueLight = \"\" } = options;\n\tconst mode = useColorMode({\n\t\t...options,\n\t\tonChanged: (mode$1, defaultHandler) => {\n\t\t\tvar _options$onChanged;\n\t\t\tif (options.onChanged) (_options$onChanged = options.onChanged) === null || _options$onChanged === void 0 || _options$onChanged.call(options, mode$1 === \"dark\", defaultHandler, mode$1);\n\t\t\telse defaultHandler(mode$1);\n\t\t},\n\t\tmodes: {\n\t\t\tdark: valueDark,\n\t\t\tlight: valueLight\n\t\t}\n\t});\n\tconst system = computed(() => mode.system.value);\n\treturn computed({\n\t\tget() {\n\t\t\treturn mode.value === \"dark\";\n\t\t},\n\t\tset(v) {\n\t\t\tconst modeVal = v ? \"dark\" : \"light\";\n\t\t\tif (system.value === modeVal) mode.value = \"auto\";\n\t\t\telse mode.value = modeVal;\n\t\t}\n\t});\n}\n\n//#endregion\n//#region useManualRefHistory/index.ts\nfunction fnBypass(v) {\n\treturn v;\n}\nfunction fnSetSource(source, value) {\n\treturn source.value = value;\n}\nfunction defaultDump(clone) {\n\treturn clone ? typeof clone === \"function\" ? clone : cloneFnJSON : fnBypass;\n}\nfunction defaultParse(clone) {\n\treturn clone ? typeof clone === \"function\" ? clone : cloneFnJSON : fnBypass;\n}\n/**\n* Track the change history of a ref, also provides undo and redo functionality.\n*\n* @see https://vueuse.org/useManualRefHistory\n* @param source\n* @param options\n*/\nfunction useManualRefHistory(source, options = {}) {\n\tconst { clone = false, dump = defaultDump(clone), parse = defaultParse(clone), setSource = fnSetSource } = options;\n\tfunction _createHistoryRecord() {\n\t\treturn markRaw({\n\t\t\tsnapshot: dump(source.value),\n\t\t\ttimestamp: timestamp()\n\t\t});\n\t}\n\tconst last = ref(_createHistoryRecord());\n\tconst undoStack = ref([]);\n\tconst redoStack = ref([]);\n\tconst _setSource = (record) => {\n\t\tsetSource(source, parse(record.snapshot));\n\t\tlast.value = record;\n\t};\n\tconst commit = () => {\n\t\tundoStack.value.unshift(last.value);\n\t\tlast.value = _createHistoryRecord();\n\t\tif (options.capacity && undoStack.value.length > options.capacity) undoStack.value.splice(options.capacity, Number.POSITIVE_INFINITY);\n\t\tif (redoStack.value.length) redoStack.value.splice(0, redoStack.value.length);\n\t};\n\tconst clear = () => {\n\t\tundoStack.value.splice(0, undoStack.value.length);\n\t\tredoStack.value.splice(0, redoStack.value.length);\n\t};\n\tconst undo = () => {\n\t\tconst state = undoStack.value.shift();\n\t\tif (state) {\n\t\t\tredoStack.value.unshift(last.value);\n\t\t\t_setSource(state);\n\t\t}\n\t};\n\tconst redo = () => {\n\t\tconst state = redoStack.value.shift();\n\t\tif (state) {\n\t\t\tundoStack.value.unshift(last.value);\n\t\t\t_setSource(state);\n\t\t}\n\t};\n\tconst reset = () => {\n\t\t_setSource(last.value);\n\t};\n\treturn {\n\t\tsource,\n\t\tundoStack,\n\t\tredoStack,\n\t\tlast,\n\t\thistory: computed(() => [last.value, ...undoStack.value]),\n\t\tcanUndo: computed(() => undoStack.value.length > 0),\n\t\tcanRedo: computed(() => redoStack.value.length > 0),\n\t\tclear,\n\t\tcommit,\n\t\treset,\n\t\tundo,\n\t\tredo\n\t};\n}\n\n//#endregion\n//#region useRefHistory/index.ts\n/**\n* Track the change history of a ref, also provides undo and redo functionality.\n*\n* @see https://vueuse.org/useRefHistory\n* @param source\n* @param options\n*/\nfunction useRefHistory(source, options = {}) {\n\tconst { deep = false, flush = \"pre\", eventFilter, shouldCommit = () => true } = options;\n\tconst { eventFilter: composedFilter, pause, resume: resumeTracking, isActive: isTracking } = pausableFilter(eventFilter);\n\tlet lastRawValue = source.value;\n\tconst { ignoreUpdates, ignorePrevAsyncUpdates, stop } = watchIgnorable(source, commit, {\n\t\tdeep,\n\t\tflush,\n\t\teventFilter: composedFilter\n\t});\n\tfunction setSource(source$1, value) {\n\t\tignorePrevAsyncUpdates();\n\t\tignoreUpdates(() => {\n\t\t\tsource$1.value = value;\n\t\t\tlastRawValue = value;\n\t\t});\n\t}\n\tconst manualHistory = useManualRefHistory(source, {\n\t\t...options,\n\t\tclone: options.clone || deep,\n\t\tsetSource\n\t});\n\tconst { clear, commit: manualCommit } = manualHistory;\n\tfunction commit() {\n\t\tignorePrevAsyncUpdates();\n\t\tif (!shouldCommit(lastRawValue, source.value)) return;\n\t\tlastRawValue = source.value;\n\t\tmanualCommit();\n\t}\n\tfunction resume(commitNow) {\n\t\tresumeTracking();\n\t\tif (commitNow) commit();\n\t}\n\tfunction batch(fn) {\n\t\tlet canceled = false;\n\t\tconst cancel = () => canceled = true;\n\t\tignoreUpdates(() => {\n\t\t\tfn(cancel);\n\t\t});\n\t\tif (!canceled) commit();\n\t}\n\tfunction dispose() {\n\t\tstop();\n\t\tclear();\n\t}\n\treturn {\n\t\t...manualHistory,\n\t\tisTracking,\n\t\tpause,\n\t\tresume,\n\t\tcommit,\n\t\tbatch,\n\t\tdispose\n\t};\n}\n\n//#endregion\n//#region useDebouncedRefHistory/index.ts\n/**\n* Shorthand for [useRefHistory](https://vueuse.org/useRefHistory) with debounce filter.\n*\n* @see https://vueuse.org/useDebouncedRefHistory\n* @param source\n* @param options\n*/\nfunction useDebouncedRefHistory(source, options = {}) {\n\tconst filter = options.debounce ? debounceFilter(options.debounce) : void 0;\n\treturn { ...useRefHistory(source, {\n\t\t...options,\n\t\teventFilter: filter\n\t}) };\n}\n\n//#endregion\n//#region useDeviceMotion/index.ts\n/**\n* Reactive DeviceMotionEvent.\n*\n* @see https://vueuse.org/useDeviceMotion\n* @param options\n*/\nfunction useDeviceMotion(options = {}) {\n\tconst { window: window$1 = defaultWindow, requestPermissions = false, eventFilter = bypassFilter } = options;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => typeof DeviceMotionEvent !== \"undefined\");\n\tconst requirePermissions = /* @__PURE__ */ useSupported(() => isSupported.value && \"requestPermission\" in DeviceMotionEvent && typeof DeviceMotionEvent.requestPermission === \"function\");\n\tconst permissionGranted = shallowRef(false);\n\tconst acceleration = ref({\n\t\tx: null,\n\t\ty: null,\n\t\tz: null\n\t});\n\tconst rotationRate = ref({\n\t\talpha: null,\n\t\tbeta: null,\n\t\tgamma: null\n\t});\n\tconst interval = shallowRef(0);\n\tconst accelerationIncludingGravity = ref({\n\t\tx: null,\n\t\ty: null,\n\t\tz: null\n\t});\n\tfunction init() {\n\t\tif (window$1) useEventListener(window$1, \"devicemotion\", createFilterWrapper(eventFilter, (event) => {\n\t\t\tvar _event$acceleration, _event$acceleration2, _event$acceleration3, _event$accelerationIn, _event$accelerationIn2, _event$accelerationIn3, _event$rotationRate, _event$rotationRate2, _event$rotationRate3;\n\t\t\tacceleration.value = {\n\t\t\t\tx: ((_event$acceleration = event.acceleration) === null || _event$acceleration === void 0 ? void 0 : _event$acceleration.x) || null,\n\t\t\t\ty: ((_event$acceleration2 = event.acceleration) === null || _event$acceleration2 === void 0 ? void 0 : _event$acceleration2.y) || null,\n\t\t\t\tz: ((_event$acceleration3 = event.acceleration) === null || _event$acceleration3 === void 0 ? void 0 : _event$acceleration3.z) || null\n\t\t\t};\n\t\t\taccelerationIncludingGravity.value = {\n\t\t\t\tx: ((_event$accelerationIn = event.accelerationIncludingGravity) === null || _event$accelerationIn === void 0 ? void 0 : _event$accelerationIn.x) || null,\n\t\t\t\ty: ((_event$accelerationIn2 = event.accelerationIncludingGravity) === null || _event$accelerationIn2 === void 0 ? void 0 : _event$accelerationIn2.y) || null,\n\t\t\t\tz: ((_event$accelerationIn3 = event.accelerationIncludingGravity) === null || _event$accelerationIn3 === void 0 ? void 0 : _event$accelerationIn3.z) || null\n\t\t\t};\n\t\t\trotationRate.value = {\n\t\t\t\talpha: ((_event$rotationRate = event.rotationRate) === null || _event$rotationRate === void 0 ? void 0 : _event$rotationRate.alpha) || null,\n\t\t\t\tbeta: ((_event$rotationRate2 = event.rotationRate) === null || _event$rotationRate2 === void 0 ? void 0 : _event$rotationRate2.beta) || null,\n\t\t\t\tgamma: ((_event$rotationRate3 = event.rotationRate) === null || _event$rotationRate3 === void 0 ? void 0 : _event$rotationRate3.gamma) || null\n\t\t\t};\n\t\t\tinterval.value = event.interval;\n\t\t}), { passive: true });\n\t}\n\tconst ensurePermissions = async () => {\n\t\tif (!requirePermissions.value) permissionGranted.value = true;\n\t\tif (permissionGranted.value) return;\n\t\tif (requirePermissions.value) {\n\t\t\tconst requestPermission = DeviceMotionEvent.requestPermission;\n\t\t\ttry {\n\t\t\t\tif (await requestPermission() === \"granted\") {\n\t\t\t\t\tpermissionGranted.value = true;\n\t\t\t\t\tinit();\n\t\t\t\t}\n\t\t\t} catch (error) {\n\t\t\t\tconsole.error(error);\n\t\t\t}\n\t\t}\n\t};\n\tif (isSupported.value) if (requestPermissions && requirePermissions.value) ensurePermissions().then(() => init());\n\telse init();\n\treturn {\n\t\tacceleration,\n\t\taccelerationIncludingGravity,\n\t\trotationRate,\n\t\tinterval,\n\t\tisSupported,\n\t\trequirePermissions,\n\t\tensurePermissions,\n\t\tpermissionGranted\n\t};\n}\n\n//#endregion\n//#region useDeviceOrientation/index.ts\n/**\n* Reactive DeviceOrientationEvent.\n*\n* @see https://vueuse.org/useDeviceOrientation\n* @param options\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useDeviceOrientation(options = {}) {\n\tconst { window: window$1 = defaultWindow } = options;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => window$1 && \"DeviceOrientationEvent\" in window$1);\n\tconst isAbsolute = shallowRef(false);\n\tconst alpha = shallowRef(null);\n\tconst beta = shallowRef(null);\n\tconst gamma = shallowRef(null);\n\tif (window$1 && isSupported.value) useEventListener(window$1, \"deviceorientation\", (event) => {\n\t\tisAbsolute.value = event.absolute;\n\t\talpha.value = event.alpha;\n\t\tbeta.value = event.beta;\n\t\tgamma.value = event.gamma;\n\t}, { passive: true });\n\treturn {\n\t\tisSupported,\n\t\tisAbsolute,\n\t\talpha,\n\t\tbeta,\n\t\tgamma\n\t};\n}\n\n//#endregion\n//#region useDevicePixelRatio/index.ts\n/**\n* Reactively track `window.devicePixelRatio`.\n*\n* @see https://vueuse.org/useDevicePixelRatio\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useDevicePixelRatio(options = {}) {\n\tconst { window: window$1 = defaultWindow } = options;\n\tconst pixelRatio = shallowRef(1);\n\tconst query = useMediaQuery(() => `(resolution: ${pixelRatio.value}dppx)`, options);\n\tlet stop = noop;\n\tif (window$1) stop = watchImmediate(query, () => pixelRatio.value = window$1.devicePixelRatio);\n\treturn {\n\t\tpixelRatio: readonly(pixelRatio),\n\t\tstop\n\t};\n}\n\n//#endregion\n//#region useDevicesList/index.ts\n/**\n* Reactive `enumerateDevices` listing available input/output devices\n*\n* @see https://vueuse.org/useDevicesList\n* @param options\n*/\nfunction useDevicesList(options = {}) {\n\tconst { navigator: navigator$1 = defaultNavigator, requestPermissions = false, constraints = {\n\t\taudio: true,\n\t\tvideo: true\n\t}, onUpdated: onUpdated$1 } = options;\n\tconst devices = ref([]);\n\tconst videoInputs = computed(() => devices.value.filter((i) => i.kind === \"videoinput\"));\n\tconst audioInputs = computed(() => devices.value.filter((i) => i.kind === \"audioinput\"));\n\tconst audioOutputs = computed(() => devices.value.filter((i) => i.kind === \"audiooutput\"));\n\tconst isSupported = /* @__PURE__ */ useSupported(() => navigator$1 && navigator$1.mediaDevices && navigator$1.mediaDevices.enumerateDevices);\n\tconst permissionGranted = shallowRef(false);\n\tlet stream;\n\tasync function update() {\n\t\tif (!isSupported.value) return;\n\t\tdevices.value = await navigator$1.mediaDevices.enumerateDevices();\n\t\tonUpdated$1 === null || onUpdated$1 === void 0 || onUpdated$1(devices.value);\n\t\tif (stream) {\n\t\t\tstream.getTracks().forEach((t) => t.stop());\n\t\t\tstream = null;\n\t\t}\n\t}\n\tasync function ensurePermissions() {\n\t\tconst deviceName = constraints.video ? \"camera\" : \"microphone\";\n\t\tif (!isSupported.value) return false;\n\t\tif (permissionGranted.value) return true;\n\t\tconst { state, query } = usePermission(deviceName, { controls: true });\n\t\tawait query();\n\t\tif (state.value !== \"granted\") {\n\t\t\tlet granted = true;\n\t\t\ttry {\n\t\t\t\tconst allDevices = await navigator$1.mediaDevices.enumerateDevices();\n\t\t\t\tconst hasCamera = allDevices.some((device) => device.kind === \"videoinput\");\n\t\t\t\tconst hasMicrophone = allDevices.some((device) => device.kind === \"audioinput\" || device.kind === \"audiooutput\");\n\t\t\t\tconstraints.video = hasCamera ? constraints.video : false;\n\t\t\t\tconstraints.audio = hasMicrophone ? constraints.audio : false;\n\t\t\t\tstream = await navigator$1.mediaDevices.getUserMedia(constraints);\n\t\t\t} catch (_unused) {\n\t\t\t\tstream = null;\n\t\t\t\tgranted = false;\n\t\t\t}\n\t\t\tupdate();\n\t\t\tpermissionGranted.value = granted;\n\t\t} else permissionGranted.value = true;\n\t\treturn permissionGranted.value;\n\t}\n\tif (isSupported.value) {\n\t\tif (requestPermissions) ensurePermissions();\n\t\tuseEventListener(navigator$1.mediaDevices, \"devicechange\", update, { passive: true });\n\t\tupdate();\n\t}\n\treturn {\n\t\tdevices,\n\t\tensurePermissions,\n\t\tpermissionGranted,\n\t\tvideoInputs,\n\t\taudioInputs,\n\t\taudioOutputs,\n\t\tisSupported\n\t};\n}\n\n//#endregion\n//#region useDisplayMedia/index.ts\n/**\n* Reactive `mediaDevices.getDisplayMedia` streaming\n*\n* @see https://vueuse.org/useDisplayMedia\n* @param options\n*/\nfunction useDisplayMedia(options = {}) {\n\tvar _options$enabled;\n\tconst enabled = shallowRef((_options$enabled = options.enabled) !== null && _options$enabled !== void 0 ? _options$enabled : false);\n\tconst video = options.video;\n\tconst audio = options.audio;\n\tconst { navigator: navigator$1 = defaultNavigator } = options;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => {\n\t\tvar _navigator$mediaDevic;\n\t\treturn navigator$1 === null || navigator$1 === void 0 || (_navigator$mediaDevic = navigator$1.mediaDevices) === null || _navigator$mediaDevic === void 0 ? void 0 : _navigator$mediaDevic.getDisplayMedia;\n\t});\n\tconst constraint = {\n\t\taudio,\n\t\tvideo\n\t};\n\tconst stream = shallowRef();\n\tasync function _start() {\n\t\tvar _stream$value;\n\t\tif (!isSupported.value || stream.value) return;\n\t\tstream.value = await navigator$1.mediaDevices.getDisplayMedia(constraint);\n\t\t(_stream$value = stream.value) === null || _stream$value === void 0 || _stream$value.getTracks().forEach((t) => useEventListener(t, \"ended\", stop, { passive: true }));\n\t\treturn stream.value;\n\t}\n\tasync function _stop() {\n\t\tvar _stream$value2;\n\t\t(_stream$value2 = stream.value) === null || _stream$value2 === void 0 || _stream$value2.getTracks().forEach((t) => t.stop());\n\t\tstream.value = void 0;\n\t}\n\tfunction stop() {\n\t\t_stop();\n\t\tenabled.value = false;\n\t}\n\tasync function start() {\n\t\tawait _start();\n\t\tif (stream.value) enabled.value = true;\n\t\treturn stream.value;\n\t}\n\twatch(enabled, (v) => {\n\t\tif (v) _start();\n\t\telse _stop();\n\t}, { immediate: true });\n\treturn {\n\t\tisSupported,\n\t\tstream,\n\t\tstart,\n\t\tstop,\n\t\tenabled\n\t};\n}\n\n//#endregion\n//#region useDocumentVisibility/index.ts\n/**\n* Reactively track `document.visibilityState`.\n*\n* @see https://vueuse.org/useDocumentVisibility\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useDocumentVisibility(options = {}) {\n\tconst { document: document$1 = defaultDocument } = options;\n\tif (!document$1) return shallowRef(\"visible\");\n\tconst visibility = shallowRef(document$1.visibilityState);\n\tuseEventListener(document$1, \"visibilitychange\", () => {\n\t\tvisibility.value = document$1.visibilityState;\n\t}, { passive: true });\n\treturn visibility;\n}\n\n//#endregion\n//#region useDraggable/index.ts\n/**\n* Make elements draggable.\n*\n* @see https://vueuse.org/useDraggable\n* @param target\n* @param options\n*/\nfunction useDraggable(target, options = {}) {\n\tvar _toValue;\n\tconst { pointerTypes, preventDefault: preventDefault$1, stopPropagation, exact, onMove, onEnd, onStart, initialValue, axis = \"both\", draggingElement = defaultWindow, containerElement, handle: draggingHandle = target, buttons = [0] } = options;\n\tconst position = ref((_toValue = toValue(initialValue)) !== null && _toValue !== void 0 ? _toValue : {\n\t\tx: 0,\n\t\ty: 0\n\t});\n\tconst pressedDelta = ref();\n\tconst filterEvent = (e) => {\n\t\tif (pointerTypes) return pointerTypes.includes(e.pointerType);\n\t\treturn true;\n\t};\n\tconst handleEvent = (e) => {\n\t\tif (toValue(preventDefault$1)) e.preventDefault();\n\t\tif (toValue(stopPropagation)) e.stopPropagation();\n\t};\n\tconst start = (e) => {\n\t\tvar _container$getBoundin;\n\t\tif (!toValue(buttons).includes(e.button)) return;\n\t\tif (toValue(options.disabled) || !filterEvent(e)) return;\n\t\tif (toValue(exact) && e.target !== toValue(target)) return;\n\t\tconst container = toValue(containerElement);\n\t\tconst containerRect = container === null || container === void 0 || (_container$getBoundin = container.getBoundingClientRect) === null || _container$getBoundin === void 0 ? void 0 : _container$getBoundin.call(container);\n\t\tconst targetRect = toValue(target).getBoundingClientRect();\n\t\tconst pos = {\n\t\t\tx: e.clientX - (container ? targetRect.left - containerRect.left + container.scrollLeft : targetRect.left),\n\t\t\ty: e.clientY - (container ? targetRect.top - containerRect.top + container.scrollTop : targetRect.top)\n\t\t};\n\t\tif ((onStart === null || onStart === void 0 ? void 0 : onStart(pos, e)) === false) return;\n\t\tpressedDelta.value = pos;\n\t\thandleEvent(e);\n\t};\n\tconst move = (e) => {\n\t\tif (toValue(options.disabled) || !filterEvent(e)) return;\n\t\tif (!pressedDelta.value) return;\n\t\tconst container = toValue(containerElement);\n\t\tconst targetRect = toValue(target).getBoundingClientRect();\n\t\tlet { x, y } = position.value;\n\t\tif (axis === \"x\" || axis === \"both\") {\n\t\t\tx = e.clientX - pressedDelta.value.x;\n\t\t\tif (container) x = Math.min(Math.max(0, x), container.scrollWidth - targetRect.width);\n\t\t}\n\t\tif (axis === \"y\" || axis === \"both\") {\n\t\t\ty = e.clientY - pressedDelta.value.y;\n\t\t\tif (container) y = Math.min(Math.max(0, y), container.scrollHeight - targetRect.height);\n\t\t}\n\t\tposition.value = {\n\t\t\tx,\n\t\t\ty\n\t\t};\n\t\tonMove === null || onMove === void 0 || onMove(position.value, e);\n\t\thandleEvent(e);\n\t};\n\tconst end = (e) => {\n\t\tif (toValue(options.disabled) || !filterEvent(e)) return;\n\t\tif (!pressedDelta.value) return;\n\t\tpressedDelta.value = void 0;\n\t\tonEnd === null || onEnd === void 0 || onEnd(position.value, e);\n\t\thandleEvent(e);\n\t};\n\tif (isClient) {\n\t\tconst config = () => {\n\t\t\tvar _options$capture;\n\t\t\treturn {\n\t\t\t\tcapture: (_options$capture = options.capture) !== null && _options$capture !== void 0 ? _options$capture : true,\n\t\t\t\tpassive: !toValue(preventDefault$1)\n\t\t\t};\n\t\t};\n\t\tuseEventListener(draggingHandle, \"pointerdown\", start, config);\n\t\tuseEventListener(draggingElement, \"pointermove\", move, config);\n\t\tuseEventListener(draggingElement, \"pointerup\", end, config);\n\t}\n\treturn {\n\t\t...toRefs(position),\n\t\tposition,\n\t\tisDragging: computed(() => !!pressedDelta.value),\n\t\tstyle: computed(() => `left:${position.value.x}px;top:${position.value.y}px;`)\n\t};\n}\n\n//#endregion\n//#region useDropZone/index.ts\nfunction useDropZone(target, options = {}) {\n\tconst isOverDropZone = shallowRef(false);\n\tconst files = shallowRef(null);\n\tlet counter = 0;\n\tlet isValid = true;\n\tif (isClient) {\n\t\tvar _options$multiple, _options$preventDefau;\n\t\tconst _options = typeof options === \"function\" ? { onDrop: options } : options;\n\t\tconst multiple = (_options$multiple = _options.multiple) !== null && _options$multiple !== void 0 ? _options$multiple : true;\n\t\tconst preventDefaultForUnhandled = (_options$preventDefau = _options.preventDefaultForUnhandled) !== null && _options$preventDefau !== void 0 ? _options$preventDefau : false;\n\t\tconst getFiles = (event) => {\n\t\t\tvar _event$dataTransfer$f, _event$dataTransfer;\n\t\t\tconst list = Array.from((_event$dataTransfer$f = (_event$dataTransfer = event.dataTransfer) === null || _event$dataTransfer === void 0 ? void 0 : _event$dataTransfer.files) !== null && _event$dataTransfer$f !== void 0 ? _event$dataTransfer$f : []);\n\t\t\treturn list.length === 0 ? null : multiple ? list : [list[0]];\n\t\t};\n\t\tconst checkDataTypes = (types) => {\n\t\t\tconst dataTypes = unref(_options.dataTypes);\n\t\t\tif (typeof dataTypes === \"function\") return dataTypes(types);\n\t\t\tif (!(dataTypes === null || dataTypes === void 0 ? void 0 : dataTypes.length)) return true;\n\t\t\tif (types.length === 0) return false;\n\t\t\treturn types.every((type) => dataTypes.some((allowedType) => type.includes(allowedType)));\n\t\t};\n\t\tconst checkValidity = (items) => {\n\t\t\tconst dataTypesValid = checkDataTypes(Array.from(items !== null && items !== void 0 ? items : []).map((item) => item.type));\n\t\t\tconst multipleFilesValid = multiple || items.length <= 1;\n\t\t\treturn dataTypesValid && multipleFilesValid;\n\t\t};\n\t\tconst isSafari = () => /^(?:(?!chrome|android).)*safari/i.test(navigator.userAgent) && !(\"chrome\" in window);\n\t\tconst handleDragEvent = (event, eventType) => {\n\t\t\tvar _event$dataTransfer2, _ref;\n\t\t\tconst dataTransferItemList = (_event$dataTransfer2 = event.dataTransfer) === null || _event$dataTransfer2 === void 0 ? void 0 : _event$dataTransfer2.items;\n\t\t\tisValid = (_ref = dataTransferItemList && checkValidity(dataTransferItemList)) !== null && _ref !== void 0 ? _ref : false;\n\t\t\tif (preventDefaultForUnhandled) event.preventDefault();\n\t\t\tif (!isSafari() && !isValid) {\n\t\t\t\tif (event.dataTransfer) event.dataTransfer.dropEffect = \"none\";\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tevent.preventDefault();\n\t\t\tif (event.dataTransfer) event.dataTransfer.dropEffect = \"copy\";\n\t\t\tconst currentFiles = getFiles(event);\n\t\t\tswitch (eventType) {\n\t\t\t\tcase \"enter\":\n\t\t\t\t\tvar _options$onEnter;\n\t\t\t\t\tcounter += 1;\n\t\t\t\t\tisOverDropZone.value = true;\n\t\t\t\t\t(_options$onEnter = _options.onEnter) === null || _options$onEnter === void 0 || _options$onEnter.call(_options, null, event);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"over\":\n\t\t\t\t\tvar _options$onOver;\n\t\t\t\t\t(_options$onOver = _options.onOver) === null || _options$onOver === void 0 || _options$onOver.call(_options, null, event);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"leave\":\n\t\t\t\t\tvar _options$onLeave;\n\t\t\t\t\tcounter -= 1;\n\t\t\t\t\tif (counter === 0) isOverDropZone.value = false;\n\t\t\t\t\t(_options$onLeave = _options.onLeave) === null || _options$onLeave === void 0 || _options$onLeave.call(_options, null, event);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"drop\":\n\t\t\t\t\tcounter = 0;\n\t\t\t\t\tisOverDropZone.value = false;\n\t\t\t\t\tif (isValid) {\n\t\t\t\t\t\tvar _options$onDrop;\n\t\t\t\t\t\tfiles.value = currentFiles;\n\t\t\t\t\t\t(_options$onDrop = _options.onDrop) === null || _options$onDrop === void 0 || _options$onDrop.call(_options, currentFiles, event);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t};\n\t\tuseEventListener(target, \"dragenter\", (event) => handleDragEvent(event, \"enter\"));\n\t\tuseEventListener(target, \"dragover\", (event) => handleDragEvent(event, \"over\"));\n\t\tuseEventListener(target, \"dragleave\", (event) => handleDragEvent(event, \"leave\"));\n\t\tuseEventListener(target, \"drop\", (event) => handleDragEvent(event, \"drop\"));\n\t}\n\treturn {\n\t\tfiles,\n\t\tisOverDropZone\n\t};\n}\n\n//#endregion\n//#region useResizeObserver/index.ts\n/**\n* Reports changes to the dimensions of an Element's content or the border-box\n*\n* @see https://vueuse.org/useResizeObserver\n* @param target\n* @param callback\n* @param options\n*/\nfunction useResizeObserver(target, callback, options = {}) {\n\tconst { window: window$1 = defaultWindow,...observerOptions } = options;\n\tlet observer;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => window$1 && \"ResizeObserver\" in window$1);\n\tconst cleanup = () => {\n\t\tif (observer) {\n\t\t\tobserver.disconnect();\n\t\t\tobserver = void 0;\n\t\t}\n\t};\n\tconst stopWatch = watch(computed(() => {\n\t\tconst _targets = toValue(target);\n\t\treturn Array.isArray(_targets) ? _targets.map((el) => unrefElement(el)) : [unrefElement(_targets)];\n\t}), (els) => {\n\t\tcleanup();\n\t\tif (isSupported.value && window$1) {\n\t\t\tobserver = new ResizeObserver(callback);\n\t\t\tfor (const _el of els) if (_el) observer.observe(_el, observerOptions);\n\t\t}\n\t}, {\n\t\timmediate: true,\n\t\tflush: \"post\"\n\t});\n\tconst stop = () => {\n\t\tcleanup();\n\t\tstopWatch();\n\t};\n\ttryOnScopeDispose(stop);\n\treturn {\n\t\tisSupported,\n\t\tstop\n\t};\n}\n\n//#endregion\n//#region useElementBounding/index.ts\n/**\n* Reactive bounding box of an HTML element.\n*\n* @see https://vueuse.org/useElementBounding\n* @param target\n*/\nfunction useElementBounding(target, options = {}) {\n\tconst { reset = true, windowResize = true, windowScroll = true, immediate = true, updateTiming = \"sync\" } = options;\n\tconst height = shallowRef(0);\n\tconst bottom = shallowRef(0);\n\tconst left = shallowRef(0);\n\tconst right = shallowRef(0);\n\tconst top = shallowRef(0);\n\tconst width = shallowRef(0);\n\tconst x = shallowRef(0);\n\tconst y = shallowRef(0);\n\tfunction recalculate() {\n\t\tconst el = unrefElement(target);\n\t\tif (!el) {\n\t\t\tif (reset) {\n\t\t\t\theight.value = 0;\n\t\t\t\tbottom.value = 0;\n\t\t\t\tleft.value = 0;\n\t\t\t\tright.value = 0;\n\t\t\t\ttop.value = 0;\n\t\t\t\twidth.value = 0;\n\t\t\t\tx.value = 0;\n\t\t\t\ty.value = 0;\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tconst rect = el.getBoundingClientRect();\n\t\theight.value = rect.height;\n\t\tbottom.value = rect.bottom;\n\t\tleft.value = rect.left;\n\t\tright.value = rect.right;\n\t\ttop.value = rect.top;\n\t\twidth.value = rect.width;\n\t\tx.value = rect.x;\n\t\ty.value = rect.y;\n\t}\n\tfunction update() {\n\t\tif (updateTiming === \"sync\") recalculate();\n\t\telse if (updateTiming === \"next-frame\") requestAnimationFrame(() => recalculate());\n\t}\n\tuseResizeObserver(target, update);\n\twatch(() => unrefElement(target), (ele) => !ele && update());\n\tuseMutationObserver(target, update, { attributeFilter: [\"style\", \"class\"] });\n\tif (windowScroll) useEventListener(\"scroll\", update, {\n\t\tcapture: true,\n\t\tpassive: true\n\t});\n\tif (windowResize) useEventListener(\"resize\", update, { passive: true });\n\ttryOnMounted(() => {\n\t\tif (immediate) update();\n\t});\n\treturn {\n\t\theight,\n\t\tbottom,\n\t\tleft,\n\t\tright,\n\t\ttop,\n\t\twidth,\n\t\tx,\n\t\ty,\n\t\tupdate\n\t};\n}\n\n//#endregion\n//#region useElementByPoint/index.ts\n/**\n* Reactive element by point.\n*\n* @see https://vueuse.org/useElementByPoint\n* @param options - UseElementByPointOptions\n*/\nfunction useElementByPoint(options) {\n\tconst { x, y, document: document$1 = defaultDocument, multiple, interval = \"requestAnimationFrame\", immediate = true } = options;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => {\n\t\tif (toValue(multiple)) return document$1 && \"elementsFromPoint\" in document$1;\n\t\treturn document$1 && \"elementFromPoint\" in document$1;\n\t});\n\tconst element = shallowRef(null);\n\tconst cb = () => {\n\t\tvar _document$elementsFro, _document$elementFrom;\n\t\telement.value = toValue(multiple) ? (_document$elementsFro = document$1 === null || document$1 === void 0 ? void 0 : document$1.elementsFromPoint(toValue(x), toValue(y))) !== null && _document$elementsFro !== void 0 ? _document$elementsFro : [] : (_document$elementFrom = document$1 === null || document$1 === void 0 ? void 0 : document$1.elementFromPoint(toValue(x), toValue(y))) !== null && _document$elementFrom !== void 0 ? _document$elementFrom : null;\n\t};\n\treturn {\n\t\tisSupported,\n\t\telement,\n\t\t...interval === \"requestAnimationFrame\" ? useRafFn(cb, { immediate }) : useIntervalFn(cb, interval, { immediate })\n\t};\n}\n\n//#endregion\n//#region useElementHover/index.ts\nfunction useElementHover(el, options = {}) {\n\tconst { delayEnter = 0, delayLeave = 0, triggerOnRemoval = false, window: window$1 = defaultWindow } = options;\n\tconst isHovered = shallowRef(false);\n\tlet timer;\n\tconst toggle = (entering) => {\n\t\tconst delay = entering ? delayEnter : delayLeave;\n\t\tif (timer) {\n\t\t\tclearTimeout(timer);\n\t\t\ttimer = void 0;\n\t\t}\n\t\tif (delay) timer = setTimeout(() => isHovered.value = entering, delay);\n\t\telse isHovered.value = entering;\n\t};\n\tif (!window$1) return isHovered;\n\tuseEventListener(el, \"mouseenter\", () => toggle(true), { passive: true });\n\tuseEventListener(el, \"mouseleave\", () => toggle(false), { passive: true });\n\tif (triggerOnRemoval) onElementRemoval(computed(() => unrefElement(el)), () => toggle(false));\n\treturn isHovered;\n}\n\n//#endregion\n//#region useElementSize/index.ts\n/**\n* Reactive size of an HTML element.\n*\n* @see https://vueuse.org/useElementSize\n*/\nfunction useElementSize(target, initialSize = {\n\twidth: 0,\n\theight: 0\n}, options = {}) {\n\tconst { window: window$1 = defaultWindow, box = \"content-box\" } = options;\n\tconst isSVG = computed(() => {\n\t\tvar _unrefElement;\n\t\treturn (_unrefElement = unrefElement(target)) === null || _unrefElement === void 0 || (_unrefElement = _unrefElement.namespaceURI) === null || _unrefElement === void 0 ? void 0 : _unrefElement.includes(\"svg\");\n\t});\n\tconst width = shallowRef(initialSize.width);\n\tconst height = shallowRef(initialSize.height);\n\tconst { stop: stop1 } = useResizeObserver(target, ([entry]) => {\n\t\tconst boxSize = box === \"border-box\" ? entry.borderBoxSize : box === \"content-box\" ? entry.contentBoxSize : entry.devicePixelContentBoxSize;\n\t\tif (window$1 && isSVG.value) {\n\t\t\tconst $elem = unrefElement(target);\n\t\t\tif ($elem) {\n\t\t\t\tconst rect = $elem.getBoundingClientRect();\n\t\t\t\twidth.value = rect.width;\n\t\t\t\theight.value = rect.height;\n\t\t\t}\n\t\t} else if (boxSize) {\n\t\t\tconst formatBoxSize = toArray(boxSize);\n\t\t\twidth.value = formatBoxSize.reduce((acc, { inlineSize }) => acc + inlineSize, 0);\n\t\t\theight.value = formatBoxSize.reduce((acc, { blockSize }) => acc + blockSize, 0);\n\t\t} else {\n\t\t\twidth.value = entry.contentRect.width;\n\t\t\theight.value = entry.contentRect.height;\n\t\t}\n\t}, options);\n\ttryOnMounted(() => {\n\t\tconst ele = unrefElement(target);\n\t\tif (ele) {\n\t\t\twidth.value = \"offsetWidth\" in ele ? ele.offsetWidth : initialSize.width;\n\t\t\theight.value = \"offsetHeight\" in ele ? ele.offsetHeight : initialSize.height;\n\t\t}\n\t});\n\tconst stop2 = watch(() => unrefElement(target), (ele) => {\n\t\twidth.value = ele ? initialSize.width : 0;\n\t\theight.value = ele ? initialSize.height : 0;\n\t});\n\tfunction stop() {\n\t\tstop1();\n\t\tstop2();\n\t}\n\treturn {\n\t\twidth,\n\t\theight,\n\t\tstop\n\t};\n}\n\n//#endregion\n//#region useIntersectionObserver/index.ts\n/**\n* Detects that a target element's visibility.\n*\n* @see https://vueuse.org/useIntersectionObserver\n* @param target\n* @param callback\n* @param options\n*/\nfunction useIntersectionObserver(target, callback, options = {}) {\n\tconst { root, rootMargin = \"0px\", threshold = 0, window: window$1 = defaultWindow, immediate = true } = options;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => window$1 && \"IntersectionObserver\" in window$1);\n\tconst targets = computed(() => {\n\t\treturn toArray(toValue(target)).map(unrefElement).filter(notNullish);\n\t});\n\tlet cleanup = noop;\n\tconst isActive = shallowRef(immediate);\n\tconst stopWatch = isSupported.value ? watch(() => [\n\t\ttargets.value,\n\t\tunrefElement(root),\n\t\tisActive.value\n\t], ([targets$1, root$1]) => {\n\t\tcleanup();\n\t\tif (!isActive.value) return;\n\t\tif (!targets$1.length) return;\n\t\tconst observer = new IntersectionObserver(callback, {\n\t\t\troot: unrefElement(root$1),\n\t\t\trootMargin,\n\t\t\tthreshold\n\t\t});\n\t\ttargets$1.forEach((el) => el && observer.observe(el));\n\t\tcleanup = () => {\n\t\t\tobserver.disconnect();\n\t\t\tcleanup = noop;\n\t\t};\n\t}, {\n\t\timmediate,\n\t\tflush: \"post\"\n\t}) : noop;\n\tconst stop = () => {\n\t\tcleanup();\n\t\tstopWatch();\n\t\tisActive.value = false;\n\t};\n\ttryOnScopeDispose(stop);\n\treturn {\n\t\tisSupported,\n\t\tisActive,\n\t\tpause() {\n\t\t\tcleanup();\n\t\t\tisActive.value = false;\n\t\t},\n\t\tresume() {\n\t\t\tisActive.value = true;\n\t\t},\n\t\tstop\n\t};\n}\n\n//#endregion\n//#region useElementVisibility/index.ts\n/**\n* Tracks the visibility of an element within the viewport.\n*\n* @see https://vueuse.org/useElementVisibility\n*/\nfunction useElementVisibility(element, options = {}) {\n\tconst { window: window$1 = defaultWindow, scrollTarget, threshold = 0, rootMargin, once = false } = options;\n\tconst elementIsVisible = shallowRef(false);\n\tconst { stop } = useIntersectionObserver(element, (intersectionObserverEntries) => {\n\t\tlet isIntersecting = elementIsVisible.value;\n\t\tlet latestTime = 0;\n\t\tfor (const entry of intersectionObserverEntries) if (entry.time >= latestTime) {\n\t\t\tlatestTime = entry.time;\n\t\t\tisIntersecting = entry.isIntersecting;\n\t\t}\n\t\telementIsVisible.value = isIntersecting;\n\t\tif (once) watchOnce(elementIsVisible, () => {\n\t\t\tstop();\n\t\t});\n\t}, {\n\t\troot: scrollTarget,\n\t\twindow: window$1,\n\t\tthreshold,\n\t\trootMargin: toValue(rootMargin)\n\t});\n\treturn elementIsVisible;\n}\n\n//#endregion\n//#region useEventBus/internal.ts\nconst events = /* @__PURE__ */ new Map();\n\n//#endregion\n//#region useEventBus/index.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction useEventBus(key) {\n\tconst scope = getCurrentScope();\n\tfunction on(listener) {\n\t\tvar _scope$cleanups;\n\t\tconst listeners = events.get(key) || /* @__PURE__ */ new Set();\n\t\tlisteners.add(listener);\n\t\tevents.set(key, listeners);\n\t\tconst _off = () => off(listener);\n\t\tscope === null || scope === void 0 || (_scope$cleanups = scope.cleanups) === null || _scope$cleanups === void 0 || _scope$cleanups.push(_off);\n\t\treturn _off;\n\t}\n\tfunction once(listener) {\n\t\tfunction _listener(...args) {\n\t\t\toff(_listener);\n\t\t\tlistener(...args);\n\t\t}\n\t\treturn on(_listener);\n\t}\n\tfunction off(listener) {\n\t\tconst listeners = events.get(key);\n\t\tif (!listeners) return;\n\t\tlisteners.delete(listener);\n\t\tif (!listeners.size) reset();\n\t}\n\tfunction reset() {\n\t\tevents.delete(key);\n\t}\n\tfunction emit(event, payload) {\n\t\tvar _events$get;\n\t\t(_events$get = events.get(key)) === null || _events$get === void 0 || _events$get.forEach((v) => v(event, payload));\n\t}\n\treturn {\n\t\ton,\n\t\tonce,\n\t\toff,\n\t\temit,\n\t\treset\n\t};\n}\n\n//#endregion\n//#region useEventSource/index.ts\nfunction resolveNestedOptions$1(options) {\n\tif (options === true) return {};\n\treturn options;\n}\n/**\n* Reactive wrapper for EventSource.\n*\n* @see https://vueuse.org/useEventSource\n* @see https://developer.mozilla.org/en-US/docs/Web/API/EventSource/EventSource EventSource\n* @param url\n* @param events\n* @param options\n*/\nfunction useEventSource(url, events$1 = [], options = {}) {\n\tconst event = shallowRef(null);\n\tconst data = shallowRef(null);\n\tconst status = shallowRef(\"CONNECTING\");\n\tconst eventSource = ref(null);\n\tconst error = shallowRef(null);\n\tconst urlRef = toRef(url);\n\tconst lastEventId = shallowRef(null);\n\tlet explicitlyClosed = false;\n\tlet retried = 0;\n\tconst { withCredentials = false, immediate = true, autoConnect = true, autoReconnect, serializer = { read: (v) => v } } = options;\n\tconst close = () => {\n\t\tif (isClient && eventSource.value) {\n\t\t\teventSource.value.close();\n\t\t\teventSource.value = null;\n\t\t\tstatus.value = \"CLOSED\";\n\t\t\texplicitlyClosed = true;\n\t\t}\n\t};\n\tconst _init = () => {\n\t\tif (explicitlyClosed || typeof urlRef.value === \"undefined\") return;\n\t\tconst es = new EventSource(urlRef.value, { withCredentials });\n\t\tstatus.value = \"CONNECTING\";\n\t\teventSource.value = es;\n\t\tes.onopen = () => {\n\t\t\tstatus.value = \"OPEN\";\n\t\t\terror.value = null;\n\t\t};\n\t\tes.onerror = (e) => {\n\t\t\tstatus.value = \"CLOSED\";\n\t\t\terror.value = e;\n\t\t\tif (es.readyState === 2 && !explicitlyClosed && autoReconnect) {\n\t\t\t\tes.close();\n\t\t\t\tconst { retries = -1, delay = 1e3, onFailed } = resolveNestedOptions$1(autoReconnect);\n\t\t\t\tretried += 1;\n\t\t\t\tif (typeof retries === \"number\" && (retries < 0 || retried < retries)) setTimeout(_init, delay);\n\t\t\t\telse if (typeof retries === \"function\" && retries()) setTimeout(_init, delay);\n\t\t\t\telse onFailed === null || onFailed === void 0 || onFailed();\n\t\t\t}\n\t\t};\n\t\tes.onmessage = (e) => {\n\t\t\tvar _serializer$read;\n\t\t\tevent.value = null;\n\t\t\tdata.value = (_serializer$read = serializer.read(e.data)) !== null && _serializer$read !== void 0 ? _serializer$read : null;\n\t\t\tlastEventId.value = e.lastEventId;\n\t\t};\n\t\tfor (const event_name of events$1) useEventListener(es, event_name, (e) => {\n\t\t\tvar _serializer$read2, _e$lastEventId;\n\t\t\tevent.value = event_name;\n\t\t\tdata.value = (_serializer$read2 = serializer.read(e.data)) !== null && _serializer$read2 !== void 0 ? _serializer$read2 : null;\n\t\t\tlastEventId.value = (_e$lastEventId = e.lastEventId) !== null && _e$lastEventId !== void 0 ? _e$lastEventId : null;\n\t\t}, { passive: true });\n\t};\n\tconst open = () => {\n\t\tif (!isClient) return;\n\t\tclose();\n\t\texplicitlyClosed = false;\n\t\tretried = 0;\n\t\t_init();\n\t};\n\tif (immediate) open();\n\tif (autoConnect) watch(urlRef, open);\n\ttryOnScopeDispose(close);\n\treturn {\n\t\teventSource,\n\t\tevent,\n\t\tdata,\n\t\tstatus,\n\t\terror,\n\t\topen,\n\t\tclose,\n\t\tlastEventId\n\t};\n}\n\n//#endregion\n//#region useEyeDropper/index.ts\n/**\n* Reactive [EyeDropper API](https://developer.mozilla.org/en-US/docs/Web/API/EyeDropper_API)\n*\n* @see https://vueuse.org/useEyeDropper\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useEyeDropper(options = {}) {\n\tconst { initialValue = \"\" } = options;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => typeof window !== \"undefined\" && \"EyeDropper\" in window);\n\tconst sRGBHex = shallowRef(initialValue);\n\tasync function open(openOptions) {\n\t\tif (!isSupported.value) return;\n\t\tconst result = await new window.EyeDropper().open(openOptions);\n\t\tsRGBHex.value = result.sRGBHex;\n\t\treturn result;\n\t}\n\treturn {\n\t\tisSupported,\n\t\tsRGBHex,\n\t\topen\n\t};\n}\n\n//#endregion\n//#region useFavicon/index.ts\nfunction useFavicon(newIcon = null, options = {}) {\n\tconst { baseUrl = \"\", rel = \"icon\", document: document$1 = defaultDocument } = options;\n\tconst favicon = toRef(newIcon);\n\tconst applyIcon = (icon) => {\n\t\tconst elements = document$1 === null || document$1 === void 0 ? void 0 : document$1.head.querySelectorAll(`link[rel*=\"${rel}\"]`);\n\t\tif (!elements || elements.length === 0) {\n\t\t\tconst link = document$1 === null || document$1 === void 0 ? void 0 : document$1.createElement(\"link\");\n\t\t\tif (link) {\n\t\t\t\tlink.rel = rel;\n\t\t\t\tlink.href = `${baseUrl}${icon}`;\n\t\t\t\tlink.type = `image/${icon.split(\".\").pop()}`;\n\t\t\t\tdocument$1 === null || document$1 === void 0 || document$1.head.append(link);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\telements === null || elements === void 0 || elements.forEach((el) => el.href = `${baseUrl}${icon}`);\n\t};\n\twatch(favicon, (i, o) => {\n\t\tif (typeof i === \"string\" && i !== o) applyIcon(i);\n\t}, { immediate: true });\n\treturn favicon;\n}\n\n//#endregion\n//#region useFetch/index.ts\nconst payloadMapping = {\n\tjson: \"application/json\",\n\ttext: \"text/plain\"\n};\n/**\n* !!!IMPORTANT!!!\n*\n* If you update the UseFetchOptions interface, be sure to update this object\n* to include the new options\n*/\nfunction isFetchOptions(obj) {\n\treturn obj && containsProp(obj, \"immediate\", \"refetch\", \"initialData\", \"timeout\", \"beforeFetch\", \"afterFetch\", \"onFetchError\", \"fetch\", \"updateDataOnError\");\n}\nconst reAbsolute = /^(?:[a-z][a-z\\d+\\-.]*:)?\\/\\//i;\nfunction isAbsoluteURL(url) {\n\treturn reAbsolute.test(url);\n}\nfunction headersToObject(headers) {\n\tif (typeof Headers !== \"undefined\" && headers instanceof Headers) return Object.fromEntries(headers.entries());\n\treturn headers;\n}\nfunction combineCallbacks(combination, ...callbacks) {\n\tif (combination === \"overwrite\") return async (ctx) => {\n\t\tlet callback;\n\t\tfor (let i = callbacks.length - 1; i >= 0; i--) if (callbacks[i] != null) {\n\t\t\tcallback = callbacks[i];\n\t\t\tbreak;\n\t\t}\n\t\tif (callback) return {\n\t\t\t...ctx,\n\t\t\t...await callback(ctx)\n\t\t};\n\t\treturn ctx;\n\t};\n\telse return async (ctx) => {\n\t\tfor (const callback of callbacks) if (callback) ctx = {\n\t\t\t...ctx,\n\t\t\t...await callback(ctx)\n\t\t};\n\t\treturn ctx;\n\t};\n}\nfunction createFetch(config = {}) {\n\tconst _combination = config.combination || \"chain\";\n\tconst _options = config.options || {};\n\tconst _fetchOptions = config.fetchOptions || {};\n\tfunction useFactoryFetch(url, ...args) {\n\t\tconst computedUrl = computed(() => {\n\t\t\tconst baseUrl = toValue(config.baseUrl);\n\t\t\tconst targetUrl = toValue(url);\n\t\t\treturn baseUrl && !isAbsoluteURL(targetUrl) ? joinPaths(baseUrl, targetUrl) : targetUrl;\n\t\t});\n\t\tlet options = _options;\n\t\tlet fetchOptions = _fetchOptions;\n\t\tif (args.length > 0) if (isFetchOptions(args[0])) options = {\n\t\t\t...options,\n\t\t\t...args[0],\n\t\t\tbeforeFetch: combineCallbacks(_combination, _options.beforeFetch, args[0].beforeFetch),\n\t\t\tafterFetch: combineCallbacks(_combination, _options.afterFetch, args[0].afterFetch),\n\t\t\tonFetchError: combineCallbacks(_combination, _options.onFetchError, args[0].onFetchError)\n\t\t};\n\t\telse fetchOptions = {\n\t\t\t...fetchOptions,\n\t\t\t...args[0],\n\t\t\theaders: {\n\t\t\t\t...headersToObject(fetchOptions.headers) || {},\n\t\t\t\t...headersToObject(args[0].headers) || {}\n\t\t\t}\n\t\t};\n\t\tif (args.length > 1 && isFetchOptions(args[1])) options = {\n\t\t\t...options,\n\t\t\t...args[1],\n\t\t\tbeforeFetch: combineCallbacks(_combination, _options.beforeFetch, args[1].beforeFetch),\n\t\t\tafterFetch: combineCallbacks(_combination, _options.afterFetch, args[1].afterFetch),\n\t\t\tonFetchError: combineCallbacks(_combination, _options.onFetchError, args[1].onFetchError)\n\t\t};\n\t\treturn useFetch(computedUrl, fetchOptions, options);\n\t}\n\treturn useFactoryFetch;\n}\nfunction useFetch(url, ...args) {\n\tvar _defaultWindow$fetch, _globalThis;\n\tconst supportsAbort = typeof AbortController === \"function\";\n\tlet fetchOptions = {};\n\tlet options = {\n\t\timmediate: true,\n\t\trefetch: false,\n\t\ttimeout: 0,\n\t\tupdateDataOnError: false\n\t};\n\tconst config = {\n\t\tmethod: \"GET\",\n\t\ttype: \"text\",\n\t\tpayload: void 0\n\t};\n\tif (args.length > 0) if (isFetchOptions(args[0])) options = {\n\t\t...options,\n\t\t...args[0]\n\t};\n\telse fetchOptions = args[0];\n\tif (args.length > 1) {\n\t\tif (isFetchOptions(args[1])) options = {\n\t\t\t...options,\n\t\t\t...args[1]\n\t\t};\n\t}\n\tconst { fetch = (_defaultWindow$fetch = defaultWindow === null || defaultWindow === void 0 ? void 0 : defaultWindow.fetch) !== null && _defaultWindow$fetch !== void 0 ? _defaultWindow$fetch : (_globalThis = globalThis) === null || _globalThis === void 0 ? void 0 : _globalThis.fetch, initialData, timeout } = options;\n\tconst responseEvent = createEventHook();\n\tconst errorEvent = createEventHook();\n\tconst finallyEvent = createEventHook();\n\tconst isFinished = shallowRef(false);\n\tconst isFetching = shallowRef(false);\n\tconst aborted = shallowRef(false);\n\tconst statusCode = shallowRef(null);\n\tconst response = shallowRef(null);\n\tconst error = shallowRef(null);\n\tconst data = shallowRef(initialData || null);\n\tconst canAbort = computed(() => supportsAbort && isFetching.value);\n\tlet controller;\n\tlet timer;\n\tconst abort = (reason) => {\n\t\tif (supportsAbort) {\n\t\t\tcontroller === null || controller === void 0 || controller.abort(reason);\n\t\t\tcontroller = new AbortController();\n\t\t\tcontroller.signal.onabort = () => aborted.value = true;\n\t\t\tfetchOptions = {\n\t\t\t\t...fetchOptions,\n\t\t\t\tsignal: controller.signal\n\t\t\t};\n\t\t}\n\t};\n\tconst loading = (isLoading) => {\n\t\tisFetching.value = isLoading;\n\t\tisFinished.value = !isLoading;\n\t};\n\tif (timeout) timer = useTimeoutFn(abort, timeout, { immediate: false });\n\tlet executeCounter = 0;\n\tconst execute = async (throwOnFailed = false) => {\n\t\tvar _context$options;\n\t\tabort();\n\t\tloading(true);\n\t\terror.value = null;\n\t\tstatusCode.value = null;\n\t\taborted.value = false;\n\t\texecuteCounter += 1;\n\t\tconst currentExecuteCounter = executeCounter;\n\t\tconst defaultFetchOptions = {\n\t\t\tmethod: config.method,\n\t\t\theaders: {}\n\t\t};\n\t\tconst payload = toValue(config.payload);\n\t\tif (payload) {\n\t\t\tvar _payloadMapping$confi;\n\t\t\tconst headers = headersToObject(defaultFetchOptions.headers);\n\t\t\tconst proto = Object.getPrototypeOf(payload);\n\t\t\tif (!config.payloadType && payload && (proto === Object.prototype || Array.isArray(proto)) && !(payload instanceof FormData)) config.payloadType = \"json\";\n\t\t\tif (config.payloadType) headers[\"Content-Type\"] = (_payloadMapping$confi = payloadMapping[config.payloadType]) !== null && _payloadMapping$confi !== void 0 ? _payloadMapping$confi : config.payloadType;\n\t\t\tdefaultFetchOptions.body = config.payloadType === \"json\" ? JSON.stringify(payload) : payload;\n\t\t}\n\t\tlet isCanceled = false;\n\t\tconst context = {\n\t\t\turl: toValue(url),\n\t\t\toptions: {\n\t\t\t\t...defaultFetchOptions,\n\t\t\t\t...fetchOptions\n\t\t\t},\n\t\t\tcancel: () => {\n\t\t\t\tisCanceled = true;\n\t\t\t}\n\t\t};\n\t\tif (options.beforeFetch) Object.assign(context, await options.beforeFetch(context));\n\t\tif (isCanceled || !fetch) {\n\t\t\tloading(false);\n\t\t\treturn Promise.resolve(null);\n\t\t}\n\t\tlet responseData = null;\n\t\tif (timer) timer.start();\n\t\treturn fetch(context.url, {\n\t\t\t...defaultFetchOptions,\n\t\t\t...context.options,\n\t\t\theaders: {\n\t\t\t\t...headersToObject(defaultFetchOptions.headers),\n\t\t\t\t...headersToObject((_context$options = context.options) === null || _context$options === void 0 ? void 0 : _context$options.headers)\n\t\t\t}\n\t\t}).then(async (fetchResponse) => {\n\t\t\tresponse.value = fetchResponse;\n\t\t\tstatusCode.value = fetchResponse.status;\n\t\t\tresponseData = await fetchResponse.clone()[config.type]();\n\t\t\tif (!fetchResponse.ok) {\n\t\t\t\tdata.value = initialData || null;\n\t\t\t\tthrow new Error(fetchResponse.statusText);\n\t\t\t}\n\t\t\tif (options.afterFetch) ({data: responseData} = await options.afterFetch({\n\t\t\t\tdata: responseData,\n\t\t\t\tresponse: fetchResponse,\n\t\t\t\tcontext,\n\t\t\t\texecute\n\t\t\t}));\n\t\t\tdata.value = responseData;\n\t\t\tresponseEvent.trigger(fetchResponse);\n\t\t\treturn fetchResponse;\n\t\t}).catch(async (fetchError) => {\n\t\t\tlet errorData = fetchError.message || fetchError.name;\n\t\t\tif (options.onFetchError) ({error: errorData, data: responseData} = await options.onFetchError({\n\t\t\t\tdata: responseData,\n\t\t\t\terror: fetchError,\n\t\t\t\tresponse: response.value,\n\t\t\t\tcontext,\n\t\t\t\texecute\n\t\t\t}));\n\t\t\terror.value = errorData;\n\t\t\tif (options.updateDataOnError) data.value = responseData;\n\t\t\terrorEvent.trigger(fetchError);\n\t\t\tif (throwOnFailed) throw fetchError;\n\t\t\treturn null;\n\t\t}).finally(() => {\n\t\t\tif (currentExecuteCounter === executeCounter) loading(false);\n\t\t\tif (timer) timer.stop();\n\t\t\tfinallyEvent.trigger(null);\n\t\t});\n\t};\n\tconst refetch = toRef(options.refetch);\n\twatch([refetch, toRef(url)], ([refetch$1]) => refetch$1 && execute(), { deep: true });\n\tconst shell = {\n\t\tisFinished: readonly(isFinished),\n\t\tisFetching: readonly(isFetching),\n\t\tstatusCode,\n\t\tresponse,\n\t\terror,\n\t\tdata,\n\t\tcanAbort,\n\t\taborted,\n\t\tabort,\n\t\texecute,\n\t\tonFetchResponse: responseEvent.on,\n\t\tonFetchError: errorEvent.on,\n\t\tonFetchFinally: finallyEvent.on,\n\t\tget: setMethod(\"GET\"),\n\t\tput: setMethod(\"PUT\"),\n\t\tpost: setMethod(\"POST\"),\n\t\tdelete: setMethod(\"DELETE\"),\n\t\tpatch: setMethod(\"PATCH\"),\n\t\thead: setMethod(\"HEAD\"),\n\t\toptions: setMethod(\"OPTIONS\"),\n\t\tjson: setType(\"json\"),\n\t\ttext: setType(\"text\"),\n\t\tblob: setType(\"blob\"),\n\t\tarrayBuffer: setType(\"arrayBuffer\"),\n\t\tformData: setType(\"formData\")\n\t};\n\tfunction setMethod(method) {\n\t\treturn (payload, payloadType) => {\n\t\t\tif (!isFetching.value) {\n\t\t\t\tconfig.method = method;\n\t\t\t\tconfig.payload = payload;\n\t\t\t\tconfig.payloadType = payloadType;\n\t\t\t\tif (isRef(config.payload)) watch([refetch, toRef(config.payload)], ([refetch$1]) => refetch$1 && execute(), { deep: true });\n\t\t\t\treturn {\n\t\t\t\t\t...shell,\n\t\t\t\t\tthen(onFulfilled, onRejected) {\n\t\t\t\t\t\treturn waitUntilFinished().then(onFulfilled, onRejected);\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t}\n\t\t};\n\t}\n\tfunction waitUntilFinished() {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tuntil(isFinished).toBe(true).then(() => resolve(shell)).catch(reject);\n\t\t});\n\t}\n\tfunction setType(type) {\n\t\treturn () => {\n\t\t\tif (!isFetching.value) {\n\t\t\t\tconfig.type = type;\n\t\t\t\treturn {\n\t\t\t\t\t...shell,\n\t\t\t\t\tthen(onFulfilled, onRejected) {\n\t\t\t\t\t\treturn waitUntilFinished().then(onFulfilled, onRejected);\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t}\n\t\t};\n\t}\n\tif (options.immediate) Promise.resolve().then(() => execute());\n\treturn {\n\t\t...shell,\n\t\tthen(onFulfilled, onRejected) {\n\t\t\treturn waitUntilFinished().then(onFulfilled, onRejected);\n\t\t}\n\t};\n}\nfunction joinPaths(start, end) {\n\tif (!start.endsWith(\"/\") && !end.startsWith(\"/\")) return `${start}/${end}`;\n\tif (start.endsWith(\"/\") && end.startsWith(\"/\")) return `${start.slice(0, -1)}${end}`;\n\treturn `${start}${end}`;\n}\n\n//#endregion\n//#region useFileDialog/index.ts\nconst DEFAULT_OPTIONS = {\n\tmultiple: true,\n\taccept: \"*\",\n\treset: false,\n\tdirectory: false\n};\nfunction prepareInitialFiles(files) {\n\tif (!files) return null;\n\tif (files instanceof FileList) return files;\n\tconst dt = new DataTransfer();\n\tfor (const file of files) dt.items.add(file);\n\treturn dt.files;\n}\n/**\n* Open file dialog with ease.\n*\n* @see https://vueuse.org/useFileDialog\n* @param options\n*/\nfunction useFileDialog(options = {}) {\n\tconst { document: document$1 = defaultDocument } = options;\n\tconst files = ref(prepareInitialFiles(options.initialFiles));\n\tconst { on: onChange, trigger: changeTrigger } = createEventHook();\n\tconst { on: onCancel, trigger: cancelTrigger } = createEventHook();\n\tconst inputRef = computed(() => {\n\t\tvar _unrefElement;\n\t\tconst input = (_unrefElement = unrefElement(options.input)) !== null && _unrefElement !== void 0 ? _unrefElement : document$1 ? document$1.createElement(\"input\") : void 0;\n\t\tif (input) {\n\t\t\tinput.type = \"file\";\n\t\t\tinput.onchange = (event) => {\n\t\t\t\tfiles.value = event.target.files;\n\t\t\t\tchangeTrigger(files.value);\n\t\t\t};\n\t\t\tinput.oncancel = () => {\n\t\t\t\tcancelTrigger();\n\t\t\t};\n\t\t}\n\t\treturn input;\n\t});\n\tconst reset = () => {\n\t\tfiles.value = null;\n\t\tif (inputRef.value && inputRef.value.value) {\n\t\t\tinputRef.value.value = \"\";\n\t\t\tchangeTrigger(null);\n\t\t}\n\t};\n\tconst applyOptions = (options$1) => {\n\t\tconst el = inputRef.value;\n\t\tif (!el) return;\n\t\tel.multiple = toValue(options$1.multiple);\n\t\tel.accept = toValue(options$1.accept);\n\t\tel.webkitdirectory = toValue(options$1.directory);\n\t\tif (hasOwn(options$1, \"capture\")) el.capture = toValue(options$1.capture);\n\t};\n\tconst open = (localOptions) => {\n\t\tconst el = inputRef.value;\n\t\tif (!el) return;\n\t\tconst mergedOptions = {\n\t\t\t...DEFAULT_OPTIONS,\n\t\t\t...options,\n\t\t\t...localOptions\n\t\t};\n\t\tapplyOptions(mergedOptions);\n\t\tif (toValue(mergedOptions.reset)) reset();\n\t\tel.click();\n\t};\n\twatchEffect(() => {\n\t\tapplyOptions(options);\n\t});\n\treturn {\n\t\tfiles: readonly(files),\n\t\topen,\n\t\treset,\n\t\tonCancel,\n\t\tonChange\n\t};\n}\n\n//#endregion\n//#region useFileSystemAccess/index.ts\nfunction useFileSystemAccess(options = {}) {\n\tconst { window: _window = defaultWindow, dataType = \"Text\" } = options;\n\tconst window$1 = _window;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => window$1 && \"showSaveFilePicker\" in window$1 && \"showOpenFilePicker\" in window$1);\n\tconst fileHandle = shallowRef();\n\tconst data = shallowRef();\n\tconst file = shallowRef();\n\tconst fileName = computed(() => {\n\t\tvar _file$value$name, _file$value;\n\t\treturn (_file$value$name = (_file$value = file.value) === null || _file$value === void 0 ? void 0 : _file$value.name) !== null && _file$value$name !== void 0 ? _file$value$name : \"\";\n\t});\n\tconst fileMIME = computed(() => {\n\t\tvar _file$value$type, _file$value2;\n\t\treturn (_file$value$type = (_file$value2 = file.value) === null || _file$value2 === void 0 ? void 0 : _file$value2.type) !== null && _file$value$type !== void 0 ? _file$value$type : \"\";\n\t});\n\tconst fileSize = computed(() => {\n\t\tvar _file$value$size, _file$value3;\n\t\treturn (_file$value$size = (_file$value3 = file.value) === null || _file$value3 === void 0 ? void 0 : _file$value3.size) !== null && _file$value$size !== void 0 ? _file$value$size : 0;\n\t});\n\tconst fileLastModified = computed(() => {\n\t\tvar _file$value$lastModif, _file$value4;\n\t\treturn (_file$value$lastModif = (_file$value4 = file.value) === null || _file$value4 === void 0 ? void 0 : _file$value4.lastModified) !== null && _file$value$lastModif !== void 0 ? _file$value$lastModif : 0;\n\t});\n\tasync function open(_options = {}) {\n\t\tif (!isSupported.value) return;\n\t\tconst [handle] = await window$1.showOpenFilePicker({\n\t\t\t...toValue(options),\n\t\t\t..._options\n\t\t});\n\t\tfileHandle.value = handle;\n\t\tawait updateData();\n\t}\n\tasync function create(_options = {}) {\n\t\tif (!isSupported.value) return;\n\t\tfileHandle.value = await window$1.showSaveFilePicker({\n\t\t\t...options,\n\t\t\t..._options\n\t\t});\n\t\tdata.value = void 0;\n\t\tawait updateData();\n\t}\n\tasync function save(_options = {}) {\n\t\tif (!isSupported.value) return;\n\t\tif (!fileHandle.value) return saveAs(_options);\n\t\tif (data.value) {\n\t\t\tconst writableStream = await fileHandle.value.createWritable();\n\t\t\tawait writableStream.write(data.value);\n\t\t\tawait writableStream.close();\n\t\t}\n\t\tawait updateFile();\n\t}\n\tasync function saveAs(_options = {}) {\n\t\tif (!isSupported.value) return;\n\t\tfileHandle.value = await window$1.showSaveFilePicker({\n\t\t\t...options,\n\t\t\t..._options\n\t\t});\n\t\tif (data.value) {\n\t\t\tconst writableStream = await fileHandle.value.createWritable();\n\t\t\tawait writableStream.write(data.value);\n\t\t\tawait writableStream.close();\n\t\t}\n\t\tawait updateFile();\n\t}\n\tasync function updateFile() {\n\t\tvar _fileHandle$value;\n\t\tfile.value = await ((_fileHandle$value = fileHandle.value) === null || _fileHandle$value === void 0 ? void 0 : _fileHandle$value.getFile());\n\t}\n\tasync function updateData() {\n\t\tvar _file$value5, _file$value6;\n\t\tawait updateFile();\n\t\tconst type = toValue(dataType);\n\t\tif (type === \"Text\") data.value = await ((_file$value5 = file.value) === null || _file$value5 === void 0 ? void 0 : _file$value5.text());\n\t\telse if (type === \"ArrayBuffer\") data.value = await ((_file$value6 = file.value) === null || _file$value6 === void 0 ? void 0 : _file$value6.arrayBuffer());\n\t\telse if (type === \"Blob\") data.value = file.value;\n\t}\n\twatch(() => toValue(dataType), updateData);\n\treturn {\n\t\tisSupported,\n\t\tdata,\n\t\tfile,\n\t\tfileName,\n\t\tfileMIME,\n\t\tfileSize,\n\t\tfileLastModified,\n\t\topen,\n\t\tcreate,\n\t\tsave,\n\t\tsaveAs,\n\t\tupdateData\n\t};\n}\n\n//#endregion\n//#region useFocus/index.ts\n/**\n* Track or set the focus state of a DOM element.\n*\n* @see https://vueuse.org/useFocus\n* @param target The target element for the focus and blur events.\n* @param options\n*/\nfunction useFocus(target, options = {}) {\n\tconst { initialValue = false, focusVisible = false, preventScroll = false } = options;\n\tconst innerFocused = shallowRef(false);\n\tconst targetElement = computed(() => unrefElement(target));\n\tconst listenerOptions = { passive: true };\n\tuseEventListener(targetElement, \"focus\", (event) => {\n\t\tvar _matches, _ref;\n\t\tif (!focusVisible || ((_matches = (_ref = event.target).matches) === null || _matches === void 0 ? void 0 : _matches.call(_ref, \":focus-visible\"))) innerFocused.value = true;\n\t}, listenerOptions);\n\tuseEventListener(targetElement, \"blur\", () => innerFocused.value = false, listenerOptions);\n\tconst focused = computed({\n\t\tget: () => innerFocused.value,\n\t\tset(value) {\n\t\t\tvar _targetElement$value, _targetElement$value2;\n\t\t\tif (!value && innerFocused.value) (_targetElement$value = targetElement.value) === null || _targetElement$value === void 0 || _targetElement$value.blur();\n\t\t\telse if (value && !innerFocused.value) (_targetElement$value2 = targetElement.value) === null || _targetElement$value2 === void 0 || _targetElement$value2.focus({ preventScroll });\n\t\t}\n\t});\n\twatch(targetElement, () => {\n\t\tfocused.value = initialValue;\n\t}, {\n\t\timmediate: true,\n\t\tflush: \"post\"\n\t});\n\treturn { focused };\n}\n\n//#endregion\n//#region useFocusWithin/index.ts\nconst EVENT_FOCUS_IN = \"focusin\";\nconst EVENT_FOCUS_OUT = \"focusout\";\nconst PSEUDO_CLASS_FOCUS_WITHIN = \":focus-within\";\n/**\n* Track if focus is contained within the target element\n*\n* @see https://vueuse.org/useFocusWithin\n* @param target The target element to track\n* @param options Focus within options\n*/\nfunction useFocusWithin(target, options = {}) {\n\tconst { window: window$1 = defaultWindow } = options;\n\tconst targetElement = computed(() => unrefElement(target));\n\tconst _focused = shallowRef(false);\n\tconst focused = computed(() => _focused.value);\n\tconst activeElement = useActiveElement(options);\n\tif (!window$1 || !activeElement.value) return { focused };\n\tconst listenerOptions = { passive: true };\n\tuseEventListener(targetElement, EVENT_FOCUS_IN, () => _focused.value = true, listenerOptions);\n\tuseEventListener(targetElement, EVENT_FOCUS_OUT, () => {\n\t\tvar _targetElement$value$, _targetElement$value, _targetElement$value$2;\n\t\treturn _focused.value = (_targetElement$value$ = (_targetElement$value = targetElement.value) === null || _targetElement$value === void 0 || (_targetElement$value$2 = _targetElement$value.matches) === null || _targetElement$value$2 === void 0 ? void 0 : _targetElement$value$2.call(_targetElement$value, PSEUDO_CLASS_FOCUS_WITHIN)) !== null && _targetElement$value$ !== void 0 ? _targetElement$value$ : false;\n\t}, listenerOptions);\n\treturn { focused };\n}\n\n//#endregion\n//#region useFps/index.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction useFps(options) {\n\tvar _options$every;\n\tconst fps = shallowRef(0);\n\tif (typeof performance === \"undefined\") return fps;\n\tconst every = (_options$every = options === null || options === void 0 ? void 0 : options.every) !== null && _options$every !== void 0 ? _options$every : 10;\n\tlet last = performance.now();\n\tlet ticks = 0;\n\tuseRafFn(() => {\n\t\tticks += 1;\n\t\tif (ticks >= every) {\n\t\t\tconst now = performance.now();\n\t\t\tconst diff = now - last;\n\t\t\tfps.value = Math.round(1e3 / (diff / ticks));\n\t\t\tlast = now;\n\t\t\tticks = 0;\n\t\t}\n\t});\n\treturn fps;\n}\n\n//#endregion\n//#region useFullscreen/index.ts\nconst eventHandlers = [\n\t\"fullscreenchange\",\n\t\"webkitfullscreenchange\",\n\t\"webkitendfullscreen\",\n\t\"mozfullscreenchange\",\n\t\"MSFullscreenChange\"\n];\n/**\n* Reactive Fullscreen API.\n*\n* @see https://vueuse.org/useFullscreen\n* @param target\n* @param options\n*/\nfunction useFullscreen(target, options = {}) {\n\tconst { document: document$1 = defaultDocument, autoExit = false } = options;\n\tconst targetRef = computed(() => {\n\t\tvar _unrefElement;\n\t\treturn (_unrefElement = unrefElement(target)) !== null && _unrefElement !== void 0 ? _unrefElement : document$1 === null || document$1 === void 0 ? void 0 : document$1.documentElement;\n\t});\n\tconst isFullscreen = shallowRef(false);\n\tconst requestMethod = computed(() => {\n\t\treturn [\n\t\t\t\"requestFullscreen\",\n\t\t\t\"webkitRequestFullscreen\",\n\t\t\t\"webkitEnterFullscreen\",\n\t\t\t\"webkitEnterFullScreen\",\n\t\t\t\"webkitRequestFullScreen\",\n\t\t\t\"mozRequestFullScreen\",\n\t\t\t\"msRequestFullscreen\"\n\t\t].find((m) => document$1 && m in document$1 || targetRef.value && m in targetRef.value);\n\t});\n\tconst exitMethod = computed(() => {\n\t\treturn [\n\t\t\t\"exitFullscreen\",\n\t\t\t\"webkitExitFullscreen\",\n\t\t\t\"webkitExitFullScreen\",\n\t\t\t\"webkitCancelFullScreen\",\n\t\t\t\"mozCancelFullScreen\",\n\t\t\t\"msExitFullscreen\"\n\t\t].find((m) => document$1 && m in document$1 || targetRef.value && m in targetRef.value);\n\t});\n\tconst fullscreenEnabled = computed(() => {\n\t\treturn [\n\t\t\t\"fullScreen\",\n\t\t\t\"webkitIsFullScreen\",\n\t\t\t\"webkitDisplayingFullscreen\",\n\t\t\t\"mozFullScreen\",\n\t\t\t\"msFullscreenElement\"\n\t\t].find((m) => document$1 && m in document$1 || targetRef.value && m in targetRef.value);\n\t});\n\tconst fullscreenElementMethod = [\n\t\t\"fullscreenElement\",\n\t\t\"webkitFullscreenElement\",\n\t\t\"mozFullScreenElement\",\n\t\t\"msFullscreenElement\"\n\t].find((m) => document$1 && m in document$1);\n\tconst isSupported = /* @__PURE__ */ useSupported(() => targetRef.value && document$1 && requestMethod.value !== void 0 && exitMethod.value !== void 0 && fullscreenEnabled.value !== void 0);\n\tconst isCurrentElementFullScreen = () => {\n\t\tif (fullscreenElementMethod) return (document$1 === null || document$1 === void 0 ? void 0 : document$1[fullscreenElementMethod]) === targetRef.value;\n\t\treturn false;\n\t};\n\tconst isElementFullScreen = () => {\n\t\tif (fullscreenEnabled.value) if (document$1 && document$1[fullscreenEnabled.value] != null) return document$1[fullscreenEnabled.value];\n\t\telse {\n\t\t\tconst target$1 = targetRef.value;\n\t\t\tif ((target$1 === null || target$1 === void 0 ? void 0 : target$1[fullscreenEnabled.value]) != null) return Boolean(target$1[fullscreenEnabled.value]);\n\t\t}\n\t\treturn false;\n\t};\n\tasync function exit() {\n\t\tif (!isSupported.value || !isFullscreen.value) return;\n\t\tif (exitMethod.value) if ((document$1 === null || document$1 === void 0 ? void 0 : document$1[exitMethod.value]) != null) await document$1[exitMethod.value]();\n\t\telse {\n\t\t\tconst target$1 = targetRef.value;\n\t\t\tif ((target$1 === null || target$1 === void 0 ? void 0 : target$1[exitMethod.value]) != null) await target$1[exitMethod.value]();\n\t\t}\n\t\tisFullscreen.value = false;\n\t}\n\tasync function enter() {\n\t\tif (!isSupported.value || isFullscreen.value) return;\n\t\tif (isElementFullScreen()) await exit();\n\t\tconst target$1 = targetRef.value;\n\t\tif (requestMethod.value && (target$1 === null || target$1 === void 0 ? void 0 : target$1[requestMethod.value]) != null) {\n\t\t\tawait target$1[requestMethod.value]();\n\t\t\tisFullscreen.value = true;\n\t\t}\n\t}\n\tasync function toggle() {\n\t\tawait (isFullscreen.value ? exit() : enter());\n\t}\n\tconst handlerCallback = () => {\n\t\tconst isElementFullScreenValue = isElementFullScreen();\n\t\tif (!isElementFullScreenValue || isElementFullScreenValue && isCurrentElementFullScreen()) isFullscreen.value = isElementFullScreenValue;\n\t};\n\tconst listenerOptions = {\n\t\tcapture: false,\n\t\tpassive: true\n\t};\n\tuseEventListener(document$1, eventHandlers, handlerCallback, listenerOptions);\n\tuseEventListener(() => unrefElement(targetRef), eventHandlers, handlerCallback, listenerOptions);\n\ttryOnMounted(handlerCallback, false);\n\tif (autoExit) tryOnScopeDispose(exit);\n\treturn {\n\t\tisSupported,\n\t\tisFullscreen,\n\t\tenter,\n\t\texit,\n\t\ttoggle\n\t};\n}\n\n//#endregion\n//#region useGamepad/index.ts\n/**\n* Maps a standard standard gamepad to an Xbox 360 Controller.\n*/\nfunction mapGamepadToXbox360Controller(gamepad) {\n\treturn computed(() => {\n\t\tif (gamepad.value) return {\n\t\t\tbuttons: {\n\t\t\t\ta: gamepad.value.buttons[0],\n\t\t\t\tb: gamepad.value.buttons[1],\n\t\t\t\tx: gamepad.value.buttons[2],\n\t\t\t\ty: gamepad.value.buttons[3]\n\t\t\t},\n\t\t\tbumper: {\n\t\t\t\tleft: gamepad.value.buttons[4],\n\t\t\t\tright: gamepad.value.buttons[5]\n\t\t\t},\n\t\t\ttriggers: {\n\t\t\t\tleft: gamepad.value.buttons[6],\n\t\t\t\tright: gamepad.value.buttons[7]\n\t\t\t},\n\t\t\tstick: {\n\t\t\t\tleft: {\n\t\t\t\t\thorizontal: gamepad.value.axes[0],\n\t\t\t\t\tvertical: gamepad.value.axes[1],\n\t\t\t\t\tbutton: gamepad.value.buttons[10]\n\t\t\t\t},\n\t\t\t\tright: {\n\t\t\t\t\thorizontal: gamepad.value.axes[2],\n\t\t\t\t\tvertical: gamepad.value.axes[3],\n\t\t\t\t\tbutton: gamepad.value.buttons[11]\n\t\t\t\t}\n\t\t\t},\n\t\t\tdpad: {\n\t\t\t\tup: gamepad.value.buttons[12],\n\t\t\t\tdown: gamepad.value.buttons[13],\n\t\t\t\tleft: gamepad.value.buttons[14],\n\t\t\t\tright: gamepad.value.buttons[15]\n\t\t\t},\n\t\t\tback: gamepad.value.buttons[8],\n\t\t\tstart: gamepad.value.buttons[9]\n\t\t};\n\t\treturn null;\n\t});\n}\n/* @__NO_SIDE_EFFECTS__ */\nfunction useGamepad(options = {}) {\n\tconst { navigator: navigator$1 = defaultNavigator } = options;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => navigator$1 && \"getGamepads\" in navigator$1);\n\tconst gamepads = ref([]);\n\tconst onConnectedHook = createEventHook();\n\tconst onDisconnectedHook = createEventHook();\n\tconst stateFromGamepad = (gamepad) => {\n\t\tconst hapticActuators = [];\n\t\tconst vibrationActuator = \"vibrationActuator\" in gamepad ? gamepad.vibrationActuator : null;\n\t\tif (vibrationActuator) hapticActuators.push(vibrationActuator);\n\t\tif (gamepad.hapticActuators) hapticActuators.push(...gamepad.hapticActuators);\n\t\treturn {\n\t\t\tid: gamepad.id,\n\t\t\tindex: gamepad.index,\n\t\t\tconnected: gamepad.connected,\n\t\t\tmapping: gamepad.mapping,\n\t\t\ttimestamp: gamepad.timestamp,\n\t\t\tvibrationActuator: gamepad.vibrationActuator,\n\t\t\thapticActuators,\n\t\t\taxes: gamepad.axes.map((axes) => axes),\n\t\t\tbuttons: gamepad.buttons.map((button) => ({\n\t\t\t\tpressed: button.pressed,\n\t\t\t\ttouched: button.touched,\n\t\t\t\tvalue: button.value\n\t\t\t}))\n\t\t};\n\t};\n\tconst updateGamepadState = () => {\n\t\tconst _gamepads = (navigator$1 === null || navigator$1 === void 0 ? void 0 : navigator$1.getGamepads()) || [];\n\t\tfor (const gamepad of _gamepads) if (gamepad && gamepads.value[gamepad.index]) gamepads.value[gamepad.index] = stateFromGamepad(gamepad);\n\t};\n\tconst { isActive, pause, resume } = useRafFn(updateGamepadState);\n\tconst onGamepadConnected = (gamepad) => {\n\t\tif (!gamepads.value.some(({ index }) => index === gamepad.index)) {\n\t\t\tgamepads.value.push(stateFromGamepad(gamepad));\n\t\t\tonConnectedHook.trigger(gamepad.index);\n\t\t}\n\t\tresume();\n\t};\n\tconst onGamepadDisconnected = (gamepad) => {\n\t\tgamepads.value = gamepads.value.filter((x) => x.index !== gamepad.index);\n\t\tonDisconnectedHook.trigger(gamepad.index);\n\t};\n\tconst listenerOptions = { passive: true };\n\tuseEventListener(\"gamepadconnected\", (e) => onGamepadConnected(e.gamepad), listenerOptions);\n\tuseEventListener(\"gamepaddisconnected\", (e) => onGamepadDisconnected(e.gamepad), listenerOptions);\n\ttryOnMounted(() => {\n\t\tconst _gamepads = (navigator$1 === null || navigator$1 === void 0 ? void 0 : navigator$1.getGamepads()) || [];\n\t\tfor (const gamepad of _gamepads) if (gamepad && gamepads.value[gamepad.index]) onGamepadConnected(gamepad);\n\t});\n\tpause();\n\treturn {\n\t\tisSupported,\n\t\tonConnected: onConnectedHook.on,\n\t\tonDisconnected: onDisconnectedHook.on,\n\t\tgamepads,\n\t\tpause,\n\t\tresume,\n\t\tisActive\n\t};\n}\n\n//#endregion\n//#region useGeolocation/index.ts\n/**\n* Reactive Geolocation API.\n*\n* @see https://vueuse.org/useGeolocation\n* @param options\n*/\nfunction useGeolocation(options = {}) {\n\tconst { enableHighAccuracy = true, maximumAge = 3e4, timeout = 27e3, navigator: navigator$1 = defaultNavigator, immediate = true } = options;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => navigator$1 && \"geolocation\" in navigator$1);\n\tconst locatedAt = shallowRef(null);\n\tconst error = shallowRef(null);\n\tconst coords = ref({\n\t\taccuracy: 0,\n\t\tlatitude: Number.POSITIVE_INFINITY,\n\t\tlongitude: Number.POSITIVE_INFINITY,\n\t\taltitude: null,\n\t\taltitudeAccuracy: null,\n\t\theading: null,\n\t\tspeed: null\n\t});\n\tfunction updatePosition(position) {\n\t\tlocatedAt.value = position.timestamp;\n\t\tcoords.value = position.coords;\n\t\terror.value = null;\n\t}\n\tlet watcher;\n\tfunction resume() {\n\t\tif (isSupported.value) watcher = navigator$1.geolocation.watchPosition(updatePosition, (err) => error.value = err, {\n\t\t\tenableHighAccuracy,\n\t\t\tmaximumAge,\n\t\t\ttimeout\n\t\t});\n\t}\n\tif (immediate) resume();\n\tfunction pause() {\n\t\tif (watcher && navigator$1) navigator$1.geolocation.clearWatch(watcher);\n\t}\n\ttryOnScopeDispose(() => {\n\t\tpause();\n\t});\n\treturn {\n\t\tisSupported,\n\t\tcoords,\n\t\tlocatedAt,\n\t\terror,\n\t\tresume,\n\t\tpause\n\t};\n}\n\n//#endregion\n//#region useIdle/index.ts\nconst defaultEvents$1 = [\n\t\"mousemove\",\n\t\"mousedown\",\n\t\"resize\",\n\t\"keydown\",\n\t\"touchstart\",\n\t\"wheel\"\n];\nconst oneMinute = 6e4;\n/**\n* Tracks whether the user is being inactive.\n*\n* @see https://vueuse.org/useIdle\n* @param timeout default to 1 minute\n* @param options IdleOptions\n*/\nfunction useIdle(timeout = oneMinute, options = {}) {\n\tconst { initialState = false, listenForVisibilityChange = true, events: events$1 = defaultEvents$1, window: window$1 = defaultWindow, eventFilter = throttleFilter(50) } = options;\n\tconst idle = shallowRef(initialState);\n\tconst lastActive = shallowRef(timestamp());\n\tconst isPending = shallowRef(false);\n\tlet timer;\n\tconst reset = () => {\n\t\tidle.value = false;\n\t\tclearTimeout(timer);\n\t\ttimer = setTimeout(() => idle.value = true, timeout);\n\t};\n\tconst onEvent = createFilterWrapper(eventFilter, () => {\n\t\tlastActive.value = timestamp();\n\t\treset();\n\t});\n\tif (window$1) {\n\t\tconst document$1 = window$1.document;\n\t\tconst listenerOptions = { passive: true };\n\t\tfor (const event of events$1) useEventListener(window$1, event, () => {\n\t\t\tif (!isPending.value) return;\n\t\t\tonEvent();\n\t\t}, listenerOptions);\n\t\tif (listenForVisibilityChange) useEventListener(document$1, \"visibilitychange\", () => {\n\t\t\tif (document$1.hidden || !isPending.value) return;\n\t\t\tonEvent();\n\t\t}, listenerOptions);\n\t\tstart();\n\t}\n\tfunction start() {\n\t\tif (isPending.value) return;\n\t\tisPending.value = true;\n\t\tif (!initialState) reset();\n\t}\n\tfunction stop() {\n\t\tidle.value = initialState;\n\t\tclearTimeout(timer);\n\t\tisPending.value = false;\n\t}\n\treturn {\n\t\tidle,\n\t\tlastActive,\n\t\treset,\n\t\tstop,\n\t\tstart,\n\t\tisPending: shallowReadonly(isPending)\n\t};\n}\n\n//#endregion\n//#region useImage/index.ts\nasync function loadImage(options) {\n\treturn new Promise((resolve, reject) => {\n\t\tconst img = new Image();\n\t\tconst { src, srcset, sizes, class: clazz, loading, crossorigin, referrerPolicy, width, height, decoding, fetchPriority, ismap, usemap } = options;\n\t\timg.src = src;\n\t\tif (srcset != null) img.srcset = srcset;\n\t\tif (sizes != null) img.sizes = sizes;\n\t\tif (clazz != null) img.className = clazz;\n\t\tif (loading != null) img.loading = loading;\n\t\tif (crossorigin != null) img.crossOrigin = crossorigin;\n\t\tif (referrerPolicy != null) img.referrerPolicy = referrerPolicy;\n\t\tif (width != null) img.width = width;\n\t\tif (height != null) img.height = height;\n\t\tif (decoding != null) img.decoding = decoding;\n\t\tif (fetchPriority != null) img.fetchPriority = fetchPriority;\n\t\tif (ismap != null) img.isMap = ismap;\n\t\tif (usemap != null) img.useMap = usemap;\n\t\timg.onload = () => resolve(img);\n\t\timg.onerror = reject;\n\t});\n}\n/**\n* Reactive load an image in the browser, you can wait the result to display it or show a fallback.\n*\n* @see https://vueuse.org/useImage\n* @param options Image attributes, as used in the <img> tag\n* @param asyncStateOptions\n*/\nfunction useImage(options, asyncStateOptions = {}) {\n\tconst state = useAsyncState(() => loadImage(toValue(options)), void 0, {\n\t\tresetOnExecute: true,\n\t\t...asyncStateOptions\n\t});\n\twatch(() => toValue(options), () => state.execute(asyncStateOptions.delay), { deep: true });\n\treturn state;\n}\n\n//#endregion\n//#region _resolve-element.ts\n/**\n* Resolves an element from a given element, window, or document.\n*\n* @internal\n*/\nfunction resolveElement(el) {\n\tif (typeof Window !== \"undefined\" && el instanceof Window) return el.document.documentElement;\n\tif (typeof Document !== \"undefined\" && el instanceof Document) return el.documentElement;\n\treturn el;\n}\n\n//#endregion\n//#region useScroll/index.ts\n/**\n* We have to check if the scroll amount is close enough to some threshold in order to\n* more accurately calculate arrivedState. This is because scrollTop/scrollLeft are non-rounded\n* numbers, while scrollHeight/scrollWidth and clientHeight/clientWidth are rounded.\n* https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollHeight#determine_if_an_element_has_been_totally_scrolled\n*/\nconst ARRIVED_STATE_THRESHOLD_PIXELS = 1;\n/**\n* Reactive scroll.\n*\n* @see https://vueuse.org/useScroll\n* @param element\n* @param options\n*/\nfunction useScroll(element, options = {}) {\n\tconst { throttle = 0, idle = 200, onStop = noop, onScroll = noop, offset = {\n\t\tleft: 0,\n\t\tright: 0,\n\t\ttop: 0,\n\t\tbottom: 0\n\t}, observe: _observe = { mutation: false }, eventListenerOptions = {\n\t\tcapture: false,\n\t\tpassive: true\n\t}, behavior = \"auto\", window: window$1 = defaultWindow, onError = (e) => {\n\t\tconsole.error(e);\n\t} } = options;\n\tconst observe = typeof _observe === \"boolean\" ? { mutation: _observe } : _observe;\n\tconst internalX = shallowRef(0);\n\tconst internalY = shallowRef(0);\n\tconst x = computed({\n\t\tget() {\n\t\t\treturn internalX.value;\n\t\t},\n\t\tset(x$1) {\n\t\t\tscrollTo(x$1, void 0);\n\t\t}\n\t});\n\tconst y = computed({\n\t\tget() {\n\t\t\treturn internalY.value;\n\t\t},\n\t\tset(y$1) {\n\t\t\tscrollTo(void 0, y$1);\n\t\t}\n\t});\n\tfunction scrollTo(_x, _y) {\n\t\tvar _ref, _toValue, _toValue2, _document;\n\t\tif (!window$1) return;\n\t\tconst _element = toValue(element);\n\t\tif (!_element) return;\n\t\t(_ref = _element instanceof Document ? window$1.document.body : _element) === null || _ref === void 0 || _ref.scrollTo({\n\t\t\ttop: (_toValue = toValue(_y)) !== null && _toValue !== void 0 ? _toValue : y.value,\n\t\t\tleft: (_toValue2 = toValue(_x)) !== null && _toValue2 !== void 0 ? _toValue2 : x.value,\n\t\t\tbehavior: toValue(behavior)\n\t\t});\n\t\tconst scrollContainer = (_element === null || _element === void 0 || (_document = _element.document) === null || _document === void 0 ? void 0 : _document.documentElement) || (_element === null || _element === void 0 ? void 0 : _element.documentElement) || _element;\n\t\tif (x != null) internalX.value = scrollContainer.scrollLeft;\n\t\tif (y != null) internalY.value = scrollContainer.scrollTop;\n\t}\n\tconst isScrolling = shallowRef(false);\n\tconst arrivedState = reactive({\n\t\tleft: true,\n\t\tright: false,\n\t\ttop: true,\n\t\tbottom: false\n\t});\n\tconst directions = reactive({\n\t\tleft: false,\n\t\tright: false,\n\t\ttop: false,\n\t\tbottom: false\n\t});\n\tconst onScrollEnd = (e) => {\n\t\tif (!isScrolling.value) return;\n\t\tisScrolling.value = false;\n\t\tdirections.left = false;\n\t\tdirections.right = false;\n\t\tdirections.top = false;\n\t\tdirections.bottom = false;\n\t\tonStop(e);\n\t};\n\tconst onScrollEndDebounced = useDebounceFn(onScrollEnd, throttle + idle);\n\tconst setArrivedState = (target) => {\n\t\tvar _document2;\n\t\tif (!window$1) return;\n\t\tconst el = (target === null || target === void 0 || (_document2 = target.document) === null || _document2 === void 0 ? void 0 : _document2.documentElement) || (target === null || target === void 0 ? void 0 : target.documentElement) || unrefElement(target);\n\t\tconst { display, flexDirection, direction } = getComputedStyle(el);\n\t\tconst directionMultipler = direction === \"rtl\" ? -1 : 1;\n\t\tconst scrollLeft = el.scrollLeft;\n\t\tdirections.left = scrollLeft < internalX.value;\n\t\tdirections.right = scrollLeft > internalX.value;\n\t\tconst left = Math.abs(scrollLeft * directionMultipler) <= (offset.left || 0);\n\t\tconst right = Math.abs(scrollLeft * directionMultipler) + el.clientWidth >= el.scrollWidth - (offset.right || 0) - ARRIVED_STATE_THRESHOLD_PIXELS;\n\t\tif (display === \"flex\" && flexDirection === \"row-reverse\") {\n\t\t\tarrivedState.left = right;\n\t\t\tarrivedState.right = left;\n\t\t} else {\n\t\t\tarrivedState.left = left;\n\t\t\tarrivedState.right = right;\n\t\t}\n\t\tinternalX.value = scrollLeft;\n\t\tlet scrollTop = el.scrollTop;\n\t\tif (target === window$1.document && !scrollTop) scrollTop = window$1.document.body.scrollTop;\n\t\tdirections.top = scrollTop < internalY.value;\n\t\tdirections.bottom = scrollTop > internalY.value;\n\t\tconst top = Math.abs(scrollTop) <= (offset.top || 0);\n\t\tconst bottom = Math.abs(scrollTop) + el.clientHeight >= el.scrollHeight - (offset.bottom || 0) - ARRIVED_STATE_THRESHOLD_PIXELS;\n\t\t/**\n\t\t* reverse columns and rows behave exactly the other way around,\n\t\t* bottom is treated as top and top is treated as the negative version of bottom\n\t\t*/\n\t\tif (display === \"flex\" && flexDirection === \"column-reverse\") {\n\t\t\tarrivedState.top = bottom;\n\t\t\tarrivedState.bottom = top;\n\t\t} else {\n\t\t\tarrivedState.top = top;\n\t\t\tarrivedState.bottom = bottom;\n\t\t}\n\t\tinternalY.value = scrollTop;\n\t};\n\tconst onScrollHandler = (e) => {\n\t\tvar _documentElement;\n\t\tif (!window$1) return;\n\t\tsetArrivedState((_documentElement = e.target.documentElement) !== null && _documentElement !== void 0 ? _documentElement : e.target);\n\t\tisScrolling.value = true;\n\t\tonScrollEndDebounced(e);\n\t\tonScroll(e);\n\t};\n\tuseEventListener(element, \"scroll\", throttle ? useThrottleFn(onScrollHandler, throttle, true, false) : onScrollHandler, eventListenerOptions);\n\ttryOnMounted(() => {\n\t\ttry {\n\t\t\tconst _element = toValue(element);\n\t\t\tif (!_element) return;\n\t\t\tsetArrivedState(_element);\n\t\t} catch (e) {\n\t\t\tonError(e);\n\t\t}\n\t});\n\tif ((observe === null || observe === void 0 ? void 0 : observe.mutation) && element != null && element !== window$1 && element !== document) useMutationObserver(element, () => {\n\t\tconst _element = toValue(element);\n\t\tif (!_element) return;\n\t\tsetArrivedState(_element);\n\t}, {\n\t\tattributes: true,\n\t\tchildList: true,\n\t\tsubtree: true\n\t});\n\tuseEventListener(element, \"scrollend\", onScrollEnd, eventListenerOptions);\n\treturn {\n\t\tx,\n\t\ty,\n\t\tisScrolling,\n\t\tarrivedState,\n\t\tdirections,\n\t\tmeasure() {\n\t\t\tconst _element = toValue(element);\n\t\t\tif (window$1 && _element) setArrivedState(_element);\n\t\t}\n\t};\n}\n\n//#endregion\n//#region useInfiniteScroll/index.ts\n/**\n* Reactive infinite scroll.\n*\n* @see https://vueuse.org/useInfiniteScroll\n*/\nfunction useInfiniteScroll(element, onLoadMore, options = {}) {\n\tvar _options$distance;\n\tconst { direction = \"bottom\", interval = 100, canLoadMore = () => true } = options;\n\tconst state = reactive(useScroll(element, {\n\t\t...options,\n\t\toffset: {\n\t\t\t[direction]: (_options$distance = options.distance) !== null && _options$distance !== void 0 ? _options$distance : 0,\n\t\t\t...options.offset\n\t\t}\n\t}));\n\tconst promise = ref();\n\tconst isLoading = computed(() => !!promise.value);\n\tconst observedElement = computed(() => {\n\t\treturn resolveElement(toValue(element));\n\t});\n\tconst isElementVisible = useElementVisibility(observedElement);\n\tfunction checkAndLoad() {\n\t\tstate.measure();\n\t\tif (!observedElement.value || !isElementVisible.value || !canLoadMore(observedElement.value)) return;\n\t\tconst { scrollHeight, clientHeight, scrollWidth, clientWidth } = observedElement.value;\n\t\tconst isNarrower = direction === \"bottom\" || direction === \"top\" ? scrollHeight <= clientHeight : scrollWidth <= clientWidth;\n\t\tif (state.arrivedState[direction] || isNarrower) {\n\t\t\tif (!promise.value) promise.value = Promise.all([onLoadMore(state), new Promise((resolve) => setTimeout(resolve, interval))]).finally(() => {\n\t\t\t\tpromise.value = null;\n\t\t\t\tnextTick(() => checkAndLoad());\n\t\t\t});\n\t\t}\n\t}\n\ttryOnUnmounted(watch(() => [state.arrivedState[direction], isElementVisible.value], checkAndLoad, { immediate: true }));\n\treturn {\n\t\tisLoading,\n\t\treset() {\n\t\t\tnextTick(() => checkAndLoad());\n\t\t}\n\t};\n}\n\n//#endregion\n//#region useKeyModifier/index.ts\nconst defaultEvents = [\n\t\"mousedown\",\n\t\"mouseup\",\n\t\"keydown\",\n\t\"keyup\"\n];\n/* @__NO_SIDE_EFFECTS__ */\nfunction useKeyModifier(modifier, options = {}) {\n\tconst { events: events$1 = defaultEvents, document: document$1 = defaultDocument, initial = null } = options;\n\tconst state = shallowRef(initial);\n\tif (document$1) events$1.forEach((listenerEvent) => {\n\t\tuseEventListener(document$1, listenerEvent, (evt) => {\n\t\t\tif (typeof evt.getModifierState === \"function\") state.value = evt.getModifierState(modifier);\n\t\t}, { passive: true });\n\t});\n\treturn state;\n}\n\n//#endregion\n//#region useLocalStorage/index.ts\n/**\n* Reactive LocalStorage.\n*\n* @see https://vueuse.org/useLocalStorage\n* @param key\n* @param initialValue\n* @param options\n*/\nfunction useLocalStorage(key, initialValue, options = {}) {\n\tconst { window: window$1 = defaultWindow } = options;\n\treturn useStorage(key, initialValue, window$1 === null || window$1 === void 0 ? void 0 : window$1.localStorage, options);\n}\n\n//#endregion\n//#region useMagicKeys/aliasMap.ts\nconst DefaultMagicKeysAliasMap = {\n\tctrl: \"control\",\n\tcommand: \"meta\",\n\tcmd: \"meta\",\n\toption: \"alt\",\n\tup: \"arrowup\",\n\tdown: \"arrowdown\",\n\tleft: \"arrowleft\",\n\tright: \"arrowright\"\n};\n\n//#endregion\n//#region useMagicKeys/index.ts\nfunction useMagicKeys(options = {}) {\n\tconst { reactive: useReactive = false, target = defaultWindow, aliasMap = DefaultMagicKeysAliasMap, passive = true, onEventFired = noop } = options;\n\tconst current = reactive(/* @__PURE__ */ new Set());\n\tconst obj = {\n\t\ttoJSON() {\n\t\t\treturn {};\n\t\t},\n\t\tcurrent\n\t};\n\tconst refs = useReactive ? reactive(obj) : obj;\n\tconst metaDeps = /* @__PURE__ */ new Set();\n\tconst depsMap = new Map([\n\t\t[\"Meta\", metaDeps],\n\t\t[\"Shift\", /* @__PURE__ */ new Set()],\n\t\t[\"Alt\", /* @__PURE__ */ new Set()]\n\t]);\n\tconst usedKeys = /* @__PURE__ */ new Set();\n\tfunction setRefs(key, value) {\n\t\tif (key in refs) if (useReactive) refs[key] = value;\n\t\telse refs[key].value = value;\n\t}\n\tfunction reset() {\n\t\tcurrent.clear();\n\t\tfor (const key of usedKeys) setRefs(key, false);\n\t}\n\tfunction updateDeps(value, e, keys$1) {\n\t\tif (!value || typeof e.getModifierState !== \"function\") return;\n\t\tfor (const [modifier, depsSet] of depsMap) if (e.getModifierState(modifier)) {\n\t\t\tkeys$1.forEach((key) => depsSet.add(key));\n\t\t\tbreak;\n\t\t}\n\t}\n\tfunction clearDeps(value, key) {\n\t\tif (value) return;\n\t\tconst depsMapKey = `${key[0].toUpperCase()}${key.slice(1)}`;\n\t\tconst deps = depsMap.get(depsMapKey);\n\t\tif (![\"shift\", \"alt\"].includes(key) || !deps) return;\n\t\tconst depsArray = Array.from(deps);\n\t\tconst depsIndex = depsArray.indexOf(key);\n\t\tdepsArray.forEach((key$1, index) => {\n\t\t\tif (index >= depsIndex) {\n\t\t\t\tcurrent.delete(key$1);\n\t\t\t\tsetRefs(key$1, false);\n\t\t\t}\n\t\t});\n\t\tdeps.clear();\n\t}\n\tfunction updateRefs(e, value) {\n\t\tvar _e$key, _e$code;\n\t\tconst key = (_e$key = e.key) === null || _e$key === void 0 ? void 0 : _e$key.toLowerCase();\n\t\tconst values = [(_e$code = e.code) === null || _e$code === void 0 ? void 0 : _e$code.toLowerCase(), key].filter(Boolean);\n\t\tif (key) if (value) current.add(key);\n\t\telse current.delete(key);\n\t\tfor (const key$1 of values) {\n\t\t\tusedKeys.add(key$1);\n\t\t\tsetRefs(key$1, value);\n\t\t}\n\t\tupdateDeps(value, e, [...current, ...values]);\n\t\tclearDeps(value, key);\n\t\tif (key === \"meta\" && !value) {\n\t\t\tmetaDeps.forEach((key$1) => {\n\t\t\t\tcurrent.delete(key$1);\n\t\t\t\tsetRefs(key$1, false);\n\t\t\t});\n\t\t\tmetaDeps.clear();\n\t\t}\n\t}\n\tuseEventListener(target, \"keydown\", (e) => {\n\t\tupdateRefs(e, true);\n\t\treturn onEventFired(e);\n\t}, { passive });\n\tuseEventListener(target, \"keyup\", (e) => {\n\t\tupdateRefs(e, false);\n\t\treturn onEventFired(e);\n\t}, { passive });\n\tuseEventListener(\"blur\", reset, { passive });\n\tuseEventListener(\"focus\", reset, { passive });\n\tconst proxy = new Proxy(refs, { get(target$1, prop, rec) {\n\t\tif (typeof prop !== \"string\") return Reflect.get(target$1, prop, rec);\n\t\tprop = prop.toLowerCase();\n\t\tif (prop in aliasMap) prop = aliasMap[prop];\n\t\tif (!(prop in refs)) if (/[+_-]/.test(prop)) {\n\t\t\tconst keys$1 = prop.split(/[+_-]/g).map((i) => i.trim());\n\t\t\trefs[prop] = computed(() => keys$1.map((key) => toValue(proxy[key])).every(Boolean));\n\t\t} else refs[prop] = shallowRef(false);\n\t\tconst r = Reflect.get(target$1, prop, rec);\n\t\treturn useReactive ? toValue(r) : r;\n\t} });\n\treturn proxy;\n}\n\n//#endregion\n//#region useMediaControls/index.ts\n/**\n* Automatically check if the ref exists and if it does run the cb fn\n*/\nfunction usingElRef(source, cb) {\n\tif (toValue(source)) cb(toValue(source));\n}\n/**\n* Converts a TimeRange object to an array\n*/\nfunction timeRangeToArray(timeRanges) {\n\tlet ranges = [];\n\tfor (let i = 0; i < timeRanges.length; ++i) ranges = [...ranges, [timeRanges.start(i), timeRanges.end(i)]];\n\treturn ranges;\n}\n/**\n* Converts a TextTrackList object to an array of `UseMediaTextTrack`\n*/\nfunction tracksToArray(tracks) {\n\treturn Array.from(tracks).map(({ label, kind, language, mode, activeCues, cues, inBandMetadataTrackDispatchType }, id) => ({\n\t\tid,\n\t\tlabel,\n\t\tkind,\n\t\tlanguage,\n\t\tmode,\n\t\tactiveCues,\n\t\tcues,\n\t\tinBandMetadataTrackDispatchType\n\t}));\n}\nconst defaultOptions = {\n\tsrc: \"\",\n\ttracks: []\n};\nfunction useMediaControls(target, options = {}) {\n\ttarget = toRef(target);\n\toptions = {\n\t\t...defaultOptions,\n\t\t...options\n\t};\n\tconst { document: document$1 = defaultDocument } = options;\n\tconst listenerOptions = { passive: true };\n\tconst currentTime = shallowRef(0);\n\tconst duration = shallowRef(0);\n\tconst seeking = shallowRef(false);\n\tconst volume = shallowRef(1);\n\tconst waiting = shallowRef(false);\n\tconst ended = shallowRef(false);\n\tconst playing = shallowRef(false);\n\tconst rate = shallowRef(1);\n\tconst stalled = shallowRef(false);\n\tconst buffered = ref([]);\n\tconst tracks = ref([]);\n\tconst selectedTrack = shallowRef(-1);\n\tconst isPictureInPicture = shallowRef(false);\n\tconst muted = shallowRef(false);\n\tconst supportsPictureInPicture = document$1 && \"pictureInPictureEnabled\" in document$1;\n\tconst sourceErrorEvent = createEventHook();\n\tconst playbackErrorEvent = createEventHook();\n\t/**\n\t* Disables the specified track. If no track is specified then\n\t* all tracks will be disabled\n\t*\n\t* @param track The id of the track to disable\n\t*/\n\tconst disableTrack = (track) => {\n\t\tusingElRef(target, (el) => {\n\t\t\tif (track) {\n\t\t\t\tconst id = typeof track === \"number\" ? track : track.id;\n\t\t\t\tel.textTracks[id].mode = \"disabled\";\n\t\t\t} else for (let i = 0; i < el.textTracks.length; ++i) el.textTracks[i].mode = \"disabled\";\n\t\t\tselectedTrack.value = -1;\n\t\t});\n\t};\n\t/**\n\t* Enables the specified track and disables the\n\t* other tracks unless otherwise specified\n\t*\n\t* @param track The track of the id of the track to enable\n\t* @param disableTracks Disable all other tracks\n\t*/\n\tconst enableTrack = (track, disableTracks = true) => {\n\t\tusingElRef(target, (el) => {\n\t\t\tconst id = typeof track === \"number\" ? track : track.id;\n\t\t\tif (disableTracks) disableTrack();\n\t\t\tel.textTracks[id].mode = \"showing\";\n\t\t\tselectedTrack.value = id;\n\t\t});\n\t};\n\t/**\n\t* Toggle picture in picture mode for the player.\n\t*/\n\tconst togglePictureInPicture = () => {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tusingElRef(target, async (el) => {\n\t\t\t\tif (supportsPictureInPicture) if (!isPictureInPicture.value) el.requestPictureInPicture().then(resolve).catch(reject);\n\t\t\t\telse document$1.exitPictureInPicture().then(resolve).catch(reject);\n\t\t\t});\n\t\t});\n\t};\n\t/**\n\t* This will automatically inject sources to the media element. The sources will be\n\t* appended as children to the media element as `<source>` elements.\n\t*/\n\twatchEffect(() => {\n\t\tif (!document$1) return;\n\t\tconst el = toValue(target);\n\t\tif (!el) return;\n\t\tconst src = toValue(options.src);\n\t\tlet sources = [];\n\t\tif (!src) return;\n\t\tif (typeof src === \"string\") sources = [{ src }];\n\t\telse if (Array.isArray(src)) sources = src;\n\t\telse if (isObject(src)) sources = [src];\n\t\tel.querySelectorAll(\"source\").forEach((e) => {\n\t\t\te.remove();\n\t\t});\n\t\tsources.forEach(({ src: src$1, type, media }) => {\n\t\t\tconst source = document$1.createElement(\"source\");\n\t\t\tsource.setAttribute(\"src\", src$1);\n\t\t\tsource.setAttribute(\"type\", type || \"\");\n\t\t\tsource.setAttribute(\"media\", media || \"\");\n\t\t\tuseEventListener(source, \"error\", sourceErrorEvent.trigger, listenerOptions);\n\t\t\tel.appendChild(source);\n\t\t});\n\t\tel.load();\n\t});\n\t/**\n\t* Apply composable state to the element, also when element is changed\n\t*/\n\twatch([target, volume], () => {\n\t\tconst el = toValue(target);\n\t\tif (!el) return;\n\t\tel.volume = volume.value;\n\t});\n\twatch([target, muted], () => {\n\t\tconst el = toValue(target);\n\t\tif (!el) return;\n\t\tel.muted = muted.value;\n\t});\n\twatch([target, rate], () => {\n\t\tconst el = toValue(target);\n\t\tif (!el) return;\n\t\tel.playbackRate = rate.value;\n\t});\n\t/**\n\t* Load Tracks\n\t*/\n\twatchEffect(() => {\n\t\tif (!document$1) return;\n\t\tconst textTracks = toValue(options.tracks);\n\t\tconst el = toValue(target);\n\t\tif (!textTracks || !textTracks.length || !el) return;\n\t\t/**\n\t\t* The MediaAPI provides an API for adding text tracks, but they don't currently\n\t\t* have an API for removing text tracks, so instead we will just create and remove\n\t\t* the tracks manually using the HTML api.\n\t\t*/\n\t\tel.querySelectorAll(\"track\").forEach((e) => e.remove());\n\t\ttextTracks.forEach(({ default: isDefault, kind, label, src, srcLang }, i) => {\n\t\t\tconst track = document$1.createElement(\"track\");\n\t\t\ttrack.default = isDefault || false;\n\t\t\ttrack.kind = kind;\n\t\t\ttrack.label = label;\n\t\t\ttrack.src = src;\n\t\t\ttrack.srclang = srcLang;\n\t\t\tif (track.default) selectedTrack.value = i;\n\t\t\tel.appendChild(track);\n\t\t});\n\t});\n\t/**\n\t* This will allow us to update the current time from the timeupdate event\n\t* without setting the medias current position, but if the user changes the\n\t* current time via the ref, then the media will seek.\n\t*\n\t* If we did not use an ignorable watch, then the current time update from\n\t* the timeupdate event would cause the media to stutter.\n\t*/\n\tconst { ignoreUpdates: ignoreCurrentTimeUpdates } = watchIgnorable(currentTime, (time) => {\n\t\tconst el = toValue(target);\n\t\tif (!el) return;\n\t\tel.currentTime = time;\n\t});\n\t/**\n\t* Using an ignorable watch so we can control the play state using a ref and not\n\t* a function\n\t*/\n\tconst { ignoreUpdates: ignorePlayingUpdates } = watchIgnorable(playing, (isPlaying) => {\n\t\tconst el = toValue(target);\n\t\tif (!el) return;\n\t\tif (isPlaying) el.play().catch((e) => {\n\t\t\tplaybackErrorEvent.trigger(e);\n\t\t\tthrow e;\n\t\t});\n\t\telse el.pause();\n\t});\n\tuseEventListener(target, \"timeupdate\", () => ignoreCurrentTimeUpdates(() => currentTime.value = toValue(target).currentTime), listenerOptions);\n\tuseEventListener(target, \"durationchange\", () => duration.value = toValue(target).duration, listenerOptions);\n\tuseEventListener(target, \"progress\", () => buffered.value = timeRangeToArray(toValue(target).buffered), listenerOptions);\n\tuseEventListener(target, \"seeking\", () => seeking.value = true, listenerOptions);\n\tuseEventListener(target, \"seeked\", () => seeking.value = false, listenerOptions);\n\tuseEventListener(target, [\"waiting\", \"loadstart\"], () => {\n\t\twaiting.value = true;\n\t\tignorePlayingUpdates(() => playing.value = false);\n\t}, listenerOptions);\n\tuseEventListener(target, \"loadeddata\", () => waiting.value = false, listenerOptions);\n\tuseEventListener(target, \"playing\", () => {\n\t\twaiting.value = false;\n\t\tended.value = false;\n\t\tignorePlayingUpdates(() => playing.value = true);\n\t}, listenerOptions);\n\tuseEventListener(target, \"ratechange\", () => rate.value = toValue(target).playbackRate, listenerOptions);\n\tuseEventListener(target, \"stalled\", () => stalled.value = true, listenerOptions);\n\tuseEventListener(target, \"ended\", () => ended.value = true, listenerOptions);\n\tuseEventListener(target, \"pause\", () => ignorePlayingUpdates(() => playing.value = false), listenerOptions);\n\tuseEventListener(target, \"play\", () => ignorePlayingUpdates(() => playing.value = true), listenerOptions);\n\tuseEventListener(target, \"enterpictureinpicture\", () => isPictureInPicture.value = true, listenerOptions);\n\tuseEventListener(target, \"leavepictureinpicture\", () => isPictureInPicture.value = false, listenerOptions);\n\tuseEventListener(target, \"volumechange\", () => {\n\t\tconst el = toValue(target);\n\t\tif (!el) return;\n\t\tvolume.value = el.volume;\n\t\tmuted.value = el.muted;\n\t}, listenerOptions);\n\t/**\n\t* The following listeners need to listen to a nested\n\t* object on the target, so we will have to use a nested\n\t* watch and manually remove the listeners\n\t*/\n\tconst listeners = [];\n\tconst stop = watch([target], () => {\n\t\tconst el = toValue(target);\n\t\tif (!el) return;\n\t\tstop();\n\t\tlisteners[0] = useEventListener(el.textTracks, \"addtrack\", () => tracks.value = tracksToArray(el.textTracks), listenerOptions);\n\t\tlisteners[1] = useEventListener(el.textTracks, \"removetrack\", () => tracks.value = tracksToArray(el.textTracks), listenerOptions);\n\t\tlisteners[2] = useEventListener(el.textTracks, \"change\", () => tracks.value = tracksToArray(el.textTracks), listenerOptions);\n\t});\n\ttryOnScopeDispose(() => listeners.forEach((listener) => listener()));\n\treturn {\n\t\tcurrentTime,\n\t\tduration,\n\t\twaiting,\n\t\tseeking,\n\t\tended,\n\t\tstalled,\n\t\tbuffered,\n\t\tplaying,\n\t\trate,\n\t\tvolume,\n\t\tmuted,\n\t\ttracks,\n\t\tselectedTrack,\n\t\tenableTrack,\n\t\tdisableTrack,\n\t\tsupportsPictureInPicture,\n\t\ttogglePictureInPicture,\n\t\tisPictureInPicture,\n\t\tonSourceError: sourceErrorEvent.on,\n\t\tonPlaybackError: playbackErrorEvent.on\n\t};\n}\n\n//#endregion\n//#region useMemoize/index.ts\n/**\n* Reactive function result cache based on arguments\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useMemoize(resolver, options) {\n\tconst initCache = () => {\n\t\tif (options === null || options === void 0 ? void 0 : options.cache) return shallowReactive(options.cache);\n\t\treturn shallowReactive(/* @__PURE__ */ new Map());\n\t};\n\tconst cache = initCache();\n\t/**\n\t* Generate key from args\n\t*/\n\tconst generateKey = (...args) => (options === null || options === void 0 ? void 0 : options.getKey) ? options.getKey(...args) : JSON.stringify(args);\n\t/**\n\t* Load data and save in cache\n\t*/\n\tconst _loadData = (key, ...args) => {\n\t\tcache.set(key, resolver(...args));\n\t\treturn cache.get(key);\n\t};\n\tconst loadData = (...args) => _loadData(generateKey(...args), ...args);\n\t/**\n\t* Delete key from cache\n\t*/\n\tconst deleteData = (...args) => {\n\t\tcache.delete(generateKey(...args));\n\t};\n\t/**\n\t* Clear cached data\n\t*/\n\tconst clearData = () => {\n\t\tcache.clear();\n\t};\n\tconst memoized = (...args) => {\n\t\tconst key = generateKey(...args);\n\t\tif (cache.has(key)) return cache.get(key);\n\t\treturn _loadData(key, ...args);\n\t};\n\tmemoized.load = loadData;\n\tmemoized.delete = deleteData;\n\tmemoized.clear = clearData;\n\tmemoized.generateKey = generateKey;\n\tmemoized.cache = cache;\n\treturn memoized;\n}\n\n//#endregion\n//#region useMemory/index.ts\n/**\n* Reactive Memory Info.\n*\n* @see https://vueuse.org/useMemory\n* @param options\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useMemory(options = {}) {\n\tconst memory = ref();\n\tconst isSupported = /* @__PURE__ */ useSupported(() => typeof performance !== \"undefined\" && \"memory\" in performance);\n\tif (isSupported.value) {\n\t\tconst { interval = 1e3 } = options;\n\t\tuseIntervalFn(() => {\n\t\t\tmemory.value = performance.memory;\n\t\t}, interval, {\n\t\t\timmediate: options.immediate,\n\t\t\timmediateCallback: options.immediateCallback\n\t\t});\n\t}\n\treturn {\n\t\tisSupported,\n\t\tmemory\n\t};\n}\n\n//#endregion\n//#region useMouse/index.ts\nconst UseMouseBuiltinExtractors = {\n\tpage: (event) => [event.pageX, event.pageY],\n\tclient: (event) => [event.clientX, event.clientY],\n\tscreen: (event) => [event.screenX, event.screenY],\n\tmovement: (event) => event instanceof MouseEvent ? [event.movementX, event.movementY] : null\n};\n/**\n* Reactive mouse position.\n*\n* @see https://vueuse.org/useMouse\n* @param options\n*/\nfunction useMouse(options = {}) {\n\tconst { type = \"page\", touch = true, resetOnTouchEnds = false, initialValue = {\n\t\tx: 0,\n\t\ty: 0\n\t}, window: window$1 = defaultWindow, target = window$1, scroll = true, eventFilter } = options;\n\tlet _prevMouseEvent = null;\n\tlet _prevScrollX = 0;\n\tlet _prevScrollY = 0;\n\tconst x = shallowRef(initialValue.x);\n\tconst y = shallowRef(initialValue.y);\n\tconst sourceType = shallowRef(null);\n\tconst extractor = typeof type === \"function\" ? type : UseMouseBuiltinExtractors[type];\n\tconst mouseHandler = (event) => {\n\t\tconst result = extractor(event);\n\t\t_prevMouseEvent = event;\n\t\tif (result) {\n\t\t\t[x.value, y.value] = result;\n\t\t\tsourceType.value = \"mouse\";\n\t\t}\n\t\tif (window$1) {\n\t\t\t_prevScrollX = window$1.scrollX;\n\t\t\t_prevScrollY = window$1.scrollY;\n\t\t}\n\t};\n\tconst touchHandler = (event) => {\n\t\tif (event.touches.length > 0) {\n\t\t\tconst result = extractor(event.touches[0]);\n\t\t\tif (result) {\n\t\t\t\t[x.value, y.value] = result;\n\t\t\t\tsourceType.value = \"touch\";\n\t\t\t}\n\t\t}\n\t};\n\tconst scrollHandler = () => {\n\t\tif (!_prevMouseEvent || !window$1) return;\n\t\tconst pos = extractor(_prevMouseEvent);\n\t\tif (_prevMouseEvent instanceof MouseEvent && pos) {\n\t\t\tx.value = pos[0] + window$1.scrollX - _prevScrollX;\n\t\t\ty.value = pos[1] + window$1.scrollY - _prevScrollY;\n\t\t}\n\t};\n\tconst reset = () => {\n\t\tx.value = initialValue.x;\n\t\ty.value = initialValue.y;\n\t};\n\tconst mouseHandlerWrapper = eventFilter ? (event) => eventFilter(() => mouseHandler(event), {}) : (event) => mouseHandler(event);\n\tconst touchHandlerWrapper = eventFilter ? (event) => eventFilter(() => touchHandler(event), {}) : (event) => touchHandler(event);\n\tconst scrollHandlerWrapper = eventFilter ? () => eventFilter(() => scrollHandler(), {}) : () => scrollHandler();\n\tif (target) {\n\t\tconst listenerOptions = { passive: true };\n\t\tuseEventListener(target, [\"mousemove\", \"dragover\"], mouseHandlerWrapper, listenerOptions);\n\t\tif (touch && type !== \"movement\") {\n\t\t\tuseEventListener(target, [\"touchstart\", \"touchmove\"], touchHandlerWrapper, listenerOptions);\n\t\t\tif (resetOnTouchEnds) useEventListener(target, \"touchend\", reset, listenerOptions);\n\t\t}\n\t\tif (scroll && type === \"page\") useEventListener(window$1, \"scroll\", scrollHandlerWrapper, listenerOptions);\n\t}\n\treturn {\n\t\tx,\n\t\ty,\n\t\tsourceType\n\t};\n}\n\n//#endregion\n//#region useMouseInElement/index.ts\n/**\n* Reactive mouse position related to an element.\n*\n* @see https://vueuse.org/useMouseInElement\n* @param target\n* @param options\n*/\nfunction useMouseInElement(target, options = {}) {\n\tconst { windowResize = true, windowScroll = true, handleOutside = true, window: window$1 = defaultWindow } = options;\n\tconst type = options.type || \"page\";\n\tconst { x, y, sourceType } = useMouse(options);\n\tconst targetRef = shallowRef(target !== null && target !== void 0 ? target : window$1 === null || window$1 === void 0 ? void 0 : window$1.document.body);\n\tconst elementX = shallowRef(0);\n\tconst elementY = shallowRef(0);\n\tconst elementPositionX = shallowRef(0);\n\tconst elementPositionY = shallowRef(0);\n\tconst elementHeight = shallowRef(0);\n\tconst elementWidth = shallowRef(0);\n\tconst isOutside = shallowRef(true);\n\tfunction update() {\n\t\tif (!window$1) return;\n\t\tconst el = unrefElement(targetRef);\n\t\tif (!el || !(el instanceof Element)) return;\n\t\tconst { left, top, width, height } = el.getBoundingClientRect();\n\t\telementPositionX.value = left + (type === \"page\" ? window$1.pageXOffset : 0);\n\t\telementPositionY.value = top + (type === \"page\" ? window$1.pageYOffset : 0);\n\t\telementHeight.value = height;\n\t\telementWidth.value = width;\n\t\tconst elX = x.value - elementPositionX.value;\n\t\tconst elY = y.value - elementPositionY.value;\n\t\tisOutside.value = width === 0 || height === 0 || elX < 0 || elY < 0 || elX > width || elY > height;\n\t\tif (handleOutside || !isOutside.value) {\n\t\t\telementX.value = elX;\n\t\t\telementY.value = elY;\n\t\t}\n\t}\n\tconst stopFnList = [];\n\tfunction stop() {\n\t\tstopFnList.forEach((fn) => fn());\n\t\tstopFnList.length = 0;\n\t}\n\ttryOnMounted(() => {\n\t\tupdate();\n\t});\n\tif (window$1) {\n\t\tconst { stop: stopResizeObserver } = useResizeObserver(targetRef, update);\n\t\tconst { stop: stopMutationObserver } = useMutationObserver(targetRef, update, { attributeFilter: [\"style\", \"class\"] });\n\t\tconst stopWatch = watch([\n\t\t\ttargetRef,\n\t\t\tx,\n\t\t\ty\n\t\t], update);\n\t\tstopFnList.push(stopResizeObserver, stopMutationObserver, stopWatch);\n\t\tuseEventListener(document, \"mouseleave\", () => isOutside.value = true, { passive: true });\n\t\tif (windowScroll) stopFnList.push(useEventListener(\"scroll\", update, {\n\t\t\tcapture: true,\n\t\t\tpassive: true\n\t\t}));\n\t\tif (windowResize) stopFnList.push(useEventListener(\"resize\", update, { passive: true }));\n\t}\n\treturn {\n\t\tx,\n\t\ty,\n\t\tsourceType,\n\t\telementX,\n\t\telementY,\n\t\telementPositionX,\n\t\telementPositionY,\n\t\telementHeight,\n\t\telementWidth,\n\t\tisOutside,\n\t\tstop\n\t};\n}\n\n//#endregion\n//#region useMousePressed/index.ts\n/**\n* Reactive mouse pressing state.\n*\n* @see https://vueuse.org/useMousePressed\n* @param options\n*/\nfunction useMousePressed(options = {}) {\n\tconst { touch = true, drag = true, capture = false, initialValue = false, window: window$1 = defaultWindow } = options;\n\tconst pressed = shallowRef(initialValue);\n\tconst sourceType = shallowRef(null);\n\tif (!window$1) return {\n\t\tpressed,\n\t\tsourceType\n\t};\n\tconst onPressed = (srcType) => (event) => {\n\t\tvar _options$onPressed;\n\t\tpressed.value = true;\n\t\tsourceType.value = srcType;\n\t\t(_options$onPressed = options.onPressed) === null || _options$onPressed === void 0 || _options$onPressed.call(options, event);\n\t};\n\tconst onReleased = (event) => {\n\t\tvar _options$onReleased;\n\t\tpressed.value = false;\n\t\tsourceType.value = null;\n\t\t(_options$onReleased = options.onReleased) === null || _options$onReleased === void 0 || _options$onReleased.call(options, event);\n\t};\n\tconst target = computed(() => unrefElement(options.target) || window$1);\n\tconst listenerOptions = {\n\t\tpassive: true,\n\t\tcapture\n\t};\n\tuseEventListener(target, \"mousedown\", onPressed(\"mouse\"), listenerOptions);\n\tuseEventListener(window$1, \"mouseleave\", onReleased, listenerOptions);\n\tuseEventListener(window$1, \"mouseup\", onReleased, listenerOptions);\n\tif (drag) {\n\t\tuseEventListener(target, \"dragstart\", onPressed(\"mouse\"), listenerOptions);\n\t\tuseEventListener(window$1, \"drop\", onReleased, listenerOptions);\n\t\tuseEventListener(window$1, \"dragend\", onReleased, listenerOptions);\n\t}\n\tif (touch) {\n\t\tuseEventListener(target, \"touchstart\", onPressed(\"touch\"), listenerOptions);\n\t\tuseEventListener(window$1, \"touchend\", onReleased, listenerOptions);\n\t\tuseEventListener(window$1, \"touchcancel\", onReleased, listenerOptions);\n\t}\n\treturn {\n\t\tpressed,\n\t\tsourceType\n\t};\n}\n\n//#endregion\n//#region useNavigatorLanguage/index.ts\n/**\n*\n* Reactive useNavigatorLanguage\n*\n* Detects the currently selected user language and returns a reactive language\n* @see https://vueuse.org/useNavigatorLanguage\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useNavigatorLanguage(options = {}) {\n\tconst { window: window$1 = defaultWindow } = options;\n\tconst navigator$1 = window$1 === null || window$1 === void 0 ? void 0 : window$1.navigator;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => navigator$1 && \"language\" in navigator$1);\n\tconst language = shallowRef(navigator$1 === null || navigator$1 === void 0 ? void 0 : navigator$1.language);\n\tuseEventListener(window$1, \"languagechange\", () => {\n\t\tif (navigator$1) language.value = navigator$1.language;\n\t}, { passive: true });\n\treturn {\n\t\tisSupported,\n\t\tlanguage\n\t};\n}\n\n//#endregion\n//#region useNetwork/index.ts\n/**\n* Reactive Network status.\n*\n* @see https://vueuse.org/useNetwork\n* @param options\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useNetwork(options = {}) {\n\tconst { window: window$1 = defaultWindow } = options;\n\tconst navigator$1 = window$1 === null || window$1 === void 0 ? void 0 : window$1.navigator;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => navigator$1 && \"connection\" in navigator$1);\n\tconst isOnline = shallowRef(true);\n\tconst saveData = shallowRef(false);\n\tconst offlineAt = shallowRef(void 0);\n\tconst onlineAt = shallowRef(void 0);\n\tconst downlink = shallowRef(void 0);\n\tconst downlinkMax = shallowRef(void 0);\n\tconst rtt = shallowRef(void 0);\n\tconst effectiveType = shallowRef(void 0);\n\tconst type = shallowRef(\"unknown\");\n\tconst connection = isSupported.value && navigator$1.connection;\n\tfunction updateNetworkInformation() {\n\t\tif (!navigator$1) return;\n\t\tisOnline.value = navigator$1.onLine;\n\t\tofflineAt.value = isOnline.value ? void 0 : Date.now();\n\t\tonlineAt.value = isOnline.value ? Date.now() : void 0;\n\t\tif (connection) {\n\t\t\tdownlink.value = connection.downlink;\n\t\t\tdownlinkMax.value = connection.downlinkMax;\n\t\t\teffectiveType.value = connection.effectiveType;\n\t\t\trtt.value = connection.rtt;\n\t\t\tsaveData.value = connection.saveData;\n\t\t\ttype.value = connection.type;\n\t\t}\n\t}\n\tconst listenerOptions = { passive: true };\n\tif (window$1) {\n\t\tuseEventListener(window$1, \"offline\", () => {\n\t\t\tisOnline.value = false;\n\t\t\tofflineAt.value = Date.now();\n\t\t}, listenerOptions);\n\t\tuseEventListener(window$1, \"online\", () => {\n\t\t\tisOnline.value = true;\n\t\t\tonlineAt.value = Date.now();\n\t\t}, listenerOptions);\n\t}\n\tif (connection) useEventListener(connection, \"change\", updateNetworkInformation, listenerOptions);\n\tupdateNetworkInformation();\n\treturn {\n\t\tisSupported,\n\t\tisOnline: readonly(isOnline),\n\t\tsaveData: readonly(saveData),\n\t\tofflineAt: readonly(offlineAt),\n\t\tonlineAt: readonly(onlineAt),\n\t\tdownlink: readonly(downlink),\n\t\tdownlinkMax: readonly(downlinkMax),\n\t\teffectiveType: readonly(effectiveType),\n\t\trtt: readonly(rtt),\n\t\ttype: readonly(type)\n\t};\n}\n\n//#endregion\n//#region useNow/index.ts\n/**\n* Reactive current Date instance.\n*\n* @see https://vueuse.org/useNow\n* @param options\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useNow(options = {}) {\n\tconst { controls: exposeControls = false, interval = \"requestAnimationFrame\", immediate = true } = options;\n\tconst now = ref(/* @__PURE__ */ new Date());\n\tconst update = () => now.value = /* @__PURE__ */ new Date();\n\tconst controls = interval === \"requestAnimationFrame\" ? useRafFn(update, { immediate }) : useIntervalFn(update, interval, { immediate });\n\tif (exposeControls) return {\n\t\tnow,\n\t\t...controls\n\t};\n\telse return now;\n}\n\n//#endregion\n//#region useObjectUrl/index.ts\n/**\n* Reactive URL representing an object.\n*\n* @see https://vueuse.org/useObjectUrl\n* @param object\n*/\nfunction useObjectUrl(object) {\n\tconst url = shallowRef();\n\tconst release = () => {\n\t\tif (url.value) URL.revokeObjectURL(url.value);\n\t\turl.value = void 0;\n\t};\n\twatch(() => toValue(object), (newObject) => {\n\t\trelease();\n\t\tif (newObject) url.value = URL.createObjectURL(newObject);\n\t}, { immediate: true });\n\ttryOnScopeDispose(release);\n\treturn readonly(url);\n}\n\n//#endregion\n//#region ../math/useClamp/index.ts\n/**\n* Reactively clamp a value between two other values.\n*\n* @see https://vueuse.org/useClamp\n* @param value number\n* @param min\n* @param max\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useClamp(value, min, max) {\n\tif (typeof value === \"function\" || isReadonly(value)) return computed(() => clamp(toValue(value), toValue(min), toValue(max)));\n\tconst _value = ref(value);\n\treturn computed({\n\t\tget() {\n\t\t\treturn _value.value = clamp(_value.value, toValue(min), toValue(max));\n\t\t},\n\t\tset(value$1) {\n\t\t\t_value.value = clamp(value$1, toValue(min), toValue(max));\n\t\t}\n\t});\n}\n\n//#endregion\n//#region useOffsetPagination/index.ts\nfunction useOffsetPagination(options) {\n\tconst { total = Number.POSITIVE_INFINITY, pageSize = 10, page = 1, onPageChange = noop, onPageSizeChange = noop, onPageCountChange = noop } = options;\n\tconst currentPageSize = useClamp(pageSize, 1, Number.POSITIVE_INFINITY);\n\tconst pageCount = computed(() => Math.max(1, Math.ceil(toValue(total) / toValue(currentPageSize))));\n\tconst currentPage = useClamp(page, 1, pageCount);\n\tconst isFirstPage = computed(() => currentPage.value === 1);\n\tconst isLastPage = computed(() => currentPage.value === pageCount.value);\n\tif (isRef(page)) syncRef(page, currentPage, { direction: isReadonly(page) ? \"ltr\" : \"both\" });\n\tif (isRef(pageSize)) syncRef(pageSize, currentPageSize, { direction: isReadonly(pageSize) ? \"ltr\" : \"both\" });\n\tfunction prev() {\n\t\tcurrentPage.value--;\n\t}\n\tfunction next() {\n\t\tcurrentPage.value++;\n\t}\n\tconst returnValue = {\n\t\tcurrentPage,\n\t\tcurrentPageSize,\n\t\tpageCount,\n\t\tisFirstPage,\n\t\tisLastPage,\n\t\tprev,\n\t\tnext\n\t};\n\twatch(currentPage, () => {\n\t\tonPageChange(reactive(returnValue));\n\t});\n\twatch(currentPageSize, () => {\n\t\tonPageSizeChange(reactive(returnValue));\n\t});\n\twatch(pageCount, () => {\n\t\tonPageCountChange(reactive(returnValue));\n\t});\n\treturn returnValue;\n}\n\n//#endregion\n//#region useOnline/index.ts\n/**\n* Reactive online state.\n*\n* @see https://vueuse.org/useOnline\n* @param options\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useOnline(options = {}) {\n\tconst { isOnline } = useNetwork(options);\n\treturn isOnline;\n}\n\n//#endregion\n//#region usePageLeave/index.ts\n/**\n* Reactive state to show whether mouse leaves the page.\n*\n* @see https://vueuse.org/usePageLeave\n* @param options\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction usePageLeave(options = {}) {\n\tconst { window: window$1 = defaultWindow } = options;\n\tconst isLeft = shallowRef(false);\n\tconst handler = (event) => {\n\t\tif (!window$1) return;\n\t\tevent = event || window$1.event;\n\t\tisLeft.value = !(event.relatedTarget || event.toElement);\n\t};\n\tif (window$1) {\n\t\tconst listenerOptions = { passive: true };\n\t\tuseEventListener(window$1, \"mouseout\", handler, listenerOptions);\n\t\tuseEventListener(window$1.document, \"mouseleave\", handler, listenerOptions);\n\t\tuseEventListener(window$1.document, \"mouseenter\", handler, listenerOptions);\n\t}\n\treturn isLeft;\n}\n\n//#endregion\n//#region useScreenOrientation/index.ts\n/**\n* Reactive screen orientation\n*\n* @see https://vueuse.org/useScreenOrientation\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useScreenOrientation(options = {}) {\n\tconst { window: window$1 = defaultWindow } = options;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => window$1 && \"screen\" in window$1 && \"orientation\" in window$1.screen);\n\tconst screenOrientation = isSupported.value ? window$1.screen.orientation : {};\n\tconst orientation = ref(screenOrientation.type);\n\tconst angle = shallowRef(screenOrientation.angle || 0);\n\tif (isSupported.value) useEventListener(window$1, \"orientationchange\", () => {\n\t\torientation.value = screenOrientation.type;\n\t\tangle.value = screenOrientation.angle;\n\t}, { passive: true });\n\tconst lockOrientation = (type) => {\n\t\tif (isSupported.value && typeof screenOrientation.lock === \"function\") return screenOrientation.lock(type);\n\t\treturn Promise.reject(/* @__PURE__ */ new Error(\"Not supported\"));\n\t};\n\tconst unlockOrientation = () => {\n\t\tif (isSupported.value && typeof screenOrientation.unlock === \"function\") screenOrientation.unlock();\n\t};\n\treturn {\n\t\tisSupported,\n\t\torientation,\n\t\tangle,\n\t\tlockOrientation,\n\t\tunlockOrientation\n\t};\n}\n\n//#endregion\n//#region useParallax/index.ts\n/**\n* Create parallax effect easily. It uses `useDeviceOrientation` and fallback to `useMouse`\n* if orientation is not supported.\n*\n* @param target\n* @param options\n*/\nfunction useParallax(target, options = {}) {\n\tconst { deviceOrientationTiltAdjust = (i) => i, deviceOrientationRollAdjust = (i) => i, mouseTiltAdjust = (i) => i, mouseRollAdjust = (i) => i, window: window$1 = defaultWindow } = options;\n\tconst orientation = reactive(useDeviceOrientation({ window: window$1 }));\n\tconst screenOrientation = reactive(useScreenOrientation({ window: window$1 }));\n\tconst { elementX: x, elementY: y, elementWidth: width, elementHeight: height } = useMouseInElement(target, {\n\t\thandleOutside: false,\n\t\twindow: window$1\n\t});\n\tconst source = computed(() => {\n\t\tif (orientation.isSupported && (orientation.alpha != null && orientation.alpha !== 0 || orientation.gamma != null && orientation.gamma !== 0)) return \"deviceOrientation\";\n\t\treturn \"mouse\";\n\t});\n\treturn {\n\t\troll: computed(() => {\n\t\t\tif (source.value === \"deviceOrientation\") {\n\t\t\t\tlet value;\n\t\t\t\tswitch (screenOrientation.orientation) {\n\t\t\t\t\tcase \"landscape-primary\":\n\t\t\t\t\t\tvalue = orientation.gamma / 90;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"landscape-secondary\":\n\t\t\t\t\t\tvalue = -orientation.gamma / 90;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"portrait-primary\":\n\t\t\t\t\t\tvalue = -orientation.beta / 90;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"portrait-secondary\":\n\t\t\t\t\t\tvalue = orientation.beta / 90;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault: value = -orientation.beta / 90;\n\t\t\t\t}\n\t\t\t\treturn deviceOrientationRollAdjust(value);\n\t\t\t} else return mouseRollAdjust(-(y.value - height.value / 2) / height.value);\n\t\t}),\n\t\ttilt: computed(() => {\n\t\t\tif (source.value === \"deviceOrientation\") {\n\t\t\t\tlet value;\n\t\t\t\tswitch (screenOrientation.orientation) {\n\t\t\t\t\tcase \"landscape-primary\":\n\t\t\t\t\t\tvalue = orientation.beta / 90;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"landscape-secondary\":\n\t\t\t\t\t\tvalue = -orientation.beta / 90;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"portrait-primary\":\n\t\t\t\t\t\tvalue = orientation.gamma / 90;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"portrait-secondary\":\n\t\t\t\t\t\tvalue = -orientation.gamma / 90;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault: value = orientation.gamma / 90;\n\t\t\t\t}\n\t\t\t\treturn deviceOrientationTiltAdjust(value);\n\t\t\t} else return mouseTiltAdjust((x.value - width.value / 2) / width.value);\n\t\t}),\n\t\tsource\n\t};\n}\n\n//#endregion\n//#region useParentElement/index.ts\nfunction useParentElement(element = useCurrentElement()) {\n\tconst parentElement = shallowRef();\n\tconst update = () => {\n\t\tconst el = unrefElement(element);\n\t\tif (el) parentElement.value = el.parentElement;\n\t};\n\ttryOnMounted(update);\n\twatch(() => toValue(element), update);\n\treturn parentElement;\n}\n\n//#endregion\n//#region usePerformanceObserver/index.ts\n/**\n* Observe performance metrics.\n*\n* @see https://vueuse.org/usePerformanceObserver\n* @param options\n*/\nfunction usePerformanceObserver(options, callback) {\n\tconst { window: window$1 = defaultWindow, immediate = true,...performanceOptions } = options;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => window$1 && \"PerformanceObserver\" in window$1);\n\tlet observer;\n\tconst stop = () => {\n\t\tobserver === null || observer === void 0 || observer.disconnect();\n\t};\n\tconst start = () => {\n\t\tif (isSupported.value) {\n\t\t\tstop();\n\t\t\tobserver = new PerformanceObserver(callback);\n\t\t\tobserver.observe(performanceOptions);\n\t\t}\n\t};\n\ttryOnScopeDispose(stop);\n\tif (immediate) start();\n\treturn {\n\t\tisSupported,\n\t\tstart,\n\t\tstop\n\t};\n}\n\n//#endregion\n//#region usePointer/index.ts\nconst defaultState = {\n\tx: 0,\n\ty: 0,\n\tpointerId: 0,\n\tpressure: 0,\n\ttiltX: 0,\n\ttiltY: 0,\n\twidth: 0,\n\theight: 0,\n\ttwist: 0,\n\tpointerType: null\n};\nconst keys = /* @__PURE__ */ Object.keys(defaultState);\n/**\n* Reactive pointer state.\n*\n* @see https://vueuse.org/usePointer\n* @param options\n*/\nfunction usePointer(options = {}) {\n\tconst { target = defaultWindow } = options;\n\tconst isInside = shallowRef(false);\n\tconst state = shallowRef(options.initialValue || {});\n\tObject.assign(state.value, defaultState, state.value);\n\tconst handler = (event) => {\n\t\tisInside.value = true;\n\t\tif (options.pointerTypes && !options.pointerTypes.includes(event.pointerType)) return;\n\t\tstate.value = objectPick(event, keys, false);\n\t};\n\tif (target) {\n\t\tconst listenerOptions = { passive: true };\n\t\tuseEventListener(target, [\n\t\t\t\"pointerdown\",\n\t\t\t\"pointermove\",\n\t\t\t\"pointerup\"\n\t\t], handler, listenerOptions);\n\t\tuseEventListener(target, \"pointerleave\", () => isInside.value = false, listenerOptions);\n\t}\n\treturn {\n\t\t...toRefs(state),\n\t\tisInside\n\t};\n}\n\n//#endregion\n//#region usePointerLock/index.ts\n/**\n* Reactive pointer lock.\n*\n* @see https://vueuse.org/usePointerLock\n* @param target\n* @param options\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction usePointerLock(target, options = {}) {\n\tconst { document: document$1 = defaultDocument } = options;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => document$1 && \"pointerLockElement\" in document$1);\n\tconst element = shallowRef();\n\tconst triggerElement = shallowRef();\n\tlet targetElement;\n\tif (isSupported.value) {\n\t\tconst listenerOptions = { passive: true };\n\t\tuseEventListener(document$1, \"pointerlockchange\", () => {\n\t\t\tvar _pointerLockElement;\n\t\t\tconst currentElement = (_pointerLockElement = document$1.pointerLockElement) !== null && _pointerLockElement !== void 0 ? _pointerLockElement : element.value;\n\t\t\tif (targetElement && currentElement === targetElement) {\n\t\t\t\telement.value = document$1.pointerLockElement;\n\t\t\t\tif (!element.value) targetElement = triggerElement.value = null;\n\t\t\t}\n\t\t}, listenerOptions);\n\t\tuseEventListener(document$1, \"pointerlockerror\", () => {\n\t\t\tvar _pointerLockElement2;\n\t\t\tconst currentElement = (_pointerLockElement2 = document$1.pointerLockElement) !== null && _pointerLockElement2 !== void 0 ? _pointerLockElement2 : element.value;\n\t\t\tif (targetElement && currentElement === targetElement) {\n\t\t\t\tconst action = document$1.pointerLockElement ? \"release\" : \"acquire\";\n\t\t\t\tthrow new Error(`Failed to ${action} pointer lock.`);\n\t\t\t}\n\t\t}, listenerOptions);\n\t}\n\tasync function lock(e) {\n\t\tvar _unrefElement;\n\t\tif (!isSupported.value) throw new Error(\"Pointer Lock API is not supported by your browser.\");\n\t\ttriggerElement.value = e instanceof Event ? e.currentTarget : null;\n\t\ttargetElement = e instanceof Event ? (_unrefElement = unrefElement(target)) !== null && _unrefElement !== void 0 ? _unrefElement : triggerElement.value : unrefElement(e);\n\t\tif (!targetElement) throw new Error(\"Target element undefined.\");\n\t\ttargetElement.requestPointerLock();\n\t\treturn await until(element).toBe(targetElement);\n\t}\n\tasync function unlock() {\n\t\tif (!element.value) return false;\n\t\tdocument$1.exitPointerLock();\n\t\tawait until(element).toBeNull();\n\t\treturn true;\n\t}\n\treturn {\n\t\tisSupported,\n\t\telement,\n\t\ttriggerElement,\n\t\tlock,\n\t\tunlock\n\t};\n}\n\n//#endregion\n//#region usePointerSwipe/index.ts\n/**\n* Reactive swipe detection based on PointerEvents.\n*\n* @see https://vueuse.org/usePointerSwipe\n* @param target\n* @param options\n*/\nfunction usePointerSwipe(target, options = {}) {\n\tconst targetRef = toRef(target);\n\tconst { threshold = 50, onSwipe, onSwipeEnd, onSwipeStart, disableTextSelect = false } = options;\n\tconst posStart = reactive({\n\t\tx: 0,\n\t\ty: 0\n\t});\n\tconst updatePosStart = (x, y) => {\n\t\tposStart.x = x;\n\t\tposStart.y = y;\n\t};\n\tconst posEnd = reactive({\n\t\tx: 0,\n\t\ty: 0\n\t});\n\tconst updatePosEnd = (x, y) => {\n\t\tposEnd.x = x;\n\t\tposEnd.y = y;\n\t};\n\tconst distanceX = computed(() => posStart.x - posEnd.x);\n\tconst distanceY = computed(() => posStart.y - posEnd.y);\n\tconst { max, abs } = Math;\n\tconst isThresholdExceeded = computed(() => max(abs(distanceX.value), abs(distanceY.value)) >= threshold);\n\tconst isSwiping = shallowRef(false);\n\tconst isPointerDown = shallowRef(false);\n\tconst direction = computed(() => {\n\t\tif (!isThresholdExceeded.value) return \"none\";\n\t\tif (abs(distanceX.value) > abs(distanceY.value)) return distanceX.value > 0 ? \"left\" : \"right\";\n\t\telse return distanceY.value > 0 ? \"up\" : \"down\";\n\t});\n\tconst eventIsAllowed = (e) => {\n\t\tvar _ref, _options$pointerTypes, _options$pointerTypes2;\n\t\tconst isReleasingButton = e.buttons === 0;\n\t\tconst isPrimaryButton = e.buttons === 1;\n\t\treturn (_ref = (_options$pointerTypes = (_options$pointerTypes2 = options.pointerTypes) === null || _options$pointerTypes2 === void 0 ? void 0 : _options$pointerTypes2.includes(e.pointerType)) !== null && _options$pointerTypes !== void 0 ? _options$pointerTypes : isReleasingButton || isPrimaryButton) !== null && _ref !== void 0 ? _ref : true;\n\t};\n\tconst listenerOptions = { passive: true };\n\tconst stops = [\n\t\tuseEventListener(target, \"pointerdown\", (e) => {\n\t\t\tif (!eventIsAllowed(e)) return;\n\t\t\tisPointerDown.value = true;\n\t\t\tconst eventTarget = e.target;\n\t\t\teventTarget === null || eventTarget === void 0 || eventTarget.setPointerCapture(e.pointerId);\n\t\t\tconst { clientX: x, clientY: y } = e;\n\t\t\tupdatePosStart(x, y);\n\t\t\tupdatePosEnd(x, y);\n\t\t\tonSwipeStart === null || onSwipeStart === void 0 || onSwipeStart(e);\n\t\t}, listenerOptions),\n\t\tuseEventListener(target, \"pointermove\", (e) => {\n\t\t\tif (!eventIsAllowed(e)) return;\n\t\t\tif (!isPointerDown.value) return;\n\t\t\tconst { clientX: x, clientY: y } = e;\n\t\t\tupdatePosEnd(x, y);\n\t\t\tif (!isSwiping.value && isThresholdExceeded.value) isSwiping.value = true;\n\t\t\tif (isSwiping.value) onSwipe === null || onSwipe === void 0 || onSwipe(e);\n\t\t}, listenerOptions),\n\t\tuseEventListener(target, \"pointerup\", (e) => {\n\t\t\tif (!eventIsAllowed(e)) return;\n\t\t\tif (isSwiping.value) onSwipeEnd === null || onSwipeEnd === void 0 || onSwipeEnd(e, direction.value);\n\t\t\tisPointerDown.value = false;\n\t\t\tisSwiping.value = false;\n\t\t}, listenerOptions)\n\t];\n\ttryOnMounted(() => {\n\t\tvar _targetRef$value;\n\t\t(_targetRef$value = targetRef.value) === null || _targetRef$value === void 0 || (_targetRef$value = _targetRef$value.style) === null || _targetRef$value === void 0 || _targetRef$value.setProperty(\"touch-action\", \"pan-y\");\n\t\tif (disableTextSelect) {\n\t\t\tvar _targetRef$value2, _targetRef$value3, _targetRef$value4;\n\t\t\t(_targetRef$value2 = targetRef.value) === null || _targetRef$value2 === void 0 || (_targetRef$value2 = _targetRef$value2.style) === null || _targetRef$value2 === void 0 || _targetRef$value2.setProperty(\"-webkit-user-select\", \"none\");\n\t\t\t(_targetRef$value3 = targetRef.value) === null || _targetRef$value3 === void 0 || (_targetRef$value3 = _targetRef$value3.style) === null || _targetRef$value3 === void 0 || _targetRef$value3.setProperty(\"-ms-user-select\", \"none\");\n\t\t\t(_targetRef$value4 = targetRef.value) === null || _targetRef$value4 === void 0 || (_targetRef$value4 = _targetRef$value4.style) === null || _targetRef$value4 === void 0 || _targetRef$value4.setProperty(\"user-select\", \"none\");\n\t\t}\n\t});\n\tconst stop = () => stops.forEach((s) => s());\n\treturn {\n\t\tisSwiping: readonly(isSwiping),\n\t\tdirection: readonly(direction),\n\t\tposStart: readonly(posStart),\n\t\tposEnd: readonly(posEnd),\n\t\tdistanceX,\n\t\tdistanceY,\n\t\tstop\n\t};\n}\n\n//#endregion\n//#region usePreferredColorScheme/index.ts\n/**\n* Reactive prefers-color-scheme media query.\n*\n* @see https://vueuse.org/usePreferredColorScheme\n* @param [options]\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction usePreferredColorScheme(options) {\n\tconst isLight = useMediaQuery(\"(prefers-color-scheme: light)\", options);\n\tconst isDark = useMediaQuery(\"(prefers-color-scheme: dark)\", options);\n\treturn computed(() => {\n\t\tif (isDark.value) return \"dark\";\n\t\tif (isLight.value) return \"light\";\n\t\treturn \"no-preference\";\n\t});\n}\n\n//#endregion\n//#region usePreferredContrast/index.ts\n/**\n* Reactive prefers-contrast media query.\n*\n* @see https://vueuse.org/usePreferredContrast\n* @param [options]\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction usePreferredContrast(options) {\n\tconst isMore = useMediaQuery(\"(prefers-contrast: more)\", options);\n\tconst isLess = useMediaQuery(\"(prefers-contrast: less)\", options);\n\tconst isCustom = useMediaQuery(\"(prefers-contrast: custom)\", options);\n\treturn computed(() => {\n\t\tif (isMore.value) return \"more\";\n\t\tif (isLess.value) return \"less\";\n\t\tif (isCustom.value) return \"custom\";\n\t\treturn \"no-preference\";\n\t});\n}\n\n//#endregion\n//#region usePreferredLanguages/index.ts\n/**\n* Reactive Navigator Languages.\n*\n* @see https://vueuse.org/usePreferredLanguages\n* @param options\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction usePreferredLanguages(options = {}) {\n\tconst { window: window$1 = defaultWindow } = options;\n\tif (!window$1) return shallowRef([\"en\"]);\n\tconst navigator$1 = window$1.navigator;\n\tconst value = shallowRef(navigator$1.languages);\n\tuseEventListener(window$1, \"languagechange\", () => {\n\t\tvalue.value = navigator$1.languages;\n\t}, { passive: true });\n\treturn value;\n}\n\n//#endregion\n//#region usePreferredReducedMotion/index.ts\n/**\n* Reactive prefers-reduced-motion media query.\n*\n* @see https://vueuse.org/usePreferredReducedMotion\n* @param [options]\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction usePreferredReducedMotion(options) {\n\tconst isReduced = useMediaQuery(\"(prefers-reduced-motion: reduce)\", options);\n\treturn computed(() => {\n\t\tif (isReduced.value) return \"reduce\";\n\t\treturn \"no-preference\";\n\t});\n}\n\n//#endregion\n//#region usePreferredReducedTransparency/index.ts\n/**\n* Reactive prefers-reduced-transparency media query.\n*\n* @see https://vueuse.org/usePreferredReducedTransparency\n* @param [options]\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction usePreferredReducedTransparency(options) {\n\tconst isReduced = useMediaQuery(\"(prefers-reduced-transparency: reduce)\", options);\n\treturn computed(() => {\n\t\tif (isReduced.value) return \"reduce\";\n\t\treturn \"no-preference\";\n\t});\n}\n\n//#endregion\n//#region usePrevious/index.ts\nfunction usePrevious(value, initialValue) {\n\tconst previous = shallowRef(initialValue);\n\twatch(toRef(value), (_, oldValue) => {\n\t\tprevious.value = oldValue;\n\t}, { flush: \"sync\" });\n\treturn readonly(previous);\n}\n\n//#endregion\n//#region useScreenSafeArea/index.ts\nconst topVarName = \"--vueuse-safe-area-top\";\nconst rightVarName = \"--vueuse-safe-area-right\";\nconst bottomVarName = \"--vueuse-safe-area-bottom\";\nconst leftVarName = \"--vueuse-safe-area-left\";\n/**\n* Reactive `env(safe-area-inset-*)`\n*\n* @see https://vueuse.org/useScreenSafeArea\n*/\nfunction useScreenSafeArea() {\n\tconst top = shallowRef(\"\");\n\tconst right = shallowRef(\"\");\n\tconst bottom = shallowRef(\"\");\n\tconst left = shallowRef(\"\");\n\tif (isClient) {\n\t\tconst topCssVar = useCssVar(topVarName);\n\t\tconst rightCssVar = useCssVar(rightVarName);\n\t\tconst bottomCssVar = useCssVar(bottomVarName);\n\t\tconst leftCssVar = useCssVar(leftVarName);\n\t\ttopCssVar.value = \"env(safe-area-inset-top, 0px)\";\n\t\trightCssVar.value = \"env(safe-area-inset-right, 0px)\";\n\t\tbottomCssVar.value = \"env(safe-area-inset-bottom, 0px)\";\n\t\tleftCssVar.value = \"env(safe-area-inset-left, 0px)\";\n\t\ttryOnMounted(update);\n\t\tuseEventListener(\"resize\", useDebounceFn(update), { passive: true });\n\t}\n\tfunction update() {\n\t\ttop.value = getValue(topVarName);\n\t\tright.value = getValue(rightVarName);\n\t\tbottom.value = getValue(bottomVarName);\n\t\tleft.value = getValue(leftVarName);\n\t}\n\treturn {\n\t\ttop,\n\t\tright,\n\t\tbottom,\n\t\tleft,\n\t\tupdate\n\t};\n}\nfunction getValue(position) {\n\treturn getComputedStyle(document.documentElement).getPropertyValue(position);\n}\n\n//#endregion\n//#region useScriptTag/index.ts\n/**\n* Async script tag loading.\n*\n* @see https://vueuse.org/useScriptTag\n* @param src\n* @param onLoaded\n* @param options\n*/\nfunction useScriptTag(src, onLoaded = noop, options = {}) {\n\tconst { immediate = true, manual = false, type = \"text/javascript\", async = true, crossOrigin, referrerPolicy, noModule, defer, document: document$1 = defaultDocument, attrs = {}, nonce = void 0 } = options;\n\tconst scriptTag = shallowRef(null);\n\tlet _promise = null;\n\t/**\n\t* Load the script specified via `src`.\n\t*\n\t* @param waitForScriptLoad Whether if the Promise should resolve once the \"load\" event is emitted by the <script> attribute, or right after appending it to the DOM.\n\t* @returns Promise<HTMLScriptElement>\n\t*/\n\tconst loadScript = (waitForScriptLoad) => new Promise((resolve, reject) => {\n\t\tconst resolveWithElement = (el$1) => {\n\t\t\tscriptTag.value = el$1;\n\t\t\tresolve(el$1);\n\t\t\treturn el$1;\n\t\t};\n\t\tif (!document$1) {\n\t\t\tresolve(false);\n\t\t\treturn;\n\t\t}\n\t\tlet shouldAppend = false;\n\t\tlet el = document$1.querySelector(`script[src=\"${toValue(src)}\"]`);\n\t\tif (!el) {\n\t\t\tel = document$1.createElement(\"script\");\n\t\t\tel.type = type;\n\t\t\tel.async = async;\n\t\t\tel.src = toValue(src);\n\t\t\tif (defer) el.defer = defer;\n\t\t\tif (crossOrigin) el.crossOrigin = crossOrigin;\n\t\t\tif (noModule) el.noModule = noModule;\n\t\t\tif (referrerPolicy) el.referrerPolicy = referrerPolicy;\n\t\t\tif (nonce) el.nonce = nonce;\n\t\t\tObject.entries(attrs).forEach(([name, value]) => el === null || el === void 0 ? void 0 : el.setAttribute(name, value));\n\t\t\tshouldAppend = true;\n\t\t} else if (el.hasAttribute(\"data-loaded\")) resolveWithElement(el);\n\t\tconst listenerOptions = { passive: true };\n\t\tuseEventListener(el, \"error\", (event) => reject(event), listenerOptions);\n\t\tuseEventListener(el, \"abort\", (event) => reject(event), listenerOptions);\n\t\tuseEventListener(el, \"load\", () => {\n\t\t\tel.setAttribute(\"data-loaded\", \"true\");\n\t\t\tonLoaded(el);\n\t\t\tresolveWithElement(el);\n\t\t}, listenerOptions);\n\t\tif (shouldAppend) el = document$1.head.appendChild(el);\n\t\tif (!waitForScriptLoad) resolveWithElement(el);\n\t});\n\t/**\n\t* Exposed singleton wrapper for `loadScript`, avoiding calling it twice.\n\t*\n\t* @param waitForScriptLoad Whether if the Promise should resolve once the \"load\" event is emitted by the <script> attribute, or right after appending it to the DOM.\n\t* @returns Promise<HTMLScriptElement>\n\t*/\n\tconst load = (waitForScriptLoad = true) => {\n\t\tif (!_promise) _promise = loadScript(waitForScriptLoad);\n\t\treturn _promise;\n\t};\n\t/**\n\t* Unload the script specified by `src`.\n\t*/\n\tconst unload = () => {\n\t\tif (!document$1) return;\n\t\t_promise = null;\n\t\tif (scriptTag.value) scriptTag.value = null;\n\t\tconst el = document$1.querySelector(`script[src=\"${toValue(src)}\"]`);\n\t\tif (el) document$1.head.removeChild(el);\n\t};\n\tif (immediate && !manual) tryOnMounted(load);\n\tif (!manual) tryOnUnmounted(unload);\n\treturn {\n\t\tscriptTag,\n\t\tload,\n\t\tunload\n\t};\n}\n\n//#endregion\n//#region useScrollLock/index.ts\nfunction checkOverflowScroll(ele) {\n\tconst style = window.getComputedStyle(ele);\n\tif (style.overflowX === \"scroll\" || style.overflowY === \"scroll\" || style.overflowX === \"auto\" && ele.clientWidth < ele.scrollWidth || style.overflowY === \"auto\" && ele.clientHeight < ele.scrollHeight) return true;\n\telse {\n\t\tconst parent = ele.parentNode;\n\t\tif (!parent || parent.tagName === \"BODY\") return false;\n\t\treturn checkOverflowScroll(parent);\n\t}\n}\nfunction preventDefault(rawEvent) {\n\tconst e = rawEvent || window.event;\n\tconst _target = e.target;\n\tif (checkOverflowScroll(_target)) return false;\n\tif (e.touches.length > 1) return true;\n\tif (e.preventDefault) e.preventDefault();\n\treturn false;\n}\nconst elInitialOverflow = /* @__PURE__ */ new WeakMap();\n/**\n* Lock scrolling of the element.\n*\n* @see https://vueuse.org/useScrollLock\n* @param element\n*/\nfunction useScrollLock(element, initialState = false) {\n\tconst isLocked = shallowRef(initialState);\n\tlet stopTouchMoveListener = null;\n\tlet initialOverflow = \"\";\n\twatch(toRef(element), (el) => {\n\t\tconst target = resolveElement(toValue(el));\n\t\tif (target) {\n\t\t\tconst ele = target;\n\t\t\tif (!elInitialOverflow.get(ele)) elInitialOverflow.set(ele, ele.style.overflow);\n\t\t\tif (ele.style.overflow !== \"hidden\") initialOverflow = ele.style.overflow;\n\t\t\tif (ele.style.overflow === \"hidden\") return isLocked.value = true;\n\t\t\tif (isLocked.value) return ele.style.overflow = \"hidden\";\n\t\t}\n\t}, { immediate: true });\n\tconst lock = () => {\n\t\tconst el = resolveElement(toValue(element));\n\t\tif (!el || isLocked.value) return;\n\t\tif (isIOS) stopTouchMoveListener = useEventListener(el, \"touchmove\", (e) => {\n\t\t\tpreventDefault(e);\n\t\t}, { passive: false });\n\t\tel.style.overflow = \"hidden\";\n\t\tisLocked.value = true;\n\t};\n\tconst unlock = () => {\n\t\tconst el = resolveElement(toValue(element));\n\t\tif (!el || !isLocked.value) return;\n\t\tif (isIOS) stopTouchMoveListener === null || stopTouchMoveListener === void 0 || stopTouchMoveListener();\n\t\tel.style.overflow = initialOverflow;\n\t\telInitialOverflow.delete(el);\n\t\tisLocked.value = false;\n\t};\n\ttryOnScopeDispose(unlock);\n\treturn computed({\n\t\tget() {\n\t\t\treturn isLocked.value;\n\t\t},\n\t\tset(v) {\n\t\t\tif (v) lock();\n\t\t\telse unlock();\n\t\t}\n\t});\n}\n\n//#endregion\n//#region useSessionStorage/index.ts\n/**\n* Reactive SessionStorage.\n*\n* @see https://vueuse.org/useSessionStorage\n* @param key\n* @param initialValue\n* @param options\n*/\nfunction useSessionStorage(key, initialValue, options = {}) {\n\tconst { window: window$1 = defaultWindow } = options;\n\treturn useStorage(key, initialValue, window$1 === null || window$1 === void 0 ? void 0 : window$1.sessionStorage, options);\n}\n\n//#endregion\n//#region useShare/index.ts\n/**\n* Reactive Web Share API.\n*\n* @see https://vueuse.org/useShare\n* @param shareOptions\n* @param options\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useShare(shareOptions = {}, options = {}) {\n\tconst { navigator: navigator$1 = defaultNavigator } = options;\n\tconst _navigator = navigator$1;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => _navigator && \"canShare\" in _navigator);\n\tconst share = async (overrideOptions = {}) => {\n\t\tif (isSupported.value) {\n\t\t\tconst data = {\n\t\t\t\t...toValue(shareOptions),\n\t\t\t\t...toValue(overrideOptions)\n\t\t\t};\n\t\t\tlet granted = false;\n\t\t\tif (_navigator.canShare) granted = _navigator.canShare(data);\n\t\t\tif (granted) return _navigator.share(data);\n\t\t}\n\t};\n\treturn {\n\t\tisSupported,\n\t\tshare\n\t};\n}\n\n//#endregion\n//#region useSorted/index.ts\nconst defaultSortFn = (source, compareFn) => source.sort(compareFn);\nconst defaultCompare = (a, b) => a - b;\nfunction useSorted(...args) {\n\tconst [source] = args;\n\tlet compareFn = defaultCompare;\n\tlet options = {};\n\tif (args.length === 2) if (typeof args[1] === \"object\") {\n\t\tvar _options$compareFn;\n\t\toptions = args[1];\n\t\tcompareFn = (_options$compareFn = options.compareFn) !== null && _options$compareFn !== void 0 ? _options$compareFn : defaultCompare;\n\t} else {\n\t\tvar _args$;\n\t\tcompareFn = (_args$ = args[1]) !== null && _args$ !== void 0 ? _args$ : defaultCompare;\n\t}\n\telse if (args.length > 2) {\n\t\tvar _args$2, _args$3;\n\t\tcompareFn = (_args$2 = args[1]) !== null && _args$2 !== void 0 ? _args$2 : defaultCompare;\n\t\toptions = (_args$3 = args[2]) !== null && _args$3 !== void 0 ? _args$3 : {};\n\t}\n\tconst { dirty = false, sortFn = defaultSortFn } = options;\n\tif (!dirty) return computed(() => sortFn([...toValue(source)], compareFn));\n\twatchEffect(() => {\n\t\tconst result = sortFn(toValue(source), compareFn);\n\t\tif (isRef(source)) source.value = result;\n\t\telse source.splice(0, source.length, ...result);\n\t});\n\treturn source;\n}\n\n//#endregion\n//#region useSpeechRecognition/index.ts\n/**\n* Reactive SpeechRecognition.\n*\n* @see https://vueuse.org/useSpeechRecognition\n* @see https://developer.mozilla.org/en-US/docs/Web/API/SpeechRecognition SpeechRecognition\n* @param options\n*/\nfunction useSpeechRecognition(options = {}) {\n\tconst { interimResults = true, continuous = true, maxAlternatives = 1, window: window$1 = defaultWindow } = options;\n\tconst lang = toRef(options.lang || \"en-US\");\n\tconst isListening = shallowRef(false);\n\tconst isFinal = shallowRef(false);\n\tconst result = shallowRef(\"\");\n\tconst error = shallowRef(void 0);\n\tlet recognition;\n\tconst start = () => {\n\t\tisListening.value = true;\n\t};\n\tconst stop = () => {\n\t\tisListening.value = false;\n\t};\n\tconst toggle = (value = !isListening.value) => {\n\t\tif (value) start();\n\t\telse stop();\n\t};\n\tconst SpeechRecognition = window$1 && (window$1.SpeechRecognition || window$1.webkitSpeechRecognition);\n\tconst isSupported = /* @__PURE__ */ useSupported(() => SpeechRecognition);\n\tif (isSupported.value) {\n\t\trecognition = new SpeechRecognition();\n\t\trecognition.continuous = continuous;\n\t\trecognition.interimResults = interimResults;\n\t\trecognition.lang = toValue(lang);\n\t\trecognition.maxAlternatives = maxAlternatives;\n\t\trecognition.onstart = () => {\n\t\t\tisListening.value = true;\n\t\t\tisFinal.value = false;\n\t\t};\n\t\twatch(lang, (lang$1) => {\n\t\t\tif (recognition && !isListening.value) recognition.lang = lang$1;\n\t\t});\n\t\trecognition.onresult = (event) => {\n\t\t\tconst currentResult = event.results[event.resultIndex];\n\t\t\tconst { transcript } = currentResult[0];\n\t\t\tisFinal.value = currentResult.isFinal;\n\t\t\tresult.value = transcript;\n\t\t\terror.value = void 0;\n\t\t};\n\t\trecognition.onerror = (event) => {\n\t\t\terror.value = event;\n\t\t};\n\t\trecognition.onend = () => {\n\t\t\tisListening.value = false;\n\t\t\trecognition.lang = toValue(lang);\n\t\t};\n\t\twatch(isListening, (newValue, oldValue) => {\n\t\t\tif (newValue === oldValue) return;\n\t\t\tif (newValue) recognition.start();\n\t\t\telse recognition.stop();\n\t\t});\n\t}\n\ttryOnScopeDispose(() => {\n\t\tstop();\n\t});\n\treturn {\n\t\tisSupported,\n\t\tisListening,\n\t\tisFinal,\n\t\trecognition,\n\t\tresult,\n\t\terror,\n\t\ttoggle,\n\t\tstart,\n\t\tstop\n\t};\n}\n\n//#endregion\n//#region useSpeechSynthesis/index.ts\n/**\n* Reactive SpeechSynthesis.\n*\n* @see https://vueuse.org/useSpeechSynthesis\n* @see https://developer.mozilla.org/en-US/docs/Web/API/SpeechSynthesis SpeechSynthesis\n*/\nfunction useSpeechSynthesis(text, options = {}) {\n\tconst { pitch = 1, rate = 1, volume = 1, window: window$1 = defaultWindow, onBoundary } = options;\n\tconst synth = window$1 && window$1.speechSynthesis;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => synth);\n\tconst isPlaying = shallowRef(false);\n\tconst status = shallowRef(\"init\");\n\tconst spokenText = toRef(text || \"\");\n\tconst lang = toRef(options.lang || \"en-US\");\n\tconst error = shallowRef(void 0);\n\tconst toggle = (value = !isPlaying.value) => {\n\t\tisPlaying.value = value;\n\t};\n\tconst bindEventsForUtterance = (utterance$1) => {\n\t\tutterance$1.lang = toValue(lang);\n\t\tutterance$1.voice = toValue(options.voice) || null;\n\t\tutterance$1.pitch = toValue(pitch);\n\t\tutterance$1.rate = toValue(rate);\n\t\tutterance$1.volume = toValue(volume);\n\t\tutterance$1.onstart = () => {\n\t\t\tisPlaying.value = true;\n\t\t\tstatus.value = \"play\";\n\t\t};\n\t\tutterance$1.onpause = () => {\n\t\t\tisPlaying.value = false;\n\t\t\tstatus.value = \"pause\";\n\t\t};\n\t\tutterance$1.onresume = () => {\n\t\t\tisPlaying.value = true;\n\t\t\tstatus.value = \"play\";\n\t\t};\n\t\tutterance$1.onend = () => {\n\t\t\tisPlaying.value = false;\n\t\t\tstatus.value = \"end\";\n\t\t};\n\t\tutterance$1.onerror = (event) => {\n\t\t\terror.value = event;\n\t\t};\n\t\tutterance$1.onboundary = (event) => {\n\t\t\tonBoundary === null || onBoundary === void 0 || onBoundary(event);\n\t\t};\n\t};\n\tconst utterance = computed(() => {\n\t\tisPlaying.value = false;\n\t\tstatus.value = \"init\";\n\t\tconst newUtterance = new SpeechSynthesisUtterance(spokenText.value);\n\t\tbindEventsForUtterance(newUtterance);\n\t\treturn newUtterance;\n\t});\n\tconst speak = () => {\n\t\tsynth.cancel();\n\t\tif (utterance) synth.speak(utterance.value);\n\t};\n\tconst stop = () => {\n\t\tsynth.cancel();\n\t\tisPlaying.value = false;\n\t};\n\tif (isSupported.value) {\n\t\tbindEventsForUtterance(utterance.value);\n\t\twatch(lang, (lang$1) => {\n\t\t\tif (utterance.value && !isPlaying.value) utterance.value.lang = lang$1;\n\t\t});\n\t\tif (options.voice) watch(options.voice, () => {\n\t\t\tsynth.cancel();\n\t\t});\n\t\twatch(isPlaying, () => {\n\t\t\tif (isPlaying.value) synth.resume();\n\t\t\telse synth.pause();\n\t\t});\n\t}\n\ttryOnScopeDispose(() => {\n\t\tisPlaying.value = false;\n\t});\n\treturn {\n\t\tisSupported,\n\t\tisPlaying,\n\t\tstatus,\n\t\tutterance,\n\t\terror,\n\t\tstop,\n\t\ttoggle,\n\t\tspeak\n\t};\n}\n\n//#endregion\n//#region useStepper/index.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction useStepper(steps, initialStep) {\n\tconst stepsRef = ref(steps);\n\tconst stepNames = computed(() => Array.isArray(stepsRef.value) ? stepsRef.value : Object.keys(stepsRef.value));\n\tconst index = ref(stepNames.value.indexOf(initialStep !== null && initialStep !== void 0 ? initialStep : stepNames.value[0]));\n\tconst current = computed(() => at(index.value));\n\tconst isFirst = computed(() => index.value === 0);\n\tconst isLast = computed(() => index.value === stepNames.value.length - 1);\n\tconst next = computed(() => stepNames.value[index.value + 1]);\n\tconst previous = computed(() => stepNames.value[index.value - 1]);\n\tfunction at(index$1) {\n\t\tif (Array.isArray(stepsRef.value)) return stepsRef.value[index$1];\n\t\treturn stepsRef.value[stepNames.value[index$1]];\n\t}\n\tfunction get(step) {\n\t\tif (!stepNames.value.includes(step)) return;\n\t\treturn at(stepNames.value.indexOf(step));\n\t}\n\tfunction goTo(step) {\n\t\tif (stepNames.value.includes(step)) index.value = stepNames.value.indexOf(step);\n\t}\n\tfunction goToNext() {\n\t\tif (isLast.value) return;\n\t\tindex.value++;\n\t}\n\tfunction goToPrevious() {\n\t\tif (isFirst.value) return;\n\t\tindex.value--;\n\t}\n\tfunction goBackTo(step) {\n\t\tif (isAfter(step)) goTo(step);\n\t}\n\tfunction isNext(step) {\n\t\treturn stepNames.value.indexOf(step) === index.value + 1;\n\t}\n\tfunction isPrevious(step) {\n\t\treturn stepNames.value.indexOf(step) === index.value - 1;\n\t}\n\tfunction isCurrent(step) {\n\t\treturn stepNames.value.indexOf(step) === index.value;\n\t}\n\tfunction isBefore(step) {\n\t\treturn index.value < stepNames.value.indexOf(step);\n\t}\n\tfunction isAfter(step) {\n\t\treturn index.value > stepNames.value.indexOf(step);\n\t}\n\treturn {\n\t\tsteps: stepsRef,\n\t\tstepNames,\n\t\tindex,\n\t\tcurrent,\n\t\tnext,\n\t\tprevious,\n\t\tisFirst,\n\t\tisLast,\n\t\tat,\n\t\tget,\n\t\tgoTo,\n\t\tgoToNext,\n\t\tgoToPrevious,\n\t\tgoBackTo,\n\t\tisNext,\n\t\tisPrevious,\n\t\tisCurrent,\n\t\tisBefore,\n\t\tisAfter\n\t};\n}\n\n//#endregion\n//#region useStorageAsync/index.ts\n/**\n* Reactive Storage in with async support.\n*\n* @see https://vueuse.org/useStorageAsync\n* @param key\n* @param initialValue\n* @param storage\n* @param options\n*/\nfunction useStorageAsync(key, initialValue, storage, options = {}) {\n\tvar _options$serializer;\n\tconst { flush = \"pre\", deep = true, listenToStorageChanges = true, writeDefaults = true, mergeDefaults = false, shallow, window: window$1 = defaultWindow, eventFilter, onError = (e) => {\n\t\tconsole.error(e);\n\t}, onReady } = options;\n\tconst rawInit = toValue(initialValue);\n\tconst type = guessSerializerType(rawInit);\n\tconst data = (shallow ? shallowRef : ref)(toValue(initialValue));\n\tconst serializer = (_options$serializer = options.serializer) !== null && _options$serializer !== void 0 ? _options$serializer : StorageSerializers[type];\n\tif (!storage) try {\n\t\tstorage = getSSRHandler(\"getDefaultStorageAsync\", () => defaultWindow === null || defaultWindow === void 0 ? void 0 : defaultWindow.localStorage)();\n\t} catch (e) {\n\t\tonError(e);\n\t}\n\tasync function read(event) {\n\t\tif (!storage || event && event.key !== key) return;\n\t\ttry {\n\t\t\tconst rawValue = event ? event.newValue : await storage.getItem(key);\n\t\t\tif (rawValue == null) {\n\t\t\t\tdata.value = rawInit;\n\t\t\t\tif (writeDefaults && rawInit !== null) await storage.setItem(key, await serializer.write(rawInit));\n\t\t\t} else if (mergeDefaults) {\n\t\t\t\tconst value = await serializer.read(rawValue);\n\t\t\t\tif (typeof mergeDefaults === \"function\") data.value = mergeDefaults(value, rawInit);\n\t\t\t\telse if (type === \"object\" && !Array.isArray(value)) data.value = {\n\t\t\t\t\t...rawInit,\n\t\t\t\t\t...value\n\t\t\t\t};\n\t\t\t\telse data.value = value;\n\t\t\t} else data.value = await serializer.read(rawValue);\n\t\t} catch (e) {\n\t\t\tonError(e);\n\t\t}\n\t}\n\tconst promise = new Promise((resolve) => {\n\t\tread().then(() => {\n\t\t\tonReady === null || onReady === void 0 || onReady(data.value);\n\t\t\tresolve(data);\n\t\t});\n\t});\n\tif (window$1 && listenToStorageChanges) useEventListener(window$1, \"storage\", (e) => Promise.resolve().then(() => read(e)), { passive: true });\n\tif (storage) watchWithFilter(data, async () => {\n\t\ttry {\n\t\t\tif (data.value == null) await storage.removeItem(key);\n\t\t\telse await storage.setItem(key, await serializer.write(data.value));\n\t\t} catch (e) {\n\t\t\tonError(e);\n\t\t}\n\t}, {\n\t\tflush,\n\t\tdeep,\n\t\teventFilter\n\t});\n\tObject.assign(data, {\n\t\tthen: promise.then.bind(promise),\n\t\tcatch: promise.catch.bind(promise)\n\t});\n\treturn data;\n}\n\n//#endregion\n//#region useStyleTag/index.ts\nlet _id = 0;\n/**\n* Inject <style> element in head.\n*\n* Overload: Omitted id\n*\n* @see https://vueuse.org/useStyleTag\n* @param css\n* @param options\n*/\nfunction useStyleTag(css, options = {}) {\n\tconst isLoaded = shallowRef(false);\n\tconst { document: document$1 = defaultDocument, immediate = true, manual = false, id = `vueuse_styletag_${++_id}` } = options;\n\tconst cssRef = shallowRef(css);\n\tlet stop = () => {};\n\tconst load = () => {\n\t\tif (!document$1) return;\n\t\tconst el = document$1.getElementById(id) || document$1.createElement(\"style\");\n\t\tif (!el.isConnected) {\n\t\t\tel.id = id;\n\t\t\tif (options.nonce) el.nonce = options.nonce;\n\t\t\tif (options.media) el.media = options.media;\n\t\t\tdocument$1.head.appendChild(el);\n\t\t}\n\t\tif (isLoaded.value) return;\n\t\tstop = watch(cssRef, (value) => {\n\t\t\tel.textContent = value;\n\t\t}, { immediate: true });\n\t\tisLoaded.value = true;\n\t};\n\tconst unload = () => {\n\t\tif (!document$1 || !isLoaded.value) return;\n\t\tstop();\n\t\tdocument$1.head.removeChild(document$1.getElementById(id));\n\t\tisLoaded.value = false;\n\t};\n\tif (immediate && !manual) tryOnMounted(load);\n\tif (!manual) tryOnScopeDispose(unload);\n\treturn {\n\t\tid,\n\t\tcss: cssRef,\n\t\tunload,\n\t\tload,\n\t\tisLoaded: readonly(isLoaded)\n\t};\n}\n\n//#endregion\n//#region useSwipe/index.ts\n/**\n* Reactive swipe detection.\n*\n* @see https://vueuse.org/useSwipe\n* @param target\n* @param options\n*/\nfunction useSwipe(target, options = {}) {\n\tconst { threshold = 50, onSwipe, onSwipeEnd, onSwipeStart, passive = true } = options;\n\tconst coordsStart = reactive({\n\t\tx: 0,\n\t\ty: 0\n\t});\n\tconst coordsEnd = reactive({\n\t\tx: 0,\n\t\ty: 0\n\t});\n\tconst diffX = computed(() => coordsStart.x - coordsEnd.x);\n\tconst diffY = computed(() => coordsStart.y - coordsEnd.y);\n\tconst { max, abs } = Math;\n\tconst isThresholdExceeded = computed(() => max(abs(diffX.value), abs(diffY.value)) >= threshold);\n\tconst isSwiping = shallowRef(false);\n\tconst direction = computed(() => {\n\t\tif (!isThresholdExceeded.value) return \"none\";\n\t\tif (abs(diffX.value) > abs(diffY.value)) return diffX.value > 0 ? \"left\" : \"right\";\n\t\telse return diffY.value > 0 ? \"up\" : \"down\";\n\t});\n\tconst getTouchEventCoords = (e) => [e.touches[0].clientX, e.touches[0].clientY];\n\tconst updateCoordsStart = (x, y) => {\n\t\tcoordsStart.x = x;\n\t\tcoordsStart.y = y;\n\t};\n\tconst updateCoordsEnd = (x, y) => {\n\t\tcoordsEnd.x = x;\n\t\tcoordsEnd.y = y;\n\t};\n\tconst listenerOptions = {\n\t\tpassive,\n\t\tcapture: !passive\n\t};\n\tconst onTouchEnd = (e) => {\n\t\tif (isSwiping.value) onSwipeEnd === null || onSwipeEnd === void 0 || onSwipeEnd(e, direction.value);\n\t\tisSwiping.value = false;\n\t};\n\tconst stops = [\n\t\tuseEventListener(target, \"touchstart\", (e) => {\n\t\t\tif (e.touches.length !== 1) return;\n\t\t\tconst [x, y] = getTouchEventCoords(e);\n\t\t\tupdateCoordsStart(x, y);\n\t\t\tupdateCoordsEnd(x, y);\n\t\t\tonSwipeStart === null || onSwipeStart === void 0 || onSwipeStart(e);\n\t\t}, listenerOptions),\n\t\tuseEventListener(target, \"touchmove\", (e) => {\n\t\t\tif (e.touches.length !== 1) return;\n\t\t\tconst [x, y] = getTouchEventCoords(e);\n\t\t\tupdateCoordsEnd(x, y);\n\t\t\tif (listenerOptions.capture && !listenerOptions.passive && Math.abs(diffX.value) > Math.abs(diffY.value)) e.preventDefault();\n\t\t\tif (!isSwiping.value && isThresholdExceeded.value) isSwiping.value = true;\n\t\t\tif (isSwiping.value) onSwipe === null || onSwipe === void 0 || onSwipe(e);\n\t\t}, listenerOptions),\n\t\tuseEventListener(target, [\"touchend\", \"touchcancel\"], onTouchEnd, listenerOptions)\n\t];\n\tconst stop = () => stops.forEach((s) => s());\n\treturn {\n\t\tisSwiping,\n\t\tdirection,\n\t\tcoordsStart,\n\t\tcoordsEnd,\n\t\tlengthX: diffX,\n\t\tlengthY: diffY,\n\t\tstop\n\t};\n}\n\n//#endregion\n//#region useTemplateRefsList/index.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction useTemplateRefsList() {\n\tconst refs = ref([]);\n\trefs.value.set = (el) => {\n\t\tif (el) refs.value.push(el);\n\t};\n\tonBeforeUpdate(() => {\n\t\trefs.value.length = 0;\n\t});\n\treturn refs;\n}\n\n//#endregion\n//#region useTextDirection/index.ts\n/**\n* Reactive dir of the element's text.\n*\n* @see https://vueuse.org/useTextDirection\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useTextDirection(options = {}) {\n\tconst { document: document$1 = defaultDocument, selector = \"html\", observe = false, initialValue = \"ltr\" } = options;\n\tfunction getValue$1() {\n\t\tvar _ref, _document$querySelect;\n\t\treturn (_ref = document$1 === null || document$1 === void 0 || (_document$querySelect = document$1.querySelector(selector)) === null || _document$querySelect === void 0 ? void 0 : _document$querySelect.getAttribute(\"dir\")) !== null && _ref !== void 0 ? _ref : initialValue;\n\t}\n\tconst dir = ref(getValue$1());\n\ttryOnMounted(() => dir.value = getValue$1());\n\tif (observe && document$1) useMutationObserver(document$1.querySelector(selector), () => dir.value = getValue$1(), { attributes: true });\n\treturn computed({\n\t\tget() {\n\t\t\treturn dir.value;\n\t\t},\n\t\tset(v) {\n\t\t\tvar _document$querySelect2, _document$querySelect3;\n\t\t\tdir.value = v;\n\t\t\tif (!document$1) return;\n\t\t\tif (dir.value) (_document$querySelect2 = document$1.querySelector(selector)) === null || _document$querySelect2 === void 0 || _document$querySelect2.setAttribute(\"dir\", dir.value);\n\t\t\telse (_document$querySelect3 = document$1.querySelector(selector)) === null || _document$querySelect3 === void 0 || _document$querySelect3.removeAttribute(\"dir\");\n\t\t}\n\t});\n}\n\n//#endregion\n//#region useTextSelection/index.ts\nfunction getRangesFromSelection(selection) {\n\tvar _selection$rangeCount;\n\tconst rangeCount = (_selection$rangeCount = selection.rangeCount) !== null && _selection$rangeCount !== void 0 ? _selection$rangeCount : 0;\n\treturn Array.from({ length: rangeCount }, (_, i) => selection.getRangeAt(i));\n}\n/**\n* Reactively track user text selection based on [`Window.getSelection`](https://developer.mozilla.org/en-US/docs/Web/API/Window/getSelection).\n*\n* @see https://vueuse.org/useTextSelection\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useTextSelection(options = {}) {\n\tvar _window$getSelection;\n\tconst { window: window$1 = defaultWindow } = options;\n\tconst selection = shallowRef((_window$getSelection = window$1 === null || window$1 === void 0 ? void 0 : window$1.getSelection()) !== null && _window$getSelection !== void 0 ? _window$getSelection : null);\n\tconst text = computed(() => {\n\t\tvar _selection$value$toSt, _selection$value;\n\t\treturn (_selection$value$toSt = (_selection$value = selection.value) === null || _selection$value === void 0 ? void 0 : _selection$value.toString()) !== null && _selection$value$toSt !== void 0 ? _selection$value$toSt : \"\";\n\t});\n\tconst ranges = computed(() => selection.value ? getRangesFromSelection(selection.value) : []);\n\tconst rects = computed(() => ranges.value.map((range) => range.getBoundingClientRect()));\n\tfunction onSelectionChange() {\n\t\tselection.value = null;\n\t\tif (window$1) selection.value = window$1.getSelection();\n\t}\n\tif (window$1) useEventListener(window$1.document, \"selectionchange\", onSelectionChange, { passive: true });\n\treturn {\n\t\ttext,\n\t\trects,\n\t\tranges,\n\t\tselection\n\t};\n}\n\n//#endregion\n//#region useTextareaAutosize/index.ts\n/**\n* Call window.requestAnimationFrame(), if not available, just call the function\n*\n* @param window\n* @param fn\n*/\nfunction tryRequestAnimationFrame(window$1 = defaultWindow, fn) {\n\tif (window$1 && typeof window$1.requestAnimationFrame === \"function\") window$1.requestAnimationFrame(fn);\n\telse fn();\n}\nfunction useTextareaAutosize(options = {}) {\n\tvar _options$input, _options$styleProp;\n\tconst { window: window$1 = defaultWindow } = options;\n\tconst textarea = toRef(options === null || options === void 0 ? void 0 : options.element);\n\tconst input = toRef((_options$input = options === null || options === void 0 ? void 0 : options.input) !== null && _options$input !== void 0 ? _options$input : \"\");\n\tconst styleProp = (_options$styleProp = options === null || options === void 0 ? void 0 : options.styleProp) !== null && _options$styleProp !== void 0 ? _options$styleProp : \"height\";\n\tconst textareaScrollHeight = shallowRef(1);\n\tconst textareaOldWidth = shallowRef(0);\n\tfunction triggerResize() {\n\t\tvar _textarea$value;\n\t\tif (!textarea.value) return;\n\t\tlet height = \"\";\n\t\ttextarea.value.style[styleProp] = \"1px\";\n\t\ttextareaScrollHeight.value = (_textarea$value = textarea.value) === null || _textarea$value === void 0 ? void 0 : _textarea$value.scrollHeight;\n\t\tconst _styleTarget = toValue(options === null || options === void 0 ? void 0 : options.styleTarget);\n\t\tif (_styleTarget) _styleTarget.style[styleProp] = `${textareaScrollHeight.value}px`;\n\t\telse height = `${textareaScrollHeight.value}px`;\n\t\ttextarea.value.style[styleProp] = height;\n\t}\n\twatch([input, textarea], () => nextTick(triggerResize), { immediate: true });\n\twatch(textareaScrollHeight, () => {\n\t\tvar _options$onResize;\n\t\treturn options === null || options === void 0 || (_options$onResize = options.onResize) === null || _options$onResize === void 0 ? void 0 : _options$onResize.call(options);\n\t});\n\tuseResizeObserver(textarea, ([{ contentRect }]) => {\n\t\tif (textareaOldWidth.value === contentRect.width) return;\n\t\ttryRequestAnimationFrame(window$1, () => {\n\t\t\ttextareaOldWidth.value = contentRect.width;\n\t\t\ttriggerResize();\n\t\t});\n\t});\n\tif (options === null || options === void 0 ? void 0 : options.watch) watch(options.watch, triggerResize, {\n\t\timmediate: true,\n\t\tdeep: true\n\t});\n\treturn {\n\t\ttextarea,\n\t\tinput,\n\t\ttriggerResize\n\t};\n}\n\n//#endregion\n//#region useThrottledRefHistory/index.ts\n/**\n* Shorthand for [useRefHistory](https://vueuse.org/useRefHistory) with throttled filter.\n*\n* @see https://vueuse.org/useThrottledRefHistory\n* @param source\n* @param options\n*/\nfunction useThrottledRefHistory(source, options = {}) {\n\tconst { throttle = 200, trailing = true } = options;\n\tconst filter = throttleFilter(throttle, trailing);\n\treturn { ...useRefHistory(source, {\n\t\t...options,\n\t\teventFilter: filter\n\t}) };\n}\n\n//#endregion\n//#region useTimeAgo/index.ts\nconst DEFAULT_UNITS = [\n\t{\n\t\tmax: 6e4,\n\t\tvalue: 1e3,\n\t\tname: \"second\"\n\t},\n\t{\n\t\tmax: 276e4,\n\t\tvalue: 6e4,\n\t\tname: \"minute\"\n\t},\n\t{\n\t\tmax: 72e6,\n\t\tvalue: 36e5,\n\t\tname: \"hour\"\n\t},\n\t{\n\t\tmax: 5184e5,\n\t\tvalue: 864e5,\n\t\tname: \"day\"\n\t},\n\t{\n\t\tmax: 24192e5,\n\t\tvalue: 6048e5,\n\t\tname: \"week\"\n\t},\n\t{\n\t\tmax: 28512e6,\n\t\tvalue: 2592e6,\n\t\tname: \"month\"\n\t},\n\t{\n\t\tmax: Number.POSITIVE_INFINITY,\n\t\tvalue: 31536e6,\n\t\tname: \"year\"\n\t}\n];\nconst DEFAULT_MESSAGES = {\n\tjustNow: \"just now\",\n\tpast: (n) => n.match(/\\d/) ? `${n} ago` : n,\n\tfuture: (n) => n.match(/\\d/) ? `in ${n}` : n,\n\tmonth: (n, past) => n === 1 ? past ? \"last month\" : \"next month\" : `${n} month${n > 1 ? \"s\" : \"\"}`,\n\tyear: (n, past) => n === 1 ? past ? \"last year\" : \"next year\" : `${n} year${n > 1 ? \"s\" : \"\"}`,\n\tday: (n, past) => n === 1 ? past ? \"yesterday\" : \"tomorrow\" : `${n} day${n > 1 ? \"s\" : \"\"}`,\n\tweek: (n, past) => n === 1 ? past ? \"last week\" : \"next week\" : `${n} week${n > 1 ? \"s\" : \"\"}`,\n\thour: (n) => `${n} hour${n > 1 ? \"s\" : \"\"}`,\n\tminute: (n) => `${n} minute${n > 1 ? \"s\" : \"\"}`,\n\tsecond: (n) => `${n} second${n > 1 ? \"s\" : \"\"}`,\n\tinvalid: \"\"\n};\nfunction DEFAULT_FORMATTER(date) {\n\treturn date.toISOString().slice(0, 10);\n}\n/**\n* Reactive time ago formatter.\n*\n* @see https://vueuse.org/useTimeAgo\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useTimeAgo(time, options = {}) {\n\tconst { controls: exposeControls = false, updateInterval = 3e4 } = options;\n\tconst { now,...controls } = useNow({\n\t\tinterval: updateInterval,\n\t\tcontrols: true\n\t});\n\tconst timeAgo = computed(() => formatTimeAgo(new Date(toValue(time)), options, toValue(now)));\n\tif (exposeControls) return {\n\t\ttimeAgo,\n\t\t...controls\n\t};\n\telse return timeAgo;\n}\nfunction formatTimeAgo(from, options = {}, now = Date.now()) {\n\tconst { max, messages = DEFAULT_MESSAGES, fullDateFormatter = DEFAULT_FORMATTER, units = DEFAULT_UNITS, showSecond = false, rounding = \"round\" } = options;\n\tconst roundFn = typeof rounding === \"number\" ? (n) => +n.toFixed(rounding) : Math[rounding];\n\tconst diff = +now - +from;\n\tconst absDiff = Math.abs(diff);\n\tfunction getValue$1(diff$1, unit) {\n\t\treturn roundFn(Math.abs(diff$1) / unit.value);\n\t}\n\tfunction format(diff$1, unit) {\n\t\tconst val = getValue$1(diff$1, unit);\n\t\tconst past = diff$1 > 0;\n\t\tconst str = applyFormat(unit.name, val, past);\n\t\treturn applyFormat(past ? \"past\" : \"future\", str, past);\n\t}\n\tfunction applyFormat(name, val, isPast) {\n\t\tconst formatter = messages[name];\n\t\tif (typeof formatter === \"function\") return formatter(val, isPast);\n\t\treturn formatter.replace(\"{0}\", val.toString());\n\t}\n\tif (absDiff < 6e4 && !showSecond) return messages.justNow;\n\tif (typeof max === \"number\" && absDiff > max) return fullDateFormatter(new Date(from));\n\tif (typeof max === \"string\") {\n\t\tvar _units$find;\n\t\tconst unitMax = (_units$find = units.find((i) => i.name === max)) === null || _units$find === void 0 ? void 0 : _units$find.max;\n\t\tif (unitMax && absDiff > unitMax) return fullDateFormatter(new Date(from));\n\t}\n\tfor (const [idx, unit] of units.entries()) {\n\t\tif (getValue$1(diff, unit) <= 0 && units[idx - 1]) return format(diff, units[idx - 1]);\n\t\tif (absDiff < unit.max) return format(diff, unit);\n\t}\n\treturn messages.invalid;\n}\n\n//#endregion\n//#region useTimeAgoIntl/index.ts\nconst UNITS = [\n\t{\n\t\tname: \"year\",\n\t\tms: 31536e6\n\t},\n\t{\n\t\tname: \"month\",\n\t\tms: 2592e6\n\t},\n\t{\n\t\tname: \"week\",\n\t\tms: 6048e5\n\t},\n\t{\n\t\tname: \"day\",\n\t\tms: 864e5\n\t},\n\t{\n\t\tname: \"hour\",\n\t\tms: 36e5\n\t},\n\t{\n\t\tname: \"minute\",\n\t\tms: 6e4\n\t},\n\t{\n\t\tname: \"second\",\n\t\tms: 1e3\n\t}\n];\nfunction useTimeAgoIntl(time, options = {}) {\n\tconst { controls: exposeControls = false, updateInterval = 3e4 } = options;\n\tconst { now,...controls } = useNow({\n\t\tinterval: updateInterval,\n\t\tcontrols: true\n\t});\n\tconst result = computed(() => getTimeAgoIntlResult(new Date(toValue(time)), options, toValue(now)));\n\tconst parts = computed(() => result.value.parts);\n\tconst timeAgoIntl = computed(() => formatTimeAgoIntlParts(parts.value, {\n\t\t...options,\n\t\tlocale: result.value.resolvedLocale\n\t}));\n\treturn exposeControls ? {\n\t\ttimeAgoIntl,\n\t\tparts,\n\t\t...controls\n\t} : timeAgoIntl;\n}\n/**\n* Non-reactive version of useTimeAgoIntl\n*/\nfunction formatTimeAgoIntl(from, options = {}, now = Date.now()) {\n\tconst { parts, resolvedLocale } = getTimeAgoIntlResult(from, options, now);\n\treturn formatTimeAgoIntlParts(parts, {\n\t\t...options,\n\t\tlocale: resolvedLocale\n\t});\n}\n/**\n* Get parts from `Intl.RelativeTimeFormat.formatToParts`.\n*/\nfunction getTimeAgoIntlResult(from, options = {}, now = Date.now()) {\n\tconst { locale, relativeTimeFormatOptions = { numeric: \"auto\" } } = options;\n\tconst rtf = new Intl.RelativeTimeFormat(locale, relativeTimeFormatOptions);\n\tconst { locale: resolvedLocale } = rtf.resolvedOptions();\n\tconst diff = +from - +now;\n\tconst absDiff = Math.abs(diff);\n\tfor (const { name, ms } of UNITS) if (absDiff >= ms) return {\n\t\tresolvedLocale,\n\t\tparts: rtf.formatToParts(Math.round(diff / ms), name)\n\t};\n\treturn {\n\t\tresolvedLocale,\n\t\tparts: rtf.formatToParts(0, \"second\")\n\t};\n}\n/**\n* Format parts into a string\n*/\nfunction formatTimeAgoIntlParts(parts, options = {}) {\n\tconst { insertSpace = true, joinParts, locale } = options;\n\tif (typeof joinParts === \"function\") return joinParts(parts, locale);\n\tif (!insertSpace) return parts.map((part) => part.value).join(\"\");\n\treturn parts.map((part) => part.value.trim()).join(\" \");\n}\n\n//#endregion\n//#region useTimeoutPoll/index.ts\nfunction useTimeoutPoll(fn, interval, options = {}) {\n\tconst { immediate = true, immediateCallback = false } = options;\n\tconst { start } = useTimeoutFn(loop, interval, { immediate });\n\tconst isActive = shallowRef(false);\n\tasync function loop() {\n\t\tif (!isActive.value) return;\n\t\tawait fn();\n\t\tstart();\n\t}\n\tfunction resume() {\n\t\tif (!isActive.value) {\n\t\t\tisActive.value = true;\n\t\t\tif (immediateCallback) fn();\n\t\t\tstart();\n\t\t}\n\t}\n\tfunction pause() {\n\t\tisActive.value = false;\n\t}\n\tif (immediate && isClient) resume();\n\ttryOnScopeDispose(pause);\n\treturn {\n\t\tisActive,\n\t\tpause,\n\t\tresume\n\t};\n}\n\n//#endregion\n//#region useTimestamp/index.ts\nfunction useTimestamp(options = {}) {\n\tconst { controls: exposeControls = false, offset = 0, immediate = true, interval = \"requestAnimationFrame\", callback } = options;\n\tconst ts = shallowRef(timestamp() + offset);\n\tconst update = () => ts.value = timestamp() + offset;\n\tconst cb = callback ? () => {\n\t\tupdate();\n\t\tcallback(ts.value);\n\t} : update;\n\tconst controls = interval === \"requestAnimationFrame\" ? useRafFn(cb, { immediate }) : useIntervalFn(cb, interval, { immediate });\n\tif (exposeControls) return {\n\t\ttimestamp: ts,\n\t\t...controls\n\t};\n\telse return ts;\n}\n\n//#endregion\n//#region useTitle/index.ts\nfunction useTitle(newTitle = null, options = {}) {\n\tvar _document$title, _ref;\n\tconst { document: document$1 = defaultDocument, restoreOnUnmount = (t) => t } = options;\n\tconst originalTitle = (_document$title = document$1 === null || document$1 === void 0 ? void 0 : document$1.title) !== null && _document$title !== void 0 ? _document$title : \"\";\n\tconst title = toRef((_ref = newTitle !== null && newTitle !== void 0 ? newTitle : document$1 === null || document$1 === void 0 ? void 0 : document$1.title) !== null && _ref !== void 0 ? _ref : null);\n\tconst isReadonly$1 = !!(newTitle && typeof newTitle === \"function\");\n\tfunction format(t) {\n\t\tif (!(\"titleTemplate\" in options)) return t;\n\t\tconst template = options.titleTemplate || \"%s\";\n\t\treturn typeof template === \"function\" ? template(t) : toValue(template).replace(/%s/g, t);\n\t}\n\twatch(title, (newValue, oldValue) => {\n\t\tif (newValue !== oldValue && document$1) document$1.title = format(newValue !== null && newValue !== void 0 ? newValue : \"\");\n\t}, { immediate: true });\n\tif (options.observe && !options.titleTemplate && document$1 && !isReadonly$1) {\n\t\tvar _document$head;\n\t\tuseMutationObserver((_document$head = document$1.head) === null || _document$head === void 0 ? void 0 : _document$head.querySelector(\"title\"), () => {\n\t\t\tif (document$1 && document$1.title !== title.value) title.value = format(document$1.title);\n\t\t}, { childList: true });\n\t}\n\ttryOnScopeDispose(() => {\n\t\tif (restoreOnUnmount) {\n\t\t\tconst restoredTitle = restoreOnUnmount(originalTitle, title.value || \"\");\n\t\t\tif (restoredTitle != null && document$1) document$1.title = restoredTitle;\n\t\t}\n\t});\n\treturn title;\n}\n\n//#endregion\n//#region useTransition/index.ts\nconst _TransitionPresets = {\n\teaseInSine: [\n\t\t.12,\n\t\t0,\n\t\t.39,\n\t\t0\n\t],\n\teaseOutSine: [\n\t\t.61,\n\t\t1,\n\t\t.88,\n\t\t1\n\t],\n\teaseInOutSine: [\n\t\t.37,\n\t\t0,\n\t\t.63,\n\t\t1\n\t],\n\teaseInQuad: [\n\t\t.11,\n\t\t0,\n\t\t.5,\n\t\t0\n\t],\n\teaseOutQuad: [\n\t\t.5,\n\t\t1,\n\t\t.89,\n\t\t1\n\t],\n\teaseInOutQuad: [\n\t\t.45,\n\t\t0,\n\t\t.55,\n\t\t1\n\t],\n\teaseInCubic: [\n\t\t.32,\n\t\t0,\n\t\t.67,\n\t\t0\n\t],\n\teaseOutCubic: [\n\t\t.33,\n\t\t1,\n\t\t.68,\n\t\t1\n\t],\n\teaseInOutCubic: [\n\t\t.65,\n\t\t0,\n\t\t.35,\n\t\t1\n\t],\n\teaseInQuart: [\n\t\t.5,\n\t\t0,\n\t\t.75,\n\t\t0\n\t],\n\teaseOutQuart: [\n\t\t.25,\n\t\t1,\n\t\t.5,\n\t\t1\n\t],\n\teaseInOutQuart: [\n\t\t.76,\n\t\t0,\n\t\t.24,\n\t\t1\n\t],\n\teaseInQuint: [\n\t\t.64,\n\t\t0,\n\t\t.78,\n\t\t0\n\t],\n\teaseOutQuint: [\n\t\t.22,\n\t\t1,\n\t\t.36,\n\t\t1\n\t],\n\teaseInOutQuint: [\n\t\t.83,\n\t\t0,\n\t\t.17,\n\t\t1\n\t],\n\teaseInExpo: [\n\t\t.7,\n\t\t0,\n\t\t.84,\n\t\t0\n\t],\n\teaseOutExpo: [\n\t\t.16,\n\t\t1,\n\t\t.3,\n\t\t1\n\t],\n\teaseInOutExpo: [\n\t\t.87,\n\t\t0,\n\t\t.13,\n\t\t1\n\t],\n\teaseInCirc: [\n\t\t.55,\n\t\t0,\n\t\t1,\n\t\t.45\n\t],\n\teaseOutCirc: [\n\t\t0,\n\t\t.55,\n\t\t.45,\n\t\t1\n\t],\n\teaseInOutCirc: [\n\t\t.85,\n\t\t0,\n\t\t.15,\n\t\t1\n\t],\n\teaseInBack: [\n\t\t.36,\n\t\t0,\n\t\t.66,\n\t\t-.56\n\t],\n\teaseOutBack: [\n\t\t.34,\n\t\t1.56,\n\t\t.64,\n\t\t1\n\t],\n\teaseInOutBack: [\n\t\t.68,\n\t\t-.6,\n\t\t.32,\n\t\t1.6\n\t]\n};\n/**\n* Common transitions\n*\n* @see https://easings.net\n*/\nconst TransitionPresets = /* @__PURE__ */ Object.assign({}, { linear: identity }, _TransitionPresets);\n/**\n* Create an easing function from cubic bezier points.\n*/\nfunction createEasingFunction([p0, p1, p2, p3]) {\n\tconst a = (a1, a2) => 1 - 3 * a2 + 3 * a1;\n\tconst b = (a1, a2) => 3 * a2 - 6 * a1;\n\tconst c = (a1) => 3 * a1;\n\tconst calcBezier = (t, a1, a2) => ((a(a1, a2) * t + b(a1, a2)) * t + c(a1)) * t;\n\tconst getSlope = (t, a1, a2) => 3 * a(a1, a2) * t * t + 2 * b(a1, a2) * t + c(a1);\n\tconst getTforX = (x) => {\n\t\tlet aGuessT = x;\n\t\tfor (let i = 0; i < 4; ++i) {\n\t\t\tconst currentSlope = getSlope(aGuessT, p0, p2);\n\t\t\tif (currentSlope === 0) return aGuessT;\n\t\t\tconst currentX = calcBezier(aGuessT, p0, p2) - x;\n\t\t\taGuessT -= currentX / currentSlope;\n\t\t}\n\t\treturn aGuessT;\n\t};\n\treturn (x) => p0 === p1 && p2 === p3 ? x : calcBezier(getTforX(x), p1, p3);\n}\nfunction lerp(a, b, alpha) {\n\treturn a + alpha * (b - a);\n}\nfunction defaultInterpolation(a, b, t) {\n\tconst aVal = toValue(a);\n\tconst bVal = toValue(b);\n\tif (typeof aVal === \"number\" && typeof bVal === \"number\") return lerp(aVal, bVal, t);\n\tif (Array.isArray(aVal) && Array.isArray(bVal)) return aVal.map((v, i) => lerp(v, toValue(bVal[i]), t));\n\tthrow new TypeError(\"Unknown transition type, specify an interpolation function.\");\n}\nfunction normalizeEasing(easing) {\n\tvar _toValue;\n\treturn typeof easing === \"function\" ? easing : (_toValue = toValue(easing)) !== null && _toValue !== void 0 ? _toValue : identity;\n}\n/**\n* Transition from one value to another.\n*\n* @param source\n* @param from\n* @param to\n* @param options\n*/\nfunction transition(source, from, to, options = {}) {\n\tvar _toValue2;\n\tconst { window: window$1 = defaultWindow } = options;\n\tconst fromVal = toValue(from);\n\tconst toVal = toValue(to);\n\tconst duration = (_toValue2 = toValue(options.duration)) !== null && _toValue2 !== void 0 ? _toValue2 : 1e3;\n\tconst startedAt = Date.now();\n\tconst endAt = Date.now() + duration;\n\tconst interpolation = typeof options.interpolation === \"function\" ? options.interpolation : defaultInterpolation;\n\tconst trans = typeof options.easing !== \"undefined\" ? normalizeEasing(options.easing) : normalizeEasing(options.transition);\n\tconst ease = typeof trans === \"function\" ? trans : createEasingFunction(trans);\n\treturn new Promise((resolve) => {\n\t\tsource.value = fromVal;\n\t\tconst tick = () => {\n\t\t\tvar _options$abort;\n\t\t\tif ((_options$abort = options.abort) === null || _options$abort === void 0 ? void 0 : _options$abort.call(options)) {\n\t\t\t\tresolve();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst now = Date.now();\n\t\t\tsource.value = interpolation(fromVal, toVal, ease((now - startedAt) / duration));\n\t\t\tif (now < endAt) window$1 === null || window$1 === void 0 || window$1.requestAnimationFrame(tick);\n\t\t\telse {\n\t\t\t\tsource.value = toVal;\n\t\t\t\tresolve();\n\t\t\t}\n\t\t};\n\t\ttick();\n\t});\n}\n/**\n* Transition from one value to another.\n* @deprecated The `executeTransition` function is deprecated, use `transition` instead.\n*\n* @param source\n* @param from\n* @param to\n* @param options\n*/\nfunction executeTransition(source, from, to, options = {}) {\n\treturn transition(source, from, to, options);\n}\n/**\n* Follow value with a transition.\n*\n* @see https://vueuse.org/useTransition\n* @param source\n* @param options\n*/\nfunction useTransition(source, options = {}) {\n\tlet currentId = 0;\n\tconst sourceVal = () => {\n\t\tconst v = toValue(source);\n\t\treturn typeof options.interpolation === \"undefined\" && Array.isArray(v) ? v.map(toValue) : v;\n\t};\n\tconst outputRef = shallowRef(sourceVal());\n\twatch(sourceVal, async (to) => {\n\t\tvar _options$onStarted, _options$onFinished;\n\t\tif (toValue(options.disabled)) return;\n\t\tconst id = ++currentId;\n\t\tif (options.delay) await promiseTimeout(toValue(options.delay));\n\t\tif (id !== currentId) return;\n\t\t(_options$onStarted = options.onStarted) === null || _options$onStarted === void 0 || _options$onStarted.call(options);\n\t\tawait transition(outputRef, outputRef.value, to, {\n\t\t\t...options,\n\t\t\tabort: () => {\n\t\t\t\tvar _options$abort2;\n\t\t\t\treturn id !== currentId || ((_options$abort2 = options.abort) === null || _options$abort2 === void 0 ? void 0 : _options$abort2.call(options));\n\t\t\t}\n\t\t});\n\t\t(_options$onFinished = options.onFinished) === null || _options$onFinished === void 0 || _options$onFinished.call(options);\n\t}, { deep: true });\n\twatch(() => toValue(options.disabled), (disabled) => {\n\t\tif (disabled) {\n\t\t\tcurrentId++;\n\t\t\toutputRef.value = sourceVal();\n\t\t}\n\t});\n\ttryOnScopeDispose(() => {\n\t\tcurrentId++;\n\t});\n\treturn computed(() => toValue(options.disabled) ? sourceVal() : outputRef.value);\n}\n\n//#endregion\n//#region useUrlSearchParams/index.ts\n/**\n* Reactive URLSearchParams\n*\n* @see https://vueuse.org/useUrlSearchParams\n* @param mode\n* @param options\n*/\nfunction useUrlSearchParams(mode = \"history\", options = {}) {\n\tconst { initialValue = {}, removeNullishValues = true, removeFalsyValues = false, write: enableWrite = true, writeMode = \"replace\", window: window$1 = defaultWindow, stringify = (params) => params.toString() } = options;\n\tif (!window$1) return reactive(initialValue);\n\tconst state = reactive({});\n\tfunction getRawParams() {\n\t\tif (mode === \"history\") return window$1.location.search || \"\";\n\t\telse if (mode === \"hash\") {\n\t\t\tconst hash = window$1.location.hash || \"\";\n\t\t\tconst index = hash.indexOf(\"?\");\n\t\t\treturn index > 0 ? hash.slice(index) : \"\";\n\t\t} else return (window$1.location.hash || \"\").replace(/^#/, \"\");\n\t}\n\tfunction constructQuery(params) {\n\t\tconst stringified = stringify(params);\n\t\tif (mode === \"history\") return `${stringified ? `?${stringified}` : \"\"}${window$1.location.hash || \"\"}`;\n\t\tif (mode === \"hash-params\") return `${window$1.location.search || \"\"}${stringified ? `#${stringified}` : \"\"}`;\n\t\tconst hash = window$1.location.hash || \"#\";\n\t\tconst index = hash.indexOf(\"?\");\n\t\tif (index > 0) return `${window$1.location.search || \"\"}${hash.slice(0, index)}${stringified ? `?${stringified}` : \"\"}`;\n\t\treturn `${window$1.location.search || \"\"}${hash}${stringified ? `?${stringified}` : \"\"}`;\n\t}\n\tfunction read() {\n\t\treturn new URLSearchParams(getRawParams());\n\t}\n\tfunction updateState(params) {\n\t\tconst unusedKeys = new Set(Object.keys(state));\n\t\tfor (const key of params.keys()) {\n\t\t\tconst paramsForKey = params.getAll(key);\n\t\t\tstate[key] = paramsForKey.length > 1 ? paramsForKey : params.get(key) || \"\";\n\t\t\tunusedKeys.delete(key);\n\t\t}\n\t\tArray.from(unusedKeys).forEach((key) => delete state[key]);\n\t}\n\tconst { pause, resume } = pausableWatch(state, () => {\n\t\tconst params = new URLSearchParams(\"\");\n\t\tObject.keys(state).forEach((key) => {\n\t\t\tconst mapEntry = state[key];\n\t\t\tif (Array.isArray(mapEntry)) mapEntry.forEach((value) => params.append(key, value));\n\t\t\telse if (removeNullishValues && mapEntry == null) params.delete(key);\n\t\t\telse if (removeFalsyValues && !mapEntry) params.delete(key);\n\t\t\telse params.set(key, mapEntry);\n\t\t});\n\t\twrite(params, false);\n\t}, { deep: true });\n\tfunction write(params, shouldUpdate, shouldWriteHistory = true) {\n\t\tpause();\n\t\tif (shouldUpdate) updateState(params);\n\t\tif (writeMode === \"replace\") window$1.history.replaceState(window$1.history.state, window$1.document.title, window$1.location.pathname + constructQuery(params));\n\t\telse if (shouldWriteHistory) window$1.history.pushState(window$1.history.state, window$1.document.title, window$1.location.pathname + constructQuery(params));\n\t\tnextTick(() => resume());\n\t}\n\tfunction onChanged() {\n\t\tif (!enableWrite) return;\n\t\twrite(read(), true, false);\n\t}\n\tconst listenerOptions = { passive: true };\n\tuseEventListener(window$1, \"popstate\", onChanged, listenerOptions);\n\tif (mode !== \"history\") useEventListener(window$1, \"hashchange\", onChanged, listenerOptions);\n\tconst initial = read();\n\tif (initial.keys().next().value) updateState(initial);\n\telse Object.assign(state, initialValue);\n\treturn state;\n}\n\n//#endregion\n//#region useUserMedia/index.ts\n/**\n* Reactive `mediaDevices.getUserMedia` streaming\n*\n* @see https://vueuse.org/useUserMedia\n* @param options\n*/\nfunction useUserMedia(options = {}) {\n\tvar _options$enabled, _options$autoSwitch;\n\tconst enabled = shallowRef((_options$enabled = options.enabled) !== null && _options$enabled !== void 0 ? _options$enabled : false);\n\tconst autoSwitch = shallowRef((_options$autoSwitch = options.autoSwitch) !== null && _options$autoSwitch !== void 0 ? _options$autoSwitch : true);\n\tconst constraints = ref(options.constraints);\n\tconst { navigator: navigator$1 = defaultNavigator } = options;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => {\n\t\tvar _navigator$mediaDevic;\n\t\treturn navigator$1 === null || navigator$1 === void 0 || (_navigator$mediaDevic = navigator$1.mediaDevices) === null || _navigator$mediaDevic === void 0 ? void 0 : _navigator$mediaDevic.getUserMedia;\n\t});\n\tconst stream = shallowRef();\n\tfunction getDeviceOptions(type) {\n\t\tswitch (type) {\n\t\t\tcase \"video\":\n\t\t\t\tif (constraints.value) return constraints.value.video || false;\n\t\t\t\tbreak;\n\t\t\tcase \"audio\":\n\t\t\t\tif (constraints.value) return constraints.value.audio || false;\n\t\t\t\tbreak;\n\t\t}\n\t}\n\tasync function _start() {\n\t\tif (!isSupported.value || stream.value) return;\n\t\tstream.value = await navigator$1.mediaDevices.getUserMedia({\n\t\t\tvideo: getDeviceOptions(\"video\"),\n\t\t\taudio: getDeviceOptions(\"audio\")\n\t\t});\n\t\treturn stream.value;\n\t}\n\tfunction _stop() {\n\t\tvar _stream$value;\n\t\t(_stream$value = stream.value) === null || _stream$value === void 0 || _stream$value.getTracks().forEach((t) => t.stop());\n\t\tstream.value = void 0;\n\t}\n\tfunction stop() {\n\t\t_stop();\n\t\tenabled.value = false;\n\t}\n\tasync function start() {\n\t\tawait _start();\n\t\tif (stream.value) enabled.value = true;\n\t\treturn stream.value;\n\t}\n\tasync function restart() {\n\t\t_stop();\n\t\treturn await start();\n\t}\n\twatch(enabled, (v) => {\n\t\tif (v) _start();\n\t\telse _stop();\n\t}, { immediate: true });\n\twatch(constraints, () => {\n\t\tif (autoSwitch.value && stream.value) restart();\n\t}, {\n\t\timmediate: true,\n\t\tdeep: true\n\t});\n\ttryOnScopeDispose(() => {\n\t\tstop();\n\t});\n\treturn {\n\t\tisSupported,\n\t\tstream,\n\t\tstart,\n\t\tstop,\n\t\trestart,\n\t\tconstraints,\n\t\tenabled,\n\t\tautoSwitch\n\t};\n}\n\n//#endregion\n//#region useVModel/index.ts\n/**\n* Shorthand for v-model binding, props + emit -> ref\n*\n* @see https://vueuse.org/useVModel\n* @param props\n* @param key (default 'modelValue')\n* @param emit\n* @param options\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useVModel(props, key, emit, options = {}) {\n\tvar _vm$$emit, _vm$proxy;\n\tconst { clone = false, passive = false, eventName, deep = false, defaultValue, shouldEmit } = options;\n\tconst vm = getCurrentInstance();\n\tconst _emit = emit || (vm === null || vm === void 0 ? void 0 : vm.emit) || (vm === null || vm === void 0 || (_vm$$emit = vm.$emit) === null || _vm$$emit === void 0 ? void 0 : _vm$$emit.bind(vm)) || (vm === null || vm === void 0 || (_vm$proxy = vm.proxy) === null || _vm$proxy === void 0 || (_vm$proxy = _vm$proxy.$emit) === null || _vm$proxy === void 0 ? void 0 : _vm$proxy.bind(vm === null || vm === void 0 ? void 0 : vm.proxy));\n\tlet event = eventName;\n\tif (!key) key = \"modelValue\";\n\tevent = event || `update:${key.toString()}`;\n\tconst cloneFn = (val) => !clone ? val : typeof clone === \"function\" ? clone(val) : cloneFnJSON(val);\n\tconst getValue$1 = () => isDef(props[key]) ? cloneFn(props[key]) : defaultValue;\n\tconst triggerEmit = (value) => {\n\t\tif (shouldEmit) {\n\t\t\tif (shouldEmit(value)) _emit(event, value);\n\t\t} else _emit(event, value);\n\t};\n\tif (passive) {\n\t\tconst proxy = ref(getValue$1());\n\t\tlet isUpdating = false;\n\t\twatch(() => props[key], (v) => {\n\t\t\tif (!isUpdating) {\n\t\t\t\tisUpdating = true;\n\t\t\t\tproxy.value = cloneFn(v);\n\t\t\t\tnextTick(() => isUpdating = false);\n\t\t\t}\n\t\t});\n\t\twatch(proxy, (v) => {\n\t\t\tif (!isUpdating && (v !== props[key] || deep)) triggerEmit(v);\n\t\t}, { deep });\n\t\treturn proxy;\n\t} else return computed({\n\t\tget() {\n\t\t\treturn getValue$1();\n\t\t},\n\t\tset(value) {\n\t\t\ttriggerEmit(value);\n\t\t}\n\t});\n}\n\n//#endregion\n//#region useVModels/index.ts\n/**\n* Shorthand for props v-model binding. Think like `toRefs(props)` but changes will also emit out.\n*\n* @see https://vueuse.org/useVModels\n* @param props\n* @param emit\n* @param options\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useVModels(props, emit, options = {}) {\n\tconst ret = {};\n\tfor (const key in props) ret[key] = useVModel(props, key, emit, options);\n\treturn ret;\n}\n\n//#endregion\n//#region useVibrate/index.ts\n/**\n* Reactive vibrate\n*\n* @see https://vueuse.org/useVibrate\n* @see https://developer.mozilla.org/en-US/docs/Web/API/Vibration_API\n* @param options\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useVibrate(options) {\n\tconst { pattern = [], interval = 0, navigator: navigator$1 = defaultNavigator } = options || {};\n\tconst isSupported = /* @__PURE__ */ useSupported(() => typeof navigator$1 !== \"undefined\" && \"vibrate\" in navigator$1);\n\tconst patternRef = toRef(pattern);\n\tlet intervalControls;\n\tconst vibrate = (pattern$1 = patternRef.value) => {\n\t\tif (isSupported.value) navigator$1.vibrate(pattern$1);\n\t};\n\tconst stop = () => {\n\t\tif (isSupported.value) navigator$1.vibrate(0);\n\t\tintervalControls === null || intervalControls === void 0 || intervalControls.pause();\n\t};\n\tif (interval > 0) intervalControls = useIntervalFn(vibrate, interval, {\n\t\timmediate: false,\n\t\timmediateCallback: false\n\t});\n\treturn {\n\t\tisSupported,\n\t\tpattern,\n\t\tintervalControls,\n\t\tvibrate,\n\t\tstop\n\t};\n}\n\n//#endregion\n//#region useVirtualList/index.ts\n/**\n* Please consider using [`vue-virtual-scroller`](https://github.com/Akryum/vue-virtual-scroller) if you are looking for more features.\n*/\nfunction useVirtualList(list, options) {\n\tconst { containerStyle, wrapperProps, scrollTo, calculateRange, currentList, containerRef } = \"itemHeight\" in options ? useVerticalVirtualList(options, list) : useHorizontalVirtualList(options, list);\n\treturn {\n\t\tlist: currentList,\n\t\tscrollTo,\n\t\tcontainerProps: {\n\t\t\tref: containerRef,\n\t\t\tonScroll: () => {\n\t\t\t\tcalculateRange();\n\t\t\t},\n\t\t\tstyle: containerStyle\n\t\t},\n\t\twrapperProps\n\t};\n}\nfunction useVirtualListResources(list) {\n\tconst containerRef = shallowRef(null);\n\tconst size = useElementSize(containerRef);\n\tconst currentList = ref([]);\n\tconst source = shallowRef(list);\n\treturn {\n\t\tstate: ref({\n\t\t\tstart: 0,\n\t\t\tend: 10\n\t\t}),\n\t\tsource,\n\t\tcurrentList,\n\t\tsize,\n\t\tcontainerRef\n\t};\n}\nfunction createGetViewCapacity(state, source, itemSize) {\n\treturn (containerSize) => {\n\t\tif (typeof itemSize === \"number\") return Math.ceil(containerSize / itemSize);\n\t\tconst { start = 0 } = state.value;\n\t\tlet sum = 0;\n\t\tlet capacity = 0;\n\t\tfor (let i = start; i < source.value.length; i++) {\n\t\t\tconst size = itemSize(i);\n\t\t\tsum += size;\n\t\t\tcapacity = i;\n\t\t\tif (sum > containerSize) break;\n\t\t}\n\t\treturn capacity - start;\n\t};\n}\nfunction createGetOffset(source, itemSize) {\n\treturn (scrollDirection) => {\n\t\tif (typeof itemSize === \"number\") return Math.floor(scrollDirection / itemSize) + 1;\n\t\tlet sum = 0;\n\t\tlet offset = 0;\n\t\tfor (let i = 0; i < source.value.length; i++) {\n\t\t\tconst size = itemSize(i);\n\t\t\tsum += size;\n\t\t\tif (sum >= scrollDirection) {\n\t\t\t\toffset = i;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn offset + 1;\n\t};\n}\nfunction createCalculateRange(type, overscan, getOffset, getViewCapacity, { containerRef, state, currentList, source }) {\n\treturn () => {\n\t\tconst element = containerRef.value;\n\t\tif (element) {\n\t\t\tconst offset = getOffset(type === \"vertical\" ? element.scrollTop : element.scrollLeft);\n\t\t\tconst viewCapacity = getViewCapacity(type === \"vertical\" ? element.clientHeight : element.clientWidth);\n\t\t\tconst from = offset - overscan;\n\t\t\tconst to = offset + viewCapacity + overscan;\n\t\t\tstate.value = {\n\t\t\t\tstart: from < 0 ? 0 : from,\n\t\t\t\tend: to > source.value.length ? source.value.length : to\n\t\t\t};\n\t\t\tcurrentList.value = source.value.slice(state.value.start, state.value.end).map((ele, index) => ({\n\t\t\t\tdata: ele,\n\t\t\t\tindex: index + state.value.start\n\t\t\t}));\n\t\t}\n\t};\n}\nfunction createGetDistance(itemSize, source) {\n\treturn (index) => {\n\t\tif (typeof itemSize === \"number\") return index * itemSize;\n\t\treturn source.value.slice(0, index).reduce((sum, _, i) => sum + itemSize(i), 0);\n\t};\n}\nfunction useWatchForSizes(size, list, containerRef, calculateRange) {\n\twatch([\n\t\tsize.width,\n\t\tsize.height,\n\t\t() => toValue(list),\n\t\tcontainerRef\n\t], () => {\n\t\tcalculateRange();\n\t});\n}\nfunction createComputedTotalSize(itemSize, source) {\n\treturn computed(() => {\n\t\tif (typeof itemSize === \"number\") return source.value.length * itemSize;\n\t\treturn source.value.reduce((sum, _, index) => sum + itemSize(index), 0);\n\t});\n}\nconst scrollToDictionaryForElementScrollKey = {\n\thorizontal: \"scrollLeft\",\n\tvertical: \"scrollTop\"\n};\nfunction createScrollTo(type, calculateRange, getDistance, containerRef) {\n\treturn (index) => {\n\t\tif (containerRef.value) {\n\t\t\tcontainerRef.value[scrollToDictionaryForElementScrollKey[type]] = getDistance(index);\n\t\t\tcalculateRange();\n\t\t}\n\t};\n}\nfunction useHorizontalVirtualList(options, list) {\n\tconst resources = useVirtualListResources(list);\n\tconst { state, source, currentList, size, containerRef } = resources;\n\tconst containerStyle = { overflowX: \"auto\" };\n\tconst { itemWidth, overscan = 5 } = options;\n\tconst getViewCapacity = createGetViewCapacity(state, source, itemWidth);\n\tconst calculateRange = createCalculateRange(\"horizontal\", overscan, createGetOffset(source, itemWidth), getViewCapacity, resources);\n\tconst getDistanceLeft = createGetDistance(itemWidth, source);\n\tconst offsetLeft = computed(() => getDistanceLeft(state.value.start));\n\tconst totalWidth = createComputedTotalSize(itemWidth, source);\n\tuseWatchForSizes(size, list, containerRef, calculateRange);\n\treturn {\n\t\tscrollTo: createScrollTo(\"horizontal\", calculateRange, getDistanceLeft, containerRef),\n\t\tcalculateRange,\n\t\twrapperProps: computed(() => {\n\t\t\treturn { style: {\n\t\t\t\theight: \"100%\",\n\t\t\t\twidth: `${totalWidth.value - offsetLeft.value}px`,\n\t\t\t\tmarginLeft: `${offsetLeft.value}px`,\n\t\t\t\tdisplay: \"flex\"\n\t\t\t} };\n\t\t}),\n\t\tcontainerStyle,\n\t\tcurrentList,\n\t\tcontainerRef\n\t};\n}\nfunction useVerticalVirtualList(options, list) {\n\tconst resources = useVirtualListResources(list);\n\tconst { state, source, currentList, size, containerRef } = resources;\n\tconst containerStyle = { overflowY: \"auto\" };\n\tconst { itemHeight, overscan = 5 } = options;\n\tconst getViewCapacity = createGetViewCapacity(state, source, itemHeight);\n\tconst calculateRange = createCalculateRange(\"vertical\", overscan, createGetOffset(source, itemHeight), getViewCapacity, resources);\n\tconst getDistanceTop = createGetDistance(itemHeight, source);\n\tconst offsetTop = computed(() => getDistanceTop(state.value.start));\n\tconst totalHeight = createComputedTotalSize(itemHeight, source);\n\tuseWatchForSizes(size, list, containerRef, calculateRange);\n\treturn {\n\t\tcalculateRange,\n\t\tscrollTo: createScrollTo(\"vertical\", calculateRange, getDistanceTop, containerRef),\n\t\tcontainerStyle,\n\t\twrapperProps: computed(() => {\n\t\t\treturn { style: {\n\t\t\t\twidth: \"100%\",\n\t\t\t\theight: `${totalHeight.value - offsetTop.value}px`,\n\t\t\t\tmarginTop: `${offsetTop.value}px`\n\t\t\t} };\n\t\t}),\n\t\tcurrentList,\n\t\tcontainerRef\n\t};\n}\n\n//#endregion\n//#region useWakeLock/index.ts\n/**\n* Reactive Screen Wake Lock API.\n*\n* @see https://vueuse.org/useWakeLock\n* @param options\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useWakeLock(options = {}) {\n\tconst { navigator: navigator$1 = defaultNavigator, document: document$1 = defaultDocument } = options;\n\tconst requestedType = shallowRef(false);\n\tconst sentinel = shallowRef(null);\n\tconst documentVisibility = useDocumentVisibility({ document: document$1 });\n\tconst isSupported = /* @__PURE__ */ useSupported(() => navigator$1 && \"wakeLock\" in navigator$1);\n\tconst isActive = computed(() => !!sentinel.value && documentVisibility.value === \"visible\");\n\tif (isSupported.value) {\n\t\tuseEventListener(sentinel, \"release\", () => {\n\t\t\tvar _sentinel$value$type, _sentinel$value;\n\t\t\trequestedType.value = (_sentinel$value$type = (_sentinel$value = sentinel.value) === null || _sentinel$value === void 0 ? void 0 : _sentinel$value.type) !== null && _sentinel$value$type !== void 0 ? _sentinel$value$type : false;\n\t\t}, { passive: true });\n\t\twhenever(() => documentVisibility.value === \"visible\" && (document$1 === null || document$1 === void 0 ? void 0 : document$1.visibilityState) === \"visible\" && requestedType.value, (type) => {\n\t\t\trequestedType.value = false;\n\t\t\tforceRequest(type);\n\t\t});\n\t}\n\tasync function forceRequest(type) {\n\t\tvar _sentinel$value2;\n\t\tawait ((_sentinel$value2 = sentinel.value) === null || _sentinel$value2 === void 0 ? void 0 : _sentinel$value2.release());\n\t\tsentinel.value = isSupported.value ? await navigator$1.wakeLock.request(type) : null;\n\t}\n\tasync function request(type) {\n\t\tif (documentVisibility.value === \"visible\") await forceRequest(type);\n\t\telse requestedType.value = type;\n\t}\n\tasync function release() {\n\t\trequestedType.value = false;\n\t\tconst s = sentinel.value;\n\t\tsentinel.value = null;\n\t\tawait (s === null || s === void 0 ? void 0 : s.release());\n\t}\n\treturn {\n\t\tsentinel,\n\t\tisSupported,\n\t\tisActive,\n\t\trequest,\n\t\tforceRequest,\n\t\trelease\n\t};\n}\n\n//#endregion\n//#region useWebNotification/index.ts\n/**\n* Reactive useWebNotification\n*\n* @see https://vueuse.org/useWebNotification\n* @see https://developer.mozilla.org/en-US/docs/Web/API/notification\n*/\nfunction useWebNotification(options = {}) {\n\tconst { window: window$1 = defaultWindow, requestPermissions: _requestForPermissions = true } = options;\n\tconst defaultWebNotificationOptions = options;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => {\n\t\tif (!window$1 || !(\"Notification\" in window$1)) return false;\n\t\tif (Notification.permission === \"granted\") return true;\n\t\ttry {\n\t\t\tconst notification$1 = new Notification(\"\");\n\t\t\tnotification$1.onshow = () => {\n\t\t\t\tnotification$1.close();\n\t\t\t};\n\t\t} catch (e) {\n\t\t\tif (e.name === \"TypeError\") return false;\n\t\t}\n\t\treturn true;\n\t});\n\tconst permissionGranted = shallowRef(isSupported.value && \"permission\" in Notification && Notification.permission === \"granted\");\n\tconst notification = ref(null);\n\tconst ensurePermissions = async () => {\n\t\tif (!isSupported.value) return;\n\t\tif (!permissionGranted.value && Notification.permission !== \"denied\") {\n\t\t\tif (await Notification.requestPermission() === \"granted\") permissionGranted.value = true;\n\t\t}\n\t\treturn permissionGranted.value;\n\t};\n\tconst { on: onClick, trigger: clickTrigger } = createEventHook();\n\tconst { on: onShow, trigger: showTrigger } = createEventHook();\n\tconst { on: onError, trigger: errorTrigger } = createEventHook();\n\tconst { on: onClose, trigger: closeTrigger } = createEventHook();\n\tconst show = async (overrides) => {\n\t\tif (!isSupported.value || !permissionGranted.value) return;\n\t\tconst options$1 = Object.assign({}, defaultWebNotificationOptions, overrides);\n\t\tnotification.value = new Notification(options$1.title || \"\", options$1);\n\t\tnotification.value.onclick = clickTrigger;\n\t\tnotification.value.onshow = showTrigger;\n\t\tnotification.value.onerror = errorTrigger;\n\t\tnotification.value.onclose = closeTrigger;\n\t\treturn notification.value;\n\t};\n\tconst close = () => {\n\t\tif (notification.value) notification.value.close();\n\t\tnotification.value = null;\n\t};\n\tif (_requestForPermissions) tryOnMounted(ensurePermissions);\n\ttryOnScopeDispose(close);\n\tif (isSupported.value && window$1) {\n\t\tconst document$1 = window$1.document;\n\t\tuseEventListener(document$1, \"visibilitychange\", (e) => {\n\t\t\te.preventDefault();\n\t\t\tif (document$1.visibilityState === \"visible\") close();\n\t\t});\n\t}\n\treturn {\n\t\tisSupported,\n\t\tnotification,\n\t\tensurePermissions,\n\t\tpermissionGranted,\n\t\tshow,\n\t\tclose,\n\t\tonClick,\n\t\tonShow,\n\t\tonError,\n\t\tonClose\n\t};\n}\n\n//#endregion\n//#region useWebSocket/index.ts\nconst DEFAULT_PING_MESSAGE = \"ping\";\nfunction resolveNestedOptions(options) {\n\tif (options === true) return {};\n\treturn options;\n}\n/**\n* Reactive WebSocket client.\n*\n* @see https://vueuse.org/useWebSocket\n* @param url\n*/\nfunction useWebSocket(url, options = {}) {\n\tconst { onConnected, onDisconnected, onError, onMessage, immediate = true, autoConnect = true, autoClose = true, protocols = [] } = options;\n\tconst data = ref(null);\n\tconst status = shallowRef(\"CLOSED\");\n\tconst wsRef = ref();\n\tconst urlRef = toRef(url);\n\tlet heartbeatPause;\n\tlet heartbeatResume;\n\tlet explicitlyClosed = false;\n\tlet retried = 0;\n\tlet bufferedData = [];\n\tlet retryTimeout;\n\tlet pongTimeoutWait;\n\tconst _sendBuffer = () => {\n\t\tif (bufferedData.length && wsRef.value && status.value === \"OPEN\") {\n\t\t\tfor (const buffer of bufferedData) wsRef.value.send(buffer);\n\t\t\tbufferedData = [];\n\t\t}\n\t};\n\tconst resetRetry = () => {\n\t\tif (retryTimeout != null) {\n\t\t\tclearTimeout(retryTimeout);\n\t\t\tretryTimeout = void 0;\n\t\t}\n\t};\n\tconst resetHeartbeat = () => {\n\t\tclearTimeout(pongTimeoutWait);\n\t\tpongTimeoutWait = void 0;\n\t};\n\tconst close = (code = 1e3, reason) => {\n\t\tresetRetry();\n\t\tif (!isClient && !isWorker || !wsRef.value) return;\n\t\texplicitlyClosed = true;\n\t\tresetHeartbeat();\n\t\theartbeatPause === null || heartbeatPause === void 0 || heartbeatPause();\n\t\twsRef.value.close(code, reason);\n\t\twsRef.value = void 0;\n\t};\n\tconst send = (data$1, useBuffer = true) => {\n\t\tif (!wsRef.value || status.value !== \"OPEN\") {\n\t\t\tif (useBuffer) bufferedData.push(data$1);\n\t\t\treturn false;\n\t\t}\n\t\t_sendBuffer();\n\t\twsRef.value.send(data$1);\n\t\treturn true;\n\t};\n\tconst _init = () => {\n\t\tif (explicitlyClosed || typeof urlRef.value === \"undefined\") return;\n\t\tconst ws = new WebSocket(urlRef.value, protocols);\n\t\twsRef.value = ws;\n\t\tstatus.value = \"CONNECTING\";\n\t\tws.onopen = () => {\n\t\t\tstatus.value = \"OPEN\";\n\t\t\tretried = 0;\n\t\t\tonConnected === null || onConnected === void 0 || onConnected(ws);\n\t\t\theartbeatResume === null || heartbeatResume === void 0 || heartbeatResume();\n\t\t\t_sendBuffer();\n\t\t};\n\t\tws.onclose = (ev) => {\n\t\t\tstatus.value = \"CLOSED\";\n\t\t\tresetHeartbeat();\n\t\t\theartbeatPause === null || heartbeatPause === void 0 || heartbeatPause();\n\t\t\tonDisconnected === null || onDisconnected === void 0 || onDisconnected(ws, ev);\n\t\t\tif (!explicitlyClosed && options.autoReconnect && (wsRef.value == null || ws === wsRef.value)) {\n\t\t\t\tconst { retries = -1, delay = 1e3, onFailed } = resolveNestedOptions(options.autoReconnect);\n\t\t\t\tif ((typeof retries === \"function\" ? retries : () => typeof retries === \"number\" && (retries < 0 || retried < retries))(retried)) {\n\t\t\t\t\tretried += 1;\n\t\t\t\t\tretryTimeout = setTimeout(_init, delay);\n\t\t\t\t} else onFailed === null || onFailed === void 0 || onFailed();\n\t\t\t}\n\t\t};\n\t\tws.onerror = (e) => {\n\t\t\tonError === null || onError === void 0 || onError(ws, e);\n\t\t};\n\t\tws.onmessage = (e) => {\n\t\t\tif (options.heartbeat) {\n\t\t\t\tresetHeartbeat();\n\t\t\t\tconst { message = DEFAULT_PING_MESSAGE, responseMessage = message } = resolveNestedOptions(options.heartbeat);\n\t\t\t\tif (e.data === toValue(responseMessage)) return;\n\t\t\t}\n\t\t\tdata.value = e.data;\n\t\t\tonMessage === null || onMessage === void 0 || onMessage(ws, e);\n\t\t};\n\t};\n\tif (options.heartbeat) {\n\t\tconst { message = DEFAULT_PING_MESSAGE, interval = 1e3, pongTimeout = 1e3 } = resolveNestedOptions(options.heartbeat);\n\t\tconst { pause, resume } = useIntervalFn(() => {\n\t\t\tsend(toValue(message), false);\n\t\t\tif (pongTimeoutWait != null) return;\n\t\t\tpongTimeoutWait = setTimeout(() => {\n\t\t\t\tclose();\n\t\t\t\texplicitlyClosed = false;\n\t\t\t}, pongTimeout);\n\t\t}, interval, { immediate: false });\n\t\theartbeatPause = pause;\n\t\theartbeatResume = resume;\n\t}\n\tif (autoClose) {\n\t\tif (isClient) useEventListener(\"beforeunload\", () => close(), { passive: true });\n\t\ttryOnScopeDispose(close);\n\t}\n\tconst open = () => {\n\t\tif (!isClient && !isWorker) return;\n\t\tclose();\n\t\texplicitlyClosed = false;\n\t\tretried = 0;\n\t\t_init();\n\t};\n\tif (immediate) open();\n\tif (autoConnect) watch(urlRef, open);\n\treturn {\n\t\tdata,\n\t\tstatus,\n\t\tclose,\n\t\tsend,\n\t\topen,\n\t\tws: wsRef\n\t};\n}\n\n//#endregion\n//#region useWebWorker/index.ts\nfunction useWebWorker(arg0, workerOptions, options) {\n\tconst { window: window$1 = defaultWindow } = options !== null && options !== void 0 ? options : {};\n\tconst data = ref(null);\n\tconst worker = shallowRef();\n\tconst post = (...args) => {\n\t\tif (!worker.value) return;\n\t\tworker.value.postMessage(...args);\n\t};\n\tconst terminate = function terminate$1() {\n\t\tif (!worker.value) return;\n\t\tworker.value.terminate();\n\t};\n\tif (window$1) {\n\t\tif (typeof arg0 === \"string\") worker.value = new Worker(arg0, workerOptions);\n\t\telse if (typeof arg0 === \"function\") worker.value = arg0();\n\t\telse worker.value = arg0;\n\t\tworker.value.onmessage = (e) => {\n\t\t\tdata.value = e.data;\n\t\t};\n\t\ttryOnScopeDispose(() => {\n\t\t\tif (worker.value) worker.value.terminate();\n\t\t});\n\t}\n\treturn {\n\t\tdata,\n\t\tpost,\n\t\tterminate,\n\t\tworker\n\t};\n}\n\n//#endregion\n//#region useWebWorkerFn/lib/depsParser.ts\n/**\n*\n* Concatenates the dependencies into a comma separated string.\n* this string will then be passed as an argument to the \"importScripts\" function\n*\n* @param deps array of string\n* @param localDeps array of function\n* @returns a string composed by the concatenation of the array\n* elements \"deps\" and \"importScripts\".\n*\n* @example\n* depsParser(['demo1', 'demo2']) // return importScripts('demo1', 'demo2')\n*/\nfunction depsParser(deps, localDeps) {\n\tif (deps.length === 0 && localDeps.length === 0) return \"\";\n\tconst depsString = deps.map((dep) => `'${dep}'`).toString();\n\tconst depsFunctionString = localDeps.filter((dep) => typeof dep === \"function\").map((fn) => {\n\t\tconst str = fn.toString();\n\t\tif (str.trim().startsWith(\"function\")) return str;\n\t\telse return `const ${fn.name} = ${str}`;\n\t}).join(\";\");\n\tconst importString = `importScripts(${depsString});`;\n\treturn `${depsString.trim() === \"\" ? \"\" : importString} ${depsFunctionString}`;\n}\nvar depsParser_default = depsParser;\n\n//#endregion\n//#region useWebWorkerFn/lib/jobRunner.ts\n/**\n* This function accepts as a parameter a function \"userFunc\"\n* And as a result returns an anonymous function.\n* This anonymous function, accepts as arguments,\n* the parameters to pass to the function \"useArgs\" and returns a Promise\n* This function can be used as a wrapper, only inside a Worker\n* because it depends by \"postMessage\".\n*\n* @param userFunc {Function} fn the function to run with web worker\n*\n* @returns returns a function that accepts the parameters\n* to be passed to the \"userFunc\" function\n*/\nfunction jobRunner(userFunc) {\n\treturn (e) => {\n\t\tconst userFuncArgs = e.data[0];\n\t\treturn Promise.resolve(userFunc.apply(void 0, userFuncArgs)).then((result) => {\n\t\t\tpostMessage([\"SUCCESS\", result]);\n\t\t}).catch((error) => {\n\t\t\tpostMessage([\"ERROR\", error]);\n\t\t});\n\t};\n}\nvar jobRunner_default = jobRunner;\n\n//#endregion\n//#region useWebWorkerFn/lib/createWorkerBlobUrl.ts\n/**\n* Converts the \"fn\" function into the syntax needed to be executed within a web worker\n*\n* @param fn the function to run with web worker\n* @param deps array of strings, imported into the worker through \"importScripts\"\n* @param localDeps array of function, local dependencies\n*\n* @returns a blob url, containing the code of \"fn\" as a string\n*\n* @example\n* createWorkerBlobUrl((a,b) => a+b, [])\n* // return \"onmessage=return Promise.resolve((a,b) => a + b)\n* .then(postMessage(['SUCCESS', result]))\n* .catch(postMessage(['ERROR', error])\"\n*/\nfunction createWorkerBlobUrl(fn, deps, localDeps) {\n\tconst blobCode = `${depsParser_default(deps, localDeps)}; onmessage=(${jobRunner_default})(${fn})`;\n\tconst blob = new Blob([blobCode], { type: \"text/javascript\" });\n\treturn URL.createObjectURL(blob);\n}\nvar createWorkerBlobUrl_default = createWorkerBlobUrl;\n\n//#endregion\n//#region useWebWorkerFn/index.ts\n/**\n* Run expensive function without blocking the UI, using a simple syntax that makes use of Promise.\n*\n* @see https://vueuse.org/useWebWorkerFn\n* @param fn\n* @param options\n*/\nfunction useWebWorkerFn(fn, options = {}) {\n\tconst { dependencies = [], localDependencies = [], timeout, window: window$1 = defaultWindow } = options;\n\tconst worker = ref();\n\tconst workerStatus = shallowRef(\"PENDING\");\n\tconst promise = ref({});\n\tconst timeoutId = shallowRef();\n\tconst workerTerminate = (status = \"PENDING\") => {\n\t\tif (worker.value && worker.value._url && window$1) {\n\t\t\tworker.value.terminate();\n\t\t\tURL.revokeObjectURL(worker.value._url);\n\t\t\tpromise.value = {};\n\t\t\tworker.value = void 0;\n\t\t\twindow$1.clearTimeout(timeoutId.value);\n\t\t\tworkerStatus.value = status;\n\t\t}\n\t};\n\tworkerTerminate();\n\ttryOnScopeDispose(workerTerminate);\n\tconst generateWorker = () => {\n\t\tconst blobUrl = createWorkerBlobUrl_default(fn, dependencies, localDependencies);\n\t\tconst newWorker = new Worker(blobUrl);\n\t\tnewWorker._url = blobUrl;\n\t\tnewWorker.onmessage = (e) => {\n\t\t\tconst { resolve = () => {}, reject = () => {} } = promise.value;\n\t\t\tconst [status, result] = e.data;\n\t\t\tswitch (status) {\n\t\t\t\tcase \"SUCCESS\":\n\t\t\t\t\tresolve(result);\n\t\t\t\t\tworkerTerminate(status);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\treject(result);\n\t\t\t\t\tworkerTerminate(\"ERROR\");\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t};\n\t\tnewWorker.onerror = (e) => {\n\t\t\tconst { reject = () => {} } = promise.value;\n\t\t\te.preventDefault();\n\t\t\treject(e);\n\t\t\tworkerTerminate(\"ERROR\");\n\t\t};\n\t\tif (timeout) timeoutId.value = setTimeout(() => workerTerminate(\"TIMEOUT_EXPIRED\"), timeout);\n\t\treturn newWorker;\n\t};\n\tconst callWorker = (...fnArgs) => new Promise((resolve, reject) => {\n\t\tvar _worker$value;\n\t\tpromise.value = {\n\t\t\tresolve,\n\t\t\treject\n\t\t};\n\t\t(_worker$value = worker.value) === null || _worker$value === void 0 || _worker$value.postMessage([[...fnArgs]]);\n\t\tworkerStatus.value = \"RUNNING\";\n\t});\n\tconst workerFn = (...fnArgs) => {\n\t\tif (workerStatus.value === \"RUNNING\") {\n\t\t\tconsole.error(\"[useWebWorkerFn] You can only run one instance of the worker at a time.\");\n\t\t\treturn Promise.reject();\n\t\t}\n\t\tworker.value = generateWorker();\n\t\treturn callWorker(...fnArgs);\n\t};\n\treturn {\n\t\tworkerFn,\n\t\tworkerStatus,\n\t\tworkerTerminate\n\t};\n}\n\n//#endregion\n//#region useWindowFocus/index.ts\n/**\n* Reactively track window focus with `window.onfocus` and `window.onblur`.\n*\n* @see https://vueuse.org/useWindowFocus\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useWindowFocus(options = {}) {\n\tconst { window: window$1 = defaultWindow } = options;\n\tif (!window$1) return shallowRef(false);\n\tconst focused = shallowRef(window$1.document.hasFocus());\n\tconst listenerOptions = { passive: true };\n\tuseEventListener(window$1, \"blur\", () => {\n\t\tfocused.value = false;\n\t}, listenerOptions);\n\tuseEventListener(window$1, \"focus\", () => {\n\t\tfocused.value = true;\n\t}, listenerOptions);\n\treturn focused;\n}\n\n//#endregion\n//#region useWindowScroll/index.ts\n/**\n* Reactive window scroll.\n*\n* @see https://vueuse.org/useWindowScroll\n* @param options\n*/\nfunction useWindowScroll(options = {}) {\n\tconst { window: window$1 = defaultWindow,...rest } = options;\n\treturn useScroll(window$1, rest);\n}\n\n//#endregion\n//#region useWindowSize/index.ts\n/**\n* Reactive window size.\n*\n* @see https://vueuse.org/useWindowSize\n* @param options\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useWindowSize(options = {}) {\n\tconst { window: window$1 = defaultWindow, initialWidth = Number.POSITIVE_INFINITY, initialHeight = Number.POSITIVE_INFINITY, listenOrientation = true, includeScrollbar = true, type = \"inner\" } = options;\n\tconst width = shallowRef(initialWidth);\n\tconst height = shallowRef(initialHeight);\n\tconst update = () => {\n\t\tif (window$1) if (type === \"outer\") {\n\t\t\twidth.value = window$1.outerWidth;\n\t\t\theight.value = window$1.outerHeight;\n\t\t} else if (type === \"visual\" && window$1.visualViewport) {\n\t\t\tconst { width: visualViewportWidth, height: visualViewportHeight, scale } = window$1.visualViewport;\n\t\t\twidth.value = Math.round(visualViewportWidth * scale);\n\t\t\theight.value = Math.round(visualViewportHeight * scale);\n\t\t} else if (includeScrollbar) {\n\t\t\twidth.value = window$1.innerWidth;\n\t\t\theight.value = window$1.innerHeight;\n\t\t} else {\n\t\t\twidth.value = window$1.document.documentElement.clientWidth;\n\t\t\theight.value = window$1.document.documentElement.clientHeight;\n\t\t}\n\t};\n\tupdate();\n\ttryOnMounted(update);\n\tconst listenerOptions = { passive: true };\n\tuseEventListener(\"resize\", update, listenerOptions);\n\tif (window$1 && type === \"visual\" && window$1.visualViewport) useEventListener(window$1.visualViewport, \"resize\", update, listenerOptions);\n\tif (listenOrientation) watch(useMediaQuery(\"(orientation: portrait)\"), () => update());\n\treturn {\n\t\twidth,\n\t\theight\n\t};\n}\n\n//#endregion\nexport { DefaultMagicKeysAliasMap, StorageSerializers, TransitionPresets, asyncComputed, breakpointsAntDesign, breakpointsBootstrapV5, breakpointsElement, breakpointsMasterCss, breakpointsPrimeFlex, breakpointsQuasar, breakpointsSematic, breakpointsTailwind, breakpointsVuetify, breakpointsVuetifyV2, breakpointsVuetifyV3, cloneFnJSON, computedAsync, computedInject, createFetch, createReusableTemplate, createTemplatePromise, createUnrefFn, customStorageEventName, defaultDocument, defaultLocation, defaultNavigator, defaultWindow, executeTransition, formatTimeAgo, formatTimeAgoIntl, formatTimeAgoIntlParts, getSSRHandler, mapGamepadToXbox360Controller, onClickOutside, onElementRemoval, onKeyDown, onKeyPressed, onKeyStroke, onKeyUp, onLongPress, onStartTyping, provideSSRWidth, setSSRHandler, templateRef, transition, unrefElement, useActiveElement, useAnimate, useAsyncQueue, useAsyncState, useBase64, useBattery, useBluetooth, useBreakpoints, useBroadcastChannel, useBrowserLocation, useCached, useClipboard, useClipboardItems, useCloned, useColorMode, useConfirmDialog, useCountdown, useCssVar, useCurrentElement, useCycleList, useDark, useDebouncedRefHistory, useDeviceMotion, useDeviceOrientation, useDevicePixelRatio, useDevicesList, useDisplayMedia, useDocumentVisibility, useDraggable, useDropZone, useElementBounding, useElementByPoint, useElementHover, useElementSize, useElementVisibility, useEventBus, useEventListener, useEventSource, useEyeDropper, useFavicon, useFetch, useFileDialog, useFileSystemAccess, useFocus, useFocusWithin, useFps, useFullscreen, useGamepad, useGeolocation, useIdle, useImage, useInfiniteScroll, useIntersectionObserver, useKeyModifier, useLocalStorage, useMagicKeys, useManualRefHistory, useMediaControls, useMediaQuery, useMemoize, useMemory, useMounted, useMouse, useMouseInElement, useMousePressed, useMutationObserver, useNavigatorLanguage, useNetwork, useNow, useObjectUrl, useOffsetPagination, useOnline, usePageLeave, useParallax, useParentElement, usePerformanceObserver, usePermission, usePointer, usePointerLock, usePointerSwipe, usePreferredColorScheme, usePreferredContrast, usePreferredDark, usePreferredLanguages, usePreferredReducedMotion, usePreferredReducedTransparency, usePrevious, useRafFn, useRefHistory, useResizeObserver, useSSRWidth, useScreenOrientation, useScreenSafeArea, useScriptTag, useScroll, useScrollLock, useSessionStorage, useShare, useSorted, useSpeechRecognition, useSpeechSynthesis, useStepper, useStorage, useStorageAsync, useStyleTag, useSupported, useSwipe, useTemplateRefsList, useTextDirection, useTextSelection, useTextareaAutosize, useThrottledRefHistory, useTimeAgo, useTimeAgoIntl, useTimeoutPoll, useTimestamp, useTitle, useTransition, useUrlSearchParams, useUserMedia, useVModel, useVModels, useVibrate, useVirtualList, useWakeLock, useWebNotification, useWebSocket, useWebWorker, useWebWorkerFn, useWindowFocus, useWindowScroll, useWindowSize };","import { defineStore } from 'pinia'\nimport { ref, computed, watch } from 'vue'\nimport { useLocalStorage } from '@vueuse/core'\nimport type {\n\tHSTOperation,\n\tHSTOperationInput,\n\tOperationLogConfig,\n\tUndoRedoState,\n\tOperationLogSnapshot,\n\tCrossTabMessage,\n\tOperationSource,\n} from '../types/operation-log'\nimport type { HSTNode } from './hst'\n\n/**\n * Generate a UUID using crypto API or fallback\n */\nfunction generateId(): string {\n\tif (typeof crypto !== 'undefined' && crypto.randomUUID) {\n\t\treturn crypto.randomUUID()\n\t}\n\t// Fallback for environments without crypto.randomUUID\n\treturn `${Date.now()}-${Math.random().toString(36).substring(2, 9)}`\n}\n\n/**\n * Serialize a message for BroadcastChannel\n * Converts Date objects to ISO strings for structured clone compatibility\n */\ntype SerializedOperation = Omit<HSTOperation, 'timestamp'> & { timestamp: string }\ntype SerializedCrossTabMessage = Omit<CrossTabMessage, 'timestamp' | 'operation' | 'operations'> & {\n\ttimestamp: string\n\toperation?: SerializedOperation\n\toperations?: SerializedOperation[]\n}\n\nfunction serializeForBroadcast(message: CrossTabMessage): SerializedCrossTabMessage {\n\tconst serialized: SerializedCrossTabMessage = {\n\t\ttype: message.type,\n\t\tclientId: message.clientId,\n\t\ttimestamp: message.timestamp.toISOString(),\n\t}\n\n\tif (message.operation) {\n\t\tserialized.operation = {\n\t\t\t...message.operation,\n\t\t\ttimestamp: message.operation.timestamp.toISOString(),\n\t\t}\n\t}\n\n\tif (message.operations) {\n\t\tserialized.operations = message.operations.map(op => ({\n\t\t\t...op,\n\t\t\ttimestamp: op.timestamp.toISOString(),\n\t\t}))\n\t}\n\n\treturn serialized\n}\n\n/**\n * Deserialize a message from BroadcastChannel\n * Converts ISO strings back to Date objects\n */\nfunction deserializeFromBroadcast(serialized: SerializedCrossTabMessage): CrossTabMessage {\n\tconst message: CrossTabMessage = {\n\t\ttype: serialized.type,\n\t\tclientId: serialized.clientId,\n\t\ttimestamp: new Date(serialized.timestamp),\n\t}\n\n\tif (serialized.operation) {\n\t\tmessage.operation = {\n\t\t\t...serialized.operation,\n\t\t\ttimestamp: new Date(serialized.operation.timestamp),\n\t\t}\n\t}\n\n\tif (serialized.operations) {\n\t\tmessage.operations = serialized.operations.map(op => ({\n\t\t\t...op,\n\t\t\ttimestamp: new Date(op.timestamp),\n\t\t}))\n\t}\n\n\treturn message\n}\n\n/**\n * Global HST Operation Log Store\n * Tracks all mutations with full metadata for undo/redo, sync, and audit\n *\n * @public\n */\nexport const useOperationLogStore = defineStore('hst-operation-log', () => {\n\t// Configuration\n\tconst config = ref<OperationLogConfig>({\n\t\tmaxOperations: 100,\n\t\tenableCrossTabSync: true,\n\t\tautoSyncInterval: 30000,\n\t\tenablePersistence: false,\n\t\tpersistenceKeyPrefix: 'stonecrop-ops',\n\t})\n\n\t// State\n\tconst operations = ref<HSTOperation[]>([])\n\tconst currentIndex = ref(-1) // Points to the last applied operation\n\tconst clientId = ref(generateId())\n\tconst batchMode = ref(false)\n\tconst currentBatch = ref<HSTOperation[]>([])\n\tconst currentBatchId = ref<string | null>(null)\n\n\t// Computed\n\tconst canUndo = computed(() => {\n\t\t// Can undo if there are operations and we're not at the beginning\n\t\tif (currentIndex.value < 0) return false\n\n\t\t// Check if the operation at currentIndex is reversible\n\t\tconst operation = operations.value[currentIndex.value]\n\t\treturn operation?.reversible ?? false\n\t})\n\n\tconst canRedo = computed(() => {\n\t\t// Can redo if there are operations ahead of current index\n\t\treturn currentIndex.value < operations.value.length - 1\n\t})\n\n\tconst undoCount = computed(() => {\n\t\tlet count = 0\n\t\tfor (let i = currentIndex.value; i >= 0; i--) {\n\t\t\tif (operations.value[i]?.reversible) count++\n\t\t\telse break\n\t\t}\n\t\treturn count\n\t})\n\n\tconst redoCount = computed(() => {\n\t\treturn operations.value.length - 1 - currentIndex.value\n\t})\n\n\tconst undoRedoState = computed<UndoRedoState>(() => ({\n\t\tcanUndo: canUndo.value,\n\t\tcanRedo: canRedo.value,\n\t\tundoCount: undoCount.value,\n\t\tredoCount: redoCount.value,\n\t\tcurrentIndex: currentIndex.value,\n\t}))\n\n\t// Core Methods\n\n\t/**\n\t * Configure the operation log\n\t */\n\tfunction configure(options: Partial<OperationLogConfig>) {\n\t\tconfig.value = { ...config.value, ...options }\n\n\t\t// Set up persistence if enabled\n\t\tif (config.value.enablePersistence) {\n\t\t\tloadFromPersistence()\n\t\t\tsetupPersistenceWatcher()\n\t\t}\n\n\t\t// Set up cross-tab sync if enabled\n\t\tif (config.value.enableCrossTabSync) {\n\t\t\tsetupCrossTabSync()\n\t\t}\n\t}\n\n\t/**\n\t * Add an operation to the log\n\t */\n\tfunction addOperation(operation: HSTOperationInput, source: OperationSource = 'user') {\n\t\tconst fullOperation: HSTOperation = {\n\t\t\t...operation,\n\t\t\tid: generateId(),\n\t\t\ttimestamp: new Date(),\n\t\t\tsource: source,\n\t\t\tuserId: config.value.userId,\n\t\t}\n\n\t\t// Apply filter if configured\n\t\tif (config.value.operationFilter && !config.value.operationFilter(fullOperation)) {\n\t\t\treturn fullOperation.id\n\t\t}\n\n\t\t// If in batch mode, collect operations\n\t\tif (batchMode.value) {\n\t\t\tcurrentBatch.value.push(fullOperation)\n\t\t\treturn fullOperation.id\n\t\t}\n\n\t\t// Remove any operations after current index (they become invalid after new operation)\n\t\tif (currentIndex.value < operations.value.length - 1) {\n\t\t\toperations.value = operations.value.slice(0, currentIndex.value + 1)\n\t\t}\n\n\t\t// Add new operation\n\t\toperations.value.push(fullOperation)\n\t\tcurrentIndex.value++\n\n\t\t// Enforce max operations limit\n\t\tif (config.value.maxOperations && operations.value.length > config.value.maxOperations) {\n\t\t\tconst overflow = operations.value.length - config.value.maxOperations\n\t\t\toperations.value = operations.value.slice(overflow)\n\t\t\tcurrentIndex.value -= overflow\n\t\t}\n\n\t\t// Broadcast to other tabs\n\t\tif (config.value.enableCrossTabSync) {\n\t\t\tbroadcastOperation(fullOperation)\n\t\t}\n\n\t\treturn fullOperation.id\n\t}\n\n\t/**\n\t * Start batch mode - collect multiple operations\n\t */\n\tfunction startBatch() {\n\t\tbatchMode.value = true\n\t\tcurrentBatch.value = []\n\t\tcurrentBatchId.value = generateId()\n\t}\n\n\t/**\n\t * Commit batch - create a single batch operation\n\t */\n\tfunction commitBatch(description?: string): string | null {\n\t\tif (!batchMode.value || currentBatch.value.length === 0) {\n\t\t\tbatchMode.value = false\n\t\t\tcurrentBatch.value = []\n\t\t\tcurrentBatchId.value = null\n\t\t\treturn null\n\t\t}\n\n\t\tconst batchId = currentBatchId.value!\n\t\tconst allReversible = currentBatch.value.every(op => op.reversible)\n\n\t\t// Create parent batch operation\n\t\tconst batchOperation: HSTOperation = {\n\t\t\tid: batchId,\n\t\t\ttype: 'batch',\n\t\t\tpath: '', // Batch doesn't have a single path\n\t\t\tfieldname: '',\n\t\t\tbeforeValue: null,\n\t\t\tafterValue: null,\n\t\t\tdoctype: currentBatch.value[0]?.doctype || '',\n\t\t\ttimestamp: new Date(),\n\t\t\tsource: 'user',\n\t\t\treversible: allReversible,\n\t\t\tirreversibleReason: allReversible ? undefined : 'Contains irreversible operations',\n\t\t\tchildOperationIds: currentBatch.value.map(op => op.id),\n\t\t\tmetadata: { description },\n\t\t}\n\n\t\t// Add parent operation ID to all children\n\t\tcurrentBatch.value.forEach(op => {\n\t\t\top.parentOperationId = batchId\n\t\t})\n\n\t\t// Add all operations to the log\n\t\toperations.value.push(...currentBatch.value, batchOperation)\n\t\tcurrentIndex.value = operations.value.length - 1\n\n\t\t// Broadcast batch\n\t\tif (config.value.enableCrossTabSync) {\n\t\t\tbroadcastBatch(currentBatch.value, batchOperation)\n\t\t}\n\n\t\t// Reset batch state\n\t\tconst result = batchId\n\t\tbatchMode.value = false\n\t\tcurrentBatch.value = []\n\t\tcurrentBatchId.value = null\n\n\t\treturn result\n\t}\n\n\t/**\n\t * Cancel batch mode without committing\n\t */\n\tfunction cancelBatch() {\n\t\tbatchMode.value = false\n\t\tcurrentBatch.value = []\n\t\tcurrentBatchId.value = null\n\t}\n\n\t/**\n\t * Undo the last operation\n\t */\n\tfunction undo(store: HSTNode): boolean {\n\t\tif (!canUndo.value) return false\n\n\t\tconst operation = operations.value[currentIndex.value]\n\n\t\tif (!operation.reversible) {\n\t\t\t// Warn about irreversible operation\n\t\t\tif (typeof console !== 'undefined' && operation.irreversibleReason) {\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.warn('Cannot undo irreversible operation:', operation.irreversibleReason)\n\t\t\t}\n\t\t\treturn false\n\t\t}\n\n\t\ttry {\n\t\t\t// Handle batch operations\n\t\t\tif (operation.type === 'batch' && operation.childOperationIds) {\n\t\t\t\t// Undo all child operations in reverse order\n\t\t\t\tfor (let i = operation.childOperationIds.length - 1; i >= 0; i--) {\n\t\t\t\t\tconst childId = operation.childOperationIds[i]\n\t\t\t\t\tconst childOp = operations.value.find(op => op.id === childId)\n\t\t\t\t\tif (childOp) {\n\t\t\t\t\t\trevertOperation(childOp, store)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Undo single operation\n\t\t\t\trevertOperation(operation, store)\n\t\t\t}\n\n\t\t\tcurrentIndex.value--\n\n\t\t\t// Broadcast undo to other tabs\n\t\t\tif (config.value.enableCrossTabSync) {\n\t\t\t\tbroadcastUndo(operation)\n\t\t\t}\n\n\t\t\treturn true\n\t\t} catch (error) {\n\t\t\t// Log error in development\n\t\t\tif (typeof console !== 'undefined') {\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.error('Undo failed:', error)\n\t\t\t}\n\t\t\treturn false\n\t\t}\n\t}\n\n\t/**\n\t * Redo the next operation\n\t */\n\tfunction redo(store: HSTNode): boolean {\n\t\tif (!canRedo.value) return false\n\n\t\tconst operation = operations.value[currentIndex.value + 1]\n\n\t\ttry {\n\t\t\t// Handle batch operations\n\t\t\tif (operation.type === 'batch' && operation.childOperationIds) {\n\t\t\t\t// Redo all child operations in order\n\t\t\t\tfor (const childId of operation.childOperationIds) {\n\t\t\t\t\tconst childOp = operations.value.find(op => op.id === childId)\n\t\t\t\t\tif (childOp) {\n\t\t\t\t\t\tapplyOperation(childOp, store)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Redo single operation\n\t\t\t\tapplyOperation(operation, store)\n\t\t\t}\n\n\t\t\tcurrentIndex.value++\n\n\t\t\t// Broadcast redo to other tabs\n\t\t\tif (config.value.enableCrossTabSync) {\n\t\t\t\tbroadcastRedo(operation)\n\t\t\t}\n\n\t\t\treturn true\n\t\t} catch (error) {\n\t\t\t// Log error in development\n\t\t\tif (typeof console !== 'undefined') {\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.error('Redo failed:', error)\n\t\t\t}\n\t\t\treturn false\n\t\t}\n\t}\n\n\t/**\n\t * Revert an operation (apply beforeValue)\n\t */\n\tfunction revertOperation(operation: HSTOperation, store: HSTNode) {\n\t\t// Both 'set' and 'delete' operations can be reverted by setting to beforeValue\n\t\tif ((operation.type === 'set' || operation.type === 'delete') && store && typeof store.set === 'function') {\n\t\t\tstore.set(operation.path, operation.beforeValue, 'undo')\n\t\t}\n\t\t// Note: 'transition' operations are marked as non-reversible, so they won't reach here\n\t\t// Note: 'batch' operations are handled separately in the undo function\n\t}\n\n\t/**\n\t * Apply an operation (apply afterValue)\n\t */\n\tfunction applyOperation(operation: HSTOperation, store: HSTNode) {\n\t\t// Both 'set' and 'delete' operations can be applied by setting to afterValue\n\t\tif ((operation.type === 'set' || operation.type === 'delete') && store && typeof store.set === 'function') {\n\t\t\tstore.set(operation.path, operation.afterValue, 'redo')\n\t\t}\n\t\t// Note: 'transition' operations are marked as non-reversible, so they won't reach here\n\t\t// Note: 'batch' operations are handled separately in the redo function\n\t}\n\n\t/**\n\t * Get operation log snapshot for debugging\n\t */\n\tfunction getSnapshot(): OperationLogSnapshot {\n\t\tconst reversibleOps = operations.value.filter(op => op.reversible).length\n\t\tconst timestamps = operations.value.map(op => op.timestamp)\n\n\t\treturn {\n\t\t\toperations: [...operations.value],\n\t\t\tcurrentIndex: currentIndex.value,\n\t\t\ttotalOperations: operations.value.length,\n\t\t\treversibleOperations: reversibleOps,\n\t\t\tirreversibleOperations: operations.value.length - reversibleOps,\n\t\t\toldestOperation: timestamps.length > 0 ? new Date(Math.min(...timestamps.map(t => t.getTime()))) : undefined,\n\t\t\tnewestOperation: timestamps.length > 0 ? new Date(Math.max(...timestamps.map(t => t.getTime()))) : undefined,\n\t\t}\n\t}\n\n\t/**\n\t * Clear all operations\n\t */\n\tfunction clear() {\n\t\toperations.value = []\n\t\tcurrentIndex.value = -1\n\t}\n\n\t/**\n\t * Get operations for a specific doctype and recordId\n\t */\n\tfunction getOperationsFor(doctype: string, recordId?: string): HSTOperation[] {\n\t\treturn operations.value.filter(op => op.doctype === doctype && (recordId === undefined || op.recordId === recordId))\n\t}\n\n\t/**\n\t * Mark an operation as irreversible\n\t * @param operationId - The ID of the operation to mark\n\t * @param reason - The reason why the operation is irreversible\n\t */\n\tfunction markIrreversible(operationId: string, reason: string) {\n\t\tconst operation = operations.value.find(op => op.id === operationId)\n\t\tif (operation) {\n\t\t\toperation.reversible = false\n\t\t\toperation.irreversibleReason = reason\n\t\t}\n\t}\n\n\t/**\n\t * Log an action execution (stateless actions like print, email, etc.)\n\t * These operations are tracked but typically not reversible\n\t * @param doctype - The doctype the action was executed on\n\t * @param actionName - The name of the action that was executed\n\t * @param recordIds - Optional array of record IDs the action was executed on\n\t * @param result - The result of the action execution\n\t * @param error - Optional error message if action failed\n\t * @returns The operation ID\n\t */\n\tfunction logAction(\n\t\tdoctype: string,\n\t\tactionName: string,\n\t\trecordIds?: string[],\n\t\tresult: 'success' | 'failure' | 'pending' = 'success',\n\t\terror?: string\n\t): string {\n\t\tconst operation: HSTOperationInput = {\n\t\t\ttype: 'action',\n\t\t\tpath: recordIds && recordIds.length > 0 ? `${doctype}.${recordIds[0]}` : doctype,\n\t\t\tfieldname: '',\n\t\t\tbeforeValue: null,\n\t\t\tafterValue: null,\n\t\t\tdoctype,\n\t\t\trecordId: recordIds && recordIds.length > 0 ? recordIds[0] : undefined,\n\t\t\treversible: false, // Actions are typically not reversible\n\t\t\tactionName,\n\t\t\tactionRecordIds: recordIds,\n\t\t\tactionResult: result,\n\t\t\tactionError: error,\n\t\t}\n\n\t\treturn addOperation(operation)\n\t}\n\n\t// Cross-tab synchronization\n\tlet broadcastChannel: BroadcastChannel | null = null\n\n\tfunction setupCrossTabSync() {\n\t\tif (typeof window === 'undefined' || !window.BroadcastChannel) return\n\n\t\tbroadcastChannel = new BroadcastChannel('stonecrop-operation-log')\n\n\t\tbroadcastChannel.addEventListener('message', (event: MessageEvent) => {\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n\t\t\tconst rawMessage = event.data\n\n\t\t\tif (!rawMessage || typeof rawMessage !== 'object') return\n\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-argument\n\t\t\tconst message = deserializeFromBroadcast(rawMessage)\n\n\t\t\t// Ignore messages from this tab\n\t\t\tif (message.clientId === clientId.value) return\n\n\t\t\tif (message.type === 'operation' && message.operation) {\n\t\t\t\t// Add operation from another tab\n\t\t\t\toperations.value.push({ ...message.operation, source: 'sync' as OperationSource })\n\t\t\t\tcurrentIndex.value = operations.value.length - 1\n\t\t\t} else if (message.type === 'operation' && message.operations) {\n\t\t\t\t// Add batch operations from another tab\n\t\t\t\toperations.value.push(...message.operations.map(op => ({ ...op, source: 'sync' as OperationSource })))\n\t\t\t\tcurrentIndex.value = operations.value.length - 1\n\t\t\t}\n\t\t})\n\t}\n\n\tfunction broadcastOperation(operation: HSTOperation) {\n\t\tif (!broadcastChannel) return\n\n\t\tconst message: CrossTabMessage = {\n\t\t\ttype: 'operation',\n\t\t\toperation,\n\t\t\tclientId: clientId.value,\n\t\t\ttimestamp: new Date(),\n\t\t}\n\t\tbroadcastChannel.postMessage(serializeForBroadcast(message))\n\t}\n\n\tfunction broadcastBatch(childOps: HSTOperation[], batchOp: HSTOperation) {\n\t\tif (!broadcastChannel) return\n\n\t\tconst message: CrossTabMessage = {\n\t\t\ttype: 'operation',\n\t\t\toperations: [...childOps, batchOp],\n\t\t\tclientId: clientId.value,\n\t\t\ttimestamp: new Date(),\n\t\t}\n\t\tbroadcastChannel.postMessage(serializeForBroadcast(message))\n\t}\n\n\tfunction broadcastUndo(operation: HSTOperation) {\n\t\tif (!broadcastChannel) return\n\n\t\tconst message: CrossTabMessage = {\n\t\t\ttype: 'undo',\n\t\t\toperation,\n\t\t\tclientId: clientId.value,\n\t\t\ttimestamp: new Date(),\n\t\t}\n\t\tbroadcastChannel.postMessage(serializeForBroadcast(message))\n\t}\n\n\tfunction broadcastRedo(operation: HSTOperation) {\n\t\tif (!broadcastChannel) return\n\n\t\tconst message: CrossTabMessage = {\n\t\t\ttype: 'redo',\n\t\t\toperation,\n\t\t\tclientId: clientId.value,\n\t\t\ttimestamp: new Date(),\n\t\t}\n\t\tbroadcastChannel.postMessage(serializeForBroadcast(message))\n\t}\n\n\t// Persistence using VueUse\n\ttype PersistedData = {\n\t\toperations: Array<Omit<HSTOperation, 'timestamp'> & { timestamp: string }>\n\t\tcurrentIndex: number\n\t}\n\n\tconst persistedData = useLocalStorage<PersistedData | null>('stonecrop-ops-operations', null, {\n\t\tserializer: {\n\t\t\tread: (v: string) => {\n\t\t\t\ttry {\n\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n\t\t\t\t\tconst data = JSON.parse(v)\n\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-return\n\t\t\t\t\treturn data\n\t\t\t\t} catch {\n\t\t\t\t\treturn null\n\t\t\t\t}\n\t\t\t},\n\t\t\twrite: (v: PersistedData | null) => {\n\t\t\t\tif (!v) return ''\n\t\t\t\treturn JSON.stringify(v)\n\t\t\t},\n\t\t},\n\t})\n\n\tfunction loadFromPersistence() {\n\t\tif (typeof window === 'undefined') return\n\n\t\ttry {\n\t\t\tconst data = persistedData.value\n\t\t\tif (data && Array.isArray(data.operations)) {\n\t\t\t\toperations.value = data.operations.map(op => ({\n\t\t\t\t\t...op,\n\t\t\t\t\ttimestamp: new Date(op.timestamp),\n\t\t\t\t}))\n\t\t\t\tcurrentIndex.value = data.currentIndex ?? -1\n\t\t\t}\n\t\t} catch (error) {\n\t\t\t// Log error in development\n\t\t\tif (typeof console !== 'undefined') {\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.error('Failed to load operations from persistence:', error)\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction saveToPersistence() {\n\t\tif (typeof window === 'undefined') return\n\n\t\ttry {\n\t\t\tpersistedData.value = {\n\t\t\t\toperations: operations.value.map(op => ({\n\t\t\t\t\t...op,\n\t\t\t\t\ttimestamp: op.timestamp.toISOString(),\n\t\t\t\t})),\n\t\t\t\tcurrentIndex: currentIndex.value,\n\t\t\t}\n\t\t} catch (error) {\n\t\t\t// Log error in development\n\t\t\tif (typeof console !== 'undefined') {\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.error('Failed to save operations to persistence:', error)\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction setupPersistenceWatcher() {\n\t\twatch(\n\t\t\t[operations, currentIndex],\n\t\t\t() => {\n\t\t\t\tif (config.value.enablePersistence) {\n\t\t\t\t\tsaveToPersistence()\n\t\t\t\t}\n\t\t\t},\n\t\t\t{ deep: true }\n\t\t)\n\t}\n\n\treturn {\n\t\t// State\n\t\toperations,\n\t\tcurrentIndex,\n\t\tconfig,\n\t\tclientId,\n\t\tundoRedoState,\n\n\t\t// Computed\n\t\tcanUndo,\n\t\tcanRedo,\n\t\tundoCount,\n\t\tredoCount,\n\n\t\t// Methods\n\t\tconfigure,\n\t\taddOperation,\n\t\tstartBatch,\n\t\tcommitBatch,\n\t\tcancelBatch,\n\t\tundo,\n\t\tredo,\n\t\tclear,\n\t\tgetOperationsFor,\n\t\tgetSnapshot,\n\t\tmarkIrreversible,\n\t\tlogAction,\n\t}\n})\n","/* eslint-disable no-new-func, no-eval */\nimport type { Map as ImmutableMap } from 'immutable'\nimport { useOperationLogStore } from './stores/operation-log'\nimport type {\n\tFieldActionFunction,\n\tFieldChangeContext,\n\tFieldTriggerExecutionResult,\n\tFieldTriggerOptions,\n\tActionExecutionResult,\n\tTransitionChangeContext,\n\tTransitionActionFunction,\n\tTransitionExecutionResult,\n} from './types/field-triggers'\n\n/**\n * Field trigger execution engine integrated with Registry\n * Singleton pattern following Registry implementation\n * @public\n */\nexport class FieldTriggerEngine {\n\t/**\n\t * The root FieldTriggerEngine instance\n\t */\n\tstatic _root: FieldTriggerEngine\n\n\tprivate options: FieldTriggerOptions & { defaultTimeout: number; debug: boolean; enableRollback: boolean }\n\tprivate doctypeActions = new Map<string, Map<string, string[]>>() // doctype -> action/field -> functions\n\tprivate doctypeTransitions = new Map<string, Map<string, string[]>>() // doctype -> transition -> functions\n\tprivate fieldRollbackConfig = new Map<string, Map<string, boolean>>() // doctype -> field -> rollback enabled\n\tprivate globalActions = new Map<string, FieldActionFunction>() // action name -> function\n\tprivate globalTransitionActions = new Map<string, TransitionActionFunction>() // transition action name -> function\n\n\t/**\n\t * Creates a new FieldTriggerEngine instance (singleton pattern)\n\t * @param options - Configuration options for the field trigger engine\n\t */\n\tconstructor(options: FieldTriggerOptions = {}) {\n\t\tif (FieldTriggerEngine._root) {\n\t\t\treturn FieldTriggerEngine._root\n\t\t}\n\t\tFieldTriggerEngine._root = this\n\t\tthis.options = {\n\t\t\tdefaultTimeout: options.defaultTimeout ?? 5000,\n\t\t\tdebug: options.debug ?? false,\n\t\t\tenableRollback: options.enableRollback ?? true,\n\t\t\terrorHandler: options.errorHandler,\n\t\t}\n\t}\n\n\t/**\n\t * Register a global action function\n\t * @param name - The name of the action\n\t * @param fn - The action function\n\t */\n\tregisterAction(name: string, fn: FieldActionFunction): void {\n\t\tthis.globalActions.set(name, fn)\n\t}\n\n\t/**\n\t * Register a global XState transition action function\n\t * @param name - The name of the transition action\n\t * @param fn - The transition action function\n\t */\n\tregisterTransitionAction(name: string, fn: TransitionActionFunction): void {\n\t\tthis.globalTransitionActions.set(name, fn)\n\t}\n\n\t/**\n\t * Configure rollback behavior for a specific field trigger\n\t * @param doctype - The doctype name\n\t * @param fieldname - The field name\n\t * @param enableRollback - Whether to enable rollback\n\t */\n\tsetFieldRollback(doctype: string, fieldname: string, enableRollback: boolean): void {\n\t\tif (!this.fieldRollbackConfig.has(doctype)) {\n\t\t\tthis.fieldRollbackConfig.set(doctype, new Map())\n\t\t}\n\t\tthis.fieldRollbackConfig.get(doctype)!.set(fieldname, enableRollback)\n\t}\n\n\t/**\n\t * Get rollback configuration for a specific field trigger\n\t */\n\tprivate getFieldRollback(doctype: string, fieldname: string): boolean | undefined {\n\t\treturn this.fieldRollbackConfig.get(doctype)?.get(fieldname)\n\t}\n\n\t/**\n\t * Register actions from a doctype - both regular actions and field triggers\n\t * Separates XState transitions (uppercase) from field triggers (lowercase)\n\t * @param doctype - The doctype name\n\t * @param actions - The actions to register (supports Immutable Map, Map, or plain object)\n\t */\n\tregisterDoctypeActions(\n\t\tdoctype: string,\n\t\tactions: ImmutableMap<string, string[]> | Map<string, string[]> | Record<string, string[]> | undefined\n\t): void {\n\t\tif (!actions) return\n\n\t\tconst actionMap = new Map<string, string[]>()\n\t\tconst transitionMap = new Map<string, string[]>()\n\n\t\t// Convert from different Map types to regular Map\n\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\tif (typeof (actions as any).entrySeq === 'function') {\n\t\t\t// Immutable Map\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t\t;(actions as any).entrySeq().forEach(([key, value]: [string, string[]]) => {\n\t\t\t\tthis.categorizeAction(key, value, actionMap, transitionMap)\n\t\t\t})\n\t\t} else if (actions instanceof Map) {\n\t\t\t// Regular Map\n\t\t\tfor (const [key, value] of actions) {\n\t\t\t\tthis.categorizeAction(key, value, actionMap, transitionMap)\n\t\t\t}\n\t\t} else if (actions && typeof actions === 'object') {\n\t\t\t// Plain object\n\t\t\tObject.entries(actions).forEach(([key, value]) => {\n\t\t\t\tthis.categorizeAction(key, value as string[], actionMap, transitionMap)\n\t\t\t})\n\t\t}\n\n\t\t// Always set the maps, even if empty\n\t\tthis.doctypeActions.set(doctype, actionMap)\n\t\tthis.doctypeTransitions.set(doctype, transitionMap)\n\t}\n\n\t/**\n\t * Categorize an action as either a field trigger or XState transition\n\t * Uses uppercase convention: UPPERCASE = transition, lowercase/mixed = field trigger\n\t */\n\tprivate categorizeAction(\n\t\tkey: string,\n\t\tvalue: string[],\n\t\tactionMap: Map<string, string[]>,\n\t\ttransitionMap: Map<string, string[]>\n\t): void {\n\t\t// Check if the key is all uppercase (XState transition convention)\n\t\tif (this.isTransitionKey(key)) {\n\t\t\ttransitionMap.set(key, value)\n\t\t} else {\n\t\t\tactionMap.set(key, value)\n\t\t}\n\t}\n\n\t/**\n\t * Determine if a key represents an XState transition\n\t * Transitions are identified by being all uppercase\n\t */\n\tprivate isTransitionKey(key: string): boolean {\n\t\t// Must be all uppercase letters/numbers/underscores\n\t\treturn /^[A-Z0-9_]+$/.test(key) && key.length > 0\n\t}\n\n\t/**\n\t * Execute field triggers for a changed field\n\t * @param context - The field change context\n\t * @param options - Execution options (timeout and enableRollback)\n\t */\n\tasync executeFieldTriggers(\n\t\tcontext: FieldChangeContext,\n\t\toptions: { timeout?: number; enableRollback?: boolean } = {}\n\t): Promise<FieldTriggerExecutionResult> {\n\t\tconst { doctype, fieldname } = context\n\t\tconst triggers = this.findFieldTriggers(doctype, fieldname)\n\n\t\tif (triggers.length === 0) {\n\t\t\treturn {\n\t\t\t\tpath: context.path,\n\t\t\t\tactionResults: [],\n\t\t\t\ttotalExecutionTime: 0,\n\t\t\t\tallSucceeded: true,\n\t\t\t\tstoppedOnError: false,\n\t\t\t\trolledBack: false,\n\t\t\t}\n\t\t}\n\n\t\tconst startTime = performance.now()\n\t\tconst actionResults: ActionExecutionResult[] = []\n\t\tlet stoppedOnError = false\n\t\tlet rolledBack = false\n\t\tlet snapshot: any = undefined\n\n\t\t// Determine if rollback is enabled (priority: execution option > field config > global setting)\n\t\tconst fieldRollbackConfig = this.getFieldRollback(doctype, fieldname)\n\t\tconst rollbackEnabled = options.enableRollback ?? fieldRollbackConfig ?? this.options.enableRollback\n\n\t\t// Capture snapshot before executing actions if rollback is enabled\n\t\tif (rollbackEnabled && context.store) {\n\t\t\tsnapshot = this.captureSnapshot(context)\n\t\t}\n\n\t\t// Execute actions sequentially\n\t\tfor (const actionName of triggers) {\n\t\t\ttry {\n\t\t\t\tconst actionResult = await this.executeAction(actionName, context, options.timeout)\n\t\t\t\tactionResults.push(actionResult)\n\n\t\t\t\tif (!actionResult.success) {\n\t\t\t\t\tstoppedOnError = true\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t} catch (error) {\n\t\t\t\tconst actionError = error instanceof Error ? error : new Error(String(error))\n\t\t\t\tconst errorResult: ActionExecutionResult = {\n\t\t\t\t\tsuccess: false,\n\t\t\t\t\terror: actionError,\n\t\t\t\t\texecutionTime: 0,\n\t\t\t\t\taction: actionName,\n\t\t\t\t}\n\t\t\t\tactionResults.push(errorResult)\n\t\t\t\tstoppedOnError = true\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\n\t\t// Perform rollback if enabled, errors occurred, and we have a snapshot\n\t\tif (rollbackEnabled && stoppedOnError && snapshot && context.store) {\n\t\t\ttry {\n\t\t\t\tthis.restoreSnapshot(context, snapshot)\n\t\t\t\trolledBack = true\n\t\t\t} catch (rollbackError) {\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.error('[FieldTriggers] Rollback failed:', rollbackError)\n\t\t\t}\n\t\t}\n\n\t\tconst totalExecutionTime = performance.now() - startTime\n\n\t\t// Call global error handler if configured and errors occurred\n\t\tconst failedResults = actionResults.filter(r => !r.success)\n\t\tif (failedResults.length > 0 && this.options.errorHandler) {\n\t\t\tfor (const failedResult of failedResults) {\n\t\t\t\ttry {\n\t\t\t\t\tthis.options.errorHandler(failedResult.error!, context, failedResult.action)\n\t\t\t\t} catch (handlerError) {\n\t\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\t\tconsole.error('[FieldTriggers] Error in global error handler:', handlerError)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tconst result: FieldTriggerExecutionResult = {\n\t\t\tpath: context.path,\n\t\t\tactionResults,\n\t\t\ttotalExecutionTime,\n\t\t\tallSucceeded: actionResults.every(r => r.success),\n\t\t\tstoppedOnError,\n\t\t\trolledBack,\n\t\t\tsnapshot: this.options.debug && rollbackEnabled ? snapshot : undefined, // Only include snapshot in debug mode if rollback is enabled\n\t\t}\n\n\t\treturn result\n\t}\n\n\t/**\n\t * Execute XState transition actions\n\t * Similar to field triggers but specifically for FSM state transitions\n\t * @param context - The transition change context\n\t * @param options - Execution options (timeout)\n\t */\n\tasync executeTransitionActions(\n\t\tcontext: TransitionChangeContext,\n\t\toptions: { timeout?: number } = {}\n\t): Promise<TransitionExecutionResult[]> {\n\t\tconst { doctype, transition } = context\n\t\tconst transitionActions = this.findTransitionActions(doctype, transition)\n\n\t\tif (transitionActions.length === 0) {\n\t\t\treturn []\n\t\t}\n\n\t\tconst results: TransitionExecutionResult[] = []\n\n\t\t// Execute transition actions sequentially\n\t\tfor (const actionName of transitionActions) {\n\t\t\ttry {\n\t\t\t\tconst actionResult = await this.executeTransitionAction(actionName, context, options.timeout)\n\t\t\t\tresults.push(actionResult)\n\n\t\t\t\tif (!actionResult.success) {\n\t\t\t\t\t// Stop on first error for transitions\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t} catch (error) {\n\t\t\t\tconst actionError = error instanceof Error ? error : new Error(String(error))\n\t\t\t\tconst errorResult: TransitionExecutionResult = {\n\t\t\t\t\tsuccess: false,\n\t\t\t\t\terror: actionError,\n\t\t\t\t\texecutionTime: 0,\n\t\t\t\t\taction: actionName,\n\t\t\t\t\ttransition,\n\t\t\t\t}\n\t\t\t\tresults.push(errorResult)\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\n\t\t// Call global error handler if configured and errors occurred\n\t\tconst failedResults = results.filter(r => !r.success)\n\t\tif (failedResults.length > 0 && this.options.errorHandler) {\n\t\t\tfor (const failedResult of failedResults) {\n\t\t\t\ttry {\n\t\t\t\t\t// Call with FieldChangeContext (base context type)\n\t\t\t\t\tthis.options.errorHandler(failedResult.error!, context, failedResult.action)\n\t\t\t\t} catch (handlerError) {\n\t\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\t\tconsole.error('[FieldTriggers] Error in global error handler:', handlerError)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn results\n\t}\n\n\t/**\n\t * Find transition actions for a specific doctype and transition\n\t */\n\tprivate findTransitionActions(doctype: string, transition: string): string[] {\n\t\tconst doctypeTransitions = this.doctypeTransitions.get(doctype)\n\t\tif (!doctypeTransitions) return []\n\n\t\treturn doctypeTransitions.get(transition) || []\n\t}\n\n\t/**\n\t * Execute a single transition action by name\n\t */\n\tprivate async executeTransitionAction(\n\t\tactionName: string,\n\t\tcontext: TransitionChangeContext,\n\t\ttimeout?: number\n\t): Promise<TransitionExecutionResult> {\n\t\tconst startTime = performance.now()\n\t\tconst actionTimeout = timeout ?? this.options.defaultTimeout\n\n\t\ttry {\n\t\t\t// Look up action in transition-specific registry first, then fall back to global\n\t\t\tlet actionFn = this.globalTransitionActions.get(actionName)\n\n\t\t\t// If not found in transition registry, try regular action registry\n\t\t\t// This allows sharing actions between field triggers and transitions\n\t\t\tif (!actionFn) {\n\t\t\t\tconst regularActionFn = this.globalActions.get(actionName)\n\t\t\t\tif (regularActionFn) {\n\t\t\t\t\t// Wrap regular action to accept TransitionChangeContext\n\t\t\t\t\tactionFn = regularActionFn as unknown as TransitionActionFunction\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!actionFn) {\n\t\t\t\tthrow new Error(`Transition action \"${actionName}\" not found in registry`)\n\t\t\t}\n\n\t\t\tawait this.executeWithTimeout(actionFn as FieldActionFunction, context, actionTimeout)\n\t\t\tconst executionTime = performance.now() - startTime\n\n\t\t\treturn {\n\t\t\t\tsuccess: true,\n\t\t\t\texecutionTime,\n\t\t\t\taction: actionName,\n\t\t\t\ttransition: context.transition,\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tconst executionTime = performance.now() - startTime\n\t\t\tconst actionError = error instanceof Error ? error : new Error(String(error))\n\n\t\t\treturn {\n\t\t\t\tsuccess: false,\n\t\t\t\terror: actionError,\n\t\t\t\texecutionTime,\n\t\t\t\taction: actionName,\n\t\t\t\ttransition: context.transition,\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Find field triggers for a specific doctype and field\n\t * Field triggers are identified by keys that look like field paths (contain dots or match field names)\n\t */\n\tprivate findFieldTriggers(doctype: string, fieldname: string): string[] {\n\t\tconst doctypeActions = this.doctypeActions.get(doctype)\n\t\tif (!doctypeActions) return []\n\n\t\tconst triggers: string[] = []\n\n\t\tfor (const [key, actionNames] of doctypeActions) {\n\t\t\t// Check if this key is a field trigger pattern\n\t\t\tif (this.isFieldTriggerKey(key, fieldname)) {\n\t\t\t\ttriggers.push(...actionNames)\n\t\t\t}\n\t\t}\n\n\t\treturn triggers\n\t}\n\n\t/**\n\t * Determine if an action key represents a field trigger\n\t * Field triggers can be:\n\t * - Exact field name match: \"emailAddress\"\n\t * - Wildcard patterns: \"emailAddress.*\", \"*.is_primary\"\n\t * - Nested field paths: \"address.street\", \"contact.email\"\n\t */\n\tprivate isFieldTriggerKey(key: string, fieldname: string): boolean {\n\t\t// Exact match\n\t\tif (key === fieldname) return true\n\n\t\t// Contains dots - likely a field path pattern\n\t\tif (key.includes('.')) {\n\t\t\treturn this.matchFieldPattern(key, fieldname)\n\t\t}\n\n\t\t// Contains wildcards\n\t\tif (key.includes('*')) {\n\t\t\treturn this.matchFieldPattern(key, fieldname)\n\t\t}\n\n\t\treturn false\n\t}\n\n\t/**\n\t * Match a field pattern against a field name\n\t * Supports wildcards (*) for dynamic segments\n\t */\n\tprivate matchFieldPattern(pattern: string, fieldname: string): boolean {\n\t\tconst patternParts = pattern.split('.')\n\t\tconst fieldParts = fieldname.split('.')\n\n\t\tif (patternParts.length !== fieldParts.length) {\n\t\t\treturn false\n\t\t}\n\n\t\tfor (let i = 0; i < patternParts.length; i++) {\n\t\t\tconst patternPart = patternParts[i]\n\t\t\tconst fieldPart = fieldParts[i]\n\n\t\t\tif (patternPart === '*') {\n\t\t\t\t// Wildcard matches any segment\n\t\t\t\tcontinue\n\t\t\t} else if (patternPart !== fieldPart) {\n\t\t\t\t// Exact match required\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\n\t\treturn true\n\t}\n\n\t/**\n\t * Execute a single action by name\n\t */\n\tprivate async executeAction(\n\t\tactionName: string,\n\t\tcontext: FieldChangeContext,\n\t\ttimeout?: number\n\t): Promise<ActionExecutionResult> {\n\t\tconst startTime = performance.now()\n\t\tconst actionTimeout = timeout ?? this.options.defaultTimeout\n\n\t\ttry {\n\t\t\t// Look up action in global registry\n\t\t\tconst actionFn = this.globalActions.get(actionName)\n\t\t\tif (!actionFn) {\n\t\t\t\tthrow new Error(`Action \"${actionName}\" not found in registry`)\n\t\t\t}\n\n\t\t\tawait this.executeWithTimeout(actionFn, context, actionTimeout)\n\t\t\tconst executionTime = performance.now() - startTime\n\n\t\t\treturn {\n\t\t\t\tsuccess: true,\n\t\t\t\texecutionTime,\n\t\t\t\taction: actionName,\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tconst executionTime = performance.now() - startTime\n\t\t\tconst actionError = error instanceof Error ? error : new Error(String(error))\n\n\t\t\treturn {\n\t\t\t\tsuccess: false,\n\t\t\t\terror: actionError,\n\t\t\t\texecutionTime,\n\t\t\t\taction: actionName,\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Execute a function with timeout\n\t */\n\tprivate async executeWithTimeout(\n\t\tfn: FieldActionFunction,\n\t\tcontext: FieldChangeContext,\n\t\ttimeout: number\n\t): Promise<unknown> {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tconst timeoutId = setTimeout(() => {\n\t\t\t\treject(new Error(`Action timeout after ${timeout}ms`))\n\t\t\t}, timeout)\n\n\t\t\tPromise.resolve(fn(context))\n\t\t\t\t.then(result => {\n\t\t\t\t\tclearTimeout(timeoutId)\n\t\t\t\t\tresolve(result)\n\t\t\t\t})\n\t\t\t\t.catch(error => {\n\t\t\t\t\tclearTimeout(timeoutId)\n\t\t\t\t\treject(error)\n\t\t\t\t})\n\t\t})\n\t}\n\n\t/**\n\t * Capture a snapshot of the record state before executing actions\n\t * This creates a deep copy of the record data for potential rollback\n\t */\n\tprivate captureSnapshot(context: FieldChangeContext): any {\n\t\tif (!context.store || !context.doctype || !context.recordId) {\n\t\t\treturn undefined\n\t\t}\n\n\t\ttry {\n\t\t\t// Get the record path (doctype.recordId)\n\t\t\tconst recordPath = `${context.doctype}.${context.recordId}`\n\n\t\t\t// Get the current record data\n\t\t\tconst recordData = context.store.get(recordPath)\n\n\t\t\tif (!recordData || typeof recordData !== 'object') {\n\t\t\t\treturn undefined\n\t\t\t}\n\n\t\t\t// Create a deep copy to avoid reference issues\n\t\t\treturn JSON.parse(JSON.stringify(recordData))\n\t\t} catch (error) {\n\t\t\tif (this.options.debug) {\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.warn('[FieldTriggers] Failed to capture snapshot:', error)\n\t\t\t}\n\t\t\treturn undefined\n\t\t}\n\t}\n\n\t/**\n\t * Restore a previously captured snapshot\n\t * This reverts the record to its state before actions were executed\n\t */\n\tprivate restoreSnapshot(context: FieldChangeContext, snapshot: any): void {\n\t\tif (!context.store || !context.doctype || !context.recordId || !snapshot) {\n\t\t\treturn\n\t\t}\n\n\t\ttry {\n\t\t\t// Get the record path (doctype.recordId)\n\t\t\tconst recordPath = `${context.doctype}.${context.recordId}`\n\n\t\t\t// Restore the entire record from snapshot\n\t\t\tcontext.store.set(recordPath, snapshot)\n\n\t\t\tif (this.options.debug) {\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.log(`[FieldTriggers] Rolled back ${recordPath} to previous state`)\n\t\t\t}\n\t\t} catch (error) {\n\t\t\t// eslint-disable-next-line no-console\n\t\t\tconsole.error('[FieldTriggers] Failed to restore snapshot:', error)\n\t\t\tthrow error\n\t\t}\n\t}\n}\n\n/**\n * Get or create the global field trigger engine singleton\n * @param options - Optional configuration for the field trigger engine\n * @public\n */\nexport function getGlobalTriggerEngine(options?: FieldTriggerOptions): FieldTriggerEngine {\n\treturn new FieldTriggerEngine(options)\n}\n\n/**\n * Register a global action function that can be used in field triggers\n * @param name - The name of the action to register\n * @param fn - The action function to execute when the trigger fires\n * @public\n */\nexport function registerGlobalAction(name: string, fn: FieldActionFunction): void {\n\tconst engine = getGlobalTriggerEngine()\n\tengine.registerAction(name, fn)\n}\n\n/**\n * Register a global XState transition action function\n * @param name - The name of the transition action to register\n * @param fn - The transition action function to execute\n * @public\n */\nexport function registerTransitionAction(name: string, fn: TransitionActionFunction): void {\n\tconst engine = getGlobalTriggerEngine()\n\tengine.registerTransitionAction(name, fn)\n}\n\n/**\n * Configure rollback behavior for a specific field trigger\n * @param doctype - The doctype name\n * @param fieldname - The field name\n * @param enableRollback - Whether to enable automatic rollback for this field\n * @public\n */\nexport function setFieldRollback(doctype: string, fieldname: string, enableRollback: boolean): void {\n\tconst engine = getGlobalTriggerEngine()\n\tengine.setFieldRollback(doctype, fieldname, enableRollback)\n}\n\n/**\n * Manually trigger an XState transition for a specific doctype/record\n * This can be called directly when you need to execute transition actions programmatically\n * @param doctype - The doctype name\n * @param transition - The XState transition name to trigger\n * @param options - Optional configuration for the transition\n * @public\n */\nexport async function triggerTransition(\n\tdoctype: string,\n\ttransition: string,\n\toptions?: {\n\t\trecordId?: string\n\t\tcurrentState?: string\n\t\ttargetState?: string\n\t\tfsmContext?: Record<string, any>\n\t\tpath?: string\n\t}\n): Promise<any> {\n\tconst engine = getGlobalTriggerEngine()\n\n\tconst context: TransitionChangeContext = {\n\t\tpath: options?.path || (options?.recordId ? `${doctype}.${options.recordId}` : doctype),\n\t\tfieldname: '',\n\t\tbeforeValue: undefined,\n\t\tafterValue: undefined,\n\t\toperation: 'set',\n\t\tdoctype,\n\t\trecordId: options?.recordId,\n\t\ttimestamp: new Date(),\n\t\ttransition,\n\t\tcurrentState: options?.currentState,\n\t\ttargetState: options?.targetState,\n\t\tfsmContext: options?.fsmContext,\n\t}\n\n\treturn await engine.executeTransitionActions(context)\n}\n\n/**\n * Mark a specific operation as irreversible.\n * Used to prevent undo of critical operations like publishing or deletion.\n * @param operationId - The ID of the operation to mark as irreversible\n * @param reason - Human-readable reason why the operation cannot be undone\n * @public\n */\nexport function markOperationIrreversible(operationId: string | undefined, reason: string): void {\n\tif (!operationId) return\n\n\ttry {\n\t\tconst store = useOperationLogStore()\n\t\tstore.markIrreversible(operationId, reason)\n\t} catch {\n\t\t// Operation log is optional\n\t}\n}\n","import { getGlobalTriggerEngine } from '../field-triggers'\nimport type { FieldChangeContext, TransitionChangeContext } from '../types/field-triggers'\nimport { useOperationLogStore } from './operation-log'\n\n/**\n * Get the operation log store if available\n */\nfunction getOperationLogStore() {\n\ttry {\n\t\treturn useOperationLogStore()\n\t} catch {\n\t\t// Operation log is optional\n\t\treturn null\n\t}\n}\n\n/**\n * Core HST Interface - enhanced with tree navigation\n * Provides a hierarchical state tree interface for navigating and manipulating nested data structures.\n *\n * @public\n */\ninterface HSTNode {\n\t/**\n\t * Gets a value at the specified path\n\t * @param path - The dot-separated path to the value\n\t * @returns The value at the specified path\n\t */\n\tget(path: string): any\n\n\t/**\n\t * Sets a value at the specified path\n\t * @param path - The dot-separated path where to set the value\n\t * @param value - The value to set\n\t * @param source - Optional source of the operation (user, system, sync, undo, redo)\n\t */\n\tset(path: string, value: any, source?: 'user' | 'system' | 'sync' | 'undo' | 'redo'): void\n\n\t/**\n\t * Checks if a value exists at the specified path\n\t * @param path - The dot-separated path to check\n\t * @returns True if the path exists, false otherwise\n\t */\n\thas(path: string): boolean\n\n\t/**\n\t * Gets the parent node in the tree hierarchy\n\t * @returns The parent HSTNode or null if this is the root\n\t */\n\tgetParent(): HSTNode | null\n\n\t/**\n\t * Gets the root node of the tree\n\t * @returns The root HSTNode\n\t */\n\tgetRoot(): HSTNode\n\n\t/**\n\t * Gets the full path from root to this node\n\t * @returns The dot-separated path string\n\t */\n\tgetPath(): string\n\n\t/**\n\t * Gets the depth level of this node in the tree\n\t * @returns The depth as a number (0 for root)\n\t */\n\tgetDepth(): number\n\n\t/**\n\t * Gets an array of path segments from root to this node\n\t * @returns Array of path segments representing breadcrumbs\n\t */\n\tgetBreadcrumbs(): string[]\n\n\t/**\n\t * Gets a child node at the specified relative path\n\t * @param path - The relative path to the child node\n\t * @returns The child HSTNode\n\t */\n\tgetNode(path: string): HSTNode\n\n\t/**\n\t * Trigger an XState transition with optional context data\n\t * @param transition - The transition name (should be uppercase per convention)\n\t * @param context - Optional additional FSM context data\n\t * @returns Promise resolving to the transition execution results\n\t */\n\ttriggerTransition(\n\t\ttransition: string,\n\t\tcontext?: { currentState?: string; targetState?: string; fsmContext?: Record<string, any> }\n\t): Promise<any>\n}\n\n// Type definitions for global Registry\ninterface RegistryGlobal {\n\tRegistry?: {\n\t\t_root?: {\n\t\t\tregistry: Record<string, any>\n\t\t}\n\t}\n}\n\n// Interface for Immutable-like objects\ninterface ImmutableLike {\n\tget(key: string): any\n\tset(key: string, value: any): ImmutableLike\n\thas(key: string): boolean\n\tsize?: number\n\t__ownerID?: any\n\t_map?: any\n\t_list?: any\n\t_origin?: any\n\t_capacity?: any\n\t_defaultValues?: any\n\t_tail?: any\n\t_root?: any\n}\n\n// Interface for Vue reactive objects\ninterface VueReactive {\n\t__v_isReactive: boolean\n\t[key: string]: any\n}\n\n// Interface for Pinia stores\ninterface PiniaStore {\n\t$state?: Record<string, any>\n\t$patch?: (partial: Record<string, any>) => void\n\t$id?: string\n\t[key: string]: any\n}\n\n// Interface for objects with property access\ninterface PropertyAccessible {\n\t[key: string]: any\n}\n\n// Extend global interfaces\ndeclare global {\n\tinterface Window extends RegistryGlobal {}\n\tconst global: RegistryGlobal | undefined\n}\n\n/**\n * Global HST Manager (Singleton)\n * Manages hierarchical state trees and provides access to the global registry.\n *\n * @public\n */\nclass HST {\n\tprivate static instance: HST\n\n\t/**\n\t * Gets the singleton instance of HST\n\t * @returns The HST singleton instance\n\t */\n\tstatic getInstance(): HST {\n\t\tif (!HST.instance) {\n\t\t\tHST.instance = new HST()\n\t\t}\n\t\treturn HST.instance\n\t}\n\n\t/**\n\t * Gets the global registry instance\n\t * @returns The global registry object or undefined if not found\n\t */\n\tgetRegistry(): any {\n\t\t// In test environment, try different ways to access Registry\n\t\t// First, try the global Registry if it exists\n\t\tif (typeof globalThis !== 'undefined') {\n\t\t\tconst globalRegistry = (globalThis as RegistryGlobal).Registry?._root\n\t\t\tif (globalRegistry) {\n\t\t\t\treturn globalRegistry\n\t\t\t}\n\t\t}\n\n\t\t// Try to access through window (browser environment)\n\t\tif (typeof window !== 'undefined') {\n\t\t\tconst windowRegistry = window.Registry?._root\n\t\t\tif (windowRegistry) {\n\t\t\t\treturn windowRegistry\n\t\t\t}\n\t\t}\n\n\t\t// Try to access through global (Node environment)\n\t\tif (typeof global !== 'undefined' && global) {\n\t\t\tconst nodeRegistry = global.Registry?._root\n\t\t\tif (nodeRegistry) {\n\t\t\t\treturn nodeRegistry\n\t\t\t}\n\t\t}\n\n\t\t// If we can't find it globally, it might not be set up\n\t\t// This is expected in test environments where Registry is created locally\n\t\treturn undefined\n\t}\n\n\t/**\n\t * Helper method to get doctype metadata from the registry\n\t * @param doctype - The name of the doctype to retrieve metadata for\n\t * @returns The doctype metadata object or undefined if not found\n\t */\n\tgetDoctypeMeta(doctype: string) {\n\t\tconst registry = this.getRegistry()\n\t\tif (registry && typeof registry === 'object' && 'registry' in registry) {\n\t\t\treturn (registry as { registry: Record<string, any> }).registry[doctype]\n\t\t}\n\t\treturn undefined\n\t}\n}\n\n// Enhanced HST Proxy with tree navigation\nclass HSTProxy implements HSTNode {\n\tprivate target: any\n\tprivate parentPath: string\n\tprivate rootNode: HSTNode | null\n\tprivate doctype: string\n\tprivate parentDoctype?: string\n\tprivate hst: HST\n\n\tconstructor(target: any, doctype: string, parentPath = '', rootNode: HSTNode | null = null, parentDoctype?: string) {\n\t\tthis.target = target\n\t\tthis.parentPath = parentPath\n\t\tthis.rootNode = rootNode || this\n\t\tthis.doctype = doctype\n\t\tthis.parentDoctype = parentDoctype\n\t\tthis.hst = HST.getInstance()\n\n\t\treturn new Proxy(this, {\n\t\t\tget(hst, prop) {\n\t\t\t\t// Return HST methods directly\n\t\t\t\tif (prop in hst) return hst[prop]\n\n\t\t\t\t// Handle property access - return tree nodes for navigation\n\t\t\t\tconst path = String(prop)\n\t\t\t\treturn hst.getNode(path)\n\t\t\t},\n\n\t\t\tset(hst, prop, value) {\n\t\t\t\tconst path = String(prop)\n\t\t\t\thst.set(path, value)\n\t\t\t\treturn true\n\t\t\t},\n\t\t})\n\t}\n\n\tget(path: string): any {\n\t\treturn this.resolveValue(path)\n\t}\n\n\t// Method to get a tree-wrapped node for navigation\n\tgetNode(path: string): HSTNode {\n\t\tconst fullPath = this.resolvePath(path)\n\t\tconst value = this.resolveValue(path)\n\n\t\t// Determine the correct doctype for this node based on the path\n\t\tconst pathSegments = fullPath.split('.')\n\t\tlet nodeDoctype = this.doctype\n\n\t\t// If we're at the root level and this is a StonecropStore, use the first path segment as the doctype\n\t\tif (this.doctype === 'StonecropStore' && pathSegments.length >= 1) {\n\t\t\tnodeDoctype = pathSegments[0]\n\t\t}\n\n\t\t// Always wrap in HSTProxy for tree navigation\n\t\tif (typeof value === 'object' && value !== null && !this.isPrimitive(value)) {\n\t\t\treturn new HSTProxy(value, nodeDoctype, fullPath, this.rootNode, this.parentDoctype)\n\t\t}\n\n\t\t// For primitives, return a minimal wrapper that throws on tree operations\n\t\treturn new HSTProxy(value, nodeDoctype, fullPath, this.rootNode, this.parentDoctype)\n\t}\n\n\tset(path: string, value: any, source: 'user' | 'system' | 'sync' | 'undo' | 'redo' = 'user'): void {\n\t\t// Get current value for change context\n\t\tconst fullPath = this.resolvePath(path)\n\t\tconst beforeValue = this.has(path) ? this.get(path) : undefined\n\n\t\t// Log operation if not from undo/redo and store is available\n\t\tif (source !== 'undo' && source !== 'redo') {\n\t\t\tconst logStore = getOperationLogStore()\n\t\t\tif (logStore && typeof logStore.addOperation === 'function') {\n\t\t\t\tconst pathSegments = fullPath.split('.')\n\t\t\t\tconst doctype = this.doctype === 'StonecropStore' && pathSegments.length >= 1 ? pathSegments[0] : this.doctype\n\t\t\t\tconst recordId = pathSegments.length >= 2 ? pathSegments[1] : undefined\n\t\t\t\tconst fieldname = pathSegments.slice(2).join('.') || pathSegments[pathSegments.length - 1]\n\n\t\t\t\t// Detect if this is a DELETE operation (setting to undefined when a value existed)\n\t\t\t\tconst isDelete = value === undefined && beforeValue !== undefined\n\t\t\t\tconst operationType: 'set' | 'delete' = isDelete ? 'delete' : 'set'\n\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-call\n\t\t\t\tlogStore.addOperation(\n\t\t\t\t\t{\n\t\t\t\t\t\ttype: operationType,\n\t\t\t\t\t\tpath: fullPath,\n\t\t\t\t\t\tfieldname,\n\t\t\t\t\t\tbeforeValue,\n\t\t\t\t\t\tafterValue: value,\n\t\t\t\t\t\tdoctype,\n\t\t\t\t\t\trecordId,\n\t\t\t\t\t\treversible: true, // Default to reversible, can be changed by field triggers\n\t\t\t\t\t},\n\t\t\t\t\tsource\n\t\t\t\t)\n\t\t\t}\n\t\t}\n\n\t\t// Update the value\n\t\tthis.updateValue(path, value)\n\n\t\t// Trigger field actions asynchronously (don't block the set operation)\n\t\tvoid this.triggerFieldActions(fullPath, beforeValue, value)\n\t}\n\n\thas(path: string): boolean {\n\t\ttry {\n\t\t\t// Handle empty path case\n\t\t\tif (path === '') {\n\t\t\t\treturn true // empty path refers to the root object\n\t\t\t}\n\n\t\t\tconst segments = this.parsePath(path)\n\t\t\tlet current = this.target\n\n\t\t\tfor (let i = 0; i < segments.length; i++) {\n\t\t\t\tconst segment = segments[i]\n\n\t\t\t\tif (current === null || current === undefined) {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\n\t\t\t\t// Check if this is the last segment\n\t\t\t\tif (i === segments.length - 1) {\n\t\t\t\t\t// For the final property, check if it exists\n\t\t\t\t\tif (this.isImmutable(current)) {\n\t\t\t\t\t\treturn current.has(segment)\n\t\t\t\t\t} else if (this.isPiniaStore(current)) {\n\t\t\t\t\t\treturn (current.$state && segment in current.$state) || segment in current\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn segment in current\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Navigate to the next level\n\t\t\t\tcurrent = this.getProperty(current, segment)\n\t\t\t}\n\n\t\t\treturn false\n\t\t} catch {\n\t\t\treturn false\n\t\t}\n\t}\n\n\t// Tree navigation methods\n\tgetParent(): HSTNode | null {\n\t\tif (!this.parentPath) return null\n\n\t\tconst parentSegments = this.parentPath.split('.').slice(0, -1)\n\t\tconst parentPath = parentSegments.join('.')\n\n\t\tif (parentPath === '') {\n\t\t\treturn this.rootNode\n\t\t}\n\n\t\t// Return a wrapped node, not raw data\n\t\treturn this.rootNode!.getNode(parentPath)\n\t}\n\n\tgetRoot(): HSTNode {\n\t\treturn this.rootNode!\n\t}\n\n\tgetPath(): string {\n\t\treturn this.parentPath\n\t}\n\n\tgetDepth(): number {\n\t\treturn this.parentPath ? this.parentPath.split('.').length : 0\n\t}\n\n\tgetBreadcrumbs(): string[] {\n\t\treturn this.parentPath ? this.parentPath.split('.') : []\n\t}\n\n\t/**\n\t * Trigger an XState transition with optional context data\n\t */\n\tasync triggerTransition(\n\t\ttransition: string,\n\t\tcontext?: { currentState?: string; targetState?: string; fsmContext?: Record<string, any> }\n\t): Promise<any> {\n\t\tconst triggerEngine = getGlobalTriggerEngine()\n\n\t\t// Determine doctype and recordId from the current path\n\t\tconst pathSegments = this.parentPath.split('.')\n\t\tlet doctype = this.doctype\n\t\tlet recordId: string | undefined\n\n\t\t// If we're at the root level and this is a StonecropStore, use the first path segment as the doctype\n\t\tif (this.doctype === 'StonecropStore' && pathSegments.length >= 1) {\n\t\t\tdoctype = pathSegments[0]\n\t\t}\n\n\t\t// Extract recordId from path if it follows the expected pattern\n\t\tif (pathSegments.length >= 2) {\n\t\t\trecordId = pathSegments[1]\n\t\t}\n\n\t\t// Build transition context\n\t\tconst transitionContext: TransitionChangeContext = {\n\t\t\tpath: this.parentPath,\n\t\t\tfieldname: '', // No specific field for transitions\n\t\t\tbeforeValue: undefined,\n\t\t\tafterValue: undefined,\n\t\t\toperation: 'set',\n\t\t\tdoctype,\n\t\t\trecordId,\n\t\t\ttimestamp: new Date(),\n\t\t\tstore: this.rootNode || undefined,\n\t\t\ttransition,\n\t\t\tcurrentState: context?.currentState,\n\t\t\ttargetState: context?.targetState,\n\t\t\tfsmContext: context?.fsmContext,\n\t\t}\n\n\t\t// Log FSM transition operation\n\t\tconst logStore = getOperationLogStore()\n\t\tif (logStore && typeof logStore.addOperation === 'function') {\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-call\n\t\t\tlogStore.addOperation(\n\t\t\t\t{\n\t\t\t\t\ttype: 'transition' as const,\n\t\t\t\t\tpath: this.parentPath,\n\t\t\t\t\tfieldname: transition,\n\t\t\t\t\tbeforeValue: context?.currentState,\n\t\t\t\t\tafterValue: context?.targetState,\n\t\t\t\t\tdoctype,\n\t\t\t\t\trecordId,\n\t\t\t\t\treversible: false, // FSM transitions are generally not reversible\n\t\t\t\t\tmetadata: {\n\t\t\t\t\t\ttransition,\n\t\t\t\t\t\tcurrentState: context?.currentState,\n\t\t\t\t\t\ttargetState: context?.targetState,\n\t\t\t\t\t\tfsmContext: context?.fsmContext,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t'user'\n\t\t\t)\n\t\t}\n\n\t\t// Execute transition actions\n\t\treturn await triggerEngine.executeTransitionActions(transitionContext)\n\t}\n\n\t// Private helper methods\n\tprivate resolvePath(path: string): string {\n\t\tif (path === '') return this.parentPath\n\t\treturn this.parentPath ? `${this.parentPath}.${path}` : path\n\t}\n\n\tprivate resolveValue(path: string): any {\n\t\t// Handle empty path - return the target object\n\t\tif (path === '') {\n\t\t\treturn this.target\n\t\t}\n\n\t\tconst segments = this.parsePath(path)\n\t\tlet current = this.target\n\n\t\tfor (const segment of segments) {\n\t\t\tif (current === null || current === undefined) {\n\t\t\t\treturn undefined\n\t\t\t}\n\n\t\t\tcurrent = this.getProperty(current, segment)\n\t\t}\n\n\t\treturn current\n\t}\n\n\tprivate updateValue(path: string, value: any): void {\n\t\t// Handle empty path case - should throw error\n\t\tif (path === '') {\n\t\t\tthrow new Error('Cannot set value on empty path')\n\t\t}\n\n\t\tconst segments = this.parsePath(path)\n\t\tconst lastSegment = segments.pop()!\n\t\tlet current = this.target\n\n\t\t// Navigate to parent object\n\t\tfor (const segment of segments) {\n\t\t\tcurrent = this.getProperty(current, segment)\n\t\t\tif (current === null || current === undefined) {\n\t\t\t\tthrow new Error(`Cannot set property on null/undefined path: ${path}`)\n\t\t\t}\n\t\t}\n\n\t\t// Set the final property\n\t\tthis.setProperty(current, lastSegment, value)\n\t}\n\n\tprivate getProperty(obj: any, key: string): any {\n\t\t// Immutable objects\n\t\tif (this.isImmutable(obj)) {\n\t\t\treturn obj.get(key)\n\t\t}\n\n\t\t// Vue reactive object\n\t\tif (this.isVueReactive(obj)) {\n\t\t\treturn obj[key]\n\t\t}\n\n\t\t// Pinia store\n\t\tif (this.isPiniaStore(obj)) {\n\t\t\treturn obj.$state?.[key] ?? obj[key]\n\t\t}\n\n\t\t// Plain object\n\t\treturn (obj as PropertyAccessible)[key]\n\t}\n\n\tprivate setProperty(obj: any, key: string, value: any): void {\n\t\t// Immutable objects\n\t\tif (this.isImmutable(obj)) {\n\t\t\tthrow new Error('Cannot directly mutate immutable objects. Use immutable update methods instead.')\n\t\t}\n\n\t\t// Pinia store\n\t\tif (this.isPiniaStore(obj)) {\n\t\t\tif (obj.$patch) {\n\t\t\t\tobj.$patch({ [key]: value })\n\t\t\t} else {\n\t\t\t\t;(obj as PropertyAccessible)[key] = value\n\t\t\t}\n\t\t\treturn\n\t\t}\n\n\t\t// Vue reactive or plain object\n\t\t;(obj as PropertyAccessible)[key] = value\n\t}\n\n\tprivate async triggerFieldActions(fullPath: string, beforeValue: any, afterValue: any): Promise<void> {\n\t\ttry {\n\t\t\t// Guard against undefined or null fullPath\n\t\t\tif (!fullPath || typeof fullPath !== 'string') {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tconst pathSegments = fullPath.split('.')\n\n\t\t\t// Only trigger field actions for actual field changes (at least 3 levels deep: doctype.recordId.fieldname)\n\t\t\t// Skip triggering for doctype-level or record-level changes\n\t\t\tif (pathSegments.length < 3) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tconst triggerEngine = getGlobalTriggerEngine()\n\t\t\tconst fieldname = pathSegments.slice(2).join('.') || pathSegments[pathSegments.length - 1]\n\n\t\t\t// Determine the correct doctype for this path using the same logic as getNode()\n\t\t\t// The path should be in format: \"doctype.recordId.fieldname\"\n\t\t\tlet doctype = this.doctype\n\n\t\t\t// If we're at the root level and this is a StonecropStore, use the first path segment as the doctype\n\t\t\tif (this.doctype === 'StonecropStore' && pathSegments.length >= 1) {\n\t\t\t\tdoctype = pathSegments[0]\n\t\t\t}\n\n\t\t\tlet recordId: string | undefined\n\n\t\t\t// Extract recordId from path if it follows the expected pattern\n\t\t\tif (pathSegments.length >= 2) {\n\t\t\t\trecordId = pathSegments[1]\n\t\t\t}\n\n\t\t\tconst context: FieldChangeContext = {\n\t\t\t\tpath: fullPath,\n\t\t\t\tfieldname,\n\t\t\t\tbeforeValue,\n\t\t\t\tafterValue,\n\t\t\t\toperation: 'set',\n\t\t\t\tdoctype,\n\t\t\t\trecordId,\n\t\t\t\ttimestamp: new Date(),\n\t\t\t\tstore: this.rootNode || undefined, // Pass the root store for snapshot/rollback capabilities\n\t\t\t}\n\n\t\t\tawait triggerEngine.executeFieldTriggers(context)\n\t\t} catch (error) {\n\t\t\t// Silently handle trigger errors to not break the main flow\n\t\t\t// In production, you might want to log this error\n\t\t\tif (error instanceof Error) {\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.warn('Field trigger error:', error.message)\n\t\t\t\t// Optional: emit an event or call error handler\n\t\t\t}\n\t\t}\n\t}\n\tprivate isVueReactive(obj: any): obj is VueReactive {\n\t\treturn (\n\t\t\tobj &&\n\t\t\ttypeof obj === 'object' &&\n\t\t\t'__v_isReactive' in obj &&\n\t\t\t(obj as { __v_isReactive: boolean }).__v_isReactive === true\n\t\t)\n\t}\n\n\tprivate isPiniaStore(obj: any): obj is PiniaStore {\n\t\treturn obj && typeof obj === 'object' && ('$state' in obj || '$patch' in obj || '$id' in obj)\n\t}\n\n\tprivate isImmutable(obj: any): obj is ImmutableLike {\n\t\tif (!obj || typeof obj !== 'object') {\n\t\t\treturn false\n\t\t}\n\n\t\tconst hasGetMethod = 'get' in obj && typeof (obj as Record<string, unknown>).get === 'function'\n\t\tconst hasSetMethod = 'set' in obj && typeof (obj as Record<string, unknown>).set === 'function'\n\t\tconst hasHasMethod = 'has' in obj && typeof (obj as Record<string, unknown>).has === 'function'\n\n\t\tconst hasImmutableMarkers =\n\t\t\t'__ownerID' in obj ||\n\t\t\t'_map' in obj ||\n\t\t\t'_list' in obj ||\n\t\t\t'_origin' in obj ||\n\t\t\t'_capacity' in obj ||\n\t\t\t'_defaultValues' in obj ||\n\t\t\t'_tail' in obj ||\n\t\t\t'_root' in obj ||\n\t\t\t('size' in obj && hasGetMethod && hasSetMethod)\n\n\t\tlet constructorName: string | undefined\n\t\ttry {\n\t\t\tconst objWithConstructor = obj as Record<string, unknown>\n\t\t\tif (\n\t\t\t\t'constructor' in objWithConstructor &&\n\t\t\t\tobjWithConstructor.constructor &&\n\t\t\t\ttypeof objWithConstructor.constructor === 'object' &&\n\t\t\t\t'name' in objWithConstructor.constructor\n\t\t\t) {\n\t\t\t\tconst nameValue = (objWithConstructor.constructor as { name: unknown }).name\n\t\t\t\tconstructorName = typeof nameValue === 'string' ? nameValue : undefined\n\t\t\t}\n\t\t} catch {\n\t\t\tconstructorName = undefined\n\t\t}\n\n\t\tconst isImmutableConstructor =\n\t\t\tconstructorName &&\n\t\t\t(constructorName.includes('Map') ||\n\t\t\t\tconstructorName.includes('List') ||\n\t\t\t\tconstructorName.includes('Set') ||\n\t\t\t\tconstructorName.includes('Stack') ||\n\t\t\t\tconstructorName.includes('Seq')) &&\n\t\t\t(hasGetMethod || hasSetMethod)\n\n\t\treturn Boolean(\n\t\t\t(hasGetMethod && hasSetMethod && hasHasMethod && hasImmutableMarkers) ||\n\t\t\t\t(hasGetMethod && hasSetMethod && isImmutableConstructor)\n\t\t)\n\t}\n\n\tprivate isPrimitive(value: any): boolean {\n\t\t// Don't wrap primitive values, functions, or null/undefined\n\t\treturn (\n\t\t\tvalue === null ||\n\t\t\tvalue === undefined ||\n\t\t\ttypeof value === 'string' ||\n\t\t\ttypeof value === 'number' ||\n\t\t\ttypeof value === 'boolean' ||\n\t\t\ttypeof value === 'function' ||\n\t\t\ttypeof value === 'symbol' ||\n\t\t\ttypeof value === 'bigint'\n\t\t)\n\t}\n\n\tprivate parsePath(path: string): string[] {\n\t\tif (!path) return []\n\t\treturn path.split('.').filter(segment => segment.length > 0)\n\t}\n}\n\n/**\n * Factory function for HST creation\n * Creates a new HSTNode proxy for hierarchical state tree navigation.\n *\n * @param target - The target object to wrap with HST functionality\n * @param doctype - The document type identifier\n * @param parentDoctype - Optional parent document type identifier\n * @returns A new HSTNode proxy instance\n *\n * @public\n */\nfunction createHST(target: any, doctype: string, parentDoctype?: string): HSTNode {\n\treturn new HSTProxy(target, doctype, '', null, parentDoctype)\n}\n\n// Export everything\nexport { HSTProxy, HST, createHST, type HSTNode }\n","import DoctypeMeta from './doctype'\nimport Registry from './registry'\nimport { createHST, type HSTNode } from './stores/hst'\nimport { useOperationLogStore } from './stores/operation-log'\nimport type { OperationLogConfig } from './types/operation-log'\nimport type { RouteContext } from './types/registry'\n\n/**\n * Main Stonecrop class with HST integration and built-in Operation Log\n * @public\n */\nexport class Stonecrop {\n\tprivate hstStore: HSTNode\n\tprivate _operationLogStore?: ReturnType<typeof useOperationLogStore>\n\tprivate _operationLogConfig?: Partial<OperationLogConfig>\n\n\t/** The registry instance containing all doctype definitions */\n\treadonly registry: Registry\n\n\t/**\n\t * Creates a new Stonecrop instance with HST integration\n\t * @param registry - The Registry instance containing doctype definitions\n\t * @param operationLogConfig - Optional configuration for the operation log\n\t */\n\tconstructor(registry: Registry, operationLogConfig?: Partial<OperationLogConfig>) {\n\t\tthis.registry = registry\n\n\t\t// Store config for lazy initialization\n\t\tthis._operationLogConfig = operationLogConfig\n\n\t\t// Initialize HST store with auto-sync to Registry\n\t\tthis.initializeHSTStore()\n\t\tthis.setupRegistrySync()\n\t}\n\n\t/**\n\t * Get the operation log store (lazy initialization)\n\t * @internal\n\t */\n\tgetOperationLogStore() {\n\t\tif (!this._operationLogStore) {\n\t\t\tthis._operationLogStore = useOperationLogStore()\n\t\t\tif (this._operationLogConfig) {\n\t\t\t\tthis._operationLogStore.configure(this._operationLogConfig)\n\t\t\t}\n\t\t}\n\t\treturn this._operationLogStore\n\t}\n\n\t/**\n\t * Initialize the HST store structure\n\t */\n\tprivate initializeHSTStore(): void {\n\t\tconst initialStoreStructure: Record<string, any> = {}\n\n\t\t// Auto-populate from existing Registry doctypes\n\t\tObject.keys(this.registry.registry).forEach(doctypeSlug => {\n\t\t\tinitialStoreStructure[doctypeSlug] = {}\n\t\t})\n\n\t\tthis.hstStore = createHST(initialStoreStructure, 'StonecropStore')\n\t}\n\n\t/**\n\t * Setup automatic sync with Registry when doctypes are added\n\t */\n\tprivate setupRegistrySync(): void {\n\t\t// Extend Registry.addDoctype to auto-create HST store sections\n\t\tconst originalAddDoctype = this.registry.addDoctype.bind(this.registry)\n\n\t\tthis.registry.addDoctype = (doctype: DoctypeMeta) => {\n\t\t\t// Call original method\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-call\n\t\t\toriginalAddDoctype(doctype)\n\n\t\t\t// Auto-create HST store section for new doctype\n\t\t\tif (!this.hstStore.has(doctype.slug)) {\n\t\t\t\tthis.hstStore.set(doctype.slug, {})\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Get records hash for a doctype\n\t * @param doctype - The doctype to get records for\n\t * @returns HST node containing records hash\n\t */\n\trecords(doctype: string | DoctypeMeta): HSTNode {\n\t\tconst slug = typeof doctype === 'string' ? doctype : doctype.slug\n\t\tthis.ensureDoctypeExists(slug)\n\t\treturn this.hstStore.getNode(slug)\n\t}\n\n\t/**\n\t * Add a record to the store\n\t * @param doctype - The doctype\n\t * @param recordId - The record ID\n\t * @param recordData - The record data\n\t */\n\taddRecord(doctype: string | DoctypeMeta, recordId: string, recordData: any): void {\n\t\tconst slug = typeof doctype === 'string' ? doctype : doctype.slug\n\n\t\tthis.ensureDoctypeExists(slug)\n\n\t\t// Store raw record data - let HST handle wrapping with proper hierarchy\n\t\tthis.hstStore.set(`${slug}.${recordId}`, recordData)\n\t}\n\n\t/**\n\t * Get a specific record\n\t * @param doctype - The doctype\n\t * @param recordId - The record ID\n\t * @returns HST node for the record or undefined\n\t */\n\tgetRecordById(doctype: string | DoctypeMeta, recordId: string): HSTNode | undefined {\n\t\tconst slug = typeof doctype === 'string' ? doctype : doctype.slug\n\t\tthis.ensureDoctypeExists(slug)\n\n\t\t// First check if the record exists\n\t\tconst recordExists = this.hstStore.has(`${slug}.${recordId}`)\n\t\tif (!recordExists) {\n\t\t\treturn undefined\n\t\t}\n\n\t\t// Check if the actual value is undefined (i.e., record was removed)\n\t\tconst recordValue = this.hstStore.get(`${slug}.${recordId}`)\n\t\tif (recordValue === undefined) {\n\t\t\treturn undefined\n\t\t}\n\n\t\t// Use getNode to get the properly wrapped HST node with correct parent relationships\n\t\treturn this.hstStore.getNode(`${slug}.${recordId}`)\n\t}\n\n\t/**\n\t * Remove a record from the store\n\t * @param doctype - The doctype\n\t * @param recordId - The record ID\n\t */\n\tremoveRecord(doctype: string | DoctypeMeta, recordId: string): void {\n\t\tconst slug = typeof doctype === 'string' ? doctype : doctype.slug\n\t\tthis.ensureDoctypeExists(slug)\n\n\t\t// Remove the specific record directly by setting to undefined\n\t\tif (this.hstStore.has(`${slug}.${recordId}`)) {\n\t\t\tthis.hstStore.set(`${slug}.${recordId}`, undefined)\n\t\t}\n\t}\n\n\t/**\n\t * Get all record IDs for a doctype\n\t * @param doctype - The doctype\n\t * @returns Array of record IDs\n\t */\n\tgetRecordIds(doctype: string | DoctypeMeta): string[] {\n\t\tconst slug = typeof doctype === 'string' ? doctype : doctype.slug\n\t\tthis.ensureDoctypeExists(slug)\n\n\t\tconst doctypeNode = this.hstStore.get(slug) as Record<string, any>\n\t\tif (!doctypeNode || typeof doctypeNode !== 'object') {\n\t\t\treturn []\n\t\t}\n\n\t\treturn Object.keys(doctypeNode).filter(key => doctypeNode[key] !== undefined)\n\t}\n\n\t/**\n\t * Clear all records for a doctype\n\t * @param doctype - The doctype\n\t */\n\tclearRecords(doctype: string | DoctypeMeta): void {\n\t\tconst slug = typeof doctype === 'string' ? doctype : doctype.slug\n\t\tthis.ensureDoctypeExists(slug)\n\n\t\t// Get all record IDs and remove them\n\t\tconst recordIds = this.getRecordIds(slug)\n\t\trecordIds.forEach(recordId => {\n\t\t\tthis.hstStore.set(`${slug}.${recordId}`, undefined)\n\t\t})\n\t}\n\n\t/**\n\t * Setup method for doctype initialization\n\t * @param doctype - The doctype to setup\n\t */\n\tsetup(doctype: DoctypeMeta): void {\n\t\t// Ensure doctype exists in store\n\t\tthis.ensureDoctypeExists(doctype.slug)\n\t}\n\n\t/**\n\t * Run action on doctype\n\t * Executes the action and logs it to the operation log for audit tracking\n\t * @param doctype - The doctype\n\t * @param action - The action to run\n\t * @param args - Action arguments (typically record IDs)\n\t */\n\trunAction(doctype: DoctypeMeta, action: string, args?: any[]): void {\n\t\tconst registry = this.registry.registry[doctype.slug]\n\t\tconst actions = registry?.actions?.get(action)\n\t\tconst recordIds = Array.isArray(args) ? args.filter((arg): arg is string => typeof arg === 'string') : undefined\n\n\t\t// Log action execution start\n\t\tconst opLogStore = this.getOperationLogStore()\n\t\tlet actionResult: 'success' | 'failure' | 'pending' = 'success'\n\t\tlet actionError: string | undefined\n\n\t\ttry {\n\t\t\t// Execute action functions\n\t\t\tif (actions && actions.length > 0) {\n\t\t\t\tactions.forEach(actionStr => {\n\t\t\t\t\ttry {\n\t\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-implied-eval\n\t\t\t\t\t\tconst actionFn = new Function('args', actionStr)\n\t\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-call\n\t\t\t\t\t\tactionFn(args)\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\tactionResult = 'failure'\n\t\t\t\t\t\tactionError = error instanceof Error ? error.message : 'Unknown error'\n\t\t\t\t\t\tthrow error\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t}\n\t\t} catch {\n\t\t\t// Error already set in inner catch\n\t\t} finally {\n\t\t\t// Log the action execution to operation log\n\t\t\topLogStore.logAction(doctype.doctype, action, recordIds, actionResult, actionError)\n\t\t}\n\t}\n\n\t/**\n\t * Get records from server (maintains compatibility)\n\t * @param doctype - The doctype\n\t */\n\tasync getRecords(doctype: DoctypeMeta): Promise<void> {\n\t\tconst response = await fetch(`/${doctype.slug}`)\n\t\tconst records = await response.json()\n\n\t\t// Store each record in HST\n\t\trecords.forEach((record: any) => {\n\t\t\tif (record.id) {\n\t\t\t\tthis.addRecord(doctype, record.id, record)\n\t\t\t}\n\t\t})\n\t}\n\n\t/**\n\t * Get single record from server (maintains compatibility)\n\t * @param doctype - The doctype\n\t * @param recordId - The record ID\n\t */\n\tasync getRecord(doctype: DoctypeMeta, recordId: string): Promise<void> {\n\t\tconst response = await fetch(`/${doctype.slug}/${recordId}`)\n\t\tconst record = await response.json()\n\n\t\t// Store record\n\t\tthis.addRecord(doctype, recordId, record)\n\t}\n\n\t/**\n\t * Ensure doctype section exists in HST store\n\t * @param slug - The doctype slug\n\t */\n\tprivate ensureDoctypeExists(slug: string): void {\n\t\tif (!this.hstStore.has(slug)) {\n\t\t\tthis.hstStore.set(slug, {})\n\t\t}\n\t}\n\n\t/**\n\t * Get doctype metadata from the registry\n\t * @param context - The route context\n\t * @returns The doctype metadata\n\t */\n\tasync getMeta(context: RouteContext): Promise<any> {\n\t\tif (!this.registry.getMeta) {\n\t\t\tthrow new Error('No getMeta function provided to Registry')\n\t\t}\n\t\treturn await this.registry.getMeta(context)\n\t}\n\n\t/**\n\t * Get the root HST store node for advanced usage\n\t * @returns Root HST node\n\t */\n\tgetStore(): HSTNode {\n\t\treturn this.hstStore\n\t}\n}\n","// src/composable.ts\nimport { inject, onMounted, Ref, ref, watch, provide, computed, ComputedRef } from 'vue'\n\nimport Registry from './registry'\nimport { Stonecrop } from './stonecrop'\nimport DoctypeMeta from './doctype'\nimport type { HSTNode } from './stores/hst'\nimport { RouteContext } from './types/registry'\nimport { storeToRefs } from 'pinia'\nimport type { HSTOperation, OperationLogConfig, OperationLogSnapshot } from './types/operation-log'\n\n/**\n * Operation Log API - nested object containing all operation log functionality\n * @public\n */\nexport type OperationLogAPI = {\n\toperations: Ref<HSTOperation[]>\n\tcurrentIndex: Ref<number>\n\tundoRedoState: ComputedRef<{\n\t\tcanUndo: boolean\n\t\tcanRedo: boolean\n\t\tundoCount: number\n\t\tredoCount: number\n\t\tcurrentIndex: number\n\t}>\n\tcanUndo: ComputedRef<boolean>\n\tcanRedo: ComputedRef<boolean>\n\tundoCount: ComputedRef<number>\n\tredoCount: ComputedRef<number>\n\tundo: (hstStore: HSTNode) => boolean\n\tredo: (hstStore: HSTNode) => boolean\n\tstartBatch: () => void\n\tcommitBatch: (description?: string) => string | null\n\tcancelBatch: () => void\n\tclear: () => void\n\tgetOperationsFor: (doctype: string, recordId?: string) => HSTOperation[]\n\tgetSnapshot: () => OperationLogSnapshot\n\tmarkIrreversible: (operationId: string, reason: string) => void\n\tlogAction: (\n\t\tdoctype: string,\n\t\tactionName: string,\n\t\trecordIds?: string[],\n\t\tresult?: 'success' | 'failure' | 'pending',\n\t\terror?: string\n\t) => string\n\tconfigure: (options: Partial<OperationLogConfig>) => void\n}\n\n/**\n * Base Stonecrop composable return type - includes operation log functionality\n * @public\n */\nexport type BaseStonecropReturn = {\n\tstonecrop: Ref<Stonecrop | undefined>\n\toperationLog: OperationLogAPI\n}\n\n/**\n * HST-enabled Stonecrop composable return type\n * @public\n */\nexport type HSTStonecropReturn = BaseStonecropReturn & {\n\tprovideHSTPath: (fieldname: string, recordId?: string) => string\n\thandleHSTChange: (changeData: HSTChangeData) => void\n\thstStore: Ref<HSTNode | undefined>\n\tformData: Ref<Record<string, any>>\n}\n\n/**\n * HST Change data structure\n * @public\n */\nexport type HSTChangeData = {\n\tpath: string\n\tvalue: any\n\tfieldname: string\n\trecordId?: string\n}\n\n/**\n * Unified Stonecrop composable - handles both general operations and HST reactive integration\n *\n * @param options - Configuration options for the composable\n * @returns Stonecrop instance and optional HST integration utilities\n * @public\n */\nexport function useStonecrop(): BaseStonecropReturn | HSTStonecropReturn\n/**\n * Unified Stonecrop composable with HST integration for a specific doctype and record\n *\n * @param options - Configuration with doctype and optional recordId\n * @returns Stonecrop instance with full HST integration utilities\n * @public\n */\nexport function useStonecrop(options: {\n\tregistry?: Registry\n\tdoctype: DoctypeMeta\n\trecordId?: string\n}): HSTStonecropReturn\n/**\n * @public\n */\nexport function useStonecrop(options?: {\n\tregistry?: Registry\n\tdoctype?: DoctypeMeta\n\trecordId?: string\n}): BaseStonecropReturn | HSTStonecropReturn {\n\tif (!options) options = {}\n\n\tconst registry = options.registry || inject<Registry>('$registry')\n\tconst providedStonecrop = inject<Stonecrop>('$stonecrop')\n\tconst stonecrop = ref<Stonecrop>()\n\tconst hstStore = ref<HSTNode>()\n\tconst formData = ref<Record<string, any>>({})\n\n\t// Use refs for router-loaded doctype to maintain reactivity\n\tconst routerDoctype = ref<DoctypeMeta | undefined>()\n\tconst routerRecordId = ref<string | undefined>()\n\n\t// Operation log state and methods - will be populated after stonecrop instance is created\n\tconst operations = ref<HSTOperation[]>([])\n\tconst currentIndex = ref(-1)\n\tconst canUndo = computed(() => stonecrop.value?.getOperationLogStore().canUndo ?? false)\n\tconst canRedo = computed(() => stonecrop.value?.getOperationLogStore().canRedo ?? false)\n\tconst undoCount = computed(() => stonecrop.value?.getOperationLogStore().undoCount ?? 0)\n\tconst redoCount = computed(() => stonecrop.value?.getOperationLogStore().redoCount ?? 0)\n\tconst undoRedoState = computed(\n\t\t() =>\n\t\t\tstonecrop.value?.getOperationLogStore().undoRedoState ?? {\n\t\t\t\tcanUndo: false,\n\t\t\t\tcanRedo: false,\n\t\t\t\tundoCount: 0,\n\t\t\t\tredoCount: 0,\n\t\t\t\tcurrentIndex: -1,\n\t\t\t}\n\t)\n\n\t// Operation log methods\n\tconst undo = (hstStore: HSTNode): boolean => {\n\t\treturn stonecrop.value?.getOperationLogStore().undo(hstStore) ?? false\n\t}\n\n\tconst redo = (hstStore: HSTNode): boolean => {\n\t\treturn stonecrop.value?.getOperationLogStore().redo(hstStore) ?? false\n\t}\n\n\tconst startBatch = () => {\n\t\tstonecrop.value?.getOperationLogStore().startBatch()\n\t}\n\n\tconst commitBatch = (description?: string): string | null => {\n\t\treturn stonecrop.value?.getOperationLogStore().commitBatch(description) ?? null\n\t}\n\n\tconst cancelBatch = () => {\n\t\tstonecrop.value?.getOperationLogStore().cancelBatch()\n\t}\n\n\tconst clear = () => {\n\t\tstonecrop.value?.getOperationLogStore().clear()\n\t}\n\n\tconst getOperationsFor = (doctype: string, recordId?: string) => {\n\t\treturn stonecrop.value?.getOperationLogStore().getOperationsFor(doctype, recordId) ?? []\n\t}\n\n\tconst getSnapshot = () => {\n\t\treturn (\n\t\t\tstonecrop.value?.getOperationLogStore().getSnapshot() ?? {\n\t\t\t\toperations: [],\n\t\t\t\tcurrentIndex: -1,\n\t\t\t\ttotalOperations: 0,\n\t\t\t\treversibleOperations: 0,\n\t\t\t\tirreversibleOperations: 0,\n\t\t\t}\n\t\t)\n\t}\n\n\tconst markIrreversible = (operationId: string, reason: string) => {\n\t\tstonecrop.value?.getOperationLogStore().markIrreversible(operationId, reason)\n\t}\n\n\tconst logAction = (\n\t\tdoctype: string,\n\t\tactionName: string,\n\t\trecordIds?: string[],\n\t\tresult: 'success' | 'failure' | 'pending' = 'success',\n\t\terror?: string\n\t): string => {\n\t\treturn stonecrop.value?.getOperationLogStore().logAction(doctype, actionName, recordIds, result, error) ?? ''\n\t}\n\n\tconst configure = (config: Partial<OperationLogConfig>) => {\n\t\tstonecrop.value?.getOperationLogStore().configure(config)\n\t}\n\n\t// Initialize Stonecrop instance\n\tonMounted(async () => {\n\t\tif (!registry) {\n\t\t\treturn\n\t\t}\n\n\t\tstonecrop.value = providedStonecrop || new Stonecrop(registry)\n\n\t\t// Set up reactive refs from operation log store - only if Pinia is available\n\t\ttry {\n\t\t\tconst opLogStore = stonecrop.value.getOperationLogStore()\n\t\t\tconst opLogRefs = storeToRefs(opLogStore)\n\t\t\toperations.value = opLogRefs.operations.value\n\t\t\tcurrentIndex.value = opLogRefs.currentIndex.value\n\n\t\t\t// Watch for changes in operation log state\n\t\t\twatch(\n\t\t\t\t() => opLogRefs.operations.value,\n\t\t\t\tnewOps => {\n\t\t\t\t\toperations.value = newOps\n\t\t\t\t}\n\t\t\t)\n\t\t\twatch(\n\t\t\t\t() => opLogRefs.currentIndex.value,\n\t\t\t\tnewIndex => {\n\t\t\t\t\tcurrentIndex.value = newIndex\n\t\t\t\t}\n\t\t\t)\n\t\t} catch {\n\t\t\t// Pinia not available (e.g., in tests) - operation log features will not be available\n\t\t\t// Silently fail - operation log is optional\n\t\t}\n\n\t\t// Handle router-based setup if no specific doctype provided\n\t\tif (!options.doctype && registry.router) {\n\t\t\tconst route = registry.router.currentRoute.value\n\n\t\t\t// Parse route path - let the application determine the doctype from the route\n\t\t\tif (!route.path) return // Early return if no path available\n\n\t\t\tconst pathSegments = route.path.split('/').filter(segment => segment.length > 0)\n\t\t\tconst recordId = pathSegments[1]?.toLowerCase()\n\n\t\t\tif (pathSegments.length > 0) {\n\t\t\t\t// Create route context for getMeta function\n\t\t\t\tconst routeContext: RouteContext = {\n\t\t\t\t\tpath: route.path,\n\t\t\t\t\tsegments: pathSegments,\n\t\t\t\t}\n\n\t\t\t\tconst doctype = await registry.getMeta?.(routeContext)\n\t\t\t\tif (doctype) {\n\t\t\t\t\tregistry.addDoctype(doctype)\n\t\t\t\t\tstonecrop.value.setup(doctype)\n\n\t\t\t\t\t// Set reactive refs for router-based doctype\n\t\t\t\t\trouterDoctype.value = doctype\n\t\t\t\t\trouterRecordId.value = recordId\n\t\t\t\t\thstStore.value = stonecrop.value.getStore()\n\n\t\t\t\t\tif (recordId && recordId !== 'new') {\n\t\t\t\t\t\tconst existingRecord = stonecrop.value.getRecordById(doctype, recordId)\n\t\t\t\t\t\tif (existingRecord) {\n\t\t\t\t\t\t\tformData.value = existingRecord.get('') || {}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tawait stonecrop.value.getRecord(doctype, recordId)\n\t\t\t\t\t\t\t\tconst loadedRecord = stonecrop.value.getRecordById(doctype, recordId)\n\t\t\t\t\t\t\t\tif (loadedRecord) {\n\t\t\t\t\t\t\t\t\tformData.value = loadedRecord.get('') || {}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} catch {\n\t\t\t\t\t\t\t\tformData.value = initializeNewRecord(doctype)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tformData.value = initializeNewRecord(doctype)\n\t\t\t\t\t}\n\n\t\t\t\t\tif (hstStore.value) {\n\t\t\t\t\t\tsetupDeepReactivity(doctype, recordId || 'new', formData, hstStore.value)\n\t\t\t\t\t}\n\n\t\t\t\t\tstonecrop.value.runAction(doctype, 'load', recordId ? [recordId] : undefined)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Handle HST integration if doctype is provided explicitly\n\t\tif (options.doctype) {\n\t\t\thstStore.value = stonecrop.value.getStore()\n\t\t\tconst doctype = options.doctype\n\t\t\tconst recordId = options.recordId\n\n\t\t\tif (recordId && recordId !== 'new') {\n\t\t\t\tconst existingRecord = stonecrop.value.getRecordById(doctype, recordId)\n\t\t\t\tif (existingRecord) {\n\t\t\t\t\tformData.value = existingRecord.get('') || {}\n\t\t\t\t} else {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tawait stonecrop.value.getRecord(doctype, recordId)\n\t\t\t\t\t\tconst loadedRecord = stonecrop.value.getRecordById(doctype, recordId)\n\t\t\t\t\t\tif (loadedRecord) {\n\t\t\t\t\t\t\tformData.value = loadedRecord.get('') || {}\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch {\n\t\t\t\t\t\tformData.value = initializeNewRecord(doctype)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tformData.value = initializeNewRecord(doctype)\n\t\t\t}\n\n\t\t\tif (hstStore.value) {\n\t\t\t\tsetupDeepReactivity(doctype, recordId || 'new', formData, hstStore.value)\n\t\t\t}\n\t\t}\n\t})\n\n\t// HST integration functions - always created but only populated when HST is available\n\tconst provideHSTPath = (fieldname: string, customRecordId?: string): string => {\n\t\tconst doctype = options.doctype || routerDoctype.value\n\t\tif (!doctype) return ''\n\n\t\tconst actualRecordId = customRecordId || options.recordId || routerRecordId.value || 'new'\n\t\treturn `${doctype.slug}.${actualRecordId}.${fieldname}`\n\t}\n\n\tconst handleHSTChange = (changeData: HSTChangeData): void => {\n\t\tconst doctype = options.doctype || routerDoctype.value\n\t\tif (!hstStore.value || !stonecrop.value || !doctype) {\n\t\t\treturn\n\t\t}\n\n\t\ttry {\n\t\t\tconst pathParts = changeData.path.split('.')\n\t\t\tif (pathParts.length >= 2) {\n\t\t\t\tconst doctypeSlug = pathParts[0]\n\t\t\t\tconst recordId = pathParts[1]\n\n\t\t\t\tif (!hstStore.value.has(`${doctypeSlug}.${recordId}`)) {\n\t\t\t\t\tstonecrop.value.addRecord(doctype, recordId, { ...formData.value })\n\t\t\t\t}\n\n\t\t\t\tif (pathParts.length > 3) {\n\t\t\t\t\tconst recordPath = `${doctypeSlug}.${recordId}`\n\t\t\t\t\tconst nestedParts = pathParts.slice(2)\n\n\t\t\t\t\tlet currentPath = recordPath\n\t\t\t\t\tfor (let i = 0; i < nestedParts.length - 1; i++) {\n\t\t\t\t\t\tcurrentPath += `.${nestedParts[i]}`\n\n\t\t\t\t\t\tif (!hstStore.value.has(currentPath)) {\n\t\t\t\t\t\t\tconst nextPart = nestedParts[i + 1]\n\t\t\t\t\t\t\tconst isArray = !isNaN(Number(nextPart))\n\t\t\t\t\t\t\thstStore.value.set(currentPath, isArray ? [] : {})\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\thstStore.value.set(changeData.path, changeData.value)\n\n\t\t\tconst fieldParts = changeData.fieldname.split('.')\n\t\t\tconst newFormData = { ...formData.value }\n\n\t\t\tif (fieldParts.length === 1) {\n\t\t\t\tnewFormData[fieldParts[0]] = changeData.value\n\t\t\t} else {\n\t\t\t\tupdateNestedObject(newFormData, fieldParts, changeData.value)\n\t\t\t}\n\n\t\t\tformData.value = newFormData\n\t\t} catch {\n\t\t\t// Silently handle errors\n\t\t}\n\t}\n\n\t// Provide injection tokens if HST will be available\n\tif (options.doctype || registry?.router) {\n\t\tprovide('hstPathProvider', provideHSTPath)\n\t\tprovide('hstChangeHandler', handleHSTChange)\n\t}\n\n\t// Create operation log API object\n\tconst operationLog: OperationLogAPI = {\n\t\toperations,\n\t\tcurrentIndex,\n\t\tundoRedoState,\n\t\tcanUndo,\n\t\tcanRedo,\n\t\tundoCount,\n\t\tredoCount,\n\t\tundo,\n\t\tredo,\n\t\tstartBatch,\n\t\tcommitBatch,\n\t\tcancelBatch,\n\t\tclear,\n\t\tgetOperationsFor,\n\t\tgetSnapshot,\n\t\tmarkIrreversible,\n\t\tlogAction,\n\t\tconfigure,\n\t}\n\t// Always return HST functions if doctype is provided or will be loaded from router\n\tif (options.doctype) {\n\t\t// Explicit doctype - return HST immediately\n\t\treturn {\n\t\t\tstonecrop,\n\t\t\toperationLog,\n\t\t\tprovideHSTPath,\n\t\t\thandleHSTChange,\n\t\t\thstStore,\n\t\t\tformData,\n\t\t} as HSTStonecropReturn\n\t} else if (!options.doctype && registry?.router) {\n\t\t// Router-based - return HST (will be populated after mount)\n\t\treturn {\n\t\t\tstonecrop,\n\t\t\toperationLog,\n\t\t\tprovideHSTPath,\n\t\t\thandleHSTChange,\n\t\t\thstStore,\n\t\t\tformData,\n\t\t} as HSTStonecropReturn\n\t}\n\n\t// No doctype and no router - basic mode\n\treturn {\n\t\tstonecrop,\n\t\toperationLog,\n\t} as BaseStonecropReturn\n}\n\n/**\n * Initialize new record structure based on doctype schema\n */\nfunction initializeNewRecord(doctype: DoctypeMeta): Record<string, any> {\n\tconst initialData: Record<string, any> = {}\n\n\tif (!doctype.schema) {\n\t\treturn initialData\n\t}\n\n\tdoctype.schema.forEach(field => {\n\t\tconst fieldtype = 'fieldtype' in field ? field.fieldtype : 'Data'\n\n\t\tswitch (fieldtype) {\n\t\t\tcase 'Data':\n\t\t\tcase 'Text':\n\t\t\t\tinitialData[field.fieldname] = ''\n\t\t\t\tbreak\n\t\t\tcase 'Check':\n\t\t\t\tinitialData[field.fieldname] = false\n\t\t\t\tbreak\n\t\t\tcase 'Int':\n\t\t\tcase 'Float':\n\t\t\t\tinitialData[field.fieldname] = 0\n\t\t\t\tbreak\n\t\t\tcase 'Table':\n\t\t\t\tinitialData[field.fieldname] = []\n\t\t\t\tbreak\n\t\t\tcase 'JSON':\n\t\t\t\tinitialData[field.fieldname] = {}\n\t\t\t\tbreak\n\t\t\tdefault:\n\t\t\t\tinitialData[field.fieldname] = null\n\t\t}\n\t})\n\n\treturn initialData\n}\n\n/**\n * Setup deep reactivity between form data and HST store\n */\nfunction setupDeepReactivity(\n\tdoctype: DoctypeMeta,\n\trecordId: string,\n\tformData: Ref<Record<string, any>>,\n\thstStore: HSTNode\n): void {\n\twatch(\n\t\tformData,\n\t\tnewData => {\n\t\t\tconst recordPath = `${doctype.slug}.${recordId}`\n\n\t\t\tObject.keys(newData).forEach(fieldname => {\n\t\t\t\tconst path = `${recordPath}.${fieldname}`\n\t\t\t\ttry {\n\t\t\t\t\thstStore.set(path, newData[fieldname])\n\t\t\t\t} catch {\n\t\t\t\t\t// Silently handle errors\n\t\t\t\t}\n\t\t\t})\n\t\t},\n\t\t{ deep: true }\n\t)\n}\n\n/**\n * Update nested object with dot-notation path\n */\nfunction updateNestedObject(obj: any, path: string[], value: any): void {\n\tlet current = obj as Record<string, any>\n\n\tfor (let i = 0; i < path.length - 1; i++) {\n\t\tconst key = path[i]\n\n\t\tif (!(key in current) || typeof current[key] !== 'object') {\n\t\t\tcurrent[key] = isNaN(Number(path[i + 1])) ? {} : []\n\t\t}\n\n\t\tcurrent = current[key] as Record<string, any>\n\t}\n\n\tconst finalKey = path[path.length - 1]\n\tcurrent[finalKey] = value\n}\n","import { useMagicKeys, whenever } from '@vueuse/core'\nimport { storeToRefs } from 'pinia'\nimport { inject } from 'vue'\n\nimport type { HSTNode } from '../stores/hst'\nimport { useOperationLogStore } from '../stores/operation-log'\nimport type { OperationLogConfig } from '../types/operation-log'\n\n/**\n * Composable for operation log management\n * Provides easy access to undo/redo functionality and operation history\n *\n * @param config - Optional configuration for the operation log\n * @returns Operation log interface\n *\n * @example\n * ```typescript\n * const { undo, redo, canUndo, canRedo, operations, configure } = useOperationLog()\n *\n * // Configure the log\n * configure({\n * maxOperations: 50,\n * enableCrossTabSync: true,\n * enablePersistence: true\n * })\n *\n * // Undo/redo\n * await undo(hstStore)\n * await redo(hstStore)\n * ```\n *\n * @public\n */\nexport function useOperationLog(config?: Partial<OperationLogConfig>) {\n\t// Try to use the injected store from the Stonecrop plugin first\n\t// This ensures we use the same Pinia instance as the app\n\tconst injectedStore = inject<ReturnType<typeof useOperationLogStore> | undefined>('$operationLogStore', undefined)\n\tconst store = injectedStore || useOperationLogStore()\n\n\t// Apply configuration if provided\n\tif (config) {\n\t\tstore.configure(config)\n\t}\n\n\t// Extract reactive state\n\tconst { operations, currentIndex, undoRedoState, canUndo, canRedo, undoCount, redoCount } = storeToRefs(store)\n\n\t/**\n\t * Undo the last operation\n\t */\n\tfunction undo(hstStore: HSTNode): boolean {\n\t\treturn store.undo(hstStore)\n\t}\n\n\t/**\n\t * Redo the next operation\n\t */\n\tfunction redo(hstStore: HSTNode): boolean {\n\t\treturn store.redo(hstStore)\n\t}\n\n\t/**\n\t * Start a batch operation\n\t */\n\tfunction startBatch() {\n\t\tstore.startBatch()\n\t}\n\n\t/**\n\t * Commit the current batch\n\t */\n\tfunction commitBatch(description?: string): string | null {\n\t\treturn store.commitBatch(description)\n\t}\n\n\t/**\n\t * Cancel the current batch\n\t */\n\tfunction cancelBatch() {\n\t\tstore.cancelBatch()\n\t}\n\n\t/**\n\t * Clear all operations\n\t */\n\tfunction clear() {\n\t\tstore.clear()\n\t}\n\n\t/**\n\t * Get operations for a specific doctype/record\n\t */\n\tfunction getOperationsFor(doctype: string, recordId?: string) {\n\t\treturn store.getOperationsFor(doctype, recordId)\n\t}\n\n\t/**\n\t * Get a snapshot of the operation log\n\t */\n\tfunction getSnapshot() {\n\t\treturn store.getSnapshot()\n\t}\n\n\t/**\n\t * Mark an operation as irreversible\n\t * @param operationId - The ID of the operation to mark\n\t * @param reason - The reason why the operation is irreversible\n\t */\n\tfunction markIrreversible(operationId: string, reason: string) {\n\t\tstore.markIrreversible(operationId, reason)\n\t}\n\n\t/**\n\t * Log an action execution (stateless actions like print, email, etc.)\n\t * @param doctype - The doctype the action was executed on\n\t * @param actionName - The name of the action that was executed\n\t * @param recordIds - Optional array of record IDs the action was executed on\n\t * @param result - The result of the action execution\n\t * @param error - Optional error message if action failed\n\t * @returns The operation ID\n\t */\n\tfunction logAction(\n\t\tdoctype: string,\n\t\tactionName: string,\n\t\trecordIds?: string[],\n\t\tresult: 'success' | 'failure' | 'pending' = 'success',\n\t\terror?: string\n\t): string {\n\t\treturn store.logAction(doctype, actionName, recordIds, result, error)\n\t}\n\n\t/**\n\t * Update configuration\n\t * @param options - Configuration options to update\n\t */\n\tfunction configure(options: Partial<OperationLogConfig>) {\n\t\tstore.configure(options)\n\t}\n\n\treturn {\n\t\t// State\n\t\toperations,\n\t\tcurrentIndex,\n\t\tundoRedoState,\n\t\tcanUndo,\n\t\tcanRedo,\n\t\tundoCount,\n\t\tredoCount,\n\n\t\t// Methods\n\t\tundo,\n\t\tredo,\n\t\tstartBatch,\n\t\tcommitBatch,\n\t\tcancelBatch,\n\t\tclear,\n\t\tgetOperationsFor,\n\t\tgetSnapshot,\n\t\tmarkIrreversible,\n\t\tlogAction,\n\t\tconfigure,\n\t}\n}\n\n/**\n * Keyboard shortcut handler for undo/redo\n * Automatically binds Ctrl+Z (undo) and Ctrl+Shift+Z/Ctrl+Y (redo) using VueUse\n *\n * @param hstStore - The HST store to operate on\n * @param enabled - Whether shortcuts are enabled (default: true)\n *\n * @example\n * ```typescript\n * import { onMounted } from 'vue'\n *\n * const stonecrop = useStonecrop({ doctype, recordId })\n * useUndoRedoShortcuts(stonecrop.hstStore)\n * ```\n *\n * @public\n */\nexport function useUndoRedoShortcuts(hstStore: HSTNode, enabled = true) {\n\tif (!enabled) return\n\n\tconst { undo, redo, canUndo, canRedo } = useOperationLog()\n\tconst keys = useMagicKeys()\n\n\t// Undo shortcuts: Ctrl+Z or Cmd+Z (Mac)\n\twhenever(keys['Ctrl+Z'], () => {\n\t\tif (canUndo.value) {\n\t\t\tundo(hstStore)\n\t\t}\n\t})\n\n\twhenever(keys['Meta+Z'], () => {\n\t\tif (canUndo.value) {\n\t\t\tundo(hstStore)\n\t\t}\n\t})\n\n\t// Redo shortcuts: Ctrl+Shift+Z, Cmd+Shift+Z (Mac), or Ctrl+Y\n\twhenever(keys['Ctrl+Shift+Z'], () => {\n\t\tif (canRedo.value) {\n\t\t\tredo(hstStore)\n\t\t}\n\t})\n\n\twhenever(keys['Meta+Shift+Z'], () => {\n\t\tif (canRedo.value) {\n\t\t\tredo(hstStore)\n\t\t}\n\t})\n\n\twhenever(keys['Ctrl+Y'], () => {\n\t\tif (canRedo.value) {\n\t\t\tredo(hstStore)\n\t\t}\n\t})\n}\n\n/**\n * Batch operation helper\n * Wraps a function execution in a batch operation\n *\n * @param fn - The function to execute within a batch\n * @param description - Optional description for the batch\n * @returns The batch operation ID\n *\n * @example\n * ```typescript\n * const { withBatch } = useOperationLog()\n *\n * const batchId = await withBatch(() => {\n * hstStore.set('task.123.title', 'New Title')\n * hstStore.set('task.123.status', 'active')\n * hstStore.set('task.123.priority', 'high')\n * }, 'Update task details')\n * ```\n *\n * @public\n */\nexport async function withBatch<T>(fn: () => T | Promise<T>, description?: string): Promise<string | null> {\n\tconst { startBatch, commitBatch, cancelBatch } = useOperationLog()\n\n\tstartBatch()\n\n\ttry {\n\t\tawait fn()\n\t\treturn commitBatch(description)\n\t} catch (error) {\n\t\tcancelBatch()\n\t\tthrow error\n\t}\n}\n","import { Component } from 'vue'\n\nimport type { ImmutableDoctype } from './types'\n\n/**\n * Doctype Meta class\n * @public\n */\nexport default class DoctypeMeta {\n\t/**\n\t * The doctype name\n\t * @public\n\t * @readonly\n\t */\n\treadonly doctype: string\n\n\t/**\n\t * The doctype schema\n\t * @public\n\t * @readonly\n\t */\n\treadonly schema: ImmutableDoctype['schema']\n\n\t/**\n\t * The doctype workflow\n\t * @public\n\t * @readonly\n\t */\n\treadonly workflow: ImmutableDoctype['workflow']\n\n\t/**\n\t * The doctype actions and field triggers\n\t * @public\n\t * @readonly\n\t */\n\treadonly actions: ImmutableDoctype['actions']\n\n\t/**\n\t * The doctype component\n\t * @public\n\t * @readonly\n\t */\n\treadonly component?: Component\n\n\t/**\n\t * Creates a new DoctypeMeta instance\n\t * @param doctype - The doctype name\n\t * @param schema - The doctype schema definition\n\t * @param workflow - The doctype workflow configuration (XState machine)\n\t * @param actions - The doctype actions and field triggers\n\t * @param component - Optional Vue component for rendering the doctype\n\t */\n\tconstructor(\n\t\tdoctype: string,\n\t\tschema: ImmutableDoctype['schema'],\n\t\tworkflow: ImmutableDoctype['workflow'],\n\t\tactions: ImmutableDoctype['actions'],\n\t\tcomponent?: Component\n\t) {\n\t\tthis.doctype = doctype\n\t\tthis.schema = schema\n\t\tthis.workflow = workflow\n\t\tthis.actions = actions\n\t\tthis.component = component\n\t}\n\n\t/**\n\t * Converts the registered doctype string to a slug (kebab-case). The following conversions are made:\n\t * - It replaces camelCase and PascalCase with kebab-case strings\n\t * - It replaces spaces and underscores with hyphens\n\t * - It converts the string to lowercase\n\t *\n\t * @returns The slugified doctype string\n\t *\n\t * @example\n\t * ```ts\n\t * const doctype = new DoctypeMeta('TaskItem', schema, workflow, actions\n\t * console.log(doctype.slug) // 'task-item'\n\t * ```\n\t *\n\t * @public\n\t */\n\tget slug() {\n\t\treturn this.doctype\n\t\t\t.replace(/([a-z])([A-Z])/g, '$1-$2')\n\t\t\t.replace(/[\\s_]+/g, '-')\n\t\t\t.toLowerCase()\n\t}\n}\n","import { Router } from 'vue-router'\n\nimport DoctypeMeta from './doctype'\nimport { getGlobalTriggerEngine } from './field-triggers'\nimport { RouteContext } from './types/registry'\n\n/**\n * Stonecrop Registry class\n * @public\n */\nexport default class Registry {\n\t/**\n\t * The root Registry instance\n\t */\n\tstatic _root: Registry\n\n\t/**\n\t * The name of the Registry instance\n\t *\n\t * @defaultValue 'Registry'\n\t */\n\treadonly name: string\n\n\t/**\n\t * The registry property contains a collection of doctypes\n\t * @see {@link DoctypeMeta}\n\t */\n\treadonly registry: Record<string, DoctypeMeta>\n\n\t/**\n\t * The Vue router instance\n\t * @see {@link https://router.vuejs.org/}\n\t */\n\treadonly router?: Router\n\n\t/**\n\t * Creates a new Registry instance (singleton pattern)\n\t * @param router - Optional Vue router instance for route management\n\t * @param getMeta - Optional function to fetch doctype metadata from an API\n\t */\n\tconstructor(router?: Router, getMeta?: (routeContext: RouteContext) => DoctypeMeta | Promise<DoctypeMeta>) {\n\t\tif (Registry._root) {\n\t\t\treturn Registry._root\n\t\t}\n\t\tRegistry._root = this\n\t\tthis.name = 'Registry'\n\t\tthis.registry = {}\n\t\tthis.router = router\n\t\tthis.getMeta = getMeta\n\t}\n\n\t/**\n\t * The getMeta function fetches doctype metadata from an API based on route context\n\t * @see {@link DoctypeMeta}\n\t */\n\tgetMeta?: (routeContext: RouteContext) => DoctypeMeta | Promise<DoctypeMeta>\n\n\t/**\n\t * Get doctype metadata\n\t * @param doctype - The doctype to fetch metadata for\n\t * @returns The doctype metadata\n\t * @see {@link DoctypeMeta}\n\t */\n\taddDoctype(doctype: DoctypeMeta) {\n\t\tif (!(doctype.doctype in Object.keys(this.registry))) {\n\t\t\tthis.registry[doctype.slug] = doctype\n\t\t}\n\n\t\t// Register actions (including field triggers) with the field trigger engine\n\t\tconst triggerEngine = getGlobalTriggerEngine()\n\t\t// Register under both doctype name and slug to handle different lookup patterns\n\t\ttriggerEngine.registerDoctypeActions(doctype.doctype, doctype.actions)\n\t\tif (doctype.slug !== doctype.doctype) {\n\t\t\ttriggerEngine.registerDoctypeActions(doctype.slug, doctype.actions)\n\t\t}\n\n\t\tif (doctype.component && this.router && !this.router.hasRoute(doctype.doctype)) {\n\t\t\tthis.router.addRoute({\n\t\t\t\tpath: `/${doctype.slug}`,\n\t\t\t\tname: doctype.slug,\n\t\t\t\tcomponent: doctype.component,\n\t\t\t})\n\t\t}\n\t}\n\n\t// TODO: should we allow clearing the registry at all?\n\t// clear() {\n\t// \tthis.registry = {}\n\t// \tif (this.router) {\n\t// \t\tconst routes = this.router.getRoutes()\n\t// \t\tfor (const route of routes) {\n\t// \t\t\tif (route.name) {\n\t// \t\t\t\tthis.router.removeRoute(route.name)\n\t// \t\t\t}\n\t// \t\t}\n\t// \t}\n\t// }\n}\n","import { App, type Plugin, nextTick } from 'vue'\nimport type { Pinia } from 'pinia'\n\nimport Registry from '../registry'\nimport { Stonecrop } from '../stonecrop'\nimport type { InstallOptions } from '../types'\nimport { useOperationLogStore } from '../stores/operation-log'\n\n/**\n * Setup auto-initialization for user-defined initialization logic\n * This function handles the post-mount initialization automatically\n */\nasync function setupAutoInitialization(\n\tregistry: Registry,\n\tstonecrop: Stonecrop,\n\tonRouterInitialized: (registry: Registry, stonecrop: Stonecrop) => void | Promise<void>\n) {\n\t// Wait for the next tick to ensure the app is mounted\n\tawait nextTick()\n\n\ttry {\n\t\tawait onRouterInitialized(registry, stonecrop)\n\t} catch {\n\t\t// Silent error handling - application should handle initialization errors\n\t}\n}\n\n/**\n * Stonecrop Vue plugin\n * @param app - The Vue app instance\n * @param options - The plugin options\n * @example\n * ```ts\n * import { createApp } from 'vue'\n * import Stonecrop from '@stonecrop/stonecrop'\n * import router from './router'\n *\n * const app = createApp(App)\n * app.use(Stonecrop, {\n * router,\n * getMeta: async (routeContext) => {\n * // routeContext contains: { path, segments }\n * // fetch doctype meta from your API using the route context\n * },\n * autoInitializeRouter: true,\n * onRouterInitialized: async (registry, stonecrop) => {\n * // your custom initialization logic here\n * }\n * })\n * app.mount('#app')\n * ```\n * @public\n */\nconst plugin: Plugin = {\n\tinstall: (app: App, options?: InstallOptions) => {\n\t\t// Check for existing router installation\n\t\tconst existingRouter = app.config.globalProperties.$router\n\t\tconst providedRouter = options?.router\n\t\tconst router = existingRouter || providedRouter\n\t\tif (!existingRouter && providedRouter) {\n\t\t\tapp.use(providedRouter)\n\t\t}\n\n\t\t// Create registry with available router\n\t\tconst registry = new Registry(router, options?.getMeta)\n\t\tapp.provide('$registry', registry)\n\t\tapp.config.globalProperties.$registry = registry\n\n\t\t// Create and provide a global Stonecrop instance\n\t\tconst stonecrop = new Stonecrop(registry)\n\t\tapp.provide('$stonecrop', stonecrop)\n\t\tapp.config.globalProperties.$stonecrop = stonecrop\n\n\t\t// Initialize operation log store if Pinia is available\n\t\t// This ensures the store is created with the app's Pinia instance\n\t\ttry {\n\t\t\tconst pinia = app.config.globalProperties.$pinia as Pinia | undefined\n\t\t\tif (pinia) {\n\t\t\t\t// Initialize the operation log store with the app's Pinia instance\n\t\t\t\tconst operationLogStore = useOperationLogStore(pinia)\n\n\t\t\t\t// Provide the store so components can access it\n\t\t\t\tapp.provide('$operationLogStore', operationLogStore)\n\t\t\t\tapp.config.globalProperties.$operationLogStore = operationLogStore\n\t\t\t}\n\t\t} catch (error) {\n\t\t\t// Pinia not available - operation log won't work, but app should still function\n\t\t\tconsole.warn('Pinia not available - operation log features will be disabled:', error)\n\t\t}\n\n\t\t// Register custom components\n\t\tif (options?.components) {\n\t\t\tfor (const [tag, component] of Object.entries(options.components)) {\n\t\t\t\tapp.component(tag, component)\n\t\t\t}\n\t\t}\n\n\t\t// Setup auto-initialization if requested\n\t\tif (options?.autoInitializeRouter && options.onRouterInitialized) {\n\t\t\tvoid setupAutoInitialization(registry, stonecrop, options.onRouterInitialized)\n\t\t}\n\t},\n}\n\nexport default plugin\n"],"names":["activePinia","setActivePinia","pinia","piniaSymbol","isPlainObject","o","MutationType","IS_CLIENT","patchObject","newState","oldState","key","subPatch","targetValue","isRef","isReactive","noop","addSubscription","subscriptions","callback","detached","onCleanup","removeSubscription","idx","getCurrentScope","onScopeDispose","triggerSubscriptions","args","fallbackRunWithContext","fn","ACTION_MARKER","ACTION_NAME","mergeReactiveObjects","target","patchToApply","value","skipHydrateSymbol","shouldHydrate","obj","assign","isComputed","createOptionsStore","id","options","hot","state","actions","getters","initialState","store","setup","localState","toRefs","ref","computedGetters","name","markRaw","computed","createSetupStore","$id","isOptionsStore","scope","optionsForPlugin","$subscribeOptions","event","isListening","debuggerEvents","isSyncListening","actionSubscriptions","hotState","activeListener","$patch","partialStateOrMutator","subscriptionMutation","myListenerId","nextTick","$reset","$state","$dispose","action","wrappedAction","afterCallbackList","onErrorCallbackList","after","onError","ret","error","_hmrPayload","partialStore","stopWatcher","watch","reactive","setupStore","effectScope","prop","toRef","actionValue","toRaw","newStore","stateKey","newStateTarget","oldStateSource","actionName","actionFn","getterName","getter","getterValue","nonEnumerable","p","extender","extensions","defineStore","setupOptions","isSetupStore","useStore","hasContext","hasInjectionContext","inject","hotId","currentInstance","getCurrentInstance","vm","cache","storeToRefs","rawStore","refs","tryOnScopeDispose","failSilently","isClient","toString","isObject","val","toRef$1","r","readonly","customRef","createFilterWrapper","filter","wrapper","resolve","reject","bypassFilter","invoke$1","pausableFilter","extendFilter","isActive","pause","resume","eventFilter","toArray","getLifeCycleTarget","watchWithFilter","source","cb","watchOptions","watchPausable","pausableWatch","tryOnMounted","sync","onMounted","watchImmediate","whenever","v","ov","onInvalidate","defaultWindow","unrefElement","elRef","_$el","plain","toValue","useEventListener","cleanups","cleanup","register","el","listener","firstParamTargets","test","e","stopWatch","_firstParamTargets$va","_firstParamTargets$va2","unref","raw_targets","raw_events","raw_listeners","raw_options","optionsClone","stop","_global","globalKey","handlers","getHandlers","getSSRHandler","fallback","guessSerializerType","rawInit","StorageSerializers","customStorageEventName","useStorage","defaults$1","storage","_options$serializer","flush","deep","listenToStorageChanges","writeDefaults","mergeDefaults","shallow","window$1","initOnMounted","data","shallowRef","keyComputed","type","serializer","pauseWatch","resumeWatch","newValue","write","update","firstMounted","onStorageEvent","ev","onStorageCustomEvent","updateFromCustomEvent","dispatchWriteEvent","oldValue","payload","serialized","read","rawValue","serializedData","useLocalStorage","initialValue","DefaultMagicKeysAliasMap","useMagicKeys","useReactive","aliasMap","passive","onEventFired","current","metaDeps","depsMap","usedKeys","setRefs","reset","updateDeps","keys$1","modifier","depsSet","clearDeps","depsMapKey","deps","depsArray","depsIndex","key$1","index","updateRefs","_e$key","_e$code","values","proxy","target$1","rec","i","generateId","serializeForBroadcast","message","op","deserializeFromBroadcast","useOperationLogStore","config","operations","currentIndex","clientId","batchMode","currentBatch","currentBatchId","canUndo","canRedo","undoCount","count","redoCount","undoRedoState","configure","loadFromPersistence","setupPersistenceWatcher","setupCrossTabSync","addOperation","operation","fullOperation","overflow","broadcastOperation","startBatch","commitBatch","description","batchId","allReversible","batchOperation","broadcastBatch","result","cancelBatch","undo","childId","childOp","revertOperation","broadcastUndo","redo","applyOperation","broadcastRedo","getSnapshot","reversibleOps","timestamps","t","clear","getOperationsFor","doctype","recordId","markIrreversible","operationId","reason","logAction","recordIds","broadcastChannel","rawMessage","childOps","batchOp","persistedData","saveToPersistence","FieldTriggerEngine","fieldname","enableRollback","actionMap","transitionMap","context","triggers","startTime","actionResults","stoppedOnError","rolledBack","snapshot","fieldRollbackConfig","rollbackEnabled","actionResult","errorResult","rollbackError","totalExecutionTime","failedResults","failedResult","handlerError","transition","transitionActions","results","doctypeTransitions","timeout","actionTimeout","regularActionFn","executionTime","doctypeActions","actionNames","pattern","patternParts","fieldParts","patternPart","fieldPart","timeoutId","recordPath","recordData","getGlobalTriggerEngine","registerGlobalAction","registerTransitionAction","setFieldRollback","triggerTransition","engine","markOperationIrreversible","getOperationLogStore","HST","globalRegistry","windowRegistry","nodeRegistry","registry","HSTProxy","parentPath","rootNode","parentDoctype","hst","path","fullPath","pathSegments","nodeDoctype","beforeValue","logStore","operationType","segments","segment","triggerEngine","transitionContext","lastSegment","afterValue","hasGetMethod","hasSetMethod","hasHasMethod","hasImmutableMarkers","constructorName","objWithConstructor","nameValue","isImmutableConstructor","createHST","Stonecrop","operationLogConfig","initialStoreStructure","doctypeSlug","originalAddDoctype","slug","doctypeNode","arg","opLogStore","actionError","actionStr","record","useStonecrop","providedStonecrop","stonecrop","hstStore","formData","routerDoctype","routerRecordId","opLogRefs","newOps","newIndex","route","routeContext","existingRecord","loadedRecord","initializeNewRecord","setupDeepReactivity","provideHSTPath","customRecordId","actualRecordId","handleHSTChange","changeData","pathParts","nestedParts","currentPath","nextPart","isArray","newFormData","updateNestedObject","provide","operationLog","initialData","field","newData","finalKey","useOperationLog","useUndoRedoShortcuts","enabled","keys","withBatch","DoctypeMeta","schema","workflow","component","Registry","router","getMeta","setupAutoInitialization","onRouterInitialized","plugin","app","existingRouter","providedRouter","operationLogStore","tag"],"mappings":";AAAA;AAAA;AAAA;AAAA;AAAA;AAYA,IAAIA;AAQJ,MAAMC,KAAiB,CAACC,MAAWF,KAAcE,GAK3CC,KAAgB,QAAQ,IAAI,aAAa,eAAgB,OAAO,OAAO;AAAA;AAAA,EAA+B,OAAA;AAAA;AAE5G,SAASC,EAETC,GAAG;AACC,SAAQA,KACJ,OAAOA,KAAM,YACb,OAAO,UAAU,SAAS,KAAKA,CAAC,MAAM,qBACtC,OAAOA,EAAE,UAAW;AAC5B;AAMA,IAAIC;AAAA,CACH,SAAUA,GAAc;AAQrBA,EAAAA,EAAa,SAAY,UAMzBA,EAAa,cAAiB,gBAM9BA,EAAa,gBAAmB;AAEpC,GAAGA,OAAiBA,KAAe,CAAA,EAAG;AAEtC,MAAMC,KAAY,OAAO,SAAW;AAo+BpC,SAASC,GAAYC,GAAUC,GAAU;AAErC,aAAWC,KAAOD,GAAU;AACxB,UAAME,IAAWF,EAASC,CAAG;AAE7B,QAAI,EAAEA,KAAOF;AACT;AAEJ,UAAMI,IAAcJ,EAASE,CAAG;AAChC,IAAIP,EAAcS,CAAW,KACzBT,EAAcQ,CAAQ,KACtB,CAACE,EAAMF,CAAQ,KACf,CAACG,GAAWH,CAAQ,IACpBH,EAASE,CAAG,IAAIH,GAAYK,GAAaD,CAAQ,IAKjDH,EAASE,CAAG,IAAIC;AAAA,EAExB;AACA,SAAOH;AACX;AAmDA,MAAMO,KAAO,MAAM;AAAE;AACrB,SAASC,GAAgBC,GAAeC,GAAUC,GAAUC,IAAYL,IAAM;AAC1E,EAAAE,EAAc,KAAKC,CAAQ;AAC3B,QAAMG,IAAqB,MAAM;AAC7B,UAAMC,IAAML,EAAc,QAAQC,CAAQ;AAC1C,IAAII,IAAM,OACNL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