@stacksjs/bun-router 0.1.7 → 0.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (100) hide show
  1. package/dist/chunk-4wd1d6ay.js +416 -0
  2. package/dist/{chunk-nf3kv7kv.js → chunk-8rrs7556.js} +1 -1
  3. package/dist/{chunk-3y4gaz7v.js → chunk-m4aaj9ay.js} +1 -1
  4. package/dist/cli.js +30 -59
  5. package/dist/container/index.js +1 -1
  6. package/dist/index.js +2 -2
  7. package/package.json +9 -1
  8. package/dist/chunk-03m2j6h7.js +0 -2
  9. package/dist/chunk-08cw7ejr.js +0 -3
  10. package/dist/chunk-0e4g0fyv.js +0 -62
  11. package/dist/chunk-0mmn02yw.js +0 -2
  12. package/dist/chunk-126c9qm3.js +0 -2
  13. package/dist/chunk-12p13817.js +0 -2
  14. package/dist/chunk-14v65c37.js +0 -4
  15. package/dist/chunk-1b6a7t3v.js +0 -231
  16. package/dist/chunk-1wenkmk0.js +0 -2
  17. package/dist/chunk-2152npfd.js +0 -2
  18. package/dist/chunk-26w23krx.js +0 -2
  19. package/dist/chunk-2g8m379z.js +0 -10
  20. package/dist/chunk-2rr178et.js +0 -1654
  21. package/dist/chunk-2w8f3swz.js +0 -29
  22. package/dist/chunk-4r1x4afz.js +0 -12
  23. package/dist/chunk-4wyw66zk.js +0 -2
  24. package/dist/chunk-4z5sf8ag.js +0 -2
  25. package/dist/chunk-58tfvayh.js +0 -4
  26. package/dist/chunk-5be9x5cq.js +0 -3
  27. package/dist/chunk-5dp83qcx.js +0 -397
  28. package/dist/chunk-5f0d9j9a.js +0 -2
  29. package/dist/chunk-5z52b0fc.js +0 -28
  30. package/dist/chunk-5zrnk2kq.js +0 -4
  31. package/dist/chunk-6bbmkwng.js +0 -3
  32. package/dist/chunk-6dmqtdnq.js +0 -2
  33. package/dist/chunk-6e91956t.js +0 -3
  34. package/dist/chunk-6rv8w5jk.js +0 -2
  35. package/dist/chunk-6x1feysm.js +0 -3
  36. package/dist/chunk-7qnxdedn.js +0 -321
  37. package/dist/chunk-7y72hm1x.js +0 -2
  38. package/dist/chunk-8hbhfh6b.js +0 -194
  39. package/dist/chunk-8kfzygg5.js +0 -3
  40. package/dist/chunk-8wpj3fqe.js +0 -351
  41. package/dist/chunk-8wydx2we.js +0 -2
  42. package/dist/chunk-8zjnjvv7.js +0 -2
  43. package/dist/chunk-9805tt8n.js +0 -341
  44. package/dist/chunk-988h4bzr.js +0 -2
  45. package/dist/chunk-9b6a58ac.js +0 -2
  46. package/dist/chunk-a8fcaywb.js +0 -2
  47. package/dist/chunk-bfjwn7yg.js +0 -2
  48. package/dist/chunk-bp2522mm.js +0 -2
  49. package/dist/chunk-brpgjyqg.js +0 -3
  50. package/dist/chunk-bswe62q4.js +0 -48
  51. package/dist/chunk-c3v796c8.js +0 -943
  52. package/dist/chunk-ccqmwdry.js +0 -2
  53. package/dist/chunk-ck0crwnx.js +0 -2
  54. package/dist/chunk-cqgkxcb4.js +0 -2
  55. package/dist/chunk-dntnakjy.js +0 -2
  56. package/dist/chunk-dxg045wj.js +0 -5
  57. package/dist/chunk-e3qej0jr.js +0 -4
  58. package/dist/chunk-ettdpnrw.js +0 -60
  59. package/dist/chunk-ezqwq17j.js +0 -185
  60. package/dist/chunk-ezx3qsez.js +0 -2
  61. package/dist/chunk-f72nnjy4.js +0 -15413
  62. package/dist/chunk-fna5n0ey.js +0 -246
  63. package/dist/chunk-fqhckdt8.js +0 -2
  64. package/dist/chunk-fr6hbx25.js +0 -2
  65. package/dist/chunk-g9cwng6w.js +0 -3
  66. package/dist/chunk-gd3za5x0.js +0 -2
  67. package/dist/chunk-gf28608k.js +0 -2
  68. package/dist/chunk-h1dj6v8q.js +0 -3
  69. package/dist/chunk-hjxe7k2g.js +0 -2
  70. package/dist/chunk-hrkgznbn.js +0 -2
  71. package/dist/chunk-j6h5v0br.js +0 -2
  72. package/dist/chunk-kjtjbcq4.js +0 -71
  73. package/dist/chunk-mgb01qdv.js +0 -14
  74. package/dist/chunk-n24c9whp.js +0 -2
  75. package/dist/chunk-n2j24b0h.js +0 -4540
  76. package/dist/chunk-nhmtg01n.js +0 -84
  77. package/dist/chunk-p0qhpnqh.js +0 -70
  78. package/dist/chunk-p0w1x8y2.js +0 -3
  79. package/dist/chunk-p3dk1w2w.js +0 -216
  80. package/dist/chunk-q4e9pxs7.js +0 -3
  81. package/dist/chunk-q5dv1kyy.js +0 -2
  82. package/dist/chunk-qnqgf9tq.js +0 -2
  83. package/dist/chunk-qvwy1808.js +0 -898
  84. package/dist/chunk-r18f77vc.js +0 -12
  85. package/dist/chunk-r63za1mr.js +0 -2
  86. package/dist/chunk-rft8gw92.js +0 -7851
  87. package/dist/chunk-ryvmyskt.js +0 -4211
  88. package/dist/chunk-sa6mx308.js +0 -2
  89. package/dist/chunk-sw0chtw4.js +0 -4
  90. package/dist/chunk-va0pc7hx.js +0 -2
  91. package/dist/chunk-vcp8dnjq.js +0 -412
  92. package/dist/chunk-vg1erq1q.js +0 -2
  93. package/dist/chunk-vsh4390q.js +0 -358
  94. package/dist/chunk-w0jv49ch.js +0 -11
  95. package/dist/chunk-wm805tte.js +0 -35
  96. package/dist/chunk-xg9xscqz.js +0 -1
  97. package/dist/chunk-xj9h6mc9.js +0 -2
  98. package/dist/chunk-ytvzwrq3.js +0 -51
  99. package/dist/chunk-zde7ebc4.js +0 -288
  100. package/dist/chunk-zmqsv2xy.js +0 -2
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{$m as b,_m as a,an as c,bn as d,cn as e,dn as f,en as g,fn as h,gn as i,hn as j,in as k}from"./chunk-2g8m379z.js";import"./chunk-p0qhpnqh.js";import"./chunk-nf3kv7kv.js";export{f as buildCrosswindCSS,i as extractClassNames,j as generateCrosswindCSS,h as getCachedCSS,a as getCrosswindServeAsset,k as injectCrosswindCSS,b as loadCrosswind,e as loadCrosswindConfig,g as rebuildCrosswindCSS,d as resetCrosswindCache,c as resetCssCache};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Oo as a,Po as b}from"./chunk-5zrnk2kq.js";import"./chunk-nf3kv7kv.js";export{a as findUnbalancedTags,b as warnUnbalancedTags};
@@ -1,3 +0,0 @@
1
- // @bun
2
- import{Zu as b}from"./chunk-nf3kv7kv.js";var n;async function f(){if(n!==void 0)return n;try{n=await import("bun-queue")}catch{n=null}return n}class u{channel;event;data;excludeSocketId;connection;queue;delay;tries;timeout;backoff;constructor(e,t,i,a){this.channel=e,this.event=t,this.data=i,this.excludeSocketId=a,this.tries=3,this.timeout=30000,this.backoff=[1000,5000]}async handle(e){try{e.broadcast(this.channel,this.event,this.data,this.excludeSocketId)}catch(t){throw console.error(`Failed to broadcast to ${this.channel}:`,t),t}}failed(e){console.error(`BroadcastJob failed for channel ${this.channel}:`,e.message)}}class c extends u{constructor(e,t,i,a,s){super(e,t,i,s);this.delay=a}}class d{channel;event;dataFn;cronExpression;connection;queue;delay;tries;timeout;constructor(e,t,i,a){this.channel=e,this.event=t,this.dataFn=i,this.cronExpression=a,this.tries=3,this.timeout=30000}async handle(e){try{let t=typeof this.dataFn==="function"?await this.dataFn():this.dataFn;e.broadcast(this.channel,this.event,t)}catch(t){throw console.error(`Failed to broadcast recurring event to ${this.channel}:`,t),t}}failed(e){console.error(`RecurringBroadcastJob failed for channel ${this.channel}:`,e.message)}}class g{queue=null;server;config;deadLetterQueue;constructor(e,t){if(this.server=e,this.config={enabled:t?.enabled??!1,connection:t?.connection||"default",defaultQueue:t?.defaultQueue||"broadcasts",retry:{attempts:t?.retry?.attempts??3,backoff:t?.retry?.backoff??{type:"exponential",delay:1000}},deadLetter:{enabled:t?.deadLetter?.enabled??!0,maxRetries:t?.deadLetter?.maxRetries??3}},this.config.enabled)this.initializeQueue()}async initializeQueue(){let e=await f();if(!e?.getQueueManager){console.warn("bun-queue is not installed. Queue features will be disabled."),this.config.enabled=!1;return}try{let t=e.getQueueManager();if(this.queue=t.connection(this.config.connection).queue(this.config.defaultQueue),this.config.deadLetter.enabled)this.deadLetterQueue=this.queue.getDeadLetterQueue();this.queue.processJobs(10),console.log(`\u2713 Broadcasting queue initialized: ${this.config.defaultQueue}`)}catch(t){console.error("Failed to initialize broadcasting queue:",t),this.config.enabled=!1}}async queueBroadcast(e,t,i,a){if(!this.isEnabled())throw Error("Queue system is not enabled");let s=Array.isArray(e)?e:[e],r=[];for(let o of s){let l=a?.delay?new c(o,t,i,a.delay,a?.excludeSocketId):new u(o,t,i,a?.excludeSocketId),h=await this.queue.dispatchJob(l,this.server);r.push(h)}return s.length===1?r[0]:r}async scheduleRecurringBroadcast(e,t,i,a){if(!this.isEnabled())throw Error("Queue system is not enabled");let s=new d(e,t,i,a);return await this.queue.scheduleCron({cron:a,data:{job:s,server:this.server},name:`recurring-broadcast-${e}-${t}`})}async cancelRecurringBroadcast(e){if(!this.isEnabled())return!1;return this.queue.unscheduleCron(e)}async getStats(){if(!this.isEnabled())return null;let e=await this.queue.getJobCounts(),t=this.deadLetterQueue?await this.deadLetterQueue.getJobs():[];return{waiting:e.waiting,active:e.active,completed:e.completed,failed:e.failed,delayed:e.delayed,deadLetter:t.length}}async getFailedJobs(e=0,t=-1){if(!this.isEnabled())return[];return this.queue.getJobs("failed",e,t)}async getDeadLetterJobs(e=0,t=-1){if(!this.isEnabled()||!this.deadLetterQueue)return[];return this.deadLetterQueue.getJobs(e,t)}async retryJob(e){if(!this.isEnabled())return null;return this.queue.retryJob(e)}async republishDeadLetterJob(e,t=!0){if(!this.isEnabled()||!this.deadLetterQueue)return null;return this.queue.republishDeadLetterJob(e,{resetRetries:t})}async clearFailedJobs(){if(!this.isEnabled())return;let e=(await this.queue.getJobs("failed")).map((t)=>t.id);if(e.length>0)await this.queue.bulkRemove(e)}async clearDeadLetterQueue(){if(!this.isEnabled()||!this.deadLetterQueue)return;await this.queue.clearDeadLetterQueue()}isEnabled(){return this.config.enabled&&this.queue!==null}async close(){if(this.queue)await this.queue.close(),this.queue=null}}
3
- export{u as W,c as X,d as Y,g as Z};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{An as g,Bn as h,Cn as i,Dn as j,un as a,vn as b,wn as c,xn as d,yn as e,zn as f}from"./chunk-wm805tte.js";import"./chunk-58tfvayh.js";import"./chunk-5be9x5cq.js";import"./chunk-nf3kv7kv.js";export{a as STX_ENGINE_BINDING_NAMES,g as convertToCommonJS,i as extractScriptFromTemplate,e as extractVariables,j as hasVariables,f as isCompleteImport,d as isMissingBindingFailure,c as isModuleResolutionFailure,h as splitDeclaration,b as stripTypeScript};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{W as a,X as s,Y as o,Z as r}from"./chunk-g9cwng6w.js";import"./chunk-xg9xscqz.js";import"./chunk-nf3kv7kv.js";export{a as BroadcastJob,r as BroadcastQueueManager,s as DelayedBroadcastJob,o as RecurringBroadcastJob};
@@ -1,3 +0,0 @@
1
- // @bun
2
- import{$s as M,dt as b}from"./chunk-fna5n0ey.js";import{Zu as N}from"./chunk-nf3kv7kv.js";import y from"fs";import l from"path";import P from"os";import B from"crypto";var O=[320,640,768,1024,1280,1536,1920],_=["webp","jpeg"],H=80,V=[".jpg",".jpeg",".png",".webp",".avif",".gif",".svg"],q={webp:"image/webp",avif:"image/avif",jpeg:"image/jpeg",png:"image/png"},w=null,F=!1;async function d(){if(F)return w;F=!0;try{let t=await import("sharp");return w=t.default||t,w}catch{return null}}async function Z(){return await d()!==null}async function tt(){return!0}async function et(t,e={}){let{widths:a=O,formats:r=_,quality:i=H,fit:o="cover",placeholder:n="none",outputDir:f=".stx/images",baseUrl:T="/images"}=e,h,m;if(typeof t==="string"){if(m=t,!await Bun.file(t).exists())throw new I(`Image not found: ${t}`,"NOT_FOUND");h=await Bun.file(t).arrayBuffer().then((s)=>Buffer.from(s))}else m="buffer-input",h=t;let E=B.createHash("sha256").update(h).digest("hex").slice(0,12),z=await x(h),{width:c,height:S}=z,U=c/S;await y.promises.mkdir(f,{recursive:!0});let j=[],D=l.basename(m,l.extname(m)),g=a.filter((s)=>s<=c);if(!g.includes(c)&&c<=Math.max(...a))g.push(c);g.sort((s,u)=>s-u);for(let s of g){let u=Math.round(s/U);for(let p of r){let L=`${D}-${s}w-${E}.${p}`,k=l.join(f,L),R=`${T}/${L}`,v=await C(h,{width:s,height:u,format:p,quality:i,fit:o});await Bun.write(k,v),j.push({path:k,url:R,width:s,height:u,format:p,size:v.length})}}let A;if(n!=="none")A=await G(h,n);return{src:m,variants:j,placeholder:A,width:c,height:S,aspectRatio:U,hash:E}}async function x(t){let e=typeof t==="string"?Buffer.from(await Bun.file(t).arrayBuffer()):t,a=await d();if(a){let r=await a(e).metadata();return{width:r.width||0,height:r.height||0,format:r.format||"unknown",hasAlpha:r.hasAlpha}}return W(e)}function W(t){if(t[0]===137&&t[1]===80&&t[2]===78&&t[3]===71){let e=t.readUInt32BE(16),a=t.readUInt32BE(20);return{width:e,height:a,format:"png",hasAlpha:!0}}if(t[0]===255&&t[1]===216){let e=2;while(e<t.length){if(t[e]!==255)break;let a=t[e+1];if(a>=192&&a<=207&&a!==196&&a!==200&&a!==204){let i=t.readUInt16BE(e+5);return{width:t.readUInt16BE(e+7),height:i,format:"jpeg",hasAlpha:!1}}let r=t.readUInt16BE(e+2);e+=2+r}}if(t.toString("utf8",0,4)==="RIFF"&&t.toString("utf8",8,12)==="WEBP"){let e=t.toString("utf8",12,16);if(e==="VP8 "){let a=t.readUInt16LE(26)&16383,r=t.readUInt16LE(28)&16383;return{width:a,height:r,format:"webp",hasAlpha:!1}}if(e==="VP8L"){let a=t.readUInt32LE(21),r=(a&16383)+1,i=(a>>14&16383)+1;return{width:r,height:i,format:"webp",hasAlpha:!0}}}if(t.toString("utf8",0,3)==="GIF"){let e=t.readUInt16LE(6),a=t.readUInt16LE(8);return{width:e,height:a,format:"gif",hasAlpha:!0}}throw new I("Unable to parse image dimensions","PARSE_ERROR")}async function C(t,e){let a=await d();if(a){let i=a(t).resize(e.width,e.height,{fit:e.fit});switch(e.format){case"webp":i=i.webp({quality:e.quality});break;case"avif":i=i.avif({quality:e.quality});break;case"jpeg":i=i.jpeg({quality:e.quality});break;case"png":i=i.png({quality:e.quality});break}return i.toBuffer()}let r=l.join(P.tmpdir(),`stx-img-${B.randomBytes(8).toString("hex")}.${e.format}`);try{return await M({input:t,output:r,format:e.format,quality:e.quality,resize:{width:e.width,height:e.height,fit:e.fit}}),Buffer.from(await Bun.file(r).arrayBuffer())}finally{await y.promises.unlink(r).catch(()=>{})}}async function G(t,e){let a=await d();if(e==="blur"&&a){let o=(await a(t).resize(20).blur(10).toBuffer()).toString("base64"),n=await x(t);return`data:${q[n.format]||"image/jpeg"};base64,${o}`}if(e==="dominant-color"&&a){let{dominant:o}=await a(t).resize(1,1).toBuffer().then(async(n)=>{let f=await a(n).metadata();return{dominant:{r:128,g:128,b:128}}}).catch(()=>({dominant:{r:128,g:128,b:128}}));return`rgb(${o.r}, ${o.g}, ${o.b})`}let r=await x(t),i=l.join(P.tmpdir(),`stx-ph-${B.randomBytes(8).toString("hex")}.${r.format==="unknown"?"bin":r.format}`);try{await Bun.write(i,t);let o=e==="blur"?"blur":e==="thumbhash"?"thumbhash":"dominant-color",n=await b(i,{strategy:o,width:o==="thumbhash"?void 0:32});if(e==="dominant-color"&&n.dominantColor)return n.dominantColor;if(n.dataURL)return n.dataURL;return"rgb(128, 128, 128)"}catch{return"rgb(128, 128, 128)"}finally{await y.promises.unlink(i).catch(()=>{})}}function at(t,e){return(e?t.filter((a)=>a.format===e):t).sort((a,r)=>a.width-r.width).map((a)=>`${a.url} ${a.width}w`).join(", ")}function rt(t){if(!t||Object.keys(t).length===0)return"100vw";return Object.entries(t).sort((e,a)=>{let r=Number.parseInt(e[0].replace(/\D/g,""))||0;return(Number.parseInt(a[0].replace(/\D/g,""))||0)-r}).map(([e,a])=>`(max-width: ${e}) ${a}`).join(", ")+", 100vw"}function it(t){let e=t.filter((r)=>r.format==="jpeg");if(e.length===0)return t[Math.floor(t.length/2)];let a=e.sort((r,i)=>r.width-i.width);return a[Math.floor(a.length/2)]}function nt(t){let e=new Map;for(let a of t){let r=e.get(a.format)||[];r.push(a),e.set(a.format,r)}return e}function ot(t){let e=l.extname(t).toLowerCase();return V.includes(e)}function st(t){return q[t]||"application/octet-stream"}function ht(t){return t.reduce((e,a)=>e+a.size,0)}function ct(t){if(t<1024)return`${t} B`;if(t<1048576)return`${(t/1024).toFixed(1)} KB`;return`${(t/1048576).toFixed(2)} MB`}class I extends Error{code;constructor(t,e){super(t);this.name="ImageProcessingError",this.code=e}}
3
- export{O as ds,_ as es,H as fs,Z as gs,tt as hs,et as is,x as js,C as ks,at as ls,rt as ms,it as ns,nt as os,ot as ps,st as qs,ht as rs,ct as ss,I as ts};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Bf as a,Cf as b}from"./chunk-w0jv49ch.js";import"./chunk-e3qej0jr.js";import"./chunk-ryvmyskt.js";import"./chunk-2g8m379z.js";import"./chunk-ezqwq17j.js";import"./chunk-wm805tte.js";import"./chunk-58tfvayh.js";import"./chunk-brpgjyqg.js";import"./chunk-2rr178et.js";import"./chunk-5be9x5cq.js";import"./chunk-5zrnk2kq.js";import"./chunk-p0qhpnqh.js";import"./chunk-nf3kv7kv.js";export{b as clearStoreCache,a as getStoreScript};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{ne as a,oe as b,pe as c,qe as d,re as e,se as f,te as g,ue as h}from"./chunk-14v65c37.js";import"./chunk-p0w1x8y2.js";import"./chunk-nf3kv7kv.js";export{c as Validator,b as defineForm,e as processErrorDirective,f as processErrorsDirective,h as processFormValidationDirectives,g as processHasErrorsDirective,a as useForm,d as v};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Td as a,Ud as b,Vd as c,Wd as d,Xd as e,Yd as f,Zd as g}from"./chunk-p3dk1w2w.js";import"./chunk-nf3kv7kv.js";export{a as createVirtualList,g as default,c as generateVirtualListCSS,e as processInfiniteListDirectives,f as processVirtualGridDirectives,b as processVirtualListDirectives,d as useVirtualList};
@@ -1,71 +0,0 @@
1
- // @bun
2
- var p=0;function f(){return`stx-teleport-${++p}`}function h(t){let e=t.split(",").map((r)=>r.trim()),i=e[0].replace(/['"]/g,""),n;for(let r=1;r<e.length;r++){let s=e[r].match(/disabled:\s*(.+)/);if(s)n=s[1].trim()}return{target:i,disabled:n}}function g(t,e){return`
3
- <script>
4
- (function() {
5
- const source = document.getElementById('${t}');
6
- if (!source) return;
7
-
8
- // Get the content template up-front so we can hold a reference for the
9
- // retry path. (template.content is moved out by cloneNode below.)
10
- const template = source.querySelector('template');
11
- if (!template) return;
12
-
13
- function mount(targetEl) {
14
- // Clone the template content and wrap it for tracking.
15
- const content = template.content.cloneNode(true);
16
- const wrapper = document.createElement('div');
17
- wrapper.setAttribute('data-teleport-from', '${t}');
18
- wrapper.appendChild(content);
19
-
20
- targetEl.appendChild(wrapper);
21
-
22
- // Remove the source placeholder
23
- source.remove();
24
-
25
- wrapper.dispatchEvent(new CustomEvent('teleport:mounted', {
26
- bubbles: true,
27
- detail: { sourceId: '${t}', target: '${e}' }
28
- }));
29
- }
30
-
31
- // The teleport script runs inline at the position it's emitted. If the
32
- // target is declared later in the same render pass (e.g. by a layout
33
- // shell whose onMount creates the portal root), the first lookup
34
- // misses. Pre-fix (stacksjs/stx#1728) the script bailed with a warning
35
- // and never tried again. Now retry once via requestAnimationFrame so
36
- // targets that land in the same paint cycle still work. A second
37
- // miss is still a warning \u2014 we don't loop forever.
38
- const firstEl = document.querySelector('${e}');
39
- if (firstEl) { mount(firstEl); return; }
40
-
41
- requestAnimationFrame(function() {
42
- const retryEl = document.querySelector('${e}');
43
- if (retryEl) { mount(retryEl); return; }
44
- console.warn('[stx] Teleport target not found: ${e}');
45
- });
46
- })();
47
- </script>
48
- `}function y(t,e,i){p=0;let n=/@teleport\s*\(([^)]+)\)\s*([\s\S]*?)@endteleport/g;return t.replace(n,(r,s,d)=>{let a=f(),{target:u,disabled:o}=h(s),c=d.trim();if(o)try{let l=!1;if(o==="true")l=!0;else if(o==="false")l=!1;else if(o in e)l=Boolean(e[o]);if(l)return`<div class="stx-teleport-inline" data-teleport-disabled>${c}</div>`}catch{}let m=g(a,u);return`
49
- <div id="${a}" class="stx-teleport-source" style="display: none;">
50
- <template>${c}</template>
51
- </div>
52
- ${m}
53
- `})}function w(){return`
54
- <script>
55
- (function() {
56
- // Common teleport targets
57
- const targets = ['#stx-modals', '#stx-tooltips', '#stx-notifications'];
58
-
59
- targets.forEach(selector => {
60
- const id = selector.slice(1); // Remove #
61
- if (!document.getElementById(id)) {
62
- const el = document.createElement('div');
63
- el.id = id;
64
- el.setAttribute('data-teleport-container', '');
65
- document.body.appendChild(el);
66
- }
67
- });
68
- })();
69
- </script>
70
- `}
71
- export{y as xe,w as ye};
@@ -1,14 +0,0 @@
1
- // @bun
2
- import"./chunk-nf3kv7kv.js";var l=null,v=[],m=new WeakMap;function x(e){let o=e,t=new Set,n={get value(){if(l){let s=m.get(n);if(!s)s=new Set,m.set(n,s);s.add(l)}return o},set value(s){if(!Object.is(o,s)){o=s,t.forEach((i)=>i(s));let r=m.get(n);if(r)r.forEach((i)=>i())}},subscribe(s){return t.add(s),()=>t.delete(s)},peek(){return o}};return n}function h(e){return e!==null&&typeof e==="object"&&"value"in e&&"subscribe"in e&&"peek"in e}function k(e){return h(e)?e.value:e}function _(e){let o={};for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t))o[t]=x(e[t]);return o}function E(e){return x(e)}function S(e){let o=typeof e==="function",t=o?e:e.get,n=o?void 0:e.set,s=o?Object.is:e.equals||Object.is,r,i=!0,c=new Set,f=new Set,d=()=>{if(i=!0,f.size>0){let u=a.value;f.forEach((w)=>w(u))}};function p(){c.clear();let u=l;l=d,v.push(d);try{return t()}finally{v.pop(),l=u}}let a={get value(){if(l){let u=m.get(a);if(!u)u=new Set,m.set(a,u);u.add(l)}if(i){let u=p();if(!s(r,u))r=u;i=!1}return r},set value(u){if(n)n(u);else console.warn("Computed property is readonly")},subscribe(u){return f.add(u),()=>f.delete(u)},peek(){if(i)r=t(),i=!1;return r},invalidate(){i=!0},get dirty(){return i},get deps(){return c}};return a}function R(e,o,t={}){let{immediate:n=!1,deep:s=!1,flush:r="pre",once:i=!1}=t,c,f=!0,d=!1,p=()=>{if(h(e))return s?b(e.value):e.value;return e()},a=()=>{if(!f||d)return;let y=p();if(c!==void 0&&Object.is(c,y)&&!s)return;let g=()=>{if(o(y,c),c=s?b(y):y,i)w()};if(r==="sync")g();else if(r==="post")queueMicrotask(g);else Promise.resolve().then(g)},u=null;if(h(e))u=e.subscribe(()=>a());else u=S(e).subscribe(()=>a());if(n)c=void 0,a();else c=p();let w=()=>{if(f=!1,u)u(),u=null};return w.pause=()=>{d=!0},w.resume=()=>{d=!1},w}function j(e,o,t={}){let{immediate:n=!1,once:s=!1}=t,r=e.map((a)=>h(a)?a.value:void 0),i=!0,c=!1,f=()=>{if(!i||c)return;let a=e.map((u)=>h(u)?u.value:void 0);if(o(a,r),r=[...a],s)p()},d=e.map((a)=>{if(h(a))return a.subscribe(()=>f());return()=>{}});if(n)f();let p=()=>{i=!1,d.forEach((a)=>a())};return p.pause=()=>{c=!0},p.resume=()=>{c=!1},p}function C(e,o={}){let{flush:t="pre"}=o,n,s=!0,r=!1,i=()=>{if(!s||r)return;if(n)n();let f=l;l=i,v.push(i);try{n=e()}finally{v.pop(),l=f}};if(t==="sync")i();else if(t==="post")queueMicrotask(i);else Promise.resolve().then(i);let c=()=>{if(s=!1,n)n()};return c.pause=()=>{r=!0},c.resume=()=>{r=!1},c}function D(e,o={},t){let n=/@computed\s*\(\s*(\w+)\s*,\s*(.+?)\s*\)/gi;return e.replace(n,(s,r,i)=>{try{let c=Function(...Object.keys(o),`return ${i}`)(...Object.values(o));return o[r]=c,`<!-- computed: ${r} = ${c} -->`}catch(c){return`<!-- computed error: ${r} - ${c} -->`}})}function P(e,o={},t){let n=/@watch\s*\(\s*(\w+)\s*\)\s*([\s\S]*?)@endwatch/gi;return e.replace(n,(s,r,i)=>`
3
- <script data-watch="${`watch-${Math.random().toString(36).substring(2,9)}`}">
4
- (function() {
5
- // Watch implementation for ${r}
6
- const handler = ${i.trim()};
7
- if (window.__stxState && window.__stxState['${r}']) {
8
- window.__stxState['${r}'].subscribe(function(newValue) {
9
- handler(newValue);
10
- });
11
- }
12
- })();
13
- </script>
14
- `)}function b(e){if(e===null||typeof e!=="object")return e;if(Array.isArray(e))return e.map((t)=>b(t));if(e instanceof Date)return new Date(e.getTime());if(e instanceof Map){let t=new Map;return e.forEach((n,s)=>t.set(b(s),b(n))),t}if(e instanceof Set){let t=new Set;return e.forEach((n)=>t.add(b(n))),t}let o={};for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t))o[t]=b(e[t]);return o}function M(e,o=100){let t=x(e()),n=null,s=()=>{if(n)clearTimeout(n);n=setTimeout(()=>{t.value=e()},o)};return S(e).subscribe(()=>s()),{get value(){return t.value},set value(r){console.warn("Debounced computed is readonly")},subscribe:t.subscribe,peek:t.peek,invalidate(){s()},get dirty(){return!1},get deps(){return new Set}}}function V(e,o=100){let t=x(e()),n=0,s=()=>{let r=Date.now();if(r-n>=o)n=r,t.value=e()};return S(e).subscribe(()=>s()),{get value(){return t.value},set value(r){console.warn("Throttled computed is readonly")},subscribe:t.subscribe,peek:t.peek,invalidate(){s()},get dirty(){return!1},get deps(){return new Set}}}var T={ref:x,computed:S,watch:R,watchMultiple:j,watchEffect:C,isRef:h,unref:k,toRefs:_,shallowRef:E,debouncedComputed:M,throttledComputed:V,processComputedDirectives:D,processWatchDirectives:P};export{S as computed,M as debouncedComputed,T as default,h as isRef,D as processComputedDirectives,P as processWatchDirectives,x as ref,E as shallowRef,S as stxComputed,M as stxDebouncedComputed,h as stxIsRef,x as stxRef,E as stxShallowRef,V as stxThrottledComputed,_ as stxToRefs,k as stxUnref,R as stxWatch,C as stxWatchEffect,j as stxWatchMultiple,V as throttledComputed,_ as toRefs,k as unref,R as watch,C as watchEffect,j as watchMultiple};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Fe as a,Ge as b,He as c,Ie as d,Je as e}from"./chunk-9805tt8n.js";import"./chunk-nf3kv7kv.js";export{b as createSSRSuspense,d as generateSuspenseCSS,e as generateSuspenseRuntime,a as processSuspenseDirectives,c as renderSSRSuspense};