@stacksjs/stx 0.2.838 → 0.2.839
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/builtins/image-delivery.js +7 -3
- package/dist/chunk-02cntwd8.js +2 -0
- package/dist/chunk-07hvjvj1.js +2 -0
- package/dist/{chunk-gh62p9mx.js → chunk-11y84h2d.js} +2 -2
- package/dist/{chunk-3bjnrmha.js → chunk-1b1ntgt7.js} +2 -2
- package/dist/{chunk-z25w7kmr.js → chunk-1m16mvt4.js} +4 -4
- package/dist/{chunk-6s3hgq9z.js → chunk-1zfxmjrf.js} +32 -32
- package/dist/{chunk-4ntm3dtk.js → chunk-23r3rby6.js} +2 -2
- package/dist/chunk-23zzbsms.js +2 -0
- package/dist/{chunk-ya6bp08c.js → chunk-2fj5zev7.js} +1 -1
- package/dist/{chunk-29f6vmyz.js → chunk-2j5yane9.js} +4 -4
- package/dist/chunk-2pgc087j.js +2 -0
- package/dist/{chunk-wzjdq7d6.js → chunk-31cnrpd1.js} +9 -9
- package/dist/{chunk-ac9ncbfw.js → chunk-321e41ck.js} +3 -3
- package/dist/{chunk-ckasfph2.js → chunk-3tydmgwh.js} +5 -5
- package/dist/chunk-41sh9y5w.js +2 -0
- package/dist/chunk-4654xm1h.js +2 -0
- package/dist/{chunk-amg6kr1p.js → chunk-4657mnht.js} +4 -4
- package/dist/{chunk-s33andzg.js → chunk-4dxq7ft1.js} +2 -2
- package/dist/chunk-4eagsz5d.js +2 -0
- package/dist/{chunk-f7jgda7x.js → chunk-4j08cbjd.js} +5 -5
- package/dist/{chunk-j59js1nh.js → chunk-4w3qpewn.js} +3 -3
- package/dist/{chunk-tx8wk6h7.js → chunk-4y6hes3h.js} +2 -2
- package/dist/chunk-53j9wakh.js +2 -0
- package/dist/{chunk-gw83680k.js → chunk-5hmm01av.js} +5 -5
- package/dist/chunk-5t93dqft.js +2 -0
- package/dist/{chunk-2x9zhezb.js → chunk-6wrf6302.js} +2 -2
- package/dist/chunk-78nsbzcm.js +2 -0
- package/dist/{chunk-1zxahmnh.js → chunk-7cg2f588.js} +1 -1
- package/dist/chunk-7ka7pvj9.js +2 -0
- package/dist/chunk-7m0r7mq9.js +2 -0
- package/dist/chunk-7mz6ze0x.js +2 -0
- package/dist/{chunk-ckg6q98b.js → chunk-7t57cnz9.js} +5 -5
- package/dist/chunk-7t9951at.js +2 -0
- package/dist/{chunk-jr0r5pzw.js → chunk-7vhm0jj5.js} +2 -2
- package/dist/{chunk-vfj9wp11.js → chunk-8370x30n.js} +2 -2
- package/dist/chunk-8913k8g7.js +3 -0
- package/dist/{chunk-txd2js5v.js → chunk-89d3h8mp.js} +14 -14
- package/dist/chunk-8byydry7.js +2 -0
- package/dist/chunk-8c363c2r.js +2 -0
- package/dist/chunk-8em568fw.js +2 -0
- package/dist/{chunk-ax624h16.js → chunk-8h0pnn5p.js} +6 -6
- package/dist/{chunk-em8tv6nz.js → chunk-8pj4v1eh.js} +2 -2
- package/dist/{chunk-b1m41fwr.js → chunk-8q3pyq6a.js} +3 -3
- package/dist/{chunk-z0ynyz62.js → chunk-8qbp5skx.js} +7 -7
- package/dist/chunk-8w0n2rae.js +2 -0
- package/dist/{chunk-nmvhktsg.js → chunk-8y3f5fyg.js} +6 -6
- package/dist/chunk-8z3yjex0.js +2 -0
- package/dist/chunk-8zzepd7g.js +2 -0
- package/dist/{chunk-c3dg8qdn.js → chunk-97k72dfh.js} +2 -2
- package/dist/chunk-98258444.js +2 -0
- package/dist/{chunk-s53wjw7y.js → chunk-9xps62ek.js} +2 -2
- package/dist/{chunk-52g026sc.js → chunk-a1s5wqw4.js} +2 -2
- package/dist/{chunk-myje6fhm.js → chunk-a9tzjqny.js} +5 -5
- package/dist/{chunk-4sv740a5.js → chunk-aekq1zyn.js} +6 -6
- package/dist/chunk-aywvbcae.js +2 -0
- package/dist/chunk-aza2zrhk.js +54 -0
- package/dist/chunk-b0fkvrat.js +2 -0
- package/dist/chunk-b6w3457c.js +2 -0
- package/dist/{chunk-fvgk1w9s.js → chunk-bp918end.js} +2 -2
- package/dist/chunk-bq7qcndg.js +3 -0
- package/dist/chunk-c18pafmf.js +3 -0
- package/dist/chunk-c2v38ghp.js +2 -0
- package/dist/{chunk-c9vxm8yq.js → chunk-ca3c5qx2.js} +31 -31
- package/dist/chunk-cax1wts7.js +2 -0
- package/dist/{chunk-evgghnjc.js → chunk-cw1ar3dq.js} +4 -4
- package/dist/{chunk-bky02g7k.js → chunk-d0dzzpfx.js} +2 -2
- package/dist/{chunk-29bt1fbn.js → chunk-d1vkjxb1.js} +5 -5
- package/dist/chunk-d2mdh669.js +2 -0
- package/dist/chunk-d44g9sek.js +2 -0
- package/dist/chunk-d5vr9g4b.js +2 -0
- package/dist/{chunk-yw1s8kyj.js → chunk-dgn87554.js} +4 -4
- package/dist/{chunk-t2vmk8tf.js → chunk-efdfkfp1.js} +3 -3
- package/dist/{chunk-33czswpt.js → chunk-f1hkagxk.js} +3 -3
- package/dist/chunk-f69cmsz9.js +2 -0
- package/dist/{chunk-55e46spy.js → chunk-g7rsd8st.js} +5 -5
- package/dist/chunk-gaxx0z19.js +2 -0
- package/dist/chunk-gft9pg9n.js +2 -0
- package/dist/{chunk-917v0bar.js → chunk-gpschnvk.js} +12 -12
- package/dist/chunk-h8h79939.js +2 -0
- package/dist/{chunk-q5pwvr98.js → chunk-jc5y35b7.js} +1 -1
- package/dist/{chunk-cwfavkk0.js → chunk-jjyt3tsv.js} +2 -2
- package/dist/{chunk-wfsa28e7.js → chunk-jzh0n2ct.js} +9 -9
- package/dist/{chunk-vfxkn1pe.js → chunk-kd6r7z27.js} +3 -3
- package/dist/chunk-ksc83y9t.js +2 -0
- package/dist/{chunk-zj4s3rnw.js → chunk-ksr6c2kh.js} +5 -5
- package/dist/{chunk-rnm8ejpz.js → chunk-m5bj2jnb.js} +2 -2
- package/dist/chunk-mad4g0yx.js +2 -0
- package/dist/{chunk-b7tb00nz.js → chunk-mhyd24bg.js} +2 -2
- package/dist/chunk-mtjt2z77.js +2 -0
- package/dist/{chunk-5w0cf32p.js → chunk-mv49hr9y.js} +1 -1
- package/dist/{chunk-65tptp4x.js → chunk-mzj71r0m.js} +2 -2
- package/dist/chunk-n7pvz99f.js +2 -0
- package/dist/chunk-n8a4jm0p.js +3 -0
- package/dist/chunk-nb2tedk0.js +2 -0
- package/dist/chunk-ndyj1d0z.js +2 -0
- package/dist/{chunk-n4qznmkm.js → chunk-ngnr831a.js} +5 -5
- package/dist/chunk-nhk0aat9.js +2 -0
- package/dist/{chunk-64eeb5p5.js → chunk-nk7nxzxf.js} +2 -2
- package/dist/chunk-np6h1ct6.js +2 -0
- package/dist/{chunk-pft65534.js → chunk-nsnzgdjt.js} +1 -1
- package/dist/{chunk-3yggtch5.js → chunk-p83h2dbg.js} +10 -10
- package/dist/{chunk-dv11h4f0.js → chunk-p9d2txcg.js} +1 -1
- package/dist/chunk-phxkmjnw.js +2 -0
- package/dist/chunk-pjkdn8zf.js +2 -0
- package/dist/{chunk-20mmryy5.js → chunk-pqg6j26p.js} +3 -3
- package/dist/{chunk-xtqapjz3.js → chunk-q0s0kc66.js} +2 -2
- package/dist/chunk-q88w2rv9.js +2 -0
- package/dist/{chunk-v3xyb3ws.js → chunk-qfvddpcg.js} +2 -2
- package/dist/{chunk-e75dntfb.js → chunk-qk079ca7.js} +2 -2
- package/dist/{chunk-11fn3hgv.js → chunk-r0ssa1xd.js} +2 -2
- package/dist/chunk-r5bhgyes.js +2 -0
- package/dist/chunk-rdn1d4bf.js +42 -0
- package/dist/{chunk-7bvvv74e.js → chunk-rk2ex6qx.js} +3 -3
- package/dist/chunk-rmc6dfj4.js +2 -0
- package/dist/chunk-rsn9rh07.js +2 -0
- package/dist/chunk-rt29w5ns.js +2 -0
- package/dist/chunk-ryrdx5mw.js +2 -0
- package/dist/chunk-rzfbffnv.js +2 -0
- package/dist/chunk-s85chp3w.js +2 -0
- package/dist/chunk-s92f8w68.js +2 -0
- package/dist/chunk-sm9f980t.js +2 -0
- package/dist/chunk-st75663x.js +2 -0
- package/dist/chunk-sv2d6nfe.js +2 -0
- package/dist/{chunk-7k9yahng.js → chunk-t0jed809.js} +6 -6
- package/dist/{chunk-s5dhvnnd.js → chunk-t3p0jy0s.js} +6 -6
- package/dist/{chunk-f49x34sr.js → chunk-v3q126ys.js} +2 -2
- package/dist/{chunk-fzdgevxr.js → chunk-v49rvx9y.js} +56 -56
- package/dist/{chunk-kw5gra2z.js → chunk-v4ybemgb.js} +2 -2
- package/dist/chunk-vcx6dy59.js +2 -0
- package/dist/{chunk-mvehmtap.js → chunk-vr6qa0g2.js} +14 -14
- package/dist/chunk-w5h67xec.js +2 -0
- package/dist/{chunk-vyv76w55.js → chunk-wbgc2n04.js} +2 -2
- package/dist/{chunk-d689fbv1.js → chunk-whmqfr3y.js} +6 -6
- package/dist/{chunk-nyg0nbjj.js → chunk-x110ssw2.js} +3 -3
- package/dist/{chunk-sfsek961.js → chunk-x4f7efgp.js} +3 -3
- package/dist/chunk-x5wkbcsf.js +2 -0
- package/dist/{chunk-w0a6yz73.js → chunk-xbcnnk8x.js} +5 -5
- package/dist/{chunk-84nw3921.js → chunk-xmsf1bnx.js} +3 -3
- package/dist/{chunk-trwe0mfa.js → chunk-xvhxxj4g.js} +103 -103
- package/dist/{chunk-38ncpvww.js → chunk-xx3reejx.js} +2 -2
- package/dist/chunk-y64qhgv1.js +2 -0
- package/dist/{chunk-52t0qpx6.js → chunk-y68xstqy.js} +1 -1
- package/dist/chunk-yg5a54pj.js +2 -0
- package/dist/chunk-yjskeqaj.js +2 -0
- package/dist/{chunk-nm26vnzd.js → chunk-yn17484y.js} +6 -6
- package/dist/{chunk-r32q8mjw.js → chunk-ynf16yz4.js} +3 -3
- package/dist/chunk-yxqzarzh.js +2 -0
- package/dist/chunk-z4g64re8.js +3 -0
- package/dist/{chunk-ms3v5nat.js → chunk-zg44cf8a.js} +7 -7
- package/dist/{chunk-s6r54dyf.js → chunk-zjqvbcwa.js} +2 -2
- package/dist/{chunk-0rvntfhj.js → chunk-zvy88beh.js} +3 -3
- package/dist/{chunk-jstrmqna.js → chunk-zyeg9t2t.js} +2 -2
- package/dist/cli.js +20 -20
- package/dist/compression.js +3 -3
- package/dist/craft-entry.js +2 -2
- package/dist/craft.js +2 -2
- package/dist/dev-server/port-utils.js +2 -1
- package/dist/expressions.js +1 -1
- package/dist/html-masking.d.ts +2 -0
- package/dist/html-masking.js +23 -0
- package/dist/image-optimization/processor.js +2 -2
- package/dist/includes.js +5 -4
- package/dist/misc-directives.js +2 -2
- package/dist/pwa.js +3 -3
- package/dist/ssg.js +6 -6
- package/dist/utils.js +16 -13
- package/package.json +5 -5
- package/dist/chunk-0a36jnq4.js +0 -2
- package/dist/chunk-0c02182b.js +0 -42
- package/dist/chunk-0rnfywsx.js +0 -2
- package/dist/chunk-1bpx9b0m.js +0 -2
- package/dist/chunk-1g6xxftp.js +0 -2
- package/dist/chunk-2fcg7aws.js +0 -2
- package/dist/chunk-2nxxhcyy.js +0 -2
- package/dist/chunk-4wgfqa56.js +0 -2
- package/dist/chunk-5p6x0ztt.js +0 -2
- package/dist/chunk-6aak0b7c.js +0 -2
- package/dist/chunk-6c6m6p9t.js +0 -3
- package/dist/chunk-6g8byhwn.js +0 -2
- package/dist/chunk-70akxpk5.js +0 -2
- package/dist/chunk-72gq0ywg.js +0 -2
- package/dist/chunk-72n804gy.js +0 -2
- package/dist/chunk-7efkc3gk.js +0 -2
- package/dist/chunk-88zc5chj.js +0 -2
- package/dist/chunk-8gg8gn87.js +0 -2
- package/dist/chunk-8wv2p899.js +0 -2
- package/dist/chunk-9w3r1ch2.js +0 -3
- package/dist/chunk-a1hxz8q4.js +0 -2
- package/dist/chunk-a579jdwb.js +0 -2
- package/dist/chunk-ahd8jdzx.js +0 -2
- package/dist/chunk-aqrx322x.js +0 -2
- package/dist/chunk-ay7ggc4k.js +0 -2
- package/dist/chunk-bc4x45vx.js +0 -2
- package/dist/chunk-c77vxvp3.js +0 -2
- package/dist/chunk-c7hw37ww.js +0 -2
- package/dist/chunk-cfrgrnej.js +0 -2
- package/dist/chunk-cw8vpk41.js +0 -2
- package/dist/chunk-d96b9qgj.js +0 -2
- package/dist/chunk-db1c0c3c.js +0 -2
- package/dist/chunk-f6vzn90z.js +0 -2
- package/dist/chunk-fd3815fe.js +0 -2
- package/dist/chunk-gtj8wy95.js +0 -2
- package/dist/chunk-h4tbpr7p.js +0 -2
- package/dist/chunk-h5aaq0j8.js +0 -2
- package/dist/chunk-j0j4p9t1.js +0 -2
- package/dist/chunk-j0w048sj.js +0 -2
- package/dist/chunk-jvg9e6t6.js +0 -2
- package/dist/chunk-k761q7s7.js +0 -2
- package/dist/chunk-m3tnxk01.js +0 -2
- package/dist/chunk-mdtysd2d.js +0 -2
- package/dist/chunk-nmtya57z.js +0 -3
- package/dist/chunk-nxfyjw59.js +0 -2
- package/dist/chunk-pe5qqem0.js +0 -2
- package/dist/chunk-pwv77cyb.js +0 -2
- package/dist/chunk-qs0vtav5.js +0 -2
- package/dist/chunk-qv21bsa1.js +0 -2
- package/dist/chunk-rrba4t7k.js +0 -2
- package/dist/chunk-s3j5vxy9.js +0 -3
- package/dist/chunk-ssrxqj55.js +0 -2
- package/dist/chunk-t612xpa4.js +0 -2
- package/dist/chunk-tesbhpbp.js +0 -2
- package/dist/chunk-tkgkdf93.js +0 -2
- package/dist/chunk-tvw571ab.js +0 -2
- package/dist/chunk-txzap6yn.js +0 -2
- package/dist/chunk-vhrq4xjf.js +0 -2
- package/dist/chunk-vqpypnys.js +0 -2
- package/dist/chunk-vv3w8z4v.js +0 -2
- package/dist/chunk-vypnjn9g.js +0 -3
- package/dist/chunk-w39cfxa6.js +0 -2
- package/dist/chunk-wj937ceq.js +0 -2
- package/dist/chunk-xbavxkm5.js +0 -2
- package/dist/chunk-xrspzeqx.js +0 -2
- package/dist/chunk-y41hhypj.js +0 -2
- package/dist/chunk-yv9589qr.js +0 -54
- package/dist/chunk-z0yq548d.js +0 -2
- package/dist/chunk-zfjbwp54.js +0 -2
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{hl,yl}from"./chunk-23r3rby6.js";import{f,P,ot,d}from"./chunk-89d3h8mp.js";import{U,wr,Ms,Ds,ci,li,Ls,gn,Me,fe,J,Sr,kr,ie,Y,N,st,_r,pi,Tr,ze,r,p,W,Sn}from"./chunk-xvhxxj4g.js";import{n}from"./chunk-n8a4jm0p.js";import{oe}from"./chunk-1b1ntgt7.js";import{s}from"./chunk-x4f7efgp.js";import{g}from"./chunk-0dve54ne.js";import{createHash as St}from"crypto";import Q from"fs";import Z from"path";import je from"fs";function Ce(e,i,t){let o=Buffer.alloc(t),a=je.readSync(e,o,0,t,i);return o.subarray(0,a)}function Le(e){if(e.length<25)return!1;let i=(o,a)=>String.fromCharCode(...e.subarray(o,a));if(i(0,4)!=="RIFF"||i(8,12)!=="WEBP")return!1;let t=i(12,16);if(t==="VP8X")return(e[20]&16)!==0;if(t==="VP8L")return((e[21]|e[22]<<8|e[23]<<16|e[24]<<24)>>>28&1)===1;return!1}function Ue(e){let i;try{i=je.openSync(e,"r");let t=Ce(i,0,33);if(t.length>=3&&t[0]===255&&t[1]===216&&t[2]===255)return"none";if(t.length>=26&&t[0]===137&&t.toString("latin1",1,4)==="PNG"){let o=t[25];if(o===4||o===6)return"possible";let a=8;for(let c=0;c<64;c++){let l=Ce(i,a,8);if(l.length<8)return"unknown";let u=l.toString("latin1",4,8);if(u==="tRNS")return"possible";if(u==="IDAT"||u==="IEND")return"none";a+=12+l.readUInt32BE(0)}return"unknown"}if(t.length>=25&&t.toString("latin1",0,4)==="RIFF"&&t.toString("latin1",8,12)==="WEBP"){if(Le(t))return"possible";let o=t.toString("latin1",12,16);return o==="VP8 "||o==="VP8X"?"none":"unknown"}return"unknown"}catch{return"unknown"}finally{if(i!==void 0)je.closeSync(i)}}import Jt from"fs";import ke from"os";import{join as gt}from"path";import{fileURLToPath as pt}from"url";var Pe=Symbol("stx.image-worker.unavailable");function Yt(e=typeof ke.availableParallelism==="function"?ke.availableParallelism():ke.cpus().length){return Math.max(1,Math.min(2,e-1))}var Ae=0,ht=[];async function Qt(){if(Ae<Yt()){Ae++;return}await new Promise((e)=>ht.push(e)),Ae++}function en(){Ae--,ht.shift()?.()}var tn="@stacksjs/stx/builtins/image-warmup-worker";function nn(e=process.cwd()){let i=import.meta.url.endsWith(".ts")?"ts":"js";try{let t=new URL(`./image-warmup-worker.${i}`,import.meta.url);if(t.protocol==="file:"&&Jt.existsSync(pt(t)))return pt(t)}catch{}try{let t=typeof Bun<"u"?Bun.resolveSync(tn,e):void 0;return t&&rn(t)?t:void 0}catch{return}}function rn(e,i=process.env){let t=e.replace(/\\/g,"/");if(t.split("/").some((a)=>/@\d[^/]*@@@\d+$/.test(a)))return!1;return![i.BUN_INSTALL_CACHE_DIR,gt(i.BUN_INSTALL||gt(ke.homedir(),".bun"),"install","cache")].filter((a)=>!!a).map((a)=>`${a.replace(/\\/g,"/").replace(/\/$/,"")}/`).some((a)=>t.startsWith(a))}var mt=!1;function ue(e){if(!mt)mt=!0,console.warn(`[stx] image worker unavailable (${e}); running the image pass on the serving thread instead. Results are the same, but requests may stall while it runs.`);return Pe}function Re(e){return e instanceof Error?e.message:String(e)}async function Fe(e,i){let t;try{t=(await import("worker_threads")).Worker}catch(a){return ue(`could not load node:worker_threads: ${Re(a)}`)}if(typeof t!=="function")return ue("node:worker_threads has no Worker in this runtime");let o=nn();if(!o)return ue("no image-warmup-worker entry beside this module or in the installed @stacksjs/stx");await Qt();try{return await new Promise((a,c)=>{let l;try{l=new t(o)}catch(y){a(ue(`could not start ${o}: ${Re(y)}`));return}let u=!1,m=!1,v=(y)=>{if(m)return;m=!0,y(),l.terminate()};l.on("message",(y)=>{if(y.type==="ready"){u=!0,l.postMessage({task:e,args:i});return}if(y.type==="result"){v(()=>a(y.value));return}let h=Error(y.error?.message??"image worker failed");if(y.error?.name)h.name=y.error.name;if(y.error?.stack)h.stack=y.error.stack;v(()=>c(h))}),l.on("error",(y)=>{v(()=>u?c(y instanceof Error?y:Error(Re(y)||"image worker crashed")):a(ue(`the worker failed before it was ready: ${Re(y)}`)))}),l.on("exit",(y)=>{v(()=>u?c(Error("image worker exited before it finished")):a(ue(`the worker exited with code ${y} before it was ready`)))})})}finally{en()}}var sn=new Set([".avif",".jpeg",".jpg",".png",".webp"]),on=[320,640,960,1280,1920],ye="/_stx/images",an=`stx:${ye}:alpha-1`,cn=`stx:${ye}:opaque-1`,ln=["@stacksjs/ts-webp","@stacksjs/ts-avif","ts-images"],Ie;function un(e,i){let t=Z.dirname(Bun.resolveSync(e,i));while(t!==Z.dirname(t)){let o=Z.join(t,"package.json");if(Q.existsSync(o)){let a=JSON.parse(Q.readFileSync(o,"utf8"));if(a.name===e)return a.version}t=Z.dirname(t)}return}function yt(){if(Ie!==void 0)return Ie;let e;try{e=Z.dirname(Bun.resolveSync("ts-images",import.meta.dir))}catch{}return Ie=ln.map((i)=>{let t;try{t=e?un(i,e):void 0}catch{}return`${i.replace("@stacksjs/","")}@${t??"unknown"}`}).join("+"),Ie}var bt=Symbol.for("stx.image-delivery");function be(){let e=globalThis;return e[bt]??={catalog:new Map,transparent:new Set},e[bt]}var vt=new Set;function fn(e){return`/${e.split(Z.sep).map(encodeURIComponent).join("/")}`}function dn(e){let i=Z.extname(e),t=e.slice(0,-i.length).replace(/[^a-zA-Z0-9_-]+/g,"-").replace(/^-+|-+$/g,""),o=St("sha256").update(e).digest("hex").slice(0,8);return`${t||"image"}-${o}`}function xt(e,i=`stx:${ye}`){let t=(o)=>`${ye}/${o.split("/").map(encodeURIComponent).join("/")}`;return{cacheNamespace:i,async stat(o){let a=Z.join(e,o);try{let c=await Q.promises.stat(a);return c.size>0?{bytes:c.size,path:a,url:t(o)}:null}catch{return null}},async write(o,a){let c=Z.join(e,o);await Q.promises.mkdir(Z.dirname(c),{recursive:!0});let l=`${c}.${process.pid}.tmp`;return await Q.promises.writeFile(l,a),await Q.promises.rename(l,c),{bytes:a.byteLength,path:c,url:t(o)}},url:t}}async function Ct(e,i=e){let t=await Q.promises.readdir(i,{withFileTypes:!0});t.sort((a,c)=>a.name.localeCompare(c.name));let o=[];for(let a of t){let c=Z.join(i,a.name);if(a.isDirectory()){o.push(...await Ct(e,c));continue}if(!a.isFile()||!sn.has(Z.extname(a.name).toLowerCase()))continue;o.push({absolutePath:c,relativePath:Z.relative(e,c)})}return o}function wt(e,i){return e.map((t)=>({key:fn(t.relativePath),input:t.absolutePath,name:dn(t.relativePath),...pn(t.absolutePath)?{options:{storage:i}}:{}}))}function pn(e){return Ue(e)==="possible"}function mn(e){for(let i=3;i<e.length;i+=4)if(e[i]!==255)return!0;return!1}async function hn(e){let i=Object.entries(e).filter(([,c])=>c.fallback.format==="png"),t=new Set,o=8;if(i.length===0)return t;let{decode:a}=await import("ts-images");for(let c=0;c<i.length;c+=8)await Promise.all(i.slice(c,c+8).map(async([l,u])=>{let m=u.variants.filter((v)=>v.format==="png").sort((v,y)=>v.width-y.width)[0];try{let v=await a(new Uint8Array(await Q.promises.readFile(m?.path??u.fallback.path)));if(mn(v.data))t.add(l)}catch{t.add(l)}}));return t}function yn(e,i){let t=[];for(let o of i){let a=e[o],c=a?.variants.filter((u)=>u.format==="webp")??[];if(!a||c.length===0)continue;if(!c.some((u)=>{let m;try{return m=Q.openSync(u.path,"r"),!Le(Ce(m,0,32))}catch{return!0}finally{if(m!==void 0)Q.closeSync(m)}}))continue;if(a.variants=a.variants.filter((u)=>u.format!=="webp"),delete a.sources.webp,t.push(o),!vt.has(o))vt.add(o),console.warn(`[stx-images] ${o} is transparent but its WebP variants have no alpha channel; serving PNG instead. Upgrade @stacksjs/ts-webp to 0.1.6 or later.`)}return t}async function bn(e){let i=[],t=8;if(e.length===0)return i;let{generateThumbHash:o}=await import("ts-images");for(let a=0;a<e.length;a+=8){let c=e.slice(a,a+8),l=await Promise.all(c.map(async(u)=>{try{return await o(u.absolutePath),u}catch{return console.warn(`[stx-images] Skipping unreadable raster: ${u.relativePath}`),null}}));i.push(...l.filter((u)=>u!==null))}return i}function We(e){return Z.join(e,"undecodable.json")}function vn(e){try{let i=Q.readFileSync(We(e),"utf-8"),t=JSON.parse(i);return t&&typeof t==="object"?t:{}}catch{return{}}}function xn(e,i){try{Q.mkdirSync(Z.dirname(We(e)),{recursive:!0}),Q.writeFileSync(We(e),JSON.stringify(i))}catch{}}function $t(e){try{let i=Q.statSync(e);return{mtimeMs:i.mtimeMs,size:i.size}}catch{return}}function Rt(e){if(!e||e.startsWith("data:")||e.startsWith("blob:")||/^https?:\/\//i.test(e)||e.startsWith("//"))return;let i=e.split(/[?#]/,1)[0];if(!i)return;try{return`/${i.replace(/^\/+/,"").split("/").map(decodeURIComponent).map(encodeURIComponent).join("/")}`}catch{return}}function Bo(e){let i=Rt(e);return i?be().catalog.get(i):void 0}function Fo(e){let i=Rt(e);return i?be().transparent.has(i):!1}function zo(e){let i=(o)=>e.variants.filter((a)=>a.format===o).reduce((a,c)=>a+c.bytes,0),t=i(e.fallback.format);return["avif","webp"].map((o)=>({format:o,srcset:e.sources[o]||"",bytes:i(o)})).filter((o)=>o.srcset&&o.bytes>0&&o.bytes<t).sort((o,a)=>o.bytes-a.bytes).map(({format:o,srcset:a})=>({format:o,srcset:a}))}function Mh(e){let i=Bo(e);if(!i)return;return{src:i.fallback.url,srcset:i.sources[i.fallback.format]||"",sources:zo(i).map(({format:t,srcset:o})=>({type:`image/${t}`,srcset:o})),width:i.source.width,height:i.source.height,placeholder:Fo(e)?void 0:i.placeholder?.dataUrl}}function ds(){let e=be();e.catalog=new Map,e.transparent=new Set}function wn(e){let i=be();i.catalog=new Map(e.entries),i.transparent=new Set(e.transparent)}async function Dh(e,i,t={}){if(!e||!Q.existsSync(e))return ds(),{count:0,fingerprint:""};if(t.offThread){let b=await Fe("delivery",{publicDir:e,outputDir:i});if(b!==Pe)return wn(b.state),b.result}let o=await Ct(e);if(o.length===0)return ds(),{count:0,fingerprint:""};let a=vn(i),c=o.filter((b)=>{let w=a[b.relativePath];if(!w)return!0;let A=$t(b.absolutePath);return!A||A.mtimeMs!==w.mtimeMs||A.size!==w.size});if(c.length===0)return ds(),{count:0,fingerprint:""};let l=xt(Z.join(i,"_stx","images"),`${an}:${yt()}`),u={outDir:Z.join(i,"_stx","images"),storage:xt(Z.join(i,"_stx","images"),`${cn}:${yt()}`),baseUrl:ye,widths:on,formats:["avif","webp"],quality:{avif:70,webp:78,jpeg:82,png:100},includeOriginal:!1,placeholder:!0,batchConcurrency:4,concurrency:4},{createImageDeliveryCatalog:m}=await import("ts-images/delivery"),v=c,y;try{y=await m({...u,entries:wt(c,l)})}catch(b){if(v=await bn(c),v.length===c.length)throw b;let w=new Set(v.map((k)=>k.relativePath)),A=!1;for(let k of c){if(w.has(k.relativePath))continue;let R=$t(k.absolutePath);if(!R)continue;a[k.relativePath]=R,A=!0}if(A)xn(i,a);if(v.length===0)return ds(),{count:0,fingerprint:""};y=await m({...u,entries:wt(v,l)})}let h=await hn(y.entries),C=yn(y.entries,h),x=be();x.catalog=new Map(Object.entries(y.entries)),x.transparent=h;let S=h.size===0&&C.length===0?y.fingerprint:St("sha256").update(y.fingerprint).update(JSON.stringify({transparent:[...h].sort(),droppedWebp:C.sort()})).digest("hex");return{count:v.length,fingerprint:S}}class kt{builtins=new Map;registerBuiltin(e){this.builtins.set(e.name.toLowerCase(),e);for(let i of e.aliases)this.builtins.set(i.toLowerCase(),e)}isBuiltin(e){return this.builtins.has(e.toLowerCase())}getBuiltin(e){return this.builtins.get(e.toLowerCase())??null}async resolveFile(e,i,t,o){let a=ci(e,o);if(a!==void 0)return a;for(let c of li(e,i,t,o))if(await r(c))return c;return null}}var de=new kt;var re="\x00stx-boolean-attribute";function He(e){return e.indexOf("\x00")===-1?e:e.replace(/\0/g,"")}var $n=new Set(["accesskey","autocapitalize","autofocus","class","contenteditable","dir","draggable","enterkeyhint","exportparts","hidden","id","inert","inputmode","is","itemid","itemprop","itemref","itemscope","itemtype","lang","nonce","part","role","slot","spellcheck","style","tabindex","title","translate","accept","action","alt","autocomplete","capture","cite","cols","colspan","content","controls","datetime","default","download","enctype","for","form","formaction","formenctype","formmethod","formnovalidate","formtarget","height","href","hreflang","kind","label","loading","loop","max","maxlength","media","method","min","minlength","multiple","muted","name","open","pattern","placeholder","playsinline","poster","preload","readonly","referrerpolicy","rel","required","reversed","rows","rowspan","scope","selected","shape","size","span","src","srcdoc","srclang","srcset","start","step","target","type","usemap","value","width","wrap"]);function qe(e){let i=e.toLowerCase();return i.startsWith("aria-")||i.startsWith("data-")||$n.has(i)}function se(e,i){let t=[];for(let[o,a]of Object.entries(e.static)){if(i.has(o))continue;let c=e.staticNames?.[o]??o;if(typeof a==="boolean"){if(a)t.push(p(c));continue}if(a===re){t.push(p(c));continue}t.push(`${p(c)}="${Sn(c,He(String(a)))}"`)}return t}function ae(e,i){let t=[];for(let[o,a]of Object.entries(e.serverDynamic??{})){if(i.has(o))continue;if(a===null||a===void 0||a===!1)continue;let c=e.serverDynamicNames?.[o]??o;if(a===!0){t.push(p(c));continue}if(typeof a==="object")continue;t.push(`${p(c)}="${Sn(c,He(String(a)))}"`)}return t}function Cn(e){if(e.clientReactive.to)return{value:e.clientReactive.to,reactive:!0};if(e.serverDynamic.to!==void 0)return{value:String(e.serverDynamic.to),reactive:!1};if(typeof e.static.to==="string")return{value:e.static.to,reactive:!1};return{value:"#",reactive:!1}}var Xe={name:"StxLink",aliases:["stx-link"],render(e,i,t){let o=Cn(e),a=(typeof e.static.class==="string"?e.static.class:"")||(typeof e.static.className==="string"?e.static.className:""),c=typeof e.static.activeClass==="string"?e.static.activeClass:"active",l=typeof e.static.exactActiveClass==="string"?e.static.exactActiveClass:"exact-active",u=e.static.prefetch===!0||e.static.prefetch==="true"||e.serverDynamic.prefetch===!0,m=[];if(o.reactive)m.push(`:href="${n(o.value)}"`);else m.push(`href="${n(Sr(o.value,"navigable"))}"`);if(a)m.push(`class="${n(a)}"`);if(m.push("data-stx-link"),m.push(`data-stx-active-class="${n(c)}"`),m.push(`data-stx-exact-active-class="${n(l)}"`),u)m.push("data-stx-prefetch");let v=typeof e.static.activeMatch==="string"?e.static.activeMatch.trim():"";if(v)m.push(`data-stx-active-match="${n(v)}"`);let y=new Set(["to","class","className","activeClass","exactActiveClass","activeMatch","prefetch"]);return m.push(...se(e,y)),m.push(...ae(e,y)),`<a ${m.join(" ")}>${i}</a>`}};var Rn=new Map;function Ve(e){if(!e)return;let i=e.split("?")[0].split("#")[0];return Rn.get(i)}var kn={sm:640,md:768,lg:1024,xl:1280,"2xl":1536},Ze=[320,640,768,1024,1280,1536,1920];function V(e,i){if(e.serverDynamic[i]!==void 0)return String(e.serverDynamic[i]);let t=e.static[i];if(typeof t==="string")return t;return}function _e(e,i,t=!1){let o=e.serverDynamic[i];if(o!==void 0)return o!==!1&&o!=="false";let a=e.static[i];if(a!==void 0)return a!=="false"&&a!==!1;return t}function Ge(e){if(e.includes("(")||e.includes(","))return e;let i=e.trim().split(/\s+/),t=[];for(let o of i)if(o.includes(":")){let[a,c]=o.split(":"),l=kn[a];if(l)t.push(`(max-width: ${l}px) ${c}`);else{let u=Number.parseInt(a);if(!Number.isNaN(u))t.push(`(max-width: ${u}px) ${c}`)}}else t.push(o);return t.join(", ")}function Ke(e,i,t,o){return i.map((a)=>`${ve(e,a,void 0,t,o)} ${a}w`).join(", ")}function An(e,i,t,o,a){return i.map((c)=>{let l=t?t*c:void 0;return`${ve(e,l,void 0,o,a)} ${c}x`}).join(", ")}function ve(e,i,t,o,a){if(!o||o==="local"||o==="static")return e;if(o==="cloudinary"){let c=[];if(i)c.push(`w_${i}`);if(t)c.push(`h_${t}`);if(a)c.push(`f_${a}`);c.push("q_auto");let l=c.join(",");return e.replace("/upload/",`/upload/${l}/`)}if(o==="imgix"){let c=new URLSearchParams;if(i)c.set("w",String(i));if(t)c.set("h",String(t));if(a)c.set("fm",a);c.set("auto","format");let l=e.includes("?")?"&":"?";return`${e}${l}${c.toString()}`}if(o==="bunny"){let c=new URLSearchParams;if(i)c.set("width",String(i));if(t)c.set("height",String(t));if(a)c.set("format",a);let l=e.includes("?")?"&":"?";return`${e}${l}${c.toString()}`}return e}function Pn(e){return`var s=this.style;${e.map((i)=>`s.${i}=''`).join(";")}`}function In(e,i,t="#e5e7eb"){let o=`<svg xmlns="http://www.w3.org/2000/svg" width="${e}" height="${i}"><rect width="100%" height="100%" fill="${t}"/></svg>`;return`data:image/svg+xml;base64,${btoa(o)}`}var Je={name:"StxImage",aliases:["Image","stx-image","stx-img"],render(e,i,t){let o=V(e,"src")||"",a=Bo(o),c=V(e,"alt")||"",l=V(e,"width")||(a?String(a.source.width):void 0),u=V(e,"height")||(a?String(a.source.height):void 0),m=V(e,"sizes"),v=V(e,"srcset"),y=V(e,"densities"),h=V(e,"format"),C=Fo(o)||Ve(o)?.transparent===!0,x=V(e,"placeholder")||(a&&!C?"thumbhash":void 0),S=V(e,"placeholderColor")||"#e5e7eb",b=V(e,"provider"),w=V(e,"class")||V(e,"className")||"",A=V(e,"style")||"",k=V(e,"objectFit")||V(e,"fit"),R=V(e,"objectPosition")||V(e,"position"),B=V(e,"quality"),G=_e(e,"lazy",!0),M=_e(e,"preload",!1),F=_e(e,"priority",!1),H=V(e,"loading"),E=V(e,"decoding")||"async",D=!!a||_e(e,"picture",!1)||!!h,O=l?Number.parseInt(l):void 0,q=u?Number.parseInt(u):void 0,z=v||"",X="";if(a)z=a.sources[a.fallback.format]||"",X=m?Ge(m):"100vw";else if(!z&&m&&b&&b!=="local"&&b!=="static")z=Ke(o,Ze,b,h),X=Ge(m);else if(!z&&y){let I=y.split(/\s+/).map((_)=>Number.parseFloat(_.replace("x","")));z=An(o,I,O,b,h)}else if(m)X=Ge(m);let L=[];if(A)L.push(A);if(k)L.push(`object-fit:${k}`);if(R)L.push(`object-position:${R}`);if(O&&q)L.push(`aspect-ratio:${O}/${q}`);let T=[],ce=x==="blur"||x==="color"||x==="thumbhash";if(ce&&!C){let I=a?.placeholder?{dataUrl:a.placeholder.dataUrl,color:S}:Ve(o);if(I&&x==="color")L.push(`background-color:${I.color}`),T.push("backgroundColor");else if(I)L.push(`background-color:${I.color}`),L.push(`background-image:url(${I.dataUrl})`),L.push("background-size:cover"),L.push("background-repeat:no-repeat"),T.push("backgroundColor","backgroundImage");else{let _=In(O||16,q||9,S);L.push(`background-image:url(${_})`),L.push("background-size:cover"),L.push("background-repeat:no-repeat"),T.push("backgroundImage")}}else if(!ce&&x&&x!=="empty"&&x!=="none")L.push(`background-image:url(${n(x)})`),L.push("background-size:cover"),L.push("background-repeat:no-repeat"),T.push("backgroundImage");let $e=a?.fallback.url||ve(o,O,q,b,h),K=[];if(K.push(`src="${n(Sr($e,"fetched"))}"`),K.push(`alt="${n(c)}"`),l)K.push(`width="${n(l)}"`);if(u)K.push(`height="${n(u)}"`);let le=H||(F||M?"eager":G?"lazy":"");if(le)K.push(`loading="${n(le)}"`);if(F)K.push('fetchpriority="high"');if(K.push(`decoding="${n(E)}"`),w)K.push(`class="${n(w)}"`);if(L.length>0)K.push(`style="${n(L.join(";"))}"`);if(z)K.push(`srcset="${n(Sr(z,"fetched"))}"`);if(X)K.push(`sizes="${n(X)}"`);let te=new Set(["src","alt","width","height","lazy","sizes","srcset","placeholder","placeholderColor","class","className","style","objectFit","objectPosition","fit","position","format","provider","quality","densities","preload","priority","picture","loading","decoding"]);if(T.length>0){let I=typeof e.static.onload==="string"?e.static.onload:"",_=Pn(T)+(I?`;${I}`:"");K.push(`onload="${n(_)}"`),te.add("onload")}K.push(...se(e,te)),K.push(...ae(e,te));let Te=`<img ${K.join(" ")} />`,j="";if(M){let _=h==="webp"?"image/webp":h==="avif"?"image/avif":"";j=`<link rel="preload" as="image" href="${n($e)}"${_?` type="${_}"`:""}${z?` imagesrcset="${n(z)}"`:""}${X?` imagesizes="${n(X)}"`:""} />
|
|
3
|
+
`}if(D){let I=[];if(a)for(let _ of zo(a))I.push(`<source type="image/${_.format}" srcset="${n(_.srcset)}"${X?` sizes="${n(X)}"`:""} />`);if(!a&&(h==="avif"||h==="auto")){let _=ve(o,O,q,b,"avif"),ee=z?Ke(o,Ze,b,"avif"):`${_}`;I.push(`<source type="image/avif" srcset="${n(ee)}"${X?` sizes="${n(X)}"`:""} />`)}if(!a&&(h==="webp"||h==="auto")){let _=ve(o,O,q,b,"webp"),ee=z?Ke(o,Ze,b,"webp"):`${_}`;I.push(`<source type="image/webp" srcset="${n(ee)}"${X?` sizes="${n(X)}"`:""} />`)}return`${j}<picture>
|
|
4
|
+
${I.join(`
|
|
5
|
+
`)}
|
|
6
|
+
${Te}
|
|
7
|
+
</picture>`}return`${j}${Te}`}};var At="/images/safe-image-default.svg";function ge(e,i){if(e.serverDynamic[i]!==void 0)return String(e.serverDynamic[i]);let t=e.static[i];if(typeof t==="string")return t;return}var _n=`<script>window.__stxSafeImageHandler||(window.__stxSafeImageHandler=function(i){if(i.__stx_fb)return;i.__stx_fb=1;var f=i.getAttribute('data-fallback')||'${At}';var c=i.getAttribute('data-fallback-class');i.src=f;if(c)i.className=c;});</script>`,Ye={name:"SafeImage",aliases:["safe-image","safe-img"],render(e,i,t){let o=ge(e,"src")||"",a=ge(e,"alt")||"",c=ge(e,"fallback")||At,l=ge(e,"class")||ge(e,"className")||"",u=ge(e,"fallbackClassName")||"",m=[];if(m.push(`src="${n(o)}"`),m.push(`alt="${n(a)}"`),l)m.push(`class="${n(l)}"`);if(m.push(`data-fallback="${n(c)}"`),u)m.push(`data-fallback-class="${n(u)}"`);m.push('onerror="window.__stxSafeImageHandler(this)"');let v=new Set(["src","alt","fallback","class","className","fallbackClassName"]);m.push(...se(e,v)),m.push(...ae(e,v));let y=`<img ${m.join(" ")} />`,h=t.context;if(!h.__safeImageHandlerEmitted)return h.__safeImageHandlerEmitted=!0,`${_n}${y}`;return y}};function Qe(e){return e.replace(/[;{}()]/g,"").replace(/url/gi,"")}function xe(e,i){if(e.serverDynamic[i]!==void 0)return String(e.serverDynamic[i]);let t=e.static[i];if(typeof t==="string")return t;return}function Ee(e,i,t){let o=xe(e,i);if(o!==void 0){let a=Number.parseInt(o,10);if(!Number.isNaN(a))return a}return t}var et={name:"StxLoadingIndicator",aliases:["stx-loading-indicator"],render(e,i,t){let o=Qe(xe(e,"color")||"#6366f1"),a=Qe(xe(e,"initialColor")||xe(e,"initial-color")||""),c=Qe(xe(e,"height")||"3px"),l=Ee(e,"duration",2000),u=Ee(e,"throttle",200),m=Ee(e,"zIndex",999999)||Ee(e,"z-index",999999),v=a?`linear-gradient(to right, ${a}, ${o})`:o;return`
|
|
8
|
+
<div id="stx-loading-indicator" style="position:fixed;top:0;left:0;right:0;height:${c};background:${v};z-index:${m};transform:scaleX(0);transform-origin:left;transition:transform 0.1s ease-out,opacity 0.3s ease;opacity:0;pointer-events:none">
|
|
9
|
+
<div style="position:absolute;top:0;left:0;right:0;bottom:0;background:linear-gradient(90deg,transparent 0%,rgba(255,255,255,0.4) 50%,transparent 100%);animation:stx-shimmer 1.5s infinite"></div>
|
|
10
|
+
</div>
|
|
11
|
+
<style>@keyframes stx-shimmer{0%{transform:translateX(-100%)}100%{transform:translateX(100%)}}</style>
|
|
12
|
+
<script>
|
|
13
|
+
(function(){var el=document.getElementById('stx-loading-indicator'),p=0,l=!1,i=null;function u(v){p=Math.min(Math.max(v,0),100);if(el){el.style.opacity=p>0?'1':'0';el.style.transform='scaleX('+(p/100)+')'}}window.stxLoading={start:function(){l=!0;p=0;u(10);if(i)clearInterval(i);i=setInterval(function(){if(!l)return;var r=90-p,inc=Math.max(0.5,r*0.1);if(p<90)u(p+inc)},${u})},finish:function(){l=!1;if(i){clearInterval(i);i=null}u(100);setTimeout(function(){if(el)el.style.opacity='0';setTimeout(function(){p=0;if(el)el.style.transform='scaleX(0)'},300)},200)},set:function(v){u(v)},clear:function(){l=!1;p=0;if(i){clearInterval(i);i=null}if(el){el.style.opacity='0';el.style.transform='scaleX(0)'}}};document.addEventListener('click',function(e){var a=e.target.closest&&e.target.closest('a');if(!a)return;var h=a.getAttribute('href');if(!h||h.startsWith('http')||h.startsWith('#')||h.startsWith('mailto:')||h.startsWith('tel:')||a.target==='_blank')return;window.stxLoading.start()});window.addEventListener('popstate',function(){window.stxLoading.start()});window.addEventListener('load',function(){window.stxLoading.finish()})})();
|
|
14
|
+
</script>`}};function It(e,i){if(e.serverDynamic[i]!==void 0)return String(e.serverDynamic[i]);let t=e.static[i];if(typeof t==="string")return t;return}function En(e,i,t){let o=It(e,i);if(o!==void 0){let a=Number.parseInt(o,10);if(!Number.isNaN(a))return a}return t}var Pt={"top-right":"top:1rem;right:1rem","top-left":"top:1rem;left:1rem","top-center":"top:1rem;left:50%;transform:translateX(-50%)","bottom-right":"bottom:1rem;right:1rem","bottom-left":"bottom:1rem;left:1rem","bottom-center":"bottom:1rem;left:50%;transform:translateX(-50%)"},tt={name:"StxToast",aliases:["stx-toast"],render(e,i,t){let o=n(It(e,"position")||"top-right"),a=En(e,"max",5),c=Pt[o]||Pt["top-right"];return`<div id="stx-toast-container" data-stx-toast-position="${o}" data-stx-toast-max="${a}" style="position:fixed;${c};z-index:999999;display:flex;flex-direction:column;gap:0.5rem;pointer-events:none;max-width:24rem;width:100%"></div>
|
|
15
|
+
<style>
|
|
16
|
+
@keyframes stx-toast-in{from{opacity:0;transform:translateX(100%)}to{opacity:1;transform:translateX(0)}}
|
|
17
|
+
@keyframes stx-toast-out{from{opacity:1;transform:translateX(0)}to{opacity:0;transform:translateX(100%)}}
|
|
18
|
+
@keyframes stx-toast-in-left{from{opacity:0;transform:translateX(-100%)}to{opacity:1;transform:translateX(0)}}
|
|
19
|
+
@keyframes stx-toast-out-left{from{opacity:1;transform:translateX(0)}to{opacity:0;transform:translateX(-100%)}}
|
|
20
|
+
@keyframes stx-toast-in-center{from{opacity:0;transform:translateY(-1rem)}to{opacity:1;transform:translateY(0)}}
|
|
21
|
+
@keyframes stx-toast-out-center{from{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(-1rem)}}
|
|
22
|
+
</style>`}};function Ne(e,i){if(e.serverDynamic[i]!==void 0)return String(e.serverDynamic[i]);let t=e.static[i];if(typeof t==="string")return t;return}var _t={sm:"max-width:24rem",md:"max-width:32rem",lg:"max-width:42rem",xl:"max-width:56rem",full:"max-width:calc(100vw - 2rem);max-height:calc(100vh - 2rem)"},nt={name:"StxModal",aliases:["stx-modal"],render(e,i,t){let o=Ne(e,"id");if(!o)return console.warn('[stx] <StxModal> requires an "id" prop'),"<!-- StxModal: missing id prop -->";let a=n(o),c=Ne(e,"size")||"md",l=Ne(e,"closeOnBackdrop")!=="false",u=Ne(e,"closeOnEscape")!=="false",m=_t[c]||_t.md;return`<div id="stx-modal-${a}" class="stx-modal-backdrop" data-stx-modal="${a}" data-close-backdrop="${l}" data-close-escape="${u}" style="display:none;position:fixed;inset:0;z-index:99999;align-items:center;justify-content:center;background:rgba(0,0,0,0.5);backdrop-filter:blur(2px);opacity:0;transition:opacity 0.2s ease" aria-modal="true" role="dialog">
|
|
23
|
+
<div class="stx-modal-panel" style="${m};width:100%;margin:1rem;border-radius:0.75rem;box-shadow:0 20px 60px rgba(0,0,0,0.3);overflow:hidden;transform:scale(0.95) translateY(8px);transition:transform 0.2s ease,opacity 0.2s ease;opacity:0;background:var(--stx-modal-bg,#fff);color:var(--stx-modal-text,#1f2937)">
|
|
24
|
+
<div style="padding:1.5rem">${i}</div>
|
|
25
|
+
</div>
|
|
26
|
+
</div>
|
|
27
|
+
<style>
|
|
28
|
+
@media(prefers-color-scheme:dark){[data-stx-modal]{--stx-modal-bg:#1f2937;--stx-modal-text:#f3f4f6}}
|
|
29
|
+
.stx-modal-backdrop[data-stx-modal-open]{display:flex!important;opacity:1}
|
|
30
|
+
.stx-modal-backdrop[data-stx-modal-open] .stx-modal-panel{transform:scale(1) translateY(0);opacity:1}
|
|
31
|
+
</style>`}};function pe(e,i){if(e.serverDynamic[i]!==void 0)return String(e.serverDynamic[i]);let t=e.static[i];if(typeof t==="string")return t;return}var Et={sm:"16rem",md:"24rem",lg:"32rem",xl:"40rem"},rt={name:"StxDrawer",aliases:["stx-drawer"],render(e,i,t){let o=pe(e,"id");if(!o)return console.warn('[stx] <StxDrawer> requires an "id" prop'),"<!-- StxDrawer: missing id prop -->";let a=n(o),c=pe(e,"side")||"right",l=pe(e,"size")||"md",u=pe(e,"closeOnBackdrop")!=="false",m=pe(e,"closeOnEscape")!=="false",v=pe(e,"overlay")!=="false",y=Et[l]||Et.md,h=c==="left",C=h?"left:0":"right:0",x=h?"translateX(-100%)":"translateX(100%)",S=h?"stx-drawer-slide-left":"stx-drawer-slide-right";return`<div id="stx-drawer-${a}" class="stx-drawer-backdrop" data-stx-drawer="${a}" data-close-backdrop="${u}" data-close-escape="${m}" style="display:none;position:fixed;inset:0;z-index:99999;${v?"background:rgba(0,0,0,0.5);backdrop-filter:blur(2px)":"background:transparent;pointer-events:none"};opacity:0;transition:opacity 0.2s ease" role="dialog" aria-modal="true">
|
|
32
|
+
<div class="stx-drawer-panel" style="position:fixed;top:0;bottom:0;${C};width:${y};max-width:100vw;transform:${x};transition:transform 0.3s cubic-bezier(0.4,0,0.2,1);background:var(--stx-drawer-bg,#fff);color:var(--stx-drawer-text,#1f2937);box-shadow:0 20px 60px rgba(0,0,0,0.3);overflow-y:auto;pointer-events:auto">
|
|
33
|
+
<div style="padding:1.5rem">${i}</div>
|
|
34
|
+
</div>
|
|
35
|
+
</div>
|
|
36
|
+
<style>
|
|
37
|
+
@media(prefers-color-scheme:dark){[data-stx-drawer]{--stx-drawer-bg:#1f2937;--stx-drawer-text:#f3f4f6}}
|
|
38
|
+
.stx-drawer-backdrop[data-stx-drawer-open]{display:block!important;opacity:1}
|
|
39
|
+
.stx-drawer-backdrop[data-stx-drawer-open] .stx-drawer-panel{transform:translateX(0)}
|
|
40
|
+
</style>`}};import{existsSync as Nn,readFileSync as On}from"fs";var Oe=new Map,Nt=new Set;function Bn(e){if(Nt.has(e))return;Nt.add(e),console.warn(`[stx] icon collection "${e}" is not installed, so its icons render as nothing. Install it with \`bun add -d @iconify-json/${e}\`.`)}function Dn(e){let i=process.cwd();for(let t of[`${i}/node_modules/@iconify-json/${e}/icons.json`,`${i}/pantry/@iconify-json/${e}/icons.json`,`${i}/node_modules/@iconify/json/json/${e}.json`,`${i}/pantry/@iconify/json/json/${e}.json`])if(Nn(t))return t;for(let t of[`@iconify-json/${e}/icons.json`,`@iconify/json/json/${e}.json`])try{return g.resolve(t)}catch{}return null}function Tn(e){if(Oe.has(e))return Oe.get(e);let i=Dn(e);if(!i)return Bn(e),null;try{let t=JSON.parse(On(i,"utf8"));return Oe.set(e,t),t}catch{return null}}function jn(e,i,t,o){let a=[];if(i.rotate)a.push(`rotate(${i.rotate*90} ${t/2} ${o/2})`);if(i.hFlip)a.push(`translate(${t} 0) scale(-1 1)`);if(i.vFlip)a.push(`translate(0 ${o}) scale(1 -1)`);return a.length?`<g transform="${a.join(" ")}">${e}</g>`:e}function Mn(e,i){let t=i,o=e.icons[t],a={hFlip:!1,vFlip:!1,rotate:0};for(let u=0;!o&&u<8;u++){let m=e.aliases?.[t];if(!m)return null;if(m.hFlip)a.hFlip=!a.hFlip;if(m.vFlip)a.vFlip=!a.vFlip;if(m.rotate)a.rotate=((a.rotate+m.rotate)%4+4)%4;t=m.parent,o=e.icons[t]}if(!o)return null;let c=o.width??e.width??24,l=o.height??e.height??24;return{body:jn(o.body,a,c,l),width:c,height:l}}function me(e,i){if(e.serverDynamic[i]!==void 0)return String(e.serverDynamic[i]);if(e.static[i]!==void 0)return String(e.static[i]);if(e.clientReactive[i]!==void 0)return e.clientReactive[i];return}var it={name:"Icon",aliases:["icon","stx-icon"],render(e,i,t){let o=me(e,"name")??me(e,"icon");if(!o)return"<!-- Icon: missing name/icon prop -->";let a="lucide",c=o;if(o.includes(":")){let w=o.split(":");a=w[0],c=w[1]}let l=n(me(e,"size")||"24"),u=n(me(e,"color")||"currentColor"),m=n(me(e,"class")||""),v=n(me(e,"style")||""),y=Oe.get(a)??Tn(a);if(!y)return`<!-- Icon: collection "${a}" not loaded -->`;let h=Mn(y,c);if(!h)return`<!-- Icon: "${c}" not found in ${a} -->`;let C=`0 0 ${h.width} ${h.height}`,x=h.body;if(u!=="currentColor")x=x.replace(/currentColor/g,u);let S=m?` class="${m}"`:"",b=v?` style="${v}"`:"";return`<svg xmlns="http://www.w3.org/2000/svg" width="${l}" height="${l}" viewBox="${C}" fill="none"${S}${b}>${x}</svg>`}};function Ot(e,...i){for(let t of i){if(e.serverDynamic[t]!==void 0)return String(e.serverDynamic[t]);let o=e.static[t];if(typeof o==="string")return o}return}function Bt(e,i){let t=new RegExp(`<(template|div|span)[^>]*\\bslot=["']${i}["'][^>]*>([\\s\\S]*?)<\\/\\1>`,"i"),o=e.match(t);if(!o)return{region:null,rest:e};return{region:o[2],rest:e.replace(o[0],"")}}var at={name:"Suspense",aliases:["suspense"],render(e,i,t){let o=Bt(i,"fallback"),a=o.rest,c=Bt(a,"error"),l=c.rest,u=o.region??Ot(e,"fallback")??'<div class="stx-suspense-loading">Loading\u2026</div>',m=c.region??Ot(e,"errorFallback","error-fallback")??'<div class="stx-suspense-error">Something went wrong.</div>';return`<div data-stx-suspense><div data-stx-suspense-fallback>${u}</div><div data-stx-suspense-error hidden>${m}</div><div data-stx-suspense-content hidden>${l}</div></div>`}};function Be(e,...i){for(let t of i){if(e.serverDynamic[t]!==void 0)return String(e.serverDynamic[t]);let o=e.static[t];if(typeof o==="string")return o}return}var ct={name:"TransitionGroup",aliases:["transition-group"],render(e,i,t){let o=(Be(e,"name")||"v").replace(/["'<>]/g,""),a=(Be(e,"tag")||"div").replace(/[^a-z0-9-]/gi,"")||"div",c=Be(e,"class"),l=Be(e,"id"),u=[`data-stx-transition-group="${o}"`,c?`class="${c}"`:"",l?`id="${l}"`:""].filter(Boolean).join(" ");return`<${a} ${u}>${i}</${a}>`}};function Dt(e=de){e.registerBuiltin(Xe),e.registerBuiltin(Je),e.registerBuiltin(Ye),e.registerBuiltin(et),e.registerBuiltin(tt),e.registerBuiltin(nt),e.registerBuiltin(rt),e.registerBuiltin(it),e.registerBuiltin(at),e.registerBuiltin(ct)}var Tt=new Map;function Ln(e){let i=Tt.get(e.source);if(!i)i=new RegExp(`(${e.source})(?![\\w.:-])`,"y"),Tt.set(e.source,i);return i}var jt=new WeakMap;function Mt(e){let i=jt.get(e);if(!i)i=new Set([...e].map((o)=>o.toLowerCase())),jt.set(e,i);let t=i;return(o)=>!/[a-z]/.test(o)&&t.has(o.toLowerCase())}function zn(e,i){let t="";for(let o=i;o<e.length;o++){let a=e[o];if(t){if(a==="\\")o++;else if(a===t)t=""}else if(a==='"'||a==="'")t=a;else if(a===">")return o}return e.length}function Lt(e,i,t){let o=[],a=0,c=typeof t==="function"?t:t?(l)=>t.has(l.toLowerCase()):void 0;while(a<e.length){let l=e.indexOf("<",a);if(l===-1)break;let u=Ln(i);u.lastIndex=l+1;let m=u.exec(e);if(!m){a=l+1;continue}let v=m[1];if(c&&c(v)){let w=l+1+v.length;while(w<e.length&&e[w]!==">")w++;a=w+1;continue}let y=l+1+v.length,h=null,C=y,x=-1,S=!1;while(y<e.length){let w=e[y];if(h){if(w==="\\"&&y+1<e.length){y+=2;continue}if(w===h)h=null;y++;continue}if(w==='"'||w==="'"){h=w,y++;continue}if(w==="/"&&y+1<e.length&&e[y+1]===">"){x=y+2,S=!0;break}if(w===">"){x=y+1;break}y++}if(x===-1){a=l+1;continue}let b=e.slice(C,S?x-2:x-1).trim();if(S)o.push({fullMatch:e.slice(l,x),tagName:v,attributes:b,content:"",startIndex:l,endIndex:x,isSelfClosing:!0}),a=x;else{let w=`<${v}`,A=`</${v}>`,k=1,R=x,B=-1;while(k>0&&R<e.length){let F=e.indexOf(w,R),H=e.indexOf(A,R);if(H===-1)break;if(F!==-1&&F<H){let E=e[F+w.length];if(E===" "||E===">"||E==="/"||E===`
|
|
41
|
+
`||E==="\t"){let D=zn(e,F+w.length);if(e[D-1]!=="/")k++;R=D+1}else R=F+w.length}else{if(k--,k===0){B=H;break}R=H+A.length}}if(B===-1){a=x;continue}let G=e.slice(x,B),M=B+A.length;o.push({fullMatch:e.slice(l,M),tagName:v,attributes:b,content:G,startIndex:l,endIndex:M,isSelfClosing:!1}),a=M}}return o}function lt(e){return e.replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/�?39;/g,"'").replace(/'/gi,"'").replace(/&/g,"&")}function zt(e,i){try{let t=Buffer.from(e,"base64").toString("utf8");return JSON.parse(t)}catch{}try{let t=e.replace(/"/g,'"').replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&");return JSON.parse(t)}catch(t){if(i?.debug)console.error("Error decoding __stx_ prop:",t);return e}}function De(e,i){let t=0,o="",a=i;while(a<e.length){let c=e[a];if(o){if(c==="\\")a++;else if(c===o)o=""}else if(c==='"'||c==="'"||c==="`")o=c;else if(c==="{")t++;else if(c==="}"){if(t--,t===0)return e.slice(i,a+1)}a++}return e.slice(i)}function Ut(e){let i=e.trim();if(!i.startsWith("{")||!i.endsWith("}"))return null;if(De(i,0).length!==i.length)return null;return i.slice(1,-1).trim()}function Ft(e){let i=[],t=0,o=e.length;while(t<o){while(t<o&&/\s/.test(e[t]))t++;if(t>=o)break;let a="";while(t<o&&!/[\s=]/.test(e[t]))a+=e[t],t++;if(!a)break;while(t<o&&/\s/.test(e[t]))t++;if(t<o&&e[t]==="="){t++;while(t<o&&/\s/.test(e[t]))t++;let c="";if(t<o&&(e[t]==='"'||e[t]==="'")){let l=e[t];t++;while(t<o&&e[t]!==l){if(e[t]==="\\"&&t+1<o)t++,c+=e[t];else c+=e[t];t++}if(t<o)t++}else if(e[t]==="{")c=De(e,t),t+=c.length;else while(t<o&&!/\s/.test(e[t]))c+=e[t],t++;i.push({name:a,value:c})}else i.push({name:a,value:!0})}return i}var Un=new Set(["disabled","checked","readonly","required","autofocus","autoplay","controls","default","defer","formnovalidate","hidden","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","reversed","selected"]),Fn=new Set([":for","x-for","v-for","@for"]),Wn=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function Hn(e){return ut(e).map((i)=>[i.start,i.end])}function ut(e){let i=[],t=new Map;for(let o of gn(e)){let a=o.name.toLowerCase();if(o.closing){let v=t.get(a)?.pop();if(v)v.end=o.end;continue}let l=/(?::for|x-for|v-for|@for)\s*=/.test(o.attributes)?Ft(o.attributes).find((v)=>Fn.has(v.name)):void 0,u=typeof l?.value==="string"?l.value:null,m=u!==null?{start:o.start,end:o.end,names:Y(u)}:null;if(m)i.push(m);if(!o.selfClosing&&!Wn.has(a)){let v=t.get(a);if(!v)v=[],t.set(a,v);v.push(m)}}return i}function Wt(e){if(typeof e==="string")return e;if(Array.isArray(e))return e.filter(Boolean).map((i)=>Wt(i)).join(" ");if(e&&typeof e==="object")return Object.entries(e).filter(([,i])=>i).map(([i])=>i).join(" ");return e?String(e):""}function uc(e,i){if(!/:[\w-]+=/.test(e))return e;let t=e,o=/<(script|style)\b[^>]*>[\s\S]*?<\/\1>/gi,a=[],c;while((c=o.exec(e))!==null)a.push([c.index,c.index+c[0].length]);a.push(...Hn(e));let l=new Set([...st(i),...Array.isArray(i.__stx_client_declared_names)?i.__stx_client_declared_names:[]]);function u(h){return a.some(([C,x])=>h>=C&&h<x)}let m=[],v=new Map,y=256;for(let h of gn(t)){if(h.closing||u(h.start))continue;let C=h.attributes.trimEnd();if(!C||!C.includes(":"))continue;let x=/(?:^|\s)data-native(?:\s|=|$)/i.test(C.replace(/"[^"]*"|'[^']*'/g,"")),S=/\s:([a-zA-Z_][\w-]*)\s*=\s*"([^"]*)"/g,b,w=C,A=!1;while((b=S.exec(C))!==null){if(kr(C,b.index,!0)?.kind==="attribute")continue;let k=b[1],R=b[2];if(hl(k))continue;if(N(R,l))continue;if(R.includes("()")&&!R.includes(".get(")||R.includes("$store")||R.includes("$ref"))continue;try{let B=Object.keys(i),G=Object.values(i),M=R.match(/^([a-zA-Z_$][\w$]*)/);if(M&&!B.includes(M[1])&&!["true","false","null","undefined","Math","JSON","String","Number","Array","Object","Date","parseInt","parseFloat"].includes(M[1]))continue;let F=JSON.stringify([B,R]),H=v.get(F);if(!H){if(H=Function(...B,`return (${R})`),v.size>=y)v.clear();v.set(F,H)}let E=H(...G);if(k==="class"){let D=W(Wt(E));if(D){let O=w.match(/\sclass="([^"]*)"/);if(O)w=w.replace(O[0],()=>` class="${O[1]} ${D}"`);else w=w.replace(b[0],()=>` class="${D}"`)}else w=w.replace(b[0],"");A=!0;continue}if(Un.has(k)){if(E)w=w.replace(b[0],` ${k}`);else w=w.replace(b[0],"");A=!0;continue}if(E===null||E===void 0||E===!1)w=w.replace(b[0],"");else{let D=x&&typeof E==="object"?JSON.stringify(E):String(E),O=Sn(k,D);w=w.replace(b[0],()=>` ${k}="${O}"`)}A=!0}catch(B){if(B instanceof ie)throw B;continue}}if(A){let k=h.selfClosing?" /":"",B=`<${h.name}${w}${k}>`;m.push({start:h.start,end:h.end,replacement:B})}}if(m.length>0){let h=Array(m.length*2+1),C=0;for(let x=0;x<m.length;x++){let{start:S,end:b,replacement:w}=m[x];h[x*2]=t.slice(C,S),h[x*2+1]=w,C=b}h[m.length*2]=t.slice(C),t=h.join("")}return t}import Ht from"fs";import qt from"path";var Xt=!1;function qn(e,i,t,o=!1,a=new Set){let c={static:{},staticNames:{},serverDynamic:{},serverDynamicNames:{},clientReactive:{},events:{}},l=new Set(Array.isArray(i.__stx_client_signal_names)?i.__stx_client_signal_names:[]),u=(h)=>{if(l.size===0)return!1;let C=s(h),x=C.match(/^\s*[!+~(-]*\s*([a-zA-Z_$][\w$]*)/)?.[1];if(x&&l.has(x))return!0;for(let S of l){let b=S.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");if(new RegExp(`(?:^|[^\\w$.])${b}\\s*\\(`).test(C))return!0}return!1},m=new Set(yl),v=(h)=>{if(!h.includes("-")||h.startsWith("@")||h.startsWith(":")||h.startsWith("x-")||h.startsWith("__"))return h;if(h.startsWith("aria-")||h.startsWith("data-"))return h;return h.replace(/-([a-z0-9])/g,(C,x)=>x.toUpperCase())},y=(h,C)=>{let x=v(h);if(c.static[x]=C,x!==h)c.staticNames[x]=h};for(let[h,C]of Object.entries(e)){let x=h.startsWith("x-")&&!m.has(h)&&!h.startsWith("x-bind:")&&!h.startsWith("x-on:")?`:${h.slice(2)}`:h;if(x.startsWith("@")){c.events[x]=C;continue}if(x.startsWith("__stx_")){let S=v(x.slice(6));c.serverDynamic[S]=zt(C,t);continue}if(x.startsWith(":")){let S=v(x.slice(1)),b=C===re?S:C;if(S==="if"||S==="for"||S==="show"){c.clientReactive[S]=b;continue}if(o){c.clientReactive[S]=b;continue}if(N(b,a)){c.clientReactive[S]=b;continue}if(u(b)){c.clientReactive[S]=b;continue}try{if(!f(b)){if(t.debug)console.error(`Unsafe expression in :${S} binding: ${b}`);c.clientReactive[S]=b;continue}let w=Object.keys(i),A=new Set(["true","false","null","undefined","typeof","instanceof","in","of","new","this","return","void","delete","throw","if","else"]),k=new Set(Array.isArray(i.__stx_client_declared_names)?i.__stx_client_declared_names:[]);if(ot(b).some((M)=>!A.has(M)&&!w.includes(M)&&(!(M in globalThis)||k.has(M)))){c.clientReactive[S]=b;continue}let G=d(b,w)(...Object.values(i));if(c.serverDynamic[S]=G,S!==x.slice(1)&&c.serverDynamicNames)c.serverDynamicNames[S]=x.slice(1)}catch{c.clientReactive[S]=b}continue}if(typeof C==="string"&&C.includes("{{")&&C.includes("}}")){let S=Xn(C,a);if(S!==null){c.clientReactive[v(x)]=S;continue}let b=C.match(/^\{\{\s*([\s\S]+?)\s*\}\}$/);if(b)try{let w=b[1];if(f(w)){let k=d(w,Object.keys(i))(...Object.values(i));y(x,k!=null?String(k):"")}else{if(t.debug)console.error(`Unsafe expression in ${x}: ${w}`);y(x,C)}}catch(w){if(t.debug)console.error(`Error evaluating expression for ${x}:`,w);y(x,C)}else{let w=C,A=/\{\{\s*([\s\S]+?)\s*\}\}/g,k;while((k=A.exec(C))!==null)try{let R=k[1];if(!f(R)){if(t.debug)console.error(`Unsafe expression in ${x}: ${R}`);continue}let G=d(R,Object.keys(i))(...Object.values(i));w=w.replace(k[0],String(G??""))}catch(R){if(t.debug)console.error(`Error evaluating expression in ${x}:`,R)}y(x,w)}continue}y(x,C===re?"true":lt(C))}return c}function Xn(e,i){if(i.size===0)return null;let t=/\{\{\s*([\s\S]+?)\s*\}\}/g,o=[...e.matchAll(t)];if(!o.some((u)=>N(u[1],i)))return null;let a=e.match(/^\{\{\s*([\s\S]+?)\s*\}\}$/);if(a&&o.length===1)return a[1];let c="",l=0;for(let u of o)c+=e.slice(l,u.index).replace(/[`\\$]/g,(m)=>`\\${m}`),c+=`\${${u[1]}}`,l=u.index+u[0].length;return c+=e.slice(l).replace(/[`\\$]/g,(u)=>`\\${u}`),`\`${c}\``}var Vn=[[/@if\s*\(/,"@endif"],[/@unless\s*\(/,"@endunless"]];function Zn(e,i,t){if(!e.includes("@"))return e;if(!Vn.some(([a,c])=>a.test(e)&&e.includes(c)))return e;try{return oe(e,i,t)}catch{return e}}function he(e){let i={},t=0,o=e.length;while(t<o){while(t<o&&/\s/.test(e[t]))t++;if(t>=o)break;let a="";while(t<o&&!/[\s=]/.test(e[t]))a+=e[t],t++;if(!a)break;while(t<o&&/\s/.test(e[t]))t++;if(t<o&&e[t]==="="){t++;while(t<o&&/\s/.test(e[t]))t++;let c="";if(t<o&&(e[t]==='"'||e[t]==="'")){let l=e[t];t++;while(t<o){let u=e[t];if(u==="\\"&&t+1<o){t++,c+=e[t],t++;continue}if(u===l){t++;break}c+=u,t++}}else if(e[t]==="{"){c=De(e,t),t+=c.length;let l=Ut(c);if(l!==null){i[`:${a}`]=l;continue}}else while(t<o&&!/\s/.test(e[t]))c+=e[t],t++;i[a]=c}else i[a]=re}return i}function Vt(e){return Object.entries(e).map(([i,t])=>t===re?i:`${i}="${Gn(t)}"`).join(" ")}function Gn(e){return e.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}function Kn(e){let i=new Set,t=/<([A-Z][A-Za-z0-9]*|stx-[a-z0-9-]+)\b[^>]*>/g,o;while((o=t.exec(e))!==null){let a=o[1];if(de.isBuiltin(a))i.add(a)}return[...i].sort()}async function Df(e,i,t,o,a){if(!/import\s/.test(e))return e;if(!i.__importedComponents)i.__importedComponents=new Map;let c=i.__importedComponents,l=qt.dirname(t),u=[],m=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi;for(let h of e.matchAll(m)){let[C,x,S]=h,b=/import\s+(?:(\{[^}]*\})|([A-Za-z_$][\w$]*))\s+from\s+['"]([^'"]+)['"]\s*;?\s*\n?/g,w=S,A,k=[];while((A=b.exec(S))!==null){let[R,B,G,M]=A,F=null,H=null;if(M.startsWith(".")||M.startsWith("/")){let O=qt.resolve(l,M);if(O.endsWith(".stx"))H=O;else{let q=`${O}.stx`;try{if(Ht.statSync(q).isFile())H=q}catch{try{if(Ht.statSync(O).isDirectory())F=O}catch{}}}}else F=Ms(M,l);if(!F&&!H)continue;let E=!1,D=(O,q)=>{c.set(O,q),c.set(O.toLowerCase(),q);let z=O.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();c.set(z,q),a.add(q)};if(G&&H)D(G,H),E=!0;else if(B){let O=B.slice(1,-1).split(",").map((z)=>z.trim()).filter(Boolean).map((z)=>{let X=z.match(/^([A-Za-z_$][\w$]*)\s+as\s+([A-Za-z_$][\w$]*)$/);if(X)return{source:X[1],local:X[2]};return{source:z,local:z}}),q=F?wr(F):null;for(let{source:z,local:X}of O){let L=null;if(H)L=H;else if(q)L=q.get(z)??q.get(z.toLowerCase())??q.get(z.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase())??null;if(L)D(X,L),E=!0}}if(E)k.push({start:A.index,end:A.index+R.length})}if(k.length===0)continue;for(let R=k.length-1;R>=0;R--)w=w.slice(0,k[R].start)+w.slice(k[R].end);u.push({start:h.index,end:h.index+C.length,value:`<script${x}>${w}</script>`})}if(u.length===0)return e;let v=[],y=0;for(let h of u)v.push(e.slice(y,h.start),h.value),y=h.end;return v.push(e.slice(y)),v.join("")}async function Jn(e,i,t,o,a){let c=e;if(!i.__importedComponents)i.__importedComponents=new Map;let l=i.__importedComponents,u=/@import\s*\(\s*([^)]+)\s*\)/g,m;while((m=u.exec(c))!==null){let[v,y]=m,h=y.split(",").map((C)=>C.trim().replace(/^['"]|['"]$/g,"")).filter((C)=>C.length>0);for(let C of h){let x=C.split("/"),b=x[x.length-1].replace(/\.stx$/,""),w=b.includes("-")?b.split("-").map((R)=>R.charAt(0).toUpperCase()+R.slice(1)).join(""):b.charAt(0).toUpperCase()+b.slice(1),A=null,k=Ds(C,t,o);for(let R of k)try{if(await Bun.file(R).exists()){A=R;break}}catch{}if(A){l.set(w,A),l.set(b,A),l.set(b.toLowerCase(),A);let R=w.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();if(l.set(R,A),a.add(A),o.debug)console.log(`Imported component: ${w} -> ${A}`)}else if(o.debug)console.warn(`Could not resolve imported component: ${C}`)}c=c.replace(v,""),u.lastIndex=0}return c}async function Yn(e,i,t,o,a){let c=e,l=o.componentsDir||"components";if(!i.__processedComponents)i.__processedComponents=new Set;let u=i.__processedComponents,m=/@component\s*\(/g,v;while((v=m.exec(c))!==null){let y=v.index,h=y+v[0].length-1,C=1,x=h+1;while(x<c.length&&C>0){if(c[x]==="(")C++;else if(c[x]===")"){if(C--,C===0)break}x++}if(C!==0)break;let S=c.substring(h+1,x),b=x+1,w=S.match(/^\s*['"]([^'"]+)['"]/);if(!w){m.lastIndex=b;continue}let A=w[1],k,R=S.slice(w[0].length),B=R.match(/^\s*,\s*/);if(B)k=R.slice(B[0].length).trim();let G={};if(k)try{G=P(k,i)}catch(O){let q=O instanceof Error?O.message:String(O);c=c.replace(c.substring(y,b),`[Error parsing component props: ${q}]`);continue}let M="",F=b,E=c.substring(b).match(/^([\s\S]*?)@endcomponent/);if(E)M=E[1].trim(),F=b+E[0].length;let D=await ze(A,G,M,l,i,t,o,u,a);c=c.substring(0,y)+D+c.substring(F),m.lastIndex=0}return c}async function Qn(e,i,t,o,a){if(!e)return e;let c=e,l=o.componentsDir||"components";if(!i.__processedComponents)i.__processedComponents=new Set;let u=i.__processedComponents,m=nr(c);if(m.size>0){let b=Array.isArray(i.__stx_client_declared_names)?i.__stx_client_declared_names:[];i.__stx_client_declared_names=[...new Set([...b,...m])]}let v=J(c);c=v.output;let y=st(i);return c=await S(c,/[a-z][a-z0-9]*-[a-z0-9-]*/,!1),c=await S(c,/[A-Z][a-zA-Z0-9]*/,!0,Mt(_r)),c=await S(c,/[a-z][a-z0-9]*/,!1,_r),c=v.restore(c),c;async function S(b,w,A,k){if(!b)return b;let R=b,B=Lt(R,w,k),G=ut(R),M=new Map;for(let E=B.length-1;E>=0;E--){let D=B[E],O=A?U(D.tagName):D.tagName,q=he(Zn(D.attributes,i,t)),z=G.filter(({start:I,end:_})=>D.startIndex>=I&&D.startIndex<_),X=z.length>0,L=new Set(y);for(let I of z)for(let _ of I.names)L.add(_);let T=qn(q,i,o,X,L);if(typeof T.clientReactive.for==="string")for(let I of Y(T.clientReactive.for))L.add(I);let ce=de.getBuiltin(D.tagName),$e=ce?await Tr(D.tagName,l,i,t,o):!1,K=D.tagName==="Image"&&Ls([...Object.keys(T.static),...Object.keys(T.serverDynamic),...Object.keys(T.clientReactive)],Object.keys(T.events),{...T.static,...T.serverDynamic})&&(o._pluginComponentDirs??[]).some((I)=>wr(I).has("Image"));if(ce&&!$e&&!K){let I={context:i,filePath:t,options:o,dependencies:a},_=ce.render(T,D.content,I);if(Object.keys(T.events).length>0){let ee=Vt(T.events);_=_.replace(/^(\s*<[a-zA-Z][a-zA-Z0-9-]*)/,`$1 ${ee}`)}if(Object.keys(T.clientReactive).length>0)_=Zt(_,T.clientReactive);M.set(E,_);continue}if(!A&&D.tagName.includes("-")&&!await Tr(O,l,i,t,o))continue;let le={};for(let[I,_]of Object.entries(T.static))le[I]=_;for(let[I,_]of Object.entries(T.serverDynamic))le[I]=_;let te={declaredProps:new Set,consumedProps:new Set,reactiveProps:Object.keys(T.clientReactive),events:Object.keys(T.events)},j=await ze(O,le,v.restore(D.content),l,i,t,o,u,a,[...L],te,D.tagName);if(j=er(j,T,te.declaredProps,te.consumedProps,o._nativeHostAttrs),o._nativeHostAttrs){let I=te.reactiveProps.filter((ne)=>!te.consumedProps.has(ne)&&!["if","for","show","key","ref"].includes(ne)).map(U),_=ft(j,!0);if(I.length&&_){if(!Object.hasOwn(he(j.slice(_.insertPos,_.tagEnd)),"data-stx-native-host-root"))j=j.slice(0,_.insertPos)+' data-stx-native-host-root="true"'+j.slice(_.insertPos);let ne=we(j);j=j.slice(0,ne.insertPos)+` data-stx-native-forward="${I.join(" ")}"`+j.slice(ne.insertPos)}let ee=ft(j,!0);if(ee){let ne=he(j.slice(ee.insertPos,ee.tagEnd)),Se=we(j),Kt=he(j.slice(Se.insertPos,Se.tagEnd));if(Object.hasOwn(ne,"data-stx-native-host-root")&&!Object.hasOwn(Kt,"data-stx-native-host-owner"))j=j.slice(0,Se.insertPos)+" data-stx-native-host-owner"+j.slice(Se.insertPos)}}if(Object.keys(T.events).length>0){let I=we(j);if(I){let _=Vt(T.events),ee=Object.keys(T.events).map((ne)=>ne.replace(/^@/,"").split(".")[0]).join(" ");j=j.substring(0,I.insertPos)+` data-stx-parent-events="${ee}" ${_}`+j.substring(I.insertPos)}}if(Object.keys(T.clientReactive).length>0)j=Zt(j,T.clientReactive);M.set(E,j)}if(M.size===0)return R;let F="",H=0;for(let E=0;E<B.length;E++){let D=M.get(E);if(D===void 0)continue;F+=R.slice(H,B[E].startIndex),F+=D,H=B[E].endIndex}return F+=R.slice(H),F}}function Zt(e,i){let t=new Set(["if","for"]),o=new Set(["show"]),a=Object.entries(i).filter(([y])=>!t.has(y)),c=a.filter(([y])=>!o.has(y)).map(([y])=>U(y)).join(" "),l=e,u=a.length>0?we(l):null;if(u){let y=a.map(([C,x])=>`:${U(C)}="${x.replace(/"/g,""")}"`).join(" "),h=c?` data-stx-parent-bindings="${c}"`:"";l=l.substring(0,u.insertPos)+`${h} ${y}`+l.substring(u.insertPos)}let m=i.if;if(m)l=`<template :if="${m.replace(/"/g,""")}">${l}</template>`;let v=i.for;if(v){let y=i.key,h=y?` :key="${y.replace(/"/g,""")}"`:"";l=`<template :for="${v.replace(/"/g,""")}"${h}>${l}</template>`}return l}function er(e,i,t=new Set,o=new Set,a=!1){let c=ft(e,a);if(!c)return e;let l=e.slice(c.insertPos,c.tagEnd),u=i.serverDynamic.class??i.static.class;if(a&&typeof u==="string"&&u&&!o.has("class")){let S=/(^|\s)class\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s>]+))/i,b=S.test(l)?l.replace(S,(w,A,k,R,B)=>`${A}class="${n(`${lt(k??R??B)} ${u}`)}"`):` class="${n(u)}"${l}`;e=e.slice(0,c.insertPos)+b+e.slice(c.tagEnd),c.tagEnd+=b.length-l.length,l=b}let m=a||/\bdata-native(?:\s|=)/i.test(l),v=m?o:t,y=new Set(Object.keys(he(l))),h=new Set(["class","className"]);for(let S of Object.keys(i.static)){let b=i.staticNames[S]??S;if(y.has(b)||v.has(S)||!m&&!qe(b))h.add(S)}for(let S of Object.keys(i.serverDynamic)){let b=i.serverDynamicNames?.[S]??S;if(y.has(b)||v.has(S)||!m&&!qe(b))h.add(S)}let C=[];if(m){for(let[S,b]of Object.entries(i.static)){if(h.has(S)||b!==!0&&b!==re)continue;h.add(S),C.push(`${n(i.staticNames?.[S]??S)}="true"`)}for(let[S,b]of Object.entries(i.serverDynamic)){if(h.has(S)||b!==!0)continue;h.add(S),C.push(`${n(i.serverDynamicNames?.[S]??S)}="true"`)}}let x=[...se(i,h),...ae(i,h),...C];if(m){for(let[S,b]of Object.entries(i.serverDynamic)){if(h.has(S)||b!==!1)continue;let w=i.serverDynamicNames?.[S]??S;x.push(`${n(w)}="false"`)}for(let[S,b]of Object.entries(i.serverDynamic)){if(h.has(S)||b===null||typeof b!=="object")continue;let w=JSON.stringify(b);if(w!==void 0){let A=i.serverDynamicNames?.[S]??S;x.push(`${n(A)}="${n(w)}"`)}}}if(x.length===0)return e;return`${e.slice(0,c.insertPos)} ${x.join(" ")}${e.slice(c.insertPos)}`}function we(e){let i=Gt(e,0);if(i)return i;let t=/<([a-zA-Z][a-zA-Z0-9-]*)\b[^>]*\bdata-stx-scope(?:\s|=|>)/i.exec(e);if(t)return{insertPos:t.index+1+t[1].length,tagEnd:dt(e,t.index+1+t[1].length)};return null}function ft(e,i=!1){let t=we(e);if(!t)return null;let o=e.slice(t.insertPos,t.tagEnd),a=/\bdata-stx-component-wrapper(?:\s|=|>|$)/i.test(o)?Gt(e,t.tagEnd+1):t;return a&&i?tr(e,a)??a:a}function tr(e,i){if(!e.includes("data-stx-native-host-root"))return null;let t=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),o=e.lastIndexOf("<",i.insertPos),a=0,c;while(o>=0&&o<e.length){if(e.startsWith("<!--",o)){let y=e.indexOf("-->",o+4);if(y<0)return null;o=e.indexOf("<",y+3);continue}let l=/^<(\/?)([a-z][\w-]*)\b/i.exec(e.slice(o));if(!l){o=e.indexOf("<",o+1);continue}let u=l[2].toLowerCase(),m=o+l[0].length,v=dt(e,m);if(l[1]){if(a--,c!==void 0&&a<c)c=void 0;if(a<=0)return null}else if(u==="script"||u==="style"){let y=new RegExp(`</${u}\\s*>`,"gi");if(y.lastIndex=v+1,!y.exec(e))return null;o=e.indexOf("<",y.lastIndex);continue}else{let y=he(e.slice(m,v)),h=a>0&&(Object.hasOwn(y,"data-stx-component-wrapper")||Object.hasOwn(y,"data-stx-native-host-owner"));if(c===void 0&&!h&&Object.hasOwn(y,"data-stx-native-host-root"))return{insertPos:m,tagEnd:v};if(!t.has(u)&&e[v-1]!=="/"){if(a++,c===void 0&&h)c=a}else if(a===0)return null}o=e.indexOf("<",v+1)}return null}function Gt(e,i){let t=i;while(t<e.length){let o=e.slice(t),a=o.match(/^\s+/);if(a){t+=a[0].length;continue}if(o.startsWith("<!--")){let u=e.indexOf("-->",t+4);if(u===-1)return null;t=u+3;continue}let c=o.match(/^<(script|style)\b[^>]*>/i);if(c){let u=`</${c[1].toLowerCase()}>`,m=e.toLowerCase().indexOf(u,t+c[0].length);if(m===-1)return null;t=m+u.length;continue}let l=o.match(/^<([a-zA-Z][a-zA-Z0-9-]*)(?:\s|>|\/)/);if(!l)return null;return{insertPos:t+1+l[1].length,tagEnd:dt(e,t+1+l[1].length)}}return null}function dt(e,i){let t="";for(let o=i;o<e.length;o++){let a=e[o];if(t){if(a==="\\")o++;else if(a===t)t=""}else if(a==='"'||a==="'")t=a;else if(a===">")return o}return e.length}function nr(e){let i=new Set;for(let t of e.matchAll(/<script\b([^>]*)>([\s\S]*?)<\/script>/gi)){let o=t[1];if(!/\bclient\b/.test(o)||/\bserver\b/.test(o))continue;for(let a of pi(t[2]))i.add(a);for(let a of t[2].matchAll(/^\s*import\s+(?:type\s+)?(?:([\w$]+)\s*,?\s*)?(?:\{([^}]*)\}|\*\s+as\s+([\w$]+))?\s*from\s/gm)){if(a[1])i.add(a[1]);if(a[3])i.add(a[3]);for(let c of(a[2]??"").split(",")){let l=c.replace(/^\s*type\s+/,"").split(/\s+as\s+/).pop().trim();if(/^[A-Za-z_$][\w$]*$/.test(l))i.add(l)}}}return i}async function ps(e,i,t,o,a){if(!Xt)Dt(de),Xt=!0;let c=await Df(e,i,t,o,a);c=await Jn(c,i,t,o,a),c=await Yn(c,i,t,o,a);let l=[];for(let u=0;u<3;u++){let m=l.length,v=fe(c,Me,(h,C)=>`\x00STX_COMPONENT_COMMENT_${m+C}\x00`,`STX_COMPONENT_COMMENT:${m}`);l.push(...v.tokens);let y=c;if(c=await Qn(v.output,i,t,o,a),c===y)break}if(l.length>0)c=c.replace(/\x00STX_COMPONENT_COMMENT_(\d+)\x00/g,(u,m)=>l[Number(m)]??"");if(o.debug){let u=Kn(c);if(u.length>0)console.warn(`[stx] ${t}: unresolved component tag(s) after render passes: ${u.join(", ")}. Check nested component output for malformed root tags or recursive component markup.`)}return c}
|
|
42
|
+
export{Bo,Fo,zo,Mh,ds,Dh,uc,Df,ps};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import o from"fs";import u from"path";var h={".html":"includeHtml",".htm":"includeHtml",".js":"includeJs",".mjs":"includeJs",".css":"includeCss",".png":"includeImages",".jpg":"includeImages",".jpeg":"includeImages",".gif":"includeImages",".webp":"includeImages",".svg":"includeImages",".ico":"includeImages",".woff":"includeFonts",".woff2":"includeFonts",".ttf":"includeFonts",".eot":"includeFonts",".otf":"includeFonts"};function p(e){let r=0;for(let t=0;t<e.length;t++){let n=e[t];r=(r<<5)-r+n,r=r&r}return Math.abs(r).toString(16).padStart(8,"0")}function x(e,r){let t=u.basename(e);for(let n of r)if(n.startsWith("*.")){let i=n.slice(1);if(t.endsWith(i))return!0}else if(n.includes("*")){let i=new RegExp(`^${n.replace(/\*/g,".*")}$`);if(i.test(t)||i.test(e))return!0}else if(t===n||e.includes(n))return!0;return!1}function S(e,r,t){let n=u.extname(e).toLowerCase(),i=h[n],c=(t.maxFileSizeKB||500)*1024;if(r>c)return!1;if(t.exclude&&x(e,t.exclude))return!1;if(t.include&&t.include.length>0){for(let s of t.include)if(s.startsWith("*.")){if(e.endsWith(s.slice(1)))return!0}else if(e.includes(s))return!0}if(i&&t[i]===!0)return!0;if(!i)return!1;return!1}function f(e,r,t,n){let i=o.readdirSync(e,{withFileTypes:!0});for(let c of i){let s=u.join(e,c.name);if(c.isDirectory()){if(["node_modules",".git",".stx"].includes(c.name))continue;f(s,r,t,n)}else if(c.isFile()){let a=o.statSync(s),l=u.relative(r,s);if(S(l,a.size,t)){let d=o.readFileSync(s),g=p(d),m=`/${l.replace(/\\/g,"/")}`;n.push({url:m,revision:g,size:a.size})}}}}function We(e,r){let t=r.pwa?.precache,n=[];if(!t?.enabled)return{entries:[],totalSize:0,fileCount:0};if(!o.existsSync(e))return{entries:[],totalSize:0,fileCount:0};f(e,e,t,n),n.sort((c,s)=>c.url.localeCompare(s.url));let i=n.reduce((c,s)=>c+s.size,0);return{entries:n,totalSize:i,fileCount:n.length}}function
|
|
2
|
+
import o from"fs";import u from"path";var h={".html":"includeHtml",".htm":"includeHtml",".js":"includeJs",".mjs":"includeJs",".css":"includeCss",".png":"includeImages",".jpg":"includeImages",".jpeg":"includeImages",".gif":"includeImages",".webp":"includeImages",".svg":"includeImages",".ico":"includeImages",".woff":"includeFonts",".woff2":"includeFonts",".ttf":"includeFonts",".eot":"includeFonts",".otf":"includeFonts"};function p(e){let r=0;for(let t=0;t<e.length;t++){let n=e[t];r=(r<<5)-r+n,r=r&r}return Math.abs(r).toString(16).padStart(8,"0")}function x(e,r){let t=u.basename(e);for(let n of r)if(n.startsWith("*.")){let i=n.slice(1);if(t.endsWith(i))return!0}else if(n.includes("*")){let i=new RegExp(`^${n.replace(/\*/g,".*")}$`);if(i.test(t)||i.test(e))return!0}else if(t===n||e.includes(n))return!0;return!1}function S(e,r,t){let n=u.extname(e).toLowerCase(),i=h[n],c=(t.maxFileSizeKB||500)*1024;if(r>c)return!1;if(t.exclude&&x(e,t.exclude))return!1;if(t.include&&t.include.length>0){for(let s of t.include)if(s.startsWith("*.")){if(e.endsWith(s.slice(1)))return!0}else if(e.includes(s))return!0}if(i&&t[i]===!0)return!0;if(!i)return!1;return!1}function f(e,r,t,n){let i=o.readdirSync(e,{withFileTypes:!0});for(let c of i){let s=u.join(e,c.name);if(c.isDirectory()){if(["node_modules",".git",".stx"].includes(c.name))continue;f(s,r,t,n)}else if(c.isFile()){let a=o.statSync(s),l=u.relative(r,s);if(S(l,a.size,t)){let d=o.readFileSync(s),g=p(d),m=`/${l.replace(/\\/g,"/")}`;n.push({url:m,revision:g,size:a.size})}}}}function We(e,r){let t=r.pwa?.precache,n=[];if(!t?.enabled)return{entries:[],totalSize:0,fileCount:0};if(!o.existsSync(e))return{entries:[],totalSize:0,fileCount:0};f(e,e,t,n),n.sort((c,s)=>c.url.localeCompare(s.url));let i=n.reduce((c,s)=>c+s.size,0);return{entries:n,totalSize:i,fileCount:n.length}}function An(e){if(e.entries.length===0)return"[]";return`[
|
|
3
3
|
${e.entries.map((t)=>` { url: '${t.url}', revision: '${t.revision}' }`).join(`,
|
|
4
4
|
`)}
|
|
5
|
-
]`}function
|
|
6
|
-
export{We,
|
|
5
|
+
]`}function Mi(e){if(e<1024)return`${e} B`;if(e<1048576)return`${(e/1024).toFixed(1)} KB`;return`${(e/1048576).toFixed(2)} MB`}
|
|
6
|
+
export{We,An,Mi};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{gs,Lf,Ho,jf}from"./chunk-4w3qpewn.js";import"./chunk-1b1ntgt7.js";import"./chunk-jzh0n2ct.js";import"./chunk-aekq1zyn.js";import"./chunk-2fj5zev7.js";import"./chunk-p83h2dbg.js";import"./chunk-efdfkfp1.js";import"./chunk-11y84h2d.js";import"./chunk-4657mnht.js";import"./chunk-zg44cf8a.js";import"./chunk-2j5yane9.js";import{It}from"./chunk-xvhxxj4g.js";import"./chunk-jjyt3tsv.js";import"./chunk-8370x30n.js";import"./chunk-89d3h8mp.js";import"./chunk-zjqvbcwa.js";import"./chunk-23r3rby6.js";export{jf as declareBareLoopHead,It as parseLoopBinding,Lf as processLoops,Ho as processLoopsAsync,gs as reportDeferredLoopWarnings};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Rl,Al}from"./chunk-v49rvx9y.js";import"./chunk-qk079ca7.js";import"./chunk-ynf16yz4.js";import"./chunk-nk7nxzxf.js";import"./chunk-8913k8g7.js";import"./chunk-ngnr831a.js";import"./chunk-g7rsd8st.js";import"./chunk-gpschnvk.js";import"./chunk-zyeg9t2t.js";import"./chunk-yn17484y.js";import"./chunk-v3q126ys.js";import"./chunk-q0s0kc66.js";import"./chunk-jc5y35b7.js";import"./chunk-r0ssa1xd.js";import"./chunk-bq7qcndg.js";import"./chunk-wbgc2n04.js";import"./chunk-1m16mvt4.js";import"./chunk-7t57cnz9.js";import"./chunk-t3p0jy0s.js";import"./chunk-t0jed809.js";import"./chunk-pqg6j26p.js";import"./chunk-8y3f5fyg.js";import"./chunk-mhyd24bg.js";import"./chunk-zvy88beh.js";import"./chunk-a9tzjqny.js";import"./chunk-4j08cbjd.js";import"./chunk-5hmm01av.js";import"./chunk-8q3pyq6a.js";import"./chunk-xbcnnk8x.js";import"./chunk-d1vkjxb1.js";import"./chunk-9xps62ek.js";import"./chunk-321e41ck.js";import{tn}from"./chunk-xx3reejx.js";import"./chunk-cw1ar3dq.js";import"./chunk-ksr6c2kh.js";import"./chunk-4y6hes3h.js";import{Ae,i}from"./chunk-1zfxmjrf.js";import"./chunk-31cnrpd1.js";import"./chunk-aza2zrhk.js";import"./chunk-4dxq7ft1.js";import"./chunk-rdn1d4bf.js";import"./chunk-n8a4jm0p.js";import"./chunk-4w3qpewn.js";import"./chunk-1b1ntgt7.js";import"./chunk-jzh0n2ct.js";import{ve}from"./chunk-aekq1zyn.js";import"./chunk-2fj5zev7.js";import{dr,pr}from"./chunk-mzj71r0m.js";import{ks,F,a}from"./chunk-p83h2dbg.js";import"./chunk-efdfkfp1.js";import"./chunk-11y84h2d.js";import"./chunk-4657mnht.js";import"./chunk-zg44cf8a.js";import"./chunk-2j5yane9.js";import{m,je}from"./chunk-xvhxxj4g.js";import"./chunk-jjyt3tsv.js";import"./chunk-8370x30n.js";import"./chunk-89d3h8mp.js";import"./chunk-zjqvbcwa.js";import"./chunk-23r3rby6.js";import"./chunk-p9d2txcg.js";import"./chunk-x110ssw2.js";export{ks as buildWebComponents,pr as cacheTemplate,dr as checkCache,tn as classifyAllScripts,Rl as createMiddleware,Al as createRoute,F as defaultConfig,m as extractVariables,ve as injectRouterScript,a as loadStxConfig,je as processClientScript,i as processDirectives,Ae as readMarkdownFile};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{cn,Io,Oo,No,Rh,Mo}from"./chunk-ksr6c2kh.js";import"./chunk-4657mnht.js";import"./chunk-2j5yane9.js";import"./chunk-8370x30n.js";export{Oo as buildServerApi,Rh as createServerApi,cn as discoverServerApi,Io as generateApiTypes,Mo as isServerApiSource,No as productionApiDispatcher};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{jm,xa,fu,Bm,Fm,zm,Hm,Vm,gu,mu,Um,Wm,qm,Km}from"./chunk-8y3f5fyg.js";import"./chunk-1zfxmjrf.js";import"./chunk-31cnrpd1.js";import"./chunk-aza2zrhk.js";import"./chunk-4dxq7ft1.js";import"./chunk-rdn1d4bf.js";import"./chunk-n8a4jm0p.js";import"./chunk-4w3qpewn.js";import"./chunk-1b1ntgt7.js";import"./chunk-jzh0n2ct.js";import"./chunk-aekq1zyn.js";import"./chunk-2fj5zev7.js";import"./chunk-mzj71r0m.js";import"./chunk-p83h2dbg.js";import"./chunk-efdfkfp1.js";import"./chunk-11y84h2d.js";import"./chunk-4657mnht.js";import"./chunk-zg44cf8a.js";import"./chunk-2j5yane9.js";import"./chunk-xvhxxj4g.js";import"./chunk-jjyt3tsv.js";import"./chunk-8370x30n.js";import"./chunk-89d3h8mp.js";import"./chunk-zjqvbcwa.js";import"./chunk-23r3rby6.js";export{fu as SUSPENSE_RESOLVER_RUNTIME,xa as buildSuspenseResolveScript,Vm as createStreamRenderer,zm as extractStreamBoundaries,Km as generateHydrationRuntime,mu as islandDirective,Wm as processSectionDirectives,Fm as processStreamDirectives,Um as registerStreamingDirectives,Bm as renderStreamingPage,jm as streamTemplate,Hm as streamTemplateSimple,qm as streamToResponse,gu as streamingSuspenseDirective};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{ca,nm,la,rm,Fl,zl,sm,om}from"./chunk-gpschnvk.js";import"./chunk-8q3pyq6a.js";import"./chunk-cw1ar3dq.js";import"./chunk-ksr6c2kh.js";import"./chunk-4y6hes3h.js";import"./chunk-jzh0n2ct.js";import"./chunk-aekq1zyn.js";import"./chunk-2fj5zev7.js";import"./chunk-p83h2dbg.js";import"./chunk-efdfkfp1.js";import"./chunk-11y84h2d.js";import"./chunk-4657mnht.js";import"./chunk-zg44cf8a.js";import"./chunk-2j5yane9.js";import{Ot,tg}from"./chunk-xvhxxj4g.js";import"./chunk-jjyt3tsv.js";import"./chunk-8370x30n.js";import"./chunk-89d3h8mp.js";import"./chunk-zjqvbcwa.js";import"./chunk-23r3rby6.js";export{ca as buildScriptVirtualFile,nm as buildVirtualSource,Ot as extractScriptBlocks,tg as extractTemplateExpressions,Fl as findRuntimeTypeDeclarations,zl as findStxModuleDeclarations,om as formatTypecheckDiagnostics,rm as sourcePathFor,sm as typecheckStxFiles,la as virtualPathFor};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Lh,ms,qo,hs,cr,Ko,Xo,Bf,ys,bs,ws,Go,dc,Ff,vt}from"./chunk-jzh0n2ct.js";import"./chunk-aekq1zyn.js";import"./chunk-2fj5zev7.js";import"./chunk-p83h2dbg.js";import"./chunk-efdfkfp1.js";import"./chunk-11y84h2d.js";import"./chunk-4657mnht.js";import"./chunk-zg44cf8a.js";import"./chunk-2j5yane9.js";import{V}from"./chunk-xvhxxj4g.js";import"./chunk-jjyt3tsv.js";import"./chunk-8370x30n.js";import"./chunk-89d3h8mp.js";import"./chunk-zjqvbcwa.js";import"./chunk-23r3rby6.js";export{Bf as bindLoopInterpolations,Lh as clearScriptScanCache,ys as convertServerLoopAttributesToDirectives,Ko as convertSignalDirectivesToAttributes,bs as convertSignalLoopsToAttributes,cr as extractClientSignalNames,V as extractExports,dc as findMarkupIndexOutsideScripts,hs as hasSignalsSyntax,qo as parseLoopExpression,Xo as preEvalLiteralReactiveIfs,ws as processScriptSetup,Go as processSignals,Ff as rewriteStxImportSpecifiers,ms as scanScriptTags,vt as stripStxRuntimeImports};
|
|
@@ -159,7 +159,7 @@ else {
|
|
|
159
159
|
stxIslands.initIslands();
|
|
160
160
|
}
|
|
161
161
|
})();
|
|
162
|
-
</script>`}function b(e){let t=e.match(/<([A-Z][a-zA-Z0-9]+)[\s/>]/);if(t)return t[1];let n=e.match(/<([a-z][a-z0-9]*-[a-z0-9-]+)[\s/>]/);if(n)return n[1];return null}function w(e,t){let n={},r=/:([a-zA-Z_][\w-]*)\s*=\s*"([^"]+)"/g,i;while((i=r.exec(e))!==null){let d=i[1],o=i[2];if(o in t)n[d]=t[o];else n[d]=o}return n}function
|
|
162
|
+
</script>`}function b(e){let t=e.match(/<([A-Z][a-zA-Z0-9]+)[\s/>]/);if(t)return t[1];let n=e.match(/<([a-z][a-z0-9]*-[a-z0-9-]+)[\s/>]/);if(n)return n[1];return null}function w(e,t){let n={},r=/:([a-zA-Z_][\w-]*)\s*=\s*"([^"]+)"/g,i;while((i=r.exec(e))!==null){let d=i[1],o=i[2];if(o in t)n[d]=t[o];else n[d]=o}return n}function Ql(){let e=new Map;return{islands:e,register(t){e.set(t.id,t)},get(t){return e.get(t)},async hydrate(t){let n=e.get(t);if(!n||n.hydrated)return;if(n.hydrated=!0,typeof window<"u"&&typeof window.dispatchEvent==="function")window.dispatchEvent(new CustomEvent("stx:hydrate",{detail:{id:t,component:n.component}}))},async hydrateAll(){let t=Array.from(e.values()).filter((n)=>!n.hydrated).map((n)=>this.hydrate(n.id));await Promise.all(t)}}}function I(e){return`
|
|
163
163
|
<script data-hydrate="${e}">
|
|
164
164
|
(function() {
|
|
165
165
|
const island = document.querySelector('[data-island="${e}"]');
|
|
@@ -311,7 +311,7 @@ else {
|
|
|
311
311
|
});
|
|
312
312
|
})();
|
|
313
313
|
</script>
|
|
314
|
-
`}function
|
|
314
|
+
`}function eu(e,t={},n){let r=e,i=!1,d=/@client:(load|idle|visible|media|only|hover|event)/i.test(e);if(r=u(r,"load",t),r=u(r,"idle",t),r=u(r,"visible",t),r=u(r,"media",t),r=M(r),r=u(r,"hover",t),r=u(r,"event",t),i=d&&r!==e,i)r+=`
|
|
315
315
|
`+v();return r}function u(e,t,n){let r=new RegExp(`@client:${t}(?:\\s*\\(([^)]*)\\))?\\s*([\\s\\S]*?)@endclient`,"gi");return e.replace(r,(i,d,o)=>{let a={strategy:t};if(d)try{let E=d.split(",").map((h)=>h.trim());for(let h of E){let[m,g]=h.split(":").map((p)=>p.trim());if(m&&g){let p=g.replace(/^['"]|['"]$/g,"");a[m]=p}}}catch{}let s=`island-${Math.random().toString(36).substring(2,9)}`,y=b(o.trim()),f=w(o.trim(),n),c=[];if(a.rootMargin)c.push(`data-root-margin="${a.rootMargin}"`);if(a.threshold!==void 0)c.push(`data-threshold="${a.threshold}"`);if(a.media)c.push(`data-media="${a.media}"`);if(a.event)c.push(`data-event="${a.event}"`);if(y)c.push(`data-component="${y}"`);let x=Object.keys(f).length>0?`
|
|
316
316
|
<script type="application/json" data-island-props="${s}">${JSON.stringify(f)}</script>`:"",l="";switch(t){case"load":l=I(s);break;case"idle":l=L(s,a);break;case"visible":l=C(s,a);break;case"media":l=S(s,a);break;case"hover":l=k(s);break;case"event":l=H(s,a);break}return`
|
|
317
317
|
<div data-island="${s}"
|
|
@@ -342,7 +342,7 @@ else {
|
|
|
342
342
|
}
|
|
343
343
|
})();
|
|
344
344
|
</script>
|
|
345
|
-
`})}function
|
|
345
|
+
`})}function tu(){return`
|
|
346
346
|
/* Island base styles */
|
|
347
347
|
.stx-island {
|
|
348
348
|
display: contents;
|
|
@@ -383,9 +383,9 @@ else {
|
|
|
383
383
|
.stx-island.hydrated {
|
|
384
384
|
opacity: 1;
|
|
385
385
|
}
|
|
386
|
-
`}function
|
|
386
|
+
`}function nu(e){if(typeof window>"u")return;let t=document.querySelector(`[data-island="${e}"]`);if(!t||t.classList.contains("hydrated"))return;t.classList.add("hydrated"),t.dispatchEvent(new CustomEvent("stx:hydrated",{bubbles:!0}))}function ru(e){if(typeof window>"u")return;document.querySelectorAll(`[data-strategy="${e}"]:not(.hydrated)`).forEach((n)=>{n.classList.add("hydrated"),n.dispatchEvent(new CustomEvent("stx:hydrated",{bubbles:!0}))})}function su(){if(typeof window>"u")return;document.querySelectorAll(".stx-island:not(.hydrated)").forEach((t)=>{t.classList.add("hydrated"),t.dispatchEvent(new CustomEvent("stx:hydrated",{bubbles:!0}))})}function ou(e){if(typeof window>"u")return!1;return document.querySelector(`[data-island="${e}"]`)?.classList.contains("hydrated")??!1}function iu(e){return new Promise((t)=>{if(typeof window>"u"){t();return}let n=document.querySelector(`[data-island="${e}"]`);if(!n){t();return}if(n.classList.contains("hydrated")){t();return}n.addEventListener("stx:hydrated",()=>t(),{once:!0})})}function au(e){return e.replace(/@static\s*([\s\S]*?)@endstatic/gi,(t,n)=>`<div class="stx-static">${n.trim()}</div>`)}function cu(e){let t=e.map((n)=>({id:n.id,component:n.component,strategy:n.options.strategy,props:n.props}));return`
|
|
387
387
|
<script type="application/json" id="stx-island-manifest">
|
|
388
388
|
${JSON.stringify(t)}
|
|
389
389
|
</script>
|
|
390
|
-
`}var
|
|
391
|
-
export{
|
|
390
|
+
`}var Mm={processPartialHydrationDirectives:eu,processStaticDirectives:au,generatePartialHydrationCSS:tu,generateIslandManifest:cu,createIslandRegistry:Ql,hydrateIsland:nu,hydrateByStrategy:ru,hydrateAll:su,isHydrated:ou,onHydrated:iu};
|
|
391
|
+
export{Ql,eu,tu,nu,ru,su,ou,iu,au,cu,Mm};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
function
|
|
2
|
+
function ba(v,c){let{itemHeight:l,containerHeight:u,overscan:s=3,keyProperty:b="id",dynamicHeight:d=!1,estimatedItemHeight:g=l,direction:x="vertical"}=c,e=[...v],t=0,n=new Map;function f(){if(d)return h();let i=Math.max(0,Math.floor(t/l)-s),r=Math.ceil(u/l),m=Math.min(e.length-1,i+r+s*2);return{startIndex:i,endIndex:m}}function h(){let i=0,r=0,m=e.length-1;for(let p=0;p<e.length;p++){let M=n.get(p)||g;if(i+M>t){r=Math.max(0,p-s);break}i+=M}i=0;for(let p=0;p<e.length;p++){let M=n.get(p)||g;if(i+=M,i>t+u){m=Math.min(e.length-1,p+s);break}}return{startIndex:r,endIndex:m}}function w(){if(d){let i=0;for(let r=0;r<e.length;r++)i+=n.get(r)||g;return i}return e.length*l}function y(i){if(d){let r=0;for(let m=0;m<i;m++)r+=n.get(m)||g;return r}return i*l}function S(){let{startIndex:i,endIndex:r}=f();return{startIndex:i,endIndex:r,scrollTop:t,totalHeight:w(),visibleItems:e.slice(i,r+1),itemHeights:new Map(n)}}function L(i,r="auto"){let m=y(i);a(m,r)}function a(i,r="auto"){t=Math.max(0,Math.min(i,w()-u))}function o(){f()}function H(i){e=[...i],n.clear(),o()}function I(){e=[],n.clear()}return{scrollToIndex:L,scrollToOffset:a,getState:S,refresh:o,setItems:H,destroy:I}}function wa(v,c={},l){let u=/@virtualList\s*\(\s*([^,]+)\s*(?:,\s*(\{[^}]*\}))?\s*\)\s*([\s\S]*?)@endvirtualList/gi;return v.replace(u,(s,b,d,g)=>{let x=b.trim(),e=c[x];if(!e||!Array.isArray(e))return`<!-- virtualList: items "${x}" not found or not an array -->`;let t={itemHeight:50,containerHeight:400,overscan:3};if(d)try{let a=d.trim(),o=Function(`return ${a}`)();t={...t,...o}}catch{}let n=`vlist-${Math.random().toString(36).substring(2,9)}`,f=Math.ceil(t.containerHeight/t.itemHeight),h=t.overscan||3,w=0,y=Math.min(e.length-1,f+h),S="";for(let a=w;a<=y&&a<e.length;a++){let o=e[a],H=g.replace(/\{\{\s*item\s*\}\}/g,typeof o==="object"?JSON.stringify(o):String(o)).replace(/\{\{\s*item\.(\w+)\s*\}\}/g,(I,i)=>{if(typeof o==="object"&&o!==null)return String(o[i]??"");return""}).replace(/\{\{\s*index\s*\}\}/g,String(a));S+=`
|
|
3
3
|
<div class="virtual-item ${t.itemClass||""}"
|
|
4
4
|
style="position: absolute; top: ${a*t.itemHeight}px; height: ${t.itemHeight}px; width: 100%;"
|
|
5
5
|
data-index="${a}">
|
|
@@ -76,7 +76,7 @@ function ya(v,c){let{itemHeight:l,containerHeight:u,overscan:s=3,keyProperty:b="
|
|
|
76
76
|
};
|
|
77
77
|
})();
|
|
78
78
|
</script>
|
|
79
|
-
`})}function
|
|
79
|
+
`})}function Gl(){return`
|
|
80
80
|
.virtual-list-container {
|
|
81
81
|
position: relative;
|
|
82
82
|
overflow-y: auto;
|
|
@@ -124,7 +124,7 @@ function ya(v,c){let{itemHeight:l,containerHeight:u,overscan:s=3,keyProperty:b="
|
|
|
124
124
|
0% { background-position: 200% 0; }
|
|
125
125
|
100% { background-position: -200% 0; }
|
|
126
126
|
}
|
|
127
|
-
`}function
|
|
127
|
+
`}function Jl(v,c){let l=null,u=()=>{if(!l)l=ba(v(),c);return l};return{visibleItems:()=>u().getState().visibleItems,totalHeight:()=>u().getState().totalHeight,containerProps:()=>({style:{height:`${c.containerHeight}px`,overflow:"auto",position:"relative"},onScroll:(s)=>{let b=s.target;if(l)l.scrollToOffset(b.scrollTop)}}),itemProps:(s)=>({style:{position:"absolute",top:`${s*c.itemHeight}px`,height:`${c.itemHeight}px`,width:"100%"},"data-index":s}),scrollToIndex:(s)=>{u().scrollToIndex(s)}}}function Yl(v,c={},l){let u=/@infiniteList\s*\(\s*([^,]+)\s*(?:,\s*(\{[^}]*\}))?\s*\)\s*([\s\S]*?)@loading\s*([\s\S]*?)@endinfiniteList/gi;return v.replace(u,(s,b,d,g,x)=>{let e=b.trim(),t=c[e];if(!t||!Array.isArray(t))return`<!-- infiniteList: items "${e}" not found or not an array -->`;let n={itemHeight:50,containerHeight:400,overscan:3,threshold:100,hasMore:!0};if(d)try{let w=Function(`return ${d.trim()}`)();n={...n,...w}}catch{}let f=`ilist-${Math.random().toString(36).substring(2,9)}`,h=wa(`@virtualList(${e}, ${JSON.stringify({itemHeight:n.itemHeight,containerHeight:n.containerHeight,overscan:n.overscan,containerClass:n.containerClass})})${g}@endvirtualList`,c);return h=h.replace("</script>",`
|
|
128
128
|
// Infinite scroll detection
|
|
129
129
|
container.addEventListener('scroll', function() {
|
|
130
130
|
const scrollBottom = container.scrollTop + container.clientHeight;
|
|
@@ -142,7 +142,7 @@ function ya(v,c){let{itemHeight:l,containerHeight:u,overscan:s=3,keyProperty:b="
|
|
|
142
142
|
${x}
|
|
143
143
|
</div>
|
|
144
144
|
</div>
|
|
145
|
-
`})}function
|
|
145
|
+
`})}function Zl(v,c={},l){let u=/@virtualGrid\s*\(\s*([^,]+)\s*(?:,\s*(\{[^}]*\}))?\s*\)\s*([\s\S]*?)@endvirtualGrid/gi;return v.replace(u,(s,b,d,g)=>{let x=b.trim(),e=c[x];if(!e||!Array.isArray(e))return`<!-- virtualGrid: items "${x}" not found or not an array -->`;let t={columns:3,rowHeight:100,containerHeight:400,gap:10,overscan:2};if(d)try{let o=Function(`return ${d.trim()}`)();t={...t,...o}}catch{}let n=`vgrid-${Math.random().toString(36).substring(2,9)}`,f=Math.ceil(e.length/t.columns),h=f*(t.rowHeight+(t.gap||0)),w=Math.ceil(t.containerHeight/(t.rowHeight+(t.gap||0))),y=t.overscan||2,S=0,L=Math.min(f-1,w+y),a="";for(let o=S;o<=L;o++)for(let H=0;H<t.columns;H++){let I=o*t.columns+H;if(I>=e.length)break;let i=e[I],r=H*(100/t.columns),m=o*(t.rowHeight+(t.gap||0)),p=g.replace(/\{\{\s*item\s*\}\}/g,typeof i==="object"?JSON.stringify(i):String(i)).replace(/\{\{\s*item\.(\w+)\s*\}\}/g,(M,T)=>{if(typeof i==="object"&&i!==null)return String(i[T]??"");return""}).replace(/\{\{\s*index\s*\}\}/g,String(I));a+=`
|
|
146
146
|
<div class="virtual-grid-item"
|
|
147
147
|
style="position: absolute; top: ${m}px; left: ${r}%; width: calc(${100/t.columns}% - ${t.gap||0}px); height: ${t.rowHeight}px;"
|
|
148
148
|
data-index="${I}">
|
|
@@ -212,5 +212,5 @@ function ya(v,c){let{itemHeight:l,containerHeight:u,overscan:s=3,keyProperty:b="
|
|
|
212
212
|
});
|
|
213
213
|
})();
|
|
214
214
|
</script>
|
|
215
|
-
`})}var
|
|
216
|
-
export{
|
|
215
|
+
`})}var Nm={createVirtualList:ba,processVirtualListDirectives:wa,processInfiniteListDirectives:Yl,processVirtualGridDirectives:Zl,generateVirtualListCSS:Gl,useVirtualList:Jl};
|
|
216
|
+
export{ba,wa,Gl,Jl,Yl,Zl,Nm};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Broadcast as s,BroadcastServer as h}from"ts-broadcasting";import{channel as
|
|
3
|
-
export{
|
|
2
|
+
import{Broadcast as s,BroadcastServer as h}from"ts-broadcasting";import{channel as mm}from"ts-broadcasting";import{Broadcast as hm,BroadcastServer as ym}from"ts-broadcasting";var e=null,u=[];function am(){return e}async function cm(n){if(e)return e;let t=n.driver??"bun",r=n.host??"0.0.0.0",c=n.port??6001,l=n.scheme??"ws",a={verbose:n.verbose??!1,driver:t,default:t,connections:{[t]:{driver:t,host:r,port:c,scheme:l}}};return e=new h(a),s.setServer(e),await e.start(),e}async function lm(){for(let n of u)clearInterval(n);if(u.length=0,!e)return;await e.stop(),e=null}async function um(n){let t=await import(n),r=t.default??t;if(typeof r!=="function")throw Error(`routes/channels.ts must export a default function, got ${typeof r}`);let c=0;return r({channel(a,o){if(c++,o.authorize&&e)e.channels.channel(a,o.authorize);if(o.interval&&o.data){let d=o.event??`${a}.updated`,p=o.data,v=setInterval(async()=>{try{let g=await p();Hl(a,d,g)}catch{}},o.interval);u.push(v)}}}),c}var f=!1;function i(){if(e)return!0;if(!f)f=!0,console.warn("[stx] broadcast() called before server started \u2014 messages will be sent once broadcasting is ready");return!1}function Hl(n,t,r){if(!i())return;s.send(n,t,r)}function dm(n,t,r){if(!i())return;s.toUser(n,t,r)}function pm(n,t,r){if(!i())return;s.toUsers(n,t,r)}function fm(n,t,r){if(!i())return;s.send(`private-${n}`,t,r)}function gm(n,t,r){if(!i())return;s.presence(n,t,r)}
|
|
3
|
+
export{am,cm,lm,um,Hl,dm,pm,fm,gm,mm,hm,ym};
|