@fluixi/dom 1.0.0-alpha.53

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 (195) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +657 -0
  3. package/dist/cdn/dom.cjs +1 -0
  4. package/dist/cdn/dom.d.ts +16 -0
  5. package/dist/cdn/dom.d.ts.map +1 -0
  6. package/dist/cdn/dom.global.js +1 -0
  7. package/dist/cdn/dom.js +15 -0
  8. package/dist/cdn/dom.mjs +1 -0
  9. package/dist/index.cjs +1 -0
  10. package/dist/index.d.ts +38 -0
  11. package/dist/index.d.ts.map +1 -0
  12. package/dist/index.js +39 -0
  13. package/dist/index.mjs +1 -0
  14. package/dist/lib/component/index.cjs +1 -0
  15. package/dist/lib/component/index.d.ts +2 -0
  16. package/dist/lib/component/index.d.ts.map +1 -0
  17. package/dist/lib/component/index.js +1 -0
  18. package/dist/lib/component/index.mjs +1 -0
  19. package/dist/lib/component/modifiers.cjs +1 -0
  20. package/dist/lib/component/modifiers.d.ts +21 -0
  21. package/dist/lib/component/modifiers.d.ts.map +1 -0
  22. package/dist/lib/component/modifiers.js +171 -0
  23. package/dist/lib/component/modifiers.mjs +1 -0
  24. package/dist/lib/dom/delegate.cjs +1 -0
  25. package/dist/lib/dom/delegate.d.ts +17 -0
  26. package/dist/lib/dom/delegate.d.ts.map +1 -0
  27. package/dist/lib/dom/delegate.js +50 -0
  28. package/dist/lib/dom/delegate.mjs +1 -0
  29. package/dist/lib/dom/hydration-state.cjs +1 -0
  30. package/dist/lib/dom/hydration-state.d.ts +45 -0
  31. package/dist/lib/dom/hydration-state.d.ts.map +1 -0
  32. package/dist/lib/dom/hydration-state.js +94 -0
  33. package/dist/lib/dom/hydration-state.mjs +1 -0
  34. package/dist/lib/dom/hydration.cjs +1 -0
  35. package/dist/lib/dom/hydration.d.ts +10 -0
  36. package/dist/lib/dom/hydration.d.ts.map +1 -0
  37. package/dist/lib/dom/hydration.js +143 -0
  38. package/dist/lib/dom/hydration.mjs +1 -0
  39. package/dist/lib/dom/index.cjs +1 -0
  40. package/dist/lib/dom/index.d.ts +9 -0
  41. package/dist/lib/dom/index.d.ts.map +1 -0
  42. package/dist/lib/dom/index.js +12 -0
  43. package/dist/lib/dom/index.mjs +1 -0
  44. package/dist/lib/dom/integration.cjs +1 -0
  45. package/dist/lib/dom/integration.d.ts +16 -0
  46. package/dist/lib/dom/integration.d.ts.map +1 -0
  47. package/dist/lib/dom/integration.js +25 -0
  48. package/dist/lib/dom/integration.mjs +1 -0
  49. package/dist/lib/dom/island.cjs +1 -0
  50. package/dist/lib/dom/island.d.ts +23 -0
  51. package/dist/lib/dom/island.d.ts.map +1 -0
  52. package/dist/lib/dom/island.js +100 -0
  53. package/dist/lib/dom/island.mjs +1 -0
  54. package/dist/lib/dom/runtime.cjs +1 -0
  55. package/dist/lib/dom/runtime.d.ts +131 -0
  56. package/dist/lib/dom/runtime.d.ts.map +1 -0
  57. package/dist/lib/dom/runtime.js +1425 -0
  58. package/dist/lib/dom/runtime.mjs +1 -0
  59. package/dist/lib/dom/server/fx-data.cjs +1 -0
  60. package/dist/lib/dom/server/fx-data.d.ts +36 -0
  61. package/dist/lib/dom/server/fx-data.d.ts.map +1 -0
  62. package/dist/lib/dom/server/fx-data.js +60 -0
  63. package/dist/lib/dom/server/fx-data.mjs +1 -0
  64. package/dist/lib/dom/server/host.cjs +1 -0
  65. package/dist/lib/dom/server/host.d.ts +14 -0
  66. package/dist/lib/dom/server/host.d.ts.map +1 -0
  67. package/dist/lib/dom/server/host.js +38 -0
  68. package/dist/lib/dom/server/host.mjs +1 -0
  69. package/dist/lib/dom/server/index.cjs +1 -0
  70. package/dist/lib/dom/server/index.d.ts +13 -0
  71. package/dist/lib/dom/server/index.d.ts.map +1 -0
  72. package/dist/lib/dom/server/index.js +12 -0
  73. package/dist/lib/dom/server/index.mjs +1 -0
  74. package/dist/lib/dom/server/nodes.cjs +1 -0
  75. package/dist/lib/dom/server/nodes.d.ts +105 -0
  76. package/dist/lib/dom/server/nodes.d.ts.map +1 -0
  77. package/dist/lib/dom/server/nodes.js +304 -0
  78. package/dist/lib/dom/server/nodes.mjs +1 -0
  79. package/dist/lib/dom/server/render.cjs +1 -0
  80. package/dist/lib/dom/server/render.d.ts +45 -0
  81. package/dist/lib/dom/server/render.d.ts.map +1 -0
  82. package/dist/lib/dom/server/render.js +174 -0
  83. package/dist/lib/dom/server/render.mjs +1 -0
  84. package/dist/lib/dom/server/request-context.cjs +1 -0
  85. package/dist/lib/dom/server/request-context.d.ts +85 -0
  86. package/dist/lib/dom/server/request-context.d.ts.map +1 -0
  87. package/dist/lib/dom/server/request-context.js +122 -0
  88. package/dist/lib/dom/server/request-context.mjs +1 -0
  89. package/dist/lib/dom/server/serialize.cjs +1 -0
  90. package/dist/lib/dom/server/serialize.d.ts +2 -0
  91. package/dist/lib/dom/server/serialize.d.ts.map +1 -0
  92. package/dist/lib/dom/server/serialize.js +98 -0
  93. package/dist/lib/dom/server/serialize.mjs +1 -0
  94. package/dist/lib/dom/server-renderer.cjs +1 -0
  95. package/dist/lib/dom/server-renderer.d.ts +2 -0
  96. package/dist/lib/dom/server-renderer.d.ts.map +1 -0
  97. package/dist/lib/dom/server-renderer.js +5 -0
  98. package/dist/lib/dom/server-renderer.mjs +1 -0
  99. package/dist/lib/dom/types.cjs +1 -0
  100. package/dist/lib/dom/types.d.ts +119 -0
  101. package/dist/lib/dom/types.d.ts.map +1 -0
  102. package/dist/lib/dom/types.js +1 -0
  103. package/dist/lib/dom/types.mjs +0 -0
  104. package/dist/lib/dom/utils.cjs +1 -0
  105. package/dist/lib/dom/utils.d.ts +411 -0
  106. package/dist/lib/dom/utils.d.ts.map +1 -0
  107. package/dist/lib/dom/utils.js +746 -0
  108. package/dist/lib/dom/utils.mjs +1 -0
  109. package/dist/lib/element/index.cjs +1 -0
  110. package/dist/lib/element/index.d.ts +2 -0
  111. package/dist/lib/element/index.d.ts.map +1 -0
  112. package/dist/lib/element/index.js +1 -0
  113. package/dist/lib/element/index.mjs +0 -0
  114. package/dist/lib/element/types.cjs +1 -0
  115. package/dist/lib/element/types.d.ts +129 -0
  116. package/dist/lib/element/types.d.ts.map +1 -0
  117. package/dist/lib/element/types.js +5 -0
  118. package/dist/lib/element/types.mjs +0 -0
  119. package/dist/lib/flow/class-map.cjs +1 -0
  120. package/dist/lib/flow/class-map.d.ts +40 -0
  121. package/dist/lib/flow/class-map.d.ts.map +1 -0
  122. package/dist/lib/flow/class-map.js +44 -0
  123. package/dist/lib/flow/class-map.mjs +1 -0
  124. package/dist/lib/flow/dynamic.cjs +1 -0
  125. package/dist/lib/flow/dynamic.d.ts +27 -0
  126. package/dist/lib/flow/dynamic.d.ts.map +1 -0
  127. package/dist/lib/flow/dynamic.js +30 -0
  128. package/dist/lib/flow/dynamic.mjs +1 -0
  129. package/dist/lib/flow/error-boundary.cjs +1 -0
  130. package/dist/lib/flow/error-boundary.d.ts +34 -0
  131. package/dist/lib/flow/error-boundary.d.ts.map +1 -0
  132. package/dist/lib/flow/error-boundary.js +49 -0
  133. package/dist/lib/flow/error-boundary.mjs +1 -0
  134. package/dist/lib/flow/for.cjs +1 -0
  135. package/dist/lib/flow/for.d.ts +64 -0
  136. package/dist/lib/flow/for.d.ts.map +1 -0
  137. package/dist/lib/flow/for.js +28 -0
  138. package/dist/lib/flow/for.mjs +1 -0
  139. package/dist/lib/flow/index-flow.cjs +1 -0
  140. package/dist/lib/flow/index-flow.d.ts +34 -0
  141. package/dist/lib/flow/index-flow.d.ts.map +1 -0
  142. package/dist/lib/flow/index-flow.js +27 -0
  143. package/dist/lib/flow/index-flow.mjs +1 -0
  144. package/dist/lib/flow/index.cjs +1 -0
  145. package/dist/lib/flow/index.d.ts +20 -0
  146. package/dist/lib/flow/index.d.ts.map +1 -0
  147. package/dist/lib/flow/index.js +11 -0
  148. package/dist/lib/flow/index.mjs +1 -0
  149. package/dist/lib/flow/portal.cjs +1 -0
  150. package/dist/lib/flow/portal.d.ts +30 -0
  151. package/dist/lib/flow/portal.d.ts.map +1 -0
  152. package/dist/lib/flow/portal.js +44 -0
  153. package/dist/lib/flow/portal.mjs +1 -0
  154. package/dist/lib/flow/show.cjs +1 -0
  155. package/dist/lib/flow/show.d.ts +35 -0
  156. package/dist/lib/flow/show.d.ts.map +1 -0
  157. package/dist/lib/flow/show.js +162 -0
  158. package/dist/lib/flow/show.mjs +1 -0
  159. package/dist/lib/flow/style-map.cjs +1 -0
  160. package/dist/lib/flow/style-map.d.ts +49 -0
  161. package/dist/lib/flow/style-map.d.ts.map +1 -0
  162. package/dist/lib/flow/style-map.js +58 -0
  163. package/dist/lib/flow/style-map.mjs +1 -0
  164. package/dist/lib/flow/switch.cjs +1 -0
  165. package/dist/lib/flow/switch.d.ts +63 -0
  166. package/dist/lib/flow/switch.d.ts.map +1 -0
  167. package/dist/lib/flow/switch.js +69 -0
  168. package/dist/lib/flow/switch.mjs +1 -0
  169. package/dist/lib/flow/utils.cjs +1 -0
  170. package/dist/lib/flow/utils.d.ts +19 -0
  171. package/dist/lib/flow/utils.d.ts.map +1 -0
  172. package/dist/lib/flow/utils.js +34 -0
  173. package/dist/lib/flow/utils.mjs +1 -0
  174. package/dist/lib/index.cjs +1 -0
  175. package/dist/lib/index.d.ts +21 -0
  176. package/dist/lib/index.d.ts.map +1 -0
  177. package/dist/lib/index.js +30 -0
  178. package/dist/lib/index.mjs +1 -0
  179. package/dist/lib/jsx/control-flow/flow.cjs +1 -0
  180. package/dist/lib/jsx/control-flow/flow.d.ts +2 -0
  181. package/dist/lib/jsx/control-flow/flow.d.ts.map +1 -0
  182. package/dist/lib/jsx/control-flow/flow.js +627 -0
  183. package/dist/lib/jsx/control-flow/flow.mjs +0 -0
  184. package/dist/lib/jsx/control-flow/for-flow.cjs +1 -0
  185. package/dist/lib/jsx/control-flow/for-flow.d.ts +2 -0
  186. package/dist/lib/jsx/control-flow/for-flow.d.ts.map +1 -0
  187. package/dist/lib/jsx/control-flow/for-flow.js +1 -0
  188. package/dist/lib/jsx/control-flow/for-flow.mjs +0 -0
  189. package/dist/lib/shared/types.cjs +1 -0
  190. package/dist/lib/shared/types.d.ts +47 -0
  191. package/dist/lib/shared/types.d.ts.map +1 -0
  192. package/dist/lib/shared/types.js +1 -0
  193. package/dist/lib/shared/types.mjs +0 -0
  194. package/dist/tsconfig.lib.tsbuildinfo +1 -0
  195. package/package.json +99 -0
package/dist/index.mjs ADDED
@@ -0,0 +1 @@
1
+ function Xn(e){return e.startsWith("aria-")||e.startsWith("data-")?e:/[A-Z]/.test(e)?e.replace(/([A-Z])/g,"-$1").toLowerCase():e}function Jn(e){return e.startsWith("@")||e.startsWith("on")&&e.length>2}function Yn(e){return e.startsWith("@")?e.slice(1):e.startsWith("on")?e.slice(2).toLowerCase():e}function Zn(e,t){let n=new Set(["checked","value","selected","disabled","readonly","required","multiple","open","contenteditable","draggable","spellcheck"]),r={input:new Set(["value","checked","indeterminate"]),textarea:new Set(["value"]),select:new Set(["value"]),option:new Set(["selected","value"]),audio:new Set(["volume","currentTime","paused"]),video:new Set(["volume","currentTime","paused"]),img:new Set(["src","srcset"]),iframe:new Set(["src"]),a:new Set(["href"])};return n.has(t)||r[e]&&r[e].has(t)}var Qn=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),er=new Set(["svg","g","path","circle","rect","line","polyline","polygon","ellipse","text","tspan","use","defs","symbol","mask","clipPath","pattern","linearGradient","radialGradient","stop","filter","feGaussianBlur","feOffset","feMerge","feMergeNode","foreignObject"]),ie="http://www.w3.org/2000/svg";function Lt(e){return e.localName.includes("-")}function se(e,t,n,r=!1){if(n==null){e.removeAttribute(t);return}if(Lt(e)){e[t]=n;return}h(e,t,n,r)}var ae=new Set(["className","value","checked","selected","innerHTML","innerText","textContent","indeterminate","htmlFor"]);function je(e,t=document){return t.querySelector(e)}function tr(e,t=document){return Array.from(t.querySelectorAll(e))}function nr(e,t){return e.closest(t)}function Fe(e,...t){e.classList.add(...t)}function He(e,...t){e.classList.remove(...t)}function Ve(e,...t){t.forEach(n=>e.classList.toggle(n))}function rr(e,t){return e.classList.contains(t)}function h(e,t,n,r=!1){if(n==null||n===!1){e.removeAttribute(t);return}if(n===!0){e.setAttribute(t,"");return}if(typeof n=="object"){e.setAttribute(t,JSON.stringify(n));return}e.setAttribute(t,String(n))}function Ue(e,t){return e.getAttribute(t)}function We(e,t){e.removeAttribute(t)}function le(e,t){Object.assign(e.style,t)}function or(e,t){return window.getComputedStyle(e).getPropertyValue(t)}function Ke(e,t={},...n){let r=document.createElement(e);return Object.entries(t).forEach(([o,i])=>{if(o==="class"||o==="className")r.className=i;else if(o==="style"&&typeof i=="object")le(r,i);else if(o.startsWith("on")&&typeof i=="function"){let s=o.slice(2).toLowerCase();r.addEventListener(s,i)}else h(r,o,i)}),n.forEach(o=>{typeof o=="string"?r.appendChild(document.createTextNode(o)):r.appendChild(o)}),r}function ze(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function Be(e,...t){t.forEach(n=>{typeof n=="string"?e.appendChild(document.createTextNode(n)):e.appendChild(n)})}function ir(e){let t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=window.innerHeight&&t.right<=window.innerWidth}function sr(e,t={behavior:"smooth",block:"nearest"}){e.scrollIntoView(t)}function ar(e){let t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset,left:t.left+window.pageXOffset}}function lr(e,t,n,r){let o=i=>{let s=i.target.closest(n);s&&e.contains(s)&&r(i,s)};return e.addEventListener(t,o),()=>{e.removeEventListener(t,o)}}function cr(e,t=5e3){return new Promise((n,r)=>{let o=je(e);if(o){n(o);return}let i=new MutationObserver(()=>{let a=je(e);a&&(i.disconnect(),clearTimeout(s),n(a))});i.observe(document.body,{childList:!0,subtree:!0});let s=setTimeout(()=>{i.disconnect(),r(new Error(`Element ${e} not found within ${t}ms`))},t)})}function ur(e,t,n={}){let r=new IntersectionObserver(o=>{o.forEach(i=>{t(i.isIntersecting)})},n);return r.observe(e),()=>{r.disconnect()}}function fr(e,t){let n=new ResizeObserver(r=>{r.forEach(t)});return n.observe(e),()=>{n.disconnect()}}var Dt=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;function dr(e){return typeof e=="object"&&e!==null&&e.$$typeof===Dt}function _t(e){return e&&typeof e=="object"&&e.strings&&Array.isArray(e.strings)&&e.values&&Array.isArray(e.values)}function pr(e){if(typeof e!="function")return!1;try{let t=e();return _t(t)}catch{return!1}}function yr(e){return typeof e=="object"&&e!==null&&(e.$$typeof==="template"||typeof e.type=="function")}function mr(e){return e instanceof Node}function gr(e,t,n="Fluixi"){typeof globalThis<"u"&&(typeof globalThis[n]>"u"&&(globalThis[n]={}),typeof globalThis[n][e]>"u"&&(globalThis[n][e]=t))}function hr(e,t,n="Fluixi"){return typeof globalThis<"u"&&typeof globalThis[n]<"u"&&typeof globalThis[n][e]<"u"?globalThis[n][e]:t}import{isSignal as m}from"@fluixi/reactive/signal";function br(e){return Object.defineProperty(e,Symbol.for("fluixi-router"),{value:!0,enumerable:!0}),e}function Tr(e){return Object.defineProperty(e,Symbol.for("fluixi-routes"),{value:!0,enumerable:!0}),e}function Nr(e){return Object.defineProperty(e,Symbol.for("fluixi-route"),{value:!0,enumerable:!0}),e}function Er(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-outlet"),{value:!0,enumerable:!0}),e}function Sr(e){return Object.defineProperty(e,Symbol.for("fluixi-provider"),{value:!0,enumerable:!0}),e}function vr(e){return Object.defineProperty(e,Symbol.for("fluixi-context"),{value:!0,enumerable:!0}),e}function wr(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-component"),{value:!0,enumerable:!0}),e}function Ar(e){return Object.defineProperty(e,Symbol.for("fluixi-suspense"),{value:!0,enumerable:!0}),e}function kt(e){return typeof e=="function"&&e[Symbol.for("fluixi-router")]===!0}function $t(e){return typeof e=="function"&&e[Symbol.for("fluixi-routes")]===!0}function Ot(e){return typeof e=="function"&&e[Symbol.for("fluixi-route")]===!0}function It(e){return typeof e=="function"&&e[Symbol.for("fluixi-outlet")]===!0}function qt(e){return typeof e=="function"&&e[Symbol.for("fluixi-provider")]===!0}function jt(e){return typeof e=="function"&&e[Symbol.for("fluixi-context")]===!0}function x(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}function Ft(e){return typeof e=="function"&&e[Symbol.for("fluixi-suspense")]===!0}function Cr(e){return kt(e)?{type:"router",value:e}:Ot(e)?{type:"route",value:e}:$t(e)?{type:"routes",value:e}:It(e)?{type:"outlet",value:e}:x(e)?{type:"component",value:e}:Ft(e)?{type:"suspense",value:e}:qt(e)?{type:"provider",value:e}:jt(e)?{type:"context",value:e}:{type:"none",value:e}}import{batch as Ze,createEffect as D,createRenderEffect as E,createRoot as Wt,onCleanup as R,readChildren as Kt}from"@fluixi/reactive/signal";var g=typeof document>"u";function P(e){g=e}var $=Symbol.for("fluixi.server-node"),ce=null;function Ge(e){ce=e}function ue(){if(!ce)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return ce}function L(e){return e!=null&&e[$]===!0?!0:typeof Node<"u"&&e instanceof Node}function fe(e){return e!=null&&e[$]===!0?e.nodeType===1:typeof Element<"u"&&e instanceof Element}function de(e){return e!=null&&e[$]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var u={active:!1,cursor:null,parents:[]},Xe=null;function Je(e){Xe=e}function pe(){return Xe}function ye(e,t){return u.active&&t.parentNode===e}function me(e){let t=u.parents.lastIndexOf(e);t!==-1&&(u.parents.length=t),u.cursor=e.nextSibling}function Ht(){return u.active?u.cursor:null}function Vt(e,t){if(!e||e.parentNode==null)return t();let n=u.active,r=u.cursor,o=u.parents;u.active=!0,u.cursor=e,u.parents=[];try{return t()}finally{u.active=n,u.cursor=r,u.parents=o}}function Ut(e){if(!u.active)return e();let t=u.cursor,n=u.parents;u.active=!1,u.parents=[];try{return e()}finally{u.active=!0,u.cursor=t,u.parents=n}}function O(e){if(!u.active||e==null)return;let t=Array.isArray(e)?e[e.length-1]:e;t&&typeof t.nodeType=="number"&&me(t)}function zt(e){let t=[];for(;e&&e.nodeType===1;){let n=e.tagName.toLowerCase();if(e.id){n+=`#${e.id}`,t.unshift(n);break}e.getAttribute("data-id")&&(n+=`[data-id="${e.getAttribute("data-id")}"]`);let r=0,o=e;for(;o=o.previousElementSibling;)o.tagName===e.tagName&&r++;n+=`:nth-of-type(${r+1})`,t.unshift(n),e=e.parentElement}return t.join(">")}function Bt(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return`el_${Math.abs(t)}`}function qr(e){return Bt(zt(e))}var jr=()=>"xxyxxxxxxy-4xx8".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)}),Gt={};var Ye=new Map,z=new Set,X=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);function J(e){if(!g)for(let t of e)z.has(t)||X.has(t)||(z.add(t),document.addEventListener(t,Xt))}function Xt(e){let t=`$$${e.type}`,n=e.composedPath&&e.composedPath()[0]||e.target;for(;n;){let r=n[t];if(r&&!n.disabled&&(r(e),e.cancelBubble))return;n=n.host&&n.host!==n&&n.host instanceof Element?n.host:n.parentNode}}function xe(e,t,n){if(e[`$$${t}`]=n,X.has(t)){let r=`__fx_${t}`;if(!e[r]){let o=i=>{e[`$$${t}`]?.(i)};e.addEventListener(t,o),e[r]=o}return}z.has(t)||J([t])}function B(e,t){delete e[`$$${t}`];let n=`__fx_${t}`,r=e[n];r&&(e.removeEventListener(t,r),delete e[n])}function Fr(e){return!X.has(e)}function Hr(e){return typeof e=="function"}function w(e){if(g)return ue().createText(e);if(u.active){let t=pe()?.hydrateText(e);if(t)return t}return document.createTextNode(e)}function Y(e,t=!1){if(g)return ue().createElement(e,t);if(u.active){let n=pe()?.hydrateElement(e);if(n)return n}return t?document.createElementNS(ie,e):document.createElement(e)}function Qe(e,t=!1){let n=Ye.get(e);if(n)return n;let r=document.createElement("template");return t?r.innerHTML=`<svg>${e}</svg>`:r.innerHTML=e,Ye.set(e,r),r}function et(e,t=!1){let n=e.content.cloneNode(!0);return t?n.firstChild:n}function Jt(e){return Array.isArray(e)?e.length===2&&e[1]===" "?Array.isArray(e[0])?Jt(e[0]):(typeof e[0]=="function",e[0]):e.length===1&&typeof e[0]=="function"?e[0]:e:e}function Vr(e){return typeof e!="function"?null:e._name||e.name||"anonymous"}function Ur(e){if(m(e)||x(e)||typeof e!="function")return e;let t=e();for(;typeof t=="function"&&!m(t)&&!x(t);)t=t();return t}var N=0,Yt=200;function Zt(e,t,n,r,o){let i=r,s=new Map;return E(()=>{let a;if(x(e)&&!m(e)){if(!s.has(e)){N++;try{let l=e();s.set(e,l)}finally{N--}}for(a=s.get(e);typeof a=="function"&&m(a);)a=a()}else for(a=e();typeof a=="function"&&m(a);)a=a();{let l=0;for(;typeof a=="function"&&l++<50;)if(x(a)){if(!s.has(a)){let c=a;N++;try{let f=c();s.set(c,f)}finally{N--}}a=s.get(a)}else if(m(a))a=a();else if(a=a(),typeof a!="function"||!m(a)&&!x(a))break}N++;try{i=I(t,a,n,i,s),o(i)}finally{N--}})}function S(e,t,n,r){if(N>Yt)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;n!==void 0&&!n&&(n=w(""),e.appendChild(n));let o=r??null;if(typeof t!="function"){N++;try{o=I(e,t,n,null)}finally{N--}return()=>o}let i=Zt(t,e,n,o,s=>{o=s});return()=>(i?.(),o)}function I(e,t,n,r,o){if(t==null||typeof t=="boolean")return C(e,r,n);if(typeof t=="function")for(;typeof t=="function";)t=t();if(t==null||typeof t=="boolean")return C(e,r,n);if(K(t)){let s=w("");return Array.isArray(r)?r.length>0?(e.replaceChild(s,r[0]),C(e,r.slice(1),n)):y(e,s,n):r?e.replaceChild(s,r):y(e,s,n),t.then(a=>{s.parentNode===e&&I(e,a,s.nextSibling,s)}).catch(a=>{console.error("Error resolving promise in insertExpression:",a)}),s}let i=typeof t;if(i==="string"||i==="number"){if(i==="number"&&(t=String(t)),Array.isArray(r)){if(r.length===0){let a=w(t);return y(e,a,n),a}if(r.length===1&&r[0].nodeType===3)return r[0].data=t,r;r=C(e,r,n)}if(r&&de(r))return r.data=t,r;let s=w(t);return r&&r.parentNode===e?e.replaceChild(s,r):ye(e,s)||y(e,s,n),s}if(L(t))return ye(e,t)?(me(t),t):Array.isArray(r)?(r.length===0?y(e,t,n):r[0].parentNode===e?(e.replaceChild(t,r[0]),C(e,r.slice(1),n)):y(e,t,n),t):(r?r!==t&&(r.parentNode===e?e.replaceChild(t,r):y(e,t,n)):y(e,t,n),t);if(Array.isArray(t)){let s=[],a=Array.isArray(r)?r:r?[r]:[],l=[];T(t,s,e,n,!0,o,l);let c=Qt(e,a,s,n);for(let f of l){let d=S(e,f.sig,f.marker);R(()=>{C(e,d()),f.marker.parentNode===e&&e.removeChild(f.marker)})}return c}if(i==="object"&&t!==null&&typeof t=="object"){let s=t;if("_$litType$"in s||"_$litDirective$"in s)return I(e,ot(t),n,r);if("type"in s&&"props"in s){let a=s;if(typeof a.type=="function"){let l=a.type(a.props||{});return I(e,l,n,r)}}}return C(e,r,n)}function T(e,t,n,r,o=!0,i,s){for(let a=0;a<e.length;a++){let l=e[a];if(!(l==null||typeof l=="boolean")){for(;typeof l=="function"&&!K(l)&&!m(l)&&!x(l)&&(l=l(),!(l==null||typeof l=="boolean")););if(!(l==null||typeof l=="boolean")){if(typeof l=="function"){let c;for(x(l)&&!m(l)?(i||(i=new Map),i.has(l)||i.set(l,l()),c=i.get(l)):c=l();typeof c=="function"&&!K(c)&&!m(c)&&!x(c);)i||(i=new Map),i.has(c)||i.set(c,c()),c=i.get(c);if(c==null||typeof c=="boolean")continue;if(typeof c=="function"){if(m(c)){if(s){let d=w("");t.push(d),s.push({marker:d,sig:c});continue}let f=c();for(;typeof f=="function"&&m(f);)f=f();if(f==null||typeof f=="boolean")continue;Array.isArray(f)?T(f,t,n,r,o,i):T([f],t,n,r,o,i);continue}continue}Array.isArray(c)?T(c,t,n,r,o,i,s):T([c],t,n,r,o,i,s);continue}if(K(l)){let c=w("");t.push(c),l.then(f=>{if(c.parentNode){let d=[];if(T([f],d,c.parentNode,void 0,!1,i),d.length>0){c.parentNode.replaceChild(d[0],c);for(let p=1;p<d.length;p++)c.parentNode?.insertBefore(d[p],d[p-1].nextSibling)}}}).catch(f=>console.error("Error resolving promise in array:",f));continue}if(Array.isArray(l)){T(l,t,n,r,o,i,s);continue}if(L(l)){t.push(l);continue}if(typeof l=="object"&&l!==null&&("_$litType$"in l||"_$litDirective$"in l)){let c=ot(l);for(let f of c)t.push(f);continue}if(typeof l=="object"&&l!==null&&"type"in l&&"props"in l){let c=l;if(typeof c.type=="function"){let f=c.type(c.props||{});Array.isArray(f)?T(f,t,n,r,!1,i):T([f],t,n,r,!1,i);continue}}if(typeof l=="string"||typeof l=="number"){let c=String(l);if(c.trim()===""&&c!==" ")continue;t.push(w(c));continue}t.push(w(String(l)))}}}}function Qt(e,t,n,r){for(let d=0;d<n.length;d++)n[d].parentNode!==null&&n[d].parentNode!==e&&(n=n.slice(),n[d]=n[d].cloneNode(!0));let o=n.length,i=t.length,s=o,a=0,l=0,c=i>0?t[i-1].nextSibling??void 0:r,f=null;for(;a<i||l<s;){if(t[a]===n[l]){a++,l++;continue}for(;i>a&&s>l&&t[i-1]===n[s-1];)i--,s--;if(i===a){let d=s<o?l?n[l-1].nextSibling??void 0:n[s-l]:c;for(;l<s;)y(e,n[l++],d)}else if(s===l)for(;a<i;)(!f||!f.has(t[a]))&&t[a].parentNode===e&&e.removeChild(t[a]),a++;else if(t[a]===n[s-1]&&n[l]===t[i-1]){let d=t[--i].nextSibling;y(e,n[l++],t[a++].nextSibling),y(e,n[--s],d),t[i]=t[a-1]}else{if(!f){f=new Map;let p=l;for(;p<s;)f.set(n[p],p++)}let d=f.get(t[a]);if(d!=null)if(l<d&&d<s){let p=a,oe=1;for(;++p<i&&p<s&&!(!f.has(t[p])||f.get(t[p])!==d+oe);)oe++;if(oe>d-l){let Pt=t[a];for(;l<d;)y(e,n[l++],Pt)}else t[a].parentNode===e?e.replaceChild(n[l++],t[a++]):(y(e,n[l++],c),a++)}else a++;else t[a].parentNode===e&&e.removeChild(t[a]),a++}}return n}function C(e,t,n){if(t)if(Array.isArray(t))for(let r=0;r<t.length;r++)t[r].parentNode===e&&e.removeChild(t[r]);else t.parentNode===e&&e.removeChild(t);return null}function y(e,t,n){u.active&&t.parentNode===e||(n&&n.parentNode===e?e.insertBefore(t,n):e.appendChild(t))}function q(e,t,n){n==null?delete e[t]:e[t]=n}function be(e,t,n,r=!1){return typeof n!="function"?(h(e,t,n,r),()=>{}):E(()=>{let o=typeof n=="function"?n():n;h(e,t,o,r)})}function Te(e,t,n){return typeof n!="function"?(q(e,t,n),()=>{}):E(()=>{let r=typeof n=="function"?n():n;q(e,t,r)})}function _(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){D(()=>{_(e,t())});return}if(typeof t=="string"){e.setAttribute("class",t);return}if(Array.isArray(t)){e.setAttribute("class",t.filter(Boolean).join(" "));return}if(typeof t=="object"){let n=Object.keys(t).filter(r=>{let o=t[r];return typeof o=="function"?o():!!o}).join(" ");e.setAttribute("class",n);return}e.setAttribute("class",String(t))}function G(e,t,n){if(!(!t||typeof t!="object"))for(let r in t){let o=t[r],i=r.split(/\s+/).filter(Boolean);if(typeof o=="function"&&n)n.push(E(()=>{let s=!!o();for(let a of i)e.classList.toggle(a,s)}));else{let s=!!(typeof o=="function"?o():o);for(let a of i)e.classList.toggle(a,s)}}}function ge(e,t){let n=t;for(;typeof n=="function";)n=n();if(n==null){e.removeAttribute("style");return}if(typeof n=="string"){e.style.cssText=n;return}if(typeof n=="object")for(let r in n){let o=n[r];o==null?e.style[r]="":e.style[r]=o}}function tt(e){let{element:t,props:n,prevProps:r=Gt,isSVG:o=!1,skipChildren:i=!1}=e;if(!t||!fe(t))return console.error("[spread] Error: element is not a DOM Element!"),()=>{};if(!n)return console.warn("[spread] Warning: props is undefined!"),()=>{};let s=o||t.namespaceURI===ie,a=[];for(let l in n){if(i&&l==="children")continue;let c=n[l],f=r[l];if(c!==f){if(l==="ref"){k(c,t);continue}if(l==="class"||l==="className"){typeof c=="function"?a.push(E(()=>_(t,c()))):_(t,c);continue}if(l==="classList"){typeof c=="function"?a.push(E(()=>G(t,c()))):G(t,c,a);continue}if(l==="style"){typeof c=="function"?a.push(E(()=>ge(t,c()))):ge(t,c);continue}if(l.startsWith("on")){let d=l.slice(2).toLowerCase();f&&B(t,d),c&&xe(t,d,c);continue}ae.has(l)||!s&&l in t?a.push(Te(t,l,c)):a.push(be(t,l,c,s))}}for(let l in r)if(!(l in n))if(l.startsWith("on")){let c=l.slice(2).toLowerCase();B(t,c)}else ae.has(l)?q(t,l,null):t.removeAttribute(l);return()=>{a.forEach(l=>l())}}function nt(e,t,n=!1){for(let r in t){let o=t[r];if(r==="ref"){k(o,e);continue}if(r!=="children"){if(r.startsWith("on")&&r.length>2){let i=r.slice(2).toLowerCase();if(typeof o=="function")if(X.has(i)){e[`$$${i}`]=o;let s=`__fx_${i}`;if(!e[s]){let a=l=>{e[`$$${i}`]?.(l)};e.addEventListener(i,a),e[s]=a}}else e[`$$${i}`]=o,z.has(i)||J([i]);continue}if(r==="class"||r==="className"){_(e,o);continue}if(r==="classList"){typeof o=="function"?E(()=>G(e,o())):G(e,o);continue}if(r==="style"){ge(e,o);continue}if(r==="innerHTML"){if(typeof o=="function"){let i=D(()=>{let s=o();for(;typeof s=="function";)s=s();e.innerHTML=s});R(()=>i())}else e.innerHTML=o;continue}if(r==="value"&&(e.tagName==="INPUT"||e.tagName==="TEXTAREA")){if(typeof o=="function"){let i=D(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.value=s??"")});R(()=>{i()})}else e.value=o??"";continue}if(r==="checked"&&e.tagName==="INPUT"){if(typeof o=="function"){let i=D(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.checked=s??"")});R(()=>{i()})}else e.checked=o??"";continue}if(r==="value"&&e.tagName==="SELECT"){if(typeof o=="function"){let i=!0,s=D(()=>{let a=o();for(;typeof a=="function"&&a.length===0;)a=a();i?(i=!1,queueMicrotask(()=>{e.value=a??""})):e.value=a??""});R(()=>{s()})}else queueMicrotask(()=>{e.value=o??""});continue}if(typeof o=="function"){let i=D(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();se(e,r,s,n)});R(()=>{i()})}else se(e,r,o,n)}}}function rt(...e){let t=r=>{for(let o=e.length-1;o>=0;o--){let i=e[o];if(i&&r in i&&i[r]!==void 0)return i[r]}},n=r=>{for(let o of e)if(o&&r in o)return!0;return!1};return new Proxy({},{get:(r,o)=>t(o),has:(r,o)=>n(o),ownKeys:()=>{let r=new Set;for(let o of e)if(o)for(let i of Reflect.ownKeys(o))r.add(i);return[...r]},getOwnPropertyDescriptor:(r,o)=>n(o)?{enumerable:!0,configurable:!0,get:()=>t(o)}:void 0})}function Wr(e,...t){let n=new Set;for(let s of t)for(let a of s)n.add(a);let r=s=>({enumerable:!0,configurable:!0,get:()=>e[s]}),o=t.map(s=>{let a=new Set(s);return new Proxy({},{get:(l,c)=>a.has(c)?e[c]:void 0,has:(l,c)=>a.has(c)&&c in e,ownKeys:()=>Array.from(a).filter(l=>l in e),getOwnPropertyDescriptor:(l,c)=>a.has(c)&&c in e?r(c):void 0})}),i=new Proxy({},{get:(s,a)=>n.has(a)?void 0:e[a],has:(s,a)=>!n.has(a)&&a in e,ownKeys:()=>Reflect.ownKeys(e).filter(s=>!n.has(s)),getOwnPropertyDescriptor:(s,a)=>!n.has(a)&&a in e?r(a):void 0});return[...o,i]}function k(e,t){if(e){if(L(e)){let n=t,r=e;if(!n)return;typeof n=="function"?n(r):typeof n=="object"&&"current"in n&&(n.current=r);return}typeof e=="function"?e(t):typeof e=="object"&&"current"in e&&(e.current=t)}}var he=null;function Kr(e){he=e}function ot(e){let t=[];if(!he)return console.warn("Lit render not registered. Call registerLitRender first."),t;try{let n=document.createElement("div");for(he(e,n);n.firstChild;)t.push(n.firstChild),n.removeChild(n.firstChild)}catch(n){console.warn("Could not render Lit template:",n)}return t}function it(e,t,n){let r=t||document.body,o=Kt(()=>e),i=[];return Ze(()=>{let s=E(()=>{let a=o();Array.isArray(a)?(a.forEach(l=>r.appendChild(l)),i.push(()=>{a.forEach(l=>{l.parentNode===r&&r.removeChild(l)})})):L(a)&&(r.appendChild(a),i.push(()=>{a.parentNode===r&&r.removeChild(a)}))});i.push(s),R(()=>{i.forEach(a=>a())})}),null}function zr(e){return typeof e=="string"&&e.toLowerCase()===e}function Br(e){return e==="svg"||e==="path"||e==="circle"||e==="rect"||e==="line"||e==="polygon"||e==="polyline"||e==="ellipse"||e==="g"||e==="defs"||e==="clipPath"||e==="text"}function Gr(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function K(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}function Xr(e){return typeof e=="function"&&e.length===0&&m(e)}function Z(e,t,n){if(!t)throw new Error("Container element is required");let r,o,i=[];return Wt(s=>{Ze(()=>{u.active||(t.textContent=""),S(t,e)}),o=s}),()=>{o?.(),r?.(),i.forEach(s=>s()),t.textContent=""}}var en="__fx_dom_create_component__",M=globalThis[en]??={fn:null};function Yr(e){M.fn=e}function Zr(e={}){let t=e.signalSystem?.createComponent;t&&(M.fn=t)}function st(e,t){return M.fn?M.fn(e,t):(()=>e(t))}var Qr=()=>M.fn!==null,at=()=>M.fn!==null;function lt(){M.fn=null}var Q,ut={getStore:()=>Q,run(e,t){let n=Q;Q=e;try{return t()}finally{Q=n}}},Ne=ut;function ft(e){Ne=e??ut}function j(e={}){e.locals||(e.locals=e.request?Se(e.request):{});let t=0,n=0,r=null,o=new Map,i=new Map;return{event:e,routeData:new Map,matchedRoute:new Map,nextId:()=>`s${t++}`,nextResourceId:()=>{if(r===null)return`r${n++}`;let s=o.get(r)??0;return o.set(r,s+1),`${r}:r${s}`},nextIslandNamespace:s=>{let a=i.get(s)??0;return i.set(s,a+1),`${s}#${a}`},withResourceScope(s,a){let l=r;r=s;try{return a()}finally{r=l}},pending:new Set,data:new Map}}function F(e,t){return Ne.run(e,t)}function v(){return Ne.getStore()}function Ee(){return v()?.event}function dt(){let e=Ee();return e?(e.locals||(e.locals={}),e.locals):{}}var ct=new WeakMap;function Se(e){let t=ct.get(e);return t||(t={},ct.set(e,t)),t}import{setResourceIdSource as tn,setServerDataGetter as nn}from"@fluixi/reactive/signal";var H="__FX_DATA__";function ee(e){return e.replace(/[<>&\u2028\u2029]/g,t=>"\\u"+t.charCodeAt(0).toString(16).padStart(4,"0"))}var ve;function te(){let e=globalThis.__FX_DATA__;if(e)return e;if(ve!==void 0)return ve;let t=null;if(typeof document<"u"){let n=document.getElementById(H)?.textContent;if(n)try{t=JSON.parse(n)}catch{t=null}}return ve=t}function we(){for(;;){for(;u.cursor&&u.cursor.nodeType===3&&u.cursor.data==="";)u.cursor=u.cursor.nextSibling;if(u.cursor!=null||!u.parents.length)return;u.cursor=u.parents.pop().nextSibling}}var rn=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Ae=typeof process<"u"&&process.env&&!1;function Ce(e,t){let n=t.nodeType===1?`<${t.tagName.toLowerCase()}>`:t.nodeType===3?`text ${JSON.stringify((t.nodeValue??"").slice(0,24))}`:t.nodeType===8?"comment":"node";console.warn(`[fluixi] hydration mismatch: expected ${e} but the server DOM has ${n}. Server and client rendered different markup; recreating this node on the client. Check for non-deterministic render (Date.now(), Math.random(), browser-only branches, untransported data).`)}function on(e){we();let t=u.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(rn.has(e.toLowerCase())?u.cursor=t.nextSibling:(u.parents.push(t),u.cursor=t.firstChild),t):(Ae&&t&&Ce(`<${e}>`,t),null)}function sn(e){if(e==="")return null;we();let t=u.cursor;return t&&t.nodeType===3?(u.cursor=t.nextSibling,t.nodeValue!==e&&(t.nodeValue=e),t):(Ae&&t&&Ce(`text ${JSON.stringify(e.slice(0,24))}`,t),null)}function an(e){we();let t=u.cursor;return t&&t.nodeType===8&&t.data===e?(u.cursor=t.nextSibling,t):(Ae&&t&&Ce(`marker <!--${e.slice(0,24)}-->`,t),null)}var pt=!1;function ln(){pt||(pt=!0,Je({hydrateElement:on,hydrateText:sn,hydrateMarker:an}))}function V(e,t,n){ln(),u.active=!0,u.cursor=t.firstChild,u.parents=[];let r=te(),o=n?.resourceNamespace,i=0;tn(()=>o?`${o}:r${i++}`:`r${i++}`),nn(r?s=>s in r?{value:r[s]}:void 0:null);try{return Z(e,t)}finally{u.active=!1,u.cursor=null,u.parents=[]}}var Re="fluixi-island";function cn(e){let{component:t,props:n={},name:r}=e,o=Y(Re),i=r??t.name??"Island";h(o,"name",i),h(o,"props",JSON.stringify(n??{}));let s=g?v():void 0;if(s){let a=s.nextIslandNamespace(i);S(o,()=>s.withResourceScope(a,()=>t(n)))}else S(o,()=>t(n));return o}var yt=!1;function un(){if(yt||typeof document>"u")return;yt=!0;let e=document.createElement("style");e.textContent=`${Re}{display:contents}`,document.head.appendChild(e)}function fn(e){if(typeof document>"u")return;un();let t=document.querySelectorAll(Re),n=new Map;t.forEach(r=>{let o=r.getAttribute("name")??"",i=n.get(o)??0;n.set(o,i+1);let s=e[o];if(!s){typeof process>"u"&&console.warn(`[fluixi] island "${o}" has no component in the registry — left static.`);return}let a={};try{a=JSON.parse(r.getAttribute("props")||"{}")}catch{}V(()=>s(a),r,{resourceNamespace:`${o}#${i}`})})}import{createMemo as Me,untrack as xt}from"@fluixi/reactive/signal";function mt(e){return typeof e=="function"?e:(()=>e)}function A(e){return()=>{let t=e();return typeof t=="function"?t():t}}function gt(e){return e!=null&&e!==!1}function ht(e){return!e||typeof e!="object"?!1:!!(typeof e._$litType$<"u"||typeof e._$litDirective$<"u"||Array.isArray(e.strings)&&Array.isArray(e.values))}function dn(e){let t=A(()=>e.when),n=Me(t,void 0),r=Me(n,void 0);return Me(()=>{if(r()){let i=e.children;return typeof i=="function"&&!ht(i)?typeof n=="function"?xt(()=>xt(n)?i(n()):e.fallback):i(n):i}return e.fallback},void 0,{name:"show"})}import{mapArray as pn,keyArray as yn}from"@fluixi/reactive/signal";function mn(e){let t=A(()=>e.each),n=()=>e.fallback??null,r=(o,i)=>{let s=e.children,a=Array.isArray(s)?s.map(l=>typeof l=="function"?l(o,i):l):typeof s=="function"?s(o,i):s;return O(a),a};return e.by?yn(t,e.by,(o,i)=>r(o,i),{fallback:n}):pn(t,(o,i)=>r(o,i),{fallback:n})}import{indexArray as gn}from"@fluixi/reactive/signal";function hn(e){let t=A(()=>e.each);return gn(t,(n,r)=>{let o=e.children(n,r);return O(o),o},{fallback:()=>e.fallback??null})}import{mapArray as pi,keyArray as yi,indexArray as mi}from"@fluixi/reactive/signal";import{createMemo as xn}from"@fluixi/reactive/signal";var Pe=Symbol("match");function bn(e){return{[Pe]:!0,when:A(()=>e.when),children:e.children}}function Tn(e){let t=Array.isArray(e.children)?e.children:[e.children];return xn(()=>{for(let n of t){let r=n,o=0;for(;typeof r=="function"&&!r[Pe]&&o++<10;)r=r();if(!r||typeof r!="object"||r[Pe]!==!0)continue;let i=r.when();if(gt(i))return typeof r.children=="function"?r.children(i):r.children}return e.fallback??null})}import{createMemo as Nn}from"@fluixi/reactive/signal";function En(e){let t=mt(e.component),{component:n,...r}=e;return Nn(()=>{let o=t();return o==null?null:typeof o=="string"?{tag:o,props:r}:o(r)})}import{createRoot as Sn,onCleanup as vn}from"@fluixi/reactive/signal";function wn(e){let t=()=>e.mount?typeof e.mount=="function"?e.mount():e.mount:document.body,n,r;return Sn(o=>{n=o,r=document.createElement("div"),r.style.display="contents",t().appendChild(r),S(r,e.children)&&k(e.ref,r)}),vn(()=>{n(),r.remove()}),null}import{createMemo as An,createSignal as Cn}from"@fluixi/reactive/signal";function Rn(e){let[t,n]=Cn(null),r=()=>n(null);return An(()=>{let o=t();if(o!==null)return typeof e.fallback=="function"?e.fallback(o,r):e.fallback;try{return typeof e.children=="function"?e.children():e.children}catch(i){return n(i),typeof e.fallback=="function"?e.fallback(i,r):e.fallback}})}import{createMemo as Mn}from"@fluixi/reactive/signal";function Pn(e){return Mn(()=>{let t=typeof e=="function"?e():e,n=[];for(let[r,o]of Object.entries(t)){if(!r)continue;(typeof o=="function"?o():o)&&n.push(r)}return n.join(" ")})}import{createMemo as Ln}from"@fluixi/reactive/signal";function Dn(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function _n(e){return Ln(()=>{let t=typeof e=="function"?e():e,n=[];for(let[r,o]of Object.entries(t)){if(!r)continue;let i=typeof o=="function"?o():o;i!=null&&n.push(`${Dn(r)}: ${i}`)}return n.join("; ")})}var _e=1,ke=3,$e=8,bt;bt=$;var U=class{constructor(){this[bt]=!0;this.parentNode=null;this.childNodes=[]}get firstChild(){return this.childNodes[0]??null}get lastChild(){return this.childNodes[this.childNodes.length-1]??null}get nextSibling(){let t=this.parentNode;if(!t)return null;let n=t.childNodes.indexOf(this);return n>=0?t.childNodes[n+1]??null:null}get previousSibling(){let t=this.parentNode;if(!t)return null;let n=t.childNodes.indexOf(this);return n>0?t.childNodes[n-1]??null:null}get parentElement(){return this.parentNode}appendChild(t){return t.parentNode&&t.parentNode.removeChild(t),t.parentNode=this,this.childNodes.push(t),t}insertBefore(t,n){if(n==null)return this.appendChild(t);t.parentNode&&t.parentNode.removeChild(t);let r=this.childNodes.indexOf(n);return t.parentNode=this,r<0?this.childNodes.push(t):this.childNodes.splice(r,0,t),t}removeChild(t){let n=this.childNodes.indexOf(t);return n>=0&&this.childNodes.splice(n,1),t.parentNode=null,t}replaceChild(t,n){let r=this.childNodes.indexOf(n);return r>=0&&(t.parentNode&&t.parentNode.removeChild(t),t.parentNode=this,this.childNodes[r]=t,n.parentNode=null),n}addEventListener(){}removeEventListener(){}},W=class e extends U{constructor(n){super();this.nodeType=ke;this.data=n}get nodeValue(){return this.data}set nodeValue(n){this.data=n==null?"":String(n)}get textContent(){return this.data}set textContent(n){this.data=n==null?"":String(n)}cloneNode(){return new e(this.data)}},ne=class e extends U{constructor(n){super();this.nodeType=$e;this.data=n}get nodeValue(){return this.data}set nodeValue(n){this.data=n==null?"":String(n)}cloneNode(){return new e(this.data)}},Le=class{constructor(){this.cssText=""}setProperty(t,n){this[t]=n}removeProperty(t){delete this[t]}},De=class{constructor(t){this.el=t}list(){let t=this.el.getAttribute("class");return t?t.split(/\s+/).filter(Boolean):[]}write(t){t.length?this.el.setAttribute("class",t.join(" ")):this.el.removeAttribute("class")}add(...t){let n=this.list();for(let r of t)n.includes(r)||n.push(r);this.write(n)}remove(...t){this.write(this.list().filter(n=>!t.includes(n)))}contains(t){return this.list().includes(t)}toggle(t,n){let r=this.contains(t),o=n===void 0?!r:n;return o?this.add(t):this.remove(t),o}},re=class e extends U{constructor(n,r=!1){super();this.nodeType=_e;this.attributes=new Map;this.style=new Le;this.classList=new De(this);this.rawHTML=null;this.localName=n.toLowerCase(),this.tagName=r?n:n.toUpperCase(),this.isSVG=r,this.namespaceURI=r?"http://www.w3.org/2000/svg":null}setAttribute(n,r){this.attributes.set(n,String(r))}removeAttribute(n){this.attributes.delete(n)}getAttribute(n){return this.attributes.has(n)?this.attributes.get(n):null}hasAttribute(n){return this.attributes.has(n)}get id(){return this.getAttribute("id")??""}set id(n){n==null?this.removeAttribute("id"):this.setAttribute("id",n)}get className(){return this.getAttribute("class")??""}set className(n){n==null?this.removeAttribute("class"):this.setAttribute("class",n)}get htmlFor(){return this.getAttribute("for")??""}set htmlFor(n){n==null?this.removeAttribute("for"):this.setAttribute("for",n)}set value(n){n==null?this.removeAttribute("value"):this.setAttribute("value",String(n))}set checked(n){n?this.setAttribute("checked",""):this.removeAttribute("checked")}set selected(n){n?this.setAttribute("selected",""):this.removeAttribute("selected")}set indeterminate(n){}get textContent(){return this.childNodes.map(n=>n.textContent??"").join("")}set textContent(n){for(let r of this.childNodes)r.parentNode=null;this.childNodes=[],this.rawHTML=null,n!=null&&n!==""&&this.appendChild(new W(String(n)))}set innerText(n){this.textContent=n}set innerHTML(n){for(let r of this.childNodes)r.parentNode=null;this.childNodes=[],this.rawHTML=n==null?"":String(n)}cloneNode(n=!1){let r=new e(this.localName,this.isSVG);if(r.attributes=new Map(this.attributes),r.style.cssText=this.style.cssText,r.rawHTML=this.rawHTML,n)for(let o of this.childNodes)r.appendChild(o.cloneNode(!0));return r}};var kn=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Nt=/&/g,$n=/</g,On=/>/g,In=/"/g;function Oe(e){return e.replace(Nt,"&amp;").replace($n,"&lt;").replace(On,"&gt;")}function Tt(e){return e.replace(Nt,"&amp;").replace(In,"&quot;")}function qn(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>"-"+t.toLowerCase())}function jn(e){if(!e)return"";let t=[];e.cssText&&t.push(e.cssText.trim().replace(/;\s*$/,""));for(let n of Object.keys(e)){if(n==="cssText")continue;let r=e[n];r==null||r===""||t.push(`${qn(n)}: ${r}`)}return t.join("; ")}function Fn(e){let t="",n=jn(e.style);for(let[r,o]of e.attributes)r==="style"&&n||(t+=` ${r}="${Tt(o)}"`);if(n){let r=e.attributes.get("style"),o=r?`${r.replace(/;\s*$/,"")}; ${n}`:n;t+=` style="${Tt(o)}"`}return t}function b(e){if(e==null||e===!1||e===!0)return"";if(typeof e=="string")return Oe(e);if(typeof e=="number")return Oe(String(e));if(typeof e=="function")return b(e());if(Array.isArray(e))return e.map(b).join("");switch(e.nodeType){case ke:return Oe(e.data??"");case $e:return`<!--${e.data??""}-->`;case _e:{let t=e.localName,n=`<${t}${Fn(e)}>`;if(kn.has(t))return n;let r=e.rawHTML!=null?e.rawHTML:(e.childNodes??[]).map(b).join("");return`${n}${r}</${t}>`}}return Array.isArray(e.childNodes)?e.childNodes.map(b).join(""):""}import{createRoot as wt}from"@fluixi/reactive/signal";import{setResourceTracker as Hn,setResourceIdSource as Vn,setResourceDataSink as Un,getOwner as Wn,runWithOwner as Et,flush as Kn}from"@fluixi/reactive/signal";var St=!1;function At(){St||(St=!0,Ge({createElement:(e,t)=>new re(e,t),createText:e=>new W(e),createComment:e=>new ne(e)}))}function Ct(e,t={}){let n=g;At(),P(!0);let r=j(t.event);try{return F(r,()=>wt(o=>{try{let i=typeof e=="function"?e():e;return b(i)}finally{o()}}))}finally{P(n)}}var vt=!1;function zn(){vt||(vt=!0,Hn(e=>{v()?.pending.add(e)}),Vn(()=>v()?.nextResourceId()??""),Un((e,t)=>{e&&v()?.data.set(e,t)}))}var Ie=null;function Rt(e){Ie=e}function qe(e){if(e.data.size===0)return"";let t={};for(let[r,o]of e.data){let i=o;if(Ie)try{i=Ie(o,r)}catch{continue}i!==void 0&&(t[r]=i)}if(Object.keys(t).length===0)return"";let n=ee(JSON.stringify(t));return`<script type="application/json" id="${H}">${n}<\/script>`}var Bn=50;async function Mt(e,t={}){let n=g;At(),P(!0),zn();let r=j(t.event);try{return await F(r,async()=>{t.preload&&await t.preload(t.event);let o,i=null,s=()=>{};wt(f=>{s=f,i=Wn(),o=typeof e=="function"?e():e});let a=()=>{try{Et(i,()=>b(o))}catch{}};a();let l=0;for(;r.pending.size>0&&l++<Bn;){let f=Array.from(r.pending);r.pending.clear(),await Promise.allSettled(f),await Kn(),a()}let c=Et(i,()=>b(o))+qe(r);return s(),c})}finally{P(n)}}var Gn={createComponent:st,createElement:Ke,createNativeElement:Y,createTemplate:Qe,cloneTemplate:et,createPortal:it,render:Z,hydrate:V,insert:S,appendChildren:Be,removeChildren:ze,spread:tt,applyProps:nt,mergeProps:rt,setProperty:q,setDynamicProperty:Te,setAttribute:h,setDynamicAttribute:be,removeAttribute:We,getAttribute:Ue,setClassName:_,addClass:Fe,removeClass:He,toggleClass:Ve,setStyles:le,delegateEvents:J,addDelegatedEventListener:xe,removeDelegatedEventListener:B,handleRef:k,resetIntegration:lt,isIntegrationInitialized:at},Gi=Gn;export{En as Dynamic,Rn as ErrorBoundary,H as FX_DATA_ID,mn as For,hn as Index,cn as Island,ae as JSX_PROPERTIES,bn as Match,wn as Portal,er as SVG_ELEMENTS,ie as SVG_NAMESPACE,dn as Show,Tn as Switch,Qn as VOID_ELEMENTS,Fe as addClass,xe as addDelegatedEventListener,Be as appendChildren,se as applyElementProp,nt as applyProps,wr as asComponent,vr as asContext,Er as asOutlet,Sr as asProvider,Nr as asRoute,br as asRouter,Tr as asRoutes,Ar as asSuspense,Ht as captureHydrationCursor,Cr as checkRenderType,Pn as classMap,C as cleanChildren,et as cloneTemplate,nr as closest,st as createComponent,Ke as createElement,Y as createNativeElement,it as createPortal,j as createRequestContext,Qe as createTemplate,Gi as default,lr as delegate,J as delegateEvents,ee as escapeFxJson,Gr as escapeHTML,Vr as fnName,jr as generateID,Ue as getAttribute,hr as getGlobal,Yn as getLitEventName,dt as getLocals,ar as getOffset,v as getRequestContext,Ee as getRequestEvent,Se as getRequestLocals,te as getServerData,qr as getStableElementId,or as getStyle,k as handleRef,rr as hasClass,V as hydrate,O as hydrateAdvancePast,fn as hydrateIslands,mi as indexArray,Zr as initializeIntegration,S as insert,I as insertExpression,Qr as intergartionInitialized,Xr as isAccessor,x as isComponent,jt as isContext,Lt as isCustomElement,mr as isDOMNode,Fr as isDelegatedEvent,fe as isDomElement,L as isDomNode,de as isDomText,Jn as isEventHandler,Hr as isFunction,at as isIntegrationInitialized,yr as isJSXTemplate,_t as isLitTemplateResult,zr as isNativeElement,It as isOutlet,K as isPromise,qt as isProvider,dr as isReactElement,Ot as isRoute,kt as isRouter,$t as isRoutes,Br as isSVGElement,g as isServer,Ft as isSuspense,pr as isTemplateFactory,ir as isVisible,Ur as iterateFn,yi as keyArray,Jt as makeArrayFlat,pi as mapArray,rt as mergeProps,ur as observeIntersection,fr as observeResize,je as query,tr as queryAll,Yr as registerCreateComponent,gr as registerGlobal,Kr as registerLitRender,We as removeAttribute,ze as removeChildren,He as removeClass,B as removeDelegatedEventListener,Z as render,ot as renderLitToNodes,Ct as renderToString,Mt as renderToStringAsync,lt as resetIntegration,Vt as runHydrationAt,F as runWithRequestContext,Ut as runWithoutHydration,sr as scrollIntoView,b as serializeNode,qe as serializeResourceData,h as setAttribute,G as setClassList,_ as setClassName,Rt as setDataRedactor,be as setDynamicAttribute,Te as setDynamicProperty,q as setProperty,ft as setRequestStore,P as setServerMode,ge as setStyle,le as setStyles,Zn as shouldSetAsProperty,Wr as splitProps,tt as spread,_n as styleMap,Xn as toAttributeName,Ve as toggleClass,cr as waitForElement};
@@ -0,0 +1 @@
1
+ "use strict";var o=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var S=Object.prototype.hasOwnProperty;var d=(t,e)=>{for(var n in e)o(t,n,{get:e[n],enumerable:!0})},O=(t,e,n,u)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of l(e))!S.call(t,r)&&r!==n&&o(t,r,{get:()=>e[r],enumerable:!(u=m(e,r))||u.enumerable});return t};var P=t=>O(o({},"__esModule",{value:!0}),t);var w={};d(w,{asComponent:()=>T,asContext:()=>k,asOutlet:()=>C,asProvider:()=>h,asRoute:()=>R,asRouter:()=>j,asRoutes:()=>a,asSuspense:()=>g,checkRenderType:()=>q,isComponent:()=>s,isContext:()=>x,isOutlet:()=>y,isProvider:()=>c,isRoute:()=>p,isRouter:()=>i,isRoutes:()=>f,isSuspense:()=>b});module.exports=P(w);function j(t){return Object.defineProperty(t,Symbol.for("fluixi-router"),{value:!0,enumerable:!0}),t}function a(t){return Object.defineProperty(t,Symbol.for("fluixi-routes"),{value:!0,enumerable:!0}),t}function R(t){return Object.defineProperty(t,Symbol.for("fluixi-route"),{value:!0,enumerable:!0}),t}function C(t){return typeof t!="function"||Object.defineProperty(t,Symbol.for("fluixi-outlet"),{value:!0,enumerable:!0}),t}function h(t){return Object.defineProperty(t,Symbol.for("fluixi-provider"),{value:!0,enumerable:!0}),t}function k(t){return Object.defineProperty(t,Symbol.for("fluixi-context"),{value:!0,enumerable:!0}),t}function T(t){return typeof t!="function"||Object.defineProperty(t,Symbol.for("fluixi-component"),{value:!0,enumerable:!0}),t}function g(t){return Object.defineProperty(t,Symbol.for("fluixi-suspense"),{value:!0,enumerable:!0}),t}function i(t){return typeof t=="function"&&t[Symbol.for("fluixi-router")]===!0}function f(t){return typeof t=="function"&&t[Symbol.for("fluixi-routes")]===!0}function p(t){return typeof t=="function"&&t[Symbol.for("fluixi-route")]===!0}function y(t){return typeof t=="function"&&t[Symbol.for("fluixi-outlet")]===!0}function c(t){return typeof t=="function"&&t[Symbol.for("fluixi-provider")]===!0}function x(t){return typeof t=="function"&&t[Symbol.for("fluixi-context")]===!0}function s(t){return typeof t=="function"&&t[Symbol.for("fluixi-component")]===!0}function b(t){return typeof t=="function"&&t[Symbol.for("fluixi-suspense")]===!0}function q(t){return i(t)?{type:"router",value:t}:p(t)?{type:"route",value:t}:f(t)?{type:"routes",value:t}:y(t)?{type:"outlet",value:t}:s(t)?{type:"component",value:t}:b(t)?{type:"suspense",value:t}:c(t)?{type:"provider",value:t}:x(t)?{type:"context",value:t}:{type:"none",value:t}}
@@ -0,0 +1,2 @@
1
+ export * from './modifiers.js';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/component/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAA"}
@@ -0,0 +1 @@
1
+ export * from './modifiers.js';
@@ -0,0 +1 @@
1
+ function y(t){return Object.defineProperty(t,Symbol.for("fluixi-router"),{value:!0,enumerable:!0}),t}function c(t){return Object.defineProperty(t,Symbol.for("fluixi-routes"),{value:!0,enumerable:!0}),t}function x(t){return Object.defineProperty(t,Symbol.for("fluixi-route"),{value:!0,enumerable:!0}),t}function s(t){return typeof t!="function"||Object.defineProperty(t,Symbol.for("fluixi-outlet"),{value:!0,enumerable:!0}),t}function b(t){return Object.defineProperty(t,Symbol.for("fluixi-provider"),{value:!0,enumerable:!0}),t}function m(t){return Object.defineProperty(t,Symbol.for("fluixi-context"),{value:!0,enumerable:!0}),t}function l(t){return typeof t!="function"||Object.defineProperty(t,Symbol.for("fluixi-component"),{value:!0,enumerable:!0}),t}function S(t){return Object.defineProperty(t,Symbol.for("fluixi-suspense"),{value:!0,enumerable:!0}),t}function e(t){return typeof t=="function"&&t[Symbol.for("fluixi-router")]===!0}function r(t){return typeof t=="function"&&t[Symbol.for("fluixi-routes")]===!0}function n(t){return typeof t=="function"&&t[Symbol.for("fluixi-route")]===!0}function o(t){return typeof t=="function"&&t[Symbol.for("fluixi-outlet")]===!0}function u(t){return typeof t=="function"&&t[Symbol.for("fluixi-provider")]===!0}function i(t){return typeof t=="function"&&t[Symbol.for("fluixi-context")]===!0}function f(t){return typeof t=="function"&&t[Symbol.for("fluixi-component")]===!0}function p(t){return typeof t=="function"&&t[Symbol.for("fluixi-suspense")]===!0}function d(t){return e(t)?{type:"router",value:t}:n(t)?{type:"route",value:t}:r(t)?{type:"routes",value:t}:o(t)?{type:"outlet",value:t}:f(t)?{type:"component",value:t}:p(t)?{type:"suspense",value:t}:u(t)?{type:"provider",value:t}:i(t)?{type:"context",value:t}:{type:"none",value:t}}export{l as asComponent,m as asContext,s as asOutlet,b as asProvider,x as asRoute,y as asRouter,c as asRoutes,S as asSuspense,d as checkRenderType,f as isComponent,i as isContext,o as isOutlet,u as isProvider,n as isRoute,e as isRouter,r as isRoutes,p as isSuspense};
@@ -0,0 +1 @@
1
+ "use strict";var o=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var S=Object.prototype.hasOwnProperty;var d=(t,e)=>{for(var n in e)o(t,n,{get:e[n],enumerable:!0})},O=(t,e,n,u)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of l(e))!S.call(t,r)&&r!==n&&o(t,r,{get:()=>e[r],enumerable:!(u=m(e,r))||u.enumerable});return t};var P=t=>O(o({},"__esModule",{value:!0}),t);var w={};d(w,{asComponent:()=>T,asContext:()=>k,asOutlet:()=>C,asProvider:()=>h,asRoute:()=>R,asRouter:()=>j,asRoutes:()=>a,asSuspense:()=>g,checkRenderType:()=>q,isComponent:()=>s,isContext:()=>x,isOutlet:()=>p,isProvider:()=>c,isRoute:()=>y,isRouter:()=>i,isRoutes:()=>f,isSuspense:()=>b});module.exports=P(w);function j(t){return Object.defineProperty(t,Symbol.for("fluixi-router"),{value:!0,enumerable:!0}),t}function a(t){return Object.defineProperty(t,Symbol.for("fluixi-routes"),{value:!0,enumerable:!0}),t}function R(t){return Object.defineProperty(t,Symbol.for("fluixi-route"),{value:!0,enumerable:!0}),t}function C(t){return typeof t!="function"||Object.defineProperty(t,Symbol.for("fluixi-outlet"),{value:!0,enumerable:!0}),t}function h(t){return Object.defineProperty(t,Symbol.for("fluixi-provider"),{value:!0,enumerable:!0}),t}function k(t){return Object.defineProperty(t,Symbol.for("fluixi-context"),{value:!0,enumerable:!0}),t}function T(t){return typeof t!="function"||Object.defineProperty(t,Symbol.for("fluixi-component"),{value:!0,enumerable:!0}),t}function g(t){return Object.defineProperty(t,Symbol.for("fluixi-suspense"),{value:!0,enumerable:!0}),t}function i(t){return typeof t=="function"&&t[Symbol.for("fluixi-router")]===!0}function f(t){return typeof t=="function"&&t[Symbol.for("fluixi-routes")]===!0}function y(t){return typeof t=="function"&&t[Symbol.for("fluixi-route")]===!0}function p(t){return typeof t=="function"&&t[Symbol.for("fluixi-outlet")]===!0}function c(t){return typeof t=="function"&&t[Symbol.for("fluixi-provider")]===!0}function x(t){return typeof t=="function"&&t[Symbol.for("fluixi-context")]===!0}function s(t){return typeof t=="function"&&t[Symbol.for("fluixi-component")]===!0}function b(t){return typeof t=="function"&&t[Symbol.for("fluixi-suspense")]===!0}function q(t){return i(t)?{type:"router",value:t}:y(t)?{type:"route",value:t}:f(t)?{type:"routes",value:t}:p(t)?{type:"outlet",value:t}:s(t)?{type:"component",value:t}:b(t)?{type:"suspense",value:t}:c(t)?{type:"provider",value:t}:x(t)?{type:"context",value:t}:{type:"none",value:t}}
@@ -0,0 +1,21 @@
1
+ export declare function asRouter(value: any): any;
2
+ export declare function asRoutes(value: any): any;
3
+ export declare function asRoute(value: any): any;
4
+ export declare function asOutlet(value: any): any;
5
+ export declare function asProvider(value: any): any;
6
+ export declare function asContext(value: any): any;
7
+ export declare function asComponent(value: any): any;
8
+ export declare function asSuspense(value: any): any;
9
+ export declare function isRouter(value: any): boolean;
10
+ export declare function isRoutes(value: any): boolean;
11
+ export declare function isRoute(value: any): boolean;
12
+ export declare function isOutlet(value: any): boolean;
13
+ export declare function isProvider(value: any): boolean;
14
+ export declare function isContext(value: any): boolean;
15
+ export declare function isComponent(value: any): boolean;
16
+ export declare function isSuspense(value: any): boolean;
17
+ export declare function checkRenderType(value: any): {
18
+ type: 'router' | 'route' | 'routes' | 'outlet' | 'component' | 'suspense' | 'provider' | 'context' | 'none';
19
+ value: any;
20
+ };
21
+ //# sourceMappingURL=modifiers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"modifiers.d.ts","sourceRoot":"","sources":["../../../src/lib/component/modifiers.ts"],"names":[],"mappings":"AAKA,wBAAgB,QAAQ,CAAC,KAAK,EAAE,GAAG,OAGlC;AACD,wBAAgB,QAAQ,CAAC,KAAK,EAAE,GAAG,OAGlC;AACD,wBAAgB,OAAO,CAAC,KAAK,EAAE,GAAG,OAGjC;AACD,wBAAgB,QAAQ,CAAC,KAAK,EAAE,GAAG,OAIlC;AACD,wBAAgB,UAAU,CAAC,KAAK,EAAE,GAAG,OAGpC;AACD,wBAAgB,SAAS,CAAC,KAAK,EAAE,GAAG,OAGnC;AACD,wBAAgB,WAAW,CAAC,KAAK,EAAE,GAAG,OAIrC;AACD,wBAAgB,UAAU,CAAC,KAAK,EAAE,GAAG,OAGpC;AAGD,wBAAgB,QAAQ,CAAC,KAAK,EAAE,GAAG,WAElC;AACD,wBAAgB,QAAQ,CAAC,KAAK,EAAE,GAAG,WAElC;AACD,wBAAgB,OAAO,CAAC,KAAK,EAAE,GAAG,WAEjC;AACD,wBAAgB,QAAQ,CAAC,KAAK,EAAE,GAAG,WAElC;AACD,wBAAgB,UAAU,CAAC,KAAK,EAAE,GAAG,WAEpC;AACD,wBAAgB,SAAS,CAAC,KAAK,EAAE,GAAG,WAEnC;AACD,wBAAgB,WAAW,CAAC,KAAK,EAAE,GAAG,WAErC;AACD,wBAAgB,UAAU,CAAC,KAAK,EAAE,GAAG,WAEpC;AAGD,wBAAgB,eAAe,CAAC,KAAK,EAAE,GAAG,GAAG;IAC3C,IAAI,EAAE,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,QAAQ,GAAG,WAAW,GAAG,UAAU,GAAG,UAAU,GAAG,SAAS,GAAG,MAAM,CAAC;IAC5G,KAAK,EAAE,GAAG,CAAA;CACX,CA0BA"}
@@ -0,0 +1,171 @@
1
+ // /**
2
+ // * Development mode flag
3
+ // */
4
+ export function asRouter(value) {
5
+ Object.defineProperty(value, Symbol.for('fluixi-router'), { value: true, enumerable: true });
6
+ return value;
7
+ }
8
+ export function asRoutes(value) {
9
+ Object.defineProperty(value, Symbol.for('fluixi-routes'), { value: true, enumerable: true });
10
+ return value;
11
+ }
12
+ export function asRoute(value) {
13
+ Object.defineProperty(value, Symbol.for('fluixi-route'), { value: true, enumerable: true });
14
+ return value;
15
+ }
16
+ export function asOutlet(value) {
17
+ if (typeof value !== 'function')
18
+ return value;
19
+ Object.defineProperty(value, Symbol.for('fluixi-outlet'), { value: true, enumerable: true });
20
+ return value;
21
+ }
22
+ export function asProvider(value) {
23
+ Object.defineProperty(value, Symbol.for('fluixi-provider'), { value: true, enumerable: true });
24
+ return value;
25
+ }
26
+ export function asContext(value) {
27
+ Object.defineProperty(value, Symbol.for('fluixi-context'), { value: true, enumerable: true });
28
+ return value;
29
+ }
30
+ export function asComponent(value) {
31
+ if (typeof value !== 'function')
32
+ return value;
33
+ Object.defineProperty(value, Symbol.for('fluixi-component'), { value: true, enumerable: true });
34
+ return value;
35
+ }
36
+ export function asSuspense(value) {
37
+ Object.defineProperty(value, Symbol.for('fluixi-suspense'), { value: true, enumerable: true });
38
+ return value;
39
+ }
40
+ export function isRouter(value) {
41
+ return typeof value === 'function' && value[Symbol.for('fluixi-router')] === true;
42
+ }
43
+ export function isRoutes(value) {
44
+ return typeof value === 'function' && value[Symbol.for('fluixi-routes')] === true;
45
+ }
46
+ export function isRoute(value) {
47
+ return typeof value === 'function' && value[Symbol.for('fluixi-route')] === true;
48
+ }
49
+ export function isOutlet(value) {
50
+ return typeof value === 'function' && value[Symbol.for('fluixi-outlet')] === true;
51
+ }
52
+ export function isProvider(value) {
53
+ return typeof value === 'function' && value[Symbol.for('fluixi-provider')] === true;
54
+ }
55
+ export function isContext(value) {
56
+ return typeof value === 'function' && value[Symbol.for('fluixi-context')] === true;
57
+ }
58
+ export function isComponent(value) {
59
+ return typeof value === 'function' && value[Symbol.for('fluixi-component')] === true;
60
+ }
61
+ export function isSuspense(value) {
62
+ return typeof value === 'function' && value[Symbol.for('fluixi-suspense')] === true;
63
+ }
64
+ export function checkRenderType(value) {
65
+ if (isRouter(value)) {
66
+ return { type: 'router', value };
67
+ }
68
+ if (isRoute(value)) {
69
+ return { type: 'route', value };
70
+ }
71
+ if (isRoutes(value)) {
72
+ return { type: 'routes', value };
73
+ }
74
+ if (isOutlet(value)) {
75
+ return { type: 'outlet', value };
76
+ }
77
+ if (isComponent(value)) {
78
+ return { type: 'component', value };
79
+ }
80
+ if (isSuspense(value)) {
81
+ return { type: 'suspense', value };
82
+ }
83
+ if (isProvider(value)) {
84
+ return { type: 'provider', value };
85
+ }
86
+ if (isContext(value)) {
87
+ return { type: 'context', value };
88
+ }
89
+ return { type: 'none', value };
90
+ }
91
+ // export const DEV =
92
+ // typeof process !== 'undefined' && process.env?.NODE_ENV === 'development';
93
+ // /**
94
+ // * Component props type
95
+ // */
96
+ // export interface ComponentProps {
97
+ // children?: any;
98
+ // [key: string]: any;
99
+ // }
100
+ // /**
101
+ // * Component function type
102
+ // */
103
+ // export type Component<P = ComponentProps> = (props: P) => any;
104
+ // /**
105
+ // * Create and execute a component
106
+ // *
107
+ // * Section 2 — createComponent responsibilities:
108
+ // * - Create Owner ✓
109
+ // * - Untrack execution ✓
110
+ // * - Capture output ✓
111
+ // * - Lazy children ✓
112
+ // * - Context propagation ✓ (via reactive system)
113
+ // * - Cleanup attachment ✓
114
+ // *
115
+ // * Section 1: Components execute once, never re-execute
116
+ // *
117
+ // * @template P - Props type
118
+ // * @param {Component<P>} Comp - Component function
119
+ // * @param {P} props - Component props
120
+ // * @returns {any} Component output
121
+ // *
122
+ // * @example
123
+ // * ```typescript
124
+ // * const MyComponent = (props: { name: string }) => {
125
+ // * return html`<div>Hello ${props.name}</div>`;
126
+ // * };
127
+ // *
128
+ // * const result = createComponent(MyComponent, { name: 'World' });
129
+ // * ```
130
+ // */
131
+ // export function createComponent<P extends ComponentProps>(
132
+ // Comp: Component<P>,
133
+ // props: P
134
+ // ): any {
135
+ // // Section 1: Component is a plain function
136
+ // if (typeof Comp !== 'function') {
137
+ // return Comp;
138
+ // }
139
+ // // Section 3: Make children lazy
140
+ // if (props && 'children' in props) {
141
+ // const children = props.children;
142
+ // // Already lazy, keep as is
143
+ // if (typeof children === 'function') {
144
+ // // Children are already a function
145
+ // } else {
146
+ // // Make children lazy by wrapping in getter
147
+ // Object.defineProperty(props, 'children', {
148
+ // get() {
149
+ // return typeof children === 'function' ? children : () => children;
150
+ // },
151
+ // enumerable: true,
152
+ // configurable: true,
153
+ // });
154
+ // }
155
+ // }
156
+ // // DEV mode: Mark component for debugging
157
+ // if (DEV && Comp.name) {
158
+ // try {
159
+ // (props as any).__componentName = Comp.name;
160
+ // } catch (e) {
161
+ // // Silently fail if props is frozen
162
+ // }
163
+ // }
164
+ // // Section 2: Untrack execution - component doesn't track parent dependencies
165
+ // // Section 1: Execute once, never re-execute
166
+ // return untrack(() => {
167
+ // // Section 2: Execute component in untracked context
168
+ // // The component function runs once and constructs the reactive graph
169
+ // return Comp(props);
170
+ // });
171
+ // }
@@ -0,0 +1 @@
1
+ function p(t){return Object.defineProperty(t,Symbol.for("fluixi-router"),{value:!0,enumerable:!0}),t}function c(t){return Object.defineProperty(t,Symbol.for("fluixi-routes"),{value:!0,enumerable:!0}),t}function x(t){return Object.defineProperty(t,Symbol.for("fluixi-route"),{value:!0,enumerable:!0}),t}function s(t){return typeof t!="function"||Object.defineProperty(t,Symbol.for("fluixi-outlet"),{value:!0,enumerable:!0}),t}function b(t){return Object.defineProperty(t,Symbol.for("fluixi-provider"),{value:!0,enumerable:!0}),t}function m(t){return Object.defineProperty(t,Symbol.for("fluixi-context"),{value:!0,enumerable:!0}),t}function l(t){return typeof t!="function"||Object.defineProperty(t,Symbol.for("fluixi-component"),{value:!0,enumerable:!0}),t}function S(t){return Object.defineProperty(t,Symbol.for("fluixi-suspense"),{value:!0,enumerable:!0}),t}function e(t){return typeof t=="function"&&t[Symbol.for("fluixi-router")]===!0}function r(t){return typeof t=="function"&&t[Symbol.for("fluixi-routes")]===!0}function n(t){return typeof t=="function"&&t[Symbol.for("fluixi-route")]===!0}function o(t){return typeof t=="function"&&t[Symbol.for("fluixi-outlet")]===!0}function u(t){return typeof t=="function"&&t[Symbol.for("fluixi-provider")]===!0}function i(t){return typeof t=="function"&&t[Symbol.for("fluixi-context")]===!0}function f(t){return typeof t=="function"&&t[Symbol.for("fluixi-component")]===!0}function y(t){return typeof t=="function"&&t[Symbol.for("fluixi-suspense")]===!0}function d(t){return e(t)?{type:"router",value:t}:n(t)?{type:"route",value:t}:r(t)?{type:"routes",value:t}:o(t)?{type:"outlet",value:t}:f(t)?{type:"component",value:t}:y(t)?{type:"suspense",value:t}:u(t)?{type:"provider",value:t}:i(t)?{type:"context",value:t}:{type:"none",value:t}}export{l as asComponent,m as asContext,s as asOutlet,b as asProvider,x as asRoute,p as asRouter,c as asRoutes,S as asSuspense,d as checkRenderType,f as isComponent,i as isContext,o as isOutlet,u as isProvider,n as isRoute,e as isRouter,r as isRoutes,y as isSuspense};
@@ -0,0 +1 @@
1
+ "use strict";var r=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var E=Object.prototype.hasOwnProperty;var g=(t,e)=>{for(var n in e)r(t,n,{get:e[n],enumerable:!0})},u=(t,e,n,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of c(e))!E.call(t,o)&&o!==n&&r(t,o,{get:()=>e[o],enumerable:!(s=l(e,o))||s.enumerable});return t};var f=t=>u(r({},"__esModule",{value:!0}),t);var h={};g(h,{addDelegatedEventListener:()=>v,delegateEvents:()=>i,isDelegatedEvent:()=>$,removeDelegatedEventListener:()=>m});module.exports=f(h);var a=new Set,d=new Set(["scroll","focus","blur"]);function i(t){for(let e of t)a.has(e)||d.has(e)||(a.add(e),document.addEventListener(e,n=>{let s=n.target;for(;s&&s!==document.documentElement;){let o=s["$$"+e];o&&o.call(s,n),s=s.parentNode}}))}function v(t,e,n){t["$$"+e]=n,i([e])}function m(t,e){delete t["$$"+e]}function $(t){return!d.has(t)}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Ensure a global listener exists for each event type
3
+ */
4
+ export declare function delegateEvents(eventNames: string[]): void;
5
+ /**
6
+ * Add delegated handler
7
+ */
8
+ export declare function addDelegatedEventListener(element: Element, name: string, handler: EventListener): void;
9
+ /**
10
+ * Remove delegated handler
11
+ */
12
+ export declare function removeDelegatedEventListener(element: Element, name: string): void;
13
+ /**
14
+ * Check if event should be delegated
15
+ */
16
+ export declare function isDelegatedEvent(name: string): boolean;
17
+ //# sourceMappingURL=delegate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delegate.d.ts","sourceRoot":"","sources":["../../../src/lib/dom/delegate.ts"],"names":[],"mappings":"AAWA;;GAEG;AACH,wBAAgB,cAAc,CAAC,UAAU,EAAE,MAAM,EAAE,QAuBlD;AAED;;GAEG;AACH,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,aAAa,QAKvB;AAED;;GAEG;AACH,wBAAgB,4BAA4B,CAC1C,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,MAAM,QAGb;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,WAE5C"}
@@ -0,0 +1,50 @@
1
+ // delegation.ts
2
+ const delegatedEvents = new Set();
3
+ // Events that should NOT be delegated (no bubbling or special behavior)
4
+ const NON_DELEGATED = new Set([
5
+ "scroll",
6
+ "focus",
7
+ "blur"
8
+ ]);
9
+ /**
10
+ * Ensure a global listener exists for each event type
11
+ */
12
+ export function delegateEvents(eventNames) {
13
+ for (const name of eventNames) {
14
+ if (delegatedEvents.has(name) || NON_DELEGATED.has(name))
15
+ continue;
16
+ delegatedEvents.add(name);
17
+ document.addEventListener(name, (event) => {
18
+ let node = event.target;
19
+ while (node && node !== document.documentElement) {
20
+ const handler = node["$$" + name];
21
+ if (handler) {
22
+ handler.call(node, event);
23
+ // stopPropagation support
24
+ // if (event.cancelBubble) return;
25
+ }
26
+ node = node.parentNode;
27
+ }
28
+ });
29
+ }
30
+ }
31
+ /**
32
+ * Add delegated handler
33
+ */
34
+ export function addDelegatedEventListener(element, name, handler) {
35
+ element["$$" + name] = handler;
36
+ // console.log('delegate on', element, name)
37
+ delegateEvents([name]);
38
+ }
39
+ /**
40
+ * Remove delegated handler
41
+ */
42
+ export function removeDelegatedEventListener(element, name) {
43
+ delete element["$$" + name];
44
+ }
45
+ /**
46
+ * Check if event should be delegated
47
+ */
48
+ export function isDelegatedEvent(name) {
49
+ return !NON_DELEGATED.has(name);
50
+ }
@@ -0,0 +1 @@
1
+ var r=new Set,a=new Set(["scroll","focus","blur"]);function d(t){for(let e of t)r.has(e)||a.has(e)||(r.add(e),document.addEventListener(e,s=>{let n=s.target;for(;n&&n!==document.documentElement;){let o=n["$$"+e];o&&o.call(n,s),n=n.parentNode}}))}function i(t,e,s){t["$$"+e]=s,d([e])}function l(t,e){delete t["$$"+e]}function c(t){return!a.has(t)}export{i as addDelegatedEventListener,d as delegateEvents,c as isDelegatedEvent,l as removeDelegatedEventListener};
@@ -0,0 +1 @@
1
+ "use strict";var i=Object.defineProperty;var s=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var p=Object.prototype.hasOwnProperty;var d=(t,e)=>{for(var n in e)i(t,n,{get:e[n],enumerable:!0})},v=(t,e,n,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of c(e))!p.call(t,a)&&a!==n&&i(t,a,{get:()=>e[a],enumerable:!(o=s(e,a))||o.enumerable});return t};var y=t=>v(i({},"__esModule",{value:!0}),t);var h={};d(h,{ascendPast:()=>u,captureHydrationCursor:()=>g,getHydrationWalker:()=>x,hydrateAdvancePast:()=>T,hydration:()=>r,isAdopted:()=>N,registerHydrationWalker:()=>f,runHydrationAt:()=>k,runWithoutHydration:()=>H});module.exports=y(h);var r={active:!1,cursor:null,parents:[]},l=null;function f(t){l=t}function x(){return l}function N(t,e){return r.active&&e.parentNode===t}function u(t){let e=r.parents.lastIndexOf(t);e!==-1&&(r.parents.length=e),r.cursor=t.nextSibling}function g(){return r.active?r.cursor:null}function k(t,e){if(!t||t.parentNode==null)return e();let n=r.active,o=r.cursor,a=r.parents;r.active=!0,r.cursor=t,r.parents=[];try{return e()}finally{r.active=n,r.cursor=o,r.parents=a}}function H(t){if(!r.active)return t();let e=r.cursor,n=r.parents;r.active=!1,r.parents=[];try{return t()}finally{r.active=!0,r.cursor=e,r.parents=n}}function T(t){if(!r.active||t==null)return;let e=Array.isArray(t)?t[t.length-1]:t;e&&typeof e.nodeType=="number"&&u(e)}
@@ -0,0 +1,45 @@
1
+ /**
2
+ * Hydration state + the small helpers the runtime hot path reads on every render
3
+ * (even when not hydrating). The heavy DOM-reuse walker lives in ./hydration.ts
4
+ * and registers itself here, so render-only apps don't bundle it.
5
+ *
6
+ * `hydration.active` gates everything, so it's a plain field read (not a getter).
7
+ */
8
+ export declare const hydration: {
9
+ active: boolean;
10
+ cursor: Node | null;
11
+ parents: Node[];
12
+ };
13
+ export interface HydrationWalker {
14
+ hydrateElement(tag: string): Element | null;
15
+ hydrateText(value: string): Text | null;
16
+ hydrateMarker(value: string): Comment | null;
17
+ }
18
+ export declare function registerHydrationWalker(walker: HydrationWalker): void;
19
+ export declare function getHydrationWalker(): HydrationWalker | null;
20
+ /** True when hydrating and `node` is already server-rendered in `parent`. */
21
+ export declare function isAdopted(parent: Node, node: Node): boolean;
22
+ /**
23
+ * Ascend the cursor past an adopted node's (already-walked) subtree. If the node is an
24
+ * open parent we descended into, pop it (and anything still open above it) off the stack.
25
+ */
26
+ export declare function ascendPast(node: Node): void;
27
+ /**
28
+ * Capture the current hydration cursor (or null when not hydrating). An async boundary
29
+ * records this when created, then resumes hydration there via runHydrationAt.
30
+ */
31
+ export declare function captureHydrationCursor(): Node | null;
32
+ /** Resume hydration with the cursor at `cursor` for the duration of `fn`, then restore. */
33
+ export declare function runHydrationAt<T>(cursor: Node | null, fn: () => T): T;
34
+ /**
35
+ * Run `fn` with DOM-reuse hydration temporarily OFF, restoring the cursor afterwards.
36
+ * For a detached subtree mid-hydration that must NOT consume the cursor (e.g. an eagerly
37
+ * instantiated Suspense fallback that isn't showing).
38
+ */
39
+ export declare function runWithoutHydration<T>(fn: () => T): T;
40
+ /**
41
+ * After a control-flow item (For/Index/Show child) builds its node(s), ascend the cursor
42
+ * past it so the next sibling item reuses the right server node. No-op outside hydration.
43
+ */
44
+ export declare function hydrateAdvancePast(rendered: unknown): void;
45
+ //# sourceMappingURL=hydration-state.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hydration-state.d.ts","sourceRoot":"","sources":["../../../src/lib/dom/hydration-state.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,eAAO,MAAM,SAAS,EAAE;IAAE,MAAM,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,IAAI,GAAG,IAAI,CAAC;IAAC,OAAO,EAAE,IAAI,EAAE,CAAA;CAI9E,CAAC;AAGF,MAAM,WAAW,eAAe;IAC9B,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC;IAC5C,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAAC;IACxC,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC;CAC9C;AAID,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,eAAe,GAAG,IAAI,CAErE;AAED,wBAAgB,kBAAkB,IAAI,eAAe,GAAG,IAAI,CAE3D;AAED,6EAA6E;AAC7E,wBAAgB,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,GAAG,OAAO,CAE3D;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,CAI3C;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,IAAI,IAAI,GAAG,IAAI,CAEpD;AAED,2FAA2F;AAC3F,wBAAgB,cAAc,CAAC,CAAC,EAAE,MAAM,EAAE,IAAI,GAAG,IAAI,EAAE,EAAE,EAAE,MAAM,CAAC,GAAG,CAAC,CAerE;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,CAAC,GAAG,CAAC,CAarD;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,OAAO,GAAG,IAAI,CAM1D"}
@@ -0,0 +1,94 @@
1
+ /**
2
+ * Hydration state + the small helpers the runtime hot path reads on every render
3
+ * (even when not hydrating). The heavy DOM-reuse walker lives in ./hydration.ts
4
+ * and registers itself here, so render-only apps don't bundle it.
5
+ *
6
+ * `hydration.active` gates everything, so it's a plain field read (not a getter).
7
+ */
8
+ // `parents` is the stack of elements the cursor has descended into (via the walker's
9
+ // hydrateElement). Lets the cursor auto-ascend when a sibling list is exhausted.
10
+ export const hydration = {
11
+ active: false,
12
+ cursor: null,
13
+ parents: [],
14
+ };
15
+ let _walker = null;
16
+ export function registerHydrationWalker(walker) {
17
+ _walker = walker;
18
+ }
19
+ export function getHydrationWalker() {
20
+ return _walker;
21
+ }
22
+ /** True when hydrating and `node` is already server-rendered in `parent`. */
23
+ export function isAdopted(parent, node) {
24
+ return hydration.active && node.parentNode === parent;
25
+ }
26
+ /**
27
+ * Ascend the cursor past an adopted node's (already-walked) subtree. If the node is an
28
+ * open parent we descended into, pop it (and anything still open above it) off the stack.
29
+ */
30
+ export function ascendPast(node) {
31
+ const idx = hydration.parents.lastIndexOf(node);
32
+ if (idx !== -1)
33
+ hydration.parents.length = idx;
34
+ hydration.cursor = node.nextSibling;
35
+ }
36
+ /**
37
+ * Capture the current hydration cursor (or null when not hydrating). An async boundary
38
+ * records this when created, then resumes hydration there via runHydrationAt.
39
+ */
40
+ export function captureHydrationCursor() {
41
+ return hydration.active ? hydration.cursor : null;
42
+ }
43
+ /** Resume hydration with the cursor at `cursor` for the duration of `fn`, then restore. */
44
+ export function runHydrationAt(cursor, fn) {
45
+ if (!cursor || cursor.parentNode == null)
46
+ return fn();
47
+ const prevActive = hydration.active;
48
+ const prevCursor = hydration.cursor;
49
+ const prevParents = hydration.parents;
50
+ hydration.active = true;
51
+ hydration.cursor = cursor;
52
+ hydration.parents = [];
53
+ try {
54
+ return fn();
55
+ }
56
+ finally {
57
+ hydration.active = prevActive;
58
+ hydration.cursor = prevCursor;
59
+ hydration.parents = prevParents;
60
+ }
61
+ }
62
+ /**
63
+ * Run `fn` with DOM-reuse hydration temporarily OFF, restoring the cursor afterwards.
64
+ * For a detached subtree mid-hydration that must NOT consume the cursor (e.g. an eagerly
65
+ * instantiated Suspense fallback that isn't showing).
66
+ */
67
+ export function runWithoutHydration(fn) {
68
+ if (!hydration.active)
69
+ return fn();
70
+ const prevCursor = hydration.cursor;
71
+ const prevParents = hydration.parents;
72
+ hydration.active = false;
73
+ hydration.parents = [];
74
+ try {
75
+ return fn();
76
+ }
77
+ finally {
78
+ hydration.active = true;
79
+ hydration.cursor = prevCursor;
80
+ hydration.parents = prevParents;
81
+ }
82
+ }
83
+ /**
84
+ * After a control-flow item (For/Index/Show child) builds its node(s), ascend the cursor
85
+ * past it so the next sibling item reuses the right server node. No-op outside hydration.
86
+ */
87
+ export function hydrateAdvancePast(rendered) {
88
+ if (!hydration.active || rendered == null)
89
+ return;
90
+ const last = Array.isArray(rendered) ? rendered[rendered.length - 1] : rendered;
91
+ if (last && typeof last.nodeType === 'number') {
92
+ ascendPast(last);
93
+ }
94
+ }
@@ -0,0 +1 @@
1
+ var t={active:!1,cursor:null,parents:[]},a=null;function u(r){a=r}function s(){return a}function c(r,e){return t.active&&e.parentNode===r}function l(r){let e=t.parents.lastIndexOf(r);e!==-1&&(t.parents.length=e),t.cursor=r.nextSibling}function p(){return t.active?t.cursor:null}function d(r,e){if(!r||r.parentNode==null)return e();let n=t.active,o=t.cursor,i=t.parents;t.active=!0,t.cursor=r,t.parents=[];try{return e()}finally{t.active=n,t.cursor=o,t.parents=i}}function v(r){if(!t.active)return r();let e=t.cursor,n=t.parents;t.active=!1,t.parents=[];try{return r()}finally{t.active=!0,t.cursor=e,t.parents=n}}function y(r){if(!t.active||r==null)return;let e=Array.isArray(r)?r[r.length-1]:r;e&&typeof e.nodeType=="number"&&l(e)}export{l as ascendPast,p as captureHydrationCursor,s as getHydrationWalker,y as hydrateAdvancePast,t as hydration,c as isAdopted,u as registerHydrationWalker,d as runHydrationAt,v as runWithoutHydration};
@@ -0,0 +1 @@
1
+ "use strict";var v=Object.defineProperty;var U=Object.getOwnPropertyDescriptor;var Y=Object.getOwnPropertyNames;var z=Object.prototype.hasOwnProperty;var Q=(n,e)=>{for(var t in e)v(n,t,{get:e[t],enumerable:!0})},Z=(n,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let c of Y(e))!z.call(n,c)&&c!==t&&v(n,c,{get:()=>e[c],enumerable:!(r=U(e,c))||r.enumerable});return n};var ee=n=>Z(v({},"__esModule",{value:!0}),n);var ce={};Q(ce,{hydrate:()=>le});module.exports=ee(ce);var h=require("@fluixi/reactive/signal");function b(n){return typeof n=="function"&&n[Symbol.for("fluixi-component")]===!0}var x=require("@fluixi/reactive/signal");var R=typeof document>"u";var k=Symbol.for("fluixi.server-node"),M=null;function F(){if(!M)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return M}function C(n){return n!=null&&n[k]===!0?!0:typeof Node<"u"&&n instanceof Node}function O(n){return n!=null&&n[k]===!0?n.nodeType===3:typeof Text<"u"&&n instanceof Text}var l={active:!1,cursor:null,parents:[]},j=null;function H(n){j=n}function I(){return j}function _(n,e){return l.active&&e.parentNode===n}function V(n){let e=l.parents.lastIndexOf(n);e!==-1&&(l.parents.length=e),l.cursor=n.nextSibling}function N(n){if(R)return F().createText(n);if(l.active){let e=I()?.hydrateText(n);if(e)return e}return document.createTextNode(n)}var m=0,ne=200;function te(n,e,t,r,c){let f=r,s=new Map;return(0,x.createRenderEffect)(()=>{let i;if(b(n)&&!(0,h.isSignal)(n)){if(!s.has(n)){m++;try{let o=n();s.set(n,o)}finally{m--}}for(i=s.get(n);typeof i=="function"&&(0,h.isSignal)(i);)i=i()}else for(i=n();typeof i=="function"&&(0,h.isSignal)(i);)i=i();{let o=0;for(;typeof i=="function"&&o++<50;)if(b(i)){if(!s.has(i)){let u=i;m++;try{let a=u();s.set(u,a)}finally{m--}}i=s.get(i)}else if((0,h.isSignal)(i))i=i();else if(i=i(),typeof i!="function"||!(0,h.isSignal)(i)&&!b(i))break}m++;try{f=T(e,i,t,f,s),c(f)}finally{m--}})}function W(n,e,t,r){if(m>ne)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;t!==void 0&&!t&&(t=N(""),n.appendChild(t));let c=r??null;if(typeof e!="function"){m++;try{c=T(n,e,t,null)}finally{m--}return()=>c}let f=te(e,n,t,c,s=>{c=s});return()=>(f?.(),c)}function T(n,e,t,r,c){if(e==null||typeof e=="boolean")return E(n,r,t);if(typeof e=="function")for(;typeof e=="function";)e=e();if(e==null||typeof e=="boolean")return E(n,r,t);if(w(e)){let s=N("");return Array.isArray(r)?r.length>0?(n.replaceChild(s,r[0]),E(n,r.slice(1),t)):p(n,s,t):r?n.replaceChild(s,r):p(n,s,t),e.then(i=>{s.parentNode===n&&T(n,i,s.nextSibling,s)}).catch(i=>{console.error("Error resolving promise in insertExpression:",i)}),s}let f=typeof e;if(f==="string"||f==="number"){if(f==="number"&&(e=String(e)),Array.isArray(r)){if(r.length===0){let i=N(e);return p(n,i,t),i}if(r.length===1&&r[0].nodeType===3)return r[0].data=e,r;r=E(n,r,t)}if(r&&O(r))return r.data=e,r;let s=N(e);return r&&r.parentNode===n?n.replaceChild(s,r):_(n,s)||p(n,s,t),s}if(C(e))return _(n,e)?(V(e),e):Array.isArray(r)?(r.length===0?p(n,e,t):r[0].parentNode===n?(n.replaceChild(e,r[0]),E(n,r.slice(1),t)):p(n,e,t),e):(r?r!==e&&(r.parentNode===n?n.replaceChild(e,r):p(n,e,t)):p(n,e,t),e);if(Array.isArray(e)){let s=[],i=Array.isArray(r)?r:r?[r]:[],o=[];g(e,s,n,t,!0,c,o);let u=oe(n,i,s,t);for(let a of o){let d=W(n,a.sig,a.marker);(0,x.onCleanup)(()=>{E(n,d()),a.marker.parentNode===n&&n.removeChild(a.marker)})}return u}if(f==="object"&&e!==null&&typeof e=="object"){let s=e;if("_$litType$"in s||"_$litDirective$"in s)return T(n,B(e),t,r);if("type"in s&&"props"in s){let i=s;if(typeof i.type=="function"){let o=i.type(i.props||{});return T(n,o,t,r)}}}return E(n,r,t)}function g(n,e,t,r,c=!0,f,s){for(let i=0;i<n.length;i++){let o=n[i];if(!(o==null||typeof o=="boolean")){for(;typeof o=="function"&&!w(o)&&!(0,h.isSignal)(o)&&!b(o)&&(o=o(),!(o==null||typeof o=="boolean")););if(!(o==null||typeof o=="boolean")){if(typeof o=="function"){let u;for(b(o)&&!(0,h.isSignal)(o)?(f||(f=new Map),f.has(o)||f.set(o,o()),u=f.get(o)):u=o();typeof u=="function"&&!w(u)&&!(0,h.isSignal)(u)&&!b(u);)f||(f=new Map),f.has(u)||f.set(u,u()),u=f.get(u);if(u==null||typeof u=="boolean")continue;if(typeof u=="function"){if((0,h.isSignal)(u)){if(s){let d=N("");e.push(d),s.push({marker:d,sig:u});continue}let a=u();for(;typeof a=="function"&&(0,h.isSignal)(a);)a=a();if(a==null||typeof a=="boolean")continue;Array.isArray(a)?g(a,e,t,r,c,f):g([a],e,t,r,c,f);continue}continue}Array.isArray(u)?g(u,e,t,r,c,f,s):g([u],e,t,r,c,f,s);continue}if(w(o)){let u=N("");e.push(u),o.then(a=>{if(u.parentNode){let d=[];if(g([a],d,u.parentNode,void 0,!1,f),d.length>0){u.parentNode.replaceChild(d[0],u);for(let y=1;y<d.length;y++)u.parentNode?.insertBefore(d[y],d[y-1].nextSibling)}}}).catch(a=>console.error("Error resolving promise in array:",a));continue}if(Array.isArray(o)){g(o,e,t,r,c,f,s);continue}if(C(o)){e.push(o);continue}if(typeof o=="object"&&o!==null&&("_$litType$"in o||"_$litDirective$"in o)){let u=B(o);for(let a of u)e.push(a);continue}if(typeof o=="object"&&o!==null&&"type"in o&&"props"in o){let u=o;if(typeof u.type=="function"){let a=u.type(u.props||{});Array.isArray(a)?g(a,e,t,r,!1,f):g([a],e,t,r,!1,f);continue}}if(typeof o=="string"||typeof o=="number"){let u=String(o);if(u.trim()===""&&u!==" ")continue;e.push(N(u));continue}e.push(N(String(o)))}}}}function oe(n,e,t,r){for(let d=0;d<t.length;d++)t[d].parentNode!==null&&t[d].parentNode!==n&&(t=t.slice(),t[d]=t[d].cloneNode(!0));let c=t.length,f=e.length,s=c,i=0,o=0,u=f>0?e[f-1].nextSibling??void 0:r,a=null;for(;i<f||o<s;){if(e[i]===t[o]){i++,o++;continue}for(;f>i&&s>o&&e[f-1]===t[s-1];)f--,s--;if(f===i){let d=s<c?o?t[o-1].nextSibling??void 0:t[s-o]:u;for(;o<s;)p(n,t[o++],d)}else if(s===o)for(;i<f;)(!a||!a.has(e[i]))&&e[i].parentNode===n&&n.removeChild(e[i]),i++;else if(e[i]===t[s-1]&&t[o]===e[f-1]){let d=e[--f].nextSibling;p(n,t[o++],e[i++].nextSibling),p(n,t[--s],d),e[f]=e[i-1]}else{if(!a){a=new Map;let y=o;for(;y<s;)a.set(t[y],y++)}let d=a.get(e[i]);if(d!=null)if(o<d&&d<s){let y=i,A=1;for(;++y<f&&y<s&&!(!a.has(e[y])||a.get(e[y])!==d+A);)A++;if(A>d-o){let G=e[i];for(;o<d;)p(n,t[o++],G)}else e[i].parentNode===n?n.replaceChild(t[o++],e[i++]):(p(n,t[o++],u),i++)}else i++;else e[i].parentNode===n&&n.removeChild(e[i]),i++}}return t}function E(n,e,t){if(e)if(Array.isArray(e))for(let r=0;r<e.length;r++)e[r].parentNode===n&&n.removeChild(e[r]);else e.parentNode===n&&n.removeChild(e);return null}function p(n,e,t){l.active&&e.parentNode===n||(t&&t.parentNode===n?n.insertBefore(e,t):n.appendChild(e))}var K=null;function B(n){let e=[];if(!K)return console.warn("Lit render not registered. Call registerLitRender first."),e;try{let t=document.createElement("div");for(K(n,t);t.firstChild;)e.push(t.firstChild),t.removeChild(t.firstChild)}catch(t){console.warn("Could not render Lit template:",t)}return e}function w(n){return n!=null&&(typeof n=="object"||typeof n=="function")&&typeof n.then=="function"||n instanceof Promise}function X(n,e,t){if(!e)throw new Error("Container element is required");let r,c,f=[];return(0,x.createRoot)(s=>{(0,x.batch)(()=>{l.active||(e.textContent=""),W(e,n)}),c=s}),()=>{c?.(),r?.(),f.forEach(s=>s()),e.textContent=""}}var S=require("@fluixi/reactive/signal");var re="__FX_DATA__";var P;function q(){let n=globalThis.__FX_DATA__;if(n)return n;if(P!==void 0)return P;let e=null;if(typeof document<"u"){let t=document.getElementById(re)?.textContent;if(t)try{e=JSON.parse(t)}catch{e=null}}return P=e}function $(){for(;;){for(;l.cursor&&l.cursor.nodeType===3&&l.cursor.data==="";)l.cursor=l.cursor.nextSibling;if(l.cursor!=null||!l.parents.length)return;l.cursor=l.parents.pop().nextSibling}}var ie=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),L=typeof process<"u"&&process.env&&!1;function D(n,e){let t=e.nodeType===1?`<${e.tagName.toLowerCase()}>`:e.nodeType===3?`text ${JSON.stringify((e.nodeValue??"").slice(0,24))}`:e.nodeType===8?"comment":"node";console.warn(`[fluixi] hydration mismatch: expected ${n} but the server DOM has ${t}. Server and client rendered different markup; recreating this node on the client. Check for non-deterministic render (Date.now(), Math.random(), browser-only branches, untransported data).`)}function se(n){$();let e=l.cursor;return e&&e.nodeType===1&&e.tagName.toLowerCase()===n.toLowerCase()?(ie.has(n.toLowerCase())?l.cursor=e.nextSibling:(l.parents.push(e),l.cursor=e.firstChild),e):(L&&e&&D(`<${n}>`,e),null)}function fe(n){if(n==="")return null;$();let e=l.cursor;return e&&e.nodeType===3?(l.cursor=e.nextSibling,e.nodeValue!==n&&(e.nodeValue=n),e):(L&&e&&D(`text ${JSON.stringify(n.slice(0,24))}`,e),null)}function ue(n){$();let e=l.cursor;return e&&e.nodeType===8&&e.data===n?(l.cursor=e.nextSibling,e):(L&&e&&D(`marker <!--${n.slice(0,24)}-->`,e),null)}var J=!1;function ae(){J||(J=!0,H({hydrateElement:se,hydrateText:fe,hydrateMarker:ue}))}function le(n,e,t){ae(),l.active=!0,l.cursor=e.firstChild,l.parents=[];let r=q(),c=t?.resourceNamespace,f=0;(0,S.setResourceIdSource)(()=>c?`${c}:r${f++}`:`r${f++}`),(0,S.setServerDataGetter)(r?s=>s in r?{value:r[s]}:void 0:null);try{return X(n,e)}finally{l.active=!1,l.cursor=null,l.parents=[]}}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Hydrate `element` over the server-rendered markup already in `container`: reuse the
3
+ * existing DOM and wire events/reactivity in place (no re-render).
4
+ *
5
+ * `options.resourceNamespace` scopes resource ids for partial (island) hydration.
6
+ */
7
+ export declare function hydrate<T>(element: T, container: Element, options?: {
8
+ resourceNamespace?: string;
9
+ }): () => void;
10
+ //# sourceMappingURL=hydration.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hydration.d.ts","sourceRoot":"","sources":["../../../src/lib/dom/hydration.ts"],"names":[],"mappings":"AAwHA;;;;;GAKG;AACH,wBAAgB,OAAO,CAAC,CAAC,EACvB,OAAO,EAAE,CAAC,EACV,SAAS,EAAE,OAAO,EAClB,OAAO,CAAC,EAAE;IAAE,iBAAiB,CAAC,EAAE,MAAM,CAAA;CAAE,GACvC,MAAM,IAAI,CAwBZ"}