flexium 0.10.4 → 0.10.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (149) hide show
  1. package/dist/{DrawText-ngwNNh8O.d.ts → DrawText-CVAKQ5wZ.d.cts} +42 -42
  2. package/dist/{DrawText-ccZrs3Xs.d.cts → DrawText-Dlh1L1Ar.d.ts} +42 -42
  3. package/dist/advanced.d.cts +1 -1
  4. package/dist/advanced.d.ts +1 -1
  5. package/dist/advanced.js +1 -1
  6. package/dist/advanced.js.map +1 -1
  7. package/dist/advanced.mjs +1 -1
  8. package/dist/advanced.mjs.map +1 -1
  9. package/dist/canvas.d.cts +5 -6
  10. package/dist/canvas.d.ts +5 -6
  11. package/dist/canvas.js +1 -1
  12. package/dist/canvas.mjs +1 -1
  13. package/dist/chunk-2L2QFYBL.mjs +2 -0
  14. package/dist/chunk-2L2QFYBL.mjs.map +1 -0
  15. package/dist/chunk-ANJNQW77.js +2 -0
  16. package/dist/chunk-ANJNQW77.js.map +1 -0
  17. package/dist/{chunk-WXEHDEIH.js → chunk-DZ7L3SHV.js} +2 -2
  18. package/dist/{chunk-WXEHDEIH.js.map → chunk-DZ7L3SHV.js.map} +1 -1
  19. package/dist/chunk-E5WYPGCV.mjs +3 -0
  20. package/dist/chunk-E5WYPGCV.mjs.map +1 -0
  21. package/dist/chunk-ECYYIQEX.mjs +3 -0
  22. package/dist/chunk-ECYYIQEX.mjs.map +1 -0
  23. package/dist/chunk-ERIXVRJ4.mjs +3 -0
  24. package/dist/chunk-ERIXVRJ4.mjs.map +1 -0
  25. package/dist/chunk-F23GIQDE.mjs +2 -0
  26. package/dist/chunk-F23GIQDE.mjs.map +1 -0
  27. package/dist/chunk-FDMJHFN7.mjs +2 -0
  28. package/dist/chunk-FDMJHFN7.mjs.map +1 -0
  29. package/dist/chunk-GKJQEOP7.mjs +2 -0
  30. package/dist/{chunk-PVPY55Z7.mjs.map → chunk-GKJQEOP7.mjs.map} +1 -1
  31. package/dist/chunk-GYDP6MFV.js +3 -0
  32. package/dist/chunk-GYDP6MFV.js.map +1 -0
  33. package/dist/chunk-HB5VPQTB.mjs +2 -0
  34. package/dist/chunk-HB5VPQTB.mjs.map +1 -0
  35. package/dist/chunk-NF4RPLCK.js +3 -0
  36. package/dist/chunk-NF4RPLCK.js.map +1 -0
  37. package/dist/chunk-OPAAGNBO.mjs +2 -0
  38. package/dist/{chunk-HLPVL6EK.mjs.map → chunk-OPAAGNBO.mjs.map} +1 -1
  39. package/dist/chunk-RLLO5M6F.js +3 -0
  40. package/dist/chunk-RLLO5M6F.js.map +1 -0
  41. package/dist/{chunk-63AW5ZOC.js → chunk-RMN5IPS5.js} +2 -2
  42. package/dist/{chunk-63AW5ZOC.js.map → chunk-RMN5IPS5.js.map} +1 -1
  43. package/dist/chunk-WWEWRI6S.js +2 -0
  44. package/dist/chunk-WWEWRI6S.js.map +1 -0
  45. package/dist/chunk-YEBBTVHG.js +2 -0
  46. package/dist/chunk-YEBBTVHG.js.map +1 -0
  47. package/dist/chunk-YPVRQKMW.js +2 -0
  48. package/dist/chunk-YPVRQKMW.js.map +1 -0
  49. package/dist/{components-CxnAnbpI.d.cts → components-BMbqsbMY.d.cts} +5 -5
  50. package/dist/{components-B7KQ8C-i.d.ts → components-C83mBQXW.d.ts} +5 -5
  51. package/dist/{effect-14CxUU8r.d.ts → core-CxHP8991.d.cts} +9 -1
  52. package/dist/{effect-14CxUU8r.d.cts → core-D0ggvjX3.d.ts} +9 -1
  53. package/dist/core.d.cts +2 -80
  54. package/dist/core.d.ts +2 -80
  55. package/dist/core.js +1 -1
  56. package/dist/core.mjs +1 -1
  57. package/dist/dom.d.cts +2 -2
  58. package/dist/dom.d.ts +2 -2
  59. package/dist/dom.js +1 -1
  60. package/dist/dom.js.map +1 -1
  61. package/dist/dom.mjs +1 -1
  62. package/dist/dom.mjs.map +1 -1
  63. package/dist/effect-554ONNZR.js +2 -0
  64. package/dist/{effect-K45UU3N4.js.map → effect-554ONNZR.js.map} +1 -1
  65. package/dist/effect-T2GVIS3T.mjs +2 -0
  66. package/dist/{effect-3LUCHSAZ.mjs.map → effect-T2GVIS3T.mjs.map} +1 -1
  67. package/dist/index.d.cts +1 -1
  68. package/dist/index.d.ts +1 -1
  69. package/dist/index.js +1 -1
  70. package/dist/index.js.map +1 -1
  71. package/dist/index.mjs +1 -1
  72. package/dist/index.mjs.map +1 -1
  73. package/dist/interactive.d.cts +5 -5
  74. package/dist/interactive.d.ts +5 -5
  75. package/dist/interactive.js +1 -1
  76. package/dist/interactive.js.map +1 -1
  77. package/dist/interactive.mjs +1 -1
  78. package/dist/interactive.mjs.map +1 -1
  79. package/dist/metafile-cjs.json +1 -1
  80. package/dist/metafile-esm.json +1 -1
  81. package/dist/{portal-NLlE-fNZ.d.cts → portal-BK_0Z0hE.d.cts} +2 -2
  82. package/dist/{portal-CVqrpmHd.d.ts → portal-CbguxtuQ.d.ts} +2 -2
  83. package/dist/primitives/motion.js +1 -1
  84. package/dist/primitives/motion.mjs +1 -1
  85. package/dist/primitives/ui.d.cts +3 -3
  86. package/dist/primitives/ui.d.ts +3 -3
  87. package/dist/primitives/ui.js +1 -1
  88. package/dist/primitives/ui.js.map +1 -1
  89. package/dist/primitives/ui.mjs +1 -1
  90. package/dist/primitives/ui.mjs.map +1 -1
  91. package/dist/primitives.d.cts +4 -5
  92. package/dist/primitives.d.ts +4 -5
  93. package/dist/primitives.js +1 -1
  94. package/dist/primitives.js.map +1 -1
  95. package/dist/primitives.mjs +1 -1
  96. package/dist/primitives.mjs.map +1 -1
  97. package/dist/router.d.cts +3 -3
  98. package/dist/router.d.ts +3 -3
  99. package/dist/router.js +1 -1
  100. package/dist/router.mjs +1 -1
  101. package/dist/server.js +1 -1
  102. package/dist/server.js.map +1 -1
  103. package/dist/server.mjs +1 -1
  104. package/dist/server.mjs.map +1 -1
  105. package/dist/state-DitsMyev.d.cts +96 -0
  106. package/dist/state-DitsMyev.d.ts +96 -0
  107. package/dist/state-S3TSPDMB.js +2 -0
  108. package/dist/state-S3TSPDMB.js.map +1 -0
  109. package/dist/state-SUVOJZYY.mjs +2 -0
  110. package/dist/state-SUVOJZYY.mjs.map +1 -0
  111. package/dist/test-exports.d.cts +37 -7
  112. package/dist/test-exports.d.ts +37 -7
  113. package/dist/test-exports.js +1 -1
  114. package/dist/test-exports.mjs +1 -1
  115. package/package.json +1 -1
  116. package/dist/chunk-3AWR7IKE.js +0 -2
  117. package/dist/chunk-3AWR7IKE.js.map +0 -1
  118. package/dist/chunk-3BQXIHYI.mjs +0 -3
  119. package/dist/chunk-3BQXIHYI.mjs.map +0 -1
  120. package/dist/chunk-5236IK5I.js +0 -2
  121. package/dist/chunk-5236IK5I.js.map +0 -1
  122. package/dist/chunk-6K44QCMT.mjs +0 -3
  123. package/dist/chunk-6K44QCMT.mjs.map +0 -1
  124. package/dist/chunk-7Q4UE442.mjs +0 -2
  125. package/dist/chunk-7Q4UE442.mjs.map +0 -1
  126. package/dist/chunk-AJT35P3Z.js +0 -3
  127. package/dist/chunk-AJT35P3Z.js.map +0 -1
  128. package/dist/chunk-AYQMU7XC.js +0 -3
  129. package/dist/chunk-AYQMU7XC.js.map +0 -1
  130. package/dist/chunk-B7VP6HBY.mjs +0 -2
  131. package/dist/chunk-B7VP6HBY.mjs.map +0 -1
  132. package/dist/chunk-HLPVL6EK.mjs +0 -2
  133. package/dist/chunk-KJPIJNFH.mjs +0 -2
  134. package/dist/chunk-KJPIJNFH.mjs.map +0 -1
  135. package/dist/chunk-PVPY55Z7.mjs +0 -2
  136. package/dist/chunk-Q7WT5IIF.mjs +0 -3
  137. package/dist/chunk-Q7WT5IIF.mjs.map +0 -1
  138. package/dist/chunk-S3EDPCYT.js +0 -3
  139. package/dist/chunk-S3EDPCYT.js.map +0 -1
  140. package/dist/chunk-WOHSSPKD.js +0 -2
  141. package/dist/chunk-WOHSSPKD.js.map +0 -1
  142. package/dist/effect-3LUCHSAZ.mjs +0 -2
  143. package/dist/effect-K45UU3N4.js +0 -2
  144. package/dist/signal-2QUI7H7B.js +0 -2
  145. package/dist/signal-2QUI7H7B.js.map +0 -1
  146. package/dist/signal-C6936A3J.d.cts +0 -175
  147. package/dist/signal-C6936A3J.d.ts +0 -175
  148. package/dist/signal-L3ZWGOVT.mjs +0 -2
  149. package/dist/signal-L3ZWGOVT.mjs.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/router/core.ts","../src/router/utils.ts","../src/router/context.ts","../src/router/components.ts"],"names":["createLocation","getDefaultLoc","getLoc","parseQuery","loc","SignalNode","navigate","path","isUnsafePath","handlePopState","error","normalizedPath","protocol","sanitizeQueryValue","value","DANGEROUS_KEYS","search","params","query","key","sanitizedKey","sanitizedValue","matchPath","pathname","routePath","paramNames","regexPath","_","paramName","regex","match","index","createRoutesFromChildren","children","routes","childArray","child","isFNode","component","beforeEnter","nestedChildren","route","matchRoutes","location","result","matchRouteBranch","parentPath","fullPath","isLeaf","matcher","compilePath","matchedPath","paramValues","paramsObj","extractParams","currentMatch","childMatches","indexRoute","c","prefix","values","i","RouterCtx","createContext","RouteDepthCtx","router","ctx","context","Router","props","nonRouteChildren","routeChildren","Route","matches","ComputedNode","m","routerContext","target","prop","signal","_target","innerProp","signalProp","currentValue","objProp","desc","ms","matchedContent","rootMatch","f","_props","Outlet","depth","Component","Link","r","handleClick","e"],"mappings":"iKA8BO,SAASA,CAAAA,EAA6E,CAE3F,IAAMC,CAAAA,CAAgB,KAAiB,CACrC,QAAA,CAAU,GAAA,CACV,MAAA,CAAQ,EAAA,CACR,IAAA,CAAM,EAAA,CACN,KAAA,CAAO,EACT,CAAA,CAAA,CAEMC,CAAAA,CAAS,IACT,OAAO,MAAA,CAAW,GAAA,CACbD,CAAAA,GAEF,CACL,QAAA,CAAU,MAAA,CAAO,QAAA,CAAS,SAC1B,MAAA,CAAQ,MAAA,CAAO,QAAA,CAAS,MAAA,CACxB,KAAM,MAAA,CAAO,QAAA,CAAS,IAAA,CACtB,KAAA,C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AAC,CACvC,CAAC,CACH,CAAA,CAtBoB,IAuBtB,CAEO,SAASgE,EAAAA,CAAKzB,CAAAA,CAAkB,CACrC,IAAM0B,EAAI9B,CAAAA,EAAO,CAEX+B,CAAAA,CAAeC,CAAAA,EAAa,CAChCA,CAAAA,CAAE,cAAA,EAAe,CACjBF,CAAAA,CAAE,SAAS1B,CAAAA,CAAM,EAAE,EACrB,CAAA,CAEA,OAAOoB,kBAAAA,CACL,GAAA,CACA,CACE,KAAMpB,CAAAA,CAAM,EAAA,CACZ,KAAA,CAAOA,CAAAA,CAAM,MACb,OAAA,CAAS2B,CACX,CAAA,CACA3B,CAAAA,CAAM,QACR,CACF","file":"chunk-AYQMU7XC.js","sourcesContent":["/**\n * Router Core Module\n *\n * Provides core routing functionality including location management,\n * path matching, and navigation.\n */\n\nimport { SignalNode } from '../core/signal'\nimport { Location } from './types'\n\n/**\n * Creates a reactive location signal and navigate function.\n *\n * The location signal automatically updates when:\n * - navigate() is called\n * - Browser back/forward buttons are used (popstate event)\n *\n * @returns Tuple of [location signal, navigate function, cleanup function]\n *\n * @example\n * ```tsx\n * const [location, navigate, cleanup] = createLocation();\n * // Access current path\n * console.log(location().pathname);\n * // Navigate to new path\n * navigate('/users/123');\n * // Cleanup when done (removes popstate listener)\n * cleanup();\n * ```\n */\nexport function createLocation(): [SignalNode<Location>, (path: string) => void, () => void] {\n // SSR guard: return safe defaults on server\n const getDefaultLoc = (): Location => ({\n pathname: '/',\n search: '',\n hash: '',\n query: {},\n })\n\n const getLoc = (): Location => {\n if (typeof window === 'undefined') {\n return getDefaultLoc()\n }\n return {\n pathname: window.location.pathname,\n search: window.location.search,\n hash: window.location.hash,\n query: parseQuery(window.location.search),\n }\n }\n\n const loc = new SignalNode(getLoc())\n\n const navigate = (path: string) => {\n // SSR guard\n if (typeof window === 'undefined') return\n\n // Security: Validate path to prevent javascript: and other dangerous protocols\n if (isUnsafePath(path)) {\n console.error('[Flexium Router] Blocked navigation to unsafe path:', path)\n return\n }\n window.history.pushState({}, '', path)\n loc.set(getLoc())\n }\n\n // SSR guard for popstate listener\n const handlePopState = () => {\n try {\n loc.set(getLoc())\n } catch (error) {\n console.error('[Flexium Router] Error handling popstate:', error)\n }\n }\n\n if (typeof window !== 'undefined') {\n window.addEventListener('popstate', handlePopState)\n }\n\n // Cleanup function to remove listener\n const cleanup = () => {\n if (typeof window !== 'undefined') {\n window.removeEventListener('popstate', handlePopState)\n }\n }\n\n return [loc, navigate, cleanup]\n}\n\n/**\n * Check if a path contains unsafe protocols (XSS prevention)\n * @param path - Path to validate\n * @returns true if path is unsafe\n */\nexport function isUnsafePath(path: string): boolean {\n const normalizedPath = path.trim().toLowerCase()\n const unsafeProtocols = ['javascript:', 'data:', 'vbscript:', 'file:']\n return unsafeProtocols.some(protocol => normalizedPath.startsWith(protocol))\n}\n\n/**\n * Sanitize query parameter value to prevent XSS\n * @param value - Query parameter value\n * @returns Sanitized value\n */\nexport function sanitizeQueryValue(value: string): string {\n // Remove potential script tags and event handlers\n return value\n .replace(/<[^>]*>/g, '') // Remove HTML tags\n .replace(/javascript:/gi, '') // Remove javascript: protocol\n .replace(/on\\w+\\s*=/gi, '') // Remove event handlers like onclick=\n}\n\n/**\n * Parses URL search string into key-value object\n * @param search - URL search string (e.g., \"?foo=bar&baz=qux\")\n * @returns Object with query parameters\n */\n// Dangerous keys that could lead to prototype pollution\nconst DANGEROUS_KEYS = new Set(['__proto__', 'constructor', 'prototype'])\n\nfunction parseQuery(search: string): Record<string, string> {\n const params = new URLSearchParams(search)\n // Use Object.create(null) to prevent prototype pollution\n const query: Record<string, string> = Object.create(null)\n params.forEach((value, key) => {\n // Sanitize both key and value to prevent XSS\n const sanitizedKey = sanitizeQueryValue(key)\n const sanitizedValue = sanitizeQueryValue(value)\n // Block dangerous keys to prevent prototype pollution\n if (sanitizedKey && !DANGEROUS_KEYS.has(sanitizedKey)) {\n query[sanitizedKey] = sanitizedValue\n }\n })\n return query\n}\n\n/**\n * Matches a pathname against a route pattern.\n *\n * Supports dynamic segments with `:param` syntax.\n *\n * @param pathname - Current URL pathname (e.g., \"/users/123\")\n * @param routePath - Route pattern (e.g., \"/users/:id\")\n * @returns Object with `matches` boolean and extracted `params`\n *\n * @example\n * ```tsx\n * const result = matchPath('/users/123', '/users/:id');\n * // { matches: true, params: { id: '123' } }\n * ```\n */\nexport function matchPath(\n pathname: string,\n routePath: string\n): { matches: boolean; params: Record<string, string> } {\n const paramNames: string[] = []\n const regexPath = routePath.replace(/:([^/]+)/g, (_, paramName) => {\n paramNames.push(paramName)\n return '([^/]+)'\n })\n\n const regex = new RegExp(`^${regexPath}$`)\n const match = pathname.match(regex)\n\n if (!match) {\n return { matches: false, params: {} }\n }\n\n const params: Record<string, string> = {}\n match.slice(1).forEach((value, index) => {\n params[paramNames[index]] = value\n })\n\n return { matches: true, params }\n}\n","import { RouteDef, RouteMatch } from './types'\nimport type { FNodeChild } from '../core/renderer'\nimport { isFNode } from '../renderers/dom/f'\n\n/**\n * Flatten the children of <Router> or <Route> into a route configuration tree.\n * Note: This assumes `children` are FNodes representing <Route> components.\n */\nexport function createRoutesFromChildren(children: FNodeChild): RouteDef[] {\n const routes: RouteDef[] = []\n\n const childArray = Array.isArray(children) ? children : [children]\n\n for (const child of childArray) {\n if (!isFNode(child)) {\n continue\n }\n\n const { path, index, component, beforeEnter } = child.props as {\n path?: string\n index?: boolean\n component?: Function\n beforeEnter?: (\n params: Record<string, string>\n ) => boolean | Promise<boolean>\n }\n const nestedChildren = child.children\n\n // Skip routes without a component (unless they have children as layout routes)\n if (!component && !nestedChildren) {\n console.warn(\n `[Flexium Router] Route \"${path || '(index)'}\" has no component and no children. Skipping.`\n )\n continue\n }\n\n const route: RouteDef = {\n path: path || '',\n index: !!index,\n component: component || (() => null),\n children: nestedChildren ? createRoutesFromChildren(nestedChildren) : [],\n beforeEnter,\n }\n\n routes.push(route)\n }\n\n return routes\n}\n\n/**\n * Match a URL against a route tree.\n * Returns an array of matches (from root to leaf).\n */\nexport function matchRoutes(\n routes: RouteDef[],\n location: string\n): RouteMatch[] | null {\n for (const route of routes) {\n const result = matchRouteBranch(route, location, '')\n if (result) return result\n }\n return null\n}\n\nfunction matchRouteBranch(\n route: RouteDef,\n location: string,\n parentPath: string\n): RouteMatch[] | null {\n let fullPath = parentPath\n if (route.path) {\n fullPath =\n parentPath.replace(/\\/$/, '') + '/' + route.path.replace(/^\\//, '')\n }\n\n const isLeaf = route.children.length === 0\n const matcher = compilePath(fullPath, !isLeaf)\n const match = location.match(matcher)\n\n if (match) {\n const [matchedPath, ...paramValues] = match\n const paramsObj = extractParams(fullPath, paramValues)\n\n const currentMatch: RouteMatch = {\n route,\n params: paramsObj,\n pathname: matchedPath,\n }\n\n if (isLeaf) {\n // Exact match required for leaf\n if (matchedPath === location) return [currentMatch]\n return null\n }\n\n // Has children: try to match one of them\n // If no children match, and this route is an index route?\n // Or if this route matches partially, maybe an index child matches the rest?\n\n for (const child of route.children) {\n const childMatches = matchRouteBranch(child, location, fullPath)\n if (childMatches) {\n return [currentMatch, ...childMatches]\n }\n }\n\n // If no children matched, but we matched exactly this layout route?\n // E.g. /users matches /users layout, and maybe it renders index?\n if (matchedPath === location) {\n // Check for index route\n const indexRoute = route.children.find((c) => c.index)\n if (indexRoute) {\n return [\n currentMatch,\n { route: indexRoute, params: {}, pathname: matchedPath },\n ]\n }\n // Just the layout? Maybe.\n return [currentMatch]\n }\n }\n\n return null\n}\n\nfunction compilePath(path: string, prefix: boolean): RegExp {\n const regexPath = path.replace(/:([^/]+)/g, () => '([^/]+)')\n\n // If path is exactly \"/\", and we want prefix matching, it should match everything\n if (regexPath === '/' && prefix) {\n return new RegExp('^')\n }\n\n // If prefix matching allowed, ensure we match segment boundary\n return new RegExp(`^${regexPath}${prefix ? '(?:/|$)' : '$'}`)\n}\n\nfunction extractParams(path: string, values: string[]): Record<string, string> {\n const params: Record<string, string> = {}\n let i = 0\n // Re-parse to find param names... inefficient but works\n path.replace(/:([^/]+)/g, (_, paramName) => {\n params[paramName] = values[i++]\n return ''\n })\n return params\n}\n","import { createContext } from '../core/context'\nimport { RouterContext } from './types'\n\n// Global Router Context\nexport const RouterCtx = createContext<RouterContext | null>(null)\n\n// Current Route Depth Context (for Outlet)\n// Stores the index of the current match in the `matches` array\nexport const RouteDepthCtx = createContext<number>(0)\n","import { ComputedNode, type SignalNode } from '../core/signal'\nimport { createLocation } from './core'\nimport { createRoutesFromChildren, matchRoutes } from './utils'\nimport { LinkProps, RouteProps, RouterContext } from './types'\nimport { f, isFNode } from '../renderers/dom/f'\nimport { RouterCtx, RouteDepthCtx } from './context'\nimport { context } from '../core/context'\nimport type { FNodeChild } from '../core/renderer'\n\n/**\n * Get the current router context.\n * Must be called within a <Router> component.\n *\n * @example\n * ```tsx\n * const r = router()\n * r.navigate('/dashboard')\n * ```\n */\nexport function router(): RouterContext {\n const ctx = context(RouterCtx)\n if (!ctx) {\n throw new Error('router() must be called within a <Router> component')\n }\n return ctx\n}\n\nexport function Router(props: { children: FNodeChild }) {\n const [location, navigate] = createLocation()\n\n // Separate Route children from non-Route children (like Nav, etc.)\n const childArray = Array.isArray(props.children) ? props.children : [props.children]\n const nonRouteChildren: FNodeChild[] = []\n const routeChildren: FNodeChild[] = []\n\n for (const child of childArray) {\n if (isFNode(child) && typeof child.type === 'function' && child.type === Route) {\n routeChildren.push(child)\n } else {\n nonRouteChildren.push(child)\n }\n }\n\n // Parse route configuration from Route children only\n const routes = createRoutesFromChildren(routeChildren)\n\n // Compute matches\n const matches = new ComputedNode(() => {\n const loc = location.get()\n return matchRoutes(routes, loc.pathname) || []\n })\n\n const params = new ComputedNode(() => {\n const m = matches.get()\n if (m.length > 0) {\n return m[m.length - 1].params\n }\n return {}\n })\n\n // Create routerContext as a stable object\n // The signals (location, params, matches) are already reactive\n // We create a proxy to ensure property access is properly tracked\n // When accessing location, params, or matches, automatically read the signal's value\n // to register subscriptions (similar to how state() proxy works)\n const routerContext: RouterContext = new Proxy({\n location,\n params,\n navigate,\n matches,\n } as any, {\n get(target, prop) {\n const value = target[prop as keyof RouterContext]\n\n // For signal/computed properties (location, params, matches),\n // return a proxy that automatically reads the signal's value when properties are accessed\n // This makes router() work like state() - property access triggers tracking\n if (prop === 'location' || prop === 'params' || prop === 'matches') {\n const signal = value as SignalNode<unknown> | ComputedNode<unknown>\n\n // Create a callable target function (like state proxy does)\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const target = () => signal.get()\n\n // Return a proxy that wraps the signal and automatically reads its value\n // when properties are accessed, ensuring subscriptions are registered\n // This follows the same pattern as state() proxy for consistency\n return new Proxy(target, {\n // Make the proxy callable - returns current value\n apply() {\n return signal.get()\n },\n\n get(_target, innerProp) {\n // Accessing .value triggers subscription registration via signal's value getter\n if (innerProp === 'value') {\n return signal.get()\n }\n\n // Allow direct access to peek() without tracking\n if (innerProp === 'peek') {\n return signal.peek\n }\n\n // Calling as function also triggers subscription\n if (innerProp === Symbol.toPrimitive || innerProp === 'toString' || innerProp === 'valueOf') {\n return () => signal.get()\n }\n\n // For other signal properties (set, etc.), access them normally\n const signalProp = (signal as any)[innerProp]\n if (typeof signalProp === 'function') {\n return signalProp.bind(signal)\n }\n\n // If the signal's value is an object, access its properties\n // This enables r.location.pathname and r.params.id to work and register subscriptions\n // Note: accessing signal.value here tracks the signal in any enclosing effect\n const currentValue = signal.get()\n if (currentValue !== null && typeof currentValue === 'object') {\n const obj = currentValue as Record<string | symbol, unknown>\n const objProp = obj[innerProp]\n // If it's a function (like array methods), bind it to the current value\n if (typeof objProp === 'function') {\n return objProp.bind(currentValue)\n }\n return objProp\n }\n\n return signalProp\n },\n\n // For property checks (like 'id' in params)\n has(_target, innerProp) {\n if (innerProp === 'value' || innerProp === 'peek') return true\n const currentValue = signal.get()\n if (currentValue !== null && typeof currentValue === 'object') {\n return innerProp in (currentValue as object)\n }\n return innerProp in signal\n },\n\n // For Object.keys, for...in loops\n ownKeys(_target) {\n const currentValue = signal.get()\n if (currentValue !== null && typeof currentValue === 'object') {\n return Reflect.ownKeys(currentValue as object)\n }\n return []\n },\n\n getOwnPropertyDescriptor(_target, innerProp) {\n const currentValue = signal.get()\n if (currentValue !== null && typeof currentValue === 'object') {\n const desc = Object.getOwnPropertyDescriptor(currentValue as object, innerProp)\n if (desc) {\n return { ...desc, configurable: true }\n }\n }\n return undefined\n }\n })\n }\n\n // For navigate, return as-is\n return value\n }\n }) as RouterContext\n\n return () => {\n const ms = matches.get()\n\n // Matched route component (or null if no match)\n let matchedContent: FNodeChild = null\n if (ms.length > 0) {\n const rootMatch = ms[0]\n\n // Check beforeEnter guard\n if (rootMatch.route.beforeEnter) {\n const result = rootMatch.route.beforeEnter(rootMatch.params)\n if (result !== false) {\n matchedContent = f(RouteDepthCtx.Provider, { value: 1 }, [\n f('div', { key: rootMatch.route.path, style: { display: 'contents' } }, [\n f(rootMatch.route.component, { params: rootMatch.params }),\n ]),\n ])\n }\n } else {\n matchedContent = f(RouteDepthCtx.Provider, { value: 1 }, [\n f('div', { key: rootMatch.route.path, style: { display: 'contents' } }, [\n f(rootMatch.route.component, { params: rootMatch.params }),\n ]),\n ])\n }\n }\n\n // Render non-Route children (like Nav) and the matched route wrapped in main\n return f(RouterCtx.Provider, { value: routerContext }, [\n ...nonRouteChildren,\n f('main', { id: 'main' }, [matchedContent]),\n ])\n }\n}\n\n/**\n * Route configuration component.\n * Doesn't render anything directly; used by Router to build the route tree.\n */\nexport function Route(_props: RouteProps) {\n return null\n}\n\n/**\n * Renders the child route content.\n */\nexport function Outlet() {\n const router = context(RouterCtx)\n const depth = context(RouteDepthCtx) || 0 // Default 0\n\n // Safety check\n if (!router) return null\n\n return () => {\n const ms = router.matches()\n\n // Check if we have a match at this depth\n if (depth >= ms.length) return null\n\n const match = ms[depth]\n\n // Check beforeEnter guard\n if (match.route.beforeEnter) {\n const result = match.route.beforeEnter(match.params)\n if (result === false) return null\n }\n\n const Component = match.route.component\n\n // Render component and provide next depth\n return f(RouteDepthCtx.Provider, { value: depth + 1 }, [\n f(Component, { params: match.params }),\n ])\n }\n}\n\nexport function Link(props: LinkProps) {\n const r = router()\n\n const handleClick = (e: Event) => {\n e.preventDefault()\n r.navigate(props.to)\n }\n\n return f(\n 'a',\n {\n href: props.to,\n class: props.class,\n onclick: handleClick,\n },\n props.children\n )\n}\n"]}
@@ -1,2 +0,0 @@
1
- import {e,d as d$1,f,c,a,k as k$1}from'./chunk-Q7WT5IIF.mjs';var d=0,S=new Set,p=new Set,T=false;function y(){T||(T=true,queueMicrotask(O));}function O(){if(T=false,p.size===0)return;let n=[];for(let e of p)n.push(e);p.clear();for(let e=0;e<n.length;e++)n[e].execute();}function m(n){p.add(n);}function k(n){S.add(n);}function x(){return d}function N(n){let e;if(n){d++;try{e=n();}finally{if(d--,d===0){let t=[];for(let s of S)t.push(s);S.clear();for(let s=0;s<t.length;s++)t[s].execute();}}}return O(),e}var B=null;function z(){return B}function K(n){B=n;}var D=0,o=class{constructor(e){this._value=e;this.version=0;this.nodeType=1;}get value(){return this.get()}set value(e){this.set(e);}get(){let e$1=e();return e$1&&d$1.connect(this,e$1),this._value}set(e){this._value!==e&&(this._value=e,this.version=++D,this.notify());}peek(){return this._value}notify(){if(x()===0){if(this.subsHead){let e=false,t=this.subsHead;for(;t;){let s=t.sub;s.nodeType===2?s.execute():(m(s),e||(e=true,y())),t=t.nextSub;}}}else {let e=this.subsHead;for(;e;)e.sub&&k(e.sub),e=e.nextSub;}}},E=class{constructor(e){this.computeFn=e;this.version=0;this.nodeType=2;this.flags=12;this.lastCleanEpoch=0;}get value(){return this.get()}execute(){this.flags|=12,this.notify();}_updateIfDirty(){let e$1=this.flags;if((e$1&12)===0)return;if((e$1&4)===0&&(e$1&8)!==0&&!this._needsRefetch()){this.flags&=-9;return}this.flags&=-13,d$1.disconnectDependencies(this);let s=e();f(this);try{let i=this.computeFn();this._value!==i&&(this._value=i,this.version=++D),this.lastCleanEpoch=D;}finally{f(s);}}_needsRefetch(){if(!this.depsHead)return true;let e=this.depsHead;for(;e;){let t=e.dep;if(t.version>this.lastCleanEpoch)return true;if(t.nodeType===2){let s=t;if((s.flags&12)!==0){let l=s.version;if(s.peek(),s.version!==l&&s.version>this.lastCleanEpoch)return true}}e=e.nextDep;}return false}get(){let e$1=e();return e$1&&e$1!==this&&d$1.connect(this,e$1),(this.flags&12)!==0&&this._updateIfDirty(),this._value}peek(){return (this.flags&12)!==0&&this._updateIfDirty(),this._value}notify(){if(x()===0){if(this.subsHead){let e=false,t=this.subsHead;for(;t;){let s=t.sub;s.nodeType===2?s.execute():(m(s),e=true),t=t.nextSub;}e&&y();}}else {let e=this.subsHead;for(;e;)e.sub&&k(e.sub),e=e.nextSub;}}},L=Symbol("flexium.signal");function A(n){return n instanceof o||n instanceof E}function W(n){let e$1=e();e$1&&e$1.nodeType===3?e$1.cleanups.push(n):c(a.CLEANUP_OUTSIDE_EFFECT);}function J(n,e){let t=new o(void 0),s=new o(void 0),i=new o(false),u=new o("unresolved"),l=async(r,H=false)=>{H?(u.set("refreshing"),i.set(true)):(u.set("pending"),i.set(true)),s.set(void 0);let f=e(r,{value:t.peek(),refetching:H});h=f;try{let g=await f;h===f&&(t.set(g),u.set("ready"),i.set(!1));}catch(g){h===f&&(s.set(g),u.set("errored"),i.set(false));}},h=null,_=()=>typeof n=="function"?A(n)?n.get():n():A(n)?n.get():n;k$1(()=>{let r=_();l(r,false);});let v=function(){return t.get()};return Object.defineProperties(v,{value:{get:()=>t.get()},loading:{get:()=>i.get()},error:{get:()=>s.get()},state:{get:()=>u.get()},latest:{get:()=>t.peek()},peek:{value:()=>t.peek()}}),v[L]=true,[v,{mutate:r=>t.set(r),refetch:()=>{let r=_();l(r,true);}}]}export{N as a,z as b,K as c,o as d,E as e,A as f,W as g,J as h};//# sourceMappingURL=chunk-B7VP6HBY.mjs.map
2
- //# sourceMappingURL=chunk-B7VP6HBY.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/core/sync.ts","../src/core/signal.ts"],"names":["batchDepth","batchQueue","autoBatchQueue","isAutoBatchScheduled","scheduleAutoBatch","flushAutoBatch","queue","sub","i","addToAutoBatch","addToBatch","getBatchDepth","sync","fn","result","devToolsHooks","getDevToolsHooks","setDevToolsHooks","hooks","globalVersion","SignalNode","_value","newValue","activeEffect","getActiveEffect","Graph","hasScheduled","link","ComputedNode","computeFn","flags","prevEffect","setActiveEffect","dep","computedDep","oldVersion","shouldSchedule","SIGNAL_MARKER","isSignal","value","onCleanup","logWarning","ErrorCodes","createResource","source","fetcher","error","loading","state","load","currentSource","refetching","currentPromise","latestPromise","err","getSource","effect","resource","v"],"mappings":"6DAGA,IAAIA,CAAAA,CAAa,EAEXC,CAAAA,CAAa,IAAI,IAGjBC,CAAAA,CAAiB,IAAI,IACvBC,CAAAA,CAAuB,KAAA,CAEpB,SAASC,CAAAA,EAA0B,CACjCD,IACDA,CAAAA,CAAuB,IAAA,CACvB,eAAeE,CAAc,CAAA,EAErC,CAEO,SAASA,CAAAA,EAAuB,CAEnC,GADAF,CAAAA,CAAuB,KAAA,CACnBD,EAAe,IAAA,GAAS,CAAA,CAAG,OAI/B,IAAMI,CAAAA,CAAuB,EAAC,CAC9B,IAAA,IAAWC,CAAAA,IAAOL,EACdI,CAAAA,CAAM,IAAA,CAAKC,CAAG,CAAA,CAElBL,CAAAA,CAAe,OAAM,CAGrB,IAAA,IAASM,CAAAA,CAAI,CAAA,CAAGA,CAAAA,CAAIF,CAAAA,CAAM,OAAQE,CAAAA,EAAAA,CAC9BF,CAAAA,CAAME,CAAC,CAAA,CAAE,OAAA,GAEjB,CAEO,SAASC,CAAAA,CAAeF,CAAAA,CAAwB,CACnDL,CAAAA,CAAe,IAAIK,CAAG,EAC1B,CAEO,SAASG,CAAAA,CAAWH,EAAwB,CAC/CN,CAAAA,CAAW,GAAA,CAAIM,CAAG,EACtB,CAEO,SAASI,CAAAA,EAAwB,CACpC,OAAOX,CACX,CAwBO,SAASY,CAAAA,CAAQC,CAAAA,CAAwB,CAC5C,IAAIC,CAAAA,CAEJ,G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,EAAI,CAEbA,CAAAA,CAITY,IAAO,IAAM,CACX,IAAMN,CAAAA,CAAgBK,CAAAA,GACtBN,CAAAA,CAAKC,CAAAA,CAAe,KAAK,EAC3B,CAAC,CAAA,CAGD,IAAMO,CAAAA,CAAW,UAAY,CAC3B,OAAOlB,CAAAA,CAAM,KACf,CAAA,CAEA,OAAA,MAAA,CAAO,gBAAA,CAAiBkB,CAAAA,CAAU,CAChC,MAAO,CAAE,GAAA,CAAK,IAAMlB,CAAAA,CAAM,GAAA,EAAM,CAAA,CAChC,OAAA,CAAS,CAAE,GAAA,CAAK,IAAMQ,CAAAA,CAAQ,KAAM,CAAA,CACpC,MAAO,CAAE,GAAA,CAAK,IAAMD,CAAAA,CAAM,GAAA,EAAM,CAAA,CAChC,KAAA,CAAO,CAAE,IAAK,IAAME,CAAAA,CAAM,KAAM,CAAA,CAChC,OAAQ,CAAE,GAAA,CAAK,IAAMT,CAAAA,CAAM,IAAA,EAAO,EAClC,IAAA,CAAM,CAAE,MAAO,IAAMA,CAAAA,CAAM,MAAO,CAEpC,CAAC,CAAA,CAGIkB,CAAAA,CAAiBpB,CAAa,EAAI,IAAA,CAUhC,CAACoB,EARQ,CACd,MAAA,CAASC,GAAqBnB,CAAAA,CAAM,GAAA,CAAImB,CAAC,CAAA,CACzC,OAAA,CAAS,IAAM,CACb,IAAMR,CAAAA,CAAgBK,GAAU,CAChCN,CAAAA,CAAKC,EAAe,IAAI,EAC1B,CACF,CAEyB,CAC3B","file":"chunk-B7VP6HBY.mjs","sourcesContent":["import { ISubscriber } from './graph'\n\n// Batching state\nlet batchDepth = 0\n// Batch queue now needs to store raw subscribers. Set is efficient for uniqueness.\nconst batchQueue = new Set<ISubscriber>()\n\n// Auto-batching state (Microtask Scheduler)\nconst autoBatchQueue = new Set<ISubscriber>()\nlet isAutoBatchScheduled = false\n\nexport function scheduleAutoBatch(): void {\n if (!isAutoBatchScheduled) {\n isAutoBatchScheduled = true\n queueMicrotask(flushAutoBatch)\n }\n}\n\nexport function flushAutoBatch(): void {\n isAutoBatchScheduled = false\n if (autoBatchQueue.size === 0) return\n\n // Performance: Direct iteration instead of Array.from() to avoid array allocation\n // Build array while iterating Set\n const queue: ISubscriber[] = []\n for (const sub of autoBatchQueue) {\n queue.push(sub)\n }\n autoBatchQueue.clear()\n\n // Execute effects - use for loop instead of forEach (slightly faster)\n for (let i = 0; i < queue.length; i++) {\n queue[i].execute()\n }\n}\n\nexport function addToAutoBatch(sub: ISubscriber): void {\n autoBatchQueue.add(sub)\n}\n\nexport function addToBatch(sub: ISubscriber): void {\n batchQueue.add(sub)\n}\n\nexport function getBatchDepth(): number {\n return batchDepth\n}\n\n/**\n * Synchronizes state updates.\n * \n * - `sync()`: Force flushes any pending auto-batched effects.\n * - `sync(fn)`: Batches updates within `fn`, then flushes them and any pending effects synchronously.\n *\n * @param fn - Optional function containing state updates\n * @returns The return value of fn, if provided\n *\n * @example\n * ```tsx\n * // 1. Force flush pending effects\n * count.value++\n * sync() // DOM is now updated\n *\n * // 2. Batch updates and flush immediately\n * sync(() => {\n * count.value = 1\n * name.value = 'Bob'\n * }) // Effects run once here, DOM updated\n * ```\n */\nexport function sync<T>(fn?: () => T): T | void {\n let result: T | undefined\n\n if (fn) {\n batchDepth++\n try {\n result = fn()\n } finally {\n batchDepth--\n if (batchDepth === 0) {\n // Execute all queued subscribers from manual batch\n // Performance: Direct iteration instead of Array.from() to avoid array allocation\n const queue: ISubscriber[] = []\n for (const sub of batchQueue) {\n queue.push(sub)\n }\n batchQueue.clear()\n // Use for loop instead of forEach (slightly faster)\n for (let i = 0; i < queue.length; i++) {\n queue[i].execute()\n }\n }\n }\n }\n\n // Always flushing auto-batch queue to ensure everything is synced\n flushAutoBatch()\n\n return result\n}\n","/**\n * Signal System - Fine-grained reactivity without VDOM\n *\n * Architecture:\n * - Signals are reactive primitives that notify subscribers on change\n * - Computed signals automatically track dependencies and memoize results\n * - Effects run side effects and auto-track dependencies\n * - Batching prevents cascading updates for performance\n */\n\nimport { ErrorCodes, logWarning } from './errors'\nimport {\n Graph,\n\n type Link,\n type ISubscriber,\n type IObservable,\n SubscriberFlags,\n NodeType\n} from './graph'\nimport {\n\n\n getActiveEffect,\n setActiveEffect,\n} from './owner'\nimport {\n scheduleAutoBatch,\n addToAutoBatch,\n addToBatch,\n getBatchDepth\n} from './sync'\nimport { EffectNode, effect } from './effect'\n\n/**\n * DevTools hooks interface - set by devtools module to avoid circular imports\n * @internal\n */\nexport interface DevToolsHooks {\n onSignalCreate?: (signal: Signal<unknown>, name?: string) => number\n onSignalUpdate?: (id: number, value: unknown) => void\n onEffectCreate?: (name?: string) => number\n onEffectRun?: (\n id: number,\n status: 'idle' | 'running' | 'error',\n error?: Error\n ) => void\n}\n\n// Global hooks registry - set by devtools when enabled\nlet devToolsHooks: DevToolsHooks | null = null\n\nexport function getDevToolsHooks() {\n return devToolsHooks\n}\n\n/**\n * Register devtools hooks (called by devtools module)\n * @internal\n */\nexport function setDevToolsHooks(hooks: DevToolsHooks | null): void {\n devToolsHooks = hooks\n}\n\n// Global version clock for epoch-based validation (Optimization: Epochs)\nlet globalVersion = 0\n\n// ==================================================================================\n// 3. User Facing API\n// ==================================================================================\n\n/**\n * Base interface for reactive signals\n * @internal\n */\nexport interface Signal<T> {\n value: T;\n (): T\n set(value: T): void\n peek(): T\n}\n\n/**\n * Computed signal interface (read-only)\n * @internal\n */\nexport interface Computed<T> {\n readonly value: T;\n (): T\n peek(): T\n}\n\n\n\n/**\n * Internal signal node for writable signals\n */\nexport class SignalNode<T> implements IObservable {\n // Performance: Hot path fields first (CPU cache line optimization)\n version = 0 // Frequently read\n nodeType = NodeType.Signal // Frequently checked\n subsHead: Link | undefined // Frequently accessed\n\n // Cold path field\n constructor(private _value: T) { }\n\n /**\n * Compatibility wrapper for legacy .value access\n */\n get value(): T {\n return this.get()\n }\n\n set value(newValue: T) {\n this.set(newValue)\n }\n\n get(): T {\n // Track dependency if inside an effect or computed\n const activeEffect = getActiveEffect()\n if (activeEffect) {\n Graph.connect(this, activeEffect)\n }\n return this._value\n }\n\n set(newValue: T): void {\n if (this._value !== newValue) {\n this._value = newValue\n this.version = ++globalVersion\n this.notify()\n }\n }\n\n peek(): T {\n return this._value\n }\n\n notify(): void {\n // Performance: Branch prediction - check most common case first (no batch)\n if (getBatchDepth() === 0) {\n // Automatic microtask batch (most common path)\n if (this.subsHead) {\n // Performance: Schedule immediately on first non-computed subscriber\n let hasScheduled = false\n let link: Link | undefined = this.subsHead\n\n while (link) {\n const sub = link.sub!\n // Performance: Use nodeType instead of instanceof (much faster)\n if (sub.nodeType === NodeType.Computed) {\n sub.execute() // Mark dirty immediately\n } else {\n addToAutoBatch(sub)\n if (!hasScheduled) {\n hasScheduled = true\n scheduleAutoBatch() // Schedule on first non-computed subscriber\n }\n }\n link = link.nextSub\n }\n }\n } else {\n // Manual batch: queue subscribers (less common path)\n let link = this.subsHead\n while (link) {\n if (link.sub) addToBatch(link.sub)\n link = link.nextSub\n }\n }\n }\n}\n\n/**\n * Internal computed node for derived values\n */\nexport class ComputedNode<T> implements ISubscriber, IObservable {\n // Performance: Hot path fields first (CPU cache line optimization)\n version = 0 // Frequently read\n nodeType = NodeType.Computed // Frequently checked\n flags = SubscriberFlags.Dirty | SubscriberFlags.Stale // Frequently checked\n subsHead: Link | undefined // Frequently accessed\n depsHead: Link | undefined // Frequently accessed\n\n // Cold path fields\n private _value!: T\n // Optimization: Track last clean epoch to avoid redundant re-computation\n private lastCleanEpoch = 0\n\n constructor(private computeFn: () => T) { }\n\n /**\n * Compatibility wrapper for legacy .value access\n */\n get value(): T {\n return this.get()\n }\n\n execute(): void {\n // Performance: Inline bit operation instead of function call\n // When a dependency changes, mark as dirty and notify subscribers\n this.flags |= SubscriberFlags.Dirty | SubscriberFlags.Stale\n this.notify()\n }\n\n private _updateIfDirty(): void {\n // Performance: Inline flag checks for better branch prediction\n // 1. If not dirty and not stale, we are valid (most common case)\n // Note: This check is now done in peek()/get() for fast path, but kept here for safety\n const flags = this.flags\n const dirtyOrStale = flags & (SubscriberFlags.Dirty | SubscriberFlags.Stale)\n if (dirtyOrStale === 0) {\n return\n }\n\n // 2. If Stale but not Dirty, check dependencies\n // Performance: Single bit check instead of two function calls\n if ((flags & SubscriberFlags.Dirty) === 0 && (flags & SubscriberFlags.Stale) !== 0) {\n if (!this._needsRefetch()) {\n this.flags &= ~SubscriberFlags.Stale\n return\n }\n }\n\n // 3. Must re-compute\n // Performance: Single bit operation instead of function call\n this.flags &= ~(SubscriberFlags.Dirty | SubscriberFlags.Stale)\n\n // Clear previous dependencies via Graph helper\n Graph.disconnectDependencies(this)\n\n const prevEffect = getActiveEffect()\n // const prevOwner = getOwner() // Not used\n setActiveEffect(this)\n\n try {\n const newValue = this.computeFn()\n if (this._value !== newValue) {\n this._value = newValue\n this.version = ++globalVersion\n }\n this.lastCleanEpoch = globalVersion\n } finally {\n setActiveEffect(prevEffect)\n }\n\n // Actually, we need to import setActiveEffect at the top of the file\n // activeEffect = this -> setActiveEffect(this)\n // activeEffect = prevEffect -> setActiveEffect(prevEffect)\n // But since I am generating this chunk, let me check imports again.\n // I added getActiveEffect to imports. I need setActiveEffect too.\n\n // REVISING CHUNK content below to use imported function properly.\n // note: I must add setActiveEffect to imports in the first chunk.\n\n\n // For this specific Chunk:\n // We will use a hack here or I should update the first chunk to include setActiveEffect.\n // I'll update the first chunk in this tool call to include setActiveEffect.\n\n // import { setActiveEffect } from './owner'\n // ...\n // setActiveEffect(this)\n // ...\n // setActiveEffect(prevEffect)\n }\n\n private _needsRefetch(): boolean {\n if (!this.depsHead) return true;\n\n // Iterate dependencies via linked list\n let link: Link | undefined = this.depsHead\n while (link) {\n const dep = link.dep!\n\n // Performance: Check version first (fastest check, avoids type check for most cases)\n if (dep.version > this.lastCleanEpoch) {\n return true\n }\n\n // Performance: Use nodeType instead of instanceof\n // Only check computed dependencies if version check passed (less common case)\n if (dep.nodeType === NodeType.Computed) {\n const computedDep = dep as ComputedNode<unknown>\n\n // Performance: Check if dirty/stale before calling peek() (peek() may trigger computation)\n // Only call peek() if actually needs update\n const flags = computedDep.flags\n const isDirtyOrStale = (flags & (SubscriberFlags.Dirty | SubscriberFlags.Stale)) !== 0\n\n if (isDirtyOrStale) {\n // Performance: Track version before peek() to detect if it actually updated\n const oldVersion = computedDep.version\n computedDep.peek()\n // Only check version again if peek() actually updated it (version changed)\n // This avoids redundant comparison when peek() didn't change anything\n if (computedDep.version !== oldVersion && computedDep.version > this.lastCleanEpoch) {\n return true\n }\n }\n }\n link = link.nextDep\n }\n return false\n }\n\n get(): T {\n // Track dependency if inside an effect or computed\n const activeEffect = getActiveEffect()\n if (activeEffect && activeEffect !== this) {\n Graph.connect(this, activeEffect)\n }\n\n // Performance: Fast path - check if update needed before calling _updateIfDirty\n const flags = this.flags\n const dirtyOrStale = flags & (SubscriberFlags.Dirty | SubscriberFlags.Stale)\n if (dirtyOrStale !== 0) {\n this._updateIfDirty()\n }\n return this._value\n }\n\n peek(): T {\n // Performance: Fast path - check if update needed before calling _updateIfDirty\n const flags = this.flags\n const dirtyOrStale = flags & (SubscriberFlags.Dirty | SubscriberFlags.Stale)\n if (dirtyOrStale !== 0) {\n this._updateIfDirty()\n }\n return this._value\n }\n\n notify(): void {\n // Performance: Branch prediction - check most common case first (no batch)\n if (getBatchDepth() === 0) {\n // Automatic microtask batch (most common path)\n if (this.subsHead) {\n let shouldSchedule = false\n let link: Link | undefined = this.subsHead\n\n while (link) {\n const sub = link.sub!\n // Performance: Use nodeType instead of instanceof (much faster)\n if (sub.nodeType === NodeType.Computed) {\n sub.execute()\n } else {\n addToAutoBatch(sub)\n shouldSchedule = true\n }\n link = link.nextSub\n }\n\n if (shouldSchedule) {\n scheduleAutoBatch()\n }\n }\n } else {\n // Manual batch (less common path)\n let link = this.subsHead\n while (link) {\n if (link.sub) addToBatch(link.sub)\n link = link.nextSub\n }\n }\n }\n}\n\n\n\n\n\n\n\n/**\n * Creates a side effect that runs when dependencies change\n *\n * @param fn - Effect function, can return a cleanup function\n * @param options - Optional error handler\n * @returns Dispose function to stop the effect\n *\n * @example\n * ```ts\n * const [count, setCount] = state(0);\n * \n * const dispose = effect(() => {\n * console.log('Count:', count());\n * return () => console.log('Cleanup');\n * });\n * ```\n */\n\n\n/**\n * Creates a root scope for effects\n * All effects created within the scope can be disposed together\n *\n * @param fn - Function that creates effects\n * @returns Dispose function for all effects in the scope\n */\n\n\n/**\n * Symbol to mark signals for detection\n * @internal\n */\nconst SIGNAL_MARKER = Symbol('flexium.signal')\n\n/**\n * Check if a value is a signal\n * @internal Use state() which handles all reactive patterns\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function isSignal(value: unknown): value is SignalNode<any> | ComputedNode<any> {\n return value instanceof SignalNode || value instanceof ComputedNode\n}\n\n/**\n * Registers a cleanup function that runs before the current effect re-runs or is disposed\n *\n * @param fn - Cleanup function\n */\nexport function onCleanup(fn: () => void): void {\n const activeEffect = getActiveEffect()\n // Performance: Use nodeType instead of instanceof\n if (activeEffect && activeEffect.nodeType === NodeType.Effect) {\n (activeEffect as EffectNode).cleanups.push(fn)\n } else {\n logWarning(ErrorCodes.CLEANUP_OUTSIDE_EFFECT)\n }\n}\n\n/**\n * Resource interface for async data\n */\nexport interface Resource<T> extends Signal<T | undefined> {\n loading: boolean\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n error: any\n state: 'unresolved' | 'pending' | 'ready' | 'refreshing' | 'errored'\n latest: T | undefined\n}\n\n/**\n * Creates a resource for handling async data\n * @internal Use state(async () => ...) instead which returns [data, refetch, status, error]\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function createResource<T, S = any>(\n source: S | Signal<S> | (() => S),\n fetcher: (\n source: S,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n { value, refetching }: { value: T | undefined; refetching: any }\n ) => Promise<T>\n): [Resource<T>, { mutate: (v: T | undefined) => void; refetch: () => void }] {\n const value = new SignalNode<T | undefined>(undefined)\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const error = new SignalNode<any>(undefined)\n const loading = new SignalNode<boolean>(false)\n const state = new SignalNode<\n 'unresolved' | 'pending' | 'ready' | 'refreshing' | 'errored'\n >('unresolved')\n\n const load = async (currentSource: S, refetching = false) => {\n if (refetching) {\n state.set('refreshing')\n loading.set(true)\n } else {\n state.set('pending')\n loading.set(true)\n }\n error.set(undefined)\n\n // Track the current promise to avoid race conditions\n // We use a local variable instead of a shared 'lastPromise'\n // because we only care about the latest execution within this closure scope\n // if we needed to support cancellation, we'd need more.\n // Actually, for race conditions we DO need to track the active promise ID or similar.\n // Let's use a simpler counter approach or just compare promise references if we kept track.\n // But since we are removing 'lastPromise' which was used for throwing, \n // we still need to handle race conditions (late resolve).\n\n // Re-introducing a local tracking mechanism just for race conditions\n const currentPromise = fetcher(currentSource, { value: value.peek(), refetching })\n // We need to store this on the closure to compare\n latestPromise = currentPromise\n\n try {\n const result = await currentPromise\n if (latestPromise === currentPromise) {\n value.set(result)\n state.set('ready')\n loading.set(false)\n }\n } catch (err) {\n if (latestPromise === currentPromise) {\n error.set(err)\n state.set('errored')\n loading.set(false)\n }\n }\n }\n\n let latestPromise: Promise<T> | null = null\n\n /*\n * Helper to get current source value\n */\n const getSource = () => {\n if (typeof source === 'function') {\n // Check if it's a SignalNode/ComputedNode\n if (isSignal(source)) {\n return source.get()\n }\n // It's a plain function\n return (source as () => S)()\n }\n // It's a static value (or SignalNode passed as value if generic S allows)\n // If S is SignalNode, then isSignal(source) is true.\n if (isSignal(source)) {\n return source.get()\n }\n return source\n }\n\n // Track source changes\n effect(() => {\n const currentSource = getSource()\n load(currentSource, false)\n })\n\n // Create the resource object (read-only signal interface)\n const resource = function () {\n return value.get()\n } as Resource<T>\n\n Object.defineProperties(resource, {\n value: { get: () => value.get() },\n loading: { get: () => loading.get() },\n error: { get: () => error.get() },\n state: { get: () => state.get() },\n latest: { get: () => value.peek() },\n peek: { value: () => value.peek() },\n // no set exposed on resource object\n })\n // Mark as signal/node for detection if needed, or just let it be a function-signal\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ; (resource as any)[SIGNAL_MARKER] = true\n\n const actions = {\n mutate: (v: T | undefined) => value.set(v),\n refetch: () => {\n const currentSource = getSource()\n load(currentSource, true)\n },\n }\n\n return [resource, actions]\n}\n\n\n"]}
@@ -1,2 +0,0 @@
1
- import {h}from'./chunk-Q7WT5IIF.mjs';function u(n){let e=Symbol("context"),t=r=>r.children;return t._contextId=e,{id:e,Provider:t,defaultValue:n}}function c(n){let e=h();if(e&&e.context){let t=e.context[n.id];if(t!==void 0)return t}return n.defaultValue}function l(n,e){let t=h();t&&(t.context||(t.context={}),t.context[n]=e);}export{u as a,c as b,l as c};//# sourceMappingURL=chunk-HLPVL6EK.mjs.map
2
- //# sourceMappingURL=chunk-HLPVL6EK.mjs.map
@@ -1,2 +0,0 @@
1
- import {f}from'./chunk-B7VP6HBY.mjs';function x(i){if(!i)return {};let n={};i.display&&(n.display=i.display),i.flex!==void 0&&(n.flex=i.flex),i.flexDirection&&(n.flexDirection=i.flexDirection),i.flexWrap&&(n.flexWrap=i.flexWrap),i.justifyContent&&(n.justifyContent=i.justifyContent),i.alignItems&&(n.alignItems=i.alignItems),i.alignSelf&&(n.alignSelf=i.alignSelf),i.gap!==void 0&&(n.gap=`${i.gap}px`),i.padding!==void 0&&(n.padding=`${i.padding}px`),i.paddingTop!==void 0&&(n.paddingTop=`${i.paddingTop}px`),i.paddingRight!==void 0&&(n.paddingRight=`${i.paddingRight}px`),i.paddingBottom!==void 0&&(n.paddingBottom=`${i.paddingBottom}px`),i.paddingLeft!==void 0&&(n.paddingLeft=`${i.paddingLeft}px`),i.paddingHorizontal!==void 0&&(n.paddingLeft=`${i.paddingHorizontal}px`,n.paddingRight=`${i.paddingHorizontal}px`),i.paddingVertical!==void 0&&(n.paddingTop=`${i.paddingVertical}px`,n.paddingBottom=`${i.paddingVertical}px`),i.margin!==void 0&&(n.margin=`${i.margin}px`),i.marginTop!==void 0&&(n.marginTop=`${i.marginTop}px`),i.marginRight!==void 0&&(n.marginRight=`${i.marginRight}px`),i.marginBottom!==void 0&&(n.marginBottom=`${i.marginBottom}px`),i.marginLeft!==void 0&&(n.marginLeft=`${i.marginLeft}px`),i.marginHorizontal!==void 0&&(n.marginLeft=`${i.marginHorizontal}px`,n.marginRight=`${i.marginHorizontal}px`),i.marginVertical!==void 0&&(n.marginTop=`${i.marginVertical}px`,n.marginBottom=`${i.marginVertical}px`),i.width!==void 0&&(n.width=typeof i.width=="number"?`${i.width}px`:i.width),i.height!==void 0&&(n.height=typeof i.height=="number"?`${i.height}px`:i.height),i.minWidth!==void 0&&(n.minWidth=`${i.minWidth}px`),i.maxWidth!==void 0&&(n.maxWidth=`${i.maxWidth}px`),i.minHeight!==void 0&&(n.minHeight=`${i.minHeight}px`),i.maxHeight!==void 0&&(n.maxHeight=`${i.maxHeight}px`),i.backgroundColor&&(n.backgroundColor=i.backgroundColor),i.borderRadius!==void 0&&(n.borderRadius=`${i.borderRadius}px`),i.borderTopLeftRadius!==void 0&&(n.borderTopLeftRadius=`${i.borderTopLeftRadius}px`),i.borderTopRightRadius!==void 0&&(n.borderTopRightRadius=`${i.borderTopRightRadius}px`),i.borderBottomLeftRadius!==void 0&&(n.borderBottomLeftRadius=`${i.borderBottomLeftRadius}px`),i.borderBottomRightRadius!==void 0&&(n.borderBottomRightRadius=`${i.borderBottomRightRadius}px`),i.opacity!==void 0&&(n.opacity=i.opacity),i.borderWidth!==void 0&&(n.borderWidth=`${i.borderWidth}px`),i.borderColor&&(n.borderColor=i.borderColor),i.borderTopWidth!==void 0&&(n.borderTopWidth=`${i.borderTopWidth}px`),i.borderRightWidth!==void 0&&(n.borderRightWidth=`${i.borderRightWidth}px`),i.borderBottomWidth!==void 0&&(n.borderBottomWidth=`${i.borderBottomWidth}px`),i.borderLeftWidth!==void 0&&(n.borderLeftWidth=`${i.borderLeftWidth}px`),i.position&&(n.position=i.position),i.top!==void 0&&(n.top=`${i.top}px`),i.right!==void 0&&(n.right=`${i.right}px`),i.bottom!==void 0&&(n.bottom=`${i.bottom}px`),i.left!==void 0&&(n.left=`${i.left}px`),i.zIndex!==void 0&&(n.zIndex=i.zIndex),i.transform&&(n.transform=i.transform);let o=i;return o.color&&(n.color=o.color),o.fontSize!==void 0&&(n.fontSize=`${o.fontSize}px`),o.fontWeight&&(n.fontWeight=o.fontWeight),o.fontFamily&&(n.fontFamily=o.fontFamily),o.fontStyle&&(n.fontStyle=o.fontStyle),o.textAlign&&(n.textAlign=o.textAlign),o.textDecoration&&(n.textDecoration=o.textDecoration),o.lineHeight!==void 0&&(n.lineHeight=`${o.lineHeight}px`),o.letterSpacing!==void 0&&(n.letterSpacing=`${o.letterSpacing}px`),n}function k(i){return f(i)}function e(i){return k(i)||i!==null&&typeof i=="object"&&"value"in i&&"peek"in i?i.value:i}function b(i,n,o,r){if(!n)return;let d=Array.isArray(n)?n:[n];for(let t of d)if(!(!t||!t.type))switch(t.type){case "canvas-rect":D(i,t.props);break;case "canvas-circle":W(i,t.props);break;case "canvas-path":C(i,t.props);break;case "canvas-text":S(i,t.props);break;case "canvas-line":v(i,t.props);break;case "canvas-arc":P(i,t.props);break}}function D(i,n){let o=e(n.x),r=e(n.y),d=e(n.width),t=e(n.height),a=e(n.fill),f=e(n.stroke),p=e(n.strokeWidth),g=e(n.opacity);i.save(),g!==void 0&&(i.globalAlpha=g),a&&(i.fillStyle=a,i.fillRect(o,r,d,t)),f&&(i.strokeStyle=f,i.lineWidth=p||1,i.strokeRect(o,r,d,t)),i.restore();}function W(i,n){let o=e(n.x),r=e(n.y),d=e(n.radius),t=e(n.fill),a=e(n.stroke),f=e(n.strokeWidth),p=e(n.opacity);i.save(),p!==void 0&&(i.globalAlpha=p),i.beginPath(),i.arc(o,r,d,0,2*Math.PI),t&&(i.fillStyle=t,i.fill()),a&&(i.strokeStyle=a,i.lineWidth=f||1,i.stroke()),i.restore();}function C(i,n){let o=e(n.d),r=e(n.fill),d=e(n.stroke),t=e(n.strokeWidth),a=e(n.opacity);i.save(),a!==void 0&&(i.globalAlpha=a);let f=new Path2D(o);r&&(i.fillStyle=r,i.fill(f)),d&&(i.strokeStyle=d,i.lineWidth=t||1,i.stroke(f)),i.restore();}function S(i,n){let o=e(n.x),r=e(n.y),d=e(n.text),t=e(n.fill),a=e(n.fontSize)||12,f=e(n.fontFamily)||"sans-serif",p=e(n.fontWeight)||"normal",g=e(n.textAlign)||"left",m=e(n.textBaseline)||"alphabetic";i.save(),i.font=`${p} ${a}px ${f}`,i.textAlign=g,i.textBaseline=m,t&&(i.fillStyle=t,i.fillText(d,o,r)),i.restore();}function v(i,n){let o=e(n.x1),r=e(n.y1),d=e(n.x2),t=e(n.y2),a=e(n.stroke)||"black",f=e(n.strokeWidth)||1,p=e(n.opacity);i.save(),p!==void 0&&(i.globalAlpha=p),i.beginPath(),i.moveTo(o,r),i.lineTo(d,t),i.strokeStyle=a,i.lineWidth=f,i.stroke(),i.restore();}function P(i,n){let o=e(n.x),r=e(n.y),d=e(n.radius),t=e(n.startAngle),a=e(n.endAngle),f=e(n.counterclockwise)||false,p=e(n.fill),g=e(n.stroke),m=e(n.strokeWidth),h=e(n.opacity);i.save(),h!==void 0&&(i.globalAlpha=h),i.beginPath(),i.arc(o,r,d,t,a,f),p&&(i.fillStyle=p,i.fill()),g&&(i.strokeStyle=g,i.lineWidth=m||1,i.stroke()),i.restore();}function N(i){let{width:n,height:o,children:r,style:d,id:t,...a}=i;return {type:"canvas",props:{...a,id:t,width:n,height:o,style:x(d),ref:f=>{if(!f||typeof requestAnimationFrame>"u")return;let p=f.getContext("2d");p&&Promise.all([import('./effect-3LUCHSAZ.mjs').then(g=>g.effect),import('./signal-L3ZWGOVT.mjs').then(g=>({onCleanup:g.onCleanup,isSignal:g.isSignal}))]).then(([g,{onCleanup:m,isSignal:h}])=>{let c,R=()=>{c!==void 0&&cancelAnimationFrame(c),c=requestAnimationFrame(()=>{p.clearRect(0,0,n,o),b(p,r),c=void 0;});};g(()=>{let w=Array.isArray(r)?r:[r];for(let u of w)if(u&&u.props)for(let $ in u.props){let s=u.props[$];h(s)&&s.value;}R(),m(()=>{c!==void 0&&(cancelAnimationFrame(c),c=void 0);});});}).catch(g=>{console.error("[Flexium Canvas] Failed to load signal module:",g);});}},children:[]}}function I(i){return {type:"canvas-rect",props:i,children:[]}}function j(i){return {type:"canvas-circle",props:i,children:[]}}function M(i){return {type:"canvas-arc",props:i,children:[]}}function E(i){return {type:"canvas-line",props:i,children:[]}}function J(i){return {type:"canvas-path",props:i,children:[]}}function O(i){return {type:"canvas-text",props:i,children:[]}}export{x as a,e as b,b as c,N as d,I as e,j as f,M as g,E as h,J as i,O as j};//# sourceMappingURL=chunk-KJPIJNFH.mjs.map
2
- //# sourceMappingURL=chunk-KJPIJNFH.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/primitives/utils.ts","../src/primitives/canvas/utils.ts","../src/primitives/canvas/renderer.ts","../src/primitives/canvas/Canvas.ts","../src/primitives/canvas/DrawRect.ts","../src/primitives/canvas/DrawCircle.ts","../src/primitives/canvas/DrawArc.ts","../src/primitives/canvas/DrawLine.ts","../src/primitives/canvas/DrawPath.ts","../src/primitives/canvas/DrawText.ts"],"names":["normalizeStyle","style","css","textStyle","isSignal","value","unwrapSignal","renderCanvasChildren","ctx","children","_width","_height","childArray","child","renderRect","renderCircle","renderPath","renderText","renderLine","renderArc","props","x","y","width","height","fill","stroke","strokeWidth","opacity","radius","d","path","text","fontSize","fontFamily","fontWeight","textAlign","textBaseline","x1","y1","x2","y2","startAngle","endAngle","counterclockwise","Canvas","id","rest","canvas","m","effect","onCleanup","rafId","scheduleRender","key","err","DrawRect","DrawCircle","DrawArc","DrawLine","DrawPath","DrawText"],"mappings":"qCASO,SAASA,EACdC,CAAAA,CAEqB,CACrB,GAAI,CAACA,CAAAA,CAAO,OAAO,EAAC,CAGpB,IAAMC,CAAAA,CAA2B,EAAC,CAG9BD,CAAAA,CAAM,UAASC,CAAAA,CAAI,OA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,IAAA,CAAM,aAAA,CACN,MAAAA,CAAAA,CACA,QAAA,CAAU,EACZ,CACF,CCNO,SAASwC,EAASxC,CAAAA,CAA6B,CACpD,OAAO,CACL,IAAA,CAAM,aAAA,CACN,KAAA,CAAAA,EACA,QAAA,CAAU,EACZ,CACF,CCNO,SAASyC,CAAAA,CAASzC,CAAAA,CAA6B,CACpD,OAAO,CACL,KAAM,aAAA,CACN,KAAA,CAAAA,EACA,QAAA,CAAU,EACZ,CACF","file":"chunk-KJPIJNFH.mjs","sourcesContent":["/**\n * Primitive utilities\n */\n\nimport type { CommonStyle, TextStyle } from './types'\n\n/**\n * Normalize CommonStyle to CSS properties\n */\nexport function normalizeStyle(\n style?: CommonStyle | TextStyle\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n): Record<string, any> {\n if (!style) return {}\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const css: Record<string, any> = {}\n\n // Layout\n if (style.display) css.display = style.display\n if (style.flex !== undefined) css.flex = style.flex\n if (style.flexDirection) css.flexDirection = style.flexDirection\n if (style.flexWrap) css.flexWrap = style.flexWrap\n if (style.justifyContent) css.justifyContent = style.justifyContent\n if (style.alignItems) css.alignItems = style.alignItems\n if (style.alignSelf) css.alignSelf = style.alignSelf\n if (style.gap !== undefined) css.gap = `${style.gap}px`\n\n // Spacing - padding\n if (style.padding !== undefined) css.padding = `${style.padding}px`\n if (style.paddingTop !== undefined) css.paddingTop = `${style.paddingTop}px`\n if (style.paddingRight !== undefined)\n css.paddingRight = `${style.paddingRight}px`\n if (style.paddingBottom !== undefined)\n css.paddingBottom = `${style.paddingBottom}px`\n if (style.paddingLeft !== undefined)\n css.paddingLeft = `${style.paddingLeft}px`\n if (style.paddingHorizontal !== undefined) {\n css.paddingLeft = `${style.paddingHorizontal}px`\n css.paddingRight = `${style.paddingHorizontal}px`\n }\n if (style.paddingVertical !== undefined) {\n css.paddingTop = `${style.paddingVertical}px`\n css.paddingBottom = `${style.paddingVertical}px`\n }\n\n // Spacing - margin\n if (style.margin !== undefined) css.margin = `${style.margin}px`\n if (style.marginTop !== undefined) css.marginTop = `${style.marginTop}px`\n if (style.marginRight !== undefined)\n css.marginRight = `${style.marginRight}px`\n if (style.marginBottom !== undefined)\n css.marginBottom = `${style.marginBottom}px`\n if (style.marginLeft !== undefined) css.marginLeft = `${style.marginLeft}px`\n if (style.marginHorizontal !== undefined) {\n css.marginLeft = `${style.marginHorizontal}px`\n css.marginRight = `${style.marginHorizontal}px`\n }\n if (style.marginVertical !== undefined) {\n css.marginTop = `${style.marginVertical}px`\n css.marginBottom = `${style.marginVertical}px`\n }\n\n // Sizing\n if (style.width !== undefined)\n css.width =\n typeof style.width === 'number' ? `${style.width}px` : style.width\n if (style.height !== undefined)\n css.height =\n typeof style.height === 'number' ? `${style.height}px` : style.height\n if (style.minWidth !== undefined) css.minWidth = `${style.minWidth}px`\n if (style.maxWidth !== undefined) css.maxWidth = `${style.maxWidth}px`\n if (style.minHeight !== undefined) css.minHeight = `${style.minHeight}px`\n if (style.maxHeight !== undefined) css.maxHeight = `${style.maxHeight}px`\n\n // Visual\n if (style.backgroundColor) css.backgroundColor = style.backgroundColor\n if (style.borderRadius !== undefined)\n css.borderRadius = `${style.borderRadius}px`\n if (style.borderTopLeftRadius !== undefined)\n css.borderTopLeftRadius = `${style.borderTopLeftRadius}px`\n if (style.borderTopRightRadius !== undefined)\n css.borderTopRightRadius = `${style.borderTopRightRadius}px`\n if (style.borderBottomLeftRadius !== undefined)\n css.borderBottomLeftRadius = `${style.borderBottomLeftRadius}px`\n if (style.borderBottomRightRadius !== undefined)\n css.borderBottomRightRadius = `${style.borderBottomRightRadius}px`\n if (style.opacity !== undefined) css.opacity = style.opacity\n\n // Border\n if (style.borderWidth !== undefined)\n css.borderWidth = `${style.borderWidth}px`\n if (style.borderColor) css.borderColor = style.borderColor\n if (style.borderTopWidth !== undefined)\n css.borderTopWidth = `${style.borderTopWidth}px`\n if (style.borderRightWidth !== undefined)\n css.borderRightWidth = `${style.borderRightWidth}px`\n if (style.borderBottomWidth !== undefined)\n css.borderBottomWidth = `${style.borderBottomWidth}px`\n if (style.borderLeftWidth !== undefined)\n css.borderLeftWidth = `${style.borderLeftWidth}px`\n\n // Position\n if (style.position) css.position = style.position\n if (style.top !== undefined) css.top = `${style.top}px`\n if (style.right !== undefined) css.right = `${style.right}px`\n if (style.bottom !== undefined) css.bottom = `${style.bottom}px`\n if (style.left !== undefined) css.left = `${style.left}px`\n if (style.zIndex !== undefined) css.zIndex = style.zIndex\n\n // Transform\n if (style.transform) css.transform = style.transform\n\n // Text-specific (if TextStyle)\n const textStyle = style as TextStyle\n if (textStyle.color) css.color = textStyle.color\n if (textStyle.fontSize !== undefined) css.fontSize = `${textStyle.fontSize}px`\n if (textStyle.fontWeight) css.fontWeight = textStyle.fontWeight\n if (textStyle.fontFamily) css.fontFamily = textStyle.fontFamily\n if (textStyle.fontStyle) css.fontStyle = textStyle.fontStyle\n if (textStyle.textAlign) css.textAlign = textStyle.textAlign\n if (textStyle.textDecoration) css.textDecoration = textStyle.textDecoration\n if (textStyle.lineHeight !== undefined)\n css.lineHeight = `${textStyle.lineHeight}px`\n if (textStyle.letterSpacing !== undefined)\n css.letterSpacing = `${textStyle.letterSpacing}px`\n\n return css\n}\n","/**\n * Canvas utilities\n */\n\nimport { isSignal as coreIsSignal } from '../../core/signal'\nimport type { Signal } from '../../core/signal'\n\n/**\n * Check if a value is a Signal\n */\nexport function isSignal<T>(value: T | Signal<T>): value is Signal<T> {\n // Use core isSignal which checks for SIGNAL_MARKER symbol\n // Signals are functions with properties, not plain objects\n return coreIsSignal(value)\n}\n\n/**\n * Unwrap a value that might be a Signal\n */\nexport function unwrapSignal<T>(value: T | Signal<T>): T {\n // Check for real signals first (have SIGNAL_MARKER)\n if (isSignal(value)) {\n return value.value\n }\n // Handle signal-like objects (for testing) - duck typing\n // Check if it's an object with a 'value' property\n if (\n value !== null &&\n typeof value === 'object' &&\n 'value' in value &&\n 'peek' in value\n ) {\n return (value as any).value\n }\n return value\n}\n","/**\n * Canvas renderer - renders canvas primitives to canvas context\n */\n\nimport type {\n DrawRectProps,\n DrawCircleProps,\n DrawPathProps,\n DrawTextProps,\n DrawLineProps,\n DrawArcProps,\n} from '../types'\nimport { unwrapSignal } from './utils'\n\n/**\n * Render canvas children to context\n */\nexport function renderCanvasChildren(\n ctx: CanvasRenderingContext2D,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n children: any,\n _width: number,\n _height: number\n): void {\n if (!children) return\n\n const childArray = Array.isArray(children) ? children : [children]\n\n for (const child of childArray) {\n if (!child || !child.type) continue\n\n switch (child.type) {\n case 'canvas-rect':\n renderRect(ctx, child.props)\n break\n case 'canvas-circle':\n renderCircle(ctx, child.props)\n break\n case 'canvas-path':\n renderPath(ctx, child.props)\n break\n case 'canvas-text':\n renderText(ctx, child.props)\n break\n case 'canvas-line':\n renderLine(ctx, child.props)\n break\n case 'canvas-arc':\n renderArc(ctx, child.props)\n break\n }\n }\n}\n\n/**\n * Render rectangle\n */\nfunction renderRect(ctx: CanvasRenderingContext2D, props: DrawRectProps): void {\n const x = unwrapSignal(props.x)\n const y = unwrapSignal(props.y)\n const width = unwrapSignal(props.width)\n const height = unwrapSignal(props.height)\n const fill = unwrapSignal(props.fill)\n const stroke = unwrapSignal(props.stroke)\n const strokeWidth = unwrapSignal(props.strokeWidth)\n const opacity = unwrapSignal(props.opacity)\n\n ctx.save()\n\n if (opacity !== undefined) {\n ctx.globalAlpha = opacity\n }\n\n if (fill) {\n ctx.fillStyle = fill\n ctx.fillRect(x, y, width, height)\n }\n\n if (stroke) {\n ctx.strokeStyle = stroke\n ctx.lineWidth = strokeWidth || 1\n ctx.strokeRect(x, y, width, height)\n }\n\n ctx.restore()\n}\n\n/**\n * Render circle\n */\nfunction renderCircle(\n ctx: CanvasRenderingContext2D,\n props: DrawCircleProps\n): void {\n const x = unwrapSignal(props.x)\n const y = unwrapSignal(props.y)\n const radius = unwrapSignal(props.radius)\n const fill = unwrapSignal(props.fill)\n const stroke = unwrapSignal(props.stroke)\n const strokeWidth = unwrapSignal(props.strokeWidth)\n const opacity = unwrapSignal(props.opacity)\n\n ctx.save()\n\n if (opacity !== undefined) {\n ctx.globalAlpha = opacity\n }\n\n ctx.beginPath()\n ctx.arc(x, y, radius, 0, 2 * Math.PI)\n\n if (fill) {\n ctx.fillStyle = fill\n ctx.fill()\n }\n\n if (stroke) {\n ctx.strokeStyle = stroke\n ctx.lineWidth = strokeWidth || 1\n ctx.stroke()\n }\n\n ctx.restore()\n}\n\n/**\n * Render path\n */\nfunction renderPath(ctx: CanvasRenderingContext2D, props: DrawPathProps): void {\n const d = unwrapSignal(props.d)\n const fill = unwrapSignal(props.fill)\n const stroke = unwrapSignal(props.stroke)\n const strokeWidth = unwrapSignal(props.strokeWidth)\n const opacity = unwrapSignal(props.opacity)\n\n ctx.save()\n\n if (opacity !== undefined) {\n ctx.globalAlpha = opacity\n }\n\n // Parse SVG path (simplified - only supports basic commands)\n const path = new Path2D(d)\n\n if (fill) {\n ctx.fillStyle = fill\n ctx.fill(path)\n }\n\n if (stroke) {\n ctx.strokeStyle = stroke\n ctx.lineWidth = strokeWidth || 1\n ctx.stroke(path)\n }\n\n ctx.restore()\n}\n\n/**\n * Render text\n */\nfunction renderText(ctx: CanvasRenderingContext2D, props: DrawTextProps): void {\n const x = unwrapSignal(props.x)\n const y = unwrapSignal(props.y)\n const text = unwrapSignal(props.text)\n const fill = unwrapSignal(props.fill)\n const fontSize = unwrapSignal(props.fontSize) || 12\n const fontFamily = unwrapSignal(props.fontFamily) || 'sans-serif'\n const fontWeight = unwrapSignal(props.fontWeight) || 'normal'\n const textAlign = unwrapSignal(props.textAlign) || 'left'\n const textBaseline = unwrapSignal(props.textBaseline) || 'alphabetic'\n\n ctx.save()\n\n ctx.font = `${fontWeight} ${fontSize}px ${fontFamily}`\n ctx.textAlign = textAlign\n ctx.textBaseline = textBaseline\n\n if (fill) {\n ctx.fillStyle = fill\n ctx.fillText(text, x, y)\n }\n\n ctx.restore()\n}\n\n/**\n * Render line\n */\nfunction renderLine(ctx: CanvasRenderingContext2D, props: DrawLineProps): void {\n const x1 = unwrapSignal(props.x1)\n const y1 = unwrapSignal(props.y1)\n const x2 = unwrapSignal(props.x2)\n const y2 = unwrapSignal(props.y2)\n const stroke = unwrapSignal(props.stroke) || 'black'\n const strokeWidth = unwrapSignal(props.strokeWidth) || 1\n const opacity = unwrapSignal(props.opacity)\n\n ctx.save()\n\n if (opacity !== undefined) {\n ctx.globalAlpha = opacity\n }\n\n ctx.beginPath()\n ctx.moveTo(x1, y1)\n ctx.lineTo(x2, y2)\n\n ctx.strokeStyle = stroke\n ctx.lineWidth = strokeWidth\n ctx.stroke()\n\n ctx.restore()\n}\n\n/**\n * Render arc\n */\nfunction renderArc(ctx: CanvasRenderingContext2D, props: DrawArcProps): void {\n const x = unwrapSignal(props.x)\n const y = unwrapSignal(props.y)\n const radius = unwrapSignal(props.radius)\n const startAngle = unwrapSignal(props.startAngle)\n const endAngle = unwrapSignal(props.endAngle)\n const counterclockwise = unwrapSignal(props.counterclockwise) || false\n const fill = unwrapSignal(props.fill)\n const stroke = unwrapSignal(props.stroke)\n const strokeWidth = unwrapSignal(props.strokeWidth)\n const opacity = unwrapSignal(props.opacity)\n\n ctx.save()\n\n if (opacity !== undefined) {\n ctx.globalAlpha = opacity\n }\n\n ctx.beginPath()\n ctx.arc(x, y, radius, startAngle, endAngle, counterclockwise)\n\n if (fill) {\n ctx.fillStyle = fill\n ctx.fill()\n }\n\n if (stroke) {\n ctx.strokeStyle = stroke\n ctx.lineWidth = strokeWidth || 1\n ctx.stroke()\n }\n\n ctx.restore()\n}\n","/**\n * Canvas - Declarative canvas container with JSX drawing\n *\n * Supports Signal-based reactive rendering\n *\n * @example\n * ```tsx\n * const x = signal(50)\n *\n * <Canvas width={300} height={200}>\n * <Rect x={x} y={50} width={100} height={50} fill=\"blue\" />\n * <Circle x={150} y={100} radius={30} fill=\"red\" />\n * </Canvas>\n * ```\n */\n\nimport type { FNode } from '../../types'\nimport type { CanvasProps } from '../types'\nimport { normalizeStyle } from '../utils'\nimport { renderCanvasChildren } from './renderer'\n\nexport function Canvas(props: CanvasProps): FNode {\n const { width, height, children, style, id, ...rest } = props\n\n return {\n type: 'canvas',\n props: {\n ...rest,\n id,\n width,\n height,\n style: normalizeStyle(style),\n // Attach canvas renderer when element is mounted\n ref: (canvas: HTMLCanvasElement | null) => {\n if (!canvas) return\n\n // SSR guard: skip canvas rendering on server\n if (typeof requestAnimationFrame === 'undefined') return\n\n const ctx = canvas.getContext('2d')\n if (!ctx) return\n\n // Check if effect is available before trying to import\n // Import effect and onCleanup dynamically to avoid circular deps\n Promise.all([\n import('../../core/effect').then(m => m.effect),\n import('../../core/signal').then(m => ({ onCleanup: m.onCleanup, isSignal: m.isSignal }))\n ])\n .then(([effect, { onCleanup, isSignal }]) => {\n let rafId: number | undefined\n\n const scheduleRender = () => {\n if (rafId !== undefined) {\n cancelAnimationFrame(rafId)\n }\n\n rafId = requestAnimationFrame(() => {\n // Clear canvas\n ctx.clearRect(0, 0, width, height)\n\n // Render all children\n renderCanvasChildren(ctx, children, width, height)\n\n rafId = undefined\n })\n }\n\n effect(() => {\n // To track signal dependencies, we need to access them in the effect\n // Walk through children and touch any signals to track dependencies\n const childArray = Array.isArray(children) ? children : [children]\n for (const child of childArray) {\n if (child && child.props) {\n // Touch each prop to track signal dependencies\n for (const key in child.props) {\n const value = child.props[key]\n // If it's a signal, access its value to track it\n if (isSignal(value)) {\n void value.value // Touch the signal to track dependency\n }\n }\n }\n }\n\n // Now schedule the actual render\n scheduleRender()\n\n // Cleanup RAF when effect is disposed\n onCleanup(() => {\n if (rafId !== undefined) {\n cancelAnimationFrame(rafId)\n rafId = undefined\n }\n })\n })\n })\n .catch((err) => {\n console.error('[Flexium Canvas] Failed to load signal module:', err)\n })\n },\n },\n children: [],\n }\n}\n","/**\n * DrawRect - Canvas rectangle primitive\n *\n * @example\n * ```tsx\n * <DrawRect x={10} y={10} width={100} height={50} fill=\"blue\" />\n * ```\n */\n\nimport type { FNode } from '../../types'\nimport type { DrawRectProps } from '../types'\n\nexport function DrawRect(props: DrawRectProps): FNode {\n return {\n type: 'canvas-rect',\n props,\n children: [],\n }\n}\n","/**\n * DrawCircle - Canvas circle primitive\n *\n * @example\n * ```tsx\n * <DrawCircle x={100} y={100} radius={50} fill=\"red\" />\n * ```\n */\n\nimport type { FNode } from '../../types'\nimport type { DrawCircleProps } from '../types'\n\nexport function DrawCircle(props: DrawCircleProps): FNode {\n return {\n type: 'canvas-circle',\n props,\n children: [],\n }\n}\n","/**\n * DrawArc - Canvas arc primitive\n *\n * @example\n * ```tsx\n * <DrawArc x={100} y={100} radius={50} startAngle={0} endAngle={Math.PI} fill=\"green\" />\n * ```\n */\n\nimport type { FNode } from '../../types'\nimport type { DrawArcProps } from '../types'\n\nexport function DrawArc(props: DrawArcProps): FNode {\n return {\n type: 'canvas-arc',\n props,\n children: [],\n }\n}\n","/**\n * DrawLine - Canvas line primitive\n *\n * @example\n * ```tsx\n * <DrawLine x1={10} y1={10} x2={100} y2={100} stroke=\"black\" strokeWidth={2} />\n * ```\n */\n\nimport type { FNode } from '../../types'\nimport type { DrawLineProps } from '../types'\n\nexport function DrawLine(props: DrawLineProps): FNode {\n return {\n type: 'canvas-line',\n props,\n children: [],\n }\n}\n","/**\n * DrawPath - Canvas path primitive\n *\n * @example\n * ```tsx\n * <DrawPath d=\"M 10 10 L 100 100\" stroke=\"black\" strokeWidth={2} />\n * ```\n */\n\nimport type { FNode } from '../../types'\nimport type { DrawPathProps } from '../types'\n\nexport function DrawPath(props: DrawPathProps): FNode {\n return {\n type: 'canvas-path',\n props,\n children: [],\n }\n}\n","/**\n * DrawText - Canvas text primitive\n *\n * @example\n * ```tsx\n * <DrawText x={50} y={50} text=\"Hello Canvas\" fontSize={20} fill=\"black\" />\n * ```\n */\n\nimport type { FNode } from '../../types'\nimport type { DrawTextProps } from '../types'\n\nexport function DrawText(props: DrawTextProps): FNode {\n return {\n type: 'canvas-text',\n props,\n children: [],\n }\n}\n"]}
@@ -1,2 +0,0 @@
1
- import {a}from'./chunk-WVEJT7HD.mjs';import {g}from'./chunk-B7VP6HBY.mjs';function m(e){let t={},i=[];return e.x!==void 0&&i.push(`translateX(${e.x}px)`),e.y!==void 0&&i.push(`translateY(${e.y}px)`),e.scale!==void 0?i.push(`scale(${e.scale})`):(e.scaleX!==void 0&&i.push(`scaleX(${e.scaleX})`),e.scaleY!==void 0&&i.push(`scaleY(${e.scaleY})`)),e.rotate!==void 0&&i.push(`rotate(${e.rotate}deg)`),i.length>0&&(t.transform=i.join(" ")),e.opacity!==void 0&&(t.opacity=e.opacity.toString()),e.width!==void 0&&(t.width=typeof e.width=="number"?`${e.width}px`:e.width),e.height!==void 0&&(t.height=typeof e.height=="number"?`${e.height}px`:e.height),t}function L(e){let t=e.tension??170,i=e.friction??26,o=e.mass??1,r=t,n=i,s=o,l=Math.sqrt(r/s),c=n/(2*Math.sqrt(r*s)),u=4.6/(c*l)*1e3;return c<1?{duration:u,easing:"cubic-bezier(0.34, 1.56, 0.64, 1)"}:{duration:u,easing:"cubic-bezier(0.22, 1, 0.36, 1)"}}var d=null,x=null;function A(){if(d===null)if(typeof window<"u"&&window.matchMedia){let e=window.matchMedia("(prefers-reduced-motion: reduce)");d=e.matches;let t=i=>{d=i.matches;};e.addEventListener("change",t),x=()=>{e.removeEventListener("change",t),d=null,x=null;};}else d=false;return d}function O(){x&&x();}var f=class{constructor(t){this.animation=null;this.resizeObserver=null;this.previousSize=null;this.element=t;}animate(t){let{initial:i,animate:o,duration:r=300,spring:n,easing:s="ease-out",delay:l=0}=t;if(!o)return;if(this.cancel(),A()){let a=m(o);Object.assign(this.element.style,{transform:a.transform||"",opacity:a.opacity||"",width:a.width||"",height:a.height||""}),t.onAnimationStart&&t.onAnimationStart(),t.onAnimationComplete&&t.onAnimationComplete();return}if(i){let a=m(i);Object.assign(this.element.style,{transform:a.transform||"",opacity:a.opacity||"",width:a.width||"",height:a.height||""});}let c=i?m(i):{},u=m(o),h=r,g=s;if(n){let a=L(n);h=a.duration,g=a.easing;}this.animation=this.element.animate([c,u],{duration:h,easing:g,delay:l,fill:"forwards"}),t.onAnimationStart&&t.onAnimationStart(),this.animation.onfinish=()=>{t.onAnimationComplete&&t.onAnimationComplete();};}async animateExit(t,i=300,o="ease-in"){if(this.cancel(),A()){let n=m(t);Object.assign(this.element.style,{transform:n.transform||"",opacity:n.opacity||"",width:n.width||"",height:n.height||""});return}let r=m(t);this.animation=this.element.animate([{},r],{duration:i,easing:o,fill:"forwards"}),await this.animation.finished;}enableLayoutAnimation(t=300,i="ease-out"){let o=this.element.getBoundingClientRect();this.previousSize={width:o.width,height:o.height},this.resizeObserver=new ResizeObserver(r=>{for(let n of r){if(!this.previousSize){this.previousSize={width:n.contentRect.width,height:n.contentRect.height};return}let s=n.contentRect.width,l=n.contentRect.height;(s!==this.previousSize.width||l!==this.previousSize.height)&&(this.cancel(),this.animation=this.element.animate([{width:`${this.previousSize.width}px`,height:`${this.previousSize.height}px`},{width:`${s}px`,height:`${l}px`}],{duration:t,easing:i,fill:"forwards"}),this.previousSize={width:s,height:l});}}),this.resizeObserver.observe(this.element);}disableLayoutAnimation(){this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null,this.previousSize=null);}cancel(){this.animation&&(this.animation.cancel(),this.animation=null);}dispose(){this.cancel(),this.disableLayoutAnimation();}};function R(e){switch(e){case "fade":return {enter:{opacity:0},enterTo:{opacity:1},exit:{opacity:0}};case "slide-up":return {enter:{opacity:0,y:20},enterTo:{opacity:1,y:0},exit:{opacity:0,y:-20}};case "slide-down":return {enter:{opacity:0,y:-20},enterTo:{opacity:1,y:0},exit:{opacity:0,y:20}};case "slide-left":return {enter:{opacity:0,x:20},enterTo:{opacity:1,x:0},exit:{opacity:0,x:-20}};case "slide-right":return {enter:{opacity:0,x:-20},enterTo:{opacity:1,x:0},exit:{opacity:0,x:20}};case "scale":return {enter:{scale:.9},enterTo:{scale:1},exit:{scale:.9}};case "scale-fade":return {enter:{opacity:0,scale:.95},enterTo:{opacity:1,scale:1},exit:{opacity:0,scale:.95}};default:return {enter:{},enterTo:{},exit:{}}}}var y=null;function $(e){let{preset:t,enter:i,enterTo:o,exit:r,enterTiming:n={duration:300,easing:"ease-out"},exitTiming:s={duration:200,easing:"ease-in"},onEnterStart:l,onEnterComplete:c,onExitStart:u,onExitComplete:h,children:g$1}=e,a$1=t?R(t):null,P=i??a$1?.enter??{},C=o??a$1?.enterTo??{},S=r??a$1?.exit??{},b=null,p=null,M=y?.registerChild()??0,z=y?.staggerDelay??0,E=M*z;return g(async()=>{b&&p&&(u?.(),await p.animateExit(S,s.duration,s.easing),h?.());}),a("div",{style:{display:"contents"},ref:T=>{T&&(b=T,p=new f(T),queueMicrotask(()=>{p&&(l?.(),p.animate({initial:P,animate:C,duration:n.duration,easing:n.easing,delay:(n.delay??0)+E,onAnimationComplete:c}));}));}},g$1)}function G(e){let{stagger:t=50,children:i}=e,o=0,r={registerChild:()=>o++,staggerDelay:t};return ()=>{o=0;let n=y;y=r;try{return i}finally{y=n;}}}var D={fade:{preset:"fade"},slideUp:{preset:"slide-up"},slideDown:{preset:"slide-down"},slideLeft:{preset:"slide-left"},slideRight:{preset:"slide-right"},scale:{preset:"scale"},scaleFade:{preset:"scale-fade"},modal:{enter:{opacity:0,scale:.95,y:-10},enterTo:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:10},enterTiming:{duration:200,easing:"cubic-bezier(0.16, 1, 0.3, 1)"},exitTiming:{duration:150,easing:"ease-in"}},dropdown:{enter:{opacity:0,y:-8,scale:.95},enterTo:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-8,scale:.95},enterTiming:{duration:150,easing:"ease-out"},exitTiming:{duration:100,easing:"ease-in"}},tooltip:{enter:{opacity:0,scale:.9},enterTo:{opacity:1,scale:1},exit:{opacity:0,scale:.9},enterTiming:{duration:100,easing:"ease-out"},exitTiming:{duration:75,easing:"ease-in"}},notification:{enter:{opacity:0,x:100},enterTo:{opacity:1,x:0},exit:{opacity:0,x:100},enterTiming:{duration:300,easing:"cubic-bezier(0.16, 1, 0.3, 1)"},exitTiming:{duration:200,easing:"ease-in"}},page:{enter:{opacity:0},enterTo:{opacity:1},exit:{opacity:0},enterTiming:{duration:200,easing:"ease-out"},exitTiming:{duration:150,easing:"ease-in"}}};export{O as a,f as b,$ as c,G as d,D as e};//# sourceMappingURL=chunk-PVPY55Z7.mjs.map
2
- //# sourceMappingURL=chunk-PVPY55Z7.mjs.map
@@ -1,3 +0,0 @@
1
- var o={EFFECT_EXECUTION_FAILED:"FLX101",CLEANUP_OUTSIDE_EFFECT:"FLX102",SIGNAL_UPDATE_DURING_RENDER:"FLX103",COMPUTED_EXECUTION_FAILED:"FLX104",CONTEXT_MISSING_PROVIDER:"FLX201",ROUTER_OUTSIDE_PROVIDER:"FLX202",FORM_VALIDATION_FAILED:"FLX301",FORM_SUBMISSION_FAILED:"FLX302",ASYNC_VALIDATION_FAILED:"FLX303",BUTTON_HANDLER_FAILED:"FLX401",BUTTON_MISSING_ARIA_LABEL:"FLX402",COMPONENT_RENDER_FAILED:"FLX403",HYDRATION_MISMATCH:"FLX501",HYDRATION_TEXT_MISMATCH:"FLX502",HYDRATION_TAG_MISMATCH:"FLX503",HYDRATION_ATTRIBUTE_MISMATCH:"FLX504",DEVTOOLS_LISTENER_ERROR:"FLX601",UNCAUGHT_RENDER_ERROR:"FLX701",ERROR_BOUNDARY_CALLBACK_FAILED:"FLX702",DOM_CLEANUP_FAILED:"FLX703",EVENT_HANDLER_FAILED:"FLX801",KEYBOARD_HANDLER_FAILED:"FLX802",RESOURCE_FETCH_FAILED:"FLX901",RESOURCE_TIMEOUT:"FLX902"};function O(e){return typeof process<"u"&&process.env?.NODE_ENV!=="production"?{[o.EFFECT_EXECUTION_FAILED]:{message:"Effect execution failed",suggestion:"Check the effect callback for runtime errors. Consider wrapping async operations in try-catch."},[o.CLEANUP_OUTSIDE_EFFECT]:{message:"onCleanup must be called from within an effect",suggestion:"Move the onCleanup() call inside an effect() callback."},[o.SIGNAL_UPDATE_DURING_RENDER]:{message:"Signal was updated during render",suggestion:"Avoid updating signals inside render functions. Use effect() for side effects."},[o.CONTEXT_MISSING_PROVIDER]:{message:"Context used outside of Provider",suggestion:"Wrap your component tree with the appropriate Context.Provider."},[o.ROUTER_OUTSIDE_PROVIDER]:{message:"router() must be used within a <Router> component",suggestion:"Ensure your component is a descendant of <Router>."},[o.FORM_VALIDATION_FAILED]:{message:"Form field validation failed",suggestion:"Check the validation rules for the field and the input value."},[o.FORM_SUBMISSION_FAILED]:{message:"Form submission failed",suggestion:"Check the onSubmit handler and network connectivity."},[o.BUTTON_HANDLER_FAILED]:{message:"Button press handler failed",suggestion:"Check the onPress/onClick callback for errors."},[o.BUTTON_MISSING_ARIA_LABEL]:{message:"IconButton is missing an aria-label",suggestion:"Add an aria-label prop to IconButton for screen reader accessibility."},[o.HYDRATION_MISMATCH]:{message:"Hydration mismatch detected",suggestion:"Ensure server and client render the same content. Check for browser-only code."},[o.HYDRATION_TEXT_MISMATCH]:{message:"Text content mismatch during hydration",suggestion:"Server and client rendered different text. Check for Date.now(), Math.random(), or client-only data."},[o.HYDRATION_TAG_MISMATCH]:{message:"Element tag mismatch during hydration",suggestion:"Server and client rendered different elements. Verify conditional rendering logic."},[o.DEVTOOLS_LISTENER_ERROR]:{message:"DevTools listener threw an error",suggestion:"Check your DevTools event listener callback."},[o.UNCAUGHT_RENDER_ERROR]:{message:"Uncaught error during render",suggestion:"Wrap components with <ErrorBoundary> to catch and handle errors gracefully."},[o.ERROR_BOUNDARY_CALLBACK_FAILED]:{message:"ErrorBoundary callback failed",suggestion:"Check your onError or onReset callback for errors."},[o.COMPUTED_EXECUTION_FAILED]:{message:"Computed value execution failed",suggestion:"Check the computed callback for runtime errors. Ensure all dependencies are valid."},[o.ASYNC_VALIDATION_FAILED]:{message:"Async form validation failed",suggestion:"Check the async validation function and ensure it handles errors properly."},[o.COMPONENT_RENDER_FAILED]:{message:"Component render failed",suggestion:"Check the component function for runtime errors. Consider wrapping with <ErrorBoundary>."},[o.HYDRATION_ATTRIBUTE_MISMATCH]:{message:"Attribute mismatch during hydration",suggestion:"Server and client rendered different attribute values. Check for dynamic attributes."},[o.DOM_CLEANUP_FAILED]:{message:"DOM cleanup operation failed",suggestion:"A node may have been removed from the DOM unexpectedly. Check for manual DOM manipulation."},[o.EVENT_HANDLER_FAILED]:{message:"Event handler threw an error",suggestion:"Check your event handler callback. Consider adding try-catch for async operations."},[o.KEYBOARD_HANDLER_FAILED]:{message:"Keyboard event handler failed",suggestion:"Check the onKeyDown/onKeyUp handler for errors."},[o.RESOURCE_FETCH_FAILED]:{message:"Resource fetch failed",suggestion:"Check the async function and network connectivity. The resource will show an error state."},[o.RESOURCE_TIMEOUT]:{message:"Resource fetch timed out",suggestion:"The async operation took too long. Consider adding a timeout handler or retry logic."}}[e]||{message:`Error ${e}`}:{message:`Minified Error ${e}`}}function I(e,n,i){let r=O(e);return {code:e,message:r.message,suggestion:r.suggestion,context:n,originalError:i}}function D(e){let n=`[Flexium ${e.code}] ${e.message}`;if(e.context&&Object.keys(e.context).length>0){let i=Object.entries(e.context).map(([r,t])=>`${r}: ${JSON.stringify(t)}`).join(", ");n+=` (${i})`;}return e.suggestion&&(n+=`
2
- \u2192 ${e.suggestion}`),n}function _(e,n,i){let r=I(e,n,i),t=D(r);i?console.error(t,i):console.error(t);}function T(e,n){let i=I(e,n),r=D(i);console.warn(r);}var g;(t=>{let e=[],n=0;function i(s,c){if(n>0){let a=e[--n];return a.dep=s,a.sub=c,a.prevSub=void 0,a.nextSub=void 0,a.prevDep=void 0,a.nextDep=void 0,a}return {dep:s,sub:c,prevSub:void 0,nextSub:void 0,prevDep:void 0,nextDep:void 0}}t.alloc=i;function r(s){s.dep=void 0,s.sub=void 0,s.prevSub=void 0,s.nextSub=void 0,s.prevDep=void 0,s.nextDep=void 0,n<1e4&&(e[n++]=s);}t.free=r;})(g||(g={}));var u;(i=>{function e(r,t){let s=g.alloc(r,t),c=t.depsHead;s.nextDep=c,c&&(c.prevDep=s),t.depsHead=s;let a=r.subsHead;s.nextSub=a,a&&(a.prevSub=s),r.subsHead=s;}i.connect=e;function n(r){let t=r.depsHead;for(;t;){let s=t.dep,c=t.nextDep,a=t.prevSub,f=t.nextSub;a?a.nextSub=f:s.subsHead=f,f&&(f.prevSub=a),g.free(t),t=c;}r.depsHead=void 0;}i.disconnectDependencies=n;})(u||(u={}));var R;(r=>{function e(t,s){return (t.flags&s)!==0}r.has=e;function n(t,s){t.flags|=s;}r.add=n;function i(t,s){t.flags&=~s;}r.remove=i;})(R||(R={}));var d=null;function A(){return d}function p(e){d=e;}function C(e){let n=d;d=null;try{return e()}finally{d=n;}}var l=null;function E(){return l}function h(e){l=e;}function x(e){let n=l,i={cleanups:[],context:n?Object.create(n.context):null,owner:n};l=i;let r=()=>{if(i.cleanups.length!==0){for(let t of i.cleanups)t();i.cleanups=[];}};try{return e(r)}finally{l=n;}}var m=class{constructor(n,i){this.fn=n;this.onError=i;this.cleanups=[];this.flags=0;this.nodeType=3;this.owner=null;this.owner=E();}execute(){if((this.flags&1)!==0){this.flags|=2;return}this.flags|=1;try{this.run();}finally{this.flags&=-2,(this.flags&2)!==0&&(this.flags&=-3,queueMicrotask(()=>this.execute()));}}run(){if(this.cleanups.length>0){for(let r=this.cleanups.length-1;r>=0;r--)this.cleanups[r]();this.cleanups=[];}u.disconnectDependencies(this);let n=A(),i=E();p(this),h(this.owner);try{let r=this.fn();typeof r=="function"&&this.cleanups.push(r);}catch(r){this.onError?this.onError(r):_(o.EFFECT_EXECUTION_FAILED,void 0,r);}finally{p(n),h(i);}}dispose(){if(this.cleanups.length>0){for(let n=this.cleanups.length-1;n>=0;n--)this.cleanups[n]();this.cleanups=[];}u.disconnectDependencies(this);}};function U(e,n){let i=new m(e,n?.onError);i.execute();let r=()=>i.dispose(),t=E();return t&&t.cleanups.push(r),r}export{o as a,_ as b,T as c,u as d,A as e,p as f,C as g,E as h,x as i,m as j,U as k};//# sourceMappingURL=chunk-Q7WT5IIF.mjs.map
3
- //# sourceMappingURL=chunk-Q7WT5IIF.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/core/errors.ts","../src/core/graph.ts","../src/core/owner.ts","../src/core/effect.ts"],"names":["ErrorCodes","getErrorDetails","code","createErrorInfo","context","originalError","details","formatErrorMessage","info","message","contextStr","key","value","logError","logWarning","LinkPool","pool","size","alloc","dep","sub","link","free","Graph","connect","depsHead","subsHead","disconnectDependencies","nextDep","prevSub","nextSub","Flags","has","obj","flag","add","remove","activeEffect","getActiveEffect","setActiveEffect","effect","untrack","fn","prev","owner","getOwner","setOwner","newOwner","root","prevOwner","dispose","cleanup","EffectNode","onError","i","prevEffect","result","error","options","node"],"mappings":"AAQO,IAAMA,CAAAA,CAAa,CAExB,uBAAA,CAAyB,QAAA,CACzB,uBAAwB,QAAA,CACxB,2BAAA,CAA6B,SAC7B,yBAAA,CAA2B,QAAA,CAG3B,yBAA0B,QAAA,CAC1B,uBAAA,CAAyB,SAGzB,sBAAA,CAAwB,QAAA,CACxB,uBAAwB,QAAA,CACxB,uBAAA,CAAyB,QAAA,CAGzB,qBAAA,CAAuB,QAAA,CACvB,yBAAA,CAA2B,SAC3B,uBAAA,CAAyB,QAAA,CAGzB,mBAAoB,QAAA,CACpB,uBAAA,CAAyB,SACzB,sBAAA,CAAwB,QAAA,CACxB,4BAAA,CAA8B,QAAA,CAG9B,uBAAA,CAAyB,QAAA,CAGzB,sBAAuB,QAAA,CACvB,8BAAA,CAAgC,SAChC,kBAAA,CAAoB,QAAA,CAGpB,qBAAsB,QAAA,CACtB,uBAAA,CAAyB,QAAA,CAGzB,qBAAA,CAAuB,QAAA,CACvB,gBAAA,CAAkB,QACpB,EAWA,SAASC,EAAgBC,CAAAA,CAGvB,CAEA,OADc,OAAO,OAAA,CAAY,KAAe,OAAA,CAAQ,GAAA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AAK,SAAS,IAAA,CAAKA,CAAM,EAEjC,CAAA,MAASC,EAAO,CACR,IAAA,CAAK,OAAA,CACL,IAAA,CAAK,QAAQA,CAAc,CAAA,CAE3B5C,CAAAA,CAASb,CAAAA,CAAW,wBAAyB,MAAA,CAAWyD,CAAK,EAErE,CAAA,OAAE,CACElB,CAAAA,CAAgBgB,CAAU,CAAA,CAC1BT,EAASG,CAAS,EACtB,CACJ,CAEA,SAAgB,CAGZ,GAAI,IAAA,CAAK,QAAA,CAAS,OAAS,CAAA,CAAG,CAC1B,IAAA,IAASK,CAAAA,CAAI,KAAK,QAAA,CAAS,MAAA,CAAS,CAAA,CAAGA,CAAAA,EAAK,EAAGA,CAAAA,EAAAA,CAC3C,IAAA,CAAK,QAAA,CAASA,CAAC,GAAE,CAErB,IAAA,CAAK,QAAA,CAAW,GACpB,CACA/B,CAAAA,CAAM,sBAAA,CAAuB,IAAI,EACrC,CACJ,EAoBO,SAASiB,EACZE,CAAAA,CACAgB,CAAAA,CACU,CAKV,IAAMC,EAAO,IAAIP,CAAAA,CAAWV,CAAAA,CAAIgB,CAAAA,EAAS,OAAO,CAAA,CAChDC,CAAAA,CAAK,OAAA,EAAQ,CACb,IAAMT,CAAAA,CAAU,IAAMS,CAAAA,CAAK,OAAA,GAErBf,CAAAA,CAAQC,CAAAA,EAAS,CACvB,OAAID,GACAA,CAAAA,CAAM,QAAA,CAAS,IAAA,CAAKM,CAAO,EAGxBA,CACX","file":"chunk-Q7WT5IIF.mjs","sourcesContent":["/**\n * Flexium Error System\n *\n * Standardized error handling with error codes, contextual information,\n * and actionable suggestions for developers.\n */\n\n// Error codes for all Flexium errors\nexport const ErrorCodes = {\n // Signal/Effect errors (1xx)\n EFFECT_EXECUTION_FAILED: 'FLX101',\n CLEANUP_OUTSIDE_EFFECT: 'FLX102',\n SIGNAL_UPDATE_DURING_RENDER: 'FLX103',\n COMPUTED_EXECUTION_FAILED: 'FLX104',\n\n // Context errors (2xx)\n CONTEXT_MISSING_PROVIDER: 'FLX201',\n ROUTER_OUTSIDE_PROVIDER: 'FLX202',\n\n // Form errors (3xx)\n FORM_VALIDATION_FAILED: 'FLX301',\n FORM_SUBMISSION_FAILED: 'FLX302',\n ASYNC_VALIDATION_FAILED: 'FLX303',\n\n // Component errors (4xx)\n BUTTON_HANDLER_FAILED: 'FLX401',\n BUTTON_MISSING_ARIA_LABEL: 'FLX402',\n COMPONENT_RENDER_FAILED: 'FLX403',\n\n // Hydration errors (5xx)\n HYDRATION_MISMATCH: 'FLX501',\n HYDRATION_TEXT_MISMATCH: 'FLX502',\n HYDRATION_TAG_MISMATCH: 'FLX503',\n HYDRATION_ATTRIBUTE_MISMATCH: 'FLX504',\n\n // DevTools errors (6xx)\n DEVTOOLS_LISTENER_ERROR: 'FLX601',\n\n // Render errors (7xx)\n UNCAUGHT_RENDER_ERROR: 'FLX701',\n ERROR_BOUNDARY_CALLBACK_FAILED: 'FLX702',\n DOM_CLEANUP_FAILED: 'FLX703',\n\n // Event errors (8xx)\n EVENT_HANDLER_FAILED: 'FLX801',\n KEYBOARD_HANDLER_FAILED: 'FLX802',\n\n // Resource/Async errors (9xx)\n RESOURCE_FETCH_FAILED: 'FLX901',\n RESOURCE_TIMEOUT: 'FLX902',\n} as const\n\nexport type ErrorCode = (typeof ErrorCodes)[keyof typeof ErrorCodes]\n\ninterface ErrorDefinition {\n message: string\n suggestion?: string\n}\n\n// Error message definitions with suggestions\n// Wrapped in a function to allow tree-shaking in production\nfunction getErrorDetails(code: ErrorCode): {\n message: string\n suggestion?: string\n} {\n const isDev = typeof process !== 'undefined' && process.env?.NODE_ENV !== 'production'\n if (isDev) {\n const errorDefinitions: Record<ErrorCode, ErrorDefinition> = {\n [ErrorCodes.EFFECT_EXECUTION_FAILED]: {\n message: 'Effect execution failed',\n suggestion:\n 'Check the effect callback for runtime errors. Consider wrapping async operations in try-catch.',\n },\n [ErrorCodes.CLEANUP_OUTSIDE_EFFECT]: {\n message: 'onCleanup must be called from within an effect',\n suggestion: 'Move the onCleanup() call inside an effect() callback.',\n },\n [ErrorCodes.SIGNAL_UPDATE_DURING_RENDER]: {\n message: 'Signal was updated during render',\n suggestion:\n 'Avoid updating signals inside render functions. Use effect() for side effects.',\n },\n [ErrorCodes.CONTEXT_MISSING_PROVIDER]: {\n message: 'Context used outside of Provider',\n suggestion:\n 'Wrap your component tree with the appropriate Context.Provider.',\n },\n [ErrorCodes.ROUTER_OUTSIDE_PROVIDER]: {\n message: 'router() must be used within a <Router> component',\n suggestion: 'Ensure your component is a descendant of <Router>.',\n },\n [ErrorCodes.FORM_VALIDATION_FAILED]: {\n message: 'Form field validation failed',\n suggestion:\n 'Check the validation rules for the field and the input value.',\n },\n [ErrorCodes.FORM_SUBMISSION_FAILED]: {\n message: 'Form submission failed',\n suggestion: 'Check the onSubmit handler and network connectivity.',\n },\n [ErrorCodes.BUTTON_HANDLER_FAILED]: {\n message: 'Button press handler failed',\n suggestion: 'Check the onPress/onClick callback for errors.',\n },\n [ErrorCodes.BUTTON_MISSING_ARIA_LABEL]: {\n message: 'IconButton is missing an aria-label',\n suggestion:\n 'Add an aria-label prop to IconButton for screen reader accessibility.',\n },\n [ErrorCodes.HYDRATION_MISMATCH]: {\n message: 'Hydration mismatch detected',\n suggestion:\n 'Ensure server and client render the same content. Check for browser-only code.',\n },\n [ErrorCodes.HYDRATION_TEXT_MISMATCH]: {\n message: 'Text content mismatch during hydration',\n suggestion:\n 'Server and client rendered different text. Check for Date.now(), Math.random(), or client-only data.',\n },\n [ErrorCodes.HYDRATION_TAG_MISMATCH]: {\n message: 'Element tag mismatch during hydration',\n suggestion:\n 'Server and client rendered different elements. Verify conditional rendering logic.',\n },\n [ErrorCodes.DEVTOOLS_LISTENER_ERROR]: {\n message: 'DevTools listener threw an error',\n suggestion: 'Check your DevTools event listener callback.',\n },\n [ErrorCodes.UNCAUGHT_RENDER_ERROR]: {\n message: 'Uncaught error during render',\n suggestion:\n 'Wrap components with <ErrorBoundary> to catch and handle errors gracefully.',\n },\n [ErrorCodes.ERROR_BOUNDARY_CALLBACK_FAILED]: {\n message: 'ErrorBoundary callback failed',\n suggestion: 'Check your onError or onReset callback for errors.',\n },\n [ErrorCodes.COMPUTED_EXECUTION_FAILED]: {\n message: 'Computed value execution failed',\n suggestion:\n 'Check the computed callback for runtime errors. Ensure all dependencies are valid.',\n },\n [ErrorCodes.ASYNC_VALIDATION_FAILED]: {\n message: 'Async form validation failed',\n suggestion:\n 'Check the async validation function and ensure it handles errors properly.',\n },\n [ErrorCodes.COMPONENT_RENDER_FAILED]: {\n message: 'Component render failed',\n suggestion:\n 'Check the component function for runtime errors. Consider wrapping with <ErrorBoundary>.',\n },\n [ErrorCodes.HYDRATION_ATTRIBUTE_MISMATCH]: {\n message: 'Attribute mismatch during hydration',\n suggestion:\n 'Server and client rendered different attribute values. Check for dynamic attributes.',\n },\n [ErrorCodes.DOM_CLEANUP_FAILED]: {\n message: 'DOM cleanup operation failed',\n suggestion:\n 'A node may have been removed from the DOM unexpectedly. Check for manual DOM manipulation.',\n },\n [ErrorCodes.EVENT_HANDLER_FAILED]: {\n message: 'Event handler threw an error',\n suggestion:\n 'Check your event handler callback. Consider adding try-catch for async operations.',\n },\n [ErrorCodes.KEYBOARD_HANDLER_FAILED]: {\n message: 'Keyboard event handler failed',\n suggestion: 'Check the onKeyDown/onKeyUp handler for errors.',\n },\n [ErrorCodes.RESOURCE_FETCH_FAILED]: {\n message: 'Resource fetch failed',\n suggestion:\n 'Check the async function and network connectivity. The resource will show an error state.',\n },\n [ErrorCodes.RESOURCE_TIMEOUT]: {\n message: 'Resource fetch timed out',\n suggestion:\n 'The async operation took too long. Consider adding a timeout handler or retry logic.',\n },\n }\n return errorDefinitions[code] || { message: `Error ${code}` }\n }\n return { message: `Minified Error ${code}` }\n}\n\nexport interface FlexiumErrorInfo {\n code: ErrorCode\n message: string\n suggestion?: string\n context?: Record<string, unknown>\n originalError?: unknown\n}\n\n/**\n * Create a standardized error info object\n */\nexport function createErrorInfo(\n code: ErrorCode,\n context?: Record<string, unknown>,\n originalError?: unknown\n): FlexiumErrorInfo {\n const details = getErrorDetails(code)\n return {\n code,\n message: details.message,\n suggestion: details.suggestion,\n context,\n originalError,\n }\n}\n\n/**\n * Format error message for console output\n */\nexport function formatErrorMessage(info: FlexiumErrorInfo): string {\n let message = `[Flexium ${info.code}] ${info.message}`\n\n if (info.context && Object.keys(info.context).length > 0) {\n const contextStr = Object.entries(info.context)\n .map(([key, value]) => `${key}: ${JSON.stringify(value)}`)\n .join(', ')\n message += ` (${contextStr})`\n }\n\n if (info.suggestion) {\n message += `\\n → ${info.suggestion}`\n }\n\n return message\n}\n\n/**\n * Log an error with standardized formatting\n */\nexport function logError(\n code: ErrorCode,\n context?: Record<string, unknown>,\n originalError?: unknown\n): void {\n const info = createErrorInfo(code, context, originalError)\n const message = formatErrorMessage(info)\n\n if (originalError) {\n console.error(message, originalError)\n } else {\n console.error(message)\n }\n}\n\n/**\n * Log a warning with standardized formatting\n */\nexport function logWarning(\n code: ErrorCode,\n context?: Record<string, unknown>\n): void {\n const info = createErrorInfo(code, context)\n const message = formatErrorMessage(info)\n console.warn(message)\n}\n\n/**\n * Create a FlexiumError with standardized information\n */\nexport class FlexiumError extends Error {\n code: ErrorCode\n suggestion?: string\n context?: Record<string, unknown>\n\n constructor(code: ErrorCode, context?: Record<string, unknown>) {\n const details = getErrorDetails(code)\n super(details.message)\n this.name = 'FlexiumError'\n this.code = code\n this.suggestion = details.suggestion\n this.context = context\n }\n\n toString(): string {\n return formatErrorMessage({\n code: this.code,\n message: this.message,\n suggestion: this.suggestion,\n context: this.context,\n })\n }\n}\n","/**\n * Graph.ts\n *\n * Core Graph Data Structures & Algorithms\n * Implements the \"Hardcore\" Doubly Linked List for dependency tracking.\n *\n * This module is purely internal and has NO dependencies on other core modules\n * to avoid circular references.\n */\n\n// ==================================================================================\n// 1. Data Structures\n// ==================================================================================\n\n/**\n * Flags for subscriber state (Optimization: Bitmasking)\n */\nexport const enum SubscriberFlags {\n Running = 1 << 0,\n Notified = 1 << 1,\n Dirty = 1 << 2,\n Stale = 1 << 3,\n Tracking = 1 << 4,\n}\n\n/**\n * Node type identifiers for fast type checking (Performance: Avoid instanceof)\n */\nexport const enum NodeType {\n Signal = 1,\n Computed = 2,\n Effect = 3,\n Resource = 4,\n}\n\n/**\n * Link node connecting a Subscriber (Effect/Computed) to a Dependency (Signal/Computed).\n *\n * ASCII Visualization of the Doubly Linked Graph:\n *\n * [Signal A] <==> [Link 1] <==> [Effect B]\n * ^\n * | (Prev/Next Sub on Signal A)\n * v\n * [Link 2] <==> [Effect C]\n *\n * Each Link serves as a node in TWO lists simultaneously:\n * 1. The Subscriber's list of dependencies (prevDep/nextDep)\n * 2. The Dependency's list of subscribers (prevSub/nextSub)\n */\nexport interface Link {\n dep: IObservable | undefined\n sub: ISubscriber | undefined\n\n // Pointers for Dependency's subscriber list\n prevSub: Link | undefined\n nextSub: Link | undefined\n\n // Pointers for Subscriber's dependency list\n prevDep: Link | undefined\n nextDep: Link | undefined\n}\n\n/**\n * Base interface for subscriber nodes (Effect, Computed)\n */\nexport interface ISubscriber {\n execute(): void\n depsHead: Link | undefined // Head of dependencies list\n flags: SubscriberFlags\n nodeType: NodeType // Fast type checking (Performance optimization)\n}\n\n/**\n * Base interface for observable nodes (Signal, Computed)\n */\nexport interface IObservable {\n subsHead: Link | undefined // Head of subscribers list\n version: number // For epoch-based check\n notify(): void\n nodeType: NodeType // Fast type checking (Performance optimization)\n}\n\n// ==================================================================================\n// 2. Object Pool (Memory Optimization)\n// ==================================================================================\n\n/**\n * Pool for Link objects to eliminate GC pressure.\n */\nexport namespace LinkPool {\n const pool: Link[] = []\n let size = 0\n\n export function alloc(dep: IObservable, sub: ISubscriber): Link {\n if (size > 0) {\n const link = pool[--size]\n link.dep = dep\n link.sub = sub\n link.prevSub = undefined\n link.nextSub = undefined\n link.prevDep = undefined\n link.nextDep = undefined\n return link\n }\n return {\n dep,\n sub,\n prevSub: undefined,\n nextSub: undefined,\n prevDep: undefined,\n nextDep: undefined,\n }\n }\n\n export function free(link: Link): void {\n link.dep = undefined\n link.sub = undefined\n // Clearing pointers is optional for safety but good for debugging leaks\n link.prevSub = undefined\n link.nextSub = undefined\n link.prevDep = undefined\n link.nextDep = undefined\n\n if (size < 10000) { // Safety cap\n pool[size++] = link\n }\n }\n}\n\n// ==================================================================================\n// 3. Graph Operations\n// ==================================================================================\n\n/**\n * Internal Graph operations to manage the \"Hardcore\" Linked List structure.\n * Encapsulates raw pointer arithmetic for readability.\n */\nexport namespace Graph {\n /**\n * Connects a dependency (Signal) to a subscriber (Effect/Computed).\n * Allocates a Link from the pool and stitches it into both lists.\n */\n export function connect(dep: IObservable, sub: ISubscriber): void {\n const link = LinkPool.alloc(dep, sub)\n\n // Add to Subscriber's dependency list (prepend)\n // Performance: Cache depsHead to avoid repeated property access\n const depsHead = sub.depsHead\n link.nextDep = depsHead\n if (depsHead) {\n depsHead.prevDep = link\n }\n sub.depsHead = link\n\n // Add to Dependency's subscriber list (prepend)\n // Performance: Cache subsHead to avoid repeated property access\n const subsHead = dep.subsHead\n link.nextSub = subsHead\n if (subsHead) {\n subsHead.prevSub = link\n }\n dep.subsHead = link\n }\n\n /**\n * Fully disconnects a subscriber from all its dependencies.\n * Walks the 'depsHead' list and unlinks each one.\n */\n export function disconnectDependencies(sub: ISubscriber): void {\n let link = sub.depsHead\n while (link) {\n const dep = link.dep!\n // Performance: Cache nextDep and pointers before modifying link\n const nextDep = link.nextDep\n const prevSub = link.prevSub\n const nextSub = link.nextSub\n\n // Remove link from dependency's subscriber list\n // This is a standard doubly-linked list removal\n // Performance: Branch prediction - middle nodes are more common\n if (prevSub) {\n prevSub.nextSub = nextSub\n } else {\n dep.subsHead = nextSub\n }\n if (nextSub) {\n nextSub.prevSub = prevSub\n }\n\n LinkPool.free(link)\n link = nextDep\n }\n sub.depsHead = undefined\n }\n}\n\n/**\n * Flag helpers for readability\n */\nexport namespace Flags {\n export function has(obj: { flags: number }, flag: SubscriberFlags): boolean {\n return (obj.flags & flag) !== 0\n }\n\n export function add(obj: { flags: number }, flag: SubscriberFlags): void {\n obj.flags |= flag\n }\n\n export function remove(obj: { flags: number }, flag: SubscriberFlags): void {\n obj.flags &= ~flag\n }\n}\n","/**\n * Owner.ts\n *\n * Managing reactive scopes and cleanup contexts.\n */\n\n// ==================================================================================\n// 1. Owner & Scope Management\n// ==================================================================================\n\nexport interface Owner {\n cleanups: (() => void)[]\n context: Record<symbol, unknown> | null\n owner: Owner | null // Parent owner\n}\n\nimport type { ISubscriber } from './graph'\n\n// Global context for dependency tracking\nlet activeEffect: ISubscriber | null = null\n\nexport function getActiveEffect(): ISubscriber | null {\n return activeEffect\n}\n\nexport function setActiveEffect(effect: ISubscriber | null): void {\n activeEffect = effect\n}\n\n/**\n * Execute a function without tracking signal dependencies.\n * Useful when you need to read signals inside an effect without creating dependencies.\n *\n * @param fn - Function to execute without tracking\n * @returns The return value of fn\n */\nexport function untrack<T>(fn: () => T): T {\n const prev = activeEffect\n activeEffect = null\n try {\n return fn()\n } finally {\n activeEffect = prev\n }\n}\n\nlet owner: Owner | null = null\n\n/**\n * Get the current owner (scope)\n * @internal\n */\nexport function getOwner(): Owner | null {\n return owner\n}\n\n/**\n * Set the current owner (scope)\n * @internal\n */\nexport function setOwner(newOwner: Owner | null): void {\n owner = newOwner\n}\n\n/**\n * Creates a disposal scope.\n * The return value of the function is returned, and a dispose function is returned.\n *\n * @param fn - Function to run within a new root scope\n * @returns [return value of fn, dispose function]\n *\n * @example\n * ```tsx\n * const [val, dispose] = root((dispose) => {\n * effect(() => console.log('Inside root'));\n * return 123;\n * });\n * dispose(); // Cleans up all effects created inside\n * ```\n */\nexport function root<T>(fn: (dispose: () => void) => T): T {\n const prevOwner = owner\n const newOwner: Owner = {\n cleanups: [],\n context: prevOwner ? Object.create(prevOwner.context) : null,\n owner: prevOwner,\n }\n\n owner = newOwner\n\n const dispose = () => {\n // Performance: Fast path when no cleanups\n if (newOwner.cleanups.length === 0) return\n \n for (const cleanup of newOwner.cleanups) {\n cleanup()\n }\n newOwner.cleanups = []\n }\n\n try {\n return fn(dispose)\n } finally {\n owner = prevOwner\n }\n}\n\n\n","import { ErrorCodes, logError } from './errors'\nimport {\n Graph,\n\n type Link,\n type ISubscriber,\n SubscriberFlags,\n NodeType\n} from './graph'\nimport {\n Owner,\n getOwner,\n setOwner,\n getActiveEffect,\n setActiveEffect\n} from './owner'\n\nexport class EffectNode implements ISubscriber {\n depsHead: Link | undefined\n cleanups: (() => void)[] = []\n flags = 0 // detached by default, will set flags during execution\n nodeType = NodeType.Effect\n\n private owner: Owner | null = null\n\n constructor(\n public fn: () => void | (() => void),\n public onError?: (error: Error) => void\n ) {\n this.owner = getOwner()\n }\n\n execute(): void {\n // Performance: Inline bit operations for better performance\n if ((this.flags & SubscriberFlags.Running) !== 0) {\n this.flags |= SubscriberFlags.Notified\n return\n }\n\n this.flags |= SubscriberFlags.Running\n\n try {\n this.run()\n } finally {\n // Performance: Inline bit operations\n this.flags &= ~SubscriberFlags.Running\n if ((this.flags & SubscriberFlags.Notified) !== 0) {\n this.flags &= ~SubscriberFlags.Notified\n // Schedule microtask to avoid stack overflow and infinite sync loops\n queueMicrotask(() => this.execute())\n }\n }\n }\n\n private run(): void {\n // Performance: Fast path when no cleanups\n if (this.cleanups.length > 0) {\n // Performance: Run cleanups in reverse order (most recent first)\n // This ensures proper dependency cleanup order and matches React's behavior\n for (let i = this.cleanups.length - 1; i >= 0; i--) {\n this.cleanups[i]()\n }\n this.cleanups = []\n }\n\n // Clean up previous dependencies via Graph helper\n Graph.disconnectDependencies(this)\n\n const prevEffect = getActiveEffect()\n const prevOwner = getOwner()\n setActiveEffect(this)\n setOwner(this.owner)\n\n try {\n const result = this.fn()\n if (typeof result === 'function') {\n this.cleanups.push(result)\n }\n } catch (error) {\n if (this.onError) {\n this.onError(error as Error)\n } else {\n logError(ErrorCodes.EFFECT_EXECUTION_FAILED, undefined, error)\n }\n } finally {\n setActiveEffect(prevEffect)\n setOwner(prevOwner)\n }\n }\n\n dispose(): void {\n // Performance: Run cleanups in reverse order (most recent first)\n // This ensures proper dependency cleanup order\n if (this.cleanups.length > 0) {\n for (let i = this.cleanups.length - 1; i >= 0; i--) {\n this.cleanups[i]()\n }\n this.cleanups = []\n }\n Graph.disconnectDependencies(this)\n }\n}\n\n/**\n * Creates a side effect that runs when dependencies change\n *\n * @param fn - Effect function, can return a cleanup function\n * @param options - Optional error handler\n * @returns Dispose function to stop the effect\n *\n * @example\n * ```ts\n * const [count, setCount] = state(0);\n * \n * effect(() => {\n * console.log(count());\n * });\n * \n * setCount(1); // logs: 1\n * ```\n */\nexport function effect(\n fn: () => void | (() => void),\n options?: { onError?: (error: Error) => void; name?: string }\n): () => void {\n // DevTools hooks integration would go here if needed\n // For now we rely on the devtools hooks in signal.ts or need to export them properly\n // This implementation is sufficient for core logic\n\n const node = new EffectNode(fn, options?.onError)\n node.execute()\n const dispose = () => node.dispose()\n\n const owner = getOwner()\n if (owner) {\n owner.cleanups.push(dispose)\n }\n\n return dispose\n}\n"]}
@@ -1,3 +0,0 @@
1
- 'use strict';var chunkWXEHDEIH_js=require('./chunk-WXEHDEIH.js'),chunk3AWR7IKE_js=require('./chunk-3AWR7IKE.js'),chunkQ7IWDVJ4_js=require('./chunk-Q7IWDVJ4.js'),chunk5236IK5I_js=require('./chunk-5236IK5I.js'),chunkAJT35P3Z_js=require('./chunk-AJT35P3Z.js');var Ne=new Set,xe=new Set(["focus","blur","mouseenter","mouseleave","load","unload","scroll"]),X=new WeakMap;function we(e){let t=e.type.toLowerCase(),n=!xe.has(t),o=e.composedPath?.()||[],r=e.target;if(o.length===0&&r)for(;r;)o.push(r),r=r.parentNode;for(let i of o){let s=i;if(s===document||!s)break;let p=X.get(s);if(p?.has(t)){let l=p.get(t);if(l){try{l(e);}catch(d){chunkAJT35P3Z_js.b(chunkAJT35P3Z_js.a.EVENT_HANDLER_FAILED,{eventType:t},d);}if(e.cancelBubble)return}}if(!n)break}}function Re(e){if(!(typeof document>"u")&&!Ne.has(e)){let t=xe.has(e);document.addEventListener(e,we,{capture:t}),Ne.add(e);}}var re={on(e,t,n){let o=t.toLowerCase(),r=X.get(e);r||(r=new Map,X.set(e,r)),r.set(o,n),Re(o);},off(e,t){let n=t.toLowerCase(),o=X.get(e);o&&o.delete(n);}};var Z={width:{cssProp:"width",transform:"px"},height:{cssProp:"height",transform:"px"},flexDirection:{cssProp:"flexDirection",transform:"none"},justifyContent:{cssProp:"justifyContent",transform:"none"},alignItems:{cssProp:"alignItems",transform:"none"},alignSelf:{cssProp:"alignSelf",transform:"none"},flexWrap:{cssProp:"flexWrap",transform:"none"},flex:{cssProp:"flex",transform:"string"},gap:{cssProp:"gap",transform:"px"},justify:{cssProp:"justifyContent",transform:"none"},align:{cssProp:"alignItems",transform:"none"},bg:{cssProp:"backgroundColor",transform:"none"},color:{cssProp:"color",transform:"none"},borderRadius:{cssProp:"borderRadius",transform:"px"},borderWidth:{cssProp:"borderWidth",transform:"px",sideEffect:(e,t)=>{t!==void 0&&e.borderStyle!=="solid"&&(e.borderStyle="solid");}},borderColor:{cssProp:"borderColor",transform:"none"},opacity:{cssProp:"opacity",transform:"string"},fontSize:{cssProp:"fontSize",transform:"px"},fontWeight:{cssProp:"fontWeight",transform:"string"},fontFamily:{cssProp:"fontFamily",transform:"none"},lineHeight:{cssProp:"lineHeight",transform:"string"},textAlign:{cssProp:"textAlign",transform:"none"},padding:{cssProp:"padding",transform:"px"},paddingTop:{cssProp:"paddingTop",transform:"px"},paddingRight:{cssProp:"paddingRight",transform:"px"},paddingBottom:{cssProp:"paddingBottom",transform:"px"},paddingLeft:{cssProp:"paddingLeft",transform:"px"},margin:{cssProp:"margin",transform:"px"},marginTop:{cssProp:"marginTop",transform:"px"},marginRight:{cssProp:"marginRight",transform:"px"},marginBottom:{cssProp:"marginBottom",transform:"px"},marginLeft:{cssProp:"marginLeft",transform:"px"}},Ce={Row:"div",Column:"div",Stack:"div",Text:"span",Button:"button",Input:"input",Container:"div"},q={onPress:"click",onHover:"mouseenter",onChange:"input",onFocus:"focus",onBlur:"blur"},be=new Set(["children","key","ref","className","style","width","height","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","margin","marginTop","marginRight","marginBottom","marginLeft","gap","flex","flexDirection","flexWrap","justifyContent","alignItems","alignSelf","align","justify","bg","color","borderRadius","borderWidth","borderColor","opacity","fontSize","fontWeight","fontFamily","lineHeight","textAlign"]),_e="http://www.w3.org/2000/svg",Fe=new Set(["svg","path","circle","rect","line","polyline","polygon","ellipse","g","text","tspan","defs","use","symbol","marker","linearGradient","radialGradient","stop","clipPath","pattern","mask","filter"]),Me={viewBox:"viewBox",preserveAspectRatio:"preserveAspectRatio",strokeWidth:"stroke-width",strokeLinecap:"stroke-linecap",strokeLinejoin:"stroke-linejoin",strokeDasharray:"stroke-dasharray",strokeDashoffset:"stroke-dashoffset",fillOpacity:"fill-opacity",strokeOpacity:"stroke-opacity",stopColor:"stop-color",stopOpacity:"stop-opacity",clipPath:"clip-path",markerEnd:"marker-end",markerStart:"marker-start",markerMid:"marker-mid"};function Pe(e){return typeof e=="number"?`${e}px`:e}var ve=new Map;function Se(e){let t=ve.get(e);return t===void 0&&(t=e.replace(/[A-Z]/g,n=>`-${n.toLowerCase()}`),ve.set(e,t)),t}function De(e){return e.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function Ie(e,t){if(e!=null)switch(t){case "px":return Pe(e);case "string":return String(e);case "none":default:return e}}function He(e,t,n){let o=e.style,r=t.style,i=n.style;if(r!==i){if(r&&typeof r=="object")for(let d in r)(!i||!(d in i))&&o.setProperty(Se(d),"");if(i&&typeof i=="object")for(let d in i){let f=i[d];(!r||r[d]!==f)&&o.setProperty(Se(d),f);}}let s=e.getAttribute("data-flexium-type");(n.flexDirection||n.justifyContent||n.alignItems||n.flexWrap||n.gap!==void 0||n.justify||n.align||s==="Row"||s==="Column"||s==="Stack")&&(o.display!=="flex"&&(o.display="flex"),s==="Row"&&o.flexDirection!=="row"&&(o.flexDirection="row"),s==="Column"&&o.flexDirection!=="column"&&(o.flexDirection="column"));let l=o;for(let d in t)if(d in Z&&!(d in n)){let f=Z[d],m=f.cssProp,a=l[m];a!==void 0&&a!==""&&(l[m]=""),f.sideEffect&&f.sideEffect(o,void 0);}for(let d in n)if(d in Z){let f=t[d],m=n[d];if(f===m)continue;let a=Z[d],c=Ie(m,a.transform),u=a.cssProp,N=l[u];c===void 0?N!==void 0&&N!==""&&(l[u]=""):N!==c&&(l[u]=c),a.sideEffect&&a.sideEffect(o,c);}}function Ee(e){if(typeof e=="string")return e;if(Array.isArray(e)){let t="";for(let n=0;n<e.length;n++){let o=e[n];if(!o)continue;let r=typeof o=="string"?o:Ee(o);r&&(t=t?`${t} ${r}`:r);}return t}if(typeof e=="object"&&e!==null){let t="";for(let n in e)e[n]&&(t=t?`${t} ${n}`:n);return t}return ""}var ie=class{createNode(t,n){let o=Ce[t]??t,r;return Fe.has(o)?r=document.createElementNS(_e,o):r=document.createElement(o),Ce[t]&&r.setAttribute("data-flexium-type",t),this.updateNode(r,{},n),r}updateNode(t,n,o){if(o.className!==n.className){let i=Ee(o.className);t instanceof SVGElement?t.setAttribute("class",i):t.className=i;}He(t,n,o);for(let i in n)if(!(i in o)){if(typeof i=="symbol")continue;if(i.startsWith("on")){let s=q[i]||i.slice(2).toLowerCase();this.removeEventListener(t,s,n[i]);}else be.has(i)||t.removeAttribute(i);}let r=Reflect.ownKeys(o);for(let i of r){if(typeof i=="symbol")continue;let s=i,p=o[s],l=n[s];if(p!==l){if(s.startsWith("on")){let d=q[s]||s.slice(2).toLowerCase();l&&this.removeEventListener(t,d,l),p&&this.addEventListener(t,d,p);}else if(!be.has(s))if(p==null||p===false)t.removeAttribute(s);else if(p===true)t.setAttribute(s,"");else {let d=Me[s]||s;t.setAttribute(d,De(String(p)));}}}}appendChild(t,n){t.appendChild(n);}insertBefore(t,n,o){t.insertBefore(n,o);}nextSibling(t){return t.nextSibling}removeChild(t,n){t.removeChild(n);}createTextNode(t){return document.createTextNode(t)}updateTextNode(t,n){t.textContent=n;}addEventListener(t,n,o){let r=q[n]||n;re.on(t,r,o);}removeEventListener(t,n,o){let r=q[n]||n;re.off(t,r);}},C=new ie;var se=Symbol("flexium.list");function de(e){return e!==null&&typeof e=="object"&&se in e&&e[se]===true}function Oe(e,t){return typeof e=="number"?e:e.mode==="fixed"?e.itemHeight:e.estimatedItemHeight}function Be(e,t,n,o,r){let i=o*n;if(o===0)return {startIndex:0,endIndex:-1,totalHeight:0};let s=Math.floor(e/n),p=Math.ceil(t/n),l=s+p;return {startIndex:Math.max(0,s-r),endIndex:Math.min(o-1,l+r),totalHeight:i}}function ce(e,t,n,o){return e.virtual?$e(e,t,n,o):Ve(e,t,n,o)}function Ve(e,t,n,o){let{each:r,renderItem:i,getKey:s,class:p,style:l}=e,d=document.createElement("div");d.setAttribute("role","list"),p&&(d.className=p),l&&Object.entries(l).forEach(([c,u])=>{d.style[c]=typeof u=="number"?`${u}px`:u;}),t.appendChild(d);let f=new Map,m=(c,u)=>s?s(c,u):u,a=chunkAJT35P3Z_js.k(()=>{let c=r()||[],u=new Set;c.forEach((N,h)=>{let x=m(N,h);if(u.add(x),!f.has(x)){let L=new chunk5236IK5I_js.d(h),y=i(N,()=>L.get()),g=n(y);g&&g instanceof HTMLElement&&(g.setAttribute("role","listitem"),d.appendChild(g),f.set(x,{node:g,dispose:()=>{try{o(g);}catch{}}}));}});for(let[N,h]of f)u.has(N)||(h.dispose(),h.node.parentNode===d&&d.removeChild(h.node),f.delete(N));});return ()=>{a();for(let c of f.values())c.dispose();f.clear(),d.parentNode===t&&t.removeChild(d);}}function $e(e,t,n,o){let{each:r,renderItem:i,height:s,width:p,itemSize:l,overscan:d,getKey:f,onScroll:m,onVisibleRangeChange:a}=e;if(!s||!l)return console.warn("List: height and itemSize are required when virtual is true"),()=>{};let c=document.createElement("div");c.style.height=typeof s=="number"?`${s}px`:s,c.style.width=p?typeof p=="number"?`${p}px`:p:"100%",c.style.overflow="auto",c.style.position="relative",c.setAttribute("role","list"),c.setAttribute("tabindex","0");let u=document.createElement("div");u.style.position="relative",u.style.width="100%";let N=new chunk5236IK5I_js.d(0),h=new Map,x=-1,L=-1,y=()=>{N.set(c.scrollTop),m?.(c.scrollTop);};c.addEventListener("scroll",y,{passive:true});let g=(w,M)=>f?f(w,M):M,E=chunkAJT35P3Z_js.k(()=>{let w=r()||[],M=N.get(),j=c.clientHeight||parseFloat(String(s)),P=Oe(l),{startIndex:K,endIndex:z,totalHeight:ke}=Be(M,j,P,w.length,d);u.style.height=`${ke}px`,c.setAttribute("aria-rowcount",String(w.length)),(K!==x||z!==L)&&(a?.(K,z),x=K,L=z);let fe=new Set;for(let v=K;v<=z&&v<w.length;v++){let R=w[v],O=g(R,v);fe.add(O);let I=h.get(O),te=h.get(O)?.state;if(te?te.set(R):te=new chunk5236IK5I_js.d(R),I){I.indexSig.peek()!==v&&I.indexSig.set(v);let B=I.node;B.style.transform=`translateY(${v*P}px)`,B.setAttribute("aria-rowindex",String(v+1));}else {let B=new chunk5236IK5I_js.d(v),Ae=i(R,()=>B.get()),T=n(Ae);T&&T instanceof HTMLElement&&(T.style.position="absolute",T.style.top="0",T.style.left="0",T.style.right="0",T.style.transform=`translateY(${v*P}px)`,T.style.height=`${P}px`,T.style.boxSizing="border-box",T.setAttribute("role","listitem"),T.setAttribute("aria-rowindex",String(v+1)),u.appendChild(T),I={item:R,key:O,node:T,indexSig:B,dispose:()=>{try{o(T);}catch{}}},h.set(O,I));}}for(let[v,R]of h)fe.has(v)||(R.dispose(),R.node.parentNode===u&&u.removeChild(R.node),h.delete(v));});return ()=>{E(),c.removeEventListener("scroll",y);for(let w of h.values())w.dispose();h.clear(),c.parentNode===t&&t.removeChild(c);}}var Te=new WeakMap;function A(e){return Te.get(e)}function D(e,t){Te.set(e,t);}var G;(s=>{let e=[],t=[];function o(){if(e.length>0){let p=e.pop();return p.clear(),p}return new Map}s.getMap=o;function r(){if(t.length>0){let p=t.pop();return p.clear(),p}return new Set}s.getSet=r;function i(p,l){e.length<10&&e.push(p),t.length<10&&t.push(l);}s.release=i;})(G||(G={}));function Y(e,t,n,o){let r=t&&t.length>0,i=n&&n.length>0;if(!r&&!i)return;if(!i){for(let a of t){let c=a&&A(a);c&&(S(c),C.removeChild(e,c));}return}if(!r){let a=document.createDocumentFragment();for(let c of n){let u=b(c,void 0);u&&(D(c,u),a.appendChild(u));}o?e.insertBefore(a,o):e.appendChild(a);return}let s=t.length,p=n.length,l=5;if(s<=l&&p<=l){let a=0,c=0,u=e.firstChild;for(;a<s||c<p;){if(c>=p){for(;a<s;){let y=t[a++],g=y&&A(y);g&&(S(g),C.removeChild(e,g));}break}if(a>=s){let y=document.createDocumentFragment();for(;c<p;){let g=n[c++],E=b(g,void 0);E&&(D(g,E),y.appendChild(E));}o?e.insertBefore(y,o):e.appendChild(y);break}let N=t[a],h=n[c],x=N.key??`__idx_${a}_${N.type}`,L=h.key??`__idx_${c}_${h.type}`;if(x===L&&N.type===h.type)le(N,h),u=u?.nextSibling||null,a++,c++;else {let y=false;for(let g=a+1;g<s;g++){let E=t[g];if((E.key??`__idx_${g}_${E.type}`)===L&&E.type===h.type){for(let M=a;M<g;M++){let j=t[M],P=j&&A(j);P&&(S(P),C.removeChild(e,P));}le(E,h),a=g+1,c++,y=true;break}}if(!y){let g=b(h,void 0);g&&(D(h,g),e.insertBefore(g,u)),c++;}}}return}let d=G.getMap(),f=G.getSet();for(let a=0;a<s;a++){let c=t[a],u=c.key??`__idx_${a}_${c.type}`;d.set(u,c);}let m=e.firstChild;for(let a=0;a<n.length;a++){let c=n[a],u=c.key??`__idx_${a}_${c.type}`;f.add(u);let N=d.get(u),h=m;if(!N||N.type!==c.type){let x=b(c,void 0);x&&(D(c,x),e.insertBefore(x,h));}else {le(N,c);let x=A(c);x&&(m!==x?e.insertBefore(x,h):m=m?.nextSibling||null);}}for(let[a,c]of d){let u=A(c);!f.has(a)&&u&&(S(u),u.parentNode===e&&C.removeChild(e,u));}G.release(d,f);}function le(e,t){let n=A(e);if(!n||(D(t,n),typeof t.type!="string"))return;C.updateNode(n,e.props,t.props);let o=e.children||[],r=t.children||[];if(!(o.length===0&&r.length===0)){if(r.length===1&&(typeof r[0]=="string"||typeof r[0]=="number")&&n.firstChild?.nodeType===Node.TEXT_NODE&&n.childNodes.length===1){let i=String(r[0]);String(o[0])!==i&&C.updateTextNode(n.firstChild,i);return}Y(n,o,r,null);}}var W=new WeakMap,J=new Set,ae=false;function ee(e){J.add(e),ae||(ae=true,requestAnimationFrame(()=>{Ge();}));}function Ge(){if(ae=false,J.size===0)return;let e=Array.from(J);J.clear();for(let t=0;t<e.length;t++)e[t]();}function H(e,t){let n=W.get(e);n||(n=new Set,W.set(e,n)),n.add(t);}function b(e,t){if(e==null||typeof e=="boolean")return null;if(de(e)){let n=t||document.createDocumentFragment(),o=ce(e,n,i=>b(i),S),r=document.createTextNode("");return H(r,o),t?n.firstChild:n}if(chunk3AWR7IKE_js.d(e)){let n=chunk3AWR7IKE_js.e(e);if(n){let o=document.createTextNode(""),r=t||document.createDocumentFragment();C.appendChild(r,o);let i=o,s=chunkAJT35P3Z_js.k(()=>{let p=n.get(),l=o.parentNode;if(l)if((typeof p=="string"||typeof p=="number")&&i&&i.nodeType===Node.TEXT_NODE&&i!==o){let d=i,f=String(p);ee(()=>{C.updateTextNode(d,f);});}else {let d=b(p);if(d)if(i&&i!==o)if(i.parentNode===l)if(i.nodeType===Node.TEXT_NODE&&d.nodeType===Node.TEXT_NODE){let f=i,m=d.textContent||"";ee(()=>{C.updateTextNode(f,m);});}else l.replaceChild(d,i),i=d;else l.insertBefore(d,o.nextSibling),i=d;else l.insertBefore(d,o.nextSibling),i=d;else {if(i&&i!==o&&i.parentNode===l)try{l.removeChild(i);}catch(f){chunkAJT35P3Z_js.b(chunkAJT35P3Z_js.a.DOM_CLEANUP_FAILED,{operation:"removeChild"},f);}i=o;}}});return H(o,s),t?o:r}}if(chunk5236IK5I_js.f(e)||typeof e=="function"){let n=document.createTextNode(""),o=t||document.createDocumentFragment();C.appendChild(o,n);let r=[],i=null,s=[],p=chunkAJT35P3Z_js.k(()=>{let l=chunk5236IK5I_js.f(e)?e.get():e(),d=n.parentNode;if(d){if(Array.isArray(l)){let f=l.filter(m=>m!=null);if(s.length>0){let m=n.nextSibling;Y(d,s,f,m);}else {for(let a of r)if(S(a),a.parentNode===d)try{d.removeChild(a);}catch(c){chunkAJT35P3Z_js.b(chunkAJT35P3Z_js.a.DOM_CLEANUP_FAILED,{operation:"removeChild"},c);}r=[];let m=document.createDocumentFragment();for(let a of f){let c=b(a,m);c&&typeof a=="object"&&D(a,c);}r=Array.from(m.childNodes),d.insertBefore(m,n.nextSibling);}s=f,i=l;return}if(s.length>0){for(let f of s){let m=A(f);if(m&&m.parentNode===d){S(m);try{d.removeChild(m);}catch(a){chunkAJT35P3Z_js.b(chunkAJT35P3Z_js.a.DOM_CLEANUP_FAILED,{operation:"removeChild"},a);}}}s=[];}if(l!==i){for(let f of r)if(S(f),f.parentNode===d)try{d.removeChild(f);}catch(m){chunkAJT35P3Z_js.b(chunkAJT35P3Z_js.a.DOM_CLEANUP_FAILED,{operation:"removeChild"},m);}if(r=[],typeof l=="string"||typeof l=="number"){let f=C.createTextNode(String(l));d.insertBefore(f,n.nextSibling),r=[f];}else {let f=b(l);f&&(f.nodeType===Node.DOCUMENT_FRAGMENT_NODE?(r=Array.from(f.childNodes),d.insertBefore(f,n.nextSibling)):(d.insertBefore(f,n.nextSibling),r=[f]));}i=l;}}});return H(n,p),t?n:o}if(Array.isArray(e)){let n=document.createDocumentFragment();for(let o of e)b(o,n);return t&&C.appendChild(t,n),n}if(typeof e=="string"||typeof e=="number"){let n=C.createTextNode(String(e));return t&&C.appendChild(t,n),n}if(chunkQ7IWDVJ4_js.c(e)){if(typeof e.type=="function"){let i=e.type,s=document.createTextNode(""),p=t||document.createDocumentFragment();C.appendChild(p,s);let l=[],d=[],f=chunk3AWR7IKE_js.b(),m=chunkAJT35P3Z_js.k(()=>{chunk3AWR7IKE_js.c(f),chunkAJT35P3Z_js.i(a=>{chunk5236IK5I_js.g(a);let c=i._contextId;c&&chunkWXEHDEIH_js.c(c,e.props.value);let u;try{chunk3AWR7IKE_js.a(f);let y=e.children!==void 0?{...e.props,children:e.children}:e.props;u=i(y);}finally{chunk3AWR7IKE_js.a(null);}if(Array.isArray(u)&&u.every(y=>chunkQ7IWDVJ4_js.c(y)&&y.type!=="fragment")){let y=s.parentNode;if(y){let g=u;Y(y,d,g,s.nextSibling),d=g,l=g.map(E=>A(E)).filter(E=>E!=null);return}}let x=s.parentNode;if(x){for(let y of l)if(S(y),y.parentNode===x)try{x.removeChild(y);}catch(g){chunkAJT35P3Z_js.b(chunkAJT35P3Z_js.a.DOM_CLEANUP_FAILED,{operation:"removeChild"},g);}}l=[],d=[];let L=document.createDocumentFragment();b(u,L),x&&(l=Array.from(L.childNodes),x.insertBefore(L,s.nextSibling));});});return H(s,m),t?s:p}if(e.type==="fragment"){let i=document.createDocumentFragment();for(let s of e.children)b(s,i);return t&&C.appendChild(t,i),i}let n=C.createNode(e.type,e.props),o=We(n,e.props);o.length>0&&W.set(n,new Set(o));for(let i of e.children)b(i,n);t&&C.appendChild(t,n);let r=e.props.ref;return r&&(typeof r=="function"?(r(n),H(n,()=>{r(null);})):typeof r=="object"&&"current"in r&&(r.current=n,H(n,()=>{r.current=null;}))),n}return null}var Q=Symbol("uninitialized");function We(e,t){let n=[],o=[];for(let r in t){if(r.startsWith("on"))continue;let i=t[r];(chunk5236IK5I_js.f(i)||typeof i=="function")&&o.push([r,i]);}for(let[r,i]of o)if(chunk5236IK5I_js.f(i)){let s=Q,p=chunkAJT35P3Z_js.k(()=>{let l=i.get();if(l!==s){let d=s===Q?void 0:s;ee(()=>{C.updateNode(e,{[r]:d},{[r]:l});}),s=l;}});n.push(p);}else {let s=Q,p=chunkAJT35P3Z_js.k(()=>{try{let l=i();if(l!==s){let d=s===Q?void 0:s;ee(()=>{C.updateNode(e,{[r]:d},{[r]:l});}),s=l;}}catch(l){chunkAJT35P3Z_js.b(chunkAJT35P3Z_js.a.DOM_CLEANUP_FAILED,{operation:"updateNode",prop:r},l);}});n.push(p);}return n}function S(e){let t=W.get(e);if(t&&(t.forEach(n=>n()),W.delete(e)),e.childNodes&&e.childNodes.length>0){let n=Array.from(e.childNodes);for(let o of n)S(o);}}function Le(e){let t=null,n=null,o=null;return {render(r){let i=o===r;!i&&n&&(S(n),e.childNodes.length===1?e.removeChild(n):e.innerHTML="",n=null),t&&(t(),t=null),t=chunkAJT35P3Z_js.k(()=>{!i&&e.firstChild&&(e.childNodes.length===1?e.removeChild(e.firstChild):e.innerHTML=""),n=b(r,e),o=r;});},unmount(){t&&(t(),t=null),S(e),e.childNodes.length===1?e.removeChild(e.firstChild):e.innerHTML="",n=null,o=null;}}}function xt(e,t){return t.innerHTML="",b(e,t)}function Ct(e){return Le(e)}function Et(e){if(typeof document>"u")return null;let t=e.mount||document.body,n=document.createComment("portal"),o=null;return o=b(e.children,t),chunk5236IK5I_js.g(()=>{o&&(S(o),o.parentNode===t&&t.removeChild(o));}),n}
2
- exports.a=ie;exports.b=C;exports.c=se;exports.d=de;exports.e=b;exports.f=Le;exports.g=xt;exports.h=Ct;exports.i=Et;//# sourceMappingURL=chunk-S3EDPCYT.js.map
3
- //# sourceMappingURL=chunk-S3EDPCYT.js.map