@fluixi/dom 1.0.0-alpha.82 → 1.0.0-alpha.83

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 (81) hide show
  1. package/dist/cdn/dom-client.cjs +1 -1
  2. package/dist/cdn/dom-client.global.js +1 -1
  3. package/dist/cdn/dom-client.mjs +1 -1
  4. package/dist/cdn/dom.cjs +1 -1
  5. package/dist/cdn/dom.global.js +1 -1
  6. package/dist/cdn/dom.mjs +1 -1
  7. package/dist/index.cjs +1 -1
  8. package/dist/index.mjs +1 -1
  9. package/dist/lib/dom/dynamic-element.cjs +1 -1
  10. package/dist/lib/dom/dynamic-element.js +1 -1
  11. package/dist/lib/dom/dynamic-element.mjs +1 -1
  12. package/dist/lib/dom/hydration.cjs +1 -1
  13. package/dist/lib/dom/hydration.mjs +1 -1
  14. package/dist/lib/dom/index.cjs +1 -1
  15. package/dist/lib/dom/index.mjs +1 -1
  16. package/dist/lib/dom/integration.cjs +1 -1
  17. package/dist/lib/dom/integration.d.ts.map +1 -1
  18. package/dist/lib/dom/integration.js +13 -4
  19. package/dist/lib/dom/integration.mjs +1 -1
  20. package/dist/lib/dom/island.cjs +1 -1
  21. package/dist/lib/dom/island.js +1 -1
  22. package/dist/lib/dom/island.mjs +1 -1
  23. package/dist/lib/dom/runtime.cjs +1 -1
  24. package/dist/lib/dom/runtime.d.ts +11 -2
  25. package/dist/lib/dom/runtime.d.ts.map +1 -1
  26. package/dist/lib/dom/runtime.js +142 -24
  27. package/dist/lib/dom/runtime.mjs +1 -1
  28. package/dist/lib/dom/server/host.cjs +1 -1
  29. package/dist/lib/dom/server/host.d.ts +8 -2
  30. package/dist/lib/dom/server/host.d.ts.map +1 -1
  31. package/dist/lib/dom/server/host.js +31 -9
  32. package/dist/lib/dom/server/host.mjs +1 -1
  33. package/dist/lib/dom/server/index.cjs +1 -1
  34. package/dist/lib/dom/server/index.mjs +1 -1
  35. package/dist/lib/dom/server/nodes.cjs +1 -1
  36. package/dist/lib/dom/server/nodes.mjs +1 -1
  37. package/dist/lib/dom/server/parse-template.cjs +1 -1
  38. package/dist/lib/dom/server/parse-template.mjs +1 -1
  39. package/dist/lib/dom/server/render.cjs +1 -1
  40. package/dist/lib/dom/server/render.js +2 -2
  41. package/dist/lib/dom/server/render.mjs +1 -1
  42. package/dist/lib/dom/server/serialize.cjs +1 -1
  43. package/dist/lib/dom/server/serialize.mjs +1 -1
  44. package/dist/lib/dom/server-renderer.cjs +1 -1
  45. package/dist/lib/dom/server-renderer.mjs +1 -1
  46. package/dist/lib/dom/versions.cjs +1 -1
  47. package/dist/lib/dom/versions.mjs +1 -1
  48. package/dist/lib/flow/class-map.cjs +1 -1
  49. package/dist/lib/flow/class-map.js +1 -1
  50. package/dist/lib/flow/class-map.mjs +1 -1
  51. package/dist/lib/flow/client-only.cjs +1 -1
  52. package/dist/lib/flow/client-only.js +1 -1
  53. package/dist/lib/flow/client-only.mjs +1 -1
  54. package/dist/lib/flow/dynamic.cjs +1 -1
  55. package/dist/lib/flow/dynamic.js +1 -1
  56. package/dist/lib/flow/dynamic.mjs +1 -1
  57. package/dist/lib/flow/error-boundary.cjs +1 -1
  58. package/dist/lib/flow/error-boundary.js +1 -1
  59. package/dist/lib/flow/error-boundary.mjs +1 -1
  60. package/dist/lib/flow/index.cjs +1 -1
  61. package/dist/lib/flow/index.mjs +1 -1
  62. package/dist/lib/flow/portal.cjs +1 -1
  63. package/dist/lib/flow/portal.mjs +1 -1
  64. package/dist/lib/flow/show.cjs +1 -1
  65. package/dist/lib/flow/show.d.ts.map +1 -1
  66. package/dist/lib/flow/show.js +8 -3
  67. package/dist/lib/flow/show.mjs +1 -1
  68. package/dist/lib/flow/style-map.cjs +1 -1
  69. package/dist/lib/flow/style-map.js +1 -1
  70. package/dist/lib/flow/style-map.mjs +1 -1
  71. package/dist/lib/flow/switch.cjs +1 -1
  72. package/dist/lib/flow/switch.js +1 -1
  73. package/dist/lib/flow/switch.mjs +1 -1
  74. package/dist/lib/index.cjs +1 -1
  75. package/dist/lib/index.mjs +1 -1
  76. package/dist/tsconfig.lib.tsbuildinfo +1 -1
  77. package/dist/version.generated.cjs +1 -1
  78. package/dist/version.generated.d.ts +1 -1
  79. package/dist/version.generated.js +1 -1
  80. package/dist/version.generated.mjs +1 -1
  81. package/package.json +3 -3
@@ -1 +1 @@
1
- "use strict";var ee=Object.defineProperty;var Ve=Object.getOwnPropertyDescriptor;var We=Object.getOwnPropertyNames;var Ke=Object.prototype.hasOwnProperty;var Be=(e,t)=>{for(var n in t)ee(e,n,{get:t[n],enumerable:!0})},Ge=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of We(t))!Ke.call(e,r)&&r!==n&&ee(e,r,{get:()=>t[r],enumerable:!(o=Ve(t,r))||o.enumerable});return e};var Je=e=>Ge(ee({},"__esModule",{value:!0}),e);var xn={};Be(xn,{Island:()=>He,JSX_PROPERTIES:()=>D,SVG_ELEMENTS:()=>Qe,SVG_NAMESPACE:()=>O,VOID_ELEMENTS:()=>Ze,addClass:()=>nt,addDelegatedEventListener:()=>Me,addNativeEventListener:()=>fe,appendChildren:()=>ct,applyElementProp:()=>k,applyProps:()=>Kt,applyUse:()=>ue,bindPair:()=>Zt,captureHydrationCursor:()=>Ae,cleanChildren:()=>w,cloneTemplate:()=>$e,closest:()=>tt,createComponent:()=>nn,createElement:()=>ut,createNativeElement:()=>ae,createPortal:()=>Jt,createTemplate:()=>_e,delegate:()=>mt,delegateEvents:()=>se,escapeHTML:()=>Ut,fnName:()=>Ft,generateID:()=>Lt,getAttribute:()=>st,getGlobal:()=>vt,getLitEventName:()=>Ue,getOffset:()=>yt,getStableElementId:()=>Rt,getStyle:()=>ft,handleRef:()=>ce,hasClass:()=>it,holeContent:()=>Dt,holeEnd:()=>kt,holeScope:()=>Ot,hydrate:()=>Z,hydrateAdvancePast:()=>Le,hydrateIslands:()=>je,initializeIntegration:()=>tn,insert:()=>A,insertExpression:()=>P,intergartionInitialized:()=>on,isAccessor:()=>Yt,isCustomElement:()=>me,isDOMNode:()=>wt,isDelegatedEvent:()=>_t,isDomElement:()=>H,isDomNode:()=>v,isDomText:()=>j,isEventHandler:()=>ze,isFunction:()=>$t,isIntegrationInitialized:()=>rn,isJSXTemplate:()=>Tt,isLitTemplateResult:()=>xe,isNativeElement:()=>Xt,isPromise:()=>L,isReactElement:()=>bt,isSVGElement:()=>zt,isServer:()=>E,isTemplateFactory:()=>Nt,isVisible:()=>dt,iterateFn:()=>Ht,makeArrayFlat:()=>Ie,mergeProps:()=>Bt,observeIntersection:()=>xt,observeResize:()=>ht,query:()=>te,queryAll:()=>et,registerCreateComponent:()=>en,registerGlobal:()=>St,removeAttribute:()=>at,removeChildren:()=>lt,removeClass:()=>ot,removeDelegatedEventListener:()=>ie,render:()=>de,resetIntegration:()=>sn,runHydrationAt:()=>R,runWithoutHydration:()=>Re,scrollIntoView:()=>pt,setAttribute:()=>x,setClassList:()=>$,setClassName:()=>_,setDynamicAttribute:()=>W,setDynamicBoolAttribute:()=>le,setDynamicProperty:()=>K,setProperty:()=>M,setServerMode:()=>Se,setStyle:()=>I,setStyles:()=>ge,shouldSetAsProperty:()=>Ye,splitProps:()=>Gt,spread:()=>Wt,templateNode:()=>It,toAttributeName:()=>Xe,toggleClass:()=>rt,waitForElement:()=>gt});module.exports=Je(xn);function Xe(e){return e.startsWith("aria-")||e.startsWith("data-")?e:/[A-Z]/.test(e)?e.replace(/([A-Z])/g,"-$1").toLowerCase():e}function ze(e){return e.startsWith("@")||e.startsWith("on")&&e.length>2}function Ue(e){return e.startsWith("@")?e.slice(1):e.startsWith("on")?e.slice(2).toLowerCase():e}function Ye(e,t){let n=new Set(["checked","value","selected","disabled","readonly","required","multiple","open","contenteditable","draggable","spellcheck"]),o={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)||o[e]&&o[e].has(t)}var Ze=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Qe=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"]),O="http://www.w3.org/2000/svg";function me(e){return e.localName.includes("-")}function k(e,t,n,o=!1){if(n==null){e.removeAttribute(t);return}if(me(e)){e[t]=n;return}x(e,t,n,o)}var D=new Set(["className","value","checked","selected","innerHTML","innerText","textContent","indeterminate","htmlFor"]);function te(e,t=document){return t.querySelector(e)}function et(e,t=document){return Array.from(t.querySelectorAll(e))}function tt(e,t){return e.closest(t)}function nt(e,...t){e.classList.add(...t)}function ot(e,...t){e.classList.remove(...t)}function rt(e,...t){t.forEach(n=>e.classList.toggle(n))}function it(e,t){return e.classList.contains(t)}function x(e,t,n,o=!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 st(e,t){return e.getAttribute(t)}function at(e,t){e.removeAttribute(t)}function ge(e,t){Object.assign(e.style,t)}function ft(e,t){return window.getComputedStyle(e).getPropertyValue(t)}function ut(e,t={},...n){let o=document.createElement(e);return Object.entries(t).forEach(([r,f])=>{if(r==="class"||r==="className")o.className=f;else if(r==="style"&&typeof f=="object")ge(o,f);else if(r.startsWith("on")&&typeof f=="function"){let s=r.slice(2).toLowerCase();o.addEventListener(s,f)}else x(o,r,f)}),n.forEach(r=>{typeof r=="string"?o.appendChild(document.createTextNode(r)):o.appendChild(r)}),o}function lt(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function ct(e,...t){t.forEach(n=>{typeof n=="string"?e.appendChild(document.createTextNode(n)):e.appendChild(n)})}function dt(e){let t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=window.innerHeight&&t.right<=window.innerWidth}function pt(e,t={behavior:"smooth",block:"nearest"}){e.scrollIntoView(t)}function yt(e){let t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset,left:t.left+window.pageXOffset}}function mt(e,t,n,o){let r=f=>{let s=f.target.closest(n);s&&e.contains(s)&&o(f,s)};return e.addEventListener(t,r),()=>{e.removeEventListener(t,r)}}function gt(e,t=5e3){return new Promise((n,o)=>{let r=te(e);if(r){n(r);return}let f=new MutationObserver(()=>{let i=te(e);i&&(f.disconnect(),clearTimeout(s),n(i))});f.observe(document.body,{childList:!0,subtree:!0});let s=setTimeout(()=>{f.disconnect(),o(new Error(`Element ${e} not found within ${t}ms`))},t)})}function xt(e,t,n={}){let o=new IntersectionObserver(r=>{r.forEach(f=>{t(f.isIntersecting)})},n);return o.observe(e),()=>{o.disconnect()}}function ht(e,t){let n=new ResizeObserver(o=>{o.forEach(t)});return n.observe(e),()=>{n.disconnect()}}var Et=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;function bt(e){return typeof e=="object"&&e!==null&&e.$$typeof===Et}function xe(e){return e&&typeof e=="object"&&e.strings&&Array.isArray(e.strings)&&e.values&&Array.isArray(e.values)}function Nt(e){if(typeof e!="function")return!1;try{let t=e();return xe(t)}catch{return!1}}function Tt(e){return typeof e=="object"&&e!==null&&(e.$$typeof==="template"||typeof e.type=="function")}function wt(e){return e instanceof Node}function St(e,t,n="Fluixi"){typeof globalThis<"u"&&(typeof globalThis[n]>"u"&&(globalThis[n]={}),typeof globalThis[n][e]>"u"&&(globalThis[n][e]=t))}function vt(e,t,n="Fluixi"){return typeof globalThis<"u"&&typeof globalThis[n]<"u"&&typeof globalThis[n][e]<"u"?globalThis[n][e]:t}var m=require("@fluixi/reactive/signal");var he="1.0.0-alpha.82";var Ee=require("@fluixi/reactive/version"),h={dom:he,reactive:Ee.VERSION};function be(e){h.core&&e.setAttribute("fluixi",h.core),e.setAttribute("fx-dom",h.dom),e.setAttribute("fx-reactive",h.reactive),typeof globalThis<"u"&&(globalThis.Fluixi=h)}function Ne(){let e=[h.core,h.dom,h.reactive].filter(t=>t!==void 0);new Set(e).size<=1||console.warn(`[fluixi] package versions disagree — core ${h.core??"(absent)"}, dom ${h.dom}, reactive ${h.reactive}. These ship as one release, so a mismatch usually means a stale lockfile or two copies resolved side by side. Reinstall, or check for duplicates with \`pnpm why @fluixi/dom\`.`)}function Te(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-component"),{value:!0,enumerable:!0}),e}function b(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}var c=require("@fluixi/reactive/signal");var E=typeof document>"u";function Se(e){E=e}var ne=Symbol.for("fluixi.server-node"),we=null;function F(){if(!we)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return we}function v(e){return e!=null&&e[ne]===!0?!0:typeof Node<"u"&&e instanceof Node}function H(e){return e!=null&&e[ne]===!0?e.nodeType===1:typeof Element<"u"&&e instanceof Element}function j(e){return e!=null&&e[ne]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var l={active:!1,cursor:null,parents:[]},ve=null;function Ce(e){ve=e}function q(){return ve}function oe(e,t){return l.active&&t.parentNode===e}function re(e){let t=l.parents.lastIndexOf(e);t!==-1&&(l.parents.length=t),l.cursor=e.nextSibling}function Ae(){return l.active?l.cursor:null}function R(e,t){if(!e||e.parentNode==null)return t();let n=l.active,o=l.cursor,r=l.parents;l.active=!0,l.cursor=e,l.parents=[];try{return t()}finally{l.active=n,l.cursor=o,l.parents=r}}function Re(e){if(!l.active)return e();let t=l.cursor,n=l.parents;l.active=!1,l.parents=[];try{return e()}finally{l.active=!0,l.cursor=t,l.parents=n}}function Le(e){if(!l.active||e==null)return;let t=Array.isArray(e)?e[e.length-1]:e;t&&typeof t.nodeType=="number"&&re(t)}function Ct(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 o=0,r=e;for(;r=r.previousElementSibling;)r.tagName===e.tagName&&o++;n+=`:nth-of-type(${o+1})`,t.unshift(n),e=e.parentElement}return t.join(">")}function At(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 Rt(e){return At(Ct(e))}var Lt=()=>"xxyxxxxxxy-4xx8".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)}),Pt={};var Pe=new Map,V=new Set,B=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);function se(e){if(!E)for(let t of e)V.has(t)||B.has(t)||(V.add(t),document.addEventListener(t,Mt))}function Mt(e){let t=`$$${e.type}`,n=e.composedPath&&e.composedPath()[0]||e.target;for(;n;){let o=n[t];if(o&&!n.disabled&&(o(e),e.cancelBubble))return;n=n.host&&n.host!==n&&n.host instanceof Element?n.host:n.parentNode}}function Me(e,t,n){if(e[`$$${t}`]=n,B.has(t)){let o=`__fx_${t}`;if(!e[o]){let r=f=>{e[`$$${t}`]?.(f)};e.addEventListener(t,r),e[o]=r}return}V.has(t)||se([t])}function ie(e,t){delete e[`$$${t}`];let n=`__fx_${t}`,o=e[n];o&&(e.removeEventListener(t,o),delete e[n])}function _t(e){return!B.has(e)}function $t(e){return typeof e=="function"}function S(e,t=!1){if(E)return F().createText(e);if(l.active&&!t){let n=q()?.hydrateText(e);if(n)return n}return document.createTextNode(e)}function ae(e,t=!1){if(E)return F().createElement(e,t);if(l.active){let n=q()?.hydrateElement(e);if(n)return n}return t?document.createElementNS(O,e):document.createElement(e)}function _e(e,t=!1){let n=Pe.get(e);if(n)return n;let o=document.createElement("template");return t?o.innerHTML=`<svg>${e}</svg>`:o.innerHTML=e,Pe.set(e,o),o}function It(e,t,n=!1,o=!1){if(E){let r=F();return n?r.parseTemplate(e,o):r.createRaw(e)}if(l.active){let r=q()?.hydrateStatic(t);if(r)return r}return $e(_e(e,o),o).firstChild}function Ot(e,t){if(!l.active)return t();let n=R(e.nextSibling,t);if(typeof n=="function"){let o=n;return((...r)=>l.active?R(e.nextSibling,()=>o(...r)):o(...r))}return n}function kt(e){for(let t=e.nextSibling;t;t=t.nextSibling)if(t.nodeType===8&&t.data==="fx/")return t;throw new Error("[fluixi] template hole is missing its closing marker")}function Dt(e,t){let n=[];for(let o=e.nextSibling;o&&o!==t;o=o.nextSibling)n.push(o);return n}function $e(e,t=!1){let n=e.content.cloneNode(!0);return t?n.firstChild:n}function Ie(e){return Array.isArray(e)?e.length===2&&e[1]===" "?Array.isArray(e[0])?Ie(e[0]):(typeof e[0]=="function",e[0]):e.length===1&&typeof e[0]=="function"?e[0]:e:e}function Ft(e){return typeof e!="function"?null:e._name||e.name||"anonymous"}function Ht(e){if((0,m.isSignal)(e)||b(e)||typeof e!="function")return e;let t=e();for(;typeof t=="function"&&!(0,m.isSignal)(t)&&!b(t);)t=t();return t}var T=0,jt=200;function qt(e,t,n,o,r){let f=o,s=new Map;return(0,c.createRenderEffect)(()=>{let i;if(b(e)&&!(0,m.isSignal)(e)){if(!s.has(e)){T++;try{let a=e();s.set(e,a)}finally{T--}}for(i=s.get(e);typeof i=="function"&&(0,m.isSignal)(i);)i=i()}else for(i=e();typeof i=="function"&&(0,m.isSignal)(i);)i=i();{let a=0;for(;typeof i=="function"&&a++<50;)if(b(i)){if(!s.has(i)){let u=i;T++;try{let d=u();s.set(u,d)}finally{T--}}i=s.get(i)}else if((0,m.isSignal)(i))i=i();else if(i=i(),typeof i!="function"||!(0,m.isSignal)(i)&&!b(i))break}T++;try{f=P(t,i,n,f,s),r(f)}finally{T--}})}function A(e,t,n,o){if(T>jt)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;n!==void 0&&!n&&(n=S("",!0),e.appendChild(n));let r=o??null,f=a=>Array.isArray(a)&&a.some(u=>typeof u=="function"),s=a=>typeof a=="function"?a:()=>a;if(typeof t!="function"&&!f(t)){T++;try{r=P(e,t,n,r)}finally{T--}return()=>r}let i=qt(s(t),e,n,r,a=>{r=a});return()=>(i?.(),r)}function P(e,t,n,o,r){if(t==null||typeof t=="boolean")return w(e,o,n);if(typeof t=="function")for(;typeof t=="function";)t=t();if(t==null||typeof t=="boolean")return w(e,o,n);if(L(t)){let s=S("",!0);return Array.isArray(o)?o.length>0?(e.replaceChild(s,o[0]),w(e,o.slice(1),n)):g(e,s,n):o?e.replaceChild(s,o):g(e,s,n),t.then(i=>{s.parentNode===e&&P(e,i,s.nextSibling,s)}).catch(i=>{console.error("Error resolving promise in insertExpression:",i)}),s}let f=typeof t;if(f==="string"||f==="number"){if(f==="number"&&(t=String(t)),Array.isArray(o)){if(o.length===0){let i=S(t);return g(e,i,n),i}if(o.length===1&&o[0].nodeType===3)return o[0].data=t,o;o=w(e,o,n)}if(o&&j(o))return o.data=t,o;let s=S(t);return o&&o.parentNode===e?e.replaceChild(s,o):oe(e,s)||g(e,s,n),s}if(v(t))return oe(e,t)?(re(t),t):Array.isArray(o)?(o.length===0?g(e,t,n):o[0].parentNode===e?(e.replaceChild(t,o[0]),w(e,o.slice(1),n)):g(e,t,n),t):(o?o!==t&&(o.parentNode===e?e.replaceChild(t,o):g(e,t,n)):g(e,t,n),t);if(Array.isArray(t)){let s=[],i=Array.isArray(o)?o:o?[o]:[],a=[];N(t,s,e,n,!0,r,a);let u=Vt(e,i,s,n);for(let d of a){let p=A(e,d.sig,d.marker);(0,c.onCleanup)(()=>{w(e,p()),d.marker.parentNode===e&&e.removeChild(d.marker)})}return u}if(f==="object"&&t!==null&&typeof t=="object"){let s=t;if("type"in s&&"props"in s){let i=s;if(typeof i.type=="function"){let a=i.type(i.props||{});return P(e,a,n,o)}}}return w(e,o,n)}function N(e,t,n,o,r=!0,f,s){for(let i=0;i<e.length;i++){let a=e[i];if(!(a==null||typeof a=="boolean")){for(;typeof a=="function"&&!L(a)&&!(0,m.isSignal)(a)&&!b(a)&&(a=a(),!(a==null||typeof a=="boolean")););if(!(a==null||typeof a=="boolean")){if(typeof a=="function"){let u;for(b(a)&&!(0,m.isSignal)(a)?(f||(f=new Map),f.has(a)||f.set(a,a()),u=f.get(a)):u=a();typeof u=="function"&&!L(u)&&!(0,m.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,m.isSignal)(u)){if(s){let p=S("",!0);t.push(p),s.push({marker:p,sig:u});continue}let d=u();for(;typeof d=="function"&&(0,m.isSignal)(d);)d=d();if(d==null||typeof d=="boolean")continue;Array.isArray(d)?N(d,t,n,o,r,f):N([d],t,n,o,r,f);continue}continue}Array.isArray(u)?N(u,t,n,o,r,f,s):N([u],t,n,o,r,f,s);continue}if(L(a)){let u=S("",!0);t.push(u),a.then(d=>{if(u.parentNode){let p=[];if(N([d],p,u.parentNode,void 0,!1,f),p.length>0){u.parentNode.replaceChild(p[0],u);for(let y=1;y<p.length;y++)u.parentNode?.insertBefore(p[y],p[y-1].nextSibling)}}}).catch(d=>console.error("Error resolving promise in array:",d));continue}if(Array.isArray(a)){N(a,t,n,o,r,f,s);continue}if(v(a)){t.push(a);continue}if(typeof a=="object"&&a!==null&&"type"in a&&"props"in a){let u=a;if(typeof u.type=="function"){let d=u.type(u.props||{});Array.isArray(d)?N(d,t,n,o,!1,f):N([d],t,n,o,!1,f);continue}}if(typeof a=="string"||typeof a=="number"){let u=String(a);if(u.trim()===""&&u!==" ")continue;t.push(S(u));continue}t.push(S(String(a)))}}}}function Vt(e,t,n,o){for(let p=0;p<n.length;p++){let y=n[p].parentNode;y!==null&&y!==e&&y.nodeType!==11&&(n=n.slice(),n[p]=n[p].cloneNode(!0))}let r=n.length,f=t.length,s=r,i=0,a=0,u=f>0?t[f-1].nextSibling??void 0:o,d=null;for(;i<f||a<s;){if(t[i]===n[a]){i++,a++;continue}for(;f>i&&s>a&&t[f-1]===n[s-1];)f--,s--;if(f===i){let p=s<r?a?n[a-1].nextSibling??void 0:n[s-a]:u;for(;a<s;)g(e,n[a++],p)}else if(s===a)for(;i<f;)(!d||!d.has(t[i]))&&t[i].parentNode===e&&e.removeChild(t[i]),i++;else if(t[i]===n[s-1]&&n[a]===t[f-1]){let p=t[--f].nextSibling;g(e,n[a++],t[i++].nextSibling),g(e,n[--s],p),t[f]=t[i-1]}else{if(!d){d=new Map;let y=a;for(;y<s;)d.set(n[y],y++)}let p=d.get(t[i]);if(p!=null)if(a<p&&p<s){let y=i,Q=1;for(;++y<f&&y<s&&!(!d.has(t[y])||d.get(t[y])!==p+Q);)Q++;if(Q>p-a){let qe=t[i];for(;a<p;)g(e,n[a++],qe)}else t[i].parentNode===e?e.replaceChild(n[a++],t[i++]):(g(e,n[a++],u),i++)}else i++;else t[i].parentNode===e&&e.removeChild(t[i]),i++}}return n}function w(e,t,n){if(t)if(Array.isArray(t))for(let o=0;o<t.length;o++)t[o].parentNode===e&&e.removeChild(t[o]);else t.parentNode===e&&e.removeChild(t);return null}function g(e,t,n){l.active&&t.parentNode===e||(n&&n.parentNode===e?e.insertBefore(t,n):e.appendChild(t))}function M(e,t,n){n==null?delete e[t]:e[t]=n}function fe(e,t,n){let o=n,r;return Array.isArray(n)&&(o=n[0],r=n[1]),typeof o!="function"?()=>{}:(e.addEventListener(t,o,r),()=>e.removeEventListener(t,o,r))}function ue(e,t){let n=(o,r)=>{typeof o=="function"&&o(e,r??(()=>{}))};if(typeof t=="function"){n(t);return}if(Array.isArray(t)){if(typeof t[0]=="function"){n(t[0],t[1]);return}for(let o of t)Array.isArray(o)?n(o[0],o[1]):n(o)}}function W(e,t,n,o=!1){return typeof n!="function"?(x(e,t,n,o),()=>{}):(0,c.createRenderEffect)(()=>{let r=typeof n=="function"?n():n;x(e,t,r,o)})}function K(e,t,n){return typeof n!="function"?(M(e,t,n),()=>{}):(0,c.createRenderEffect)(()=>{let o=typeof n=="function"?n():n;M(e,t,o)})}function le(e,t,n){return typeof n!="function"?(x(e,t,!!n),()=>{}):(0,c.createRenderEffect)(()=>{let o=n();x(e,t,!!o)})}function _(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){(0,c.createRenderEffect)(()=>_(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(o=>{let r=t[o];return typeof r=="function"?r():!!r}).join(" ");e.setAttribute("class",n);return}e.setAttribute("class",String(t))}function $(e,t,n){if(!(!t||typeof t!="object"))for(let o in t){let r=t[o],f=o.split(/\s+/).filter(Boolean);if(typeof r=="function"&&n)n.push((0,c.createRenderEffect)(()=>{let s=!!r();for(let i of f)e.classList.toggle(i,s)}));else{let s=!!(typeof r=="function"?r():r);for(let i of f)e.classList.toggle(i,s)}}}function I(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 o in n){let r=n[o];r==null?e.style[o]="":e.style[o]=r}}function Wt(e){let{element:t,props:n,prevProps:o=Pt,isSVG:r=!1,skipChildren:f=!1}=e;if(!t||!H(t))return console.error("[spread] Error: element is not a DOM Element!"),()=>{};if(!n)return console.warn("[spread] Warning: props is undefined!"),()=>{};let s=r||t.namespaceURI===O,i=[];for(let a in n){if(f&&a==="children")continue;let u=n[a],d=o[a];if(u===d)continue;if(a==="ref"){ce(u,t);continue}if(a==="use"){ue(t,u);continue}if(a.startsWith("on:")){i.push(fe(t,a.slice(3),u));continue}if(a.startsWith("prop:")){i.push(K(t,a.slice(5),u));continue}if(a.startsWith("attr:")){i.push(W(t,a.slice(5),u,s));continue}if(a.startsWith("bool:")){i.push(le(t,a.slice(5),u));continue}if(a==="class"||a==="className"){typeof u=="function"?i.push((0,c.createRenderEffect)(()=>_(t,u()))):_(t,u);continue}if(a==="classList"){typeof u=="function"?i.push((0,c.createRenderEffect)(()=>$(t,u()))):$(t,u,i);continue}if(a==="style"){typeof u=="function"?i.push((0,c.createRenderEffect)(()=>I(t,u()))):I(t,u);continue}if(a.startsWith("on")){let y=a.slice(2).toLowerCase();d&&ie(t,y),u&&Me(t,y,u);continue}let p=D.has(a)||!s&&a in t;typeof u=="function"?i.push(p?K(t,a,u):W(t,a,u,s)):i.push((0,c.createRenderEffect)(()=>p?M(t,a,n[a]):x(t,a,n[a],s)))}for(let a in o)if(!(a in n))if(a.startsWith("on")){let u=a.slice(2).toLowerCase();ie(t,u)}else D.has(a)?M(t,a,null):t.removeAttribute(a);return()=>{i.forEach(a=>a())}}function Kt(e,t,n=!1){for(let o in t){let r=t[o];if(o==="ref"){ce(r,e);continue}if(o!=="children"){if(o==="use"){ue(e,r);continue}if(o.startsWith("on:")){fe(e,o.slice(3),r);continue}if(o.startsWith("prop:")){K(e,o.slice(5),r);continue}if(o.startsWith("attr:")){W(e,o.slice(5),r,n);continue}if(o.startsWith("bool:")){le(e,o.slice(5),r);continue}if(o.startsWith("on")&&o.length>2){let f=o.slice(2).toLowerCase();if(typeof r=="function")if(B.has(f)){e[`$$${f}`]=r;let s=`__fx_${f}`;if(!e[s]){let i=a=>{e[`$$${f}`]?.(a)};e.addEventListener(f,i),e[s]=i}}else e[`$$${f}`]=r,V.has(f)||se([f]);continue}if(o==="class"||o==="className"){_(e,r);continue}if(o==="classList"){typeof r=="function"?(0,c.createRenderEffect)(()=>$(e,r())):$(e,r);continue}if(o==="style"){typeof r=="function"?(0,c.createRenderEffect)(()=>I(e,r())):I(e,r);continue}if(o==="innerHTML"){if(typeof r=="function"){let f=(0,c.createEffect)(()=>{let s=r();for(;typeof s=="function";)s=s();e.innerHTML=s});(0,c.onCleanup)(()=>f())}else e.innerHTML=r;continue}if(o==="value"&&(e.tagName==="INPUT"||e.tagName==="TEXTAREA")){if(typeof r=="function"){let f=(0,c.createEffect)(()=>{let s=r();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.value=s??"")});(0,c.onCleanup)(()=>{f()})}else(0,c.createRenderEffect)(()=>{document.activeElement!==e&&(e.value=t[o]??"")});continue}if(o==="checked"&&e.tagName==="INPUT"){if(typeof r=="function"){let f=(0,c.createEffect)(()=>{let s=r();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.checked=s??"")});(0,c.onCleanup)(()=>{f()})}else(0,c.createRenderEffect)(()=>{document.activeElement!==e&&(e.checked=t[o]??"")});continue}if(o==="value"&&e.tagName==="SELECT"){if(typeof r=="function"){let f=!0,s=(0,c.createEffect)(()=>{let i=r();for(;typeof i=="function"&&i.length===0;)i=i();f?(f=!1,queueMicrotask(()=>{e.value=i??""})):e.value=i??""});(0,c.onCleanup)(()=>{s()})}else{let f=!0;(0,c.createRenderEffect)(()=>{let s=t[o];f?(f=!1,queueMicrotask(()=>{e.value=s??""})):e.value=s??""})}continue}if(typeof r=="function"){let f=(0,c.createEffect)(()=>{let s=r();for(;typeof s=="function"&&s.length===0;)s=s();k(e,o,s,n)});(0,c.onCleanup)(()=>{f()})}else(0,c.createRenderEffect)(()=>k(e,o,t[o],n))}}}function Bt(...e){let t=o=>{for(let r=e.length-1;r>=0;r--){let f=e[r];if(f&&o in f&&f[o]!==void 0)return f[o]}},n=o=>{for(let r of e)if(r&&o in r)return!0;return!1};return new Proxy({},{get:(o,r)=>t(r),has:(o,r)=>n(r),ownKeys:()=>{let o=new Set;for(let r of e)if(r)for(let f of Reflect.ownKeys(r))o.add(f);return[...o]},getOwnPropertyDescriptor:(o,r)=>n(r)?{enumerable:!0,configurable:!0,get:()=>t(r)}:void 0})}function Gt(e,...t){let n=new Set;for(let s of t)for(let i of s)n.add(i);let o=s=>({enumerable:!0,configurable:!0,get:()=>e[s]}),r=t.map(s=>{let i=new Set(s);return new Proxy({},{get:(a,u)=>i.has(u)?e[u]:void 0,has:(a,u)=>i.has(u)&&u in e,ownKeys:()=>Array.from(i).filter(a=>a in e),getOwnPropertyDescriptor:(a,u)=>i.has(u)&&u in e?o(u):void 0})}),f=new Proxy({},{get:(s,i)=>n.has(i)?void 0:e[i],has:(s,i)=>!n.has(i)&&i in e,ownKeys:()=>Reflect.ownKeys(e).filter(s=>!n.has(s)),getOwnPropertyDescriptor:(s,i)=>!n.has(i)&&i in e?o(i):void 0});return[...r,f]}function ce(e,t){if(e){if(v(e)){let n=t,o=e;if(!n)return;typeof n=="function"?n(o):typeof n=="object"&&"current"in n&&(n.current=o);return}typeof e=="function"?e(t):typeof e=="object"&&"current"in e&&(e.current=t)}}function Jt(e,t,n){let o=t||document.body,r=(0,c.readChildren)(()=>e),f=[];return(0,c.batch)(()=>{let s=(0,c.createRenderEffect)(()=>{let i=r();Array.isArray(i)?(i.forEach(a=>o.appendChild(a)),f.push(()=>{i.forEach(a=>{a.parentNode===o&&o.removeChild(a)})})):v(i)&&(o.appendChild(i),f.push(()=>{i.parentNode===o&&o.removeChild(i)}))});f.push(s),(0,c.onCleanup)(()=>{f.forEach(i=>i())})}),null}function Xt(e){return typeof e=="string"&&e.toLowerCase()===e}function zt(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 Ut(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function L(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}function Yt(e){return typeof e=="function"&&e.length===0&&(0,m.isSignal)(e)}function de(e,t,n){if(!t)throw new Error("Container element is required");let o,r,f=[];return(0,c.createRoot)(s=>{(0,c.batch)(()=>{l.active||(t.textContent=""),be(t),Ne(),A(t,e)}),r=s}),()=>{r?.(),o?.(),f.forEach(s=>s()),t.textContent=""}}function Zt(e){if(Array.isArray(e))return e;if(typeof e=="function"&&typeof e.set=="function")return[e,e.set];throw new TypeError("[fluixi] bind: needs a signal — either `signal(…)` or the `[get, set]` pair from `createSignal(…)`.")}var G=require("@fluixi/reactive");var Qt="__fx_dom_create_component__",C=globalThis[Qt]??={fn:null};function en(e){C.fn=e}function tn(e={}){let t=e.signalSystem?.createComponent;t&&(C.fn=t)}function nn(e,t){if(C.fn)return C.fn(e,t);let n=typeof e=="function"?(0,G.untrack)(()=>e(t)):e;if(n!=null&&(typeof n=="function"||typeof n=="object")&&!(0,G.isSignal)(n)){try{n.$name=e?.name}catch{}return Te(n)}return n}var on=()=>C.fn!==null,rn=()=>C.fn!==null;function sn(){C.fn=null}var J,an={getStore:()=>J,run(e,t){let n=J;J=e;try{return t()}finally{J=n}}},fn=an;function Oe(){return fn.getStore()}var X=require("@fluixi/reactive/signal");var un="__FX_DATA__";var pe;function ke(){let e=globalThis.__FX_DATA__;if(e)return e;if(pe!==void 0)return pe;let t=null;if(typeof document<"u"){let n=document.getElementById(un)?.textContent;if(n)try{t=JSON.parse(n)}catch{t=null}}return pe=t}function z(){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 ln=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),U=typeof process<"u"&&process.env&&!1;function Y(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 cn(e){z();let t=l.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(ln.has(e.toLowerCase())?l.cursor=t.nextSibling:(l.parents.push(t),l.cursor=t.firstChild),t):(U&&t&&Y(`<${e}>`,t),null)}function dn(e){z();let t=l.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(l.cursor=t.nextSibling,t):(U&&t&&Y(`<${e}> (static)`,t),null)}function pn(e){if(e===""){let n=l.cursor;return n&&n.nodeType===3&&n.data!==""?(l.cursor=n.nextSibling,n.data="",n):null}z();let t=l.cursor;return t&&t.nodeType===3?(l.cursor=t.nextSibling,t.nodeValue!==e&&(t.nodeValue=e),t):(U&&t&&Y(`text ${JSON.stringify(e.slice(0,24))}`,t),null)}function yn(e){z();let t=l.cursor;return t&&t.nodeType===8&&t.data===e?(l.cursor=t.nextSibling,t):(U&&t&&Y(`marker <!--${e.slice(0,24)}-->`,t),null)}var De=!1;function mn(){De||(De=!0,Ce({hydrateElement:cn,hydrateText:pn,hydrateMarker:yn,hydrateStatic:dn}))}function Z(e,t,n){mn(),l.active=!0,l.cursor=t.firstChild,l.parents=[];let o=ke(),r=n?.resourceNamespace,f=0;(0,X.setResourceIdSource)(()=>r?`${r}:r${f++}`:`r${f++}`),(0,X.setServerDataGetter)(o?s=>s in o?{value:o[s]}:void 0:null);try{return de(e,t)}finally{l.active=!1,l.cursor=null,l.parents=[]}}var ye="fluixi-island";function He(e){let{component:t,props:n={},name:o}=e,r=ae(ye),f=o??t.name??"Island";x(r,"name",f),x(r,"props",JSON.stringify(n??{}));let s=E?Oe():void 0;if(s){let i=s.nextIslandNamespace(f);A(r,()=>s.withResourceScope(i,()=>t(n)))}else A(r,()=>t(n));return r}var Fe=!1;function gn(){if(Fe||typeof document>"u")return;Fe=!0;let e=document.createElement("style");e.textContent=`${ye}{display:contents}`,document.head.appendChild(e)}function je(e){if(typeof document>"u")return;gn();let t=document.querySelectorAll(ye),n=new Map;t.forEach(o=>{let r=o.getAttribute("name")??"",f=n.get(r)??0;n.set(r,f+1);let s=e[r];if(!s){typeof process>"u"&&console.warn(`[fluixi] island "${r}" has no component in the registry — left static.`);return}let i={};try{i=JSON.parse(o.getAttribute("props")||"{}")}catch{}Z(()=>s(i),o,{resourceNamespace:`${r}#${f}`})})}
1
+ "use strict";var oe=Object.defineProperty;var Xe=Object.getOwnPropertyDescriptor;var ze=Object.getOwnPropertyNames;var Ue=Object.prototype.hasOwnProperty;var Ye=(e,t)=>{for(var n in t)oe(e,n,{get:t[n],enumerable:!0})},Ze=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of ze(t))!Ue.call(e,r)&&r!==n&&oe(e,r,{get:()=>t[r],enumerable:!(o=Xe(t,r))||o.enumerable});return e};var Qe=e=>Ze(oe({},"__esModule",{value:!0}),e);var An={};Ye(An,{Island:()=>Be,JSX_PROPERTIES:()=>H,SVG_ELEMENTS:()=>it,SVG_NAMESPACE:()=>I,VOID_ELEMENTS:()=>rt,addClass:()=>ft,addDelegatedEventListener:()=>Ie,addNativeEventListener:()=>ce,appendChildren:()=>xt,applyElementProp:()=>D,applyProps:()=>Qt,applyUse:()=>de,bindPair:()=>fn,captureHydrationCursor:()=>Le,cleanChildren:()=>w,cloneTemplate:()=>He,closest:()=>at,createComponent:()=>dn,createElement:()=>mt,createNativeElement:()=>le,createPortal:()=>nn,createTemplate:()=>De,delegate:()=>Tt,delegateEvents:()=>ue,escapeHTML:()=>sn,fnName:()=>Jt,generateID:()=>Dt,getAttribute:()=>dt,getGlobal:()=>Mt,getLitEventName:()=>nt,getOffset:()=>Et,getStableElementId:()=>It,getStyle:()=>yt,handleRef:()=>ye,hasClass:()=>ct,holeContent:()=>Gt,holeEnd:()=>Bt,holeScope:()=>Wt,hydrate:()=>te,hydrateAdvancePast:()=>Me,hydrateIslands:()=>Ge,initializeIntegration:()=>cn,insert:()=>C,insertExpression:()=>M,intergartionInitialized:()=>pn,isAccessor:()=>an,isCustomElement:()=>he,isDOMNode:()=>Lt,isDelegatedEvent:()=>qt,isDomElement:()=>F,isDomNode:()=>v,isDomText:()=>V,isEventHandler:()=>tt,isFunction:()=>Ft,isIntegrationInitialized:()=>yn,isJSXTemplate:()=>Rt,isLitTemplateResult:()=>Ee,isNativeElement:()=>on,isPromise:()=>P,isReactElement:()=>At,isSVGElement:()=>rn,isServer:()=>E,isTemplateFactory:()=>Ct,isVisible:()=>ht,iterateFn:()=>Xt,makeArrayFlat:()=>je,mergeProps:()=>en,observeIntersection:()=>wt,observeResize:()=>St,query:()=>re,queryAll:()=>st,registerCreateComponent:()=>ln,registerGlobal:()=>Pt,removeAttribute:()=>pt,removeChildren:()=>gt,removeClass:()=>ut,removeDelegatedEventListener:()=>fe,render:()=>me,resetIntegration:()=>mn,runHydrationAt:()=>L,runWithoutHydration:()=>Pe,scrollIntoView:()=>bt,setAttribute:()=>x,setClassList:()=>O,setClassName:()=>k,setDynamicAttribute:()=>J,setDynamicBoolAttribute:()=>pe,setDynamicProperty:()=>X,setProperty:()=>_,setServerMode:()=>Ae,setStyle:()=>$,setStyles:()=>be,shouldSetAsProperty:()=>ot,splitProps:()=>tn,spread:()=>Zt,templateNode:()=>Vt,toAttributeName:()=>et,toggleClass:()=>lt,waitForElement:()=>Nt});module.exports=Qe(An);function et(e){return e.startsWith("aria-")||e.startsWith("data-")?e:/[A-Z]/.test(e)?e.replace(/([A-Z])/g,"-$1").toLowerCase():e}function tt(e){return e.startsWith("@")||e.startsWith("on")&&e.length>2}function nt(e){return e.startsWith("@")?e.slice(1):e.startsWith("on")?e.slice(2).toLowerCase():e}function ot(e,t){let n=new Set(["checked","value","selected","disabled","readonly","required","multiple","open","contenteditable","draggable","spellcheck"]),o={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)||o[e]&&o[e].has(t)}var rt=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),it=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"]),I="http://www.w3.org/2000/svg";function he(e){return e.localName.includes("-")}function D(e,t,n,o=!1){if(n==null){e.removeAttribute(t);return}if(he(e)){e[t]=n;return}x(e,t,n,o)}var H=new Set(["className","value","checked","selected","innerHTML","innerText","textContent","indeterminate","htmlFor"]);function re(e,t=document){return t.querySelector(e)}function st(e,t=document){return Array.from(t.querySelectorAll(e))}function at(e,t){return e.closest(t)}function ft(e,...t){e.classList.add(...t)}function ut(e,...t){e.classList.remove(...t)}function lt(e,...t){t.forEach(n=>e.classList.toggle(n))}function ct(e,t){return e.classList.contains(t)}function x(e,t,n,o=!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 dt(e,t){return e.getAttribute(t)}function pt(e,t){e.removeAttribute(t)}function be(e,t){Object.assign(e.style,t)}function yt(e,t){return window.getComputedStyle(e).getPropertyValue(t)}function mt(e,t={},...n){let o=document.createElement(e);return Object.entries(t).forEach(([r,s])=>{if(r==="class"||r==="className")o.className=s;else if(r==="style"&&typeof s=="object")be(o,s);else if(r.startsWith("on")&&typeof s=="function"){let a=r.slice(2).toLowerCase();o.addEventListener(a,s)}else x(o,r,s)}),n.forEach(r=>{typeof r=="string"?o.appendChild(document.createTextNode(r)):o.appendChild(r)}),o}function gt(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function xt(e,...t){t.forEach(n=>{typeof n=="string"?e.appendChild(document.createTextNode(n)):e.appendChild(n)})}function ht(e){let t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=window.innerHeight&&t.right<=window.innerWidth}function bt(e,t={behavior:"smooth",block:"nearest"}){e.scrollIntoView(t)}function Et(e){let t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset,left:t.left+window.pageXOffset}}function Tt(e,t,n,o){let r=s=>{let a=s.target.closest(n);a&&e.contains(a)&&o(s,a)};return e.addEventListener(t,r),()=>{e.removeEventListener(t,r)}}function Nt(e,t=5e3){return new Promise((n,o)=>{let r=re(e);if(r){n(r);return}let s=new MutationObserver(()=>{let i=re(e);i&&(s.disconnect(),clearTimeout(a),n(i))});s.observe(document.body,{childList:!0,subtree:!0});let a=setTimeout(()=>{s.disconnect(),o(new Error(`Element ${e} not found within ${t}ms`))},t)})}function wt(e,t,n={}){let o=new IntersectionObserver(r=>{r.forEach(s=>{t(s.isIntersecting)})},n);return o.observe(e),()=>{o.disconnect()}}function St(e,t){let n=new ResizeObserver(o=>{o.forEach(t)});return n.observe(e),()=>{n.disconnect()}}var vt=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;function At(e){return typeof e=="object"&&e!==null&&e.$$typeof===vt}function Ee(e){return e&&typeof e=="object"&&e.strings&&Array.isArray(e.strings)&&e.values&&Array.isArray(e.values)}function Ct(e){if(typeof e!="function")return!1;try{let t=e();return Ee(t)}catch{return!1}}function Rt(e){return typeof e=="object"&&e!==null&&(e.$$typeof==="template"||typeof e.type=="function")}function Lt(e){return e instanceof Node}function Pt(e,t,n="Fluixi"){typeof globalThis<"u"&&(typeof globalThis[n]>"u"&&(globalThis[n]={}),typeof globalThis[n][e]>"u"&&(globalThis[n][e]=t))}function Mt(e,t,n="Fluixi"){return typeof globalThis<"u"&&typeof globalThis[n]<"u"&&typeof globalThis[n][e]<"u"?globalThis[n][e]:t}var m=require("@fluixi/reactive/signal");var Te="1.0.0-alpha.83";var Ne=require("@fluixi/reactive/version"),h={dom:Te,reactive:Ne.VERSION};function we(e){h.core&&e.setAttribute("fluixi",h.core),e.setAttribute("fx-dom",h.dom),e.setAttribute("fx-reactive",h.reactive),typeof globalThis<"u"&&(globalThis.Fluixi=h)}function Se(){let e=[h.core,h.dom,h.reactive].filter(t=>t!==void 0);new Set(e).size<=1||console.warn(`[fluixi] package versions disagree — core ${h.core??"(absent)"}, dom ${h.dom}, reactive ${h.reactive}. These ship as one release, so a mismatch usually means a stale lockfile or two copies resolved side by side. Reinstall, or check for duplicates with \`pnpm why @fluixi/dom\`.`)}function ve(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-component"),{value:!0,enumerable:!0}),e}function b(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}var l=require("@fluixi/reactive/signal");var ie=Symbol.for("fluixi.server-node"),_t=Symbol.for("fluixi.dom.server-host"),kt=globalThis,j=kt[_t]??={server:typeof document>"u",nodes:null};function E(){return j.server}function Ae(e){j.server=e}function q(){if(!j.nodes)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return j.nodes}function v(e){return e!=null&&e[ie]===!0?!0:typeof Node<"u"&&e instanceof Node}function F(e){return e!=null&&e[ie]===!0?e.nodeType===1:typeof Element<"u"&&e instanceof Element}function V(e){return e!=null&&e[ie]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var c={active:!1,cursor:null,parents:[]},Ce=null;function Re(e){Ce=e}function W(){return Ce}function se(e,t){return c.active&&t.parentNode===e}function ae(e){let t=c.parents.lastIndexOf(e);t!==-1&&(c.parents.length=t),c.cursor=e.nextSibling}function Le(){return c.active?c.cursor:null}function L(e,t){if(!e||e.parentNode==null)return t();let n=c.active,o=c.cursor,r=c.parents;c.active=!0,c.cursor=e,c.parents=[];try{return t()}finally{c.active=n,c.cursor=o,c.parents=r}}function Pe(e){if(!c.active)return e();let t=c.cursor,n=c.parents;c.active=!1,c.parents=[];try{return e()}finally{c.active=!0,c.cursor=t,c.parents=n}}function Me(e){if(!c.active||e==null)return;let t=Array.isArray(e)?e[e.length-1]:e;t&&typeof t.nodeType=="number"&&ae(t)}function Ot(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 o=0,r=e;for(;r=r.previousElementSibling;)r.tagName===e.tagName&&o++;n+=`:nth-of-type(${o+1})`,t.unshift(n),e=e.parentElement}return t.join(">")}function $t(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 It(e){return $t(Ot(e))}var Dt=()=>"xxyxxxxxxy-4xx8".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)}),Ht={};var K="__fx_at",$e="__fx_loc";function _e(e,t){return t&&(e[$e]=t),e}var ke=new Map,B=new Set,z=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);function ue(e){if(!E())for(let t of e)B.has(t)||z.has(t)||(B.add(t),document.addEventListener(t,jt))}function jt(e){let t=`$$${e.type}`,n=e.composedPath&&e.composedPath()[0]||e.target;for(;n;){let o=n[t];if(o&&!n.disabled&&(o(e),e.cancelBubble))return;n=n.host&&n.host!==n&&n.host instanceof Element?n.host:n.parentNode}}function Ie(e,t,n){if(e[`$$${t}`]=n,z.has(t)){let o=`__fx_${t}`;if(!e[o]){let r=s=>{e[`$$${t}`]?.(s)};e.addEventListener(t,r),e[o]=r}return}B.has(t)||ue([t])}function fe(e,t){delete e[`$$${t}`];let n=`__fx_${t}`,o=e[n];o&&(e.removeEventListener(t,o),delete e[n])}function qt(e){return!z.has(e)}function Ft(e){return typeof e=="function"}function S(e,t=!1){if(E())return q().createText(e);if(c.active&&!t){let n=W()?.hydrateText(e);if(n)return n}return document.createTextNode(e)}function le(e,t=!1,n){if(E())return q().createElement(e,t);if(c.active){let o=W()?.hydrateElement(e);if(o)return n?_e(o,n):o}return _e(t?document.createElementNS(I,e):document.createElement(e),n)}function De(e,t=!1){let n=ke.get(e);if(n)return n;let o=document.createElement("template");return t?o.innerHTML=`<svg>${e}</svg>`:o.innerHTML=e,ke.set(e,o),o}function Vt(e,t,n=!1,o=!1,r){if(E()){let s=q();return n?s.parseTemplate(e,o):s.createRaw(e)}if(c.active){let s=W()?.hydrateStatic(t);if(s)return Oe(s,r)}return Oe(He(De(e,o),o).firstChild,r)}function Oe(e,t){let n=e;if(!t||typeof n?.querySelectorAll!="function")return e;let o=[n,...n.querySelectorAll("*")];for(let r=0;r<o.length&&r*2+1<t.pos.length;r++){let s=t.pos[r*2];s&&(o[r][$e]={file:t.file,line:s,column:t.pos[r*2+1]})}return e}function Wt(e,t){if(!c.active)return t();let n=L(e.nextSibling,t);if(typeof n=="function"){let o=n;return Kt(o,(...s)=>c.active?L(e.nextSibling,()=>o(...s)):o(...s))}return n}function Kt(e,t){let n=e[K];return n!==void 0&&(t[K]=n),t}function Bt(e){for(let t=e.nextSibling;t;t=t.nextSibling)if(t.nodeType===8&&t.data==="fx/")return t;throw new Error("[fluixi] template hole is missing its closing marker")}function Gt(e,t){let n=[];for(let o=e.nextSibling;o&&o!==t;o=o.nextSibling)n.push(o);return n}function He(e,t=!1){let n=e.content.cloneNode(!0);return t?n.firstChild:n}function je(e){return Array.isArray(e)?e.length===2&&e[1]===" "?Array.isArray(e[0])?je(e[0]):(typeof e[0]=="function",e[0]):e.length===1&&typeof e[0]=="function"?e[0]:e:e}function Jt(e){return typeof e!="function"?null:e._name||e.name||"anonymous"}function Xt(e){if((0,m.isSignal)(e)||b(e)||typeof e!="function")return e;let t=e();for(;typeof t=="function"&&!(0,m.isSignal)(t)&&!b(t);)t=t();return t}var N=0,zt=200;function Ut(e,t,n,o,r){let s=o,a=new Map;return(0,l.createRenderEffect)(()=>{(0,l.reportReactiveBinding)(n??t,"content",void 0,e);let i;if(b(e)&&!(0,m.isSignal)(e)){if(!a.has(e)){N++;try{let f=e();a.set(e,f)}finally{N--}}for(i=a.get(e);typeof i=="function"&&(0,m.isSignal)(i);)i=i()}else for(i=e();typeof i=="function"&&(0,m.isSignal)(i);)i=i();{let f=0;for(;typeof i=="function"&&f++<50;)if(b(i)){if(!a.has(i)){let u=i;N++;try{let d=u();a.set(u,d)}finally{N--}}i=a.get(i)}else if((0,m.isSignal)(i))i=i();else if(i=i(),typeof i!="function"||!(0,m.isSignal)(i)&&!b(i))break}N++;try{s=M(t,i,n,s,a),r(s)}finally{N--}})}function C(e,t,n,o){if(N>zt)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;n!==void 0&&!n&&(n=S("",!0),e.appendChild(n));let r=o??null,s=f=>Array.isArray(f)&&f.some(u=>typeof u=="function"),a=f=>typeof f=="function"?f:()=>f;if(typeof t!="function"&&!s(t)){N++;try{r=M(e,t,n,r)}finally{N--}return()=>r}let i=Ut(a(t),e,n,r,f=>{r=f});return()=>(i?.(),r)}function M(e,t,n,o,r){if(t==null||typeof t=="boolean")return w(e,o,n);if(typeof t=="function")for(;typeof t=="function";)t=t();if(t==null||typeof t=="boolean")return w(e,o,n);if(P(t)){let a=S("",!0);return Array.isArray(o)?o.length>0?(e.replaceChild(a,o[0]),w(e,o.slice(1),n)):g(e,a,n):o?e.replaceChild(a,o):g(e,a,n),t.then(i=>{a.parentNode===e&&M(e,i,a.nextSibling,a)}).catch(i=>{console.error("Error resolving promise in insertExpression:",i)}),a}let s=typeof t;if(s==="string"||s==="number"){if(s==="number"&&(t=String(t)),Array.isArray(o)){if(o.length===0){let i=S(t);return g(e,i,n),i}if(o.length===1&&o[0].nodeType===3)return o[0].data=t,o;o=w(e,o,n)}if(o&&V(o))return o.data=t,o;let a=S(t);return o&&o.parentNode===e?e.replaceChild(a,o):se(e,a)||g(e,a,n),a}if(v(t))return se(e,t)?(ae(t),t):Array.isArray(o)?(o.length===0?g(e,t,n):o[0].parentNode===e?(e.replaceChild(t,o[0]),w(e,o.slice(1),n)):g(e,t,n),t):(o?o!==t&&(o.parentNode===e?e.replaceChild(t,o):g(e,t,n)):g(e,t,n),t);if(Array.isArray(t)){let a=[],i=Array.isArray(o)?o:o?[o]:[],f=[];T(t,a,e,n,!0,r,f);let u=Yt(e,i,a,n);for(let d of f){let p=C(e,d.sig,d.marker);(0,l.onCleanup)(()=>{w(e,p()),d.marker.parentNode===e&&e.removeChild(d.marker)})}return u}if(s==="object"&&t!==null&&typeof t=="object"){let a=t;if("type"in a&&"props"in a){let i=a;if(typeof i.type=="function"){let f=i.type(i.props||{});return M(e,f,n,o)}}}return w(e,o,n)}function T(e,t,n,o,r=!0,s,a){for(let i=0;i<e.length;i++){let f=e[i];if(!(f==null||typeof f=="boolean")){for(;typeof f=="function"&&!P(f)&&!(0,m.isSignal)(f)&&!b(f)&&(f=f(),!(f==null||typeof f=="boolean")););if(!(f==null||typeof f=="boolean")){if(typeof f=="function"){let u;for(b(f)&&!(0,m.isSignal)(f)?(s||(s=new Map),s.has(f)||s.set(f,f()),u=s.get(f)):u=f();typeof u=="function"&&!P(u)&&!(0,m.isSignal)(u)&&!b(u);)s||(s=new Map),s.has(u)||s.set(u,u()),u=s.get(u);if(u==null||typeof u=="boolean")continue;if(typeof u=="function"){if((0,m.isSignal)(u)){if(a){let p=S("",!0);t.push(p),a.push({marker:p,sig:u});continue}let d=u();for(;typeof d=="function"&&(0,m.isSignal)(d);)d=d();if(d==null||typeof d=="boolean")continue;Array.isArray(d)?T(d,t,n,o,r,s):T([d],t,n,o,r,s);continue}continue}Array.isArray(u)?T(u,t,n,o,r,s,a):T([u],t,n,o,r,s,a);continue}if(P(f)){let u=S("",!0);t.push(u),f.then(d=>{if(u.parentNode){let p=[];if(T([d],p,u.parentNode,void 0,!1,s),p.length>0){u.parentNode.replaceChild(p[0],u);for(let y=1;y<p.length;y++)u.parentNode?.insertBefore(p[y],p[y-1].nextSibling)}}}).catch(d=>console.error("Error resolving promise in array:",d));continue}if(Array.isArray(f)){T(f,t,n,o,r,s,a);continue}if(v(f)){t.push(f);continue}if(typeof f=="object"&&f!==null&&"type"in f&&"props"in f){let u=f;if(typeof u.type=="function"){let d=u.type(u.props||{});Array.isArray(d)?T(d,t,n,o,!1,s):T([d],t,n,o,!1,s);continue}}if(typeof f=="string"||typeof f=="number"){let u=String(f);if(u.trim()===""&&u!==" ")continue;t.push(S(u));continue}t.push(S(String(f)))}}}}function Yt(e,t,n,o){for(let p=0;p<n.length;p++){let y=n[p].parentNode;y!==null&&y!==e&&y.nodeType!==11&&(n=n.slice(),n[p]=n[p].cloneNode(!0))}let r=n.length,s=t.length,a=r,i=0,f=0,u=s>0?t[s-1].nextSibling??void 0:o,d=null;for(;i<s||f<a;){if(t[i]===n[f]){i++,f++;continue}for(;s>i&&a>f&&t[s-1]===n[a-1];)s--,a--;if(s===i){let p=a<r?f?n[f-1].nextSibling??void 0:n[a-f]:u;for(;f<a;)g(e,n[f++],p)}else if(a===f)for(;i<s;)(!d||!d.has(t[i]))&&t[i].parentNode===e&&e.removeChild(t[i]),i++;else if(t[i]===n[a-1]&&n[f]===t[s-1]){let p=t[--s].nextSibling;g(e,n[f++],t[i++].nextSibling),g(e,n[--a],p),t[s]=t[i-1]}else{if(!d){d=new Map;let y=f;for(;y<a;)d.set(n[y],y++)}let p=d.get(t[i]);if(p!=null)if(f<p&&p<a){let y=i,ne=1;for(;++y<s&&y<a&&!(!d.has(t[y])||d.get(t[y])!==p+ne);)ne++;if(ne>p-f){let Je=t[i];for(;f<p;)g(e,n[f++],Je)}else t[i].parentNode===e?e.replaceChild(n[f++],t[i++]):(g(e,n[f++],u),i++)}else i++;else t[i].parentNode===e&&e.removeChild(t[i]),i++}}return n}function w(e,t,n){if(t)if(Array.isArray(t))for(let o=0;o<t.length;o++)t[o].parentNode===e&&e.removeChild(t[o]);else t.parentNode===e&&e.removeChild(t);return null}function g(e,t,n){c.active&&t.parentNode===e||(n&&n.parentNode===e?e.insertBefore(t,n):e.appendChild(t))}function _(e,t,n){n==null?delete e[t]:e[t]=n}function ce(e,t,n){let o=n,r;return Array.isArray(n)&&(o=n[0],r=n[1]),typeof o!="function"?()=>{}:(e.addEventListener(t,o,r),()=>e.removeEventListener(t,o,r))}function qe(e,t){if(!t||typeof t!="function")return;let n=t[K]?.name;if(!n)return;let o=n.indexOf(":");o!==-1&&(0,l.reportReactiveDirective)(e,n.slice(0,o),n.slice(o+1),t)}function G(e,t,n){let o=typeof n=="function"?(0,l.untrack)(()=>n()):n;if(!(!o||typeof o!="object"))for(let r of Object.keys(o))(0,l.reportReactiveDirective)(e,t,r)}function de(e,t){let n=(o,r)=>{typeof o=="function"&&((0,l.reportReactiveDirective)(e,"use",o.name||"use",r),o(e,r??(()=>{})))};if(typeof t=="function"){n(t);return}if(Array.isArray(t)){if(typeof t[0]=="function"){n(t[0],t[1]);return}for(let o of t)Array.isArray(o)?n(o[0],o[1]):n(o)}}function J(e,t,n,o=!1){return qe(e,n),typeof n!="function"?(x(e,t,n,o),()=>{}):(0,l.createRenderEffect)(()=>{(0,l.reportReactiveBinding)(e,"attribute",t,n);let r=typeof n=="function"?n():n;x(e,t,r,o)})}function X(e,t,n){return typeof n!="function"?(_(e,t,n),()=>{}):(qe(e,n),(0,l.createRenderEffect)(()=>{(0,l.reportReactiveBinding)(e,"property",t,n);let o=typeof n=="function"?n():n;_(e,t,o)}))}function pe(e,t,n){return typeof n!="function"?(x(e,t,!!n),()=>{}):(0,l.createRenderEffect)(()=>{(0,l.reportReactiveBinding)(e,"attribute",t,n);let o=n();x(e,t,!!o)})}function k(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){(0,l.createRenderEffect)(()=>{(0,l.reportReactiveBinding)(e,"attribute","class",t),k(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(o=>{let r=t[o];return typeof r=="function"?r():!!r}).join(" ");e.setAttribute("class",n);return}e.setAttribute("class",String(t))}function O(e,t,n){if(!(!t||typeof t!="object"))for(let o in t){let r=t[o],s=o.split(/\s+/).filter(Boolean);if(typeof r=="function"&&n)n.push((0,l.createRenderEffect)(()=>{let a=!!r();for(let i of s)e.classList.toggle(i,a)}));else{let a=!!(typeof r=="function"?r():r);for(let i of s)e.classList.toggle(i,a)}}}function $(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 o in n){let r=n[o];r==null?e.style[o]="":e.style[o]=r}}function Zt(e){let{element:t,props:n,prevProps:o=Ht,isSVG:r=!1,skipChildren:s=!1}=e;if(!t||!F(t))return console.error("[spread] Error: element is not a DOM Element!"),()=>{};if(!n)return console.warn("[spread] Warning: props is undefined!"),()=>{};let a=r||t.namespaceURI===I,i=[];for(let f in n){if(s&&f==="children")continue;let u=n[f],d=o[f];if(u===d)continue;if(f==="ref"){ye(u,t);continue}if(f==="use"){de(t,u);continue}if(f.startsWith("on:")){i.push(ce(t,f.slice(3),u));continue}if(f.startsWith("prop:")){(0,l.reportReactiveDirective)(t,"prop",f.slice(5),u),i.push(X(t,f.slice(5),u));continue}if(f.startsWith("attr:")){(0,l.reportReactiveDirective)(t,"attr",f.slice(5),u),i.push(J(t,f.slice(5),u,a));continue}if(f.startsWith("bool:")){(0,l.reportReactiveDirective)(t,"bool",f.slice(5),u),i.push(pe(t,f.slice(5),u));continue}if(f==="class"||f==="className"){typeof u=="function"?i.push((0,l.createRenderEffect)(()=>{(0,l.reportReactiveBinding)(t,"attribute","class",u),k(t,u())})):k(t,u);continue}if(f==="classList"){G(t,"class",u),typeof u=="function"?i.push((0,l.createRenderEffect)(()=>{(0,l.reportReactiveBinding)(t,"attribute","class",u),O(t,u())})):O(t,u,i);continue}if(f==="style"){G(t,"style",u),typeof u=="function"?i.push((0,l.createRenderEffect)(()=>{(0,l.reportReactiveBinding)(t,"attribute","style",u),$(t,u())})):$(t,u);continue}if(f.startsWith("on")){let y=f.slice(2).toLowerCase();d&&fe(t,y),u&&Ie(t,y,u);continue}let p=H.has(f)||!a&&f in t;typeof u=="function"?i.push(p?X(t,f,u):J(t,f,u,a)):i.push((0,l.createRenderEffect)(()=>p?_(t,f,n[f]):x(t,f,n[f],a)))}for(let f in o)if(!(f in n))if(f.startsWith("on")){let u=f.slice(2).toLowerCase();fe(t,u)}else H.has(f)?_(t,f,null):t.removeAttribute(f);return()=>{i.forEach(f=>f())}}function Qt(e,t,n=!1){for(let o in t){let r=t[o];if(o==="ref"){ye(r,e);continue}if(o!=="children"){if(o==="use"){de(e,r);continue}if(o.startsWith("on:")){ce(e,o.slice(3),r);continue}if(o.startsWith("prop:")){(0,l.reportReactiveDirective)(e,"prop",o.slice(5),r),X(e,o.slice(5),r);continue}if(o.startsWith("attr:")){(0,l.reportReactiveDirective)(e,"attr",o.slice(5),r),J(e,o.slice(5),r,n);continue}if(o.startsWith("bool:")){(0,l.reportReactiveDirective)(e,"bool",o.slice(5),r),pe(e,o.slice(5),r);continue}if(o.startsWith("on")&&o.length>2){let s=o.slice(2).toLowerCase();if(typeof r=="function")if(z.has(s)){e[`$$${s}`]=r;let a=`__fx_${s}`;if(!e[a]){let i=f=>{e[`$$${s}`]?.(f)};e.addEventListener(s,i),e[a]=i}}else e[`$$${s}`]=r,B.has(s)||ue([s]);continue}if(o==="class"||o==="className"){k(e,r);continue}if(o==="classList"){G(e,"class",r),typeof r=="function"?(0,l.createRenderEffect)(()=>{(0,l.reportReactiveBinding)(e,"attribute","class",r),O(e,r())}):O(e,r);continue}if(o==="style"){G(e,"style",r),typeof r=="function"?(0,l.createRenderEffect)(()=>{(0,l.reportReactiveBinding)(e,"attribute","style",r),$(e,r())}):$(e,r);continue}if(o==="innerHTML"){if(typeof r=="function"){let s=(0,l.createEffect)(()=>{let a=r();for(;typeof a=="function";)a=a();e.innerHTML=a});(0,l.onCleanup)(()=>s())}else e.innerHTML=r;continue}if(o==="value"&&(e.tagName==="INPUT"||e.tagName==="TEXTAREA")){if(typeof r=="function"){let s=(0,l.createEffect)(()=>{let a=r();for(;typeof a=="function"&&a.length===0;)a=a();document.activeElement!==e&&(e.value=a??"")});(0,l.onCleanup)(()=>{s()})}else(0,l.createRenderEffect)(()=>{document.activeElement!==e&&(e.value=t[o]??"")});continue}if(o==="checked"&&e.tagName==="INPUT"){if(typeof r=="function"){let s=(0,l.createEffect)(()=>{let a=r();for(;typeof a=="function"&&a.length===0;)a=a();document.activeElement!==e&&(e.checked=a??"")});(0,l.onCleanup)(()=>{s()})}else(0,l.createRenderEffect)(()=>{document.activeElement!==e&&(e.checked=t[o]??"")});continue}if(o==="value"&&e.tagName==="SELECT"){if(typeof r=="function"){let s=!0,a=(0,l.createEffect)(()=>{let i=r();for(;typeof i=="function"&&i.length===0;)i=i();s?(s=!1,queueMicrotask(()=>{e.value=i??""})):e.value=i??""});(0,l.onCleanup)(()=>{a()})}else{let s=!0;(0,l.createRenderEffect)(()=>{let a=t[o];s?(s=!1,queueMicrotask(()=>{e.value=a??""})):e.value=a??""})}continue}if(typeof r=="function"){let s=(0,l.createEffect)(()=>{let a=r();for(;typeof a=="function"&&a.length===0;)a=a();D(e,o,a,n)});(0,l.onCleanup)(()=>{s()})}else(0,l.createRenderEffect)(()=>D(e,o,t[o],n))}}}function en(...e){let t=o=>{for(let r=e.length-1;r>=0;r--){let s=e[r];if(s&&o in s&&s[o]!==void 0)return s[o]}},n=o=>{for(let r of e)if(r&&o in r)return!0;return!1};return new Proxy({},{get:(o,r)=>t(r),has:(o,r)=>n(r),ownKeys:()=>{let o=new Set;for(let r of e)if(r)for(let s of Reflect.ownKeys(r))o.add(s);return[...o]},getOwnPropertyDescriptor:(o,r)=>n(r)?{enumerable:!0,configurable:!0,get:()=>t(r)}:void 0})}function tn(e,...t){let n=new Set;for(let a of t)for(let i of a)n.add(i);let o=a=>({enumerable:!0,configurable:!0,get:()=>e[a]}),r=t.map(a=>{let i=new Set(a);return new Proxy({},{get:(f,u)=>i.has(u)?e[u]:void 0,has:(f,u)=>i.has(u)&&u in e,ownKeys:()=>Array.from(i).filter(f=>f in e),getOwnPropertyDescriptor:(f,u)=>i.has(u)&&u in e?o(u):void 0})}),s=new Proxy({},{get:(a,i)=>n.has(i)?void 0:e[i],has:(a,i)=>!n.has(i)&&i in e,ownKeys:()=>Reflect.ownKeys(e).filter(a=>!n.has(a)),getOwnPropertyDescriptor:(a,i)=>!n.has(i)&&i in e?o(i):void 0});return[...r,s]}function ye(e,t){if(!e)return;let n=e[K]?.name;if((0,l.reportReactiveDirective)(t,"ref",n||typeof e=="function"&&e.name||"ref",e),v(e)){let o=t,r=e;if(!o)return;typeof o=="function"?o(r):typeof o=="object"&&"current"in o&&(o.current=r);return}typeof e=="function"?e(t):typeof e=="object"&&"current"in e&&(e.current=t)}function nn(e,t,n){let o=t||document.body,r=(0,l.readChildren)(()=>e),s=[];return(0,l.batch)(()=>{let a=(0,l.createRenderEffect)(()=>{let i=r();Array.isArray(i)?(i.forEach(f=>o.appendChild(f)),s.push(()=>{i.forEach(f=>{f.parentNode===o&&o.removeChild(f)})})):v(i)&&(o.appendChild(i),s.push(()=>{i.parentNode===o&&o.removeChild(i)}))});s.push(a),(0,l.onCleanup)(()=>{s.forEach(i=>i())})}),null}function on(e){return typeof e=="string"&&e.toLowerCase()===e}function rn(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 sn(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function P(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}function an(e){return typeof e=="function"&&e.length===0&&(0,m.isSignal)(e)}function me(e,t,n){if(!t)throw new Error("Container element is required");let o,r,s=[];return(0,l.createRoot)(a=>{(0,l.batch)(()=>{c.active||(t.textContent=""),we(t),Se(),C(t,e)}),r=a}),()=>{r?.(),o?.(),s.forEach(a=>a()),t.textContent=""}}function fn(e){if(Array.isArray(e))return e;if(typeof e=="function"&&typeof e.set=="function")return[e,e.set];throw new TypeError("[fluixi] bind: needs a signal — either `signal(…)` or the `[get, set]` pair from `createSignal(…)`.")}var R=require("@fluixi/reactive");var un="__fx_dom_create_component__",A=globalThis[un]??={fn:null};function ln(e){A.fn=e}function cn(e={}){let t=e.signalSystem?.createComponent;t&&(A.fn=t)}function dn(e,t){if(A.fn)return A.fn(e,t);t&&(0,R.reportReactiveProps)(t);let n=typeof e=="function"?(0,R.untrack)(()=>e(t)):e,o=n!=null&&(typeof n=="function"||typeof n=="object");if(o)try{n.$name=e?.name}catch{}return o&&!(0,R.isSignal)(n)?ve(n):n}var pn=()=>A.fn!==null,yn=()=>A.fn!==null;function mn(){A.fn=null}var U,gn={getStore:()=>U,run(e,t){let n=U;U=e;try{return t()}finally{U=n}}},xn=gn;function Fe(){return xn.getStore()}var Y=require("@fluixi/reactive/signal");var hn="__FX_DATA__";var ge;function Ve(){let e=globalThis.__FX_DATA__;if(e)return e;if(ge!==void 0)return ge;let t=null;if(typeof document<"u"){let n=document.getElementById(hn)?.textContent;if(n)try{t=JSON.parse(n)}catch{t=null}}return ge=t}function Z(){for(;;){for(;c.cursor&&c.cursor.nodeType===3&&c.cursor.data==="";)c.cursor=c.cursor.nextSibling;if(c.cursor!=null||!c.parents.length)return;c.cursor=c.parents.pop().nextSibling}}var bn=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Q=typeof process<"u"&&process.env&&!1;function ee(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 En(e){Z();let t=c.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(bn.has(e.toLowerCase())?c.cursor=t.nextSibling:(c.parents.push(t),c.cursor=t.firstChild),t):(Q&&t&&ee(`<${e}>`,t),null)}function Tn(e){Z();let t=c.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(c.cursor=t.nextSibling,t):(Q&&t&&ee(`<${e}> (static)`,t),null)}function Nn(e){if(e===""){let n=c.cursor;return n&&n.nodeType===3&&n.data!==""?(c.cursor=n.nextSibling,n.data="",n):null}Z();let t=c.cursor;return t&&t.nodeType===3?(c.cursor=t.nextSibling,t.nodeValue!==e&&(t.nodeValue=e),t):(Q&&t&&ee(`text ${JSON.stringify(e.slice(0,24))}`,t),null)}function wn(e){Z();let t=c.cursor;return t&&t.nodeType===8&&t.data===e?(c.cursor=t.nextSibling,t):(Q&&t&&ee(`marker <!--${e.slice(0,24)}-->`,t),null)}var We=!1;function Sn(){We||(We=!0,Re({hydrateElement:En,hydrateText:Nn,hydrateMarker:wn,hydrateStatic:Tn}))}function te(e,t,n){Sn(),c.active=!0,c.cursor=t.firstChild,c.parents=[];let o=Ve(),r=n?.resourceNamespace,s=0;(0,Y.setResourceIdSource)(()=>r?`${r}:r${s++}`:`r${s++}`),(0,Y.setServerDataGetter)(o?a=>a in o?{value:o[a]}:void 0:null);try{return me(e,t)}finally{c.active=!1,c.cursor=null,c.parents=[]}}var xe="fluixi-island";function Be(e){let{component:t,props:n={},name:o}=e,r=le(xe),s=o??t.name??"Island";x(r,"name",s),x(r,"props",JSON.stringify(n??{}));let a=E()?Fe():void 0;if(a){let i=a.nextIslandNamespace(s);C(r,()=>a.withResourceScope(i,()=>t(n)))}else C(r,()=>t(n));return r}var Ke=!1;function vn(){if(Ke||typeof document>"u")return;Ke=!0;let e=document.createElement("style");e.textContent=`${xe}{display:contents}`,document.head.appendChild(e)}function Ge(e){if(typeof document>"u")return;vn();let t=document.querySelectorAll(xe),n=new Map;t.forEach(o=>{let r=o.getAttribute("name")??"",s=n.get(r)??0;n.set(r,s+1);let a=e[r];if(!a){typeof process>"u"&&console.warn(`[fluixi] island "${r}" has no component in the registry — left static.`);return}let i={};try{i=JSON.parse(o.getAttribute("props")||"{}")}catch{}te(()=>a(i),o,{resourceNamespace:`${r}#${s}`})})}
@@ -1 +1 @@
1
- function pt(e){return e.startsWith("aria-")||e.startsWith("data-")?e:/[A-Z]/.test(e)?e.replace(/([A-Z])/g,"-$1").toLowerCase():e}function yt(e){return e.startsWith("@")||e.startsWith("on")&&e.length>2}function mt(e){return e.startsWith("@")?e.slice(1):e.startsWith("on")?e.slice(2).toLowerCase():e}function gt(e,t){let n=new Set(["checked","value","selected","disabled","readonly","required","multiple","open","contenteditable","draggable","spellcheck"]),o={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)||o[e]&&o[e].has(t)}var xt=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),ht=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"]),G="http://www.w3.org/2000/svg";function Re(e){return e.localName.includes("-")}function J(e,t,n,o=!1){if(n==null){e.removeAttribute(t);return}if(Re(e)){e[t]=n;return}x(e,t,n,o)}var X=new Set(["className","value","checked","selected","innerHTML","innerText","textContent","indeterminate","htmlFor"]);function ie(e,t=document){return t.querySelector(e)}function Et(e,t=document){return Array.from(t.querySelectorAll(e))}function bt(e,t){return e.closest(t)}function Nt(e,...t){e.classList.add(...t)}function Tt(e,...t){e.classList.remove(...t)}function wt(e,...t){t.forEach(n=>e.classList.toggle(n))}function St(e,t){return e.classList.contains(t)}function x(e,t,n,o=!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 vt(e,t){return e.getAttribute(t)}function Ct(e,t){e.removeAttribute(t)}function Le(e,t){Object.assign(e.style,t)}function At(e,t){return window.getComputedStyle(e).getPropertyValue(t)}function Rt(e,t={},...n){let o=document.createElement(e);return Object.entries(t).forEach(([r,f])=>{if(r==="class"||r==="className")o.className=f;else if(r==="style"&&typeof f=="object")Le(o,f);else if(r.startsWith("on")&&typeof f=="function"){let s=r.slice(2).toLowerCase();o.addEventListener(s,f)}else x(o,r,f)}),n.forEach(r=>{typeof r=="string"?o.appendChild(document.createTextNode(r)):o.appendChild(r)}),o}function Lt(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function Pt(e,...t){t.forEach(n=>{typeof n=="string"?e.appendChild(document.createTextNode(n)):e.appendChild(n)})}function Mt(e){let t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=window.innerHeight&&t.right<=window.innerWidth}function _t(e,t={behavior:"smooth",block:"nearest"}){e.scrollIntoView(t)}function $t(e){let t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset,left:t.left+window.pageXOffset}}function It(e,t,n,o){let r=f=>{let s=f.target.closest(n);s&&e.contains(s)&&o(f,s)};return e.addEventListener(t,r),()=>{e.removeEventListener(t,r)}}function Ot(e,t=5e3){return new Promise((n,o)=>{let r=ie(e);if(r){n(r);return}let f=new MutationObserver(()=>{let i=ie(e);i&&(f.disconnect(),clearTimeout(s),n(i))});f.observe(document.body,{childList:!0,subtree:!0});let s=setTimeout(()=>{f.disconnect(),o(new Error(`Element ${e} not found within ${t}ms`))},t)})}function kt(e,t,n={}){let o=new IntersectionObserver(r=>{r.forEach(f=>{t(f.isIntersecting)})},n);return o.observe(e),()=>{o.disconnect()}}function Dt(e,t){let n=new ResizeObserver(o=>{o.forEach(t)});return n.observe(e),()=>{n.disconnect()}}var Pe=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;function Ft(e){return typeof e=="object"&&e!==null&&e.$$typeof===Pe}function Me(e){return e&&typeof e=="object"&&e.strings&&Array.isArray(e.strings)&&e.values&&Array.isArray(e.values)}function Ht(e){if(typeof e!="function")return!1;try{let t=e();return Me(t)}catch{return!1}}function jt(e){return typeof e=="object"&&e!==null&&(e.$$typeof==="template"||typeof e.type=="function")}function qt(e){return e instanceof Node}function Vt(e,t,n="Fluixi"){typeof globalThis<"u"&&(typeof globalThis[n]>"u"&&(globalThis[n]={}),typeof globalThis[n][e]>"u"&&(globalThis[n][e]=t))}function Wt(e,t,n="Fluixi"){return typeof globalThis<"u"&&typeof globalThis[n]<"u"&&typeof globalThis[n][e]<"u"?globalThis[n][e]:t}import{isSignal as g}from"@fluixi/reactive/signal";var se="1.0.0-alpha.82";import{VERSION as _e}from"@fluixi/reactive/version";var h={dom:se,reactive:_e};function ae(e){h.core&&e.setAttribute("fluixi",h.core),e.setAttribute("fx-dom",h.dom),e.setAttribute("fx-reactive",h.reactive),typeof globalThis<"u"&&(globalThis.Fluixi=h)}function fe(){let e=[h.core,h.dom,h.reactive].filter(t=>t!==void 0);new Set(e).size<=1||console.warn(`[fluixi] package versions disagree — core ${h.core??"(absent)"}, dom ${h.dom}, reactive ${h.reactive}. These ship as one release, so a mismatch usually means a stale lockfile or two copies resolved side by side. Reinstall, or check for duplicates with \`pnpm why @fluixi/dom\`.`)}function ue(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-component"),{value:!0,enumerable:!0}),e}function E(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}import{batch as me,createEffect as R,createRenderEffect as y,createRoot as De,onCleanup as v,readChildren as Fe}from"@fluixi/reactive/signal";var b=typeof document>"u";function $e(e){b=e}var z=Symbol.for("fluixi.server-node"),le=null;function P(){if(!le)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return le}function A(e){return e!=null&&e[z]===!0?!0:typeof Node<"u"&&e instanceof Node}function U(e){return e!=null&&e[z]===!0?e.nodeType===1:typeof Element<"u"&&e instanceof Element}function Y(e){return e!=null&&e[z]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var l={active:!1,cursor:null,parents:[]},ce=null;function de(e){ce=e}function M(){return ce}function Z(e,t){return l.active&&t.parentNode===e}function Q(e){let t=l.parents.lastIndexOf(e);t!==-1&&(l.parents.length=t),l.cursor=e.nextSibling}function Ie(){return l.active?l.cursor:null}function _(e,t){if(!e||e.parentNode==null)return t();let n=l.active,o=l.cursor,r=l.parents;l.active=!0,l.cursor=e,l.parents=[];try{return t()}finally{l.active=n,l.cursor=o,l.parents=r}}function Oe(e){if(!l.active)return e();let t=l.cursor,n=l.parents;l.active=!1,l.parents=[];try{return e()}finally{l.active=!0,l.cursor=t,l.parents=n}}function ke(e){if(!l.active||e==null)return;let t=Array.isArray(e)?e[e.length-1]:e;t&&typeof t.nodeType=="number"&&Q(t)}function He(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 o=0,r=e;for(;r=r.previousElementSibling;)r.tagName===e.tagName&&o++;n+=`:nth-of-type(${o+1})`,t.unshift(n),e=e.parentElement}return t.join(">")}function je(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 an(e){return je(He(e))}var fn=()=>"xxyxxxxxxy-4xx8".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)}),qe={};var pe=new Map,I=new Set,j=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);function ge(e){if(!b)for(let t of e)I.has(t)||j.has(t)||(I.add(t),document.addEventListener(t,Ve))}function Ve(e){let t=`$$${e.type}`,n=e.composedPath&&e.composedPath()[0]||e.target;for(;n;){let o=n[t];if(o&&!n.disabled&&(o(e),e.cancelBubble))return;n=n.host&&n.host!==n&&n.host instanceof Element?n.host:n.parentNode}}function We(e,t,n){if(e[`$$${t}`]=n,j.has(t)){let o=`__fx_${t}`;if(!e[o]){let r=f=>{e[`$$${t}`]?.(f)};e.addEventListener(t,r),e[o]=r}return}I.has(t)||ge([t])}function ye(e,t){delete e[`$$${t}`];let n=`__fx_${t}`,o=e[n];o&&(e.removeEventListener(t,o),delete e[n])}function un(e){return!j.has(e)}function ln(e){return typeof e=="function"}function w(e,t=!1){if(b)return P().createText(e);if(l.active&&!t){let n=M()?.hydrateText(e);if(n)return n}return document.createTextNode(e)}function xe(e,t=!1){if(b)return P().createElement(e,t);if(l.active){let n=M()?.hydrateElement(e);if(n)return n}return t?document.createElementNS(G,e):document.createElement(e)}function Ke(e,t=!1){let n=pe.get(e);if(n)return n;let o=document.createElement("template");return t?o.innerHTML=`<svg>${e}</svg>`:o.innerHTML=e,pe.set(e,o),o}function cn(e,t,n=!1,o=!1){if(b){let r=P();return n?r.parseTemplate(e,o):r.createRaw(e)}if(l.active){let r=M()?.hydrateStatic(t);if(r)return r}return Be(Ke(e,o),o).firstChild}function dn(e,t){if(!l.active)return t();let n=_(e.nextSibling,t);if(typeof n=="function"){let o=n;return((...r)=>l.active?_(e.nextSibling,()=>o(...r)):o(...r))}return n}function pn(e){for(let t=e.nextSibling;t;t=t.nextSibling)if(t.nodeType===8&&t.data==="fx/")return t;throw new Error("[fluixi] template hole is missing its closing marker")}function yn(e,t){let n=[];for(let o=e.nextSibling;o&&o!==t;o=o.nextSibling)n.push(o);return n}function Be(e,t=!1){let n=e.content.cloneNode(!0);return t?n.firstChild:n}function Ge(e){return Array.isArray(e)?e.length===2&&e[1]===" "?Array.isArray(e[0])?Ge(e[0]):(typeof e[0]=="function",e[0]):e.length===1&&typeof e[0]=="function"?e[0]:e:e}function mn(e){return typeof e!="function"?null:e._name||e.name||"anonymous"}function gn(e){if(g(e)||E(e)||typeof e!="function")return e;let t=e();for(;typeof t=="function"&&!g(t)&&!E(t);)t=t();return t}var T=0,Je=200;function Xe(e,t,n,o,r){let f=o,s=new Map;return y(()=>{let i;if(E(e)&&!g(e)){if(!s.has(e)){T++;try{let a=e();s.set(e,a)}finally{T--}}for(i=s.get(e);typeof i=="function"&&g(i);)i=i()}else for(i=e();typeof i=="function"&&g(i);)i=i();{let a=0;for(;typeof i=="function"&&a++<50;)if(E(i)){if(!s.has(i)){let u=i;T++;try{let c=u();s.set(u,c)}finally{T--}}i=s.get(i)}else if(g(i))i=i();else if(i=i(),typeof i!="function"||!g(i)&&!E(i))break}T++;try{f=O(t,i,n,f,s),r(f)}finally{T--}})}function L(e,t,n,o){if(T>Je)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;n!==void 0&&!n&&(n=w("",!0),e.appendChild(n));let r=o??null,f=a=>Array.isArray(a)&&a.some(u=>typeof u=="function"),s=a=>typeof a=="function"?a:()=>a;if(typeof t!="function"&&!f(t)){T++;try{r=O(e,t,n,r)}finally{T--}return()=>r}let i=Xe(s(t),e,n,r,a=>{r=a});return()=>(i?.(),r)}function O(e,t,n,o,r){if(t==null||typeof t=="boolean")return S(e,o,n);if(typeof t=="function")for(;typeof t=="function";)t=t();if(t==null||typeof t=="boolean")return S(e,o,n);if($(t)){let s=w("",!0);return Array.isArray(o)?o.length>0?(e.replaceChild(s,o[0]),S(e,o.slice(1),n)):m(e,s,n):o?e.replaceChild(s,o):m(e,s,n),t.then(i=>{s.parentNode===e&&O(e,i,s.nextSibling,s)}).catch(i=>{console.error("Error resolving promise in insertExpression:",i)}),s}let f=typeof t;if(f==="string"||f==="number"){if(f==="number"&&(t=String(t)),Array.isArray(o)){if(o.length===0){let i=w(t);return m(e,i,n),i}if(o.length===1&&o[0].nodeType===3)return o[0].data=t,o;o=S(e,o,n)}if(o&&Y(o))return o.data=t,o;let s=w(t);return o&&o.parentNode===e?e.replaceChild(s,o):Z(e,s)||m(e,s,n),s}if(A(t))return Z(e,t)?(Q(t),t):Array.isArray(o)?(o.length===0?m(e,t,n):o[0].parentNode===e?(e.replaceChild(t,o[0]),S(e,o.slice(1),n)):m(e,t,n),t):(o?o!==t&&(o.parentNode===e?e.replaceChild(t,o):m(e,t,n)):m(e,t,n),t);if(Array.isArray(t)){let s=[],i=Array.isArray(o)?o:o?[o]:[],a=[];N(t,s,e,n,!0,r,a);let u=ze(e,i,s,n);for(let c of a){let d=L(e,c.sig,c.marker);v(()=>{S(e,d()),c.marker.parentNode===e&&e.removeChild(c.marker)})}return u}if(f==="object"&&t!==null&&typeof t=="object"){let s=t;if("type"in s&&"props"in s){let i=s;if(typeof i.type=="function"){let a=i.type(i.props||{});return O(e,a,n,o)}}}return S(e,o,n)}function N(e,t,n,o,r=!0,f,s){for(let i=0;i<e.length;i++){let a=e[i];if(!(a==null||typeof a=="boolean")){for(;typeof a=="function"&&!$(a)&&!g(a)&&!E(a)&&(a=a(),!(a==null||typeof a=="boolean")););if(!(a==null||typeof a=="boolean")){if(typeof a=="function"){let u;for(E(a)&&!g(a)?(f||(f=new Map),f.has(a)||f.set(a,a()),u=f.get(a)):u=a();typeof u=="function"&&!$(u)&&!g(u)&&!E(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(g(u)){if(s){let d=w("",!0);t.push(d),s.push({marker:d,sig:u});continue}let c=u();for(;typeof c=="function"&&g(c);)c=c();if(c==null||typeof c=="boolean")continue;Array.isArray(c)?N(c,t,n,o,r,f):N([c],t,n,o,r,f);continue}continue}Array.isArray(u)?N(u,t,n,o,r,f,s):N([u],t,n,o,r,f,s);continue}if($(a)){let u=w("",!0);t.push(u),a.then(c=>{if(u.parentNode){let d=[];if(N([c],d,u.parentNode,void 0,!1,f),d.length>0){u.parentNode.replaceChild(d[0],u);for(let p=1;p<d.length;p++)u.parentNode?.insertBefore(d[p],d[p-1].nextSibling)}}}).catch(c=>console.error("Error resolving promise in array:",c));continue}if(Array.isArray(a)){N(a,t,n,o,r,f,s);continue}if(A(a)){t.push(a);continue}if(typeof a=="object"&&a!==null&&"type"in a&&"props"in a){let u=a;if(typeof u.type=="function"){let c=u.type(u.props||{});Array.isArray(c)?N(c,t,n,o,!1,f):N([c],t,n,o,!1,f);continue}}if(typeof a=="string"||typeof a=="number"){let u=String(a);if(u.trim()===""&&u!==" ")continue;t.push(w(u));continue}t.push(w(String(a)))}}}}function ze(e,t,n,o){for(let d=0;d<n.length;d++){let p=n[d].parentNode;p!==null&&p!==e&&p.nodeType!==11&&(n=n.slice(),n[d]=n[d].cloneNode(!0))}let r=n.length,f=t.length,s=r,i=0,a=0,u=f>0?t[f-1].nextSibling??void 0:o,c=null;for(;i<f||a<s;){if(t[i]===n[a]){i++,a++;continue}for(;f>i&&s>a&&t[f-1]===n[s-1];)f--,s--;if(f===i){let d=s<r?a?n[a-1].nextSibling??void 0:n[s-a]:u;for(;a<s;)m(e,n[a++],d)}else if(s===a)for(;i<f;)(!c||!c.has(t[i]))&&t[i].parentNode===e&&e.removeChild(t[i]),i++;else if(t[i]===n[s-1]&&n[a]===t[f-1]){let d=t[--f].nextSibling;m(e,n[a++],t[i++].nextSibling),m(e,n[--s],d),t[f]=t[i-1]}else{if(!c){c=new Map;let p=a;for(;p<s;)c.set(n[p],p++)}let d=c.get(t[i]);if(d!=null)if(a<d&&d<s){let p=i,B=1;for(;++p<f&&p<s&&!(!c.has(t[p])||c.get(t[p])!==d+B);)B++;if(B>d-a){let Ae=t[i];for(;a<d;)m(e,n[a++],Ae)}else t[i].parentNode===e?e.replaceChild(n[a++],t[i++]):(m(e,n[a++],u),i++)}else i++;else t[i].parentNode===e&&e.removeChild(t[i]),i++}}return n}function S(e,t,n){if(t)if(Array.isArray(t))for(let o=0;o<t.length;o++)t[o].parentNode===e&&e.removeChild(t[o]);else t.parentNode===e&&e.removeChild(t);return null}function m(e,t,n){l.active&&t.parentNode===e||(n&&n.parentNode===e?e.insertBefore(t,n):e.appendChild(t))}function k(e,t,n){n==null?delete e[t]:e[t]=n}function he(e,t,n){let o=n,r;return Array.isArray(n)&&(o=n[0],r=n[1]),typeof o!="function"?()=>{}:(e.addEventListener(t,o,r),()=>e.removeEventListener(t,o,r))}function Ee(e,t){let n=(o,r)=>{typeof o=="function"&&o(e,r??(()=>{}))};if(typeof t=="function"){n(t);return}if(Array.isArray(t)){if(typeof t[0]=="function"){n(t[0],t[1]);return}for(let o of t)Array.isArray(o)?n(o[0],o[1]):n(o)}}function ee(e,t,n,o=!1){return typeof n!="function"?(x(e,t,n,o),()=>{}):y(()=>{let r=typeof n=="function"?n():n;x(e,t,r,o)})}function te(e,t,n){return typeof n!="function"?(k(e,t,n),()=>{}):y(()=>{let o=typeof n=="function"?n():n;k(e,t,o)})}function be(e,t,n){return typeof n!="function"?(x(e,t,!!n),()=>{}):y(()=>{let o=n();x(e,t,!!o)})}function D(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){y(()=>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(o=>{let r=t[o];return typeof r=="function"?r():!!r}).join(" ");e.setAttribute("class",n);return}e.setAttribute("class",String(t))}function F(e,t,n){if(!(!t||typeof t!="object"))for(let o in t){let r=t[o],f=o.split(/\s+/).filter(Boolean);if(typeof r=="function"&&n)n.push(y(()=>{let s=!!r();for(let i of f)e.classList.toggle(i,s)}));else{let s=!!(typeof r=="function"?r():r);for(let i of f)e.classList.toggle(i,s)}}}function H(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 o in n){let r=n[o];r==null?e.style[o]="":e.style[o]=r}}function xn(e){let{element:t,props:n,prevProps:o=qe,isSVG:r=!1,skipChildren:f=!1}=e;if(!t||!U(t))return console.error("[spread] Error: element is not a DOM Element!"),()=>{};if(!n)return console.warn("[spread] Warning: props is undefined!"),()=>{};let s=r||t.namespaceURI===G,i=[];for(let a in n){if(f&&a==="children")continue;let u=n[a],c=o[a];if(u===c)continue;if(a==="ref"){Ne(u,t);continue}if(a==="use"){Ee(t,u);continue}if(a.startsWith("on:")){i.push(he(t,a.slice(3),u));continue}if(a.startsWith("prop:")){i.push(te(t,a.slice(5),u));continue}if(a.startsWith("attr:")){i.push(ee(t,a.slice(5),u,s));continue}if(a.startsWith("bool:")){i.push(be(t,a.slice(5),u));continue}if(a==="class"||a==="className"){typeof u=="function"?i.push(y(()=>D(t,u()))):D(t,u);continue}if(a==="classList"){typeof u=="function"?i.push(y(()=>F(t,u()))):F(t,u,i);continue}if(a==="style"){typeof u=="function"?i.push(y(()=>H(t,u()))):H(t,u);continue}if(a.startsWith("on")){let p=a.slice(2).toLowerCase();c&&ye(t,p),u&&We(t,p,u);continue}let d=X.has(a)||!s&&a in t;typeof u=="function"?i.push(d?te(t,a,u):ee(t,a,u,s)):i.push(y(()=>d?k(t,a,n[a]):x(t,a,n[a],s)))}for(let a in o)if(!(a in n))if(a.startsWith("on")){let u=a.slice(2).toLowerCase();ye(t,u)}else X.has(a)?k(t,a,null):t.removeAttribute(a);return()=>{i.forEach(a=>a())}}function hn(e,t,n=!1){for(let o in t){let r=t[o];if(o==="ref"){Ne(r,e);continue}if(o!=="children"){if(o==="use"){Ee(e,r);continue}if(o.startsWith("on:")){he(e,o.slice(3),r);continue}if(o.startsWith("prop:")){te(e,o.slice(5),r);continue}if(o.startsWith("attr:")){ee(e,o.slice(5),r,n);continue}if(o.startsWith("bool:")){be(e,o.slice(5),r);continue}if(o.startsWith("on")&&o.length>2){let f=o.slice(2).toLowerCase();if(typeof r=="function")if(j.has(f)){e[`$$${f}`]=r;let s=`__fx_${f}`;if(!e[s]){let i=a=>{e[`$$${f}`]?.(a)};e.addEventListener(f,i),e[s]=i}}else e[`$$${f}`]=r,I.has(f)||ge([f]);continue}if(o==="class"||o==="className"){D(e,r);continue}if(o==="classList"){typeof r=="function"?y(()=>F(e,r())):F(e,r);continue}if(o==="style"){typeof r=="function"?y(()=>H(e,r())):H(e,r);continue}if(o==="innerHTML"){if(typeof r=="function"){let f=R(()=>{let s=r();for(;typeof s=="function";)s=s();e.innerHTML=s});v(()=>f())}else e.innerHTML=r;continue}if(o==="value"&&(e.tagName==="INPUT"||e.tagName==="TEXTAREA")){if(typeof r=="function"){let f=R(()=>{let s=r();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.value=s??"")});v(()=>{f()})}else y(()=>{document.activeElement!==e&&(e.value=t[o]??"")});continue}if(o==="checked"&&e.tagName==="INPUT"){if(typeof r=="function"){let f=R(()=>{let s=r();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.checked=s??"")});v(()=>{f()})}else y(()=>{document.activeElement!==e&&(e.checked=t[o]??"")});continue}if(o==="value"&&e.tagName==="SELECT"){if(typeof r=="function"){let f=!0,s=R(()=>{let i=r();for(;typeof i=="function"&&i.length===0;)i=i();f?(f=!1,queueMicrotask(()=>{e.value=i??""})):e.value=i??""});v(()=>{s()})}else{let f=!0;y(()=>{let s=t[o];f?(f=!1,queueMicrotask(()=>{e.value=s??""})):e.value=s??""})}continue}if(typeof r=="function"){let f=R(()=>{let s=r();for(;typeof s=="function"&&s.length===0;)s=s();J(e,o,s,n)});v(()=>{f()})}else y(()=>J(e,o,t[o],n))}}}function En(...e){let t=o=>{for(let r=e.length-1;r>=0;r--){let f=e[r];if(f&&o in f&&f[o]!==void 0)return f[o]}},n=o=>{for(let r of e)if(r&&o in r)return!0;return!1};return new Proxy({},{get:(o,r)=>t(r),has:(o,r)=>n(r),ownKeys:()=>{let o=new Set;for(let r of e)if(r)for(let f of Reflect.ownKeys(r))o.add(f);return[...o]},getOwnPropertyDescriptor:(o,r)=>n(r)?{enumerable:!0,configurable:!0,get:()=>t(r)}:void 0})}function bn(e,...t){let n=new Set;for(let s of t)for(let i of s)n.add(i);let o=s=>({enumerable:!0,configurable:!0,get:()=>e[s]}),r=t.map(s=>{let i=new Set(s);return new Proxy({},{get:(a,u)=>i.has(u)?e[u]:void 0,has:(a,u)=>i.has(u)&&u in e,ownKeys:()=>Array.from(i).filter(a=>a in e),getOwnPropertyDescriptor:(a,u)=>i.has(u)&&u in e?o(u):void 0})}),f=new Proxy({},{get:(s,i)=>n.has(i)?void 0:e[i],has:(s,i)=>!n.has(i)&&i in e,ownKeys:()=>Reflect.ownKeys(e).filter(s=>!n.has(s)),getOwnPropertyDescriptor:(s,i)=>!n.has(i)&&i in e?o(i):void 0});return[...r,f]}function Ne(e,t){if(e){if(A(e)){let n=t,o=e;if(!n)return;typeof n=="function"?n(o):typeof n=="object"&&"current"in n&&(n.current=o);return}typeof e=="function"?e(t):typeof e=="object"&&"current"in e&&(e.current=t)}}function Nn(e,t,n){let o=t||document.body,r=Fe(()=>e),f=[];return me(()=>{let s=y(()=>{let i=r();Array.isArray(i)?(i.forEach(a=>o.appendChild(a)),f.push(()=>{i.forEach(a=>{a.parentNode===o&&o.removeChild(a)})})):A(i)&&(o.appendChild(i),f.push(()=>{i.parentNode===o&&o.removeChild(i)}))});f.push(s),v(()=>{f.forEach(i=>i())})}),null}function Tn(e){return typeof e=="string"&&e.toLowerCase()===e}function wn(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 Sn(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function $(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}function vn(e){return typeof e=="function"&&e.length===0&&g(e)}function Te(e,t,n){if(!t)throw new Error("Container element is required");let o,r,f=[];return De(s=>{me(()=>{l.active||(t.textContent=""),ae(t),fe(),L(t,e)}),r=s}),()=>{r?.(),o?.(),f.forEach(s=>s()),t.textContent=""}}function Cn(e){if(Array.isArray(e))return e;if(typeof e=="function"&&typeof e.set=="function")return[e,e.set];throw new TypeError("[fluixi] bind: needs a signal — either `signal(…)` or the `[get, set]` pair from `createSignal(…)`.")}import{untrack as Ue,isSignal as Ye}from"@fluixi/reactive";var Ze="__fx_dom_create_component__",C=globalThis[Ze]??={fn:null};function Pn(e){C.fn=e}function Mn(e={}){let t=e.signalSystem?.createComponent;t&&(C.fn=t)}function _n(e,t){if(C.fn)return C.fn(e,t);let n=typeof e=="function"?Ue(()=>e(t)):e;if(n!=null&&(typeof n=="function"||typeof n=="object")&&!Ye(n)){try{n.$name=e?.name}catch{}return ue(n)}return n}var $n=()=>C.fn!==null,In=()=>C.fn!==null;function On(){C.fn=null}var q,Qe={getStore:()=>q,run(e,t){let n=q;q=e;try{return t()}finally{q=n}}},et=Qe;function we(){return et.getStore()}import{setResourceIdSource as nt,setServerDataGetter as ot}from"@fluixi/reactive/signal";var tt="__FX_DATA__";var ne;function Se(){let e=globalThis.__FX_DATA__;if(e)return e;if(ne!==void 0)return ne;let t=null;if(typeof document<"u"){let n=document.getElementById(tt)?.textContent;if(n)try{t=JSON.parse(n)}catch{t=null}}return ne=t}function V(){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 rt=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),W=typeof process<"u"&&process.env&&!1;function K(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 it(e){V();let t=l.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(rt.has(e.toLowerCase())?l.cursor=t.nextSibling:(l.parents.push(t),l.cursor=t.firstChild),t):(W&&t&&K(`<${e}>`,t),null)}function st(e){V();let t=l.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(l.cursor=t.nextSibling,t):(W&&t&&K(`<${e}> (static)`,t),null)}function at(e){if(e===""){let n=l.cursor;return n&&n.nodeType===3&&n.data!==""?(l.cursor=n.nextSibling,n.data="",n):null}V();let t=l.cursor;return t&&t.nodeType===3?(l.cursor=t.nextSibling,t.nodeValue!==e&&(t.nodeValue=e),t):(W&&t&&K(`text ${JSON.stringify(e.slice(0,24))}`,t),null)}function ft(e){V();let t=l.cursor;return t&&t.nodeType===8&&t.data===e?(l.cursor=t.nextSibling,t):(W&&t&&K(`marker <!--${e.slice(0,24)}-->`,t),null)}var ve=!1;function ut(){ve||(ve=!0,de({hydrateElement:it,hydrateText:at,hydrateMarker:ft,hydrateStatic:st}))}function oe(e,t,n){ut(),l.active=!0,l.cursor=t.firstChild,l.parents=[];let o=Se(),r=n?.resourceNamespace,f=0;nt(()=>r?`${r}:r${f++}`:`r${f++}`),ot(o?s=>s in o?{value:o[s]}:void 0:null);try{return Te(e,t)}finally{l.active=!1,l.cursor=null,l.parents=[]}}var re="fluixi-island";function lt(e){let{component:t,props:n={},name:o}=e,r=xe(re),f=o??t.name??"Island";x(r,"name",f),x(r,"props",JSON.stringify(n??{}));let s=b?we():void 0;if(s){let i=s.nextIslandNamespace(f);L(r,()=>s.withResourceScope(i,()=>t(n)))}else L(r,()=>t(n));return r}var Ce=!1;function ct(){if(Ce||typeof document>"u")return;Ce=!0;let e=document.createElement("style");e.textContent=`${re}{display:contents}`,document.head.appendChild(e)}function dt(e){if(typeof document>"u")return;ct();let t=document.querySelectorAll(re),n=new Map;t.forEach(o=>{let r=o.getAttribute("name")??"",f=n.get(r)??0;n.set(r,f+1);let s=e[r];if(!s){typeof process>"u"&&console.warn(`[fluixi] island "${r}" has no component in the registry — left static.`);return}let i={};try{i=JSON.parse(o.getAttribute("props")||"{}")}catch{}oe(()=>s(i),o,{resourceNamespace:`${r}#${f}`})})}export{lt as Island,X as JSX_PROPERTIES,ht as SVG_ELEMENTS,G as SVG_NAMESPACE,xt as VOID_ELEMENTS,Nt as addClass,We as addDelegatedEventListener,he as addNativeEventListener,Pt as appendChildren,J as applyElementProp,hn as applyProps,Ee as applyUse,Cn as bindPair,Ie as captureHydrationCursor,S as cleanChildren,Be as cloneTemplate,bt as closest,_n as createComponent,Rt as createElement,xe as createNativeElement,Nn as createPortal,Ke as createTemplate,It as delegate,ge as delegateEvents,Sn as escapeHTML,mn as fnName,fn as generateID,vt as getAttribute,Wt as getGlobal,mt as getLitEventName,$t as getOffset,an as getStableElementId,At as getStyle,Ne as handleRef,St as hasClass,yn as holeContent,pn as holeEnd,dn as holeScope,oe as hydrate,ke as hydrateAdvancePast,dt as hydrateIslands,Mn as initializeIntegration,L as insert,O as insertExpression,$n as intergartionInitialized,vn as isAccessor,Re as isCustomElement,qt as isDOMNode,un as isDelegatedEvent,U as isDomElement,A as isDomNode,Y as isDomText,yt as isEventHandler,ln as isFunction,In as isIntegrationInitialized,jt as isJSXTemplate,Me as isLitTemplateResult,Tn as isNativeElement,$ as isPromise,Ft as isReactElement,wn as isSVGElement,b as isServer,Ht as isTemplateFactory,Mt as isVisible,gn as iterateFn,Ge as makeArrayFlat,En as mergeProps,kt as observeIntersection,Dt as observeResize,ie as query,Et as queryAll,Pn as registerCreateComponent,Vt as registerGlobal,Ct as removeAttribute,Lt as removeChildren,Tt as removeClass,ye as removeDelegatedEventListener,Te as render,On as resetIntegration,_ as runHydrationAt,Oe as runWithoutHydration,_t as scrollIntoView,x as setAttribute,F as setClassList,D as setClassName,ee as setDynamicAttribute,be as setDynamicBoolAttribute,te as setDynamicProperty,k as setProperty,$e as setServerMode,H as setStyle,Le as setStyles,gt as shouldSetAsProperty,bn as splitProps,xn as spread,cn as templateNode,pt as toAttributeName,wt as toggleClass,Ot as waitForElement};
1
+ function At(e){return e.startsWith("aria-")||e.startsWith("data-")?e:/[A-Z]/.test(e)?e.replace(/([A-Z])/g,"-$1").toLowerCase():e}function Ct(e){return e.startsWith("@")||e.startsWith("on")&&e.length>2}function Rt(e){return e.startsWith("@")?e.slice(1):e.startsWith("on")?e.slice(2).toLowerCase():e}function Lt(e,t){let n=new Set(["checked","value","selected","disabled","readonly","required","multiple","open","contenteditable","draggable","spellcheck"]),o={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)||o[e]&&o[e].has(t)}var Pt=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Mt=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"]),Y="http://www.w3.org/2000/svg";function Ie(e){return e.localName.includes("-")}function Z(e,t,n,o=!1){if(n==null){e.removeAttribute(t);return}if(Ie(e)){e[t]=n;return}x(e,t,n,o)}var Q=new Set(["className","value","checked","selected","innerHTML","innerText","textContent","indeterminate","htmlFor"]);function le(e,t=document){return t.querySelector(e)}function _t(e,t=document){return Array.from(t.querySelectorAll(e))}function kt(e,t){return e.closest(t)}function Ot(e,...t){e.classList.add(...t)}function $t(e,...t){e.classList.remove(...t)}function It(e,...t){t.forEach(n=>e.classList.toggle(n))}function Dt(e,t){return e.classList.contains(t)}function x(e,t,n,o=!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 Ht(e,t){return e.getAttribute(t)}function jt(e,t){e.removeAttribute(t)}function De(e,t){Object.assign(e.style,t)}function qt(e,t){return window.getComputedStyle(e).getPropertyValue(t)}function Ft(e,t={},...n){let o=document.createElement(e);return Object.entries(t).forEach(([r,s])=>{if(r==="class"||r==="className")o.className=s;else if(r==="style"&&typeof s=="object")De(o,s);else if(r.startsWith("on")&&typeof s=="function"){let a=r.slice(2).toLowerCase();o.addEventListener(a,s)}else x(o,r,s)}),n.forEach(r=>{typeof r=="string"?o.appendChild(document.createTextNode(r)):o.appendChild(r)}),o}function Vt(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function Wt(e,...t){t.forEach(n=>{typeof n=="string"?e.appendChild(document.createTextNode(n)):e.appendChild(n)})}function Kt(e){let t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=window.innerHeight&&t.right<=window.innerWidth}function Bt(e,t={behavior:"smooth",block:"nearest"}){e.scrollIntoView(t)}function Gt(e){let t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset,left:t.left+window.pageXOffset}}function Jt(e,t,n,o){let r=s=>{let a=s.target.closest(n);a&&e.contains(a)&&o(s,a)};return e.addEventListener(t,r),()=>{e.removeEventListener(t,r)}}function Xt(e,t=5e3){return new Promise((n,o)=>{let r=le(e);if(r){n(r);return}let s=new MutationObserver(()=>{let i=le(e);i&&(s.disconnect(),clearTimeout(a),n(i))});s.observe(document.body,{childList:!0,subtree:!0});let a=setTimeout(()=>{s.disconnect(),o(new Error(`Element ${e} not found within ${t}ms`))},t)})}function zt(e,t,n={}){let o=new IntersectionObserver(r=>{r.forEach(s=>{t(s.isIntersecting)})},n);return o.observe(e),()=>{o.disconnect()}}function Ut(e,t){let n=new ResizeObserver(o=>{o.forEach(t)});return n.observe(e),()=>{n.disconnect()}}var He=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;function Yt(e){return typeof e=="object"&&e!==null&&e.$$typeof===He}function je(e){return e&&typeof e=="object"&&e.strings&&Array.isArray(e.strings)&&e.values&&Array.isArray(e.values)}function Zt(e){if(typeof e!="function")return!1;try{let t=e();return je(t)}catch{return!1}}function Qt(e){return typeof e=="object"&&e!==null&&(e.$$typeof==="template"||typeof e.type=="function")}function en(e){return e instanceof Node}function tn(e,t,n="Fluixi"){typeof globalThis<"u"&&(typeof globalThis[n]>"u"&&(globalThis[n]={}),typeof globalThis[n][e]>"u"&&(globalThis[n][e]=t))}function nn(e,t,n="Fluixi"){return typeof globalThis<"u"&&typeof globalThis[n]<"u"&&typeof globalThis[n][e]<"u"?globalThis[n][e]:t}import{isSignal as g}from"@fluixi/reactive/signal";var ce="1.0.0-alpha.83";import{VERSION as qe}from"@fluixi/reactive/version";var h={dom:ce,reactive:qe};function de(e){h.core&&e.setAttribute("fluixi",h.core),e.setAttribute("fx-dom",h.dom),e.setAttribute("fx-reactive",h.reactive),typeof globalThis<"u"&&(globalThis.Fluixi=h)}function pe(){let e=[h.core,h.dom,h.reactive].filter(t=>t!==void 0);new Set(e).size<=1||console.warn(`[fluixi] package versions disagree — core ${h.core??"(absent)"}, dom ${h.dom}, reactive ${h.reactive}. These ship as one release, so a mismatch usually means a stale lockfile or two copies resolved side by side. Reinstall, or check for duplicates with \`pnpm why @fluixi/dom\`.`)}function ye(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-component"),{value:!0,enumerable:!0}),e}function T(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}import{batch as Te,createEffect as P,createRenderEffect as y,createRoot as Je,onCleanup as C,readChildren as Xe,reportReactiveBinding as b,reportReactiveDirective as E,untrack as ze}from"@fluixi/reactive/signal";var ee=Symbol.for("fluixi.server-node"),Fe=Symbol.for("fluixi.dom.server-host"),Ve=globalThis,_=Ve[Fe]??={server:typeof document>"u",nodes:null};function S(){return _.server}function We(e){_.server=e}function k(){if(!_.nodes)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return _.nodes}function L(e){return e!=null&&e[ee]===!0?!0:typeof Node<"u"&&e instanceof Node}function te(e){return e!=null&&e[ee]===!0?e.nodeType===1:typeof Element<"u"&&e instanceof Element}function ne(e){return e!=null&&e[ee]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var l={active:!1,cursor:null,parents:[]},me=null;function ge(e){me=e}function O(){return me}function oe(e,t){return l.active&&t.parentNode===e}function re(e){let t=l.parents.lastIndexOf(e);t!==-1&&(l.parents.length=t),l.cursor=e.nextSibling}function Ke(){return l.active?l.cursor:null}function $(e,t){if(!e||e.parentNode==null)return t();let n=l.active,o=l.cursor,r=l.parents;l.active=!0,l.cursor=e,l.parents=[];try{return t()}finally{l.active=n,l.cursor=o,l.parents=r}}function Be(e){if(!l.active)return e();let t=l.cursor,n=l.parents;l.active=!1,l.parents=[];try{return e()}finally{l.active=!0,l.cursor=t,l.parents=n}}function Ge(e){if(!l.active||e==null)return;let t=Array.isArray(e)?e[e.length-1]:e;t&&typeof t.nodeType=="number"&&re(t)}function Ue(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 o=0,r=e;for(;r=r.previousElementSibling;)r.tagName===e.tagName&&o++;n+=`:nth-of-type(${o+1})`,t.unshift(n),e=e.parentElement}return t.join(">")}function Ye(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 bn(e){return Ye(Ue(e))}var En=()=>"xxyxxxxxxy-4xx8".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)}),Ze={};var D="__fx_at",Ne="__fx_loc";function xe(e,t){return t&&(e[Ne]=t),e}var he=new Map,H=new Set,B=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);function we(e){if(!S())for(let t of e)H.has(t)||B.has(t)||(H.add(t),document.addEventListener(t,Qe))}function Qe(e){let t=`$$${e.type}`,n=e.composedPath&&e.composedPath()[0]||e.target;for(;n;){let o=n[t];if(o&&!n.disabled&&(o(e),e.cancelBubble))return;n=n.host&&n.host!==n&&n.host instanceof Element?n.host:n.parentNode}}function et(e,t,n){if(e[`$$${t}`]=n,B.has(t)){let o=`__fx_${t}`;if(!e[o]){let r=s=>{e[`$$${t}`]?.(s)};e.addEventListener(t,r),e[o]=r}return}H.has(t)||we([t])}function be(e,t){delete e[`$$${t}`];let n=`__fx_${t}`,o=e[n];o&&(e.removeEventListener(t,o),delete e[n])}function Tn(e){return!B.has(e)}function Nn(e){return typeof e=="function"}function v(e,t=!1){if(S())return k().createText(e);if(l.active&&!t){let n=O()?.hydrateText(e);if(n)return n}return document.createTextNode(e)}function Se(e,t=!1,n){if(S())return k().createElement(e,t);if(l.active){let o=O()?.hydrateElement(e);if(o)return n?xe(o,n):o}return xe(t?document.createElementNS(Y,e):document.createElement(e),n)}function tt(e,t=!1){let n=he.get(e);if(n)return n;let o=document.createElement("template");return t?o.innerHTML=`<svg>${e}</svg>`:o.innerHTML=e,he.set(e,o),o}function wn(e,t,n=!1,o=!1,r){if(S()){let s=k();return n?s.parseTemplate(e,o):s.createRaw(e)}if(l.active){let s=O()?.hydrateStatic(t);if(s)return Ee(s,r)}return Ee(ot(tt(e,o),o).firstChild,r)}function Ee(e,t){let n=e;if(!t||typeof n?.querySelectorAll!="function")return e;let o=[n,...n.querySelectorAll("*")];for(let r=0;r<o.length&&r*2+1<t.pos.length;r++){let s=t.pos[r*2];s&&(o[r][Ne]={file:t.file,line:s,column:t.pos[r*2+1]})}return e}function Sn(e,t){if(!l.active)return t();let n=$(e.nextSibling,t);if(typeof n=="function"){let o=n;return nt(o,(...s)=>l.active?$(e.nextSibling,()=>o(...s)):o(...s))}return n}function nt(e,t){let n=e[D];return n!==void 0&&(t[D]=n),t}function vn(e){for(let t=e.nextSibling;t;t=t.nextSibling)if(t.nodeType===8&&t.data==="fx/")return t;throw new Error("[fluixi] template hole is missing its closing marker")}function An(e,t){let n=[];for(let o=e.nextSibling;o&&o!==t;o=o.nextSibling)n.push(o);return n}function ot(e,t=!1){let n=e.content.cloneNode(!0);return t?n.firstChild:n}function rt(e){return Array.isArray(e)?e.length===2&&e[1]===" "?Array.isArray(e[0])?rt(e[0]):(typeof e[0]=="function",e[0]):e.length===1&&typeof e[0]=="function"?e[0]:e:e}function Cn(e){return typeof e!="function"?null:e._name||e.name||"anonymous"}function Rn(e){if(g(e)||T(e)||typeof e!="function")return e;let t=e();for(;typeof t=="function"&&!g(t)&&!T(t);)t=t();return t}var w=0,it=200;function st(e,t,n,o,r){let s=o,a=new Map;return y(()=>{b(n??t,"content",void 0,e);let i;if(T(e)&&!g(e)){if(!a.has(e)){w++;try{let f=e();a.set(e,f)}finally{w--}}for(i=a.get(e);typeof i=="function"&&g(i);)i=i()}else for(i=e();typeof i=="function"&&g(i);)i=i();{let f=0;for(;typeof i=="function"&&f++<50;)if(T(i)){if(!a.has(i)){let u=i;w++;try{let c=u();a.set(u,c)}finally{w--}}i=a.get(i)}else if(g(i))i=i();else if(i=i(),typeof i!="function"||!g(i)&&!T(i))break}w++;try{s=j(t,i,n,s,a),r(s)}finally{w--}})}function M(e,t,n,o){if(w>it)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;n!==void 0&&!n&&(n=v("",!0),e.appendChild(n));let r=o??null,s=f=>Array.isArray(f)&&f.some(u=>typeof u=="function"),a=f=>typeof f=="function"?f:()=>f;if(typeof t!="function"&&!s(t)){w++;try{r=j(e,t,n,r)}finally{w--}return()=>r}let i=st(a(t),e,n,r,f=>{r=f});return()=>(i?.(),r)}function j(e,t,n,o,r){if(t==null||typeof t=="boolean")return A(e,o,n);if(typeof t=="function")for(;typeof t=="function";)t=t();if(t==null||typeof t=="boolean")return A(e,o,n);if(I(t)){let a=v("",!0);return Array.isArray(o)?o.length>0?(e.replaceChild(a,o[0]),A(e,o.slice(1),n)):m(e,a,n):o?e.replaceChild(a,o):m(e,a,n),t.then(i=>{a.parentNode===e&&j(e,i,a.nextSibling,a)}).catch(i=>{console.error("Error resolving promise in insertExpression:",i)}),a}let s=typeof t;if(s==="string"||s==="number"){if(s==="number"&&(t=String(t)),Array.isArray(o)){if(o.length===0){let i=v(t);return m(e,i,n),i}if(o.length===1&&o[0].nodeType===3)return o[0].data=t,o;o=A(e,o,n)}if(o&&ne(o))return o.data=t,o;let a=v(t);return o&&o.parentNode===e?e.replaceChild(a,o):oe(e,a)||m(e,a,n),a}if(L(t))return oe(e,t)?(re(t),t):Array.isArray(o)?(o.length===0?m(e,t,n):o[0].parentNode===e?(e.replaceChild(t,o[0]),A(e,o.slice(1),n)):m(e,t,n),t):(o?o!==t&&(o.parentNode===e?e.replaceChild(t,o):m(e,t,n)):m(e,t,n),t);if(Array.isArray(t)){let a=[],i=Array.isArray(o)?o:o?[o]:[],f=[];N(t,a,e,n,!0,r,f);let u=at(e,i,a,n);for(let c of f){let d=M(e,c.sig,c.marker);C(()=>{A(e,d()),c.marker.parentNode===e&&e.removeChild(c.marker)})}return u}if(s==="object"&&t!==null&&typeof t=="object"){let a=t;if("type"in a&&"props"in a){let i=a;if(typeof i.type=="function"){let f=i.type(i.props||{});return j(e,f,n,o)}}}return A(e,o,n)}function N(e,t,n,o,r=!0,s,a){for(let i=0;i<e.length;i++){let f=e[i];if(!(f==null||typeof f=="boolean")){for(;typeof f=="function"&&!I(f)&&!g(f)&&!T(f)&&(f=f(),!(f==null||typeof f=="boolean")););if(!(f==null||typeof f=="boolean")){if(typeof f=="function"){let u;for(T(f)&&!g(f)?(s||(s=new Map),s.has(f)||s.set(f,f()),u=s.get(f)):u=f();typeof u=="function"&&!I(u)&&!g(u)&&!T(u);)s||(s=new Map),s.has(u)||s.set(u,u()),u=s.get(u);if(u==null||typeof u=="boolean")continue;if(typeof u=="function"){if(g(u)){if(a){let d=v("",!0);t.push(d),a.push({marker:d,sig:u});continue}let c=u();for(;typeof c=="function"&&g(c);)c=c();if(c==null||typeof c=="boolean")continue;Array.isArray(c)?N(c,t,n,o,r,s):N([c],t,n,o,r,s);continue}continue}Array.isArray(u)?N(u,t,n,o,r,s,a):N([u],t,n,o,r,s,a);continue}if(I(f)){let u=v("",!0);t.push(u),f.then(c=>{if(u.parentNode){let d=[];if(N([c],d,u.parentNode,void 0,!1,s),d.length>0){u.parentNode.replaceChild(d[0],u);for(let p=1;p<d.length;p++)u.parentNode?.insertBefore(d[p],d[p-1].nextSibling)}}}).catch(c=>console.error("Error resolving promise in array:",c));continue}if(Array.isArray(f)){N(f,t,n,o,r,s,a);continue}if(L(f)){t.push(f);continue}if(typeof f=="object"&&f!==null&&"type"in f&&"props"in f){let u=f;if(typeof u.type=="function"){let c=u.type(u.props||{});Array.isArray(c)?N(c,t,n,o,!1,s):N([c],t,n,o,!1,s);continue}}if(typeof f=="string"||typeof f=="number"){let u=String(f);if(u.trim()===""&&u!==" ")continue;t.push(v(u));continue}t.push(v(String(f)))}}}}function at(e,t,n,o){for(let d=0;d<n.length;d++){let p=n[d].parentNode;p!==null&&p!==e&&p.nodeType!==11&&(n=n.slice(),n[d]=n[d].cloneNode(!0))}let r=n.length,s=t.length,a=r,i=0,f=0,u=s>0?t[s-1].nextSibling??void 0:o,c=null;for(;i<s||f<a;){if(t[i]===n[f]){i++,f++;continue}for(;s>i&&a>f&&t[s-1]===n[a-1];)s--,a--;if(s===i){let d=a<r?f?n[f-1].nextSibling??void 0:n[a-f]:u;for(;f<a;)m(e,n[f++],d)}else if(a===f)for(;i<s;)(!c||!c.has(t[i]))&&t[i].parentNode===e&&e.removeChild(t[i]),i++;else if(t[i]===n[a-1]&&n[f]===t[s-1]){let d=t[--s].nextSibling;m(e,n[f++],t[i++].nextSibling),m(e,n[--a],d),t[s]=t[i-1]}else{if(!c){c=new Map;let p=f;for(;p<a;)c.set(n[p],p++)}let d=c.get(t[i]);if(d!=null)if(f<d&&d<a){let p=i,U=1;for(;++p<s&&p<a&&!(!c.has(t[p])||c.get(t[p])!==d+U);)U++;if(U>d-f){let $e=t[i];for(;f<d;)m(e,n[f++],$e)}else t[i].parentNode===e?e.replaceChild(n[f++],t[i++]):(m(e,n[f++],u),i++)}else i++;else t[i].parentNode===e&&e.removeChild(t[i]),i++}}return n}function A(e,t,n){if(t)if(Array.isArray(t))for(let o=0;o<t.length;o++)t[o].parentNode===e&&e.removeChild(t[o]);else t.parentNode===e&&e.removeChild(t);return null}function m(e,t,n){l.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 ve(e,t,n){let o=n,r;return Array.isArray(n)&&(o=n[0],r=n[1]),typeof o!="function"?()=>{}:(e.addEventListener(t,o,r),()=>e.removeEventListener(t,o,r))}function Ae(e,t){if(!t||typeof t!="function")return;let n=t[D]?.name;if(!n)return;let o=n.indexOf(":");o!==-1&&E(e,n.slice(0,o),n.slice(o+1),t)}function F(e,t,n){let o=typeof n=="function"?ze(()=>n()):n;if(!(!o||typeof o!="object"))for(let r of Object.keys(o))E(e,t,r)}function Ce(e,t){let n=(o,r)=>{typeof o=="function"&&(E(e,"use",o.name||"use",r),o(e,r??(()=>{})))};if(typeof t=="function"){n(t);return}if(Array.isArray(t)){if(typeof t[0]=="function"){n(t[0],t[1]);return}for(let o of t)Array.isArray(o)?n(o[0],o[1]):n(o)}}function ie(e,t,n,o=!1){return Ae(e,n),typeof n!="function"?(x(e,t,n,o),()=>{}):y(()=>{b(e,"attribute",t,n);let r=typeof n=="function"?n():n;x(e,t,r,o)})}function se(e,t,n){return typeof n!="function"?(q(e,t,n),()=>{}):(Ae(e,n),y(()=>{b(e,"property",t,n);let o=typeof n=="function"?n():n;q(e,t,o)}))}function Re(e,t,n){return typeof n!="function"?(x(e,t,!!n),()=>{}):y(()=>{b(e,"attribute",t,n);let o=n();x(e,t,!!o)})}function V(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){y(()=>{b(e,"attribute","class",t),V(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(o=>{let r=t[o];return typeof r=="function"?r():!!r}).join(" ");e.setAttribute("class",n);return}e.setAttribute("class",String(t))}function W(e,t,n){if(!(!t||typeof t!="object"))for(let o in t){let r=t[o],s=o.split(/\s+/).filter(Boolean);if(typeof r=="function"&&n)n.push(y(()=>{let a=!!r();for(let i of s)e.classList.toggle(i,a)}));else{let a=!!(typeof r=="function"?r():r);for(let i of s)e.classList.toggle(i,a)}}}function K(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 o in n){let r=n[o];r==null?e.style[o]="":e.style[o]=r}}function Ln(e){let{element:t,props:n,prevProps:o=Ze,isSVG:r=!1,skipChildren:s=!1}=e;if(!t||!te(t))return console.error("[spread] Error: element is not a DOM Element!"),()=>{};if(!n)return console.warn("[spread] Warning: props is undefined!"),()=>{};let a=r||t.namespaceURI===Y,i=[];for(let f in n){if(s&&f==="children")continue;let u=n[f],c=o[f];if(u===c)continue;if(f==="ref"){Le(u,t);continue}if(f==="use"){Ce(t,u);continue}if(f.startsWith("on:")){i.push(ve(t,f.slice(3),u));continue}if(f.startsWith("prop:")){E(t,"prop",f.slice(5),u),i.push(se(t,f.slice(5),u));continue}if(f.startsWith("attr:")){E(t,"attr",f.slice(5),u),i.push(ie(t,f.slice(5),u,a));continue}if(f.startsWith("bool:")){E(t,"bool",f.slice(5),u),i.push(Re(t,f.slice(5),u));continue}if(f==="class"||f==="className"){typeof u=="function"?i.push(y(()=>{b(t,"attribute","class",u),V(t,u())})):V(t,u);continue}if(f==="classList"){F(t,"class",u),typeof u=="function"?i.push(y(()=>{b(t,"attribute","class",u),W(t,u())})):W(t,u,i);continue}if(f==="style"){F(t,"style",u),typeof u=="function"?i.push(y(()=>{b(t,"attribute","style",u),K(t,u())})):K(t,u);continue}if(f.startsWith("on")){let p=f.slice(2).toLowerCase();c&&be(t,p),u&&et(t,p,u);continue}let d=Q.has(f)||!a&&f in t;typeof u=="function"?i.push(d?se(t,f,u):ie(t,f,u,a)):i.push(y(()=>d?q(t,f,n[f]):x(t,f,n[f],a)))}for(let f in o)if(!(f in n))if(f.startsWith("on")){let u=f.slice(2).toLowerCase();be(t,u)}else Q.has(f)?q(t,f,null):t.removeAttribute(f);return()=>{i.forEach(f=>f())}}function Pn(e,t,n=!1){for(let o in t){let r=t[o];if(o==="ref"){Le(r,e);continue}if(o!=="children"){if(o==="use"){Ce(e,r);continue}if(o.startsWith("on:")){ve(e,o.slice(3),r);continue}if(o.startsWith("prop:")){E(e,"prop",o.slice(5),r),se(e,o.slice(5),r);continue}if(o.startsWith("attr:")){E(e,"attr",o.slice(5),r),ie(e,o.slice(5),r,n);continue}if(o.startsWith("bool:")){E(e,"bool",o.slice(5),r),Re(e,o.slice(5),r);continue}if(o.startsWith("on")&&o.length>2){let s=o.slice(2).toLowerCase();if(typeof r=="function")if(B.has(s)){e[`$$${s}`]=r;let a=`__fx_${s}`;if(!e[a]){let i=f=>{e[`$$${s}`]?.(f)};e.addEventListener(s,i),e[a]=i}}else e[`$$${s}`]=r,H.has(s)||we([s]);continue}if(o==="class"||o==="className"){V(e,r);continue}if(o==="classList"){F(e,"class",r),typeof r=="function"?y(()=>{b(e,"attribute","class",r),W(e,r())}):W(e,r);continue}if(o==="style"){F(e,"style",r),typeof r=="function"?y(()=>{b(e,"attribute","style",r),K(e,r())}):K(e,r);continue}if(o==="innerHTML"){if(typeof r=="function"){let s=P(()=>{let a=r();for(;typeof a=="function";)a=a();e.innerHTML=a});C(()=>s())}else e.innerHTML=r;continue}if(o==="value"&&(e.tagName==="INPUT"||e.tagName==="TEXTAREA")){if(typeof r=="function"){let s=P(()=>{let a=r();for(;typeof a=="function"&&a.length===0;)a=a();document.activeElement!==e&&(e.value=a??"")});C(()=>{s()})}else y(()=>{document.activeElement!==e&&(e.value=t[o]??"")});continue}if(o==="checked"&&e.tagName==="INPUT"){if(typeof r=="function"){let s=P(()=>{let a=r();for(;typeof a=="function"&&a.length===0;)a=a();document.activeElement!==e&&(e.checked=a??"")});C(()=>{s()})}else y(()=>{document.activeElement!==e&&(e.checked=t[o]??"")});continue}if(o==="value"&&e.tagName==="SELECT"){if(typeof r=="function"){let s=!0,a=P(()=>{let i=r();for(;typeof i=="function"&&i.length===0;)i=i();s?(s=!1,queueMicrotask(()=>{e.value=i??""})):e.value=i??""});C(()=>{a()})}else{let s=!0;y(()=>{let a=t[o];s?(s=!1,queueMicrotask(()=>{e.value=a??""})):e.value=a??""})}continue}if(typeof r=="function"){let s=P(()=>{let a=r();for(;typeof a=="function"&&a.length===0;)a=a();Z(e,o,a,n)});C(()=>{s()})}else y(()=>Z(e,o,t[o],n))}}}function Mn(...e){let t=o=>{for(let r=e.length-1;r>=0;r--){let s=e[r];if(s&&o in s&&s[o]!==void 0)return s[o]}},n=o=>{for(let r of e)if(r&&o in r)return!0;return!1};return new Proxy({},{get:(o,r)=>t(r),has:(o,r)=>n(r),ownKeys:()=>{let o=new Set;for(let r of e)if(r)for(let s of Reflect.ownKeys(r))o.add(s);return[...o]},getOwnPropertyDescriptor:(o,r)=>n(r)?{enumerable:!0,configurable:!0,get:()=>t(r)}:void 0})}function _n(e,...t){let n=new Set;for(let a of t)for(let i of a)n.add(i);let o=a=>({enumerable:!0,configurable:!0,get:()=>e[a]}),r=t.map(a=>{let i=new Set(a);return new Proxy({},{get:(f,u)=>i.has(u)?e[u]:void 0,has:(f,u)=>i.has(u)&&u in e,ownKeys:()=>Array.from(i).filter(f=>f in e),getOwnPropertyDescriptor:(f,u)=>i.has(u)&&u in e?o(u):void 0})}),s=new Proxy({},{get:(a,i)=>n.has(i)?void 0:e[i],has:(a,i)=>!n.has(i)&&i in e,ownKeys:()=>Reflect.ownKeys(e).filter(a=>!n.has(a)),getOwnPropertyDescriptor:(a,i)=>!n.has(i)&&i in e?o(i):void 0});return[...r,s]}function Le(e,t){if(!e)return;let n=e[D]?.name;if(E(t,"ref",n||typeof e=="function"&&e.name||"ref",e),L(e)){let o=t,r=e;if(!o)return;typeof o=="function"?o(r):typeof o=="object"&&"current"in o&&(o.current=r);return}typeof e=="function"?e(t):typeof e=="object"&&"current"in e&&(e.current=t)}function kn(e,t,n){let o=t||document.body,r=Xe(()=>e),s=[];return Te(()=>{let a=y(()=>{let i=r();Array.isArray(i)?(i.forEach(f=>o.appendChild(f)),s.push(()=>{i.forEach(f=>{f.parentNode===o&&o.removeChild(f)})})):L(i)&&(o.appendChild(i),s.push(()=>{i.parentNode===o&&o.removeChild(i)}))});s.push(a),C(()=>{s.forEach(i=>i())})}),null}function On(e){return typeof e=="string"&&e.toLowerCase()===e}function $n(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 In(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function I(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}function Dn(e){return typeof e=="function"&&e.length===0&&g(e)}function Pe(e,t,n){if(!t)throw new Error("Container element is required");let o,r,s=[];return Je(a=>{Te(()=>{l.active||(t.textContent=""),de(t),pe(),M(t,e)}),r=a}),()=>{r?.(),o?.(),s.forEach(a=>a()),t.textContent=""}}function Hn(e){if(Array.isArray(e))return e;if(typeof e=="function"&&typeof e.set=="function")return[e,e.set];throw new TypeError("[fluixi] bind: needs a signal — either `signal(…)` or the `[get, set]` pair from `createSignal(…)`.")}import{untrack as ft,isSignal as ut,reportReactiveProps as lt}from"@fluixi/reactive";var ct="__fx_dom_create_component__",R=globalThis[ct]??={fn:null};function Vn(e){R.fn=e}function Wn(e={}){let t=e.signalSystem?.createComponent;t&&(R.fn=t)}function Kn(e,t){if(R.fn)return R.fn(e,t);t&&lt(t);let n=typeof e=="function"?ft(()=>e(t)):e,o=n!=null&&(typeof n=="function"||typeof n=="object");if(o)try{n.$name=e?.name}catch{}return o&&!ut(n)?ye(n):n}var Bn=()=>R.fn!==null,Gn=()=>R.fn!==null;function Jn(){R.fn=null}var G,dt={getStore:()=>G,run(e,t){let n=G;G=e;try{return t()}finally{G=n}}},pt=dt;function Me(){return pt.getStore()}import{setResourceIdSource as mt,setServerDataGetter as gt}from"@fluixi/reactive/signal";var yt="__FX_DATA__";var ae;function _e(){let e=globalThis.__FX_DATA__;if(e)return e;if(ae!==void 0)return ae;let t=null;if(typeof document<"u"){let n=document.getElementById(yt)?.textContent;if(n)try{t=JSON.parse(n)}catch{t=null}}return ae=t}function J(){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 xt=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),X=typeof process<"u"&&process.env&&!1;function z(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 ht(e){J();let t=l.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(xt.has(e.toLowerCase())?l.cursor=t.nextSibling:(l.parents.push(t),l.cursor=t.firstChild),t):(X&&t&&z(`<${e}>`,t),null)}function bt(e){J();let t=l.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(l.cursor=t.nextSibling,t):(X&&t&&z(`<${e}> (static)`,t),null)}function Et(e){if(e===""){let n=l.cursor;return n&&n.nodeType===3&&n.data!==""?(l.cursor=n.nextSibling,n.data="",n):null}J();let t=l.cursor;return t&&t.nodeType===3?(l.cursor=t.nextSibling,t.nodeValue!==e&&(t.nodeValue=e),t):(X&&t&&z(`text ${JSON.stringify(e.slice(0,24))}`,t),null)}function Tt(e){J();let t=l.cursor;return t&&t.nodeType===8&&t.data===e?(l.cursor=t.nextSibling,t):(X&&t&&z(`marker <!--${e.slice(0,24)}-->`,t),null)}var ke=!1;function Nt(){ke||(ke=!0,ge({hydrateElement:ht,hydrateText:Et,hydrateMarker:Tt,hydrateStatic:bt}))}function fe(e,t,n){Nt(),l.active=!0,l.cursor=t.firstChild,l.parents=[];let o=_e(),r=n?.resourceNamespace,s=0;mt(()=>r?`${r}:r${s++}`:`r${s++}`),gt(o?a=>a in o?{value:o[a]}:void 0:null);try{return Pe(e,t)}finally{l.active=!1,l.cursor=null,l.parents=[]}}var ue="fluixi-island";function wt(e){let{component:t,props:n={},name:o}=e,r=Se(ue),s=o??t.name??"Island";x(r,"name",s),x(r,"props",JSON.stringify(n??{}));let a=S()?Me():void 0;if(a){let i=a.nextIslandNamespace(s);M(r,()=>a.withResourceScope(i,()=>t(n)))}else M(r,()=>t(n));return r}var Oe=!1;function St(){if(Oe||typeof document>"u")return;Oe=!0;let e=document.createElement("style");e.textContent=`${ue}{display:contents}`,document.head.appendChild(e)}function vt(e){if(typeof document>"u")return;St();let t=document.querySelectorAll(ue),n=new Map;t.forEach(o=>{let r=o.getAttribute("name")??"",s=n.get(r)??0;n.set(r,s+1);let a=e[r];if(!a){typeof process>"u"&&console.warn(`[fluixi] island "${r}" has no component in the registry — left static.`);return}let i={};try{i=JSON.parse(o.getAttribute("props")||"{}")}catch{}fe(()=>a(i),o,{resourceNamespace:`${r}#${s}`})})}export{wt as Island,Q as JSX_PROPERTIES,Mt as SVG_ELEMENTS,Y as SVG_NAMESPACE,Pt as VOID_ELEMENTS,Ot as addClass,et as addDelegatedEventListener,ve as addNativeEventListener,Wt as appendChildren,Z as applyElementProp,Pn as applyProps,Ce as applyUse,Hn as bindPair,Ke as captureHydrationCursor,A as cleanChildren,ot as cloneTemplate,kt as closest,Kn as createComponent,Ft as createElement,Se as createNativeElement,kn as createPortal,tt as createTemplate,Jt as delegate,we as delegateEvents,In as escapeHTML,Cn as fnName,En as generateID,Ht as getAttribute,nn as getGlobal,Rt as getLitEventName,Gt as getOffset,bn as getStableElementId,qt as getStyle,Le as handleRef,Dt as hasClass,An as holeContent,vn as holeEnd,Sn as holeScope,fe as hydrate,Ge as hydrateAdvancePast,vt as hydrateIslands,Wn as initializeIntegration,M as insert,j as insertExpression,Bn as intergartionInitialized,Dn as isAccessor,Ie as isCustomElement,en as isDOMNode,Tn as isDelegatedEvent,te as isDomElement,L as isDomNode,ne as isDomText,Ct as isEventHandler,Nn as isFunction,Gn as isIntegrationInitialized,Qt as isJSXTemplate,je as isLitTemplateResult,On as isNativeElement,I as isPromise,Yt as isReactElement,$n as isSVGElement,S as isServer,Zt as isTemplateFactory,Kt as isVisible,Rn as iterateFn,rt as makeArrayFlat,Mn as mergeProps,zt as observeIntersection,Ut as observeResize,le as query,_t as queryAll,Vn as registerCreateComponent,tn as registerGlobal,jt as removeAttribute,Vt as removeChildren,$t as removeClass,be as removeDelegatedEventListener,Pe as render,Jn as resetIntegration,$ as runHydrationAt,Be as runWithoutHydration,Bt as scrollIntoView,x as setAttribute,W as setClassList,V as setClassName,ie as setDynamicAttribute,Re as setDynamicBoolAttribute,se as setDynamicProperty,q as setProperty,We as setServerMode,K as setStyle,De as setStyles,Lt as shouldSetAsProperty,_n as splitProps,Ln as spread,wn as templateNode,At as toAttributeName,It as toggleClass,Xt as waitForElement};
@@ -1 +1 @@
1
- "use strict";var u=Object.defineProperty;var y=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var s=Object.prototype.hasOwnProperty;var a=(t,e)=>{for(var n in e)u(t,n,{get:e[n],enumerable:!0})},m=(t,e,n,f)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of c(e))!s.call(t,o)&&o!==n&&u(t,o,{get:()=>e[o],enumerable:!(f=y(e,o))||f.enumerable});return t};var x=t=>m(u({},"__esModule",{value:!0}),t);var O={};a(O,{createComponent:()=>C,initializeIntegration:()=>d,intergartionInitialized:()=>S,isIntegrationInitialized:()=>g,registerCreateComponent:()=>b,resetIntegration:()=>R});module.exports=x(O);var i=require("@fluixi/reactive");function p(t){return typeof t!="function"||Object.defineProperty(t,Symbol.for("fluixi-component"),{value:!0,enumerable:!0}),t}var l="__fx_dom_create_component__",r=globalThis[l]??={fn:null};function b(t){r.fn=t}function d(t={}){let e=t.signalSystem?.createComponent;e&&(r.fn=e)}function C(t,e){if(r.fn)return r.fn(t,e);let n=typeof t=="function"?(0,i.untrack)(()=>t(e)):t;if(n!=null&&(typeof n=="function"||typeof n=="object")&&!(0,i.isSignal)(n)){try{n.$name=t?.name}catch{}return p(n)}return n}var S=()=>r.fn!==null,g=()=>r.fn!==null;function R(){r.fn=null}
1
+ "use strict";var f=Object.defineProperty;var y=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var s=Object.prototype.hasOwnProperty;var a=(e,t)=>{for(var n in t)f(e,n,{get:t[n],enumerable:!0})},m=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let u of c(t))!s.call(e,u)&&u!==n&&f(e,u,{get:()=>t[u],enumerable:!(i=y(t,u))||i.enumerable});return e};var x=e=>m(f({},"__esModule",{value:!0}),e);var O={};a(O,{createComponent:()=>C,initializeIntegration:()=>d,intergartionInitialized:()=>S,isIntegrationInitialized:()=>R,registerCreateComponent:()=>b,resetIntegration:()=>g});module.exports=x(O);var o=require("@fluixi/reactive");function p(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-component"),{value:!0,enumerable:!0}),e}var l="__fx_dom_create_component__",r=globalThis[l]??={fn:null};function b(e){r.fn=e}function d(e={}){let t=e.signalSystem?.createComponent;t&&(r.fn=t)}function C(e,t){if(r.fn)return r.fn(e,t);t&&(0,o.reportReactiveProps)(t);let n=typeof e=="function"?(0,o.untrack)(()=>e(t)):e,i=n!=null&&(typeof n=="function"||typeof n=="object");if(i)try{n.$name=e?.name}catch{}return i&&!(0,o.isSignal)(n)?p(n):n}var S=()=>r.fn!==null,R=()=>r.fn!==null;function g(){r.fn=null}
@@ -1 +1 @@
1
- {"version":3,"file":"integration.d.ts","sourceRoot":"","sources":["../../../src/lib/dom/integration.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAC;AAE5D,KAAK,iBAAiB,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,EAAE,KAAK,CAAC,EAAE,GAAG,KAAK,GAAG,CAAC;AAO7D,MAAM,WAAW,kBAAkB;IAEjC,YAAY,CAAC,EAAE;QAAE,eAAe,CAAC,EAAE,iBAAiB,CAAA;KAAE,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC7E,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CACnC;AAED,wBAAgB,uBAAuB,CAAC,eAAe,EAAE,iBAAiB,GAAG,IAAI,CAEhF;AAGD,wBAAgB,qBAAqB,CAAC,OAAO,GAAE,kBAAuB,GAAG,IAAI,CAG5E;AAED,wBAAgB,eAAe,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,GAAG,KAAK,GAAG,EAAE,CAAC,GAAG,GAAG,EACrE,IAAI,EAAE,CAAC,EACP,KAAK,CAAC,EAAE,CAAC,GAAG,SAAS,GACpB,yBAAyB,CAAC,CAAC,EAAE,CAAC,CAAC,CAsBjC;AAED,eAAO,MAAM,uBAAuB,QAAO,OAA4B,CAAC;AACxE,eAAO,MAAM,wBAAwB,QAAO,OAA4B,CAAC;AAEzE,wBAAgB,gBAAgB,IAAI,IAAI,CAEvC"}
1
+ {"version":3,"file":"integration.d.ts","sourceRoot":"","sources":["../../../src/lib/dom/integration.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAC;AAE5D,KAAK,iBAAiB,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,EAAE,KAAK,CAAC,EAAE,GAAG,KAAK,GAAG,CAAC;AAO7D,MAAM,WAAW,kBAAkB;IAEjC,YAAY,CAAC,EAAE;QAAE,eAAe,CAAC,EAAE,iBAAiB,CAAA;KAAE,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC7E,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CACnC;AAED,wBAAgB,uBAAuB,CAAC,eAAe,EAAE,iBAAiB,GAAG,IAAI,CAEhF;AAGD,wBAAgB,qBAAqB,CAAC,OAAO,GAAE,kBAAuB,GAAG,IAAI,CAG5E;AAED,wBAAgB,eAAe,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,GAAG,KAAK,GAAG,EAAE,CAAC,GAAG,GAAG,EACrE,IAAI,EAAE,CAAC,EACP,KAAK,CAAC,EAAE,CAAC,GAAG,SAAS,GACpB,yBAAyB,CAAC,CAAC,EAAE,CAAC,CAAC,CA8BjC;AAED,eAAO,MAAM,uBAAuB,QAAO,OAA4B,CAAC;AACxE,eAAO,MAAM,wBAAwB,QAAO,OAA4B,CAAC;AAEzE,wBAAgB,gBAAgB,IAAI,IAAI,CAEvC"}
@@ -2,7 +2,7 @@
2
2
  // slot below, which left the runtime with a fallback that re-invoked a component on
3
3
  // every read — a list rebuilt every node whenever it changed, and only for consumers
4
4
  // who had not loaded core. The slot stays so a host can still override it.
5
- import { untrack, isSignal } from '@fluixi/reactive';
5
+ import { untrack, isSignal, reportReactiveProps } from '@fluixi/reactive';
6
6
  import { asComponent } from '../component/modifiers.js';
7
7
  // On globalThis so every bundled copy shares the slot.
8
8
  const _slotKey = '__fx_dom_create_component__';
@@ -19,20 +19,29 @@ export function initializeIntegration(options = {}) {
19
19
  export function createComponent(Comp, props) {
20
20
  if (_slot.fn)
21
21
  return _slot.fn(Comp, props);
22
+ // Before the call, so the computation this is created inside is still the running one.
23
+ // A property read when nobody is watching.
24
+ if (props)
25
+ reportReactiveProps(props);
22
26
  // Untracked: a component reading a signal while it is created must not make its
23
27
  // caller depend on that signal, or the caller re-runs and rebuilds the subtree.
24
28
  const component = typeof Comp === 'function' ? untrack(() => Comp(props)) : Comp;
25
29
  // Primitives cannot carry properties, and a signal must not be stamped as a
26
30
  // component or the runtime caches it as a static thunk.
27
- if (component != null &&
28
- (typeof component === 'function' || typeof component === 'object') &&
29
- !isSignal(component)) {
31
+ const nameable = component != null && (typeof component === 'function' || typeof component === 'object');
32
+ if (nameable) {
33
+ // The name goes on whatever came back, reactive or not. Only `asComponent` has to skip a
34
+ // signal — the runtime would cache it as a static thunk. Nothing reads `$name` but a
35
+ // watcher, and skipping it there hid every component that returns another one: an App
36
+ // whose whole body is `<Router/>` was named nowhere.
30
37
  try {
31
38
  component['$name'] = Comp?.name;
32
39
  }
33
40
  catch {
34
41
  /* frozen or exotic object */
35
42
  }
43
+ }
44
+ if (nameable && !isSignal(component)) {
36
45
  return asComponent(component);
37
46
  }
38
47
  return component;
@@ -1 +1 @@
1
- import{untrack as i,isSignal as u}from"@fluixi/reactive";function o(t){return typeof t!="function"||Object.defineProperty(t,Symbol.for("fluixi-component"),{value:!0,enumerable:!0}),t}var f="__fx_dom_create_component__",n=globalThis[f]??={fn:null};function s(t){n.fn=t}function a(t={}){let r=t.signalSystem?.createComponent;r&&(n.fn=r)}function m(t,r){if(n.fn)return n.fn(t,r);let e=typeof t=="function"?i(()=>t(r)):t;if(e!=null&&(typeof e=="function"||typeof e=="object")&&!u(e)){try{e.$name=t?.name}catch{}return o(e)}return e}var x=()=>n.fn!==null,l=()=>n.fn!==null;function b(){n.fn=null}export{m as createComponent,a as initializeIntegration,x as intergartionInitialized,l as isIntegrationInitialized,s as registerCreateComponent,b as resetIntegration};
1
+ import{untrack as u,isSignal as f,reportReactiveProps as p}from"@fluixi/reactive";function i(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-component"),{value:!0,enumerable:!0}),e}var y="__fx_dom_create_component__",r=globalThis[y]??={fn:null};function m(e){r.fn=e}function x(e={}){let t=e.signalSystem?.createComponent;t&&(r.fn=t)}function l(e,t){if(r.fn)return r.fn(e,t);t&&p(t);let n=typeof e=="function"?u(()=>e(t)):e,o=n!=null&&(typeof n=="function"||typeof n=="object");if(o)try{n.$name=e?.name}catch{}return o&&!f(n)?i(n):n}var b=()=>r.fn!==null,d=()=>r.fn!==null;function C(){r.fn=null}export{l as createComponent,x as initializeIntegration,b as intergartionInitialized,d as isIntegrationInitialized,m as registerCreateComponent,C as resetIntegration};
@@ -1 +1 @@
1
- "use strict";var k=Object.defineProperty;var se=Object.getOwnPropertyDescriptor;var ae=Object.getOwnPropertyNames;var fe=Object.prototype.hasOwnProperty;var ue=(t,e)=>{for(var n in e)k(t,n,{get:e[n],enumerable:!0})},le=(t,e,n,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let u of ae(e))!fe.call(t,u)&&u!==n&&k(t,u,{get:()=>e[u],enumerable:!(o=se(e,u))||o.enumerable});return t};var ce=t=>le(k({},"__esModule",{value:!0}),t);var Ce={};ue(Ce,{Island:()=>Se,hydrateIslands:()=>Ae});module.exports=ce(Ce);var m=require("@fluixi/reactive/signal");var F="http://www.w3.org/2000/svg";function v(t,e,n,o=!1){if(n==null||n===!1){t.removeAttribute(e);return}if(n===!0){t.setAttribute(e,"");return}if(typeof n=="object"){t.setAttribute(e,JSON.stringify(n));return}t.setAttribute(e,String(n))}var Le=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;var V="1.0.0-alpha.82";var W=require("@fluixi/reactive/version"),g={dom:V,reactive:W.VERSION};function K(t){g.core&&t.setAttribute("fluixi",g.core),t.setAttribute("fx-dom",g.dom),t.setAttribute("fx-reactive",g.reactive),typeof globalThis<"u"&&(globalThis.Fluixi=g)}function B(){let t=[g.core,g.dom,g.reactive].filter(e=>e!==void 0);new Set(t).size<=1||console.warn(`[fluixi] package versions disagree — core ${g.core??"(absent)"}, dom ${g.dom}, reactive ${g.reactive}. These ship as one release, so a mismatch usually means a stale lockfile or two copies resolved side by side. Reinstall, or check for duplicates with \`pnpm why @fluixi/dom\`.`)}function N(t){return typeof t=="function"&&t[Symbol.for("fluixi-component")]===!0}var x=require("@fluixi/reactive/signal");var T=typeof document>"u";var J=Symbol.for("fluixi.server-node"),G=null;function O(){if(!G)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return G}function D(t){return t!=null&&t[J]===!0?!0:typeof Node<"u"&&t instanceof Node}function X(t){return t!=null&&t[J]===!0?t.nodeType===3:typeof Text<"u"&&t instanceof Text}var l={active:!1,cursor:null,parents:[]},z=null;function U(t){z=t}function I(){return z}function q(t,e){return l.active&&e.parentNode===t}function Y(t){let e=l.parents.lastIndexOf(t);e!==-1&&(l.parents.length=e),l.cursor=t.nextSibling}function b(t,e=!1){if(T)return O().createText(t);if(l.active&&!e){let n=I()?.hydrateText(t);if(n)return n}return document.createTextNode(t)}function Z(t,e=!1){if(T)return O().createElement(t,e);if(l.active){let n=I()?.hydrateElement(t);if(n)return n}return e?document.createElementNS(F,t):document.createElement(t)}var E=0,de=200;function pe(t,e,n,o,u){let a=o,s=new Map;return(0,x.createRenderEffect)(()=>{let r;if(N(t)&&!(0,m.isSignal)(t)){if(!s.has(t)){E++;try{let i=t();s.set(t,i)}finally{E--}}for(r=s.get(t);typeof r=="function"&&(0,m.isSignal)(r);)r=r()}else for(r=t();typeof r=="function"&&(0,m.isSignal)(r);)r=r();{let i=0;for(;typeof r=="function"&&i++<50;)if(N(r)){if(!s.has(r)){let f=r;E++;try{let c=f();s.set(f,c)}finally{E--}}r=s.get(r)}else if((0,m.isSignal)(r))r=r();else if(r=r(),typeof r!="function"||!(0,m.isSignal)(r)&&!N(r))break}E++;try{a=C(e,r,n,a,s),u(a)}finally{E--}})}function S(t,e,n,o){if(E>de)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;n!==void 0&&!n&&(n=b("",!0),t.appendChild(n));let u=o??null,a=i=>Array.isArray(i)&&i.some(f=>typeof f=="function"),s=i=>typeof i=="function"?i:()=>i;if(typeof e!="function"&&!a(e)){E++;try{u=C(t,e,n,u)}finally{E--}return()=>u}let r=pe(s(e),t,n,u,i=>{u=i});return()=>(r?.(),u)}function C(t,e,n,o,u){if(e==null||typeof e=="boolean")return w(t,o,n);if(typeof e=="function")for(;typeof e=="function";)e=e();if(e==null||typeof e=="boolean")return w(t,o,n);if(A(e)){let s=b("",!0);return Array.isArray(o)?o.length>0?(t.replaceChild(s,o[0]),w(t,o.slice(1),n)):y(t,s,n):o?t.replaceChild(s,o):y(t,s,n),e.then(r=>{s.parentNode===t&&C(t,r,s.nextSibling,s)}).catch(r=>{console.error("Error resolving promise in insertExpression:",r)}),s}let a=typeof e;if(a==="string"||a==="number"){if(a==="number"&&(e=String(e)),Array.isArray(o)){if(o.length===0){let r=b(e);return y(t,r,n),r}if(o.length===1&&o[0].nodeType===3)return o[0].data=e,o;o=w(t,o,n)}if(o&&X(o))return o.data=e,o;let s=b(e);return o&&o.parentNode===t?t.replaceChild(s,o):q(t,s)||y(t,s,n),s}if(D(e))return q(t,e)?(Y(e),e):Array.isArray(o)?(o.length===0?y(t,e,n):o[0].parentNode===t?(t.replaceChild(e,o[0]),w(t,o.slice(1),n)):y(t,e,n),e):(o?o!==e&&(o.parentNode===t?t.replaceChild(e,o):y(t,e,n)):y(t,e,n),e);if(Array.isArray(e)){let s=[],r=Array.isArray(o)?o:o?[o]:[],i=[];h(e,s,t,n,!0,u,i);let f=ye(t,r,s,n);for(let c of i){let d=S(t,c.sig,c.marker);(0,x.onCleanup)(()=>{w(t,d()),c.marker.parentNode===t&&t.removeChild(c.marker)})}return f}if(a==="object"&&e!==null&&typeof e=="object"){let s=e;if("type"in s&&"props"in s){let r=s;if(typeof r.type=="function"){let i=r.type(r.props||{});return C(t,i,n,o)}}}return w(t,o,n)}function h(t,e,n,o,u=!0,a,s){for(let r=0;r<t.length;r++){let i=t[r];if(!(i==null||typeof i=="boolean")){for(;typeof i=="function"&&!A(i)&&!(0,m.isSignal)(i)&&!N(i)&&(i=i(),!(i==null||typeof i=="boolean")););if(!(i==null||typeof i=="boolean")){if(typeof i=="function"){let f;for(N(i)&&!(0,m.isSignal)(i)?(a||(a=new Map),a.has(i)||a.set(i,i()),f=a.get(i)):f=i();typeof f=="function"&&!A(f)&&!(0,m.isSignal)(f)&&!N(f);)a||(a=new Map),a.has(f)||a.set(f,f()),f=a.get(f);if(f==null||typeof f=="boolean")continue;if(typeof f=="function"){if((0,m.isSignal)(f)){if(s){let d=b("",!0);e.push(d),s.push({marker:d,sig:f});continue}let c=f();for(;typeof c=="function"&&(0,m.isSignal)(c);)c=c();if(c==null||typeof c=="boolean")continue;Array.isArray(c)?h(c,e,n,o,u,a):h([c],e,n,o,u,a);continue}continue}Array.isArray(f)?h(f,e,n,o,u,a,s):h([f],e,n,o,u,a,s);continue}if(A(i)){let f=b("",!0);e.push(f),i.then(c=>{if(f.parentNode){let d=[];if(h([c],d,f.parentNode,void 0,!1,a),d.length>0){f.parentNode.replaceChild(d[0],f);for(let p=1;p<d.length;p++)f.parentNode?.insertBefore(d[p],d[p-1].nextSibling)}}}).catch(c=>console.error("Error resolving promise in array:",c));continue}if(Array.isArray(i)){h(i,e,n,o,u,a,s);continue}if(D(i)){e.push(i);continue}if(typeof i=="object"&&i!==null&&"type"in i&&"props"in i){let f=i;if(typeof f.type=="function"){let c=f.type(f.props||{});Array.isArray(c)?h(c,e,n,o,!1,a):h([c],e,n,o,!1,a);continue}}if(typeof i=="string"||typeof i=="number"){let f=String(i);if(f.trim()===""&&f!==" ")continue;e.push(b(f));continue}e.push(b(String(i)))}}}}function ye(t,e,n,o){for(let d=0;d<n.length;d++){let p=n[d].parentNode;p!==null&&p!==t&&p.nodeType!==11&&(n=n.slice(),n[d]=n[d].cloneNode(!0))}let u=n.length,a=e.length,s=u,r=0,i=0,f=a>0?e[a-1].nextSibling??void 0:o,c=null;for(;r<a||i<s;){if(e[r]===n[i]){r++,i++;continue}for(;a>r&&s>i&&e[a-1]===n[s-1];)a--,s--;if(a===r){let d=s<u?i?n[i-1].nextSibling??void 0:n[s-i]:f;for(;i<s;)y(t,n[i++],d)}else if(s===i)for(;r<a;)(!c||!c.has(e[r]))&&e[r].parentNode===t&&t.removeChild(e[r]),r++;else if(e[r]===n[s-1]&&n[i]===e[a-1]){let d=e[--a].nextSibling;y(t,n[i++],e[r++].nextSibling),y(t,n[--s],d),e[a]=e[r-1]}else{if(!c){c=new Map;let p=i;for(;p<s;)c.set(n[p],p++)}let d=c.get(e[r]);if(d!=null)if(i<d&&d<s){let p=r,_=1;for(;++p<a&&p<s&&!(!c.has(e[p])||c.get(e[p])!==d+_);)_++;if(_>d-i){let ie=e[r];for(;i<d;)y(t,n[i++],ie)}else e[r].parentNode===t?t.replaceChild(n[i++],e[r++]):(y(t,n[i++],f),r++)}else r++;else e[r].parentNode===t&&t.removeChild(e[r]),r++}}return n}function w(t,e,n){if(e)if(Array.isArray(e))for(let o=0;o<e.length;o++)e[o].parentNode===t&&t.removeChild(e[o]);else e.parentNode===t&&t.removeChild(e);return null}function y(t,e,n){l.active&&e.parentNode===t||(n&&n.parentNode===t?t.insertBefore(e,n):t.appendChild(e))}function A(t){return t!=null&&(typeof t=="object"||typeof t=="function")&&typeof t.then=="function"||t instanceof Promise}function Q(t,e,n){if(!e)throw new Error("Container element is required");let o,u,a=[];return(0,x.createRoot)(s=>{(0,x.batch)(()=>{l.active||(e.textContent=""),K(e),B(),S(e,t)}),u=s}),()=>{u?.(),o?.(),a.forEach(s=>s()),e.textContent=""}}var R,ge={getStore:()=>R,run(t,e){let n=R;R=t;try{return e()}finally{R=n}}},me=ge;function ee(){return me.getStore()}var L=require("@fluixi/reactive/signal");var xe="__FX_DATA__";var H;function te(){let t=globalThis.__FX_DATA__;if(t)return t;if(H!==void 0)return H;let e=null;if(typeof document<"u"){let n=document.getElementById(xe)?.textContent;if(n)try{e=JSON.parse(n)}catch{e=null}}return H=e}function P(){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 he=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),M=typeof process<"u"&&process.env&&!1;function $(t,e){let n=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 ${t} 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 Ee(t){P();let e=l.cursor;return e&&e.nodeType===1&&e.tagName.toLowerCase()===t.toLowerCase()?(he.has(t.toLowerCase())?l.cursor=e.nextSibling:(l.parents.push(e),l.cursor=e.firstChild),e):(M&&e&&$(`<${t}>`,e),null)}function be(t){P();let e=l.cursor;return e&&e.nodeType===1&&e.tagName.toLowerCase()===t.toLowerCase()?(l.cursor=e.nextSibling,e):(M&&e&&$(`<${t}> (static)`,e),null)}function Ne(t){if(t===""){let n=l.cursor;return n&&n.nodeType===3&&n.data!==""?(l.cursor=n.nextSibling,n.data="",n):null}P();let e=l.cursor;return e&&e.nodeType===3?(l.cursor=e.nextSibling,e.nodeValue!==t&&(e.nodeValue=t),e):(M&&e&&$(`text ${JSON.stringify(t.slice(0,24))}`,e),null)}function we(t){P();let e=l.cursor;return e&&e.nodeType===8&&e.data===t?(l.cursor=e.nextSibling,e):(M&&e&&$(`marker <!--${t.slice(0,24)}-->`,e),null)}var ne=!1;function Te(){ne||(ne=!0,U({hydrateElement:Ee,hydrateText:Ne,hydrateMarker:we,hydrateStatic:be}))}function oe(t,e,n){Te(),l.active=!0,l.cursor=e.firstChild,l.parents=[];let o=te(),u=n?.resourceNamespace,a=0;(0,L.setResourceIdSource)(()=>u?`${u}:r${a++}`:`r${a++}`),(0,L.setServerDataGetter)(o?s=>s in o?{value:o[s]}:void 0:null);try{return Q(t,e)}finally{l.active=!1,l.cursor=null,l.parents=[]}}var j="fluixi-island";function Se(t){let{component:e,props:n={},name:o}=t,u=Z(j),a=o??e.name??"Island";v(u,"name",a),v(u,"props",JSON.stringify(n??{}));let s=T?ee():void 0;if(s){let r=s.nextIslandNamespace(a);S(u,()=>s.withResourceScope(r,()=>e(n)))}else S(u,()=>e(n));return u}var re=!1;function ve(){if(re||typeof document>"u")return;re=!0;let t=document.createElement("style");t.textContent=`${j}{display:contents}`,document.head.appendChild(t)}function Ae(t){if(typeof document>"u")return;ve();let e=document.querySelectorAll(j),n=new Map;e.forEach(o=>{let u=o.getAttribute("name")??"",a=n.get(u)??0;n.set(u,a+1);let s=t[u];if(!s){typeof process>"u"&&console.warn(`[fluixi] island "${u}" has no component in the registry — left static.`);return}let r={};try{r=JSON.parse(o.getAttribute("props")||"{}")}catch{}oe(()=>s(r),o,{resourceNamespace:`${u}#${a}`})})}
1
+ "use strict";var O=Object.defineProperty;var ae=Object.getOwnPropertyDescriptor;var fe=Object.getOwnPropertyNames;var ue=Object.prototype.hasOwnProperty;var le=(t,e)=>{for(var n in e)O(t,n,{get:e[n],enumerable:!0})},ce=(t,e,n,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let u of fe(e))!ue.call(t,u)&&u!==n&&O(t,u,{get:()=>e[u],enumerable:!(o=ae(e,u))||o.enumerable});return t};var de=t=>ce(O({},"__esModule",{value:!0}),t);var Me={};le(Me,{Island:()=>Re,hydrateIslands:()=>Pe});module.exports=de(Me);var x=require("@fluixi/reactive/signal");var V="http://www.w3.org/2000/svg";function v(t,e,n,o=!1){if(n==null||n===!1){t.removeAttribute(e);return}if(n===!0){t.setAttribute(e,"");return}if(typeof n=="object"){t.setAttribute(e,JSON.stringify(n));return}t.setAttribute(e,String(n))}var _e=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;var W="1.0.0-alpha.83";var K=require("@fluixi/reactive/version"),m={dom:W,reactive:K.VERSION};function B(t){m.core&&t.setAttribute("fluixi",m.core),t.setAttribute("fx-dom",m.dom),t.setAttribute("fx-reactive",m.reactive),typeof globalThis<"u"&&(globalThis.Fluixi=m)}function G(){let t=[m.core,m.dom,m.reactive].filter(e=>e!==void 0);new Set(t).size<=1||console.warn(`[fluixi] package versions disagree — core ${m.core??"(absent)"}, dom ${m.dom}, reactive ${m.reactive}. These ship as one release, so a mismatch usually means a stale lockfile or two copies resolved side by side. Reinstall, or check for duplicates with \`pnpm why @fluixi/dom\`.`)}function N(t){return typeof t=="function"&&t[Symbol.for("fluixi-component")]===!0}var y=require("@fluixi/reactive/signal");var J=Symbol.for("fluixi.server-node"),pe=Symbol.for("fluixi.dom.server-host"),ye=globalThis,$=ye[pe]??={server:typeof document>"u",nodes:null};function T(){return $.server}function D(){if(!$.nodes)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return $.nodes}function I(t){return t!=null&&t[J]===!0?!0:typeof Node<"u"&&t instanceof Node}function X(t){return t!=null&&t[J]===!0?t.nodeType===3:typeof Text<"u"&&t instanceof Text}var l={active:!1,cursor:null,parents:[]},z=null;function U(t){z=t}function H(){return z}function q(t,e){return l.active&&e.parentNode===t}function Y(t){let e=l.parents.lastIndexOf(t);e!==-1&&(l.parents.length=e),l.cursor=t.nextSibling}var ge="__fx_loc";function Z(t,e){return e&&(t[ge]=e),t}function E(t,e=!1){if(T())return D().createText(t);if(l.active&&!e){let n=H()?.hydrateText(t);if(n)return n}return document.createTextNode(t)}function Q(t,e=!1,n){if(T())return D().createElement(t,e);if(l.active){let o=H()?.hydrateElement(t);if(o)return n?Z(o,n):o}return Z(e?document.createElementNS(V,t):document.createElement(t),n)}var b=0,me=200;function xe(t,e,n,o,u){let a=o,s=new Map;return(0,y.createRenderEffect)(()=>{(0,y.reportReactiveBinding)(n??e,"content",void 0,t);let r;if(N(t)&&!(0,x.isSignal)(t)){if(!s.has(t)){b++;try{let i=t();s.set(t,i)}finally{b--}}for(r=s.get(t);typeof r=="function"&&(0,x.isSignal)(r);)r=r()}else for(r=t();typeof r=="function"&&(0,x.isSignal)(r);)r=r();{let i=0;for(;typeof r=="function"&&i++<50;)if(N(r)){if(!s.has(r)){let f=r;b++;try{let c=f();s.set(f,c)}finally{b--}}r=s.get(r)}else if((0,x.isSignal)(r))r=r();else if(r=r(),typeof r!="function"||!(0,x.isSignal)(r)&&!N(r))break}b++;try{a=C(e,r,n,a,s),u(a)}finally{b--}})}function S(t,e,n,o){if(b>me)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;n!==void 0&&!n&&(n=E("",!0),t.appendChild(n));let u=o??null,a=i=>Array.isArray(i)&&i.some(f=>typeof f=="function"),s=i=>typeof i=="function"?i:()=>i;if(typeof e!="function"&&!a(e)){b++;try{u=C(t,e,n,u)}finally{b--}return()=>u}let r=xe(s(e),t,n,u,i=>{u=i});return()=>(r?.(),u)}function C(t,e,n,o,u){if(e==null||typeof e=="boolean")return w(t,o,n);if(typeof e=="function")for(;typeof e=="function";)e=e();if(e==null||typeof e=="boolean")return w(t,o,n);if(A(e)){let s=E("",!0);return Array.isArray(o)?o.length>0?(t.replaceChild(s,o[0]),w(t,o.slice(1),n)):g(t,s,n):o?t.replaceChild(s,o):g(t,s,n),e.then(r=>{s.parentNode===t&&C(t,r,s.nextSibling,s)}).catch(r=>{console.error("Error resolving promise in insertExpression:",r)}),s}let a=typeof e;if(a==="string"||a==="number"){if(a==="number"&&(e=String(e)),Array.isArray(o)){if(o.length===0){let r=E(e);return g(t,r,n),r}if(o.length===1&&o[0].nodeType===3)return o[0].data=e,o;o=w(t,o,n)}if(o&&X(o))return o.data=e,o;let s=E(e);return o&&o.parentNode===t?t.replaceChild(s,o):q(t,s)||g(t,s,n),s}if(I(e))return q(t,e)?(Y(e),e):Array.isArray(o)?(o.length===0?g(t,e,n):o[0].parentNode===t?(t.replaceChild(e,o[0]),w(t,o.slice(1),n)):g(t,e,n),e):(o?o!==e&&(o.parentNode===t?t.replaceChild(e,o):g(t,e,n)):g(t,e,n),e);if(Array.isArray(e)){let s=[],r=Array.isArray(o)?o:o?[o]:[],i=[];h(e,s,t,n,!0,u,i);let f=he(t,r,s,n);for(let c of i){let d=S(t,c.sig,c.marker);(0,y.onCleanup)(()=>{w(t,d()),c.marker.parentNode===t&&t.removeChild(c.marker)})}return f}if(a==="object"&&e!==null&&typeof e=="object"){let s=e;if("type"in s&&"props"in s){let r=s;if(typeof r.type=="function"){let i=r.type(r.props||{});return C(t,i,n,o)}}}return w(t,o,n)}function h(t,e,n,o,u=!0,a,s){for(let r=0;r<t.length;r++){let i=t[r];if(!(i==null||typeof i=="boolean")){for(;typeof i=="function"&&!A(i)&&!(0,x.isSignal)(i)&&!N(i)&&(i=i(),!(i==null||typeof i=="boolean")););if(!(i==null||typeof i=="boolean")){if(typeof i=="function"){let f;for(N(i)&&!(0,x.isSignal)(i)?(a||(a=new Map),a.has(i)||a.set(i,i()),f=a.get(i)):f=i();typeof f=="function"&&!A(f)&&!(0,x.isSignal)(f)&&!N(f);)a||(a=new Map),a.has(f)||a.set(f,f()),f=a.get(f);if(f==null||typeof f=="boolean")continue;if(typeof f=="function"){if((0,x.isSignal)(f)){if(s){let d=E("",!0);e.push(d),s.push({marker:d,sig:f});continue}let c=f();for(;typeof c=="function"&&(0,x.isSignal)(c);)c=c();if(c==null||typeof c=="boolean")continue;Array.isArray(c)?h(c,e,n,o,u,a):h([c],e,n,o,u,a);continue}continue}Array.isArray(f)?h(f,e,n,o,u,a,s):h([f],e,n,o,u,a,s);continue}if(A(i)){let f=E("",!0);e.push(f),i.then(c=>{if(f.parentNode){let d=[];if(h([c],d,f.parentNode,void 0,!1,a),d.length>0){f.parentNode.replaceChild(d[0],f);for(let p=1;p<d.length;p++)f.parentNode?.insertBefore(d[p],d[p-1].nextSibling)}}}).catch(c=>console.error("Error resolving promise in array:",c));continue}if(Array.isArray(i)){h(i,e,n,o,u,a,s);continue}if(I(i)){e.push(i);continue}if(typeof i=="object"&&i!==null&&"type"in i&&"props"in i){let f=i;if(typeof f.type=="function"){let c=f.type(f.props||{});Array.isArray(c)?h(c,e,n,o,!1,a):h([c],e,n,o,!1,a);continue}}if(typeof i=="string"||typeof i=="number"){let f=String(i);if(f.trim()===""&&f!==" ")continue;e.push(E(f));continue}e.push(E(String(i)))}}}}function he(t,e,n,o){for(let d=0;d<n.length;d++){let p=n[d].parentNode;p!==null&&p!==t&&p.nodeType!==11&&(n=n.slice(),n[d]=n[d].cloneNode(!0))}let u=n.length,a=e.length,s=u,r=0,i=0,f=a>0?e[a-1].nextSibling??void 0:o,c=null;for(;r<a||i<s;){if(e[r]===n[i]){r++,i++;continue}for(;a>r&&s>i&&e[a-1]===n[s-1];)a--,s--;if(a===r){let d=s<u?i?n[i-1].nextSibling??void 0:n[s-i]:f;for(;i<s;)g(t,n[i++],d)}else if(s===i)for(;r<a;)(!c||!c.has(e[r]))&&e[r].parentNode===t&&t.removeChild(e[r]),r++;else if(e[r]===n[s-1]&&n[i]===e[a-1]){let d=e[--a].nextSibling;g(t,n[i++],e[r++].nextSibling),g(t,n[--s],d),e[a]=e[r-1]}else{if(!c){c=new Map;let p=i;for(;p<s;)c.set(n[p],p++)}let d=c.get(e[r]);if(d!=null)if(i<d&&d<s){let p=r,_=1;for(;++p<a&&p<s&&!(!c.has(e[p])||c.get(e[p])!==d+_);)_++;if(_>d-i){let se=e[r];for(;i<d;)g(t,n[i++],se)}else e[r].parentNode===t?t.replaceChild(n[i++],e[r++]):(g(t,n[i++],f),r++)}else r++;else e[r].parentNode===t&&t.removeChild(e[r]),r++}}return n}function w(t,e,n){if(e)if(Array.isArray(e))for(let o=0;o<e.length;o++)e[o].parentNode===t&&t.removeChild(e[o]);else e.parentNode===t&&t.removeChild(e);return null}function g(t,e,n){l.active&&e.parentNode===t||(n&&n.parentNode===t?t.insertBefore(e,n):t.appendChild(e))}function A(t){return t!=null&&(typeof t=="object"||typeof t=="function")&&typeof t.then=="function"||t instanceof Promise}function ee(t,e,n){if(!e)throw new Error("Container element is required");let o,u,a=[];return(0,y.createRoot)(s=>{(0,y.batch)(()=>{l.active||(e.textContent=""),B(e),G(),S(e,t)}),u=s}),()=>{u?.(),o?.(),a.forEach(s=>s()),e.textContent=""}}var R,be={getStore:()=>R,run(t,e){let n=R;R=t;try{return e()}finally{R=n}}},Ee=be;function te(){return Ee.getStore()}var L=require("@fluixi/reactive/signal");var Ne="__FX_DATA__";var j;function ne(){let t=globalThis.__FX_DATA__;if(t)return t;if(j!==void 0)return j;let e=null;if(typeof document<"u"){let n=document.getElementById(Ne)?.textContent;if(n)try{e=JSON.parse(n)}catch{e=null}}return j=e}function P(){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 we=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),M=typeof process<"u"&&process.env&&!1;function k(t,e){let n=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 ${t} 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 Te(t){P();let e=l.cursor;return e&&e.nodeType===1&&e.tagName.toLowerCase()===t.toLowerCase()?(we.has(t.toLowerCase())?l.cursor=e.nextSibling:(l.parents.push(e),l.cursor=e.firstChild),e):(M&&e&&k(`<${t}>`,e),null)}function Se(t){P();let e=l.cursor;return e&&e.nodeType===1&&e.tagName.toLowerCase()===t.toLowerCase()?(l.cursor=e.nextSibling,e):(M&&e&&k(`<${t}> (static)`,e),null)}function ve(t){if(t===""){let n=l.cursor;return n&&n.nodeType===3&&n.data!==""?(l.cursor=n.nextSibling,n.data="",n):null}P();let e=l.cursor;return e&&e.nodeType===3?(l.cursor=e.nextSibling,e.nodeValue!==t&&(e.nodeValue=t),e):(M&&e&&k(`text ${JSON.stringify(t.slice(0,24))}`,e),null)}function Ae(t){P();let e=l.cursor;return e&&e.nodeType===8&&e.data===t?(l.cursor=e.nextSibling,e):(M&&e&&k(`marker <!--${t.slice(0,24)}-->`,e),null)}var oe=!1;function Ce(){oe||(oe=!0,U({hydrateElement:Te,hydrateText:ve,hydrateMarker:Ae,hydrateStatic:Se}))}function re(t,e,n){Ce(),l.active=!0,l.cursor=e.firstChild,l.parents=[];let o=ne(),u=n?.resourceNamespace,a=0;(0,L.setResourceIdSource)(()=>u?`${u}:r${a++}`:`r${a++}`),(0,L.setServerDataGetter)(o?s=>s in o?{value:o[s]}:void 0:null);try{return ee(t,e)}finally{l.active=!1,l.cursor=null,l.parents=[]}}var F="fluixi-island";function Re(t){let{component:e,props:n={},name:o}=t,u=Q(F),a=o??e.name??"Island";v(u,"name",a),v(u,"props",JSON.stringify(n??{}));let s=T()?te():void 0;if(s){let r=s.nextIslandNamespace(a);S(u,()=>s.withResourceScope(r,()=>e(n)))}else S(u,()=>e(n));return u}var ie=!1;function Le(){if(ie||typeof document>"u")return;ie=!0;let t=document.createElement("style");t.textContent=`${F}{display:contents}`,document.head.appendChild(t)}function Pe(t){if(typeof document>"u")return;Le();let e=document.querySelectorAll(F),n=new Map;e.forEach(o=>{let u=o.getAttribute("name")??"",a=n.get(u)??0;n.set(u,a+1);let s=t[u];if(!s){typeof process>"u"&&console.warn(`[fluixi] island "${u}" has no component in the registry — left static.`);return}let r={};try{r=JSON.parse(o.getAttribute("props")||"{}")}catch{}re(()=>s(r),o,{resourceNamespace:`${u}#${a}`})})}
@@ -42,7 +42,7 @@ export function Island(props) {
42
42
  // (`name#N` in render order). The render-once model runs the insert effect
43
43
  // synchronously, so resources created while the island's subtree renders are
44
44
  // numbered within the scope — and the client reproduces the same ids per island.
45
- const ctx = isServer ? getRequestContext() : undefined;
45
+ const ctx = isServer() ? getRequestContext() : undefined;
46
46
  if (ctx) {
47
47
  const ns = ctx.nextIslandNamespace(islandName);
48
48
  insert(el, () => ctx.withResourceScope(ns, () => component(cprops)));
@@ -1 +1 @@
1
- import{isSignal as m}from"@fluixi/reactive/signal";var q="http://www.w3.org/2000/svg";function S(t,e,n,i=!1){if(n==null||n===!1){t.removeAttribute(e);return}if(n===!0){t.setAttribute(e,"");return}if(typeof n=="object"){t.setAttribute(e,JSON.stringify(n));return}t.setAttribute(e,String(n))}var we=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;var H="1.0.0-alpha.82";import{VERSION as ne}from"@fluixi/reactive/version";var g={dom:H,reactive:ne};function j(t){g.core&&t.setAttribute("fluixi",g.core),t.setAttribute("fx-dom",g.dom),t.setAttribute("fx-reactive",g.reactive),typeof globalThis<"u"&&(globalThis.Fluixi=g)}function F(){let t=[g.core,g.dom,g.reactive].filter(e=>e!==void 0);new Set(t).size<=1||console.warn(`[fluixi] package versions disagree — core ${g.core??"(absent)"}, dom ${g.dom}, reactive ${g.reactive}. These ship as one release, so a mismatch usually means a stale lockfile or two copies resolved side by side. Reinstall, or check for duplicates with \`pnpm why @fluixi/dom\`.`)}function b(t){return typeof t=="function"&&t[Symbol.for("fluixi-component")]===!0}import{batch as oe,createEffect as je,createRenderEffect as re,createRoot as ie,onCleanup as se,readChildren as Fe}from"@fluixi/reactive/signal";var w=typeof document>"u";var W=Symbol.for("fluixi.server-node"),V=null;function $(){if(!V)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return V}function _(t){return t!=null&&t[W]===!0?!0:typeof Node<"u"&&t instanceof Node}function K(t){return t!=null&&t[W]===!0?t.nodeType===3:typeof Text<"u"&&t instanceof Text}var l={active:!1,cursor:null,parents:[]},B=null;function G(t){B=t}function k(){return B}function O(t,e){return l.active&&e.parentNode===t}function J(t){let e=l.parents.lastIndexOf(t);e!==-1&&(l.parents.length=e),l.cursor=t.nextSibling}function E(t,e=!1){if(w)return $().createText(t);if(l.active&&!e){let n=k()?.hydrateText(t);if(n)return n}return document.createTextNode(t)}function X(t,e=!1){if(w)return $().createElement(t,e);if(l.active){let n=k()?.hydrateElement(t);if(n)return n}return e?document.createElementNS(q,t):document.createElement(t)}var h=0,ae=200;function fe(t,e,n,i,u){let a=i,s=new Map;return re(()=>{let o;if(b(t)&&!m(t)){if(!s.has(t)){h++;try{let r=t();s.set(t,r)}finally{h--}}for(o=s.get(t);typeof o=="function"&&m(o);)o=o()}else for(o=t();typeof o=="function"&&m(o);)o=o();{let r=0;for(;typeof o=="function"&&r++<50;)if(b(o)){if(!s.has(o)){let f=o;h++;try{let c=f();s.set(f,c)}finally{h--}}o=s.get(o)}else if(m(o))o=o();else if(o=o(),typeof o!="function"||!m(o)&&!b(o))break}h++;try{a=A(e,o,n,a,s),u(a)}finally{h--}})}function T(t,e,n,i){if(h>ae)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;n!==void 0&&!n&&(n=E("",!0),t.appendChild(n));let u=i??null,a=r=>Array.isArray(r)&&r.some(f=>typeof f=="function"),s=r=>typeof r=="function"?r:()=>r;if(typeof e!="function"&&!a(e)){h++;try{u=A(t,e,n,u)}finally{h--}return()=>u}let o=fe(s(e),t,n,u,r=>{u=r});return()=>(o?.(),u)}function A(t,e,n,i,u){if(e==null||typeof e=="boolean")return N(t,i,n);if(typeof e=="function")for(;typeof e=="function";)e=e();if(e==null||typeof e=="boolean")return N(t,i,n);if(v(e)){let s=E("",!0);return Array.isArray(i)?i.length>0?(t.replaceChild(s,i[0]),N(t,i.slice(1),n)):y(t,s,n):i?t.replaceChild(s,i):y(t,s,n),e.then(o=>{s.parentNode===t&&A(t,o,s.nextSibling,s)}).catch(o=>{console.error("Error resolving promise in insertExpression:",o)}),s}let a=typeof e;if(a==="string"||a==="number"){if(a==="number"&&(e=String(e)),Array.isArray(i)){if(i.length===0){let o=E(e);return y(t,o,n),o}if(i.length===1&&i[0].nodeType===3)return i[0].data=e,i;i=N(t,i,n)}if(i&&K(i))return i.data=e,i;let s=E(e);return i&&i.parentNode===t?t.replaceChild(s,i):O(t,s)||y(t,s,n),s}if(_(e))return O(t,e)?(J(e),e):Array.isArray(i)?(i.length===0?y(t,e,n):i[0].parentNode===t?(t.replaceChild(e,i[0]),N(t,i.slice(1),n)):y(t,e,n),e):(i?i!==e&&(i.parentNode===t?t.replaceChild(e,i):y(t,e,n)):y(t,e,n),e);if(Array.isArray(e)){let s=[],o=Array.isArray(i)?i:i?[i]:[],r=[];x(e,s,t,n,!0,u,r);let f=ue(t,o,s,n);for(let c of r){let d=T(t,c.sig,c.marker);se(()=>{N(t,d()),c.marker.parentNode===t&&t.removeChild(c.marker)})}return f}if(a==="object"&&e!==null&&typeof e=="object"){let s=e;if("type"in s&&"props"in s){let o=s;if(typeof o.type=="function"){let r=o.type(o.props||{});return A(t,r,n,i)}}}return N(t,i,n)}function x(t,e,n,i,u=!0,a,s){for(let o=0;o<t.length;o++){let r=t[o];if(!(r==null||typeof r=="boolean")){for(;typeof r=="function"&&!v(r)&&!m(r)&&!b(r)&&(r=r(),!(r==null||typeof r=="boolean")););if(!(r==null||typeof r=="boolean")){if(typeof r=="function"){let f;for(b(r)&&!m(r)?(a||(a=new Map),a.has(r)||a.set(r,r()),f=a.get(r)):f=r();typeof f=="function"&&!v(f)&&!m(f)&&!b(f);)a||(a=new Map),a.has(f)||a.set(f,f()),f=a.get(f);if(f==null||typeof f=="boolean")continue;if(typeof f=="function"){if(m(f)){if(s){let d=E("",!0);e.push(d),s.push({marker:d,sig:f});continue}let c=f();for(;typeof c=="function"&&m(c);)c=c();if(c==null||typeof c=="boolean")continue;Array.isArray(c)?x(c,e,n,i,u,a):x([c],e,n,i,u,a);continue}continue}Array.isArray(f)?x(f,e,n,i,u,a,s):x([f],e,n,i,u,a,s);continue}if(v(r)){let f=E("",!0);e.push(f),r.then(c=>{if(f.parentNode){let d=[];if(x([c],d,f.parentNode,void 0,!1,a),d.length>0){f.parentNode.replaceChild(d[0],f);for(let p=1;p<d.length;p++)f.parentNode?.insertBefore(d[p],d[p-1].nextSibling)}}}).catch(c=>console.error("Error resolving promise in array:",c));continue}if(Array.isArray(r)){x(r,e,n,i,u,a,s);continue}if(_(r)){e.push(r);continue}if(typeof r=="object"&&r!==null&&"type"in r&&"props"in r){let f=r;if(typeof f.type=="function"){let c=f.type(f.props||{});Array.isArray(c)?x(c,e,n,i,!1,a):x([c],e,n,i,!1,a);continue}}if(typeof r=="string"||typeof r=="number"){let f=String(r);if(f.trim()===""&&f!==" ")continue;e.push(E(f));continue}e.push(E(String(r)))}}}}function ue(t,e,n,i){for(let d=0;d<n.length;d++){let p=n[d].parentNode;p!==null&&p!==t&&p.nodeType!==11&&(n=n.slice(),n[d]=n[d].cloneNode(!0))}let u=n.length,a=e.length,s=u,o=0,r=0,f=a>0?e[a-1].nextSibling??void 0:i,c=null;for(;o<a||r<s;){if(e[o]===n[r]){o++,r++;continue}for(;a>o&&s>r&&e[a-1]===n[s-1];)a--,s--;if(a===o){let d=s<u?r?n[r-1].nextSibling??void 0:n[s-r]:f;for(;r<s;)y(t,n[r++],d)}else if(s===r)for(;o<a;)(!c||!c.has(e[o]))&&e[o].parentNode===t&&t.removeChild(e[o]),o++;else if(e[o]===n[s-1]&&n[r]===e[a-1]){let d=e[--a].nextSibling;y(t,n[r++],e[o++].nextSibling),y(t,n[--s],d),e[a]=e[o-1]}else{if(!c){c=new Map;let p=r;for(;p<s;)c.set(n[p],p++)}let d=c.get(e[o]);if(d!=null)if(r<d&&d<s){let p=o,M=1;for(;++p<a&&p<s&&!(!c.has(e[p])||c.get(e[p])!==d+M);)M++;if(M>d-r){let te=e[o];for(;r<d;)y(t,n[r++],te)}else e[o].parentNode===t?t.replaceChild(n[r++],e[o++]):(y(t,n[r++],f),o++)}else o++;else e[o].parentNode===t&&t.removeChild(e[o]),o++}}return n}function N(t,e,n){if(e)if(Array.isArray(e))for(let i=0;i<e.length;i++)e[i].parentNode===t&&t.removeChild(e[i]);else e.parentNode===t&&t.removeChild(e);return null}function y(t,e,n){l.active&&e.parentNode===t||(n&&n.parentNode===t?t.insertBefore(e,n):t.appendChild(e))}function v(t){return t!=null&&(typeof t=="object"||typeof t=="function")&&typeof t.then=="function"||t instanceof Promise}function z(t,e,n){if(!e)throw new Error("Container element is required");let i,u,a=[];return ie(s=>{oe(()=>{l.active||(e.textContent=""),j(e),F(),T(e,t)}),u=s}),()=>{u?.(),i?.(),a.forEach(s=>s()),e.textContent=""}}var C,le={getStore:()=>C,run(t,e){let n=C;C=t;try{return e()}finally{C=n}}},ce=le;function U(){return ce.getStore()}import{setResourceIdSource as pe,setServerDataGetter as ye}from"@fluixi/reactive/signal";var de="__FX_DATA__";var D;function Y(){let t=globalThis.__FX_DATA__;if(t)return t;if(D!==void 0)return D;let e=null;if(typeof document<"u"){let n=document.getElementById(de)?.textContent;if(n)try{e=JSON.parse(n)}catch{e=null}}return D=e}function R(){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 ge=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),L=typeof process<"u"&&process.env&&!1;function P(t,e){let n=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 ${t} 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 me(t){R();let e=l.cursor;return e&&e.nodeType===1&&e.tagName.toLowerCase()===t.toLowerCase()?(ge.has(t.toLowerCase())?l.cursor=e.nextSibling:(l.parents.push(e),l.cursor=e.firstChild),e):(L&&e&&P(`<${t}>`,e),null)}function xe(t){R();let e=l.cursor;return e&&e.nodeType===1&&e.tagName.toLowerCase()===t.toLowerCase()?(l.cursor=e.nextSibling,e):(L&&e&&P(`<${t}> (static)`,e),null)}function he(t){if(t===""){let n=l.cursor;return n&&n.nodeType===3&&n.data!==""?(l.cursor=n.nextSibling,n.data="",n):null}R();let e=l.cursor;return e&&e.nodeType===3?(l.cursor=e.nextSibling,e.nodeValue!==t&&(e.nodeValue=t),e):(L&&e&&P(`text ${JSON.stringify(t.slice(0,24))}`,e),null)}function Ee(t){R();let e=l.cursor;return e&&e.nodeType===8&&e.data===t?(l.cursor=e.nextSibling,e):(L&&e&&P(`marker <!--${t.slice(0,24)}-->`,e),null)}var Z=!1;function be(){Z||(Z=!0,G({hydrateElement:me,hydrateText:he,hydrateMarker:Ee,hydrateStatic:xe}))}function Q(t,e,n){be(),l.active=!0,l.cursor=e.firstChild,l.parents=[];let i=Y(),u=n?.resourceNamespace,a=0;pe(()=>u?`${u}:r${a++}`:`r${a++}`),ye(i?s=>s in i?{value:i[s]}:void 0:null);try{return z(t,e)}finally{l.active=!1,l.cursor=null,l.parents=[]}}var I="fluixi-island";function rt(t){let{component:e,props:n={},name:i}=t,u=X(I),a=i??e.name??"Island";S(u,"name",a),S(u,"props",JSON.stringify(n??{}));let s=w?U():void 0;if(s){let o=s.nextIslandNamespace(a);T(u,()=>s.withResourceScope(o,()=>e(n)))}else T(u,()=>e(n));return u}var ee=!1;function Ne(){if(ee||typeof document>"u")return;ee=!0;let t=document.createElement("style");t.textContent=`${I}{display:contents}`,document.head.appendChild(t)}function it(t){if(typeof document>"u")return;Ne();let e=document.querySelectorAll(I),n=new Map;e.forEach(i=>{let u=i.getAttribute("name")??"",a=n.get(u)??0;n.set(u,a+1);let s=t[u];if(!s){typeof process>"u"&&console.warn(`[fluixi] island "${u}" has no component in the registry — left static.`);return}let o={};try{o=JSON.parse(i.getAttribute("props")||"{}")}catch{}Q(()=>s(o),i,{resourceNamespace:`${u}#${a}`})})}export{rt as Island,it as hydrateIslands};
1
+ import{isSignal as m}from"@fluixi/reactive/signal";var q="http://www.w3.org/2000/svg";function S(t,e,n,o=!1){if(n==null||n===!1){t.removeAttribute(e);return}if(n===!0){t.setAttribute(e,"");return}if(typeof n=="object"){t.setAttribute(e,JSON.stringify(n));return}t.setAttribute(e,String(n))}var Ce=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;var j="1.0.0-alpha.83";import{VERSION as oe}from"@fluixi/reactive/version";var g={dom:j,reactive:oe};function F(t){g.core&&t.setAttribute("fluixi",g.core),t.setAttribute("fx-dom",g.dom),t.setAttribute("fx-reactive",g.reactive),typeof globalThis<"u"&&(globalThis.Fluixi=g)}function V(){let t=[g.core,g.dom,g.reactive].filter(e=>e!==void 0);new Set(t).size<=1||console.warn(`[fluixi] package versions disagree — core ${g.core??"(absent)"}, dom ${g.dom}, reactive ${g.reactive}. These ship as one release, so a mismatch usually means a stale lockfile or two copies resolved side by side. Reinstall, or check for duplicates with \`pnpm why @fluixi/dom\`.`)}function E(t){return typeof t=="function"&&t[Symbol.for("fluixi-component")]===!0}import{batch as se,createEffect as Be,createRenderEffect as ae,createRoot as fe,onCleanup as ue,readChildren as Ge,reportReactiveBinding as le,reportReactiveDirective as Je,untrack as Xe}from"@fluixi/reactive/signal";var W=Symbol.for("fluixi.server-node"),re=Symbol.for("fluixi.dom.server-host"),ie=globalThis,k=ie[re]??={server:typeof document>"u",nodes:null};function w(){return k.server}function _(){if(!k.nodes)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return k.nodes}function O(t){return t!=null&&t[W]===!0?!0:typeof Node<"u"&&t instanceof Node}function K(t){return t!=null&&t[W]===!0?t.nodeType===3:typeof Text<"u"&&t instanceof Text}var l={active:!1,cursor:null,parents:[]},B=null;function G(t){B=t}function $(){return B}function D(t,e){return l.active&&e.parentNode===t}function J(t){let e=l.parents.lastIndexOf(t);e!==-1&&(l.parents.length=e),l.cursor=t.nextSibling}var ce="__fx_loc";function X(t,e){return e&&(t[ce]=e),t}function b(t,e=!1){if(w())return _().createText(t);if(l.active&&!e){let n=$()?.hydrateText(t);if(n)return n}return document.createTextNode(t)}function z(t,e=!1,n){if(w())return _().createElement(t,e);if(l.active){let o=$()?.hydrateElement(t);if(o)return n?X(o,n):o}return X(e?document.createElementNS(q,t):document.createElement(t),n)}var h=0,de=200;function pe(t,e,n,o,u){let a=o,s=new Map;return ae(()=>{le(n??e,"content",void 0,t);let r;if(E(t)&&!m(t)){if(!s.has(t)){h++;try{let i=t();s.set(t,i)}finally{h--}}for(r=s.get(t);typeof r=="function"&&m(r);)r=r()}else for(r=t();typeof r=="function"&&m(r);)r=r();{let i=0;for(;typeof r=="function"&&i++<50;)if(E(r)){if(!s.has(r)){let f=r;h++;try{let c=f();s.set(f,c)}finally{h--}}r=s.get(r)}else if(m(r))r=r();else if(r=r(),typeof r!="function"||!m(r)&&!E(r))break}h++;try{a=A(e,r,n,a,s),u(a)}finally{h--}})}function T(t,e,n,o){if(h>de)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;n!==void 0&&!n&&(n=b("",!0),t.appendChild(n));let u=o??null,a=i=>Array.isArray(i)&&i.some(f=>typeof f=="function"),s=i=>typeof i=="function"?i:()=>i;if(typeof e!="function"&&!a(e)){h++;try{u=A(t,e,n,u)}finally{h--}return()=>u}let r=pe(s(e),t,n,u,i=>{u=i});return()=>(r?.(),u)}function A(t,e,n,o,u){if(e==null||typeof e=="boolean")return N(t,o,n);if(typeof e=="function")for(;typeof e=="function";)e=e();if(e==null||typeof e=="boolean")return N(t,o,n);if(v(e)){let s=b("",!0);return Array.isArray(o)?o.length>0?(t.replaceChild(s,o[0]),N(t,o.slice(1),n)):y(t,s,n):o?t.replaceChild(s,o):y(t,s,n),e.then(r=>{s.parentNode===t&&A(t,r,s.nextSibling,s)}).catch(r=>{console.error("Error resolving promise in insertExpression:",r)}),s}let a=typeof e;if(a==="string"||a==="number"){if(a==="number"&&(e=String(e)),Array.isArray(o)){if(o.length===0){let r=b(e);return y(t,r,n),r}if(o.length===1&&o[0].nodeType===3)return o[0].data=e,o;o=N(t,o,n)}if(o&&K(o))return o.data=e,o;let s=b(e);return o&&o.parentNode===t?t.replaceChild(s,o):D(t,s)||y(t,s,n),s}if(O(e))return D(t,e)?(J(e),e):Array.isArray(o)?(o.length===0?y(t,e,n):o[0].parentNode===t?(t.replaceChild(e,o[0]),N(t,o.slice(1),n)):y(t,e,n),e):(o?o!==e&&(o.parentNode===t?t.replaceChild(e,o):y(t,e,n)):y(t,e,n),e);if(Array.isArray(e)){let s=[],r=Array.isArray(o)?o:o?[o]:[],i=[];x(e,s,t,n,!0,u,i);let f=ye(t,r,s,n);for(let c of i){let d=T(t,c.sig,c.marker);ue(()=>{N(t,d()),c.marker.parentNode===t&&t.removeChild(c.marker)})}return f}if(a==="object"&&e!==null&&typeof e=="object"){let s=e;if("type"in s&&"props"in s){let r=s;if(typeof r.type=="function"){let i=r.type(r.props||{});return A(t,i,n,o)}}}return N(t,o,n)}function x(t,e,n,o,u=!0,a,s){for(let r=0;r<t.length;r++){let i=t[r];if(!(i==null||typeof i=="boolean")){for(;typeof i=="function"&&!v(i)&&!m(i)&&!E(i)&&(i=i(),!(i==null||typeof i=="boolean")););if(!(i==null||typeof i=="boolean")){if(typeof i=="function"){let f;for(E(i)&&!m(i)?(a||(a=new Map),a.has(i)||a.set(i,i()),f=a.get(i)):f=i();typeof f=="function"&&!v(f)&&!m(f)&&!E(f);)a||(a=new Map),a.has(f)||a.set(f,f()),f=a.get(f);if(f==null||typeof f=="boolean")continue;if(typeof f=="function"){if(m(f)){if(s){let d=b("",!0);e.push(d),s.push({marker:d,sig:f});continue}let c=f();for(;typeof c=="function"&&m(c);)c=c();if(c==null||typeof c=="boolean")continue;Array.isArray(c)?x(c,e,n,o,u,a):x([c],e,n,o,u,a);continue}continue}Array.isArray(f)?x(f,e,n,o,u,a,s):x([f],e,n,o,u,a,s);continue}if(v(i)){let f=b("",!0);e.push(f),i.then(c=>{if(f.parentNode){let d=[];if(x([c],d,f.parentNode,void 0,!1,a),d.length>0){f.parentNode.replaceChild(d[0],f);for(let p=1;p<d.length;p++)f.parentNode?.insertBefore(d[p],d[p-1].nextSibling)}}}).catch(c=>console.error("Error resolving promise in array:",c));continue}if(Array.isArray(i)){x(i,e,n,o,u,a,s);continue}if(O(i)){e.push(i);continue}if(typeof i=="object"&&i!==null&&"type"in i&&"props"in i){let f=i;if(typeof f.type=="function"){let c=f.type(f.props||{});Array.isArray(c)?x(c,e,n,o,!1,a):x([c],e,n,o,!1,a);continue}}if(typeof i=="string"||typeof i=="number"){let f=String(i);if(f.trim()===""&&f!==" ")continue;e.push(b(f));continue}e.push(b(String(i)))}}}}function ye(t,e,n,o){for(let d=0;d<n.length;d++){let p=n[d].parentNode;p!==null&&p!==t&&p.nodeType!==11&&(n=n.slice(),n[d]=n[d].cloneNode(!0))}let u=n.length,a=e.length,s=u,r=0,i=0,f=a>0?e[a-1].nextSibling??void 0:o,c=null;for(;r<a||i<s;){if(e[r]===n[i]){r++,i++;continue}for(;a>r&&s>i&&e[a-1]===n[s-1];)a--,s--;if(a===r){let d=s<u?i?n[i-1].nextSibling??void 0:n[s-i]:f;for(;i<s;)y(t,n[i++],d)}else if(s===i)for(;r<a;)(!c||!c.has(e[r]))&&e[r].parentNode===t&&t.removeChild(e[r]),r++;else if(e[r]===n[s-1]&&n[i]===e[a-1]){let d=e[--a].nextSibling;y(t,n[i++],e[r++].nextSibling),y(t,n[--s],d),e[a]=e[r-1]}else{if(!c){c=new Map;let p=i;for(;p<s;)c.set(n[p],p++)}let d=c.get(e[r]);if(d!=null)if(i<d&&d<s){let p=r,M=1;for(;++p<a&&p<s&&!(!c.has(e[p])||c.get(e[p])!==d+M);)M++;if(M>d-i){let ne=e[r];for(;i<d;)y(t,n[i++],ne)}else e[r].parentNode===t?t.replaceChild(n[i++],e[r++]):(y(t,n[i++],f),r++)}else r++;else e[r].parentNode===t&&t.removeChild(e[r]),r++}}return n}function N(t,e,n){if(e)if(Array.isArray(e))for(let o=0;o<e.length;o++)e[o].parentNode===t&&t.removeChild(e[o]);else e.parentNode===t&&t.removeChild(e);return null}function y(t,e,n){l.active&&e.parentNode===t||(n&&n.parentNode===t?t.insertBefore(e,n):t.appendChild(e))}function v(t){return t!=null&&(typeof t=="object"||typeof t=="function")&&typeof t.then=="function"||t instanceof Promise}function U(t,e,n){if(!e)throw new Error("Container element is required");let o,u,a=[];return fe(s=>{se(()=>{l.active||(e.textContent=""),F(e),V(),T(e,t)}),u=s}),()=>{u?.(),o?.(),a.forEach(s=>s()),e.textContent=""}}var C,ge={getStore:()=>C,run(t,e){let n=C;C=t;try{return e()}finally{C=n}}},me=ge;function Y(){return me.getStore()}import{setResourceIdSource as he,setServerDataGetter as be}from"@fluixi/reactive/signal";var xe="__FX_DATA__";var I;function Z(){let t=globalThis.__FX_DATA__;if(t)return t;if(I!==void 0)return I;let e=null;if(typeof document<"u"){let n=document.getElementById(xe)?.textContent;if(n)try{e=JSON.parse(n)}catch{e=null}}return I=e}function R(){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 Ee=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),L=typeof process<"u"&&process.env&&!1;function P(t,e){let n=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 ${t} 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 Ne(t){R();let e=l.cursor;return e&&e.nodeType===1&&e.tagName.toLowerCase()===t.toLowerCase()?(Ee.has(t.toLowerCase())?l.cursor=e.nextSibling:(l.parents.push(e),l.cursor=e.firstChild),e):(L&&e&&P(`<${t}>`,e),null)}function we(t){R();let e=l.cursor;return e&&e.nodeType===1&&e.tagName.toLowerCase()===t.toLowerCase()?(l.cursor=e.nextSibling,e):(L&&e&&P(`<${t}> (static)`,e),null)}function Te(t){if(t===""){let n=l.cursor;return n&&n.nodeType===3&&n.data!==""?(l.cursor=n.nextSibling,n.data="",n):null}R();let e=l.cursor;return e&&e.nodeType===3?(l.cursor=e.nextSibling,e.nodeValue!==t&&(e.nodeValue=t),e):(L&&e&&P(`text ${JSON.stringify(t.slice(0,24))}`,e),null)}function Se(t){R();let e=l.cursor;return e&&e.nodeType===8&&e.data===t?(l.cursor=e.nextSibling,e):(L&&e&&P(`marker <!--${t.slice(0,24)}-->`,e),null)}var Q=!1;function ve(){Q||(Q=!0,G({hydrateElement:Ne,hydrateText:Te,hydrateMarker:Se,hydrateStatic:we}))}function ee(t,e,n){ve(),l.active=!0,l.cursor=e.firstChild,l.parents=[];let o=Z(),u=n?.resourceNamespace,a=0;he(()=>u?`${u}:r${a++}`:`r${a++}`),be(o?s=>s in o?{value:o[s]}:void 0:null);try{return U(t,e)}finally{l.active=!1,l.cursor=null,l.parents=[]}}var H="fluixi-island";function lt(t){let{component:e,props:n={},name:o}=t,u=z(H),a=o??e.name??"Island";S(u,"name",a),S(u,"props",JSON.stringify(n??{}));let s=w()?Y():void 0;if(s){let r=s.nextIslandNamespace(a);T(u,()=>s.withResourceScope(r,()=>e(n)))}else T(u,()=>e(n));return u}var te=!1;function Ae(){if(te||typeof document>"u")return;te=!0;let t=document.createElement("style");t.textContent=`${H}{display:contents}`,document.head.appendChild(t)}function ct(t){if(typeof document>"u")return;Ae();let e=document.querySelectorAll(H),n=new Map;e.forEach(o=>{let u=o.getAttribute("name")??"",a=n.get(u)??0;n.set(u,a+1);let s=t[u];if(!s){typeof process>"u"&&console.warn(`[fluixi] island "${u}" has no component in the registry — left static.`);return}let r={};try{r=JSON.parse(o.getAttribute("props")||"{}")}catch{}ee(()=>s(r),o,{resourceNamespace:`${u}#${a}`})})}export{lt as Island,ct as hydrateIslands};