@stacksjs/ts-cloud 0.9.1 → 0.9.3
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.
- package/dist/aws/index.js +10 -2
- package/dist/bin/chunk-09nwf2gy.js +34 -0
- package/dist/bin/chunk-14cwr6eh.js +70 -0
- package/dist/bin/chunk-271gk1n2.js +6 -0
- package/dist/bin/chunk-38pq971s.js +2 -0
- package/dist/bin/chunk-3gykfyq4.js +37 -0
- package/dist/bin/chunk-3r4fb59r.js +3 -0
- package/dist/bin/chunk-41x17hw1.js +1 -0
- package/dist/bin/chunk-4vrqm9h0.js +2 -0
- package/dist/bin/chunk-57y1zxbf.js +3 -0
- package/dist/bin/chunk-598yf4bs.js +1 -0
- package/dist/bin/chunk-8v7ddyvf.js +1 -0
- package/dist/bin/chunk-92mea34a.js +1 -0
- package/dist/bin/chunk-9pvsff8g.js +1 -0
- package/dist/bin/chunk-9v39615t.js +1 -0
- package/dist/bin/chunk-avm7tnwe.js +1 -0
- package/dist/bin/chunk-ax9mr6wm.js +44 -0
- package/dist/bin/chunk-axhnkn5g.js +2 -0
- package/dist/bin/chunk-b5gd39s8.js +512 -0
- package/dist/bin/chunk-b9qbp8j1.js +1 -0
- package/dist/bin/chunk-bz828v8q.js +3 -0
- package/dist/bin/chunk-c1vcdgvr.js +1 -0
- package/dist/bin/chunk-ctd2vg9w.js +2 -0
- package/dist/bin/chunk-dbgffky8.js +1 -0
- package/dist/bin/chunk-dwr30vbv.js +1 -0
- package/dist/bin/chunk-e3xrwh9z.js +1 -0
- package/dist/bin/chunk-fhc6ntvd.js +2 -0
- package/dist/bin/chunk-fpm59y25.js +6 -0
- package/dist/bin/chunk-fvbxvq6b.js +1 -0
- package/dist/bin/chunk-fy8j3y8p.js +92 -0
- package/dist/bin/chunk-fz21b57w.js +1 -0
- package/dist/bin/chunk-gavvf0pg.js +141 -0
- package/dist/bin/chunk-ggn7ax8p.js +4 -0
- package/dist/bin/chunk-gpe2prkm.js +1 -0
- package/dist/bin/chunk-gqf6jsmy.js +1 -0
- package/dist/bin/chunk-h5pa5men.js +2 -0
- package/dist/bin/chunk-hm08xdxf.js +2 -0
- package/dist/bin/chunk-hzgz13nf.js +1 -0
- package/dist/bin/chunk-hzqw8xm5.js +111 -0
- package/dist/bin/chunk-j703btc5.js +50 -0
- package/dist/bin/chunk-jpjamjey.js +6935 -0
- package/dist/bin/chunk-m2zwtapr.js +1 -0
- package/dist/bin/chunk-m669wtgr.js +1 -0
- package/dist/bin/chunk-mh0kdzqp.js +2 -0
- package/dist/bin/chunk-mr0atd2s.js +2 -0
- package/dist/bin/chunk-ngcyftm2.js +1 -0
- package/dist/bin/chunk-p66ptpmr.js +2 -0
- package/dist/bin/chunk-p8q9bq9g.js +1 -0
- package/dist/bin/chunk-r3kv0vm9.js +6 -0
- package/dist/bin/chunk-r9hjwcj9.js +6 -0
- package/dist/bin/chunk-rtczra13.js +1 -0
- package/dist/bin/chunk-ry030a6b.js +1507 -0
- package/dist/bin/chunk-rytk89az.js +60 -0
- package/dist/bin/chunk-sgyffpgm.js +581 -0
- package/dist/bin/chunk-vek8a0w6.js +1 -0
- package/dist/bin/chunk-waayf9ay.js +2 -0
- package/dist/bin/chunk-ynjvbphf.js +8 -0
- package/dist/bin/chunk-yv9sth30.js +1 -0
- package/dist/bin/cli.js +417 -10597
- package/dist/bin/dashboard-server.js +1 -6998
- package/dist/{chunk-hg7rhrgd.js → chunk-1c8dbv57.js} +5 -1
- package/dist/{chunk-5nr95wpj.js → chunk-728jvrr0.js} +3 -3
- package/dist/{chunk-ws47smxr.js → chunk-k4px0bnv.js} +2 -2
- package/dist/{chunk-hygwq9y2.js → chunk-q0st3se8.js} +2 -2
- package/dist/{chunk-atbgd8wz.js → chunk-qr803fye.js} +112 -1
- package/dist/deploy/attach-credentials.d.ts +57 -0
- package/dist/deploy/index.js +4 -4
- package/dist/deploy/site-ports.d.ts +151 -0
- package/dist/deploy/site-target.d.ts +24 -1
- package/dist/dns/declared-records.d.ts +87 -0
- package/dist/dns/declared-records.test.d.ts +1 -0
- package/dist/dns/index.d.ts +2 -0
- package/dist/dns/index.js +10 -2
- package/dist/drivers/index.js +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +13 -5
- package/dist/ui/404.html +16 -548
- package/dist/ui/_stx/chunk.5ddb5087.js +90 -0
- package/dist/ui/_stx/chunk.9fd39d5b.js +86 -0
- package/dist/ui/_stx/chunk.d5301f79.js +119 -0
- package/dist/ui/_stx/crosswind.222ed683.css +1 -0
- package/dist/ui/_stx/crosswind.616c25f3.css +1 -0
- package/dist/ui/_stx/crosswind.80baa894.css +320 -0
- package/dist/ui/_stx/crosswind.906ee17c.css +1 -0
- package/dist/ui/_stx/crosswind.996ed49e.css +1 -0
- package/dist/ui/_stx/crosswind.b7a99a5c.css +1 -0
- package/dist/ui/_stx/router.fa5bc4dc.js +4 -0
- package/dist/ui/_stx/runtime.c696d17a.js +1 -0
- package/dist/ui/_stx/style.448ab192.css +1 -0
- package/dist/ui/accept-invitation.html +2 -1133
- package/dist/ui/access-denied.html +7 -1130
- package/dist/ui/account/automation.html +12 -1134
- package/dist/ui/account/security.html +13 -1136
- package/dist/ui/applications/compose.html +12 -1134
- package/dist/ui/applications/new.html +13 -1137
- package/dist/ui/data/backups.html +91 -1136
- package/dist/ui/data/services.html +89 -1136
- package/dist/ui/data/volumes.html +61 -1136
- package/dist/ui/index.html +60 -1136
- package/dist/ui/infrastructure/topology.html +128 -1135
- package/dist/ui/integrations.html +13 -1138
- package/dist/ui/operations/alerts.html +59 -1136
- package/dist/ui/operations/configuration.html +13 -1135
- package/dist/ui/operations/jobs.html +87 -1136
- package/dist/ui/operations/maintenance.html +12 -1134
- package/dist/ui/operations/observability.html +93 -1136
- package/dist/ui/operations/previews.html +12 -1134
- package/dist/ui/operations/queue.html +12 -1134
- package/dist/ui/operations/regions.html +12 -1134
- package/dist/ui/operations/releases.html +12 -1134
- package/dist/ui/operations/spend.html +65 -1136
- package/dist/ui/operations/workloads.html +115 -1136
- package/dist/ui/robots.txt +2 -0
- package/dist/ui/security.html +24 -1136
- package/dist/ui/server/actions.html +67 -1138
- package/dist/ui/server/activity.html +7 -1130
- package/dist/ui/server/capacity.html +12 -1134
- package/dist/ui/server/database.html +166 -1135
- package/dist/ui/server/deployments.html +60 -1136
- package/dist/ui/server/diagnostics.html +7 -1130
- package/dist/ui/server/firewall.html +286 -1212
- package/dist/ui/server/fleet.html +45 -1136
- package/dist/ui/server/logs.html +34 -1135
- package/dist/ui/server/metrics.html +124 -1140
- package/dist/ui/server/security.html +7 -1130
- package/dist/ui/server/services.html +46 -1133
- package/dist/ui/server/sites.html +287 -1137
- package/dist/ui/server/ssh-keys.html +62 -1135
- package/dist/ui/server/team.html +155 -1136
- package/dist/ui/server/terminal.html +97 -1183
- package/dist/ui/serverless/alarms.html +62 -1135
- package/dist/ui/serverless/assets.html +47 -1132
- package/dist/ui/serverless/cost.html +7 -1130
- package/dist/ui/serverless/data.html +46 -1135
- package/dist/ui/serverless/deployments.html +47 -1132
- package/dist/ui/serverless/firewall.html +7 -1130
- package/dist/ui/serverless/functions.html +50 -1136
- package/dist/ui/serverless/logs.html +34 -1135
- package/dist/ui/serverless/metrics.html +7 -1130
- package/dist/ui/serverless/queues.html +58 -1135
- package/dist/ui/serverless/secrets.html +62 -1136
- package/dist/ui/serverless/traces.html +12 -1134
- package/dist/ui/serverless.html +64 -1137
- package/dist/ui-src/pages/server/firewall.stx +14 -14
- package/package.json +3 -3
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
(function(){var ROUTER_REV=7;if(window.__stxRouter&&window.__stxRouter.__rev===ROUTER_REV)return;var defaults={container:"main",loadingClass:"stx-navigating",viewTransitions:true,cache:true,scrollToTop:true,prefetch:true,progress:true,progressColor:"#78dce8",progressHeight:"2px",interceptAllLinks:false,prefetchCacheMax:50,routeFocus:true,announceRoute:true,interceptForms:false};var o=Object.assign({},defaults,window.__stxRouterConfig||{},window.STX_ROUTER_OPTIONS||{});var containerSel=o.container;var debug=!!o.debug;function log(){if(debug&&typeof console!=="undefined"&&console.log)console.log.apply(console,arguments)};var buildMeta=document.querySelector('meta[name="stx-build"]');var loadedBuild=buildMeta?buildMeta.getAttribute("content")||"":"";window.__stxBuild=loadedBuild;function isBuildSkew(incoming){return!!(loadedBuild&&incoming&&incoming!==loadedBuild)};function reloadForSkew(url,incoming){log("[router] build skew: page is",loadedBuild,"server is",incoming,"— full navigation");location.href=url};function runViewTransition(callback){if(!o.viewTransitions||!document.startViewTransition)return false;try{var transition=document.startViewTransition(callback);var onAbort=function(err){log("[router] view transition aborted:",err&&err.message?err.message:err)};if(transition&&transition.ready&&transition.ready.catch)transition.ready.catch(onAbort);if(transition&&transition.finished&&transition.finished.catch)transition.finished.catch(onAbort);if(transition&&transition.updateCallbackDone&&transition.updateCallbackDone.catch)transition.updateCallbackDone.catch(onAbort);return true}catch(err){log("[router] view transition unavailable:",err&&err.message?err.message:err);return false}};var progEl=null;var progVal=0;var progTimer=null;function setProgress(v){progVal=v<0?0:v>100?100:v;if(!progEl)return;progEl.style.opacity=progVal>0?"1":"0";progEl.style.transform="scaleX("+progVal/100+")"};function startProgress(){if(!o.progress||!progEl)return;if(progTimer){clearInterval(progTimer);progTimer=null}setProgress(8);progTimer=setInterval(function(){if(progVal>=90)return;var inc=Math.max(0.4,(90-progVal)*0.08);setProgress(progVal+inc)},160)};function finishProgress(){if(!o.progress||!progEl)return;if(progTimer){clearInterval(progTimer);progTimer=null}setProgress(100);setTimeout(function(){if(!progEl)return;progEl.style.opacity="0";setTimeout(function(){progVal=0;if(progEl)progEl.style.transform="scaleX(0)"},260)},180)};var cache={};var prefetching={};var isNavigating=false;var cacheOrder=[];function setCache(key,html,layout,group,title,cattrs){if(!(key in cache))cacheOrder.push(key);cache[key]=html;layoutCache[key]=layout;layoutGroupCache[key]=group;titleCache[key]=title||"";attrsCache[key]=cattrs||"";while(cacheOrder.length>o.prefetchCacheMax){var oldest=cacheOrder.shift();delete cache[oldest];delete layoutCache[oldest];delete layoutGroupCache[oldest];delete titleCache[oldest];delete attrsCache[oldest]}};function applyTitle(t){if(t){try{document.title=decodeURIComponent(t)}catch(e){document.title=t}}};var pendingContainerAttrs="";function parseContainerAttrs(attrStr){var map={};if(!attrStr)return map;var probe=document.createElement("div");probe.innerHTML="<i "+attrStr+"></i>";var src=probe.firstChild;if(src&&src.attributes){Array.prototype.forEach.call(src.attributes,function(a){map[a.name]=a.value})}return map};function setContainerAttrs(el,map){if(!el)return;var prev=(el.getAttribute("data-stx-cattrs")||"").split(",");prev.forEach(function(n){if(n&&!(n in map))el.removeAttribute(n)});var names=[];for(var k in map){if(Object.prototype.hasOwnProperty.call(map,k)&&k!=="data-stx-cattrs"){el.setAttribute(k,map[k]);names.push(k)}}if(names.length)el.setAttribute("data-stx-cattrs",names.join(","));else el.removeAttribute("data-stx-cattrs")};function applyContainerAttrs(el,encoded){var attrStr="";if(encoded){try{attrStr=decodeURIComponent(encoded)}catch(e){attrStr=encoded}}setContainerAttrs(el,parseContainerAttrs(attrStr))};function touchCache(key){var i=cacheOrder.indexOf(key);if(i>=0){cacheOrder.splice(i,1);cacheOrder.push(key)}};function evictCache(key){var i=cacheOrder.indexOf(key);if(i>=0)cacheOrder.splice(i,1);delete cache[key];delete layoutCache[key];delete layoutGroupCache[key];delete titleCache[key];delete attrsCache[key]};function extractCssBlocks(css){var blocks=[];var i=0;var len=css.length;while(i<len){while(i<len&&(css[i]===" "||css[i]===`
|
|
2
|
+
`||css[i]==="\r"||css[i]==="\t"))i++;if(i>=len)break;var blockStart=i;var bracePos=css.indexOf("{",i);if(bracePos===-1)break;var depth=0;var j=bracePos;while(j<len){if(css[j]==="{")depth++;else if(css[j]==="}"){depth--;if(depth===0){j++;break}}j++}if(depth!==0)break;blocks.push(css.slice(blockStart,j).trim());i=j}return blocks};function mergeCrosswindCSS(existing,incoming){var blocks=extractCssBlocks(incoming);var newBlocks=[];for(var bi=0;bi<blocks.length;bi++){if(existing.indexOf(blocks[bi])===-1)newBlocks.push(blocks[bi])}if(newBlocks.length>0)return existing+`
|
|
3
|
+
`+newBlocks.join(`
|
|
4
|
+
`);return null};function getContainer(){return document.querySelector(containerSel)||document.querySelector("[data-stx-content]")||document.querySelector("main")};var layoutCache={};var layoutGroupCache={};var titleCache={};var attrsCache={};var executedScriptHashes={};var REGISTERS_SCOPE=/window\.stx\.mount|_scopes\s*\[|\.initScope\s*\(|__stxComponentFactories\s*\[/;function runsAlways(declared,code){if(declared==="always")return true;if(declared==="once")return false;if(REGISTERS_SCOPE.test(code))return true;var head=code.trimStart();return head.charAt(0)==="("||head.charAt(0)===";"};function hashScript(code){var h=0;for(var i=0;i<code.length;i++){h=(h<<5)-h+code.charCodeAt(i);h|=0}return h};function hasStaticImport(code){return/(?:^|\n)[ \t]*import(?:[ \t]+|[{*'"])/.test(code)};function generatedSetupName(code){var match=code.match(/function (__stx_setup_[A-Za-z0-9_]+)\s*\(/);return match?match[1]:""};function documentShipsRuntime(doc,html){if(doc&&doc.querySelector&&doc.querySelector("script[data-stx-runtime]"))return true;return html.indexOf("'use strict';var cloakStyle")!==-1||html.indexOf("_cleanupContainer")!==-1&&html.indexOf("signals runtime loading")!==-1};function isSignalsRuntimeScript(script,code){return!!(script&&script.hasAttribute&&script.hasAttribute("data-stx-runtime"))||code.indexOf("_cleanupContainer")!==-1&&code.indexOf("signals runtime loading")!==-1||code.indexOf("'use strict';var cloakStyle")!==-1};function fragmentNeedsRuntime(frag,declared){if(declared==="1")return true;if(declared==="0")return false;if(frag.indexOf("__stx_setup_")!==-1||frag.indexOf("data-stx-scope=")!==-1||frag.indexOf("data-stx-reactive")!==-1||/=\s*window\.stx\s*;/.test(frag))return true;var content=stripInertRegions(frag);return BARE_DIRECTIVE.test(content)||content.indexOf("{{")!==-1};function stripInertRegions(frag){return frag.replace(new RegExp("<scr"+"ipt\\b[\\s\\S]*?<\\/scr"+"ipt>","gi"),"").replace(/<style\b[\s\S]*?<\/style>/gi,"").replace(/<pre\b[\s\S]*?<\/pre>/gi,"").replace(/<code\b[\s\S]*?<\/code>/gi,"").replace(/<!--[\s\S]*?-->/g,"")};var BARE_DIRECTIVE=/\s(?::[a-z][\w-]*|@[a-z][\w.-]*|x-[a-z][\w-]*)\s*=\s*["']/i;function fragmentMarker(declared){return"<!--stx-fragment"+(declared==="true"?" rt=1":declared==="false"?" rt=0":"")+"-->"}document.querySelectorAll("script").forEach(function(s){var text=s.textContent||"";if(text.trim()&&!s.hasAttribute("src"))executedScriptHashes[hashScript(text)]=1});function cacheKey(url){var u=new URL(url,location.href);return u.pathname+u.search};function withCurrentLocale(href){var d=window.__stxI18n;if(d&&typeof d.localizeHref==="function")return d.localizeHref(href);return href};function defaultLayoutGroup(layout){if(!layout)return"app";var clean=String(layout).replace(/\\/g,"/");var parts=clean.split("/").filter(Boolean);var idx=parts.lastIndexOf("layouts");var part=idx>=0?parts[idx+1]:parts[parts.length-1];return part?part.replace(/\.stx$/i,""):"app"};function getCurrentLayoutGroup(){var meta=document.querySelector('meta[name="stx-layout-group"]');if(meta&&meta.getAttribute("content"))return meta.getAttribute("content");var layout=document.querySelector('meta[name="stx-layout"]');return defaultLayoutGroup(layout?layout.getAttribute("content"):"")};function getDocLayoutGroup(doc,layout){var meta=doc&&doc.querySelector?doc.querySelector('meta[name="stx-layout-group"]'):null;return meta&&meta.getAttribute("content")?meta.getAttribute("content"):defaultLayoutGroup(layout||"")};function checkLayoutChange(newLayout,targetUrl,newGroup){var currentLayout=document.querySelector('meta[name="stx-layout"]');var curLayoutName=currentLayout?currentLayout.getAttribute("content"):"";var curGroup=getCurrentLayoutGroup();var nextGroup=newGroup||defaultLayoutGroup(newLayout);log("[router] layout check: current="+curLayoutName+"("+curGroup+") new="+(newLayout||"")+"("+nextGroup+")");if(curGroup!==nextGroup){log("[router] layout group change:",curGroup,"→",nextGroup,"— full reload to:",targetUrl);return true}if(curLayoutName&&newLayout&&curLayoutName!==newLayout){log("[router] layout name change:",curLayoutName,"→",newLayout,"— full body swap");return true}return false};function shouldUseFragmentResponse(){return containerSel==="main"||containerSel==="[data-stx-content]"};function writeHistory(mode,href){if(mode==="replace")history.replaceState({},"",href);else history.pushState({},"",href)};function navigate(url,pushState,force){if(pushState&&typeof pushState==="object")pushState=pushState.replace?"replace":true;if(!force)url=withCurrentLocale(url);log("[router] navigate() called:",url,"isNavigating:",isNavigating);if(isNavigating)return Promise.resolve(false);var t=new URL(url,location.href);if(t.origin!==location.origin){location.href=url;return Promise.resolve(false)}if(t.pathname===location.pathname&&t.hash){if(pushState!==false)writeHistory(pushState,t.href);var el=document.querySelector(t.hash);if(el)el.scrollIntoView({behavior:"smooth"});return Promise.resolve(true)}if(pushState!==false&&t.href===location.href&&!t.hash&&!force)return Promise.resolve(false);isNavigating=true;document.body.classList.add(o.loadingClass);startProgress();var targetHref=t.href;var targetPath=cacheKey(url);var targetHash=t.hash;function done(){isNavigating=false;document.body.classList.remove(o.loadingClass);finishProgress()}if(o.cache&&cache[targetPath]&&!force){touchCache(targetPath);if(checkLayoutChange(layoutCache[targetPath],url,layoutGroupCache[targetPath])){log("[router] cache hit but layout changed — fetching full page");return fetch(url,{headers:{Accept:"text/html"}}).then(function(r){if(!r.ok)throw new Error(r.status);return r.text()}).then(function(html){log("[router] full page fetched from cache path, len:",html.length);pendingLayoutDecl={layout:layoutCache[targetPath]||"",group:layoutGroupCache[targetPath]||""};return swap(html,targetPath,pushState,targetHash)}).catch(function(err){console.error("[router] full page fetch error:",err);location.href=url}).finally(done)}pendingContainerAttrs=attrsCache[targetPath]||"";pendingLayoutDecl=null;return Promise.resolve(swap(cache[targetPath],targetPath,pushState,targetHash)).then(function(){applyTitle(titleCache[targetPath]);return true}).finally(done)}else{if(force&&cache[targetPath])evictCache(targetPath);var wantsFragment=shouldUseFragmentResponse();return fetch(url,{headers:wantsFragment?{"X-STX-Router":"true",Accept:"text/html"}:{Accept:"text/html"}}).then(function(r){if(!r.ok)throw new Error(r.status);if(r.redirected&&r.url){var rd=new URL(r.url,location.href);if(rd.origin!==location.origin){location.href=r.url;return null}log("[router] guard redirected:",url,"->",rd.pathname);url=rd.pathname+rd.search+rd.hash;targetPath=cacheKey(url);targetHash=rd.hash};var incomingBuild=r.headers.get("X-STX-Build")||"";if(isBuildSkew(incomingBuild)){reloadForSkew(url,incomingBuild);return null};var isFragment=wantsFragment&&r.headers.get("X-STX-Fragment")==="true";var newLayout=r.headers.get("X-STX-Layout")||"";var newGroup=r.headers.get("X-STX-Layout-Group")||"";var newTitle=r.headers.get("X-STX-Title")||"";var newCAttrs=r.headers.get("X-STX-Container-Attrs")||"";var newRuntime=r.headers.get("X-STX-Runtime")||"";if(isFragment&&checkLayoutChange(newLayout,url,newGroup)){log("[router] layout change — fetching full page for document swap");return fetch(url,{headers:{Accept:"text/html"}}).then(function(fullRes){log("[router] full page fetched:",fullRes.status,"ok:",fullRes.ok);if(!fullRes.ok)throw new Error(fullRes.status);return fullRes.text().then(function(html){log("[router] full page html length:",html.length);return{html,isFragment:false,layout:newLayout,layoutGroup:newGroup,title:newTitle}})})}return r.text().then(function(html){return{html,isFragment,layout:newLayout,layoutGroup:newGroup,title:newTitle,containerAttrs:newCAttrs,runtime:newRuntime}})}).then(function(result){if(!result)return;if(result.isFragment)result.html=fragmentMarker(result.runtime)+result.html;if(o.cache)setCache(targetPath,result.html,result.layout,result.layoutGroup,result.title,result.containerAttrs);pendingContainerAttrs=result.isFragment?result.containerAttrs||"":"";pendingLayoutDecl=result.isFragment?null:{layout:result.layout||"",group:result.layoutGroup||""};return Promise.resolve(swap(result.html,targetPath,pushState,targetHash)).then(function(){if(result.isFragment)applyTitle(result.title);return true})}).catch(function(err){console.error("[router] fetch error:",err);location.href=url}).finally(done)}};function isStxDocument(html){return html.indexOf('name="stx-layout"')!==-1||html.indexOf("__stxRouterConfig")!==-1||html.indexOf("data-stx-content")!==-1};var pendingLayoutDecl=null;function routeAnnouncer(){var el=document.getElementById("stx-route-announcer");if(el)return el;el=document.createElement("div");el.id="stx-route-announcer";el.setAttribute("aria-live","polite");el.setAttribute("role","status");el.setAttribute("aria-atomic","true");el.style.cssText="position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap;border:0";document.body.appendChild(el);return el};function announceRoute(){if(o.announceRoute===false)return;var c=getContainer();var h=c&&c.querySelector?c.querySelector("h1"):null;var label=h&&(h.textContent||"").trim()||document.title||"";if(!label)return;var el=routeAnnouncer();el.textContent="";el.textContent=label};function focusAfterNavigation(hash){if(o.routeFocus===false)return;var target=null;if(hash){try{target=document.querySelector(hash)}catch(e){target=null}}if(!target)target=getContainer();if(!target||!target.focus)return;if(!target.hasAttribute("tabindex"))target.setAttribute("tabindex","-1");try{target.focus({preventScroll:true})}catch(e){try{target.focus()}catch(e2){}}};function swap(html,url,pushState,hash){var fragMark=/^<!--stx-fragment(?: rt=([01]))?-->/.exec(html);var isFragment=!!fragMark;var declaredRuntime=fragMark&&fragMark[1]?fragMark[1]:"";if(isFragment)html=html.slice(fragMark[0].length);if(!isFragment&&!isStxDocument(html)){log("[router] non-stx document — full navigation to:",url);location.href=url;return Promise.resolve(false)};var currentContent=getContainer();log("[router] swap: isFragment="+isFragment+" container="+!!currentContent+" tag="+(currentContent&¤tContent.tagName)+" selector="+containerSel+" htmlLen="+html.length);if(!currentContent){log("[router] no container — falling back");location.href=url;return Promise.resolve(false)}if(isFragment){let doFragSwap=function(){var fragScripts=[];var fragScriptId=0;var fragStyles=[];var fragCrosswindHrefs=[];var fragCrosswindCSS=null;var cleanFrag=html.replace(new RegExp("<scr"+"ipt\\b([^>]*)>([\\s\\S]*?)<\\/scr"+"ipt>","gi"),function(m,attrs,code){var typeMatch=attrs.match(/\btype\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s>]+))/i);var scriptType=(typeMatch&&(typeMatch[1]||typeMatch[2]||typeMatch[3])||"").trim().toLowerCase();if(scriptType&&scriptType!=="text/javascript"&&scriptType!=="application/javascript"&&scriptType!=="module")return m;if(code&&code.trim()&&!isSignalsRuntimeScript({hasAttribute:function(name){return name==="data-stx-runtime"&&attrs.indexOf("data-stx-runtime")!==-1}},code)){var slot="fragment-"+ ++fragScriptId;var scoped=/(?:^|\s)data-stx-scoped(?:\s|=|$)/i.test(attrs);var runDecl=(attrs.match(/data-stx-run\s*=\s*["']?(always|once)["']?/i)||[])[1];fragScripts.push({text:code,slot,setupName:generatedSetupName(code),scoped,run:runDecl?runDecl.toLowerCase():""});return"<scr"+'ipt type="application/stx-pending" data-stx-route-script="'+slot+'"'+(scoped?" data-stx-scoped":"")+(runDecl?' data-stx-run="'+runDecl.toLowerCase()+'"':"")+">"+code+"</scr"+"ipt>"}return""});cleanFrag=cleanFrag.replace(new RegExp("<sty"+"le\\b([^>]*)>([\\s\\S]*?)<\\/sty"+"le>","gi"),function(m,attrs,css){if(attrs.indexOf("data-crosswind")!==-1){fragCrosswindCSS=css}else{fragStyles.push({attrs,css})}return""});cleanFrag=cleanFrag.replace(new RegExp("<link\\b([^>]*)>","gi"),function(m,attrs){if(attrs.indexOf("data-crosswind")===-1)return m;var hrefMatch=attrs.match(/\bhref=(["'])(.*?)\1/i);if(hrefMatch&&hrefMatch[2])fragCrosswindHrefs.push(hrefMatch[2]);return""});document.querySelectorAll("style[data-stx-page]").forEach(function(s){s.remove()});if(fragCrosswindCSS){var curCrosswind=document.querySelector("head style[data-crosswind]");if(curCrosswind){var merged=mergeCrosswindCSS(curCrosswind.textContent||"",fragCrosswindCSS);if(merged)curCrosswind.textContent=merged}else{var cw=document.createElement("style");cw.setAttribute("data-crosswind","generated");cw.textContent=fragCrosswindCSS;document.head.appendChild(cw)}}fragCrosswindHrefs.forEach(function(href){var absolute=new URL(href,location.href).href;var exists=false;document.querySelectorAll("head link[data-crosswind][href]").forEach(function(link){if(new URL(link.getAttribute("href"),location.href).href===absolute)exists=true});if(exists)return;var link=document.createElement("link");link.setAttribute("data-crosswind","generated");link.setAttribute("rel","stylesheet");link.setAttribute("href",href);document.head.appendChild(link)});fragStyles.forEach(function(s){var el=document.createElement("style");el.textContent=s.css;el.setAttribute("data-stx-page","");document.head.appendChild(el)});applyContainerAttrs(currentContent,pendingContainerAttrs);currentContent.innerHTML=cleanFrag;document.querySelectorAll("script[data-stx-page]").forEach(function(s){s.remove()});if(pushState!==false)writeHistory(pushState,url+(hash||""));updateNav(url);updateActiveLinks();if(o.scrollToTop&&!hash)window.scrollTo({top:0,behavior:"instant"});else if(hash){var el=document.querySelector(hash);if(el)el.scrollIntoView({behavior:"smooth"})}window.dispatchEvent(new CustomEvent("stx:navigate",{detail:{url}}));focusAfterNavigation(hash);setTimeout(announceRoute,0);log("[router] frag scripts:",fragScripts.length);document.querySelectorAll("script[data-stx-page]").forEach(function(s){s.remove()});fragScripts.sort(function(a,b){return(a.setupName?1:0)-(b.setupName?1:0)});fragScripts.forEach(function(entry){var code=entry.text;log("[router] exec script len:",code.length,"has __stx_setup:",code.indexOf("__stx_setup")>-1);var placeholder=document.querySelector('script[data-stx-route-script="'+entry.slot+'"]');var nestedScopedTemplate=false;var scopedLoopSetup=false;if(entry.scoped&&placeholder){document.querySelectorAll("template").forEach(function(template){if(template.contains(placeholder)||template.content&&template.content.contains(placeholder))nestedScopedTemplate=true});var loopRoot=placeholder.previousSibling;while(loopRoot&&(loopRoot.nodeType===Node.TEXT_NODE&&!(loopRoot.textContent||"").trim()||loopRoot.nodeType===Node.COMMENT_NODE))loopRoot=loopRoot.previousSibling;if(loopRoot&&loopRoot.nodeType===Node.ELEMENT_NODE&&loopRoot.hasAttribute("data-stx-scope")&&(loopRoot.hasAttribute(":for")||loopRoot.hasAttribute("@for")||loopRoot.hasAttribute("x-for"))){var loopScopeId=loopRoot.getAttribute("data-stx-scope");scopedLoopSetup=!!loopScopeId&&code.indexOf(loopScopeId)!==-1}}if(entry.scoped&&(!placeholder||!placeholder.parentNode||nestedScopedTemplate||scopedLoopSetup)){log("[router] leaving loop-scoped script for component hydration");return};var h=hashScript(code);var isSetup=code.indexOf("__stx_setup_")!==-1;var isAlreadyScoped=runsAlways(entry.run,code);if(!isSetup&&!isAlreadyScoped&&executedScriptHashes[h]){log("[router] skipping already-executed script (hash dedup)");return}executedScriptHashes[h]=1;var ns=document.createElement("script");var hasImport=hasStaticImport(code);if(hasImport){ns.type="module"}ns.textContent=hasImport||isAlreadyScoped?code:"{"+code+"}";ns.setAttribute("data-stx-page","");if(placeholder&&placeholder.parentNode){ns.setAttribute("data-stx-positioned","");placeholder.parentNode.replaceChild(ns,placeholder)}else{document.body.appendChild(ns)}});log("[router] scripts done. _latestSetup:",!!(window.stx&&window.stx._latestSetup));window.dispatchEvent(new Event("stx:load"))};if(!window.stx&&fragmentNeedsRuntime(html,declaredRuntime)){log("[router] fragment needs the signals runtime and this page has none — full navigation to:",url);location.href=url;return Promise.resolve(false)}if(window.stx&&window.stx._cleanupContainer)window.stx._cleanupContainer(currentContent);return new Promise(function(resolve,reject){function completeFragSwap(){try{doFragSwap();resolve(true)}catch(err){reject(err)}}if(runViewTransition(completeFragSwap)){}else{currentContent.style.transition="opacity 0.12s ease-out";currentContent.style.opacity="0";setTimeout(function(){completeFragSwap();currentContent.style.opacity="1";setTimeout(function(){currentContent.style.transition=""},150)},120)}})};var parser=new DOMParser;var doc=parser.parseFromString(html,"text/html");var docBuildMeta=doc.querySelector('meta[name="stx-build"]');var docBuild=docBuildMeta?docBuildMeta.getAttribute("content")||"":"";if(isBuildSkew(docBuild)){reloadForSkew(url,docBuild);return Promise.resolve(false)}if(!window.stx&&documentShipsRuntime(doc,html)){log("[router] document needs the signals runtime and this page has none — full navigation to:",url);location.href=url;return Promise.resolve(false)};var newContent=doc.querySelector(containerSel)||doc.querySelector("[data-stx-content]")||doc.querySelector("main");if(!newContent){location.href=url;return Promise.resolve(false)}if(window.stx&&window.stx._cleanupContainer){window.stx._cleanupContainer(currentContent)};function doSwap(){var keepIds={"stx-view-transitions":1,"stx-r-css":1};var curStyles=document.querySelectorAll("head style");var newStyles=doc.querySelectorAll("head style");var curCrosswind=document.querySelector("head style[data-crosswind]");var newCrosswind=null;newStyles.forEach(function(s){if(s.getAttribute("data-crosswind"))newCrosswind=s});if(curCrosswind&&newCrosswind){var merged=mergeCrosswindCSS(curCrosswind.textContent||"",newCrosswind.textContent||"");if(merged)curCrosswind.textContent=merged};var incoming=[];newStyles.forEach(function(s){if(!keepIds[s.id]&&!s.getAttribute("data-crosswind")){var ns=document.createElement("style");ns.textContent=s.textContent;ns.setAttribute("data-stx-incoming","");document.head.appendChild(ns);incoming.push(ns)}});if(!curCrosswind&&newCrosswind){var ns=document.createElement("style");ns.textContent=newCrosswind.textContent;ns.setAttribute("data-crosswind",newCrosswind.getAttribute("data-crosswind"));document.head.appendChild(ns)}curStyles.forEach(function(s){if(!keepIds[s.id]&&!s.hasAttribute("data-stx-incoming")&&!s.hasAttribute("data-crosswind"))s.remove()});incoming.forEach(function(s){s.removeAttribute("data-stx-incoming")});var docBase;try{docBase=new URL(url,location.href).href}catch(e){docBase=location.href};var linkSel='link[rel="stylesheet"],link[rel="preconnect"]';var curLinks={};document.querySelectorAll("head "+linkSel).forEach(function(l){var h=l.getAttribute("href");if(h)curLinks[new URL(h,location.href).href]=1});doc.querySelectorAll("head "+linkSel).forEach(function(l){var href=l.getAttribute("href");if(!href)return;var abs=new URL(href,docBase).href;if(curLinks[abs])return;curLinks[abs]=1;var nl=document.createElement("link");Array.from(l.attributes).forEach(function(a){nl.setAttribute(a.name,a.value)});document.head.appendChild(nl)});var newBody=doc.querySelector("body");var isLayoutChange=false;var declaredLayout=pendingLayoutDecl;pendingLayoutDecl=null;if(newBody){var newMeta=doc.querySelector('meta[name="stx-layout"]');var curMeta=document.querySelector('meta[name="stx-layout"]');var curLayout=curMeta?curMeta.getAttribute("content"):"";var newLayout=declaredLayout&&declaredLayout.layout?declaredLayout.layout:newMeta?newMeta.getAttribute("content"):"";var curGroup=getCurrentLayoutGroup();var newGroup=declaredLayout&&declaredLayout.group?declaredLayout.group:getDocLayoutGroup(doc,newLayout);isLayoutChange=curGroup!==newGroup||!!(curLayout&&newLayout&&curLayout!==newLayout)};var incomingSetupName=newBody?newBody.getAttribute("data-stx")||"":"";var routedBodyScripts=[];var routedBodyScriptId=0;function prepareRoutedBodyScripts(root){if(!root)return;root.querySelectorAll("script").forEach(function(s){var text=s.textContent||"";if(s.hasAttribute("src")){s.remove();return};var type=(s.getAttribute("type")||"").trim().toLowerCase();var executable=!type||type==="text/javascript"||type==="application/javascript"||type==="module";if(!executable||!text.trim())return;if(isSignalsRuntimeScript(s,text)||text.indexOf("__stxRouter")!==-1){s.remove();return};var slot="document-"+ ++routedBodyScriptId;var setupName=generatedSetupName(text);if(setupName)incomingSetupName=setupName;routedBodyScripts.push({text,runAlways:true,slot,setupName,run:s.getAttribute("data-stx-run")||""});s.textContent="";s.setAttribute("type","application/stx-pending");s.setAttribute("data-stx-route-script",slot)})}prepareRoutedBodyScripts(isLayoutChange?newBody:newContent);if(isLayoutChange&&newBody){log("[router] full body swap for layout change");var bodyHTML=newBody.innerHTML;document.body.innerHTML=bodyHTML;Array.from(newBody.attributes).forEach(function(attr){document.body.setAttribute(attr.name,attr.value)});var oldMeta=document.querySelector('meta[name="stx-layout"]');var freshMeta=doc.querySelector('meta[name="stx-layout"]');if(oldMeta&&freshMeta)oldMeta.setAttribute("content",freshMeta.getAttribute("content")||"");else if(freshMeta){var m=document.createElement("meta");m.name="stx-layout";m.content=freshMeta.getAttribute("content")||"";document.head.appendChild(m)};var oldGroupMeta=document.querySelector('meta[name="stx-layout-group"]');var freshGroupMeta=doc.querySelector('meta[name="stx-layout-group"]');if(oldGroupMeta&&freshGroupMeta)oldGroupMeta.setAttribute("content",freshGroupMeta.getAttribute("content")||"");else if(freshGroupMeta){var gm=document.createElement("meta");gm.name="stx-layout-group";gm.content=freshGroupMeta.getAttribute("content")||"";document.head.appendChild(gm)}currentContent=document.querySelector(containerSel)||document.querySelector("main")||document.body}else{var attrMap={};Array.prototype.forEach.call(newContent.attributes,function(a){attrMap[a.name]=a.value});setContainerAttrs(currentContent,attrMap);var cleanHTML=newContent.innerHTML;currentContent.innerHTML=cleanHTML;if(incomingSetupName)document.body.setAttribute("data-stx",incomingSetupName)};var loadedSrcs={};document.querySelectorAll("head script[src]").forEach(function(s){loadedSrcs[s.src]=1});var extPromises=[];doc.querySelectorAll("head script[src]").forEach(function(s){var src=new URL(s.getAttribute("src"),docBase).href;if(loadedSrcs[src])return;loadedSrcs[src]=1;extPromises.push(new Promise(function(resolve,reject){var ns=document.createElement("script");ns.src=src;ns.onload=resolve;ns.onerror=reject;document.head.appendChild(ns)}))});document.querySelectorAll("script[data-stx-page]").forEach(function(s){s.remove()});var scripts=routedBodyScripts.slice();function addScript(text,runAlways,slot){scripts.push({text,runAlways:!!runAlways,slot:slot||""})}if(isLayoutChange){doc.querySelectorAll("head script").forEach(function(s){var text=s.textContent||"";if(s.hasAttribute("src"))return;if(!text.trim())return;if(isSignalsRuntimeScript(s,text))return;if(text.indexOf("__stx_setup_")!==-1)addScript(text,true)})}else{var seenSetups={};scripts.forEach(function(entry){var t=entry.text;if(t.indexOf("__stx_setup_")!==-1)seenSetups[t.substring(0,80)]=1});doc.querySelectorAll("script").forEach(function(s){var text=s.textContent||"";if(s.hasAttribute("src"))return;if(!text.trim())return;if(isSignalsRuntimeScript(s,text))return;if(text.indexOf("__stxRouter")!==-1)return;if(newContent.contains(s))return;if(text.indexOf("__stx_setup_")===-1&&!s.hasAttribute("data-stx-scoped")&&!s.hasAttribute("data-stx-page")&&!s.hasAttribute("data-stx-route-params"))return;var key=text.substring(0,80);if(seenSetups[key])return;seenSetups[key]=1;addScript(text,true)})}if(incomingSetupName){scripts.sort(function(a,b){var aPage=(a.setupName||generatedSetupName(a.text))===incomingSetupName?1:0;var bPage=(b.setupName||generatedSetupName(b.text))===incomingSetupName?1:0;return aPage-bPage})}if(pushState!==false)writeHistory(pushState,url+(hash||""));updateNav(url);updateActiveLinks();if(o.scrollToTop&&!hash)window.scrollTo({top:0,behavior:"instant"});else if(hash){var el=document.querySelector(hash);if(el)el.scrollIntoView({behavior:"smooth"})};var newTitle=doc.querySelector("title");if(newTitle)document.title=newTitle.textContent;if(doc.documentElement&&doc.documentElement.lang){document.documentElement.lang=doc.documentElement.lang}if(doc.documentElement){var curRoot=document.documentElement,incRoot=doc.documentElement;var tokens=function(el,attr){var v=el.getAttribute(attr);return v?v.split(/\s+/).filter(Boolean):[]};var prevCls=tokens(curRoot,"data-stx-html-class"),nextCls=tokens(incRoot,"data-stx-html-class");prevCls.forEach(function(c){if(nextCls.indexOf(c)===-1)curRoot.classList.remove(c)});nextCls.forEach(function(c){curRoot.classList.add(c)});if(nextCls.length)curRoot.setAttribute("data-stx-html-class",nextCls.join(" "));else curRoot.removeAttribute("data-stx-html-class");var prevNames=tokens(curRoot,"data-stx-html-attrs"),nextNames=tokens(incRoot,"data-stx-html-attrs");prevNames.forEach(function(n){if(nextNames.indexOf(n)===-1)curRoot.removeAttribute(n)});nextNames.forEach(function(n){var v=incRoot.getAttribute(n);if(v!==null)curRoot.setAttribute(n,v)});if(nextNames.length)curRoot.setAttribute("data-stx-html-attrs",nextNames.join(" "));else curRoot.removeAttribute("data-stx-html-attrs")}window.dispatchEvent(new CustomEvent("stx:navigate",{detail:{url}}));function execScripts(){scripts.forEach(function(entry){var text=typeof entry==="string"?entry:entry.text;var runAlways=typeof entry==="string"?false:entry.runAlways;var h=hashScript(text);var isSetup=text.indexOf("__stx_setup_")!==-1;var hasImport=hasStaticImport(text);if(!runAlways&&!isSetup&&executedScriptHashes[h])return;executedScriptHashes[h]=1;var ns=document.createElement("script");if(hasImport){ns.type="module"};var alreadyScoped=runsAlways(typeof entry==="string"?"":entry.run,text);ns.textContent=hasImport||alreadyScoped?text:"{"+text+"}";ns.setAttribute("data-stx-page","");var placeholder=entry.slot?document.querySelector('script[data-stx-route-script="'+entry.slot+'"]'):null;if(placeholder&&placeholder.parentNode){ns.setAttribute("data-stx-positioned","");placeholder.parentNode.replaceChild(ns,placeholder)}else{document.body.appendChild(ns)}});window.dispatchEvent(new Event("stx:load"))}if(extPromises.length>0){Promise.all(extPromises).then(execScripts).catch(execScripts)}else{execScripts()}}return new Promise(function(resolve,reject){function completeSwap(){try{doSwap();resolve(true)}catch(err){reject(err)}}if(runViewTransition(completeSwap)){}else{currentContent.style.transition="opacity 0.12s ease-out";currentContent.style.opacity="0";setTimeout(function(){completeSwap();currentContent.style.opacity="1";setTimeout(function(){currentContent.style.transition=""},150)},120)}})};function isRouterExcluded(link){if(!link)return true;var href=link.getAttribute("href");if(!href)return true;if(href.startsWith("http")||href.startsWith("#")||href.startsWith("mailto:")||href.startsWith("tel:")||href.startsWith("javascript:"))return true;if(link.target==="_blank")return true;if(link.hasAttribute("data-stx-no-router")||link.hasAttribute("data-no-router")||link.hasAttribute("download"))return true;return false};var ownedRoutes=null;(function(){var raw=o.ownedRoutes;if(!raw||!raw.length)return;var compiled=[];for(var i=0;i<raw.length;i++){try{compiled.push(new RegExp(raw[i]))}catch(e){}}if(compiled.length)ownedRoutes=compiled})();function routerOwns(pathname){if(!ownedRoutes)return true;for(var i=0;i<ownedRoutes.length;i++){if(ownedRoutes[i].test(pathname))return true}return false};function shouldIntercept(link){if(isRouterExcluded(link))return false;var href=link.getAttribute("href");if(href.startsWith("?"))return true;if(href===location.pathname)return false;if(!getContainer())return false;var path=href;var q=path.indexOf("?");if(q!==-1)path=path.slice(0,q);var h=path.indexOf("#");if(h!==-1)path=path.slice(0,h);if(path.charAt(0)==="/"&&!routerOwns(path)){log("[router] not a known route, leaving to the browser:",href);return false}return true}document.addEventListener("click",function(e){if(e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.button!==0)return;if(!e.target||!e.target.closest)return;var link=e.target.closest("[data-stx-link]");if(link&&isRouterExcluded(link)){log("[router] excluded:",link.getAttribute("href"));return}if(!link&&o.interceptAllLinks){var anchor=e.target.closest("a[href]");if(anchor&&shouldIntercept(anchor))link=anchor}if(!link){return};var href=link.getAttribute("href");log("[router] click intercepted:",href,"container:",!!getContainer(),"defaultPrevented:",e.defaultPrevented);e.preventDefault();e.stopPropagation();log("[router] navigating to:",href);navigate(withCurrentLocale(href))},true);function formAttrOf(form,submitter,submitterAttr,formAttr){var v=submitter&&submitter.getAttribute?submitter.getAttribute(submitterAttr):null;return v!==null&&v!==undefined?v:form.getAttribute(formAttr)};function formTargetUrl(form,submitter){return formAttrOf(form,submitter,"formaction","action")||location.pathname+location.search};function formMethodOf(form,submitter){return String(formAttrOf(form,submitter,"formmethod","method")||"get").toLowerCase()};function formExcluded(form,submitter){if(!form||form.tagName!=="FORM")return true;if(form.hasAttribute("data-stx-no-router")||form.hasAttribute("data-no-router"))return true;if(form.target&&form.target!=="_self")return true;try{if(new URL(formTargetUrl(form,submitter),location.href).origin!==location.origin)return true}catch(e){return true}return false};function setFormPending(form,on){if(on){form.classList.add("stx-submitting");form.setAttribute("aria-busy","true")}else{form.classList.remove("stx-submitting");form.removeAttribute("aria-busy")}};function submitForm(form,submitter){var method=formMethodOf(form,submitter);var action=formTargetUrl(form,submitter);var fd=new FormData(form);if(submitter&&submitter.name)fd.append(submitter.name,submitter.value||"");if(method==="get"){var qs=new URLSearchParams;fd.forEach(function(v,k){if(typeof v==="string")qs.append(k,v)});var gu=new URL(action,location.href);gu.search=qs.toString();return navigate(gu.pathname+gu.search+gu.hash)}setFormPending(form,true);form.dispatchEvent(new CustomEvent("stx:form-submit",{bubbles:true,detail:{action,method}}));var enctype=String(formAttrOf(form,submitter,"formenctype","enctype")||"").toLowerCase();var body=enctype.indexOf("multipart")===0?fd:new URLSearchParams(fd);var wantsFragment=shouldUseFragmentResponse();return fetch(action,{method:method.toUpperCase(),body,headers:wantsFragment?{"X-STX-Router":"true",Accept:"text/html"}:{Accept:"text/html"},credentials:"same-origin"}).then(function(r){if(r.redirected&&r.url){var rd=new URL(r.url,location.href);if(rd.origin!==location.origin){location.href=r.url;return}return navigate(rd.pathname+rd.search+rd.hash)}return r.text().then(function(html){var isFrag=wantsFragment&&r.headers.get("X-STX-Fragment")==="true";pendingContainerAttrs=isFrag?r.headers.get("X-STX-Container-Attrs")||"":"";pendingLayoutDecl=isFrag?null:{layout:r.headers.get("X-STX-Layout")||"",group:r.headers.get("X-STX-Layout-Group")||""};var marked=isFrag?fragmentMarker(r.headers.get("X-STX-Runtime")||"")+html:html;return Promise.resolve(swap(marked,cacheKey(action),"replace","")).then(function(){applyTitle(r.headers.get("X-STX-Title")||"")})})}).catch(function(err){console.error("[router] form submit failed:",err);form.dispatchEvent(new CustomEvent("stx:form-error",{bubbles:true,detail:{error:err,action}}))}).finally(function(){setFormPending(form,false)})}document.addEventListener("submit",function(e){if(e.defaultPrevented)return;var form=e.target;if(!form||form.tagName!=="FORM")return;if(!form.hasAttribute("data-stx-form")&&!form.hasAttribute("data-stx-link")&&!o.interceptForms)return;var submitter=e.submitter||null;if(formExcluded(form,submitter))return;if(!getContainer())return;e.preventDefault();try{submitForm(form,submitter)}catch(err){console.error("[router] form submit failed:",err);setFormPending(form,false);form.dispatchEvent(new CustomEvent("stx:form-error",{bubbles:true,detail:{error:err}}))}});window.addEventListener("popstate",function(){navigate(location.pathname+location.search+location.hash,false)});if(o.prefetch){document.addEventListener("mouseover",function(e){if(!e.target||!e.target.closest)return;var link=e.target.closest("[data-stx-link]");if(isRouterExcluded(link))return;var href=withCurrentLocale(link.getAttribute("href"));var key=cacheKey(href);if(cache[key]||prefetching[key])return;prefetching[key]=true;var wantsFragment=shouldUseFragmentResponse();fetch(href,{headers:wantsFragment?{"X-STX-Router":"true",Accept:"text/html"}:{Accept:"text/html"}}).then(function(r){if(r.redirected)return null;var isFrag=wantsFragment&&r.headers.get("X-STX-Fragment")==="true";var pLayout=r.headers.get("X-STX-Layout")||"";var pGroup=r.headers.get("X-STX-Layout-Group")||"";var pTitle=r.headers.get("X-STX-Title")||"";var pRuntime=r.headers.get("X-STX-Runtime")||"";return r.text().then(function(html){return{html:isFrag?fragmentMarker(pRuntime)+html:html,layout:pLayout,layoutGroup:pGroup,title:pTitle}})}).then(function(result){if(result&&o.cache)setCache(key,result.html,result.layout,result.layoutGroup,result.title)}).catch(function(){}).finally(function(){delete prefetching[key]})},true)};function updateNav(url){document.querySelectorAll("nav a[href], #mobileNav a[href], [data-stx-nav] a[href]").forEach(function(a){var href=a.getAttribute("href");if(!href||href.startsWith("#")||href.startsWith("http"))return;var isActive=href===url||href==="/"&&url==="/";if(a.hasAttribute("data-stx-link")){var ac=a.getAttribute("data-stx-active-class")||"active";if(isActive)ac.split(" ").forEach(function(cls){if(cls)a.classList.add(cls)});else ac.split(" ").forEach(function(cls){if(cls)a.classList.remove(cls)})}})};function updateActiveLinks(){var links=document.querySelectorAll("[data-stx-link]");var cur=location.pathname;links.forEach(function(link){var href=link.getAttribute("to")||link.getAttribute("href")||"";var ac=link.getAttribute("active-class")||link.getAttribute("data-stx-active-class")||"active";var eac=link.getAttribute("exact-active-class")||link.getAttribute("data-stx-exact-active-class")||"exact-active";ac.split(" ").forEach(function(cls){if(cls)link.classList.remove(cls)});eac.split(" ").forEach(function(cls){if(cls)link.classList.remove(cls)});var isExact=cur===href;var isActive=href!=="/"?cur.startsWith(href):cur==="/";if(isExact)eac.split(" ").forEach(function(cls){if(cls)link.classList.add(cls)});if(isActive)ac.split(" ").forEach(function(cls){if(cls)link.classList.add(cls)})})};function injectStyles(){if(!document.getElementById("stx-r-css")){var s=document.createElement("style");s.id="stx-r-css";var sanitize=function(v){return String(v).replace(/[;{}()"'\\<>\n\r\t]/g,"")};var pc=sanitize(o.progressColor);var ph=sanitize(o.progressHeight);var css=".stx-navigating{cursor:wait}.stx-navigating a,.stx-navigating button{pointer-events:none}#stx-router-progress{position:fixed;top:0;left:0;right:0;height:"+ph+";background:"+pc+";box-shadow:0 0 8px "+pc+",0 0 4px "+pc+";transform:scaleX(0);transform-origin:left;transition:transform .18s ease-out,opacity .26s ease;opacity:0;pointer-events:none;z-index:999999}";if(o.viewTransitions&&"startViewTransition"in document){var dur=(o.viewTransitionDuration||220)+"ms";var ease=o.viewTransitionEasing||"cubic-bezier(0.16, 1, 0.3, 1)";css+="::view-transition-old(root),::view-transition-new(root){animation-duration:"+dur+";animation-timing-function:"+ease+"}";css+="::view-transition-old(root){animation-name:stx-r-fade-out}::view-transition-new(root){animation-name:stx-r-fade-in}";css+="@keyframes stx-r-fade-out{from{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(-4px)}}";css+="@keyframes stx-r-fade-in{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}";css+="@media (prefers-reduced-motion: reduce){::view-transition-old(root),::view-transition-new(root){animation-duration:0s;animation-name:none}}"}s.textContent=css;document.head.appendChild(s)}if(o.progress&&!document.getElementById("stx-router-progress")){var el=document.createElement("div");el.id="stx-router-progress";el.setAttribute("role","progressbar");el.setAttribute("aria-hidden","true");document.documentElement.appendChild(el);progEl=el}else if(o.progress){progEl=document.getElementById("stx-router-progress")}};function injectViewTransitionCSS(){if(document.getElementById("stx-view-transitions"))return;var s=document.createElement("style");s.id="stx-view-transitions";s.textContent="::view-transition-group(root){animation:none}::view-transition-old(root){animation:none}::view-transition-new(root){animation:none}main,#app-content,[data-stx-content]{view-transition-name:stx-content}::view-transition-old(stx-content){animation:stx-fade-out .15s ease-out both}::view-transition-new(stx-content){animation:stx-fade-in .15s ease-in .1s both}@keyframes stx-fade-out{from{opacity:1}to{opacity:0}}@keyframes stx-fade-in{from{opacity:0}to{opacity:1}}::view-transition{background:transparent}::view-transition-group(stx-content){background:inherit;overflow:hidden}";(document.head||document.documentElement).appendChild(s)};var router={navigate,navigateTo:navigate,prefetch:function(url){var key=cacheKey(url);if(!cache[key]){var wantsFragment=shouldUseFragmentResponse();fetch(url,{headers:wantsFragment?{"X-STX-Router":"true"}:{Accept:"text/html"}}).then(function(r){var isFrag=wantsFragment&&r.headers.get("X-STX-Fragment")==="true";var pLayout=r.headers.get("X-STX-Layout")||"";var pGroup=r.headers.get("X-STX-Layout-Group")||"";var pTitle=r.headers.get("X-STX-Title")||"";var pRuntime=r.headers.get("X-STX-Runtime")||"";return r.text().then(function(html){return{html:isFrag?fragmentMarker(pRuntime)+html:html,layout:pLayout,layoutGroup:pGroup,title:pTitle}})}).then(function(result){setCache(key,result.html,result.layout,result.layoutGroup,result.title)}).catch(function(){})}},refresh:function(){return navigate(location.pathname+location.search+location.hash,"replace",true)},invalidate:function(url){evictCache(cacheKey(url||location.pathname+location.search))},clearCache:function(){for(var k in cache)delete cache[k];for(var lk in layoutCache)delete layoutCache[lk];for(var gk in layoutGroupCache)delete layoutGroupCache[gk];cacheOrder.length=0},cache,swap,updateNav};router.__rev=ROUTER_REV;window.__stxRouter=router;window.stxRouter=router;if(window.stx)window.stx.router=router;function init(){injectStyles();injectViewTransitionCSS();updateActiveLinks();updateNav(location.pathname)}if(document.readyState==="loading")document.addEventListener("DOMContentLoaded",init);else init()})();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
if(!window.__stx_early_mounts)window.__stx_early_mounts=[];if(!window.__stx_early_destroys)window.__stx_early_destroys=[];if(!window.onMount)window.onMount=function(fn){window.__stx_early_mounts.push(fn)};if(!window.onDestroy)window.onDestroy=function(fn){window.__stx_early_destroys.push(fn)};(function(){var cloakStyle=document.getElementById?document.getElementById("stx-cloak-style"):null;if(!cloakStyle){cloakStyle=document.createElement("style");cloakStyle.id="stx-cloak-style";cloakStyle.textContent="[x-cloak] { display: none !important; }";document.head.appendChild(cloakStyle)};let activeEffect=null;const effectStack=[];const pendingEffects=new Set;let isBatching=false;var __stxDevtoolsTracking=false;var __stxDevtoolsStats={signalSets:0,effectRuns:0};var __stxEffectId=0;var __stxDevtoolsIfTrace=[];var __stxDevtoolsQueries=[];var __stxDevtoolsMutations=[];var __stxSignalId=0;function __stxDevtoolsNow(){return typeof performance!=="undefined"&&performance.now?performance.now():Date.now()};function __stxDevtoolsRecordIf(rec){if(!__stxDevtoolsTracking)return;__stxDevtoolsIfTrace.push(rec);if(__stxDevtoolsIfTrace.length>100)__stxDevtoolsIfTrace.shift()};function __stxDevtoolsRecordQuery(rec){if(!__stxDevtoolsTracking)return;__stxDevtoolsQueries.push(rec);if(__stxDevtoolsQueries.length>100)__stxDevtoolsQueries.shift()};function __stxShort(v){try{if(typeof v==="string")return v.length>40?v.slice(0,40)+"…":v;if(v===null||typeof v!=="object")return v;var s=JSON.stringify(v);return s.length>60?s.slice(0,60)+"…":s}catch(e){return"[unserializable]"}}async function __stxHttpError(response){var body=null;var text="";try{text=await response.text()}catch(e){text=""}if(text){try{body=JSON.parse(text)}catch(e){body=text}};var detail="";if(body&&typeof body==="object")detail=body.message||body.error||"";else if(typeof body==="string")detail=body.slice(0,200);var message="HTTP "+response.status;if(response.statusText)message+=": "+response.statusText;if(detail)message+=" - "+detail;var err=new Error(message);err.status=response.status;err.statusText=response.statusText;err.data=body;err.response=response;return err};var __stxFetchHooks={onRequest:null,onResponse:null,onResponseError:null};function configureFetch(cfg){cfg=cfg||{};__stxFetchHooks.onRequest=typeof cfg.onRequest==="function"?cfg.onRequest:null;__stxFetchHooks.onResponse=typeof cfg.onResponse==="function"?cfg.onResponse:null;__stxFetchHooks.onResponseError=typeof cfg.onResponseError==="function"?cfg.onResponseError:null};function __stxHeaders(h){return(typeof h==="function"?h():h)||{}}async function __stxFetch(source,url,opts){var t0=__stxDevtoolsNow();opts=opts||{};if(__stxFetchHooks.onRequest){opts.headers=__stxHeaders(opts.headers);var reqCtx={source,url:String(url),options:opts};await __stxFetchHooks.onRequest(reqCtx);if(reqCtx.url)url=reqCtx.url;opts=reqCtx.options||opts};var method=opts&&opts.method||"GET";function __stxIsResponse(v){return!!v&&typeof v.ok==="boolean"}try{var r=await fetch(url,opts);__stxDevtoolsRecordQuery({source,url:String(url),method,status:r.status,ok:r.ok,ms:__stxDevtoolsNow()-t0});if(__stxFetchHooks.onResponse){await __stxFetchHooks.onResponse({source,url:String(url),options:opts,response:r})}if(!r.ok&&__stxFetchHooks.onResponseError){var recovered=await __stxFetchHooks.onResponseError({source,url:String(url),options:opts,response:r,error:null});if(__stxIsResponse(recovered)){__stxDevtoolsRecordQuery({source,url:String(url),method,status:recovered.status,ok:recovered.ok,retried:true,ms:__stxDevtoolsNow()-t0});return recovered}}return r}catch(e){__stxDevtoolsRecordQuery({source,url:String(url),method,status:0,ok:false,error:String(e&&e.message||e),ms:__stxDevtoolsNow()-t0});if(__stxFetchHooks.onResponseError){var recoveredErr=await __stxFetchHooks.onResponseError({source,url:String(url),options:opts,response:null,error:e});if(__stxIsResponse(recoveredErr)){__stxDevtoolsRecordQuery({source,url:String(url),method,status:recoveredErr.status,ok:recoveredErr.ok,retried:true,ms:__stxDevtoolsNow()-t0});return recoveredErr}}throw e}};let activeDisposers=null;const targetMap=new WeakMap;const globalHelpers={fmt(n){if(n==null)return"0";n=Number(n);if(n>=1e6)return(n/1e6).toFixed(1)+"M";if(n>=1000)return(n/1000).toFixed(1)+"K";return String(n)},formatDate(date,format="YYYY-MM-DD"){if(!date)return"";const d=date instanceof Date?date:new Date(date);if(isNaN(d.getTime()))return"";const year=d.getFullYear();const month=String(d.getMonth()+1).padStart(2,"0");const day=String(d.getDate()).padStart(2,"0");const hours=String(d.getHours()).padStart(2,"0");const minutes=String(d.getMinutes()).padStart(2,"0");const seconds=String(d.getSeconds()).padStart(2,"0");return format.replace("YYYY",year).replace("MM",month).replace("DD",day).replace("HH",hours).replace("mm",minutes).replace("ss",seconds)},timeAgo(date){if(!date)return"";const d=date instanceof Date?date:new Date(date);const now=new Date;const seconds=Math.floor((now-d)/1000);if(seconds<60)return"just now";if(seconds<3600)return Math.floor(seconds/60)+"m ago";if(seconds<86400)return Math.floor(seconds/3600)+"h ago";if(seconds<604800)return Math.floor(seconds/86400)+"d ago";return d.toLocaleDateString()},debounce(fn,delay=300){let timeout;return function(...args){clearTimeout(timeout);timeout=setTimeout(()=>fn.apply(this,args),delay)}},throttle(fn,limit=300){let inThrottle;return function(...args){if(!inThrottle){fn.apply(this,args);inThrottle=true;setTimeout(()=>inThrottle=false,limit)}}},capitalize(str){if(!str)return"";return str.charAt(0).toUpperCase()+str.slice(1)},truncate(str,length=50,suffix="..."){if(!str||str.length<=length)return str||"";return str.slice(0,length)+suffix},json(value,indent=2){try{return JSON.stringify(value,null,indent)}catch(e){return String(value)}},pluralize(count,singular,plural){const p=plural||singular+"s";return count===1?singular:p},clamp(value,min,max){return Math.min(Math.max(value,min),max)},currency(value,symbol="$",decimals=2){if(value==null)return symbol+"0.00";return symbol+Number(value).toFixed(decimals).replace(/\B(?=(\d{3})+(?!\d))/g,",")},percent(value,decimals=0){if(value==null)return"0%";return(Number(value)*100).toFixed(decimals)+"%"}};function track(target,key){if(!activeEffect)return;let depsMap=targetMap.get(target);if(!depsMap)targetMap.set(target,depsMap=new Map);let deps=depsMap.get(key);if(!deps)depsMap.set(key,deps=new Set);deps.add(activeEffect)};function trigger(target,key){const depsMap=targetMap.get(target);if(!depsMap)return;const deps=depsMap.get(key);if(deps){if(isBatching){deps.forEach((effect)=>pendingEffects.add(effect))}else{deps.forEach((effect)=>effect())}}};function createAutoUnwrapProxy(scope,preserveSignal){return new Proxy(scope,{get(target,prop){const val=target[prop];if(val&&typeof val==="function"&&(val._isSignal||val._isDerived)){if(val._isStxLoopItem)return val();if(preserveSignal&&preserveSignal(prop,val))return val;return val()}if(val&&typeof val==="object"&&val._isStxStore){return createAutoUnwrapProxy(val,preserveSignal)}return val},set(target,prop,value){const cur=target[prop];if(cur&&typeof cur==="function"&&cur._isSignal&&typeof cur.set==="function"){cur.set(value);return true}target[prop]=value;return true}})};function createModelWriteProxy(target){return new Proxy(target,{get(t,prop){var val=t[prop];if(val&&typeof val==="function"&&(val._isSignal||val._isDerived)){var inner=val();return inner&&typeof inner==="object"?createModelWriteProxy(inner):inner}if(val&&typeof val==="object")return createModelWriteProxy(val);return val},set(t,prop,value){var cur=t[prop];if(cur&&typeof cur==="function"&&cur._isSignal&&typeof cur.set==="function"){cur.set(value);return true}t[prop]=value;return true}})};function parsePipeExpression(expr,scope){let pipeIndex=-1;let inString=false;let stringChar="";let depth=0;for(let i=0;i<expr.length;i++){const char=expr[i];const prevChar=i>0?expr[i-1]:"";const nextChar=i<expr.length-1?expr[i+1]:"";if((char==='"'||char==="'"||char==="`")&&prevChar!=="\\"){if(!inString){inString=true;stringChar=char}else if(char===stringChar){inString=false}continue}if(inString)continue;if(char==="("||char==="["||char==="{")depth++;if(char===")"||char==="]"||char==="}")depth--;if(depth!==0)continue;if(char==="|"){if(nextChar==="|"){i++;continue}if(prevChar==="|")continue;if(prevChar==="?")continue;pipeIndex=i;break}}if(pipeIndex===-1)return null;const valueExpr=expr.slice(0,pipeIndex).trim();const pipeChain=expr.slice(pipeIndex+1).trim();const pipes=[];let currentPipe="";inString=false;stringChar="";depth=0;for(let i=0;i<pipeChain.length;i++){const char=pipeChain[i];const prevChar=i>0?pipeChain[i-1]:"";const nextChar=i<pipeChain.length-1?pipeChain[i+1]:"";if((char==='"'||char==="'"||char==="`")&&prevChar!=="\\"){if(!inString){inString=true;stringChar=char}else if(char===stringChar){inString=false}currentPipe+=char;continue}if(inString){currentPipe+=char;continue}if(char==="("||char==="["||char==="{")depth++;if(char===")"||char==="]"||char==="}")depth--;if(depth===0&&char==="|"&&nextChar!=="|"&&prevChar!=="|"&&prevChar!=="?"){if(currentPipe.trim()){const parts=currentPipe.trim().split(":");pipes.push({name:parts[0].trim(),args:parts.slice(1).map((a)=>a.trim())})}currentPipe=""}else{currentPipe+=char}}if(currentPipe.trim()){const parts=currentPipe.trim().split(":");pipes.push({name:parts[0].trim(),args:parts.slice(1).map((a)=>a.trim())})}if(pipes.length===0)return null;return{valueExpr,pipes}};function executePipeExpression(valueExpr,pipes,scope){let value;try{const fn=new Function(...Object.keys(scope),"return "+valueExpr);value=fn(...Object.values(scope))}catch(e){if(!(e instanceof ReferenceError)&&!(e instanceof TypeError))console.warn("[STX] Pipe base expression error:",valueExpr,e);return""}for(const pipe of pipes){const filterFn=scope[pipe.name]||globalHelpers[pipe.name];if(typeof filterFn==="function"){try{const parsedArgs=pipe.args.map((arg)=>{if(/^-?\d+(\.\d+)?$/.test(arg))return Number(arg);if(/^['"].*['"]$/.test(arg))return arg.slice(1,-1);try{const fn=new Function(...Object.keys(scope),"return "+arg);return fn(...Object.values(scope))}catch(e){return arg}});value=filterFn(value,...parsedArgs)}catch(e){if(!(e instanceof ReferenceError)&&!(e instanceof TypeError))console.warn("[STX] Pipe filter error:",pipe.name,e)}}else{console.warn("[STX] Unknown pipe/filter:",pipe.name)}}return value};function state(initialValue){let value=initialValue;const subscribers=new Set;const effects=new Set;const signal=()=>{if(activeEffect){effects.add(activeEffect)}return value};signal.set=(newValue)=>{if(!Object.is(newValue,value)){if(__stxDevtoolsTracking){signal._setCount++;__stxDevtoolsStats.signalSets++;__stxDevtoolsMutations.push({sid:signal._stxSignalId,prev:__stxShort(value),next:__stxShort(newValue)});if(__stxDevtoolsMutations.length>100)__stxDevtoolsMutations.shift()};const prev=value;value=newValue;subscribers.forEach((cb)=>cb(value,prev));if(isBatching){effects.forEach((effect)=>pendingEffects.add(effect))}else{effects.forEach((effect)=>effect())}}};signal.update=(fn)=>signal.set(fn(value));signal.subscribe=(cb)=>{subscribers.add(cb);return()=>subscribers.delete(cb)};signal._isSignal=true;signal._effects=effects;signal._setCount=0;signal._stxSignalId=++__stxSignalId;Object.defineProperty(signal,"value",{get(){return signal()},set(v){signal.set(v)},configurable:true});return signal};function derived(compute){let cached;let isDirty=true;const effects=new Set;const markDirty=()=>{if(!isDirty){isDirty=true;if(isBatching){effects.forEach((e)=>pendingEffects.add(e))}else{effects.forEach((e)=>e())}}};const signal=()=>{if(activeEffect)effects.add(activeEffect);if(isDirty){const prev=activeEffect;activeEffect=markDirty;effectStack.push(markDirty);try{cached=compute()}finally{effectStack.pop();activeEffect=prev}isDirty=false}return cached};signal._isDerived=true;signal._effects=effects;Object.defineProperty(signal,"value",{get(){return signal()},configurable:true});return signal};function effect(fn,options={}){let cleanup;let isDisposed=false;const runEffect=()=>{if(isDisposed)return;if(__stxDevtoolsTracking){runEffect._runCount++;__stxDevtoolsStats.effectRuns++}if(cleanup){cleanup();cleanup=undefined};const prev=activeEffect;activeEffect=runEffect;effectStack.push(runEffect);try{var __result=fn();cleanup=typeof __result==="function"?__result:undefined}catch(e){isDisposed=true;if(e instanceof ReferenceError){}else{throw e}}finally{effectStack.pop();activeEffect=prev}};runEffect._isStxEffect=true;runEffect._stxId=++__stxEffectId;runEffect._runCount=0;if(options.immediate!==false)runEffect();const dispose=()=>{isDisposed=true;if(cleanup)cleanup()};if(activeDisposers)activeDisposers.push(dispose);return dispose};function trackEffects(fn){var parentDisposers=activeDisposers;var disposers=[];activeDisposers=disposers;try{fn()}finally{activeDisposers=parentDisposers;if(parentDisposers){disposers.forEach(function(d){parentDisposers.push(d)})}}return function disposeAll(){disposers.forEach(function(d){try{d()}catch(e){console.warn("[stx] dispose error:",e)}});disposers.length=0}};function batch(fn){if(isBatching){fn();return}isBatching=true;fn();isBatching=false;pendingEffects.forEach((e)=>e());pendingEffects.clear()};function isSignal(v){return typeof v==="function"&&v._isSignal===true};function isDerived(v){return typeof v==="function"&&v._isDerived===true};function untrack(v){return isSignal(v)||typeof v==="function"&&v._isDerived?v():v};function peek(fn){const prev=activeEffect;activeEffect=null;try{return fn()}finally{activeEffect=prev}};const mountCallbacks=[];const destroyCallbacks=[];function currentLifecycleScope(){var el=window.__STX_CURRENT_ELEMENT__;if(!el||!el.getAttribute||!window.stx||!window.stx._scopes)return null;var scopeId=el.getAttribute("data-stx-scope");return scopeId?window.stx._scopes[scopeId]||null:null};function onMount(fn){var scope=currentLifecycleScope();if(scope){scope.__mountCallbacks=scope.__mountCallbacks||[];scope.__mountCallbacks.push(fn);return}mountCallbacks.push(fn)};function onDestroy(fn){var scope=currentLifecycleScope();if(scope){scope.__destroyCallbacks=scope.__destroyCallbacks||[];scope.__destroyCallbacks.push(fn);return}destroyCallbacks.push(fn)};function runMountCallbacks(list,sink){if(!list||!list.length)return;var target=sink||destroyCallbacks;for(var i=0;i<list.length;i++){try{var cleanup=list[i]();if(typeof cleanup==="function")target.push(cleanup)}catch(e){console.error("[stx] onMount error:",e)}}};function scopeDestroySink(scopeVars){if(!scopeVars)return destroyCallbacks;scopeVars.__destroyCallbacks=scopeVars.__destroyCallbacks||[];return scopeVars.__destroyCallbacks}if(window.__stx_early_mounts){window.__stx_early_mounts.forEach(function(fn){mountCallbacks.push(fn)});window.__stx_early_mounts=null}if(window.__stx_early_destroys){window.__stx_early_destroys.forEach(function(fn){destroyCallbacks.push(fn)});window.__stx_early_destroys=null};function useWebSocket(url,options){options=options||{};var ws=state(null);var status=state("CLOSED");var lastMessage=state(null);var error=state(null);var reconnectAttempts=0;var maxReconnects=options.reconnect===false?0:options.maxReconnects||10;var reconnectDelay=options.reconnectDelay||1000;var reconnectTimer=null;var manualClose=false;var listeners={};function connect(){if(ws()&&ws().readyState<=1)return;manualClose=false;status.set("CONNECTING");error.set(null);var socket=new WebSocket(url);socket.onopen=function(){status.set("OPEN");reconnectAttempts=0;if(options.onOpen)options.onOpen(socket)};socket.onmessage=function(event){var data=event.data;try{data=JSON.parse(data)}catch(e){}lastMessage.set(data);if(options.onMessage)options.onMessage(data,event);if(data&&data.channel&&data.event){var key=data.channel+":"+data.event;var fns=listeners[key];if(fns){for(var i=0;i<fns.length;i++){fns[i](data.data)}}}};socket.onerror=function(event){error.set(event);if(options.onError)options.onError(event)};socket.onclose=function(event){status.set("CLOSED");ws.set(null);if(options.onClose)options.onClose(event);if(!manualClose&&reconnectAttempts<maxReconnects){reconnectAttempts++;var delay=reconnectDelay*Math.min(reconnectAttempts,5);reconnectTimer=setTimeout(connect,delay)}};ws.set(socket)};function send(data){var socket=ws();if(socket&&socket.readyState===WebSocket.OPEN){socket.send(typeof data==="string"?data:JSON.stringify(data))}};function close(){manualClose=true;if(reconnectTimer){clearTimeout(reconnectTimer);reconnectTimer=null};var socket=ws();if(socket)socket.close()};function subscribe(channel){send({type:"subscribe",channel});return{listen:function(event,handler){var key=channel+":"+event;if(!listeners[key])listeners[key]=[];listeners[key].push(handler);return this},leave:function(){send({type:"unsubscribe",channel});var prefix=channel+":";for(var key in listeners){if(key.indexOf(prefix)===0){delete listeners[key]}}}}}if(options.immediate!==false){connect()}onDestroy(function(){close();listeners={}});return{ws,status,lastMessage,error,send,close,connect,subscribe}};function useFetch(urlOrFn,options={}){const data=state(options.initialData??null);const immediate=options.immediate!==false;const loading=state(immediate);const isFetching=state(immediate);const error=state(null);if(options.suspense)registerSuspense(loading,error);let __stxAbort=null;const fetchData=async(runOptions)=>{const background=!!(runOptions&&runOptions.background);if(__stxAbort)__stxAbort.abort();__stxAbort=typeof AbortController!=="undefined"?new AbortController:null;const __signal=__stxAbort?__stxAbort.signal:undefined;if(!background)loading.set(true);isFetching.set(true);if(!background)error.set(null);try{const url=typeof urlOrFn==="function"?urlOrFn():urlOrFn;if(!url){if(!background)loading.set(false);isFetching.set(false);return};const fetchOptions={method:options.method||"GET",headers:{"Content-Type":"application/json",...__stxHeaders(options.headers)},signal:__signal};if(options.body){fetchOptions.body=typeof options.body==="string"?options.body:JSON.stringify(options.body)};const response=await __stxFetch("useFetch",url,fetchOptions);if(__signal&&__signal.aborted)return;if(!response.ok)throw await __stxHttpError(response);const result=await response.json();if(__signal&&__signal.aborted)return;const transformed=options.transform?options.transform(result):result;data.set(transformed);if(background)error.set(null)}catch(e){if(e&&e.name==="AbortError")return;console.error("[STX] useFetch error:",e);error.set(e instanceof Error?e:new Error(String(e)));if(options.onError)options.onError(e)}finally{if(!__signal||!__signal.aborted){if(!background)loading.set(false);isFetching.set(false)}}};if(typeof urlOrFn==="function"){var firstUrlRun=true;effect(()=>{const url=urlOrFn();if(!url)return;if(firstUrlRun){firstUrlRun=false;if(!immediate)return}fetchData()})}else if(immediate){onMount(fetchData)}if(typeof onDestroy==="function")onDestroy(function(){if(__stxAbort)__stxAbort.abort()});return{data,loading,isFetching,error,refetch:fetchData,get isLoading(){return loading()},get hasError(){return!!error()},get isEmpty(){return!loading()&&!data()}}};function useRef(name){var ownerScope=currentLifecycleScope()||componentScope;return{get current(){return ownerScope.$refs&&ownerScope.$refs[name]||null},get value(){return this.current}}};function navigate(url,options){var opts=options&&typeof options==="object"?options:{reload:!!options};var replace=!!opts.replace;var reload=!!(opts.reload||opts.forceReload);if(!reload&&window.stxRouter&&typeof window.stxRouter.navigate==="function"){window.stxRouter.navigate(url,{replace});return}if(replace)window.location.replace(url);else window.location.href=url};function refresh(){if(window.stxRouter&&typeof window.stxRouter.refresh==="function")return window.stxRouter.refresh();window.location.reload();return Promise.resolve(false)};function invalidateRoute(url){if(window.stxRouter&&typeof window.stxRouter.invalidate==="function")window.stxRouter.invalidate(url)};function goBack(){window.history.back()};function goForward(){window.history.forward()};var _routeParams=state({});function setRouteParams(params){var nextParams=params||{};_routeParams.set(nextParams);window.__stx_rp=nextParams;if(window.stx)window.stx._rp=nextParams}window.addEventListener("stx:navigate",function(e){var nextParams=e.detail&&Object.prototype.hasOwnProperty.call(e.detail,"params")?e.detail.params:{};setRouteParams(nextParams)});if(window.stx&&window.stx._rp||window.__stx_rp){_routeParams.set(window.stx?._rp||window.__stx_rp)};function useRoute(){return{get path(){return window.location.pathname},get fullPath(){return window.location.pathname+window.location.search+window.location.hash},get hash(){return window.location.hash},get query(){var params={};new URLSearchParams(window.location.search).forEach(function(v,k){params[k]=v});return params},get params(){return _routeParams()}}};function useRouteParams(){return _routeParams()};function useRouteParam(name,fallback){var value=_routeParams()[name];return value===undefined?fallback:value};function useSearchParams(){var params=state(Object.fromEntries(new URLSearchParams(window.location.search)));var syncFromUrl=function(){params.set(Object.fromEntries(new URLSearchParams(window.location.search)))};window.addEventListener("popstate",syncFromUrl);window.addEventListener("stx:navigate",syncFromUrl);var own=function(key){var current=params();return Object.prototype.hasOwnProperty.call(current,key)};var commit=function(url,options){var replace=!!(options&&typeof options==="object"&&options.replace);if(replace)window.history.replaceState({},"",url);else window.history.pushState({},"",url);syncFromUrl()};return{data:params,get:function(key){return own(key)?params()[key]:undefined},has:own,set:function(key,value,options){var url=new URL(window.location.href);url.searchParams.set(key,value);commit(url,options)},delete:function(key,options){var url=new URL(window.location.href);url.searchParams["delete"](key);commit(url,options)},setAll:function(obj,options){var url=new URL(window.location.href);Object.keys(obj).forEach(function(k){url.searchParams.set(k,obj[k])});commit(url,options)}}};var _queryCache={};var _queryInflight={};var __stxQueryInstance=0;function suspenseRegistry(){if(typeof window==="undefined")return[];return window.__stx_suspense_registry||(window.__stx_suspense_registry=[])};function registerSuspense(loading,error){var el=typeof window!=="undefined"&&window.__STX_CURRENT_ELEMENT__||null;suspenseRegistry().push({el,loading,error})};function useQuery(url,options){options=options||{};var staleTime=options.staleTime||0;var cacheTime=options.cacheTime||300000;var cacheKey=options.cacheKey||(typeof url==="function"?null:url);var data=state(options.initialData||null);var loading=state(true);var isFetching=state(true);var error=state(null);var isStale=state(false);if(options.suspense)registerSuspense(loading,error);var __stxAbort=null;var __instanceId=++__stxQueryInstance;var __joined=null;var fetchData=async function(runOptions){var background=!!(runOptions&&runOptions.background);var resolvedUrl=typeof url==="function"?url():url;if(!resolvedUrl){if(!background)loading.set(false);isFetching.set(false);return};var key=cacheKey||resolvedUrl;var cached=_queryCache[key];if(cached&&Date.now()-cached.timestamp<staleTime){data.set(cached.data);if(!background)loading.set(false);isFetching.set(false);isStale.set(false);if(options.onSuccess)options.onSuccess(cached.data);return}if(cached){data.set(cached.data);isStale.set(true)};var shared=_queryInflight[key];if(shared&&shared.owner!==__instanceId){shared.refs++;__joined=shared;if(!background)loading.set(true);isFetching.set(true);if(!background)error.set(null);try{var joinedResult=await shared.promise;var joinedTransformed=options.transform?options.transform(joinedResult):joinedResult;data.set(joinedTransformed);if(background)error.set(null);isStale.set(false);if(options.onSuccess)options.onSuccess(joinedTransformed)}catch(e){if(e&&e.name==="AbortError")return;error.set(e.message||"Query failed");if(options.onError)options.onError(e)}finally{shared.refs--;if(__joined===shared)__joined=null;if(!background)loading.set(false);isFetching.set(false)}return}if(__stxAbort){if(__joined&&__joined.refs>1)__joined.refs--;else __stxAbort.abort()}__joined=null;__stxAbort=typeof AbortController!=="undefined"?new AbortController:null;var __signal=__stxAbort?__stxAbort.signal:undefined;if(!background)loading.set(true);isFetching.set(true);if(!background)error.set(null);try{var fetchOpts={method:"GET",headers:{"Content-Type":"application/json",...__stxHeaders(options.headers)},signal:__signal};var netPromise=async function(){var response=await __stxFetch("useQuery",resolvedUrl,fetchOpts);if(!response.ok)throw await __stxHttpError(response);return await response.json()}();var entry={owner:__instanceId,refs:1,controller:__stxAbort,promise:netPromise};_queryInflight[key]=entry;__joined=entry;var releaseEntry=function(){if(_queryInflight[key]===entry)delete _queryInflight[key]};netPromise.then(releaseEntry,releaseEntry);var result=await netPromise;if(__signal&&__signal.aborted)return;var transformed=options.transform?options.transform(result):result;data.set(transformed);if(background)error.set(null);isStale.set(false);_queryCache[key]={data:transformed,timestamp:Date.now()};if(options.onSuccess)options.onSuccess(transformed);setTimeout(function(){delete _queryCache[key]},cacheTime)}catch(e){if(e&&e.name==="AbortError")return;error.set(e.message||"Query failed");if(options.onError)options.onError(e)}finally{if(!__signal||!__signal.aborted){if(!background)loading.set(false);isFetching.set(false)}}};if(options.immediate!==false){onMount(fetchData)};var backgroundRun={background:true};if(options.refetchOnFocus){var onVisibility=function(){if(!document.hidden)fetchData(backgroundRun)};document.addEventListener("visibilitychange",onVisibility);onDestroy(function(){document.removeEventListener("visibilitychange",onVisibility)})}if(options.refetchInterval){var intervalId=setInterval(function(){if(typeof document!=="undefined"&&document.hidden)return;var en=options.enabled;if(typeof en==="function"?!en():en===false)return;var p=fetchData(backgroundRun);if(options.stopOnError&&p&&typeof p.then==="function"){p.then(function(){if(error())clearInterval(intervalId)})}},options.refetchInterval);onDestroy(function(){clearInterval(intervalId)})}onDestroy(function(){if(__stxAbort)__stxAbort.abort()});return{data,loading,isFetching,error,isStale,refetch:fetchData,invalidate:function(runOptions){var key=cacheKey||(typeof url==="function"?url():url);delete _queryCache[key];return fetchData(runOptions)}}};function useMutation(url,options){options=options||{};var data=state(null);var loading=state(false);var error=state(null);var mutate=async function(body){loading.set(true);error.set(null);var previousData=data();if(options.optimisticData){var optimistic=typeof options.optimisticData==="function"?options.optimisticData(body):options.optimisticData;data.set(optimistic)}try{var resolvedUrl=typeof url==="function"?url():url;var fetchOpts={method:options.method||"POST",headers:{"Content-Type":"application/json",...__stxHeaders(options.headers)},body:typeof body==="string"?body:JSON.stringify(body)};var response=await __stxFetch("useMutation",resolvedUrl,fetchOpts);if(!response.ok)throw await __stxHttpError(response);var result=await response.json();var transformed=options.transform?options.transform(result):result;data.set(transformed);if(options.onSuccess)options.onSuccess(transformed);if(options.invalidateQueries){options.invalidateQueries.forEach(function(key){delete _queryCache[key]})}return transformed}catch(e){error.set(e.message||"Mutation failed");if(options.optimisticData)data.set(previousData);if(options.onError)options.onError(e);throw e}finally{loading.set(false)}};return{data,loading,error,mutate,reset:function(){data.set(null);error.set(null);loading.set(false)}}};function useOptimistic(base,reducer){var readBase=typeof base==="function"?base:function(){return base};var pending=state([]);var optimistic=derived(function(){return pending().reduce(function(acc,entry){return reducer(acc,entry.action)},readBase())});var primed=false;effect(function(){readBase();if(!primed){primed=true;return}if(peek(function(){return pending().length}))pending.set([])});function addOptimistic(action,settleWhen){var entry={action};pending.set(pending().concat([entry]));var settle=function(){var next=pending().filter(function(e){return e!==entry});if(next.length!==pending().length)pending.set(next)};if(settleWhen&&typeof settleWhen.then==="function"){Promise.resolve(settleWhen).then(settle,settle)}return settle}return[optimistic,addOptimistic]};let componentScope={$refs:{}};let currentElement=null;function findElementScope(el){let current=el;while(current&¤t!==document){if(current.__stx_scope){return current.__stx_scope}if(current.hasAttribute&¤t.hasAttribute("data-stx-scope")){const scopeId=current.getAttribute("data-stx-scope");if(window.stx._scopes&&window.stx._scopes[scopeId]){return window.stx._scopes[scopeId]}}current=current.parentElement||current.parentNode}return null};function toValue(expr,el,enableAutoUnwrap=true,extraScope={}){try{if(/^__[A-Z_]+__$/.test(expr.trim())){return expr};const elementScope=findElementScope(el||currentElement);const baseScope={...globalHelpers,...componentScope,...elementScope||{},...extraScope};const pipeResult=parsePipeExpression(expr,baseScope);if(pipeResult){const unwrapScope=enableAutoUnwrap?createAutoUnwrapProxy(baseScope,function(prop){if(typeof prop!=="string")return false;return expressionCallsSignal(expr,prop)||expressionUsesSignalApi(expr,prop)}):baseScope;const piped=executePipeExpression(pipeResult.valueExpr,pipeResult.pipes,unwrapScope);return piped&&typeof piped==="function"&&(piped._isSignal||piped._isDerived)?piped():piped};const scope=enableAutoUnwrap?createAutoUnwrapProxy(baseScope,function(prop){if(typeof prop!=="string")return false;return expressionCallsSignal(expr,prop)||expressionUsesSignalApi(expr,prop)}):baseScope;const fn=new Function(...Object.keys(baseScope),"return "+expr);const result=fn(...Object.values(scope));return result&&typeof result==="function"&&(result._isSignal||result._isDerived)?result():result}catch(e){if(!(e instanceof ReferenceError)&&!(e instanceof TypeError))console.warn("[STX] Expression error:",expr,e);return""}};function parseEventShorthand(expr,scope){const trimmed=expr.trim();if(/^!\w+$/.test(trimmed)){const varName=trimmed.slice(1);const signal=scope[varName];if(signal&&signal._isSignal){return()=>signal.set(!signal())}return null}if(/^\w+\+\+$/.test(trimmed)){const varName=trimmed.slice(0,-2);const signal=scope[varName];if(signal&&signal._isSignal){return()=>signal.update((n)=>n+1)}return null}if(/^\w+--$/.test(trimmed)){const varName=trimmed.slice(0,-2);const signal=scope[varName];if(signal&&signal._isSignal){return()=>signal.update((n)=>n-1)}return null};const assignMatch=trimmed.match(/^(\w+)\s*([+\-*\/])=\s*(.+)$/);if(assignMatch){const[,varName,op,valueExpr]=assignMatch;const signal=scope[varName];if(signal&&signal._isSignal){return($event)=>{const addValue=toValue(valueExpr,null,true,{...scope,$event});signal.update((n)=>{switch(op){case"+":return n+addValue;case"-":return n-addValue;case"*":return n*addValue;case"/":return n/addValue;default:return n}})}}return null};const simpleAssignMatch=trimmed.match(/^(\w+)\s*=\s*(.+)$/);if(simpleAssignMatch&&!trimmed.includes("==")&&!trimmed.includes("=>")){const[,varName,valueExpr]=simpleAssignMatch;const signal=scope[varName];if(signal&&signal._isSignal){return($event)=>{const newValue=toValue(valueExpr,null,true,{...scope,$event});signal.set(newValue)}}return null};const bareIdMatch=trimmed.match(/^([a-zA-Z_$][\w$]*)$/);if(bareIdMatch){const fn=scope[bareIdMatch[1]];if(typeof fn==="function"&&!fn._isSignal){return($event)=>fn($event)}}return null};function expressionUsesSignalApi(expression,name){var escapedName=name.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&");return expressionUsesSignalMethod(expression,name)||expressionUsesSignalValue(expression,name)};function expressionUsesSignalMethod(expression,name){var escapedName=name.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&");return new RegExp("(?:^|[^\\w$])"+escapedName+"\\s*\\.\\s*(?:set|update|subscribe)\\s*\\(").test(expression)};function expressionUsesSignalValue(expression,name){var escapedName=name.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&");return new RegExp("(?:^|[^\\w$])"+escapedName+"\\s*\\.\\s*value\\b").test(expression)};function expressionCallsSignal(expression,name){var escapedName=name.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&");return new RegExp("(?:^|[^\\w$])"+escapedName+"\\s*\\(").test(expression)};function createExpressionAutoUnwrapProxy(scope,expression){return createAutoUnwrapProxy(scope,function(prop,signal){if(typeof prop!=="string")return false;if(expressionCallsSignal(expression,prop)||expressionUsesSignalMethod(expression,prop))return true;if(!expressionUsesSignalValue(expression,prop))return false;try{var currentValue=signal();return!(currentValue&&typeof currentValue==="object"&&Object.prototype.hasOwnProperty.call(currentValue,"value"))}catch(e){return true}})};function executeHandler(expr,event,el){try{if(/^__[A-Z_]+__$/.test(expr.trim())){return};const elementScope=findElementScope(el||currentElement);const scope={...globalHelpers,...componentScope,...elementScope||{}};const shorthandFn=parseEventShorthand(expr,scope);if(shorthandFn){shorthandFn(event);return};const handlerScope={};Object.keys(scope).forEach(function(k){const v=scope[k];handlerScope[k]=v&&typeof v==="function"&&v._isStxLoopItem?v():v});const fn=new Function(...Object.keys(handlerScope),"$event",expr);fn(...Object.values(handlerScope),event)}catch(e){console.warn("[STX] Handler error:",expr,e)}};function deferHydration(el,trigger,scope){if(el.__stx_hydration_scheduled)return;el.__stx_hydration_scheduled=true;var run=function(){if(el.__stx_hydrated)return;el.__stx_hydrated=true;el.__stx_hydration_cancel=null;el.removeAttribute("stx-hydrate");var sid=el.getAttribute&&el.getAttribute("data-stx-scope");var finishHydrate=function(){var effectiveScope=scope;if(sid){var reg=window.stx._scopes?window.stx._scopes[sid]:null;if(reg)effectiveScope=Object.assign({},scope||{},reg)}Array.from(el.children).forEach(function(child){processElement(child,effectiveScope)});processAttributesOnly(el,effectiveScope);var sv=sid&&window.stx._scopes?window.stx._scopes[sid]:null;if(sv&&sv.__mountCallbacks&&!sv.__mounted){sv.__mounted=true;runMountCallbacks(sv.__mountCallbacks,scopeDestroySink(sv))}window.dispatchEvent(new CustomEvent("stx:hydrated",{detail:{el,trigger}}))};var islandScript=sid?document.querySelector('script[data-stx-island="'+sid+'"]'):null;if(islandScript&&!islandScript.__stx_ran){islandScript.__stx_ran=true;var chunkSrc=islandScript.getAttribute&&islandScript.getAttribute("data-stx-src");if(chunkSrc){var s=document.createElement("script");s.src=chunkSrc;var integ=islandScript.getAttribute("data-stx-integrity");if(integ)s.integrity=integ;s.onload=finishHydrate;s.onerror=function(){console.error("[stx] island chunk load failed:",sid,chunkSrc);window.dispatchEvent(new CustomEvent("stx:island-error",{detail:{el,scopeId:sid,src:chunkSrc}}));finishHydrate()};document.head.appendChild(s);return}try{new Function(islandScript.textContent)()}catch(e){console.error("[stx] island setup error:",sid,e)}}finishHydrate()};if(trigger==="idle"){if(typeof requestIdleCallback==="function"){var idleId=requestIdleCallback(run,{timeout:2000});el.__stx_hydration_cancel=function(){if(typeof cancelIdleCallback==="function")cancelIdleCallback(idleId)}}else{var idleTimer=setTimeout(run,200);el.__stx_hydration_cancel=function(){clearTimeout(idleTimer)}}}else if(trigger==="visible"){if(typeof IntersectionObserver==="function"){var io=new IntersectionObserver(function(entries){entries.forEach(function(e){if(e.isIntersecting){io.disconnect();run()}})},{rootMargin:"50px"});io.observe(el);el.__stx_hydration_cancel=function(){io.disconnect()}}else{run()}}else if(trigger==="interaction"){var events=["mouseenter","click","focusin","touchstart"];var handler=function(){events.forEach(function(ev){el.removeEventListener(ev,handler)});run()};events.forEach(function(ev){el.addEventListener(ev,handler,{once:true,passive:true})});el.__stx_hydration_cancel=function(){events.forEach(function(ev){el.removeEventListener(ev,handler)})}}else if(trigger&&trigger.indexOf("media:")===0){var query=trigger.slice(6);var mql=window.matchMedia(query);if(mql.matches)run();else{var mqHandler=function(e){if(e.matches){mql.removeEventListener("change",mqHandler);run()}};mql.addEventListener("change",mqHandler);el.__stx_hydration_cancel=function(){mql.removeEventListener("change",mqHandler)}}}else{run()}};function processAttributesOnly(el,scope){el.__stx_hydrated=true;processElement(el,scope)};function isForDirectiveExpression(expr){return typeof expr==="string"&&/^\s*\(?\s*\w+(?:\s*,\s*\w+)?\s*\)?\s+(?:in|of)\s+.+\s*$/.test(expr)};function getElementAttributes(el){if(!el||!el.attributes)return[];return Array.from(el.attributes).map(function(attr){if(Array.isArray(attr))return{name:attr[0],value:attr[1]};return attr})};function getModelBinding(el){if(!el||!el.attributes)return null;var prefixes=["x-model",":model","@model"];var attrs=getElementAttributes(el);for(var i=0;i<attrs.length;i++){var name=attrs[i]&&attrs[i].name;if(!name)continue;for(var j=0;j<prefixes.length;j++){if(name===prefixes[j]||name.indexOf(prefixes[j]+".")===0)return{name,expression:attrs[i].value}}}return null};function readDeferredParentComponentProps(el){var serialized=el.getAttribute("data-stx-deferred-parent-bindings");if(!serialized)return{};try{var parsed=JSON.parse(serialized);return parsed&&typeof parsed==="object"?parsed:{}}catch(e){return{}}};function preserveDeferredParentComponentProps(el){var names=(el.getAttribute("data-stx-parent-bindings")||"").split(/\s+/).filter(Boolean);if(!names.length)return;var deferred=readDeferredParentComponentProps(el);names.forEach(function(name){var sourceName=":"+name;if(el.hasAttribute(sourceName))deferred[name]=el.getAttribute(sourceName)});if(Object.keys(deferred).length)el.setAttribute("data-stx-deferred-parent-bindings",JSON.stringify(deferred))};function hasPendingLoopBoundary(el){var loopBoundary=el;while(loopBoundary&&loopBoundary!==document){var loopExpression=loopBoundary.getAttribute&&(loopBoundary.getAttribute("@for")||loopBoundary.getAttribute(":for")||loopBoundary.getAttribute("x-for"));if(loopExpression&&isForDirectiveExpression(loopExpression))return true;loopBoundary=loopBoundary.parentElement||loopBoundary.parentNode}return false};function hasPendingAncestorLoopBoundary(el){var loopBoundary=el&&(el.parentElement||el.parentNode);while(loopBoundary&&loopBoundary!==document){var loopExpression=loopBoundary.getAttribute&&(loopBoundary.getAttribute("@for")||loopBoundary.getAttribute(":for")||loopBoundary.getAttribute("x-for"));if(loopExpression&&isForDirectiveExpression(loopExpression))return true;loopBoundary=loopBoundary.parentElement||loopBoundary.parentNode}return false};function syncComponentPropSignal(el,name,value){if(!el||!el.getAttribute||value===undefined)return;var scopeId=el.getAttribute("data-stx-scope");var scopeVars=scopeId&&window.stx._scopes&&window.stx._scopes[scopeId];var camelName=name.replace(/-([a-z0-9])/g,function(_,character){return character.toUpperCase()});var propSignals=el.__stx_reactive_prop_signals;var propSignal=propSignals&&(propSignals[name]||propSignals[camelName]);if(!propSignal&&scopeVars)propSignal=scopeVars[name]||scopeVars[camelName];if(!propSignal||!propSignal._isSignal||typeof propSignal.set!=="function")return;var directValues=el.__stx_direct_prop_values||(el.__stx_direct_prop_values={});var directValue={raw:el.hasAttribute(name)?el.getAttribute(name):null,value};directValues[name]=directValue;directValues[camelName]=directValue;if(!Object.is(peek(function(){return propSignal()}),value))propSignal.set(value)};function bindParentComponentProps(el,callerScope){if(!el||!el.getAttribute||el.__stx_parent_props_bound)return;var names=(el.getAttribute("data-stx-parent-bindings")||"").split(/\s+/).filter(Boolean);if(!names.length)return;if(hasPendingLoopBoundary(el)){preserveDeferredParentComponentProps(el);return};var deferred=readDeferredParentComponentProps(el);var bindings=names.map(function(name){var sourceName=":"+name;var expression=el.hasAttribute(sourceName)?el.getAttribute(sourceName):deferred[name];return typeof expression==="string"?{name,sourceName,expression}:null}).filter(Boolean);if(!bindings.length)return;el.__stx_parent_props_bound=true;var scope={...globalHelpers,...callerScope};bindings.forEach(function(binding){var name=binding.name;var sourceName=binding.sourceName;var expression=binding.expression;effect(function(){var value;try{var unwrapScope=createAutoUnwrapProxy(scope,function(prop){if(typeof prop!=="string")return false;return expressionCallsSignal(expression,prop)||expressionUsesSignalApi(expression,prop)});var fn=new Function("__scope__","with(__scope__) { return ("+expression+") }");value=fn(unwrapScope);if(value&&typeof value==="function"&&(value._isSignal||value._isDerived))value=value()}catch(e){if(!(e instanceof ReferenceError)&&!(e instanceof TypeError))console.warn("[STX] Parent component prop error:",expression,e);value=undefined}if(value===false||value===null||value===undefined){el.removeAttribute(name)}else if(value===true){el.setAttribute(name,"")}else{var serialized=value;if(typeof value==="object"){try{serialized=JSON.stringify(value)}catch(e){serialized=String(value)}}el.setAttribute(name,serialized)}syncComponentPropSignal(el,name,value)});el.removeAttribute(sourceName);delete deferred[name]});if(Object.keys(deferred).length)el.setAttribute("data-stx-deferred-parent-bindings",JSON.stringify(deferred));else el.removeAttribute("data-stx-deferred-parent-bindings")};function resolveComponentCallerScope(el,pageScope){var resolved={...pageScope};var ancestors=[];var current=el&&(el.parentElement||el.parentNode);while(current&¤t!==document){if(current.getAttribute&¤t.hasAttribute("data-stx-scope"))ancestors.push(current.getAttribute("data-stx-scope"));current=current.parentElement||current.parentNode}ancestors.reverse().forEach(function(scopeId){var ancestorScope=window.stx._scopes&&window.stx._scopes[scopeId];if(ancestorScope)Object.assign(resolved,ancestorScope)});return resolved};function preserveConditionalComponentScopes(root,callerScope){if(!root||!root.querySelectorAll)return;var scopeEls=[];if(root.matches&&root.matches("[data-stx-scope]"))scopeEls.push(root);root.querySelectorAll("[data-stx-scope]").forEach(function(scopeEl){scopeEls.push(scopeEl)});scopeEls.forEach(function(scopeEl){if(scopeEl.__stx_parent_props_bound)return;var current=scopeEl;while(current&¤t!==root){if(current.hasAttribute&&(current.hasAttribute("@for")||current.hasAttribute(":for")||current.hasAttribute("x-for"))){preserveDeferredParentComponentProps(scopeEl);return}current=current.parentElement||current.parentNode}scopeEl.__stx_parent_scope=resolveComponentCallerScope(scopeEl,callerScope);bindParentComponentProps(scopeEl,scopeEl.__stx_parent_scope)})};function findConditionalComponentSetupSiblings(root){if(!root||!root.hasAttribute||!root.hasAttribute("data-stx-scope"))return[];var scopeId=root.getAttribute("data-stx-scope");var templateScopeId=root.getAttribute("data-stx-template-scope")||scopeId;if(!scopeId)return[];var scripts=[];var sibling=root.nextSibling;while(sibling){var next=sibling.nextSibling;if(sibling.nodeType===Node.TEXT_NODE&&!(sibling.textContent||"").trim()){sibling=next;continue}if(sibling.nodeType===Node.COMMENT_NODE){sibling=next;continue}if(sibling.nodeType===Node.ELEMENT_NODE&&sibling.tagName==="STYLE"&&sibling.hasAttribute("data-stx-vendor")){sibling=next;continue}if(sibling.nodeType===Node.ELEMENT_NODE&&sibling.tagName==="SCRIPT"&&sibling.hasAttribute("data-stx-scoped")&&((sibling.textContent||"").indexOf(scopeId)!==-1||templateScopeId&&(sibling.textContent||"").indexOf(templateScopeId)!==-1)){scripts.push(sibling);sibling=next;continue}break}return scripts};function processElement(el,scope=componentScope){if(el.nodeType===Node.ELEMENT_NODE&&el.hasAttribute&&el.hasAttribute("stx-hydrate")&&!el.__stx_hydrated){var trigger=el.getAttribute("stx-hydrate")||"idle";deferHydration(el,trigger,scope);return}if(el.nodeType===Node.ELEMENT_NODE&&el.hasAttribute&&el.hasAttribute("data-stx-scope")&&hasPendingAncestorLoopBoundary(el)){preserveDeferredParentComponentProps(el);return}if(el.nodeType===Node.ELEMENT_NODE&&el.tagName==="BUTTON"&&el.hasAttribute&&el.hasAttribute("@click")){}if(el.nodeType===Node.ELEMENT_NODE&&el.hasAttribute){if(el.hasAttribute("x-data")||el.hasAttribute("data-stx-xdata")||el.__stx_scope){var xdScope=el.__stx_scope||(findElementScope(el)||{});if(xdScope&&Object.keys(xdScope).length>0){scope={...scope,...xdScope}}}if(el.hasAttribute("data-stx-memo")){var memoExpr=el.getAttribute("data-stx-memo");try{var memoScope={...globalHelpers,...scope,...findElementScope(el)||{}};var memoFn=new Function(...Object.keys(memoScope),"return "+memoExpr);var memoVals=JSON.stringify(memoFn(...Object.values(memoScope)));if(el.__stx_memo_prev===memoVals){return}el.__stx_memo_prev=memoVals}catch(e){}}}if(el.nodeType===Node.TEXT_NODE){const text=el.textContent==null?"":String(el.textContent);if(text&&text.includes("{{")){const parts=text.split(/(\{\{[\s\S]+?\}\})/g);if(parts.length>1){const fragment=document.createDocumentFragment();const parentEl=el.parentNode;const capturedScope={...globalHelpers,...scope,...findElementScope(parentEl)||{}};parts.forEach((part)=>{const match=part.match(/^\{\{\s*([\s\S]+?)\s*\}\}$/);if(match){const expr=match[1];if(/^__[A-Z_]+__$/.test(expr.trim())){fragment.appendChild(document.createTextNode(part));return};const isTextOnlyParent=parentEl&&(parentEl.tagName==="OPTION"||parentEl.tagName==="TITLE"||parentEl.tagName==="TEXTAREA");const bindingNode=isTextOnlyParent?document.createTextNode(""):document.createElement("span");fragment.appendChild(bindingNode);effect(()=>{try{const pipeResult=parsePipeExpression(expr,capturedScope);if(pipeResult){const unwrapScope=createExpressionAutoUnwrapProxy(capturedScope,expr);bindingNode.textContent=executePipeExpression(pipeResult.valueExpr,pipeResult.pipes,unwrapScope)}else{const unwrapScope=createExpressionAutoUnwrapProxy(capturedScope,expr);const fn=new Function(...Object.keys(capturedScope),"return "+expr);bindingNode.textContent=fn(...Object.values(unwrapScope))}}catch(e){try{const fn=new Function(...Object.keys(capturedScope),"return "+expr);bindingNode.textContent=fn(...Object.values(capturedScope))}catch(e2){if(!(e2 instanceof ReferenceError)&&!(e2 instanceof TypeError))console.warn("[STX] Expression error:",expr,e2);bindingNode.textContent=""}}})}else if(part){fragment.appendChild(document.createTextNode(part))}});el.replaceWith(fragment)}}return}if(el.nodeType!==Node.ELEMENT_NODE)return;if(el.hasAttribute("data-stx-suspense")&&!el.__stx_suspense_bound){bindSuspense(el,scope);return};var hasColonForLoop=el.hasAttribute(":for")&&isForDirectiveExpression(el.getAttribute(":for"));if(el.hasAttribute("@for")||hasColonForLoop||el.hasAttribute("x-for")){var forAttr=hasColonForLoop?":for":el.hasAttribute("x-for")?"x-for":"@for";bindFor(el,scope,forAttr);return}if(el.__stx_chain_member&&!el.__stx_chain_active)return;if(!el.__stx_chain_member){var orphanElse=getElseAttrInfo(el);if(orphanElse){console.warn("[STX] "+orphanElse.name+" has no matching preceding x-if/:if/@if sibling; rendering as a plain element.");el.removeAttribute(orphanElse.name)}}if(el.hasAttribute("@if")||el.hasAttribute(":if")||el.hasAttribute("x-if")){var ifAttr=el.hasAttribute(":if")?":if":el.hasAttribute("x-if")?"x-if":"@if";var ifChain=findIfChain(el,ifAttr);if(ifChain.length>1)bindIfChain(ifChain,scope);else bindIf(el,scope,ifAttr);return}if(el.hasAttribute("@show")||el.hasAttribute(":show")||el.hasAttribute("x-show")){var showAttr=el.hasAttribute(":show")?":show":el.hasAttribute("x-show")?"x-show":"@show";bindShow(el,el.getAttribute(showAttr),scope,showAttr)};var modelBinding=getModelBinding(el);if(modelBinding){bindModel(el,modelBinding.expression,scope,modelBinding.name)};const attrCapturedScope={...globalHelpers,...scope,...findElementScope(el)||{}};const maybeUnwrapSignal=(v)=>{if(v&&typeof v==="function"&&(v._isSignal||v._isDerived))return v();return v};const evalAttrExpr=(rawExpr,evaluationScope)=>{const activeScope=evaluationScope||attrCapturedScope;var expr=rawExpr.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/'/g,"'").replace(/'/g,"'");try{if(/^__[A-Z_]+__$/.test(expr.trim()))return expr;const pipeResult=parsePipeExpression(expr,activeScope);if(pipeResult){const unwrapScope=createExpressionAutoUnwrapProxy(activeScope,expr);var piped=maybeUnwrapSignal(executePipeExpression(pipeResult.valueExpr,pipeResult.pipes,unwrapScope));noteExprSuccess(expr);return piped};const unwrapScope=createExpressionAutoUnwrapProxy(activeScope,expr);const fn=new Function("__scope__","with(__scope__) { return ("+expr+") }");var value=maybeUnwrapSignal(fn(unwrapScope));noteExprSuccess(expr);return value}catch(e){try{const fn=new Function("__scope__","with(__scope__) { return ("+expr+") }");var retried=maybeUnwrapSignal(fn(activeScope));noteExprSuccess(expr);return retried}catch(e2){if(!(e2 instanceof ReferenceError)&&!(e2 instanceof TypeError))console.warn("[STX] Attribute expression error:",expr,e2);else noteExprFailure(expr,e2);return""}}};var DIRECTIVE_NAMES={class:1,style:1,text:1,html:1,show:1,model:1,if:1,ref:1};var SVG_ATTR_CASE={attributename:"attributeName",attributetype:"attributeType",basefrequency:"baseFrequency",baseprofile:"baseProfile",calcmode:"calcMode",clippathunits:"clipPathUnits",diffuseconstant:"diffuseConstant",edgemode:"edgeMode",filterunits:"filterUnits",glyphref:"glyphRef",gradienttransform:"gradientTransform",gradientunits:"gradientUnits",kernelmatrix:"kernelMatrix",kernelunitlength:"kernelUnitLength",keypoints:"keyPoints",keysplines:"keySplines",keytimes:"keyTimes",lengthadjust:"lengthAdjust",limitingconeangle:"limitingConeAngle",markerheight:"markerHeight",markerunits:"markerUnits",markerwidth:"markerWidth",maskcontentunits:"maskContentUnits",maskunits:"maskUnits",numoctaves:"numOctaves",pathlength:"pathLength",patterncontentunits:"patternContentUnits",patterntransform:"patternTransform",patternunits:"patternUnits",pointsatx:"pointsAtX",pointsaty:"pointsAtY",pointsatz:"pointsAtZ",preservealpha:"preserveAlpha",preserveaspectratio:"preserveAspectRatio",primitiveunits:"primitiveUnits",refx:"refX",refy:"refY",repeatcount:"repeatCount",repeatdur:"repeatDur",requiredextensions:"requiredExtensions",requiredfeatures:"requiredFeatures",specularconstant:"specularConstant",specularexponent:"specularExponent",spreadmethod:"spreadMethod",startoffset:"startOffset",stddeviation:"stdDeviation",stitchtiles:"stitchTiles",surfacescale:"surfaceScale",systemlanguage:"systemLanguage",tablevalues:"tableValues",targetx:"targetX",targety:"targetY",textlength:"textLength",viewbox:"viewBox",viewtarget:"viewTarget",xchannelselector:"xChannelSelector",ychannelselector:"yChannelSelector",zoomandpan:"zoomAndPan"};var SVG_NS="http://www.w3.org/2000/svg";var EVENT_RE=/^(click|dblclick|mousedown|mouseup|mousemove|mouseenter|mouseleave|keydown|keyup|keypress|input|change|submit|focus|blur|scroll|resize|touchstart|touchend|touchmove|contextmenu|wheel|pointerdown|pointerup|pointermove)/;var KEY_MAP={enter:"Enter",tab:"Tab",escape:"Escape",space:" ",up:"ArrowUp",down:"ArrowDown",left:"ArrowLeft",right:"ArrowRight",delete:"Delete",backspace:"Backspace"};getElementAttributes(el).forEach((attr)=>{const name=attr.name;const value=attr.value;if(!name)return;var X_HANDLED={"x-text":1,"x-html":1,"x-model":1,"x-show":1,"x-if":1,"x-for":1,"x-cloak":1,"x-ref":1,"x-data":1,"x-bind":1,"x-class":1,"x-style":1,"x-tooltip":1,"x-tooltip-position":1};if(name.startsWith("@bind:")||name.startsWith("x-bind:")||name.startsWith(":")&&!name.startsWith("::")&&!DIRECTIVE_NAMES[name.slice(1).split(".")[0]]&&!EVENT_RE.test(name.slice(1))||name.startsWith("x-")&&!X_HANDLED[name.split(".")[0]]&&!X_HANDLED[name]){let attrName=name.startsWith("@bind:")?name.slice(6):name.startsWith("x-bind:")?name.slice(7):name.startsWith("x-")?name.slice(2):name.slice(1);if(el.namespaceURI===SVG_NS&&SVG_ATTR_CASE[attrName])attrName=SVG_ATTR_CASE[attrName];var parentBindingNames=(el.getAttribute&&el.getAttribute("data-stx-parent-bindings")||"").split(/\s+/);var bindingScope=el.__stx_parent_scope&&parentBindingNames.includes(attrName)?el.__stx_parent_scope:attrCapturedScope;effect(()=>{const v=evalAttrExpr(value,bindingScope);if(attrName==="value"&&"value"in el){var controlValue=v;if(typeof v==="object"&&v!==null){try{controlValue=JSON.stringify(v)}catch(e){controlValue=String(v)}}controlValue=v===false||v===null||v===undefined?"":String(controlValue);el.__stx_bound_value=controlValue;var applyControlValue=function(){var desiredValue=el.__stx_bound_value==null?"":String(el.__stx_bound_value);el.value=desiredValue;if(desiredValue===""&&el.tagName!=="OPTION")el.removeAttribute(attrName);else if(el.getAttribute(attrName)!==desiredValue)el.setAttribute(attrName,desiredValue);if(typeof el.__stx_model_sync==="function")el.__stx_model_sync()};applyControlValue();if(el.tagName==="SELECT"&&!el.__stx_value_observer&&typeof window.MutationObserver!=="undefined"){el.__stx_value_observer=new window.MutationObserver(applyControlValue);el.__stx_value_observer.observe(el,{childList:true,subtree:true,attributes:true,attributeFilter:["value"]});el.__stx_destroy=el.__stx_destroy||[];el.__stx_destroy.push(function(){if(el.__stx_value_observer)el.__stx_value_observer.disconnect();el.__stx_value_observer=null})}return}if((attrName==="checked"||attrName==="selected"||attrName==="indeterminate")&&attrName in el){var selectedState=Boolean(v);el[attrName]=selectedState;if(attrName==="indeterminate"){el.removeAttribute(attrName)}else if(selectedState){el.setAttribute(attrName,"")}else{el.removeAttribute(attrName)}return}if(v===false||v===null||v===undefined){el.removeAttribute(attrName)}else if(v===true){el.setAttribute(attrName,"")}else{var attrValue=v;if(typeof v==="object"){try{attrValue=JSON.stringify(v)}catch(e){attrValue=String(v)}}el.setAttribute(attrName,attrValue)}});el.removeAttribute(name)}else if(name==="@class"||name===":class"||name==="x-class"){bindClass(el,value,scope);el.removeAttribute(name)}else if(name==="@style"||name===":style"||name==="x-style"){bindStyle(el,value,scope);el.removeAttribute(name)}else if(name==="@text"||name===":text"||name==="x-text"){effect(()=>{el.textContent=evalAttrExpr(value)});el.removeAttribute(name)}else if(name==="@html"||name===":html"||name==="x-html"){effect(()=>{el.innerHTML=evalAttrExpr(value)??""});el.removeAttribute(name)}else if(name==="ref"||name===":ref"||name==="x-ref"||name==="data-stx-ref"){if(scope.$refs)scope.$refs[value]=el;if(componentScope.$refs)componentScope.$refs[value]=el;var refTarget=scope&&scope[value]||componentScope[value];if(refTarget&&typeof refTarget==="function"&&refTarget._isSignal&&typeof refTarget.set==="function"){refTarget.set(el)}}else if(name.startsWith("@")||name.startsWith(":")){const parts=name.slice(1).split(".");const eventName=parts[0];const modifiers=parts.slice(1);if(["if","for","show","model","class","style","text","html","ref"].includes(eventName)){return};var eventKey="__stx_evt_"+eventName+"_"+value.substring(0,20);if(el[eventKey]){el.removeAttribute(name);return}el[eventKey]=true;const parentEventNames=(el.getAttribute&&el.getAttribute("data-stx-parent-events")||"").split(/\s+/);const isForwardedComponentEvent=!!(el.__stx_parent_scope&&parentEventNames.includes(eventName));const eventCapturedScope=isForwardedComponentEvent?{...globalHelpers,...el.__stx_parent_scope}:{...globalHelpers,...scope,...findElementScope(el)||{}};el.addEventListener(eventName,(event)=>{var componentEmits=el.__stx_component_emits;if(isForwardedComponentEvent&&event.target!==el&&componentEmits&&componentEmits[eventName])return;var handlerEvent=isForwardedComponentEvent&&event instanceof CustomEvent?event.detail:event;if(eventName==="click"){var ancestor=el;while(ancestor){if(ancestor.__stx_shown_at&&performance.now()-ancestor.__stx_shown_at<50&&!(ancestor.contains&&ancestor.contains(event.target)))return;ancestor=ancestor.parentElement}}if(modifiers.includes("self")&&event.target!==el)return;if(modifiers.includes("ctrl")&&!event.ctrlKey)return;if(modifiers.includes("alt")&&!event.altKey)return;if(modifiers.includes("shift")&&!event.shiftKey)return;if(modifiers.includes("meta")&&!event.metaKey)return;for(var mi=0;mi<modifiers.length;mi++){if(KEY_MAP[modifiers[mi]]&&event.key!==KEY_MAP[modifiers[mi]])return}if(modifiers.includes("prevent"))event.preventDefault();if(modifiers.includes("stop"))event.stopPropagation();try{if(!value||/^__[A-Z_]+__$/.test(value.trim()))return;var shorthandFn=parseEventShorthand(value,eventCapturedScope);if(shorthandFn){shorthandFn(handlerEvent);return};var hasSignals=Object.values(eventCapturedScope).some(function(v){return v&&typeof v==="function"&&v._isSignal});var isDirectAssignment=hasSignals&&/^[a-zA-Z_$]\w*\s*=/.test(value.trim())&&!value.trim().startsWith("==");if(isDirectAssignment){var getVars=Object.keys(eventCapturedScope).map(function(k){return"var "+k+' = __s["'+k+'"] && typeof __s["'+k+'"] === "function" && __s["'+k+'"]._isSignal ? __s["'+k+'"]() : __s["'+k+'"]'}).join(";");var setVars=Object.keys(eventCapturedScope).filter(function(k){var v=eventCapturedScope[k];return v&&typeof v==="function"&&v._isSignal}).map(function(k){return"if("+k+' !== __s["'+k+'"]()) __s["'+k+'"].set('+k+")"}).join(";");var body=getVars+";"+value+";"+setVars;var fn2=new Function("__s","$event",body);fn2(eventCapturedScope,handlerEvent)}else if(hasSignals){var unwrapVars=Object.keys(eventCapturedScope).map(function(k){var v=eventCapturedScope[k];if(v&&typeof v==="function"&&v._isSignal&&!v._isStxLoopItem&&(expressionCallsSignal(value,k)||expressionUsesSignalApi(value,k))){return"var "+k+' = __s["'+k+'"]'}return"var "+k+' = __s["'+k+'"] && typeof __s["'+k+'"] === "function" && __s["'+k+'"]._isSignal ? __s["'+k+'"]() : __s["'+k+'"]'}).join(";");var fn3=new Function("__s","$event",unwrapVars+";"+value);fn3(eventCapturedScope,handlerEvent)}else{var fn=new Function(...Object.keys(eventCapturedScope),"$event",value);fn(...Object.values(eventCapturedScope),handlerEvent)}}catch(e){console.warn("[STX] Handler error:",value,e)}},{capture:modifiers.includes("capture"),passive:modifiers.includes("passive"),once:modifiers.includes("once")});el.removeAttribute(name)}});if(el.tagName!=="SCRIPT"&&el.tagName!=="STYLE"){var children=Array.from(el.childNodes);children.forEach(function(child){if(child.nodeType!==Node.ELEMENT_NODE){processElement(child,scope);return}if(child.tagName==="SCRIPT")return;if(child.__stx_scope)return;if(child.hasAttribute&&child.hasAttribute("data-stx-scope"))return;processElement(child,scope)})}};function bindSuspense(el,scope){if(el.__stx_suspense_bound)return;el.__stx_suspense_bound=true;var fallbackEl=el.querySelector("[data-stx-suspense-fallback]");var errorEl=el.querySelector("[data-stx-suspense-error]");var contentEl=el.querySelector("[data-stx-suspense-content]")||el;var claimed=suspenseRegistry().filter(function(entry){return entry.el&&el.contains(entry.el)&&entry.el.closest("[data-stx-suspense]")===el});var anyLoading=derived(function(){for(var i=0;i<claimed.length;i++){if(claimed[i].loading&&claimed[i].loading())return true}return false});var firstError=derived(function(){for(var i=0;i<claimed.length;i++){var err=claimed[i].error?claimed[i].error():null;if(err)return err}return null});function setHidden(node,hidden){if(!node||node===el)return;if(hidden)node.setAttribute("hidden","");else node.removeAttribute("hidden")}effect(function(){var err=firstError();var loading=anyLoading();if(err&&errorEl){setHidden(errorEl,false);setHidden(fallbackEl,true);setHidden(contentEl,true)}else if(loading){setHidden(fallbackEl,false);setHidden(contentEl,true);setHidden(errorEl,true)}else{setHidden(contentEl,false);setHidden(fallbackEl,true);setHidden(errorEl,true)}});var contentRoot=contentEl===el?el:contentEl;Array.from(contentRoot.childNodes).forEach(function(child){processElement(child,scope)})};function bindShow(el,expr,passedScope=componentScope,attrName="@show"){if(el.__stx_show_bound)return;el.__stx_show_bound=true;const currentDisplay=el.style.display;const originalDisplay=currentDisplay&¤tDisplay!=="none"?currentDisplay:"";const capturedScope={...globalHelpers,...passedScope,...findElementScope(el)||{}};const directSignal=capturedScope[expr];if(directSignal&&directSignal._isSignal){effect(()=>{const value=directSignal();el.style.display=value?originalDisplay:"none"})}else{effect(()=>{var value;try{var unwrapScope=createExpressionAutoUnwrapProxy(capturedScope,expr);var fn=new Function(...Object.keys(capturedScope),"return "+expr);value=fn(...Object.values(unwrapScope))}catch(e1){try{var fn2=new Function(...Object.keys(capturedScope),"return "+expr);value=fn2(...Object.values(capturedScope))}catch(e2){if(!(e2 instanceof ReferenceError)&&!(e2 instanceof TypeError))console.warn("[STX] Show expression error:",expr,e2);el.style.display="none";return}};var wasHidden=el.style.display==="none";el.style.display=value?originalDisplay:"none";if(value&&wasHidden){el.__stx_shown_at=performance.now()}})}el.removeAttribute(attrName)};function bindModel(el,expr,passedScope=componentScope,attrName="@model"){if(el.__stx_model_bound)return;el.__stx_model_bound=true;const tag=el.tagName.toLowerCase();const type=el.type;const modifiers=attrName.split(".").slice(1);const capturedScope={...globalHelpers,...passedScope,...findElementScope(el)||{}};const coerceValue=(value)=>{var next=value;if(modifiers.includes("trim")&&typeof next==="string")next=next.trim();if(modifiers.includes("number")&&next!==""){var numeric=Number(next);if(!Number.isNaN(numeric))next=numeric}return next};const getValue=()=>{var direct=capturedScope[expr];if(direct&&typeof direct==="function"&&(direct._isSignal||direct._isDerived))return direct();try{var unwrapScope=createExpressionAutoUnwrapProxy(capturedScope,expr);var fn=new Function("__scope__","with(__scope__) { return ("+expr+") }");return fn(unwrapScope)}catch(e){if(!(e instanceof ReferenceError)&&!(e instanceof TypeError))console.warn("[STX] "+attrName+" get error:",expr,e);return""}};const setValue=(val)=>{try{if(capturedScope[expr]&&capturedScope[expr]._isSignal){capturedScope[expr].set(val)}else{var writeScope=createModelWriteProxy(capturedScope);var writeFn=new Function("__scope__","__v__","with(__scope__) { "+expr+" = __v__ }");writeFn(writeScope,val)}}catch(e){if(!(e instanceof ReferenceError)&&!(e instanceof TypeError))console.warn("[STX] "+attrName+" set error:",expr,e)}};if(tag==="input"&&type==="checkbox"){var syncCheckbox=()=>{var current=getValue();el.checked=Array.isArray(current)?current.some(function(item){return String(item)===String(el.value)}):Boolean(current)};el.__stx_model_sync=syncCheckbox;effect(syncCheckbox);el.addEventListener("change",()=>{var current=getValue();if(!Array.isArray(current)){setValue(el.checked);return};var checkboxValue=coerceValue(el.value);var next=current.filter(function(item){return String(item)!==String(checkboxValue)});if(el.checked)next.push(checkboxValue);setValue(next)})}else if(tag==="input"&&type==="radio"){var syncRadio=()=>{el.checked=String(getValue())===String(el.value)};el.__stx_model_sync=syncRadio;effect(syncRadio);el.addEventListener("change",()=>{if(el.checked)setValue(coerceValue(el.value))})}else if(tag==="select"){var syncSelect=()=>{var next=getValue()??"";if(el.value!==next)el.value=next};el.__stx_model_sync=syncSelect;effect(syncSelect);if(!el.__stx_model_observer&&typeof window.MutationObserver!=="undefined"){el.__stx_model_observer=new window.MutationObserver(syncSelect);el.__stx_model_observer.observe(el,{childList:true,subtree:true,attributes:true,attributeFilter:["value"]});el.__stx_destroy=el.__stx_destroy||[];el.__stx_destroy.push(function(){if(el.__stx_model_observer)el.__stx_model_observer.disconnect();el.__stx_model_observer=null})}el.addEventListener("change",()=>setValue(coerceValue(el.value)))}else{effect(()=>{var next=getValue()??"";if(el.value===next)return;var active=typeof document!=="undefined"&&document.activeElement===el;var start=null;var end=null;if(active){try{start=el.selectionStart;end=el.selectionEnd}catch(e){start=null;end=null}}el.value=next;if(active&&start!==null&&typeof el.setSelectionRange==="function"){try{el.setSelectionRange(Math.min(start,next.length),Math.min(end==null?start:end,next.length))}catch(e){}}});el.addEventListener(modifiers.includes("lazy")?"change":"input",()=>setValue(coerceValue(el.value)))}el.removeAttribute(attrName)};function bindClass(el,expr,passedScope=componentScope){const originalClasses=el.className;const capturedScope={...globalHelpers,...passedScope,...findElementScope(el)||{}};const keys=Object.keys(capturedScope);const safeKeys=keys.filter((k)=>/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(k));let fn;try{fn=new Function(...safeKeys,"return "+expr)}catch(e){console.warn("[STX] bindClass compile error:",expr,e);return}effect(()=>{for(let i=0;i<safeKeys.length;i++){const v=capturedScope[safeKeys[i]];if(v&&typeof v==="function"&&(v._isSignal||v._isDerived)){v()}};let value;try{const unwrapScope=createExpressionAutoUnwrapProxy(capturedScope,expr);value=fn.apply(null,safeKeys.map((k)=>unwrapScope[k]))}catch(e1){try{value=fn.apply(null,safeKeys.map((k)=>capturedScope[k]))}catch(e2){if(!(e2 instanceof ReferenceError)&&!(e2 instanceof TypeError))console.warn("[STX] Class expression error:",expr,e2);value=""}}if(typeof value==="object"&&value!==null&&!Array.isArray(value)){Object.keys(value).forEach((cls)=>{const tokens=cls.split(/\s+/).filter(Boolean);if(value[cls])tokens.forEach((t)=>el.classList.add(t));else tokens.forEach((t)=>el.classList.remove(t))})}else if(Array.isArray(value)){var _clsArr=[originalClasses,value.filter(Boolean).join(" ")].filter(Boolean).join(" ");if(typeof el.className==="string")el.className=_clsArr;else el.setAttribute("class",_clsArr)}else{var _clsStr=[originalClasses,value||""].filter(Boolean).join(" ");if(typeof el.className==="string")el.className=_clsStr;else el.setAttribute("class",_clsStr)}})};function bindStyle(el,expr,passedScope=componentScope){const capturedScope={...globalHelpers,...passedScope,...findElementScope(el)||{}};const evalExpr=()=>{try{const unwrapScope=createExpressionAutoUnwrapProxy(capturedScope,expr);const fn=new Function(...Object.keys(capturedScope),"return "+expr);return fn(...Object.values(unwrapScope))}catch(e1){try{const fn2=new Function(...Object.keys(capturedScope),"return "+expr);return fn2(...Object.values(capturedScope))}catch(e2){if(!(e2 instanceof ReferenceError)&&!(e2 instanceof TypeError))console.warn("[STX] Style expression error:",expr,e2);return{}}}};effect(()=>{const value=evalExpr();if(typeof value==="object"&&value!==null){Object.assign(el.style,value)}else if(typeof value==="string"){el.style.cssText=value}})};function tgDurationMs(el){try{var cs=typeof getComputedStyle==="function"?getComputedStyle(el):null;if(cs){var raw=(cs.transitionDuration||"").split(",")[0].trim();var ms=raw.indexOf("ms")>=0?parseFloat(raw):parseFloat(raw)*1000;if(ms>0)return ms}}catch(e){}return 300};function tgOnEnd(el,cb){var done=false;function finish(){if(done)return;done=true;try{el.removeEventListener("transitionend",finish)}catch(e){}cb()}try{el.addEventListener("transitionend",finish)}catch(e){}setTimeout(finish,tgDurationMs(el)+60)};function tgRaf2(fn){var raf=typeof requestAnimationFrame==="function"?requestAnimationFrame:function(f){return setTimeout(f,16)};raf(function(){raf(fn)})};function tgEnter(el,name){if(!el||el.nodeType!==1||!el.classList)return;el.classList.add(name+"-enter-from",name+"-enter-active");tgRaf2(function(){el.classList.remove(name+"-enter-from");el.classList.add(name+"-enter-to");tgOnEnd(el,function(){el.classList.remove(name+"-enter-active",name+"-enter-to")})})};function tgLeave(el,name){if(!el||el.nodeType!==1||!el.classList)return false;el.classList.add(name+"-leave-from",name+"-leave-active");tgRaf2(function(){el.classList.remove(name+"-leave-from");el.classList.add(name+"-leave-to");tgOnEnd(el,function(){if(el.parentNode)el.parentNode.removeChild(el)})});return true};function tgSnapshot(els){var m=new Map;for(var i=0;i<els.length;i++){var el=els[i];if(el&&el.nodeType===1&&el.getBoundingClientRect){try{m.set(el,el.getBoundingClientRect())}catch(e){}}}return m};function tgFlip(els,first,name){var moved=[];for(var i=0;i<els.length;i++){var el=els[i];if(!el||el.nodeType!==1||!first.has(el)||!el.getBoundingClientRect)continue;var last,f=first.get(el);try{last=el.getBoundingClientRect()}catch(e){continue};var dx=f.left-last.left,dy=f.top-last.top;if(dx||dy){el.style.transform="translate("+dx+"px,"+dy+"px)";el.style.transitionDuration="0s";moved.push(el)}}if(!moved.length)return;if(els[0]&&typeof els[0].offsetHeight==="number")els[0].offsetHeight;var raf=typeof requestAnimationFrame==="function"?requestAnimationFrame:function(f){return setTimeout(f,16)};raf(function(){moved.forEach(function(el){el.classList.add(name+"-move");el.style.transform="";el.style.transitionDuration="";tgOnEnd(el,function(){el.classList.remove(name+"-move");el.style.transform="";el.style.transitionDuration=""})})})};var __forComponentScopeCounter=0;var __forComponentSetupFactories=new Map;function forEachGroupElement(nodes,callback){function visit(node,insideTemplateContent){if(!node||node.nodeType!==Node.ELEMENT_NODE)return;callback(node,insideTemplateContent);var entersTemplateContent=node.tagName==="TEMPLATE"&&node.content;var childRoot=entersTemplateContent?node.content:node;Array.from(childRoot.childNodes||[]).forEach(function(child){visit(child,insideTemplateContent||entersTemplateContent)})}nodes.forEach(function(node){visit(node,false)})};function remapForComponentScopes(nodes){var scopeMap={};forEachGroupElement(nodes,function(node){if(!node.hasAttribute||!node.hasAttribute("data-stx-scope"))return;var oldId=node.getAttribute("data-stx-scope");if(!oldId)return;if(!scopeMap[oldId])scopeMap[oldId]=oldId+"_for_"+ ++__forComponentScopeCounter;if(!node.hasAttribute("data-stx-template-scope"))node.setAttribute("data-stx-template-scope",oldId);node.setAttribute("data-stx-scope",scopeMap[oldId])});var oldIds=Object.keys(scopeMap);if(!oldIds.length)return;forEachGroupElement(nodes,function(node){if(node.attributes){Array.from(node.attributes).forEach(function(rawAttribute){var attribute=Array.isArray(rawAttribute)?{name:rawAttribute[0],value:rawAttribute[1]}:rawAttribute;if(!attribute||attribute.name==="data-stx-scope"||attribute.name==="data-stx-template-scope")return;var value=attribute.value;if(typeof value!=="string")return;oldIds.forEach(function(oldId){if(value.indexOf(oldId)!==-1)value=value.split(oldId).join(scopeMap[oldId])});if(value!==attribute.value)node.setAttribute(attribute.name,value)})}})};function hydrateComponentScopes(nodes,callerScope){var roots=[];var scripts=[];forEachGroupElement(nodes,function(node,insideTemplateContent){if(insideTemplateContent)return;if(node.hasAttribute&&node.hasAttribute("data-stx-scope"))roots.push(node);if(node.tagName==="SCRIPT"&&node.hasAttribute("data-stx-scoped"))scripts.push(node)});if(!roots.length)return;function hasPendingStructuralAncestor(root){var cursor=root&&root.parentElement;while(cursor&&cursor.nodeType===Node.ELEMENT_NODE){if(cursor.hasAttribute("@for")||cursor.hasAttribute(":for")||cursor.hasAttribute("x-for")||cursor.hasAttribute("@if")||cursor.hasAttribute(":if")||cursor.hasAttribute("x-if")||cursor.hasAttribute("@else-if")||cursor.hasAttribute(":else-if")||cursor.hasAttribute("x-else-if")||cursor.hasAttribute("@else")||cursor.hasAttribute(":else")||cursor.hasAttribute("x-else"))return true;cursor=cursor.parentElement}return false}scripts.forEach(function(old){var text=old.textContent||"";var pendingRoots=roots.filter(function(root){var scopeId=root.getAttribute("data-stx-scope");var originalScopeId=root.getAttribute("data-stx-template-scope")||scopeId;return scopeId&&originalScopeId&&text.indexOf(originalScopeId)!==-1&&!hasPendingStructuralAncestor(root)&&!(window.stx._scopes&&window.stx._scopes[scopeId])});if(!pendingRoots.length)return;var setup=__forComponentSetupFactories.get(text);if(!setup){try{setup=new Function(text);__forComponentSetupFactories.set(text,setup)}catch(e){console.error("[stx] cloned component setup compile error:",e);return}}pendingRoots.forEach(function(root){var scopeId=root.getAttribute("data-stx-scope");var originalScopeId=root.getAttribute("data-stx-template-scope")||scopeId;if(!scopeId||!originalScopeId)return;root.setAttribute("data-stx-scope",originalScopeId);try{setup();var registeredScope=window.stx._scopes&&(window.stx._scopes[originalScopeId]||window.stx._scopes[scopeId]);if(registeredScope&&originalScopeId!==scopeId){delete window.stx._scopes[originalScopeId];window.stx._scopes[scopeId]=registeredScope}}catch(e){console.error("[stx] cloned component setup error:",e)}finally{root.setAttribute("data-stx-scope",scopeId)}});var isStructuralSource=pendingRoots.some(function(root){return root.hasAttribute("@for")||root.hasAttribute(":for")||root.hasAttribute("x-for")||root.hasAttribute("@if")||root.hasAttribute(":if")||root.hasAttribute("x-if")});if(!isStructuralSource&&old.parentNode)old.parentNode.removeChild(old)});roots.forEach(function(root){var scopeId=root.getAttribute("data-stx-scope");var scopeVars=scopeId&&window.stx._scopes&&window.stx._scopes[scopeId];var resolvedCallerScope=resolveComponentCallerScope(root,callerScope);root.__stx_parent_scope=resolvedCallerScope;bindParentComponentProps(root,resolvedCallerScope);if(!scopeVars||root.__stx_disposers)return;scopeVars.__el=root;var childScope={...resolvedCallerScope,...scopeVars};root.__stx_disposers=trackEffects(function(){processElement(root,childScope)});if(scopeVars.__mountCallbacks&&!scopeVars.__mounted){scopeVars.__mounted=true;runMountCallbacks(scopeVars.__mountCallbacks,scopeDestroySink(scopeVars))}})};function bindFor(el,passedScope=componentScope,attrName="@for"){if(el.__stx_for_bound)return;el.__stx_for_bound=true;const expr=el.getAttribute(attrName);const match=expr.match(/^\s*\(?\s*(\w+)(?:\s*,\s*(\w+))?\s*\)?\s+(?:in|of)\s+(.+)\s*$/);if(!match){console.warn("[STX] Invalid "+attrName+":",expr);return}const[,itemName,indexName,listExpr]=match;const parent=el.parentNode;if(!parent){console.warn("[STX] bindFor: element has no parent, skipping");return};const placeholder=document.createComment("stx-for");const isTemplate=el.tagName==="TEMPLATE";const componentSetupTemplates=[];if(!isTemplate&&el.hasAttribute("data-stx-scope")){const componentScopeId=el.getAttribute("data-stx-scope");const componentTemplateScopeId=el.getAttribute("data-stx-template-scope")||componentScopeId;let setupSibling=el.nextSibling;while(setupSibling){const nextSetupSibling=setupSibling.nextSibling;if(setupSibling.nodeType===Node.TEXT_NODE&&!(setupSibling.textContent||"").trim()){setupSibling=nextSetupSibling;continue}if(setupSibling.nodeType===Node.COMMENT_NODE){setupSibling=nextSetupSibling;continue}if(setupSibling.nodeType===Node.ELEMENT_NODE&&setupSibling.tagName==="SCRIPT"&&setupSibling.hasAttribute("data-stx-scoped")&&((setupSibling.textContent||"").indexOf(componentScopeId)!==-1||componentTemplateScopeId&&(setupSibling.textContent||"").indexOf(componentTemplateScopeId)!==-1)){componentSetupTemplates.push(setupSibling.cloneNode(true));setupSibling.remove();setupSibling=nextSetupSibling;continue}break}};const ifExpr=el.getAttribute("@if")||el.getAttribute(":if");const loadingExpr=el.getAttribute("@loading");const emptyExpr=el.getAttribute("@empty");let loadingTemplate=null;let emptyTemplate=null;let sibling=el.nextElementSibling;while(sibling){if(sibling.hasAttribute("@for-loading")){loadingTemplate=sibling.cloneNode(true);loadingTemplate.removeAttribute("@for-loading");sibling.remove();sibling=el.nextElementSibling;continue}if(sibling.hasAttribute("@for-empty")){emptyTemplate=sibling.cloneNode(true);emptyTemplate.removeAttribute("@for-empty");sibling.remove();sibling=el.nextElementSibling;continue}break};const capturedScope=findElementScope(el)||findElementScope(parent);parent.insertBefore(placeholder,el);disposeSubtreeScopes(el);parent.removeChild(el);const keyExpr=el.getAttribute(":key")||el.getAttribute("x-bind:key");let templateContent;if(isTemplate){templateContent=el.content}else{const wrapper=el.cloneNode(true);wrapper.removeAttribute("@for");wrapper.removeAttribute(":for");wrapper.removeAttribute("x-for");wrapper.removeAttribute("@loading");wrapper.removeAttribute("@empty");wrapper.removeAttribute(":key");wrapper.removeAttribute("x-bind:key");if(ifExpr){wrapper.removeAttribute("@if");wrapper.removeAttribute(":if");wrapper.removeAttribute("x-if")}templateContent=wrapper};let currentElements=[];let currentGroups=[];let currentKeys=[];let loadingElement=null;let emptyElement=null;const liveGroupNodes=(group)=>{if(!isTemplate||!group||group.length<2)return group||[];const start=group[0];const end=group[group.length-1];if(!start||!end||start.parentNode!==parent||end.parentNode!==parent)return group.filter((groupNode)=>groupNode&&groupNode.parentNode===parent);const nodes=[];let currentNode=start;while(currentNode){nodes.push(currentNode);if(currentNode===end)break;currentNode=currentNode.nextSibling}return nodes};const removeGroup=(group)=>{const liveNodes=liveGroupNodes(group);const liveSet=new Set(liveNodes);liveNodes.forEach((e)=>{disposeSubtreeScopes(e);e.remove()});group.forEach((groupNode)=>{if(liveSet.has(groupNode))return;disposeSubtreeScopes(groupNode);groupNode.remove()})};const clearRenderedItems=()=>{currentGroups.forEach(removeGroup);currentElements=[];currentGroups=[];currentKeys=[]};const evalExpr=(expression,extraScope={})=>{try{if(/^__[A-Z_]+__$/.test(expression.trim())){return expression};const scope={...globalHelpers,...passedScope,...capturedScope||{},...extraScope};const unwrapScope=createAutoUnwrapProxy(scope,function(prop){if(typeof prop!=="string")return false;return expressionCallsSignal(expression,prop)||expressionUsesSignalApi(expression,prop)});const fn=new Function(...Object.keys(scope),"return "+expression);return fn(...Object.values(unwrapScope))}catch(e){if(!(e instanceof ReferenceError)&&!(e instanceof TypeError))console.warn("[STX] Expression error:",expression,e);return""}};const evalLazy=(expression,extraScope={})=>{try{if(/^__[A-Z_]+__$/.test(expression.trim()))return expression;const scope={...globalHelpers,...passedScope,...capturedScope||{},...extraScope};const unwrapScope=createAutoUnwrapProxy(scope,function(prop){if(typeof prop!=="string")return false;return expressionCallsSignal(expression,prop)||expressionUsesSignalApi(expression,prop)});const fn=new Function("__scope__","with(__scope__) { return "+expression+" }");return fn(unwrapScope)}catch(e){if(!(e instanceof ReferenceError)&&!(e instanceof TypeError))console.warn("[STX] Expression error:",expression,e);return""}};const showLoading=()=>{hideLoading();hideEmpty();if(loadingTemplate){loadingElement=loadingTemplate.cloneNode(true);parent.insertBefore(loadingElement,placeholder)}};const hideLoading=()=>{if(loadingElement){loadingElement.remove();loadingElement=null}};const showEmpty=()=>{hideLoading();hideEmpty();if(emptyTemplate){emptyElement=emptyTemplate.cloneNode(true);parent.insertBefore(emptyElement,placeholder);processElement(emptyElement)}};const hideEmpty=()=>{if(emptyElement){emptyElement.remove();emptyElement=null}};const itemSignalMap=new Map;const createItemElements=(item,index,key)=>{const itemSignal=state(item);itemSignal._isStxLoopItem=true;const indexSignal=state(index);if(key)itemSignalMap.set(key,{item:itemSignal,index:indexSignal});const itemScope={...globalHelpers,...passedScope,...capturedScope||{}};itemScope[itemName]=itemSignal;if(indexName)itemScope[indexName]=indexSignal;const elements=[];if(isTemplate){elements.push(document.createComment("stx-for-item-start"));Array.from(templateContent.childNodes).forEach((node)=>{const clone=node.cloneNode(true);if(clone.nodeType===1){clone.__stx_for_scope=itemScope}elements.push(clone)});elements.push(document.createComment("stx-for-item-end"))}else{const clone=templateContent.cloneNode(true);clone.__stx_for_scope=itemScope;elements.push(clone);componentSetupTemplates.forEach(function(setupTemplate){elements.push(setupTemplate.cloneNode(true))})}remapForComponentScopes(elements);return elements};const getItemKey=(item,index)=>{if(!keyExpr)return String(index);try{const scope={[itemName]:item};if(indexName)scope[indexName]=index;const fn=new Function(itemName,indexName||"_idx","return "+keyExpr);return String(fn(item,index))}catch(e){return String(index)}};effect(()=>{if(loadingExpr){const isLoading=evalLazy(loadingExpr);if(isLoading){clearRenderedItems();showLoading();return}}hideLoading();let list=evalLazy(listExpr);var trailingParens=/\(\s*\)\s*$/;if(!Array.isArray(list)&&trailingParens.test(listExpr)){list=evalLazy(listExpr.replace(trailingParens,""))}if(!Array.isArray(list)&&typeof list==="function"&&(list._isSignal||list._isDerived)){try{list=list()}catch{}}if(ifExpr){const ifValue=evalLazy(ifExpr);if(!ifValue){clearRenderedItems();hideEmpty();return}}if(!Array.isArray(list)){var diagScope;try{var diagMerged={...globalHelpers,...passedScope,...capturedScope||{}};var firstIdent=listExpr.match(/^[A-Za-z_$][\w$]*/);var rootName=firstIdent?firstIdent[0]:"?";var rootInScope=Object.prototype.hasOwnProperty.call(diagMerged,rootName);var rootVal=rootInScope?diagMerged[rootName]:"<NOT-IN-SCOPE>";var rootKeys=rootVal&&typeof rootVal==="object"?Object.keys(rootVal).slice(0,8).join(","):"-";diagScope="[root="+rootName+" inScope="+rootInScope+" type="+typeof rootVal+" isStxStore="+!!(rootVal&&rootVal._isStxStore)+" keys="+rootKeys+"]"}catch(_e){diagScope="[diag-error]"}console.warn("[STX] :for expected an array; got "+(list===""?"empty/error":typeof list)+' for expression "'+listExpr+'". '+diagScope+" If this is a signal call, try the bare reference (signal instead of signal()).");return}if(list.length===0){clearRenderedItems();if(emptyExpr){const emptyContent=evalLazy(emptyExpr);if(emptyContent&&typeof emptyContent==="string"){const textNode=document.createTextNode(emptyContent);parent.insertBefore(textNode,placeholder);currentElements.push(textNode)}}else if(emptyTemplate){showEmpty()}return}hideEmpty();var tgIsGroup=!!(parent&&parent.hasAttribute&&parent.hasAttribute("data-stx-transition-group"));var tgName=tgIsGroup?parent.getAttribute("data-stx-transition-group")||"v":null;var tgReady=tgIsGroup&&!!parent.__stx_tg_init;var tgFirst=tgReady?tgSnapshot(currentElements):null;const newKeys=list.map((item,i)=>getItemKey(item,i));const oldKeyMap=new Map;for(let i=0;i<currentKeys.length;i++){const k=currentKeys[i];if(!oldKeyMap.has(k))oldKeyMap.set(k,[]);oldKeyMap.get(k).push(currentGroups[i]||[])};const newElements=[];const newGroups=[];const usedKeys=new Set;let cursor=null;for(let ci=0;ci<currentGroups.length&&!cursor;ci++){const seed=liveGroupNodes(currentGroups[ci]||[]);if(seed.length)cursor=seed[0]}for(let i=0;i<list.length;i++){const key=newKeys[i];const existing=oldKeyMap.get(key);if(existing&&existing.length>0&&!usedKeys.has(key)){const group=existing.shift();const liveNodes=liveGroupNodes(group);for(let li=0;li<liveNodes.length;li++){const groupNode=liveNodes[li];if(groupNode===cursor){cursor=cursor.nextSibling}else{parent.insertBefore(groupNode,cursor||placeholder)}}newElements.push(...group);newGroups.push(group);usedKeys.add(key);const signals=itemSignalMap.get(key);if(signals){signals.item.set(list[i]);signals.index.set(i)}}else{const elements=createItemElements(list[i],i,key);elements.forEach((el)=>{parent.insertBefore(el,cursor||placeholder);if(tgReady&&el.isConnected)tgEnter(el,tgName)});hydrateComponentScopes(elements,elements.find(function(node){return node&&node.__stx_for_scope})?.__stx_for_scope||passedScope);elements.forEach((el)=>{if(el.nodeType===1){var itemScope=el.__stx_for_scope||passedScope;delete el.__stx_for_scope;if(!el.__stx_disposers&&el.tagName!=="SCRIPT")processElement(el,itemScope);el.removeAttribute("x-cloak");el.querySelectorAll("[x-cloak]").forEach((c)=>c.removeAttribute("x-cloak"))}});newElements.push(...elements);newGroups.push(elements)}}for(const[key,groups]of oldKeyMap){if(!usedKeys.has(key)){groups.forEach((group)=>{if(tgReady){const liveNodes=liveGroupNodes(group);const transitioned=new Set;liveNodes.forEach((el)=>{disposeSubtreeScopes(el);if(tgLeave(el,tgName))transitioned.add(el);else el.remove()});group.forEach((el)=>{if(transitioned.has(el)||liveNodes.includes(el))return;disposeSubtreeScopes(el);el.remove()})}else{removeGroup(group)}});itemSignalMap.delete(key)}}currentElements=newElements;currentGroups=newGroups;currentKeys=newKeys;if(tgReady&&tgFirst)tgFlip(newElements,tgFirst,tgName);if(tgIsGroup)parent.__stx_tg_init=true})};var __bindIfCounter=0;function getElseAttrInfo(el){if(!el||!el.hasAttribute)return null;if(el.hasAttribute(":else-if"))return{name:":else-if",terminal:false};if(el.hasAttribute("x-else-if"))return{name:"x-else-if",terminal:false};if(el.hasAttribute("@else-if"))return{name:"@else-if",terminal:false};if(el.hasAttribute(":else"))return{name:":else",terminal:true};if(el.hasAttribute("x-else"))return{name:"x-else",terminal:true};if(el.hasAttribute("@else"))return{name:"@else",terminal:true};return null};function findIfChain(el,ifAttr){var chain=[{el,attr:ifAttr,expr:el.getAttribute(ifAttr),terminal:false}];var sib=el.nextElementSibling;while(sib){var info=getElseAttrInfo(sib);if(!info)break;chain.push({el:sib,attr:info.name,expr:info.terminal?null:sib.getAttribute(info.name),terminal:info.terminal});if(info.terminal)break;sib=sib.nextElementSibling}return chain};function bindIfChain(chain,passedScope=componentScope){var head=chain[0].el;if(head.__stx_if_bound){return};var parent=head.parentNode;if(!parent){console.warn("[STX] bindIfChain: head element has no parent, skipping");return};var capturedComponentScope={...passedScope};chain.forEach(function(b){preserveConditionalComponentScopes(b.el,capturedComponentScope);b.el.__stx_if_bound=true;b.el.__stx_chain_member=true;b.el.__stx_chain_active=false;b.capturedElementScope=findElementScope(b.el);b.placeholder=document.createComment("stx-if-chain");parent.insertBefore(b.placeholder,b.el);b.el.removeAttribute(b.attr);b.isTemplate=b.el.tagName==="TEMPLATE";b.nodes=b.isTemplate?Array.prototype.slice.call(b.el.content.cloneNode(true).childNodes):[b.el];b.el.remove();b.childrenProcessed=false});function evalBranch(b){var expression=b.expr;if(/^__[A-Z_]+__$/.test(expression.trim()))return expression;var scope={...globalHelpers,...capturedComponentScope,...b.capturedElementScope||{}};try{var unwrapScope=createExpressionAutoUnwrapProxy(scope,expression);var fn=new Function("__scope__","with(__scope__) { return "+expression+" }");return fn(unwrapScope)}catch(e1){try{var fn2=new Function("__scope__","with(__scope__) { return "+expression+" }");return fn2(scope)}catch(e2){if(!(e2 instanceof ReferenceError)&&!(e2 instanceof TypeError))console.warn("[STX] Expression error:",expression,e2);return""}}};var currentIdx=-1;effect(function(){var pickedIdx=-1;for(var i=0;i<chain.length;i++){var b=chain[i];var matched=b.terminal?true:!!evalBranch(b);if(matched&&pickedIdx===-1)pickedIdx=i}if(__stxDevtoolsTracking){var __ifScope=null;try{__ifScope=head&&head.closest?head.closest("[data-stx-scope]"):null}catch(e){__ifScope=null}__stxDevtoolsRecordIf({scopeId:__ifScope?__ifScope.getAttribute("data-stx-scope"):null,branches:chain.map(function(c){return c.attr}),picked:pickedIdx,pickedAttr:pickedIdx>=0?chain[pickedIdx].attr:null,prev:currentIdx})}if(pickedIdx===currentIdx)return;if(currentIdx!==-1){chain[currentIdx].el.__stx_chain_active=false;chain[currentIdx].nodes.forEach(function(n){if(n.parentNode)n.parentNode.removeChild(n)})}if(pickedIdx!==-1){var pick=chain[pickedIdx];pick.el.__stx_chain_active=true;var anchor=pick.placeholder.nextSibling;pick.nodes.forEach(function(n){pick.placeholder.parentNode.insertBefore(n,anchor)});pick.el.__stx_shown_at=performance.now();if(!pick.childrenProcessed){pick.childrenProcessed=true;peek(function(){var childScope={...globalHelpers,...capturedComponentScope,...pick.capturedElementScope||{}};var previouslyTrackedNodes=new Set;pick.nodes.forEach(function(n){if(n&&n.__stx_disposers)previouslyTrackedNodes.add(n)});hydrateComponentScopes(pick.nodes,childScope);pick.nodes.forEach(function(n){if(n.nodeType!==1)return;if(previouslyTrackedNodes.has(n)||!n.__stx_disposers)processElement(n,childScope);n.removeAttribute("x-cloak");n.querySelectorAll("[x-cloak]").forEach(function(c){c.removeAttribute("x-cloak")})})})}}currentIdx=pickedIdx})};function bindIf(el,passedScope=componentScope,attrName="@if"){if(el.__stx_if_bound){return}el.__stx_if_bound=true;const expr=el.getAttribute(attrName);const parent=el.parentNode;if(!parent){console.warn("[STX] bindIf: element has no parent, skipping");return};const placeholder=document.createComment("stx-if");let isInserted=true;const isTemplate=el.tagName==="TEMPLATE";const componentSetupSiblings=isTemplate?[]:findConditionalComponentSetupSiblings(el);let currentNodes=isTemplate?[]:[el,...componentSetupSiblings];const capturedElementScope=findElementScope(el);const capturedComponentScope={...passedScope};preserveConditionalComponentScopes(el,capturedComponentScope);parent.insertBefore(placeholder,el);el.removeAttribute(attrName);if(isTemplate){const content=el.content;currentNodes=Array.from(content.childNodes).map((n)=>n.cloneNode(true));const initialAnchor=placeholder.nextSibling;currentNodes.forEach((node)=>parent.insertBefore(node,initialAnchor));el.remove()};const evalExpr=(expression)=>{if(/^__[A-Z_]+__$/.test(expression.trim())){return expression}try{const scope={...globalHelpers,...capturedComponentScope,...capturedElementScope||{}};const unwrapScope=createExpressionAutoUnwrapProxy(scope,expression);const fn=new Function("__scope__","with(__scope__) { return "+expression+" }");return fn(unwrapScope)}catch(e1){try{const scope2={...globalHelpers,...capturedComponentScope,...capturedElementScope||{}};const fn2=new Function("__scope__","with(__scope__) { return "+expression+" }");return fn2(scope2)}catch(e2){if(!(e2 instanceof ReferenceError)&&!(e2 instanceof TypeError))console.warn("[STX] Expression error:",expression,e2);return""}}};let childrenProcessed=false;const processChildrenWithScope=()=>{const childScope={...globalHelpers,...capturedComponentScope,...capturedElementScope||{}};Array.from(el.childNodes).forEach((child)=>processElement(child,childScope));childrenProcessed=true};const processTemplateNodes=(nodes)=>{const childScope={...globalHelpers,...capturedComponentScope,...capturedElementScope||{}};hydrateComponentScopes(nodes,childScope);nodes.forEach((node)=>{if(!node.__stx_disposers&&node.tagName!=="SCRIPT")processElement(node,childScope);if(node.nodeType===1){node.removeAttribute("x-cloak");node.querySelectorAll("[x-cloak]").forEach((c)=>c.removeAttribute("x-cloak"))}})};const fullScope={...globalHelpers,...capturedComponentScope,...capturedElementScope||{}};const directSignal=fullScope[expr];effect(()=>{var value;if(directSignal&&(directSignal._isSignal||directSignal._isDerived)){value=directSignal()}else{value=evalExpr(expr)}if(isTemplate){if(value&&!isInserted){currentNodes=Array.from(el.content.childNodes).map((n)=>n.cloneNode(true));const insertionAnchor=placeholder.nextSibling;currentNodes.forEach((node)=>parent.insertBefore(node,insertionAnchor));processTemplateNodes(currentNodes);childrenProcessed=true;currentNodes.forEach(function(n){if(n.nodeType===1)n.__stx_shown_at=performance.now()});isInserted=true}else if(!value&&isInserted){currentNodes.forEach((node)=>node.remove());currentNodes=[];isInserted=false;childrenProcessed=false}else if(value&&isInserted&&!childrenProcessed){childrenProcessed=true;peek(function(){if(isInserted)processTemplateNodes(currentNodes)})}}else{if(value&&!isInserted){const insertionAnchor=placeholder.nextSibling;currentNodes.forEach((node)=>parent.insertBefore(node,insertionAnchor));el.__stx_shown_at=performance.now();isInserted=true}else if(!value&&isInserted){currentNodes.forEach((node)=>node.remove());isInserted=false}if(value&&isInserted&&!childrenProcessed){childrenProcessed=true;el.__stx_if_pending=true;setTimeout(function(){var childScope={...globalHelpers,...capturedComponentScope,...capturedElementScope||{}};var wasTrackedBeforeConditionalHydration=!!el.__stx_disposers;hydrateComponentScopes(currentNodes,childScope);if(wasTrackedBeforeConditionalHydration||!el.__stx_disposers)processElement(el,childScope);el.removeAttribute("x-cloak");el.querySelectorAll("[x-cloak]").forEach(function(c){c.removeAttribute("x-cloak")});el.__stx_if_pending=false},0)}}})};function $computed(fn){return derived(fn)};function $watch(deps,fn){effect(()=>{const values=Array.isArray(deps)?deps.map((d)=>{if(typeof d==="function"&&(d._isSignal||d._isDerived))return d();return d}):typeof deps==="function"&&(deps._isSignal||deps._isDerived)?[deps()]:[deps];fn(...values)})};var __stxProvided=Object.create(null);function provide(name,value){__stxProvided[name]=value;window[name]=value};function inject(name,defaultValue){if(name in __stxProvided)return __stxProvided[name];if(name in window)return window[name];return defaultValue};function useDebounce(fn,delay){delay=delay||250;var timer=null;var lastArgs=null;var debounced=function(){lastArgs=Array.prototype.slice.call(arguments);if(timer!==null)clearTimeout(timer);var args=lastArgs;timer=setTimeout(function(){timer=null;lastArgs=null;fn.apply(null,args)},delay)};debounced.cancel=function(){if(timer!==null){clearTimeout(timer);timer=null;lastArgs=null}};debounced.flush=function(){if(timer!==null&&lastArgs!==null){clearTimeout(timer);timer=null;var args=lastArgs;lastArgs=null;fn.apply(null,args)}};debounced.pending=function(){return timer!==null};onDestroy(debounced.cancel);return debounced};function useDebouncedValue(getter,delay){delay=delay||250;var current=getter();var listeners=[];var timer=null;function schedule(){if(timer!==null)clearTimeout(timer);timer=setTimeout(function(){timer=null;var next=getter();if(next!==current){current=next;listeners.forEach(function(fn){fn(current)})}},delay)}schedule();onDestroy(function(){if(timer!==null)clearTimeout(timer);listeners=[]});return{get value(){return current},subscribe:function(fn){listeners.push(fn);return function(){listeners=listeners.filter(function(f){return f!==fn})}}}};function useThrottle(fn,limit){limit=limit||250;var timer=null;var lastRan=0;var throttled=function(){var args=Array.prototype.slice.call(arguments);var now=Date.now();var remaining=limit-(now-lastRan);if(remaining<=0){if(timer!==null){clearTimeout(timer);timer=null}lastRan=now;fn.apply(null,args)}else if(timer===null){timer=setTimeout(function(){lastRan=Date.now();timer=null;fn.apply(null,args)},remaining)}};throttled.cancel=function(){if(timer!==null){clearTimeout(timer);timer=null}};onDestroy(throttled.cancel);return throttled};function useInterval(interval,options,thirdOptions){var callback=null;if(typeof interval==="function"){callback=interval;if(typeof options==="number"){interval=options;options=thirdOptions||{}}else{interval=1000;options=options&&typeof options==="object"?options:{}}}interval=interval||1000;options=options||{};var count=0;var id=null;var running=false;var listeners=[];function shouldTick(){if(options.whileVisible&&typeof document!=="undefined"&&document.hidden)return false;var en=options.enabled;if(typeof en==="function")return!!en();return en!==false};function tick(){if(!shouldTick())return;count++;listeners.forEach(function(fn){fn(count)})};function resume(){if(running)return;running=true;id=setInterval(tick,interval);if(options.immediate)tick()};function pause(){if(!running)return;running=false;if(id!==null){clearInterval(id);id=null}};function reset(){pause();count=0;listeners.forEach(function(fn){fn(count)});resume()}if(callback)listeners.push(callback);resume();onDestroy(function(){pause();listeners=[]});return{get counter(){return count},pause,resume,reset,subscribe:function(fn){listeners.push(fn);return function(){listeners=listeners.filter(function(f){return f!==fn})}}}};function useTimeout(callback,delay){delay=delay||1000;var timer=null;var pending=false;var listeners=[];function setPending(v){if(v!==pending){pending=v;listeners.forEach(function(fn){fn(pending)})}};function start(){stop();setPending(true);timer=setTimeout(function(){timer=null;setPending(false);callback()},delay)};function stop(){if(timer!==null){clearTimeout(timer);timer=null}setPending(false)}start();onDestroy(stop);return{get isPending(){return pending},start,stop,subscribe:function(fn){listeners.push(fn);return function(){listeners=listeners.filter(function(f){return f!==fn})}}}};function useToggle(initial){var current=!!initial;var listeners=[];function notify(){listeners.forEach(function(fn){fn(current)})};function toggle(){current=!current;notify()};function set(v){v=!!v;if(v!==current){current=v;notify()}};var ref={get value(){return current},subscribe:function(fn){listeners.push(fn);return function(){listeners=listeners.filter(function(f){return f!==fn})}}};return[ref,toggle,set]};function useCounter(initial,options){initial=initial||0;options=options||{};var min=options.min!=null?options.min:-1/0;var max=options.max!=null?options.max:1/0;function clamp(v){return Math.min(max,Math.max(min,v))};var current=clamp(initial);var listeners=[];function notify(){listeners.forEach(function(fn){fn(current)})}return{get count(){return current},inc:function(step){current=clamp(current+(step||1));notify()},dec:function(step){current=clamp(current-(step||1));notify()},set:function(v){current=clamp(v);notify()},reset:function(){current=clamp(initial);notify()},subscribe:function(fn){listeners.push(fn);return function(){listeners=listeners.filter(function(f){return f!==fn})}}}};function useClickOutside(target,handler){function resolveTarget(){if(typeof target==="string")return document.querySelector(target);if(target&&typeof target==="object"){if("current"in target)return target.current;if("value"in target)return target.value}return target};function listener(event){var el=resolveTarget();if(!el)return;if(el===event.target||el.contains(event.target))return;handler(event)}document.addEventListener("pointerdown",listener,true);function remove(){document.removeEventListener("pointerdown",listener,true)}onDestroy(remove);return{remove}};function useFocus(target){var focused=false;var listeners=[];function resolve(){return typeof target==="string"?document.querySelector(target):target};function setFocused(v){if(v!==focused){focused=v;listeners.forEach(function(fn){fn(focused)})}};var onFocusIn=function(){setFocused(true)};var onBlurOut=function(){setFocused(false)};var el=resolve();if(el){el.addEventListener("focus",onFocusIn);el.addEventListener("blur",onBlurOut);focused=document.activeElement===el}onDestroy(function(){var el=resolve();if(el){el.removeEventListener("focus",onFocusIn);el.removeEventListener("blur",onBlurOut)}listeners=[]});return{get isFocused(){return focused},focus:function(){var el=resolve();if(el&&el.focus)el.focus()},blur:function(){var el=resolve();if(el&&el.blur)el.blur()},subscribe:function(fn){listeners.push(fn);return function(){listeners=listeners.filter(function(f){return f!==fn})}}}};function nextTick(fn){return Promise.resolve().then(function(){return new Promise(function(resolve){setTimeout(function(){if(fn)fn();resolve()},0)})})};function watchMultiple(sources,callback,options){options=options||{};var read=function(){return sources.map(function(s){if(typeof s==="function")return s();if(s&&typeof s==="object"&&"value"in s)return s.value;return s})};var oldValues=read();var first=true;return effect(function(){var newValues=read();if(first){first=false;if(!options.immediate)return}callback(newValues,oldValues);oldValues=newValues})};function useAsync(fn,options){options=options||{};var asyncState="idle";var data=null;var error=null;var listeners=[];function notify(){var snap={state:asyncState,data,error};listeners.forEach(function(fn){fn(snap)})};function execute(){var args=Array.prototype.slice.call(arguments);asyncState="loading";error=null;notify();return fn.apply(null,args).then(function(result){data=result;asyncState="success";notify();return data}).catch(function(e){error=e instanceof Error?e:new Error(String(e));asyncState="error";notify();return null})}if(options.immediate)execute();return{get state(){return asyncState},get isLoading(){return asyncState==="loading"},get error(){return error},get data(){return data},execute,subscribe:function(fn){listeners.push(fn);return function(){listeners=listeners.filter(function(f){return f!==fn})}}}};function useColorMode(options){options=options||{};var boot=null;try{boot=window.__STX_COLOR_MODE__||null}catch(e){};function pick(a,b,fallback){if(a!==undefined)return a;if(b!==undefined)return b;return fallback};function fromBoot(key){return boot&&typeof boot==="object"?boot[key]:undefined};var storageKey=pick(options.storageKey,fromBoot("storageKey"),"stx-color-mode");var initialMode=pick(options.initialMode,fromBoot("initialMode"),"auto");var darkClass=pick(options.darkClass,fromBoot("darkClass"),"dark");var attribute=pick(options.attribute,fromBoot("attribute"),null);var autoValueOption=pick(options.autoValue,fromBoot("autoValue"),undefined);var disableTransitions=options.disableTransitions!==false;var resolved="light";var listeners=[];var cleanups=[];function normalizeMode(v){if(v==="light"||v==="dark")return v;if(v==="auto"||v==="system")return"auto";return null};var preference=normalizeMode(initialMode)||"auto";function getSystem(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"};function resolve(pref){return pref==="auto"?getSystem():pref};function applyDOM(mode){var el=document.documentElement;if(disableTransitions)el.style.setProperty("transition","none","important");if(attribute)el.setAttribute(attribute,mode);if(darkClass){if(mode==="dark")el.classList.add(darkClass);else el.classList.remove(darkClass)}if(disableTransitions){el.offsetHeight;el.style.removeProperty("transition")}};function readRaw(){try{return localStorage.getItem(storageKey)}catch(e){return null}};var storedRaw=readRaw();var autoValue=autoValueOption!==undefined?autoValueOption:storedRaw==="auto"||storedRaw==="system"?storedRaw:"auto";function persist(pref){try{localStorage.setItem(storageKey,pref==="auto"?autoValue:pref)}catch(e){}};function update(pref,persistChoice){preference=normalizeMode(pref)||"auto";resolved=resolve(preference);applyDOM(resolved);if(persistChoice!==false)persist(preference);listeners.forEach(function(fn){fn(resolved,preference)})}update(normalizeMode(storedRaw)||initialMode,false);var mql=window.matchMedia("(prefers-color-scheme: dark)");var onSystemChange=function(){if(preference==="auto"){resolved=getSystem();applyDOM(resolved);listeners.forEach(function(fn){fn(resolved,preference)})}};mql.addEventListener("change",onSystemChange);cleanups.push(function(){mql.removeEventListener("change",onSystemChange)});var onStorage=function(e){if(e.key!==storageKey)return;var v=normalizeMode(e.newValue);if(v){if(v==="auto"&&(e.newValue==="auto"||e.newValue==="system"))autoValue=e.newValue;preference=v;resolved=resolve(v);applyDOM(resolved);listeners.forEach(function(fn){fn(resolved,preference)})}};window.addEventListener("storage",onStorage);cleanups.push(function(){window.removeEventListener("storage",onStorage)});onDestroy(function(){cleanups.forEach(function(fn){fn()});listeners=[]});return{get mode(){return resolved},get preference(){return preference},get isDark(){return resolved==="dark"},set:function(mode){update(mode)},toggle:function(){update(resolved==="dark"?"light":"dark")},subscribe:function(fn){listeners.push(fn);return function(){listeners=listeners.filter(function(f){return f!==fn})}}}};function useDark(options){var cm=useColorMode(options);var dark=state(cm.isDark);var setSignal=dark.set;cm.subscribe(function(mode){setSignal(mode==="dark")});dark.toggle=function(){cm.toggle()};dark.set=function(value){cm.set(value?"dark":"light")};Object.defineProperty(dark,"isDark",{get:function(){return dark()}});return dark};function useMediaQuery(query){var mql=window.matchMedia(query);var matches=state(mql.matches);var onChange=function(event){matches.set(event.matches)};if(mql.addEventListener)mql.addEventListener("change",onChange);else if(mql.addListener)mql.addListener(onChange);onDestroy(function(){if(mql.removeEventListener)mql.removeEventListener("change",onChange);else if(mql.removeListener)mql.removeListener(onChange)});Object.defineProperty(matches,"matches",{get:function(){return matches()}});Object.defineProperty(matches,"value",{get:function(){return matches()}});return matches};var scrollLockStates=new WeakMap;function resolveScrollLockTarget(target){var value=target;if(typeof value==="function")value=value();if(value&&typeof value==="object"&&"current"in value)value=value.current;if(value&&typeof value==="object"&&!value.nodeType&&"value"in value)value=value.value;return value||document.body||document.documentElement};function acquireScrollLock(element){if(!element)return;var existing=scrollLockStates.get(element);if(existing){existing.count+=1;return}scrollLockStates.set(element,{count:1,overflow:element.style.overflow});element.style.overflow="hidden"};function releaseScrollLock(element){if(!element)return;var existing=scrollLockStates.get(element);if(!existing)return;existing.count-=1;if(existing.count>0)return;element.style.overflow=existing.overflow;scrollLockStates.delete(element)};function useScrollLock(target){var locked=state(false);var lockedElement=null;var unsubscribe=locked.subscribe(function(value){if(value){if(lockedElement)return;lockedElement=resolveScrollLockTarget(target);acquireScrollLock(lockedElement)}else if(lockedElement){releaseScrollLock(lockedElement);lockedElement=null}});onDestroy(function(){unsubscribe();if(lockedElement){releaseScrollLock(lockedElement);lockedElement=null}});return locked};function usePreferredDark(){return useMediaQuery("(prefers-color-scheme: dark)")};function usePreferredLight(){return useMediaQuery("(prefers-color-scheme: light)")};function usePreferredReducedMotion(){return useMediaQuery("(prefers-reduced-motion: reduce)")};function usePreferredContrast(){return useMediaQuery("(prefers-contrast: more)")};var ref=state;var __stxReactiveProxies=new WeakMap;function reactive(target){if(!target||typeof target!=="object")return target;var existing=__stxReactiveProxies.get(target);if(existing)return existing;var propSignals=Object.create(null);function signalFor(prop){if(!propSignals[prop])propSignals[prop]=state(target[prop]);return propSignals[prop]};var proxy=new Proxy(target,{get:function(t,prop,receiver){if(typeof prop==="symbol"||!Object.prototype.hasOwnProperty.call(t,prop))return Reflect.get(t,prop,receiver);var value=signalFor(prop)();return value&&typeof value==="object"?reactive(value):value},set:function(t,prop,value){if(typeof prop==="symbol")return Reflect.set(t,prop,value);var had=Object.prototype.hasOwnProperty.call(t,prop);t[prop]=value;if(propSignals[prop])propSignals[prop].set(value);else if(had)signalFor(prop);return true},deleteProperty:function(t,prop){var had=Object.prototype.hasOwnProperty.call(t,prop);delete t[prop];if(had&&propSignals[prop])propSignals[prop].set(undefined);return true}});__stxReactiveProxies.set(target,proxy);return proxy};var computed=derived;var watch=$watch;var watchEffect=function(fn){return effect(fn)};function stxParseStored(raw,fallback,key,label){if(raw===null||raw===undefined)return fallback;try{return JSON.parse(raw)}catch(e){console.warn("[stx] "+label+': "'+key+'" holds a value that is not JSON ('+String(raw).slice(0,64)+"); using it as a raw string. Write it with the same composable to store it as JSON.");return raw}};function stxStorageRead(store,key,fallback,label){var raw;try{raw=store.getItem(key)}catch(e){console.warn("[stx] "+label+': cannot read "'+key+'" ('+(e&&e.message?e.message:e)+"); using the default.");return fallback}return stxParseStored(raw,fallback,key,label)};function stxStorageWrite(store,key,value,label){try{store.setItem(key,JSON.stringify(value))}catch(e){console.warn("[stx] "+label+': cannot persist "'+key+'" ('+(e&&e.message?e.message:e)+"); the value stays in memory only.")}};function useLocalStorage(key,defaultValue){var s=state(stxStorageRead(localStorage,key,defaultValue,"useLocalStorage"));effect(function(){stxStorageWrite(localStorage,key,s(),"useLocalStorage")});var handler=function(e){if(e.key===key&&(!e.storageArea||e.storageArea===localStorage))s.set(stxParseStored(e.newValue,defaultValue,key,"useLocalStorage"))};window.addEventListener("storage",handler);onDestroy(function(){window.removeEventListener("storage",handler)});return s};function useSessionStorage(key,defaultValue){var s=state(stxStorageRead(sessionStorage,key,defaultValue,"useSessionStorage"));effect(function(){stxStorageWrite(sessionStorage,key,s(),"useSessionStorage")});var handler=function(e){if(e.key===key&&(!e.storageArea||e.storageArea===sessionStorage))s.set(stxParseStored(e.newValue,defaultValue,key,"useSessionStorage"))};window.addEventListener("storage",handler);onDestroy(function(){window.removeEventListener("storage",handler)});return s};function useCookie(name,opts){opts=opts||{};var encode=opts.encode||encodeURIComponent;var decode=opts.decode||decodeURIComponent;var escapedName=name.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");var nameRe=new RegExp("(?:^|; )"+escapedName+"=([^;]*)");function read(){if(typeof document==="undefined")return opts.defaultValue||"";var m=document.cookie.match(nameRe);return m?decode(m[1]):opts.defaultValue||""};var s=state(read());function serialise(value){var parts=[name+"="+(value?encode(value):"")];parts.push("path="+(opts.path||"/"));if(opts.domain)parts.push("domain="+opts.domain);if(value==="")parts.push("max-age=0");else if(typeof opts.maxAge==="number")parts.push("max-age="+opts.maxAge);else if(opts.expires!==undefined){var expiresDate=opts.expires instanceof Date?opts.expires:typeof opts.expires==="number"?new Date(Date.now()+opts.expires*1000):new Date(opts.expires);parts.push("expires="+expiresDate.toUTCString())}parts.push("SameSite="+(opts.sameSite||"Lax"));var secure=opts.secure;if(secure===undefined)secure=typeof location!=="undefined"&&location.protocol==="https:";if(secure)parts.push("Secure");return parts.join("; ")}s.subscribe(function(value){if(typeof document==="undefined")return;document.cookie=serialise(value)});return s};var __stxGeneratedIdCounter=0;function useId(prefix){var normalizedPrefix=String(prefix||"stx").trim().replace(/[^a-zA-Z0-9_-]+/g,"-").replace(/^-+|-+$/g,"")||"stx";var root=window.__STX_CURRENT_ELEMENT__;if(root&&root.getAttribute){var scopeId=root.getAttribute("data-stx-scope")||root.getAttribute("data-stx")||"";if(scopeId){root.__stx_id_counter=(root.__stx_id_counter||0)+1;return normalizedPrefix+"-"+String(scopeId).replace(/[^a-zA-Z0-9_-]+/g,"-")+"-"+root.__stx_id_counter}}__stxGeneratedIdCounter++;return normalizedPrefix+"-"+__stxGeneratedIdCounter};function useReactiveProp(name,defaultValue,opts){opts=opts||{};var parse=opts.parse||function(v){if(typeof defaultValue==="string")return v==null?"":String(v);if(typeof defaultValue==="boolean"){if(v===""||v==="true")return true;if(v==="false"||v===null||v===undefined)return false;return Boolean(v)}if(v===""||v==="true")return true;if(v==="false")return false;if(typeof v==="string"&&(v.charAt(0)==="["||v.charAt(0)==="{")){try{return JSON.parse(v)}catch(e){}}if(typeof defaultValue==="number")return v!=null&&v!==""&&!isNaN(Number(v))?Number(v):defaultValue;if(v!=null&&v!==""&&!isNaN(Number(v)))return Number(v);return v};var root=window.__STX_CURRENT_ELEMENT__;var kebabName=name.replace(/([A-Z])/g,function(_,c){return"-"+c.toLowerCase()});var lowerName=name.toLowerCase();var attributeNames=[name];if(kebabName!==name)attributeNames.push(kebabName);if(lowerName!==name&&lowerName!==kebabName)attributeNames.push(lowerName);function readAttribute(){if(!root||!root.hasAttribute)return{has:false,raw:null};for(var i=0;i<attributeNames.length;i++){var candidate=attributeNames[i];if(root.hasAttribute(candidate))return{has:true,raw:root.getAttribute(candidate)}}return{has:false,raw:null}};var staticValue=defaultValue;if(root&&root.getAttribute){var serializedProps=root.getAttribute("data-stx-props");if(serializedProps){try{var parsedProps=JSON.parse(serializedProps);var camelName=name.replace(/-([a-z0-9])/g,function(_,c){return c.toUpperCase()});if(Object.prototype.hasOwnProperty.call(parsedProps,name))staticValue=parsedProps[name];else if(Object.prototype.hasOwnProperty.call(parsedProps,camelName))staticValue=parsedProps[camelName]}catch(e){}}};var initial;var lastRaw=null;var initialAttribute=readAttribute();if(initialAttribute.has){lastRaw=initialAttribute.raw;initial=parse(lastRaw)}else{initial=staticValue};var s=state(initial);if(!root)return s;var propSignals=root.__stx_reactive_prop_signals||(root.__stx_reactive_prop_signals={});propSignals[name]=s;propSignals[kebabName]=s;propSignals[lowerName]=s;var observer=new MutationObserver(function(){var attribute=readAttribute();var hasAttr=attribute.has;var raw=attribute.raw;if(raw===lastRaw)return;lastRaw=raw;var directValues=root.__stx_direct_prop_values;var directValue=directValues&&directValues[name];var next;if(directValue&&directValue.raw===raw){next=directValue.value;delete directValues[name];for(var directKey in directValues){if(directValues[directKey]===directValue)delete directValues[directKey]}}else{next=hasAttr?parse(raw):staticValue}if(next!==s())s.set(next)});observer.observe(root,{attributes:true,attributeFilter:attributeNames});onDestroy(function(){observer.disconnect();attributeNames.forEach(function(attributeName){if(propSignals[attributeName]===s)delete propSignals[attributeName]})});return s};function useEventListener(event,handler,options){var target=options&&options.target||window;if(typeof target==="string")target=document.querySelector(target);if(!target)return;var opts={capture:options&&options.capture,passive:options&&options.passive,once:options&&options.once};target.addEventListener(event,handler,opts);onDestroy(function(){target.removeEventListener(event,handler,opts)})};function useHead(config){function apply(){if(config.title)document.title=config.title;var metas=config.meta||[];for(var i=0;i<metas.length;i++){var m=metas[i];if(!m.name&&!m.property)continue;var selector=m.name?'meta[name="'+m.name+'"]':'meta[property="'+m.property+'"]';var el=document.querySelector(selector);if(el){el.setAttribute("content",m.content||"")}else{el=document.createElement("meta");if(m.name)el.setAttribute("name",m.name);if(m.property)el.setAttribute("property",m.property);el.setAttribute("content",m.content||"");document.head.appendChild(el)}};var links=config.link||config.links||[];for(var j=0;j<links.length;j++){var l=links[j];if(!l.rel||!l.href)continue;var linkSel='link[rel="'+l.rel+'"][href="'+l.href+'"]';if(!document.querySelector(linkSel)){var le=document.createElement("link");for(var k in l){if(l.hasOwnProperty(k))le.setAttribute(k,l[k])}document.head.appendChild(le)}};var scripts=config.script||config.scripts||[];for(var si=0;si<scripts.length;si++){var s=scripts[si];var se=document.createElement("script");if(s.src)se.src=s.src;if(s.innerHTML)se.innerHTML=s.innerHTML;if(s.async)se.async=true;if(s.defer)se.defer=true;document.head.appendChild(se)}if(config.bodyAttrs&&config.bodyAttrs.class){config.bodyAttrs.class.split(" ").forEach(function(cls){if(cls)document.body.classList.add(cls)})}if(config.htmlAttrs){for(var hk in config.htmlAttrs){if(!config.htmlAttrs.hasOwnProperty(hk))continue;var hv=config.htmlAttrs[hk];if(hv==null)continue;if(hk==="class"){String(hv).split(" ").forEach(function(cls){if(cls)document.documentElement.classList.add(cls)})}else{document.documentElement.setAttribute(hk,hv)}}}}if(document.readyState!=="loading"){apply()}else{onMount(apply)}};function useSeoMeta(config){var meta=[];if(config.title)meta.push({name:"title",content:config.title});if(config.description)meta.push({name:"description",content:config.description});if(config.ogTitle)meta.push({property:"og:title",content:config.ogTitle});if(config.ogDescription)meta.push({property:"og:description",content:config.ogDescription});if(config.ogImage)meta.push({property:"og:image",content:config.ogImage});if(config.ogType)meta.push({property:"og:type",content:config.ogType});if(config.ogUrl)meta.push({property:"og:url",content:config.ogUrl});if(config.twitterCard)meta.push({name:"twitter:card",content:config.twitterCard});if(config.twitterTitle)meta.push({name:"twitter:title",content:config.twitterTitle});if(config.twitterDescription)meta.push({name:"twitter:description",content:config.twitterDescription});if(config.twitterImage)meta.push({name:"twitter:image",content:config.twitterImage});if(config.robots)meta.push({name:"robots",content:config.robots});if(config.canonical)meta.push({property:"og:url",content:config.canonical});useHead({title:config.title||config.ogTitle,meta})};var _toastId=0;var _toastIcons={success:'<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="#16a34a" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><path d="M9 12l2 2 4-4"/></svg>',error:'<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="#dc2626" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><line x1="15" y1="9" x2="9" y2="15"/><line x1="9" y1="9" x2="15" y2="15"/></svg>',info:'<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="#2563eb" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><line x1="12" y1="16" x2="12" y2="12"/><line x1="12" y1="8" x2="12.01" y2="8"/></svg>',warning:'<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="#d97706" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z"/><line x1="12" y1="9" x2="12" y2="13"/><line x1="12" y1="17" x2="12.01" y2="17"/></svg>'};var _toastColors={success:"#16a34a",error:"#dc2626",info:"#2563eb",warning:"#d97706"};function _getToastContainer(){return document.getElementById("stx-toast-container")};function _getToastAnimClass(container){if(!container)return{inAnim:"stx-toast-in",outAnim:"stx-toast-out"};var pos=container.getAttribute("data-stx-toast-position")||"top-right";if(pos.indexOf("left")!==-1)return{inAnim:"stx-toast-in-left",outAnim:"stx-toast-out-left"};if(pos.indexOf("center")!==-1)return{inAnim:"stx-toast-in-center",outAnim:"stx-toast-out-center"};return{inAnim:"stx-toast-in",outAnim:"stx-toast-out"}};function removeToast(id){var el=document.getElementById("stx-toast-"+id);if(!el)return;var container=_getToastContainer();var anims=_getToastAnimClass(container);el.style.animation=anims.outAnim+" 0.3s ease forwards";setTimeout(function(){if(el.parentNode)el.parentNode.removeChild(el)},300)};function _resolveDark(override){if(override!=null)return!!override;var root=document.documentElement;if(root.classList.contains("dark"))return true;var attr=root.getAttribute("data-theme")||root.getAttribute("data-color-mode");if(attr==="dark")return true;if(attr==="light")return false;return!!(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches)};function addToast(type,message,options){var container=_getToastContainer();if(!container){console.warn("[stx:toast] No <StxToast /> container found. Add <StxToast /> to your layout.");return-1};var opts=options||{};var duration=opts.duration!==undefined?opts.duration:3000;var id=++_toastId;var maxToasts=parseInt(container.getAttribute("data-stx-toast-max")||"5",10);var key=opts.id!=null?String(opts.id):"";if(key){var prior=container.querySelector('[data-stx-toast-key="'+key.replace(/"/g,"")+'"]');if(prior&&prior.parentNode)prior.parentNode.removeChild(prior)};var existing=container.querySelectorAll("[data-stx-toast]");while(existing.length>=maxToasts&&existing.length>0){var oldId=existing[0].getAttribute("data-stx-toast");removeToast(oldId);existing=container.querySelectorAll("[data-stx-toast]")};var anims=_getToastAnimClass(container);var borderColor=_toastColors[type]||_toastColors.info;var icon=_toastIcons[type]||_toastIcons.info;var isDark=_resolveDark(opts.dark);var bg=isDark?"#1f2937":"#ffffff";var textColor=isDark?"#f3f4f6":"#1f2937";var shadow=isDark?"0 4px 12px rgba(0,0,0,0.4)":"0 4px 12px rgba(0,0,0,0.15)";var el=document.createElement("div");el.id="stx-toast-"+id;el.setAttribute("data-stx-toast",String(id));if(key)el.setAttribute("data-stx-toast-key",key);el.setAttribute("role","alert");el.setAttribute("aria-live","assertive");el.style.cssText="pointer-events:auto;display:flex;align-items:flex-start;gap:0.75rem;padding:0.875rem 1rem;border-radius:0.5rem;border-left:4px solid "+borderColor+";background:"+bg+";color:"+textColor+";box-shadow:"+shadow+";animation:"+anims.inAnim+" 0.3s ease;font-family:system-ui,-apple-system,sans-serif;font-size:0.875rem;line-height:1.4;max-width:100%";var iconSpan=document.createElement("span");iconSpan.style.cssText="flex-shrink:0;display:flex;align-items:center;margin-top:1px";iconSpan.innerHTML=icon;var msgSpan=document.createElement(opts.title?"div":"span");msgSpan.style.cssText="flex:1;word-wrap:break-word";if(opts.title){var titleEl=document.createElement("div");titleEl.setAttribute("data-stx-toast-title","");titleEl.style.cssText="font-weight:600;margin-bottom:0.125rem";titleEl.textContent=opts.title;msgSpan.appendChild(titleEl);var bodyEl=document.createElement("div");bodyEl.style.cssText="opacity:0.9";bodyEl.textContent=message;msgSpan.appendChild(bodyEl)}else{msgSpan.textContent=message};var closeBtn=document.createElement("button");closeBtn.type="button";closeBtn.setAttribute("aria-label","Dismiss notification");closeBtn.style.cssText="flex-shrink:0;background:none;border:none;cursor:pointer;padding:0;color:"+(isDark?"#9ca3af":"#6b7280")+";font-size:1.125rem;line-height:1;display:flex;align-items:center";closeBtn.innerHTML='<svg width="16" height="16" viewBox="0 0 16 16" fill="currentColor"><path d="M4.646 4.646a.5.5 0 01.708 0L8 7.293l2.646-2.647a.5.5 0 01.708.708L8.707 8l2.647 2.646a.5.5 0 01-.708.708L8 8.707l-2.646 2.647a.5.5 0 01-.708-.708L7.293 8 4.646 5.354a.5.5 0 010-.708z"/></svg>';closeBtn.onclick=function(){removeToast(id)};el.appendChild(iconSpan);el.appendChild(msgSpan);el.appendChild(closeBtn);container.appendChild(el);if(duration>0){setTimeout(function(){removeToast(id)},duration)}return id};var toast={success:function(message,options){return addToast("success",message,options)},error:function(message,options){return addToast("error",message,options)},info:function(message,options){return addToast("info",message,options)},warning:function(message,options){return addToast("warning",message,options)},dismiss:function(id){if(id!==undefined){if(typeof id==="string"){var c=_getToastContainer();var match=c&&c.querySelector('[data-stx-toast-key="'+id.replace(/"/g,"")+'"]');if(match)removeToast(match.getAttribute("data-stx-toast"));return}removeToast(id);return};var container=_getToastContainer();if(!container)return;var all=container.querySelectorAll("[data-stx-toast]");for(var i=0;i<all.length;i++){var tid=all[i].getAttribute("data-stx-toast");removeToast(tid)}}};var modal={open:function(id){var el=document.querySelector('[data-stx-modal="'+id+'"]');if(!el){console.warn('[stx:modal] Modal "'+id+'" not found');return}el.style.display="flex";el.offsetHeight;el.setAttribute("data-stx-modal-open","");document.body.style.overflow="hidden";if(el.getAttribute("data-close-escape")!=="false"){var escHandler=function(e){if(e.key==="Escape"){modal.close(id);document.removeEventListener("keydown",escHandler)}};document.addEventListener("keydown",escHandler);el._stxEscHandler=escHandler}if(el.getAttribute("data-close-backdrop")!=="false"){el.onclick=function(e){if(e.target===el)modal.close(id)}}},close:function(id){var el=document.querySelector('[data-stx-modal="'+id+'"]');if(!el)return;el.removeAttribute("data-stx-modal-open");if(el._stxEscHandler){document.removeEventListener("keydown",el._stxEscHandler);el._stxEscHandler=null}el.onclick=null;setTimeout(function(){el.style.display="none";if(!document.querySelector("[data-stx-modal-open]"))document.body.style.overflow=""},200)},toggle:function(id){var el=document.querySelector('[data-stx-modal="'+id+'"]');if(el&&el.hasAttribute("data-stx-modal-open"))modal.close(id);else modal.open(id)}};var _dialogId=0;var _dialogIcons={info:'<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#2563eb" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><line x1="12" y1="16" x2="12" y2="12"/><line x1="12" y1="8" x2="12.01" y2="8"/></svg>',warning:'<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#d97706" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z"/><line x1="12" y1="9" x2="12" y2="13"/><line x1="12" y1="17" x2="12.01" y2="17"/></svg>',error:'<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#dc2626" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><line x1="15" y1="9" x2="9" y2="15"/><line x1="9" y1="9" x2="15" y2="15"/></svg>',success:'<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#16a34a" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><path d="M9 12l2 2 4-4"/></svg>',question:'<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#6366f1" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><path d="M9.09 9a3 3 0 015.83 1c0 2-3 3-3 3"/><line x1="12" y1="17" x2="12.01" y2="17"/></svg>'};function _createDialog(message,options,isConfirm){var opts=options||{};var type=opts.type||(isConfirm?"question":"info");var title=opts.title||"";var confirmText=opts.confirmText||"OK";var cancelText=opts.cancelText||"Cancel";var id="stx-dialog-"+ ++_dialogId;var isDark=_resolveDark(opts.dark);var bg=isDark?"#1f2937":"#ffffff";var textColor=isDark?"#f3f4f6":"#1f2937";var subColor=isDark?"#9ca3af":"#6b7280";var icon=_dialogIcons[type]||_dialogIcons.info;return new Promise(function(resolve){var backdrop=document.createElement("div");backdrop.id=id;backdrop.style.cssText="position:fixed;inset:0;z-index:999999;display:flex;align-items:center;justify-content:center;background:rgba(0,0,0,0.5);backdrop-filter:blur(2px);opacity:0;transition:opacity 0.2s ease;font-family:system-ui,-apple-system,sans-serif";backdrop.setAttribute("role","alertdialog");backdrop.setAttribute("aria-modal","true");var panel=document.createElement("div");panel.style.cssText="max-width:24rem;width:calc(100% - 2rem);border-radius:0.75rem;padding:1.5rem;background:"+bg+";color:"+textColor+";box-shadow:0 20px 60px rgba(0,0,0,0.3);transform:scale(0.95);transition:transform 0.2s ease;text-align:center";var iconDiv=document.createElement("div");iconDiv.style.cssText="display:flex;justify-content:center;margin-bottom:1rem";iconDiv.innerHTML=icon;panel.appendChild(iconDiv);if(title){var titleEl=document.createElement("h3");titleEl.id=id+"-title";titleEl.style.cssText="margin:0 0 0.5rem;font-size:1.125rem;font-weight:600";titleEl.textContent=title;panel.appendChild(titleEl);backdrop.setAttribute("aria-labelledby",titleEl.id)};var msgEl=document.createElement("p");msgEl.id=id+"-message";msgEl.style.cssText="margin:0 0 1.25rem;font-size:0.875rem;line-height:1.5;color:"+subColor;msgEl.textContent=message;panel.appendChild(msgEl);backdrop.setAttribute("aria-describedby",msgEl.id);if(!title)backdrop.setAttribute("aria-label",message);var btnRow=document.createElement("div");btnRow.style.cssText="display:flex;gap:0.75rem;justify-content:center";var previouslyFocused=document.activeElement;var closed=false;function cleanup(result){if(closed)return;closed=true;document.removeEventListener("keydown",keyHandler,true);backdrop.style.opacity="0";panel.style.transform="scale(0.95)";setTimeout(function(){backdrop.remove()},200);if(previouslyFocused&&typeof previouslyFocused.focus==="function"){try{previouslyFocused.focus()}catch(_e){}}resolve(result)}if(isConfirm){var cancelBtn=document.createElement("button");cancelBtn.textContent=cancelText;cancelBtn.style.cssText="padding:0.5rem 1.25rem;border-radius:0.5rem;font-size:0.875rem;font-weight:500;cursor:pointer;border:1px solid "+(isDark?"#374151":"#d1d5db")+";background:transparent;color:"+textColor+";transition:background 0.15s";cancelBtn.onmouseover=function(){this.style.background=isDark?"#374151":"#f3f4f6"};cancelBtn.onmouseout=function(){this.style.background="transparent"};cancelBtn.onclick=function(){cleanup(false)};btnRow.appendChild(cancelBtn)};var okBtn=document.createElement("button");okBtn.textContent=confirmText;var btnColor=type==="error"?"#dc2626":type==="warning"?"#d97706":"#5672cd";okBtn.style.cssText="padding:0.5rem 1.25rem;border-radius:0.5rem;font-size:0.875rem;font-weight:500;cursor:pointer;border:none;background:"+btnColor+";color:#fff;transition:opacity 0.15s";okBtn.onmouseover=function(){this.style.opacity="0.9"};okBtn.onmouseout=function(){this.style.opacity="1"};okBtn.onclick=function(){cleanup(isConfirm?true:undefined)};btnRow.appendChild(okBtn);panel.appendChild(btnRow);backdrop.appendChild(panel);document.body.appendChild(backdrop);backdrop.offsetHeight;backdrop.style.opacity="1";panel.style.transform="scale(1)";var keyHandler=function(e){if(e.key==="Escape"){e.preventDefault();cleanup(isConfirm?false:undefined);return}if(e.key!=="Tab")return;var focusable=panel.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(!focusable.length)return;var first=focusable[0];var last=focusable[focusable.length-1];if(!panel.contains(document.activeElement)){e.preventDefault();(e.shiftKey?last:first).focus();return}if(e.shiftKey&&document.activeElement===first){e.preventDefault();last.focus()}else if(!e.shiftKey&&document.activeElement===last){e.preventDefault();first.focus()}};document.addEventListener("keydown",keyHandler,true);okBtn.focus()})};function stxAlert(message,options){return _createDialog(message,options,false)};function stxConfirm(message,options){return _createDialog(message,options,true)};var drawer={open:function(id){var el=document.querySelector('[data-stx-drawer="'+id+'"]');if(!el){console.warn('[stx:drawer] Drawer "'+id+'" not found');return}el.style.display="flex";el.offsetHeight;el.setAttribute("data-stx-drawer-open","");document.body.style.overflow="hidden";if(el.getAttribute("data-close-escape")!=="false"){var escHandler=function(e){if(e.key==="Escape"){drawer.close(id);document.removeEventListener("keydown",escHandler)}};document.addEventListener("keydown",escHandler);el._stxEscHandler=escHandler}if(el.getAttribute("data-close-backdrop")!=="false"){el.onclick=function(e){if(e.target===el)drawer.close(id)}}},close:function(id){var el=document.querySelector('[data-stx-drawer="'+id+'"]');if(!el)return;el.removeAttribute("data-stx-drawer-open");if(el._stxEscHandler){document.removeEventListener("keydown",el._stxEscHandler);el._stxEscHandler=null}el.onclick=null;setTimeout(function(){el.style.display="none";if(!document.querySelector("[data-stx-drawer-open]")&&!document.querySelector("[data-stx-modal-open]"))document.body.style.overflow=""},300)},toggle:function(id){var el=document.querySelector('[data-stx-drawer="'+id+'"]');if(el&&el.hasAttribute("data-stx-drawer-open"))drawer.close(id);else drawer.open(id)}};(function(){var tip=null;function createTip(){tip=document.createElement("div");tip.id="stx-tooltip";tip.style.cssText="position:absolute;z-index:999999;pointer-events:none;background:#1f2937;color:#fff;font-size:12px;line-height:1.4;padding:6px 10px;border-radius:6px;max-width:250px;word-wrap:break-word;opacity:0;transition:opacity 0.15s ease;white-space:pre-wrap;box-shadow:0 2px 8px rgba(0,0,0,0.2)";document.body.appendChild(tip)};function show(el){if(!tip)createTip();var text=el.getAttribute("x-tooltip");if(!text)return;tip.textContent=text;tip.style.display="block";tip.style.opacity="0";var pos=el.getAttribute("x-tooltip-position")||"top";var rect=el.getBoundingClientRect();var tw=tip.offsetWidth;var th=tip.offsetHeight;var sx=window.scrollX;var sy=window.scrollY;var left,top;if(pos==="bottom"){left=rect.left+rect.width/2-tw/2;top=rect.bottom+8}else if(pos==="left"){left=rect.left-tw-8;top=rect.top+rect.height/2-th/2}else if(pos==="right"){left=rect.right+8;top=rect.top+rect.height/2-th/2}else{left=rect.left+rect.width/2-tw/2;top=rect.top-th-8;if(top<0){top=rect.bottom+8}}if(left<4)left=4;if(left+tw>window.innerWidth-4)left=window.innerWidth-tw-4;tip.style.left=left+sx+"px";tip.style.top=top+sy+"px";tip.style.opacity="1"};function hide(){if(tip){tip.style.opacity="0";setTimeout(function(){if(tip)tip.style.display="none"},150)}}document.addEventListener("mouseover",function(e){var el=e.target.closest("[x-tooltip]");if(el)show(el)});document.addEventListener("mouseout",function(e){var el=e.target.closest("[x-tooltip]");if(el)hide()});document.addEventListener("focusin",function(e){var el=e.target.closest("[x-tooltip]");if(el)show(el)});document.addEventListener("focusout",function(e){var el=e.target.closest("[x-tooltip]");if(el)hide()})})();function hydrateSubtree(container){if(!container||!container.querySelectorAll)return;var scoped=container.querySelectorAll("script[data-stx-scoped]");for(var i=0;i<scoped.length;i++){var old=scoped[i];if(old.__stx_ran)continue;var fresh=document.createElement("script");for(var a=0;a<old.attributes.length;a++)fresh.setAttribute(old.attributes[a].name,old.attributes[a].value);fresh.textContent=old.textContent;fresh.__stx_ran=true;if(old.parentNode)old.parentNode.replaceChild(fresh,old)};var scopeEls=[];if(container.matches&&container.matches("[data-stx-scope]"))scopeEls.push(container);container.querySelectorAll("[data-stx-scope]").forEach(function(el){scopeEls.push(el)});scopeEls.forEach(function(el){if(el.__stx_disposers)return;var scopeId=el.getAttribute("data-stx-scope");var scopeVars=window.stx._scopes&&window.stx._scopes[scopeId];if(!scopeVars)return;el.__stx_parent_scope=el.__stx_parent_scope||resolveComponentCallerScope(el,componentScope);bindParentComponentProps(el,el.__stx_parent_scope);Object.assign(componentScope,scopeVars);el.__stx_disposers=trackEffects(function(){processElement(el,componentScope)});if(scopeVars.__mountCallbacks&&!scopeVars.__mounted){scopeVars.__mounted=true;runMountCallbacks(scopeVars.__mountCallbacks,scopeDestroySink(scopeVars))}});processElement(container);if(container.removeAttribute)container.removeAttribute("x-cloak");container.querySelectorAll("[x-cloak]").forEach(function(c){c.removeAttribute("x-cloak")});if(mountCallbacks.length){var cbs=mountCallbacks.slice();mountCallbacks.length=0;runMountCallbacks(cbs,destroyCallbacks)}window.dispatchEvent(new CustomEvent("stx:hydrated",{detail:{el:container,trigger:"stream"}}))};var mountQueue=[];window.stx=Object.assign(window.stx||{},{hydrate:hydrateSubtree,state,derived,effect,batch,isSignal,isDerived,untrack,peek,inject,watchMultiple,onMount,onBeforeMount:onMount,onDestroy,onMounted:onMount,onBeforeUnmount:onDestroy,onUnmounted:onDestroy,useFetch,useRef,navigate,refresh,invalidateRoute,goBack,goForward,useRoute,useRouteParams,useRouteParam,setRouteParams,useSearchParams,useQuery,useMutation,configureFetch,useOptimistic,provide,$computed,$watch,ref,reactive,computed,watch,watchEffect,useDebounce,useDebouncedValue,useThrottle,useInterval,useTimeout,useToggle,useCounter,useClickOutside,useFocus,nextTick,useAsync,useLocalStorage,useSessionStorage,useCookie,useId,useReactiveProp,useEventListener,useWebSocket,useColorMode,useDark,useMediaQuery,useScrollLock,usePreferredDark,usePreferredLight,usePreferredReducedMotion,usePreferredContrast,useHead,useSeoMeta,definePageMeta:function(){},toast,modal,drawer,alert:stxAlert,confirm:stxConfirm,helpers:globalHelpers,defineProps:function(definitions){var props=window.__STX_CURRENT_PROPS__||{};if(!definitions)return props;var result=Object.assign({},props);for(var key in definitions){if(!definitions.hasOwnProperty(key))continue;var def=definitions[key];var opts=typeof def==="function"||Array.isArray(def)?{type:def}:def||{};if(result[key]===undefined&&opts["default"]!==undefined){result[key]=typeof opts["default"]==="function"?opts["default"]():opts["default"]}}return result},withDefaults:function(props,defaults){var result=Object.assign({},props);for(var key in defaults){if(!defaults.hasOwnProperty(key))continue;if(result[key]===undefined){result[key]=typeof defaults[key]==="function"?defaults[key]():defaults[key]}}return result},defineEmits:function(events){var el=window.__STX_CURRENT_ELEMENT__||null;var declaredEvents=Array.isArray(events)?events:events&&typeof events==="object"?Object.keys(events):[];if(el&&declaredEvents.length){el.__stx_component_emits=el.__stx_component_emits||Object.create(null);declaredEvents.forEach(function(event){el.__stx_component_emits[event]=true})}return function(event,payload){var target=el||document.body;if(el){el.__stx_component_emits=el.__stx_component_emits||Object.create(null);el.__stx_component_emits[event]=true}target.dispatchEvent(new CustomEvent(event,{detail:payload,bubbles:true,cancelable:true}))}},defineExpose:function(exposed){var el=window.__STX_CURRENT_ELEMENT__;if(el)el.__stx_exposed=exposed},defineSlots:function(){return window.__STX_CURRENT_SLOTS__||{}},useSlots:function(){return window.__STX_CURRENT_SLOTS__||{}},_mountCallbacks:mountCallbacks,_destroyCallbacks:destroyCallbacks,_cleanupContainer:cleanupContainer,_registerSuspense:registerSuspense,_tg:{enter:tgEnter,leave:tgLeave,flip:tgFlip,snapshot:tgSnapshot},_scopes:{},_scopeCounter:0,_latestSetup:window.__stx_latestSetup||null,_stores:new Map,defineStore:function(id,setupOrOptions,storeOptions){if(window.stx._stores.has(id)&&!window.stx.__hmrStoreReplacing){return window.stx._stores.get(id)};var setupFn;if(typeof setupOrOptions==="function"){setupFn=setupOrOptions}else{var opts=setupOrOptions;setupFn=function(){var result={};var initialState=typeof opts.state==="function"?opts.state():opts.state||{};var stateSignals={};for(var key in initialState){stateSignals[key]=state(initialState[key]);result[key]=stateSignals[key]}if(opts.getters){for(var gKey in opts.getters){(function(getterKey,getterFn){result[getterKey]=derived(function(){var snapshot={};for(var sk in stateSignals){snapshot[sk]=stateSignals[sk]()}return getterFn(snapshot)})})(gKey,opts.getters[gKey])}}if(opts.actions){for(var aKey in opts.actions){(function(actionKey,actionFn){result[actionKey]=function(){var proxy=new Proxy({},{get:function(_,p){if(result[p]&&result[p]._isSignal)return result[p]();if(result[p])return result[p];return},set:function(_,p,v){if(result[p]&&result[p]._isSignal){result[p].set(v);return true}return false}});return actionFn.apply(proxy,arguments)}})(aKey,opts.actions[aKey])}}return result}};var prevDisposers=activeDisposers;activeDisposers=null;var result;try{result=setupFn()}finally{activeDisposers=prevDisposers};var signalKeys=[];var actionKeys=[];for(var dk in result){if(result[dk]&&result[dk]._isSignal)signalKeys.push(dk);else if(typeof result[dk]==="function")actionKeys.push(dk)};var _initialValues={};for(var k in result){if(result[k]&&result[k]._isSignal){_initialValues[k]=result[k]()}}result.$id=id;result.$reset=function(){batch(function(){for(var rk in _initialValues){if(result[rk]&&result[rk]._isSignal)result[rk].set(_initialValues[rk])}})};result.$patch=function(partial){batch(function(){for(var pk in partial){if(result[pk]&&result[pk]._isSignal)result[pk].set(partial[pk])}})};result.$subscribe=function(cb){var unsubs=[];for(var sk in result){if(result[sk]&&result[sk]._isSignal&&result[sk].subscribe){unsubs.push(result[sk].subscribe(function(){var snapshot={};for(var ssk in result){if(result[ssk]&&result[ssk]._isSignal)snapshot[ssk]=result[ssk]()}cb(snapshot)}))}}return function(){unsubs.forEach(function(u){u()})}};result.$dispose=function(){window.stx._stores.delete(id);if(window.__STX_STORES__)delete window.__STX_STORES__[id]};var hydrationData=window.__STX_STORE_STATE__&&window.__STX_STORE_STATE__[id];if(hydrationData){batch(function(){for(var hk in hydrationData){if(result[hk]&&result[hk]._isSignal)result[hk].set(hydrationData[hk])}})};var persistCfg=storeOptions&&storeOptions.persist;if(persistCfg){let _backendFor=function(kind){if(kind==="cookie")return"cookie";var scope=typeof window!=="undefined"?window:null;if(kind==="session"||kind==="sessionStorage")return typeof sessionStorage!=="undefined"?sessionStorage:scope&&scope.sessionStorage;return typeof localStorage!=="undefined"?localStorage:scope&&scope.localStorage},_mappedConfig=function(field){if(!fieldMap||!Object.prototype.hasOwnProperty.call(fieldMap,field))return null;var cfg=fieldMap[field];if(typeof cfg==="string")cfg={key:cfg};cfg=cfg||{};return{key:cfg.key||field,backend:_backendFor(cfg.storage===undefined?pOpts.storage:cfg.storage),cookieOpts:cfg,serialize:cfg.serialize||defaultSerialize,deserialize:cfg.deserialize||defaultDeserialize}},_inBlob=function(field){if(pick&&pick.indexOf(field)===-1)return false;return!_mappedConfig(field)};var pOpts=persistCfg===true?{}:persistCfg;var storageKey=pOpts.key||"stx-store-"+id;var pick=pOpts.pick||null;var fieldMap=pOpts.keys||null;var defaultSerialize=pOpts.serialize||function(value){return JSON.stringify(value)};var defaultDeserialize=pOpts.deserialize||function(raw){return JSON.parse(raw)};var storageType=_backendFor(pOpts.storage);try{var saved=storageType==="cookie"?null:storageType.getItem(storageKey);if(saved){var parsed=defaultDeserialize(saved);batch(function(){for(var pk in parsed){if(result[pk]&&result[pk]._isSignal&&_inBlob(pk)){result[pk].set(parsed[pk])}}})}}catch(e){console.warn("[stx:store] persistence read error:",id,e)};var prevFieldDisposers=activeDisposers;activeDisposers=null;if(fieldMap){for(var fk in fieldMap){if(!Object.prototype.hasOwnProperty.call(fieldMap,fk))continue;if(!result[fk]||!result[fk]._isSignal){console.warn("[stx:store] persist.keys names a field that is not a signal:",id,fk);continue}(function(field,cfg,signal){if(cfg.backend==="cookie"){var cookieSignal=useCookie(cfg.key,cfg.cookieOpts);var initialCookie=cookieSignal();if(initialCookie!==""&&initialCookie!=null){try{signal.set(cfg.deserialize(initialCookie))}catch(e){console.warn("[stx:store] persist read error:",id,field,e)}}effect(function(){var next=signal();try{cookieSignal.set(next==null?"":String(cfg.serialize(next)))}catch(e){console.warn("[stx:store] persist write error:",id,field,e)}});return}try{var rawValue=cfg.backend.getItem(cfg.key);if(rawValue!==null)signal.set(cfg.deserialize(rawValue))}catch(e){console.warn("[stx:store] persist read error:",id,field,e)}effect(function(){var value=signal();try{cfg.backend.setItem(cfg.key,String(cfg.serialize(value)))}catch(e){console.warn("[stx:store] persist write error:",id,field,e)}})})(fk,_mappedConfig(fk),result[fk])}}activeDisposers=prevFieldDisposers;var writeTimer=null;var prevPersistDisposers=activeDisposers;activeDisposers=null;effect(function(){var snapshot={};var wrote=false;for(var wk in result){if(result[wk]&&result[wk]._isSignal&&_inBlob(wk)){snapshot[wk]=result[wk]();wrote=true}}if(!wrote||storageType==="cookie")return;if(writeTimer)clearTimeout(writeTimer);writeTimer=setTimeout(function(){try{storageType.setItem(storageKey,String(defaultSerialize(snapshot)))}catch(e){console.warn("[stx:store] persist write error:",id,e)}},100)});activeDisposers=prevPersistDisposers}result._isStxStore=true;var seed=window.stx.__hmrStoreSeed&&window.stx.__hmrStoreSeed[id];if(seed){for(var seedKey in seed){var target=result[seedKey];if(target&&target._isSignal&&typeof target.set==="function"&&!target._isDerived){try{target.set(seed[seedKey])}catch(e){}}}}window.stx._stores.set(id,result);window.__STX_STORES__=window.__STX_STORES__||{};window.__STX_STORES__[id]=result;return result},__hmrReplaceStores:function(code){var seed={};window.stx._stores.forEach(function(store,id){var values={};for(var key in store){var value=store[key];if(value&&value._isSignal&&!value._isDerived){try{values[key]=value.peek?value.peek():value()}catch(e){}}}seed[id]=values});window.stx.__hmrStoreSeed=seed;window.stx.__hmrStoreReplacing=true;var ok=true;try{(0,eval)(code)}catch(e){ok=false;console.error("[stx:hmr] store bundle failed to evaluate:",e)}finally{window.stx.__hmrStoreReplacing=false;window.stx.__hmrStoreSeed=null}if(!ok)return false;if(window.stxRouter&&typeof window.stxRouter.refresh==="function"){try{window.stxRouter.refresh()}catch(e){}}return true},registerStoresClient:function(stores){window.__STX_STORES__=window.__STX_STORES__||{};var names=Object.keys(stores||{});for(var i=0;i<names.length;i++){var name=names[i];window.__STX_STORES__[name]=stores[name]}window.dispatchEvent(new CustomEvent("stx:stores-ready",{detail:names}))},useStore:function(id){var store=window.stx._stores.get(id);if(!store&&window.__STX_STORES__){store=window.__STX_STORES__[id]}if(!store){console.error("[stx:store] Store not found:",id,"available:",Array.from(window.stx._stores.keys()));throw new Error('[stx] Store "'+id+'" not found. Define it with defineStore() first.')}return store},mountEl:function(selector,setupFn){function doMount(){var root=document.querySelector(selector);if(!root){console.warn("[stx] mountEl: element not found:",selector);return};var prevProps=window.__STX_CURRENT_PROPS__;var prevEl=window.__STX_CURRENT_ELEMENT__;var propsAttr=root.getAttribute&&root.getAttribute("data-stx-props");window.__STX_CURRENT_PROPS__=root.__stx_props||(propsAttr?JSON.parse(propsAttr):{});window.__STX_CURRENT_ELEMENT__=root;var mountStart=mountCallbacks.length;var destroyStart=destroyCallbacks.length;var scope=setupFn();window.__STX_CURRENT_PROPS__=prevProps;window.__STX_CURRENT_ELEMENT__=prevEl;var localMountHooks=mountCallbacks.splice(mountStart);var localDestroyHooks=destroyCallbacks.splice(destroyStart);if(typeof scope==="object"&&scope!==null){scope.$el=root;scope.$refs=scope.$refs||{};root.__stx_scope=scope};var disposeEffects=trackEffects(function(){processElement(root,{...componentScope,...scope||{}})});root.__stx_disposers=disposeEffects;root.removeAttribute("x-cloak");root.querySelectorAll("[x-cloak]").forEach(function(el){el.removeAttribute("x-cloak")});localMountHooks.forEach(function(fn){try{var cleanup=fn();if(typeof cleanup==="function")localDestroyHooks.push(cleanup)}catch(e){console.error("[stx] onMount error:",e)}});root.__stx_destroy=localDestroyHooks}if(document.readyState==="loading"){mountQueue.push(doMount)}else{doMount()}},mount:function(setupFn){var scriptEl=document.currentScript;function doMount(){var isSpaPageScript=scriptEl&&scriptEl.hasAttribute&&scriptEl.hasAttribute("data-stx-page")&&!scriptEl.hasAttribute("data-stx-positioned");var root=null;if(scriptEl&&!isSpaPageScript){var previous=scriptEl.previousElementSibling;while(previous&&(previous.tagName==="SCRIPT"||previous.tagName==="STYLE"))previous=previous.previousElementSibling;var next=scriptEl.nextElementSibling;while(next&&(next.tagName==="SCRIPT"||next.tagName==="STYLE"))next=next.nextElementSibling;root=previous||next||scriptEl.parentElement};var needsFallback=!root||root===document.body||root&&root.tagName==="SCRIPT";if(needsFallback){var routerOpts=window.STX_ROUTER_OPTIONS||window.__stxRouterConfig||{};var container=document.querySelector("[data-stx-content]")||document.querySelector("[data-stx-router-container]")||(routerOpts.container?document.querySelector(routerOpts.container):null)||document.querySelector("main")||document.querySelector("#content");if(container){root=container;var hasMount=false;var children=container.children;for(var ci=0;ci<children.length;ci++){if(children[ci].__stx_scope){hasMount=true;break}}if(hasMount)for(var ci=0;ci<children.length;ci++){if(!children[ci].__stx_scope&&children[ci].tagName!=="SCRIPT"){root=children[ci];break}}}}if(!root){console.warn("[stx] mount: no root element found");return};var prevProps=window.__STX_CURRENT_PROPS__;var prevEl=window.__STX_CURRENT_ELEMENT__;var propsAttr=root.getAttribute&&root.getAttribute("data-stx-props");window.__STX_CURRENT_PROPS__=root.__stx_props||(propsAttr?JSON.parse(propsAttr):{});window.__STX_CURRENT_ELEMENT__=root;var mountStart=mountCallbacks.length;var destroyStart=destroyCallbacks.length;var scope=setupFn();window.__STX_CURRENT_PROPS__=prevProps;window.__STX_CURRENT_ELEMENT__=prevEl;var localMountHooks=mountCallbacks.splice(mountStart);var localDestroyHooks=destroyCallbacks.splice(destroyStart);if(typeof scope==="object"&&scope!==null){scope.$el=root;scope.$refs=scope.$refs||{};root.__stx_scope=scope;Object.assign(componentScope,scope)};var disposeEffects=trackEffects(function(){processElement(root,{...componentScope,...scope||{}})});root.__stx_disposers=disposeEffects;root.removeAttribute("x-cloak");root.querySelectorAll("[x-cloak]").forEach(function(el){el.removeAttribute("x-cloak")});localMountHooks.forEach(function(fn){try{var cleanup=fn();if(typeof cleanup==="function")localDestroyHooks.push(cleanup)}catch(e){console.error("[stx] onMount error:",e)}});root.__stx_destroy=localDestroyHooks};var isRoutedMount=scriptEl&&scriptEl.hasAttribute&&scriptEl.hasAttribute("data-stx-page");if(document.readyState==="loading"||isRoutedMount){mountQueue.push(doMount)}else{doMount()}}});window.state=state;window.derived=derived;window.effect=effect;window.batch=batch;window.onMount=onMount;window.onDestroy=onDestroy;window.useFetch=useFetch;window.useRef=useRef;window.navigate=navigate;window.goBack=goBack;window.goForward=goForward;window.useRoute=useRoute;window.useSearchParams=useSearchParams;window.useQuery=useQuery;window.useMutation=useMutation;window.provide=provide;window.$computed=$computed;window.$watch=$watch;window.useDebounce=useDebounce;window.useDebouncedValue=useDebouncedValue;window.useThrottle=useThrottle;window.useInterval=useInterval;window.useTimeout=useTimeout;window.useToggle=useToggle;window.useCounter=useCounter;window.useClickOutside=useClickOutside;window.useFocus=useFocus;window.nextTick=nextTick;window.useAsync=useAsync;window.useLocalStorage=useLocalStorage;window.useSessionStorage=useSessionStorage;window.useEventListener=useEventListener;window.useWebSocket=useWebSocket;window.useColorMode=useColorMode;window.useDark=useDark;window.useHead=useHead;window.useSeoMeta=useSeoMeta;window.toast=toast;window.modal=modal;window.drawer=drawer;window.stxAlert=stxAlert;window.stxConfirm=stxConfirm;window.defineStore=window.stx.defineStore;window.useStore=window.stx.useStore;window.ref=state;window.reactive=reactive;window.computed=derived;window.watch=$watch;window.watchEffect=function(fn){return effect(fn)};function __stxDevtoolsClassify(sv){var out={signals:{},derived:{},stores:{},values:{},methods:[]};if(!sv||typeof sv!=="object")return out;Object.keys(sv).forEach(function(k){if(k.indexOf("__")===0||k==="$el"||k==="$refs"||k==="$props")return;var v=sv[k];try{if(typeof v==="function"&&v._isSignal)out.signals[k]=peek(function(){return v()});else if(typeof v==="function"&&v._isDerived)out.derived[k]=peek(function(){return v()});else if(v&&v._isStxStore)out.stores[k]="[store]";else if(typeof v==="function")out.methods.push(k);else out.values[k]=v}catch(e){out.values[k]="[unreadable]"}});return out}window.__stxDevtools={version:4,enable:function(){__stxDevtoolsTracking=true},disable:function(){__stxDevtoolsTracking=false},tracking:function(){return __stxDevtoolsTracking},stats:function(){return{signalSets:__stxDevtoolsStats.signalSets,effectRuns:__stxDevtoolsStats.effectRuns,tracking:__stxDevtoolsTracking}},resetStats:function(){__stxDevtoolsStats.signalSets=0;__stxDevtoolsStats.effectRuns=0;__stxDevtoolsIfTrace.length=0;__stxDevtoolsQueries.length=0;__stxDevtoolsMutations.length=0},ifTrace:function(){return __stxDevtoolsIfTrace.slice()},queries:function(){return __stxDevtoolsQueries.slice()},mutations:function(){var nameById={};function index(container,label){if(!container||typeof container!=="object")return;Object.keys(container).forEach(function(k){if(k.indexOf("__")===0)return;var v=container[k];if(typeof v==="function"&&v._stxSignalId)nameById[v._stxSignalId]={name:k,scope:label}})};var scopes=window.stx&&window.stx._scopes||{};Object.keys(scopes).forEach(function(id){index(scopes[id],id)});if(window.stx&&window.stx._stores&&typeof window.stx._stores.forEach==="function")window.stx._stores.forEach(function(s,id){index(s,"store:"+id)});return __stxDevtoolsMutations.map(function(m){var info=nameById[m.sid];return{name:info?info.name:"(anonymous)",scope:info?info.scope:null,prev:m.prev,next:m.next}})},graph:function(){var out=[];var scopes=window.stx&&window.stx._scopes||{};Object.keys(scopes).forEach(function(scopeId){var sv=scopes[scopeId];if(!sv||typeof sv!=="object")return;var nodes=[];Object.keys(sv).forEach(function(k){if(k.indexOf("__")===0||k==="$el"||k==="$refs"||k==="$props")return;var v=sv[k];if(typeof v==="function"&&(v._isSignal||v._isDerived)){nodes.push({name:k,type:v._isDerived?"derived":"signal",value:peek(function(){return v()}),setCount:v._setCount||0,subscribers:v._effects&&typeof v._effects.size==="number"?v._effects.size:0})}});if(nodes.length)out.push({scopeId,nodes})});return out},tree:function(){var byEl=new Map;var roots=[];var nodes=document.querySelectorAll("[data-stx-scope]");Array.prototype.forEach.call(nodes,function(el){byEl.set(el,{scopeId:el.getAttribute("data-stx-scope"),tag:(el.tagName||"").toLowerCase(),children:[],el})});Array.prototype.forEach.call(nodes,function(el){var node=byEl.get(el);var p=el.parentElement;while(p&&!byEl.has(p))p=p.parentElement;if(p)byEl.get(p).children.push(node);else roots.push(node)});function clean(n){return{scopeId:n.scopeId,tag:n.tag,children:n.children.map(clean)}}return roots.map(clean)},scope:function(scopeId){var sv=window.stx&&window.stx._scopes?window.stx._scopes[scopeId]:null;return sv?__stxDevtoolsClassify(sv):null},inspect:function(el){var s=el;while(s&&!(s.getAttribute&&s.getAttribute("data-stx-scope")))s=s.parentElement;return s?this.scope(s.getAttribute("data-stx-scope")):null},stores:function(){var out={};var reg=window.stx&&window.stx._stores;if(reg&&typeof reg.forEach==="function")reg.forEach(function(v,k){out[k]=true});return out},store:function(id){var reg=window.stx&&window.stx._stores;var s=reg&&typeof reg.get==="function"?reg.get(id):null;return s?__stxDevtoolsClassify(s):null}};if(window.__stxDomReadyHandler){document.removeEventListener("DOMContentLoaded",window.__stxDomReadyHandler)};const stxDomReadyHandler=()=>{const processedScopes=new Set;const latestSetup=window.stx._latestSetup;const latestSetupName=typeof latestSetup==="function"?latestSetup.name:"";const hasLatestSetupMarker=latestSetupName&&Array.from(document.querySelectorAll("[data-stx]")).some((el)=>el.getAttribute("data-stx")===latestSetupName);if(latestSetup&&!hasLatestSetupMarker){try{const result=latestSetup();if(typeof result==="object"&&result!==null)Object.assign(componentScope,result)}catch(e){console.error("[stx] initial setup error:",e)}}document.querySelectorAll("[data-stx]").forEach((el)=>{const setupName=el.getAttribute("data-stx");if(setupName&&window[setupName]){try{const result=window[setupName]();if(typeof result==="object"&&result!==null){Object.assign(componentScope,result)}}catch(e){console.error('[stx] page setup "'+setupName+'" threw; this root will not hydrate:',e)}}});var pageScopeSnapshot={...componentScope};if(window.__stx_reactive&&window.__stx_reactive.initScope){document.querySelectorAll("[data-stx-xdata]").forEach(function(el){var scopeId=el.getAttribute("data-stx-scope");if(scopeId&&window.stx._scopes&&window.stx._scopes[scopeId])return;if(el.__stx_scope_initialized)return;var xdata=el.getAttribute("data-stx-xdata");if(!xdata)return;if(!scopeId){scopeId="__stx_scope_island_"+ ++window.stx._scopeCounter;el.setAttribute("data-stx-scope",scopeId)}el.__stx_scope_initialized=true;try{window.__stx_reactive.initScope(el,xdata,[],{},el.getAttribute("data-stx-xinit")||null)}catch(e){console.error("[stx] island scope init error:",e)}})}mountQueue.forEach(function(fn){fn()});mountQueue=[];document.querySelectorAll("[data-stx]").forEach((el)=>{var disposeEffects=trackEffects(function(){processElement(el)});el.__stx_disposers=disposeEffects;el.removeAttribute("x-cloak");el.querySelectorAll("[x-cloak]").forEach(function(c){c.removeAttribute("x-cloak")});runMountCallbacks(mountCallbacks,destroyCallbacks)});var stxRoots=document.querySelectorAll("[data-stx]");if(stxRoots.length&&Object.keys(componentScope).length){var rootParent=stxRoots[0].parentNode;if(rootParent&&rootParent.children){Array.prototype.slice.call(rootParent.children).forEach(function(sib){if(sib.nodeType!==1)return;if(sib.hasAttribute("data-stx")||sib.hasAttribute("data-stx-scope"))return;if(sib.tagName==="SCRIPT"||sib.tagName==="STYLE")return;if(sib.__stx_disposers)return;var disposeSib=trackEffects(function(){processElement(sib)});sib.__stx_disposers=disposeSib;sib.removeAttribute("x-cloak");sib.querySelectorAll("[x-cloak]").forEach(function(c){c.removeAttribute("x-cloak")})})}};var allScopes=document.querySelectorAll("[data-stx-scope]");allScopes.forEach((el)=>{const scopeId=el.getAttribute("data-stx-scope");processedScopes.add(el);const scopeVars=window.stx._scopes&&window.stx._scopes[scopeId];if(scopeVars)scopeVars.__el=el;var isDeferredIsland=!scopeVars&&el.hasAttribute&&el.hasAttribute("stx-hydrate")&&!!document.querySelector('script[data-stx-island="'+scopeId+'"]');if(isDeferredIsland){processElement(el);el.removeAttribute("x-cloak");el.querySelectorAll("[x-cloak]").forEach(function(c){c.removeAttribute("x-cloak")});return}if(!scopeVars)return;el.__stx_parent_scope=el.__stx_parent_scope||resolveComponentCallerScope(el,pageScopeSnapshot);bindParentComponentProps(el,el.__stx_parent_scope);if(scopeVars){componentScope={...componentScope,...scopeVars}};var disposeEffects=trackEffects(function(){processElement(el)});el.__stx_disposers=disposeEffects;el.removeAttribute("x-cloak");el.querySelectorAll("[x-cloak]").forEach(function(c){c.removeAttribute("x-cloak")});var scopeDeferred=el.hasAttribute&&el.hasAttribute("stx-hydrate")&&!el.__stx_hydrated;if(scopeVars&&scopeVars.__mountCallbacks&&!scopeVars.__mounted&&!scopeDeferred){scopeVars.__mounted=true;runMountCallbacks(scopeVars.__mountCallbacks,scopeDestroySink(scopeVars))}});runMountCallbacks(mountCallbacks,destroyCallbacks);mountCallbacks.length=0;document.querySelectorAll("[data-stx-auto]").forEach((el)=>{processElementSkipScopes(el,processedScopes);el.removeAttribute("x-cloak");el.querySelectorAll("[x-cloak]").forEach(function(c){c.removeAttribute("x-cloak")})});const headElements=document.querySelectorAll("head title, head meta[content]");headElements.forEach((el)=>{if(el.tagName==="TITLE"){const text=el.textContent;if(text&&text.includes("{{")){effect(()=>{try{let result=text;const matches=text.match(/\{\{\s*(.+?)\s*\}\}/g);if(matches){matches.forEach((match)=>{const expr=match.replace(/^\{\{\s*|\s*\}\}$/g,"");const fn=new Function(...Object.keys(componentScope),"return "+expr);const value=fn(...Object.values(componentScope));result=result.replace(match,value!=null?value:"")})}el.textContent=result}catch(e){if(!(e instanceof ReferenceError)&&!(e instanceof TypeError))console.warn("[STX] Title expression error:",e)}})}}else if(el.tagName==="META"){const content=el.getAttribute("content");if(content&&content.includes("{{")){const hasOnlyPlaceholders=!content.replace(/\{\{\s*__[A-Z_]+__\s*\}\}/g,"").includes("{{");if(hasOnlyPlaceholders)return;effect(()=>{try{let result=content;const matches=content.match(/\{\{\s*(.+?)\s*\}\}/g);if(matches){matches.forEach((match)=>{const expr=match.replace(/^\{\{\s*|\s*\}\}$/g,"");if(/^__[A-Z_]+__$/.test(expr.trim()))return;const fn=new Function(...Object.keys(componentScope),"return "+expr);const value=fn(...Object.values(componentScope));result=result.replace(match,value!=null?value:"")})}el.setAttribute("content",result)}catch(e){if(!(e instanceof ReferenceError)&&!(e instanceof TypeError))console.warn("[STX] Meta expression error:",e)}})}}});auditHydration(document.body,"DOMContentLoaded")};window.__stxDomReadyHandler=stxDomReadyHandler;document.addEventListener("DOMContentLoaded",stxDomReadyHandler);function disposeSubtreeScopes(root){if(!root||!window.stx||!window.stx._scopes)return;var nodes=[];if(root.getAttribute&&root.getAttribute("data-stx-scope"))nodes.push(root);if(root.querySelectorAll){var matches=root.querySelectorAll("[data-stx-scope]");for(var i=0;i<matches.length;i++)nodes.push(matches[i])}for(var n=0;n<nodes.length;n++){var el=nodes[n];var scopeId=el.getAttribute("data-stx-scope");if(!scopeId)continue;var scopeVars=window.stx._scopes[scopeId];if(!scopeVars)continue;if(scopeVars.__destroyCallbacks&&Array.isArray(scopeVars.__destroyCallbacks)){for(var j=0;j<scopeVars.__destroyCallbacks.length;j++){try{scopeVars.__destroyCallbacks[j]()}catch(e){console.warn("[stx] scope destroy error:",e)}}}delete window.stx._scopes[scopeId]}};function sweepOrphanedScopes(){if(!window.stx||!window.stx._scopes)return;var scopes=window.stx._scopes;for(var id in scopes){if(!Object.prototype.hasOwnProperty.call(scopes,id))continue;var entry=scopes[id];if(!entry)continue;var el=entry.__el;if(!el||el.isConnected)continue;var retained=false;for(var p=el;p;p=p.parentNode){if(p.__stx_if_bound||p.__stx_chain_member){retained=true;break}}if(retained)continue;if(entry.__destroyCallbacks&&Array.isArray(entry.__destroyCallbacks)){for(var k=0;k<entry.__destroyCallbacks.length;k++){try{entry.__destroyCallbacks[k]()}catch(e){console.warn("[stx] scope destroy error:",e)}}}delete scopes[id]}};var AUDIT_SKIP_TAGS={PRE:1,CODE:1,SCRIPT:1,STYLE:1,TEXTAREA:1,TEMPLATE:1};var _exprFailures={};var _exprFailureCount=0;function noteExprFailure(expr,err){if(_exprFailures[expr]!==undefined)return;if(_exprFailureCount>=50)return;_exprFailureCount++;_exprFailures[expr]=err&&err.message?err.message:String(err)};function noteExprSuccess(expr){if(_exprFailures[expr]===undefined)return;delete _exprFailures[expr];_exprFailureCount--};function auditSkipped(node){if(node.isConnected===false)return true;for(var p=node.parentNode;p;p=p.parentNode){if(p.nodeType===Node.DOCUMENT_FRAGMENT_NODE)return true;if(p.nodeType!==Node.ELEMENT_NODE)continue;if(AUDIT_SKIP_TAGS[p.tagName])return true;if(p.hasAttribute&&p.hasAttribute("data-stx-ignore"))return true;if(p.__stx_if_pending)return true;if(p.hasAttribute&&p.hasAttribute("stx-hydrate")&&!p.__stx_hydrated)return true}return false};function findLiteralMoustaches(root){var found=[];if(!root||typeof document.createTreeWalker!=="function")return found;var showText=window.NodeFilter&&window.NodeFilter.SHOW_TEXT||4;var walker=document.createTreeWalker(root,showText,null);var node;while(node=walker.nextNode()){var text=node.nodeValue==null?"":String(node.nodeValue);if(text.indexOf("{{")===-1||text.indexOf("}}")===-1)continue;if(auditSkipped(node))continue;found.push(text.trim().slice(0,80));if(found.length>=5)break}return found};function auditHydration(container,phase){try{auditHydrationUnsafe(container,phase)}catch(e){console.warn("[stx] hydration audit skipped:",e&&e.message?e.message:e)}};function auditHydrationUnsafe(container,phase){if(!window.stx||!window.stx._scopes)return;var root=container&&typeof container.querySelectorAll==="function"?container:document.body;if(!root||typeof root.querySelectorAll!=="function")return;var stranded=[];root.querySelectorAll("[data-stx-scope]").forEach(function(el){if(el.__stx_audit_recovered)return;if(el.hasAttribute("stx-hydrate")||el.__stx_hydration_scheduled)return;var scopeId=el.getAttribute("data-stx-scope");var registered=window.stx._scopes[scopeId];if(registered&&el.__stx_disposers)return;stranded.push({el,id:scopeId,registered:!!registered})});if(stranded.length){console.error("[stx] hydration invariant failed after "+phase+": "+stranded.length+" scope(s) left unhydrated — "+stranded.map(function(s){return s.id+(s.registered?" (registered, never processed)":" (not registered)")}).join(", ")+". Recovering with the ambient scope; please report with the page that produced it (stacksjs/stx#1773).");stranded.forEach(function(s){s.el.__stx_audit_recovered=true;try{var vars=s.registered?window.stx._scopes[s.id]:null;if(vars)Object.assign(componentScope,vars);s.el.__stx_disposers=trackEffects(function(){processElement(s.el,componentScope)});s.el.removeAttribute("x-cloak");s.el.querySelectorAll("[x-cloak]").forEach(function(c){c.removeAttribute("x-cloak")})}catch(e){console.error("[stx] hydration recovery failed for scope "+s.id+":",e)}})};var literals=findLiteralMoustaches(root);if(literals.length){console.error("[stx] hydration invariant failed after "+phase+": literal {{ }} left in the DOM — "+literals.join(" | ")+". An expression did not bind; see stacksjs/stx#1773. Wrap intentional "+"template syntax in <pre>/<code> or [data-stx-ignore] to exclude it.")};var brokenExprs=[];for(var expr in _exprFailures){if(Object.prototype.hasOwnProperty.call(_exprFailures,expr))brokenExprs.push(expr+" → "+_exprFailures[expr])}if(brokenExprs.length){var hint=brokenExprs.some(function(m){return m.indexOf("is not a function")!==-1})?" If one of these calls a signal, drop the parentheses: templates read "+'a signal by bare name (:if="flag"), scripts call it (flag()). Calling '+"the unwrapped value is a TypeError, which directives suppress — the "+"element just stays hidden.":"";console.error("[stx] hydration invariant failed after "+phase+": "+brokenExprs.length+" expression(s) never evaluated — "+brokenExprs.slice(0,5).join(" | ")+"."+hint);_exprFailures={};_exprFailureCount=0}};function cleanupContainer(container){if(!container)return;mountCallbacks.length=0;var preservedRefs=componentScope.$refs||{};componentScope={$refs:preservedRefs};var shellElements=document.querySelectorAll("[data-stx-content] ~ *");document.querySelectorAll("body > *").forEach(function(el){if(el===container)return;if(el.tagName==="SCRIPT"||el.tagName==="STYLE")return;if(el.__stx_scope)Object.assign(componentScope,el.__stx_scope)});container.querySelectorAll("*").forEach(function(el){if(typeof el.__stx_hydration_cancel==="function"){try{el.__stx_hydration_cancel()}catch(e){}el.__stx_hydration_cancel=null}if(el.__stx_destroy&&Array.isArray(el.__stx_destroy)){el.__stx_destroy.forEach(function(fn){try{fn()}catch(e){console.warn("[stx] destroy hook error:",e)}});el.__stx_destroy=null}if(el.__stx_disposers&&typeof el.__stx_disposers==="function"){el.__stx_disposers();el.__stx_disposers=null}});if(typeof container.__stx_hydration_cancel==="function"){try{container.__stx_hydration_cancel()}catch(e){}container.__stx_hydration_cancel=null}if(container.__stx_destroy){container.__stx_destroy.forEach(function(fn){try{fn()}catch(e){console.warn("[stx] destroy hook error:",e)}});container.__stx_destroy=null}if(container.__stx_disposers){container.__stx_disposers();container.__stx_disposers=null}container.__stx_scope=null;disposeSubtreeScopes(container);sweepOrphanedScopes()};var _stxLoadTimer=null;if(window.__stxLoadHandler){window.removeEventListener("stx:load",window.__stxLoadHandler)};function stxLoadHandler(){if(_stxLoadTimer){clearTimeout(_stxLoadTimer)}_stxLoadTimer=setTimeout(_handleStxLoad,5)}window.__stxLoadHandler=stxLoadHandler;window.addEventListener("stx:load",stxLoadHandler);function _handleStxLoad(){_stxLoadTimer=null;destroyCallbacks.forEach(function(fn){try{fn()}catch(e){console.warn("[stx] destroy callback error:",e)}});destroyCallbacks.length=0;var routerOpts=window.STX_ROUTER_OPTIONS||window.__stxRouterConfig||{};var container=document.querySelector("[data-stx-content]")||(routerOpts.container?document.querySelector(routerOpts.container):null)||document.querySelector("main")||document.querySelector("#main-content")||document.body;var usedLatestSetup=false;if(window.stx._latestSetup&&typeof window.stx._latestSetup==="function"){try{var setupResult=window.stx._latestSetup();usedLatestSetup=true;if(typeof setupResult==="object"&&setupResult!==null){Object.assign(componentScope,setupResult)}}catch(e){console.error("[stx:load] _latestSetup error:",e);usedLatestSetup=true}}if(!usedLatestSetup){document.querySelectorAll("[data-stx]").forEach(function(el){var setupName=el.getAttribute("data-stx");if(setupName&&window[setupName]){var result=window[setupName]();if(typeof result==="object")Object.assign(componentScope,result)}})};var spaPageScopeSnapshot={...componentScope};mountQueue.forEach(function(fn){fn()});mountQueue=[];if(window.__stx_reactive&&window.__stx_reactive.initScope){container.querySelectorAll("[data-stx-xdata]").forEach(function(el){var scopeId=el.getAttribute("data-stx-scope");if(scopeId&&window.stx._scopes&&window.stx._scopes[scopeId])return;var xdata=el.getAttribute("data-stx-xdata");if(!xdata)return;if(!scopeId){scopeId="__stx_scope_spa_"+ ++window.stx._scopeCounter;el.setAttribute("data-stx-scope",scopeId)};var xinit=el.getAttribute("data-stx-xinit");window.__stx_reactive.initScope(el,xdata,[],{},xinit||null)})}document.body.querySelectorAll("[data-stx-scope]").forEach(function(el){var scopeId=el.getAttribute("data-stx-scope");var scopeVars=window.stx._scopes&&window.stx._scopes[scopeId];if(scopeVars)scopeVars.__el=el;if(!scopeVars&&el.hasAttribute&&el.hasAttribute("stx-hydrate")&&!el.__stx_hydration_scheduled&&document.querySelector('script[data-stx-island="'+scopeId+'"]')){processElement(el,componentScope);el.removeAttribute("x-cloak");el.querySelectorAll("[x-cloak]").forEach(function(c){c.removeAttribute("x-cloak")});return}if(!scopeVars)return;el.__stx_parent_scope=el.__stx_parent_scope||resolveComponentCallerScope(el,spaPageScopeSnapshot);bindParentComponentProps(el,el.__stx_parent_scope);Object.assign(componentScope,scopeVars);if(el.__stx_disposers)return;var disposeEffects=trackEffects(function(){processElement(el,componentScope)});el.__stx_disposers=disposeEffects});if(!container.__stx_scope){if(container.__stx_disposers&&typeof container.__stx_disposers==="function"){container.__stx_disposers()};var disposeEffects=trackEffects(function(){processElement(container,componentScope)});container.__stx_disposers=disposeEffects}container.removeAttribute("x-cloak");container.querySelectorAll("[x-cloak]").forEach(function(c){c.removeAttribute("x-cloak")});document.body.querySelectorAll("[data-stx-scope]").forEach(function(el){var scopeId=el.getAttribute("data-stx-scope");var scopeVars=window.stx._scopes&&window.stx._scopes[scopeId];if(scopeVars&&scopeVars.__mountCallbacks&&!scopeVars.__mounted){scopeVars.__mounted=true;runMountCallbacks(scopeVars.__mountCallbacks,scopeDestroySink(scopeVars))}});runMountCallbacks(mountCallbacks,destroyCallbacks);mountCallbacks.length=0;auditHydration(container,"stx:load")};function processElementSkipScopes(el,processedScopes){if(processedScopes.has(el))return;if(el.nodeType===Node.TEXT_NODE){processElement(el);return}if(el.nodeType!==Node.ELEMENT_NODE)return;if(el.hasAttribute&&el.hasAttribute("data-stx-scope"))return;if(el.__stx_chain_member&&!el.__stx_chain_active)return;const hasFor=el.hasAttribute&&(el.hasAttribute("@for")||el.hasAttribute(":for")||el.hasAttribute("x-for"));const hasIf=el.hasAttribute&&(el.hasAttribute("@if")||el.hasAttribute(":if")||el.hasAttribute("x-if"));if(hasFor){var fa=el.hasAttribute(":for")?":for":el.hasAttribute("x-for")?"x-for":"@for";bindFor(el,componentScope,fa);return}if(hasIf){var ia=el.hasAttribute(":if")?":if":el.hasAttribute("x-if")?"x-if":"@if";var ic=findIfChain(el,ia);if(ic.length>1)bindIfChain(ic,componentScope);else bindIf(el,componentScope,ia);return}if(el.hasAttribute&&(el.hasAttribute("@show")||el.hasAttribute(":show")||el.hasAttribute("x-show"))){var sa=el.hasAttribute(":show")?":show":el.hasAttribute("x-show")?"x-show":"@show";bindShow(el,el.getAttribute(sa),componentScope,sa)};var mb=getModelBinding(el);if(mb){bindModel(el,mb.expression,componentScope,mb.name)}if(el.tagName!=="SCRIPT"&&el.tagName!=="STYLE"){Array.from(el.childNodes).forEach((child)=>processElementSkipScopes(child,processedScopes))}}})();
|