@muxcodecli/cli 1.15.16 → 1.15.18

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 (204) hide show
  1. package/dist/bip-bop-01-ga21wr3r.mp3 +0 -0
  2. package/dist/bip-bop-03-kgfd4rq4.mp3 +0 -0
  3. package/dist/chunk-0hqmdrjr.js +3 -0
  4. package/dist/chunk-0npjzye0.js +2 -0
  5. package/dist/chunk-0pe6y883.js +2 -0
  6. package/dist/chunk-0qqpjj2h.js +3 -0
  7. package/dist/chunk-0r3h8jgj.js +2 -0
  8. package/dist/chunk-11285jfy.js +3 -0
  9. package/dist/chunk-11ant2kk.js +3 -0
  10. package/dist/chunk-124qmktt.js +18 -0
  11. package/dist/chunk-138ntz3h.js +2 -0
  12. package/dist/chunk-1e73ypg5.js +3 -0
  13. package/dist/chunk-1evcc54z.js +3 -0
  14. package/dist/chunk-1mqsg5s7.js +75 -0
  15. package/dist/chunk-1pv2317e.js +7 -0
  16. package/dist/chunk-1y3ssxx6.js +2 -0
  17. package/dist/chunk-20x8vsdn.js +7 -0
  18. package/dist/chunk-21x3anp4.js +9 -0
  19. package/dist/chunk-22qpzg37.js +212 -0
  20. package/dist/chunk-2bt5mtgm.js +3 -0
  21. package/dist/chunk-2d95ene8.js +2 -0
  22. package/dist/chunk-2h2zq5cp.js +2 -0
  23. package/dist/chunk-2pc63est.js +2 -0
  24. package/dist/chunk-33gs9z8d.js +2 -0
  25. package/dist/chunk-33vwwxjk.js +2 -0
  26. package/dist/chunk-3dq7hfxc.js +9 -0
  27. package/dist/chunk-3jvft1k1.js +2 -0
  28. package/dist/chunk-4jqh4mpm.js +2 -0
  29. package/dist/chunk-4mgyaytc.js +672 -0
  30. package/dist/chunk-4va8fzq1.js +2 -0
  31. package/dist/chunk-4wkq9y2z.js +7 -0
  32. package/dist/chunk-526nbm9e.js +2 -0
  33. package/dist/chunk-5a6895cv.js +37 -0
  34. package/dist/chunk-5e9dq2av.js +2 -0
  35. package/dist/chunk-5jn2z3nf.js +3 -0
  36. package/dist/chunk-5npr1qyq.js +574 -0
  37. package/dist/chunk-5sfky0gz.js +8 -0
  38. package/dist/chunk-5t7xqdvk.js +3 -0
  39. package/dist/chunk-5tpqj6ag.js +10 -0
  40. package/dist/chunk-5v5015am.js +12 -0
  41. package/dist/chunk-5wawdxv2.js +7 -0
  42. package/dist/chunk-6btrg3ff.js +2 -0
  43. package/dist/chunk-6skbzman.js +6 -0
  44. package/dist/chunk-6sz698ew.js +11 -0
  45. package/dist/chunk-6xzrzmsr.js +2 -0
  46. package/dist/chunk-7848rf5q.js +63 -0
  47. package/dist/chunk-7ep2edcv.js +12 -0
  48. package/dist/chunk-7svw66kw.js +13 -0
  49. package/dist/chunk-7xgr8vx6.js +2 -0
  50. package/dist/chunk-7zjn6m1m.js +2 -0
  51. package/dist/chunk-8atqb297.js +12 -0
  52. package/dist/chunk-8ebkxjar.js +7 -0
  53. package/dist/chunk-8j3aw4qg.js +3 -0
  54. package/dist/chunk-8jy0dvcn.js +3 -0
  55. package/dist/chunk-8refh038.js +2 -0
  56. package/dist/chunk-93cszp8k.js +3 -0
  57. package/dist/chunk-93ze3gcb.js +2 -0
  58. package/dist/chunk-98yxzxtd.js +2 -0
  59. package/dist/chunk-9g64kggy.js +3 -0
  60. package/dist/chunk-9h1pwxb2.js +8 -0
  61. package/dist/chunk-9j4j9nrm.js +2 -0
  62. package/dist/chunk-9kzczwh0.js +3 -0
  63. package/dist/chunk-9n629gtn.js +3 -0
  64. package/dist/chunk-9y59sxde.js +2 -0
  65. package/dist/chunk-a2m5jyd8.js +2 -0
  66. package/dist/chunk-a595cp8s.js +2 -0
  67. package/dist/chunk-ak0k3m4q.js +3 -0
  68. package/dist/chunk-apksmrz9.js +3 -0
  69. package/dist/chunk-b05r09sj.js +10 -0
  70. package/dist/chunk-b47e563q.js +2 -0
  71. package/dist/chunk-b57avnse.js +2 -0
  72. package/dist/chunk-bfjq7w7k.js +2 -0
  73. package/dist/chunk-bhc70qet.js +3 -0
  74. package/dist/chunk-bvtscj68.js +2 -0
  75. package/dist/chunk-bw2cy5v0.js +8 -0
  76. package/dist/chunk-c7dvyh2x.js +2 -0
  77. package/dist/chunk-cbz8b7g5.js +3 -0
  78. package/dist/chunk-cw4vbnet.js +3 -0
  79. package/dist/chunk-czcj3j9y.js +2 -0
  80. package/dist/chunk-dg466kdp.js +2 -0
  81. package/dist/chunk-dmscgnhq.js +2 -0
  82. package/dist/chunk-dtk4m8rm.js +3 -0
  83. package/dist/chunk-dy7akyj3.js +2 -0
  84. package/dist/chunk-e2wv2sp4.js +2 -0
  85. package/dist/chunk-e8j03wnd.js +3 -0
  86. package/dist/chunk-egkp6tct.js +2 -0
  87. package/dist/chunk-emfc800a.js +2 -0
  88. package/dist/chunk-envnht72.js +4 -0
  89. package/dist/chunk-eskw1cj2.js +3 -0
  90. package/dist/chunk-ezz15tyg.js +2 -0
  91. package/dist/chunk-fkmzj0qt.js +16 -0
  92. package/dist/chunk-fqt3c3g5.js +4 -0
  93. package/dist/chunk-frbht418.js +19 -0
  94. package/dist/chunk-ftz8cqfq.js +2 -0
  95. package/dist/chunk-g4jxdrr6.js +2 -0
  96. package/dist/chunk-g52xzmrr.js +2 -0
  97. package/dist/chunk-gbtvkje9.js +4 -0
  98. package/dist/chunk-gm9msqq5.js +8 -0
  99. package/dist/chunk-gxat3dpd.js +3 -0
  100. package/dist/chunk-hfppq1w5.js +4 -0
  101. package/dist/chunk-jdg870gy.js +1683 -0
  102. package/dist/chunk-jfz77m78.js +3 -0
  103. package/dist/chunk-jg9r58pf.js +16 -0
  104. package/dist/chunk-jgzt4945.js +2 -0
  105. package/dist/chunk-jh2epywq.js +2 -0
  106. package/dist/chunk-jpj6a56k.js +2 -0
  107. package/dist/chunk-jw4sgq23.js +2 -0
  108. package/dist/chunk-jws11ngd.js +2 -0
  109. package/dist/chunk-jxhz82qt.js +2 -0
  110. package/dist/chunk-k19y2psf.js +4 -0
  111. package/dist/chunk-k6cj14zk.js +2 -0
  112. package/dist/chunk-kktm0pdc.js +3 -0
  113. package/dist/chunk-kmr27ake.js +160 -0
  114. package/dist/chunk-kyhwvbvq.js +2 -0
  115. package/dist/chunk-mgn5pejx.js +2 -0
  116. package/dist/chunk-mskyzxb3.js +3 -0
  117. package/dist/chunk-my9cfmvt.js +5 -0
  118. package/dist/chunk-n4vx7kvs.js +389 -0
  119. package/dist/chunk-nc44rvs7.js +23 -0
  120. package/dist/chunk-ng3vbpmy.js +3 -0
  121. package/dist/chunk-nmnp5g5p.js +228 -0
  122. package/dist/chunk-nn0t3xmn.js +2 -0
  123. package/dist/chunk-npr41z9a.js +19 -0
  124. package/dist/chunk-ntvr3177.js +25 -0
  125. package/dist/chunk-pkc5hkha.js +2 -0
  126. package/dist/chunk-ppg6zhae.js +3 -0
  127. package/dist/chunk-pqwm9zk1.js +6 -0
  128. package/dist/chunk-ptvjmfqx.js +2 -0
  129. package/dist/chunk-q1r48y0y.js +34 -0
  130. package/dist/chunk-q9yddd1r.js +3 -0
  131. package/dist/chunk-qavtgsrh.js +2 -0
  132. package/dist/chunk-qvh8ghjw.js +7 -0
  133. package/dist/chunk-qx6r187q.js +2 -0
  134. package/dist/chunk-r093mfa8.js +32 -0
  135. package/dist/chunk-rbaj9ktq.js +2 -0
  136. package/dist/chunk-rkf9ynkx.js +3 -0
  137. package/dist/chunk-rpp44jtx.js +3 -0
  138. package/dist/chunk-rrvwp351.js +2 -0
  139. package/dist/chunk-rs8fsgqt.js +81 -0
  140. package/dist/chunk-s4gy87ft.js +8 -0
  141. package/dist/chunk-s5qq2ch2.js +12 -0
  142. package/dist/chunk-s92578qx.js +71 -0
  143. package/dist/chunk-snsb760m.js +2 -0
  144. package/dist/chunk-sp1cvejp.js +2 -0
  145. package/dist/chunk-spb3tm25.js +4 -0
  146. package/dist/chunk-srnmswkj.js +2 -0
  147. package/dist/chunk-sxgbzwrs.js +2 -0
  148. package/dist/chunk-t2s6m9t2.js +35 -0
  149. package/dist/chunk-t98sdxty.js +2 -0
  150. package/dist/chunk-tbnxx5na.js +2 -0
  151. package/dist/chunk-tfxm3qz4.js +2 -0
  152. package/dist/chunk-treb38pz.js +3 -0
  153. package/dist/chunk-tvw8tfpr.js +6 -0
  154. package/dist/chunk-v107htgw.js +101 -0
  155. package/dist/chunk-v8at4gnt.js +2 -0
  156. package/dist/chunk-vmr3get8.js +2 -0
  157. package/dist/chunk-vqrnejgj.js +71 -0
  158. package/dist/chunk-vvwy955j.js +3 -0
  159. package/dist/chunk-w5jxffnq.js +2 -0
  160. package/dist/chunk-wcbh5jqy.js +3 -0
  161. package/dist/chunk-wfmrnep1.js +2 -0
  162. package/dist/chunk-wk11yy8h.js +3 -0
  163. package/dist/chunk-wn5f1tfj.js +2 -0
  164. package/dist/chunk-wpm2p1gq.js +3 -0
  165. package/dist/chunk-wxkyv5gj.js +2 -0
  166. package/dist/chunk-wyed730e.js +2 -0
  167. package/dist/chunk-x65zs89t.js +3 -0
  168. package/dist/chunk-x6zjq78z.js +2 -0
  169. package/dist/chunk-xedav0qx.js +3 -0
  170. package/dist/chunk-xmftb9ad.js +38 -0
  171. package/dist/chunk-xvtkw7hj.js +3 -0
  172. package/dist/chunk-xy0txg0n.js +2 -0
  173. package/dist/chunk-y7s5cpwr.js +34 -0
  174. package/dist/chunk-yg48tfvv.js +16 -0
  175. package/dist/chunk-ygpen625.js +3 -0
  176. package/dist/chunk-ymb45bt6.js +2 -0
  177. package/dist/chunk-yp2zfcvh.js +8 -0
  178. package/dist/chunk-z3mx7n44.js +3 -0
  179. package/dist/chunk-zaj612bw.js +3 -0
  180. package/dist/chunk-zb3179f9.js +3 -0
  181. package/dist/chunk-zhd8f4pc.js +759 -0
  182. package/dist/chunk-zjpnyah2.js +3 -0
  183. package/dist/cli/cmd/tui/worker.js +2 -0
  184. package/dist/highlights-eq9cgrbb.scm +604 -0
  185. package/dist/highlights-ghv9g403.scm +205 -0
  186. package/dist/highlights-hk7bwhj4.scm +284 -0
  187. package/dist/highlights-r812a2qc.scm +150 -0
  188. package/dist/highlights-x6tmsnaa.scm +115 -0
  189. package/dist/index.js +146 -5742
  190. package/dist/injections-73j83es3.scm +27 -0
  191. package/dist/muxcode-linux-x64 +0 -0
  192. package/dist/nope-03-2z8weyjw.mp3 +0 -0
  193. package/dist/photon_rs_bg-bq08arze.wasm +0 -0
  194. package/dist/staplebops-06-rz29m246.mp3 +0 -0
  195. package/dist/tree-sitter-3jzf13jk.wasm +0 -0
  196. package/dist/tree-sitter-bash-hq5s6fxb.wasm +0 -0
  197. package/dist/tree-sitter-javascript-nd0q4pe9.wasm +0 -0
  198. package/dist/tree-sitter-markdown-411r6y9b.wasm +0 -0
  199. package/dist/tree-sitter-markdown_inline-j5349f42.wasm +0 -0
  200. package/dist/tree-sitter-powershell-ryb2ffqs.wasm +0 -0
  201. package/dist/tree-sitter-typescript-zxjzwt75.wasm +0 -0
  202. package/dist/tree-sitter-zig-e78zbjpm.wasm +0 -0
  203. package/dist/yup-01-30ecpeh9.mp3 +0 -0
  204. package/package.json +8 -7
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{bh as u,ch as f,dh as _}from"./chunk-7svw66kw.js";import{Gh as R,Hh as T,Kh as S,Mh as h,Oh as k,lh as z,nh as C,rh as U,sh as I,uh as v,xh as b}from"./chunk-yp2zfcvh.js";import"./chunk-21x3anp4.js";import{Du as V}from"./chunk-ntvr3177.js";import"./chunk-8j3aw4qg.js";var m=class{constructor(j,G){this.modelId=j,this.config=G,this.specificationVersion="v3",this.maxImagesPerCall=1}get provider(){return this.config.provider}async doGenerate({prompt:j,n:G,size:P,aspectRatio:W,seed:N,providerOptions:K,headers:Y,abortSignal:X,files:Q,mask:q}){var F,Z,J,A,D;let $=[],B=(J=(Z=(F=this.config._internal)==null?void 0:F.currentDate)==null?void 0:Z.call(F))!=null?J:new Date;if(Q!=null&&Q.length>0){let{value:y,responseHeaders:c}=await T({url:this.getEditUrl(),headers:z(this.config.headers(),Y),formData:U({model:this.modelId,prompt:j,image:await Promise.all(Q.map((H)=>w(H))),mask:q!=null?await w(q):void 0,n:G,size:P,...(A=K.deepinfra)!=null?A:{}},{useArrayBrackets:!1}),failedResponseHandler:S({errorSchema:t,errorToMessage:(H)=>{var x,M;return(M=(x=H.error)==null?void 0:x.message)!=null?M:"Unknown error"}}),successfulResponseHandler:h(d),abortSignal:X,fetch:this.config.fetch});return{images:y.data.map((H)=>H.b64_json),warnings:$,response:{timestamp:B,modelId:this.modelId,headers:c}}}let E=P==null?void 0:P.split("x"),{value:L,responseHeaders:O}=await R({url:`${this.config.baseURL}/${this.modelId}`,headers:z(this.config.headers(),Y),body:{prompt:j,num_images:G,...W&&{aspect_ratio:W},...E&&{width:E[0],height:E[1]},...N!=null&&{seed:N},...(D=K.deepinfra)!=null?D:{}},failedResponseHandler:S({errorSchema:g,errorToMessage:(y)=>y.detail.error}),successfulResponseHandler:h(p),abortSignal:X,fetch:this.config.fetch});return{images:L.images.map((y)=>y.replace(/^data:image\/\w+;base64,/,"")),warnings:$,response:{timestamp:B,modelId:this.modelId,headers:O}}}getEditUrl(){return`${this.config.baseURL.replace("/inference","/openai")}/images/edits`}},g=V.object({detail:V.object({error:V.string()})}),p=V.object({images:V.array(V.string())}),t=V.object({error:V.object({message:V.string()}).optional()}),d=V.object({data:V.array(V.object({b64_json:V.string()}))});async function w(j){if(j.type==="url")return I(j.url);let G=j.data instanceof Uint8Array?j.data:C(j.data);return new Blob([G],{type:j.mediaType})}var l=class extends u{constructor(j,G){super(j,G)}fixUsageForGeminiModels(j){var G,P;if(!j||!((G=j.completion_tokens_details)==null?void 0:G.reasoning_tokens))return j;let W=(P=j.completion_tokens)!=null?P:0,N=j.completion_tokens_details.reasoning_tokens;if(N>W){let K=W+N;return{...j,completion_tokens:K,total_tokens:j.total_tokens!=null?j.total_tokens+N:void 0}}return j}async doGenerate(j){var G,P,W,N,K,Y,X;let Q=await super.doGenerate(j);if((G=Q.usage)==null?void 0:G.raw){let q=this.fixUsageForGeminiModels(Q.usage.raw);if(q!==Q.usage.raw){let F=(P=q.prompt_tokens)!=null?P:0,Z=(W=q.completion_tokens)!=null?W:0,J=(K=(N=q.prompt_tokens_details)==null?void 0:N.cached_tokens)!=null?K:0,A=(X=(Y=q.completion_tokens_details)==null?void 0:Y.reasoning_tokens)!=null?X:0;return{...Q,usage:{inputTokens:{total:F,noCache:F-J,cacheRead:J,cacheWrite:void 0},outputTokens:{total:Z,text:Z-A,reasoning:A},raw:q}}}}return Q}async doStream(j){let G=await super.doStream(j),P=G.stream,W=this.fixUsageForGeminiModels.bind(this),N=new ReadableStream({async start(K){var Y,X,Q,q,F,Z,J;let A=P.getReader();try{while(!0){let{done:D,value:$}=await A.read();if(D)break;if($.type==="finish"&&((Y=$.usage)==null?void 0:Y.raw)){let B=W($.usage.raw);if(B!==$.usage.raw){let E=(X=B.prompt_tokens)!=null?X:0,L=(Q=B.completion_tokens)!=null?Q:0,O=(F=(q=B.prompt_tokens_details)==null?void 0:q.cached_tokens)!=null?F:0,y=(J=(Z=B.completion_tokens_details)==null?void 0:Z.reasoning_tokens)!=null?J:0;K.enqueue({...$,usage:{inputTokens:{total:E,noCache:E-O,cacheRead:O,cacheWrite:void 0},outputTokens:{total:L,text:L-y,reasoning:y},raw:B}})}else K.enqueue($)}else K.enqueue($)}K.close()}catch(D){K.error(D)}}});return{...G,stream:N}}},n="2.0.41";function i(j={}){var G;let P=k((G=j.baseURL)!=null?G:"https://api.deepinfra.com/v1"),W=()=>v({Authorization:`Bearer ${b({apiKey:j.apiKey,environmentVariableName:"DEEPINFRA_API_KEY",description:"DeepInfra's API key"})}`,...j.headers},`ai-sdk/deepinfra/${n}`),N=(F)=>({provider:`deepinfra.${F}`,url:({path:Z})=>`${P}/openai${Z}`,headers:W,fetch:j.fetch}),K=(F)=>{return new l(F,N("chat"))},Y=(F)=>new f(F,N("completion")),X=(F)=>new _(F,N("embedding")),Q=(F)=>new m(F,{...N("image"),baseURL:P?`${P}/inference`:"https://api.deepinfra.com/v1/inference"}),q=(F)=>K(F);return q.specificationVersion="v3",q.completionModel=Y,q.chatModel=K,q.image=Q,q.imageModel=Q,q.languageModel=K,q.embeddingModel=X,q.textEmbeddingModel=X,q}var jj=i();export{jj as deepinfra,i as createDeepInfra,n as VERSION};
@@ -0,0 +1,3 @@
1
+ // @bun
2
+ import{af as q,yc as d}from"./chunk-7848rf5q.js";import{mp as B,op as V}from"./chunk-zhd8f4pc.js";import{ks as N}from"./chunk-8jy0dvcn.js";import{eC as H}from"./chunk-1mqsg5s7.js";import{PF as U}from"./chunk-9g64kggy.js";import{QF as Q,UF as ee}from"./chunk-8j3aw4qg.js";var g=Q(U(),1);var L=g.trace.wrapSpanContext(g.INVALID_SPAN_CONTEXT),W=g.trace.getTracer("muxcode.run"),Y=N.make(B.layer,{memoMap:V}),k;function _(e){if(!e)return;let t=Object.entries(e).flatMap(([n,r])=>r===void 0?[]:[[n,r]]);if(t.length===0)return;return Object.fromEntries(t)}function Z(e){if(typeof e==="string")return e;if(e instanceof Error)return e.message||e.name;return String(e)}function D(){if(!B.enabled)return Promise.resolve();if(k)return k;return k=Y.runPromise(H.void).then(()=>{return},(e)=>{throw k=void 0,e}),k}function X(e,t){return t.then((n)=>{return e.end(),n},(n)=>{throw v(e,n),e.end(),n})}function le(e,t){let n=_(t);if(!n)return;e.setAttributes(n)}function v(e,t){let n=Z(t);e.recordException(t instanceof Error?t:n),e.setStatus({code:g.SpanStatusCode.ERROR,message:n})}function ce(e,t,n){if(!B.enabled)return n(L);return D().then(()=>{let r=W.startSpan(e,{attributes:_(t)});return g.context.with(g.trace.setSpan(g.context.active(),r),()=>X(r,new Promise((f)=>{f(n(r))})))},()=>n(L))}var S=d.fromValues(0,0,0,0);function h(e,t){return d.fromValues(e.r,e.g,e.b,Math.max(0,Math.min(1,t)))}function x(e,t){let n=d.fromHex(e);return t===void 0?n:h(n,t)}function te(e){return 0.299*e.r+0.587*e.g+0.114*e.b>0.5?"light":"dark"}function w(e,t,n,r,f){if(e.a===0)return d.fromValues(e.r,e.g,e.b,Math.max(0,Math.min(1,n)));let o=Math.min(f,e.a*r),i=Math.min(1,o/e.a);return d.fromValues(t.r+(e.r-t.r)*i,t.g+(e.g-t.g)*i,t.b+(e.b-t.b)*i,e.a)}function J(e){if(e<16){let t=["#000000","#800000","#008000","#808000","#000080","#800080","#008080","#c0c0c0","#808080","#ff0000","#00ff00","#ffff00","#0000ff","#ff00ff","#00ffff","#ffffff"];return d.fromHex(t[e]??"#000000")}if(e<232){let t=e-16,n=t%6,r=Math.floor(t/6)%6,f=Math.floor(t/36),o=(i)=>i===0?0:i*40+55;return d.fromInts(o(f),o(r),o(n))}if(e<256){let t=(e-232)*10+8;return d.fromInts(t,t,t)}return d.fromInts(0,0,0)}function C(e,t,n){return d.fromInts(Math.round((e.r+(t.r-e.r)*n)*255),Math.round((e.g+(t.g-e.g)*n)*255),Math.round((e.b+(t.b-e.b)*n)*255))}function E(e,t){if(e.a>=1)return e;return d.fromValues(t.r+(e.r-t.r)*e.a,t.g+(e.g-t.g)*e.a,t.b+(e.b-t.b)*e.a,1)}function ne(e){return Math.max(e.r,e.g,e.b)-Math.min(e.r,e.g,e.b)}function re(e,t){if(!e)return;return q.fromStyles(Object.fromEntries([...e.getAllStyles()].map(([n,r])=>[n,{...r,fg:r.fg?E(r.fg,t):r.fg,bg:r.bg?E(r.bg,t):r.bg}])))}function $(e,t=Math.max(e.palette.length,16)){return Array.from({length:t},(n,r)=>{let f=e.palette[r];return d.fromIndex(r,f?d.fromHex(f):J(r))})}function T(e,t){let n=e.reduce((r,f)=>{let o=f.r-t.r,i=f.g-t.g,m=f.b-t.b,l=o*o+i*i+m*m;if(l>=r.dist)return r;return{dist:l,item:f}},{dist:Number.POSITIVE_INFINITY,item:e[0]});return d.clone(n.item)}function A(e,t,n,r){let f=C(t,n,r);return T(e,f)}function oe(e,t){let n=e.defs??{},r=(o,i=[])=>{if(o instanceof d)return o;if(typeof o==="number")return d.fromIndex(o,J(o));if(typeof o!=="string")return r(o[t],i);if(o==="transparent"||o==="none")return d.fromInts(0,0,0,0);if(o.startsWith("#"))return d.fromHex(o);if(i.includes(o))throw Error(`Circular color reference: ${[...i,o].join(" -> ")}`);let m=n[o]??e.theme[o];if(m===void 0)throw Error(`Color reference "${o}" not found in defs or theme`);return r(m,[...i,o])},f=Object.fromEntries(Object.entries(e.theme).filter(([o])=>o!=="selectedListItemText"&&o!=="backgroundMenu"&&o!=="thinkingOpacity").map(([o,i])=>[o,r(i)]));return{...f,selectedListItemText:e.theme.selectedListItemText===void 0?f.background:r(e.theme.selectedListItemText),backgroundMenu:e.theme.backgroundMenu===void 0?f.backgroundElement:r(e.theme.backgroundMenu),thinkingOpacity:e.theme.thinkingOpacity??0.6}}function F(e,t,n){let r=e.r*255,f=e.g*255,o=e.b*255,i=0.299*r+0.587*f+0.114*o,m=0.25*(1-ne(e))**2,l=(b)=>{let s=b/12;if(t&&i<10){let c=Math.floor(s*0.4*255);return n(d.fromInts(c,c,c))}if(!t&&i>245){let c=Math.floor(255-s*0.4*255);return n(d.fromInts(c,c,c))}let y=t?i+(255-i)*s*0.4:i*(1-s*0.4),p=d.fromInts(Math.floor(y),Math.floor(y),Math.floor(y));if(m===0)return n(p);let a=i===0?0:y/i;return n(C(p,d.fromInts(Math.floor(Math.max(0,Math.min(r*a,255))),Math.floor(Math.max(0,Math.min(f*a,255))),Math.floor(Math.max(0,Math.min(o*a,255)))),m))};return Object.fromEntries(Array.from({length:12},(b,s)=>[s+1,l(s+1)]))}function de(e,t,n){let r=0.299*e.r*255+0.587*e.g*255+0.114*e.b*255,f=t?r<10?180:Math.min(Math.floor(160+r*0.3),200):r>245?75:Math.max(Math.floor(100-(255-r)*0.2),60);return n(d.fromInts(f,f,f))}function fe(e,t){let n=d.fromHex(e.defaultBackground??e.palette[0]),r=d.fromHex(e.defaultForeground??e.palette[7]),f=d.defaultBackground(n),o=d.defaultForeground(r),i=t==="dark",m=$(e),l=(I)=>d.clone(m[I]),b=(I)=>T(m,I),s=F(n,i,b),y=F(n,i,(I)=>I),p=de(n,i,b),a={red:l(1),green:l(2),yellow:l(3),blue:l(4),magenta:l(5),cyan:l(6),red_bright:l(9),green_bright:l(10)},c=i?0.22:0.14,M=s[2],G=a.cyan,z=a.magenta;return{theme:{primary:G,secondary:z,accent:G,error:a.red,warning:a.yellow,success:a.green,info:a.cyan,text:o,textMuted:p,selectedListItemText:f,background:h(f,0),backgroundPanel:s[2],backgroundElement:s[3],backgroundMenu:y[3],borderSubtle:s[6],border:s[7],borderActive:s[8],diffAdded:a.green,diffRemoved:a.red,diffContext:s[7],diffHunkHeader:s[7],diffHighlightAdded:a.green_bright,diffHighlightRemoved:a.red_bright,diffAddedBg:b(C(n,a.green,c)),diffRemovedBg:b(C(n,a.red,c)),diffContextBg:M,diffLineNumber:p,diffAddedLineNumberBg:b(C(M,a.green,c)),diffRemovedLineNumberBg:b(C(M,a.red,c)),markdownText:o,markdownHeading:o,markdownLink:a.blue,markdownLinkText:a.cyan,markdownCode:a.green,markdownBlockQuote:a.yellow,markdownEmph:a.yellow,markdownStrong:o,markdownHorizontalRule:s[7],markdownListItem:a.blue,markdownListEnumeration:a.cyan,markdownImage:a.blue,markdownImageText:a.cyan,markdownCodeBlock:o,syntaxComment:p,syntaxKeyword:a.magenta,syntaxFunction:a.blue,syntaxVariable:o,syntaxString:a.green,syntaxNumber:a.yellow,syntaxType:a.cyan,syntaxOperator:a.cyan,syntaxPunctuation:o}}}function ie(e,t){let n=T(t,e.textMuted),r=T(t,e.text);return{left:n,right:r,leftShadow:A(t,e.background,n,0.14),rightShadow:A(t,e.background,r,0.14)}}function ae(e,t,n,r){let f=re(r,e.background);r?.destroy();let o=w(e.backgroundMenu,e.background,0.12,0.56,0.72),i=w(e.backgroundMenu,e.background,0.18,0.76,0.9),m=w(e.backgroundMenu,e.background,0.24,0.9,0.98);return{background:e.background,footer:{highlight:e.primary,warning:e.warning,success:e.success,error:e.error,muted:e.textMuted,text:e.text,shade:o,surface:i,pane:e.backgroundMenu,border:e.border,line:m},entry:{system:{body:e.textMuted},user:{body:e.primary},assistant:{body:e.text},reasoning:{body:e.textMuted},tool:{body:e.text,start:e.textMuted},error:{body:e.error}},splash:t,block:{text:e.text,muted:e.textMuted,syntax:n,subtleSyntax:f,diffAdded:e.diffAdded,diffRemoved:e.diffRemoved,diffAddedBg:S,diffRemovedBg:S,diffContextBg:S,diffHighlightAdded:e.diffHighlightAdded,diffHighlightRemoved:e.diffHighlightRemoved,diffLineNumber:e.diffLineNumber,diffAddedLineNumberBg:e.diffAddedLineNumberBg,diffRemovedLineNumberBg:e.diffRemovedLineNumberBg}}}var u={highlight:d.fromIndex(6,x("#38bdf8")),muted:d.fromIndex(8,x("#64748b")),text:d.defaultForeground(x("#f8fafc")),panel:x("#0f172a"),success:d.fromIndex(2,x("#22c55e")),warning:d.fromIndex(3,x("#f59e0b")),error:d.fromIndex(1,x("#ef4444"))};function R(e,t){return{body:e,start:t}}var O=Array.from({length:256},(e,t)=>d.fromIndex(t)),P=d.fromIndex(67),j=d.fromIndex(110),K={background:d.fromValues(0,0,0,0),footer:{highlight:u.highlight,warning:u.warning,success:u.success,error:u.error,muted:u.muted,text:u.text,shade:h(u.panel,0.68),surface:h(u.panel,0.86),pane:u.panel,border:u.muted,line:h(u.panel,0.96)},entry:{system:R(u.muted),user:R(u.highlight),assistant:R(u.text),reasoning:R(u.muted),tool:R(u.text,u.muted),error:R(u.error)},splash:{left:P,right:j,leftShadow:A(O,d.fromValues(0,0,0,0),P,0.14),rightShadow:A(O,d.fromValues(0,0,0,0),j,0.14)},block:{text:u.text,muted:u.muted,diffAdded:u.success,diffRemoved:u.error,diffAddedBg:h(u.success,0.18),diffRemovedBg:h(u.error,0.18),diffContextBg:h(u.panel,0.72),diffHighlightAdded:u.success,diffHighlightRemoved:u.error,diffLineNumber:u.muted,diffAddedLineNumberBg:h(u.success,0.12),diffRemovedLineNumberBg:h(u.error,0.12)}};async function be(e){try{let t=await e.getPalette({size:256}),n=t.defaultBackground??t.palette[0];if(!n)return K;let r=e.themeMode??te(d.fromHex(n)),f=oe(fe(t,r),r),o=$(t,256),i=await import("./chunk-snsb760m.js"),m={...f,_hasSelectedListItemText:!0},l=i.generateSyntax(m);return ae(f,ie(f,o),l,i.generateSubtleSyntax(m))}catch{return K}}
3
+ export{le as Ia,v as Ja,ce as Ka,S as La,K as Ma,be as Na};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import"./chunk-8j3aw4qg.js";var q="./tree-sitter-powershell-ryb2ffqs.wasm";export{q as default};
@@ -0,0 +1,3 @@
1
+ // @bun
2
+ import{RF as a}from"./chunk-8j3aw4qg.js";var i=a((f)=>{function u(t){let r={};if(t=t.replace(/^\?/,""),t)for(let n of t.split("&")){let[e,s=null]=n.split("=");if(e=decodeURIComponent(e),s)s=decodeURIComponent(s);if(!(e in r))r[e]=s;else if(Array.isArray(r[e]))r[e].push(s);else r[e]=[r[e],s]}return r}f.parseQueryString=u});var U=a((d)=>{var y=i(),c=(t)=>{if(typeof t==="string")return c(new URL(t));let{hostname:r,pathname:n,port:e,protocol:s,search:o}=t,p;if(o)p=y.parseQueryString(o);return{hostname:r,port:e?parseInt(e):void 0,protocol:s,path:n,query:p}};d.parseUrl=c});
3
+ export{U as Sg};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import"./chunk-8j3aw4qg.js";var D=Object.defineProperty,x=(J,Q,W)=>(Q in J)?D(J,Q,{enumerable:!0,configurable:!0,writable:!0,value:W}):J[Q]=W,B=(J,Q,W)=>x(J,typeof Q!=="symbol"?Q+"":Q,W),I="CF_TEMP_TOKEN",L=[{name:"openai",regex:/^https:\/\/api\.openai\.com\//,transformEndpoint:(J)=>J.replace(/^https:\/\/api\.openai\.com\//,"")},{name:"deepseek",regex:/^https:\/\/api\.deepseek\.com\//,transformEndpoint:(J)=>J.replace(/^https:\/\/api\.deepseek\.com\//,"")},{name:"anthropic",regex:/^https:\/\/api\.anthropic\.com\//,transformEndpoint:(J)=>J.replace(/^https:\/\/api\.anthropic\.com\//,""),headerKey:"x-api-key"},{name:"google-ai-studio",regex:/^https:\/\/generativelanguage\.googleapis\.com\//,headerKey:"x-goog-api-key",transformEndpoint:(J)=>J.replace(/^https:\/\/generativelanguage\.googleapis\.com\//,"")},{name:"google-vertex-ai",regex:/aiplatform\.googleapis\.com/,transformEndpoint:(J)=>J.replace(/https:\/\/(.*)[-]?aiplatform\.googleapis\.com\//,"")},{name:"grok",regex:/^https:\/\/api\.x\.ai\//,transformEndpoint:(J)=>J.replace(/^https:\/\/api\.x\.ai\//,"")},{name:"mistral",regex:/^https:\/\/api\.mistral\.ai\//,transformEndpoint:(J)=>J.replace(/^https:\/\/api\.mistral\.ai\//,"")},{name:"perplexity-ai",regex:/^https:\/\/api\.perplexity\.ai\//,transformEndpoint:(J)=>J.replace(/^https:\/\/api\.perplexity\.ai\//,"")},{name:"replicate",regex:/^https:\/\/api\.replicate\.com\//,transformEndpoint:(J)=>J.replace(/^https:\/\/api\.replicate\.com\//,"")},{name:"groq",regex:/^https:\/\/api\.groq\.com\/openai\/v1\//,transformEndpoint:(J)=>J.replace(/^https:\/\/api\.groq\.com\/openai\/v1\//,"")},{name:"google-vertex-ai",regex:/^https:\/\/(?:[a-z0-9]+-)*aiplatform\.googleapis\.com\//,transformEndpoint:(J)=>J.replace(/^https:\/\/(?:[a-z0-9]+-)*aiplatform\.googleapis\.com\//,""),headerKey:"authorization"},{name:"azure-openai",regex:/^https:\/\/(?<resource>[^.]+)\.openai\.azure\.com\/openai\/deployments\/(?<deployment>[^/]+)\/(?<rest>.*)$/,transformEndpoint:(J)=>{let Q=J.match(/^https:\/\/(?<resource>[^.]+)\.openai\.azure\.com\/openai\/deployments\/(?<deployment>[^/]+)\/(?<rest>.*)$/);if(!Q||!Q.groups)return J;let{resource:W,deployment:X,rest:Z}=Q.groups;if(!W||!X||!Z)throw Error("Failed to parse Azure OpenAI endpoint URL.");return`${W}/${X}/${Z}`},headerKey:"api-key"},{name:"openrouter",regex:/^https:\/\/openrouter\.ai\/api\//,transformEndpoint:(J)=>J.replace(/^https:\/\/openrouter\.ai\/api\//,"")},{name:"compat",regex:/^https:\/\/gateway\.ai\.cloudflare\.com\/v1\/compat\//,transformEndpoint:(J)=>J.replace(/^https:\/\/gateway\.ai\.cloudflare\.com\/v1\/compat\//,"")}],z=class extends Error{},P=class extends Error{},T=class extends Error{};async function U(J){return await new Response(J).json()}var H=class{constructor(J,Q){B(this,"specificationVersion","v3"),B(this,"defaultObjectGenerationMode","json"),B(this,"supportedUrls",{}),B(this,"models"),B(this,"config"),this.models=J,this.config=Q}get modelId(){if(!this.models[0])throw Error("models cannot be empty array");return this.models[0].modelId}get provider(){if(!this.models[0])throw Error("models cannot be empty array");return this.models[0].provider}async processModelRequest(J,Q){let W=[];for(let S of this.models){if(!S.config||!Object.keys(S.config).includes("fetch"))throw Error(`Sorry, but provider "${S.provider}" is currently not supported, please open a issue in the github repo!`);S.config.fetch=(V,$)=>{throw W.push({modelProvider:S.provider,request:$,url:V}),new z("Stopping provider execution...")};try{await S[Q](J)}catch(V){if(!(V instanceof z))throw V}}let X=await Promise.all(W.map(async(S)=>{let V=null;for(let R of L)if(R.regex.test(S.url))V=R;if(!V)throw Error(`Sorry, but provider "${S.modelProvider}" is currently not supported, please open a issue in the github repo!`);if(!S.request.body)throw Error("Ai Gateway provider received an unexpected empty body");let $=V.headerKey??"authorization";if(("get"in S.request.headers?S.request.headers.get($):S.request.headers[$])?.indexOf(I)!==-1)if("delete"in S.request.headers)S.request.headers.delete($);else delete S.request.headers[$];return{endpoint:V.transformEndpoint(S.url),headers:S.request.headers,provider:V.name,query:await U(S.request.body)}})),Z=N(this.config.options??{}),Y;if("binding"in this.config){let S=X.map((V)=>({...V,headers:{...V.headers??{},...Object.fromEntries(Z.entries())}}));Y=await this.config.binding.run(S,{signal:J.abortSignal})}else Z.set("Content-Type","application/json"),Z.set("cf-aig-authorization",`Bearer ${this.config.apiKey}`),Y=await fetch(`https://gateway.ai.cloudflare.com/v1/${this.config.accountId}/${this.config.gateway}`,{body:JSON.stringify(X),headers:Z,method:"POST",signal:J.abortSignal});if(Y.status===400){let V=await Y.clone().json();if(V.success===!1&&V.error&&V.error.length>0&&V.error[0]?.code===2001)throw new P("This AI gateway does not exist")}else if(Y.status===401){let V=await Y.clone().json();if(V.success===!1&&V.error&&V.error.length>0&&V.error[0]?.code===2009)throw new T("Your AI Gateway has authentication active, but you didn't provide a valid apiKey")}let K=Number.parseInt(Y.headers.get("cf-aig-step")??"0",10);if(!this.models[K])throw Error("Unexpected AI Gateway Error");return this.models[K].config={...this.models[K].config,fetch:(S,V)=>Y},this.models[K][Q](J)}async doStream(J){return this.processModelRequest(J,"doStream")}async doGenerate(J){return this.processModelRequest(J,"doGenerate")}};function f(J){let Q=(X)=>{return new H(Array.isArray(X)?X:[X],J)},W=(X)=>Q(X);return W.chat=Q,W}function N(J){let Q=new Headers;if(J.skipCache===!0)Q.set("cf-skip-cache","true");if(J.cacheTtl)Q.set("cf-cache-ttl",J.cacheTtl.toString());if(J.metadata)Q.set("cf-aig-metadata",JSON.stringify(J.metadata));if(J.cacheKey)Q.set("cf-aig-cache-key",J.cacheKey);if(J.collectLog!==void 0)Q.set("cf-aig-collect-log",J.collectLog===!0?"true":"false");if(J.eventId!==void 0)Q.set("cf-aig-event-id",J.eventId);if(J.requestTimeoutMs!==void 0)Q.set("cf-aig-request-timeout",J.requestTimeoutMs.toString());if(J.retries!==void 0){if(J.retries.maxAttempts!==void 0)Q.set("cf-aig-max-attempts",J.retries.maxAttempts.toString());if(J.retries.retryDelayMs!==void 0)Q.set("cf-aig-retry-delay",J.retries.retryDelayMs.toString());if(J.retries.backoff!==void 0)Q.set("cf-aig-backoff",J.retries.backoff)}return Q}export{N as parseAiGatewayOptions,f as createAiGateway,T as AiGatewayUnauthorizedError,z as AiGatewayInternalFetchError,P as AiGatewayDoesNotExist,H as AiGatewayChatLanguageModel};
@@ -0,0 +1,3 @@
1
+ // @bun
2
+ import{RF as e,UF as d}from"./chunk-8j3aw4qg.js";var jq=e((j)=>{var E=j&&j.__importDefault||function(q){return q&&q.__esModule?q:{default:q}};Object.defineProperty(j,"__esModule",{value:!0});j.Minipass=j.isWritable=j.isReadable=j.isStream=void 0;var T=typeof process==="object"&&process?process:{stdout:null,stderr:null},O=d("events"),s=E(d("stream")),qq=d("string_decoder"),zq=(q)=>!!q&&typeof q==="object"&&(q instanceof r||q instanceof s.default||(0,j.isReadable)(q)||(0,j.isWritable)(q));j.isStream=zq;var Qq=(q)=>!!q&&typeof q==="object"&&q instanceof O.EventEmitter&&typeof q.pipe==="function"&&q.pipe!==s.default.Writable.prototype.pipe;j.isReadable=Qq;var Xq=(q)=>!!q&&typeof q==="object"&&q instanceof O.EventEmitter&&typeof q.write==="function"&&typeof q.end==="function";j.isWritable=Xq;var f=Symbol("EOF"),l=Symbol("maybeEmitEnd"),H=Symbol("emittedEnd"),M=Symbol("emittingEnd"),_=Symbol("emittedError"),i=Symbol("closed"),c=Symbol("read"),v=Symbol("flush"),t=Symbol("flushChunk"),x=Symbol("encoding"),Y=Symbol("decoder"),Z=Symbol("flowing"),G=Symbol("paused"),P=Symbol("resume"),$=Symbol("buffer"),y=Symbol("pipes"),V=Symbol("bufferLength"),u=Symbol("bufferPush"),A=Symbol("bufferShift"),w=Symbol("objectMode"),X=Symbol("destroyed"),p=Symbol("error"),S=Symbol("emitData"),o=Symbol("emitEnd"),I=Symbol("emitEnd2"),W=Symbol("async"),N=Symbol("abort"),a=Symbol("aborted"),L=Symbol("signal"),g=Symbol("dataListeners"),m=Symbol("discarded"),C=(q)=>Promise.resolve().then(q),Zq=(q)=>q(),$q=(q)=>q==="end"||q==="finish"||q==="prefinish",Vq=(q)=>q instanceof ArrayBuffer||!!q&&typeof q==="object"&&q.constructor&&q.constructor.name==="ArrayBuffer"&&q.byteLength>=0,Kq=(q)=>!Buffer.isBuffer(q)&&ArrayBuffer.isView(q);class F{src;dest;opts;ondrain;constructor(q,z,Q){this.src=q,this.dest=z,this.opts=Q,this.ondrain=()=>q[P](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(q){}end(){if(this.unpipe(),this.opts.end)this.dest.end()}}class D extends F{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(q,z,Q){super(q,z,Q);this.proxyErrors=(K)=>this.dest.emit("error",K),q.on("error",this.proxyErrors)}}var wq=(q)=>!!q.objectMode,yq=(q)=>!q.objectMode&&!!q.encoding&&q.encoding!=="buffer";class r extends O.EventEmitter{[Z]=!1;[G]=!1;[y]=[];[$]=[];[w];[x];[W];[Y];[f]=!1;[H]=!1;[M]=!1;[i]=!1;[_]=null;[V]=0;[X]=!1;[L];[a]=!1;[g]=0;[m]=!1;writable=!0;readable=!0;constructor(...q){let z=q[0]||{};super();if(z.objectMode&&typeof z.encoding==="string")throw TypeError("Encoding and objectMode may not be used together");if(wq(z))this[w]=!0,this[x]=null;else if(yq(z))this[x]=z.encoding,this[w]=!1;else this[w]=!1,this[x]=null;if(this[W]=!!z.async,this[Y]=this[x]?new qq.StringDecoder(this[x]):null,z&&z.debugExposeBuffer===!0)Object.defineProperty(this,"buffer",{get:()=>this[$]});if(z&&z.debugExposePipes===!0)Object.defineProperty(this,"pipes",{get:()=>this[y]});let{signal:Q}=z;if(Q)if(this[L]=Q,Q.aborted)this[N]();else Q.addEventListener("abort",()=>this[N]())}get bufferLength(){return this[V]}get encoding(){return this[x]}set encoding(q){throw Error("Encoding must be set at instantiation time")}setEncoding(q){throw Error("Encoding must be set at instantiation time")}get objectMode(){return this[w]}set objectMode(q){throw Error("objectMode must be set at instantiation time")}get["async"](){return this[W]}set["async"](q){this[W]=this[W]||!!q}[N](){this[a]=!0,this.emit("abort",this[L]?.reason),this.destroy(this[L]?.reason)}get aborted(){return this[a]}set aborted(q){}write(q,z,Q){if(this[a])return!1;if(this[f])throw Error("write after end");if(this[X])return this.emit("error",Object.assign(Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;if(typeof z==="function")Q=z,z="utf8";if(!z)z="utf8";let K=this[W]?C:Zq;if(!this[w]&&!Buffer.isBuffer(q)){if(Kq(q))q=Buffer.from(q.buffer,q.byteOffset,q.byteLength);else if(Vq(q))q=Buffer.from(q);else if(typeof q!=="string")throw Error("Non-contiguous data written to non-objectMode stream")}if(this[w]){if(this[Z]&&this[V]!==0)this[v](!0);if(this[Z])this.emit("data",q);else this[u](q);if(this[V]!==0)this.emit("readable");if(Q)K(Q);return this[Z]}if(!q.length){if(this[V]!==0)this.emit("readable");if(Q)K(Q);return this[Z]}if(typeof q==="string"&&!(z===this[x]&&!this[Y]?.lastNeed))q=Buffer.from(q,z);if(Buffer.isBuffer(q)&&this[x])q=this[Y].write(q);if(this[Z]&&this[V]!==0)this[v](!0);if(this[Z])this.emit("data",q);else this[u](q);if(this[V]!==0)this.emit("readable");if(Q)K(Q);return this[Z]}read(q){if(this[X])return null;if(this[m]=!1,this[V]===0||q===0||q&&q>this[V])return this[l](),null;if(this[w])q=null;if(this[$].length>1&&!this[w])this[$]=[this[x]?this[$].join(""):Buffer.concat(this[$],this[V])];let z=this[c](q||null,this[$][0]);return this[l](),z}[c](q,z){if(this[w])this[A]();else{let Q=z;if(q===Q.length||q===null)this[A]();else if(typeof Q==="string")this[$][0]=Q.slice(q),z=Q.slice(0,q),this[V]-=q;else this[$][0]=Q.subarray(q),z=Q.subarray(0,q),this[V]-=q}if(this.emit("data",z),!this[$].length&&!this[f])this.emit("drain");return z}end(q,z,Q){if(typeof q==="function")Q=q,q=void 0;if(typeof z==="function")Q=z,z="utf8";if(q!==void 0)this.write(q,z);if(Q)this.once("end",Q);if(this[f]=!0,this.writable=!1,this[Z]||!this[G])this[l]();return this}[P](){if(this[X])return;if(!this[g]&&!this[y].length)this[m]=!0;if(this[G]=!1,this[Z]=!0,this.emit("resume"),this[$].length)this[v]();else if(this[f])this[l]();else this.emit("drain")}resume(){return this[P]()}pause(){this[Z]=!1,this[G]=!0,this[m]=!1}get destroyed(){return this[X]}get flowing(){return this[Z]}get paused(){return this[G]}[u](q){if(this[w])this[V]+=1;else this[V]+=q.length;this[$].push(q)}[A](){if(this[w])this[V]-=1;else this[V]-=this[$][0].length;return this[$].shift()}[v](q=!1){do;while(this[t](this[A]())&&this[$].length);if(!q&&!this[$].length&&!this[f])this.emit("drain")}[t](q){return this.emit("data",q),this[Z]}pipe(q,z){if(this[X])return q;this[m]=!1;let Q=this[H];if(z=z||{},q===T.stdout||q===T.stderr)z.end=!1;else z.end=z.end!==!1;if(z.proxyErrors=!!z.proxyErrors,Q){if(z.end)q.end()}else if(this[y].push(!z.proxyErrors?new F(this,q,z):new D(this,q,z)),this[W])C(()=>this[P]());else this[P]();return q}unpipe(q){let z=this[y].find((Q)=>Q.dest===q);if(z){if(this[y].length===1){if(this[Z]&&this[g]===0)this[Z]=!1;this[y]=[]}else this[y].splice(this[y].indexOf(z),1);z.unpipe()}}addListener(q,z){return this.on(q,z)}on(q,z){let Q=super.on(q,z);if(q==="data"){if(this[m]=!1,this[g]++,!this[y].length&&!this[Z])this[P]()}else if(q==="readable"&&this[V]!==0)super.emit("readable");else if($q(q)&&this[H])super.emit(q),this.removeAllListeners(q);else if(q==="error"&&this[_]){let K=z;if(this[W])C(()=>K.call(this,this[_]));else K.call(this,this[_])}return Q}removeListener(q,z){return this.off(q,z)}off(q,z){let Q=super.off(q,z);if(q==="data"){if(this[g]=this.listeners("data").length,this[g]===0&&!this[m]&&!this[y].length)this[Z]=!1}return Q}removeAllListeners(q){let z=super.removeAllListeners(q);if(q==="data"||q===void 0){if(this[g]=0,!this[m]&&!this[y].length)this[Z]=!1}return z}get emittedEnd(){return this[H]}[l](){if(!this[M]&&!this[H]&&!this[X]&&this[$].length===0&&this[f]){if(this[M]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[i])this.emit("close");this[M]=!1}}emit(q,...z){let Q=z[0];if(q!=="error"&&q!=="close"&&q!==X&&this[X])return!1;else if(q==="data")return!this[w]&&!Q?!1:this[W]?(C(()=>this[S](Q)),!0):this[S](Q);else if(q==="end")return this[o]();else if(q==="close"){if(this[i]=!0,!this[H]&&!this[X])return!1;let J=super.emit("close");return this.removeAllListeners("close"),J}else if(q==="error"){this[_]=Q,super.emit(p,Q);let J=!this[L]||this.listeners("error").length?super.emit("error",Q):!1;return this[l](),J}else if(q==="resume"){let J=super.emit("resume");return this[l](),J}else if(q==="finish"||q==="prefinish"){let J=super.emit(q);return this.removeAllListeners(q),J}let K=super.emit(q,...z);return this[l](),K}[S](q){for(let Q of this[y])if(Q.dest.write(q)===!1)this.pause();let z=this[m]?!1:super.emit("data",q);return this[l](),z}[o](){if(this[H])return!1;return this[H]=!0,this.readable=!1,this[W]?(C(()=>this[I]()),!0):this[I]()}[I](){if(this[Y]){let z=this[Y].end();if(z){for(let Q of this[y])Q.dest.write(z);if(!this[m])super.emit("data",z)}}for(let z of this[y])z.end();let q=super.emit("end");return this.removeAllListeners("end"),q}async collect(){let q=Object.assign([],{dataLength:0});if(!this[w])q.dataLength=0;let z=this.promise();return this.on("data",(Q)=>{if(q.push(Q),!this[w])q.dataLength+=Q.length}),await z,q}async concat(){if(this[w])throw Error("cannot concat in objectMode");let q=await this.collect();return this[x]?q.join(""):Buffer.concat(q,q.dataLength)}async promise(){return new Promise((q,z)=>{this.on(X,()=>z(Error("stream destroyed"))),this.on("error",(Q)=>z(Q)),this.on("end",()=>q())})}[Symbol.asyncIterator](){this[m]=!1;let q=!1,z=async()=>{return this.pause(),q=!0,{value:void 0,done:!0}};return{next:()=>{if(q)return z();let K=this.read();if(K!==null)return Promise.resolve({done:!1,value:K});if(this[f])return z();let J,R,U=(b)=>{this.off("data",B),this.off("end",h),this.off(X,k),z(),R(b)},B=(b)=>{this.off("error",U),this.off("end",h),this.off(X,k),this.pause(),J({value:b,done:!!this[f]})},h=()=>{this.off("error",U),this.off("data",B),this.off(X,k),z(),J({done:!0,value:void 0})},k=()=>U(Error("stream destroyed"));return new Promise((b,n)=>{R=n,J=b,this.once(X,k),this.once("error",U),this.once("end",h),this.once("data",B)})},throw:z,return:z,[Symbol.asyncIterator](){return this},[Symbol.asyncDispose]:async()=>{}}}[Symbol.iterator](){this[m]=!1;let q=!1,z=()=>{return this.pause(),this.off(p,z),this.off(X,z),this.off("end",z),q=!0,{done:!0,value:void 0}},Q=()=>{if(q)return z();let K=this.read();return K===null?z():{done:!1,value:K}};return this.once("end",z),this.once(p,z),this.once(X,z),{next:Q,throw:z,return:z,[Symbol.iterator](){return this},[Symbol.dispose]:()=>{}}}destroy(q){if(this[X]){if(q)this.emit("error",q);else this.emit(X);return this}this[X]=!0,this[m]=!0,this[$].length=0,this[V]=0;let z=this;if(typeof z.close==="function"&&!this[i])z.close();if(q)this.emit("error",q);else this.emit(X);return this}static get isStream(){return j.isStream}}j.Minipass=r});
3
+ export{jq as Gi};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import"./chunk-8j3aw4qg.js";var F="./tree-sitter-markdown-411r6y9b.wasm";export{F as default};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Fu as a,Gu as b,Hu as c,Iu as d,Ju as e,Ku as f,Lu as g,Mu as h}from"./chunk-9h1pwxb2.js";import"./chunk-8j3aw4qg.js";export{g as types,f as lookup,e as extensions,d as extension,c as contentType,b as charsets,a as charset,h as _extensionConflicts};export default {get types(){return g},get lookup(){return f},get extensions(){return e},get extension(){return d},get contentType(){return c},get charsets(){return b},get charset(){return a},get _extensionConflicts(){return h}};
@@ -0,0 +1,3 @@
1
+ // @bun
2
+ import{PF as T}from"./chunk-9g64kggy.js";import{RF as G,UF as J}from"./chunk-8j3aw4qg.js";var K=G((Q)=>{Object.defineProperty(Q,"__esModule",{value:!0});Q.AbstractAsyncHooksContextManager=void 0;var b=J("events"),f=["addListener","on","once","prependListener","prependOnceListener"];class P{bind(q,j){if(j instanceof b.EventEmitter)return this._bindEventEmitter(q,j);if(typeof j==="function")return this._bindFunction(q,j);return j}_bindFunction(q,j){let z=this,w=function(...B){return z.with(q,()=>j.apply(this,B))};return Object.defineProperty(w,"length",{enumerable:!1,configurable:!0,writable:!1,value:j.length}),w}_bindEventEmitter(q,j){if(this._getPatchMap(j)!==void 0)return j;if(this._createPatchMap(j),f.forEach((w)=>{if(j[w]===void 0)return;j[w]=this._patchAddListener(j,j[w],q)}),typeof j.removeListener==="function")j.removeListener=this._patchRemoveListener(j,j.removeListener);if(typeof j.off==="function")j.off=this._patchRemoveListener(j,j.off);if(typeof j.removeAllListeners==="function")j.removeAllListeners=this._patchRemoveAllListeners(j,j.removeAllListeners);return j}_patchRemoveListener(q,j){let z=this;return function(w,B){let D=z._getPatchMap(q)?.[w];if(D===void 0)return j.call(this,w,B);let E=D.get(B);return j.call(this,w,E||B)}}_patchRemoveAllListeners(q,j){let z=this;return function(w){let B=z._getPatchMap(q);if(B!==void 0){if(arguments.length===0)z._createPatchMap(q);else if(B[w]!==void 0)delete B[w]}return j.apply(this,arguments)}}_patchAddListener(q,j,z){let w=this;return function(B,D){if(w._wrapped)return j.call(this,B,D);let E=w._getPatchMap(q);if(E===void 0)E=w._createPatchMap(q);let F=E[B];if(F===void 0)F=new WeakMap,E[B]=F;let O=w.bind(z,D);F.set(D,O),w._wrapped=!0;try{return j.call(this,B,O)}finally{w._wrapped=!1}}}_createPatchMap(q){let j=Object.create(null);return q[this._kOtListeners]=j,j}_getPatchMap(q){return q[this._kOtListeners]}_kOtListeners=Symbol("OtListeners");_wrapped=!1}Q.AbstractAsyncHooksContextManager=P});var Y=G((V)=>{Object.defineProperty(V,"__esModule",{value:!0});V.AsyncHooksContextManager=void 0;var u=T(),L=J("async_hooks"),N=K();class U extends N.AbstractAsyncHooksContextManager{_asyncHook;_contexts=new Map;_stack=[];constructor(){super();this._asyncHook=L.createHook({init:this._init.bind(this),before:this._before.bind(this),after:this._after.bind(this),destroy:this._destroy.bind(this),promiseResolve:this._destroy.bind(this)})}active(){return this._stack[this._stack.length-1]??u.ROOT_CONTEXT}with(q,j,z,...w){this._enterContext(q);try{return j.call(z,...w)}finally{this._exitContext()}}enable(){return this._asyncHook.enable(),this}disable(){return this._asyncHook.disable(),this._contexts.clear(),this._stack=[],this}_init(q,j){if(j==="TIMERWRAP")return;let z=this._stack[this._stack.length-1];if(z!==void 0)this._contexts.set(q,z)}_destroy(q){this._contexts.delete(q)}_before(q){let j=this._contexts.get(q);if(j!==void 0)this._enterContext(j)}_after(){this._exitContext()}_enterContext(q){this._stack.push(q)}_exitContext(){this._stack.pop()}}V.AsyncHooksContextManager=U});var S=G(($)=>{Object.defineProperty($,"__esModule",{value:!0});$.AsyncLocalStorageContextManager=void 0;var H=T(),k=J("async_hooks"),_=K();class Z extends _.AbstractAsyncHooksContextManager{_asyncLocalStorage;constructor(){super();this._asyncLocalStorage=new k.AsyncLocalStorage}active(){return this._asyncLocalStorage.getStore()??H.ROOT_CONTEXT}with(q,j,z,...w){let B=z==null?j:j.bind(z);return this._asyncLocalStorage.run(q,B,...w)}enable(){return this}disable(){return this._asyncLocalStorage.disable(),this}}$.AsyncLocalStorageContextManager=Z});var h=G((I)=>{Object.defineProperty(I,"__esModule",{value:!0});I.AsyncLocalStorageContextManager=I.AsyncHooksContextManager=void 0;var C=Y();Object.defineProperty(I,"AsyncHooksContextManager",{enumerable:!0,get:function(){return C.AsyncHooksContextManager}});var y=S();Object.defineProperty(I,"AsyncLocalStorageContextManager",{enumerable:!0,get:function(){return y.AsyncLocalStorageContextManager}})});
3
+ export{h as pv};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import"./chunk-8j3aw4qg.js";var a="./highlights-x6tmsnaa.scm";export{a as default};
@@ -0,0 +1,3 @@
1
+ // @bun
2
+ function k({onlyFirst:j=!1}={}){return new RegExp("(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]",j?void 0:"g")}var q=k();function v(j){if(typeof j!=="string")throw TypeError(`Expected a \`string\`, got \`${typeof j}\``);return j.replace(q,"")}
3
+ export{v as uj};
@@ -0,0 +1,38 @@
1
+ // @bun
2
+ import{Yk as AJ,bl as R$}from"./chunk-rpp44jtx.js";import{cl as j6,jl as H$,nl as I$}from"./chunk-4mgyaytc.js";import{Hl as j0,Rl as iJ,Sl as nJ}from"./chunk-22qpzg37.js";import{Dn as mJ,En as rJ,Fn as O$,fo as m1,mn as _0,nn as D0,rn as _$,zn as D$}from"./chunk-vqrnejgj.js";import{$o as V1,Ar as W1,Bq as E$,Br as $2,Cp as p,Cr as d0,Dr as q1,Ip as b1,Lr as vJ,Op as x,Pp as X1,Qq as n0,Up as y$,Vq as k$,Zq as q0,br as F0,gq as v0,jq as K0,kp as e$,kq as bJ,no as Y1,oo as lJ,oq as uJ,po as S1,pq as fJ,qo as H0,rp as t$,tp as i1,tq as L$,wp as P1,xp as H1,yp as RJ}from"./chunk-zhd8f4pc.js";import{$r as d}from"./chunk-ygpen625.js";import{bs as j$,gs as s}from"./chunk-my9cfmvt.js";import{vs as B$,xs as L1}from"./chunk-8jy0dvcn.js";import{AF as N,Dw as N$,Fx as U1,Hz as _1,TC as p0,Yz as b,eC as X,fD as L0,fz as s1,hE as z2,pE as v,tz as hJ}from"./chunk-1mqsg5s7.js";import{QF as Q2,RF as a,SF as j1,UF as N1}from"./chunk-8j3aw4qg.js";var c$=a((X9,y0)=>{function b$($){return Array.isArray($)?$:[$]}var RZ=void 0,l0="",S$=" ",h0="\\",AZ=/^\s+$/,IZ=/(?:[^\\]|^)\\$/,TZ=/^\\!/,EZ=/^\\#/,kZ=/\r?\n/g,xZ=/^\.{0,2}\/|^\.{1,2}$/,SZ=/\/$/,k1="/",f$="node-ignore";if(typeof Symbol<"u")f$=Symbol.for("node-ignore");var v$=f$,x1=($,J,Z)=>{return Object.defineProperty($,J,{value:Z}),Z},gZ=/([0-z])-([0-z])/g,d$=()=>!1,bZ=($)=>$.replace(gZ,(J,Z,U)=>Z.charCodeAt(0)<=U.charCodeAt(0)?J:l0),fZ=($)=>{let{length:J}=$;return $.slice(0,J-J%2)},vZ=[[/^\uFEFF/,()=>l0],[/((?:\\\\)*?)(\\?\s+)$/,($,J,Z)=>J+(Z.indexOf("\\")===0?S$:l0)],[/(\\+?)\s/g,($,J)=>{let{length:Z}=J;return J.slice(0,Z-Z%2)+S$}],[/[\\$.|*+(){^]/g,($)=>`\\${$}`],[/(?!\\)\?/g,()=>"[^/]"],[/^\//,()=>"^"],[/\//g,()=>"\\/"],[/^\^*\\\*\\\*\\\//,()=>"^(?:.*\\/)?"],[/^(?=[^^])/,function(){return!/\/(?!$)/.test(this)?"(?:^|\\/)":"^"}],[/\\\/\\\*\\\*(?=\\\/|$)/g,($,J,Z)=>J+6<Z.length?"(?:\\/[^\\/]+)*":"\\/.+"],[/(^|[^\\]+)(\\\*)+(?=.+)/g,($,J,Z)=>{let U=Z.replace(/\\\*/g,"[^\\/]*");return J+U}],[/\\\\\\(?=[$.|*+(){^])/g,()=>h0],[/\\\\/g,()=>h0],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,($,J,Z,U,V)=>J===h0?`\\[${Z}${fZ(U)}${V}`:V==="]"?U.length%2===0?`[${bZ(Z)}${U}]`:"[]":"[]"],[/(?:[^*])$/,($)=>/\/$/.test($)?`${$}$`:`${$}(?=$|\\/$)`]],dZ=/(^|\\\/)?\\\*$/,n1="regex",P0="checkRegex",g$="_",hZ={[n1]($,J){return`${J?`${J}[^/]+`:"[^/]*"}(?=$|\\/$)`},[P0]($,J){return`${J?`${J}[^/]*`:"[^/]*"}(?=$|\\/$)`}},lZ=($)=>vZ.reduce((J,[Z,U])=>J.replace(Z,U.bind($)),$),N0=($)=>typeof $==="string",uZ=($)=>$&&N0($)&&!AZ.test($)&&!IZ.test($)&&$.indexOf("#")!==0,mZ=($)=>$.split(kZ).filter(Boolean);class h${constructor($,J,Z,U,V,W){this.pattern=$,this.mark=J,this.negative=V,x1(this,"body",Z),x1(this,"ignoreCase",U),x1(this,"regexPrefix",W)}get regex(){let $=g$+n1;if(this[$])return this[$];return this._make(n1,$)}get checkRegex(){let $=g$+P0;if(this[$])return this[$];return this._make(P0,$)}_make($,J){let Z=this.regexPrefix.replace(dZ,hZ[$]),U=this.ignoreCase?new RegExp(Z,"i"):new RegExp(Z);return x1(this,J,U)}}var rZ=({pattern:$,mark:J},Z)=>{let U=!1,V=$;if(V.indexOf("!")===0)U=!0,V=V.substr(1);V=V.replace(TZ,"!").replace(EZ,"#");let W=lZ(V);return new h$($,J,V,Z,U,W)};class l${constructor($){this._ignoreCase=$,this._rules=[]}_add($){if($&&$[v$]){this._rules=this._rules.concat($._rules._rules),this._added=!0;return}if(N0($))$={pattern:$};if(uZ($.pattern)){let J=rZ($,this._ignoreCase);this._added=!0,this._rules.push(J)}}add($){return this._added=!1,b$(N0($)?mZ($):$).forEach(this._add,this),this._added}test($,J,Z){let U=!1,V=!1,W;this._rules.forEach((Q)=>{let{negative:j}=Q;if(V===j&&U!==V||j&&!U&&!V&&!J)return;if(!Q[Z].test($))return;U=!j,V=j,W=j?RZ:Q});let Y={ignored:U,unignored:V};if(W)Y.rule=W;return Y}}var cZ=($,J)=>{throw new J($)},w1=($,J,Z)=>{if(!N0($))return Z(`path must be a string, but got \`${J}\``,TypeError);if(!$)return Z("path must not be empty",TypeError);if(w1.isNotRelative($))return Z(`path should be a \`path.relative()\`d string, but got "${J}"`,RangeError);return!0},u$=($)=>xZ.test($);w1.isNotRelative=u$;w1.convert=($)=>$;class m${constructor({ignorecase:$=!0,ignoreCase:J=$,allowRelativePaths:Z=!1}={}){x1(this,v$,!0),this._rules=new l$(J),this._strictPathCheck=!Z,this._initCache()}_initCache(){this._ignoreCache=Object.create(null),this._testCache=Object.create(null)}add($){if(this._rules.add($))this._initCache();return this}addPattern($){return this.add($)}_test($,J,Z,U){let V=$&&w1.convert($);return w1(V,$,this._strictPathCheck?cZ:d$),this._t(V,J,Z,U)}checkIgnore($){if(!SZ.test($))return this.test($);let J=$.split(k1).filter(Boolean);if(J.pop(),J.length){let Z=this._t(J.join(k1)+k1,this._testCache,!0,J);if(Z.ignored)return Z}return this._rules.test($,!1,P0)}_t($,J,Z,U){if($ in J)return J[$];if(!U)U=$.split(k1).filter(Boolean);if(U.pop(),!U.length)return J[$]=this._rules.test($,Z,n1);let V=this._t(U.join(k1)+k1,J,Z,U);return J[$]=V.ignored?V:this._rules.test($,Z,n1)}ignores($){return this._test($,this._ignoreCache,!1).ignored}createFilter(){return($)=>!this.ignores($)}filter($){return b$($).filter(this.createFilter())}test($){return this._test($,this._testCache,!0)}}var u0=($)=>new m$($),pZ=($)=>w1($&&w1.convert($),$,d$),r$=()=>{let $=(Z)=>/^\\\\\?\\/.test(Z)||/["<>|\u0000-\u001F]+/u.test(Z)?Z:Z.replace(/\\/g,"/");w1.convert=$;let J=/^[a-z]:\//i;w1.isNotRelative=(Z)=>J.test(Z)||u$(Z)};if(typeof process<"u"&&process.platform==="win32")r$();y0.exports=u0;u0.default=u0;y0.exports.isPathValid=pZ;x1(y0.exports,Symbol.for("setupWindows"),r$)});var R0=a((g6)=>{g6.isInteger=($)=>{if(typeof $==="number")return Number.isInteger($);if(typeof $==="string"&&$.trim()!=="")return Number.isInteger(Number($));return!1};g6.find=($,J)=>$.nodes.find((Z)=>Z.type===J);g6.exceedsLimit=($,J,Z=1,U)=>{if(U===!1)return!1;if(!g6.isInteger($)||!g6.isInteger(J))return!1;return(Number(J)-Number($))/Number(Z)>=U};g6.escapeNode=($,J=0,Z)=>{let U=$.nodes[J];if(!U)return;if(Z&&U.type===Z||U.type==="open"||U.type==="close"){if(U.escaped!==!0)U.value="\\"+U.value,U.escaped=!0}};g6.encloseBrace=($)=>{if($.type!=="brace")return!1;if($.commas>>0+$.ranges>>0===0)return $.invalid=!0,!0;return!1};g6.isInvalidBrace=($)=>{if($.type!=="brace")return!1;if($.invalid===!0||$.dollar)return!0;if($.commas>>0+$.ranges>>0===0)return $.invalid=!0,!0;if($.open!==!0||$.close!==!0)return $.invalid=!0,!0;return!1};g6.isOpenOrClose=($)=>{if($.type==="open"||$.type==="close")return!0;return $.open===!0||$.close===!0};g6.reduce=($)=>$.reduce((J,Z)=>{if(Z.type==="text")J.push(Z.value);if(Z.type==="range")Z.type="text";return J},[]);g6.flatten=(...$)=>{let J=[],Z=(U)=>{for(let V=0;V<U.length;V++){let W=U[V];if(Array.isArray(W)){Z(W);continue}if(W!==void 0)J.push(W)}return J};return Z($),J}});var A0=a((b9,G2)=>{var B2=R0();G2.exports=($,J={})=>{let Z=(U,V={})=>{let W=J.escapeInvalid&&B2.isInvalidBrace(V),Y=U.invalid===!0&&J.escapeInvalid===!0,Q="";if(U.value){if((W||Y)&&B2.isOpenOrClose(U))return"\\"+U.value;return U.value}if(U.value)return U.value;if(U.nodes)for(let j of U.nodes)Q+=Z(j);return Q};return Z($)}});var q2=a((f9,w2)=>{/*!
3
+ * is-number <https://github.com/jonschlinkert/is-number>
4
+ *
5
+ * Copyright (c) 2014-present, Jon Schlinkert.
6
+ * Released under the MIT License.
7
+ */w2.exports=function($){if(typeof $==="number")return $-$===0;if(typeof $==="string"&&$.trim()!=="")return Number.isFinite?Number.isFinite(+$):isFinite(+$);return!1}});var _2=a((v9,H2)=>{/*!
8
+ * to-regex-range <https://github.com/micromatch/to-regex-range>
9
+ *
10
+ * Copyright (c) 2015-present, Jon Schlinkert.
11
+ * Released under the MIT License.
12
+ */var F2=q2(),D1=($,J,Z)=>{if(F2($)===!1)throw TypeError("toRegexRange: expected the first argument to be a number");if(J===void 0||$===J)return String($);if(F2(J)===!1)throw TypeError("toRegexRange: expected the second argument to be a number.");let U={relaxZeros:!0,...Z};if(typeof U.strictZeros==="boolean")U.relaxZeros=U.strictZeros===!1;let V=String(U.relaxZeros),W=String(U.shorthand),Y=String(U.capture),Q=String(U.wrap),j=$+":"+J+"="+V+W+Y+Q;if(D1.cache.hasOwnProperty(j))return D1.cache[j].result;let q=Math.min($,J),C=Math.max($,J);if(Math.abs(q-C)===1){let M=$+"|"+J;if(U.capture)return`(${M})`;if(U.wrap===!1)return M;return`(?:${M})`}let P=L2($)||L2(J),K={min:$,max:J,a:q,b:C},A=[],z=[];if(P)K.isPadded=P,K.maxLen=String(K.max).length;if(q<0){let M=C<0?Math.abs(C):1;z=C2(M,Math.abs(q),K,U),q=K.a=0}if(C>=0)A=C2(q,C,K,U);if(K.negatives=z,K.positives=A,K.result=r6(z,A,U),U.capture===!0)K.result=`(${K.result})`;else if(U.wrap!==!1&&A.length+z.length>1)K.result=`(?:${K.result})`;return D1.cache[j]=K,K.result};function r6($,J,Z){let U=a0($,J,"-",!1,Z)||[],V=a0(J,$,"",!1,Z)||[],W=a0($,J,"-?",!0,Z)||[];return U.concat(W).concat(V).join("|")}function c6($,J){let Z=1,U=1,V=N2($,Z),W=new Set([J]);while($<=V&&V<=J)W.add(V),Z+=1,V=N2($,Z);V=y2(J+1,U)-1;while($<V&&V<=J)W.add(V),U+=1,V=y2(J+1,U)-1;return W=[...W],W.sort(n6),W}function p6($,J,Z){if($===J)return{pattern:$,count:[],digits:0};let U=i6($,J),V=U.length,W="",Y=0;for(let Q=0;Q<V;Q++){let[j,q]=U[Q];if(j===q)W+=j;else if(j!=="0"||q!=="9")W+=o6(j,q,Z);else Y++}if(Y)W+=Z.shorthand===!0?"\\d":"[0-9]";return{pattern:W,count:[Y],digits:V}}function C2($,J,Z,U){let V=c6($,J),W=[],Y=$,Q;for(let j=0;j<V.length;j++){let q=V[j],C=p6(String(Y),String(q),U),P="";if(!Z.isPadded&&Q&&Q.pattern===C.pattern){if(Q.count.length>1)Q.count.pop();Q.count.push(C.count[0]),Q.string=Q.pattern+O2(Q.count),Y=q+1;continue}if(Z.isPadded)P=a6(q,Z,U);C.string=P+C.pattern+O2(C.count),W.push(C),Y=q+1,Q=C}return W}function a0($,J,Z,U,V){let W=[];for(let Y of $){let{string:Q}=Y;if(!U&&!P2(J,"string",Q))W.push(Z+Q);if(U&&P2(J,"string",Q))W.push(Z+Q)}return W}function i6($,J){let Z=[];for(let U=0;U<$.length;U++)Z.push([$[U],J[U]]);return Z}function n6($,J){return $>J?1:J>$?-1:0}function P2($,J,Z){return $.some((U)=>U[J]===Z)}function N2($,J){return Number(String($).slice(0,-J)+"9".repeat(J))}function y2($,J){return $-$%Math.pow(10,J)}function O2($){let[J=0,Z=""]=$;if(Z||J>1)return`{${J+(Z?","+Z:"")}}`;return""}function o6($,J,Z){return`[${$}${J-$===1?"":"-"}${J}]`}function L2($){return/^-?(0+)\d/.test($)}function a6($,J,Z){if(!J.isPadded)return $;let U=Math.abs(J.maxLen-String($).length),V=Z.relaxZeros!==!1;switch(U){case 0:return"";case 1:return V?"0?":"0";case 2:return V?"0{0,2}":"00";default:return V?`0{0,${U}}`:`0{${U}}`}}D1.cache={};D1.clearCache=()=>D1.cache={};H2.exports=D1});var t0=a((d9,k2)=>{/*!
13
+ * fill-range <https://github.com/jonschlinkert/fill-range>
14
+ *
15
+ * Copyright (c) 2014-present, Jon Schlinkert.
16
+ * Licensed under the MIT License.
17
+ */var s6=N1("util"),R2=_2(),D2=($)=>$!==null&&typeof $==="object"&&!Array.isArray($),e6=($)=>{return(J)=>$===!0?Number(J):String(J)},s0=($)=>{return typeof $==="number"||typeof $==="string"&&$!==""},J0=($)=>Number.isInteger(+$),e0=($)=>{let J=`${$}`,Z=-1;if(J[0]==="-")J=J.slice(1);if(J==="0")return!1;while(J[++Z]==="0");return Z>0},t6=($,J,Z)=>{if(typeof $==="string"||typeof J==="string")return!0;return Z.stringify===!0},$5=($,J,Z)=>{if(J>0){let U=$[0]==="-"?"-":"";if(U)$=$.slice(1);$=U+$.padStart(U?J-1:J,"0")}if(Z===!1)return String($);return $},T0=($,J)=>{let Z=$[0]==="-"?"-":"";if(Z)$=$.slice(1),J--;while($.length<J)$="0"+$;return Z?"-"+$:$},J5=($,J,Z)=>{$.negatives.sort((Q,j)=>Q<j?-1:Q>j?1:0),$.positives.sort((Q,j)=>Q<j?-1:Q>j?1:0);let U=J.capture?"":"?:",V="",W="",Y;if($.positives.length)V=$.positives.map((Q)=>T0(String(Q),Z)).join("|");if($.negatives.length)W=`-(${U}${$.negatives.map((Q)=>T0(String(Q),Z)).join("|")})`;if(V&&W)Y=`${V}|${W}`;else Y=V||W;if(J.wrap)return`(${U}${Y})`;return Y},A2=($,J,Z,U)=>{if(Z)return R2($,J,{wrap:!1,...U});let V=String.fromCharCode($);if($===J)return V;let W=String.fromCharCode(J);return`[${V}-${W}]`},I2=($,J,Z)=>{if(Array.isArray($)){let U=Z.wrap===!0,V=Z.capture?"":"?:";return U?`(${V}${$.join("|")})`:$.join("|")}return R2($,J,Z)},T2=(...$)=>{return RangeError("Invalid range arguments: "+s6.inspect(...$))},E2=($,J,Z)=>{if(Z.strictRanges===!0)throw T2([$,J]);return[]},Z5=($,J)=>{if(J.strictRanges===!0)throw TypeError(`Expected step "${$}" to be a number`);return[]},U5=($,J,Z=1,U={})=>{let V=Number($),W=Number(J);if(!Number.isInteger(V)||!Number.isInteger(W)){if(U.strictRanges===!0)throw T2([$,J]);return[]}if(V===0)V=0;if(W===0)W=0;let Y=V>W,Q=String($),j=String(J),q=String(Z);Z=Math.max(Math.abs(Z),1);let C=e0(Q)||e0(j)||e0(q),P=C?Math.max(Q.length,j.length,q.length):0,K=C===!1&&t6($,J,U)===!1,A=U.transform||e6(K);if(U.toRegex&&Z===1)return A2(T0($,P),T0(J,P),!0,U);let z={negatives:[],positives:[]},M=(F)=>z[F<0?"negatives":"positives"].push(Math.abs(F)),L=[],D=0;while(Y?V>=W:V<=W){if(U.toRegex===!0&&Z>1)M(V);else L.push($5(A(V,D),P,K));V=Y?V-Z:V+Z,D++}if(U.toRegex===!0)return Z>1?J5(z,U,P):I2(L,null,{wrap:!1,...U});return L},V5=($,J,Z=1,U={})=>{if(!J0($)&&$.length>1||!J0(J)&&J.length>1)return E2($,J,U);let V=U.transform||((K)=>String.fromCharCode(K)),W=`${$}`.charCodeAt(0),Y=`${J}`.charCodeAt(0),Q=W>Y,j=Math.min(W,Y),q=Math.max(W,Y);if(U.toRegex&&Z===1)return A2(j,q,!1,U);let C=[],P=0;while(Q?W>=Y:W<=Y)C.push(V(W,P)),W=Q?W-Z:W+Z,P++;if(U.toRegex===!0)return I2(C,null,{wrap:!1,options:U});return C},I0=($,J,Z,U={})=>{if(J==null&&s0($))return[$];if(!s0($)||!s0(J))return E2($,J,U);if(typeof Z==="function")return I0($,J,1,{transform:Z});if(D2(Z))return I0($,J,0,Z);let V={...U};if(V.capture===!0)V.wrap=!0;if(Z=Z||V.step||1,!J0(Z)){if(Z!=null&&!D2(Z))return Z5(Z,V);return I0($,J,1,Z)}if(J0($)&&J0(J))return U5($,J,Z,V);return V5($,J,Math.max(Math.abs(Z),1),V)};k2.exports=I0});var g2=a((h9,S2)=>{var W5=t0(),x2=R0(),Y5=($,J={})=>{let Z=(U,V={})=>{let W=x2.isInvalidBrace(V),Y=U.invalid===!0&&J.escapeInvalid===!0,Q=W===!0||Y===!0,j=J.escapeInvalid===!0?"\\":"",q="";if(U.isOpen===!0)return j+U.value;if(U.isClose===!0)return console.log("node.isClose",j,U.value),j+U.value;if(U.type==="open")return Q?j+U.value:"(";if(U.type==="close")return Q?j+U.value:")";if(U.type==="comma")return U.prev.type==="comma"?"":Q?U.value:"|";if(U.value)return U.value;if(U.nodes&&U.ranges>0){let C=x2.reduce(U.nodes),P=W5(...C,{...J,wrap:!1,toRegex:!0,strictZeros:!0});if(P.length!==0)return C.length>1&&P.length>1?`(${P})`:P}if(U.nodes)for(let C of U.nodes)q+=Z(C,U);return q};return Z($)};S2.exports=Y5});var v2=a((l9,f2)=>{var X5=t0(),b2=A0(),v1=R0(),R1=($="",J="",Z=!1)=>{let U=[];if($=[].concat($),J=[].concat(J),!J.length)return $;if(!$.length)return Z?v1.flatten(J).map((V)=>`{${V}}`):J;for(let V of $)if(Array.isArray(V))for(let W of V)U.push(R1(W,J,Z));else for(let W of J){if(Z===!0&&typeof W==="string")W=`{${W}}`;U.push(Array.isArray(W)?R1(V,W,Z):V+W)}return v1.flatten(U)},Q5=($,J={})=>{let Z=J.rangeLimit===void 0?1000:J.rangeLimit,U=(V,W={})=>{V.queue=[];let Y=W,Q=W.queue;while(Y.type!=="brace"&&Y.type!=="root"&&Y.parent)Y=Y.parent,Q=Y.queue;if(V.invalid||V.dollar){Q.push(R1(Q.pop(),b2(V,J)));return}if(V.type==="brace"&&V.invalid!==!0&&V.nodes.length===2){Q.push(R1(Q.pop(),["{}"]));return}if(V.nodes&&V.ranges>0){let P=v1.reduce(V.nodes);if(v1.exceedsLimit(...P,J.step,Z))throw RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");let K=X5(...P,J);if(K.length===0)K=b2(V,J);Q.push(R1(Q.pop(),K)),V.nodes=[];return}let j=v1.encloseBrace(V),q=V.queue,C=V;while(C.type!=="brace"&&C.type!=="root"&&C.parent)C=C.parent,q=C.queue;for(let P=0;P<V.nodes.length;P++){let K=V.nodes[P];if(K.type==="comma"&&V.type==="brace"){if(P===1)q.push("");q.push("");continue}if(K.type==="close"){Q.push(R1(Q.pop(),q,j));continue}if(K.value&&K.type!=="open"){q.push(R1(q.pop(),K.value));continue}if(K.nodes)U(K,V)}return q};return v1.flatten(U($))};f2.exports=Q5});var h2=a((u9,d2)=>{d2.exports={MAX_LENGTH:1e4,CHAR_0:"0",CHAR_9:"9",CHAR_UPPERCASE_A:"A",CHAR_LOWERCASE_A:"a",CHAR_UPPERCASE_Z:"Z",CHAR_LOWERCASE_Z:"z",CHAR_LEFT_PARENTHESES:"(",CHAR_RIGHT_PARENTHESES:")",CHAR_ASTERISK:"*",CHAR_AMPERSAND:"&",CHAR_AT:"@",CHAR_BACKSLASH:"\\",CHAR_BACKTICK:"`",CHAR_CARRIAGE_RETURN:"\r",CHAR_CIRCUMFLEX_ACCENT:"^",CHAR_COLON:":",CHAR_COMMA:",",CHAR_DOLLAR:"$",CHAR_DOT:".",CHAR_DOUBLE_QUOTE:'"',CHAR_EQUAL:"=",CHAR_EXCLAMATION_MARK:"!",CHAR_FORM_FEED:"\f",CHAR_FORWARD_SLASH:"/",CHAR_HASH:"#",CHAR_HYPHEN_MINUS:"-",CHAR_LEFT_ANGLE_BRACKET:"<",CHAR_LEFT_CURLY_BRACE:"{",CHAR_LEFT_SQUARE_BRACKET:"[",CHAR_LINE_FEED:`
18
+ `,CHAR_NO_BREAK_SPACE:"\xA0",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:"\t",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\uFEFF"}});var c2=a((m9,r2)=>{var z5=A0(),{MAX_LENGTH:l2,CHAR_BACKSLASH:$$,CHAR_BACKTICK:K5,CHAR_COMMA:M5,CHAR_DOT:j5,CHAR_LEFT_PARENTHESES:B5,CHAR_RIGHT_PARENTHESES:G5,CHAR_LEFT_CURLY_BRACE:w5,CHAR_RIGHT_CURLY_BRACE:q5,CHAR_LEFT_SQUARE_BRACKET:u2,CHAR_RIGHT_SQUARE_BRACKET:m2,CHAR_DOUBLE_QUOTE:F5,CHAR_SINGLE_QUOTE:C5,CHAR_NO_BREAK_SPACE:P5,CHAR_ZERO_WIDTH_NOBREAK_SPACE:N5}=h2(),y5=($,J={})=>{if(typeof $!=="string")throw TypeError("Expected a string");let Z=J||{},U=typeof Z.maxLength==="number"?Math.min(l2,Z.maxLength):l2;if($.length>U)throw SyntaxError(`Input length (${$.length}), exceeds max characters (${U})`);let V={type:"root",input:$,nodes:[]},W=[V],Y=V,Q=V,j=0,q=$.length,C=0,P=0,K,A=()=>$[C++],z=(M)=>{if(M.type==="text"&&Q.type==="dot")Q.type="text";if(Q&&Q.type==="text"&&M.type==="text"){Q.value+=M.value;return}return Y.nodes.push(M),M.parent=Y,M.prev=Q,Q=M,M};z({type:"bos"});while(C<q){if(Y=W[W.length-1],K=A(),K===N5||K===P5)continue;if(K===$$){z({type:"text",value:(J.keepEscaping?K:"")+A()});continue}if(K===m2){z({type:"text",value:"\\"+K});continue}if(K===u2){j++;let M;while(C<q&&(M=A())){if(K+=M,M===u2){j++;continue}if(M===$$){K+=A();continue}if(M===m2){if(j--,j===0)break}}z({type:"text",value:K});continue}if(K===B5){Y=z({type:"paren",nodes:[]}),W.push(Y),z({type:"text",value:K});continue}if(K===G5){if(Y.type!=="paren"){z({type:"text",value:K});continue}Y=W.pop(),z({type:"text",value:K}),Y=W[W.length-1];continue}if(K===F5||K===C5||K===K5){let M=K,L;if(J.keepQuotes!==!0)K="";while(C<q&&(L=A())){if(L===$$){K+=L+A();continue}if(L===M){if(J.keepQuotes===!0)K+=L;break}K+=L}z({type:"text",value:K});continue}if(K===w5){P++;let L={type:"brace",open:!0,close:!1,dollar:Q.value&&Q.value.slice(-1)==="$"||Y.dollar===!0,depth:P,commas:0,ranges:0,nodes:[]};Y=z(L),W.push(Y),z({type:"open",value:K});continue}if(K===q5){if(Y.type!=="brace"){z({type:"text",value:K});continue}let M="close";Y=W.pop(),Y.close=!0,z({type:M,value:K}),P--,Y=W[W.length-1];continue}if(K===M5&&P>0){if(Y.ranges>0){Y.ranges=0;let M=Y.nodes.shift();Y.nodes=[M,{type:"text",value:z5(Y)}]}z({type:"comma",value:K}),Y.commas++;continue}if(K===j5&&P>0&&Y.commas===0){let M=Y.nodes;if(P===0||M.length===0){z({type:"text",value:K});continue}if(Q.type==="dot"){if(Y.range=[],Q.value+=K,Q.type="range",Y.nodes.length!==3&&Y.nodes.length!==5){Y.invalid=!0,Y.ranges=0,Q.type="text";continue}Y.ranges++,Y.args=[];continue}if(Q.type==="range"){M.pop();let L=M[M.length-1];L.value+=Q.value+K,Q=L,Y.ranges--;continue}z({type:"dot",value:K});continue}z({type:"text",value:K})}do if(Y=W.pop(),Y.type!=="root"){Y.nodes.forEach((D)=>{if(!D.nodes){if(D.type==="open")D.isOpen=!0;if(D.type==="close")D.isClose=!0;if(!D.nodes)D.type="text";D.invalid=!0}});let M=W[W.length-1],L=M.nodes.indexOf(Y);M.nodes.splice(L,1,...Y.nodes)}while(W.length>0);return z({type:"eos"}),V};r2.exports=y5});var n2=a((r9,i2)=>{var p2=A0(),O5=g2(),L5=v2(),H5=c2(),Z1=($,J={})=>{let Z=[];if(Array.isArray($))for(let U of $){let V=Z1.create(U,J);if(Array.isArray(V))Z.push(...V);else Z.push(V)}else Z=[].concat(Z1.create($,J));if(J&&J.expand===!0&&J.nodupes===!0)Z=[...new Set(Z)];return Z};Z1.parse=($,J={})=>H5($,J);Z1.stringify=($,J={})=>{if(typeof $==="string")return p2(Z1.parse($,J),J);return p2($,J)};Z1.compile=($,J={})=>{if(typeof $==="string")$=Z1.parse($,J);return O5($,J)};Z1.expand=($,J={})=>{if(typeof $==="string")$=Z1.parse($,J);let Z=L5($,J);if(J.noempty===!0)Z=Z.filter(Boolean);if(J.nodupes===!0)Z=[...new Set(Z)];return Z};Z1.create=($,J={})=>{if($===""||$.length<3)return[$];return J.expand!==!0?Z1.compile($,J):Z1.expand($,J)};i2.exports=Z1});var Z0=a((c9,a2)=>{var _5=N1("path"),o2={DOT_LITERAL:"\\.",PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:"\\/",ONE_CHAR:"(?=.)",QMARK:"[^/]",END_ANCHOR:"(?:\\/|$)",DOTS_SLASH:"\\.{1,2}(?:\\/|$)",NO_DOT:"(?!\\.)",NO_DOTS:"(?!(?:^|\\/)\\.{1,2}(?:\\/|$))",NO_DOT_SLASH:"(?!\\.{0,1}(?:\\/|$))",NO_DOTS_SLASH:"(?!\\.{1,2}(?:\\/|$))",QMARK_NO_DOT:"[^.\\/]",STAR:"[^/]*?",START_ANCHOR:"(?:^|\\/)"},D5={...o2,SLASH_LITERAL:"[\\\\/]",QMARK:"[^\\\\/]",STAR:"[^\\\\/]*?",DOTS_SLASH:"\\.{1,2}(?:[\\\\/]|$)",NO_DOT:"(?!\\.)",NO_DOTS:"(?!(?:^|[\\\\/])\\.{1,2}(?:[\\\\/]|$))",NO_DOT_SLASH:"(?!\\.{0,1}(?:[\\\\/]|$))",NO_DOTS_SLASH:"(?!\\.{1,2}(?:[\\\\/]|$))",QMARK_NO_DOT:"[^.\\\\/]",START_ANCHOR:"(?:^|[\\\\/])",END_ANCHOR:"(?:[\\\\/]|$)"},R5={__proto__:null,alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};a2.exports={DEFAULT_MAX_EXTGLOB_RECURSION:0,MAX_LENGTH:65536,POSIX_REGEX_SOURCE:R5,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:_5.sep,extglobChars($){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${$.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars($){return $===!0?D5:o2}}});var U0=a((S5)=>{var A5=N1("path"),I5=process.platform==="win32",{REGEX_BACKSLASH:T5,REGEX_REMOVE_BACKSLASH:E5,REGEX_SPECIAL_CHARS:k5,REGEX_SPECIAL_CHARS_GLOBAL:x5}=Z0();S5.isObject=($)=>$!==null&&typeof $==="object"&&!Array.isArray($);S5.hasRegexChars=($)=>k5.test($);S5.isRegexChar=($)=>$.length===1&&S5.hasRegexChars($);S5.escapeRegex=($)=>$.replace(x5,"\\$1");S5.toPosixSlashes=($)=>$.replace(T5,"/");S5.removeBackslashes=($)=>{return $.replace(E5,(J)=>{return J==="\\"?"":J})};S5.supportsLookbehinds=()=>{let $=process.version.slice(1).split(".").map(Number);if($.length===3&&$[0]>=9||$[0]===8&&$[1]>=10)return!0;return!1};S5.isWindows=($)=>{if($&&typeof $.windows==="boolean")return $.windows;return I5===!0||A5.sep==="\\"};S5.escapeLast=($,J,Z)=>{let U=$.lastIndexOf(J,Z);if(U===-1)return $;if($[U-1]==="\\")return S5.escapeLast($,J,U-1);return`${$.slice(0,U)}\\${$.slice(U)}`};S5.removePrefix=($,J={})=>{let Z=$;if(Z.startsWith("./"))Z=Z.slice(2),J.prefix="./";return Z};S5.wrapOutput=($,J={},Z={})=>{let U=Z.contains?"":"^",V=Z.contains?"":"$",W=`${U}(?:${$})${V}`;if(J.negated===!0)W=`(?:^(?!${W}).*$)`;return W}});var YJ=a((i9,WJ)=>{var t2=U0(),{CHAR_ASTERISK:J$,CHAR_AT:r5,CHAR_BACKWARD_SLASH:V0,CHAR_COMMA:c5,CHAR_DOT:Z$,CHAR_EXCLAMATION_MARK:U$,CHAR_FORWARD_SLASH:VJ,CHAR_LEFT_CURLY_BRACE:V$,CHAR_LEFT_PARENTHESES:W$,CHAR_LEFT_SQUARE_BRACKET:p5,CHAR_PLUS:i5,CHAR_QUESTION_MARK:$J,CHAR_RIGHT_CURLY_BRACE:n5,CHAR_RIGHT_PARENTHESES:JJ,CHAR_RIGHT_SQUARE_BRACKET:o5}=Z0(),ZJ=($)=>{return $===VJ||$===V0},UJ=($)=>{if($.isPrefix!==!0)$.depth=$.isGlobstar?1/0:1},a5=($,J)=>{let Z=J||{},U=$.length-1,V=Z.parts===!0||Z.scanToEnd===!0,W=[],Y=[],Q=[],j=$,q=-1,C=0,P=0,K=!1,A=!1,z=!1,M=!1,L=!1,D=!1,F=!1,O=!1,T=!1,y=!1,_=0,E,H,k={value:"",depth:0,isGlob:!1},n=()=>q>=U,w=()=>j.charCodeAt(q+1),r=()=>{return E=H,j.charCodeAt(++q)};while(q<U){H=r();let t;if(H===V0){if(F=k.backslashes=!0,H=r(),H===V$)D=!0;continue}if(D===!0||H===V$){_++;while(n()!==!0&&(H=r())){if(H===V0){F=k.backslashes=!0,r();continue}if(H===V$){_++;continue}if(D!==!0&&H===Z$&&(H=r())===Z$){if(K=k.isBrace=!0,z=k.isGlob=!0,y=!0,V===!0)continue;break}if(D!==!0&&H===c5){if(K=k.isBrace=!0,z=k.isGlob=!0,y=!0,V===!0)continue;break}if(H===n5){if(_--,_===0){D=!1,K=k.isBrace=!0,y=!0;break}}}if(V===!0)continue;break}if(H===VJ){if(W.push(q),Y.push(k),k={value:"",depth:0,isGlob:!1},y===!0)continue;if(E===Z$&&q===C+1){C+=2;continue}P=q+1;continue}if(Z.noext!==!0){if((H===i5||H===r5||H===J$||H===$J||H===U$)===!0&&w()===W$){if(z=k.isGlob=!0,M=k.isExtglob=!0,y=!0,H===U$&&q===C)T=!0;if(V===!0){while(n()!==!0&&(H=r())){if(H===V0){F=k.backslashes=!0,H=r();continue}if(H===JJ){z=k.isGlob=!0,y=!0;break}}continue}break}}if(H===J$){if(E===J$)L=k.isGlobstar=!0;if(z=k.isGlob=!0,y=!0,V===!0)continue;break}if(H===$J){if(z=k.isGlob=!0,y=!0,V===!0)continue;break}if(H===p5){while(n()!==!0&&(t=r())){if(t===V0){F=k.backslashes=!0,r();continue}if(t===o5){A=k.isBracket=!0,z=k.isGlob=!0,y=!0;break}}if(V===!0)continue;break}if(Z.nonegate!==!0&&H===U$&&q===C){O=k.negated=!0,C++;continue}if(Z.noparen!==!0&&H===W$){if(z=k.isGlob=!0,V===!0){while(n()!==!0&&(H=r())){if(H===W$){F=k.backslashes=!0,H=r();continue}if(H===JJ){y=!0;break}}continue}break}if(z===!0){if(y=!0,V===!0)continue;break}}if(Z.noext===!0)M=!1,z=!1;let l=j,F1="",B="";if(C>0)F1=j.slice(0,C),j=j.slice(C),P-=C;if(l&&z===!0&&P>0)l=j.slice(0,P),B=j.slice(P);else if(z===!0)l="",B=j;else l=j;if(l&&l!==""&&l!=="/"&&l!==j){if(ZJ(l.charCodeAt(l.length-1)))l=l.slice(0,-1)}if(Z.unescape===!0){if(B)B=t2.removeBackslashes(B);if(l&&F===!0)l=t2.removeBackslashes(l)}let G={prefix:F1,input:$,start:C,base:l,glob:B,isBrace:K,isBracket:A,isGlob:z,isExtglob:M,isGlobstar:L,negated:O,negatedExtglob:T};if(Z.tokens===!0){if(G.maxDepth=0,!ZJ(H))Y.push(k);G.tokens=Y}if(Z.parts===!0||Z.tokens===!0){let t;for(let f=0;f<W.length;f++){let Q1=t?t+1:C,z1=W[f],J1=$.slice(Q1,z1);if(Z.tokens){if(f===0&&C!==0)Y[f].isPrefix=!0,Y[f].value=F1;else Y[f].value=J1;UJ(Y[f]),G.maxDepth+=Y[f].depth}if(f!==0||J1!=="")Q.push(J1);t=z1}if(t&&t+1<$.length){let f=$.slice(t+1);if(Q.push(f),Z.tokens)Y[Y.length-1].value=f,UJ(Y[Y.length-1]),G.maxDepth+=Y[Y.length-1].depth}G.slashes=W,G.parts=Q}return G};WJ.exports=a5});var MJ=a((n9,KJ)=>{var W0=Z0(),e=U0(),{MAX_LENGTH:E0,POSIX_REGEX_SOURCE:s5,REGEX_NON_SPECIAL_CHARS:e5,REGEX_SPECIAL_CHARS_BACKREF:t5,REPLACEMENTS:XJ}=W0,$7=($,J)=>{if(typeof J.expandRange==="function")return J.expandRange(...$,J);$.sort();let Z=`[${$.join("-")}]`;try{new RegExp(Z)}catch(U){return $.map((V)=>e.escapeRegex(V)).join("..")}return Z},d1=($,J)=>{return`Missing ${$}: "${J}" - use "\\\\${J}" to match literal characters`},QJ=($)=>{let J=[],Z=0,U=0,V=0,W="",Y=!1;for(let Q of $){if(Y===!0){W+=Q,Y=!1;continue}if(Q==="\\"){W+=Q,Y=!0;continue}if(Q==='"'){V=V===1?0:1,W+=Q;continue}if(V===0){if(Q==="[")Z++;else if(Q==="]"&&Z>0)Z--;else if(Z===0){if(Q==="(")U++;else if(Q===")"&&U>0)U--;else if(Q==="|"&&U===0){J.push(W),W="";continue}}}W+=Q}return J.push(W),J},J7=($)=>{let J=!1;for(let Z of $){if(J===!0){J=!1;continue}if(Z==="\\"){J=!0;continue}if(/[?*+@!()[\]{}]/.test(Z))return!1}return!0},zJ=($)=>{let J=$.trim(),Z=!0;while(Z===!0)if(Z=!1,/^@\([^\\()[\]{}|]+\)$/.test(J))J=J.slice(2,-1),Z=!0;if(!J7(J))return;return J.replace(/\\(.)/g,"$1")},Z7=($)=>{let J=$.map(zJ).filter(Boolean);for(let Z=0;Z<J.length;Z++)for(let U=Z+1;U<J.length;U++){let V=J[Z],W=J[U],Y=V[0];if(!Y||V!==Y.repeat(V.length)||W!==Y.repeat(W.length))continue;if(V===W||V.startsWith(W)||W.startsWith(V))return!0}return!1},Y$=($,J=!0)=>{if($[0]!=="+"&&$[0]!=="*"||$[1]!=="(")return;let Z=0,U=0,V=0,W=!1;for(let Y=1;Y<$.length;Y++){let Q=$[Y];if(W===!0){W=!1;continue}if(Q==="\\"){W=!0;continue}if(Q==='"'){V=V===1?0:1;continue}if(V===1)continue;if(Q==="["){Z++;continue}if(Q==="]"&&Z>0){Z--;continue}if(Z>0)continue;if(Q==="("){U++;continue}if(Q===")"){if(U--,U===0){if(J===!0&&Y!==$.length-1)return;return{type:$[0],body:$.slice(2,Y),end:Y}}}}},U7=($)=>{let J=0,Z=[];while(J<$.length){let V=Y$($.slice(J),!1);if(!V||V.type!=="*")return;let W=QJ(V.body).map((Q)=>Q.trim());if(W.length!==1)return;let Y=zJ(W[0]);if(!Y||Y.length!==1)return;Z.push(Y),J+=V.end+1}if(Z.length<1)return;return`${Z.length===1?e.escapeRegex(Z[0]):`[${Z.map((V)=>e.escapeRegex(V)).join("")}]`}*`},V7=($)=>{let J=0,Z=$.trim(),U=Y$(Z);while(U)J++,Z=U.body.trim(),U=Y$(Z);return J},W7=($,J)=>{if(J.maxExtglobRecursion===!1)return{risky:!1};let Z=typeof J.maxExtglobRecursion==="number"?J.maxExtglobRecursion:W0.DEFAULT_MAX_EXTGLOB_RECURSION,U=QJ($).map((V)=>V.trim());if(U.length>1){if(U.some((V)=>V==="")||U.some((V)=>/^[*?]+$/.test(V))||Z7(U))return{risky:!0}}for(let V of U){let W=U7(V);if(W)return{risky:!0,safeOutput:W};if(V7(V)>Z)return{risky:!0}}return{risky:!1}},X$=($,J)=>{if(typeof $!=="string")throw TypeError("Expected a string");$=XJ[$]||$;let Z={...J},U=typeof Z.maxLength==="number"?Math.min(E0,Z.maxLength):E0,V=$.length;if(V>U)throw SyntaxError(`Input length: ${V}, exceeds maximum allowed length: ${U}`);let W={type:"bos",value:"",output:Z.prepend||""},Y=[W],Q=Z.capture?"":"?:",j=e.isWindows(J),q=W0.globChars(j),C=W0.extglobChars(q),{DOT_LITERAL:P,PLUS_LITERAL:K,SLASH_LITERAL:A,ONE_CHAR:z,DOTS_SLASH:M,NO_DOT:L,NO_DOT_SLASH:D,NO_DOTS_SLASH:F,QMARK:O,QMARK_NO_DOT:T,STAR:y,START_ANCHOR:_}=q,E=(I)=>{return`(${Q}(?:(?!${_}${I.dot?M:P}).)*?)`},H=Z.dot?"":L,k=Z.dot?O:T,n=Z.bash===!0?E(Z):y;if(Z.capture)n=`(${n})`;if(typeof Z.noext==="boolean")Z.noextglob=Z.noext;let w={input:$,index:-1,start:0,dot:Z.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:Y};$=e.removePrefix($,w),V=$.length;let r=[],l=[],F1=[],B=W,G,t=()=>w.index===V-1,f=w.peek=(I=1)=>$[w.index+I],Q1=w.advance=()=>$[++w.index]||"",z1=()=>$.slice(w.index+1),J1=(I="",c=0)=>{w.consumed+=I,w.index+=c},B0=(I)=>{w.output+=I.output!=null?I.output:I.value,J1(I.value)},aJ=()=>{let I=1;while(f()==="!"&&(f(2)!=="("||f(3)==="?"))Q1(),w.start++,I++;if(I%2===0)return!1;return w.negated=!0,w.start++,!0},G0=(I)=>{w[I]++,F1.push(I)},C1=(I)=>{w[I]--,F1.pop()},g=(I)=>{if(B.type==="globstar"){let c=w.braces>0&&(I.type==="comma"||I.type==="brace"),R=I.extglob===!0||r.length&&(I.type==="pipe"||I.type==="paren");if(I.type!=="slash"&&I.type!=="paren"&&!c&&!R)w.output=w.output.slice(0,-B.output.length),B.type="star",B.value="*",B.output=n,w.output+=B.output}if(r.length&&I.type!=="paren")r[r.length-1].inner+=I.value;if(I.value||I.output)B0(I);if(B&&B.type==="text"&&I.type==="text"){B.value+=I.value,B.output=(B.output||"")+I.value;return}I.prev=B,Y.push(I),B=I},w0=(I,c)=>{let R={...C[c],conditions:1,inner:""};R.prev=B,R.parens=w.parens,R.output=w.output,R.startIndex=w.index,R.tokensIndex=Y.length;let S=(Z.capture?"(":"")+R.open;G0("parens"),g({type:I,value:c,output:w.output?"":z}),g({type:"paren",extglob:!0,value:Q1(),output:S}),r.push(R)},sJ=(I)=>{let c=$.slice(I.startIndex,w.index+1),R=$.slice(I.startIndex+2,w.index),S=W7(R,Z);if((I.type==="plus"||I.type==="star")&&S.risky){let h=S.safeOutput?(I.output?"":z)+(Z.capture?`(${S.safeOutput})`:S.safeOutput):void 0,K1=Y[I.tokensIndex];K1.type="text",K1.value=c,K1.output=h||e.escapeRegex(c);for(let M1=I.tokensIndex+1;M1<Y.length;M1++)Y[M1].value="",Y[M1].output="",delete Y[M1].suffix;w.output=I.output+K1.output,w.backtrack=!0,g({type:"paren",extglob:!0,value:G,output:""}),C1("parens");return}let u=I.close+(Z.capture?")":""),o;if(I.type==="negate"){let h=n;if(I.inner&&I.inner.length>1&&I.inner.includes("/"))h=E(Z);if(h!==n||t()||/^\)+$/.test(z1()))u=I.close=`)$))${h}`;if(I.inner.includes("*")&&(o=z1())&&/^\.[^\\/.]+$/.test(o)){let K1=X$(o,{...J,fastpaths:!1}).output;u=I.close=`)${K1})${h})`}if(I.prev.type==="bos")w.negatedExtglob=!0}g({type:"paren",extglob:!0,value:G,output:u}),C1("parens")};if(Z.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test($)){let I=!1,c=$.replace(t5,(R,S,u,o,h,K1)=>{if(o==="\\")return I=!0,R;if(o==="?"){if(S)return S+o+(h?O.repeat(h.length):"");if(K1===0)return k+(h?O.repeat(h.length):"");return O.repeat(u.length)}if(o===".")return P.repeat(u.length);if(o==="*"){if(S)return S+o+(h?n:"");return n}return S?R:`\\${R}`});if(I===!0)if(Z.unescape===!0)c=c.replace(/\\/g,"");else c=c.replace(/\\+/g,(R)=>{return R.length%2===0?"\\\\":R?"\\":""});if(c===$&&Z.contains===!0)return w.output=$,w;return w.output=e.wrapOutput(c,w,J),w}while(!t()){if(G=Q1(),G==="\x00")continue;if(G==="\\"){let R=f();if(R==="/"&&Z.bash!==!0)continue;if(R==="."||R===";")continue;if(!R){G+="\\",g({type:"text",value:G});continue}let S=/^\\+/.exec(z1()),u=0;if(S&&S[0].length>2){if(u=S[0].length,w.index+=u,u%2!==0)G+="\\"}if(Z.unescape===!0)G=Q1();else G+=Q1();if(w.brackets===0){g({type:"text",value:G});continue}}if(w.brackets>0&&(G!=="]"||B.value==="["||B.value==="[^")){if(Z.posix!==!1&&G===":"){let R=B.value.slice(1);if(R.includes("[")){if(B.posix=!0,R.includes(":")){let S=B.value.lastIndexOf("["),u=B.value.slice(0,S),o=B.value.slice(S+2),h=s5[o];if(h){if(B.value=u+h,w.backtrack=!0,Q1(),!W.output&&Y.indexOf(B)===1)W.output=z;continue}}}}if(G==="["&&f()!==":"||G==="-"&&f()==="]")G=`\\${G}`;if(G==="]"&&(B.value==="["||B.value==="[^"))G=`\\${G}`;if(Z.posix===!0&&G==="!"&&B.value==="[")G="^";B.value+=G,B0({value:G});continue}if(w.quotes===1&&G!=='"'){G=e.escapeRegex(G),B.value+=G,B0({value:G});continue}if(G==='"'){if(w.quotes=w.quotes===1?0:1,Z.keepQuotes===!0)g({type:"text",value:G});continue}if(G==="("){G0("parens"),g({type:"paren",value:G});continue}if(G===")"){if(w.parens===0&&Z.strictBrackets===!0)throw SyntaxError(d1("opening","("));let R=r[r.length-1];if(R&&w.parens===R.parens+1){sJ(r.pop());continue}g({type:"paren",value:G,output:w.parens?")":"\\)"}),C1("parens");continue}if(G==="["){if(Z.nobracket===!0||!z1().includes("]")){if(Z.nobracket!==!0&&Z.strictBrackets===!0)throw SyntaxError(d1("closing","]"));G=`\\${G}`}else G0("brackets");g({type:"bracket",value:G});continue}if(G==="]"){if(Z.nobracket===!0||B&&B.type==="bracket"&&B.value.length===1){g({type:"text",value:G,output:`\\${G}`});continue}if(w.brackets===0){if(Z.strictBrackets===!0)throw SyntaxError(d1("opening","["));g({type:"text",value:G,output:`\\${G}`});continue}C1("brackets");let R=B.value.slice(1);if(B.posix!==!0&&R[0]==="^"&&!R.includes("/"))G=`/${G}`;if(B.value+=G,B0({value:G}),Z.literalBrackets===!1||e.hasRegexChars(R))continue;let S=e.escapeRegex(B.value);if(w.output=w.output.slice(0,-B.value.length),Z.literalBrackets===!0){w.output+=S,B.value=S;continue}B.value=`(${Q}${S}|${B.value})`,w.output+=B.value;continue}if(G==="{"&&Z.nobrace!==!0){G0("braces");let R={type:"brace",value:G,output:"(",outputIndex:w.output.length,tokensIndex:w.tokens.length};l.push(R),g(R);continue}if(G==="}"){let R=l[l.length-1];if(Z.nobrace===!0||!R){g({type:"text",value:G,output:G});continue}let S=")";if(R.dots===!0){let u=Y.slice(),o=[];for(let h=u.length-1;h>=0;h--){if(Y.pop(),u[h].type==="brace")break;if(u[h].type!=="dots")o.unshift(u[h].value)}S=$7(o,Z),w.backtrack=!0}if(R.comma!==!0&&R.dots!==!0){let u=w.output.slice(0,R.outputIndex),o=w.tokens.slice(R.tokensIndex);R.value=R.output="\\{",G=S="\\}",w.output=u;for(let h of o)w.output+=h.output||h.value}g({type:"brace",value:G,output:S}),C1("braces"),l.pop();continue}if(G==="|"){if(r.length>0)r[r.length-1].conditions++;g({type:"text",value:G});continue}if(G===","){let R=G,S=l[l.length-1];if(S&&F1[F1.length-1]==="braces")S.comma=!0,R="|";g({type:"comma",value:G,output:R});continue}if(G==="/"){if(B.type==="dot"&&w.index===w.start+1){w.start=w.index+1,w.consumed="",w.output="",Y.pop(),B=W;continue}g({type:"slash",value:G,output:A});continue}if(G==="."){if(w.braces>0&&B.type==="dot"){if(B.value===".")B.output=P;let R=l[l.length-1];B.type="dots",B.output+=G,B.value+=G,R.dots=!0;continue}if(w.braces+w.parens===0&&B.type!=="bos"&&B.type!=="slash"){g({type:"text",value:G,output:P});continue}g({type:"dot",value:G,output:P});continue}if(G==="?"){if(!(B&&B.value==="(")&&Z.noextglob!==!0&&f()==="("&&f(2)!=="?"){w0("qmark",G);continue}if(B&&B.type==="paren"){let S=f(),u=G;if(S==="<"&&!e.supportsLookbehinds())throw Error("Node.js v10 or higher is required for regex lookbehinds");if(B.value==="("&&!/[!=<:]/.test(S)||S==="<"&&!/<([!=]|\w+>)/.test(z1()))u=`\\${G}`;g({type:"text",value:G,output:u});continue}if(Z.dot!==!0&&(B.type==="slash"||B.type==="bos")){g({type:"qmark",value:G,output:T});continue}g({type:"qmark",value:G,output:O});continue}if(G==="!"){if(Z.noextglob!==!0&&f()==="("){if(f(2)!=="?"||!/[!=<:]/.test(f(3))){w0("negate",G);continue}}if(Z.nonegate!==!0&&w.index===0){aJ();continue}}if(G==="+"){if(Z.noextglob!==!0&&f()==="("&&f(2)!=="?"){w0("plus",G);continue}if(B&&B.value==="("||Z.regex===!1){g({type:"plus",value:G,output:K});continue}if(B&&(B.type==="bracket"||B.type==="paren"||B.type==="brace")||w.parens>0){g({type:"plus",value:G});continue}g({type:"plus",value:K});continue}if(G==="@"){if(Z.noextglob!==!0&&f()==="("&&f(2)!=="?"){g({type:"at",extglob:!0,value:G,output:""});continue}g({type:"text",value:G});continue}if(G!=="*"){if(G==="$"||G==="^")G=`\\${G}`;let R=e5.exec(z1());if(R)G+=R[0],w.index+=R[0].length;g({type:"text",value:G});continue}if(B&&(B.type==="globstar"||B.star===!0)){B.type="star",B.star=!0,B.value+=G,B.output=n,w.backtrack=!0,w.globstar=!0,J1(G);continue}let I=z1();if(Z.noextglob!==!0&&/^\([^?]/.test(I)){w0("star",G);continue}if(B.type==="star"){if(Z.noglobstar===!0){J1(G);continue}let R=B.prev,S=R.prev,u=R.type==="slash"||R.type==="bos",o=S&&(S.type==="star"||S.type==="globstar");if(Z.bash===!0&&(!u||I[0]&&I[0]!=="/")){g({type:"star",value:G,output:""});continue}let h=w.braces>0&&(R.type==="comma"||R.type==="brace"),K1=r.length&&(R.type==="pipe"||R.type==="paren");if(!u&&R.type!=="paren"&&!h&&!K1){g({type:"star",value:G,output:""});continue}while(I.slice(0,3)==="/**"){let M1=$[w.index+4];if(M1&&M1!=="/")break;I=I.slice(3),J1("/**",3)}if(R.type==="bos"&&t()){B.type="globstar",B.value+=G,B.output=E(Z),w.output=B.output,w.globstar=!0,J1(G);continue}if(R.type==="slash"&&R.prev.type!=="bos"&&!o&&t()){w.output=w.output.slice(0,-(R.output+B.output).length),R.output=`(?:${R.output}`,B.type="globstar",B.output=E(Z)+(Z.strictSlashes?")":"|$)"),B.value+=G,w.globstar=!0,w.output+=R.output+B.output,J1(G);continue}if(R.type==="slash"&&R.prev.type!=="bos"&&I[0]==="/"){let M1=I[1]!==void 0?"|$":"";w.output=w.output.slice(0,-(R.output+B.output).length),R.output=`(?:${R.output}`,B.type="globstar",B.output=`${E(Z)}${A}|${A}${M1})`,B.value+=G,w.output+=R.output+B.output,w.globstar=!0,J1(G+Q1()),g({type:"slash",value:"/",output:""});continue}if(R.type==="bos"&&I[0]==="/"){B.type="globstar",B.value+=G,B.output=`(?:^|${A}|${E(Z)}${A})`,w.output=B.output,w.globstar=!0,J1(G+Q1()),g({type:"slash",value:"/",output:""});continue}w.output=w.output.slice(0,-B.output.length),B.type="globstar",B.output=E(Z),B.value+=G,w.output+=B.output,w.globstar=!0,J1(G);continue}let c={type:"star",value:G,output:n};if(Z.bash===!0){if(c.output=".*?",B.type==="bos"||B.type==="slash")c.output=H+c.output;g(c);continue}if(B&&(B.type==="bracket"||B.type==="paren")&&Z.regex===!0){c.output=G,g(c);continue}if(w.index===w.start||B.type==="slash"||B.type==="dot"){if(B.type==="dot")w.output+=D,B.output+=D;else if(Z.dot===!0)w.output+=F,B.output+=F;else w.output+=H,B.output+=H;if(f()!=="*")w.output+=z,B.output+=z}g(c)}while(w.brackets>0){if(Z.strictBrackets===!0)throw SyntaxError(d1("closing","]"));w.output=e.escapeLast(w.output,"["),C1("brackets")}while(w.parens>0){if(Z.strictBrackets===!0)throw SyntaxError(d1("closing",")"));w.output=e.escapeLast(w.output,"("),C1("parens")}while(w.braces>0){if(Z.strictBrackets===!0)throw SyntaxError(d1("closing","}"));w.output=e.escapeLast(w.output,"{"),C1("braces")}if(Z.strictSlashes!==!0&&(B.type==="star"||B.type==="bracket"))g({type:"maybe_slash",value:"",output:`${A}?`});if(w.backtrack===!0){w.output="";for(let I of w.tokens)if(w.output+=I.output!=null?I.output:I.value,I.suffix)w.output+=I.suffix}return w};X$.fastpaths=($,J)=>{let Z={...J},U=typeof Z.maxLength==="number"?Math.min(E0,Z.maxLength):E0,V=$.length;if(V>U)throw SyntaxError(`Input length: ${V}, exceeds maximum allowed length: ${U}`);$=XJ[$]||$;let W=e.isWindows(J),{DOT_LITERAL:Y,SLASH_LITERAL:Q,ONE_CHAR:j,DOTS_SLASH:q,NO_DOT:C,NO_DOTS:P,NO_DOTS_SLASH:K,STAR:A,START_ANCHOR:z}=W0.globChars(W),M=Z.dot?P:C,L=Z.dot?K:C,D=Z.capture?"":"?:",F={negated:!1,prefix:""},O=Z.bash===!0?".*?":A;if(Z.capture)O=`(${O})`;let T=(H)=>{if(H.noglobstar===!0)return O;return`(${D}(?:(?!${z}${H.dot?q:Y}).)*?)`},y=(H)=>{switch(H){case"*":return`${M}${j}${O}`;case".*":return`${Y}${j}${O}`;case"*.*":return`${M}${O}${Y}${j}${O}`;case"*/*":return`${M}${O}${Q}${j}${L}${O}`;case"**":return M+T(Z);case"**/*":return`(?:${M}${T(Z)}${Q})?${L}${j}${O}`;case"**/*.*":return`(?:${M}${T(Z)}${Q})?${L}${O}${Y}${j}${O}`;case"**/.*":return`(?:${M}${T(Z)}${Q})?${Y}${j}${O}`;default:{let k=/^(.*?)\.(\w+)$/.exec(H);if(!k)return;let n=y(k[1]);if(!n)return;return n+Y+k[2]}}},_=e.removePrefix($,F),E=y(_);if(E&&Z.strictSlashes!==!0)E+=`${Q}?`;return E};KJ.exports=X$});var BJ=a((o9,jJ)=>{var Y7=N1("path"),X7=YJ(),Q$=MJ(),z$=U0(),Q7=Z0(),z7=($)=>$&&typeof $==="object"&&!Array.isArray($),i=($,J,Z=!1)=>{if(Array.isArray($)){let C=$.map((K)=>i(K,J,Z));return(K)=>{for(let A of C){let z=A(K);if(z)return z}return!1}}let U=z7($)&&$.tokens&&$.input;if($===""||typeof $!=="string"&&!U)throw TypeError("Expected pattern to be a non-empty string");let V=J||{},W=z$.isWindows(J),Y=U?i.compileRe($,J):i.makeRe($,J,!1,!0),Q=Y.state;delete Y.state;let j=()=>!1;if(V.ignore){let C={...J,ignore:null,onMatch:null,onResult:null};j=i(V.ignore,C,Z)}let q=(C,P=!1)=>{let{isMatch:K,match:A,output:z}=i.test(C,Y,J,{glob:$,posix:W}),M={glob:$,state:Q,regex:Y,posix:W,input:C,output:z,match:A,isMatch:K};if(typeof V.onResult==="function")V.onResult(M);if(K===!1)return M.isMatch=!1,P?M:!1;if(j(C)){if(typeof V.onIgnore==="function")V.onIgnore(M);return M.isMatch=!1,P?M:!1}if(typeof V.onMatch==="function")V.onMatch(M);return P?M:!0};if(Z)q.state=Q;return q};i.test=($,J,Z,{glob:U,posix:V}={})=>{if(typeof $!=="string")throw TypeError("Expected input to be a string");if($==="")return{isMatch:!1,output:""};let W=Z||{},Y=W.format||(V?z$.toPosixSlashes:null),Q=$===U,j=Q&&Y?Y($):$;if(Q===!1)j=Y?Y($):$,Q=j===U;if(Q===!1||W.capture===!0)if(W.matchBase===!0||W.basename===!0)Q=i.matchBase($,J,Z,V);else Q=J.exec(j);return{isMatch:Boolean(Q),match:Q,output:j}};i.matchBase=($,J,Z,U=z$.isWindows(Z))=>{return(J instanceof RegExp?J:i.makeRe(J,Z)).test(Y7.basename($))};i.isMatch=($,J,Z)=>i(J,Z)($);i.parse=($,J)=>{if(Array.isArray($))return $.map((Z)=>i.parse(Z,J));return Q$($,{...J,fastpaths:!1})};i.scan=($,J)=>X7($,J);i.compileRe=($,J,Z=!1,U=!1)=>{if(Z===!0)return $.output;let V=J||{},W=V.contains?"":"^",Y=V.contains?"":"$",Q=`${W}(?:${$.output})${Y}`;if($&&$.negated===!0)Q=`^(?!${Q}).*$`;let j=i.toRegex(Q,J);if(U===!0)j.state=$;return j};i.makeRe=($,J={},Z=!1,U=!1)=>{if(!$||typeof $!=="string")throw TypeError("Expected a non-empty string");let V={negated:!1,fastpaths:!0};if(J.fastpaths!==!1&&($[0]==="."||$[0]==="*"))V.output=Q$.fastpaths($,J);if(!V.output)V=Q$($,J);return i.compileRe(V,J,Z,U)};i.toRegex=($,J)=>{try{let Z=J||{};return new RegExp($,Z.flags||(Z.nocase?"i":""))}catch(Z){if(J&&J.debug===!0)throw Z;return/$^/}};i.constants=Q7;jJ.exports=i});var PJ=a((a9,CJ)=>{var wJ=N1("util"),qJ=n2(),B1=BJ(),K$=U0(),GJ=($)=>$===""||$==="./",FJ=($)=>{let J=$.indexOf("{");return J>-1&&$.indexOf("}",J)>-1},m=($,J,Z)=>{J=[].concat(J),$=[].concat($);let U=new Set,V=new Set,W=new Set,Y=0,Q=(C)=>{if(W.add(C.output),Z&&Z.onResult)Z.onResult(C)};for(let C=0;C<J.length;C++){let P=B1(String(J[C]),{...Z,onResult:Q},!0),K=P.state.negated||P.state.negatedExtglob;if(K)Y++;for(let A of $){let z=P(A,!0);if(!(K?!z.isMatch:z.isMatch))continue;if(K)U.add(z.output);else U.delete(z.output),V.add(z.output)}}let q=(Y===J.length?[...W]:[...V]).filter((C)=>!U.has(C));if(Z&&q.length===0){if(Z.failglob===!0)throw Error(`No matches found for "${J.join(", ")}"`);if(Z.nonull===!0||Z.nullglob===!0)return Z.unescape?J.map((C)=>C.replace(/\\/g,"")):J}return q};m.match=m;m.matcher=($,J)=>B1($,J);m.isMatch=($,J,Z)=>B1(J,Z)($);m.any=m.isMatch;m.not=($,J,Z={})=>{J=[].concat(J).map(String);let U=new Set,V=[],Y=new Set(m($,J,{...Z,onResult:(Q)=>{if(Z.onResult)Z.onResult(Q);V.push(Q.output)}}));for(let Q of V)if(!Y.has(Q))U.add(Q);return[...U]};m.contains=($,J,Z)=>{if(typeof $!=="string")throw TypeError(`Expected a string: "${wJ.inspect($)}"`);if(Array.isArray(J))return J.some((U)=>m.contains($,U,Z));if(typeof J==="string"){if(GJ($)||GJ(J))return!1;if($.includes(J)||$.startsWith("./")&&$.slice(2).includes(J))return!0}return m.isMatch($,J,{...Z,contains:!0})};m.matchKeys=($,J,Z)=>{if(!K$.isObject($))throw TypeError("Expected the first argument to be an object");let U=m(Object.keys($),J,Z),V={};for(let W of U)V[W]=$[W];return V};m.some=($,J,Z)=>{let U=[].concat($);for(let V of[].concat(J)){let W=B1(String(V),Z);if(U.some((Y)=>W(Y)))return!0}return!1};m.every=($,J,Z)=>{let U=[].concat($);for(let V of[].concat(J)){let W=B1(String(V),Z);if(!U.every((Y)=>W(Y)))return!1}return!0};m.all=($,J,Z)=>{if(typeof $!=="string")throw TypeError(`Expected a string: "${wJ.inspect($)}"`);return[].concat(J).every((U)=>B1(U,Z)($))};m.capture=($,J,Z)=>{let U=K$.isWindows(Z),W=B1.makeRe(String($),{...Z,capture:!0}).exec(U?K$.toPosixSlashes(J):J);if(W)return W.slice(1).map((Y)=>Y===void 0?"":Y)};m.makeRe=(...$)=>B1.makeRe(...$);m.scan=(...$)=>B1.scan(...$);m.parse=($,J)=>{let Z=[];for(let U of[].concat($||[]))for(let V of qJ(String(U),J))Z.push(B1.parse(V,J));return Z};m.braces=($,J)=>{if(typeof $!=="string")throw TypeError("Expected a string");if(J&&J.nobrace===!0||!FJ($))return[$];return qJ($,J)};m.braceExpand=($,J)=>{if(typeof $!=="string")throw TypeError("Expected a string");return m.braces($,{...J,expand:!0})};m.hasBraces=FJ;CJ.exports=m});var yJ=a((s9,NJ)=>{/*!
19
+ * is-extglob <https://github.com/jonschlinkert/is-extglob>
20
+ *
21
+ * Copyright (c) 2014-2016, Jon Schlinkert.
22
+ * Licensed under the MIT License.
23
+ */NJ.exports=function(J){if(typeof J!=="string"||J==="")return!1;var Z;while(Z=/(\\).|([@?!+*]\(.*\))/g.exec(J)){if(Z[2])return!0;J=J.slice(Z.index+Z[0].length)}return!1}});var HJ=a((e9,LJ)=>{/*!
24
+ * is-glob <https://github.com/jonschlinkert/is-glob>
25
+ *
26
+ * Copyright (c) 2014-2017, Jon Schlinkert.
27
+ * Released under the MIT License.
28
+ */var K7=yJ(),OJ={"{":"}","(":")","[":"]"},M7=function($){if($[0]==="!")return!0;var J=0,Z=-2,U=-2,V=-2,W=-2,Y=-2;while(J<$.length){if($[J]==="*")return!0;if($[J+1]==="?"&&/[\].+)]/.test($[J]))return!0;if(U!==-1&&$[J]==="["&&$[J+1]!=="]"){if(U<J)U=$.indexOf("]",J);if(U>J){if(Y===-1||Y>U)return!0;if(Y=$.indexOf("\\",J),Y===-1||Y>U)return!0}}if(V!==-1&&$[J]==="{"&&$[J+1]!=="}"){if(V=$.indexOf("}",J),V>J){if(Y=$.indexOf("\\",J),Y===-1||Y>V)return!0}}if(W!==-1&&$[J]==="("&&$[J+1]==="?"&&/[:!=]/.test($[J+2])&&$[J+3]!==")"){if(W=$.indexOf(")",J),W>J){if(Y=$.indexOf("\\",J),Y===-1||Y>W)return!0}}if(Z!==-1&&$[J]==="("&&$[J+1]!=="|"){if(Z<J)Z=$.indexOf("|",J);if(Z!==-1&&$[Z+1]!==")"){if(W=$.indexOf(")",Z),W>Z){if(Y=$.indexOf("\\",Z),Y===-1||Y>W)return!0}}}if($[J]==="\\"){var Q=$[J+1];J+=2;var j=OJ[Q];if(j){var q=$.indexOf(j,J);if(q!==-1)J=q+1}if($[J]==="!")return!0}else J++}return!1},j7=function($){if($[0]==="!")return!0;var J=0;while(J<$.length){if(/[*?{}()[\]]/.test($[J]))return!0;if($[J]==="\\"){var Z=$[J+1];J+=2;var U=OJ[Z];if(U){var V=$.indexOf(U,J);if(V!==-1)J=V+1}if($[J]==="!")return!0}else J++}return!1};LJ.exports=function(J,Z){if(typeof J!=="string"||J==="")return!1;if(K7(J))return!0;var U=M7;if(Z&&Z.strict===!1)U=j7;return U(J)}});var A$={};j1(A$,{layer:()=>oJ,defaultLayer:()=>p7,Service:()=>j0,InstanceBootstrap:()=>A$});var E1={};j1(E1,{use:()=>_Z,layer:()=>x$,defaultLayer:()=>DZ,Status:()=>HZ,Service:()=>c1,Format:()=>E1});import LZ from"path";var C0={};j1(C0,{zig:()=>UZ,uvformat:()=>XZ,terraform:()=>BZ,standardrb:()=>zZ,shfmt:()=>qZ,rustfmt:()=>CZ,ruff:()=>T$,rubocop:()=>QZ,rlang:()=>YZ,prettier:()=>$Z,pint:()=>PZ,oxfmt:()=>JZ,ormolu:()=>NZ,ocamlformat:()=>jZ,nixfmt:()=>FZ,mix:()=>tJ,latexindent:()=>GZ,ktlint:()=>WZ,htmlbeautifier:()=>KZ,gofmt:()=>eJ,gleam:()=>wZ,dfmt:()=>OZ,dart:()=>MZ,cljfmt:()=>yZ,clang:()=>VZ,biome:()=>ZZ});var eJ={name:"gofmt",extensions:[".go"],async enabled(){let $=d("gofmt");if(!$)return!1;return[$,"-w","$FILE"]}},tJ={name:"mix",extensions:[".ex",".exs",".eex",".heex",".leex",".neex",".sface"],async enabled(){let $=d("mix");if(!$)return!1;return[$,"format","$FILE"]}},$Z={name:"prettier",environment:{BUN_BE_BUN:"1"},extensions:[".js",".jsx",".mjs",".cjs",".ts",".tsx",".mts",".cts",".html",".htm",".css",".scss",".sass",".less",".vue",".svelte",".json",".jsonc",".yaml",".yml",".toml",".xml",".md",".mdx",".graphql",".gql"],async enabled($){let J=await s.findUp("package.json",$.directory,$.worktree);for(let Z of J){let U=await s.readJson(Z);if(U.dependencies?.prettier||U.devDependencies?.prettier){let V=await F0.which("prettier");if(V)return[V,"--write","$FILE"]}}return!1}},JZ={name:"oxfmt",environment:{BUN_BE_BUN:"1"},extensions:[".js",".jsx",".mjs",".cjs",".ts",".tsx",".mts",".cts"],async enabled($){if(!$.experimentalOxfmt)return!1;let J=await s.findUp("package.json",$.directory,$.worktree);for(let Z of J){let U=await s.readJson(Z);if(U.dependencies?.oxfmt||U.devDependencies?.oxfmt){let V=await F0.which("oxfmt");if(V)return[V,"$FILE"]}}return!1}},ZZ={name:"biome",environment:{BUN_BE_BUN:"1"},extensions:[".js",".jsx",".mjs",".cjs",".ts",".tsx",".mts",".cts",".html",".htm",".css",".scss",".sass",".less",".vue",".svelte",".json",".jsonc",".yaml",".yml",".toml",".xml",".md",".mdx",".graphql",".gql"],async enabled($){let J=["biome.json","biome.jsonc"];for(let Z of J)if((await s.findUp(Z,$.directory,$.worktree)).length>0){let V=await F0.which("@biomejs/biome");if(V)return[V,"format","--write","$FILE"]}return!1}},UZ={name:"zig",extensions:[".zig",".zon"],async enabled(){let $=d("zig");if(!$)return!1;return[$,"fmt","$FILE"]}},VZ={name:"clang-format",extensions:[".c",".cc",".cpp",".cxx",".c++",".h",".hh",".hpp",".hxx",".h++",".ino",".C",".H"],async enabled($){if((await s.findUp(".clang-format",$.directory,$.worktree)).length>0){let Z=d("clang-format");if(Z)return[Z,"-i","$FILE"]}return!1}},WZ={name:"ktlint",extensions:[".kt",".kts"],async enabled(){let $=d("ktlint");if(!$)return!1;return[$,"-F","$FILE"]}},T$={name:"ruff",extensions:[".py",".pyi"],async enabled($){if(!d("ruff"))return!1;let J=["pyproject.toml","ruff.toml",".ruff.toml"];for(let U of J){let V=await s.findUp(U,$.directory,$.worktree);if(V.length>0)if(U==="pyproject.toml"){if((await s.readText(V[0])).includes("[tool.ruff]"))return["ruff","format","$FILE"]}else return["ruff","format","$FILE"]}let Z=["requirements.txt","pyproject.toml","Pipfile"];for(let U of Z){let V=await s.findUp(U,$.directory,$.worktree);if(V.length>0){if((await s.readText(V[0])).includes("ruff"))return["ruff","format","$FILE"]}}return!1}},YZ={name:"air",extensions:[".R"],async enabled(){let $=d("air");if($==null)return!1;let J=await q0.text([$,"--help"],{nothrow:!0}),Z=J.text.split(`
29
+ `)[0],U=Z.includes("R language"),V=Z.includes("formatter");if(J.code===0&&U&&V)return[$,"format","$FILE"];return!1}},XZ={name:"uv",extensions:[".py",".pyi"],async enabled($){if(await T$.enabled($))return!1;let J=d("uv");if(J==null)return!1;if((await q0.run([J,"format","--help"],{nothrow:!0})).code===0)return[J,"format","--","$FILE"];return!1}},QZ={name:"rubocop",extensions:[".rb",".rake",".gemspec",".ru"],async enabled(){let $=d("rubocop");if(!$)return!1;return[$,"--autocorrect","$FILE"]}},zZ={name:"standardrb",extensions:[".rb",".rake",".gemspec",".ru"],async enabled(){let $=d("standardrb");if(!$)return!1;return[$,"--fix","$FILE"]}},KZ={name:"htmlbeautifier",extensions:[".erb",".html.erb"],async enabled(){let $=d("htmlbeautifier");if(!$)return!1;return[$,"$FILE"]}},MZ={name:"dart",extensions:[".dart"],async enabled(){let $=d("dart");if(!$)return!1;return[$,"format","$FILE"]}},jZ={name:"ocamlformat",extensions:[".ml",".mli"],async enabled($){if(!d("ocamlformat"))return!1;if((await s.findUp(".ocamlformat",$.directory,$.worktree)).length>0)return["ocamlformat","-i","$FILE"];return!1}},BZ={name:"terraform",extensions:[".tf",".tfvars"],async enabled(){let $=d("terraform");if(!$)return!1;return[$,"fmt","$FILE"]}},GZ={name:"latexindent",extensions:[".tex"],async enabled(){let $=d("latexindent");if(!$)return!1;return[$,"-w","-s","$FILE"]}},wZ={name:"gleam",extensions:[".gleam"],async enabled(){let $=d("gleam");if(!$)return!1;return[$,"format","$FILE"]}},qZ={name:"shfmt",extensions:[".sh",".bash"],async enabled(){let $=d("shfmt");if(!$)return!1;return[$,"-w","$FILE"]}},FZ={name:"nixfmt",extensions:[".nix"],async enabled(){let $=d("nixfmt");if(!$)return!1;return[$,"$FILE"]}},CZ={name:"rustfmt",extensions:[".rs"],async enabled(){let $=d("rustfmt");if(!$)return!1;return[$,"$FILE"]}},PZ={name:"pint",extensions:[".php"],async enabled($){let J=await s.findUp("composer.json",$.directory,$.worktree);for(let Z of J){let U=await s.readJson(Z);if(U.require?.["laravel/pint"]||U["require-dev"]?.["laravel/pint"])return["./vendor/bin/pint","$FILE"]}return!1}},NZ={name:"ormolu",extensions:[".hs"],async enabled(){let $=d("ormolu");if(!$)return!1;return[$,"-i","$FILE"]}},yZ={name:"cljfmt",extensions:[".clj",".cljs",".cljc",".edn"],async enabled(){let $=d("cljfmt");if(!$)return!1;return[$,"fix","--quiet","$FILE"]}},OZ={name:"dfmt",extensions:[".d"],async enabled(){let $=d("dfmt");if(!$)return!1;return[$,"-i","$FILE"]}};var G1=V1({service:"format"}),HZ=N.Struct({name:N.String,extensions:N.Array(N.String),enabled:N.Boolean}).annotate({identifier:"FormatterStatus"});class c1 extends U1.Service()("@muxcode/Format"){}var _Z=P1(c1),x$=b.effect(c1,X.gen(function*(){let $=yield*W1.Service,J=yield*d0.Service,Z=yield*v0.Service,U=yield*x.make(X.fn("Format.state")(function*(Q){let j={},q={};async function C(M){let L=j[M.name];if(L===!1||L===void 0)L=await M.enabled({...Q,experimentalOxfmt:Z.experimentalOxfmt}),j[M.name]=L;return L}async function P(M){return await C(M)!==!1}async function K(M){let L=Object.values(q).filter((F)=>F.extensions.includes(M));return(await Promise.all(L.map(async(F)=>{G1.info("checking",{name:F.name,ext:M});let O=await C(F);if(O)G1.info("enabled",{name:F.name,ext:M});return{item:F,cmd:O}}))).filter((F)=>F.cmd!==!1).map((F)=>({item:F.item,cmd:F.cmd}))}function A(M){return X.gen(function*(){G1.info("formatting",{file:M});let L=yield*X.promise(()=>K(LZ.extname(M)));if(!L.length)return!1;for(let{item:D,cmd:F}of L){G1.info("running",{command:F});let O=F.map((_)=>_.replace("$FILE",M)),T=yield*x.directory,y=yield*J.run(i1.make(O[0],O.slice(1),{cwd:T,env:D.environment,extendEnv:!0,stdin:"ignore",stdout:"ignore",stderr:"ignore"})).pipe(X.catch((_)=>X.sync(()=>{G1.error("failed to format file",{error:"spawn failed",command:F,...D.environment,file:M,cause:k$(_.cause??_)});return})));if(y&&y.exitCode!==0)G1.error("failed",{command:F,...D.environment})}return!0})}let z=yield*$.get();if(!z.formatter)return G1.info("all formatters are disabled"),G1.info("init"),{formatters:q,isEnabled:P,formatFile:A};for(let M of Object.values(C0))q[M.name]=M;if(z.formatter!==!0)for(let[M,L]of Object.entries(z.formatter)){let D=C0[M];if(["ruff","uv"].includes(M)&&(z.formatter.ruff?.disabled||z.formatter.uv?.disabled)){delete q.ruff,delete q.uv;continue}if(L.disabled){delete q[M];continue}let F=E$(D??{extensions:[]},L);q[M]={...F,name:M,extensions:F.extensions??[],enabled:D&&!F.command?D.enabled:async(O)=>F.command??!1}}return G1.info("init"),{formatters:q,isEnabled:P,formatFile:A}})),V=X.fn("Format.init")(function*(){yield*x.get(U)}),W=X.fn("Format.status")(function*(){let{formatters:Q,isEnabled:j}=yield*x.get(U),q=[];for(let C of Object.values(Q)){let P=yield*X.promise(()=>j(C));q.push({name:C.name,extensions:C.extensions,enabled:P})}return q}),Y=X.fn("Format.file")(function*(Q){let{formatFile:j}=yield*x.get(U);return yield*j(Q)});return c1.of({init:V,status:W,file:Y})})),DZ=x$.pipe(b.provide(W1.defaultLayer),b.provide(d0.defaultLayer),b.provide(v0.defaultLayer));var f1={};j1(f1,{use:()=>x6,layer:()=>j2,defaultLayer:()=>S6,Service:()=>$0,Node:()=>G6,Info:()=>B6,File:()=>f1,Event:()=>C6,Content:()=>F6});var K2=Q2(j6(),1),M2=Q2(c$(),1);import $1 from"path";var O1={};j1(O1,{paths:()=>sZ,names:()=>aZ,Protected:()=>O1});import m0 from"path";import iZ from"os";var r0=iZ.homedir(),p$=["Music","Pictures","Movies","Downloads","Desktop","Documents","Public","Applications","Library"],nZ=["Application Support/AddressBook","Calendars","Mail","Messages","Safari","Cookies","Application Support/com.apple.TCC","PersonalizationPortrait","Metadata/CoreSpotlight","Suggestions"],oZ=["/.DocumentRevisions-V100","/.Spotlight-V100","/.Trashes","/.fseventsd"],i$=["AppData","Downloads","Desktop","Documents","Pictures","Music","Videos","OneDrive"];function aZ(){if(process.platform==="darwin")return new Set(p$);if(process.platform==="win32")return new Set(i$);return new Set}function sZ(){if(process.platform==="darwin")return[...p$.map(($)=>m0.join(r0,$)),...nZ.map(($)=>m0.join(r0,"Library",$)),...oZ];if(process.platform==="win32")return i$.map(($)=>m0.join(r0,$));return[]}var g1={};j1(g1,{use:()=>V6,layer:()=>Y2,defaultLayer:()=>M6,Service:()=>a1,SearchMatch:()=>U2,Ripgrep:()=>g1,Match:()=>V2});import o1 from"path";var n$=V1({service:"ripgrep"}),c0="15.1.0",eZ={"arm64-darwin":{platform:"aarch64-apple-darwin",extension:"tar.gz"},"arm64-linux":{platform:"aarch64-unknown-linux-gnu",extension:"tar.gz"},"x64-darwin":{platform:"x86_64-apple-darwin",extension:"tar.gz"},"x64-linux":{platform:"x86_64-unknown-linux-musl",extension:"tar.gz"},"arm64-win32":{platform:"aarch64-pc-windows-msvc",extension:"zip"},"ia32-win32":{platform:"i686-pc-windows-msvc",extension:"zip"},"x64-win32":{platform:"x86_64-pc-windows-msvc",extension:"zip"}},J2=N.Struct({secs:p,nanos:p,human:N.String}),Z2=N.Struct({elapsed:J2,searches:p,searches_with_match:p,bytes_searched:p,bytes_printed:p,matched_lines:p,matches:p}),i0=N.Struct({text:N.String}),tZ=N.Struct({type:N.Literal("begin"),data:N.Struct({path:i0})}),U2=N.Struct({path:i0,lines:N.Struct({text:N.String}),line_number:p,absolute_offset:p,submatches:N.Array(N.Struct({match:N.Struct({text:N.String}),start:p,end:p}))}),V2=N.Struct({type:N.Literal("match"),data:U2}),$6=N.Struct({type:N.Literal("end"),data:N.Struct({path:i0,binary_offset:N.NullOr(p),stats:Z2})}),J6=N.Struct({type:N.Literal("summary"),data:N.Struct({elapsed_total:J2,stats:Z2})}),Z6=N.Union([tZ,V2,$6,J6]),U6=N.decodeUnknownEffect(N.fromJsonString(Z6));class a1 extends U1.Service()("@muxcode/Ripgrep"){}var V6=P1(a1);function W6(){let $=e$();return delete $.RIPGREP_CONFIG_PATH,$}function o$($){let J=$?.reason;if(J instanceof Error)return J;let Z=Error("Aborted");return Z.name="AbortError",Z}function Y6($){if(!$)return X.never;if($.aborted)return X.fail(o$($));return X.callback((J)=>{let Z=()=>J(X.fail(o$($)));return $.addEventListener("abort",Z,{once:!0}),X.sync(()=>$.removeEventListener("abort",Z))})}function O0($,J){let Z=Error($.trim()||`ripgrep failed with code ${J}`);return Z.name="RipgrepError",Z}function W2($){return o1.normalize($.replace(/^\.[\\/]/,""))}function X6($){return{...$,path:{...$.path,text:W2($.path.text)}}}function Q6($){return U6($).pipe(X.mapError((J)=>Error("invalid ripgrep output",{cause:J})))}function a$($,J){L0.failCauseUnsafe($,s1.fail(J))}function z6($){let J=["--no-config","--files","--glob=!.git/*"];if($.follow)J.push("--follow");if($.hidden!==!1)J.push("--hidden");if($.hidden===!1)J.push("--glob=!.*");if($.maxDepth!==void 0)J.push(`--max-depth=${$.maxDepth}`);if($.glob)for(let Z of $.glob)J.push(`--glob=${Z}`);return J.push("."),J}function K6($){let J=["--no-config","--json","--hidden","--glob=!.git/*","--no-messages"];if($.follow)J.push("--follow");if($.glob)for(let Z of $.glob)J.push(`--glob=${Z}`);if($.limit)J.push(`--max-count=${$.limit}`);return J.push("--",$.pattern,...$.file??["."]),J}function s$($,J){return J?$.pipe(X.raceFirst(Y6(J))):$}var Y2=b.effect(a1,X.gen(function*(){let $=yield*H1.Service,J=S1.filterStatusOk(yield*S1.HttpClient),Z=yield*t$,U=X.fnUntraced(function*(P,K,A){let z=yield*Z.spawn(i1.make(P,K,{cwd:A?.cwd,extendEnv:!0,stdin:"ignore"})),[M,L,D]=yield*X.all([v.mkString(v.decodeText(z.stdout)),v.mkString(v.decodeText(z.stderr)),z.exitCode],{concurrency:"unbounded"});return{stdout:M,stderr:L,code:D}},X.scoped),V=X.fnUntraced(function*(P,K,A){let z=yield*$.makeTempDirectoryScoped({directory:L1.Path.bin,prefix:"ripgrep-"});if(K.extension==="zip"){let L=(yield*X.sync(()=>d("powershell.exe")??d("pwsh.exe")))??"powershell.exe",D=yield*U(L,["-NoProfile","-NonInteractive","-Command",`$global:ProgressPreference = 'SilentlyContinue'; Expand-Archive -LiteralPath '${P.replaceAll("'","''")}' -DestinationPath '${z.replaceAll("'","''")}' -Force`]);if(D.code!==0)return yield*X.fail(O0(D.stderr||D.stdout,D.code))}if(K.extension==="tar.gz"){let L=yield*U("tar",["-xzf",P,"-C",z]);if(L.code!==0)return yield*X.fail(O0(L.stderr||L.stdout,L.code))}let M=o1.join(z,`ripgrep-${c0}-${K.platform}`,process.platform==="win32"?"rg.exe":"rg");if(!(yield*$.isFile(M)))return yield*X.fail(Error(`ripgrep archive did not contain executable: ${M}`));if(yield*$.copyFile(M,A),process.platform==="win32")return;yield*$.chmod(A,493)},X.scoped),W=yield*X.cached(X.gen(function*(){let P=yield*X.sync(()=>d(process.platform==="win32"?"rg.exe":"rg"));if(P&&(yield*$.isFile(P).pipe(X.orDie)))return P;let K=o1.join(L1.Path.bin,`rg${process.platform==="win32"?".exe":""}`);if(yield*$.isFile(K).pipe(X.orDie))return K;let A=`${process.arch}-${process.platform}`,z=eZ[A];if(!z)return yield*X.fail(Error(`unsupported platform for ripgrep: ${A}`));let M=`ripgrep-${c0}-${z.platform}.${z.extension}`,L=`https://github.com/BurntSushi/ripgrep/releases/download/${c0}/${M}`,D=o1.join(L1.Path.bin,M);n$.info("downloading ripgrep",{url:L}),yield*$.ensureDir(L1.Path.bin).pipe(X.orDie);let F=yield*Y1.get(L).pipe(J.execute,X.flatMap((O)=>O.arrayBuffer),X.mapError((O)=>O instanceof Error?O:Error(String(O))));if(F.byteLength===0)return yield*X.fail(Error(`failed to download ripgrep from ${L}`));return yield*$.writeWithDirs(D,new Uint8Array(F)),yield*V(D,z,K),yield*$.remove(D,{force:!0}).pipe(X.ignore),K})),Y=X.fnUntraced(function*(P){if(yield*$.isDir(P).pipe(X.orDie))return;return yield*X.fail(Object.assign(Error(`No such file or directory: '${P}'`),{code:"ENOENT",errno:-2,path:P}))}),Q=X.fnUntraced(function*(P,K){let A=yield*W;return i1.make(A,K,{cwd:P,env:W6(),extendEnv:!0,stdin:"ignore"})}),j=(P)=>v.callback((K)=>X.gen(function*(){yield*X.forkScoped(X.gen(function*(){yield*Y(P.cwd);let A=yield*Z.spawn(yield*Q(P.cwd,z6(P))),z=yield*v.mkString(v.decodeText(A.stderr)).pipe(X.forkScoped),M=yield*v.decodeText(A.stdout).pipe(v.splitLines,v.filter((D)=>D.length>0),v.runForEach((D)=>X.sync(()=>L0.offerUnsafe(K,W2(D)))),X.forkScoped),L=yield*s$(A.exitCode,P.signal);if(yield*p0.join(M),L===0||L===1){L0.endUnsafe(K);return}a$(K,O0(yield*p0.join(z),L))}).pipe(X.catch((A)=>X.sync(()=>{a$(K,A)}))))})),q=X.fn("Ripgrep.search")(function*(P){yield*Y(P.cwd);let K=X.scoped(X.gen(function*(){let A=yield*Z.spawn(yield*Q(P.cwd,K6(P))),[z,M,L]=yield*X.all([v.decodeText(A.stdout).pipe(v.splitLines,v.filter((D)=>D.length>0),v.mapEffect(Q6),v.filter((D)=>D.type==="match"),v.map((D)=>X6(D.data)),v.runCollect,X.map((D)=>[...D])),v.mkString(v.decodeText(A.stderr)),A.exitCode],{concurrency:"unbounded"});if(L!==0&&L!==1&&L!==2)return yield*X.fail(O0(M,L));return{items:L===1?[]:z,partial:L===2}}));return yield*s$(K,P.signal)}),C=X.fn("Ripgrep.tree")(function*(P){n$.info("tree",P);let K=Array.from(yield*j({cwd:P.cwd,signal:P.signal}).pipe(v.runCollect));function A(y,_){let E=y.children.get(_);if(E)return E;let H={name:_,children:new Map};return y.children.set(_,H),H}function z(y){return Array.from(y.children.values()).reduce((_,E)=>_+1+z(E),0)}let M={name:"",children:new Map};for(let y of K){if(y.includes(".muxcode"))continue;let _=y.split(o1.sep);if(_.length<2)continue;let E=M;for(let H of _.slice(0,-1))E=A(E,H)}let L=z(M),D=P.limit??L,F=[],O=Array.from(M.children.values()).sort((y,_)=>y.name.localeCompare(_.name)).map((y)=>({node:y,path:y.name})),T=0;for(let y=0;y<O.length&&T<D;y++){let _=O[y];F.push(_.path),T++,O.push(...Array.from(_.node.children.values()).sort((E,H)=>E.name.localeCompare(H.name)).map((E)=>({node:E,path:`${_.path}/${E.name}`})))}if(L>T)F.push(`[${L-T} truncated]`);return F.join(`
30
+ `)});return a1.of({files:j,tree:C,search:q})})),M6=Y2.pipe(b.provide(H0.layer),b.provide(H1.defaultLayer),b.provide($2.defaultLayer));var B6=N.Struct({path:N.String,added:p,removed:p,status:N.Literals(["added","deleted","modified"])}).annotate({identifier:"File"}),G6=N.Struct({name:N.String,path:N.String,absolute:N.String,type:N.Literals(["file","directory"]),ignored:N.Boolean}).annotate({identifier:"FileNode"}),w6=N.Struct({oldStart:p,oldLines:p,newStart:p,newLines:p,lines:N.Array(N.String)}),q6=N.Struct({oldFileName:N.String,newFileName:N.String,oldHeader:N.optional(N.String),newHeader:N.optional(N.String),hunks:N.Array(w6),index:N.optional(N.String)}),F6=N.Struct({type:N.Literals(["text","binary"]),content:N.String,diff:N.optional(N.String),patch:N.optional(q6),encoding:N.optional(N.Literal("base64")),mimeType:N.optional(N.String)}).annotate({identifier:"FileContent"}),C6={Edited:b1.define("file.edited",N.Struct({file:N.String}))},e1=V1({service:"file"}),P6=new Set(["exe","dll","pdb","bin","so","dylib","o","a","lib","wav","mp3","ogg","oga","ogv","ogx","flac","aac","wma","m4a","weba","mp4","avi","mov","wmv","flv","webm","mkv","zip","tar","gz","gzip","bz","bz2","bzip","bzip2","7z","rar","xz","lz","z","pdf","doc","docx","ppt","pptx","xls","xlsx","dmg","iso","img","vmdk","ttf","otf","woff","woff2","eot","sqlite","db","mdb","apk","ipa","aab","xapk","app","pkg","deb","rpm","snap","flatpak","appimage","msi","msp","jar","war","ear","class","kotlin_module","dex","vdex","odex","oat","art","wasm","wat","bc","ll","s","ko","sys","drv","efi","rom","com"]),N6=new Set(["png","jpg","jpeg","gif","bmp","webp","ico","tif","tiff","svg","svgz","avif","apng","jxl","heic","heif","raw","cr2","nef","arw","dng","orf","raf","pef","x3f"]),y6=new Set(["ts","tsx","mts","cts","mtsx","ctsx","js","jsx","mjs","cjs","sh","bash","zsh","fish","ps1","psm1","cmd","bat","json","jsonc","json5","yaml","yml","toml","md","mdx","txt","xml","html","htm","css","scss","sass","less","graphql","gql","sql","ini","cfg","conf","env"]),O6=new Set(["dockerfile","makefile",".gitignore",".gitattributes",".editorconfig",".npmrc",".nvmrc",".prettierrc",".eslintrc"]),L6={png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",bmp:"image/bmp",webp:"image/webp",ico:"image/x-icon",tif:"image/tiff",tiff:"image/tiff",svg:"image/svg+xml",svgz:"image/svg+xml",avif:"image/avif",apng:"image/apng",jxl:"image/jxl",heic:"image/heic",heif:"image/heif"},t1=($)=>$1.extname($).toLowerCase().slice(1),H6=($)=>$1.basename($).toLowerCase(),_6=($)=>N6.has(t1($)),D6=($)=>y6.has(t1($)),R6=($)=>O6.has(H6($)),A6=($)=>P6.has(t1($)),I6=($)=>$.startsWith("image/"),T6=($)=>L6[t1($)]||"image/"+t1($);function E6($){let J=$.toLowerCase();if(e1.debug("shouldEncode",{type:J}),!J)return!1;if(J.startsWith("text/"))return!1;if(J.includes("charset="))return!1;let Z=J.split("/",2)[0];return["image","audio","video","font","model","multipart"].includes(Z)}var k6=($)=>{return $.replaceAll("\\","/").replace(/\/+$/,"").split("/").some((Z)=>Z.startsWith(".")&&Z.length>1)},X2=($,J)=>{if(J)return $;let Z=[],U=[];for(let V of $)if(k6(V))U.push(V);else Z.push(V);return[...Z,...U]};class $0 extends U1.Service()("@muxcode/File"){}var x6=P1($0),j2=b.effect($0,X.gen(function*(){let $=yield*H1.Service,J=yield*g1.Service,Z=yield*q1.Service,U=yield*_1.Scope,V=yield*x.make(X.fn("File.state")(()=>X.succeed({cache:{files:[],dirs:[]}}))),W=X.fn("File.scan")(function*(){let z=yield*x.context;if(z.directory===$1.parse(z.directory).root)return;let M=z.directory===L1.Path.home&&z.project.id==="global",L={files:[],dirs:[]};if(M){let F=new Set,O=O1.names(),T=new Set(["node_modules","dist","build","target","vendor"]),y=(H)=>H.startsWith(".")||O.has(H),_=(H)=>H.startsWith(".")||T.has(H),E=yield*$.readDirectoryEntries(z.directory).pipe(X.orElseSucceed(()=>[]));for(let H of E){if(H.type!=="directory")continue;if(y(H.name))continue;F.add(H.name+"/");let k=$1.join(z.directory,H.name),n=yield*$.readDirectoryEntries(k).pipe(X.orElseSucceed(()=>[]));for(let w of n){if(w.type!=="directory")continue;if(_(w.name))continue;F.add(H.name+"/"+w.name+"/")}}L.dirs=Array.from(F).toSorted()}else{let F=yield*J.files({cwd:z.directory}).pipe(z2,X.map((T)=>[...T])),O=new Set;for(let T of F){L.files.push(T);let y=T;while(!0){let _=$1.dirname(y);if(_===".")break;if(_===y)break;if(y=_,O.has(_))continue;O.add(_),L.dirs.push(_+"/")}}}let D=yield*x.get(V);D.cache=L}),Y=yield*X.cached(W().pipe(X.catchCause(()=>X.void))),Q=X.fn("File.ensure")(function*(){yield*Y,Y=yield*X.cached(W().pipe(X.catchCause(()=>X.void)))}),j=X.fnUntraced(function*(z){return(yield*Z.run(z,{cwd:(yield*x.context).directory})).text()}),q=X.fn("File.init")(function*(){yield*Q().pipe(X.forkIn(U))}),C=X.fn("File.status")(function*(){let z=yield*x.context;if(z.project.vcs!=="git")return[];let M=yield*j(["-c","core.fsmonitor=false","-c","core.quotepath=false","diff","--numstat","HEAD"]),L=[];if(M.trim())for(let O of M.trim().split(`
31
+ `)){let[T,y,_]=O.split("\t");L.push({path:_,added:T==="-"?0:parseInt(T,10),removed:y==="-"?0:parseInt(y,10),status:"modified"})}let D=yield*j(["-c","core.fsmonitor=false","-c","core.quotepath=false","ls-files","--others","--exclude-standard"]);if(D.trim())for(let O of D.trim().split(`
32
+ `)){let T=yield*$.readFileString($1.join(z.directory,O)).pipe(X.catch(()=>X.succeed(void 0)));if(T===void 0)continue;L.push({path:O,added:T.split(`
33
+ `).length,removed:0,status:"added"})}let F=yield*j(["-c","core.fsmonitor=false","-c","core.quotepath=false","diff","--name-only","--diff-filter=D","HEAD"]);if(F.trim())for(let O of F.trim().split(`
34
+ `))L.push({path:O,added:0,removed:0,status:"deleted"});return L.map((O)=>{let T=$1.isAbsolute(O.path)?O.path:$1.join(z.directory,O.path);return{...O,path:$1.relative(z.directory,T)}})}),P=X.fn("File.read")(function*(z){using M=e1.time("read",{file:z});let L=yield*x.context,D=$1.join(L.directory,z);if(!n0(D,L))throw Error("Access denied: path escapes project directory");if(_6(z)){if(yield*$.existsSafe(D)){let H=yield*$.readFile(D).pipe(X.catch(()=>X.succeed(new Uint8Array)));return{type:"text",content:Buffer.from(H).toString("base64"),mimeType:T6(z),encoding:"base64"}}return{type:"text",content:""}}let F=D6(z)||R6(z);if(A6(z)&&!F)return{type:"binary",content:""};if(!(yield*$.existsSafe(D)))return{type:"text",content:""};let T=H1.mimeType(D),y=F?!1:E6(T);if(y&&!I6(T))return{type:"binary",content:"",mimeType:T};if(y){let E=yield*$.readFile(D).pipe(X.catch(()=>X.succeed(new Uint8Array)));return{type:"text",content:Buffer.from(E).toString("base64"),mimeType:T,encoding:"base64"}}let _=yield*$.readFileString(D).pipe(X.map((E)=>E.trim()),X.catch(()=>X.succeed("")));if(L.project.vcs==="git"){let E=yield*j(["-c","core.fsmonitor=false","diff","--",z]);if(!E.trim())E=yield*j(["-c","core.fsmonitor=false","diff","--staged","--",z]);if(E.trim()){let H=yield*Z.show(L.directory,"HEAD",z),k=_0(z,z,H,_,"old","new",{context:1/0,ignoreWhitespace:!0});return{type:"text",content:_,patch:k,diff:D0(k)}}return{type:"text",content:_}}return{type:"text",content:_}}),K=X.fn("File.list")(function*(z){let M=yield*x.context,L=[".git",".DS_Store"],D=(y)=>!1;if(M.project.vcs==="git"){let y=M2.default(),_=$1.join(M.worktree,".gitignore"),E=yield*$.readFileString(_).pipe(X.catch(()=>X.succeed("")));if(E)y.add(E);let H=$1.join(M.worktree,".ignore"),k=yield*$.readFileString(H).pipe(X.catch(()=>X.succeed("")));if(k)y.add(k);D=y.ignores.bind(y)}let F=z?$1.join(M.directory,z):M.directory;if(!n0(F,M))throw Error("Access denied: path escapes project directory");let O=yield*$.readDirectoryEntries(F).pipe(X.orElseSucceed(()=>[])),T=[];for(let y of O){if(L.includes(y.name))continue;let _=$1.join(F,y.name),E=$1.relative(M.directory,_),H=y.type==="directory"?"directory":"file";T.push({name:y.name,path:E,absolute:_,type:H,ignored:D(H==="directory"?E+"/":E)})}return T.sort((y,_)=>{if(y.type!==_.type)return y.type==="directory"?-1:1;return y.name.localeCompare(_.name)})}),A=X.fn("File.search")(function*(z){yield*Q();let{cache:M}=yield*x.get(V),L=z.query.trim(),D=z.limit??100,F=z.type??(z.dirs===!1?"file":"all");e1.info("search",{query:L,kind:F});let O=L.startsWith(".")||L.includes("/.");if(!L){if(F==="file")return M.files.slice(0,D);return X2(M.dirs.toSorted(),O).slice(0,D)}let T=F==="file"?M.files:F==="directory"?M.dirs:[...M.files,...M.dirs],y=F==="directory"&&!O?D*20:D,_=K2.default.go(L,T,{limit:y}).map((H)=>H.target),E=F==="directory"?X2(_,O).slice(0,D):_;return e1.info("search",{query:L,kind:F,results:E.length}),E});return e1.info("init"),$0.of({init:q,status:C,read:P,list:K,search:A})})),S6=j2.pipe(b.provide(g1.defaultLayer),b.provide(H1.defaultLayer),b.provide(q1.defaultLayer));var f0={};j1(f0,{layer:()=>gJ,defaultLayer:()=>C$,Vcs:()=>f0,Service:()=>l1,PatchApplyError:()=>b0,Mode:()=>g7,Info:()=>b7,FileStatus:()=>v7,FileDiff:()=>f7,Event:()=>SJ,ApplyResult:()=>h7,ApplyInput:()=>d7});var y1={};j1(y1,{layer:()=>TJ,hasNativeBinding:()=>O7,defaultLayer:()=>L7,Service:()=>S0,FileWatcher:()=>y1,Event:()=>x0});var A1=N1("path"),B7=PJ(),G7=HJ();function k0($,J={}){let{ignore:Z,...U}=J;if(Array.isArray(Z)){J={...U};for(let V of Z)if(G7(V)){if(!J.ignoreGlobs)J.ignoreGlobs=[];let W=B7.makeRe(V,{dot:!0,lookbehinds:!1});J.ignoreGlobs.push(W.source)}else{if(!J.ignorePaths)J.ignorePaths=[];J.ignorePaths.push(A1.resolve($,V))}}return J}var M$=($)=>{return{writeSnapshot(J,Z,U){return $.writeSnapshot(A1.resolve(J),A1.resolve(Z),k0(J,U))},getEventsSince(J,Z,U){return $.getEventsSince(A1.resolve(J),A1.resolve(Z),k0(J,U))},async subscribe(J,Z,U){return J=A1.resolve(J),U=k0(J,U),await $.subscribe(J,Z,U),{unsubscribe(){return $.unsubscribe(J,Z,U)}}},unsubscribe(J,Z,U){return $.unsubscribe(A1.resolve(J),Z,k0(J,U))}}};import{readdir as F7,realpath as C7}from"fs/promises";import G$ from"path";var Y0={};j1(Y0,{match:()=>q7,PATTERNS:()=>w7,FileIgnore:()=>Y0});var _J=new Set(["node_modules","bower_components",".pnpm-store","vendor",".npm","dist","build","out",".next","target","bin","obj",".git",".svn",".hg",".vscode",".idea",".turbo",".output","desktop",".sst",".cache",".webkit-cache","__pycache__",".pytest_cache","mypy_cache",".history",".gradle"]),DJ=["**/*.swp","**/*.swo","**/*.pyc","**/.DS_Store","**/Thumbs.db","**/logs/**","**/tmp/**","**/temp/**","**/*.log","**/coverage/**","**/.nyc_output/**"],w7=[...DJ,..._J];function q7($,J){for(let V of J?.whitelist||[])if(j$.match(V,$))return!1;let Z=$.split(/[/\\]/);for(let V=0;V<Z.length;V++)if(_J.has(Z[V]))return!0;let U=J?.extra||[];for(let V of[...DJ,...U])if(j$.match(V,$))return!0;return!1}var h1=V1({service:"file.watcher"}),P7=1e4,x0={Updated:b1.define("file.watcher.updated",N.Struct({file:N.String,event:N.Literals(["add","change","unlink"])}))},IJ=AJ(()=>{try{let $=N1(`@parcel/watcher-${process.platform}-${process.arch}${process.platform==="linux"?"-glibc":""}`);return M$($)}catch($){h1.error("failed to load watcher binding",{error:$});return}});function N7(){if(process.platform==="win32")return"windows";if(process.platform==="darwin")return"fs-events";if(process.platform==="linux")return"inotify"}function y7($){return O1.paths().filter((J)=>{let Z=G$.relative($,J);return Z!==""&&!Z.startsWith("..")&&!G$.isAbsolute(Z)})}var O7=()=>!!IJ();class S0 extends U1.Service()("@muxcode/FileWatcher"){}var TJ=b.effect(S0,X.gen(function*(){let $=yield*W1.Service,J=yield*q1.Service,Z=yield*x.make(X.fn("FileWatcher.state")(function*(){if(yield*B$.MUXCODE_EXPERIMENTAL_DISABLE_FILEWATCHER)return;let U=yield*x.context;h1.info("init",{directory:U.directory});let V=N7();if(!V){h1.error("watcher backend not supported",{directory:U.directory,platform:process.platform});return}let W=IJ();if(!W)return;h1.info("watcher backend",{directory:U.directory,platform:process.platform,backend:V});let Y=yield*RJ.make(),Q=[];yield*X.addFinalizer(()=>X.promise(()=>Promise.allSettled(Q.map((K)=>K.unsubscribe()))));let j=Y.bind((K,A)=>{for(let z of A){if(z.type==="create")X1.publish(U,x0.Updated,{file:z.path,event:"add"});if(z.type==="update")X1.publish(U,x0.Updated,{file:z.path,event:"change"});if(z.type==="delete")X1.publish(U,x0.Updated,{file:z.path,event:"unlink"})}}),q=(K,A)=>{let z=W.subscribe(K,j,{ignore:A,backend:V});return X.gen(function*(){let M=yield*X.promise(()=>z);Q.push(M)}).pipe(X.timeout(P7),X.catchCause((M)=>{return h1.error("failed to subscribe",{dir:K,cause:s1.pretty(M)}),z.then((L)=>L.unsubscribe()).catch(()=>{}),X.void}))},P=(yield*$.get()).watcher?.ignore??[];if(yield*B$.MUXCODE_EXPERIMENTAL_FILEWATCHER)yield*X.forkScoped(q(U.directory,[...Y0.PATTERNS,...P,...y7(U.directory)]));if(U.project.vcs==="git"){let K=yield*J.run(["rev-parse","--git-dir"],{cwd:U.worktree}),A=K.exitCode===0?G$.resolve(U.worktree,K.text().trim()):void 0,z=A?yield*X.promise(()=>C7(A).catch(()=>A)):void 0;if(z&&!P.includes(".git")&&!P.includes(z)&&(!A||!P.includes(A))){let M=(yield*X.promise(()=>F7(z).catch(()=>[]))).filter((L)=>L!=="HEAD");yield*X.forkScoped(q(z,M))}}},X.catchCause((U)=>{return h1.error("failed to init watcher service",{cause:s1.pretty(U)}),X.void})));return S0.of({init:X.fn("FileWatcher.init")(function*(){yield*x.get(Z)})})})),L7=TJ.pipe(b.provide(W1.defaultLayer),b.provide(q1.defaultLayer));var Q0=V1({service:"vcs"}),q$=2147483647,w$=1e7,z0=1e7,g0=($)=>D0(_0($,$,"","","","",{context:0})),EJ=($)=>new Map($.map((J)=>[J.file,{additions:J.additions,deletions:J.deletions}])),H7=(...$)=>{let J=new Map;return $.flat().forEach((Z)=>{if(!J.has(Z.file))J.set(Z.file,Z)}),[...J.values()]},_7=()=>({patches:new Map,capped:!1}),F$=($)=>{let J="";for(let Z=1;Z<$.length;Z++){let U=$[Z];if(U==='"')return{value:J,end:Z+1};if(U!=="\\"){J+=U;continue}let V=$[++Z];if(V==="t")J+="\t";else if(V==="n")J+=`
35
+ `;else if(V==="r")J+="\r";else if(V==='"'||V==="\\")J+=V;else J+=V??""}},D7=($)=>{if(!$.startsWith('"'))return $.split("\t")[0];return F$($)?.value??$},X0=($)=>{if(!$||$==="/dev/null")return;let J=D7($);if(J.startsWith("a/")||J.startsWith("b/"))return J.slice(2);return J},R7=($)=>{if($.startsWith('"')){let Z=F$($),U=Z?$.slice(Z.end).trimStart():void 0;if(!U)return;if(!U.startsWith('"'))return X0(U);return X0(F$(U)?.value)}let J=$.indexOf(" b/");if(J===-1)return;return X0($.slice(J+1))},A7=($)=>{let J=/^\+\+\+ (.+)$/m.exec($)?.[1],Z=/^--- (.+)$/m.exec($)?.[1],U=X0(J)??X0(Z);if(U)return U;let V=/^diff --git (.+)$/m.exec($)?.[1];return R7(V??"")},I7=($)=>{let J=[...$.text.matchAll(/(?:^|\n)diff --git /g)].map((U)=>U[0].startsWith(`
36
+ `)?U.index+1:U.index),Z=J.map((U,V)=>$.text.slice(U,J[V+1]??$.text.length));if(!$.truncated)return Z;return Z.slice(0,-1)},T7=X.fnUntraced(function*($,J,Z,U,V){if(U.length===0)return{patches:new Map,capped:!1};let W=yield*$.patchAll(J,Z,{context:V?.context??q$,maxOutputBytes:z0});if(W.truncated)Q0.warn("batched patch exceeded byte limit",{max:z0});return{patches:I7(W).reduce((Y,Q,j)=>{let q=A7(Q)??U[j]?.file;if(!q)return Y;return Y.set(q,(Y.get(q)??"")+Q),Y},new Map),capped:W.truncated}}),E7=X.fnUntraced(function*($,J,Z,U,V){let W=U.code==="??"||!Z?yield*$.patchUntracked(J,U.file,{context:V?.context??q$,maxOutputBytes:w$}):yield*$.patch(J,Z,U.file,{context:V?.context??q$,maxOutputBytes:w$});if(!W.truncated&&W.text)return W.text;if(W.truncated)Q0.warn("patch exceeded byte limit",{file:U.file,max:w$});return g0(U.file)}),k7=($,J,Z)=>{if(Z+Buffer.byteLength(J)<=z0)return{patch:J,capped:!1};return Q0.warn("total patch budget exceeded",{file:$,max:z0}),{patch:g0($),capped:!0}},x7=X.fnUntraced(function*($,J,Z,U,V,W,Y){if(W)return g0(U.file);let Q=V.patches.get(U.file);if(Q!==void 0)return Q;if(U.code!=="??"&&V.capped)return g0(U.file);return yield*E7($,J,Z,U,Y)}),kJ=X.fnUntraced(function*($,J,Z,U,V,W,Y){let Q=[],j=0,q=!1;for(let C of U.toSorted((P,K)=>P.file.localeCompare(K.file))){let P=V.get(C.file)??(C.status==="added"?yield*$.statUntracked(J,C.file):void 0),K=yield*x7($,J,Z,C,W,q,Y),A=q?{patch:K,capped:!0}:k7(C.file,K,j);if(q=q||A.capped,!q)j+=Buffer.byteLength(A.patch),q=j>=z0;Q.push({file:C.file,patch:A.patch,additions:P?.additions??0,deletions:P?.deletions??0,status:C.status})}return Q}),xJ=X.fnUntraced(function*($,J,Z,U){let[V,W,Y]=yield*X.all([$.diff(J,Z),$.stats(J,Z),$.status(J)],{concurrency:3});return yield*kJ($,J,Z,H7(V,Y.filter((Q)=>Q.code==="??")),EJ(W),yield*T7($,J,Z,V,U),U)}),S7=X.fnUntraced(function*($,J,Z,U){if(!Z)return yield*kJ($,J,Z,yield*$.status(J),new Map,_7(),U);return yield*xJ($,J,Z,U)}),g7=N.Literals(["git","branch"]),SJ={BranchUpdated:b1.define("vcs.branch.updated",N.Struct({branch:N.optional(N.String)}))},b7=N.Struct({branch:N.optional(N.String),default_branch:N.optional(N.String)}).annotate({identifier:"VcsInfo"}),f7=N.Struct({file:N.String,patch:N.optional(N.String),additions:N.Finite,deletions:N.Finite,status:N.optional(N.Literals(["added","deleted","modified"]))}).annotate({identifier:"VcsFileDiff"}),v7=N.Struct({file:N.String,additions:N.Finite,deletions:N.Finite,status:N.Literals(["added","deleted","modified"])}).annotate({identifier:"VcsFileStatus"}),d7=N.Struct({patch:N.String}),h7=N.Struct({applied:N.Boolean});class b0 extends N.TaggedErrorClass()("VcsPatchApplyError",{message:N.String,reason:N.Literals(["non-git","not-clean"])}){}class l1 extends U1.Service()("@muxcode/Vcs"){}var gJ=b.effect(l1,X.gen(function*(){let $=yield*q1.Service,J=yield*X1.Service,Z=yield*_1.Scope,U=yield*x.make(X.fn("Vcs.state")(function*(V){if(V.project.vcs!=="git")return{current:void 0,root:void 0};let W=X.fnUntraced(function*(){return yield*$.branch(V.directory)}),[Y,Q]=yield*X.all([$.branch(V.directory),$.defaultBranch(V.directory)],{concurrency:2}),j={current:Y,root:Q};return Q0.info("initialized",{branch:j.current,default_branch:j.root?.name}),yield*(yield*J.subscribe(y1.Event.Updated)).pipe(v.filter((q)=>q.properties.file.endsWith("HEAD")),v.runForEach((q)=>X.gen(function*(){let C=yield*W();if(C!==j.current)Q0.info("branch changed",{from:j.current,to:C}),j.current=C,yield*J.publish(SJ.BranchUpdated,{branch:C})})),X.forkScoped),j}));return l1.of({init:X.fn("Vcs.init")(function*(){yield*x.get(U).pipe(X.forkIn(Z))}),branch:X.fn("Vcs.branch")(function*(){return yield*x.use(U,(V)=>V.current)}),defaultBranch:X.fn("Vcs.defaultBranch")(function*(){return yield*x.use(U,(V)=>V.root?.name)}),status:X.fn("Vcs.status")(function*(){let V=yield*x.context;if(V.project.vcs!=="git")return[];let W=(yield*$.hasHead(V.directory))?"HEAD":void 0,[Y,Q]=yield*X.all([$.status(V.directory),W?$.stats(V.directory,W):X.succeed([])],{concurrency:2}),j=EJ(Q);return yield*X.forEach(Y.toSorted((q,C)=>q.file.localeCompare(C.file)),(q)=>X.gen(function*(){let C=j.get(q.file)??(q.status==="added"?yield*$.statUntracked(V.worktree,q.file):void 0);return{file:q.file,additions:C?.additions??0,deletions:C?.deletions??0,status:q.status}}))}),diff:X.fn("Vcs.diff")(function*(V,W){let Y=yield*x.get(U),Q=yield*x.context;if(Q.project.vcs!=="git")return[];if(V==="git")return yield*S7($,Q.directory,(yield*$.hasHead(Q.directory))?"HEAD":void 0,W);if(!Y.root)return[];if(Y.current&&Y.current===Y.root.name)return[];let j=yield*$.mergeBase(Q.directory,Y.root.ref);if(!j)return[];return yield*xJ($,Q.directory,j,W)}),diffRaw:X.fn("Vcs.diffRaw")(function*(){let V=yield*x.context;if(V.project.vcs!=="git")return"";let[W,Y]=yield*X.all([$.hasHead(V.directory),$.status(V.directory)],{concurrency:2}),Q=W?(yield*$.patchAll(V.directory,"HEAD")).text:"",j=yield*X.forEach(Y.filter((q)=>q.code==="??"),(q)=>$.patchUntracked(V.directory,q.file).pipe(X.map((C)=>C.text)));return[Q,...j].filter(Boolean).join(`
37
+ `)}),apply:X.fn("Vcs.apply")(function*(V){let W=yield*x.context;if(W.project.vcs!=="git")return yield*new b0({message:"Patch can't be applied because the project is not git-based",reason:"non-git"});if((yield*$.applyPatch(W.directory,V.patch)).exitCode!==0)return yield*new b0({message:"Patch can't be applied",reason:"not-clean"});return{applied:!0}})})})),C$=gJ.pipe(b.provide(q1.defaultLayer),b.provide(X1.layer));var r1={};j1(r1,{use:()=>u7,layer:()=>pJ,defaultLayer:()=>c7,ShareNext:()=>r1,Service:()=>M0});var I1=bJ("session_share",{session_id:K0().primaryKey().references(()=>vJ.id,{onDelete:"cascade"}),id:K0().notNull(),secret:K0().notNull(),url:K0().notNull(),...fJ});var T1=V1({service:"share-next"}),u1=process.env.MUXCODE_DISABLE_SHARE==="true"||process.env.MUXCODE_DISABLE_SHARE==="1",l7=N.Struct({id:N.String,url:N.String,secret:N.String});class M0 extends U1.Service()("@muxcode/ShareNext"){}var u7=P1(M0),P$=($)=>X.sync(()=>uJ.use($));function cJ($){return{create:`/api/${$}`,sync:(J)=>`/api/${$}/${J}/sync`,remove:(J)=>`/api/${$}/${J}`,data:(J)=>`/api/${$}/${J}/data`}}var m7=cJ("share"),r7=cJ("shares");function dJ($){switch($.type){case"session":return"session";case"message":return`message/${$.data.id}`;case"part":return`part/${$.data.messageID}/${$.data.id}`;case"session_diff":return"session_diff";case"model":return"model"}}var pJ=b.effect(M0,X.gen(function*(){let $=yield*L$.Service,J=yield*X1.Service,Z=yield*W1.Service,U=yield*S1.HttpClient,V=S1.filterStatusOk(U),W=yield*H$.Service,Y=yield*m1.Service;function Q(F,O){return X.gen(function*(){if(u1)return;if(!(yield*P(F)))return;let y=yield*x.get(j),_=y.queue.get(F);if(_){for(let H of O)_.set(dJ(H),H);return}let E=new Map(O.map((H)=>[dJ(H),H]));y.queue.set(F,E),yield*K(F).pipe(X.delay(1000),X.catchCause((H)=>X.sync(()=>{T1.error("share flush failed",{sessionID:F,cause:H})})),X.forkIn(y.scope))})}let j=yield*x.make(X.fn("ShareNext.state")(function*(F){let O={queue:new Map,scope:yield*_1.make(),shared:new Map};if(yield*X.addFinalizer(()=>_1.close(O.scope,hJ.void).pipe(X.andThen(X.sync(()=>{O.queue.clear(),O.shared.clear()})))),u1)return O;let T=(y,_)=>J.subscribe(y).pipe(X.flatMap((E)=>E.pipe(v.runForEach((H)=>_(H).pipe(X.catchCause((k)=>X.sync(()=>{T1.error("share subscriber failed",{type:y.type,cause:k})})))),X.forkScoped)));return yield*T(m1.Event.Updated,(y)=>X.gen(function*(){let _=y.properties.info;yield*Q(_.id,[{type:"session",data:_}])})),yield*T(O$.Event.Updated,(y)=>X.gen(function*(){let _=y.properties.info;if(yield*Q(_.sessionID,[{type:"message",data:_}]),_.role!=="user")return;let E=yield*W.getModel(_.model.providerID,_.model.modelID);yield*Q(_.sessionID,[{type:"model",data:[E]}])})),yield*T(O$.Event.PartUpdated,(y)=>Q(y.properties.part.sessionID,[{type:"part",data:y.properties.part}])),yield*T(m1.Event.Diff,(y)=>Q(y.properties.sessionID,[{type:"session_diff",data:y.properties.diff}])),yield*T(m1.Event.Deleted,(y)=>D(y.properties.sessionID)),O})),q=X.fn("ShareNext.request")(function*(){let F={},O=yield*$.active();if(N$.isNone(O)||!O.value.active_org_id){let y=(yield*Z.get()).enterprise?.url??"https://opncd.ai";return{headers:F,api:m7,baseUrl:y}}let T=yield*$.token(O.value.id);if(N$.isNone(T))throw Error("No active account token available for sharing");return F.authorization=`Bearer ${T.value}`,F["x-org-id"]=O.value.active_org_id,{headers:F,api:r7,baseUrl:O.value.url}}),C=X.fnUntraced(function*(F){let O=yield*P$((T)=>T.select().from(I1).where(y$(I1.session_id,F)).get());if(!O)return;return{id:O.id,secret:O.secret,url:O.url}}),P=X.fnUntraced(function*(F){let O=yield*x.get(j);if(O.shared.has(F)){let y=O.shared.get(F);return y===null?void 0:y}let T=yield*C(F);return O.shared.set(F,T??null),T}),K=X.fn("ShareNext.flush")(function*(F){if(u1)return;let O=yield*x.get(j),T=O.queue.get(F);if(!T)return;O.queue.delete(F);let y=yield*P(F);if(!y)return;let _=yield*q(),E=yield*Y1.post(`${_.baseUrl}${_.api.sync(y.id)}`).pipe(Y1.setHeaders(_.headers),Y1.bodyJson({secret:y.secret,data:Array.from(T.values())}),X.flatMap((H)=>U.execute(H)));if(E.status>=400)T1.warn("failed to sync share",{sessionID:F,shareID:y.id,status:E.status})}),A=X.fn("ShareNext.full")(function*(F){T1.info("full sync",{sessionID:F});let O=yield*Y.get(F),T=yield*Y.diff(F),y=yield*Y.messages({sessionID:F}),_=yield*X.forEach(Array.from(new Map(y.filter((E)=>E.info.role==="user").map((E)=>E.info.model).map((E)=>[`${E.providerID}/${E.modelID}`,E])).values()),(E)=>W.getModel(mJ.make(E.providerID),rJ.make(E.modelID)),{concurrency:8});yield*Q(F,[{type:"session",data:O},...y.map((E)=>({type:"message",data:E.info})),...y.flatMap((E)=>E.parts.map((H)=>({type:"part",data:H}))),{type:"session_diff",data:T},{type:"model",data:_}])}),z=X.fn("ShareNext.init")(function*(){if(u1)return;yield*x.get(j)}),M=X.fn("ShareNext.url")(function*(){return(yield*q()).baseUrl}),L=X.fn("ShareNext.create")(function*(F){if(u1)return{id:"",url:"",secret:""};T1.info("creating share",{sessionID:F});let O=yield*q(),T=yield*Y1.post(`${O.baseUrl}${O.api.create}`).pipe(Y1.setHeaders(O.headers),Y1.bodyJson({sessionID:F}),X.flatMap((_)=>V.execute(_)),X.flatMap(lJ.schemaBodyJson(l7)));yield*P$((_)=>_.insert(I1).values({session_id:F,id:T.id,secret:T.secret,url:T.url}).onConflictDoUpdate({target:I1.session_id,set:{id:T.id,secret:T.secret,url:T.url}}).run());let y=yield*x.get(j);return y.shared.set(F,T),yield*A(F).pipe(X.catchCause((_)=>X.sync(()=>{T1.error("share full sync failed",{sessionID:F,cause:_})})),X.forkIn(y.scope)),T}),D=X.fn("ShareNext.remove")(function*(F){if(u1)return;T1.info("removing share",{sessionID:F});let O=yield*x.get(j),T=yield*P(F);if(!T){O.shared.delete(F),O.queue.delete(F);return}let y=yield*q();yield*Y1.delete(`${y.baseUrl}${y.api.remove(T.id)}`).pipe(Y1.setHeaders(y.headers),Y1.bodyJson({secret:T.secret}),X.flatMap((_)=>V.execute(_))),yield*P$((_)=>_.delete(I1).where(y$(I1.session_id,F)).run()),O.shared.delete(F),O.queue.delete(F)});return M0.of({init:z,url:M,request:q,create:L,remove:D})})),c7=pJ.pipe(b.provide(X1.layer),b.provide(L$.defaultLayer),b.provide(W1.defaultLayer),b.provide(H0.layer),b.provide(H$.defaultLayer),b.provide(m1.defaultLayer));var oJ=b.effect(j0,X.gen(function*(){let $=yield*W1.Service,J=yield*f1.Service,Z=yield*y1.Service,U=yield*E1.Service,V=yield*D$.Service,W=yield*I$.Service,Y=yield*iJ,Q=yield*R$.Service,j=yield*r1.Service,q=yield*_$.Service,C=yield*l1,P=X.gen(function*(){let K=yield*x.context;yield*X.logInfo("bootstrapping").pipe(X.annotateLogs("directory",K.directory)),yield*$.get(),yield*W.init(),yield*X.forEach([Q,V,j,U,J,Z,C,q,Y],(A)=>A.init().pipe(X.catchCause((z)=>X.logWarning("init failed",{cause:z}))),{concurrency:"unbounded",discard:!0}).pipe(X.withSpan("InstanceBootstrap.init"))}).pipe(X.withSpan("InstanceBootstrap"));return j0.of({run:P})})),p7=oJ.pipe(b.provide([X1.layer,W1.defaultLayer,f1.defaultLayer,y1.defaultLayer,E1.defaultLayer,D$.defaultLayer,I$.defaultLayer,nJ,R$.defaultLayer,r1.defaultLayer,_$.defaultLayer,C$]));
38
+ export{g1 as Ok,f1 as Pk,y1 as Qk,E1 as Rk,f0 as Sk,I1 as Tk,r1 as Uk,oJ as Vk,p7 as Wk,A$ as Xk};