@unsetsoft/ryunixjs 1.2.5-canary.11 → 1.2.5-canary.13

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.
@@ -1,2 +1,2 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).Ryunix={})}(this,function(e){"use strict";const t="undefined"!=typeof requestIdleCallback?requestIdleCallback:e=>setTimeout(()=>e({timeRemaining:()=>1}),1);let r={containerRoot:null,nextUnitOfWork:null,currentRoot:null,wipRoot:null,deletions:[],wipFiber:null,hookIndex:0,effects:[]};const n=()=>r,o=/[A-Z]/g,i=Object.freeze({TEXT_ELEMENT:Symbol.for("ryunix.text.element"),RYUNIX_ELEMENT:Symbol.for("ryunix.element"),RYUNIX_EFFECT:Symbol.for("ryunix.effect"),RYUNIX_MEMO:Symbol.for("ryunix.memo"),RYUNIX_URL_QUERY:Symbol.for("ryunix.urlQuery"),RYUNIX_REF:Symbol.for("ryunix.ref"),RYUNIX_STORE:Symbol.for("ryunix.store"),RYUNIX_REDUCE:Symbol.for("ryunix.reduce"),RYUNIX_FRAGMENT:Symbol.for("ryunix.fragment"),RYUNIX_CONTEXT:Symbol.for("ryunix.context"),RYUNIX_SUSPENSE:Symbol.for("ryunix.suspense")}),s=Object.freeze({OBJECT:"object",FUNCTION:"function",STYLE:"ryunix-style",CLASS_NAME:"ryunix-class",CHILDREN:"children",BOOLEAN:"boolean",STRING:"string",UNDEFINED:"undefined"}),a=Object.freeze({STYLE:"style",CLASS_NAME:"className"}),l=Object.freeze({PLACEMENT:Symbol.for("ryunix.reconciler.status.placement"),UPDATE:Symbol.for("ryunix.reconciler.status.update"),DELETION:Symbol.for("ryunix.reconciler.status.deletion"),NO_EFFECT:Symbol.for("ryunix.reconciler.status.no_effect"),HYDRATE:Symbol.for("ryunix.reconciler.status.hydrate")});function c(e,t=1){return Array.isArray(e)?t<1?e.slice():e.reduce((e,r)=>(Array.isArray(r)&&t>0?e.push(...c(r,t-1)):e.push(r),e),[]):[e]}const u=e=>null!==e&&typeof e===s.OBJECT,d=e=>typeof e===s.FUNCTION,p=e=>typeof e===s.STRING,f=e=>null===e;function y(e){let t=e;for(;t&&(3===t.nodeType&&!t.nodeValue?.trim()||8===t.nodeType||1===t.nodeType&&t.hasAttribute("data-ryunix-ssr"));)t=t.nextSibling;return t}const h=e=>({type:i.TEXT_ELEMENT,props:{nodeValue:String(e),children:[]}}),m=(e,t,...r)=>{const n=t||{};let o=r;0===r.length&&void 0!==n.children&&(o=Array.isArray(n.children)?n.children:[n.children]),o=o.flat().filter(e=>null!=e&&!1!==e&&!0!==e);const i=[];let a="";for(const e of o)typeof e!==s.OBJECT?a+=String(e):(""!==a&&(i.push(h(a)),a=""),i.push(e));return""!==a&&i.push(h(a)),{type:e,props:{...n,children:i}}},g=e=>{const t=Array.isArray(e.children)?e.children:[e.children];return m(i.RYUNIX_FRAGMENT,{},...t)},E=(e,t={},...r)=>{if(!e||!u(e))throw new Error("cloneElement requires a valid element");const n=r.length>0?r:e.props.children??[];return m(e.type,{...e.props,...t},...Array.isArray(n)?n:[n])},x=e=>u(e)&&void 0!==e.type&&void 0!==e.props,R=e=>e.startsWith("on"),v=e=>e!==s.CHILDREN&&!R(e),b=(e,t)=>r=>!Object.is(e[r],t[r]),N=e=>t=>!(t in e),_=e=>{e?.hooks?.length&&e.hooks.filter(e=>e.type===i.RYUNIX_EFFECT&&d(e.cancel)).forEach(e=>{try{e.cancel&&e.cancel(),e.cancel=null}catch(e){"production"!==process.env.NODE_ENV&&console.error("Error in effect cleanup:",e)}})},w=e=>{e&&(e.hooks?.length&&e.hooks.filter(e=>e.type===i.RYUNIX_EFFECT&&d(e.cancel)).forEach(e=>{try{e.cancel&&e.cancel(),e.cancel=null}catch(e){"production"!==process.env.NODE_ENV&&console.error("Error in deep effect cleanup:",e)}}),e.child&&w(e.child),e.sibling&&w(e.sibling))},S={strokeWidth:"stroke-width",strokeLinecap:"stroke-linecap",strokeLinejoin:"stroke-linejoin",strokeDasharray:"stroke-dasharray",strokeDashoffset:"stroke-dashoffset",strokeMiterlimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",fillRule:"fill-rule",fillOpacity:"fill-opacity",clipRule:"clip-rule",clipPath:"clip-path",fontFamily:"font-family",fontSize:"font-size",fontWeight:"font-weight",textAnchor:"text-anchor",textDecoration:"text-decoration",dominantBaseline:"dominant-baseline",alignmentBaseline:"alignment-baseline",baselineShift:"baseline-shift",stopColor:"stop-color",stopOpacity:"stop-opacity",floodColor:"flood-color",floodOpacity:"flood-opacity",lightingColor:"lighting-color",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",pointerEvents:"pointer-events",shapeRendering:"shape-rendering",imageRendering:"image-rendering",markerStart:"marker-start",markerMid:"marker-mid",markerEnd:"marker-end"};function T(e){return S[e]??e}const k={IMMEDIATE:1,USER_BLOCKING:2,NORMAL:3,LOW:4,IDLE:5};let I=k.NORMAL,C=[],O=!1;function A(e){for(C.sort((e,t)=>e.priority-t.priority);C.length>0&&e.timeRemaining()>1;){const e=C.shift();if(!e)break;I=e.priority,e.callback()}C.length>0?t(A):(O=!1,I=k.NORMAL)}function D(e,t){const r=I;I=e;try{return t()}finally{I=r}}function M(){return I}const L=e=>e.replace(o,e=>`-${e.toLowerCase()}`),U=(e,t,r)=>{if(!r||""===r.trim()){if(t){const r=t.split(/\s+/).filter(Boolean);e.classList.remove(...r)}return}if(t){const r=t.split(/\s+/).filter(Boolean);e.classList.remove(...r)}const n=r.split(/\s+/).filter(Boolean);n.length>0&&e.classList.add(...n)},Y=e=>{if(e.type===i.RYUNIX_FRAGMENT||e.type===i.RYUNIX_CONTEXT||e.type===Symbol.for("ryunix.portal"))return null;let t;try{if(e.type===i.TEXT_ELEMENT)t=document.createTextNode("");else{if(!p(e.type))return"production"!==process.env.NODE_ENV&&console.warn("Attempted to create DOM for non-host component:",e.type),null;{const r=e.type;t=["svg","path","g","circle","polygon","rect","line","polyline","ellipse","text","tspan","defs","use","symbol","mask","clipPath","linearGradient","radialGradient","stop","filter","feGaussianBlur","feOffset","feMerge","feMergeNode","feBlend","feColorMatrix","feComposite","foreignObject","image","marker","pattern","textPath"].includes(r)?document.createElementNS("http://www.w3.org/2000/svg",r):document.createElement(r)}}return H(t,{},e.props),t}catch(t){return"production"!==process.env.NODE_ENV&&console.error("Error creating DOM element:",t,e),null}},$=(e,t)=>{if("string"!=typeof t)return t;const r=e.toLowerCase();if("href"!==r&&"src"!==r&&"action"!==r&&"formaction"!==r)return t;const n=t.replace(/\s+/g,"").toLowerCase();return n.startsWith("javascript:")||n.startsWith("vbscript:")||n.startsWith("data:")?("production"!==process.env.NODE_ENV&&console.warn(`[Ryunix Security] Blocked dangerous ${e} URI: ${t}`),"javascript:void(0)"):t},F=$,H=(e,t={},r={})=>{if(3===e.nodeType)return void(t.nodeValue!==r.nodeValue&&(e.nodeValue=String(r.nodeValue??"")));const n=e,o=n,i=o._ryunixHandlers;Object.keys(t).filter(R).filter(e=>N(r)(e)||b(t,r)(e)).forEach(e=>{const r=e.toLowerCase().substring(2);try{const o=t[e],s=i?.get(o)||o;n.removeEventListener(r,s),i&&i.delete(o)}catch(e){"production"!==process.env.NODE_ENV&&console.warn("Error removing event listener:",e)}}),Object.keys(t).filter(v).filter(N(r)).forEach(e=>{if(e!==s.STYLE&&e!==a.STYLE&&e!==s.CLASS_NAME&&e!==a.CLASS_NAME)if(n instanceof SVGElement){const t=T(e);n.removeAttribute(t)}else n[e]="",n.removeAttribute(e)}),Object.keys(r).filter(v).filter(b(t,r)).forEach(e=>{try{if(e===s.STYLE||e===a.STYLE){const t=r[e];((e,t)=>{if(u(t)&&!f(t))try{const r=Object.entries(t).filter(([e,t])=>null!=t).map(([e,t])=>`${L(e)}: ${t}`).join("; ");e.style.cssText=r}catch(e){"production"!==process.env.NODE_ENV&&console.error("Error applying styles:",e)}else e.style.cssText=""})(n,t)}else if(e===s.CLASS_NAME)U(n,t[s.CLASS_NAME],r[s.CLASS_NAME]);else if(e===a.CLASS_NAME)U(n,t[a.CLASS_NAME],r[a.CLASS_NAME]);else if("value"===e||"checked"===e)n[e]!==r[e]&&(n[e]=r[e]);else{if(n instanceof SVGElement){const t=T(e),o=$(t,r[e]);n.setAttribute(t,o)}else{const t=r[e],o=$(e,t);n[e]=o,"object"!=typeof t&&"function"!=typeof t&&n.setAttribute(e,o)}}}catch(t){"production"!==process.env.NODE_ENV&&console.warn(`Error setting property ${e}:`,t)}}),Object.keys(r).filter(R).filter(b(t,r)).forEach(e=>{const t=e.toLowerCase().substring(2);try{const i=t=>{D(k.IMMEDIATE,()=>r[e](t))};o._ryunixHandlers||(o._ryunixHandlers=new Map),o._ryunixHandlers.set(r[e],i),n.addEventListener(t,i)}catch(e){"production"!==process.env.NODE_ENV&&console.warn("Error adding event listener:",e)}})},X=e=>{if(e)for(;e.firstChild;)e.removeChild(e.firstChild)},j=Symbol.for("ryunix.portal");function P(e,t){return t?{type:j,props:{children:Array.isArray(e)?e:[e]},containerInfo:t,_isPortal:!0}:("production"!==process.env.NODE_ENV&&console.error("createPortal: target container is not a DOM element."),null)}const B=(e,t)=>{const r=`[Ryunix Hydration] ${t}`;"error"===e?console.error(r):console.warn(r)},V=()=>"production"!==process.env.NODE_ENV&&"true"===process.env.RYUNIX_HYDRATION_STRICT,W=e=>{V()&&B("warn",e)},q=e=>{const t=n();if(t.hydrationBoundaryMismatchReported)return;t.hydrationBoundaryMismatchReported=!0;const r="production"===process.env.NODE_ENV?"error":"warn";B(r,`${e} Recovering the nearest hydration boundary with a scoped client render.`)},G=e=>{V()&&B("warn",`Recovered a hydration mismatch (${e}) without root fallback.`)},z=()=>{const e=n();e.hydrationBoundaryRecoveryReported||(e.hydrationBoundaryRecoveryReported=!0,B("warn","Remounting a hydration boundary after local mismatch."))},K=e=>{B("error",e)},Q=e=>{if(e?.hooks?.length)for(let t=0;t<e.hooks.length;t++){const r=e.hooks[t];if(r.type===i.RYUNIX_EFFECT&&r.isLayout&&d(r.effect)){if(d(r.cancel))try{r.cancel()}catch(e){"production"!==process.env.NODE_ENV&&console.error("Error in layout effect cleanup:",e)}try{const e=r.effect();r.cancel=d(e)?e:null}catch(e){"production"!==process.env.NODE_ENV&&console.error("Error in layout effect:",e),r.cancel=null}r.effect=null}}},J=e=>{if(e?.hooks?.length)for(let t=0;t<e.hooks.length;t++){const r=e.hooks[t];if(r.type===i.RYUNIX_EFFECT&&!r.isLayout&&d(r.effect)){if(d(r.cancel))try{r.cancel()}catch(e){"production"!==process.env.NODE_ENV&&console.error("Error in effect cleanup:",e)}try{const e=r.effect();r.cancel=d(e)?e:null}catch(e){"production"!==process.env.NODE_ENV&&console.error("Error in effect:",e),r.cancel=null}r.effect=null}}};function Z(){const e=n();e.deletions.forEach(ee);const t=e.wipRoot;if(e.currentRoot=t,e.isHydrating||e.hydrationFailed){if("production"!==process.env.NODE_ENV&&process.env.RYUNIX_DEBUG&&console.log(`[Ryunix Debug] commitRoot - isHydrating: ${e.isHydrating}, hydrationFailed: ${e.hydrationFailed}`),e.hydrationFailed);else{let t=e.hydrateCursor,r=0;for(t&&"production"!==process.env.NODE_ENV&&process.env.RYUNIX_DEBUG&&console.log("[Ryunix Debug] Removing unmatched root siblings.");t;){const e=t.nextSibling;t.parentNode&&(t.parentNode.removeChild(t),r++),t=e}(e=>{if(!e)return;const t=n();t.hydrationUnmatchedReported||(t.hydrationUnmatchedReported=!0,B("warn",`Removed ${e} server-rendered DOM node(s) that were not used by the client tree. This can indicate an SSR/client markup mismatch.`))})(r)}e.isHydrating=!1,e.hydrationFailed=!1,e.hydrateCursor=null}ee(t.child),e.wipRoot===t&&(e.wipRoot=null)}function ee(e){if(!e)return;if(e.type===j||e._isPortal){const t=e.containerInfo;if(t){const r=e.child;r&&te(r,t)}return void ee(e.sibling)}let t=e.parent;for(;t&&!t.dom;)t=t.parent;if(!t)return;const r=t.dom;if(e.effectTag===l.PLACEMENT)null!=e.dom&&("production"!==process.env.NODE_ENV&&process.env.RYUNIX_DEBUG&&console.log("[Ryunix Debug] Appending PLACEMENT:",e.type),r.appendChild(e.dom)),Q(e),J(e);else if(e.effectTag===l.UPDATE)_(e),null!=e.dom&&H(e.dom,e.alternate.props,e.props),Q(e),J(e);else if(e.effectTag===l.HYDRATE){n().hydrationFailed?("production"!==process.env.NODE_ENV&&process.env.RYUNIX_DEBUG&&console.log("[Ryunix Debug] Hydration fallback PLACEMENT:",e.type),null!=e.dom&&r.appendChild(e.dom),Q(e),J(e)):("production"!==process.env.NODE_ENV&&process.env.RYUNIX_DEBUG&&console.log("[Ryunix Debug] Hydrating node:",e.type),null!=e.dom&&H(e.dom,{},e.props),Q(e),J(e))}else if(e.effectTag===l.DELETION)return w(e),void re(e);ee(e.child),ee(e.sibling)}const te=(e,t)=>{if(e){if(e.effectTag===l.PLACEMENT)null!=e.dom&&t.appendChild(e.dom),Q(e),J(e);else if(e.effectTag===l.UPDATE)_(e),null!=e.dom&&H(e.dom,e.alternate.props,e.props),Q(e),J(e);else if(e.effectTag===l.DELETION)return w(e),void re(e);te(e.child,t),te(e.sibling,t)}},re=(e,t)=>{if(e.dom)e.dom.parentNode&&e.dom.parentNode.removeChild(e.dom);else{let t=e.child;for(;t;)re(t),t=t.sibling}},ne=(e,t)=>{const r=n();let o,i=0,s=!0;const a=new Map;let c=e.alternate?.child,u=0;for(;c;){const e=c.key??`__index_${c.index??u}__`;a.set(e,c),c=c.sibling,u++}for(;i<t.length;){const n=t[i];if(!n){i++;continue}const c=n.key??`__index_${i}__`,u=a.get(c);let d;u&&n.type===u.type&&u?(d={type:u.type,props:n.props,dom:u.dom,parent:e,alternate:u,effectTag:l.UPDATE,hooks:u.hooks,stateError:u.stateError,key:n.key,index:i},a.delete(c)):(d={type:n.type,props:n.props,dom:null,parent:e,alternate:null,effectTag:r.isHydrating?l.HYDRATE:l.PLACEMENT,key:n.key,index:i},u&&(u.effectTag=l.DELETION,r.deletions.push(u),a.delete(c))),s?(e.child=d,s=!1):o&&(o.sibling=d),o=d,i++}a.forEach(e=>{e.effectTag=l.DELETION,r.deletions.push(e)})};let oe=null;const ie=(e,t)=>{if(oe)return oe(e,t);"production"!==process.env.NODE_ENV&&console.warn("[Ryunix] scheduleWork called before being initialized.")};let se=!1,ae=[];function le(e){const t=se;se=!0;try{e()}finally{se=t,!se&&ae.length>0&&ce()}}function ce(){if(0===ae.length)return;const e=ae;ae=[],e.forEach(e=>e())}process.env.NODE_ENV;const ue=(e="A hook")=>{const t=n();if(!t.wipFiber)throw new Error(`${e} can only be called inside function components. Make sure you are calling hooks at the top level of your component.`);const r=t.wipFiber;Array.isArray(r.hooks)||(r.hooks=[])},de=(e,t)=>!e||!t||(e.length!==t.length||e.some((e,r)=>!Object.is(e,t[r]))),pe=(e,t=M())=>{if("undefined"==typeof window)return[d(e)?e():e,()=>{}];if(n().isServerRendering)return[d(e)?e():e,()=>{}];return fe((e,t)=>d(t)?t(e):t,e,void 0,t)},fe=(e,t,r,o=M())=>{if("undefined"==typeof window)return[r?r(t):t,()=>{}];const s=n();if(s.isServerRendering)return[r?r(t):t,()=>{}];ue();const{hookIndex:a}=s,l=s.wipFiber,c=l.alternate?.hooks?.[a],u={hookID:a,type:i.RYUNIX_STORE,state:c?c.state:r?r(t):t,queue:[]};c?.queue&&c.queue.forEach(t=>{try{u.state=e(u.state,t)}catch(e){"production"!==process.env.NODE_ENV&&console.error("Error in reducer:",e)}});return l.hooks[a]=u,s.hookIndex++,[u.state,(e,t=o)=>{if(void 0===e)return void("production"!==process.env.NODE_ENV&&console.warn("dispatch called with undefined action"));u.queue.push(e);const r=n(),i=r.currentRoot||r.wipRoot;if(!i)return;const s={dom:i.dom,props:i.props,alternate:r.currentRoot||null};var a;a=()=>ie(s,t),ae.push(a),se||ce()}]},ye=(e,t)=>{if("undefined"==typeof window)return;const r=n();if(r.isServerRendering)return;if(ue(),!d(e))throw new Error("useEffect callback must be a function");if(void 0!==t&&!Array.isArray(t))throw new Error("useEffect dependencies must be an array or undefined");const{hookIndex:o}=r,s=r.wipFiber,a=s.alternate?.hooks?.[o],l=de(a?.deps,t),c={hookID:o,type:i.RYUNIX_EFFECT,deps:t,effect:l?e:null,cancel:a?.cancel};s.hooks[o]=c,r.hookIndex++},he=e=>{if("undefined"==typeof window)return{current:e};const t=n();if(t.isServerRendering)return{current:e};ue();const{hookIndex:r}=t,o=t.wipFiber,s=o.alternate?.hooks?.[r],a={hookID:r,type:i.RYUNIX_REF,value:s?s.value:{current:e}};return o.hooks[r]=a,t.hookIndex++,a.value},me=(e,t)=>{if("undefined"==typeof window)return e();const r=n();if(r.isServerRendering)return e();if(ue(),!d(e))throw new Error("useMemo callback must be a function");if(!Array.isArray(t))throw new Error("useMemo requires a dependencies array");const{hookIndex:o}=r,s=r.wipFiber,a=s.alternate?.hooks?.[o];let l;if(a&&!de(a.deps,t))l=a.value;else try{l=e()}catch(e){throw"production"!==process.env.NODE_ENV&&console.error("Error in useMemo computation:",e),e}const c={hookID:o,type:i.RYUNIX_MEMO,value:l,deps:t};return s.hooks[o]=c,r.hookIndex++,l},ge=(e,t)=>{if(!d(e))throw new Error("useCallback requires a function as first argument");return me(()=>e,t)},Ee=(e=i.RYUNIX_CONTEXT,t={})=>{const r=({value:t,children:r})=>m(i.RYUNIX_CONTEXT,{value:t,children:r,_contextId:e},...c([r]));r._contextId=e;return{Provider:r,useContext:(r=e)=>{const o=n();if(o.isServerRendering){const e=o.ssrContexts;return e&&void 0!==e[r]?e[r]:t}ue();let i=o.wipFiber;for(;i;){if(i._contextId===r&&void 0!==i._contextValue)return i._contextValue;const e=i.type;if(e?._contextId===r&&void 0!==i.props?.value)return i.props.value;i=i.parent}return t}}},xe=()=>{if("undefined"==typeof window)return{};const e=new URLSearchParams(window.location.search),t={};for(const[r,n]of e.entries())t[r]=n;return t},Re=()=>{if("undefined"==typeof window)return"";const[e,t]=pe(window.location.hash);return ye(()=>{const e=()=>t(window.location.hash);return window.addEventListener("hashchange",e),()=>window.removeEventListener("hashchange",e)},[]),e},ve=(e={},t={})=>{const r=n();r.isServerRendering?r.ssrMetadata={...r.ssrMetadata,...e}:ye(()=>{if("undefined"==typeof document)return;let r="Ryunix App";const n=t.title?.template,o=t.title?.prefix||"Ryunix App",i=e.pageTitle||e.title;if(r=p(i)&&i.trim()?n?.includes("%s")?n.replace("%s",i):i:o,document.title=r,e.canonical){let t=document.querySelector('link[rel="canonical"]');t||(t=document.createElement("link"),t.setAttribute("rel","canonical"),document.head.appendChild(t)),t.setAttribute("href",e.canonical)}Object.entries(e).forEach(([e,t])=>{if(["title","pageTitle","canonical"].includes(e))return;const r=e.startsWith("og:")||e.startsWith("twitter:"),n=`meta[${r?"property":"name"}='${e}']`;let o=document.head.querySelector(n);o||(o=document.createElement("meta"),o.setAttribute(r?"property":"name",e),document.head.appendChild(o)),o.setAttribute("content",t)})},[JSON.stringify(e),JSON.stringify(t)])},be=Ee("ryunix.navigation",{location:"/",params:{},query:{},navigate:e=>{},route:null}),Ne=(e,t)=>{const r=t.split("?")[0].split("#")[0],n=e.find(e=>e.NotFound),o=n?{route:{component:n.NotFound},params:{}}:{route:{component:null},params:{}};for(const n of e){if(n.subRoutes){const e=Ne(n.subRoutes,t);if(e)return e}if("*"===n.path)return o;if(!n.path||"string"!=typeof n.path)continue;const e=[],i=new RegExp(`^${n.path.replace(/:(\.\.\.)?(\w+)/g,(t,r,n)=>(e.push({key:n,isCatchAll:!!r}),r?"(.+)":"([^/]+)"))}$`),s=r.match(i);if(s){return{route:n,params:e.reduce((e,t,r)=>{const n=s[r+1];return e[t.key]=t.isCatchAll&&n?n.split("/"):n,e},{})}}}return o},_e=({routes:e,children:t})=>{if("undefined"==typeof window){const r=(()=>{const e=globalThis?.window?.location?.pathname;return"string"==typeof e&&e?e.split("?")[0].split("#")[0]:"/"})(),n=Ne(e,r),o={location:r,params:n.params||{},query:{},navigate:()=>{},route:n.route};return m(be.Provider,{value:o},g({children:t}))}const[r,n]=pe(window.location.pathname);ye(()=>{const e=()=>n(window.location.pathname);return window.addEventListener("popstate",e),window.addEventListener("hashchange",e),()=>{window.removeEventListener("popstate",e),window.removeEventListener("hashchange",e)}},[]);const o=Ne(e,r),i=xe(),s={location:r,params:o.params||{},query:i,navigate:e=>{"undefined"!=typeof window&&window.__RYUNIX_MPA__?window.location.assign(e):(window.history.pushState({},"",e),n(e))},route:o.route};return m(be.Provider,{value:s},g({children:t}))},we=()=>be.useContext("ryunix.navigation"),Se=()=>{const{route:e,params:t,query:r,location:n}=we();if(!e||!e.component)return null;const o=Re();return ye(()=>{if(o){const e=o.slice(1),t=document.getElementById(e);t&&t.scrollIntoView({block:"start",behavior:"smooth"})}},[o]),m(e.component,{key:n,params:t,query:r,hash:o,location:n})},Te=()=>{const{location:e}=we();return e.split("?")[0].split("#")[0]},ke=()=>{const{query:e}=we();return new URLSearchParams(e)},Ie=({to:e,prefetch:t=!0,...r})=>{const{navigate:n}=we(),{className:o,...i}=r;return m("a",{href:e,onClick:t=>{0!==t.button||t.metaKey||t.altKey||t.ctrlKey||t.shiftKey||(t.preventDefault(),n(e))},onMouseEnter:()=>{},className:r.className||r["ryunix-class"],...i},r.children)},Ce=({to:e,exact:t=!1,...r})=>{const{location:n,navigate:o}=we(),i=t?n===e:n.startsWith(e),s=r["ryunix-class"]?"ryunix-class":"className",a="function"==typeof(l=r["ryunix-class"]||r.className)?l({isActive:i}):l||"";var l;const{"ryunix-class":c,className:u,...d}=r;return m("a",{href:e,onClick:t=>{0!==t.button||t.metaKey||t.altKey||t.ctrlKey||t.shiftKey||(t.preventDefault(),o(e))},[s]:a,...d},r.children)},Oe=e=>{const[r,n]=fe((e,t)=>"function"==typeof t?t.value(e):t.value,e,void 0);return[r,(e,r=k.NORMAL)=>{const o={value:e,priority:r};!function(e,r=k.NORMAL){C.push({callback:e,priority:r,timestamp:Date.now()}),O||(O=!0,t(A))}(()=>n(o,r),r)}]},Ae=()=>{const[e,t]=Oe(!1);return[e,e=>{t(!0,k.IMMEDIATE),setTimeout(()=>{D(k.LOW,()=>{e(),t(!1,k.LOW)})},0)}]},De=e=>{const[t,r]=Oe(e);return ye(()=>{const t=setTimeout(()=>{r(e,k.LOW)},100);return()=>clearTimeout(t)},[e]),t},Me=(e,t="")=>{const[r,n]=pe(()=>{try{const r=window.localStorage.getItem(e);return r?JSON.parse(r):t}catch(e){return t}});return[r,t=>{try{n(t),window.localStorage.setItem(e,JSON.stringify(t))}catch(e){console.error(e)}}]},Le=(e=!1)=>{const[t,r]=pe(e);return[t,()=>{r(e=>!e)}]},Ue=(e,t)=>{if("undefined"==typeof window)return;const r=n();if(r.isServerRendering)return;if(ue(),!d(e))throw new Error("useLayoutEffect callback must be a function");if(void 0!==t&&!Array.isArray(t))throw new Error("useLayoutEffect dependencies must be an array or undefined");const{hookIndex:o}=r,s=r.wipFiber,a=s.alternate?.hooks?.[o],l=de(a?.deps,t),c={hookID:o,type:i.RYUNIX_EFFECT,deps:t,effect:l?e:null,cancel:a?.cancel,isLayout:!0};s.hooks[o]=c,r.hookIndex++};let Ye=0;const $e=()=>{Ye=0},Fe=()=>{const e=n();if(e.isServerRendering)return`:r${Ye++}:`;ue();const{hookIndex:t}=e,r=e.wipFiber,o=r.alternate?.hooks?.[t],s={hookID:t,type:i.RYUNIX_REF,value:o?o.value:`:r${Ye++}:`};return r.hooks[t]=s,e.hookIndex++,s.value},He=(e,t=300)=>{const[r,n]=pe(e);return ye(()=>{const r=setTimeout(()=>{n(e)},t);return()=>clearTimeout(r)},[e,t]),r},Xe=(e,t=300)=>{const[r,n]=pe(e),o=he(Date.now());return ye(()=>{const r=Date.now(),i=r-o.current;if(!(i>=t)){const r=setTimeout(()=>{o.current=Date.now(),n(e)},t-i);return()=>clearTimeout(r)}o.current=r,n(e)},[e,t]),r};var je=Object.freeze({__proto__:null,Children:Se,Link:Ie,NavLink:Ce,RouterProvider:_e,createContext:Ee,resetIdCounter:$e,useCallback:ge,useDebounce:He,useDeferredValue:De,useEffect:ye,useHash:Re,useId:Fe,useLayoutEffect:Ue,useMemo:me,useMetadata:ve,usePathname:Te,usePersistentStore:Me,usePersitentStore:Me,useQuery:xe,useReducer:fe,useRef:he,useRouter:we,useSearchParams:ke,useStore:pe,useStorePriority:Oe,useSwitch:Le,useThrottle:Xe,useTransition:Ae});const Pe=()=>{const e="undefined"!=typeof process&&process.env?process.env:{},t=e.RYUNIX_HYDRATION_RECOVER||"boundary",r=e.RYUNIX_HYDRATION_BOUNDARIES||"route";return{recover:"none"===t||"root"===t?t:"boundary",boundaries:"server-only"===r||"all-layouts"===r?r:"route",strict:"true"===e.RYUNIX_HYDRATION_STRICT}},Be=e=>{const t=n();e.type===i.RYUNIX_CONTEXT&&(e._contextId=e.props?._contextId,e._contextValue=e.props?.value);const r=e.type===i.RYUNIX_FRAGMENT||e.type===i.RYUNIX_CONTEXT||e.type===Symbol.for("ryunix.portal");if(t.isHydrating&&r)e.effectTag=l.HYDRATE;else if(t.isHydrating&&(e=>{let t=e?.parent||null;for(;t;){if(t._hydrateClientOnly)return!0;t=t.parent||null}return!1})(e))e.dom||(e.dom=Y(e),e.effectTag=l.PLACEMENT);else if(!e.dom)if(t.isHydrating&&t.hydrateCursor){const r=t.hydrateCursor,a=e.type===i.TEXT_ELEMENT&&3===r.nodeType,c="string"==typeof e.type&&1===r.nodeType&&r.tagName.toLowerCase()===e.type.toLowerCase();if(a||c)e.dom=r,e.effectTag=l.HYDRATE,a&&null!=e.props?.nodeValue&&r.nodeValue!==String(e.props.nodeValue)&&(r.nodeValue=String(e.props.nodeValue),G("text")),c&&r.hasAttribute("data-ryunix-hydrate-boundary")&&(e._hydrateClientOnly=!0),t.hydrateCursor=y(r.firstChild);else{const i=Pe(),a=`Mismatch at ${Ve(e.type)}. Expected ${1===r.nodeType?r.tagName:"text"} but got ${String(e.type)}.`,c=(e=>{let t=e||null;for(;t;){const e=t.props;if(e&&Object.prototype.hasOwnProperty.call(e,"data-ryunix-hydrate-boundary"))return t;const r=t.type,n=r;if(r&&"function"==typeof r&&("RYUNIX_HYDRATION_BOUNDARY"===n?.ryunix_type||"RYUNIX_SERVER_BOUNDARY"===n?.ryunix_type))return t;t=t.parent||null}return null})(e),u=c?(e=>{if(!e)return null;if(e.dom&&1===e.dom.nodeType){const t=e.dom;if(t.hasAttribute("data-ryunix-hydrate-boundary"))return t}let t=e.child||null;for(;t;){if(t.dom&&1===t.dom.nodeType){const e=t.dom;if(e.hasAttribute("data-ryunix-hydrate-boundary"))return e}t=t.child||t.sibling||null}return null})(c):null;"boundary"===i.recover&&c&&u?(q(a),((e,t,r)=>{if(!e||!t)return;const o=n(),i=o.scopedRecoveryQueue||[];i.push({boundaryFiber:e,boundaryDom:t,resumeCursor:r,element:Array.isArray(e.props?.children)?e.props.children[0]:e.props?.children}),o.scopedRecoveryQueue=i})(c,u,t.hydrateCursor??null),t.hydrateCursor=(o=t.hydrateCursor??null,s=u,o&&s&&(o===s||s.contains(o))?s.nextSibling:o),e.dom=Y(e),e.effectTag=l.PLACEMENT):"none"===i.recover?(K(a),t.isHydrating=!1,t.hydrateCursor=null,e.dom=Y(e),e.effectTag=l.PLACEMENT):((e=>{const t=n();if(t.hydrationMismatchReported)return;t.hydrationMismatchReported=!0;const r="production"===process.env.NODE_ENV?"error":"warn";B(r,`${e} Server HTML did not match the client render. Falling back to client-side render.`)})(a),t.isHydrating=!1,t.hydrationFailed=!0,t.hydrateCursor=null,e.dom=Y(e),e.effectTag=l.PLACEMENT)}}else e.dom=Y(e);var o,s;const a=e.props?.children||[];ne(e,a)},Ve=e=>"symbol"==typeof e?e.description||e.toString():"function"==typeof e?e.name||"anonymous":String(e),{Provider:We,useContext:qe}=Ee("ryunix.mdx",{}),Ge=e=>({...qe(),...e}),ze=(e,t)=>m(e,t),Ke={h1:e=>ze("h1",e),h2:e=>ze("h2",e),h3:e=>ze("h3",e),h4:e=>ze("h4",e),h5:e=>ze("h5",e),h6:e=>ze("h6",e),p:e=>ze("p",e),a:e=>ze("a",e),strong:e=>ze("strong",e),em:e=>ze("em",e),code:e=>ze("code",e),ul:e=>ze("ul",e),ol:e=>ze("ol",e),li:e=>ze("li",e),blockquote:e=>ze("blockquote",e),pre:e=>ze("pre",e),hr:e=>ze("hr",e),table:e=>ze("table",e),thead:e=>ze("thead",e),tbody:e=>ze("tbody",e),tr:e=>ze("tr",e),th:e=>ze("th",e),td:e=>ze("td",e),img:e=>ze("img",e)},Qe=(e,t)=>{X(t);ie({dom:t,props:{children:[e]},isHydrating:!1,hydrateCursor:null},void 0)},Je=()=>{const e=n();if(!e.hydrationFailed||e.hydrationRecover)return;if("none"===Pe().recover)return;const t=e.containerRoot||e.currentRoot?.dom,r=e.currentRoot?.props?.children?.[0];t&&null!=r&&(e.hydrationRecover=!0,e.hydrationFailed=!1,((e="")=>{const t=n();if(t.hydrationFailureReported)return;t.hydrationFailureReported=!0;const r=e?`${e} `:t.hydrationMismatchReported?"":"Hydration could not attach to the server HTML. ",o="production"===process.env.NODE_ENV?"error":"warn";B(o,`${r}Clearing #__ryunix and remounting on the client.`)})(""),(()=>{const e=n();e.hydrationRecoveryReported||(e.hydrationRecoveryReported=!0,B("warn","Remounting the application on the client after hydration failure."))})(),Qe(r,t))},Ze=()=>{(()=>{const e=n(),t=e.scopedRecoveryQueue;if(t?.length){e.scopedRecoveryQueue=[];for(const e of t)z(),Qe(e.element,e.boundaryDom)}})(),Je()};let et=[],tt=!1;function rt(e){const t=n(),r=e.type instanceof Function||"function"==typeof e.type;try{r?(e=>{const t=n();t.wipFiber=e,t.hookIndex=0,t.wipFiber.hooks=[],t.isHydrating&&(e.effectTag=l.HYDRATE);const r=e.type;if(r._isMemo&&e.alternate){const{children:t,...n}=e.alternate.props||{},{children:o,...i}=e.props||{};if(r._arePropsEqual?.(n,i)){e.hooks=e.alternate.hooks;const t=e.alternate.child;return void(t&&(t.parent=e,e.child=t))}}let o=[r(e.props)];r._contextId&&void 0!==e.props?.value&&(e._contextId=r._contextId,e._contextValue=e.props.value),ne(e,o)})(e):Be(e)}catch(r){if("production"!==process.env.NODE_ENV){console.error("[Ryunix ErrorBoundary] Caught error during render:",r);try{const t=e.props&&e.props.__source;t&&r&&"object"==typeof r&&(r.__ryunix_source=t);let n=e;for(;!r.__ryunix_source&&n;)n.props&&n.props.__source&&(r.__ryunix_source=n.props.__source),n=n.parent}catch(e){}}let n=e.parent,o=!1;for(;n;){if(n.type&&"RYUNIX_ERROR_BOUNDARY"===n.type.ryunix_type){o=!0;break}n=n.parent}return o?("production"!==process.env.NODE_ENV&&console.warn("[Ryunix ErrorBoundary] Recovering tree at nearest boundary."),n.stateError=r,e.child=null,n):(console.error("[Ryunix] Fatal Uncaught Error. No ErrorBoundary was found in the tree to handle this exception:\n",r),t.nextUnitOfWork=null,null)}if(e.child)return e.child;let o=e;for(;o;){if(t.isHydrating&&o.dom&&(t.hydrateCursor=y(o.dom.nextSibling)),o.sibling)return o.sibling;o=o.parent}}const nt=e=>{const r=n();let o=!1;for(;(r.nextUnitOfWork||et.length>0)&&!o;){if(!r.nextUnitOfWork&&et.length>0){const e=et.shift();r.wipRoot=e,r.nextUnitOfWork=e,r.deletions=[],void 0!==e.isHydrating&&(r.isHydrating=e.isHydrating,r.hydrateCursor=e.hydrateCursor)}r.nextUnitOfWork&&(r.nextUnitOfWork=rt(r.nextUnitOfWork)),o=e.timeRemaining()<1}!r.nextUnitOfWork&&r.wipRoot&&(Z(),Ze()),r.nextUnitOfWork||et.length>0?t(nt):tt=!1},ot=(e,r=M())=>{const o=n();o.wipRoot?et.push(e):(o.nextUnitOfWork=e,o.wipRoot=e,o.deletions=[],void 0!==e.isHydrating&&(o.isHydrating=e.isHydrating,o.hydrateCursor=e.hydrateCursor)),o.hookIndex=0,o.effects=[],tt||(tt=!0,r<=k.USER_BLOCKING?Promise.resolve().then(()=>{nt({timeRemaining:()=>10,didTimeout:!0})}):t(nt))};oe=ot;const it=(e,t)=>{const r=n();X(t);const o={dom:t,props:{children:[e]},alternate:r.currentRoot,isHydrating:!1,hydrateCursor:null};return ot(o),o},st=e=>{let t=e;for(;t&&(3===t.nodeType&&!t.nodeValue.trim()||8===t.nodeType||1===t.nodeType&&t.hasAttribute("data-ryunix-ssr"));)t=t.nextSibling;return t},at=(e,t)=>{const r=n();r.containerRoot=t;const o={dom:t,props:{children:[e]},alternate:r.currentRoot,isHydrating:!0,hydrateCursor:st(t.firstChild)};return ot(o),o},lt=(e,t="__ryunix",r={})=>{const o=n();o.containerRoot=document.getElementById(t),(()=>{const e=n();e.hydrationMismatchReported=!1,e.hydrationBoundaryMismatchReported=!1,e.hydrationFailureReported=!1,e.hydrationUnmatchedReported=!1,e.hydrationRecoveryReported=!1,e.hydrationBoundaryRecoveryReported=!1})(),o.hydrationPolicy=Pe(),o.scopedRecoveryQueue=[],o.hydrationRecover=!1,o.isHydrating=!1,o.hydrationFailed=!1;const i=o.containerRoot&&o.containerRoot.hasChildNodes();"production"!==process.env.NODE_ENV&&process.env.RYUNIX_DEBUG&&console.log(`[Ryunix Debug] init: hasChildNodes=${i}, has SSR content detected.`);const s="false"!==process.env.RYUNIX_SSR;if(i&&s){"production"!==process.env.NODE_ENV&&process.env.RYUNIX_DEBUG&&console.log(`[Ryunix Debug] init: SSR content detected. Starting hydration on #${t}`);return at(e,o.containerRoot)}"production"!==process.env.NODE_ENV&&process.env.RYUNIX_DEBUG&&console.log(`[Ryunix Debug] init: No SSR content or SSR disabled. Starting normal render on #${t}`);return it(e,o.containerRoot)},ct=(e,t,r)=>{try{return e(t)}catch(e){return"production"!==process.env.NODE_ENV&&console.error("Component error:",e),r&&r(e),null}},ut=e=>"string"!=typeof e?String(e):e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;"),dt=e=>!u(e)||f(e)?"":Object.entries(e).filter(([e,t])=>null!=t).map(([e,t])=>`${L(e)}:${t}`).join(";"),pt=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),ft=e=>{if(null==e||"boolean"==typeof e)return"";if("string"==typeof e||"number"==typeof e)return ut(e);if(Array.isArray(e))return e.map(e=>ft(e)).join("");const t=e;if(t.type===i.TEXT_ELEMENT)return ut(t.props.nodeValue);if(t.type===i.RYUNIX_FRAGMENT){return(t.props?.children||[]).map(e=>ft(e)).join("")}if(t.type===i.RYUNIX_CONTEXT){const e=n();e.ssrContexts=e.ssrContexts||{};const r=t.props||{},o=r._contextId,i=e.ssrContexts[o];o&&(e.ssrContexts[o]=r.value);const s=r.children||[];let a="";return a=Array.isArray(s)?s.map(e=>ft(e)).join(""):ft(s),o&&(e.ssrContexts[o]=i),a}if("function"==typeof t.type){const e=(0,t.type)(t.props||{});return ft(e)}const r=String(t.type),o=t.props||{};let l="",c="",u=null;if(Object.entries(o).forEach(([e,t])=>{if("children"===e)c=Array.isArray(t)?t.map(e=>ft(e)).join(""):ft(t);else if("dangerouslySetInnerHTML"===e){const e=t;e?.__html&&(u=e.__html)}else if(e===s.STYLE||e===a.STYLE){const e=dt(t);e&&(l+=` style="${ut(e)}"`)}else if(e===s.CLASS_NAME||e===a.CLASS_NAME)t&&(l+=` class="${ut(t)}"`);else if(!e.startsWith("on")&&"__source"!==e&&"__self"!==e)if("boolean"==typeof t)t&&(l+=` ${e}=""`);else if(null!=t){let r=T(e),n=F(r,t);l+=` ${r}="${ut(n)}"`}}),pt.has(r))return`<${r}${l} />`;return`<${r}${l}>${null!==u?u:c}</${r}>`},yt="\nfunction $RC(id, templateId) {\n var b = document.getElementById(id);\n var t = document.getElementById(templateId);\n if (b && t) {\n b.innerHTML = t.innerHTML;\n t.remove();\n }\n}\n".replace(/\s+/g," ").trim(),ht=async(e,t,r=[])=>{if(null==e||"boolean"==typeof e)return;if(e instanceof Promise&&(null==(e=await e)||"boolean"==typeof e))return;if("string"==typeof e||"number"==typeof e)return void t(ut(e));if(Array.isArray(e)){for(const n of e)await ht(n,t,r);return}const o=e;if(o.type===i.TEXT_ELEMENT)return void t(ut(o.props.nodeValue));if(o.type===i.RYUNIX_FRAGMENT){const e=o.props?.children||[];for(const n of e)await ht(n,t,r);return}if(o.type===i.RYUNIX_CONTEXT){const e=n();e.ssrContexts=e.ssrContexts||{};const i=o.props||{},s=i._contextId,a=e.ssrContexts[s];s&&(e.ssrContexts[s]=i.value);const l=i.children||[];if(Array.isArray(l))for(const e of l)await ht(e,t,r);else await ht(l,t,r);return void(s&&(e.ssrContexts[s]=a))}const l=o.type;if(o.type===i.RYUNIX_SUSPENSE||"object"==typeof l&&null!=l&&l.type===i.RYUNIX_SUSPENSE){const e=o.props||{},{fallback:i,children:s}=e,a=`s-${Math.random().toString(36).slice(2,9)}`;t(`\x3c!--$?--\x3e<template id="B:${a}"></template><div id="S:${a}">`);const l=(async()=>{const e=n(),t=e.isSuspenseBackground;e.isSuspenseBackground=!0;let o="";const i=e=>{o+=e};try{return await ht(s,i,r),{id:a,content:o,success:!0}}catch(e){return{id:a,content:"",success:!1,error:e}}finally{e.isSuspenseBackground=t}})();return r.push(l),await ht(i,t,r),void t("</div>\x3c!--$/--\x3e")}let c=o.type,u=o.props||{};if("function"==typeof c){process.env.RYUNIX_DEBUG&&console.log("[SSR Debug] Rendering function:",c.name||"anonymous");const e=await c(u);return void await ht(e,t,r)}const d=String(c);let p="",f=null,y=u.children||[];if(Object.entries(u).forEach(([e,t])=>{if("children"===e);else if("dangerouslySetInnerHTML"===e){const e=t;e?.__html&&(f=e.__html)}else if(e===s.STYLE||e===a.STYLE){const e=dt(t);e&&(p+=` style="${ut(e)}"`)}else if(e===s.CLASS_NAME||e===a.CLASS_NAME)t&&(p+=` class="${ut(t)}"`);else if(!e.startsWith("on")&&"__source"!==e&&"__self"!==e)if("boolean"==typeof t)t&&(p+=` ${e}=""`);else if(null!=t){const r=T(e),n=F(r,t);p+=` ${r}="${ut(n)}"`}}),t(`<${d}${p}>`),null!==f)t(f);else if(Array.isArray(y))for(const e of y)await ht(e,t,r);else await ht(y,t,r);pt.has(d)||t(`</${d}>`)},mt=(e,t={})=>{const r=n(),o=new TextEncoder;return $e(),new ReadableStream({async start(n){const i=r.isServerRendering;r.isServerRendering=!0,r.ssrMetadata={};const s=e=>n.enqueue(o.encode(e)),a=[];try{const r=t.nonce?` nonce="${t.nonce}"`:"";for(s(`<script${r} data-ryunix-ssr>${yt}<\/script>`),await ht(e,s,a);a.length>0;){const e=a.shift(),t=await e;t.success&&(s(`<template id="P:${t.id}" data-ryunix-ssr>${t.content}</template>`),s(`<script${r} data-ryunix-ssr>$RC("S:${t.id}", "P:${t.id}")<\/script>`))}n.close()}catch(e){n.error(e)}finally{r.isServerRendering=i}}})},gt=(e,t={})=>{const r=n(),o=r.isServerRendering;r.isServerRendering=!0,r.ssrMetadata={},$e();try{return ft(e)}finally{r.isServerRendering=o}},Et=async(e,t={})=>{const r=mt(e,t).getReader(),n=new TextDecoder;let o="";for(;;){const{done:e,value:t}=await r.read();if(e)break;o+=n.decode(t,{stream:!0})}return o+=n.decode(),o};function xt(e,t=Rt){const r=t=>e(t);return r._isMemo=!0,r._wrappedComponent=e,r._arePropsEqual=t,r.displayName=`Memo(${e.displayName||e.name||"Component"})`,r}function Rt(e,t){const r=Object.keys(e),n=Object.keys(t);return r.length===n.length&&r.every(r=>Object.is(e[r],t[r]))}function vt(e,t){if(e===t)return!0;if(null==e||null==t)return!1;if("object"!=typeof e||"object"!=typeof t)return!1;const r=Object.keys(e),n=Object.keys(t);return r.length===n.length&&r.every(r=>vt(e[r],t[r]))}const bt="pending",Nt="resolved",_t="rejected";function wt(e){return null!=e&&"object"==typeof e&&"type"in e&&"function"==typeof e.type&&Boolean(e.type._isLazy)}function St(e){let t=bt,r=null,n=null,o=null;const i=i=>{if(t===Nt&&r)return m(r,i);if(t===_t&&n)throw n;o||(o=e().then(e=>{const n=e;r="default"in n&&n.default?n.default:n,t=Nt}).catch(e=>{n=e,t=_t}));const[,s]=pe(0);return ye(()=>{if(t===bt&&o){let e=!0;return o.then(()=>{e&&s(e=>e+1)}).catch(()=>{e&&s(e=>e+1)}),()=>{e=!1}}},[]),null};return i._isLazy=!0,i._getStatus=()=>t,i}const Tt=({fallback:e,children:t})=>{const[r,o]=pe(!1),i=Array.isArray(t)?t:[t];let s=!1;for(const e of i)if(wt(e)){const t=e.type._getStatus?.();t===bt&&(s=!0)}return ye(()=>{s||r||o(!0)},[s]),s&&!n().isSuspenseBackground?e||null:m(g,{children:t})};function kt(e){return e()}Tt.type=i.RYUNIX_SUSPENSE;const It=()=>"undefined"!=typeof performance?performance.now():Date.now();const Ct=new class{enabled;measures;renderTimes;maxSamples;constructor(){this.enabled="production"!==process.env.NODE_ENV,this.measures=new Map,this.renderTimes=[],this.maxSamples=100}startMeasure(e){this.enabled&&this.measures.set(e,It())}endMeasure(e){if(!this.enabled)return;const t=this.measures.get(e);if(!t)return;const r=It()-t;return this.measures.delete(e),r}recordRender(e,t){this.enabled&&(this.renderTimes.push({component:e,duration:t,timestamp:Date.now()}),this.renderTimes.length>this.maxSamples&&this.renderTimes.shift())}getStats(){if(!this.enabled)return null;const e=this.renderTimes.reduce((e,t)=>e+t.duration,0);return{total:e,avg:e/this.renderTimes.length,max:Math.max(...this.renderTimes.map(e=>e.duration)),min:Math.min(...this.renderTimes.map(e=>e.duration)),count:this.renderTimes.length}}getSlowestComponents(e=10){if(!this.enabled)return[];const t=new Map;return this.renderTimes.forEach(({component:e,duration:r})=>{t.has(e)||t.set(e,{total:0,count:0,max:0});const n=t.get(e);n.total+=r,n.count++,n.max=Math.max(n.max,r)}),Array.from(t.entries()).map(([e,t])=>({name:e,avg:t.total/t.count,max:t.max,count:t.count})).sort((e,t)=>t.avg-e.avg).slice(0,e)}logStats(){if(!this.enabled)return;const e=this.getStats();if(!e)return;console.group("šŸ” Ryunix Performance Stats"),console.log(`Total renders: ${e.count}`),console.log(`Avg render time: ${e.avg.toFixed(2)}ms`),console.log(`Min: ${e.min.toFixed(2)}ms | Max: ${e.max.toFixed(2)}ms`);const t=this.getSlowestComponents(5);t.length>0&&(console.log("\nāš ļø Slowest components:"),t.forEach((e,t)=>{console.log(`${t+1}. ${e.name}: ${e.avg.toFixed(2)}ms avg (${e.count} renders)`)})),console.groupEnd()}clear(){this.renderTimes=[],this.measures.clear()}enable(){this.enabled=!0}disable(){this.enabled=!1}};function Ot(e){const t=It();return()=>{const r=It()-t;Ct.recordRender(e,r)}}function At(e,t){return r=>{Ct.startMeasure(t);const n=e(r),o=Ct.endMeasure(t);return o&&Ct.recordRender(t,o),n}}function Dt(e){if("function"!=typeof e)throw new Error("forwardRef requires a render function");const t=t=>{const{ref:r,...n}=t||{};return e(n,r??null)},r=e;return t.displayName=`ForwardRef(${r.displayName||r.name||"Component"})`,t._isForwardRef=!0,t._render=e,t}function Mt({children:e,id:t}){return m("div",{"data-ryunix-server":t,style:{display:"contents"}},e)}function Lt({children:e,id:t}){return m("div",{"data-ryunix-hydrate-boundary":t??"",suppressHydrationWarning:!0,style:{display:"contents"}},e)}function Ut({children:e,fallback:t}){const r=n().wipFiber;if(r?.stateError){const e=r.stateError;return"function"==typeof t?t(e):t??null}return m("ryunix-error-boundary-wrapper",{style:{display:"contents"}},e)}function Yt(e){return async function(...t){const r=await fetch("/_ryunix/action",{method:"POST",headers:{"Content-Type":"application/json","X-Ryunix-Action":"true"},body:JSON.stringify({actionId:e,args:t})});if(!r.ok){const e=await r.json().catch(()=>({}));throw new Error(e.error||"Server Action failed")}return r.json()}}function $t(e){const t=e,r=!t||"object"!=typeof t||t instanceof Error||!t.nativeEvent?t:t.error;let n=null;if(r instanceof Error)n=r;else if(r&&"object"==typeof r)if("message"in r)n=r;else if("error"in r){const e=r.error;n=e&&"object"==typeof e?e:null}else n=r;const o=JSON.stringify(t,Object.getOwnPropertyNames(t||{})),[i,s]=pe(null),[a,l]=pe(1),[c,u]=pe(""),[d,p]=pe(0),f=i,y=a,h=c,g=d;let E=[];n&&n.stack&&(E="string"==typeof n.stack?n.stack.split("\n").filter(e=>{const t=e.trim();if(!t)return!1;if(t.includes("node_modules"))return!1;return!["components.js","workers.js","reconciler.js","commits.js","hooks.js","errorBoundary.js","serverBoundary.js","app-router.js","app-router-server.js","render.js","createElement.js","index.js"].some(e=>t.includes(e))}):Array.isArray(n.stack)?n.stack:[]);const x=n&&"string"==typeof n.name?n.name:"Unknown Error Type",R=n&&"string"==typeof n.message?n.message:`Raw unhandled error. Debug: ${o}`;ye(()=>{let e=null,t=null;const r=n?.__ryunix_source;if(r?.fileName&&(e=r.fileName,t=r.lineNumber??null),!e||!t)for(let r=0;r<E.length;r++){const n=E[r];if(!n.includes(":"))continue;let o=null,i=null;const s=n.indexOf("("),a=n.lastIndexOf(")");if(-1!==s&&a>s){const e=n.slice(s+1,a),t=e.lastIndexOf(":"),r=t>0?e.lastIndexOf(":",t-1):-1;if(r>0){const n=e.slice(t+1),s=e.slice(r+1,t);/^\d+$/.test(s)&&/^\d+$/.test(n)&&(o=e.slice(0,r),i=parseInt(s,10))}}if(!o){const e=n.trim();if(e.startsWith("at ")){const t=e.slice(3).trim(),r=t.lastIndexOf(":"),n=r>0?t.lastIndexOf(":",r-1):-1;if(n>0){const e=t.slice(r+1),s=t.slice(n+1,r);/^\d+$/.test(s)&&/^\d+$/.test(e)&&(o=t.slice(0,n),i=parseInt(s,10))}}}if(!o){const e=[".ryx",".jsx",".js",".ts",".tsx"],t=n.lastIndexOf(":");if(t>0){const r=n.slice(t+1).trim(),s=n.slice(0,t).trim();/^\d+$/.test(r)&&e.some(e=>s.endsWith(e))&&(o=s,i=parseInt(r,10))}}if(o&&i){e=o,t=i;break}}e&&t&&(u(e),p(t),fetch(`/_ryunix/source?file=${encodeURIComponent(e)}&line=${t}`).then(e=>e.json()).then(e=>{e.snippet&&(s(e.snippet),l(e.startLine))}).catch(e=>console.error("Failed to fetch source snippet",e)))},[n]);const v={backgroundColor:"#000",borderRadius:"8px",border:"1px solid #333",padding:"16px",fontFamily:"ui-monospace, monospace",fontSize:"14px",overflowX:"auto",color:"#d1d5db",marginBottom:"32px",whiteSpace:"pre-wrap",maxHeight:"150px",height:"auto"},b=e=>({display:"flex",backgroundColor:e?"rgba(239, 68, 68, 0.15)":"transparent",padding:"2px 8px",borderRadius:"4px",borderLeft:e?"3px solid #ef4444":"3px solid transparent"}),N=f?f.split("\n"):[];let _="UNHANDLED RUNTIME ERROR";return x&&"Error"!==x&&"Unknown Error Type"!==x&&(_=x.replace(/([a-z])([A-Z])/g,"$1 $2").toUpperCase()),m("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,zIndex:2147483647,backgroundColor:"rgba(0, 0, 0, 0.85)",backdropFilter:"blur(8px)",display:"flex",alignItems:"center",justifyContent:"center",padding:"20px",fontFamily:"system-ui, -apple-system, sans-serif"}},m("div",{style:{backgroundColor:"#0c0c0c",width:"100%",maxWidth:"1000px",maxHeight:"90vh",borderRadius:"12px",boxShadow:"0 25px 50px -12px rgba(0, 0, 0, 0.8)",display:"flex",flexDirection:"column",overflow:"hidden",border:"1px solid #333"}},m("div",{style:{backgroundColor:"#161616",padding:"16px 24px",borderBottom:"1px solid #333",display:"flex",justifyContent:"space-between",alignItems:"center"}},m("div",{style:{display:"flex",alignItems:"center",gap:"12px"}},m("span",{style:{backgroundColor:"rgba(239, 68, 68, 0.2)",color:"#ef4444",padding:"4px 8px",borderRadius:"4px",fontSize:"13px",fontWeight:"bold",textTransform:"uppercase",letterSpacing:"0.05em"}},_),m("span",{style:{color:"#9ca3af",fontSize:"14px"}},"Ryunix Development")),m("button",{onClick:()=>window.location.reload(),style:{background:"none",border:"none",color:"#9ca3af",cursor:"pointer",outline:"none"},title:"Reload page"},m("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},m("path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"}),m("path",{d:"M3 3v5h5"})))),m("div",{style:{padding:"32px",overflowY:"auto",flex:1,color:"#fff"}},m("h1",{style:{fontSize:"24px",fontWeight:"bold",marginBottom:"24px",fontFamily:"ui-monospace, monospace",wordBreak:"break-word",lineHeight:1.4}},m("span",{style:{color:"#f87171"}},x),": ",R),h&&m("div",{style:{marginBottom:"16px",color:"#9ca3af",fontSize:"14px",display:"flex",alignItems:"center",gap:"8px"}},m("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},m("path",{d:"M13 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z"}),m("polyline",{points:"13 2 13 9 20 9"})),h,":",g),f&&m("div",{style:v},m("div",{style:{display:"flex",flexDirection:"column"}},...N.map((e,t)=>{const r=y+t,n=r===g;return m("div",{key:t,style:b(n)},m("span",{style:{color:"#6b7280",width:"40px",userSelect:"none",textAlign:"right",marginRight:"16px",display:"inline-block"}},r),m("span",{style:{color:n?"#f87171":"#e5e7eb",whiteSpace:"pre"}},e||" "))}))),m("div",{style:{marginBottom:"16px"}},m("p",{style:{color:"#9ca3af",fontSize:"14px",marginBottom:"8px",fontWeight:600,textTransform:"uppercase",letterSpacing:"0.05em"}},"Call Stack"),m("div",{style:v},E.length>0?m("ul",{style:{listStyle:"none",padding:0,margin:0,display:"flex",flexDirection:"column",gap:"12px"}},...E.map((e,t)=>{if(0===t&&(e.startsWith("Error:")||e.startsWith("TypeError:")))return null;const r=e.trim();let n="<anonymous>",o=e;if(r.startsWith("at ")){const e=r.slice(3),t=e.indexOf("("),i=e.lastIndexOf(")");-1!==t&&i>t?(n=e.slice(0,t).trim()||"<anonymous>",o=e.slice(t+1,i)):(n=e.includes(":")?"<anonymous>":e,o=e)}else if(r.includes("@")){const e=r.indexOf("@");n=r.slice(0,e)||"<anonymous>",o=r.slice(e+1)}else{const e=[".ryx",".jsx",".js",".ts",".tsx"],t=r.split(/\s+/);if(t.length>=2){const r=t[t.length-1],i=r.indexOf(":"),s=i>0?r.slice(0,i):r;e.some(e=>s.endsWith(e))?(n=t.slice(0,-1).join(" "),o=r):(n=t[0],o=t.slice(1).join(" "))}}return m("li",{key:t},m("span",{style:{color:"#60a5fa",fontWeight:600}},n),m("div",{style:{color:"#6b7280",marginTop:"4px",paddingLeft:"16px",display:"flex",alignItems:"center",gap:"8px"}},m("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},m("path",{d:"M13 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z"}),m("polyline",{points:"13 2 13 9 20 9"})),o))})):m("div",{style:{color:"#6b7280",fontStyle:"italic"}},"No stack trace available."))))))}Mt.ryunix_type="RYUNIX_SERVER_BOUNDARY",Lt.ryunix_type="RYUNIX_HYDRATION_BOUNDARY",Ut.ryunix_type="RYUNIX_ERROR_BOUNDARY";var Ft=Object.freeze({__proto__:null,Children:Se,ErrorBoundary:Ut,Fragment:g,Hooks:je,HydrationBoundary:Lt,Link:Ie,NavLink:Ce,Priority:k,RouterProvider:_e,RyunixDevOverlay:$t,ServerBoundary:Mt,Suspense:Tt,batchUpdates:le,cloneElement:E,createActionProxy:Yt,createContext:Ee,createElement:m,createPortal:P,deepEqual:vt,escapeHtml:ut,forwardRef:Dt,getState:n,hydrate:at,init:lt,isValidElement:x,lazy:St,logHydrationBoundaryMismatch:q,logHydrationBoundaryRecovery:z,logHydrationFatal:K,logHydrationInfo:W,logHydrationRecoverable:G,memo:xt,preload:kt,profiler:Ct,render:it,renderToReadableStream:mt,renderToString:gt,renderToStringAsync:Et,resetIdCounter:$e,safeRender:ct,shallowEqual:Rt,useCallback:ge,useDebounce:He,useDeferredValue:De,useEffect:ye,useHash:Re,useId:Fe,useLayoutEffect:Ue,useMemo:me,useMetadata:ve,usePathname:Te,usePersistentStore:Me,usePersitentStore:Me,useProfiler:Ot,useQuery:xe,useReducer:fe,useRef:he,useRouter:we,useSearchParams:ke,useStore:pe,useStorePriority:Oe,useSwitch:Le,useThrottle:Xe,useTransition:Ae,withProfiler:At});"undefined"!=typeof window&&(window.Ryunix=Ft),e.Children=Se,e.ErrorBoundary=Ut,e.Fragment=g,e.Hooks=je,e.HydrationBoundary=Lt,e.Image=({src:e,...t})=>m("img",{...t,src:e}),e.Link=Ie,e.MDXContent=({children:e,components:t={}})=>{const r=Ge(t);return m(We,{value:r},m("div",null,e))},e.MDXProvider=We,e.NavLink=Ce,e.Priority=k,e.RouterProvider=_e,e.RyunixDevOverlay=$t,e.ServerBoundary=Mt,e.Suspense=Tt,e.batchUpdates=le,e.cloneElement=E,e.createActionProxy=Yt,e.createContext=Ee,e.createElement=m,e.createPortal=P,e.deepEqual=vt,e.default=Ft,e.defaultComponents=Ke,e.escapeHtml=ut,e.forwardRef=Dt,e.getMDXComponents=Ge,e.getState=n,e.hydrate=at,e.init=lt,e.isValidElement=x,e.lazy=St,e.logHydrationBoundaryMismatch=q,e.logHydrationBoundaryRecovery=z,e.logHydrationFatal=K,e.logHydrationInfo=W,e.logHydrationRecoverable=G,e.memo=xt,e.preload=kt,e.profiler=Ct,e.render=it,e.renderToReadableStream=mt,e.renderToString=gt,e.renderToStringAsync=Et,e.resetIdCounter=$e,e.safeRender=ct,e.shallowEqual=Rt,e.useCallback=ge,e.useDebounce=He,e.useDeferredValue=De,e.useEffect=ye,e.useHash=Re,e.useId=Fe,e.useLayoutEffect=Ue,e.useMDXComponents=qe,e.useMemo=me,e.useMetadata=ve,e.usePathname=Te,e.usePersistentStore=Me,e.usePersitentStore=Me,e.useProfiler=Ot,e.useQuery=xe,e.useReducer=fe,e.useRef=he,e.useRouter=we,e.useSearchParams=ke,e.useStore=pe,e.useStorePriority=Oe,e.useSwitch=Le,e.useThrottle=Xe,e.useTransition=Ae,e.withProfiler=At,Object.defineProperty(e,"__esModule",{value:!0})});
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).Ryunix={})}(this,function(e){"use strict";const t="undefined"!=typeof requestIdleCallback?requestIdleCallback:e=>setTimeout(()=>e({timeRemaining:()=>1}),1);let r={containerRoot:null,nextUnitOfWork:null,currentRoot:null,wipRoot:null,deletions:[],wipFiber:null,hookIndex:0,effects:[]};const n=()=>r,o=/[A-Z]/g,i=Object.freeze({TEXT_ELEMENT:Symbol.for("ryunix.text.element"),RYUNIX_ELEMENT:Symbol.for("ryunix.element"),RYUNIX_EFFECT:Symbol.for("ryunix.effect"),RYUNIX_MEMO:Symbol.for("ryunix.memo"),RYUNIX_URL_QUERY:Symbol.for("ryunix.urlQuery"),RYUNIX_REF:Symbol.for("ryunix.ref"),RYUNIX_STORE:Symbol.for("ryunix.store"),RYUNIX_REDUCE:Symbol.for("ryunix.reduce"),RYUNIX_FRAGMENT:Symbol.for("ryunix.fragment"),RYUNIX_CONTEXT:Symbol.for("ryunix.context"),RYUNIX_SUSPENSE:Symbol.for("ryunix.suspense")}),s=Object.freeze({OBJECT:"object",FUNCTION:"function",STYLE:"ryunix-style",CLASS_NAME:"ryunix-class",CHILDREN:"children",BOOLEAN:"boolean",STRING:"string",UNDEFINED:"undefined"}),a=Object.freeze({STYLE:"style",CLASS_NAME:"className"}),l=Object.freeze({PLACEMENT:Symbol.for("ryunix.reconciler.status.placement"),UPDATE:Symbol.for("ryunix.reconciler.status.update"),DELETION:Symbol.for("ryunix.reconciler.status.deletion"),NO_EFFECT:Symbol.for("ryunix.reconciler.status.no_effect"),HYDRATE:Symbol.for("ryunix.reconciler.status.hydrate")});function c(e,t=1){return Array.isArray(e)?t<1?e.slice():e.reduce((e,r)=>(Array.isArray(r)&&t>0?e.push(...c(r,t-1)):e.push(r),e),[]):[e]}const u=e=>null!==e&&typeof e===s.OBJECT,d=e=>typeof e===s.FUNCTION,p=e=>typeof e===s.STRING,f=e=>null===e;function y(e){let t=e;for(;t&&(3===t.nodeType&&!t.nodeValue?.trim()||8===t.nodeType||1===t.nodeType&&t.hasAttribute("data-ryunix-ssr"));)t=t.nextSibling;return t}const h=e=>({type:i.TEXT_ELEMENT,props:{nodeValue:String(e),children:[]}}),m=(e,t,...r)=>{const n=t||{};let o=r;0===r.length&&void 0!==n.children&&(o=Array.isArray(n.children)?n.children:[n.children]),o=o.flat().filter(e=>null!=e&&!1!==e&&!0!==e);const i=[];let a="";for(const e of o)typeof e!==s.OBJECT?a+=String(e):(""!==a&&(i.push(h(a)),a=""),i.push(e));return""!==a&&i.push(h(a)),{type:e,props:{...n,children:i}}},g=e=>{const t=Array.isArray(e.children)?e.children:[e.children];return m(i.RYUNIX_FRAGMENT,{},...t)},E=(e,t={},...r)=>{if(!e||!u(e))throw new Error("cloneElement requires a valid element");const n=r.length>0?r:e.props.children??[];return m(e.type,{...e.props,...t},...Array.isArray(n)?n:[n])},x=e=>u(e)&&void 0!==e.type&&void 0!==e.props,v=e=>e.startsWith("on"),N=new Set(["key","ref",s.CHILDREN]),b=e=>!N.has(e)&&!v(e),R=(e,t)=>r=>!Object.is(e[r],t[r]),k=e=>t=>!(t in e),w=e=>{e?.hooks?.length&&e.hooks.filter(e=>e.type===i.RYUNIX_EFFECT&&d(e.cancel)).forEach(e=>{try{e.cancel&&e.cancel(),e.cancel=null}catch(e){"production"!==process.env.NODE_ENV&&console.error("Error in effect cleanup:",e)}})},T=e=>{e&&(e.hooks?.length&&e.hooks.filter(e=>e.type===i.RYUNIX_EFFECT&&d(e.cancel)).forEach(e=>{try{e.cancel&&e.cancel(),e.cancel=null}catch(e){"production"!==process.env.NODE_ENV&&console.error("Error in deep effect cleanup:",e)}}),e.child&&T(e.child),e.sibling&&T(e.sibling))},S={strokeWidth:"stroke-width",strokeLinecap:"stroke-linecap",strokeLinejoin:"stroke-linejoin",strokeDasharray:"stroke-dasharray",strokeDashoffset:"stroke-dashoffset",strokeMiterlimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",fillRule:"fill-rule",fillOpacity:"fill-opacity",clipRule:"clip-rule",clipPath:"clip-path",fontFamily:"font-family",fontSize:"font-size",fontWeight:"font-weight",textAnchor:"text-anchor",textDecoration:"text-decoration",dominantBaseline:"dominant-baseline",alignmentBaseline:"alignment-baseline",baselineShift:"baseline-shift",stopColor:"stop-color",stopOpacity:"stop-opacity",floodColor:"flood-color",floodOpacity:"flood-opacity",lightingColor:"lighting-color",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",pointerEvents:"pointer-events",shapeRendering:"shape-rendering",imageRendering:"image-rendering",markerStart:"marker-start",markerMid:"marker-mid",markerEnd:"marker-end"};function _(e){return S[e]??e}const C={IMMEDIATE:1,USER_BLOCKING:2,NORMAL:3,LOW:4,IDLE:5};let A=C.NORMAL,I=[],L=!1;function O(e){for(I.sort((e,t)=>e.priority-t.priority);I.length>0&&e.timeRemaining()>1;){const e=I.shift();if(!e)break;A=e.priority,e.callback()}I.length>0?t(O):(L=!1,A=C.NORMAL)}function M(e,t){const r=A;A=e;try{return t()}finally{A=r}}function D(){return A}const $=e=>e.replace(o,e=>`-${e.toLowerCase()}`),U=(e,t,r)=>{if(!r||""===r.trim()){if(t){const r=t.split(/\s+/).filter(Boolean);e.classList.remove(...r)}return}if(t){const r=t.split(/\s+/).filter(Boolean);e.classList.remove(...r)}const n=r.split(/\s+/).filter(Boolean);n.length>0&&e.classList.add(...n)},F=e=>{if(e.type===i.RYUNIX_FRAGMENT||e.type===i.RYUNIX_CONTEXT||e.type===Symbol.for("ryunix.portal"))return null;let t;try{if(e.type===i.TEXT_ELEMENT)t=document.createTextNode("");else{if(!p(e.type))return"production"!==process.env.NODE_ENV&&console.warn("Attempted to create DOM for non-host component:",e.type),null;{const r=e.type;t=["svg","path","g","circle","polygon","rect","line","polyline","ellipse","text","tspan","defs","use","symbol","mask","clipPath","linearGradient","radialGradient","stop","filter","feGaussianBlur","feOffset","feMerge","feMergeNode","feBlend","feColorMatrix","feComposite","foreignObject","image","marker","pattern","textPath"].includes(r)?document.createElementNS("http://www.w3.org/2000/svg",r):document.createElement(r)}}return j(t,{},e.props),t}catch(t){return"production"!==process.env.NODE_ENV&&console.error("Error creating DOM element:",t,e),null}},P=(e,t)=>{if("string"!=typeof t)return t;const r=e.toLowerCase();if("href"!==r&&"src"!==r&&"action"!==r&&"formaction"!==r)return t;const n=t.replace(/\s+/g,"").toLowerCase();return n.startsWith("javascript:")||n.startsWith("vbscript:")||n.startsWith("data:")?("production"!==process.env.NODE_ENV&&console.warn(`[Ryunix Security] Blocked dangerous ${e} URI: ${t}`),"javascript:void(0)"):t},Y=P,j=(e,t={},r={})=>{if(3===e.nodeType)return void(t.nodeValue!==r.nodeValue&&(e.nodeValue=String(r.nodeValue??"")));const n=e,o=n,i=o._ryunixHandlers,l=n;Object.keys(t).filter(v).filter(e=>k(r)(e)||R(t,r)(e)).forEach(e=>{const r=e.toLowerCase().substring(2);try{const o=t[e],s=i?.get(o)||o;n.removeEventListener(r,s),i&&i.delete(o)}catch(e){"production"!==process.env.NODE_ENV&&console.warn("Error removing event listener:",e)}}),Object.keys(t).filter(b).filter(k(r)).forEach(e=>{if(e!==s.STYLE&&e!==a.STYLE&&e!==s.CLASS_NAME&&e!==a.CLASS_NAME)if(n instanceof SVGElement){const t=_(e);n.removeAttribute(t)}else l[e]="",n.removeAttribute(e)}),Object.keys(r).filter(b).filter(R(t,r)).forEach(e=>{try{if(e===s.STYLE||e===a.STYLE){const t=r[e];((e,t)=>{if(u(t)&&!f(t))try{const r=Object.entries(t).filter(([e,t])=>null!=t).map(([e,t])=>`${$(e)}: ${t}`).join("; ");e.style.cssText=r}catch(e){"production"!==process.env.NODE_ENV&&console.error("Error applying styles:",e)}else e.style.cssText=""})(n,t)}else if(e===s.CLASS_NAME)U(n,t[s.CLASS_NAME],r[s.CLASS_NAME]);else if(e===a.CLASS_NAME)U(n,t[a.CLASS_NAME],r[a.CLASS_NAME]);else if("value"===e||"checked"===e)l[e]!==r[e]&&(l[e]=r[e]);else{if(n instanceof SVGElement){const t=_(e),o=P(t,r[e]);n.setAttribute(t,String(o))}else{const t=r[e],o=P(e,t);l[e]=o,"object"!=typeof t&&"function"!=typeof t&&n.setAttribute(e,String(o))}}}catch(t){"production"!==process.env.NODE_ENV&&console.warn(`Error setting property ${e}:`,t)}}),Object.keys(r).filter(v).filter(R(t,r)).forEach(e=>{const t=e.toLowerCase().substring(2);try{const i=t=>{M(C.IMMEDIATE,()=>r[e](t))};o._ryunixHandlers||(o._ryunixHandlers=new Map),o._ryunixHandlers.set(r[e],i),n.addEventListener(t,i)}catch(e){"production"!==process.env.NODE_ENV&&console.warn("Error adding event listener:",e)}})},H=e=>{if(e)for(;e.firstChild;)e.removeChild(e.firstChild)},B=Symbol.for("ryunix.portal");function X(e,t){return t?{type:B,props:{children:Array.isArray(e)?e:[e]},containerInfo:t,_isPortal:!0}:("production"!==process.env.NODE_ENV&&console.error("createPortal: target container is not a DOM element."),null)}const V=(e,t)=>{const r=`[Ryunix Hydration] ${t}`;"error"===e?console.error(r):console.warn(r)},W=()=>"production"!==process.env.NODE_ENV&&"true"===process.env.RYUNIX_HYDRATION_STRICT,q=e=>{W()&&V("warn",e)},z=e=>{const t=n();if(t.hydrationBoundaryMismatchReported)return;t.hydrationBoundaryMismatchReported=!0;const r="production"===process.env.NODE_ENV?"error":"warn";V(r,`${e} Recovering the nearest hydration boundary with a scoped client render.`)},G=e=>{W()&&V("warn",`Recovered a hydration mismatch (${e}) without root fallback.`)},K=()=>{const e=n();e.hydrationBoundaryRecoveryReported||(e.hydrationBoundaryRecoveryReported=!0,V("warn","Remounting a hydration boundary after local mismatch."))},Q=e=>{V("error",e)},J=e=>{if(e?.hooks?.length)for(let t=0;t<e.hooks.length;t++){const r=e.hooks[t];if(r.type===i.RYUNIX_EFFECT&&r.isLayout&&d(r.effect)){if(d(r.cancel))try{r.cancel()}catch(e){"production"!==process.env.NODE_ENV&&console.error("Error in layout effect cleanup:",e)}try{const e=r.effect();r.cancel=d(e)?e:null}catch(e){"production"!==process.env.NODE_ENV&&console.error("Error in layout effect:",e),r.cancel=null}r.effect=null}}},Z=e=>{if(e?.hooks?.length)for(let t=0;t<e.hooks.length;t++){const r=e.hooks[t];if(r.type===i.RYUNIX_EFFECT&&!r.isLayout&&d(r.effect)){if(d(r.cancel))try{r.cancel()}catch(e){"production"!==process.env.NODE_ENV&&console.error("Error in effect cleanup:",e)}try{const e=r.effect();r.cancel=d(e)?e:null}catch(e){"production"!==process.env.NODE_ENV&&console.error("Error in effect:",e),r.cancel=null}r.effect=null}}};function ee(){const e=n();e.deletions.forEach(te);const t=e.wipRoot;if(t){if(e.currentRoot=t,e.isHydrating||e.hydrationFailed){if("production"!==process.env.NODE_ENV&&process.env.RYUNIX_DEBUG&&console.log(`[Ryunix Debug] commitRoot - isHydrating: ${e.isHydrating}, hydrationFailed: ${e.hydrationFailed}`),e.hydrationFailed);else{let t=e.hydrateCursor,r=0;for(t&&"production"!==process.env.NODE_ENV&&process.env.RYUNIX_DEBUG&&console.log("[Ryunix Debug] Removing unmatched root siblings.");t;){const e=t.nextSibling;t.parentNode&&(t.parentNode.removeChild(t),r++),t=e}(e=>{if(!e)return;const t=n();t.hydrationUnmatchedReported||(t.hydrationUnmatchedReported=!0,V("warn",`Removed ${e} server-rendered DOM node(s) that were not used by the client tree. This can indicate an SSR/client markup mismatch.`))})(r)}e.isHydrating=!1,e.hydrationFailed=!1,e.hydrateCursor=null}te(t.child),e.wipRoot===t&&(e.wipRoot=null)}}function te(e){if(!e)return;if(e.type===B||e._isPortal){const t=e.containerInfo;if(t){const r=e.child;r&&re(r,t)}return void te(e.sibling)}let t=e.parent;for(;t&&!t.dom;)t=t.parent;if(!t)return;const r=t.dom;if(r){if(e.effectTag===l.PLACEMENT)null!=e.dom&&("production"!==process.env.NODE_ENV&&process.env.RYUNIX_DEBUG&&console.log("[Ryunix Debug] Appending PLACEMENT:",e.type),r.appendChild(e.dom)),J(e),Z(e);else if(e.effectTag===l.UPDATE)w(e),null!=e.dom&&j(e.dom,e.alternate?.props,e.props),J(e),Z(e);else if(e.effectTag===l.HYDRATE){n().hydrationFailed?("production"!==process.env.NODE_ENV&&process.env.RYUNIX_DEBUG&&console.log("[Ryunix Debug] Hydration fallback PLACEMENT:",e.type),null!=e.dom&&r.appendChild(e.dom),J(e),Z(e)):("production"!==process.env.NODE_ENV&&process.env.RYUNIX_DEBUG&&console.log("[Ryunix Debug] Hydrating node:",e.type),null!=e.dom&&j(e.dom,{},e.props),J(e),Z(e))}else if(e.effectTag===l.DELETION)return T(e),void ne(e);te(e.child),te(e.sibling)}}const re=(e,t)=>{if(e){if(e.effectTag===l.PLACEMENT)null!=e.dom&&t.appendChild(e.dom),J(e),Z(e);else if(e.effectTag===l.UPDATE)w(e),null!=e.dom&&j(e.dom,e.alternate?.props,e.props),J(e),Z(e);else if(e.effectTag===l.DELETION)return T(e),void ne(e);re(e.child,t),re(e.sibling,t)}},ne=(e,t)=>{if(e.dom)e.dom.parentNode&&e.dom.parentNode.removeChild(e.dom);else{let t=e.child;for(;t;)ne(t),t=t.sibling}},oe=(e,t)=>{const r=n();let o,i=0,s=!0;const a=new Map;let c=e.alternate?.child,u=0;for(;c;){const e=c.key??`__index_${c.index??u}__`;a.set(e,c),c=c.sibling,u++}for(;i<t.length;){const n=t[i];if(!n){i++;continue}const c=n.key??`__index_${i}__`,u=a.get(c);let d;if(u&&n.type===u.type&&u){const t=u.type,r="function"==typeof u.type&&"RYUNIX_ERROR_BOUNDARY"===t?.ryunix_type&&null!=u.stateError&&null==u.child;d={type:u.type,props:n.props,dom:u.dom,parent:e,alternate:u,effectTag:l.UPDATE,hooks:u.hooks,stateError:r?u.stateError:void 0,key:n.key,index:i},a.delete(c)}else d={type:n.type,props:n.props,dom:null,parent:e,alternate:null,effectTag:r.isHydrating?l.HYDRATE:l.PLACEMENT,key:n.key,index:i},u&&(u.effectTag=l.DELETION,r.deletions.push(u),a.delete(c));s?(e.child=d,s=!1):o&&(o.sibling=d),o=d,i++}a.forEach(e=>{e.effectTag=l.DELETION,r.deletions.push(e)})},ie=()=>{const e=globalThis.process&&globalThis.process.env||{},t=e.RYUNIX_HYDRATION_RECOVER||"boundary",r=e.RYUNIX_HYDRATION_BOUNDARIES||"route";return{recover:"none"===t||"root"===t?t:"boundary",boundaries:"server-only"===r||"all-layouts"===r?r:"route",strict:"true"===e.RYUNIX_HYDRATION_STRICT}},se=e=>{const t=n();e.type===i.RYUNIX_CONTEXT&&(e._contextId=e.props?._contextId,e._contextValue=e.props?.value);const r=e.type===i.RYUNIX_FRAGMENT||e.type===i.RYUNIX_CONTEXT||e.type===Symbol.for("ryunix.portal");if(t.isHydrating&&r)e.effectTag=l.HYDRATE;else{if(t.isHydrating&&(e=>{let t=e?.parent||null;for(;t;){if(t._hydratePreserveServer)return!0;t=t.parent||null}return!1})(e))return;if(t.isHydrating&&(e=>{let t=e?.parent||null;for(;t;){if(t._hydrateClientOnly)return!0;t=t.parent||null}return!1})(e))e.dom||(e.dom=F(e),e.effectTag=l.PLACEMENT);else if(!e.dom)if(t.isHydrating&&t.hydrateCursor){const r=t.hydrateCursor,a=e.type===i.TEXT_ELEMENT&&3===r.nodeType,c="string"==typeof e.type&&1===r.nodeType&&r.tagName.toLowerCase()===e.type.toLowerCase();if(a||c){if(e.dom=r,e.effectTag=l.HYDRATE,a&&null!=e.props?.nodeValue&&r.nodeValue!==String(e.props.nodeValue)&&(r.nodeValue=String(e.props.nodeValue),G("text")),c&&r.hasAttribute("data-ryunix-server"))return e._hydratePreserveServer=!0,t.hydrateCursor=y(r),void oe(e,[]);c&&r.hasAttribute("data-ryunix-hydrate-boundary")&&(e._hydrateClientOnly=!0),t.hydrateCursor=y(r.firstChild)}else{const i=ie(),a=`Mismatch at ${ae(e.type??"unknown")}. Expected ${1===r.nodeType?r.tagName:"text"} but got ${String(e.type)}.`,c=(e=>{let t=e||null;for(;t;){const e=t.props;if(e&&Object.prototype.hasOwnProperty.call(e,"data-ryunix-hydrate-boundary"))return t;const r=t.type,n=r;if(r&&"function"==typeof r&&"RYUNIX_HYDRATION_BOUNDARY"===n?.ryunix_type)return t;t=t.parent||null}return null})(e),u=(c?(e=>{if(!e)return null;if(e.dom&&1===e.dom.nodeType){const t=e.dom;if(t.hasAttribute("data-ryunix-hydrate-boundary"))return t}let t=e.child||null;for(;t;){if(t.dom&&1===t.dom.nodeType){const e=t.dom;if(e.hasAttribute("data-ryunix-hydrate-boundary"))return e}t=t.child||t.sibling||null}return null})(c):null)??(e=>{let t=e??null;for(;t;){if(1===t.nodeType&&t.hasAttribute("data-ryunix-hydrate-boundary"))return t;t=t.parentNode}return null})(t.hydrateCursor);"boundary"===i.recover&&c&&u?(z(a),((e,t,r)=>{if(!e||!t)return;const o=n(),i=o.scopedRecoveryQueue||[];i.push({boundaryFiber:e,boundaryDom:t,resumeCursor:r,element:Array.isArray(e.props?.children)?e.props.children[0]:e.props?.children}),o.scopedRecoveryQueue=i})(c,u,t.hydrateCursor??null),t.hydrateCursor=(o=t.hydrateCursor??null,s=u,o&&s&&(o===s||s.contains(o))?s.nextSibling:o),e.dom=F(e),e.effectTag=l.PLACEMENT):"none"===i.recover?(Q(a),t.isHydrating=!1,t.hydrateCursor=null,e.dom=F(e),e.effectTag=l.PLACEMENT):((e=>{const t=n();if(t.hydrationMismatchReported)return;t.hydrationMismatchReported=!0;const r="production"===process.env.NODE_ENV?"error":"warn";V(r,`${e} Server HTML did not match the client render. Falling back to client-side render.`)})(a),t.isHydrating=!1,t.hydrationFailed=!0,t.hydrateCursor=null,e.dom=F(e),e.effectTag=l.PLACEMENT)}}else e.dom=F(e)}var o,s;if(e._hydratePreserveServer)return;const a=(e=>null==e?[]:Array.isArray(e)?e:[e])(e.props?.children);oe(e,a)},ae=e=>"symbol"==typeof e?e.description||e.toString():"function"==typeof e?e.name||"anonymous":String(e);let le=null;const ce=(e,t)=>{if(le)return le(e,t);"production"!==process.env.NODE_ENV&&console.warn("[Ryunix] scheduleWork called before being initialized.")},ue=(e,t)=>{H(t);ce({dom:t,props:{children:[e]},isHydrating:!1,hydrateCursor:null},void 0)},de=()=>{const e=n();if(!e.hydrationFailed||e.hydrationRecover)return;if("none"===ie().recover)return;const t=e.containerRoot||e.currentRoot?.dom,r=(e=>{if(null!=e)return Array.isArray(e)?e[0]:e})(e.currentRoot?.props?.children);t&&null!=r&&(e.hydrationRecover=!0,e.hydrationFailed=!1,((e="")=>{const t=n();if(t.hydrationFailureReported)return;t.hydrationFailureReported=!0;const r=e?`${e} `:t.hydrationMismatchReported?"":"Hydration could not attach to the server HTML. ",o="production"===process.env.NODE_ENV?"error":"warn";V(o,`${r}Clearing #__ryunix and remounting on the client.`)})(""),(()=>{const e=n();e.hydrationRecoveryReported||(e.hydrationRecoveryReported=!0,V("warn","Remounting the application on the client after hydration failure."))})(),ue(r,t))},pe=()=>{const e=n();(()=>{const e=n(),t=e.scopedRecoveryQueue;if(t?.length){e.scopedRecoveryQueue=[];for(const e of t)K(),ue(e.element,e.boundaryDom)}})(),de(),e.hydrationRecover=!1};let fe=[],ye=!1;function he(e){const t=n(),r=e.type instanceof Function||"function"==typeof e.type;try{r?(e=>{const t=n();t.wipFiber=e,t.hookIndex=0,e.hooks=[];const r=e.type;if(t.hydrationRecover&&"RYUNIX_ERROR_BOUNDARY"===r.ryunix_type&&(e.stateError=void 0),t.isHydrating&&(e.effectTag=l.HYDRATE),r._isMemo&&e.alternate){const{children:t,...n}=e.alternate.props||{},{children:o,...i}=e.props||{};if(r._arePropsEqual?.(n,i)){e.hooks=e.alternate.hooks;const t=e.alternate.child;return void(t&&(t.parent=e,e.child=t))}}const o=[r(e.props)];r._contextId&&void 0!==e.props?.value&&(e._contextId=r._contextId,e._contextValue=e.props.value),oe(e,o)})(e):se(e)}catch(r){if("production"!==process.env.NODE_ENV){console.error("[Ryunix ErrorBoundary] Caught error during render:",r);try{const t=e.props,n=t?.__source;n&&r&&"object"==typeof r&&(r.__ryunix_source=n);let o=e;for(;!r.__ryunix_source&&o;){const e=o.props;e?.__source&&(r.__ryunix_source=e.__source),o=o.parent}}catch(e){}}let n=e.parent,o=!1;for(;n;){if(n.type&&"RYUNIX_ERROR_BOUNDARY"===n.type.ryunix_type){o=!0;break}n=n.parent}return o&&n?("production"!==process.env.NODE_ENV&&console.warn("[Ryunix ErrorBoundary] Recovering tree at nearest boundary."),n.stateError=r,e.child=null,n):(console.error("[Ryunix] Fatal Uncaught Error. No ErrorBoundary was found in the tree to handle this exception:\n",r),t.nextUnitOfWork=null,null)}if(e.child)return e.child;let o=e;for(;o;){if(t.isHydrating&&o.dom&&(t.hydrateCursor=y(o.dom.nextSibling)),o.sibling)return o.sibling;o=o.parent}return null}const me=e=>{const r=n();let o=!1;for(;(r.nextUnitOfWork||fe.length>0)&&!o;){if(!r.nextUnitOfWork&&fe.length>0){const e=fe.shift();if(!e)continue;r.wipRoot=e,r.nextUnitOfWork=e,r.deletions=[],void 0!==e.isHydrating&&(r.isHydrating=e.isHydrating,r.hydrateCursor=e.hydrateCursor)}r.nextUnitOfWork&&(r.nextUnitOfWork=he(r.nextUnitOfWork)),o=e.timeRemaining()<1}!r.nextUnitOfWork&&r.wipRoot&&(ee(),pe()),r.nextUnitOfWork||fe.length>0?t(me):ye=!1},ge=(e,r=D())=>{const o=n();o.wipRoot?fe.push(e):(o.nextUnitOfWork=e,o.wipRoot=e,o.deletions=[],void 0!==e.isHydrating&&(o.isHydrating=e.isHydrating,o.hydrateCursor=e.hydrateCursor)),o.hookIndex=0,o.effects=[],ye||(ye=!0,r<=C.USER_BLOCKING?Promise.resolve().then(()=>{me({timeRemaining:()=>10,didTimeout:!0})}):t(me))};le=ge;const Ee=(e,t)=>{const r=n();H(t);const o={dom:t,props:{children:[e]},alternate:r.currentRoot,isHydrating:!1,hydrateCursor:null};return ge(o),o},xe="data-ryunix-ssr-root",ve=e=>{let t=e;for(;t&&(3===t.nodeType&&!t.nodeValue?.trim()||8===t.nodeType||1===t.nodeType&&t.hasAttribute("data-ryunix-ssr"));)t=t.nextSibling;return t},Ne=(e,t)=>{const r=n();r.containerRoot=t;const o={dom:t,props:{children:[e]},alternate:r.currentRoot,isHydrating:!0,hydrateCursor:ve(t.firstChild)};return ge(o),o},be=(e,t="__ryunix",r={})=>{const o=n(),i=document.getElementById(t);if(o.containerRoot=i,!i)return void("production"!==process.env.NODE_ENV&&console.warn(`[Ryunix] init: container #${t} not found.`));if((()=>{const e=n();e.hydrationMismatchReported=!1,e.hydrationBoundaryMismatchReported=!1,e.hydrationFailureReported=!1,e.hydrationUnmatchedReported=!1,e.hydrationRecoveryReported=!1,e.hydrationBoundaryRecoveryReported=!1})(),o.hydrationPolicy=ie(),o.scopedRecoveryQueue=[],o.hydrationRecover=!1,o.isHydrating=!1,o.hydrationFailed=!1,o.currentRoot)return"production"!==process.env.NODE_ENV&&process.env.RYUNIX_DEBUG&&console.log(`[Ryunix Debug] init: existing root detected. Client render on #${t}`),Ee(e,i);const s="false"!==process.env.RYUNIX_SSR&&i.hasAttribute(xe)&&i.hasChildNodes();return"production"!==process.env.NODE_ENV&&process.env.RYUNIX_DEBUG&&console.log(`[Ryunix Debug] init: isSsrPayload=${s}, hasChildNodes=${i.hasChildNodes()}`),s?("production"!==process.env.NODE_ENV&&process.env.RYUNIX_DEBUG&&console.log(`[Ryunix Debug] init: hydrating SSR markup on #${t}`),i.removeAttribute(xe),Ne(e,i)):("production"!==process.env.NODE_ENV&&process.env.RYUNIX_DEBUG&&console.log(`[Ryunix Debug] init: client render on #${t}`),Ee(e,i))},Re=(e,t,r)=>{try{return e(t)}catch(e){return"production"!==process.env.NODE_ENV&&console.error("Component error:",e),r&&r(e),null}};let ke=!1,we=[];function Te(e){const t=ke;ke=!0;try{e()}finally{ke=t,!ke&&we.length>0&&Se()}}function Se(){if(0===we.length)return;const e=we;we=[],e.forEach(e=>e())}process.env.NODE_ENV;const _e=(e="A hook")=>{const t=n();if(!t.wipFiber)throw new Error(`${e} can only be called inside function components. Make sure you are calling hooks at the top level of your component.`);const r=t.wipFiber;Array.isArray(r.hooks)||(r.hooks=[])},Ce=new Set(["title","pageTitle","canonical","titleTemplate","titleDefault","lastmod","changefreq","priority","custom","icon","appleTouchIcon"]),Ae=e=>u(e)&&null!==e&&("default"in e||"template"in e),Ie=e=>"string"==typeof e&&e.trim()?e.trim():void 0;function Le(e={},t={}){const r=Ie(t.title?.template)||Ie(e.titleTemplate)||(Ae(e.title)?Ie(e.title.template):void 0),n=Ie(t.title?.prefix)||Ie(e.titleDefault)||(Ae(e.title)?Ie(e.title.default):void 0)||"Ryunix App",o=Ie(e.pageTitle)||("string"==typeof e.title?Ie(e.title):void 0);let i=n;o&&(i=r&&r.includes("%s")?r.replace("%s",o):o);const s={};for(const[t,r]of Object.entries(e))if(!(Ce.has(t)||"title"===t&&Ae(r))){if(Array.isArray(r)){const e=r.map(e=>"string"==typeof e?e.trim():"").filter(Boolean);e.length>0&&(s[t]=e);continue}"string"==typeof r&&r.trim()&&(s[t]=r.trim())}return Ie(e.canonical)&&(s.canonical=e.canonical),Ie(e.icon)&&(s.icon=e.icon),Ie(e.appleTouchIcon)&&(s.appleTouchIcon=e.appleTouchIcon),{title:i,tags:s}}function Oe(e={},t={}){const r={...e,...t};return"string"==typeof t.title&&Ae(e.title)&&(!Ie(r.titleTemplate)&&Ie(e.title.template)&&(r.titleTemplate=e.title.template),!Ie(r.titleDefault)&&Ie(e.title.default)&&(r.titleDefault=e.title.default)),r}const Me=(e,t)=>!e||!t||(e.length!==t.length||e.some((e,r)=>!Object.is(e,t[r]))),De=(e,t=D())=>{if("undefined"==typeof window)return[d(e)?e():e,()=>{}];if(n().isServerRendering)return[d(e)?e():e,()=>{}];return $e((e,t)=>d(t)?t(e):t,e,void 0,t)},$e=(e,t,r,o=D())=>{if("undefined"==typeof window)return[r?r(t):t,()=>{}];const s=n();if(s.isServerRendering)return[r?r(t):t,()=>{}];_e();const{hookIndex:a}=s,l=s.wipFiber;l.hooks||(l.hooks=[]);const c=l.alternate?.hooks?.[a],u={hookID:a,type:i.RYUNIX_STORE,state:c?c.state:r?r(t):t,queue:[]};c?.queue&&c.queue.forEach(t=>{try{u.state=e(u.state,t)}catch(e){"production"!==process.env.NODE_ENV&&console.error("Error in reducer:",e)}});return l.hooks[a]=u,s.hookIndex++,[u.state,(e,t=o)=>{if(void 0===e)return void("production"!==process.env.NODE_ENV&&console.warn("dispatch called with undefined action"));u.queue.push(e);const r=n(),i=r.currentRoot||r.wipRoot;if(!i)return;const s={dom:i.dom,props:i.props,alternate:r.currentRoot||null};var a;a=()=>ce(s,t),we.push(a),ke||Se()}]},Ue=(e,t)=>{if("undefined"==typeof window)return;const r=n();if(r.isServerRendering)return;if(_e(),!d(e))throw new Error("useEffect callback must be a function");if(void 0!==t&&!Array.isArray(t))throw new Error("useEffect dependencies must be an array or undefined");const{hookIndex:o}=r,s=r.wipFiber;s.hooks||(s.hooks=[]);const a=s.alternate?.hooks?.[o],l=Me(a?.deps,t),c={hookID:o,type:i.RYUNIX_EFFECT,deps:t,effect:l?e:null,cancel:a?.cancel};s.hooks[o]=c,r.hookIndex++},Fe=e=>{if("undefined"==typeof window)return{current:e};const t=n();if(t.isServerRendering)return{current:e};_e();const{hookIndex:r}=t,o=t.wipFiber;o.hooks||(o.hooks=[]);const s=o.alternate?.hooks?.[r],a={hookID:r,type:i.RYUNIX_REF,value:s?s.value:{current:e}};return o.hooks[r]=a,t.hookIndex++,a.value},Pe=(e,t)=>{if("undefined"==typeof window)return e();const r=n();if(r.isServerRendering)return e();if(_e(),!d(e))throw new Error("useMemo callback must be a function");if(!Array.isArray(t))throw new Error("useMemo requires a dependencies array");const{hookIndex:o}=r,s=r.wipFiber;s.hooks||(s.hooks=[]);const a=s.alternate?.hooks?.[o];let l;if(a&&!Me(a.deps,t))l=a.value;else try{l=e()}catch(e){throw"production"!==process.env.NODE_ENV&&console.error("Error in useMemo computation:",e),e}const c={hookID:o,type:i.RYUNIX_MEMO,value:l,deps:t};return s.hooks[o]=c,r.hookIndex++,l},Ye=(e,t)=>{if(!d(e))throw new Error("useCallback requires a function as first argument");return Pe(()=>e,t)},je=(e=i.RYUNIX_CONTEXT,t={})=>{const r=({value:t,children:r})=>m(i.RYUNIX_CONTEXT,{value:t,children:r,_contextId:e},...c([r]));r._contextId=e;return{Provider:r,useContext:(r=e)=>{const o=n();if(o.isServerRendering){const e=o.ssrContexts;return e&&void 0!==e[r]?e[r]:t}_e();let i=o.wipFiber;for(;i;){if(i._contextId===r&&void 0!==i._contextValue)return i._contextValue;const e=i.type;if(e?._contextId===r&&void 0!==i.props?.value)return i.props.value;i=i.parent}return t}}},He=()=>{if("undefined"==typeof window)return{};const e=new URLSearchParams(window.location.search),t={};for(const[r,n]of e.entries())t[r]=n;return t},Be=()=>{if("undefined"==typeof window)return"";const[e,t]=De(window.location.hash);return Ue(()=>{const e=()=>t(window.location.hash);return window.addEventListener("hashchange",e),()=>window.removeEventListener("hashchange",e)},[]),e},Xe=(e={},t={})=>{const r=n();r.isServerRendering?r.ssrMetadata=Oe(r.ssrMetadata||{},e):Ue(()=>{if("undefined"==typeof document)return;let r="Ryunix App";const n=t.title?.template,o=t.title?.prefix||"Ryunix App",i=e.pageTitle||e.title;if(r=p(i)&&i.trim()?n?.includes("%s")?n.replace("%s",i):i:o,document.title=r,e.canonical){let t=document.querySelector('link[rel="canonical"]');t||(t=document.createElement("link"),t.setAttribute("rel","canonical"),document.head.appendChild(t)),t.setAttribute("href",e.canonical)}Object.entries(e).forEach(([e,t])=>{if(["title","pageTitle","canonical"].includes(e))return;if(null==t)return;const r=e.startsWith("og:")||e.startsWith("twitter:"),n=`meta[${r?"property":"name"}='${e}']`;let o=document.head.querySelector(n);o||(o=document.createElement("meta"),o.setAttribute(r?"property":"name",e),document.head.appendChild(o)),o.setAttribute("content",t)})},[JSON.stringify(e),JSON.stringify(t)])},Ve=je("ryunix.navigation",{location:"/",params:{},query:{},navigate:e=>{},route:null}),We=(e,t)=>{const r=t.split("?")[0].split("#")[0],n=e.find(e=>e.NotFound),o=n?{route:{component:n.NotFound??null},params:{}}:{route:{component:null},params:{}};for(const n of e){if(n.subRoutes){const e=We(n.subRoutes,t);if(e)return e}if("*"===n.path)return o;if(!n.path||"string"!=typeof n.path)continue;const e=[],i=new RegExp(`^${n.path.replace(/:(\.\.\.)?(\w+)/g,(t,r,n)=>(e.push({key:n,isCatchAll:!!r}),r?"(.+)":"([^/]+)"))}$`),s=r.match(i);if(s){const t=e.reduce((e,t,r)=>{const n=s[r+1];return e[t.key]=t.isCatchAll&&n?n.split("/"):n,e},{});return{route:n,params:t}}}return o},qe=({routes:e,children:t})=>{if("undefined"==typeof window){const r=(()=>{const e=globalThis?.window?.location?.pathname;return"string"==typeof e&&e?e.split("?")[0].split("#")[0]:"/"})(),n=We(e,r),o={location:r,params:n.params||{},query:{},navigate:()=>{},route:n.route};return m(Ve.Provider,{value:o},g({children:t}))}const[r,n]=De(window.location.pathname);Ue(()=>{const e=()=>n(window.location.pathname);return window.addEventListener("popstate",e),window.addEventListener("hashchange",e),()=>{window.removeEventListener("popstate",e),window.removeEventListener("hashchange",e)}},[]);const o=We(e,r),i=He(),s={location:r,params:o.params||{},query:i,navigate:e=>{"undefined"!=typeof window&&window.__RYUNIX_MPA__?window.location.assign(e):(window.history.pushState({},"",e),n(e))},route:o.route};return m(Ve.Provider,{value:s},g({children:t}))},ze=()=>Ve.useContext("ryunix.navigation"),Ge=()=>{const{route:e,params:t,query:r,location:n}=ze();if(!e||!e.component)return null;const o=Be();return Ue(()=>{if(o){const e=o.slice(1),t=document.getElementById(e);return void(t&&t.scrollIntoView({block:"start",behavior:"smooth"}))}"undefined"!=typeof window&&window.scrollTo(0,0)},[n,o]),m(e.component,{params:t,query:r,hash:o,location:n})},Ke=()=>{const{location:e}=ze();return e.split("?")[0].split("#")[0]},Qe=()=>{const{query:e}=ze();return new URLSearchParams(e)},Je=({to:e,prefetch:t=!0,...r})=>{const{navigate:n}=ze(),{className:o,...i}=r;return m("a",{href:e,onClick:t=>{0!==t.button||t.metaKey||t.altKey||t.ctrlKey||t.shiftKey||(t.preventDefault(),n(e))},onMouseEnter:()=>{},className:r.className||r["ryunix-class"],...i},r.children)},Ze=({to:e,exact:t=!1,...r})=>{const{location:n,navigate:o}=ze(),i=t?n===e:n.startsWith(e),s=r["ryunix-class"]?"ryunix-class":"className",a="function"==typeof(l=r["ryunix-class"]||r.className)?l({isActive:i}):l||"";var l;const{"ryunix-class":c,className:u,...d}=r;return m("a",{href:e,onClick:t=>{0!==t.button||t.metaKey||t.altKey||t.ctrlKey||t.shiftKey||(t.preventDefault(),o(e))},[s]:a,...d},r.children)},et=e=>{const[r,n]=$e((e,t)=>"function"==typeof t?t.value(e):t.value,e,void 0);return[r,(e,r=C.NORMAL)=>{const o={value:e,priority:r};!function(e,r=C.NORMAL){I.push({callback:e,priority:r,timestamp:Date.now()}),L||(L=!0,t(O))}(()=>n(o,r),r)}]},tt=()=>{const[e,t]=et(!1);return[e,e=>{t(!0,C.IMMEDIATE),setTimeout(()=>{M(C.LOW,()=>{e(),t(!1,C.LOW)})},0)}]},rt=e=>{const[t,r]=et(e);return Ue(()=>{const t=setTimeout(()=>{r(e,C.LOW)},100);return()=>clearTimeout(t)},[e]),t},nt=(e,t="")=>{const[r,n]=De(()=>{try{const r=window.localStorage.getItem(e);return r?JSON.parse(r):t}catch(e){return t}});return[r,t=>{try{n(t),window.localStorage.setItem(e,JSON.stringify(t))}catch(e){console.error(e)}}]},ot=(e=!1)=>{const[t,r]=De(e);return[t,()=>{r(e=>!e)}]},it=(e,t)=>{if("undefined"==typeof window)return;const r=n();if(r.isServerRendering)return;if(_e(),!d(e))throw new Error("useLayoutEffect callback must be a function");if(void 0!==t&&!Array.isArray(t))throw new Error("useLayoutEffect dependencies must be an array or undefined");const{hookIndex:o}=r,s=r.wipFiber;s.hooks||(s.hooks=[]);const a=s.alternate?.hooks?.[o],l=Me(a?.deps,t),c={hookID:o,type:i.RYUNIX_EFFECT,deps:t,effect:l?e:null,cancel:a?.cancel,isLayout:!0};s.hooks[o]=c,r.hookIndex++};let st=0;const at=()=>{st=0},lt=()=>{const e=n();if(e.isServerRendering)return`:r${st++}:`;_e();const{hookIndex:t}=e,r=e.wipFiber;r.hooks||(r.hooks=[]);const o=r.alternate?.hooks?.[t],s={hookID:t,type:i.RYUNIX_REF,value:o?o.value:`:r${st++}:`};return r.hooks[t]=s,e.hookIndex++,s.value},ct=(e,t=300)=>{const[r,n]=De(e);return Ue(()=>{const r=setTimeout(()=>{n(e)},t);return()=>clearTimeout(r)},[e,t]),r},ut=(e,t=300)=>{const[r,n]=De(e),o=Fe(Date.now());return Ue(()=>{const r=Date.now(),i=r-o.current;if(!(i>=t)){const r=setTimeout(()=>{o.current=Date.now(),n(e)},t-i);return()=>clearTimeout(r)}o.current=r,n(e)},[e,t]),r},dt=e=>"string"!=typeof e?String(e):e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;"),pt=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),ft=e=>null==e?[]:Array.isArray(e)?e:[e],yt=(e,t)=>{let r="",n="",o=null;return Object.entries(e).forEach(([e,i])=>{if("children"===e)n=Array.isArray(i)?i.map(e=>t(e)).join(""):t(i);else if("dangerouslySetInnerHTML"===e){const e=i;e?.__html&&(o=e.__html)}else if(e===s.STYLE||e===a.STYLE){const e=!u(l=i)||f(l)?"":Object.entries(l).filter(([e,t])=>null!=t).map(([e,t])=>`${$(e)}:${t}`).join(";");e&&(r+=` style="${dt(e)}"`)}else if(e===s.CLASS_NAME||e===a.CLASS_NAME)i&&(r+=` class="${dt(i)}"`);else if(!e.startsWith("on")&&"key"!==e&&"ref"!==e&&"__source"!==e&&"__self"!==e)if("boolean"==typeof i)i&&(r+=` ${e}=""`);else if(null!=i){const t=_(e),n=Y(t,i);r+=` ${t}="${dt(n)}"`}var l}),{attributes:r,innerHTML:o,htmlChildren:n}},ht=(e,t)=>pt.has(e)?`<${e}${t} />`:`<${e}${t}>`,mt=()=>{const e=n();e.isServerRendering=!0,e.ssrMetadata={},e.ssrContexts={},at()},gt=e=>{if(null==e||"boolean"==typeof e)return"";if("string"==typeof e||"number"==typeof e)return dt(e);if(Array.isArray(e))return e.map(e=>gt(e)).join("");const t=e;if(t.type===i.TEXT_ELEMENT)return dt(t.props.nodeValue);if(t.type===i.RYUNIX_FRAGMENT){return ft(t.props?.children).map(e=>gt(e)).join("")}if(t.type===i.RYUNIX_CONTEXT){const e=n();e.ssrContexts=e.ssrContexts||{};const r=t.props||{},o=r._contextId,i=o?e.ssrContexts[o]:void 0;o&&(e.ssrContexts[o]=r.value);const s=r.children||[];let a="";return a=Array.isArray(s)?s.map(e=>gt(e)).join(""):gt(s),o&&(e.ssrContexts[o]=i),a}if("function"==typeof t.type){const e=(e=>{if(null!=e&&"object"==typeof e&&"then"in e&&"function"==typeof e.then)throw new Error("Async components require renderToStringAsync or renderToReadableStream, not renderToString");return e})((0,t.type)(t.props||{}));return gt(e)}const r=String(t.type),o=t.props||{},{attributes:s,innerHTML:a,htmlChildren:l}=yt(o,gt);if(pt.has(r))return ht(r,s);const c=null!==a?a:l;return`${ht(r,s)}${c}</${r}>`},Et="\nfunction $RC(id, templateId) {\n var b = document.getElementById(id);\n var t = document.getElementById(templateId);\n if (b && t) {\n b.innerHTML = t.innerHTML;\n t.remove();\n }\n}\n".replace(/\s+/g," ").trim(),xt=async(e,t,r=[])=>{if(e instanceof Promise&&(e=await e),null==e||"boolean"==typeof e)return;if("string"==typeof e||"number"==typeof e)return void t(dt(e));if(Array.isArray(e)){for(const n of e)await xt(n,t,r);return}const o=e;if(o.type===i.TEXT_ELEMENT)return void t(dt(o.props.nodeValue));if(o.type===i.RYUNIX_FRAGMENT){const e=ft(o.props?.children);for(const n of e)await xt(n,t,r);return}if(o.type===i.RYUNIX_CONTEXT){const e=n();e.ssrContexts=e.ssrContexts||{};const i=o.props||{},s=i._contextId,a=s?e.ssrContexts[s]:void 0;s&&(e.ssrContexts[s]=i.value);const l=i.children||[];if(Array.isArray(l))for(const e of l)await xt(e,t,r);else await xt(l,t,r);return void(s&&(e.ssrContexts[s]=a))}const s=o.type;if(o.type===i.RYUNIX_SUSPENSE||"object"==typeof s&&null!=s&&s.type===i.RYUNIX_SUSPENSE){const e=o.props||{},{fallback:i,children:s}=e,a=`s-${Math.random().toString(36).slice(2,9)}`;t(`\x3c!--$?--\x3e<template id="B:${a}"></template><div id="S:${a}">`);const l=async()=>{const e=n(),t=e.isSuspenseBackground;e.isSuspenseBackground=!0;let o="";const i=e=>{o+=e};try{return await xt(s,i,r),{id:a,content:o,success:!0}}catch(e){return{id:a,content:"",success:!1,error:e}}finally{e.isSuspenseBackground=t}};return r.push(l),await xt(i,t,r),void t("</div>\x3c!--$/--\x3e")}const a=o.type,l=o.props||{};if("function"==typeof a){process.env.RYUNIX_DEBUG&&console.log("[SSR Debug] Rendering function:",a.name||"anonymous");const e=await a(l);return void await xt(e,t,r)}const c=String(a),u=l.children||[],{attributes:d,innerHTML:p}=yt(l,()=>"");if(t(ht(c,d)),null!==p)t(p);else if(!pt.has(c)){if(Array.isArray(u))for(const e of u)await xt(e,t,r);else await xt(u,t,r);t(`</${c}>`)}},vt=(e,t,r)=>{if(e.success)return t(`<template id="P:${e.id}" data-ryunix-ssr>${e.content}</template>`),void t(`<script${r} data-ryunix-ssr>$RC("S:${e.id}", "P:${e.id}")<\/script>`);const n=e.error instanceof Error?e.error.message:String(e.error??"Unknown error");"production"!==process.env.NODE_ENV&&console.error("[Ryunix SSR] Suspense boundary failed:",e.error),t(`\x3c!-- Ryunix Suspense error: ${dt(n)} --\x3e`)},Nt=(e,t={})=>{const r=n(),o=new TextEncoder;return new ReadableStream({async start(n){const i=r.isServerRendering;mt();const s=e=>n.enqueue(o.encode(e)),a=[];try{const r=t.nonce?` nonce="${t.nonce}"`:"";for(s(`<script${r} data-ryunix-ssr>${Et}<\/script>`),await xt(e,s,a);a.length>0;){const e=a.shift();if(!e)continue;const t=await e();vt(t,s,r)}n.close()}catch(e){n.error(e)}finally{r.isServerRendering=i}}})},bt=(e,t={})=>{const r=n(),o=r.isServerRendering;mt();try{return gt(e)}finally{r.isServerRendering=o}},Rt=async(e,t={})=>{const r=Nt(e,t).getReader(),n=new TextDecoder;let o="";for(;;){const{done:e,value:t}=await r.read();if(e)break;o+=n.decode(t,{stream:!0})}return o+=n.decode(),o};function kt(e,t=wt){const r=t=>e(t);return r._isMemo=!0,r._wrappedComponent=e,r._arePropsEqual=t,r.displayName=`Memo(${e.displayName||e.name||"Component"})`,r}function wt(e,t){const r=Object.keys(e),n=Object.keys(t);return r.length===n.length&&r.every(r=>Object.is(e[r],t[r]))}function Tt(e,t){if(e===t)return!0;if(null==e||null==t)return!1;if("object"!=typeof e||"object"!=typeof t)return!1;const r=Object.keys(e),n=Object.keys(t);return r.length===n.length&&r.every(r=>Tt(e[r],t[r]))}function St(e){if("function"!=typeof e)throw new Error("forwardRef requires a render function");const t=t=>{const{ref:r,...n}=t||{};return e(n,r??null)},r=e;return t.displayName=`ForwardRef(${r.displayName||r.name||"Component"})`,t._isForwardRef=!0,t._render=e,t}const _t="pending",Ct="resolved",At="rejected";function It(e){return null!=e&&"object"==typeof e&&"type"in e&&"function"==typeof e.type&&Boolean(e.type._isLazy)}function Lt(e){let t=_t,r=null,n=null,o=null;const i=i=>{if(t===Ct&&r)return m(r,i);if(t===At&&n)throw n;o||(o=e().then(e=>{const n=e;r="default"in n&&n.default?n.default:n,t=Ct}).catch(e=>{n=e,t=At}));const[,s]=De(0);return Ue(()=>{if(t===_t&&o){let e=!0;return o.then(()=>{e&&s(e=>e+1)}).catch(()=>{e&&s(e=>e+1)}),()=>{e=!1}}},[]),null};return i._isLazy=!0,i._getStatus=()=>t,i}const Ot=({fallback:e,children:t})=>{const[r,o]=De(!1),i=Array.isArray(t)?t:[t];let s=!1;for(const e of i)if(It(e)){const t=e.type._getStatus?.();t===_t&&(s=!0)}return Ue(()=>{s||r||o(!0)},[s]),s&&!n().isSuspenseBackground?e||null:m(g,{children:t})};function Mt(e){return e()}Ot.type=i.RYUNIX_SUSPENSE;var Dt=Object.freeze({__proto__:null,Children:Ge,INTERNAL_META_KEYS:Ce,Link:Je,NavLink:Ze,RouterProvider:qe,Suspense:Ot,createContext:je,deepEqual:Tt,forwardRef:St,lazy:Lt,memo:kt,mergeRouteMetadata:Oe,preload:Mt,resetIdCounter:at,resolvePageMetadata:Le,shallowEqual:wt,useCallback:Ye,useDebounce:ct,useDeferredValue:rt,useEffect:Ue,useHash:Be,useId:lt,useLayoutEffect:it,useMemo:Pe,useMetadata:Xe,usePathname:Ke,usePersistentStore:nt,usePersitentStore:nt,useQuery:He,useReducer:$e,useRef:Fe,useRouter:ze,useSearchParams:Qe,useStore:De,useStorePriority:et,useSwitch:ot,useThrottle:ut,useTransition:tt});const $t=()=>"undefined"!=typeof performance?performance.now():Date.now();const Ut=new class{enabled;measures;renderTimes;maxSamples;constructor(){this.enabled="production"!==process.env.NODE_ENV,this.measures=new Map,this.renderTimes=[],this.maxSamples=100}startMeasure(e){this.enabled&&this.measures.set(e,$t())}endMeasure(e){if(!this.enabled)return;const t=this.measures.get(e);if(!t)return;const r=$t()-t;return this.measures.delete(e),r}recordRender(e,t){this.enabled&&(this.renderTimes.push({component:e,duration:t,timestamp:Date.now()}),this.renderTimes.length>this.maxSamples&&this.renderTimes.shift())}getStats(){if(!this.enabled)return null;const e=this.renderTimes.reduce((e,t)=>e+t.duration,0);return{total:e,avg:e/this.renderTimes.length,max:Math.max(...this.renderTimes.map(e=>e.duration)),min:Math.min(...this.renderTimes.map(e=>e.duration)),count:this.renderTimes.length}}getSlowestComponents(e=10){if(!this.enabled)return[];const t=new Map;return this.renderTimes.forEach(({component:e,duration:r})=>{t.has(e)||t.set(e,{total:0,count:0,max:0});const n=t.get(e);n.total+=r,n.count++,n.max=Math.max(n.max,r)}),Array.from(t.entries()).map(([e,t])=>({name:e,avg:t.total/t.count,max:t.max,count:t.count})).sort((e,t)=>t.avg-e.avg).slice(0,e)}logStats(){if(!this.enabled)return;const e=this.getStats();if(!e)return;console.group("šŸ” Ryunix Performance Stats"),console.log(`Total renders: ${e.count}`),console.log(`Avg render time: ${e.avg.toFixed(2)}ms`),console.log(`Min: ${e.min.toFixed(2)}ms | Max: ${e.max.toFixed(2)}ms`);const t=this.getSlowestComponents(5);t.length>0&&(console.log("\nāš ļø Slowest components:"),t.forEach((e,t)=>{console.log(`${t+1}. ${e.name}: ${e.avg.toFixed(2)}ms avg (${e.count} renders)`)})),console.groupEnd()}clear(){this.renderTimes=[],this.measures.clear()}enable(){this.enabled=!0}disable(){this.enabled=!1}};function Ft(e){const t=$t();return()=>{const r=$t()-t;Ut.recordRender(e,r)}}function Pt(e,t){return r=>{Ut.startMeasure(t);const n=e(r),o=Ut.endMeasure(t);return o&&Ut.recordRender(t,o),n}}function Yt({children:e,id:t}){return m("div",{"data-ryunix-server":t,style:{display:"contents"}},e)}function jt({children:e,id:t}){return m("div",{"data-ryunix-hydrate-boundary":t??"",suppressHydrationWarning:!0,style:{display:"contents"}},e)}function Ht({children:e,fallback:t}){const r=n().wipFiber;if(r?.stateError){const e=r.stateError;return"function"==typeof t?t(e):t??null}return m("ryunix-error-boundary-wrapper",{style:{display:"contents"}},e)}function Bt(e){return async function(...t){const r=await fetch("/_ryunix/action",{method:"POST",headers:{"Content-Type":"application/json","X-Ryunix-Action":"true"},body:JSON.stringify({actionId:e,args:t})});if(!r.ok){const e=await r.json().catch(()=>({}));throw new Error(e.error||"Server Action failed")}return r.json()}}function Xt(e){const t=e,r=!t||"object"!=typeof t||t instanceof Error||!t.nativeEvent?t:t.error;let n=null;if(r instanceof Error)n=r;else if(r&&"object"==typeof r)if("message"in r)n=r;else if("error"in r){const e=r.error;n=e&&"object"==typeof e?e:null}else n=r;const o=JSON.stringify(t,Object.getOwnPropertyNames(t||{})),[i,s]=De(null),[a,l]=De(1),[c,u]=De(""),[d,p]=De(0),f=i,y=a,h=c,g=d;let E=[];n&&n.stack&&(E="string"==typeof n.stack?n.stack.split("\n").filter(e=>{const t=e.trim();if(!t)return!1;if(t.includes("node_modules"))return!1;return!["fiber-update.js","workers.js","reconciler.js","commits.js","hooks/hooks.js","hooks.js","error-boundary.js","errorBoundary.js","boundaries.js","serverBoundary.js","app-router.js","app-router-server.js","render/render.js","render.js","createElement.js","index.js"].some(e=>t.includes(e))}):Array.isArray(n.stack)?n.stack:[]);const x=n&&"string"==typeof n.name?n.name:"Unknown Error Type",v=n&&"string"==typeof n.message?n.message:`Raw unhandled error. Debug: ${o}`;Ue(()=>{let e=null,t=null;const r=n?.__ryunix_source;if(r?.fileName&&(e=r.fileName,t=r.lineNumber??null),!e||!t)for(let r=0;r<E.length;r++){const n=E[r];if(!n.includes(":"))continue;let o=null,i=null;const s=n.indexOf("("),a=n.lastIndexOf(")");if(-1!==s&&a>s){const e=n.slice(s+1,a),t=e.lastIndexOf(":"),r=t>0?e.lastIndexOf(":",t-1):-1;if(r>0){const n=e.slice(t+1),s=e.slice(r+1,t);/^\d+$/.test(s)&&/^\d+$/.test(n)&&(o=e.slice(0,r),i=parseInt(s,10))}}if(!o){const e=n.trim();if(e.startsWith("at ")){const t=e.slice(3).trim(),r=t.lastIndexOf(":"),n=r>0?t.lastIndexOf(":",r-1):-1;if(n>0){const e=t.slice(r+1),s=t.slice(n+1,r);/^\d+$/.test(s)&&/^\d+$/.test(e)&&(o=t.slice(0,n),i=parseInt(s,10))}}}if(!o){const e=[".ryx",".jsx",".js",".ts",".tsx"],t=n.lastIndexOf(":");if(t>0){const r=n.slice(t+1).trim(),s=n.slice(0,t).trim();/^\d+$/.test(r)&&e.some(e=>s.endsWith(e))&&(o=s,i=parseInt(r,10))}}if(o&&i){e=o,t=i;break}}e&&t&&(u(e),p(t),fetch(`/_ryunix/source?file=${encodeURIComponent(e)}&line=${t}`).then(e=>e.json()).then(e=>{e.snippet&&(s(e.snippet),l(e.startLine))}).catch(e=>console.error("Failed to fetch source snippet",e)))},[n]);const N={backgroundColor:"#000",borderRadius:"8px",border:"1px solid #333",padding:"16px",fontFamily:"ui-monospace, monospace",fontSize:"14px",overflowX:"auto",color:"#d1d5db",marginBottom:"32px",whiteSpace:"pre-wrap",maxHeight:"150px",height:"auto"},b=e=>({display:"flex",backgroundColor:e?"rgba(239, 68, 68, 0.15)":"transparent",padding:"2px 8px",borderRadius:"4px",borderLeft:e?"3px solid #ef4444":"3px solid transparent"}),R=f?f.split("\n"):[];let k="UNHANDLED RUNTIME ERROR";return x&&"Error"!==x&&"Unknown Error Type"!==x&&(k=x.replace(/([a-z])([A-Z])/g,"$1 $2").toUpperCase()),m("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,zIndex:2147483647,backgroundColor:"rgba(0, 0, 0, 0.85)",backdropFilter:"blur(8px)",display:"flex",alignItems:"center",justifyContent:"center",padding:"20px",fontFamily:"system-ui, -apple-system, sans-serif"}},m("div",{style:{backgroundColor:"#0c0c0c",width:"100%",maxWidth:"1000px",maxHeight:"90vh",borderRadius:"12px",boxShadow:"0 25px 50px -12px rgba(0, 0, 0, 0.8)",display:"flex",flexDirection:"column",overflow:"hidden",border:"1px solid #333"}},m("div",{style:{backgroundColor:"#161616",padding:"16px 24px",borderBottom:"1px solid #333",display:"flex",justifyContent:"space-between",alignItems:"center"}},m("div",{style:{display:"flex",alignItems:"center",gap:"12px"}},m("span",{style:{backgroundColor:"rgba(239, 68, 68, 0.2)",color:"#ef4444",padding:"4px 8px",borderRadius:"4px",fontSize:"13px",fontWeight:"bold",textTransform:"uppercase",letterSpacing:"0.05em"}},k),m("span",{style:{color:"#9ca3af",fontSize:"14px"}},"Ryunix Development")),m("button",{onClick:()=>window.location.reload(),style:{background:"none",border:"none",color:"#9ca3af",cursor:"pointer",outline:"none"},title:"Reload page"},m("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},m("path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"}),m("path",{d:"M3 3v5h5"})))),m("div",{style:{padding:"32px",overflowY:"auto",flex:1,color:"#fff"}},m("h1",{style:{fontSize:"24px",fontWeight:"bold",marginBottom:"24px",fontFamily:"ui-monospace, monospace",wordBreak:"break-word",lineHeight:1.4}},m("span",{style:{color:"#f87171"}},x),": ",v),h&&m("div",{style:{marginBottom:"16px",color:"#9ca3af",fontSize:"14px",display:"flex",alignItems:"center",gap:"8px"}},m("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},m("path",{d:"M13 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z"}),m("polyline",{points:"13 2 13 9 20 9"})),h,":",g),f&&m("div",{style:N},m("div",{style:{display:"flex",flexDirection:"column"}},...R.map((e,t)=>{const r=y+t,n=r===g;return m("div",{key:t,style:b(n)},m("span",{style:{color:"#6b7280",width:"40px",userSelect:"none",textAlign:"right",marginRight:"16px",display:"inline-block"}},r),m("span",{style:{color:n?"#f87171":"#e5e7eb",whiteSpace:"pre"}},e||" "))}))),m("div",{style:{marginBottom:"16px"}},m("p",{style:{color:"#9ca3af",fontSize:"14px",marginBottom:"8px",fontWeight:600,textTransform:"uppercase",letterSpacing:"0.05em"}},"Call Stack"),m("div",{style:N},E.length>0?m("ul",{style:{listStyle:"none",padding:0,margin:0,display:"flex",flexDirection:"column",gap:"12px"}},...E.map((e,t)=>{if(0===t&&(e.startsWith("Error:")||e.startsWith("TypeError:")))return null;const r=e.trim();let n="<anonymous>",o=e;if(r.startsWith("at ")){const e=r.slice(3),t=e.indexOf("("),i=e.lastIndexOf(")");-1!==t&&i>t?(n=e.slice(0,t).trim()||"<anonymous>",o=e.slice(t+1,i)):(n=e.includes(":")?"<anonymous>":e,o=e)}else if(r.includes("@")){const e=r.indexOf("@");n=r.slice(0,e)||"<anonymous>",o=r.slice(e+1)}else{const e=[".ryx",".jsx",".js",".ts",".tsx"],t=r.split(/\s+/);if(t.length>=2){const r=t[t.length-1],i=r.indexOf(":"),s=i>0?r.slice(0,i):r;e.some(e=>s.endsWith(e))?(n=t.slice(0,-1).join(" "),o=r):(n=t[0],o=t.slice(1).join(" "))}}return m("li",{key:t},m("span",{style:{color:"#60a5fa",fontWeight:600}},n),m("div",{style:{color:"#6b7280",marginTop:"4px",paddingLeft:"16px",display:"flex",alignItems:"center",gap:"8px"}},m("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},m("path",{d:"M13 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z"}),m("polyline",{points:"13 2 13 9 20 9"})),o))})):m("div",{style:{color:"#6b7280",fontStyle:"italic"}},"No stack trace available."))))))}Yt.ryunix_type="RYUNIX_SERVER_BOUNDARY",jt.ryunix_type="RYUNIX_HYDRATION_BOUNDARY",Ht.ryunix_type="RYUNIX_ERROR_BOUNDARY";const Vt="ryunix_theme",Wt=["light","system","dark"];function qt(e={}){const t=e.cookieName??Vt,r=e.defaultTheme??"dark",n=e.darkClass??"dark",o=e.maxAgeSeconds??31536e3,i=e=>Wt.includes(e),s=()=>{if("undefined"==typeof document)return null;const e=document.cookie.match(new RegExp(`(?:^|;\\s*)${t}=(light|system|dark)(?:;|$)`));return e?e[1]:null},a=()=>"undefined"==typeof window||window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",l=e=>{const t=i(e)?e:r;return"system"===t?a():t};return{cookieName:t,defaultTheme:r,themes:Wt,getThemeCookie:s,setThemeCookie:e=>{"undefined"!=typeof document&&i(e)&&(document.cookie=`${t}=${e}; path=/; max-age=${o}; SameSite=Lax`)},resolveThemeFromCookie:()=>s()||r,getSystemColorScheme:a,resolveEffectiveTheme:l,applyTheme:e=>{if("undefined"==typeof document)return;const t=i(e)?e:r,o=l(t),s=document.documentElement;s.classList.toggle(n,"dark"===o),s.dataset.theme=t,s.dataset.themeEffective=o,s.style.colorScheme="dark"===o?"dark":"light"},getInitScript:()=>`(function(){try{var m=document.cookie.match(/(?:^|;\\s*)${t}=(light|system|dark)(?:;|$)/);var t=m?m[1]:'${r}';var dark=t==='dark'||(t==='system'&&window.matchMedia('(prefers-color-scheme: dark)').matches);var r=document.documentElement;r.classList.toggle('${n}',dark);r.dataset.theme=t;r.dataset.themeEffective=dark?'dark':'light';r.style.colorScheme=dark?'dark':'light';}catch(e){document.documentElement.classList.add('${n}');}})();`,watchSystemTheme:e=>{if("undefined"==typeof window)return()=>{};const t=window.matchMedia("(prefers-color-scheme: dark)"),r=()=>e(a());return t.addEventListener("change",r),()=>t.removeEventListener("change",r)}}}const zt=qt(),{cookieName:Gt,defaultTheme:Kt,themes:Qt,getThemeCookie:Jt,setThemeCookie:Zt,resolveThemeFromCookie:er,getSystemColorScheme:tr,resolveEffectiveTheme:rr,applyTheme:nr,watchSystemTheme:or}=zt,ir=zt.getInitScript(),sr={light:({className:e=""})=>m("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.75,strokeLinecap:"round",strokeLinejoin:"round",className:e,"aria-hidden":!0},m("circle",{cx:12,cy:12,r:4}),m("path",{d:"M12 2v2M12 20v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2M4.93 19.07l1.41-1.41M17.66 6.34l1.41-1.41"})),system:({className:e=""})=>m("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.75,strokeLinecap:"round",strokeLinejoin:"round",className:e,"aria-hidden":!0},m("rect",{x:2,y:3,width:20,height:14,rx:2}),m("path",{d:"M8 21h8M12 17v4"})),dark:({className:e=""})=>m("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.75,strokeLinecap:"round",strokeLinejoin:"round",className:e,"aria-hidden":!0},m("path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z"}))};function ar({labels:e,className:t="",controller:r=zt}){const[n,o]=De(r.defaultTheme);Ue(()=>{const e=r.resolveThemeFromCookie();o(e),r.applyTheme(e)},[]),Ue(()=>{if("system"===n)return r.watchSystemTheme(()=>r.applyTheme("system"))},[n]);return m("div",{className:`ryx-theme-segment ${t}`.trim(),role:"radiogroup","aria-label":e.title},...r.themes.map(t=>{const i=n===t,s=sr[t];return m("button",{key:t,type:"button",role:"radio","aria-checked":i?"true":"false",title:e[t],className:"ryx-theme-segment-btn"+(i?" ryx-theme-segment-btn--active":""),onClick:()=>{var e;(e=t)!==n&&(o(e),r.setThemeCookie(e),r.applyTheme(e))}},s({className:"ryx-theme-segment-icon"}),m("span",{className:"ryx-theme-segment-sr-only"},e[t]))}))}function lr({controller:e=zt}={}){return m("script",{dangerouslySetInnerHTML:{__html:e.getInitScript()}})}const cr=({image:e,title:t,href:r="/",imageAlt:n,blockClass:o,linkClass:i,imageClass:s,titleClass:a})=>{if(!e&&!t)return null;const l=[e?m("img",{src:e,alt:n??t??"",className:s}):null,t?m("span",{className:a},t):null].filter(Boolean);return m("div",{className:o},m("a",{href:r,className:i},...l))},ur=e=>null==e||!1===e?[]:c(Array.isArray(e)?e:[e]).filter(e=>null!=e&&!1!==e),dr=(e,t)=>{const r=ur(t);return 0===r.length?null:m("div",{className:e},...r)};function pr({maxWidth:e,className:t="",innerClassName:r="",children:n}){const o=null!=e&&""!==e?{maxWidth:e,marginInline:"auto",width:"100%"}:void 0;return m("main",{className:`ryx-main ${t}`.trim()},m("div",{className:`ryx-main-inner ${r}`.trim(),style:o},...ur(n)))}function fr({image:e,title:t,href:r="/",imageAlt:n,sticky:o=!0,className:i="",children:s}){const a=["ryx-header",!1!==o?"ryx-header--sticky":"",i].filter(Boolean).join(" ");return m("header",{className:a},m("div",{className:"ryx-header-inner"},m("div",{className:"ryx-header-start"},cr({image:e,title:t,href:r,imageAlt:n,blockClass:"ryx-header-brand",linkClass:"ryx-header-brand-link",imageClass:"ryx-header-brand-image",titleClass:"ryx-header-brand-title"})),dr("ryx-header-end",s)))}function yr({image:e,title:t,description:r,href:n="/",imageAlt:o,className:i="",children:s,bottomStart:a,bottomEnd:l}){const c=cr({image:e,title:t,href:n,imageAlt:o,blockClass:"ryx-footer-brand",linkClass:"ryx-footer-brand-link",imageClass:"ryx-footer-brand-image",titleClass:"ryx-footer-brand-title"}),u=c||r?m("div",{className:"ryx-footer-brand-column"},c,r?m("p",{className:"ryx-footer-description"},r):null):null,d=ur(s).map((e,t)=>m("div",{key:t,className:"ryx-footer-column"},e)),p=dr("ryx-footer-bottom-start",a),f=dr("ryx-footer-bottom-end",l),y=p||f?m("div",{className:"ryx-footer-bottom"},p,f):null;return m("footer",{className:`ryx-footer ${i}`.trim()},m("div",{className:"ryx-footer-accent","aria-hidden":"true"}),m("div",{className:"ryx-footer-glow","aria-hidden":"true"}),m("div",{className:"ryx-footer-inner"},u||d.length>0?m("div",{className:"ryx-footer-grid"},u,...d):null,y))}function hr(){try{const e=ryunix.config.i18n;if(e&&Array.isArray(e.locales)&&e.locales.length>0)return e}catch{}return null}function mr(e){return e}function gr(e,t){if(!e)return;const r=t.split(".");let n=e;for(const e of r){if(null==n||"string"==typeof n)return;n=n[e]}return"string"==typeof n?n:void 0}function Er(e){const t=[...new Set(e.locales.filter(Boolean))];if(0===t.length)throw new Error("[Ryunix i18n] At least one locale is required.");const r=t.includes(e.defaultLocale)?e.defaultLocale:t[0];return{...e,locales:t,defaultLocale:r}}function xr(e,t,r){return e?.[t]??e?.[r]}function vr(e,t){if("string"!=typeof e||0===t.length)return null;const r=new RegExp(`^/(${t.map(Rr).join("|")})(/|$)`),n=e.match(r);return n?n[1]:null}function Nr(e,t="",r){const n=t.startsWith("/")?t:t?`/${t}`:"";return r.includes(e)?n&&"/"!==n?`/${e}${n}`:`/${e}`:n||"/"}function br(e,t,r){const{locales:n}=r;if(!n.includes(t))return e;const o=vr(e,n);if(o){return Nr(t,e.slice(o.length+1)||"",n)}return e.startsWith("/")?Nr(t,e,n):Nr(t,"",n)}function Rr(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}const kr="ryunix_locale";function wr(e){const t=Er({locales:e.locales,defaultLocale:e.defaultLocale}),r=function(e,t,r){const n="object"==typeof e?e:{};return{enabled:!1!==e,cookieName:t??n.name??kr,maxAgeSeconds:r??n.maxAgeSeconds??31536e3}}(e.cookie,e.cookieName,e.maxAgeSeconds),n={...e.localeLabels};for(const e of t.locales)n[e]||(n[e]=e.toUpperCase());return{locales:t.locales,defaultLocale:t.defaultLocale,localeLabels:n,cookieName:r.cookieName,maxAgeSeconds:r.maxAgeSeconds,cookieEnabled:r.enabled,messages:e.messages??{}}}function Tr(e,t,r){return(n,o)=>function(e,t){return t?Object.entries(t).reduce((e,[t,r])=>e.replace(new RegExp(`\\{${function(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(t)}\\}`,"g"),String(r)),e):e}(gr(e[t],n)??gr(e[r],n)??n,o)}function Sr(e){const t=wr(e),{Provider:r,useContext:n}=je("ryunix.i18n",{locale:t.defaultLocale,defaultLocale:t.defaultLocale,locales:t.locales,localeLabels:t.localeLabels,t:e=>e}),o=e=>"string"==typeof e&&t.locales.includes(e),i=()=>{if(!t.cookieEnabled||"undefined"==typeof document)return null;const e=new RegExp(`(?:^|;\\s*)${t.cookieName}=(${t.locales.map(Ar).join("|")})(?:;|$)`),r=document.cookie.match(e);return r?r[1]:null},s=e=>{t.cookieEnabled&&"undefined"!=typeof document&&o(e)&&(document.cookie=`${t.cookieName}=${e}; path=/; max-age=${t.maxAgeSeconds}; SameSite=Lax`)},a=()=>n();return{config:t,Provider:({locale:e,children:n})=>{const i=o(e)?e:t.defaultLocale,s={locale:i,defaultLocale:t.defaultLocale,locales:t.locales,localeLabels:t.localeLabels,t:Tr(t.messages,i,t.defaultLocale)};return m(r,{value:s,children:n})},useI18n:a,useLocale:()=>a().locale,useTranslations:()=>a().t,LocaleSwitcher:({className:e=""})=>{const{location:r,navigate:n}=ze(),{locale:o,localeLabels:i,locales:l}=a();return m("div",{className:`ryunix-locale-switcher ${e}`.trim(),role:"group","aria-label":"Language",children:l.map(e=>m("button",{key:e,type:"button",onClick:()=>(e=>{if(e===o)return;s(e);const i=br(r,e,{locales:l,defaultLocale:t.defaultLocale});n(i.startsWith(`/${e}`)?i:`/${e}`)})(e),className:e===o?"ryunix-locale-switcher__btn is-active":"ryunix-locale-switcher__btn","aria-current":e===o?"true":void 0},i[e]??e))})},generateStaticParams:()=>t.locales.map(e=>({locale:e})),getLocaleFromPath:e=>vr(e,t.locales),localePath:(e,r="")=>Nr(e,r,t.locales),swapLocalePath:(e,r)=>br(e,r,{locales:t.locales,defaultLocale:t.defaultLocale}),pickLocale:(e,r)=>xr(e,r,t.defaultLocale),getLocaleCookie:i,setLocaleCookie:s,resolveLocaleFromCookie:()=>i()||t.defaultLocale,getLocaleRedirectScript:()=>{if(!t.cookieEnabled)return"";const e=t.locales.map(Ar).join("|");return`(function(){try{var m=document.cookie.match(/(?:^|;\\s*)${t.cookieName}=(${e})(?:;|$)/);var l=m?m[1]:'${t.defaultLocale}';var p=location.pathname;var r=new RegExp('^/(${e})(/|$)');if(!r.test(p)){location.replace('/'+l+(p==='/'?'':p));}}catch(e){}})();`}}}function _r(e,t){const r=hr()??t;if(!r)throw new Error("[Ryunix i18n] Missing ryunix.config.i18n. Add i18n: { locales, defaultLocale } to ryunix.config.js, pass a fallback to createAppI18n(), or call createI18n() directly.");return Sr({...r,messages:e})}function Cr(e,t){if(!e?.locales?.length)throw new Error("[Ryunix i18n] Invalid i18n config: locales array is required.");return Sr({...e,messages:t})}function Ar(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var Ir=Object.freeze({__proto__:null,Children:Ge,DEFAULT_LOCALE_COOKIE_NAME:kr,DEFAULT_THEME_COOKIE_NAME:Vt,ErrorBoundary:Ht,Footer:yr,Fragment:g,Header:fr,Hooks:Dt,HydrationBoundary:jt,INTERNAL_META_KEYS:Ce,Link:Je,Main:pr,NavLink:Ze,Priority:C,RouterProvider:qe,RyunixDevOverlay:Xt,ServerBoundary:Yt,Suspense:Ot,THEME_PREFERENCES:Wt,ThemeInitScript:lr,ThemeToggle:ar,applyTheme:nr,batchUpdates:Te,cloneElement:E,createActionProxy:Bt,createAppI18n:_r,createContext:je,createElement:m,createI18n:Sr,createI18nFromConfig:Cr,createPortal:X,createThemeController:qt,deepEqual:Tt,defineMessages:mr,escapeHtml:dt,forwardRef:St,getLocaleFromPath:vr,getRyunixI18nConfig:hr,getState:n,getSystemColorScheme:tr,getThemeCookie:Jt,hydrate:Ne,init:be,isValidElement:x,lazy:Lt,localePath:Nr,logHydrationBoundaryMismatch:z,logHydrationBoundaryRecovery:K,logHydrationFatal:Q,logHydrationInfo:q,logHydrationRecoverable:G,memo:kt,mergeRouteMetadata:Oe,normalizeI18nConfig:Er,pickLocale:xr,preload:Mt,profiler:Ut,render:Ee,renderToReadableStream:Nt,renderToString:bt,renderToStringAsync:Rt,resetIdCounter:at,resolveEffectiveTheme:rr,resolvePageMetadata:Le,resolveThemeFromCookie:er,safeRender:Re,setThemeCookie:Zt,shallowEqual:wt,swapLocalePath:br,themeController:zt,themeInitScript:ir,useCallback:Ye,useDebounce:ct,useDeferredValue:rt,useEffect:Ue,useHash:Be,useId:lt,useLayoutEffect:it,useMemo:Pe,useMetadata:Xe,usePathname:Ke,usePersistentStore:nt,usePersitentStore:nt,useProfiler:Ft,useQuery:He,useReducer:$e,useRef:Fe,useRouter:ze,useSearchParams:Qe,useStore:De,useStorePriority:et,useSwitch:ot,useThrottle:ut,useTransition:tt,watchSystemTheme:or,withProfiler:Pt});const{Provider:Lr,useContext:Or}=je("ryunix.mdx",{}),Mr=e=>({...Or(),...e}),Dr=globalThis.process&&"true"===String(globalThis.process.env?.RYUNIX_STYLE),$r=e=>{const{unstyled:t,...r}=e;return t||r["data-ryx-unstyled"]?{...r,"data-ryx-unstyled":!0}:r},Ur=(e,t,r)=>{const n=$r(r);return Dr&&t&&!n["data-ryx-unstyled"]?m(e,{...n,className:(o=n.className,i=t,o?Array.isArray(o)?[...o,i].join(" "):`${o} ${i}`:i)}):m(e,n);var o,i},Fr={h1:e=>Ur("h1","ryx-h1",e),h2:e=>Ur("h2","ryx-h2",e),h3:e=>Ur("h3","ryx-h3",e),h4:e=>Ur("h4","ryx-h4",e),h5:e=>Ur("h5","ryx-h5",e),h6:e=>Ur("h6","ryx-h6",e),p:e=>Ur("p","ryx-p",e),a:e=>Ur("a","ryx-a",e),strong:e=>Ur("strong","ryx-strong",e),em:e=>Ur("em","ryx-em",e),code:e=>Ur("code","ryx-code",e),ul:e=>Ur("ul","ryx-ul",e),ol:e=>Ur("ol","ryx-ol",e),li:e=>Ur("li","ryx-li",e),blockquote:e=>Ur("blockquote","ryx-blockquote",e),pre:e=>Ur("pre","ryx-pre",e),hr:e=>Ur("hr","ryx-hr",e),table:e=>Ur("table","ryx-table",e),thead:e=>Ur("thead","ryx-thead",e),tbody:e=>Ur("tbody","ryx-tbody",e),tr:e=>Ur("tr","ryx-tr",e),th:e=>Ur("th","ryx-th",e),td:e=>Ur("td","ryx-td",e),img:e=>Ur("img","ryx-img",e)};"undefined"!=typeof window&&(window.Ryunix=Ir),e.Children=Ge,e.DEFAULT_LOCALE_COOKIE_NAME=kr,e.DEFAULT_THEME_COOKIE_NAME=Vt,e.ErrorBoundary=Ht,e.Footer=yr,e.Fragment=g,e.Header=fr,e.Hooks=Dt,e.HydrationBoundary=jt,e.INTERNAL_META_KEYS=Ce,e.Image=({src:e,...t})=>m("img",{...t,src:e}),e.Link=Je,e.MDXContent=({children:e,components:t={}})=>{const r=Mr(t);return m(Lr,{value:r},m("div",null,e))},e.MDXProvider=Lr,e.Main=pr,e.NavLink=Ze,e.Priority=C,e.RouterProvider=qe,e.RyunixDevOverlay=Xt,e.ServerBoundary=Yt,e.Suspense=Ot,e.THEME_PREFERENCES=Wt,e.ThemeInitScript=lr,e.ThemeToggle=ar,e.applyTheme=nr,e.batchUpdates=Te,e.cloneElement=E,e.createActionProxy=Bt,e.createAppI18n=_r,e.createContext=je,e.createElement=m,e.createI18n=Sr,e.createI18nFromConfig=Cr,e.createPortal=X,e.createThemeController=qt,e.deepEqual=Tt,e.default=Ir,e.defaultComponents=Fr,e.defineMessages=mr,e.escapeHtml=dt,e.forwardRef=St,e.getLocaleFromPath=vr,e.getMDXComponents=Mr,e.getRyunixI18nConfig=hr,e.getState=n,e.getSystemColorScheme=tr,e.getThemeCookie=Jt,e.hydrate=Ne,e.init=be,e.isValidElement=x,e.lazy=Lt,e.localePath=Nr,e.logHydrationBoundaryMismatch=z,e.logHydrationBoundaryRecovery=K,e.logHydrationFatal=Q,e.logHydrationInfo=q,e.logHydrationRecoverable=G,e.memo=kt,e.mergeRouteMetadata=Oe,e.normalizeI18nConfig=Er,e.pickLocale=xr,e.preload=Mt,e.profiler=Ut,e.render=Ee,e.renderToReadableStream=Nt,e.renderToString=bt,e.renderToStringAsync=Rt,e.resetIdCounter=at,e.resolveEffectiveTheme=rr,e.resolvePageMetadata=Le,e.resolveThemeFromCookie=er,e.ryxProps=$r,e.safeRender=Re,e.setThemeCookie=Zt,e.shallowEqual=wt,e.swapLocalePath=br,e.themeController=zt,e.themeInitScript=ir,e.useCallback=Ye,e.useDebounce=ct,e.useDeferredValue=rt,e.useEffect=Ue,e.useHash=Be,e.useId=lt,e.useLayoutEffect=it,e.useMDXComponents=Or,e.useMemo=Pe,e.useMetadata=Xe,e.usePathname=Ke,e.usePersistentStore=nt,e.usePersitentStore=nt,e.useProfiler=Ft,e.useQuery=He,e.useReducer=$e,e.useRef=Fe,e.useRouter=ze,e.useSearchParams=Qe,e.useStore=De,e.useStorePriority=et,e.useSwitch=ot,e.useThrottle=ut,e.useTransition=tt,e.watchSystemTheme=or,e.withProfiler=Pt,Object.defineProperty(e,"__esModule",{value:!0})});
2
2
  //# sourceMappingURL=Ryunix.umd.min.js.map