{"version":3,"sources":["../src/utils/mixin.ts","../src/utils/props.ts","../src/utils/emits.ts","../src/utils/vnode.ts","../src/utils/slots.ts","../src/utils/component.ts","../src/utils/router.ts","../src/utils/iterable.ts","../src/utils/app.ts","../src/components/ClientOnly.ts","../src/directives.ts"],"names":["_mock","_withCtx","route","ref","toValue","onMounted"],"mappings":";;;;;AAqBA,IAAM,uBAAA,GAAyC,OAAO,gBAAgB,CAAA;AAkC/D,SAAS,SAAA,CAGd,SAAY,MAAA,EAAgD;AAC5D,EAAA,MAAM,UAAqC,CAAC,IAAA,EAAM,GAAG,MAAM,EAAE,OAAA,EAAQ;AACrE,EAAA,MAAM,QAAA,GAAW;AAAA,IACf,CAAC,uBAAuB,GAAG;AAAA,GAC7B;AAEA,EAAA,MAAM,gBAAA,GAAmB,CAAC,WAAA,KAAiC;AACzD,IAAA,KAAA,MAAW,UAAU,OAAA,EAAS;AAC5B,MAAA,MAAM,OAAA,GAAU,QAAQ,MAAM,CAAA;AAC9B,MAAA,IAAI,OAAA,CAAQ,GAAA,CAAI,OAAA,EAAS,WAAW,CAAA,EAAG;AACrC,QAAA,OAAO,OAAA;AAAA,MACT;AAAA,IACF;AACA,IAAA,OAAO,QAAA;AAAA,EACT,CAAA;AAEA,EAAA,MAAM,KAAA,GAAQ,IAAI,KAAA,CAAM,QAAA,EAAU;AAAA,IAChC,GAAA,EAAK,CAAC,OAAA,EAAS,WAAA,EAAa,QAAA,KAAa;AACvC,MAAA,MAAM,MAAA,GAAS,iBAAiB,WAAW,CAAA;AAC3C,MAAA,OAAO,OAAA,CAAQ,GAAA,CAAI,MAAA,EAAQ,WAAA,EAAa,QAAQ,CAAA;AAAA,IAClD,CAAA;AAAA,IACA,GAAA,EAAK,CAAC,OAAA,EAAS,WAAA,EAAa,UAAU,QAAA,KAAa;AACjD,MAAA,MAAM,MAAA,GAAS,iBAAiB,WAAW,CAAA;AAC3C,MAAA,OAAO,OAAA,CAAQ,GAAA,CAAI,MAAA,EAAQ,WAAA,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AAI,SAAA,CAAU,MAAM,SAAS,CAAA;AAAA,EAC/B;AACA,EAAA,OAAO,GAAA;AACT","file":"vue-utils.mjs","sourcesContent":["import { type Ref, toValue } from 'vue';\nimport { type Mixin, arrayUnique } from '@fastkit/helpers';\nimport { type UnionToIntersection } from '@fastkit/ts-type-utils';\n\nexport type RefOrGetterOrValue<T> = T | Ref<T> | (() => T);\n\nexport type MixedInRefs<T, R> =\n  T extends RefOrGetterOrValue<infer Base>\n    ? Base extends object\n      ? R extends Array<infer U>\n        ? MixedInRefs<Base, UnionToIntersection<U>>\n        : R extends RefOrGetterOrValue<infer Trait>\n          ? Trait extends object\n            ? Mixin<Base, Trait>\n            : never\n          : never\n      : never\n    : never;\n\ntype ToValue<T> = T extends RefOrGetterOrValue<infer V> ? V : never;\n\nconst REF_MIXINS_PROXY_SYMBOL: unique symbol = Symbol('RefMixinsProxy');\n\nexport interface MixedInRefsProxyImpl<T> {\n  /**\n   * @internal\n   */\n  [REF_MIXINS_PROXY_SYMBOL]: {\n    get targets(): RefOrGetterOrValue<any>[];\n  };\n\n  $extend<ER extends RefOrGetterOrValue<any>[]>(\n    ...traits: ER\n  ): MixedInRefsProxy<MixedInRefs<T, ER>>;\n}\n\nexport type MixedInRefsProxy<T> = T & MixedInRefsProxyImpl<T>;\n\nexport function refsProxy<T extends RefOrGetterOrValue<any>>(\n  base: T,\n): MixedInRefsProxy<ToValue<T>>;\nexport function refsProxy<\n  T extends RefOrGetterOrValue<any>,\n  R extends RefOrGetterOrValue<any>[],\n>(base: T, ...traits: R): MixedInRefsProxy<MixedInRefs<T, R>>;\n\n/**\n * Obtain a Proxy instance mixed with multiple objects as mixins.\n *\n * The `Ref` and getter functions flatten their target values as mixins.\n *\n * @param base - Base object or Ref or getter\n * @param traits - trait objects\n * @returns Mixed-in Proxy\n */\nexport function refsProxy<\n  T extends RefOrGetterOrValue<any>,\n  R extends RefOrGetterOrValue<any>[],\n>(base: T, ...traits: R): MixedInRefsProxy<MixedInRefs<T, R>> {\n  const targets: RefOrGetterOrValue<any>[] = [base, ...traits].reverse();\n  const __mock__ = {\n    [REF_MIXINS_PROXY_SYMBOL]: targets,\n  } as any;\n\n  const findTargetByProp = (propertyKey: string | symbol) => {\n    for (const target of targets) {\n      const _target = toValue(target);\n      if (Reflect.has(_target, propertyKey)) {\n        return _target;\n      }\n    }\n    return __mock__;\n  };\n\n  const proxy = new Proxy(__mock__, {\n    get: (_target, propertyKey, receiver) => {\n      const target = findTargetByProp(propertyKey);\n      return Reflect.get(target, propertyKey, receiver);\n    },\n    set: (_target, propertyKey, newValue, receiver) => {\n      const target = findTargetByProp(propertyKey);\n      return Reflect.set(target, propertyKey, newValue, receiver);\n    },\n    has: (_target, propertyKey) =>\n      targets.some((target) => Reflect.has(toValue(target), propertyKey)),\n    ownKeys: (_target) =>\n      arrayUnique(\n        targets.map((target) => Reflect.ownKeys(toValue(target))).flat(),\n      ),\n    getOwnPropertyDescriptor: (_target, propertyKey) => {\n      for (const target of targets) {\n        const descriptor = Reflect.getOwnPropertyDescriptor(\n          toValue(target),\n          propertyKey,\n        );\n        if (descriptor) return descriptor;\n      }\n    },\n  }) as any;\n  return proxy;\n}\n","import { PropType, Prop, ComponentPropsOptions, mergeProps } from 'vue';\n\nimport type { HTMLAttributes, Events } from 'vue';\n\nexport const rawNumberPropType = [String, Number] as PropType<string | number>;\n\nexport type RawNumberProp<D extends number | string | undefined = undefined> =\n  D extends undefined\n    ? {\n        type: PropType<string | number>;\n        required: true;\n      }\n    : {\n        type: PropType<string | number>;\n        default: string | number;\n      };\n\nexport function rawNumberProp<\n  D extends number | string | undefined = undefined,\n  R = RawNumberProp<D>,\n>(defaultValue?: D): R {\n  return {\n    type: rawNumberPropType,\n    required: defaultValue == null ? true : undefined,\n    default: defaultValue,\n  } as unknown as R;\n}\n\ntype InferPropType<T> = [T] extends [null]\n  ? any\n  : [T] extends [\n        {\n          type: null | true;\n        },\n      ]\n    ? any\n    : [T] extends [\n          | ObjectConstructor\n          | {\n              type: ObjectConstructor;\n            },\n        ]\n      ? Record<string, any>\n      : [T] extends [\n            | BooleanConstructor\n            | {\n                type: BooleanConstructor;\n              },\n          ]\n        ? boolean\n        : [T] extends [\n              | DateConstructor\n              | {\n                  type: DateConstructor;\n                },\n            ]\n          ? Date\n          : [T] extends [Prop<infer V, infer D>]\n            ? unknown extends V\n              ? D\n              : V\n            : T;\n\ntype RequiredKeys<T> = {\n  [K in keyof T]: T[K] extends {\n    required: true;\n  }\n    ? K\n    : never;\n}[keyof T];\n\ntype OptionalKeys<T> = Exclude<keyof T, RequiredKeys<T>>;\n\nexport type ExtractPropInput<O> = O extends object\n  ? {\n      [K in RequiredKeys<O>]: InferPropType<O[K]>;\n    } & {\n      [K in OptionalKeys<O>]?: InferPropType<O[K]>;\n    }\n  : {\n      [K in string]: any;\n    };\n\nexport function createPropsOptions<\n  PropsOptions extends Readonly<ComponentPropsOptions>,\n>(opts: PropsOptions): PropsOptions {\n  return opts;\n}\n\nexport type Booleanish = boolean | 'true' | 'false';\n\nexport const BooleanishPropOption = {\n  type: [Boolean, String] as PropType<Booleanish>,\n  default: false,\n};\n\nexport function resolveBooleanish(\n  source: Booleanish | undefined,\n  defaultValue = false,\n): boolean {\n  if (source == null) return defaultValue;\n  return typeof source === 'boolean' ? source : JSON.parse(source);\n}\n\nexport type Numberish = string | number;\n\nexport const NumberishPropOption = {\n  type: [Number, String] as PropType<Numberish>,\n};\n\nexport function resolveNumberish<\n  T extends Numberish | undefined,\n  D extends number | undefined = undefined,\n>(\n  source: T,\n  defaultValue?: D,\n): D extends number\n  ? number\n  : T extends undefined\n    ? number | undefined\n    : number {\n  if (source == null) return defaultValue as any;\n  return typeof source === 'number' ? source : Number(source);\n}\n\ntype HTMLAttributeName = keyof HTMLAttributes;\n\nexport type HTMLAttributesPropOptions<\n  Names extends HTMLAttributeName = HTMLAttributeName,\n> = {\n  [K in Names]-?: PropType<HTMLAttributes[K]>;\n};\n\nconst _mock: unknown = undefined;\n\nexport const FOCUSABLE_ATTRIBUTES_PROP_KEYS = [\n  'tabindex',\n  'onFocus',\n  'onFocusin',\n  'onFocusout',\n  'onBlur',\n] as const;\n\nexport type FocusableAttributesPropKey =\n  (typeof FOCUSABLE_ATTRIBUTES_PROP_KEYS)[number];\n\n/**\n * Focusable Element Events\n */\nexport const FOCUSABLE_ATTRIBUTES_PROPS =\n  _mock as HTMLAttributesPropOptions<FocusableAttributesPropKey>;\n\n/**\n * Focusable Element Events\n * @see {@link FOCUSABLE_ATTRIBUTES_PROPS}\n */\nexport type FocusableAttributesProps = typeof FOCUSABLE_ATTRIBUTES_PROPS;\n\n/**\n * Keyboard Operable Element Events\n */\nexport const KEYBOARDABLE_ATTRIBUTES_PROPS = _mock as HTMLAttributesPropOptions<\n  'onKeydown' | 'onKeypress' | 'onKeyup'\n>;\n\n/**\n * Keyboard Operable Element Events\n * @see {@link KEYBOARDABLE_ATTRIBUTES_PROPS}\n */\nexport type KeyboardableAttributesProps = typeof KEYBOARDABLE_ATTRIBUTES_PROPS;\n\nexport const POINTABLE_ATTRIBUTES_PROP_KEYS = [\n  'onAuxclick',\n  'onClick',\n  'onContextmenu',\n  'onDblclick',\n  'onMousedown',\n  'onMouseenter',\n  'onMouseleave',\n  'onMousemove',\n  'onMouseout',\n  'onMouseover',\n  'onMouseup',\n  'onTouchcancel',\n  'onTouchend',\n  'onTouchmove',\n  'onTouchstart',\n  'onPointerdown',\n  'onPointermove',\n  'onPointerup',\n  'onPointercancel',\n  'onPointerenter',\n  'onPointerleave',\n  'onPointerover',\n  'onPointerout',\n] as const;\n\nexport type PointableAttributesPropKey =\n  (typeof POINTABLE_ATTRIBUTES_PROP_KEYS)[number];\n\n/**\n * Pointer Operable Element Events\n */\nexport const POINTABLE_ATTRIBUTES_PROPS =\n  _mock as HTMLAttributesPropOptions<PointableAttributesPropKey>;\n\n/**\n * Pointer Operable Element Events\n * @see {@link POINTABLE_ATTRIBUTES_PROPS}\n */\nexport type PointableAttributesProps = typeof POINTABLE_ATTRIBUTES_PROPS;\n\n/**\n * Events held by HTML elements\n *\n * @deprecated - This symbol may be removed in the next minor version; consider using {@link HTMLAttributesPropOptions} to define only the necessary events.\n */\nexport const htmlAttributesPropOptions = _mock as HTMLAttributesPropOptions;\n\ntype ReplaceOnAndUncapitalize<T extends `on${string}`> =\n  T extends `${'on'}${infer R}` ? Uncapitalize<R> : never;\n\ntype HTMLEventName = ReplaceOnAndUncapitalize<keyof Events>;\n\ntype HTMLEventEmitOptions = {\n  [EventName in HTMLEventName]: (\n    ev: Events[`on${Capitalize<EventName>}`],\n  ) => true;\n};\n\n/**\n * Focusable Element Emit options mock\n */\nexport const FOCUSABLE_EMIT_OPTIONS_MOCK = _mock as Pick<\n  HTMLEventEmitOptions,\n  'focus' | 'focusin' | 'focusout' | 'blur'\n>;\n\n/**\n * Keyboard Operable Emit options mock\n */\nexport const KEYBOARDABLE_EMIT_OPTIONS_MOCK = _mock as Pick<\n  HTMLEventEmitOptions,\n  'keydown' | 'keypress' | 'keyup'\n>;\n\n/**\n * Pointer Operable Emit options mock\n */\nexport const POINTABLE_EMIT_OPTIONS_MOCK = _mock as Pick<\n  HTMLEventEmitOptions,\n  | 'auxclick'\n  | 'click'\n  | 'contextmenu'\n  | 'dblclick'\n  | 'mousedown'\n  | 'mouseenter'\n  | 'mouseleave'\n  | 'mousemove'\n  | 'mouseout'\n  | 'mouseover'\n  | 'mouseup'\n  | 'touchcancel'\n  | 'touchend'\n  | 'touchmove'\n  | 'touchstart'\n  | 'pointerdown'\n  | 'pointermove'\n  | 'pointerup'\n  | 'pointercancel'\n  | 'pointerenter'\n  | 'pointerleave'\n  | 'pointerover'\n  | 'pointerout'\n>;\n\ntype Data = Record<string, unknown>;\n\nexport function assignProps<T extends Data>(\n  base: T | undefined | null,\n  ...overrides: T[]\n): T {\n  const processed = mergeProps(base || {}, ...overrides);\n  return processed as T;\n}\n","import { ObjectEmitsOptions, EmitsOptions } from 'vue';\n\nimport { UnionToIntersection } from '@fastkit/ts-type-utils';\n\n/**\n * Define an event up corresponding to the specified generics type\n */\nexport function defineEmitsOptions<\n  EmitsOptions extends Readonly<ObjectEmitsOptions>,\n>(): EmitsOptions;\n\n/**\n * Define event up\n */\nexport function defineEmitsOptions<\n  EmitsOptions extends Readonly<ObjectEmitsOptions>,\n>(opts: EmitsOptions): EmitsOptions;\n\nexport function defineEmitsOptions<\n  EmitsOptions extends Readonly<ObjectEmitsOptions>,\n>(opts?: EmitsOptions): EmitsOptions {\n  return opts as any;\n}\n\n/**\n * Emitter\n *\n * * Union emitter function type generated from object-like event options specified by generics.\n *\n * @example\n * ```\n * { a: (arg: string) => any; b: (arg: number) => any; }\n * // ↓\n * (ev: 'a', arg: string) & (ev: 'b', arg: number)\n *\n * { a: [arg: string]; b: [arg: number]; }\n * // ↓\n * (ev: 'a', arg: string) & (ev: 'b', arg: number)\n *\n * { (e: 'a', arg: string): any; (e: 'b', arg: number): any; }\n * // ↓\n * (ev: 'a', arg: string) & (ev: 'b', arg: number)\n * ```\n */\nexport type EmitFn<\n  Options = ObjectEmitsOptions,\n  Event extends keyof Options = keyof Options,\n> =\n  Options extends Array<infer V>\n    ? (event: V, ...args: any[]) => void\n    : {} extends Options\n      ? (event: string, ...args: any[]) => void\n      : Options extends (...args: any[]) => any\n        ? Options\n        : UnionToIntersection<\n            {\n              [key in Event]: Options[key] extends (...args: infer Args) => any\n                ? (event: key, ...args: Args) => void\n                : Options[key] extends any[]\n                  ? (event: key, ...args: Options[key]) => void\n                  : (event: key, ...args: any[]) => void;\n            }[Event]\n          >;\n\ntype ShortEmitsToProps<E extends Record<string, any[]>> = {\n  [K in `on${Capitalize<string & keyof E>}`]?: K extends `on${infer C}`\n    ? E[Uncapitalize<C>] extends null\n      ? (...args: any[]) => any\n      : (...args: E[Uncapitalize<C>]) => any\n    : never;\n};\n\n/**\n * Convert an emit option specified by a type argument to a property IF like `onXXX`.\n */\nexport type EmitsToProps<T extends EmitsOptions | Record<string, any[]>> =\n  T extends string[]\n    ? {\n        [K in string & `on${Capitalize<T[number]>}`]?: (...args: any[]) => any;\n      }\n    : T extends ObjectEmitsOptions\n      ? {\n          [K in string &\n            `on${Capitalize<string & keyof T>}`]?: K extends `on${infer C}`\n            ? T[Uncapitalize<C>] extends null\n              ? (...args: any[]) => any\n              : (\n                  ...args: T[Uncapitalize<C>] extends (..._args: infer P) => any\n                    ? P\n                    : never\n                ) => any\n            : never;\n        }\n      : T extends Record<string, any[]>\n        ? ShortEmitsToProps<T>\n        : {};\n","import type {\n  VNode,\n  VNodeTypes,\n  VNodeChild,\n  Slots,\n  VNodeArrayChildren,\n  VNodeNormalizedChildren,\n} from 'vue';\nimport { Comment, Text, Fragment, isVNode } from 'vue';\n\nexport function findVNodeChild(\n  vnode: VNode,\n  condition: VNodeTypes | ((type: VNodeTypes) => boolean),\n): VNode | undefined {\n  const { children } = vnode;\n  if (!Array.isArray(children)) return;\n\n  const check: (type: VNodeTypes) => boolean =\n    typeof condition === 'function'\n      ? (condition as (type: VNodeTypes) => boolean)\n      : (type: VNodeTypes) => type === condition;\n\n  let hit: VNode | undefined;\n\n  for (const child of children) {\n    if (!child || typeof child !== 'object' || !('type' in child)) {\n      continue;\n    }\n    if (check(child.type)) {\n      hit = child;\n      break;\n    }\n  }\n  return hit;\n}\n\nexport type TypedSlot<Prop = any> = (prop: Prop) => VNodeChild;\n\nexport type VNodeChildOrSlot<Prop = any> = VNodeChild | TypedSlot<Prop>;\n\nexport function resolveVNodeChildOrSlot<Prop = any>(\n  raw: VNodeChildOrSlot<Prop>,\n): TypedSlot<Prop> {\n  return typeof raw === 'function' ? raw : () => raw;\n}\n\nexport function resolveVNodeChildOrSlots<Prop = any>(\n  ...raws: VNodeChildOrSlot<Prop>[]\n): TypedSlot<Prop> | undefined {\n  for (const raw of raws) {\n    if (raw == null) continue;\n    const resolved = resolveVNodeChildOrSlot(raw);\n    return resolved;\n  }\n}\n\nexport function cleanupEmptyVNodeChild(\n  child: VNodeChild,\n): VNodeArrayChildren | undefined {\n  if (child == null || child === '' || child === false) return;\n  if (!Array.isArray(child)) {\n    child = [child];\n  }\n  child = child.filter((row) => {\n    if (row == null || row === '' || row === false) return false;\n    if (typeof row !== 'object') return true;\n    if (Array.isArray(row)) return true;\n    if (row.type === Comment) return false;\n    if (row.type === Text) {\n      if (!row.children || !row.children.length) {\n        return false;\n      }\n    }\n    return true;\n  });\n  if (!child.length) {\n    return;\n  }\n  return child;\n}\n\nexport function renderVNodeChildOrSlotsOrEmpty(\n  raws: VNodeChildOrSlot<void>[],\n  prop?: undefined | null,\n): VNodeArrayChildren | undefined;\nexport function renderVNodeChildOrSlotsOrEmpty<Prop>(\n  raws: VNodeChildOrSlot<Prop>[],\n  prop: Prop,\n): VNodeArrayChildren | undefined;\n\nexport function renderVNodeChildOrSlotsOrEmpty<Prop>(\n  raws: VNodeChildOrSlot<Prop>[],\n  prop?: Prop,\n): VNodeArrayChildren | undefined {\n  const rows = raws\n    .map((raw) => (typeof raw === 'function' ? raw(prop as Prop) : raw))\n    .flat();\n  return cleanupEmptyVNodeChild(rows);\n}\n\nexport function renderSlotOrEmpty(\n  slots: Slots | { [key: string]: TypedSlot },\n\n  name = 'default',\n  prop?: { [key: string]: unknown },\n) {\n  const slot = slots[name];\n  if (!slot) return;\n  return cleanupEmptyVNodeChild(slot(prop));\n}\n\nexport function isFragment(child: VNodeChild): child is VNode {\n  return isVNode(child) && child.type === Fragment;\n}\n\n/**\n * Checks whether a given VNode corresponds to a real DOM element.\n *\n * @param vnode - The VNode to check.\n * @returns `true` if the VNode is backed by a real DOM element, otherwise `false`.\n *\n * @example\n * ```ts\n * const vnode = h('div');\n * console.log(isElementVNode(vnode)); // false before mounting\n * ```\n */\nexport const isElementVNode = (vnode: VNode): boolean => {\n  if (!vnode.el) return false;\n  return vnode.el instanceof Element;\n};\n\n/**\n * A callback hook to control how `findFirstDomVNode` traverses the VNode tree.\n *\n * This function is invoked whenever a DOM-backed VNode is found.\n * You can decide whether to:\n *\n * - **Skip** the current VNode by returning `true`.\n * - **Replace** the current VNode by returning another `VNode`.\n * - **Continue normally** by returning nothing (`void`).\n *\n * @param vnode - The current DOM-backed VNode being visited.\n * @param el - The corresponding real DOM element of the VNode.\n * @returns\n * - `true` to skip the current VNode and continue traversal.\n * - A `VNode` to replace the current one in the traversal.\n * - `void` (or nothing) to accept the current VNode as-is.\n */\nexport type VNodeSkipHandler = (\n  currentVNode: VNode,\n  el: Element,\n) => boolean | VNode | void;\n\n/**\n * Recursively searches a VNode tree and returns the first VNode\n * that corresponds to a real DOM element.\n *\n * @param children - A VNode or its normalized children to search through.\n * @param skipVNode - Optional callback to skip or replace matched VNodes.\n * @returns The first DOM-backed VNode found, or undefined if none exist.\n */\nexport const findFirstDomVNode = (\n  children: VNode | VNodeNormalizedChildren | undefined,\n  skipVNode?: VNodeSkipHandler,\n): VNode | undefined => {\n  if (!children) return;\n  let child = Array.isArray(children) ? children[0] : children;\n\n  if (Array.isArray(child)) return findFirstDomVNode(child, skipVNode);\n\n  if (isVNode(child)) {\n    if (isElementVNode(child)) {\n      const skipResult = skipVNode?.(child, child.el as Element);\n      if (isVNode(skipResult)) {\n        child = skipResult;\n      } else if (skipResult !== true) {\n        return child;\n      }\n    }\n\n    const subTree = child.component?.subTree;\n\n    const nextTarget =\n      (Array.isArray(child.children) && child.children) ||\n      (isVNode(subTree) && subTree) ||\n      undefined;\n\n    return findFirstDomVNode(nextTarget, skipVNode);\n  }\n};\n","import { withCtx as _withCtx } from 'vue';\n\nimport type {\n  VNodeChild,\n  VNode,\n  PropType,\n  SlotsType,\n  ComponentInternalInstance,\n  ComponentInstance,\n} from 'vue';\n\ntype RawSlot = (...args: any[]) => any;\n\ntype RawSlots = Record<string, RawSlot>;\n\n/**\n * Modify all ReturnTypes of the map type of the Slot\n *\n */\ntype NormalizedSlotsReturnTypes<S extends RawSlots, T> = {\n  [K in keyof S]: (...params: Parameters<S[K]>) => T;\n};\n\n/**\n * Map of slots that can be bound as `v-slots` directives.\n */\ntype SlotsDirectiveBindings<S extends RawSlots> = NormalizedSlotsReturnTypes<\n  S,\n  VNodeChild\n>;\n\n/**\n * Interface of the slots object that can be referenced in the setup context\n */\nexport type DefineSlotsType<S extends RawSlots> = NormalizedSlotsReturnTypes<\n  S,\n  VNode[]\n>;\n\n/**\n * Map type of slots that can be set as `slots` option in Vue components\n */\nexport type ResolvedSlots<S extends RawSlots> = SlotsType<\n  NormalizedSlotsReturnTypes<S, VNode[]>\n>;\n\n/**\n * A factory that generates map types for slots that can be set as `slots` options in Vue components and props options for tsx support\n *\n */\nexport type DefinedSlots<S extends RawSlots> = ResolvedSlots<S> & {\n  (): {\n    'v-slots': PropType<SlotsDirectiveBindings<S>>;\n  };\n};\n\nconst _mock = () => undefined;\n\n/**\n * Define Vue slot options and props factory for tsx support\n *\n * @example\n * ```tsx\n * import { defineComponent } from 'vue';\n * import { defineSlots } from '@fastkit/vue-utils';\n *\n * const slots = defineSlots({\n *   default?: (params: string) => any;\n *   requiredSlots: (optionalParams?: number) => any;\n * });\n *\n * const Component = defineComponent({\n *   props: {\n *     ...slots(), // For tsx\n *   },\n *   slots,\n *   setup() {\n *     // .....\n *   },\n * });\n *\n * <Component\n *   v-slots={{\n *     requiredSlots: (optionalParams) => `${optionalParams || 'fallback message'}`,\n *     default: () => <div>Hello slots.</div>\n *   }}\n * />\n * ```\n *\n * @returns slot options and props factory\n */\nexport function defineSlots<S extends RawSlots>(): DefinedSlots<S> {\n  return _mock as any;\n}\n\ntype AnyFn = (...args: any[]) => any;\n\n/**\n * Wraps Vue's compiler helper `withCtx` to accept a type argument for its first parameter\n *\n * This function is a workaround for a feature request. It will be unnecessary if Vue adopts the feature.\n *\n * @see {@link https://github.com/vuejs/rfcs/discussions/779}\n * @see {@link _withCtx | withCtx}\n */\nexport const withCtx = _withCtx as <Fn extends AnyFn>(\n  fn: Fn,\n  ctx?: ComponentInternalInstance | null,\n  isNonScopedSlot?: boolean,\n) => Fn;\n\n/**\n * Apply `withCtx` to all functions inside the object (Vue compiler helper)\n *\n * @mutable\n *\n * @see {@link _withCtx | withCtx}\n */\nexport function withCtxForSlots<Slots extends Record<string, any>>(\n  slots: Slots,\n  ctx?: ComponentInternalInstance | null,\n  isNonScopedSlot?: boolean,\n) {\n  for (const key in slots) {\n    if (Object.hasOwn(slots, key)) {\n      const entry = slots[key];\n      if (typeof entry === 'function') {\n        slots[key] = withCtx(entry, ctx, isNonScopedSlot);\n      }\n    }\n  }\n  return slots;\n}\n\ntype RemoveIndexSignature<T> = {\n  [K in keyof T as string extends K\n    ? never\n    : number extends K\n      ? never\n      : symbol extends K\n        ? never\n        : K]: T[K];\n};\n\ntype ToAny<T extends Record<string, AnyFn | undefined>> = {\n  [K in keyof T]: NonNullable<T[K]> extends AnyFn\n    ? (...args: Parameters<NonNullable<T[K]>>) => any\n    : number;\n};\n\nexport type TypedSlotsWithCtx<Ctor> = ToAny<\n  RemoveIndexSignature<ComponentInstance<Ctor>['$slots']>\n>;\n\n/**\n * Wrap all slot functions in the given object with `withCtx` for the specified component.\n *\n * @mutable\n *\n * @example\n * ```tsx\n * <SlotComponent\n *   v-slots={typedSlotsWithCtx(SlotComponent, {\n *     default: () => <div>{some.value}</div>, // This is type safe\n *     slot1: (slot1Payload) => <div>{some.value}</div>, // This is type safe\n *   })}\n * />\n * ```\n *\n * @remarks\n * When defining a set of slots at once using an object, you can use {@link typedSlotsWithCtx}.\n *\n * @see {@link withCtx}\n */\nexport function typedSlotsWithCtx<Ctor, Slots extends TypedSlotsWithCtx<Ctor>>(\n  _ctor: Ctor,\n  slots: Slots,\n  ctx?: ComponentInternalInstance | null,\n  isNonScopedSlot?: boolean,\n): Slots {\n  return withCtxForSlots(slots, ctx, isNonScopedSlot);\n}\n\nexport type TypedSlotWithCtx<\n  Ctor,\n  SlotName extends keyof TypedSlotsWithCtx<Ctor>,\n> = TypedSlotsWithCtx<Ctor>[SlotName];\n\n/**\n * Wrap the slot function for the specified component and slot name with `withCtx`.\n *\n * @example\n * ```tsx\n * <SlotComponent\n *   v-slots={{\n *     default: typedSlotsWithCtx(SlotComponent, 'default', () => <div>{some.value}</div>), // This is type safe\n *     slot1: typedSlotsWithCtx(SlotComponent, 'slot1', (slot1Payload) => <div>{some.value}</div>), // This is type safe\n *   }}\n * />\n * ```\n *\n * @remarks\n * When defining a single slot function, you can use {@link typedSlotWithCtx}.\n *\n * @see {@link withCtx}\n */\nexport function typedSlotWithCtx<\n  Ctor,\n  SlotName extends keyof TypedSlotsWithCtx<Ctor>,\n  Slot extends TypedSlotWithCtx<Ctor, SlotName>,\n>(\n  _ctor: Ctor,\n  _slotName: SlotName,\n  fn: Slot,\n  ctx?: ComponentInternalInstance | null,\n  isNonScopedSlot?: boolean,\n): Slot {\n  return typeof fn === 'function'\n    ? withCtx(fn as any, ctx, isNonScopedSlot)\n    : fn;\n}\n","import {\n  DefineComponent,\n  VNodeChild,\n  PropType,\n  ComponentCustomOptions,\n  ref,\n  h,\n} from 'vue';\nimport type { defineSlots } from './slots';\n\nexport type ExtractComponentPropTypes<\n  C extends {\n    setup?: DefineComponent<any>['setup'];\n  },\n> = Parameters<NonNullable<C['setup']>>[0];\n\ninterface RawSlotsSettings {\n  [key: string]: any;\n}\n\ntype ResolveRawSlots<R extends RawSlotsSettings> = {\n  [K in keyof R]?: (prop: R[K]) => VNodeChild;\n};\n\n/**\n * Define properties for slots for tsx support\n *\n * @deprecated This functionality has been moved to {@link defineSlots} with Vue 3.3 slots type support. It may be removed in the next minor version.\n */\nexport function defineSlotsProps<R extends RawSlotsSettings>() {\n  return undefined as unknown as {\n    'v-slots': PropType<ResolveRawSlots<R>>;\n  };\n}\n\nexport function isComponentCustomOptions(\n  Component: unknown,\n): Component is ComponentCustomOptions {\n  return (\n    (!!Component && typeof Component === 'object') ||\n    typeof Component === 'function'\n  );\n}\n\ntype AnyComponentConstructor = { new (): any };\n\nexport type ComponentInstanceType<\n  ComponentConstructor extends AnyComponentConstructor,\n> = InstanceType<ComponentConstructor>;\n\n/**\n * API for referenceable component constructors\n */\nexport type ReferencedComponentAPI<\n  ComponentConstructor extends AnyComponentConstructor,\n> = {\n  /** component instance */\n  get instance(): ComponentInstanceType<ComponentConstructor> | undefined;\n\n  /**\n   * Ensure component instances are retrieved\n   *\n   * @throws Throws an exception if the instance is not retained\n   */\n  ensureInstance(): ComponentInstanceType<ComponentConstructor>;\n};\n\n/**\n * Component constructor with reference\n *\n * @see {@link ReferencedComponentAPI}\n */\nexport type ReferencedComponent<\n  ComponentConstructor extends AnyComponentConstructor,\n> = ComponentConstructor & ReferencedComponentAPI<ComponentConstructor>;\n\n/**\n * Creating a referenceable component constructor\n * @param Ctor - component constructor\n * @returns Component constructor with reference\n *\n * @see {@link ReferencedComponent}\n */\nexport function componentRef<\n  ComponentConstructor extends AnyComponentConstructor,\n>(Ctor: ComponentConstructor): ReferencedComponent<ComponentConstructor> {\n  const _ref = ref<ComponentInstanceType<ComponentConstructor>>();\n  const _ReferencedComponent: ReferencedComponent<ComponentConstructor> = ((\n    props: any,\n    ctx: any,\n  ) =>\n    h(\n      Ctor,\n      {\n        ...props,\n        ref: (source: any) => {\n          _ref.value = source;\n        },\n      },\n      ctx.slots,\n    )) as any;\n\n  Object.defineProperty(_ReferencedComponent, 'instance', {\n    get: () => _ref.value,\n    enumerable: true,\n  });\n\n  _ReferencedComponent.ensureInstance = () => {\n    const instance = _ref.value;\n    if (!instance) {\n      const name = Ctor.name ? `(${Ctor.name})` : '';\n      throw new Error(\n        `The component instance${name} was not found. The ref may not be properly set within the render hook.`,\n      );\n    }\n    return instance;\n  };\n\n  return _ReferencedComponent;\n}\n\n/** Extend the component's public IF with a specified type argument */\nexport type ExposedComponent<\n  Exposed extends Record<string, any>,\n  ComponentConstructor extends AnyComponentConstructor,\n> = ComponentConstructor & {\n  new (): Exposed;\n};\n\n/**\n * Utility API to supplement type information for components\n */\nexport type TypedComponentAPI<\n  ComponentConstructor extends AnyComponentConstructor,\n  CustomInterface extends Record<keyof any, unknown> = {},\n> = {\n  /**\n   * Get a new constructor that extends the component's public IF type\n   *\n   * This is a support method for the inability to infer `expose()` in a jsx expression.\n   */\n  $expose<Exposed extends Record<string, any>>(): TypedComponent<\n    ExposedComponent<Exposed, ComponentConstructor>,\n    CustomInterface\n  >;\n  /**\n   * Creating a referenceable component constructor\n   * @returns Component constructor with reference\n   *\n   * @see {@link componentRef}\n   * @see {@link ReferencedComponent}\n   */\n  $ref(): ReferencedComponent<ComponentConstructor>;\n} & CustomInterface;\n\n/**\n * Constructor with component type information extension API already set up\n *\n * @see {@link TypedComponentAPI}\n */\nexport type TypedComponent<\n  ComponentConstructor extends AnyComponentConstructor,\n  CustomInterface extends Record<keyof any, unknown> = {},\n> = ComponentConstructor &\n  TypedComponentAPI<ComponentConstructor, CustomInterface>;\n\n/**\n * Set up a utility API for type information extension in the component constructor\n *\n * @param Ctor - Component constructor\n * @param customInterface - Component constructor custom interface\n * @returns Constructor with utility API already set up\n */\nexport function defineTypedComponent<\n  ComponentConstructor extends AnyComponentConstructor,\n  CustomInterface extends Record<keyof any, unknown> = {},\n>(Ctor: ComponentConstructor, customInterface?: CustomInterface) {\n  const api: TypedComponentAPI<ComponentConstructor> = {\n    $expose: () => _TypedComponent,\n    $ref: () => componentRef(Ctor),\n  };\n\n  const _TypedComponent = new Proxy(\n    Ctor as TypedComponent<ComponentConstructor, CustomInterface>,\n    {\n      get(target, propertyKey, receiver) {\n        const apiProp = (api as any)[propertyKey];\n        if (apiProp) return apiProp;\n        if (customInterface && Reflect.has(customInterface, propertyKey)) {\n          return Reflect.get(customInterface, propertyKey, receiver);\n        }\n        return Reflect.get(target, propertyKey, receiver);\n      },\n    },\n  );\n\n  return _TypedComponent;\n}\n","import type { ComponentPublicInstance } from 'vue';\nimport type {\n  RouteLocationNormalized,\n  RouteComponent,\n  RouteRecordNormalized,\n  LocationQueryRaw,\n  RouteLocationNormalizedLoaded,\n  _RouteLocationBase,\n  LocationQuery,\n  Router,\n  RouteLocation,\n} from 'vue-router';\nimport { isObjectEqual } from '@fastkit/helpers';\n\nexport type RawRouteComponent =\n  | RouteComponent\n  | (() => Promise<RouteComponent>);\n\nexport function getRouteMatchedComponents<\n  P extends 'components' = 'components',\n>(\n  route: RouteLocationNormalized,\n  matches: false | number[] = false,\n  prop: P = 'components' as P,\n) {\n  const values = route.matched.map((m, index) =>\n    Object.values(m[prop] || {}).map((v) => {\n      matches && matches.push(index);\n      return v;\n    }),\n  );\n  return [...values].flat();\n}\n\nexport interface RouteMatchedItem {\n  Component: RawRouteComponent;\n  instance: ComponentPublicInstance | null;\n  route: RouteRecordNormalized;\n  key: string;\n  index: number;\n}\n\nexport function extractRouteMatchedItems(route: RouteLocationNormalized) {\n  const results: RouteMatchedItem[] = [];\n\n  route.matched.forEach((route, index) => {\n    const { components, instances } = route;\n    if (!components) return;\n    Object.entries(components).forEach(([key, Component]) => {\n      if (!Component) return;\n      const instance = instances[key] || null;\n      results.push({ Component, instance, route, key, index });\n    });\n  });\n\n  return results;\n}\n\nexport function getMergedRouteQuery(\n  query: LocationQueryRaw,\n  overrides: LocationQuery,\n) {\n  const _query = JSON.parse(JSON.stringify(overrides)) as LocationQuery;\n\n  Object.entries(query).forEach(([key, value]) => {\n    if (Array.isArray(value)) {\n      const values = value.map((v) => {\n        if (typeof v === 'number') v = String(v);\n        return v;\n      });\n      _query[key] = values as string[];\n    } else if (value === null) {\n      delete _query[key];\n    } else {\n      if (typeof value === 'number') value = String(value);\n      _query[key] = value as string;\n    }\n  });\n  return _query;\n}\nexport function getQueryMergedLocation(\n  query: LocationQueryRaw,\n  route: RouteLocationNormalizedLoaded,\n): _RouteLocationBase {\n  return {\n    ...route,\n    query: getMergedRouteQuery(query, route.query),\n  };\n}\n\nexport type RouteQueryType =\n  | StringConstructor\n  | NumberConstructor\n  | BooleanConstructor;\n\nexport function getRouteQuery(bucket: LocationQuery, key: string): string | undefined; // eslint-disable-line prettier/prettier\nexport function getRouteQuery(bucket: LocationQuery, key: string, type: undefined, defaultValue: string): string; // eslint-disable-line prettier/prettier\nexport function getRouteQuery(bucket: LocationQuery, key: string, type: StringConstructor): string | undefined; // eslint-disable-line prettier/prettier\nexport function getRouteQuery(bucket: LocationQuery, key: string, type: StringConstructor, defaultValue: string): string; // eslint-disable-line prettier/prettier\nexport function getRouteQuery(bucket: LocationQuery, key: string, type: NumberConstructor): number | undefined; // eslint-disable-line prettier/prettier\nexport function getRouteQuery(bucket: LocationQuery, key: string, type: NumberConstructor, defaultValue: number): number; // eslint-disable-line prettier/prettier\nexport function getRouteQuery(bucket: LocationQuery, key: string, type: BooleanConstructor): boolean; // eslint-disable-line prettier/prettier\nexport function getRouteQuery(bucket: LocationQuery, key: string, type: BooleanConstructor, defaultValue: boolean): boolean; // eslint-disable-line prettier/prettier\nexport function getRouteQuery(\n  bucket: LocationQuery,\n  key: string,\n\n  type: RouteQueryType = String,\n  defaultValue?: string | number | boolean,\n): string | number | boolean | undefined {\n  const _value = bucket[key];\n  const value = Array.isArray(_value) ? _value[0] : _value;\n  if (type === String) {\n    return value != null ? value : defaultValue;\n  }\n  if (type === Number) {\n    if (value != null) {\n      const parsed = Number(value);\n      return isNaN(parsed) ? defaultValue : parsed;\n    }\n    return defaultValue;\n  }\n  if (type === Boolean) {\n    if (value != null) {\n      const lower = String(value).toLowerCase().trim();\n      if (['1', 'true', 'on'].includes(lower)) return true;\n      if (['0', '-1', 'false', 'off'].includes(lower)) return false;\n    }\n    return defaultValue;\n  }\n}\n\nexport const trailingSlashRE = /\\/?$/;\n\nexport function removeTrailingSlash(str: string) {\n  return str.replace(trailingSlashRE, '');\n}\n\nexport interface SameRouteCheckOptions {\n  hash?: boolean;\n  query?: boolean;\n  params?: boolean;\n}\n\n/**\n * @see https://github.com/vuejs/vue-router/blob/c69ff7bd60228fb79acd764c3fdae91015a49103/src/util/route.js#L73\n */\nexport function isSameRoute(\n  a: _RouteLocationBase,\n  b?: _RouteLocationBase,\n  opts?: SameRouteCheckOptions,\n): boolean {\n  const includeHash = (opts && opts.hash) || true;\n  const includeQuery = (opts && opts.query) || true;\n  const includeParams = (opts && opts.params) || true;\n\n  if (!b) {\n    return false;\n  }\n  if (a.path && b.path) {\n    return (\n      removeTrailingSlash(a.path) === removeTrailingSlash(b.path) &&\n      (!includeHash || a.hash === b.hash) &&\n      (!includeQuery || isObjectEqual(a.query, b.query))\n    );\n  }\n  if (a.name && b.name) {\n    return (\n      a.name === b.name &&\n      (!includeHash || a.hash === b.hash) &&\n      (!includeQuery || isObjectEqual(a.query, b.query)) &&\n      (!includeParams || isObjectEqual(a.params, b.params))\n    );\n  }\n  return false;\n}\n\nconst MOCK_REDIRECT_FN = () => ({ name: '' });\n\nexport function createMockPathRoute(\n  router: Router,\n  path: string,\n): RouteLocation & { href: string } {\n  const { base } = router.options.history;\n  if (path.startsWith(base)) {\n    path = path.replace(base, '');\n  }\n\n  const release = router.addRoute({\n    name: '__mockRoute__',\n    path,\n    redirect: MOCK_REDIRECT_FN,\n  });\n\n  const route = router.resolve(path);\n  release();\n\n  return route;\n}\n","import { type MaybeRefOrGetter, computed, toValue, ref, onMounted } from 'vue';\nimport { temporaryObjectID } from '@fastkit/helpers';\n\n/**\n * Retrieve the vnode key for the specified object.\n *\n * The key obtained from this function is intended to be used on the client side.\n * Please note that in non-browser environments, undefined will be returned.\n *\n * @param obj - The object from which to retrieve the key\n * @returns The key for the object\n */\nexport function getClientIterableKey(obj: WeakKey): number | undefined {\n  return temporaryObjectID(obj, true);\n}\n\nexport type IterableKeyDetectorCandidate = string;\n\nconst ITERABLE_KEY_DETECTOR_CANDIDATES: IterableKeyDetectorCandidate[] = [\n  'id',\n  '_id',\n  'key',\n  '_key',\n  'value',\n];\n\nexport function registerIterableKeyDetectorCandidates(\n  candidates: IterableKeyDetectorCandidate[],\n  replace?: boolean,\n) {\n  if (replace) {\n    ITERABLE_KEY_DETECTOR_CANDIDATES.splice(\n      0,\n      ITERABLE_KEY_DETECTOR_CANDIDATES.length,\n      ...candidates,\n    );\n  } else {\n    ITERABLE_KEY_DETECTOR_CANDIDATES.push(...candidates);\n  }\n}\n\nexport type IterableKeyResolver<T = unknown> = (item: T) => string | undefined;\n\n/**\n * Settings of the List Item Enumeration Key Detector\n */\nexport interface IterableKeyDetectorSettings<T = unknown> {\n  /**\n   * List of items\n   */\n  items: MaybeRefOrGetter<T[] | undefined>;\n  /**\n   * Detection criteria for item key\n   *\n   * - `string` If the item is an object, use the value of the specified property name as the key.\n   * - `IterableKeyResolver (Function)` Retrieve the key using a custom function.\n   * - `undefined` If the item is an object, detect the key from a list of candidates.\n   *\n   * @default undefined\n   */\n  itemKey?: MaybeRefOrGetter<string | IterableKeyResolver<T> | undefined>;\n  /**\n   * List of candidates for automatic detection\n   */\n  candidates?: MaybeRefOrGetter<IterableKeyDetectorCandidate[] | undefined>;\n}\n\nconst resolveKeyValue = (\n  value: unknown,\n): string | undefined | Record<keyof any, unknown> => {\n  if (\n    typeof value === 'string' ||\n    typeof value === 'number' ||\n    typeof value === 'boolean' ||\n    value instanceof Date\n  ) {\n    return String(value);\n  }\n  if (value && typeof value === 'object') {\n    return value as any;\n  }\n};\n\n/**\n * List Item Enumeration Key Detector\n */\nexport interface IterableKeyDetector<T = unknown> {\n  /**\n   * List of items\n   */\n  get items(): T[];\n  /**\n   * Detect and return the key of enumerable items.\n   *\n   * @param item - item\n   * @param defaultValue - default value\n   */\n  detect<D extends string | undefined>(item: T, defaultValue?: D): string | D;\n}\n\n/**\n * Initialize and retrieve the List Item Enumeration Key Detector\n *\n * @param settings - Settings of the List Item Enumeration Key Detector\n * @returns List Item Enumeration Key Detector\n *\n * @see {@link IterableKeyDetectorSettings}\n * @see {@link IterableKeyDetector}\n */\nexport function useIterableKeyDetector<T = unknown>(\n  settings: IterableKeyDetectorSettings<T>,\n): IterableKeyDetector<T> {\n  let detectedItemKey: string | undefined;\n\n  const mounted = ref(false);\n  onMounted(() => {\n    mounted.value = true;\n  });\n\n  const items = computed<T[]>(() => toValue(settings.items) || []);\n\n  const candidates = computed<IterableKeyDetectorCandidate[]>(() => {\n    const itemKey = toValue(settings.itemKey);\n    const _candidates = [\n      ...(toValue(settings.candidates) || []),\n      ...ITERABLE_KEY_DETECTOR_CANDIDATES,\n    ];\n    if (typeof itemKey === 'string') {\n      _candidates.unshift(itemKey);\n    }\n    return _candidates;\n  });\n\n  const detect = computed<IterableKeyResolver<T>>(() => {\n    const itemKey = toValue(settings.itemKey);\n    if (typeof itemKey === 'function') {\n      return itemKey;\n    }\n\n    if (typeof itemKey === 'string') {\n      detectedItemKey = itemKey;\n    }\n\n    return (item) => {\n      let value = resolveKeyValue(item);\n      if (typeof value === 'string') {\n        return value;\n      }\n\n      if (value && typeof value === 'object') {\n        if (detectedItemKey) {\n          return resolveKeyValue(value[detectedItemKey]) as any;\n        }\n\n        const _candidates = candidates.value;\n        let detected: string | undefined;\n        for (const candidate of _candidates) {\n          const _detected = resolveKeyValue(value[candidate]);\n          if (typeof _detected === 'string') {\n            detected = _detected;\n            detectedItemKey = candidate;\n            break;\n          }\n        }\n        if (typeof detected === 'string') {\n          value = detected;\n        } else {\n          const _key = mounted.value ? getClientIterableKey(value) : undefined;\n          value = _key !== undefined ? String(_key) : undefined;\n        }\n      }\n      return value;\n    };\n  });\n\n  return {\n    get items() {\n      return items.value;\n    },\n    detect<D extends string | undefined>(\n      item: T,\n      defaultValue?: D,\n    ): string | D {\n      return (detect.value(item) ?? defaultValue) as string | D;\n    },\n  };\n}\n","import { App } from 'vue';\n\nexport function onAppUnmount<HostElement = any>(\n  app: App<HostElement>,\n  unmount: () => any,\n) {\n  const unmountApp = app.unmount;\n\n  app.unmount = function wrapedUnmount() {\n    try {\n      unmount();\n    } finally {\n      unmountApp();\n    }\n  };\n}\n","import { ref, onMounted, defineComponent } from 'vue';\n\nexport const ClientOnly = defineComponent({\n  name: 'ClientOnly',\n  setup(_, { slots }) {\n    const show = ref(false);\n    onMounted(() => {\n      show.value = true;\n    });\n\n    return () => (show.value && slots.default?.()) || null;\n  },\n});\n","import type { App, Directive } from 'vue';\n\nexport function installDirective(\n  app: App,\n  name: string,\n  directive: Directive<any, any>,\n) {\n  if (app._context.directives[name] !== directive) {\n    app.directive(name, directive);\n  }\n  return app;\n}\n"]}