@stacksjs/stx 0.2.857 → 0.2.858
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/chunk-0ts3p84y.js +2 -0
- package/dist/{chunk-sgnkbgx1.js → chunk-0vptj943.js} +2 -2
- package/dist/{chunk-0d3z8hwz.js → chunk-0z2gqttt.js} +9 -9
- package/dist/{chunk-g0h1gxew.js → chunk-1347hwt5.js} +9 -9
- package/dist/chunk-139mxsyc.js +2 -0
- package/dist/chunk-1barsha6.js +2 -0
- package/dist/chunk-1fnx7ze9.js +2 -0
- package/dist/chunk-1g06wfs9.js +2 -0
- package/dist/chunk-1nasq00e.js +2 -0
- package/dist/{chunk-v1eycdhj.js → chunk-1z2am28h.js} +2 -2
- package/dist/chunk-2102tvxh.js +2 -0
- package/dist/{chunk-0veh8bcn.js → chunk-252enthj.js} +1 -1
- package/dist/{chunk-cvrkr3re.js → chunk-2bks42z4.js} +4 -4
- package/dist/chunk-39cwa35j.js +2 -0
- package/dist/{chunk-fj5jw2jd.js → chunk-3b7q7d7j.js} +6 -6
- package/dist/{chunk-fyp1v087.js → chunk-3evwxrpx.js} +1 -1
- package/dist/chunk-3rcegvgg.js +2 -0
- package/dist/chunk-3wvq28hz.js +2 -0
- package/dist/{chunk-zx5bt056.js → chunk-4ezfen91.js} +8 -8
- package/dist/{chunk-41md2f3q.js → chunk-5xy1z71a.js} +4 -4
- package/dist/{chunk-63rvsnt2.js → chunk-69zj9q02.js} +3 -3
- package/dist/{chunk-chr56bhk.js → chunk-6d74qdc6.js} +1 -1
- package/dist/chunk-6m4v1tsq.js +2 -0
- package/dist/{chunk-dnrgcjds.js → chunk-6qbha6fb.js} +5 -5
- package/dist/{chunk-3wabhzf4.js → chunk-71s4hpkj.js} +3 -3
- package/dist/chunk-75e4wzzs.js +3 -0
- package/dist/{chunk-wdh20fxz.js → chunk-78amng8s.js} +5 -5
- package/dist/chunk-7ambc4f7.js +2 -0
- package/dist/{chunk-432c35hs.js → chunk-7fgfzaah.js} +2 -2
- package/dist/{chunk-xfymp197.js → chunk-8623gte8.js} +6 -6
- package/dist/{chunk-mpmnbvy4.js → chunk-8cpqcn19.js} +5 -5
- package/dist/chunk-8nmc3rh7.js +2 -0
- package/dist/chunk-8pn7ah12.js +2 -0
- package/dist/chunk-8zwwmnpb.js +2 -0
- package/dist/chunk-98bgx3ws.js +2 -0
- package/dist/chunk-a58w524e.js +2 -0
- package/dist/chunk-a6v6x2pg.js +2 -0
- package/dist/{chunk-cama7kaq.js → chunk-afrqm7w5.js} +3 -3
- package/dist/{chunk-t3a3wbjk.js → chunk-az9b4bj4.js} +2 -2
- package/dist/chunk-b62mr2kz.js +2 -0
- package/dist/chunk-b7vxb2y6.js +2 -0
- package/dist/chunk-bb20hnqd.js +2 -0
- package/dist/chunk-bc3sknxf.js +2 -0
- package/dist/{chunk-fphnst8a.js → chunk-bef0wr53.js} +5 -5
- package/dist/{chunk-npzzbdn1.js → chunk-bhzh7mj1.js} +1 -1
- package/dist/{chunk-08a7j82a.js → chunk-bxn4b0wm.js} +2 -2
- package/dist/{chunk-zrsc45wv.js → chunk-c7eew8qs.js} +1 -1
- package/dist/chunk-cbrbrkp1.js +2 -0
- package/dist/{chunk-xw12cd90.js → chunk-cqkr291c.js} +3 -3
- package/dist/{chunk-mmdqdkbd.js → chunk-d6am6en8.js} +1 -1
- package/dist/chunk-d8djpp7f.js +2 -0
- package/dist/chunk-dk6t4h48.js +2 -0
- package/dist/chunk-dkbm7117.js +2 -0
- package/dist/chunk-e44bse67.js +2 -0
- package/dist/{chunk-kvafq9gy.js → chunk-e763qsg0.js} +2 -2
- package/dist/{chunk-pm241ehv.js → chunk-e7thwrt5.js} +2 -2
- package/dist/{chunk-1ywqsmy2.js → chunk-eazccp6e.js} +2 -2
- package/dist/{chunk-1772ax8e.js → chunk-egwtv5hp.js} +3 -3
- package/dist/chunk-ewnfgczq.js +2 -0
- package/dist/chunk-f1v5hvbt.js +2 -0
- package/dist/{chunk-914wcp1a.js → chunk-fbnykfnv.js} +3 -3
- package/dist/{chunk-827rt3ew.js → chunk-fd7e162p.js} +3 -3
- package/dist/{chunk-fhrvxfq9.js → chunk-ff3j7jnf.js} +2 -2
- package/dist/{chunk-j2wcawmf.js → chunk-fw50vydb.js} +2 -2
- package/dist/{chunk-xejhmsfw.js → chunk-fxk1psd8.js} +30 -30
- package/dist/chunk-g6epqcb3.js +2 -0
- package/dist/{chunk-23mccy5y.js → chunk-g8d24rfk.js} +2 -2
- package/dist/{chunk-ya6f7mt5.js → chunk-gjbnzn7k.js} +4 -4
- package/dist/chunk-gmvypdm8.js +2 -0
- package/dist/{chunk-sb7zn84j.js → chunk-gz0j98dy.js} +2 -2
- package/dist/{chunk-csksn1kg.js → chunk-hjh5wt5f.js} +2 -2
- package/dist/chunk-hmgry6dn.js +2 -0
- package/dist/{chunk-s37af6rd.js → chunk-jafn7f7f.js} +2 -2
- package/dist/chunk-jbv1srnh.js +2 -0
- package/dist/{chunk-fp24ecp8.js → chunk-jdqmk5sv.js} +40 -40
- package/dist/{chunk-d4gy4yz0.js → chunk-jgvwzt1t.js} +2 -2
- package/dist/{chunk-0hrkpb2h.js → chunk-jtag68hg.js} +2 -2
- package/dist/chunk-jwtp4csj.js +20 -0
- package/dist/{chunk-dhpd4mx7.js → chunk-jwwsxym6.js} +2 -2
- package/dist/chunk-jzynkjfc.js +2 -0
- package/dist/{chunk-n77xrpv9.js → chunk-k19ba3jz.js} +2 -2
- package/dist/chunk-k1qajhpx.js +2 -0
- package/dist/{chunk-tm8a2b69.js → chunk-kedgfk9z.js} +4 -4
- package/dist/{chunk-sftyb8k4.js → chunk-kq3h2rjq.js} +4 -4
- package/dist/{chunk-k0ert6e7.js → chunk-ksxbfyef.js} +2 -2
- package/dist/chunk-m28j4ym7.js +2 -0
- package/dist/{chunk-4nhbbcr9.js → chunk-m2rm2gxv.js} +5 -5
- package/dist/{chunk-cskmp5p1.js → chunk-me16tftr.js} +1 -1
- package/dist/{chunk-bkefg64w.js → chunk-mh45hcsa.js} +5 -5
- package/dist/{chunk-16p1vkn6.js → chunk-mxazxwc4.js} +3 -3
- package/dist/chunk-mzembfxk.js +2 -0
- package/dist/{chunk-hfng042r.js → chunk-mzg1wq86.js} +14 -14
- package/dist/chunk-ngzjwp2e.js +2 -0
- package/dist/chunk-nj9n0en9.js +2 -0
- package/dist/{chunk-6zj9wsy3.js → chunk-nv5xhfwz.js} +2 -2
- package/dist/chunk-nyasqjnt.js +2 -0
- package/dist/{chunk-j2s8j7ff.js → chunk-pa8xkctc.js} +6 -6
- package/dist/chunk-pn0rmd8d.js +2 -0
- package/dist/chunk-pvx1hrqq.js +2 -0
- package/dist/chunk-q78dsejp.js +2 -0
- package/dist/{chunk-8hymdzv2.js → chunk-q93jcdgj.js} +5 -5
- package/dist/{chunk-6tpcm12w.js → chunk-qv52et0d.js} +1 -1
- package/dist/{chunk-1277d5we.js → chunk-qvwzaxdd.js} +4 -4
- package/dist/chunk-qw1f97s7.js +2 -0
- package/dist/chunk-rcn0yyh2.js +2 -0
- package/dist/{chunk-1kmzj10y.js → chunk-rq9pqd4s.js} +5 -5
- package/dist/{chunk-htwn1f36.js → chunk-s322kcw7.js} +5 -5
- package/dist/{chunk-w7p34cr3.js → chunk-smve11g0.js} +1 -1
- package/dist/{chunk-gqrypyk7.js → chunk-snmq7yn4.js} +3 -3
- package/dist/chunk-t9h3e3bp.js +2 -0
- package/dist/{chunk-bg574nvy.js → chunk-tjer45j7.js} +2 -2
- package/dist/{chunk-xqr2ec9k.js → chunk-tk67pqaf.js} +3 -3
- package/dist/{chunk-4tzsze9z.js → chunk-tpw435g0.js} +2 -2
- package/dist/chunk-ts9bvjzh.js +2 -0
- package/dist/chunk-tzvgjrp4.js +2 -0
- package/dist/{chunk-1qvtme01.js → chunk-v8b1wz1b.js} +1 -1
- package/dist/{chunk-qvydfw8g.js → chunk-va1hj69e.js} +4 -4
- package/dist/{chunk-r69en2jg.js → chunk-w7s3afam.js} +1 -1
- package/dist/chunk-w9aa8xte.js +2 -0
- package/dist/{chunk-eefdz43s.js → chunk-wd4z5w4d.js} +1 -1
- package/dist/chunk-wegkgjmf.js +2 -0
- package/dist/chunk-wn065q3f.js +2 -0
- package/dist/{chunk-bq6jy4yk.js → chunk-wskdnfh9.js} +4 -4
- package/dist/{chunk-jr346anv.js → chunk-xhvw0t0f.js} +2 -2
- package/dist/{chunk-jefafv6s.js → chunk-xz1csyq9.js} +9 -9
- package/dist/chunk-y2dtqrrz.js +2 -0
- package/dist/{chunk-mfwfaggj.js → chunk-y67r0d0c.js} +3 -3
- package/dist/chunk-yss7n9db.js +2 -0
- package/dist/chunk-z6p0yxwd.js +2 -0
- package/dist/{chunk-5erremft.js → chunk-z703xzhy.js} +2 -2
- package/dist/chunk-zcpwc47w.js +2 -0
- package/dist/{chunk-2cy33z00.js → chunk-zn9dp7yn.js} +4 -4
- package/dist/chunk-zsmrq1w3.js +2 -0
- package/dist/cli.js +13 -13
- package/dist/client-script-bundler.d.ts +21 -0
- package/dist/client-script-bundler.js +14 -0
- package/dist/craft-entry.js +2 -2
- package/dist/craft.js +2 -2
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1 -0
- package/dist/pwa.js +3 -3
- package/dist/ssg.js +3 -3
- package/package.json +5 -5
- package/dist/chunk-03t7tk2k.js +0 -2
- package/dist/chunk-05f4tjsq.js +0 -2
- package/dist/chunk-08vwk3x7.js +0 -2
- package/dist/chunk-0xwmweqm.js +0 -2
- package/dist/chunk-1ffkbwdz.js +0 -2
- package/dist/chunk-1qbagang.js +0 -2
- package/dist/chunk-1xx55d2p.js +0 -2
- package/dist/chunk-2a471sw1.js +0 -3
- package/dist/chunk-2jrf9m4w.js +0 -2
- package/dist/chunk-3jgrrjvx.js +0 -2
- package/dist/chunk-5758n8sm.js +0 -2
- package/dist/chunk-655m8g98.js +0 -2
- package/dist/chunk-68kspmq4.js +0 -2
- package/dist/chunk-6x0jm4bv.js +0 -2
- package/dist/chunk-8j8fth4b.js +0 -2
- package/dist/chunk-8ta5b0eb.js +0 -2
- package/dist/chunk-93cgpqva.js +0 -2
- package/dist/chunk-9wf5fx4s.js +0 -2
- package/dist/chunk-a53jtd74.js +0 -2
- package/dist/chunk-b16g785w.js +0 -2
- package/dist/chunk-bz4bskx3.js +0 -2
- package/dist/chunk-ccdp6g5z.js +0 -2
- package/dist/chunk-dee5mtdv.js +0 -2
- package/dist/chunk-dm10y06z.js +0 -2
- package/dist/chunk-dtxg2a6m.js +0 -2
- package/dist/chunk-dw9vnhc4.js +0 -2
- package/dist/chunk-ent64fyq.js +0 -2
- package/dist/chunk-erfspa7v.js +0 -2
- package/dist/chunk-f0kveh4g.js +0 -2
- package/dist/chunk-f1z6y2ts.js +0 -2
- package/dist/chunk-f3msj6jf.js +0 -2
- package/dist/chunk-fk7wk568.js +0 -2
- package/dist/chunk-fsg958xx.js +0 -2
- package/dist/chunk-gggethdc.js +0 -2
- package/dist/chunk-gr19kv83.js +0 -2
- package/dist/chunk-hj1yn8w5.js +0 -2
- package/dist/chunk-hzrcnxzg.js +0 -2
- package/dist/chunk-jed9n2hz.js +0 -2
- package/dist/chunk-js7nmw8v.js +0 -2
- package/dist/chunk-kfq4mwem.js +0 -2
- package/dist/chunk-knd3m4t4.js +0 -2
- package/dist/chunk-m3kc2a3v.js +0 -2
- package/dist/chunk-mjp2sp74.js +0 -2
- package/dist/chunk-mx79sfyr.js +0 -2
- package/dist/chunk-n68sanmz.js +0 -2
- package/dist/chunk-n6w82yf2.js +0 -2
- package/dist/chunk-nstcwcpj.js +0 -2
- package/dist/chunk-q1z8edtn.js +0 -2
- package/dist/chunk-qw0ctwnc.js +0 -20
- package/dist/chunk-rrf78ezg.js +0 -2
- package/dist/chunk-syww37qd.js +0 -2
- package/dist/chunk-vmrvkbw6.js +0 -2
- package/dist/chunk-vr5h5jpw.js +0 -2
- package/dist/chunk-vw9h1x2m.js +0 -2
- package/dist/chunk-wg7xzens.js +0 -2
- package/dist/chunk-x2vybq9n.js +0 -2
- package/dist/chunk-y5agvhgg.js +0 -2
- package/dist/chunk-zd2c84ct.js +0 -2
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Ni,my,hy,bl,We,Ig,to,yy,by,wy,vy,xy,Sy,ky,_y,Cy}from"./chunk-0z2gqttt.js";export{Sy as applyHead,yy as definePageMeta,Ni as getHead,my as getPageMeta,We as mergeHeadConfigs,ky as processHeadDirective,Cy as processMetaDirective,_y as processTitleDirective,xy as renderBodyAttrs,wy as renderHead,vy as renderHtmlAttrs,hy as resetHead,to as seoMetaToHeadConfig,bl as useHead,by as usePageTitle,Ig as useSeoMeta,by as useTitle};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{a}from"./chunk-
|
|
3
|
-
export{
|
|
2
|
+
import{a}from"./chunk-1347hwt5.js";import{xo}from"./chunk-12r22pf0.js";import p from"path";async function om(t={}){let l=performance.now(),s=t.root||process.cwd(),e=await a(s),o=t.ssr?.routeRules??e.routeRules??{};if(xo(o),!e.ssr&&Object.keys(o).length)throw Error("routeRules require ssr: true and the production server; flat SSG output cannot apply request/cache policies");if(!e.ssr&&(t.ssr?.serverApi??e.serverApi))throw Error("serverApi requires ssr: true; flat SSG output cannot execute API endpoints");let r=e.ssr?"ssr":"ssg";console.log(`[stx build] Mode: ${r.toUpperCase()}${e.ssr?" (ssr: true in stx.config.ts)":" (default \u2014 ssr is false)"}`);let u,n;if(r==="ssg"){let{generateStaticSite:i}=await import("./ssg.js");u=await i({pagesDir:p.join(e.root||".",e.pagesDir||e.build?.pagesDir||"pages"),publicDir:e.publicDir||e.build?.publicDir||"public",outputDir:e.build?.outputDir||"dist",generate404:e.build?.generate404??!0,minify:e.build?.minify??!0,cleanOutput:e.build?.cleanOutput??!0,router:e.router,...t.ssg})}else{let{buildForProduction:i}=await import("./chunk-a58w524e.js");n=await i({root:s,outputDir:".output",debug:t.debug,...t.ssr})}let d=Math.round(performance.now()-l);return{mode:r,ssg:u,ssr:n,duration:d}}
|
|
3
|
+
export{om};
|
|
@@ -25,7 +25,7 @@ ${"\x1B[31m"}\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\
|
|
|
25
25
|
`;n.appendFileSync(this.logFilePath,s,"utf-8")}catch(n){if(process.env.STX_DEBUG==="true")console.error("Failed to write to error log:",n)}})}async rotateIfNeeded(e){try{if(!e.existsSync(this.logFilePath))return;if(e.statSync(this.logFilePath).size<this.maxFileSize)return;for(let r=this.maxLogFiles-1;r>=1;r--){let i=`${this.logFilePath}.${r}`,s=`${this.logFilePath}.${r+1}`;if(e.existsSync(i))if(r>=this.maxLogFiles-1)e.unlinkSync(i);else e.renameSync(i,s)}if(this.maxLogFiles<=1)e.writeFileSync(this.logFilePath,"");else e.renameSync(this.logFilePath,`${this.logFilePath}.1`)}catch(n){if(process.env.STX_DEBUG==="true")console.error("Failed to rotate error logs:",n)}}getRecentErrors(e=10){return this.errors.slice(-e)}getErrorsByType(e){return this.errors.filter((n)=>n.error.constructor.name===e)}getErrorsByLevel(e){return this.errors.filter((n)=>n.level===e)}clear(){this.errors.length=0}async clearLogFile(){try{let e=await import("fs");if(e.existsSync(this.logFilePath))e.writeFileSync(this.logFilePath,"","utf-8")}catch(e){if(process.env.STX_DEBUG==="true")console.error("Failed to clear error log:",e)}}getStats(){let e={},n={error:0,warning:0,info:0};for(let r of this.errors){let i=r.error.constructor.name;e[i]=(e[i]||0)+1;let s=r.level||"error";n[s]=(n[s]||0)+1}return{total:this.errors.length,byType:e,byLevel:n}}async exportToFile(e,n="json"){let r=await import("fs"),i=await import("path"),s=i.dirname(e);if(!r.existsSync(s))r.mkdirSync(s,{recursive:!0});if(n==="json"){let o=this.errors.map((a)=>({timestamp:a.timestamp.toISOString(),level:a.level||"error",type:a.error.constructor.name,message:a.error.message,stack:a.error.stack,context:a.context}));r.writeFileSync(e,JSON.stringify(o,null,2),"utf-8")}else{let o=this.errors.map((a)=>this.formatEntry(a));r.writeFileSync(e,o.join(`
|
|
26
26
|
|
|
27
27
|
`),"utf-8")}}async flush(){await this.writeQueue}}var z=new ne,En={isDevelopment(){return G()},logDetailedError(e,n){if(!this.isDevelopment())return;if(console.error("=== stx Detailed Error ==="),console.error("Error:",e.message),console.error("Stack:",e.stack),n)console.error("Context:",n);console.error("========================")},createErrorReport(e,n){let r=["=== stx Error Report ===",`Time: ${new Date().toISOString()}`,`Error: ${e.message}`,`Type: ${e.constructor.name}`,`Stack: ${e.stack}`];if(n)r.push(`Context: ${JSON.stringify(n,null,2)}`);return r.push("========================"),r.join(`
|
|
28
|
-
`)}};function x(e,n,r,i=0){let s=0,o=i,a=null,c=0,p=!1;while(o<e.length){let g=e[o];if(a&&p){p=!1,o++;continue}if(a&&g==="\\"){p=!0,o++;continue}if(p=!1,(g==='"'||g==="'"||g==="`")&&!a){a=g,o++;continue}if(g===a&&a!=="`"){a=null,o++;continue}if(a==="`"&&g==="$"&&e[o+1]==="{"){c++,o+=2;continue}if(c>0&&g==="}"){c--,o++;continue}if(g==="`"&&a==="`"&&c===0){a=null,o++;continue}if(a){o++;continue}if(g===n)s++;else if(g===r){if(s--,s===0)return o}o++}return-1}function
|
|
28
|
+
`)}};function x(e,n,r,i=0){let s=0,o=i,a=null,c=0,p=!1;while(o<e.length){let g=e[o];if(a&&p){p=!1,o++;continue}if(a&&g==="\\"){p=!0,o++;continue}if(p=!1,(g==='"'||g==="'"||g==="`")&&!a){a=g,o++;continue}if(g===a&&a!=="`"){a=null,o++;continue}if(a==="`"&&g==="$"&&e[o+1]==="{"){c++,o+=2;continue}if(c>0&&g==="}"){c--,o++;continue}if(g==="`"&&a==="`"&&c===0){a=null,o++;continue}if(a){o++;continue}if(g===n)s++;else if(g===r){if(s--,s===0)return o}o++}return-1}function pl(e,n){let r=n,i={paren:0,bracket:0,brace:0},s=null,o=0;while(r<e.length){let a=e[r];if((r>0?e[r-1]:"")==="\\"&&s){r++;continue}if((a==='"'||a==="'")&&!s){s=a,r++;continue}if(a===s&&s!=="`"){s=null,r++;continue}if(a==="`"&&!s){s="`",r++;continue}if(a==="`"&&s==="`"&&o===0){s=null,r++;continue}if(s==="`"&&a==="$"&&e[r+1]==="{"){o++,r+=2;continue}if(o>0){if(a==="{")o++;else if(a==="}")o--;r++;continue}if(s){r++;continue}if(i.paren===0&&i.bracket===0&&i.brace===0){if(e.slice(r,r+2)==="}}"||e.slice(r,r+3)==="!!}")break;if(a===","||a===";")break}if(a==="(")i.paren++;else if(a===")"){if(i.paren--,i.paren<0)break}else if(a==="[")i.bracket++;else if(a==="]"){if(i.bracket--,i.bracket<0)break}else if(a==="{")i.brace++;else if(a==="}"){if(i.brace--,i.brace<0)break}r++}return{expression:e.slice(n,r),endPos:r}}class R{cache=new Map;maxSize;options;sizes;bytes=0;constructor(e=100,n){this.maxSize=e,this.options=n??null,this.sizes=n?new Map:null}get byteSize(){return this.bytes}setMaxBytes(e){if(!this.options)return;this.options={...this.options,maxBytes:e};while(this.bytes>e&&this.cache.size>0){let n=this.cache.keys().next().value;if(n===void 0)break;this.delete(n)}}get(e){if(!this.cache.has(e))return;let n=this.cache.get(e);return this.cache.delete(e),this.cache.set(e,n),n}set(e,n){if(this.cache.has(e))this.delete(e);let r=this.options?this.options.sizeOf(n):0;if(this.options&&r>this.options.maxBytes)return;while(this.cache.size>0&&(this.cache.size>=this.maxSize||this.options!==null&&this.bytes+r>this.options.maxBytes)){let i=this.cache.keys().next().value;if(i===void 0)break;this.delete(i)}if(this.cache.set(e,n),this.sizes)this.sizes.set(e,r),this.bytes+=r}has(e){return this.cache.has(e)}delete(e){if(this.sizes){let n=this.sizes.get(e);if(n!==void 0)this.bytes-=n,this.sizes.delete(e)}return this.cache.delete(e)}clear(){this.cache.clear(),this.sizes?.clear(),this.bytes=0}get size(){return this.cache.size}keys(){return this.cache.keys()}values(){return this.cache.values()}}var M=new Map,Tt=500;function Ft(e,n){if(n?.includes("g"))return new RegExp(e,n);let r=`${e}:${n||""}`;if(!M.has(r)){if(M.size>=Tt){let i=M.keys().next().value;if(i)M.delete(i)}M.set(r,new RegExp(e,n))}return M.get(r)}class ke{pool=[];maxPoolSize=10;fnCache=new Map;fnCacheMaxSize=200;getEvaluator(e){let n=Array.from(new Set(e)),r=n.sort().join(","),i=this.pool.find((c)=>c.context.join(",")===r);if(i)return i.func;let s=this.fnCache,o=this.fnCacheMaxSize,a=(...c)=>(p)=>{try{let g=`${r}:${p}`,h=s.get(g);if(!h){if(s.size>=o){let m=s.keys().next().value;if(m)s.delete(m)}h=Function(...n,`
|
|
29
29
|
'use strict';
|
|
30
30
|
try {
|
|
31
31
|
return ${p};
|
|
@@ -36,7 +36,7 @@ catch (e) {
|
|
|
36
36
|
}
|
|
37
37
|
throw e;
|
|
38
38
|
}
|
|
39
|
-
`),s.set(g,h)}return h(...c)}catch{return}};if(this.pool.length<this.maxPoolSize)this.pool.push({func:a,context:n.slice()});return a}clear(){this.pool.length=0,this.fnCache.clear()}}var or=new ke;class Te{metrics=new Map;budgets=new Map;violations=[];maxViolations=100;violationHandlers=[];enabled=!0;setEnabled(e){this.enabled=e}isEnabled(){return this.enabled}setBudget(e,n){this.budgets.set(e,{warnThreshold:0.8,action:"warn",...n})}setBudgets(e){for(let[n,r]of Object.entries(e))this.setBudget(n,r)}removeBudget(e){this.budgets.delete(e)}getBudgets(){let e={};for(let[n,r]of this.budgets.entries())e[n]=r;return e}onViolation(e){this.violationHandlers.push(e)}offViolation(e){let n=this.violationHandlers.indexOf(e);if(n!==-1)this.violationHandlers.splice(n,1)}time(e,n){if(!this.enabled)return n();let r=performance.now(),i=n(),s=performance.now()-r;return this.recordTime(e,s),this.checkBudget(e,s),i}async timeAsync(e,n){if(!this.enabled)return n();let r=performance.now(),i=await n(),s=performance.now()-r;return this.recordTime(e,s),this.checkBudget(e,s),i}checkBudget(e,n){let r=this.budgets.get(e);if(!r)return;let i=n/r.maxTime*100,s=r.warnThreshold!==void 0?n>=r.maxTime*r.warnThreshold&&n<r.maxTime:!1,o=n>=r.maxTime;if(!s&&!o)return;let a={label:e,actualTime:n,budgetTime:r.maxTime,exceedancePercent:i,timestamp:new Date,isWarning:s};this.violations.push(a);while(this.violations.length>this.maxViolations)this.violations.shift();for(let p of this.violationHandlers)try{p(a)}catch{}let c=s?`[Performance Warning] "${e}" took ${n.toFixed(2)}ms (${i.toFixed(1)}% of ${r.maxTime}ms budget)`:`[Performance Budget Exceeded] "${e}" took ${n.toFixed(2)}ms (exceeded ${r.maxTime}ms budget by ${(i-100).toFixed(1)}%)`;switch(r.action){case"log":console.log(c);break;case"warn":console.warn(c);break;case"error":console.error(c);break;case"throw":if(o)throw Error(c);else console.warn(c);break}}recordTime(e,n){let r=this.metrics.get(e);if(r)r.count++,r.totalTime+=n,r.maxTime=Math.max(r.maxTime,n),r.minTime=Math.min(r.minTime,n);else this.metrics.set(e,{count:1,totalTime:n,maxTime:n,minTime:n})}getStats(e){if(e){let r=this.metrics.get(e);if(!r)return{};let i=this.budgets.get(e);return{count:r.count,avgTime:r.totalTime/r.count,totalTime:r.totalTime,maxTime:r.maxTime,minTime:r.minTime,budget:i?.maxTime,budgetUtilization:i?r.totalTime/r.count/i.maxTime*100:void 0}}let n={};for(let[r,i]of this.metrics.entries()){let s=this.budgets.get(r);n[r]={count:i.count,avgTime:i.totalTime/i.count,totalTime:i.totalTime,maxTime:i.maxTime,minTime:i.minTime,budget:s?.maxTime,budgetUtilization:s?i.totalTime/i.count/s.maxTime*100:void 0}}return n}getViolations(e){if(e)return this.violations.filter((n)=>n.label===e);return[...this.violations]}getViolationStats(){let e={},n=0,r=0;for(let i of this.violations)if(e[i.label]=(e[i.label]||0)+1,i.isWarning)n++;else r++;return{total:this.violations.length,byLabel:e,warnings:n,errors:r}}clear(){this.metrics.clear()}clearViolations(){this.violations.length=0}clearBudgets(){this.budgets.clear()}reset(){this.clear(),this.clearViolations(),this.clearBudgets(),this.violationHandlers.length=0}}var re=null;function Rt(){if(!re)re=new Te;return re}var le=new Proxy({},{get(e,n){return Rt()[n]}});var Se=0;async function _(){if(performance.now()-Se<16)return;await new Promise((e)=>setTimeout(e,0)),Se=performance.now()}var $t={maxSanitizeDepth:10,allowBracketNotation:!1},Le={...$t};var U=/\bnew\s+/,V="__stx_safe_ctors",Me=["Bun","Deno","Buffer","fetch","atob","btoa","console","Response","Request","Headers","WebAssembly","structuredClone","queueMicrotask","crypto","performance","navigator","Worker","WebSocket","BroadcastChannel","EventSource","XMLHttpRequest","localStorage","sessionStorage"],ie=[...Me,"Function","setTimeout","setInterval","setImmediate","process","require","exports","module","window","document","global","globalThis","Reflect","Proxy","Symbol","WeakMap","WeakSet","WeakRef","FinalizationRegistry"],Re=ie.map(()=>{return}),se=Object.freeze(Object.assign(Object.create(null),{keys:Object.keys,values:Object.values,entries:Object.entries,fromEntries:Object.fromEntries,assign:Object.assign,hasOwn:Object.hasOwn,is:Object.is})),ae=[/\b(eval|Function|setTimeout|setInterval|setImmediate)\b/,/\b(process|require|import|exports|module)\b/,/\b(window|document|global|globalThis)\b/,/\b(constructor|prototype|__proto__)\b/,/\b(Reflect|Proxy)\b/,/\bSymbol\b/,/\b(WeakMap|WeakSet|WeakRef|FinalizationRegistry)\b/,/\b(Generator|AsyncGenerator)\b/,/__\w+__/,/\.(bind|call|apply)\s*\(/,U,/\bdelete\s+/,/\bthis\b/,/\\u(?:\{[\dA-Fa-f]+\}|[\dA-Fa-f]{4})/],ce=new Set([...Me,"eval","Function","setTimeout","setInterval","setImmediate","process","require","import","exports","module","window","document","global","globalThis","constructor","prototype","Reflect","Proxy","Symbol","WeakMap","WeakSet","WeakRef","FinalizationRegistry","Generator","AsyncGenerator","delete","this",V]),ue=new Set(["__proto__","constructor","prototype"]);function Ne(e){let n="",r=[],i=null,s=!1;for(let o=0;o<e.length;o++){let a=e[o];if(s){s=!1;continue}if(a==="\\"&&i){s=!0;continue}if(i){if(i==="`"&&a==="$"&&o+1<e.length&&e[o+1]==="{"){let c=1;o+=2;while(o<e.length&&c>0){if(e[o]==="{")c++;else if(e[o]==="}")c--;if(c>0)n+=e[o],r.push(o),o++}continue}if(a===i)i=null;continue}if(a==='"'||a==="'"||a==="`"){i=a;continue}n+=a,r.push(o)}return{text:n,map:r}}function De(e){return Ne(e).text}var Fe=["Collator","DateTimeFormat","DisplayNames","ListFormat","Locale","NumberFormat","PluralRules","RelativeTimeFormat","Segmenter"],ze=(()=>{let e={Date,URL,URLSearchParams},n=Intl;for(let r of Fe)if(typeof n[r]==="function")e[`Intl_${r}`]=n[r];return Object.freeze(Object.assign(Object.create(null),e))})(),Ct=/^new(\s+)(Date|URLSearchParams|URL|Intl\s*\.\s*([A-Z_a-z]\w*))\s*\(/,$e=/(?<![\w$])new(?![\w$])/g,Ae=`only new Date(), new URL(), new URLSearchParams() and new Intl.{${Fe.join(",")}}() are allowed`;function At(e){let{text:n,map:r}=Ne(e),i=[];$e.lastIndex=0;let s;while((s=$e.exec(n))!==null){let a=s.index;if(/(?<!\.)\.\s*$/.test(n.slice(0,a)))continue;let c=Ct.exec(n.slice(a)),p=c?.[3],g=!c?null:p?`Intl_${p}`:c[2];if(!c||!g||!(g in ze))throw new S(`matched /${U.source}/; ${Ae}`,e);let h=a+c[0].length,m=r[a],y=r[h-1]+1;if(e.slice(m,y)!==n.slice(a,h))throw new S(`matched /${U.source}/; ${Ae}`,e);let E=m+3+c[1].length;i.push({start:E,end:E+c[2].length,key:g})}let o=e;for(let a=i.length-1;a>=0;a--){let c=i[a];o=`${o.slice(0,c.start)}${V}.${c.key}${o.slice(c.end)}`}return{source:o,usesSafeConstructors:i.length>0}}class S extends Error{rule;expression;constructor(e,n,r){super(r??`Potentially unsafe expression (${e}): ${n}`);this.name="UnsafeExpressionError",this.rule=e,this.expression=n}}function Js(e){try{return ge(e),null}catch(n){return n instanceof S?n.rule:n instanceof Error?n.message:String(n)}}function je(e,n){let r=/[$A-Z_a-z][$\w]*/g,i;while((i=r.exec(e))!==null){let s=i[0],o=e[i.index-1];if(ce.has(s))throw new S(`matched /\\b${s}\\b/; identifier ${s}`,n);if(o==="."&&ue.has(s))throw new S(`matched /.${s}/; property ${s}`,n)}}function Be(e,n=!0){let r=/(?:[$\w)\].]|\?\.)\s*\[([^\]]*)\]/g,i=new Set,s;while((s=r.exec(e))!==null){let o=s.index+s[0].indexOf("["),a=e.slice(0,o);if(/(?:^|[^$\w])(?:let|const|var)\s*$/.test(a))continue;let c=s[1].trim(),p=/^'(?:[^'\\]|\\.)*'$/.test(c),g=/^"(?:[^"\\]|\\.)*"$/.test(c);if(/^\d+$/.test(c))continue;if(p||g){let m=c.slice(1,-1);if(ue.has(m))throw new S(`bracket key ${m}`,e);if(!Le.allowBracketNotation)throw new S("bracket notation with a string key; enable with configureSafeEvaluator({ allowBracketNotation: true })",e,`Bracket notation with strings not allowed: ${e}. Enable with configureSafeEvaluator({ allowBracketNotation: true })`);continue}if(n&&/^[$A-Z_a-z][$\w]*$/.test(c)){i.add(c);continue}throw new S("dynamic bracket notation is not allowed",e)}return[...i]}function ge(e){let n=e.trim(),r=De(n);je(r,n);let i=Be(n);for(let s of ae){if(s===U)continue;if(s.test(r))throw new S(`matched /${s.source}/`,n)}return{...At(n),dynamicKeys:i}}function Ri(e){return ge(e),e.trim()}var Ys=Symbol("stx.sanitizeCache"),_t=4000,B=new Map;function Ot(e){let n=B.get(e);if(n===void 0){if(n=ae.some((r)=>r.test(e)),B.size>=_t)B.clear();B.set(e,n)}return n}function W(e){let n={},r=e[Ys];n.Math=Math,n.JSON=JSON,n.Date=Date,n.String=String,n.Number=Number,n.Boolean=Boolean,n.Array=Array,n.Object=se,n.parseInt=Number.parseInt,n.parseFloat=Number.parseFloat,n.isNaN=Number.isNaN,n.isFinite=Number.isFinite,n.encodeURIComponent=encodeURIComponent,n.decodeURIComponent=decodeURIComponent;for(let[i,s]of Object.entries(e)){if(i.startsWith("__")||Ot(i))continue;if(s&&typeof s==="object"&&!Array.isArray(s)){let o=r?.get(s);if(o===void 0)o=oe(s),r?.set(s,o);n[i]=o}else n[i]=s}return n}function oe(e,n=0){if(n>=Le.maxSanitizeDepth)return"[Object too deep]";if(e===null||typeof e!=="object")return e;if(Array.isArray(e))return e.map((i)=>oe(i,n+1));if(e instanceof Date||e instanceof RegExp||e instanceof Map||e instanceof Set||e instanceof Error)return e;let r={};for(let[i,s]of Object.entries(e)){if(i.startsWith("__")||i==="constructor"||i==="prototype")continue;if(s&&typeof s==="object")r[i]=oe(s,n+1);else r[i]=s}return r}function u(e,n){try{let r=W(n),i=Object.keys(r),s=Object.values(r);return d(e,i)(...s)}catch{return}}function f(e){try{return Ri(e),!0}catch{return!1}}function ul(e,n){try{let r=W(n),i=Object.keys(r),s=Object.values(r),o=!1,c=d(e,i,()=>{o=!0})(...s);return!o&&Boolean(c)}catch{return!1}}function P(e,n){try{let r=u(e,n);if(r&&typeof r==="object"&&!Array.isArray(r))return r;return{}}catch{return{}}}var He=new Set(["break","case","catch","class","const","continue","debugger","default","delete","do","else","enum","export","extends","false","finally","for","function","if","import","in","instanceof","new","null","return","super","switch","this","throw","true","try","typeof","var","void","while","with","yield","let","static","implements","interface","package","private","protected","public","arguments","eval","await"]),_e=`stx-compile-probe:${globalThis.crypto.randomUUID()}`,It=0,Pt=0;function Lt(e,n){let r="__stx_compile_probe";while(e.includes(r))r+="_";let i=Array.from({length:e.length+1});i[e.length]=_e;for(let s=0;s<16;s++){let o=`c${++It}`,a=`'use strict';if(${r}===${JSON.stringify(_e)})return ${JSON.stringify(o)};`,c=Function(...e,r,a+n);if(c(...i)===o)return c;Pt++}throw Error("[stx] the JavaScript runtime repeatedly returned code compiled from a different source; refusing to evaluate with it.")}var Mt=2000,H=new Map;function Oe(e,n){let r=`${e.join(",")}\x00${n}`,i=H.get(r);if(i)return i;let s=Lt(e,n);if(H.size>=Mt)H.clear();return H.set(r,s),s}function at(e){return e.replace(/'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`(?:[^`\\]|\\.)*`/g," ").replace(/\??\.\s*[a-zA-Z_$][\w$]*/g," ").replace(/([{,]\s*)[a-zA-Z_$][\w$]*(\s*:)/g,"$1$2").match(/\b[a-zA-Z_$][\w$]*\b/g)||[]}var Nt=/^[A-Za-z_$][\w$]*$/;function zt(e){return Nt.test(e)&&!He.has(e)}var Ie=new R(2000,{maxBytes:2097152,sizeOf:(e)=>e.sourceBytes});function d(e,n,r){let i=JSON.stringify([e,n]),s=Ie.get(i);if(!s)s=Dt(e,[...n]),s.sourceBytes+=i.length*2,Ie.set(i,s);return jt(Bt(s.buildFunc,s.filteredKeys,s.contextKeys,s.validEntries,s.validIndices,r),s.contextKeys,s.dynamicKeys)}function Dt(e,n){let{source:r,usesSafeConstructors:i,dynamicKeys:s}=ge(e),o=[];for(let m=0;m<n.length;m++){if(!zt(n[m]))continue;if(n[m]===V||n[m]==="Object"||ce.has(n[m]))continue;o.push({key:n[m],index:m})}o.sort((m,y)=>m.key<y.key?-1:1);let a=o.map((m)=>m.key),c=o.map((m)=>m.index),p=`
|
|
39
|
+
`),s.set(g,h)}return h(...c)}catch{return}};if(this.pool.length<this.maxPoolSize)this.pool.push({func:a,context:n.slice()});return a}clear(){this.pool.length=0,this.fnCache.clear()}}var or=new ke;class Te{metrics=new Map;budgets=new Map;violations=[];maxViolations=100;violationHandlers=[];enabled=!0;setEnabled(e){this.enabled=e}isEnabled(){return this.enabled}setBudget(e,n){this.budgets.set(e,{warnThreshold:0.8,action:"warn",...n})}setBudgets(e){for(let[n,r]of Object.entries(e))this.setBudget(n,r)}removeBudget(e){this.budgets.delete(e)}getBudgets(){let e={};for(let[n,r]of this.budgets.entries())e[n]=r;return e}onViolation(e){this.violationHandlers.push(e)}offViolation(e){let n=this.violationHandlers.indexOf(e);if(n!==-1)this.violationHandlers.splice(n,1)}time(e,n){if(!this.enabled)return n();let r=performance.now(),i=n(),s=performance.now()-r;return this.recordTime(e,s),this.checkBudget(e,s),i}async timeAsync(e,n){if(!this.enabled)return n();let r=performance.now(),i=await n(),s=performance.now()-r;return this.recordTime(e,s),this.checkBudget(e,s),i}checkBudget(e,n){let r=this.budgets.get(e);if(!r)return;let i=n/r.maxTime*100,s=r.warnThreshold!==void 0?n>=r.maxTime*r.warnThreshold&&n<r.maxTime:!1,o=n>=r.maxTime;if(!s&&!o)return;let a={label:e,actualTime:n,budgetTime:r.maxTime,exceedancePercent:i,timestamp:new Date,isWarning:s};this.violations.push(a);while(this.violations.length>this.maxViolations)this.violations.shift();for(let p of this.violationHandlers)try{p(a)}catch{}let c=s?`[Performance Warning] "${e}" took ${n.toFixed(2)}ms (${i.toFixed(1)}% of ${r.maxTime}ms budget)`:`[Performance Budget Exceeded] "${e}" took ${n.toFixed(2)}ms (exceeded ${r.maxTime}ms budget by ${(i-100).toFixed(1)}%)`;switch(r.action){case"log":console.log(c);break;case"warn":console.warn(c);break;case"error":console.error(c);break;case"throw":if(o)throw Error(c);else console.warn(c);break}}recordTime(e,n){let r=this.metrics.get(e);if(r)r.count++,r.totalTime+=n,r.maxTime=Math.max(r.maxTime,n),r.minTime=Math.min(r.minTime,n);else this.metrics.set(e,{count:1,totalTime:n,maxTime:n,minTime:n})}getStats(e){if(e){let r=this.metrics.get(e);if(!r)return{};let i=this.budgets.get(e);return{count:r.count,avgTime:r.totalTime/r.count,totalTime:r.totalTime,maxTime:r.maxTime,minTime:r.minTime,budget:i?.maxTime,budgetUtilization:i?r.totalTime/r.count/i.maxTime*100:void 0}}let n={};for(let[r,i]of this.metrics.entries()){let s=this.budgets.get(r);n[r]={count:i.count,avgTime:i.totalTime/i.count,totalTime:i.totalTime,maxTime:i.maxTime,minTime:i.minTime,budget:s?.maxTime,budgetUtilization:s?i.totalTime/i.count/s.maxTime*100:void 0}}return n}getViolations(e){if(e)return this.violations.filter((n)=>n.label===e);return[...this.violations]}getViolationStats(){let e={},n=0,r=0;for(let i of this.violations)if(e[i.label]=(e[i.label]||0)+1,i.isWarning)n++;else r++;return{total:this.violations.length,byLabel:e,warnings:n,errors:r}}clear(){this.metrics.clear()}clearViolations(){this.violations.length=0}clearBudgets(){this.budgets.clear()}reset(){this.clear(),this.clearViolations(),this.clearBudgets(),this.violationHandlers.length=0}}var re=null;function Rt(){if(!re)re=new Te;return re}var le=new Proxy({},{get(e,n){return Rt()[n]}});var Se=0;async function _(){if(performance.now()-Se<16)return;await new Promise((e)=>setTimeout(e,0)),Se=performance.now()}var $t={maxSanitizeDepth:10,allowBracketNotation:!1},Le={...$t};var U=/\bnew\s+/,V="__stx_safe_ctors",Me=["Bun","Deno","Buffer","fetch","atob","btoa","console","Response","Request","Headers","WebAssembly","structuredClone","queueMicrotask","crypto","performance","navigator","Worker","WebSocket","BroadcastChannel","EventSource","XMLHttpRequest","localStorage","sessionStorage"],ie=[...Me,"Function","setTimeout","setInterval","setImmediate","process","require","exports","module","window","document","global","globalThis","Reflect","Proxy","Symbol","WeakMap","WeakSet","WeakRef","FinalizationRegistry"],Re=ie.map(()=>{return}),se=Object.freeze(Object.assign(Object.create(null),{keys:Object.keys,values:Object.values,entries:Object.entries,fromEntries:Object.fromEntries,assign:Object.assign,hasOwn:Object.hasOwn,is:Object.is})),ae=[/\b(eval|Function|setTimeout|setInterval|setImmediate)\b/,/\b(process|require|import|exports|module)\b/,/\b(window|document|global|globalThis)\b/,/\b(constructor|prototype|__proto__)\b/,/\b(Reflect|Proxy)\b/,/\bSymbol\b/,/\b(WeakMap|WeakSet|WeakRef|FinalizationRegistry)\b/,/\b(Generator|AsyncGenerator)\b/,/__\w+__/,/\.(bind|call|apply)\s*\(/,U,/\bdelete\s+/,/\bthis\b/,/\\u(?:\{[\dA-Fa-f]+\}|[\dA-Fa-f]{4})/],ce=new Set([...Me,"eval","Function","setTimeout","setInterval","setImmediate","process","require","import","exports","module","window","document","global","globalThis","constructor","prototype","Reflect","Proxy","Symbol","WeakMap","WeakSet","WeakRef","FinalizationRegistry","Generator","AsyncGenerator","delete","this",V]),ue=new Set(["__proto__","constructor","prototype"]);function Ne(e){let n="",r=[],i=null,s=!1;for(let o=0;o<e.length;o++){let a=e[o];if(s){s=!1;continue}if(a==="\\"&&i){s=!0;continue}if(i){if(i==="`"&&a==="$"&&o+1<e.length&&e[o+1]==="{"){let c=1;o+=2;while(o<e.length&&c>0){if(e[o]==="{")c++;else if(e[o]==="}")c--;if(c>0)n+=e[o],r.push(o),o++}continue}if(a===i)i=null;continue}if(a==='"'||a==="'"||a==="`"){i=a;continue}n+=a,r.push(o)}return{text:n,map:r}}function De(e){return Ne(e).text}var Fe=["Collator","DateTimeFormat","DisplayNames","ListFormat","Locale","NumberFormat","PluralRules","RelativeTimeFormat","Segmenter"],ze=(()=>{let e={Date,URL,URLSearchParams},n=Intl;for(let r of Fe)if(typeof n[r]==="function")e[`Intl_${r}`]=n[r];return Object.freeze(Object.assign(Object.create(null),e))})(),Ct=/^new(\s+)(Date|URLSearchParams|URL|Intl\s*\.\s*([A-Z_a-z]\w*))\s*\(/,$e=/(?<![\w$])new(?![\w$])/g,Ae=`only new Date(), new URL(), new URLSearchParams() and new Intl.{${Fe.join(",")}}() are allowed`;function At(e){let{text:n,map:r}=Ne(e),i=[];$e.lastIndex=0;let s;while((s=$e.exec(n))!==null){let a=s.index;if(/(?<!\.)\.\s*$/.test(n.slice(0,a)))continue;let c=Ct.exec(n.slice(a)),p=c?.[3],g=!c?null:p?`Intl_${p}`:c[2];if(!c||!g||!(g in ze))throw new S(`matched /${U.source}/; ${Ae}`,e);let h=a+c[0].length,m=r[a],y=r[h-1]+1;if(e.slice(m,y)!==n.slice(a,h))throw new S(`matched /${U.source}/; ${Ae}`,e);let E=m+3+c[1].length;i.push({start:E,end:E+c[2].length,key:g})}let o=e;for(let a=i.length-1;a>=0;a--){let c=i[a];o=`${o.slice(0,c.start)}${V}.${c.key}${o.slice(c.end)}`}return{source:o,usesSafeConstructors:i.length>0}}class S extends Error{rule;expression;constructor(e,n,r){super(r??`Potentially unsafe expression (${e}): ${n}`);this.name="UnsafeExpressionError",this.rule=e,this.expression=n}}function Js(e){try{return ge(e),null}catch(n){return n instanceof S?n.rule:n instanceof Error?n.message:String(n)}}function je(e,n){let r=/[$A-Z_a-z][$\w]*/g,i;while((i=r.exec(e))!==null){let s=i[0],o=e[i.index-1];if(ce.has(s))throw new S(`matched /\\b${s}\\b/; identifier ${s}`,n);if(o==="."&&ue.has(s))throw new S(`matched /.${s}/; property ${s}`,n)}}function Be(e,n=!0){let r=/(?:[$\w)\].]|\?\.)\s*\[([^\]]*)\]/g,i=new Set,s;while((s=r.exec(e))!==null){let o=s.index+s[0].indexOf("["),a=e.slice(0,o);if(/(?:^|[^$\w])(?:let|const|var)\s*$/.test(a))continue;let c=s[1].trim(),p=/^'(?:[^'\\]|\\.)*'$/.test(c),g=/^"(?:[^"\\]|\\.)*"$/.test(c);if(/^\d+$/.test(c))continue;if(p||g){let m=c.slice(1,-1);if(ue.has(m))throw new S(`bracket key ${m}`,e);if(!Le.allowBracketNotation)throw new S("bracket notation with a string key; enable with configureSafeEvaluator({ allowBracketNotation: true })",e,`Bracket notation with strings not allowed: ${e}. Enable with configureSafeEvaluator({ allowBracketNotation: true })`);continue}if(n&&/^[$A-Z_a-z][$\w]*$/.test(c)){i.add(c);continue}throw new S("dynamic bracket notation is not allowed",e)}return[...i]}function ge(e){let n=e.trim(),r=De(n);je(r,n);let i=Be(n);for(let s of ae){if(s===U)continue;if(s.test(r))throw new S(`matched /${s.source}/`,n)}return{...At(n),dynamicKeys:i}}function Ri(e){return ge(e),e.trim()}var Ys=Symbol("stx.sanitizeCache"),_t=4000,B=new Map;function Ot(e){let n=B.get(e);if(n===void 0){if(n=ae.some((r)=>r.test(e)),B.size>=_t)B.clear();B.set(e,n)}return n}function W(e){let n={},r=e[Ys];n.Math=Math,n.JSON=JSON,n.Date=Date,n.String=String,n.Number=Number,n.Boolean=Boolean,n.Array=Array,n.Object=se,n.parseInt=Number.parseInt,n.parseFloat=Number.parseFloat,n.isNaN=Number.isNaN,n.isFinite=Number.isFinite,n.encodeURIComponent=encodeURIComponent,n.decodeURIComponent=decodeURIComponent;for(let[i,s]of Object.entries(e)){if(i.startsWith("__")||Ot(i))continue;if(s&&typeof s==="object"&&!Array.isArray(s)){let o=r?.get(s);if(o===void 0)o=oe(s),r?.set(s,o);n[i]=o}else n[i]=s}return n}function oe(e,n=0){if(n>=Le.maxSanitizeDepth)return"[Object too deep]";if(e===null||typeof e!=="object")return e;if(Array.isArray(e))return e.map((i)=>oe(i,n+1));if(e instanceof Date||e instanceof RegExp||e instanceof Map||e instanceof Set||e instanceof Error)return e;let r={};for(let[i,s]of Object.entries(e)){if(i.startsWith("__")||i==="constructor"||i==="prototype")continue;if(s&&typeof s==="object")r[i]=oe(s,n+1);else r[i]=s}return r}function u(e,n){try{let r=W(n),i=Object.keys(r),s=Object.values(r);return d(e,i)(...s)}catch{return}}function f(e){try{return Ri(e),!0}catch{return!1}}function dl(e,n){try{let r=W(n),i=Object.keys(r),s=Object.values(r),o=!1,c=d(e,i,()=>{o=!0})(...s);return!o&&Boolean(c)}catch{return!1}}function P(e,n){try{let r=u(e,n);if(r&&typeof r==="object"&&!Array.isArray(r))return r;return{}}catch{return{}}}var He=new Set(["break","case","catch","class","const","continue","debugger","default","delete","do","else","enum","export","extends","false","finally","for","function","if","import","in","instanceof","new","null","return","super","switch","this","throw","true","try","typeof","var","void","while","with","yield","let","static","implements","interface","package","private","protected","public","arguments","eval","await"]),_e=`stx-compile-probe:${globalThis.crypto.randomUUID()}`,It=0,Pt=0;function Lt(e,n){let r="__stx_compile_probe";while(e.includes(r))r+="_";let i=Array.from({length:e.length+1});i[e.length]=_e;for(let s=0;s<16;s++){let o=`c${++It}`,a=`'use strict';if(${r}===${JSON.stringify(_e)})return ${JSON.stringify(o)};`,c=Function(...e,r,a+n);if(c(...i)===o)return c;Pt++}throw Error("[stx] the JavaScript runtime repeatedly returned code compiled from a different source; refusing to evaluate with it.")}var Mt=2000,H=new Map;function Oe(e,n){let r=`${e.join(",")}\x00${n}`,i=H.get(r);if(i)return i;let s=Lt(e,n);if(H.size>=Mt)H.clear();return H.set(r,s),s}function at(e){return e.replace(/'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`(?:[^`\\]|\\.)*`/g," ").replace(/\??\.\s*[a-zA-Z_$][\w$]*/g," ").replace(/([{,]\s*)[a-zA-Z_$][\w$]*(\s*:)/g,"$1$2").match(/\b[a-zA-Z_$][\w$]*\b/g)||[]}var Nt=/^[A-Za-z_$][\w$]*$/;function zt(e){return Nt.test(e)&&!He.has(e)}var Ie=new R(2000,{maxBytes:2097152,sizeOf:(e)=>e.sourceBytes});function d(e,n,r){let i=JSON.stringify([e,n]),s=Ie.get(i);if(!s)s=Dt(e,[...n]),s.sourceBytes+=i.length*2,Ie.set(i,s);return jt(Bt(s.buildFunc,s.filteredKeys,s.contextKeys,s.validEntries,s.validIndices,r),s.contextKeys,s.dynamicKeys)}function Dt(e,n){let{source:r,usesSafeConstructors:i,dynamicKeys:s}=ge(e),o=[];for(let m=0;m<n.length;m++){if(!zt(n[m]))continue;if(n[m]===V||n[m]==="Object"||ce.has(n[m]))continue;o.push({key:n[m],index:m})}o.sort((m,y)=>m.key<y.key?-1:1);let a=o.map((m)=>m.key),c=o.map((m)=>m.index),p=`
|
|
40
40
|
'use strict';
|
|
41
41
|
try {
|
|
42
42
|
return ${r};
|
|
@@ -48,10 +48,10 @@ catch (e) {
|
|
|
48
48
|
throw e;
|
|
49
49
|
}
|
|
50
50
|
`,g=i?(m)=>{let y=Oe([V,"Object",...ie,...a,...m],p);return(...E)=>y(ze,se,...Re,...E)}:(m)=>{let y=Oe(["Object",...ie,...a,...m],p);return(...E)=>y(se,...Re,...E)},h=g([]);return{sourceBytes:e.length*2+n.reduce((m,y)=>m+y.length*2,0),contextKeys:n,filteredKeys:a,validEntries:o,validIndices:c,dynamicKeys:s,buildFunc:(m)=>m.length===0?h:g(m)}}function jt(e,n,r){if(r.length===0)return e;let i=r.map((s)=>n.indexOf(s));return(...s)=>{for(let o of i){if(o<0)continue;let a=s[o];if(typeof a==="string"&&ue.has(a))return}return e(...s)}}function Bt(e,n,r,i,s,o){let a=e([]),c=i.every((g,h)=>g.index===h);if(n.length===r.length&&c)return Pe(a,n,e,void 0,o);return Pe((...g)=>{let h=Array(s.length);for(let m=0;m<s.length;m++)h[m]=g[s[m]];return a(...h)},n,e,(g)=>{a=e(g)},o)}function Pe(e,n,r,i,s){let a=/^(\w+) is not defined$/,c=e,p=[],g=new Set(n);return(...h)=>{for(let m=0;m<=8;m++)try{return c(...h)}catch(y){let E=y instanceof Error?y.message:"",v=a.exec(E);if(!(y instanceof ReferenceError)||!v)return;let w=v[1];if(g.has(w)||He.has(w)||ce.has(w))return;if(s?.(w),g.add(w),p.push(w),i)i(p);else c=r(p)}return}}function Zs(e){let n=e.trim();try{let r=De(n);if(/\b(?:eval|function|import|require|process|globalthis|window|document|fetch|bun|deno|buffer|console|reflect|proxy|prototype|constructor|this)\b/i.test(r))return!1;je(r,n),Be(n);for(let i of ae)if(i.test(r))return!1}catch{return!1}return!0}function Pi(e,n){let r=[];n.lastIndex=0;let i;while((i=n.exec(e))!==null){let s=i.index,o=s+i[0].length-1,a=x(e,"(",")",o);if(a===-1){r.push({start:s,end:-1,args:"",call:e.slice(s,Math.min(e.length,s+80))}),n.lastIndex=o+1;continue}r.push({start:s,end:a+1,args:e.slice(o+1,a),call:e.slice(s,a+1)}),n.lastIndex=a+1}return r}function Ht(e,n,r,i){let s="",o=0;for(let a of Pi(e,n)){if(s+=e.slice(o,a.start),a.end===-1){s+=i(a.call),o=a.start;continue}s+=r(a.args,a.call),o=a.end}return s+e.slice(o)}function Vt(e){let n=[],r=0,i=null,s="";for(let o=0;o<e.length;o++){let a=e[o];if(i){if(s+=a,a==="\\"&&o+1<e.length){s+=e[++o];continue}if(a===i)i=null;continue}if(a==="'"||a==='"'||a==="`")i=a;else if(a==="("||a==="["||a==="{")r++;else if(a===")"||a==="]"||a==="}")r--;else if(a===","&&r===0){n.push(s.trim()),s="";continue}s+=a}if(s.trim())n.push(s.trim());return n}function de(e){let n=e.trim(),r=n[0];if(r!=="'"&&r!=='"'&&r!=="`"||n.length<2||n.at(-1)!==r)return null;let i="";for(let s=1;s<n.length-1;s++){let o=n[s];if(o==="\\"&&s+1<n.length-1){let a=n[++s];i+=a==="n"?`
|
|
51
|
-
`:a==="t"?"\t":a;continue}if(o===r)return null;if(r==="`"&&o==="$"&&n[s+1]==="{")return null;i+=o}return i}var Wt=new Set(["true","false","null","undefined","typeof","void","new","in","of","instanceof","this","delete","await","async","function","return","NaN","Infinity"]);function Ut(e,n){let r=e.trim();if(!r)return{ok:!1,message:"the argument is empty",code:t.INVALID_DIRECTIVE_SYNTAX};let i=Js(r);if(i)return{ok:!1,message:`the expression is not allowed (${i})`,code:t.UNSAFE_EXPRESSION};let s=W(n),o;try{o=d(r,Object.keys(s))(...Object.values(s))}catch(c){return{ok:!1,message:`the expression could not be evaluated: ${c instanceof Error?c.message:String(c)}`,code:t.EVALUATION_ERROR}}if(o!==void 0&&o!==null)return{ok:!0,value:o};let a=[...new Set(at(r))].filter((c)=>!Wt.has(c)&&!(c in s)&&!(c in globalThis));if(a.length>0)return{ok:!1,message:`${a.map((p)=>`"${p}"`).join(", ")} ${a.length===1?"is":"are"} not defined here. Values a directive reads must come from <script server> or the render context; a plain <script> runs in the browser. To pass literal text, quote it.`,code:t.UNDEFINED_VARIABLE};if(o===void 0&&(r.startsWith("{")||r.startsWith("[")))return{ok:!1,message:"the expression threw while it was evaluated",code:t.EVALUATION_ERROR};return{ok:!0,value:o}}function Ue(e){if(e===null)return"null";if(Array.isArray(e))return"an array";if(typeof e==="object")return"an object";if(typeof e==="string")return`a string ("${e.length>40?`${e.slice(0,40)}...`:e}")`;return`${/^[aeiou]/.test(typeof e)?"an":"a"} ${typeof e}`}function ct(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}function Ke(e){if(!e)return"";return Ve.isAbsolute(e)?Ve.relative(process.cwd(),e)||e:e}function pe(e){let n=e.replace(/\s+/g," ").trim();return n.length>80?`${n.slice(0,77)}...`:n}function D(e,n,r,i,s=t.EVALUATION_ERROR){let o=i?` in ${Ke(i)}`:"";return console.warn(`[stx] ${pe(n)}${o}: ${r}`),l(e,`${pe(n)}: ${r}`,s)}function Qs(e,n,r){let i=r?` in ${Ke(r)}`:"";console.warn(`[stx] ${pe(e)}${i}: ${n}`)}function Ii(){return{afterOpen:[],beforeClose:[]}}function Kt(e){return e.afterOpen.length>0||e.beforeClose.length>0}function
|
|
51
|
+
`:a==="t"?"\t":a;continue}if(o===r)return null;if(r==="`"&&o==="$"&&n[s+1]==="{")return null;i+=o}return i}var Wt=new Set(["true","false","null","undefined","typeof","void","new","in","of","instanceof","this","delete","await","async","function","return","NaN","Infinity"]);function Ut(e,n){let r=e.trim();if(!r)return{ok:!1,message:"the argument is empty",code:t.INVALID_DIRECTIVE_SYNTAX};let i=Js(r);if(i)return{ok:!1,message:`the expression is not allowed (${i})`,code:t.UNSAFE_EXPRESSION};let s=W(n),o;try{o=d(r,Object.keys(s))(...Object.values(s))}catch(c){return{ok:!1,message:`the expression could not be evaluated: ${c instanceof Error?c.message:String(c)}`,code:t.EVALUATION_ERROR}}if(o!==void 0&&o!==null)return{ok:!0,value:o};let a=[...new Set(at(r))].filter((c)=>!Wt.has(c)&&!(c in s)&&!(c in globalThis));if(a.length>0)return{ok:!1,message:`${a.map((p)=>`"${p}"`).join(", ")} ${a.length===1?"is":"are"} not defined here. Values a directive reads must come from <script server> or the render context; a plain <script> runs in the browser. To pass literal text, quote it.`,code:t.UNDEFINED_VARIABLE};if(o===void 0&&(r.startsWith("{")||r.startsWith("[")))return{ok:!1,message:"the expression threw while it was evaluated",code:t.EVALUATION_ERROR};return{ok:!0,value:o}}function Ue(e){if(e===null)return"null";if(Array.isArray(e))return"an array";if(typeof e==="object")return"an object";if(typeof e==="string")return`a string ("${e.length>40?`${e.slice(0,40)}...`:e}")`;return`${/^[aeiou]/.test(typeof e)?"an":"a"} ${typeof e}`}function ct(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}function Ke(e){if(!e)return"";return Ve.isAbsolute(e)?Ve.relative(process.cwd(),e)||e:e}function pe(e){let n=e.replace(/\s+/g," ").trim();return n.length>80?`${n.slice(0,77)}...`:n}function D(e,n,r,i,s=t.EVALUATION_ERROR){let o=i?` in ${Ke(i)}`:"";return console.warn(`[stx] ${pe(n)}${o}: ${r}`),l(e,`${pe(n)}: ${r}`,s)}function Qs(e,n,r){let i=r?` in ${Ke(r)}`:"";console.warn(`[stx] ${pe(e)}${i}: ${n}`)}function Ii(){return{afterOpen:[],beforeClose:[]}}function Kt(e){return e.afterOpen.length>0||e.beforeClose.length>0}function fl(e,n){if(!Kt(n))return e;let r=n.afterOpen.join(""),i=n.beforeClose.join(""),s=e.lastIndexOf("</head>"),o=r?Pr(e):null,a=i&&s!==-1?s:null;if(o===null&&a===null)return e;if(o!==null&&a!==null)return`${e.slice(0,o)}${r}${e.slice(o,a)}${i}${e.slice(a)}`;if(o!==null)return`${e.slice(0,o)}${r}${e.slice(o)}`;return`${e.slice(0,a)}${i}${e.slice(a)}`}var Xe=/\s*<meta\b[^>]*\bcharset\b[^>]*>/iy;function Pr(e){let n=/<head\b[^>]*>/i.exec(e);if(!n)return null;let r=n.index+n[0].length;Xe.lastIndex=r;let i=Xe.exec(e);return i?r+i[0].length:r}var me="data-stx-color-mode-boot",qe="__STX_COLOR_MODE__",Xt=new Set(["light","dark","auto","system"]),qt=new Set(["auto","system"]),Gt=/^[a-z][\w:-]*$/i,Yt=/^[\w-]+$/;function Jt(e){let n=e.storageKey??"stx-color-mode",r=e.initialMode??"auto",i=e.darkClass===void 0?"dark":e.darkClass,s=e.attribute??null,o=e.autoValue??null,a=e.respectExisting===!0;if(typeof n!=="string"||n.length===0)throw Error("colorMode.storageKey must be a non-empty string");if(!Xt.has(r))throw Error(`colorMode.initialMode must be one of light, dark, auto, system \u2014 got ${JSON.stringify(r)}`);if(i!==null&&(typeof i!=="string"||!Yt.test(i)))throw Error(`colorMode.darkClass must be a single CSS class name, or null to opt out \u2014 got ${JSON.stringify(i)}`);if(s!==null&&(typeof s!=="string"||!Gt.test(s)))throw Error(`colorMode.attribute must be a valid HTML attribute name \u2014 got ${JSON.stringify(s)}`);if(o!==null&&!qt.has(o))throw Error(`colorMode.autoValue must be 'auto' or 'system' \u2014 got ${JSON.stringify(o)}`);if(i===null&&s===null)throw Error("colorMode needs at least one of darkClass or attribute \u2014 with both null nothing would mark the mode on <html>");if(a&&s===null)throw Error("colorMode.respectExisting needs an attribute to read \u2014 the dark class alone cannot say whether a mode was chosen");return{storageKey:n,initialMode:r==="system"?"auto":r,darkClass:i,attribute:s,autoValue:o,respectExisting:a}}function Zt(e){return JSON.stringify(e).replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/&/g,"\\u0026").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}function he(e={}){let n=Jt(e),r=Zt(n),i=`(function(){"use strict";var o=window.${qe};if(o&&typeof o.sync==="function"){o.sync();return}var c=${r};var r=document.documentElement;function read(){var p=c.initialMode,a=c.autoValue;try{var v=localStorage.getItem(c.storageKey);if(v==="light"||v==="dark"){p=v}else if(v==="auto"||v==="system"){p="auto";if(!a)a=v}}catch(e){}return{p:p,a:a}}function sys(){try{return matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}catch(e){return"light"}}function stamp(m){if(c.attribute)r.setAttribute(c.attribute,m);if(c.darkClass){if(m==="dark")r.classList.add(c.darkClass);else r.classList.remove(c.darkClass)}}var s=read();var f=null;if(c.respectExisting&&c.attribute){var x=r.getAttribute(c.attribute);if(x==="light"||x==="dark")f=x}var m=f||(s.p==="auto"?sys():s.p);var p=s.p;stamp(m);var g=null;function sync(){var t=read(),n=f||(t.p==="auto"?sys():t.p);var moved=n!==m,chose=t.p!==p;if(moved){r.style.setProperty("transition","none","important");stamp(n);void r.offsetHeight;r.style.removeProperty("transition")}else stamp(n);m=n;p=t.p;if(g){g.mode=n;g.preference=t.p;if(t.a)g.autoValue=t.a}if(moved||chose){try{window.dispatchEvent(new CustomEvent("stx:color-mode",{detail:{mode:n,preference:t.p}}))}catch(e){}}}try{g=window.${qe}={storageKey:c.storageKey,initialMode:c.initialMode,darkClass:c.darkClass,attribute:c.attribute,autoValue:s.a||"auto",respectExisting:c.respectExisting,forced:f,preference:p,mode:m,watching:true,sync:sync}}catch(e){}try{var q=matchMedia("(prefers-color-scheme: dark)");if(q.addEventListener)q.addEventListener("change",sync);else if(q.addListener)q.addListener(sync)}catch(e){}try{addEventListener("pageshow",sync);addEventListener("storage",function(e){if(e.key===null||e.key===c.storageKey)sync()});document.addEventListener("visibilitychange",function(){if(document.visibilityState==="visible")sync()})}catch(e){}}());`;return`<script ${me}>${i}</script>`}function Ir(e,n={}){if(e.includes(me))return e;let r=fe(e);if(r===null)return e;let i=he(n);return`${e.slice(0,r)}
|
|
52
52
|
${i}${e.slice(r)}`}var fe=Pr,Qt=new RegExp(`<script\\b[^>]*\\b${me}\\b[^>]*>[\\s\\S]*?<\\/script>`,"i"),Ge=/<meta\b[^>]*\bcharset\b[^>]*>/gi,Ye=/<\/head>/gi;function en(e){let n=/<head\b[^>]*>/i.exec(e);if(!n)return e;let r=n.index+n[0].length;Ye.lastIndex=r;let i=Ye.exec(e),s=i?i.index:e.length;Ge.lastIndex=r;let o=Ge.exec(e);if(!o||o.index>=s)return e;if(e.slice(r,o.index).trim()==="")return e;let a=o.index+o[0].length;return`${e.slice(0,r)}
|
|
53
|
-
${o[0]}${e.slice(r,o.index)}${e.slice(a,s)}${e.slice(s)}`}function
|
|
54
|
-
${n[0]}${i.slice(s)}`}var nn="[data-stx-component-wrapper]:not([stx-hydrate]){display:contents}",Qe=`<style data-stx-cloak>[x-cloak]{display:none !important}${nn}</style>`,X="data-stx-html-attrs",q="data-stx-html-class",et=/^[A-Za-z_:][\w:.-]*$/;function k(e){return String(e).replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}function rn(e){return String(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}function lt(e){if(e.name)return`name="${e.name}"`;if(e.property)return`property="${e.property}"`;if(e.charset!=null)return"charset=";if(e["http-equiv"])return`http-equiv="${e["http-equiv"]}"`;return""}function sn(e){let n=/^\s*<meta\b([^>]*)>/i.exec(e);if(!n)return null;let r={};for(let i of n[1].matchAll(/([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g))r[i[1].toLowerCase()]=i[2]??i[3]??i[4]??"";return r}function O(e,n){return Object.entries(e).filter(([r])=>!n?.(r)).map(([r,i])=>`${r}="${k(String(i))}"`).join(" ")}function Y(e){let n=String(e.content),r=typeof e.type==="string"?e.type.trim().toLowerCase():"";return/json$|^importmap$/.test(r)?n.replace(/<\//g,"<\\/"):n}function tt(e){let n=O(e,(r)=>r==="content");return`<script${n?` ${n}`:""}>${Y(e)}</script>`}function on(e={},n="en"){let r=[],i=[],s="",o=n;for(let[c,p]of Object.entries(e||{})){if(p==null)continue;let g=c.trim();if(!et.test(g))continue;let h=g.toLowerCase();if(h==="lang"){o=String(p);continue}if(h==="class"){s=String(p).trim();continue}r.push(` ${g}="${k(String(p))}"`),i.push(g)}let a=` lang="${k(o)}"`;if(s)a+=` class="${k(s)}"`;if(a+=r.join(""),s)a+=` ${q}="${k(s)}"`;if(i.length)a+=` ${X}="${k(i.join(" "))}"`;return a}function
|
|
53
|
+
${o[0]}${e.slice(r,o.index)}${e.slice(a,s)}${e.slice(s)}`}function gl(e){return tn(en(e))}function tn(e){let n=Qt.exec(e);if(!n)return e;let r=fe(e);if(r===null)return e;if(n.index<=r||e.slice(r,n.index).trim()==="")return e;let i=e.slice(0,n.index)+e.slice(n.index+n[0].length),s=fe(i);if(s===null)return e;return`${i.slice(0,s)}
|
|
54
|
+
${n[0]}${i.slice(s)}`}var nn="[data-stx-component-wrapper]:not([stx-hydrate]){display:contents}",Qe=`<style data-stx-cloak>[x-cloak]{display:none !important}${nn}</style>`,X="data-stx-html-attrs",q="data-stx-html-class",et=/^[A-Za-z_:][\w:.-]*$/;function k(e){return String(e).replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}function rn(e){return String(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}function lt(e){if(e.name)return`name="${e.name}"`;if(e.property)return`property="${e.property}"`;if(e.charset!=null)return"charset=";if(e["http-equiv"])return`http-equiv="${e["http-equiv"]}"`;return""}function sn(e){let n=/^\s*<meta\b([^>]*)>/i.exec(e);if(!n)return null;let r={};for(let i of n[1].matchAll(/([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g))r[i[1].toLowerCase()]=i[2]??i[3]??i[4]??"";return r}function O(e,n){return Object.entries(e).filter(([r])=>!n?.(r)).map(([r,i])=>`${r}="${k(String(i))}"`).join(" ")}function Y(e){let n=String(e.content),r=typeof e.type==="string"?e.type.trim().toLowerCase():"";return/json$|^importmap$/.test(r)?n.replace(/<\//g,"<\\/"):n}function tt(e){let n=O(e,(r)=>r==="content");return`<script${n?` ${n}`:""}>${Y(e)}</script>`}function on(e={},n="en"){let r=[],i=[],s="",o=n;for(let[c,p]of Object.entries(e||{})){if(p==null)continue;let g=c.trim();if(!et.test(g))continue;let h=g.toLowerCase();if(h==="lang"){o=String(p);continue}if(h==="class"){s=String(p).trim();continue}r.push(` ${g}="${k(String(p))}"`),i.push(g)}let a=` lang="${k(o)}"`;if(s)a+=` class="${k(s)}"`;if(a+=r.join(""),s)a+=` ${q}="${k(s)}"`;if(i.length)a+=` ${X}="${k(i.join(" "))}"`;return a}function ml(e={},n={}){let r={...e,...n};if(e.class&&n.class){let i=e.class.split(/\s+/).filter(Boolean);for(let s of n.class.split(/\s+/).filter(Boolean))if(!i.includes(s))i.push(s);r.class=i.join(" ")}return r}function Or(e,n={}){if(!n||Object.keys(n).length===0)return e;let r=e.match(/<html\b([^>]*)>/i);if(!r)return e;let i={},s=[],o=/([A-Za-z_:][\w:.-]*)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g,a;while((a=o.exec(r[1]))!==null){let h=a[1];if(!(h in i))s.push(h);i[h]=a[2]??a[3]??a[4]??""}let c=[],p=[];for(let[h,m]of Object.entries(n)){if(m==null)continue;let y=h.trim();if(!et.test(y))continue;let E=y.toLowerCase();if(E==="class"){let v=(i.class||"").split(/\s+/).filter(Boolean);for(let w of String(m).split(/\s+/).filter(Boolean))if(!v.includes(w))v.push(w),c.push(w);if(!("class"in i))s.push("class");i.class=v.join(" ");continue}if(!(y in i))s.push(y);if(i[y]=String(m),E!=="lang")p.push(y)}if(c.length){if(!(q in i))s.push(q);i[q]=c.join(" ")}if(p.length){if(!(X in i))s.push(X);i[X]=p.join(" ")}let g=s.map((h)=>` ${h}="${k(i[h])}"`).join("");return e.replace(r[0],()=>`<html${g}>`)}function hl(e){if(e.includes("data-stx-cloak"))return null;if(e.lastIndexOf("</head>")===-1)return null;return`${Qe}
|
|
55
55
|
`}function an(e){let n=[],r=0;while(r<e.length){let o=e.slice(r),a=o.match(/^\s+/);if(a){r+=a[0].length;continue}if(o.startsWith("<!--")){let m=e.indexOf("-->",r);if(m===-1)break;r=m+3;continue}let c=o.match(/^<script\b[^>]*>/i);if(c){let m=e.toLowerCase().indexOf("</script>",r+c[0].length);if(m===-1)break;r=m+9;continue}let p=o.match(/^<link\b[^>]*>/i);if(p){n.push(p[0]),r+=p[0].length;continue}let g=o.match(/^<meta\b[^>]*>/i);if(g){n.push(g[0]),r+=g[0].length;continue}let h=o.match(/^<style\b[^>]*>[\s\S]*?<\/style>/i);if(h){n.push(h[0]),r+=h[0].length;continue}break}if(n.length===0)return{body:e,hoisted:n};let i="",s=0;while(s<e.length&&s<r){let o=e.slice(s),a=o.match(/^<link\b[^>]*>/i);if(a&&n.includes(a[0])){s+=a[0].length;continue}let c=o.match(/^<meta\b[^>]*>/i);if(c&&n.includes(c[0])){s+=c[0].length;continue}let p=o.match(/^<style\b[^>]*>[\s\S]*?<\/style>/i);if(p&&n.includes(p[0])){s+=p[0].length;continue}i+=e[s],s++}return i+=e.slice(r),{body:i,hoisted:n}}function cn(e,n={},r={}){let{title:i="stx App",lang:s="en",meta:o=[],link:a=[],script:c=[],headRaw:p="",htmlAttrs:g={},bodyClass:h="",bodyAttrs:m={}}=n,y=r.title||i,E=[{charset:"UTF-8"},{name:"viewport",content:"width=device-width, initial-scale=1.0"}],v=new Set(o.map(lt).filter(Boolean)),{body:w,hoisted:T}=an(e),A=new Set(T.flatMap((b)=>{let L=sn(b);return L?[lt(L)].filter(Boolean):[]})),ot=[...E.filter((b)=>!v.has(lt(b))),...o].filter((b)=>!A.has(lt(b))).map((b)=>` <meta ${O(b)}>`).join(`
|
|
56
56
|
`),ut=a.map((b)=>` <link ${O(b)}>`).join(`
|
|
57
57
|
`),gt=c.map((b)=>{if(b.src)return` <script ${O(b,(L)=>L==="content")}></script>`;if(b.content)return` ${tt(b)}`;return""}).filter(Boolean).join(`
|
|
@@ -65,8 +65,8 @@ ${mt.join(`
|
|
|
65
65
|
${ht.join(`
|
|
66
66
|
`)}
|
|
67
67
|
</body>
|
|
68
|
-
</html>`}var ye=/\s+/y,be=/<(script|style)\b[^>]*>/iy,ln=/<\/script>/gi,un=/<\/style>/gi,Je=/<!DOCTYPE\b/iy,Ze=/<html[\s>]/iy;function Tn(e){let n=0;while(n<e.length){if(ye.lastIndex=n,ye.exec(e)){n=ye.lastIndex;continue}if(e.startsWith("<!--",n)){let s=e.indexOf("-->",n);if(s===-1)return!1;n=s+3;continue}be.lastIndex=n;let i=be.exec(e);if(i){let s=i[1].toLowerCase()==="script"?ln:un;s.lastIndex=be.lastIndex;let o=s.exec(e);if(o===null)return!1;n=o.index+o[0].length;continue}if(Je.lastIndex=n,Je.test(e))return!0;return Ze.lastIndex=n,Ze.test(e)}return!1}function Oi(e){return Tn(e)}function
|
|
68
|
+
</html>`}var ye=/\s+/y,be=/<(script|style)\b[^>]*>/iy,ln=/<\/script>/gi,un=/<\/style>/gi,Je=/<!DOCTYPE\b/iy,Ze=/<html[\s>]/iy;function Tn(e){let n=0;while(n<e.length){if(ye.lastIndex=n,ye.exec(e)){n=ye.lastIndex;continue}if(e.startsWith("<!--",n)){let s=e.indexOf("-->",n);if(s===-1)return!1;n=s+3;continue}be.lastIndex=n;let i=be.exec(e);if(i){let s=i[1].toLowerCase()==="script"?ln:un;s.lastIndex=be.lastIndex;let o=s.exec(e);if(o===null)return!1;n=o.index+o[0].length;continue}if(Je.lastIndex=n,Je.test(e))return!0;return Ze.lastIndex=n,Ze.test(e)}return!1}function Oi(e){return Tn(e)}function yl(e,n={}){let r=e.lastIndexOf("</head>");if(r===-1)return e;let{meta:i=[],link:s=[],script:o=[],headRaw:a=""}=n,c=e.slice(0,r),p=[];for(let g of i){let h=lt(g);if(h&&c.includes(h))continue;p.push(` <meta ${O(g)}>`)}for(let g of s){if(g.href&&c.includes(`href="${g.href}"`))continue;p.push(` <link ${O(g)}>`)}for(let g of o)if(g.src){if(c.includes(`src="${g.src}"`))continue;p.push(` <script ${O(g,(h)=>h==="content")}></script>`)}else if(g.content){if(c.includes(Y(g)))continue;p.push(` ${tt(g)}`)}if(a&&!c.includes(a))p.push(` ${a}`);if(p.length===0)return e;return`${e.slice(0,r)}${p.join(`
|
|
69
69
|
`)}
|
|
70
|
-
${e.slice(r)}`}function Nr(e,n={},r={},i){if(i??Oi(e))return e;return cn(e,n,r)}var gn=["og:","article:","book:","profile:","fb:","music:","video:"],pn=/^[a-z][\w-]*(?::[\w:-]+)?$/i;function Mr(e,n){if(e.length<1)return{kind:"error",message:"meta directive requires at least the meta name",code:t.INVALID_DIRECTIVE_SYNTAX};if(e.length>2)return{kind:"error",message:`@meta takes a name and a value, got ${e.length} arguments`,code:t.INVALID_DIRECTIVE_SYNTAX};let r=dn(e[0],n);if(typeof r!=="string")return r;let i;if(e.length===2){let o=fn(e[1],n);if(typeof o!=="string")return o;i=o}else{let o=r.includes(":")?r.slice(r.indexOf(":")+1):r,a=n.openGraph,c=n[o]??(ct(a)?a[o]:void 0);i=c===void 0||c===null||typeof c==="object"?"":String(c)}if(!i)return{kind:"empty"};return{kind:"tag",tag:gn.some((o)=>r.startsWith(o))?{property:r,content:i}:{name:r,content:i}}}function dn(e,n){let r=de(e);if(r!==null)return r.trim()?r:{kind:"error",message:"the meta name is empty",code:t.INVALID_DIRECTIVE_SYNTAX};if(pn.test(e.trim()))return e.trim();let i=Ut(e,n);if(!i.ok)return{kind:"error",message:`meta name: ${i.message}`,code:i.code};if(typeof i.value!=="string"||!i.value.trim())return{kind:"error",message:`the meta name must be a non-empty string, got ${Ue(i.value)}`,code:t.TYPE_ERROR};return i.value}function fn(e,n){let r=de(e);if(r!==null)return r;let i=Ut(e,n);if(!i.ok)return{kind:"error",message:i.message,code:i.code};let s=i.value;if(s===void 0||s===null||s===!1)return"";if(Array.isArray(s))return s.filter((o)=>o!==void 0&&o!==null&&o!=="").map(String).join(", ");if(typeof s==="object"&&!(s instanceof Date))return{kind:"error",message:`the content must be text, got ${Ue(s)}`,code:t.TYPE_ERROR};return String(s)}var Dr=["title","lang","meta","link","script","headRaw","htmlAttrs","bodyClass","bodyAttrs"],eo=["title","titleTemplate","base","meta","link","script","style","htmlAttrs","bodyAttrs"],it={links:"link",metas:"meta",scripts:"script",styles:"style"},nt=new Set,rt=new WeakMap;function xe(e){if(nt.has(e))return;nt.add(e),console.warn(e)}function mn(e,n){let r=Array.from({length:n.length+1},(i,s)=>s);for(let i=1;i<=e.length;i++){let s=r[0];r[0]=i;for(let o=1;o<=n.length;o++){let a=r[o];r[o]=Math.min(r[o]+1,r[o-1]+1,s+(e[i-1]===n[o-1]?0:1)),s=a}}return r[n.length]}function hn(e,n){let r=e.toLowerCase(),i=n.find((p)=>p.toLowerCase()===r);if(i)return i;let s=it[r];if(s&&n.includes(s))return s;let o,a=1/0;for(let p of n){let g=mn(r,p.toLowerCase());if(g<a)o=p,a=g}let c=Math.min(e.length,o?.length??0)<=4?1:2;return a<=c?o:void 0}function Ee(e,n){if(!e||typeof e!=="object"||Array.isArray(e))return e||{};let r=rt.get(e);if(r)return r;let{known:i,source:s}=n,o=e;for(let a of Object.keys(e)){if(i.includes(a))continue;let c=it[a];if(c&&i.includes(c)&&Array.isArray(e[a])){if(o===e)o={...e};let g=Array.isArray(o[c])?o[c]:[];o[c]=[...g,...e[a]],delete o[a],xe(`[stx] ${s}.${a} is not a head key; reading it as ${s}.${c}. Rename it to \`${c}\`.`);continue}if(/^styles?$/.test(a)&&!i.includes("style")){xe(`[stx] ${s}.${a} is not a head key and is ignored. Use \`link\` with rel: 'stylesheet', or \`headRaw\` for an inline <style>.`);continue}let p=hn(a,i);xe(p?`[stx] ${s}.${a} is not a head key and is ignored. Did you mean \`${p}\`?`:`[stx] ${s}.${a} is not a head key and is ignored. Known keys: ${i.join(", ")}.`)}return rt.set(e,o),o}var C={},yn=[],J={};function Ni(){return C}function
|
|
71
|
-
`)}function
|
|
72
|
-
`,"")),headContent:n.trim()}}function
|
|
70
|
+
${e.slice(r)}`}function Nr(e,n={},r={},i){if(i??Oi(e))return e;return cn(e,n,r)}var gn=["og:","article:","book:","profile:","fb:","music:","video:"],pn=/^[a-z][\w-]*(?::[\w:-]+)?$/i;function Mr(e,n){if(e.length<1)return{kind:"error",message:"meta directive requires at least the meta name",code:t.INVALID_DIRECTIVE_SYNTAX};if(e.length>2)return{kind:"error",message:`@meta takes a name and a value, got ${e.length} arguments`,code:t.INVALID_DIRECTIVE_SYNTAX};let r=dn(e[0],n);if(typeof r!=="string")return r;let i;if(e.length===2){let o=fn(e[1],n);if(typeof o!=="string")return o;i=o}else{let o=r.includes(":")?r.slice(r.indexOf(":")+1):r,a=n.openGraph,c=n[o]??(ct(a)?a[o]:void 0);i=c===void 0||c===null||typeof c==="object"?"":String(c)}if(!i)return{kind:"empty"};return{kind:"tag",tag:gn.some((o)=>r.startsWith(o))?{property:r,content:i}:{name:r,content:i}}}function dn(e,n){let r=de(e);if(r!==null)return r.trim()?r:{kind:"error",message:"the meta name is empty",code:t.INVALID_DIRECTIVE_SYNTAX};if(pn.test(e.trim()))return e.trim();let i=Ut(e,n);if(!i.ok)return{kind:"error",message:`meta name: ${i.message}`,code:i.code};if(typeof i.value!=="string"||!i.value.trim())return{kind:"error",message:`the meta name must be a non-empty string, got ${Ue(i.value)}`,code:t.TYPE_ERROR};return i.value}function fn(e,n){let r=de(e);if(r!==null)return r;let i=Ut(e,n);if(!i.ok)return{kind:"error",message:i.message,code:i.code};let s=i.value;if(s===void 0||s===null||s===!1)return"";if(Array.isArray(s))return s.filter((o)=>o!==void 0&&o!==null&&o!=="").map(String).join(", ");if(typeof s==="object"&&!(s instanceof Date))return{kind:"error",message:`the content must be text, got ${Ue(s)}`,code:t.TYPE_ERROR};return String(s)}var Dr=["title","lang","meta","link","script","headRaw","htmlAttrs","bodyClass","bodyAttrs"],eo=["title","titleTemplate","base","meta","link","script","style","htmlAttrs","bodyAttrs"],it={links:"link",metas:"meta",scripts:"script",styles:"style"},nt=new Set,rt=new WeakMap;function xe(e){if(nt.has(e))return;nt.add(e),console.warn(e)}function mn(e,n){let r=Array.from({length:n.length+1},(i,s)=>s);for(let i=1;i<=e.length;i++){let s=r[0];r[0]=i;for(let o=1;o<=n.length;o++){let a=r[o];r[o]=Math.min(r[o]+1,r[o-1]+1,s+(e[i-1]===n[o-1]?0:1)),s=a}}return r[n.length]}function hn(e,n){let r=e.toLowerCase(),i=n.find((p)=>p.toLowerCase()===r);if(i)return i;let s=it[r];if(s&&n.includes(s))return s;let o,a=1/0;for(let p of n){let g=mn(r,p.toLowerCase());if(g<a)o=p,a=g}let c=Math.min(e.length,o?.length??0)<=4?1:2;return a<=c?o:void 0}function Ee(e,n){if(!e||typeof e!=="object"||Array.isArray(e))return e||{};let r=rt.get(e);if(r)return r;let{known:i,source:s}=n,o=e;for(let a of Object.keys(e)){if(i.includes(a))continue;let c=it[a];if(c&&i.includes(c)&&Array.isArray(e[a])){if(o===e)o={...e};let g=Array.isArray(o[c])?o[c]:[];o[c]=[...g,...e[a]],delete o[a],xe(`[stx] ${s}.${a} is not a head key; reading it as ${s}.${c}. Rename it to \`${c}\`.`);continue}if(/^styles?$/.test(a)&&!i.includes("style")){xe(`[stx] ${s}.${a} is not a head key and is ignored. Use \`link\` with rel: 'stylesheet', or \`headRaw\` for an inline <style>.`);continue}let p=hn(a,i);xe(p?`[stx] ${s}.${a} is not a head key and is ignored. Did you mean \`${p}\`?`:`[stx] ${s}.${a} is not a head key and is ignored. Known keys: ${i.join(", ")}.`)}return rt.set(e,o),o}var C={},yn=[],J={};function Ni(){return C}function my(){return J}function hy(){C={},yn.length=0,J={}}function bl(e){C=We(C,Ee(e,{known:eo,source:"useHead()"}))}function st(e,n,r){let i=[...e||[]];for(let s of n||[]){let o=r(s),a=o?i.findIndex((c)=>r(c)===o):-1;if(a<0)i.push(s);else i[a]=s}return i}function We(e,n){return{title:n.title??e.title,titleTemplate:n.titleTemplate??e.titleTemplate,base:n.base??e.base,meta:st(e.meta,n.meta,(r)=>r.name||r.property||(r.httpEquiv?`http:${r.httpEquiv}`:void 0)),link:st(e.link,n.link,(r)=>["icon","apple-touch-icon","canonical"].includes(r.rel||"")?[r.rel,r.type,r.media,r.sizes].join(":"):void 0),script:[...e.script||[],...n.script||[]],style:[...e.style||[],...n.style||[]],htmlAttrs:{...e.htmlAttrs,...n.htmlAttrs},bodyAttrs:{...e.bodyAttrs,...n.bodyAttrs}}}function Ig(e){bl(to(e))}function to(e){let n=[];if(e.description)n.push({name:"description",content:e.description});if(e.keywords){let p=Array.isArray(e.keywords)?e.keywords.join(", "):e.keywords;n.push({name:"keywords",content:p})}if(e.author)n.push({name:"author",content:e.author});if(e.robots)n.push({name:"robots",content:e.robots});let r=e.ogTitle??e.title,i=e.ogDescription??e.description;if(r)n.push({property:"og:title",content:r});if(i)n.push({property:"og:description",content:i});if(e.ogImage){if(n.push({property:"og:image",content:e.ogImage}),e.ogImageType)n.push({property:"og:image:type",content:e.ogImageType});if(e.ogImageWidth)n.push({property:"og:image:width",content:String(e.ogImageWidth)});if(e.ogImageHeight)n.push({property:"og:image:height",content:String(e.ogImageHeight)});if(e.ogImageAlt)n.push({property:"og:image:alt",content:e.ogImageAlt})}if(e.ogUrl)n.push({property:"og:url",content:e.ogUrl});if(e.ogType)n.push({property:"og:type",content:e.ogType});if(e.ogSiteName)n.push({property:"og:site_name",content:e.ogSiteName});if(e.ogLocale)n.push({property:"og:locale",content:e.ogLocale});if(e.profileFirstName)n.push({property:"profile:first_name",content:e.profileFirstName});if(e.profileLastName)n.push({property:"profile:last_name",content:e.profileLastName});if(e.profileUsername)n.push({property:"profile:username",content:e.profileUsername});let s=e.twitterTitle??e.title,o=e.twitterDescription??e.description,a=e.twitterImage??e.ogImage;if(e.twitterCard)n.push({name:"twitter:card",content:e.twitterCard});if(s)n.push({name:"twitter:title",content:s});if(o)n.push({name:"twitter:description",content:o});if(a){n.push({name:"twitter:image",content:a});let p=e.twitterImageAlt??(e.twitterImage?void 0:e.ogImageAlt);if(p)n.push({name:"twitter:image:alt",content:p})}if(e.twitterSite)n.push({name:"twitter:site",content:e.twitterSite});if(e.twitterCreator)n.push({name:"twitter:creator",content:e.twitterCreator});if(e.articleAuthor)n.push({property:"article:author",content:e.articleAuthor});if(e.articlePublishedTime)n.push({property:"article:published_time",content:e.articlePublishedTime});if(e.articleModifiedTime)n.push({property:"article:modified_time",content:e.articleModifiedTime});if(e.articleSection)n.push({property:"article:section",content:e.articleSection});if(e.articleTags)for(let p of e.articleTags)n.push({property:"article:tag",content:p});let c=[];if(e.canonical)c.push({rel:"canonical",href:e.canonical});return{title:e.title,titleTemplate:e.titleTemplate,meta:n,link:c}}function yy(e){if(J={...J,...e},e.title||e.description)Ig({title:e.title,description:e.description})}function by(e){let n=typeof e==="function"?e():e;bl({title:n})}function wy(e=C){let n=[];if(e.title){let r=e.title;if(e.titleTemplate)r=typeof e.titleTemplate==="function"?e.titleTemplate(r):e.titleTemplate.replace("%s",r);n.push(`<title>${I(r)}</title>`)}if(e.base){let r=Object.entries(e.base).map(([i,s])=>`${i}="${I(s)}"`).join(" ");n.push(`<base ${r}>`)}for(let r of e.meta||[]){let i=Object.entries(r).filter(([s,o])=>o!==void 0).map(([s,o])=>`${s==="httpEquiv"?"http-equiv":s}="${I(String(o))}"`).join(" ");n.push(`<meta ${i}>`)}for(let r of e.link||[]){let i=Object.entries(r).filter(([s,o])=>o!==void 0).map(([s,o])=>`${s}="${I(String(o))}"`).join(" ");n.push(`<link ${i}>`)}for(let r of e.script||[]){let{content:i,...s}=r,o=Object.entries(s).filter(([a,c])=>c!==void 0).map(([a,c])=>{if(typeof c==="boolean")return c?a:"";return`${a}="${I(String(c))}"`}).filter(Boolean).join(" ");if(i)n.push(`<script ${o}>${Y(r)}</script>`);else n.push(`<script ${o}></script>`)}for(let r of e.style||[]){let i=r.type?` type="${r.type}"`:"";n.push(`<style${i}>${r.content}</style>`)}return n.join(`
|
|
71
|
+
`)}function vy(e=C){if(!e.htmlAttrs)return"";return Object.entries(e.htmlAttrs).map(([n,r])=>`${n}="${I(r)}"`).join(" ")}function xy(e=C){if(!e.bodyAttrs)return"";return Object.entries(e.bodyAttrs).map(([n,r])=>`${n}="${I(r)}"`).join(" ")}function I(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function Sy(e=C){if(typeof document>"u")return;if(e.title){let n=e.title;if(e.titleTemplate)n=typeof e.titleTemplate==="function"?e.titleTemplate(n):e.titleTemplate.replace("%s",n);document.title=n}for(let n of e.meta||[]){let r=n.name?`meta[name="${n.name}"]`:n.property?`meta[property="${n.property}"]`:null;if(r){let i=document.querySelector(r);if(!i){if(i=document.createElement("meta"),n.name)i.setAttribute("name",n.name);if(n.property)i.setAttribute("property",n.property);document.head.appendChild(i)}i.setAttribute("content",n.content)}}for(let n of e.link||[]){let r=`link[rel="${n.rel}"]${n.href?`[href="${n.href}"]`:""}`,i=document.querySelector(r);if(!i)i=document.createElement("link"),document.head.appendChild(i);for(let[s,o]of Object.entries(n))if(o!==void 0)i.setAttribute(s,String(o))}if(e.htmlAttrs)for(let[n,r]of Object.entries(e.htmlAttrs))if(n==="class")for(let i of String(r).split(/\s+/).filter(Boolean))document.documentElement.classList.add(i);else document.documentElement.setAttribute(n,r);if(e.bodyAttrs)for(let[n,r]of Object.entries(e.bodyAttrs))document.body.setAttribute(n,r)}function ky(e){let n="";return{content:e.replace(/@head\s*([\s\S]*?)@endhead/g,(i,s)=>(n+=s.trim()+`
|
|
72
|
+
`,"")),headContent:n.trim()}}function _y(e,n){return e.replace(/@title\s*\(\s*(?:(['"`])(.+?)\1|([^)]+))\s*\)/g,(r,i,s,o)=>{let a=i?s:n[(o||"").trim()]??o,c=n.__stx_runtime_head??{};return n.__stx_runtime_head=We(c,{title:a}),""})}function Cy(e,n,r=""){if(!e.includes("@meta"))return e;return Ht(e,/(?<![\w$@])@meta\s*\(/g,(i,s)=>{let o=Mr(Vt(i),n);if(o.kind==="error")return D("Meta",s,o.message,r,o.code);if(o.kind==="tag"){let a=n.__stx_runtime_head??{};n.__stx_runtime_head=We(a,{meta:[o.tag]})}return""},(i)=>D("Meta",i,"the call has no closing parenthesis",r,t.INVALID_DIRECTIVE_SYNTAX))}export{R,Ft,le,_,Js,Ri,Ys,u,f,dl,P,at,zt,d,Zs,t,ee,Ar,K,l,Ce,Ai,z,En,x,pl,Pi,Ht,Vt,Ut,Ue,ct,D,Qs,Ii,fl,Pr,Ir,gl,lt,ml,Or,hl,Tn,Oi,yl,Nr,Mr,Dr,eo,Ee,Ni,my,hy,bl,We,Ig,to,yy,by,wy,vy,xy,Sy,ky,_y,Cy};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{t,l}from"./chunk-
|
|
2
|
+
import{t,l}from"./chunk-0z2gqttt.js";import{s,xn,m}from"./chunk-jdqmk5sv.js";import{rt}from"./chunk-jwwsxym6.js";import{$s,Rs}from"./chunk-pa8xkctc.js";import{Ac,ni,Es,Ts}from"./chunk-kedgfk9z.js";import{Tc,$c}from"./chunk-tk67pqaf.js";import{_t}from"./chunk-f1vvhbmw.js";import{gn,Dc,wr,vr}from"./chunk-ksxbfyef.js";import{h}from"./chunk-kgrvvtcy.js";import{oo}from"./chunk-ff3j7jnf.js";import Q from"fs";import N from"path";import{loadConfigWithResult as Bt}from"bunfig";var B={duration:300,delay:0,ease:"ease",direction:"both"};function it(e,r={}){let{duration:i,delay:o,ease:n,direction:c,custom:d}={...B,...r};if(e==="custom"&&d)return d;switch(e){case"fade":return`${c==="in"?"opacity: 0; animation: fadeIn var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms) forwards;":c==="out"?"opacity: 1; animation: fadeOut var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms) forwards;":"opacity: 1; transition: opacity var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms);"}
|
|
3
3
|
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
|
|
4
4
|
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }`;case"slide":return`${c==="in"?"transform: translateY(20px); opacity: 0; animation: slideIn var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms) forwards;":c==="out"?"transform: translateY(0); opacity: 1; animation: slideOut var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms) forwards;":"transform: translateY(0); opacity: 1; transition: transform var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms), opacity var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms);"}
|
|
5
5
|
@keyframes slideIn { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
|
|
@@ -234,7 +234,7 @@ else {
|
|
|
234
234
|
</script>
|
|
235
235
|
`}var Pe={name:"transition",handler:(e,r,i,o)=>{if(r.length<1)return`<div class="stx-error">@transition directive requires at least a transition type</div>${e}`;let n=r[0],c=r.length>1?Number.parseInt(r[1],10)||B.duration:B.duration,d=r.length>2?r[2]||B.ease:B.ease,p=r.length>3?Number.parseInt(r[3],10)||B.delay:B.delay,u=r.length>4?r[4]||B.direction:B.direction,g=`stx-transition-${Math.random().toString(36).substr(2,9)}`,y=it(n,{duration:c,delay:p,ease:d,direction:u}),f="stx-transition",v="";if(n==="fade")v="stx-fade";else if(n==="slide")v="stx-slide";else if(n==="scale")v="stx-scale";else if(n==="flip")v="stx-flip";else if(n==="rotate")v="stx-rotate";return`<div id="${g}" class="${f} ${v} ${u==="out"?"stx-out":""}"
|
|
236
236
|
style="--stx-transition-duration: ${c}ms; --stx-transition-ease: ${d}; --stx-transition-delay: ${p}ms;">${e}</div>`},hasEndTag:!0,description:"Applies transition effects to an element"},ke={name:"scrollAnimate",handler:(e,r,i,o)=>{if(r.length<1)return`<div class="stx-error">@scrollAnimate directive requires at least an animation type</div>${e}`;let n=r[0],c=r.length>1?Number.parseInt(r[1],10)||300:300,d=r.length>2?r[2]||"ease":"ease",p=r.length>3?Number.parseFloat(r[3])||0.2:0.2,u=r.length>4?Number.parseInt(r[4],10)||0:0,g=`stx-scroll-${Math.random().toString(36).substr(2,9)}`,y=`--stx-transition-duration: ${c}ms; --stx-transition-ease: ${d}; --stx-transition-delay: ${u}ms; will-change: opacity, transform;`,f="stx-transition stx-observe stx-out";if(n==="fade")f+=" stx-fade";else if(n==="slide-up"||n==="slide")f+=" stx-from-bottom";else if(n==="slide-down")f+=" stx-from-top";else if(n==="slide-left")f+=" stx-from-right";else if(n==="slide-right")f+=" stx-from-left";else if(n==="scale")f+=" stx-scale";else if(n.includes("-"))f+=` stx-${n}`;else f+=` stx-${n}`;return`<div id="${g}" class="${f}" style="${y}" data-threshold="${p}">${e}</div>`},hasEndTag:!0,description:"Applies animations that trigger when scrolled into view"},Ae={name:"animationGroup",handler:(e,r,i,o)=>{if(r.length<2)return`<div class="stx-error">@animationGroup directive requires a group name and at least one element selector</div>${e}`;let n=r[0],c=r.slice(1).map((g)=>g.startsWith("#")||g.startsWith(".")?g:`#${g}`),d=i.staggerDelay||50,p=i.sequence||!0,u=dt(n,c,{staggerDelay:d,sequence:p});return`${e}
|
|
237
|
-
${u}`},hasEndTag:!1,description:"Coordinates multiple animations together as a group"},_e={name:"motion",handler:(e,r,i,o)=>{let n=r.length>0?r[0].toLowerCase()==="true":!0,c=at();return`<div data-animate="${n?"auto":"true"}">${e}</div>${c}`},hasEndTag:!0,description:"Controls motion and animation preferences"};function
|
|
237
|
+
${u}`},hasEndTag:!1,description:"Coordinates multiple animations together as a group"},_e={name:"motion",handler:(e,r,i,o)=>{let n=r.length>0?r[0].toLowerCase()==="true":!0,c=at();return`<div data-animate="${n?"auto":"true"}">${e}</div>${c}`},hasEndTag:!0,description:"Controls motion and animation preferences"};function vc(e,r,i,o){let n=e;if(o.animation?.enabled===!1)return n;let c=i.includes("test")&&i.includes("animation");if(!ot(n)&&!c)return n;if(!n.includes('<style id="stx-animation-base">')){let p=ct();n=n.replace("</head>",`${p}
|
|
238
238
|
</head>`)}if(n.includes("stx-observe")){if(!n.includes("Intersection Observer for scroll animations")){let u=lt(),g=n.lastIndexOf("</body>");if(g!==-1)n=n.slice(0,g)+u+`
|
|
239
239
|
`+n.slice(g)}}return n}async function ut(e,r,i,o){let n=r[0]?.replace(/['"]/g,"")||"main",c=rt();if(n!=="main")c=c.replace("container:'main'",`container:'${n}'`);return`<script data-stx-router>${c}</script>`}var Re={name:"stxRouter",handler:ut,hasEndTag:!1,description:"Inject the STX SPA router script for client-side navigation"};var pt={enabled:!1,trackMouse:!0,trackClicks:!0,trackScroll:!0,samplingRate:100,honorDnt:!0,batchSize:50,maxDataPoints:1000,sessionTimeout:30,persistData:!1,storagePrefix:"stx_heatmap",captureAttributes:["data-heatmap-id","data-track"],ignoreSelectors:["[data-heatmap-ignore]",".heatmap-ignore"],debugOverlay:!1};function Ee(e){let r=e.heatmap;if(!r?.enabled)return"";let i={...pt,...r};return`
|
|
240
240
|
<!-- stx Heatmap - Privacy-Compliant Tracking -->
|
|
@@ -619,7 +619,7 @@ else {
|
|
|
619
619
|
};
|
|
620
620
|
})();
|
|
621
621
|
</script>
|
|
622
|
-
`}function
|
|
622
|
+
`}function xc(e,r){let i=Ee(r);if(!i)return e;let o=e.lastIndexOf("</body>");if(o!==-1)return e.slice(0,o)+i+e.slice(o);return e+i}var Oe={name:"heatmap",hasEndTag:!1,description:"Inject privacy-compliant heatmap tracking script",handler:async(e,r,i,o)=>{let n=i.__stx_config||{};if(r.length>0){let c=mt(r.join(" "));n.heatmap={...n.heatmap,...c,enabled:!0}}return Ee(n)}};function mt(e){let r={},i=e.match(/(\w+)=["']?([^"'\s]+)["']?/g)||[];for(let o of i){let[n,c]=o.split("="),d=c?.replace(/["']/g,"");switch(n){case"endpoint":r.endpoint=d;break;case"samplingRate":r.samplingRate=Number.parseInt(d,10);break;case"batchSize":r.batchSize=Number.parseInt(d,10);break;case"trackMouse":r.trackMouse=d==="true";break;case"trackClicks":r.trackClicks=d==="true";break;case"trackScroll":r.trackScroll=d==="true";break;case"honorDnt":r.honorDnt=d==="true";break;case"debugOverlay":r.debugOverlay=d==="true";break}}return r}function J(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function Ie(e){let r=e.trim().toLowerCase();return!r.startsWith("javascript:")&&!r.startsWith("vbscript:")&&!r.startsWith("data:text/html")}function mr(e){let r=/^---\r?\n([\s\S]*?)\r?\n---\r?\n/,i=e.match(r);if(!i)return{data:{},content:e.trim()};let o=i[1],n=e.slice(i[0].length),c={};for(let d of o.split(`
|
|
623
623
|
`)){let p=d.trim();if(!p||p.startsWith("#"))continue;let u=p.indexOf(":");if(u===-1)continue;let g=p.slice(0,u).trim(),y=p.slice(u+1).trim();if(typeof y==="string"){if(y.startsWith('"')&&y.endsWith('"')||y.startsWith("'")&&y.endsWith("'"))y=y.slice(1,-1);else if(y.startsWith("[")&&y.endsWith("]"))try{y=JSON.parse(y)}catch{}else if(y==="true")y=!0;else if(y==="false")y=!1;else if(/^-?\d+(?:\.\d+)?$/.test(y))y=Number(y)}c[g]=y}return{data:c,content:n.trim()}}function tt(e,r={}){let{gfm:i=!0,breaks:o=!1}=r,n=e,c=[];if(n=n.replace(/```(\w*)\n([\s\S]*?)```/g,(y,f,v)=>{let b=c.length,w=f?` class="language-${J(f)}"`:"";return c.push(`<pre><code${w}>${J(v.trim())}</code></pre>`),`\x00CODEBLOCK${b}\x00`}),n=n.replace(/`([^`]*)`/g,(y,f)=>`<code>${J(f)}</code>`),n=n.replace(/^######\s+(.*)$/gm,"<h6>$1</h6>"),n=n.replace(/^#####\s+(.*)$/gm,"<h5>$1</h5>"),n=n.replace(/^####\s+(.*)$/gm,"<h4>$1</h4>"),n=n.replace(/^###\s+(.*)$/gm,"<h3>$1</h3>"),n=n.replace(/^##\s+(.*)$/gm,"<h2>$1</h2>"),n=n.replace(/^#\s+(.*)$/gm,"<h1>$1</h1>"),n=n.replace(/\*\*\*(.+?)\*\*\*/g,"<strong><em>$1</em></strong>"),n=n.replace(/___(.+?)___/g,"<strong><em>$1</em></strong>"),n=n.replace(/\*\*(.+?)\*\*/g,"<strong>$1</strong>"),n=n.replace(/__(.+?)__/g,"<strong>$1</strong>"),n=n.replace(/\*(.+?)\*/g,"<em>$1</em>"),n=n.replace(/(?<![a-zA-Z0-9])_(.+?)_(?![a-zA-Z0-9])/g,"<em>$1</em>"),i)n=n.replace(/~~(.+?)~~/g,"<del>$1</del>");if(n=n.replace(/!\[([^\]]*)\]\(([^)]+)\)/g,(y,f,v)=>`<img src="${Ie(v)?J(v):""}" alt="${J(f)}" />`),n=n.replace(/\[([^\]]+)\]\(([^)]+)\)/g,(y,f,v)=>`<a href="${Ie(v)?J(v):""}">${f}</a>`),n=n.replace(/^(?:---|\*\*\*|___)\s*$/gm,"<hr />"),n=n.replace(/^>\s+(.*)$/gm,"<blockquote>$1</blockquote>"),n=n.replace(/<\/blockquote>\n<blockquote>/g,`
|
|
624
624
|
`),n=n.replace(/^[*\-+]\s+(.*)$/gm,"<li data-ul>$1</li>"),n=n.replace(/(<li data-ul>.*<\/li>\n?)+/g,"<ul>$&</ul>"),n=n.replace(/<\/ul>\n<ul>/g,""),n=n.replace(/^\d+\.\s+(.*)$/gm,"<li data-ol>$1</li>"),n=n.replace(/(<li data-ol>.*<\/li>\n?)+/g,"<ol>$&</ol>"),n=n.replace(/<\/ol>\n<ol>/g,""),n=n.replace(/<li data-ul>/g,"<li>"),n=n.replace(/<li data-ol>/g,"<li>"),i)n=n.replace(/^\|(.+)\|\s*\n\|[-:\s|]+\|\s*\n((?:\|.+\|\s*\n)*)/gm,(y,f,v)=>{let w=`<tr>${f.split("|").map((C)=>C.trim()).filter(Boolean).map((C)=>`<th>${J(C)}</th>`).join("")}</tr>`,k=v.trim().split(`
|
|
625
625
|
`).map((C)=>`<tr>${C.split("|").map((P)=>P.trim()).filter(Boolean).map((P)=>`<td>${J(P)}</td>`).join("")}</tr>`).join(`
|
|
@@ -637,7 +637,7 @@ ${k}
|
|
|
637
637
|
`:`
|
|
638
638
|
`)}</p>`);if(n=p.join(`
|
|
639
639
|
`),o)n=n.replace(/\n/g,`<br />
|
|
640
|
-
`);for(let y=0;y<c.length;y++)n=n.replace(`\x00CODEBLOCK${y}\x00`,c[y]);return n=n.replace(/<p>\s*<\/p>/g,""),n.trim()}async function
|
|
640
|
+
`);for(let y=0;y<c.length;y++)n=n.replace(`\x00CODEBLOCK${y}\x00`,c[y]);return n=n.replace(/<p>\s*<\/p>/g,""),n.trim()}async function Sc(e,r,i=""){let o=e,n=[],c=/@markdown(?:\([^)]*\))?/g,d;while((d=c.exec(e))!==null){let p=d.index,u=d[0].match(/@markdown\(([^)]*)\)/),g=u?u[1]:"",y=p+d[0].length,f=1,v=y,b=-1;while(f>0&&v<e.length){let C=e.indexOf("@markdown",v),A=e.indexOf("@endmarkdown",v);if(A===-1)break;if(C!==-1&&C<A&&C!==p){let P=e[C+9];if(P==="("||P===`
|
|
641
641
|
`||P==="\r"||P===" "||P===void 0)f++;v=C+9}else{if(f--,f===0){b=A;break}v=A+12}}if(b===-1)continue;let w=e.slice(y,b),k=e.slice(p,b+12);n.push({fullMatch:k,options:g,content:w,index:p}),c.lastIndex=b+12}for(let{fullMatch:p,options:u,content:g,index:y}of n)try{let f={};if(u)u.split(",").forEach((w)=>{let k=w.trim();if(k)f[k]=!0});let v={gfm:f.gfm??!0,breaks:f.breaks??!1},b=tt(g.trim(),v);o=o.split(p).join(b)}catch(f){let v=f instanceof Error?f.message:String(f),b=m("Markdown Directive",`Error processing markdown: ${v}`,i,e,y,p);o=o.split(p).join(b)}return o}async function Te(e,r,i,o){let n={gfm:!0,breaks:!1};return r.forEach((c)=>{let d=c.trim().replace(/['"]/g,"");if(d==="breaks")n.breaks=!0;if(d==="no-gfm")n.gfm=!1}),tt(e.trim(),n)}var Z=[320,480,640,768,1024,1280,1536,1920,2560],gt=[1,1.5,2,3],te=["avif","webp","jpeg"],ft={avif:"image/avif",webp:"image/webp",jpeg:"image/jpeg",png:"image/png",gif:"image/gif"};function me(e,r=Z,i={},o){return r.sort((n,c)=>n-c).map((n)=>`${re(e,{...i,w:n,fm:o})} ${n}w`).join(", ")}function Me(e,r,i=gt,o={},n){return i.sort((c,d)=>c-d).map((c)=>{let d=Math.round(r*c);return`${re(e,{...o,w:d,dpr:c,fm:n})} ${c}x`}).join(", ")}function ge(e,r="100vw"){if(!e||Object.keys(e).length===0)return r;let o=Object.entries(e).map(([n,c])=>{let d=/^\d+$/.test(n)?`${n}px`:n;return{bp:d,size:c,numericBp:Number.parseInt(d)||0}}).sort((n,c)=>n.numericBp-c.numericBp).map(({bp:n,size:c})=>`(max-width: ${n}) ${c}`);return o.push(r),o.join(", ")}function re(e,r={}){let i=Object.entries(r).filter(([,c])=>c!==void 0&&c!==null).map(([c,d])=>{if(Array.isArray(d))return[c,d.join(",")];return[c,String(d)]});if(i.length===0)return e;let o=i.map(([c,d])=>`${c}=${encodeURIComponent(d)}`).join("&"),n=e.includes("?")?"&":"?";return`${e}${n}${o}`}function fe(e){return ft[e]||"application/octet-stream"}var ht={strategy:"thumbhash",width:20,quality:50,blurLevel:40,transitionDuration:300,easing:"ease-out"},ye=`
|
|
642
642
|
.stx-img-placeholder {
|
|
643
643
|
position: relative;
|
|
@@ -684,7 +684,7 @@ ${k}
|
|
|
684
684
|
#${e}.stx-img-loaded img {
|
|
685
685
|
opacity: 1;
|
|
686
686
|
}
|
|
687
|
-
`.trim()}var he=new Map;async function Ne(e,r={}){let i=`${e}:${JSON.stringify(r)}`;if(he.has(i))return he.get(i);let o=await vt(e,r);return he.set(i,o),o}async function wt(){try{return await import("./chunk-
|
|
687
|
+
`.trim()}var he=new Map;async function Ne(e,r={}){let i=`${e}:${JSON.stringify(r)}`;if(he.has(i))return he.get(i);let o=await vt(e,r);return he.set(i,o),o}async function wt(){try{return await import("./chunk-qw1f97s7.js")}catch(e){if(!Ve)console.warn("[stx-media] Image processor not available, some features disabled:",e),Ve=!0;return null}}var Ve=!1,ve=80,le="async",ce="lazy",ze=!1;async function oe(e,r={}){let i=r,o=e;if(o.process&&!o.skipOptimization){if(i.tsImagesConfig?.enabled&&!i.isDev)return Dt(o,i)}if(i.processedResult?.processed)return we(e,i.processedResult,r);if(i.responsiveVariants)return Fe(e,i.responsiveVariants,r);let{src:n,alt:c,width:d,height:p,sizes:u,widths:g=Z,dpr:y,formats:f=te,quality:v=ve,params:b={},placeholder:w="none",placeholderOptions:k={},lazy:C=!0,priority:A=!1,loading:P=A?"eager":ce,decoding:E=le,fetchpriority:I,objectFit:D,objectPosition:S,crossorigin:x,referrerpolicy:T}=e,{class:V,style:M,id:z}=e,_=e.data||{},{isDev:L=!1,baseUrl:G=""}=r;if(L&&!r.optimize)return Ct(e);let W,R,q=z||`stx-img-${Math.random().toString(36).slice(2,8)}`;if(w!=="none"&&!A)try{W=await Ne(n,{strategy:w,...k}),R=je(q,W,k)}catch{}let ie=y!==void 0&&d!==void 0,X;if(ie)X=St(e,q,W,r);else X=await $t(e,q,W,r);let ee;if(A){let De=f.includes("webp")?"webp":f[0],nt=me(n,g,{...b,q:v},De),st=typeof u==="object"?ge(u):u||"100vw";ee=`<link rel="preload" as="image" imagesrcset="${nt}" imagesizes="${st}" />`}let ae=[];if(!ze&&w!=="none")ae.push(ye),ze=!0;if(R)ae.push(R);let et=C?We(q):void 0;return{html:X,preloadLink:ee,css:ae.length>0?ae.join(`
|
|
688
688
|
`):void 0,script:et}}async function $t(e,r,i,o){let{src:n,alt:c,width:d,height:p,sizes:u,widths:g=Z,formats:y=te,quality:f=ve,params:v={},lazy:b=!0,priority:w=!1,loading:k=w?"eager":ce,decoding:C=le,fetchpriority:A,objectFit:P,objectPosition:E,crossorigin:I,referrerpolicy:D}=e,{class:S,style:x}=e,T=e.data||{},V=typeof u==="object"?ge(u):u||"100vw",M=[];for(let L of y){let G=me(n,g,{...v,q:f},L),W=fe(L);if(b&&!w)M.push(` <source type="${W}" data-srcset="${G}" data-sizes="${V}" />`);else M.push(` <source type="${W}" srcset="${G}" sizes="${V}" />`)}let z=be({src:re(n,{...v,q:f}),alt:c,width:d,height:p,loading:w?void 0:k,decoding:C,fetchpriority:w?"high":A,objectFit:P,objectPosition:E,crossorigin:I,referrerpolicy:D,className:Le(S,i),style:xe(x,P,E,i),lazy:b&&!w,data:T}),_;if(i){let L=`background-image: url('${i.dataURL}'); background-size: cover; background-position: center;`;_=`<div id="${r}" class="stx-img-placeholder" style="${L}">
|
|
689
689
|
<picture>
|
|
690
690
|
${M.join(`
|
|
@@ -748,7 +748,7 @@ ${D.join(`
|
|
|
748
748
|
`):void 0,script:G}}async function Fe(e,r,i){let o={src:r.src,processed:!0,variants:[],placeholder:r.placeholder?.dataURL,originalWidth:r.placeholder?.width,originalHeight:r.placeholder?.height};for(let[n,c]of Object.entries(r.byFormat))if(c)o.variants.push(...c);return we(e,o,i)}function Pt(){return _t({name:"img",hasEndTag:!1,description:"Render an optimized responsive image with srcset and lazy loading",transform:async(e,r,i,o)=>{let{src:n,alt:c,options:d}=kt(e,r,i);if(!n)return console.warn("@img directive: missing src argument"),"<!-- @img: missing src -->";let p={src:n,alt:c||"",widths:d.widths||Z,formats:d.formats||te,quality:d.quality,sizes:d.sizes,dpr:d.dpr,params:d.params,placeholder:d.placeholder,placeholderOptions:d.placeholderOptions,lazy:d.lazy!==!1,priority:d.priority||!1,loading:d.loading,decoding:d.decoding,fetchpriority:d.fetchpriority,objectFit:d.objectFit,objectPosition:d.objectPosition,class:d.class,style:d.style,id:d.id,width:d.width,height:d.height},u=i.__isDev||!1,g=await oe(p,{isDev:u}),y=g.html;if(g.preloadLink)y=g.preloadLink+`
|
|
749
749
|
`+y;if(g.css)y+=`
|
|
750
750
|
<style>${g.css}</style>`;if(g.script)y+=`
|
|
751
|
-
<script>${g.script}</script>`;return y},defaults:{src:"",alt:"",options:{lazy:!0,placeholder:"none"}}})}function kt(e,r,i){if(r.src)return{src:String(r.src),alt:String(r.alt||""),options:r.options||{}};let o=e.trim();if(o.startsWith("@img(")||o.startsWith("("))o=o.replace(/^@img\(/,"").replace(/^\(/,"").replace(/\)$/,"");let n=At(o),c=$e(n[0],i)||"",d=$e(n[1],i)||"",p={};if(n[2]){let u=$e(n[2],i);if(typeof u==="object"&&u!==null)p=u;else if(typeof n[2]==="string")try{p=JSON.parse(n[2])}catch{}}return{src:c,alt:d,options:p}}function At(e){let r=[],i="",o=!1,n="",c=0,d=0;for(let p=0;p<e.length;p++){let u=e[p],g=p>0?e[p-1]:"";if((u==='"'||u==="'"||u==="`")&&g!=="\\"){if(!o)o=!0,n=u;else if(u===n)o=!1,n="";else i+=u;continue}if(!o){if(u==="{")c++;if(u==="}")c--;if(u==="[")d++;if(u==="]")d--;if(u===","&&c===0&&d===0){r.push(i.trim()),i="";continue}}i+=u}if(i.trim())r.push(i.trim());return r}function $e(e,r){if(typeof e!=="string")return e;let i=e.trim();if(i.startsWith('"')&&i.endsWith('"')||i.startsWith("'")&&i.endsWith("'"))return i.slice(1,-1);if(!i.startsWith("/")&&!i.startsWith(".")&&!i.startsWith("http")&&!i.startsWith("{")){let o=r[i];if(o!==void 0)return o}if(i.startsWith("{")||i.startsWith("["))try{return JSON.parse(i)}catch{}return i}var He=Pt();import{existsSync as Rt}from"fs";import ne from"path";function _s(){let e=[ne.join(import.meta.dir,"primitives"),ne.join(import.meta.dir,"..","primitives"),ne.join(import.meta.dir,"native","primitives"),ne.join(import.meta.dir,"..","native","primitives")];for(let r of e)if(Rt(ne.join(r,"View.stx")))return r;return e[0]}async function Ue(){try{return await import("./chunk-
|
|
751
|
+
<script>${g.script}</script>`;return y},defaults:{src:"",alt:"",options:{lazy:!0,placeholder:"none"}}})}function kt(e,r,i){if(r.src)return{src:String(r.src),alt:String(r.alt||""),options:r.options||{}};let o=e.trim();if(o.startsWith("@img(")||o.startsWith("("))o=o.replace(/^@img\(/,"").replace(/^\(/,"").replace(/\)$/,"");let n=At(o),c=$e(n[0],i)||"",d=$e(n[1],i)||"",p={};if(n[2]){let u=$e(n[2],i);if(typeof u==="object"&&u!==null)p=u;else if(typeof n[2]==="string")try{p=JSON.parse(n[2])}catch{}}return{src:c,alt:d,options:p}}function At(e){let r=[],i="",o=!1,n="",c=0,d=0;for(let p=0;p<e.length;p++){let u=e[p],g=p>0?e[p-1]:"";if((u==='"'||u==="'"||u==="`")&&g!=="\\"){if(!o)o=!0,n=u;else if(u===n)o=!1,n="";else i+=u;continue}if(!o){if(u==="{")c++;if(u==="}")c--;if(u==="[")d++;if(u==="]")d--;if(u===","&&c===0&&d===0){r.push(i.trim()),i="";continue}}i+=u}if(i.trim())r.push(i.trim());return r}function $e(e,r){if(typeof e!=="string")return e;let i=e.trim();if(i.startsWith('"')&&i.endsWith('"')||i.startsWith("'")&&i.endsWith("'"))return i.slice(1,-1);if(!i.startsWith("/")&&!i.startsWith(".")&&!i.startsWith("http")&&!i.startsWith("{")){let o=r[i];if(o!==void 0)return o}if(i.startsWith("{")||i.startsWith("["))try{return JSON.parse(i)}catch{}return i}var He=Pt();import{existsSync as Rt}from"fs";import ne from"path";function _s(){let e=[ne.join(import.meta.dir,"primitives"),ne.join(import.meta.dir,"..","primitives"),ne.join(import.meta.dir,"native","primitives"),ne.join(import.meta.dir,"..","native","primitives")];for(let r of e)if(Rt(ne.join(r,"View.stx")))return r;return e[0]}async function Ue(){try{return await import("./chunk-y2dtqrrz.js")}catch(e){if(!qe)console.warn("[stx-media] Video processor not available, some features disabled:",e),qe=!0;return null}}var qe=!1,Be=!0,Je="metadata",Et="https://cdn.jsdelivr.net/npm/ts-video-player@latest/dist/index.min.js";async function de(e,r={}){let i=r,o=e;if(o.process&&!o.skipProcessing){if(i.tsVideosConfig?.enabled&&!i.isDev)return jt(o,i)}if(i.processedResult?.processed)return Ge(e,i.processedResult,r);let n;if(o.generatePoster&&o.src&&!e.poster)n=await Nt(o,i);let{src:c,sources:d=[],poster:p,posterPlaceholder:u,controls:g=Be,autoplay:y=!1,muted:f=!1,loop:v=!1,preload:b=Je,playsinline:w=!0,lazy:k=!0,player:C="native",type:A,width:P,height:E,crossorigin:I,disablePictureInPicture:D=!1,disableRemotePlayback:S=!1}=e,x=n||p,{class:T,style:V}=e,M=e.id||`stx-video-${Math.random().toString(36).slice(2,8)}`;if(C==="ts-video")return It(e,r);if(A&&A!=="video")return Ot(c||"",A,e);let z=d.length>0?d:c?[{src:c,type:Ke(c)}]:[],_=[`id="${M}"`];if(g)_.push("controls");if(y)_.push("autoplay");if(f)_.push("muted");if(v)_.push("loop");if(w)_.push("playsinline");if(D)_.push("disablepictureinpicture");if(S)_.push("disableremoteplayback");if(I)_.push(`crossorigin="${I}"`);if(k){if(_.push(`data-preload="${b}"`),_.push('preload="none"'),x)_.push(`data-poster="${j(x)}"`);_.push("data-stx-lazy")}else if(_.push(`preload="${b}"`),x)_.push(`poster="${j(x)}"`);if(P)_.push(`width="${P}"`);if(E)_.push(`height="${E}"`);if(T)_.push(`class="${j(T)}"`);if(V)_.push(`style="${j(V)}"`);let L=z.map((R)=>` <source ${k?`data-src="${j(R.src)}"`:`src="${j(R.src)}"`} type="${R.type}"${R.media?` media="${R.media}"`:""} />`).join(`
|
|
752
752
|
`),G=`<video ${_.join(" ")}>
|
|
753
753
|
${L}
|
|
754
754
|
Your browser does not support the video tag.
|
|
@@ -1307,6 +1307,6 @@ ${y}
|
|
|
1307
1307
|
customElements.define('${r}', ${d});
|
|
1308
1308
|
`}async function Ze(e,r,i,o){if(r.length<1)return l("WebComponent","@webcomponent directive requires at least the tag name parameter",t.INVALID_DIRECTIVE_SYNTAX);let n=r[0].replace(/['"]/g,""),d=(i.__stx_options||{}).componentsDir||"components",p=H.isAbsolute(d)?[H.join(d,`${n}.stx`),H.join(H.dirname(o),`${n}.stx`)]:[H.join(H.dirname(o),d,`${n}.stx`),H.join(process.cwd(),d,`${n}.stx`),H.join(H.dirname(o),`${n}.stx`)],u=null;for(let f of p)if(await s(f)){u=await Bun.file(f).text();break}if(!u)return l("WebComponent",`Component file not found: ${n}.stx`,t.FILE_NOT_FOUND);let g=qt(u,n);return`<script type="module">
|
|
1309
1309
|
${Ut(g)}
|
|
1310
|
-
</script>`}var F={enabled:!0,ssr:!1,partialsDir:"partials",componentsDir:"components",layoutsDir:"layouts",defaultLayout:"default",debug:!1,cache:!0,stateDir:gn,cachePath:".stx/cache",cacheVersion:"1.0.0",componentRenderCacheBytes:33554432,build:{pagesDir:"pages",outputDir:"dist",baseUrl:"/",sitemap:!0,minify:!0,cache:!0,cacheDir:".stx/ssg-cache",concurrency:10,generate404:!0,publicDir:"public",trailingSlash:!1,cleanOutput:!0},customDirectives:[{name:"markdown",handler:Te,hasEndTag:!0,description:"Render markdown content to HTML"},{name:"webcomponent",handler:Ze,hasEndTag:!1,description:"Include a web component in the template"},Ec,Tc,$s,Rs,Pe,Ae,_e,ke,Re,Oe,He,Se,...oo],middleware:[],i18n:{defaultLocale:"en",locale:"en",translationsDir:"translations",format:"yaml",fallbackToKey:!0,cache:!0},webComponents:{enabled:!1,outputDir:"dist/web-components",components:[]},docs:{enabled:!1,outputDir:"docs",format:"markdown",components:!0,templates:!0,directives:!0},streaming:{enabled:!0,bufferSize:16384,strategy:"auto",timeout:30000},hydration:{enabled:!1,mode:"islands",clientEntry:"src/client.ts",autoMarkers:!0,preload:"lazy"},router:{enabled:!0,container:"main",linkSelector:"a[href]",viewTransitions:!0,scrollToTop:!0,scrollRestoration:!0,prefetch:!0,cache:!0,cacheTTL:300000,skipSelectors:'[data-no-router], [target="_blank"]',viewTransitionCSS:{oldRoot:"fade-out 0.15s ease-in",newRoot:"fade-in 0.2s ease-out",oldContent:"slide-out 0.2s ease-in",newContent:"slide-in 0.25s ease-out"}},a11y:{enabled:!0,addSrOnlyStyles:!0,level:"AA",autoFix:!1,ignoreChecks:[]},seo:{enabled:!0,socialPreview:!0,defaultConfig:{title:"stx Project",description:"A website built with stx templating engine"}},animation:{enabled:!0,defaultDuration:300,defaultEase:"ease",respectMotionPreferences:!0,staggerDelay:50},markdown:{enabled:!0,syntaxHighlighting:{enabled:!0,serverSide:!0,defaultTheme:"github-dark",highlightUnknownLanguages:!0,additionalThemes:["light-plus","one-dark-pro","dracula","monokai","solarized-light","nord","github-dark"]}},loops:{maxWhileIterations:1000,useAltLoopVariable:!1},story:{enabled:!0,outDir:".stx/dist/story",storyMatch:["**/*.story.stx"],storyIgnored:["**/node_modules/**","**/dist/**","**/.stx/**"],port:6006},pwa:{enabled:!1,manifest:{name:"stx App",shortName:"stx",description:"A Progressive Web App built with stx",startUrl:"/",display:"standalone",orientation:"any",themeColor:"#000000",backgroundColor:"#ffffff",scope:"/"},icons:{src:"public/icon.png",sizes:[72,96,128,144,152,192,384,512],generateWebP:!0,generateAppleIcons:!0,outputDir:"pwa-icons",purpose:["any","maskable"]},routes:[{pattern:"/",strategy:"network-first"},{pattern:"/static/*",strategy:"cache-first",maxAgeSeconds:2592000},{pattern:"/api/*",strategy:"network-only"},{pattern:"*.js",strategy:"stale-while-revalidate"},{pattern:"*.css",strategy:"stale-while-revalidate"},{pattern:"*.png",strategy:"cache-first"},{pattern:"*.jpg",strategy:"cache-first"},{pattern:"*.webp",strategy:"cache-first"},{pattern:"*.svg",strategy:"cache-first"}],offline:{enabled:!0,fallbackTitle:"You are offline",fallbackMessage:"Please check your internet connection and try again.",precacheAssets:[]},serviceWorker:{fileName:"sw.js",cacheVersion:"1.0.0",skipWaiting:!0,clientsClaim:!0,navigationPreload:!1,excludeRoutes:["/api/auth/*"],cacheFileTypes:["html","css","js","png","jpg","jpeg","webp","svg","woff","woff2"],useWorkbox:!1},autoInject:!0,push:{enabled:!1,defaultOptions:{vibrate:[100,50,100],requireInteraction:!1}},backgroundSync:{enabled:!1,queueName:"stx-sync-queue",maxRetentionMinutes:1440,maxRetries:3,minInterval:1000,forms:[],endpoints:[]},shareTarget:{enabled:!1,action:"/share-target",method:"POST",enctype:"multipart/form-data",params:{title:"title",text:"text",url:"url"}},fileHandlers:{enabled:!1},protocolHandlers:[],cacheStorage:{maxSize:100,maxEntries:500,maxAge:30,purgeStrategy:"lru"},updates:{enabled:!0,promptUser:!0,autoReload:!1,message:"A new version is available. Reload to update?"},precache:{enabled:!0,includeHtml:!0,includeJs:!0,includeCss:!0,includeImages:!0,includeFonts:!0,include:[],exclude:["*.map","*.LICENSE.txt"],maxFileSizeKB:500}},media:{enabled:!0,image:{enabled:!0,defaultWidths:[320,480,640,768,1024,1280,1536,1920],defaultFormats:["avif","webp","jpeg"],defaultQuality:80,placeholderStrategy:"thumbhash",lazyByDefault:!0,enableDpr:!0,defaultDpr:[1,2,3],tsImages:{enabled:!0,outputDir:"dist/images",baseUrl:"/images",formatQuality:{jpeg:{quality:85,mozjpeg:!0,progressive:!0},png:{compressionLevel:9,palette:!1},webp:{quality:82,effort:5,smartSubsample:!0},avif:{quality:75,effort:4,lossless:!1}},breakpoints:[320,480,640,768,1024,1280,1536,1920],batchOptions:{concurrency:4,optimizationPreset:"web"}}},video:{enabled:!0,lazyByDefault:!0,defaultControls:!0,tsVideos:{enabled:!0,outputDir:"dist/videos",baseUrl:"/videos",defaultQuality:"high",streaming:{enabled:!0,format:"hls",segmentDuration:6,defaultQualities:[{label:"1080p",width:1920,height:1080,bitrate:5000000,audioBitrate:192000},{label:"720p",width:1280,height:720,bitrate:2500000,audioBitrate:128000},{label:"480p",width:854,height:480,bitrate:1e6,audioBitrate:96000}]},thumbnails:{enabled:!0,count:10,format:"webp",width:320},transcoding:{defaultCodec:"h264",defaultAudioCodec:"aac",speedPreset:"medium"}}},upload:{enabled:!0,maxSize:10485760,allowedTypes:["image/*","video/*","audio/*","application/pdf"],maxConcurrent:3},protected:{enabled:!0,expirationSeconds:3600,batchSize:10},cache:{enabled:!0,directory:".stx/media-cache",maxAge:30,maxSize:500}},broadcasting:{enabled:!1,driver:"bun",host:"0.0.0.0",port:6001,scheme:"ws",verbose:!1}};function Jt(e,r,i){let o=r||"pages";if(e)return{root:e,pagesDir:o};let n=i||process.cwd(),c=N.join(n,"resources","views"),d=N.join(n,"resources","layouts");if(Q.existsSync(c)&&Q.existsSync(d))return{root:"resources",pagesDir:"views"};let p=N.join(n,"resources","views","pages");if(Q.existsSync(p))return{root:"resources/views",pagesDir:o};return{root:".",pagesDir:o}}var Qe=new Set,pe=["partialsDir","componentsDir","layoutsDir"],Ce=new WeakMap;function Kt(e,r){let i=r.replace(/[\\/]+$/,"");if(!i||i===".")return!0;let o=e.replace(/\\/g,"/"),n=i.replace(/\\/g,"/");return o===n||o.startsWith(`${n}/`)}function Xf(e,r){let i=!e.root,o=Jt(e.root,e.pagesDir,r);if(e.root=o.root,e.pagesDir=o.pagesDir,i&&o.root!=="."){let n=`${r}::${o.root}`;if(!Qe.has(n))Qe.add(n),console.warn(`[stx] No "root" in config \u2014 inferred "${o.root}" from the project layout. Template directories are resolved under it; set root explicitly to pin this.`)}if(!Ce.has(e)){let n={};for(let c of pe){let d=e[c];if(typeof d==="string"&&d)n[c]=d}Ce.set(e,n)}if(e.root&&e.root!=="."){let n=e.root;for(let c of pe){let d=e[c];if(typeof d!=="string"||!d)continue;if(N.isAbsolute(d)||Kt(d,n))continue;e[c]=N.join(n,d)}}for(let n of pe){let c=e[n];if(typeof c!=="string"||!c||N.isAbsolute(c))continue;e[n]=N.resolve(r,c)}return e}function Gt(e,r){let i=Ce.get(e);for(let o of pe){let n=e[o];if(typeof n!=="string"||!n)continue;let c=N.isAbsolute(n)?n:N.join(r,n);if(Q.existsSync(c))continue;let d=i?.[o]??n,p=e.root,u=!!p&&p!==".";console.warn(`[stx] ${String(o)} resolves to "${c}", which does not exist. Configured as "${d}"`+(u?`, resolved under root "${p}".`:"."))}}function Yt(e){if(e.customDirectives)e.customDirectives=[...e.customDirectives];if(e.middleware)e.middleware=[...e.middleware];if(e.apiRoutes)e.apiRoutes={...e.apiRoutes}}function Xt(e){if(Mc(e.stateDir),e.stateDir=wr(),e.cachePath=vr(e.cachePath),e.build)e.build.cacheDir=vr(e.build.cacheDir);if(e.media?.cache)e.media.cache.directory=vr(e.media.cache.directory);if(e.story)e.story.outDir=vr(e.story.outDir)}var K=null,Y=new Map,ue=new Map,se=null;async function ei(e,r=Bt){try{return await r(e)}catch(i){if(i instanceof Error&&i.name==="ConfigNotFoundError")return{config:e.defaultConfig};throw i}}var Zt=/[\\/]install[\\/]cache[\\/](?:@[^\\/]+[\\/])?[^\\/]+@[^\\/]*@@@\d+[\\/]/;function Sc(e,r){let i=h.resolve(e,{paths:[r]});if(Zt.test(i))throw Error(`${e} is not installed in ${r} (found only in Bun's install cache)`);return i}async function a(e){let r=e?N.resolve(e):process.cwd(),i=ue.get(r);if(i&&i.signature!==Es(i.graph)){let c=Y.get(r);if(Y.delete(r),ue.delete(r),!e)K=null,se=null;let{clearComponentCache:d}=await import("./chunk-hzrcnxzg.js"),{partialsCache:p}=await import("./chunk-3jgrrjvx.js");if(d(),p.clear(),c&&i.configSignature===Ts(i.graph)){let u=c.then(async(g)=>{let y={...i.graph};await ni(y,r),ue.set(r,{graph:y,signature:Es(y),configSignature:Ts(y)});let f={...g,_layerGraph:y};if(!e)K=f;return f});return Y.set(r,u),u}}if(!e){if(K)return K;if(se)return se}let o=Y.get(r);if(o)return o;let n=(async()=>{let c=[".ts",".js",".mjs",".cjs",".json"],d=c.some((v)=>Q.existsSync(N.join(r,`stx.config${v}`))),p=c.some((v)=>Q.existsSync(N.join(r,"config",`ui${v}`))),u;if(d&&p){let v=await ei({name:"ui",cwd:N.join(r,"config"),defaultConfig:F,errorPolicy:"throw",verbose:!1});u=(await ei({name:"stx",alias:"ui",cwd:r,defaultConfig:v.config,errorPolicy:"throw",verbose:!1})).config}else u=(await ei({name:"stx",alias:"ui",cwd:r,defaultConfig:F,errorPolicy:"throw",verbose:!1})).config;if(u.extends!==void 0||i){let v=await Rc(r,F);u=v.config,ue.set(r,{graph:v.graph,signature:Es(v.graph),configSignature:Ts(v.graph)})}if(u.runtimeConfig){let{resolveRuntimeConfig:v}=await import("./chunk-a4v8z93r.js");v(u.runtimeConfig,{});let{generateRuntimeConfigTypes:b}=await import("./chunk-1qvtme01.js");await b(r,u.runtimeConfig)}Yt(u),Xt(u),Xf(u,r),Gt(u,r);let g=[],y=new Set((u.plugins??[]).map((v)=>typeof v==="string"?v:v[0]));for(let v of u.componentPackages??["@stacksjs/components"]){let b=`${v}/stx-plugin`;if(y.has(b)||y.has(v))continue;try{Sc(b,r),g.push(b)}catch{}}let f=[...u.plugins??[],...g];if(f.length>0){let{pluginManager:v}=await import("./chunk-n6w82yf2.js"),b=[],w=[],k=new Set(u.componentPackages??["@stacksjs/components"]),C=[];for(let A of f){let P=typeof A==="string"?A:A[0],E=typeof A==="string"?{}:A[1]||{};try{let I,D;try{let x=Sc(P,r);I=await import(x),D=N.dirname(x)}catch{let x=N.resolve(r,P);I=await import(x),D=N.dirname(x)}let S=I.default||I;if(!v.has(S.name))await v.register(S,u);if(S.components){let x=Array.isArray(S.components)?S.components:[S.components],T=k.has(S.name)||k.has(P)||k.has(P.replace(/\/stx-plugin$/,""));for(let V of x){let M=N.resolve(D,V);if(b.push(M),T)w.push(M)}}if(S.pages){let x=N.resolve(D,S.pages),T=E.path||"/";C.push({dir:x,prefix:T})}if(S.setup){let x={addDirective:(T)=>{u.customDirectives=u.customDirectives||[],u.customDirectives.push(T)},addRoute:(T,V)=>{u.apiRoutes=u.apiRoutes||{},u.apiRoutes[T]=V},addMiddleware:(T)=>{u.middleware=u.middleware||[],u.middleware.push(T)},pluginDir:D,config:u};await S.setup(E,x)}process.stderr.write(`[stx] Plugin loaded: ${S.name||P}
|
|
1311
|
-
`)}catch(I){console.warn(`[stx] Failed to load plugin ${P}:`,I.message)}}u._pluginComponentDirs=b,u._componentPackageDirs=w,u._pluginPageDirs=C}if(u.nativePrimitives!==!1)u._nativePrimitivesFallback={dir:_s(),except:["Button","Checkbox","Switch","TextInput","Image","Video"]};return u})();if(Y.set(r,n),n.catch(()=>{if(Y.get(r)===n)Y.delete(r)}),!e)se=n,n.then((c)=>{K=c}).catch(()=>{});return n}var O=new Proxy(F,{get(e,r){if(K&&r in K)return K[r];if(!se)a().catch((i)=>{console.warn("[stx] Failed to load config file:",i?.message||i)});return e[r]}});function
|
|
1312
|
-
export{
|
|
1310
|
+
</script>`}var F={enabled:!0,ssr:!1,partialsDir:"partials",componentsDir:"components",layoutsDir:"layouts",defaultLayout:"default",debug:!1,cache:!0,stateDir:gn,cachePath:".stx/cache",cacheVersion:"1.0.0",componentRenderCacheBytes:33554432,build:{pagesDir:"pages",outputDir:"dist",baseUrl:"/",sitemap:!0,minify:!0,cache:!0,cacheDir:".stx/ssg-cache",concurrency:10,generate404:!0,publicDir:"public",trailingSlash:!1,cleanOutput:!0},customDirectives:[{name:"markdown",handler:Te,hasEndTag:!0,description:"Render markdown content to HTML"},{name:"webcomponent",handler:Ze,hasEndTag:!1,description:"Include a web component in the template"},Tc,$c,$s,Rs,Pe,Ae,_e,ke,Re,Oe,He,Se,...oo],middleware:[],i18n:{defaultLocale:"en",locale:"en",translationsDir:"translations",format:"yaml",fallbackToKey:!0,cache:!0},webComponents:{enabled:!1,outputDir:"dist/web-components",components:[]},docs:{enabled:!1,outputDir:"docs",format:"markdown",components:!0,templates:!0,directives:!0},streaming:{enabled:!0,bufferSize:16384,strategy:"auto",timeout:30000},hydration:{enabled:!1,mode:"islands",clientEntry:"src/client.ts",autoMarkers:!0,preload:"lazy"},router:{enabled:!0,container:"main",linkSelector:"a[href]",viewTransitions:!0,scrollToTop:!0,scrollRestoration:!0,prefetch:!0,cache:!0,cacheTTL:300000,skipSelectors:'[data-no-router], [target="_blank"]',viewTransitionCSS:{oldRoot:"fade-out 0.15s ease-in",newRoot:"fade-in 0.2s ease-out",oldContent:"slide-out 0.2s ease-in",newContent:"slide-in 0.25s ease-out"}},a11y:{enabled:!0,addSrOnlyStyles:!0,level:"AA",autoFix:!1,ignoreChecks:[]},seo:{enabled:!0,socialPreview:!0,defaultConfig:{title:"stx Project",description:"A website built with stx templating engine"}},animation:{enabled:!0,defaultDuration:300,defaultEase:"ease",respectMotionPreferences:!0,staggerDelay:50},markdown:{enabled:!0,syntaxHighlighting:{enabled:!0,serverSide:!0,defaultTheme:"github-dark",highlightUnknownLanguages:!0,additionalThemes:["light-plus","one-dark-pro","dracula","monokai","solarized-light","nord","github-dark"]}},loops:{maxWhileIterations:1000,useAltLoopVariable:!1},story:{enabled:!0,outDir:".stx/dist/story",storyMatch:["**/*.story.stx"],storyIgnored:["**/node_modules/**","**/dist/**","**/.stx/**"],port:6006},pwa:{enabled:!1,manifest:{name:"stx App",shortName:"stx",description:"A Progressive Web App built with stx",startUrl:"/",display:"standalone",orientation:"any",themeColor:"#000000",backgroundColor:"#ffffff",scope:"/"},icons:{src:"public/icon.png",sizes:[72,96,128,144,152,192,384,512],generateWebP:!0,generateAppleIcons:!0,outputDir:"pwa-icons",purpose:["any","maskable"]},routes:[{pattern:"/",strategy:"network-first"},{pattern:"/static/*",strategy:"cache-first",maxAgeSeconds:2592000},{pattern:"/api/*",strategy:"network-only"},{pattern:"*.js",strategy:"stale-while-revalidate"},{pattern:"*.css",strategy:"stale-while-revalidate"},{pattern:"*.png",strategy:"cache-first"},{pattern:"*.jpg",strategy:"cache-first"},{pattern:"*.webp",strategy:"cache-first"},{pattern:"*.svg",strategy:"cache-first"}],offline:{enabled:!0,fallbackTitle:"You are offline",fallbackMessage:"Please check your internet connection and try again.",precacheAssets:[]},serviceWorker:{fileName:"sw.js",cacheVersion:"1.0.0",skipWaiting:!0,clientsClaim:!0,navigationPreload:!1,excludeRoutes:["/api/auth/*"],cacheFileTypes:["html","css","js","png","jpg","jpeg","webp","svg","woff","woff2"],useWorkbox:!1},autoInject:!0,push:{enabled:!1,defaultOptions:{vibrate:[100,50,100],requireInteraction:!1}},backgroundSync:{enabled:!1,queueName:"stx-sync-queue",maxRetentionMinutes:1440,maxRetries:3,minInterval:1000,forms:[],endpoints:[]},shareTarget:{enabled:!1,action:"/share-target",method:"POST",enctype:"multipart/form-data",params:{title:"title",text:"text",url:"url"}},fileHandlers:{enabled:!1},protocolHandlers:[],cacheStorage:{maxSize:100,maxEntries:500,maxAge:30,purgeStrategy:"lru"},updates:{enabled:!0,promptUser:!0,autoReload:!1,message:"A new version is available. Reload to update?"},precache:{enabled:!0,includeHtml:!0,includeJs:!0,includeCss:!0,includeImages:!0,includeFonts:!0,include:[],exclude:["*.map","*.LICENSE.txt"],maxFileSizeKB:500}},media:{enabled:!0,image:{enabled:!0,defaultWidths:[320,480,640,768,1024,1280,1536,1920],defaultFormats:["avif","webp","jpeg"],defaultQuality:80,placeholderStrategy:"thumbhash",lazyByDefault:!0,enableDpr:!0,defaultDpr:[1,2,3],tsImages:{enabled:!0,outputDir:"dist/images",baseUrl:"/images",formatQuality:{jpeg:{quality:85,mozjpeg:!0,progressive:!0},png:{compressionLevel:9,palette:!1},webp:{quality:82,effort:5,smartSubsample:!0},avif:{quality:75,effort:4,lossless:!1}},breakpoints:[320,480,640,768,1024,1280,1536,1920],batchOptions:{concurrency:4,optimizationPreset:"web"}}},video:{enabled:!0,lazyByDefault:!0,defaultControls:!0,tsVideos:{enabled:!0,outputDir:"dist/videos",baseUrl:"/videos",defaultQuality:"high",streaming:{enabled:!0,format:"hls",segmentDuration:6,defaultQualities:[{label:"1080p",width:1920,height:1080,bitrate:5000000,audioBitrate:192000},{label:"720p",width:1280,height:720,bitrate:2500000,audioBitrate:128000},{label:"480p",width:854,height:480,bitrate:1e6,audioBitrate:96000}]},thumbnails:{enabled:!0,count:10,format:"webp",width:320},transcoding:{defaultCodec:"h264",defaultAudioCodec:"aac",speedPreset:"medium"}}},upload:{enabled:!0,maxSize:10485760,allowedTypes:["image/*","video/*","audio/*","application/pdf"],maxConcurrent:3},protected:{enabled:!0,expirationSeconds:3600,batchSize:10},cache:{enabled:!0,directory:".stx/media-cache",maxAge:30,maxSize:500}},broadcasting:{enabled:!1,driver:"bun",host:"0.0.0.0",port:6001,scheme:"ws",verbose:!1}};function Jt(e,r,i){let o=r||"pages";if(e)return{root:e,pagesDir:o};let n=i||process.cwd(),c=N.join(n,"resources","views"),d=N.join(n,"resources","layouts");if(Q.existsSync(c)&&Q.existsSync(d))return{root:"resources",pagesDir:"views"};let p=N.join(n,"resources","views","pages");if(Q.existsSync(p))return{root:"resources/views",pagesDir:o};return{root:".",pagesDir:o}}var Qe=new Set,pe=["partialsDir","componentsDir","layoutsDir"],Ce=new WeakMap;function Kt(e,r){let i=r.replace(/[\\/]+$/,"");if(!i||i===".")return!0;let o=e.replace(/\\/g,"/"),n=i.replace(/\\/g,"/");return o===n||o.startsWith(`${n}/`)}function Zf(e,r){let i=!e.root,o=Jt(e.root,e.pagesDir,r);if(e.root=o.root,e.pagesDir=o.pagesDir,i&&o.root!=="."){let n=`${r}::${o.root}`;if(!Qe.has(n))Qe.add(n),console.warn(`[stx] No "root" in config \u2014 inferred "${o.root}" from the project layout. Template directories are resolved under it; set root explicitly to pin this.`)}if(!Ce.has(e)){let n={};for(let c of pe){let d=e[c];if(typeof d==="string"&&d)n[c]=d}Ce.set(e,n)}if(e.root&&e.root!=="."){let n=e.root;for(let c of pe){let d=e[c];if(typeof d!=="string"||!d)continue;if(N.isAbsolute(d)||Kt(d,n))continue;e[c]=N.join(n,d)}}for(let n of pe){let c=e[n];if(typeof c!=="string"||!c||N.isAbsolute(c))continue;e[n]=N.resolve(r,c)}return e}function Gt(e,r){let i=Ce.get(e);for(let o of pe){let n=e[o];if(typeof n!=="string"||!n)continue;let c=N.isAbsolute(n)?n:N.join(r,n);if(Q.existsSync(c))continue;let d=i?.[o]??n,p=e.root,u=!!p&&p!==".";console.warn(`[stx] ${String(o)} resolves to "${c}", which does not exist. Configured as "${d}"`+(u?`, resolved under root "${p}".`:"."))}}function Yt(e){if(e.customDirectives)e.customDirectives=[...e.customDirectives];if(e.middleware)e.middleware=[...e.middleware];if(e.apiRoutes)e.apiRoutes={...e.apiRoutes}}function Xt(e){if(Dc(e.stateDir),e.stateDir=wr(),e.cachePath=vr(e.cachePath),e.build)e.build.cacheDir=vr(e.build.cacheDir);if(e.media?.cache)e.media.cache.directory=vr(e.media.cache.directory);if(e.story)e.story.outDir=vr(e.story.outDir)}var K=null,Y=new Map,ue=new Map,se=null;async function ei(e,r=Bt){try{return await r(e)}catch(i){if(i instanceof Error&&i.name==="ConfigNotFoundError")return{config:e.defaultConfig};throw i}}var Zt=/[\\/]install[\\/]cache[\\/](?:@[^\\/]+[\\/])?[^\\/]+@[^\\/]*@@@\d+[\\/]/;function kc(e,r){let i=h.resolve(e,{paths:[r]});if(Zt.test(i))throw Error(`${e} is not installed in ${r} (found only in Bun's install cache)`);return i}async function a(e){let r=e?N.resolve(e):process.cwd(),i=ue.get(r);if(i&&i.signature!==Es(i.graph)){let c=Y.get(r);if(Y.delete(r),ue.delete(r),!e)K=null,se=null;let{clearComponentCache:d}=await import("./chunk-m28j4ym7.js"),{partialsCache:p}=await import("./chunk-e44bse67.js");if(d(),p.clear(),c&&i.configSignature===Ts(i.graph)){let u=c.then(async(g)=>{let y={...i.graph};await ni(y,r),ue.set(r,{graph:y,signature:Es(y),configSignature:Ts(y)});let f={...g,_layerGraph:y};if(!e)K=f;return f});return Y.set(r,u),u}}if(!e){if(K)return K;if(se)return se}let o=Y.get(r);if(o)return o;let n=(async()=>{let c=[".ts",".js",".mjs",".cjs",".json"],d=c.some((v)=>Q.existsSync(N.join(r,`stx.config${v}`))),p=c.some((v)=>Q.existsSync(N.join(r,"config",`ui${v}`))),u;if(d&&p){let v=await ei({name:"ui",cwd:N.join(r,"config"),defaultConfig:F,errorPolicy:"throw",verbose:!1});u=(await ei({name:"stx",alias:"ui",cwd:r,defaultConfig:v.config,errorPolicy:"throw",verbose:!1})).config}else u=(await ei({name:"stx",alias:"ui",cwd:r,defaultConfig:F,errorPolicy:"throw",verbose:!1})).config;if(u.extends!==void 0||i){let v=await Ac(r,F);u=v.config,ue.set(r,{graph:v.graph,signature:Es(v.graph),configSignature:Ts(v.graph)})}if(u.runtimeConfig){let{resolveRuntimeConfig:v}=await import("./chunk-a4v8z93r.js");v(u.runtimeConfig,{});let{generateRuntimeConfigTypes:b}=await import("./chunk-v8b1wz1b.js");await b(r,u.runtimeConfig)}Yt(u),Xt(u),Zf(u,r),Gt(u,r);let g=[],y=new Set((u.plugins??[]).map((v)=>typeof v==="string"?v:v[0]));for(let v of u.componentPackages??["@stacksjs/components"]){let b=`${v}/stx-plugin`;if(y.has(b)||y.has(v))continue;try{kc(b,r),g.push(b)}catch{}}let f=[...u.plugins??[],...g];if(f.length>0){let{pluginManager:v}=await import("./chunk-q78dsejp.js"),b=[],w=[],k=new Set(u.componentPackages??["@stacksjs/components"]),C=[];for(let A of f){let P=typeof A==="string"?A:A[0],E=typeof A==="string"?{}:A[1]||{};try{let I,D;try{let x=kc(P,r);I=await import(x),D=N.dirname(x)}catch{let x=N.resolve(r,P);I=await import(x),D=N.dirname(x)}let S=I.default||I;if(!v.has(S.name))await v.register(S,u);if(S.components){let x=Array.isArray(S.components)?S.components:[S.components],T=k.has(S.name)||k.has(P)||k.has(P.replace(/\/stx-plugin$/,""));for(let V of x){let M=N.resolve(D,V);if(b.push(M),T)w.push(M)}}if(S.pages){let x=N.resolve(D,S.pages),T=E.path||"/";C.push({dir:x,prefix:T})}if(S.setup){let x={addDirective:(T)=>{u.customDirectives=u.customDirectives||[],u.customDirectives.push(T)},addRoute:(T,V)=>{u.apiRoutes=u.apiRoutes||{},u.apiRoutes[T]=V},addMiddleware:(T)=>{u.middleware=u.middleware||[],u.middleware.push(T)},pluginDir:D,config:u};await S.setup(E,x)}process.stderr.write(`[stx] Plugin loaded: ${S.name||P}
|
|
1311
|
+
`)}catch(I){console.warn(`[stx] Failed to load plugin ${P}:`,I.message)}}u._pluginComponentDirs=b,u._componentPackageDirs=w,u._pluginPageDirs=C}if(u.nativePrimitives!==!1)u._nativePrimitivesFallback={dir:_s(),except:["Button","Checkbox","Switch","TextInput","Image","Video"]};return u})();if(Y.set(r,n),n.catch(()=>{if(Y.get(r)===n)Y.delete(r)}),!e)se=n,n.then((c)=>{K=c}).catch(()=>{});return n}var O=new Proxy(F,{get(e,r){if(K&&r in K)return K[r];if(!se)a().catch((i)=>{console.warn("[stx] Failed to load config file:",i?.message||i)});return e[r]}});function ty(e){return e}function ny(e){let r=[],i=[];if(e.partialsDir!==void 0&&typeof e.partialsDir!=="string")r.push({path:"partialsDir",message:"partialsDir must be a string",severity:"error"});if(e.componentsDir!==void 0&&typeof e.componentsDir!=="string")r.push({path:"componentsDir",message:"componentsDir must be a string",severity:"error"});if(e.cache!==void 0&&typeof e.cache!=="boolean")r.push({path:"cache",message:"cache must be a boolean",severity:"error"});if(e.debug!==void 0&&typeof e.debug!=="boolean")r.push({path:"debug",message:"debug must be a boolean",severity:"error"});if(e.streaming){if(e.streaming.bufferSize!==void 0){if(typeof e.streaming.bufferSize!=="number"||e.streaming.bufferSize<=0)r.push({path:"streaming.bufferSize",message:"streaming.bufferSize must be a positive number",severity:"error"})}if(e.streaming.timeout!==void 0){if(typeof e.streaming.timeout!=="number"||e.streaming.timeout<=0)r.push({path:"streaming.timeout",message:"streaming.timeout must be a positive number",severity:"error"})}if(e.streaming.strategy!==void 0){let o=["auto","manual","sections"];if(!o.includes(e.streaming.strategy))r.push({path:"streaming.strategy",message:`streaming.strategy must be one of: ${o.join(", ")}`,severity:"error"})}}if(e.i18n){if(e.i18n.format!==void 0){let o=["json","yaml","yml","js"];if(!o.includes(e.i18n.format))r.push({path:"i18n.format",message:`i18n.format must be one of: ${o.join(", ")}`,severity:"error"})}}if(e.animation){if(e.animation.defaultDuration!==void 0){if(typeof e.animation.defaultDuration!=="number"||e.animation.defaultDuration<0)r.push({path:"animation.defaultDuration",message:"animation.defaultDuration must be a non-negative number",severity:"error"})}if(e.animation.staggerDelay!==void 0){if(typeof e.animation.staggerDelay!=="number"||e.animation.staggerDelay<0)r.push({path:"animation.staggerDelay",message:"animation.staggerDelay must be a non-negative number",severity:"error"})}}if(e.a11y){if(e.a11y.level!==void 0){let o=["AA","AAA"];if(!o.includes(e.a11y.level))r.push({path:"a11y.level",message:`a11y.level must be one of: ${o.join(", ")}`,severity:"error"})}}if(e.hydration){if(e.hydration.mode!==void 0){let o=["progressive","islands"];if(!o.includes(e.hydration.mode))r.push({path:"hydration.mode",message:`hydration.mode must be one of: ${o.join(", ")}`,severity:"error"})}if(e.hydration.preload!==void 0){let o=["none","eager","lazy"];if(!o.includes(e.hydration.preload))r.push({path:"hydration.preload",message:`hydration.preload must be one of: ${o.join(", ")}`,severity:"error"})}}if(e.customDirectives)if(!Array.isArray(e.customDirectives))r.push({path:"customDirectives",message:"customDirectives must be an array",severity:"error"});else e.customDirectives.forEach((o,n)=>{if(!o.name||typeof o.name!=="string")r.push({path:`customDirectives[${n}].name`,message:"Custom directive must have a name string",severity:"error"});if(!o.handler||typeof o.handler!=="function")r.push({path:`customDirectives[${n}].handler`,message:"Custom directive must have a handler function",severity:"error"})});if(e.middleware)if(!Array.isArray(e.middleware))r.push({path:"middleware",message:"middleware must be an array",severity:"error"});else e.middleware.forEach((o,n)=>{if(!o.name||typeof o.name!=="string")r.push({path:`middleware[${n}].name`,message:"Middleware must have a name string",severity:"error"});if(!o.handler||typeof o.handler!=="function")r.push({path:`middleware[${n}].handler`,message:"Middleware must have a handler function",severity:"error"});if(!o.timing||!["before","after"].includes(o.timing))r.push({path:`middleware[${n}].timing`,message:'Middleware timing must be "before" or "after"',severity:"error"})});if(e.debug===!0&&e.cache===!0)i.push({path:"debug+cache",message:"Debug mode with caching enabled may show stale content during development",severity:"warning"});if(e.seo?.enabled===!0&&!e.seo?.defaultConfig?.title)i.push({path:"seo.defaultConfig.title",message:"SEO is enabled but no default title is set",severity:"warning"});if(e.pwa){if(e.pwa.enabled===!0&&!e.pwa.manifest?.name)r.push({path:"pwa.manifest.name",message:"PWA manifest name is required when PWA is enabled",severity:"error"});if(e.pwa.manifest?.display!==void 0){let o=["fullscreen","standalone","minimal-ui","browser"];if(!o.includes(e.pwa.manifest.display))r.push({path:"pwa.manifest.display",message:`PWA display must be one of: ${o.join(", ")}`,severity:"error"})}if(e.pwa.manifest?.orientation!==void 0){let o=["portrait","landscape","any","portrait-primary","portrait-secondary","landscape-primary","landscape-secondary"];if(!o.includes(e.pwa.manifest.orientation))r.push({path:"pwa.manifest.orientation",message:`PWA orientation must be one of: ${o.join(", ")}`,severity:"error"})}if(e.pwa.routes){let o=["cache-first","network-first","stale-while-revalidate","network-only","cache-only"];e.pwa.routes.forEach((n,c)=>{if(!n.pattern||typeof n.pattern!=="string")r.push({path:`pwa.routes[${c}].pattern`,message:"PWA route must have a pattern string",severity:"error"});if(!o.includes(n.strategy))r.push({path:`pwa.routes[${c}].strategy`,message:`PWA route strategy must be one of: ${o.join(", ")}`,severity:"error"});if(n.maxAgeSeconds!==void 0&&(typeof n.maxAgeSeconds!=="number"||n.maxAgeSeconds<0))r.push({path:`pwa.routes[${c}].maxAgeSeconds`,message:"PWA route maxAgeSeconds must be a non-negative number",severity:"error"});if(n.maxEntries!==void 0&&(typeof n.maxEntries!=="number"||n.maxEntries<1))r.push({path:`pwa.routes[${c}].maxEntries`,message:"PWA route maxEntries must be a positive number",severity:"error"})})}if(e.pwa.icons?.sizes){if(!Array.isArray(e.pwa.icons.sizes))r.push({path:"pwa.icons.sizes",message:"PWA icon sizes must be an array of numbers",severity:"error"});else if(e.pwa.icons.sizes.filter((n)=>typeof n!=="number"||n<16||n>1024).length>0)r.push({path:"pwa.icons.sizes",message:"PWA icon sizes must be numbers between 16 and 1024",severity:"error"})}if(e.pwa.icons?.purpose){let o=["any","maskable","monochrome"];if(e.pwa.icons.purpose.filter((c)=>!o.includes(c)).length>0)r.push({path:"pwa.icons.purpose",message:`PWA icon purpose must be one of: ${o.join(", ")}`,severity:"error"})}if(e.pwa.enabled===!0&&!e.pwa.icons?.src)i.push({path:"pwa.icons.src",message:"PWA is enabled but no icon source specified. Provide a 512x512 PNG for best results.",severity:"warning"});if(e.pwa.enabled===!0&&!e.pwa.manifest?.themeColor)i.push({path:"pwa.manifest.themeColor",message:"PWA theme color not set, defaulting to black",severity:"warning"})}return{valid:r.length===0,errors:r,warnings:i}}
|
|
1312
|
+
export{vc,xc,mr,tt,Sc,_s,Cs,F,Zf,ei,kc,a,O,ty,ny};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{ku,$o,Yn,_u,Cu,Eu,Tu,$u,Ru,Au,Pu,Iu,Ou,Nu,Mu,Du,Lu,ju,Bu,Fu,zu,Hu,Vu,Uu,Wu,qu,Ku,Gu,Xu,Ju,Yu,Zu,Qu,ed,td,nd,rd,sd,od,id,ad,cd,ld,ud,dd,pd,fd,gd,en,Da,md,hd,yd,La,bd,wd,vd,xd,Sd,kd,ja,_d,Cd,Ed,Td,$d,Rd,Ad,Pd,Id,Zn,Od,Nd,Md,Dd,Ld,jd,Bd,Fd,zd,Hd,Vd,Ud,Ro,Wd,qd,Kd,Gd,Xd,rs,ss,Jd,Yd,Zd,Qd,ep,Ba,tp,np,rp,Fa,Ao,sp,op,za,Ha,os,Va,ip,tn,ap,Ua,Wa,Po,cp,Io,lp,up,dp,pp,fp,gp,mp,qa,hp,yp,Ka,bp,wp,vp,xp,Sp,kp,_p,Cp,Ep,Tp,$p,Rp,Ap,Pp,Ip,Op,Np,Mp,Dp,Lp,jp,Bp,Fp,zp,Ga,Hp,Vp,Up,Wp,qp,Kp,Gp,Xp,Jp,Yp,Zp,Qn,Xa,Ja,Qp,er,ef,tf,nf,Ya,Za,is,as,rf,Oo,sf,of,af,cf,lf,uf,df,pf,ff,gf,mf,hf,yf,bf,wf,vf,xf,Sf,kf,_f,Qa,Cf,Ef,ec,tc,Tf,$f}from"./chunk-fxk1psd8.js";export{fd as AVAILABLE_COMPONENTS,Ba as AutoUpdater,gd as COMPONENT_STYLES,is as DEFAULT_WATCH_INTERVAL_MS,Za as MAX_WATCH_INTERVAL_MS,Ya as MIN_WATCH_INTERVAL_MS,kd as MODAL_STYLES,Iu as TOAST_STYLES,Ad as TRAY_MENU_STYLES,za as UPDATE_MANIFEST_ASSET,wd as alert,jp as appInfo,uf as appleScript,$f as applicationDataDirectory,lf as audio,Ef as backgroundDelay,Np as battery,cf as biometric,Yp as bluetooth,mf as bonjour,tn as bundlePathForExecutable,cp as caffeinate,tp as canReplaceBundle,np as clearQuarantine,Cp as clipboard,Sd as closeAllModals,Ud as closeAllWindows,bd as confirm,zp as contextMenu,xf as continuityCamera,vf as coreml,Qd as craftBinaryNotFoundMessage,Ro as craftWindowArguments,Qn as crashReporter,td as createAccordion,Gu as createAutocomplete,Bu as createAvatar,ju as createBadge,Ou as createButton,Fu as createCard,cd as createChart,Mu as createCheckbox,Yu as createChip,ld as createCodeEditor,Wu as createColorPicker,ad as createDataGrid,qu as createDatePicker,ss as createDiskImage,Hu as createDropdown,dd as createFileExplorer,ip as createGitHubUpdateManifest,Va as createGitHubUpdater,Ju as createImageView,xp as createInterval,Xu as createLabel,sd as createListView,ud as createMediaPlayer,_d as createMenubar,rd as createModalComponent,Tf as createNativeUpdateApi,tc as createPantrySelfUpdater,fp as createPreferences,Lu as createProgressBar,Uu as createRadioButton,Vu as createRating,Qu as createScrollView,Po as createSelfUpdater,Du as createSlider,ed as createSplitView,nd as createStepper,ja as createSystemTray,od as createTable,zu as createTabs,Nu as createTextInput,Ku as createTimePicker,vp as createTimer,Zu as createTooltip,id as createTreeView,pd as createWebView,Wd as createWindow,Kd as createWindowWithHTML,Io as decaffeinate,Op as deepLinks,Sp as delay,Ru as dismissAlertById,Au as dismissAllAlerts,Pp as dragOut,rp as extractBundle,df as fileAssociations,Oo as focus,of as focusShortcutsReady,_p as formatCompact,pp as formatDuration,dp as formatRemainingTime,hp as formatShortcut,kp as formatTime,Tp as fs,Fa as generateUpdateManifest,Pu as getActiveAlertCount,xd as getActiveModalCount,Cd as getActiveTrayInstances,Hd as getActiveWindowIds,up as getCaffeinateStatus,_f as getCapabilities,Qa as getCapability,Fd as getDesktopConfig,jd as getDialogBridgeScript,wp as getRegisteredHotkeys,$d as getSimulatedTrayHTML,Rd as getTrayBridgeScript,Ed as getTrayInstance,Vd as getWindow,Xd as getWindowBridgeScript,Ha as githubLatestAssetUrl,os as githubReleaseAssetUrl,Rp as globalShortcuts,er as handoff,sf as hasFocusShortcuts,Qp as iap,mp as isAutoLaunchEnabled,Cf as isAvailable,lp as isCaffeinated,Ip as isDragOutAvailable,Gd as isWebviewAvailable,Up as keychain,ef as liveActivities,af as localServer,tf as location,gf as log,Jd as macOSRuntimeExecutablePath,Fp as menu,wf as midi,Kp as nativeAutoLaunch,Gp as nativeTray,Xp as nativeWindow,Mp as network,Ep as notifications,$u as notify,qd as openDevWindow,Yd as pack,Zd as packageApp,ec as parsePantryUpdateManifest,qa as parseShortcut,ff as pdf,Wp as permissions,qp as printing,vd as prompt,Ua as quitLauncher,Ao as readBundleIdentity,Xa as redactPII,yp as registerHotkey,Wa as relaunchBundle,ku as requestNotificationPermission,zd as resetDesktopConfig,ep as resolveCraftBinary,rs as resolveCraftExecutablePath,ap as runningBundleTeamId,Vp as screen,nf as screenCapture,as as screenSharing,kf as serial,Sf as serviceMenu,gp as setAutoLaunch,Bd as setDesktopConfig,$p as shell,$o as showAlert,Nd as showAlertDialog,Od as showColorPicker,Md as showConfirmDialog,Dd as showErrorDialog,hd as showErrorModal,Tu as showErrorToast,Da as showInfoModal,_u as showInfoToast,Zn as showMessageBox,en as showModal,Pd as showOpenDialog,La as showQuestionModal,Id as showSaveDialog,yd as showSuccessModal,Cu as showSuccessToast,Yn as showToast,Ld as showWarningDialog,md as showWarningModal,Eu as showWarningToast,Ga as sidebar,Ja as signPayload,Zp as speech,yf as speechRecognition,hf as spotlight,Bp as standardMenus,sp as swapBundle,Hp as system,pf as tags,Ap as theme,Jp as touchbar,Td as triggerTrayAction,bp as unregisterAllHotkeys,Ka as unregisterHotkey,Dp as updater,op as verifyBundleTrust,bf as vision,rf as watchScreenSharing,Lp as windowEvents};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Jl,Tm,Yl,Zl,$m,Rm}from"./chunk-bxn4b0wm.js";import"./chunk-jdqmk5sv.js";import"./chunk-qv52et0d.js";import"./chunk-sny8rqe8.js";import"./chunk-0z2gqttt.js";import"./chunk-xppm4cs4.js";import"./chunk-7fgfzaah.js";export{Rm as applySlots,$m as extractSlotContent,Tm as parseSlotElement,Jl as parseSlots,Zl as processSlots,Yl as renderSlot};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
var f=null,D=[],v=0,g=new Set;function x(){return f}function S(e){let n=f;return D.push(e),f=e,n}function h(e){D.pop(),f=e}var A=new WeakMap;function w(e,n){A.set(e,n)}function p(e,n){for(let r of e){let i=A.get(r);if(i)i(n);else n.add(r)}}function b(e){if(v>0){p(e,g);return}let n=new Set;p(e,n);for(let r of n)r()}function C(e){v++;try{e()}finally{if(v--,v===0){let n=[...g];g.clear();for(let r of n)r()}}}function m(e){let n=f;f=null;try{return e()}finally{f=n}}var k=[],T=[];function de(e){let n=e,r=new Set,i=new Set,o=()=>{let t=x();if(t)i.add(t);return n};return o.set=(t)=>{if(!Object.is(t,n)){let c=n;n=t,r.forEach((u)=>{try{u(n,c)}catch(l){console.error("[stx] subscriber error:",l)}}),b(i)}},o.update=(t)=>{o.set(t(n))},o.subscribe=(t)=>(r.add(t),()=>r.delete(t)),Object.defineProperty(o,"_isSignal",{value:!0,writable:!1}),Object.defineProperty(o,"value",{get:()=>o(),set:(t)=>o.set(t),configurable:!0}),o}function Kn(e,n={}){let r,i=!0,o=!1,t=new Set,c=typeof n.equals==="function"?n.equals:null,u=()=>{let s=S(d);try{r=e(),o=!0}finally{h(s)}i=!1},l=()=>{let s=r,y=o;try{u()}catch{return i=!0,!0}return!y||!c(s,r)},d=()=>{if(i)return;if(c&&t.size){if(l())b(t);return}i=!0,b(t)};w(d,(s)=>{if(i)return;if(c&&t.size){if(l())p(t,s);return}i=!0,p(t,s)});let a=()=>{let s=x();if(s)t.add(s);if(i)u();return r};return Object.defineProperty(a,"_isDerived",{value:!0,writable:!1}),Object.defineProperty(a,"value",{get:()=>a(),configurable:!0}),a}function
|
|
3
|
-
export{de,Kn,
|
|
2
|
+
var f=null,D=[],v=0,g=new Set;function x(){return f}function S(e){let n=f;return D.push(e),f=e,n}function h(e){D.pop(),f=e}var A=new WeakMap;function w(e,n){A.set(e,n)}function p(e,n){for(let r of e){let i=A.get(r);if(i)i(n);else n.add(r)}}function b(e){if(v>0){p(e,g);return}let n=new Set;p(e,n);for(let r of n)r()}function C(e){v++;try{e()}finally{if(v--,v===0){let n=[...g];g.clear();for(let r of n)r()}}}function m(e){let n=f;f=null;try{return e()}finally{f=n}}var k=[],T=[];function de(e){let n=e,r=new Set,i=new Set,o=()=>{let t=x();if(t)i.add(t);return n};return o.set=(t)=>{if(!Object.is(t,n)){let c=n;n=t,r.forEach((u)=>{try{u(n,c)}catch(l){console.error("[stx] subscriber error:",l)}}),b(i)}},o.update=(t)=>{o.set(t(n))},o.subscribe=(t)=>(r.add(t),()=>r.delete(t)),Object.defineProperty(o,"_isSignal",{value:!0,writable:!1}),Object.defineProperty(o,"value",{get:()=>o(),set:(t)=>o.set(t),configurable:!0}),o}function Kn(e,n={}){let r,i=!0,o=!1,t=new Set,c=typeof n.equals==="function"?n.equals:null,u=()=>{let s=S(d);try{r=e(),o=!0}finally{h(s)}i=!1},l=()=>{let s=r,y=o;try{u()}catch{return i=!0,!0}return!y||!c(s,r)},d=()=>{if(i)return;if(c&&t.size){if(l())b(t);return}i=!0,b(t)};w(d,(s)=>{if(i)return;if(c&&t.size){if(l())p(t,s);return}i=!0,p(t,s)});let a=()=>{let s=x();if(s)t.add(s);if(i)u();return r};return Object.defineProperty(a,"_isDerived",{value:!0,writable:!1}),Object.defineProperty(a,"value",{get:()=>a(),configurable:!0}),a}function _h(e,n=Object.is){return Kn(e,{equals:n})}function Gn(e,n={}){let r,i=!1,o=()=>{if(i)return;if(r){let c=r;r=void 0;try{c()}catch(u){console.error("[stx] effect cleanup error:",u)}}let t=S(o);try{let c=e();r=typeof c==="function"?c:void 0}catch(c){i=!0,console.error("[stx] effect error (the effect is disposed):",c)}finally{h(t)}};if(n.immediate!==!1)o();return()=>{if(i=!0,r){let t=r;r=void 0,t()}}}function _o(e){C(e)}function Qr(e){k.push(e)}function es(e){T.push(e)}function Ch(){O(k,"onMount",T)}function Eh(){O(T,"onDestroy")}function O(e,n,r){let i=e.splice(0,e.length);for(let o of i)try{let t=o();if(r&&typeof t==="function")r.push(t)}catch(t){console.error(`[stx] ${n} callback threw:`,t)}}function Th(){return{mount:k.length,destroy:T.length}}function Xn(e){return typeof e==="function"&&e._isSignal===!0}function Jn(e){return typeof e==="function"&&e._isDerived===!0}function Co(e){if(Xn(e)||Jn(e))return m(()=>e());return e}function ts(e){return m(e)}function $h(e,n){let r=typeof e==="function"?e:()=>e,i=de([]),o=Kn(()=>i().reduce((u,l)=>n(u,l.action),r())),t=!1;return Gn(()=>{if(r(),!t){t=!0;return}if(ts(()=>i().length))i.set([])}),[o,(u,l)=>{let d={action:u};i.set([...i(),d]);let a=()=>{let s=i().filter((y)=>y!==d);if(s.length!==i().length)i.set(s)};if(l&&typeof l.then==="function")Promise.resolve(l).then(a,a);return a}]}
|
|
3
|
+
export{de,Kn,_h,Gn,_o,Qr,es,Ch,Eh,Th,Xn,Jn,Co,ts,$h};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{ke,xi,Si,yg,jt,nl,bg,rl,cy,je,vn,Be}from"./chunk-jdqmk5sv.js";import{ul,r}from"./chunk-snmq7yn4.js";import"./chunk-qv52et0d.js";import"./chunk-sny8rqe8.js";import"./chunk-0z2gqttt.js";import"./chunk-xppm4cs4.js";import"./chunk-7fgfzaah.js";export{ke as BROWSER_CORE_IMPORTS,yg as STX_AUTO_IMPORTS,xi as extractAndStripCssImports,je as extractBridgeData,ul as findInterpolationEnd,rl as generateAutoImportDestructuring,cy as generateBrowserAutoImportDestructuring,vn as generateServerDataBridge,jt as injectBrowserCoreAutoImports,Be as processClientScript,bg as referencesName,Si as renderVendorStyleTags,r as stripCommentsAndLiterals,nl as transformAutoImports};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{q,De}from"./chunk-
|
|
2
|
+
import{q,De}from"./chunk-jdqmk5sv.js";var o=/\b(?:state|derived|effect|batch|ref|reactive|computed|watch|watchEffect)\s*(?:<[^>]*>)?\s*\(/;function u(t,e,r){let i={fullTag:r,content:e,attrs:t};if(/\bserver\b/.test(t))return{...i,type:"server"};if(/\bdata-stx-scoped\b/.test(t))return{...i,type:"client"};if(o.test(e))return{...i,type:"signals"};if(/\bclient\b/.test(t)||/\btype\s*=\s*["']module["']/.test(t)||/\bsrc\s*=/.test(t))return{...i,type:"client"};return{...i,type:"server"}}var S=/^<script\b([^>]*)>([\s\S]*)<\/script\s*>$/i;function rn(t){let e=[],r=[],i=[],c=0;while(c<t.length){let s=t.indexOf("<",c);if(s===-1)break;let p=De(t,s);if(p>s){c=p;continue}let a=q(t,s);if(a>s){let f=t.slice(s,a),l=S.exec(f);if(l){let n=u(l[1],l[2],f);switch(n.type){case"signals":e.push(n);break;case"client":r.push(n);break;case"server":i.push(n);break}}c=a;continue}c=s+(t.startsWith("<!--",s)?4:1)}return{signals:e,client:r,server:i}}
|
|
3
3
|
export{rn};
|