gemi 0.108.0 → 0.109.0

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 (211) hide show
  1. package/dist/ai/index.js +2 -2
  2. package/dist/ai/index.js.map +1 -1
  3. package/dist/app/index.js +1 -1
  4. package/dist/bin/gemi.js +74 -16
  5. package/dist/bin/gemi.js.map +6 -5
  6. package/dist/bun/plugin.js +1 -1
  7. package/dist/bun/preload.js +1 -1
  8. package/dist/{chunk-9jz4rggd.js → chunk-1es50p4k.js} +2 -2
  9. package/dist/{chunk-9jz4rggd.js.map → chunk-1es50p4k.js.map} +1 -1
  10. package/dist/{chunk-2gmgd05c.js → chunk-367kyrdx.js} +2 -2
  11. package/dist/{chunk-2gmgd05c.js.map → chunk-367kyrdx.js.map} +1 -1
  12. package/dist/{chunk-h7pafjej.js → chunk-3x86bhfn.js} +3 -3
  13. package/dist/{chunk-h7pafjej.js.map → chunk-3x86bhfn.js.map} +1 -1
  14. package/dist/{chunk-kda25fn4.js → chunk-52vsdnny.js} +1 -1
  15. package/dist/{chunk-m31pfz1s.js → chunk-5d6eaxab.js} +2 -2
  16. package/dist/{chunk-m31pfz1s.js.map → chunk-5d6eaxab.js.map} +1 -1
  17. package/dist/{chunk-njkk498k.js → chunk-6zekebzt.js} +2 -2
  18. package/dist/{chunk-njkk498k.js.map → chunk-6zekebzt.js.map} +1 -1
  19. package/dist/{chunk-00y49jcf.js → chunk-7mc5e61r.js} +2 -2
  20. package/dist/{chunk-00y49jcf.js.map → chunk-7mc5e61r.js.map} +1 -1
  21. package/dist/{chunk-47rgq59q.js → chunk-7ssjzp87.js} +2 -2
  22. package/dist/{chunk-47rgq59q.js.map → chunk-7ssjzp87.js.map} +1 -1
  23. package/dist/{chunk-5wt25tyd.js → chunk-9m18pknp.js} +2 -2
  24. package/dist/{chunk-5wt25tyd.js.map → chunk-9m18pknp.js.map} +1 -1
  25. package/dist/{chunk-vj2t77x1.js → chunk-9qw9fa6z.js} +2 -2
  26. package/dist/{chunk-vj2t77x1.js.map → chunk-9qw9fa6z.js.map} +1 -1
  27. package/dist/{chunk-v52dyw0q.js → chunk-c8dhvdrs.js} +2 -2
  28. package/dist/{chunk-v52dyw0q.js.map → chunk-c8dhvdrs.js.map} +1 -1
  29. package/dist/{chunk-kstvyvr0.js → chunk-d2tngs73.js} +2 -2
  30. package/dist/{chunk-kstvyvr0.js.map → chunk-d2tngs73.js.map} +1 -1
  31. package/dist/{chunk-q7y9v2v5.js → chunk-d5sbnzng.js} +13 -13
  32. package/dist/{chunk-q7y9v2v5.js.map → chunk-d5sbnzng.js.map} +5 -4
  33. package/dist/{chunk-1npdp1w2.js → chunk-dpy08xw4.js} +2 -2
  34. package/dist/{chunk-1npdp1w2.js.map → chunk-dpy08xw4.js.map} +1 -1
  35. package/dist/{chunk-h3t4n0bn.js → chunk-ehasw3qm.js} +2 -2
  36. package/dist/{chunk-h3t4n0bn.js.map → chunk-ehasw3qm.js.map} +1 -1
  37. package/dist/{chunk-331s9wqr.js → chunk-eyg88bgv.js} +2 -2
  38. package/dist/{chunk-331s9wqr.js.map → chunk-eyg88bgv.js.map} +1 -1
  39. package/dist/{chunk-fq3sb3xt.js → chunk-f7jhkg8x.js} +3 -3
  40. package/dist/{chunk-fq3sb3xt.js.map → chunk-f7jhkg8x.js.map} +1 -1
  41. package/dist/chunk-fe1pcnw6.js +6 -0
  42. package/dist/chunk-fe1pcnw6.js.map +11 -0
  43. package/dist/chunk-fj6yftm7.js +58 -0
  44. package/dist/{chunk-b9av1sgb.js.map → chunk-fj6yftm7.js.map} +3 -3
  45. package/dist/{chunk-2mhx4e4g.js → chunk-g5a3ptsa.js} +2 -2
  46. package/dist/{chunk-2mhx4e4g.js.map → chunk-g5a3ptsa.js.map} +1 -1
  47. package/dist/{chunk-2q7m8a16.js → chunk-g74qwhvf.js} +2 -2
  48. package/dist/{chunk-2q7m8a16.js.map → chunk-g74qwhvf.js.map} +1 -1
  49. package/dist/{chunk-eytdyahy.js → chunk-g7fr2cy2.js} +2 -2
  50. package/dist/{chunk-eytdyahy.js.map → chunk-g7fr2cy2.js.map} +1 -1
  51. package/dist/{chunk-yebaheh7.js → chunk-ga533cpz.js} +2 -2
  52. package/dist/{chunk-yebaheh7.js.map → chunk-ga533cpz.js.map} +1 -1
  53. package/dist/{chunk-q2fyp44f.js → chunk-gdsby5jh.js} +2 -2
  54. package/dist/{chunk-q2fyp44f.js.map → chunk-gdsby5jh.js.map} +1 -1
  55. package/dist/{chunk-sbyqs03h.js → chunk-grs8dnkd.js} +2 -2
  56. package/dist/{chunk-sbyqs03h.js.map → chunk-grs8dnkd.js.map} +1 -1
  57. package/dist/{chunk-k17prwhx.js → chunk-h15eae7g.js} +2 -2
  58. package/dist/{chunk-k17prwhx.js.map → chunk-h15eae7g.js.map} +1 -1
  59. package/dist/{chunk-9mqqr05d.js → chunk-h6g9g8qc.js} +3 -3
  60. package/dist/{chunk-9mqqr05d.js.map → chunk-h6g9g8qc.js.map} +1 -1
  61. package/dist/{chunk-82hpq0bq.js → chunk-hf32yq23.js} +2 -2
  62. package/dist/{chunk-82hpq0bq.js.map → chunk-hf32yq23.js.map} +1 -1
  63. package/dist/{chunk-xpyhmg45.js → chunk-hgz8sx40.js} +2 -2
  64. package/dist/{chunk-3s3awh38.js.map → chunk-hgz8sx40.js.map} +1 -1
  65. package/dist/{chunk-8pynv9rw.js → chunk-jc4j61xb.js} +2 -2
  66. package/dist/{chunk-8pynv9rw.js.map → chunk-jc4j61xb.js.map} +1 -1
  67. package/dist/{chunk-h4x7cba0.js → chunk-jgtean4t.js} +2 -2
  68. package/dist/{chunk-h4x7cba0.js.map → chunk-jgtean4t.js.map} +1 -1
  69. package/dist/{chunk-6rz8kyqb.js → chunk-jm4jn28j.js} +2 -2
  70. package/dist/{chunk-6rz8kyqb.js.map → chunk-jm4jn28j.js.map} +1 -1
  71. package/dist/{chunk-jnw73s8c.js → chunk-k1ezptt8.js} +2 -2
  72. package/dist/{chunk-jnw73s8c.js.map → chunk-k1ezptt8.js.map} +1 -1
  73. package/dist/{chunk-xg9vye7c.js → chunk-m9609t1y.js} +1 -1
  74. package/dist/{chunk-mhq2bd9c.js → chunk-mp5krm14.js} +3 -3
  75. package/dist/{chunk-mhq2bd9c.js.map → chunk-mp5krm14.js.map} +1 -1
  76. package/dist/{chunk-k9qmr2wa.js → chunk-ngw4xzrt.js} +3 -3
  77. package/dist/{chunk-k9qmr2wa.js.map → chunk-ngw4xzrt.js.map} +1 -1
  78. package/dist/{chunk-ydkjf626.js → chunk-nxxx0m1a.js} +2 -2
  79. package/dist/{chunk-ydkjf626.js.map → chunk-nxxx0m1a.js.map} +1 -1
  80. package/dist/{chunk-rn2kgbg4.js → chunk-pa3khk46.js} +2 -2
  81. package/dist/{chunk-rn2kgbg4.js.map → chunk-pa3khk46.js.map} +1 -1
  82. package/dist/{chunk-wsftnxzs.js → chunk-q8k7f11z.js} +2 -2
  83. package/dist/{chunk-wsftnxzs.js.map → chunk-q8k7f11z.js.map} +1 -1
  84. package/dist/{chunk-rjernda5.js → chunk-qnq110tw.js} +2 -2
  85. package/dist/{chunk-rjernda5.js.map → chunk-qnq110tw.js.map} +1 -1
  86. package/dist/{chunk-ftgd68se.js → chunk-qyyxzy04.js} +2 -2
  87. package/dist/{chunk-ftgd68se.js.map → chunk-qyyxzy04.js.map} +1 -1
  88. package/dist/{chunk-pj2e1p07.js → chunk-qz9aaw5x.js} +2 -2
  89. package/dist/{chunk-pj2e1p07.js.map → chunk-qz9aaw5x.js.map} +1 -1
  90. package/dist/{chunk-2xqrh6d0.js → chunk-r9gzbjc5.js} +1 -1
  91. package/dist/{chunk-wedwkqe7.js → chunk-rgfzqwpg.js} +3 -3
  92. package/dist/{chunk-wedwkqe7.js.map → chunk-rgfzqwpg.js.map} +1 -1
  93. package/dist/{chunk-hdhahvd4.js → chunk-rjcsdazt.js} +2 -2
  94. package/dist/{chunk-hdhahvd4.js.map → chunk-rjcsdazt.js.map} +1 -1
  95. package/dist/chunk-s5aa4hty.js +17 -0
  96. package/dist/{chunk-ncfxmtd5.js.map → chunk-s5aa4hty.js.map} +8 -6
  97. package/dist/{chunk-rh9j8cwv.js → chunk-sp2v357a.js} +3 -3
  98. package/dist/{chunk-rh9j8cwv.js.map → chunk-sp2v357a.js.map} +1 -1
  99. package/dist/{chunk-cfsscms3.js → chunk-t0bp8nrc.js} +4 -4
  100. package/dist/{chunk-cfsscms3.js.map → chunk-t0bp8nrc.js.map} +1 -1
  101. package/dist/{chunk-kqff894s.js → chunk-t3qw9syt.js} +2 -2
  102. package/dist/{chunk-kqff894s.js.map → chunk-t3qw9syt.js.map} +1 -1
  103. package/dist/{chunk-zrdbytx4.js → chunk-t85rca2p.js} +2 -2
  104. package/dist/{chunk-zrdbytx4.js.map → chunk-t85rca2p.js.map} +1 -1
  105. package/dist/{chunk-tyhrrnp5.js → chunk-tr9mxdth.js} +3 -3
  106. package/dist/{chunk-tyhrrnp5.js.map → chunk-tr9mxdth.js.map} +1 -1
  107. package/dist/{chunk-6wrhc9bq.js → chunk-vee4j6ft.js} +2 -2
  108. package/dist/{chunk-6wrhc9bq.js.map → chunk-vee4j6ft.js.map} +1 -1
  109. package/dist/{chunk-kqz8jp6v.js → chunk-vna85rdq.js} +2 -2
  110. package/dist/{chunk-kqz8jp6v.js.map → chunk-vna85rdq.js.map} +1 -1
  111. package/dist/{chunk-4rr9wmh8.js → chunk-vsnmdtrs.js} +2 -2
  112. package/dist/{chunk-4rr9wmh8.js.map → chunk-vsnmdtrs.js.map} +1 -1
  113. package/dist/{chunk-anp4kv3w.js → chunk-vwkdfngg.js} +1 -1
  114. package/dist/chunk-w3j53r0a.js +24 -0
  115. package/dist/{chunk-h2hdpm70.js.map → chunk-w3j53r0a.js.map} +4 -4
  116. package/dist/{chunk-gqpge54c.js → chunk-wdpdqjr1.js} +2 -2
  117. package/dist/{chunk-gqpge54c.js.map → chunk-wdpdqjr1.js.map} +1 -1
  118. package/dist/{chunk-wzqkdmjd.js → chunk-whe0x70j.js} +2 -2
  119. package/dist/{chunk-wzqkdmjd.js.map → chunk-whe0x70j.js.map} +1 -1
  120. package/dist/{chunk-1rs13253.js → chunk-wqsdjweb.js} +3 -3
  121. package/dist/{chunk-1rs13253.js.map → chunk-wqsdjweb.js.map} +1 -1
  122. package/dist/{chunk-3s3awh38.js → chunk-wvwee7dn.js} +2 -2
  123. package/dist/{chunk-xpyhmg45.js.map → chunk-wvwee7dn.js.map} +1 -1
  124. package/dist/{chunk-ffagkj3x.js → chunk-y66ntxbg.js} +2 -2
  125. package/dist/{chunk-ffagkj3x.js.map → chunk-y66ntxbg.js.map} +1 -1
  126. package/dist/chunk-z9x8x3wq.js +5 -0
  127. package/dist/{chunk-mrvcaakf.js.map → chunk-z9x8x3wq.js.map} +1 -1
  128. package/dist/{chunk-we2sj339.js → chunk-zh1t33nq.js} +2 -2
  129. package/dist/{chunk-we2sj339.js.map → chunk-zh1t33nq.js.map} +1 -1
  130. package/dist/{chunk-661wezaf.js → chunk-zhm3qvrc.js} +2 -2
  131. package/dist/{chunk-661wezaf.js.map → chunk-zhm3qvrc.js.map} +1 -1
  132. package/dist/{chunk-kh273hj0.js → chunk-zys7kecf.js} +2 -2
  133. package/dist/{chunk-kh273hj0.js.map → chunk-zys7kecf.js.map} +1 -1
  134. package/dist/{chunk-fwympxqk.js → chunk-zz7h6tdr.js} +2 -2
  135. package/dist/{chunk-fwympxqk.js.map → chunk-zz7h6tdr.js.map} +1 -1
  136. package/dist/chunks/{ThemeProvider-Cqfwr6dk.js → ThemeProvider-BgLyzzOL.js} +8 -2
  137. package/dist/chunks/ThemeProvider-BgLyzzOL.js.map +1 -0
  138. package/dist/client/ClientRouterContext.d.ts.map +1 -1
  139. package/dist/client/ServerDataProvider.d.ts +2 -0
  140. package/dist/client/ServerDataProvider.d.ts.map +1 -1
  141. package/dist/client/createRoot.d.ts.map +1 -1
  142. package/dist/client/index.d.ts +2 -0
  143. package/dist/client/index.d.ts.map +1 -1
  144. package/dist/client/index.js +72 -3
  145. package/dist/client/index.js.map +1 -1
  146. package/dist/client/islands.d.ts +84 -0
  147. package/dist/client/islands.d.ts.map +1 -0
  148. package/dist/config/index.js +1 -1
  149. package/dist/console/run.js +2 -2
  150. package/dist/console/run.js.map +1 -1
  151. package/dist/container/index.js +2 -2
  152. package/dist/container/index.js.map +1 -1
  153. package/dist/database/index.js +2 -2
  154. package/dist/database/index.js.map +1 -1
  155. package/dist/email/index.js +2 -2
  156. package/dist/email/index.js.map +1 -1
  157. package/dist/facades/index.js +2 -2
  158. package/dist/facades/index.js.map +1 -1
  159. package/dist/foundation/index.js +2 -2
  160. package/dist/foundation/index.js.map +1 -1
  161. package/dist/http/ViewRouter.d.ts +38 -0
  162. package/dist/http/ViewRouter.d.ts.map +1 -1
  163. package/dist/http/index.d.ts +1 -1
  164. package/dist/http/index.d.ts.map +1 -1
  165. package/dist/http/index.js +2 -2
  166. package/dist/http/index.js.map +1 -1
  167. package/dist/i18n/dictionaryRuntime.js +2 -2
  168. package/dist/i18n/dictionaryRuntime.js.map +1 -1
  169. package/dist/i18n/index.js +2 -2
  170. package/dist/i18n/index.js.map +1 -1
  171. package/dist/kernel/index.js +2 -2
  172. package/dist/kernel/index.js.map +1 -1
  173. package/dist/orm/index.js +2 -2
  174. package/dist/orm/index.js.map +1 -1
  175. package/dist/server/devFetch.d.ts.map +1 -1
  176. package/dist/server/httpProd.d.ts.map +1 -1
  177. package/dist/server/index.js +2 -2
  178. package/dist/server/index.js.map +1 -1
  179. package/dist/server/modulePreloads.d.ts +17 -0
  180. package/dist/server/modulePreloads.d.ts.map +1 -1
  181. package/dist/server/styles.d.ts +3 -1
  182. package/dist/server/styles.d.ts.map +1 -1
  183. package/dist/services/index.d.ts +1 -0
  184. package/dist/services/index.d.ts.map +1 -1
  185. package/dist/services/index.js +3 -3
  186. package/dist/services/index.js.map +2 -2
  187. package/dist/services/queue/work.js +2 -2
  188. package/dist/services/queue/work.js.map +1 -1
  189. package/dist/services/router/ViewRouteDispatcher.d.ts +27 -1
  190. package/dist/services/router/ViewRouteDispatcher.d.ts.map +1 -1
  191. package/dist/services/router/createFlatViewRoutes.d.ts +13 -1
  192. package/dist/services/router/createFlatViewRoutes.d.ts.map +1 -1
  193. package/dist/services/router/staticDocument.d.ts +44 -0
  194. package/dist/services/router/staticDocument.d.ts.map +1 -0
  195. package/dist/support/index.js +2 -2
  196. package/dist/support/index.js.map +1 -1
  197. package/dist/testing/index.js +1 -1
  198. package/dist/vite/index.mjs +72 -3
  199. package/dist/vitest/index.js +1 -1
  200. package/package.json +1 -1
  201. package/dist/chunk-b9av1sgb.js +0 -58
  202. package/dist/chunk-cewyag0d.js +0 -6
  203. package/dist/chunk-cewyag0d.js.map +0 -11
  204. package/dist/chunk-h2hdpm70.js +0 -24
  205. package/dist/chunk-mrvcaakf.js +0 -5
  206. package/dist/chunk-ncfxmtd5.js +0 -17
  207. package/dist/chunks/ThemeProvider-Cqfwr6dk.js.map +0 -1
  208. /package/dist/{chunk-kda25fn4.js.map → chunk-52vsdnny.js.map} +0 -0
  209. /package/dist/{chunk-xg9vye7c.js.map → chunk-m9609t1y.js.map} +0 -0
  210. /package/dist/{chunk-2xqrh6d0.js.map → chunk-r9gzbjc5.js.map} +0 -0
  211. /package/dist/{chunk-anp4kv3w.js.map → chunk-vwkdfngg.js.map} +0 -0
@@ -1,17 +0,0 @@
1
- // @bun
2
- import{ee as WJ,le as b5}from"./chunk-h7pafjej.js";import{cf as R5,se as MZ,xe as B3}from"./chunk-1npdp1w2.js";import{Af as fj,Bf as Bj,Df as o1,Ef as V0,Ff as uO,Nf as K9,Of as I$,Pf as S5,df as _j,hf as G5,if as v4,jf as Qj,kf as Dj,nf as Tj,of as Gj,pf as VZ,qf as O5,rf as V5,sf as F4,tf as p,yf as A,zf as Sj}from"./chunk-rh9j8cwv.js";import{Rf as Q3,Sf as q0,Tf as f1,Uf as w4}from"./chunk-fwympxqk.js";import{Vf as u9,Wf as a2,Xf as H}from"./chunk-njkk498k.js";import{_f as P5}from"./chunk-gqpge54c.js";import{$f as I5}from"./chunk-5wt25tyd.js";import{ag as F5,bg as kZ,cg as qZ,dg as A5,eg as E5,pg as v5}from"./chunk-k9qmr2wa.js";import{Eg as gZ}from"./chunk-4rr9wmh8.js";import{Jg as z5,Og as X5}from"./chunk-47rgq59q.js";import{Vg as Y5,Zg as n}from"./chunk-2q7m8a16.js";import{_g as BZ,bh as N}from"./chunk-9mqqr05d.js";import{ph as U5}from"./chunk-82hpq0bq.js";import{uh as r2}from"./chunk-3s3awh38.js";function L3($){return typeof $==="function"&&$.prototype!==void 0}function D1($){return typeof $==="string"?[$]:$}function _3($,Z){let O=Z?"attachment":"inline",j=$.replace(/["\\]/g,"").replace(/[^\x20-\x7e]/g,"_");return`${O}; filename="${j}"; filename*=UTF-8''${encodeURIComponent($)}`}function d5($){return"total"in $&&"partial"in $&&"body"in $}function W4(){return new Response("Not found",{status:404,headers:{"X-Content-Type-Options":"nosniff"}})}function LZ($){return new Response(null,{status:416,headers:{"Accept-Ranges":"bytes","Content-Range":Gj($),"Content-Length":"0","Cache-Control":"no-store","X-Content-Type-Options":"nosniff"}})}async function i5($){if($ instanceof Blob)return{body:$,start:0,end:$.size-1,total:$.size,partial:!1,type:$.type,name:$.name,download:!1,status:200,extraHeaders:{}};if(d5($))return{body:$.body,start:$.start,end:$.end,total:$.total,partial:$.partial,type:$.type,name:$.name,download:$.download??!1,etag:$.etag,lastModified:$.lastModified,status:$.status??200,extraHeaders:$.headers??{}};let Z=$.file,O=Z instanceof Blob?Z:null,j=$.total??O?.size??-1;return{body:Z,start:$.start??0,end:$.end??j-1,total:j,partial:$.partial??!1,type:$.type??O?.type??"",name:$.name??Z?.name,download:$.download??!1,etag:$.etag,lastModified:$.lastModified,status:$.status??200,extraHeaders:$.headers??{}}}async function Fj($,Z){if($ instanceof Response)return $;if(!$)return W4();let O=await i5($),{body:j,start:J,end:W,total:Y,partial:z}=O;if(j instanceof Blob&&"exists"in j&&typeof j.exists==="function"){if(!await j.exists())return W4()}let{range:X}=Z;if(X){if(Y<=0)return LZ(Math.max(Y,0));if(!z){if(j instanceof Blob){let G=Dj(X,Y);if(!G)return LZ(Y);j=j.slice(G.start,G.end+1),J=G.start,W=G.end,z=!0}}}let D=Boolean(X)&&z,T=D?206:O.status,F=new Headers;if(F.set("Accept-Ranges","bytes"),F.set("Content-Type",O.type||"application/octet-stream"),F.set("X-Content-Type-Options","nosniff"),D)F.set("Content-Range",Tj(J,W,Y)),F.set("Content-Length",String(W-J+1));else if(Y>=0)F.set("Content-Length",String(Y));if(O.name)F.set("Content-Disposition",_3(O.name,O.download));if(O.etag)F.set("ETag",O.etag);if(O.lastModified)F.set("Last-Modified",O.lastModified.toUTCString());for(let[G,U]of Object.entries(O.extraHeaders))F.set(G,U);if((Z.method??"GET").toUpperCase()==="HEAD"){if(j&&"cancel"in j&&typeof j.cancel==="function")await j.cancel();return new Response(null,{status:T,headers:F})}return new Response(j,{status:T,headers:F})}class P$ extends q0{limit;constructor($){super("The request body is too large.",{status:413});this.limit=$}}var Y4={b:1,k:1024,kb:1024,m:1048576,mb:1048576,g:1073741824,gb:1073741824};function SZ($){if(typeof $==="number"){if(Number.isFinite($)&&$>=0)return Math.floor($);if($===1/0)return 1/0}else{let Z=$.trim().toLowerCase();if(Z==="none"||Z==="off")return 1/0;let O=/^(\d+(?:\.\d+)?)\s*([a-z]*)$/.exec(Z);if(O&&(O[2]===""||(O[2]in Y4)))return Math.floor(Number(O[1])*(Y4[O[2]]??1))}throw Error(`Invalid body limit ${JSON.stringify($)}. Use a byte count or a size such as "64kb", "1mb" or "none".`)}var _Z=new WeakMap;function X4($){return _Z.has($)}function D4($){return _Z.get($)?.limit??null}function T4($){let Z=_Z.get($);return Z?Z.read>Z.limit:!1}function u5($){let Z=$.headers.get("Content-Length");if(Z===null||!/^\s*\d+\s*$/.test(Z))return null;return Number(Z)}function Kj($,Z){let O=u5($);if(O!==null&&O>Z)throw new P$(Z)}function S3($,Z,O={}){let j=_Z.get($);if(j)j.limit=Z;else{let J={limit:Z,read:0,stream:void 0,used:!1};_Z.set($,J),n5($,J)}if(O.checkDeclared!==!1)Kj($,Z)}function s5($){return Reflect.get(Object.getPrototypeOf($),"body",$)??null}function Uj($,Z){if(Z.stream!==void 0)return Z.stream;let O=s5($);if(!O)return Z.stream=null;let j;return Z.stream=new ReadableStream({async pull(J){j??=O.getReader();let{done:W,value:Y}=await j.read();if(W){J.close();return}if(Z.read+=Y.byteLength,Z.read>Z.limit){let z=new P$(Z.limit);J.error(z),j.cancel(z).catch(()=>{});return}J.enqueue(Y)},cancel(J){return j?j.cancel(J):O.cancel(J)}},{highWaterMark:0}),Z.stream}async function f$($,Z){if(Kj($,Z.limit),Z.used||Z.stream?.locked)throw TypeError("Body already used");Z.used=!0;let O=Uj($,Z);if(!O)return new Uint8Array(0);let j=O.getReader(),J=[],W=0;for(;;){let{done:X,value:D}=await j.read();if(X)break;J.push(D),W+=D.byteLength}let Y=new Uint8Array(W),z=0;for(let X of J)Y.set(X,z),z+=X.byteLength;return Y}function z4($){return $.headers.get("Content-Type")??""}function n5($,Z){let O=(j,J)=>Object.defineProperty($,j,{configurable:!0,...J});O("body",{get:()=>Uj($,Z)}),O("bodyUsed",{get:()=>Z.used||Boolean(Z.stream?.locked)||Reflect.get(Object.getPrototypeOf($),"bodyUsed",$)}),O("bytes",{value:()=>f$($,Z)}),O("arrayBuffer",{value:async()=>{let j=await f$($,Z);return j.buffer.slice(j.byteOffset,j.byteOffset+j.byteLength)}}),O("text",{value:async()=>new TextDecoder().decode(await f$($,Z))}),O("json",{value:async()=>JSON.parse(new TextDecoder().decode(await f$($,Z)))}),O("blob",{value:async()=>new Blob([await f$($,Z)],{type:z4($)})}),O("formData",{value:async()=>new Response(await f$($,Z),{headers:{"Content-Type":z4($)}}).formData()}),O("clone",{value:()=>{Kj($,Z.limit);let j=Uj($,Z),J=null;if(j){let[W,Y]=j.tee();Z.stream=W,J=Y}return new Request($.url,{method:$.method,headers:$.headers,body:J,signal:$.signal,duplex:"half"})}})}function G4($){return L3($)}class e{method;handler;methodName;__internal_brand="RouteHandler";middlewares=[];constructor($,Z,O){this.method=$;this.handler=Z;this.methodName=O;this.handler=Z,this.methodName=O,this.method=$}get source(){if(!G4(this.handler)||typeof this.methodName!=="string")return;return{controller:this.handler,methodName:this.methodName}}__internal_use(){return{run:this.run.bind(this),middlewares:this.middlewares}}run($){if(G4(this.handler)){let Z=new this.handler;return Z[this.methodName].bind(Z)()}return this.handler()}middleware($){return this.middlewares=D1($),this}}class U4{url;headers;__internal_brand="ProxyHandler";middlewares=[];constructor($,Z){this.url=$;this.headers=Z}middleware($){return this.middlewares=D1($),this}async run(){let $=new A,Z=$.headers.toJSON();for(let O of F4($.rawRequest))delete Z[O];try{return await fetch(this.url,{method:$.rawRequest.method,headers:{...Z,...this.headers},body:$.rawRequest.body})}catch(O){if(T4($.rawRequest))throw new P$(D4($.rawRequest));throw O}}}class K4{constructor(...$){return new e(...$)}}class Q4 extends e{__internal_brand="StreamHandler";async run($){let Z=H.getStore(),O=Z?.req?.rawRequest,j=Qj(O?.headers.get("Range"));if(Z)Z.rangeRequest=j;try{let J=await super.run($);return await Fj(J,{range:j,method:O?.method})}catch(J){if(J instanceof Bj)return LZ(J.total);throw J}finally{if(Z)Z.rangeRequest=null}}}class B4{constructor(...$){return new Q4(...$)}}class V4{__internal_brand="ResourceRoutes";first;second;constructor($){this.first={get:new e("GET",$,"list"),post:new e("POST",$,"store")},this.second={get:new e("GET",$,"show"),put:new e("PUT",$,"update"),delete:new e("DELETE",$,"delete")}}middleware($){if($.list)this.first.get.middleware($.list);if($.store)this.first.post.middleware($.store);if($.show)this.second.get.middleware($.show);if($.update)this.second.put.middleware($.update);if($.delete)this.second.delete.middleware($.delete);return this}}class H0{static __brand="ApiRouter";routes={};middlewares=[];middleware($){}get($,Z){return new e("GET",$,Z)}post($,Z){return new e("POST",$,Z)}put($,Z){return new e("PUT",$,Z)}patch($,Z){return new e("PATCH",$,Z)}delete($,Z){return new e("DELETE",$,Z)}resource($){return new V4($)}agent($){if($.kind!=="agent-controller")throw TypeError(`this.agent() takes an AgentController class, and got ${a5($)}.`);return o5($,this)}file($,Z){return new K4("GET",$,Z)}stream($,Z){return new B4("GET",$,Z)}proxy($,Z={}){return new U4($,Z)}}function a5($){if(typeof $==="function"&&$.name)return $.name;return typeof $}function o5($,Z){let O={stream:new e("POST",$,"stream"),attach:new e("POST",$,"attach"),stop:new e("POST",$,"stop"),upload:new e("POST",$,"upload")};return class extends H0{static __internal_brand="AgentRoute";static controller=$;static handlers=O;constructor(){super();this.middlewares=[...Z?.middlewares??[]]}routes={"/":O.stream,"/attach":O.attach,"/stop":O.stop,"/files":O.upload};static middleware(J){if(J.stream)O.stream.middleware(J.stream);if(J.attach)O.attach.middleware(J.attach);if(J.stop)O.stop.middleware(J.stop);if(J.upload)O.upload.middleware(J.upload);return this}}}class Vj{as;input;bind;__internal_brand="McpModelParam";constructor($,Z,O){this.as=$;this.input=Z;this.bind=O}}class Cj{method;url;meta;__internal_brand="McpRoute";constructor($,Z,O){this.method=$;this.url=Z;this.meta=O}}class C4{static __brand="McpRouter";routes={};param($){return new Vj($.as,$.input,$.bind)}fromApiRoute($,Z,O){return new Cj($,Z,O)}}function Y0($,Z){return $.replace(/:([^/]+[*?]?)/g,(O,j)=>{let J=j.endsWith("?")||j.endsWith("*"),W=J?j.slice(0,-1):j,Y=Z[W];if(Y===void 0){if(J)return"";if(import.meta.env.DEV)throw Error(`Missing parameter: ${W}`);console.error(`Missing parameter: ${W} in URL: ${$}`)}return String(Y)}).replace(/\/\//g,"/").replace(/\/$/,"")}class Mj extends q0{constructor($,Z=307){super("Redirect error");this.name="RedirectError",this.payload={api:{status:200,data:{},directive:{kind:"Redirect",path:$}},view:{status:Z,headers:{"Cache-Control":"private, no-cache, no-store, max-age=0, must-revalidate",Location:$}}}}}class f3{static to($,...Z){let[O={}]=Z,{search:j={},params:J={},permanent:W,status:Y}={params:{},status:307,permanent:!1,...O},z=new URLSearchParams(j).toString();throw new Mj([Y0($,J)||"/",z.toString()].filter(Boolean).join("?"),Y??(W?301:307))}static external($,Z=307){throw new Mj($,Z)}}var M4=Symbol.for("gemi.HttpResponse");class a1{kind;body;status;headers;[M4]=!0;constructor($,Z,O,j){this.kind=$;this.body=Z;this.status=O;this.headers=j}static json($,Z={}){let O=Z.status??200;return r5(O),new a1("json",$,O,new Headers(Z.headers))}static error($,Z,O={}){if(!Number.isInteger($)||$<400||$>599)throw RangeError(`HttpResponse.error: status must be an integer from 400 to 599, got ${$}.`);return a1.json({error:Z},{...O,status:$})}get ok(){return this.status>=200&&this.status<300}toResponse($,Z){let O=$,j=this.serialize(O);for(let J of Z)O.append("Set-Cookie",J);this.headers.forEach((J,W)=>{if(W.toLowerCase()!=="set-cookie")O.set(W,J)});for(let J of this.headers.getSetCookie())O.append("Set-Cookie",J);if(this.status>=400&&!this.headers.has("Cache-Control"))O.set("Cache-Control","no-store");return new Response(j,{status:this.status,headers:O})}serialize($){switch(this.kind){case"json":return $.set("Content-Type","application/json"),JSON.stringify(this.body)??null}}}function r5($){if(!Number.isInteger($)||$<200||$>599)throw RangeError(`HttpResponse: status must be an integer from 200 to 599, got ${$}.`);if($===204||$===205||$===304)throw RangeError(`HttpResponse.json: a ${$} response has no body.`)}function H$($){return typeof $==="object"&&$!==null&&$[M4]===!0}function t5($,Z,O={}){return a1.error($,Z,O)}class I4{kind="redirect";viewPath="REDIRECT";middlewares=[];featureGates=[];handler;constructor($){if(!$)this.handler=()=>({});else if(typeof $==="function")this.handler=$;else{let[Z,O]=$;this.handler=(j)=>{return new Z()[O](j)}}}async run($,Z){let{destination:O,permanent:j=!1,status:J=307}=await this.handler($);if(!O)throw Error(`Redirect destination is required see ${Z}`);return f3.to(O,{permanent:j,status:J}),{}}middleware($){return this.middlewares=D1($),this}feature($){return this.featureGates=[...this.featureGates,$],this}}async function Ij($,Z){if($ instanceof Response)return $;let O=$ instanceof Blob,j=O?$:$.file,J=O?$.name:$.name??$.file?.name,W=(O?$.type:$.type??$.file?.type)||"",Y=O?!1:$.download??!1,z=O?200:$.status??200;if(!O)for(let[X,D]of Object.entries($.headers??{}))Z.set(X,D);if(j instanceof Blob&&"exists"in j&&typeof j.exists==="function"){if(!await j.exists())return new Response("Not found",{status:404})}if(Z.set("Content-Type",W||"application/octet-stream"),j instanceof Blob)Z.set("Content-Length",String(j.size));if(J)Z.set("Content-Disposition",_3(J,Y));return new Response(j instanceof Blob?j.stream():j,{status:z,headers:Z})}class N4{kind="file";viewPath="FILE";middlewares=[];featureGates=[];handler;constructor($){if(!$)this.handler=()=>null;else if(typeof $==="function")this.handler=$;else{let[Z,O]=$;this.handler=(j)=>{return new Z()[O](j)}}}async run($,Z){let O=await this.handler($);if(!O)throw Error(`File route handler must return a file see ${Z}`);return{FILE:O}}middleware($){return this.middlewares=D1($),this}feature($){return this.featureGates=[...this.featureGates,$],this}}function L4($,Z){if(H$($))throw Error(`The handler of view "${Z}" returned an HttpResponse. HttpResponse is for api routes; a view handler returns its props.`);return $}class _4{viewPath;middlewares=[];featureGates=[];handler;constructor($,Z){this.viewPath=$;if(!Z)this.handler=()=>({});else if(typeof Z==="function")this.handler=Z;else{let[O,j]=Z;this.handler=(J)=>{return new O()[j](J)}}}async run($,Z){let O=L4(await this.handler($),this.viewPath);return{[this.viewPath]:{...O,breadcrumb:{label:O?.breadcrumb??"",href:Z}}}}middleware($){return this.middlewares=D1($),this}feature($){return this.featureGates=[...this.featureGates,$],this}}class S4{viewPath;children;middlewares=[];featureGates=[];alwaysRuns=!1;handler=()=>({});constructor($,Z,O){this.viewPath=$;if(typeof Z==="function")this.handler=Z,this.children=class extends _1{routes=O??{}};else if(Array.isArray(Z)){let[j,J]=Z;this.handler=(W)=>{return new j()[J](W)},this.children=class extends _1{routes=O??{}}}else this.children=class extends _1{routes=Z},this.handler=()=>({})}async run($,Z){let O=L4(await this.handler($),this.viewPath);return{[this.viewPath]:{...O,breadcrumb:{label:O?.breadcrumb??"",href:Z}}}}alwaysRun(){return this.alwaysRuns=!0,this}middleware($){return this.middlewares=D1($),this}feature($){return this.featureGates=[...this.featureGates,$],this}}class _1{middlewares=[];featureGates=[];routes={};view($,Z){return new _4($,Z)}file($){return new N4($)}redirect($){return new I4($)}layout($,Z,O){return new S4($,Z,O)}}class C0{req;config={};constructor($){this.req=$}run(...$){return{}}static configure($){let Z=this;return class extends Z{config=$}}}function e5($){return $}function $7(){return{aliases:{},global:[],bodyLimit:null}}var x$="redirect";function fZ($,Z="/"){if(typeof $!=="string"||!$.startsWith("/"))return Z;if(/[\u0000-\u001f\u007f\\]/.test($)||$.startsWith("//"))return Z;try{let O=new URL($,"http://gemi.invalid");if(O.origin!=="http://gemi.invalid")return Z;let j=`${O.search}${O.hash}`.replaceAll("/","%2F"),J=`${O.pathname}${j}`.replaceAll(":","%3A");return J.startsWith("//")?Z:J}catch{return Z}}function f4($){let Z=$.headers.get("x-forwarded-proto")?.split(",")[0]?.trim();return Z?Z==="https":new URL($.url).protocol==="https:"}function Z7($,Z=!0){let O=new URL($.rawRequest.url),j=O.pathname.replace(/\.(json|og)$/,""),[,J,...W]=j.split("/");if(N(n).supportedLocales.includes(J))j=`/${W.join("/")}`;return Z?`${j}${O.search}`:j}function O7($,Z){let O=(j)=>j.replace(/\/+$/,"")||"/";return O($)===O(Z)}function P3($,Z){let O=Z||N(E).config.signInPath,j=/^[a-z][a-z\d+.-]*:/i.test(O);if(j?!/^https?:\/\//i.test(O):!O.startsWith("/"))throw Error(`\`auth.signInPath\` must be a path like "/auth/sign-in", or an http(s) URL for sign-in hosted elsewhere. Got "${O}". A route's own \`"auth:<path>"\` cannot carry a URL, because the alias parser splits it on the colon.`);let J=new URL(O,"http://gemi.invalid");if($?.kind==="view"){let W=Z7($,!j);if(j||!O7(new URL(W,J).pathname,J.pathname))J.searchParams.set(x$,W)}return j?J.href:`${J.pathname}${J.search}`}var S1="access_token";function Nj($){return $?.cookies?.get("access_token")||$?.headers?.get("access_token")||null}async function H3($,Z){let O=Nj(Z);if(!O)return null;return(await $.getSession(O,Z.headers.get("User-Agent")))?.user??null}class P4 extends C0{async run($){let Z=H.getStore(),O=Z.req;if(Z.user)return{};let j=await H3(N(E),O);if(!j)throw new o1({redirectTo:P3(O,$)});return Z.setUser(j),{}}}class H4 extends C0{async run(...$){let[Z="public",O="864000",...j]=$,J=`${Z}, max-age=${O}${j.length>0?", ":""}${j.join(", ")}`;if($.length===0)J="public, max-age=864000, stale-while-revalidate=300, stale-if-error=600";if($.length===1&&$[0]==="public")J="public, max-age=864000, stale-while-revalidate=300, stale-if-error=600";if($.length===1&&$[0]==="private")J="private, max-age=0, stale-while-revalidate=300, stale-if-error=600";if(this.req.rawRequest.method==="GET")this.req.ctx().setHeaders("Cache-Control",J);return{}}}var j7={"Access-Control-Allow-Methods":"GET, POST, PUT, DELETE, OPTIONS","Access-Control-Allow-Headers":"Content-Type, Authorization, X-Requested-With","Access-Control-Allow-Credentials":"true"};class x4 extends C0{config={origins:{"":{"Access-Control-Allow-Methods":"GET, HEAD, POST, PUT, DELETE, OPTIONS","Access-Control-Allow-Headers":"Content-Type, Authorization, X-Requested-With","Access-Control-Allow-Credentials":"true"}}};run(){let $=this.req,Z=$.rawRequest.headers.get("Origin");if(this.config.origins[Z]){$.ctx().setHeaders("Access-Control-Allow-Origin",Z);let O={...j7,...this.config.origins[Z]};for(let[j,J]of Object.entries(O))$.ctx().setHeaders(j,J)}return{}}}class t0{config;static token="ratelimiter";constructor($){this.config=$}get driver(){return this.config.driver}async consume($,Z={}){let O=Z.limit??this.config.limit,j=Z.window??this.config.window,J=Z.cost??1;if(A4("window",j),A4("limit",O),!Number.isFinite(J)||J<0)throw Error(`Rate limiter cost must be zero or greater, got ${J}`);return await this.config.driver.consume({key:$,limit:O,window:j*1000,cost:J})}}function A4($,Z){if(!Number.isFinite(Z)||Z<=0)throw Error(`Rate limiter ${$} must be greater than zero, got ${Z}`)}class PZ extends q0{constructor($){super("Rate limit exceeded");let Z={"Content-Type":"application/json",...$?b4($):{}};this.payload={api:{status:429,data:{error:f1("rate_limit","Rate limit exceeded",429)},headers:Z},view:{error:{message:"Rate limit exceeded"},status:429,headers:Z}}}}class R4 extends C0{async run($,Z){let O=J7();if(!O)return{};let j=await O.consume(this.key(),{limit:E4($)??this.config.limit,window:E4(Z)??this.config.window});if(this.config.headers!==!1){let J=this.req.ctx?.();if(J)for(let[W,Y]of Object.entries(b4(j)))J.setHeaders(W,Y)}if(!j.allowed)throw new PZ(j);return{}}key(){if(this.config.key)return this.config.key(this.req);return`${A$(this.req)}:${this.req.routePath??"*"}`}}function J7(){try{let $=N();return $.bound(t0)?$.make(t0):null}catch{return null}}function A$($){let Z=v4($.rawRequest);if(Z!==void 0)return Z;let O=$.headers.get("x-forwarded-for");if(O){let[j]=O.split(",");if(j?.trim())return j.trim()}return $.headers.get("x-real-ip")?.trim()||"unknown"}function b4($){let Z={"X-RateLimit-Limit":String($.limit),"X-RateLimit-Remaining":String($.remaining),"X-RateLimit-Reset":String(Math.ceil($.resetAt/1000))};if(!$.allowed)Z["Retry-After"]=String(Math.max(1,Math.ceil($.retryAfter/1000)));return Z}function E4($){if($===void 0||$===null||$==="")return;let Z=Number($);if(!Number.isFinite(Z)||Z<=0)return;return Z}class k4 extends C0{async run(){let $=this.req.cookies.get("csrf_token");if(!$)throw new Lj;if(!["POST","PUT","PATCH","DELETE"].includes(this.req.rawRequest.method))return{};if(!Bun.CSRF.verify($,{secret:process.env.SECRET}))throw new Lj;return{}}}class Lj extends q0{constructor(){super("Invalid CSRF token");this.name="InvalidCSRFTokenError"}payload={api:{status:403,data:{error:w4("csrf","Invalid CSRF token",403)}},view:{}}}class x3 extends C0{run($){let Z=$??this.config.limit;if(Z===void 0||Z==="")throw Error('`body-limit` needs a size, as in "body-limit:64kb".');return S3(this.req.rawRequest,SZ(Z)),{}}}class q4{policiesList={};constructor(){let $=this.register();for(let Z of $){let O=new Z;this.policiesList[Z.name]=O}}register(){return[]}}class g4{all($,Z){return!0}}import{lookup as K7}from"dns/promises";import*as Q7 from"http";import*as B7 from"https";import*as q$ from"zlib";function W7($){if($==="")return null;let Z=$.split(".");if(Z.length>1&&Z[Z.length-1]==="")Z.pop();if(Z.length===0||Z.length>4)return null;let O=[];for(let W of Z){let Y=Y7(W);if(Y===null)return null;O.push(Y)}let j=O.pop();for(let W of O)if(W>255)return null;if(j>=256**(4-O.length))return null;let J=j;return O.forEach((W,Y)=>{J+=W*256**(3-Y)}),new Uint8Array([Math.floor(J/16777216)&255,Math.floor(J/65536)&255,Math.floor(J/256)&255,J&255])}function Y7($){if($==="")return null;let Z=$,O=10;if(/^0x/i.test(Z)){if(Z=Z.slice(2),O=16,Z==="")return 0}else if(Z.length>1&&Z.startsWith("0"))Z=Z.slice(1),O=8;if(!(O===16?/^[0-9a-f]+$/i:O===8?/^[0-7]+$/:/^[0-9]+$/).test(Z))return null;let J=parseInt(Z,O);return Number.isSafeInteger(J)?J:null}function y4($){let Z=$;if(Z.startsWith("[")&&Z.endsWith("]"))Z=Z.slice(1,-1);let O=Z.indexOf("%");if(O!==-1)Z=Z.slice(0,O);if(!Z.includes(":"))return null;let j=Z.split("::");if(j.length>2)return null;let J=(D,T)=>{if(D==="")return[];let F=[],G=D.split(":");for(let U=0;U<G.length;U++){let K=G[U];if(T&&U===G.length-1&&K.includes(".")){if(!/^\d{1,3}(\.\d{1,3}){3}$/.test(K))return null;let Q=K.split(".").map(Number);if(Q.some((B)=>B>255))return null;F.push(Q[0]<<8|Q[1],Q[2]<<8|Q[3]);continue}if(!/^[0-9a-f]{1,4}$/i.test(K))return null;F.push(parseInt(K,16))}return F},W=J(j[0],j.length===1),Y=j.length===2?J(j[1],!0):[];if(!W||!Y)return null;let z;if(j.length===2){let D=8-W.length-Y.length;if(D<1)return null;z=[...W,...Array.from({length:D},()=>0),...Y]}else z=W;if(z.length!==8)return null;let X=new Uint8Array(16);return z.forEach((D,T)=>{X[T*2]=D>>8,X[T*2+1]=D&255}),X}function HZ($){let Z=y4($);if(Z)return{family:6,bytes:Z};let O=W7($);if(O)return{family:4,bytes:O};return null}function r1($){if($.family===6&&z7($.bytes))return{family:4,bytes:$.bytes.slice(12)};return $}function z7($){for(let Z=0;Z<10;Z++)if($[Z]!==0)return!1;return $[10]===255&&$[11]===255}function xZ($){if($.family===4)return Array.from($.bytes).join(".");let Z=[];for(let O=0;O<16;O+=2)Z.push(($.bytes[O]<<8|$.bytes[O+1]).toString(16));return Z.join(":")}function v$($){let Z=$.lastIndexOf("/"),O=Z===-1?$:$.slice(0,Z),j=/^[0-9.]+$/.test(O)?X7(O):y4(O);if(!j)return null;let J=r1(j.length===4?{family:4,bytes:j}:{family:6,bytes:j}),W=J.family===4?32:128,Y=W;if(Z!==-1){let z=$.slice(Z+1);if(!/^\d{1,3}$/.test(z))return null;if(Y=Number(z),j.length===16&&J.family===4)Y-=96;if(Y<0||Y>W)return null}return{family:J.family,bytes:J.bytes,prefix:Y}}function X7($){return/^\d{1,3}(\.\d{1,3}){3}$/.test($)&&$.split(".").every((Z)=>Number(Z)<=255)?new Uint8Array($.split(".").map(Number)):null}function T1($,Z){let O=r1($);if(O.family!==Z.family)return!1;let j=Z.prefix;for(let J=0;j>0;J++){let W=Math.min(8,j),Y=255<<8-W&255;if((O.bytes[J]&Y)!==(Z.bytes[J]&Y))return!1;j-=W}return!0}var k=($,Z)=>({cidr:v$($),kind:Z,text:$}),D7=[k("0.0.0.0/8","unspecified"),k("10.0.0.0/8","private"),k("100.64.0.0/10","shared"),k("127.0.0.0/8","loopback"),k("169.254.169.254/32","metadata"),k("169.254.0.0/16","link-local"),k("168.63.129.16/32","metadata"),k("172.16.0.0/12","private"),k("192.0.0.0/24","reserved"),k("192.0.2.0/24","documentation"),k("192.88.99.0/24","reserved"),k("192.168.0.0/16","private"),k("198.18.0.0/15","benchmarking"),k("198.51.100.0/24","documentation"),k("203.0.113.0/24","documentation"),k("224.0.0.0/4","multicast"),k("255.255.255.255/32","broadcast"),k("240.0.0.0/4","reserved")],T7=[k("::/128","unspecified"),k("::1/128","loopback"),k("64:ff9b:1::/48","private"),k("::/8","reserved"),k("100::/64","reserved"),k("2001:db8::/32","documentation"),k("2001::/23","reserved"),k("3fff::/20","documentation"),k("fd00:ec2::254/128","metadata"),k("fc00::/7","unique-local"),k("fe80::/10","link-local"),k("fec0::/10","private"),k("ff00::/8","multicast")],G7=v$("64:ff9b::/96"),F7=v$("2002::/16"),U7=v$("2000::/3");function E$($){let Z=typeof $==="string"?HZ($):$;if(!Z)return{kind:"reserved",range:"not an IP address"};let O=r1(Z);if(O.family===4){let J=D7.find((W)=>T1(O,W.cidr));return J?{kind:J.kind,range:J.text}:null}if(T1(O,G7))return E$({family:4,bytes:O.bytes.slice(12)});if(T1(O,F7))return E$({family:4,bytes:O.bytes.slice(2,6)});let j=T7.find((J)=>T1(O,J.cidr));if(j)return{kind:j.kind,range:j.text};return T1(O,U7)?null:{kind:"reserved",range:"outside 2000::/3"}}function m4($,Z){let O=r1($),j=r1(Z);return O.family===j.family&&O.bytes.every((J,W)=>J===j.bytes[W])}class T0 extends Error{code="safe-fetch";url;constructor($,Z,O){super($,O);this.name=new.target.name,this.url=Z}}class G1 extends T0{reason;code="invalid-url";constructor($,Z,O){super(O,$);this.reason=Z}}class R$ extends T0{host;reason;code="blocked-host";constructor($,Z,O){super(O==="denied"?`Requests to ${Z} are not allowed.`:`${Z} is not on the list of hosts this request may reach.`,$);this.host=Z;this.reason=O}}class P1 extends T0{host;address;range;code="blocked-address";constructor($,Z,O,j){super(Z===O?`${O} is not a public address (${j}).`:`${Z} resolves to ${O}, which is not a public address (${j}).`,$);this.host=Z;this.address=O;this.range=j}}class b$ extends T0{host;code="dns";constructor($,Z,O){super(`Couldn't resolve ${Z}.`,$,{cause:O});this.host=Z}}class w$ extends T0{phase;ms;code="timeout";constructor($,Z,O){super(Z==="connect"?`Couldn't connect within ${O} ms.`:`The request didn't finish within ${O} ms.`,$);this.phase=Z;this.ms=O}}class k$ extends T0{limit;code="too-large";constructor($,Z){super(`The response is larger than ${Z} bytes.`,$);this.limit=Z}}class AZ extends T0{contentType;allowed;code="content-type";constructor($,Z,O){super(`The response is ${Z??"of no content type"}, not ${O.join(" or ")}.`,$);this.contentType=Z;this.allowed=O}}class EZ extends T0{limit;code="too-many-redirects";constructor($,Z){super(`More than ${Z} redirects.`,$);this.limit=Z}}class H1 extends T0{code="network";constructor($,Z){super(`The request failed: ${Z instanceof Error?Z.message:String(Z)}`,$,{cause:Z})}}class RZ extends Response{#J;#Z;address;constructor($,Z,O){super($,Z);this.#J=O.url,this.#Z=O.redirected,this.address=O.address}get url(){return this.#J}get redirected(){return this.#Z}}var vZ={timeout:30000,connectTimeout:1e4,maxSize:10485760,maxRedirects:5,ports:[80,443]},V7=new Set([301,302,303,307,308]),C7=new Set([101,103,204,205,304]),M7=["host","connection","content-length","transfer-encoding","keep-alive","upgrade"],I7=["authorization","cookie","proxy-authorization"];async function c4($,Z={}){let O=N7(Z),j=Z.signal;j?.throwIfAborted();let J=new AbortController,W=J.signal,Y=String($),z=(F)=>{if(!W.aborted)J.abort(F)},X=setTimeout(()=>z(new w$(Y,"total",O.timeout)),O.timeout),D=()=>z(j.reason);j?.addEventListener("abort",D,{once:!0});let T=()=>{clearTimeout(X),j?.removeEventListener("abort",D)};try{let F=h4(Y,O),G=(Z.method??"GET").toUpperCase(),U=new Headers(Z.headers);for(let Q of M7)U.delete(Q);if(!U.has("accept"))U.set("accept","*/*");if(!U.has("user-agent"))U.set("user-agent","gemi");if(!U.has("accept-encoding"))U.set("accept-encoding","gzip, deflate, br");let K=await f7(G,Z.body,U);for(let Q=0;;Q++){Y=F.href;let{request:B,response:M,address:L}=await P7(F,G,U,K,O,W),I=M.statusCode??0,S=M.headers.location;if(V7.has(I)&&S&&Z.redirect!=="manual"){if(B.destroy(),Q>=O.maxRedirects)throw new EZ(F.href,O.maxRedirects);let P;try{P=new URL(S,F)}catch{throw new G1(S,"malformed",`The redirect to "${S}" is not a URL.`)}if(I===303?G!=="HEAD":(I===301||I===302)&&G==="POST"){G="GET",K=null;let V=[];U.forEach((C,_)=>{if(_.startsWith("content-"))V.push(_)});for(let C of V)U.delete(C)}if(P.origin!==F.origin)for(let V of I7)U.delete(V);F=h4(P.href,O);continue}return H7({url:F,hop:Q,method:G,request:B,response:M,address:L,policy:O,signal:W,release:T})}}catch(F){throw T(),W.aborted?W.reason:F}}function N7($){let Z=(j,J)=>{let W={hosts:[],ranges:[]};for(let Y of j){let z=Y.includes("/")||Y.includes(":")||/^[\d.]+$/.test(Y),X=z?v$(Y):null;if(X)W.ranges.push(X);else if(!z&&/^(\*\.)?[a-z0-9-]+(\.[a-z0-9-]+)*\.?$/i.test(Y))W.hosts.push(l4(Y));else throw TypeError(`safeFetch: "${Y}" in ${J} is not a host name or an IP range.`)}return W},O=$.allowPrivate;return{timeout:$.timeout??vZ.timeout,connectTimeout:$.connectTimeout??vZ.connectTimeout,maxSize:$.maxSize??vZ.maxSize,maxRedirects:$.maxRedirects??vZ.maxRedirects,ports:$.ports??vZ.ports,allow:$.allow&&$.allow.length>0?Z($.allow,"allow"):null,deny:Z($.deny??[],"deny"),allowPrivate:O===!0?!0:Z(O||[],"allowPrivate").ranges,contentTypes:$.contentTypes?.length?$.contentTypes:null,resolve:$.resolve??L7}}async function L7($){return(await K7($,{all:!0,verbatim:!0})).map((O)=>O.address)}function l4($){return $.toLowerCase().replace(/\.$/,"")}function p4($,Z){return Z.some((O)=>O.startsWith("*.")?$.endsWith(O.slice(1)):$===O)}function h4($,Z){let O;try{O=new URL($)}catch{throw new G1($,"malformed",`"${$}" is not a URL.`)}if(O.protocol!=="http:"&&O.protocol!=="https:")throw new G1(O.href,"scheme",`Only http and https URLs can be fetched, not ${O.protocol.slice(0,-1)}.`);if(O.username||O.password)throw new G1(O.href,"credentials","The URL has a username or password in it.");let j=d4(O);if(Z.ports!=="any"&&!Z.ports.includes(j))throw new G1(O.href,"port",`Port ${j} is not allowed.`);return O}function d4($){return $.port?Number($.port):$.protocol==="https:"?443:80}async function _7($,Z,O){let j=l4($.hostname.replace(/^\[(.*)\]$/,"$1")),J=HZ(j),W=J!==null&&(j.includes(":")||/^\d+\.\d+\.\d+\.\d+$/.test(j));if(!W&&p4(j,Z.deny.hosts))throw new R$($.href,j,"denied");let Y=!W&&Z.allow!==null&&p4(j,Z.allow.hosts);if(Z.allow&&!Y&&Z.allow.ranges.length===0)throw new R$($.href,j,"not-allowed");let z;if(W)z=[J];else{let X;try{X=await S7(Z.resolve(j),O)}catch(D){if(O.aborted)throw O.reason;throw new b$($.href,j,D)}if(z=X.map((D)=>HZ(D)).filter((D)=>D!==null),z.length===0)throw new b$($.href,j)}for(let X of z){let D=xZ(X);if(Z.deny.ranges.some((F)=>T1(X,F)))throw new P1($.href,j,D,"denied");if(Z.allow&&!Y&&!Z.allow.ranges.some((F)=>T1(X,F)))throw new P1($.href,j,D,"not-allowed");let T=E$(X);if(T&&Z.allowPrivate!==!0&&!Z.allowPrivate.some((F)=>T1(X,F)))throw new P1($.href,j,D,T.kind)}return{host:j,addresses:z,isLiteral:W}}function S7($,Z){if(Z.aborted)return Promise.reject(Z.reason);return new Promise((O,j)=>{let J=()=>j(Z.reason);Z.addEventListener("abort",J,{once:!0}),$.then((W)=>{Z.removeEventListener("abort",J),O(W)},(W)=>{Z.removeEventListener("abort",J),j(W)})})}async function f7($,Z,O){if(Z===void 0||Z===null)return null;if($==="GET"||$==="HEAD")throw TypeError(`safeFetch: a ${$} request can't have a body.`);let j=new Request("http://body.invalid/",{method:"POST",body:Z}),J=j.headers.get("content-type");if(J&&!O.has("content-type"))O.set("content-type",J);return new Uint8Array(await j.arrayBuffer())}async function P7($,Z,O,j,J,W){let Y=new AbortController,z=setTimeout(()=>Y.abort(new w$($.href,"connect",J.connectTimeout)),J.connectTimeout),X=AbortSignal.any([W,Y.signal]);try{let{host:D,addresses:T,isLiteral:F}=await _7($,J,X),G=$.protocol==="https:",U={};if(O.forEach((K,Q)=>{U[Q]=K}),j)U["content-length"]=String(j.byteLength);return await new Promise((K,Q)=>{let B={method:Z,host:D,port:d4($),path:`${$.pathname}${$.search}`,headers:U,agent:!1,lookup:(V,C,_)=>{let x=C?.family,w=T.filter((v)=>!x||v.family===x);if(w.length===0)_(Object.assign(Error(`No IPv${x} address for ${D}`),{code:"ENOTFOUND"}));else if(C?.all)_(null,w.map((v)=>({address:xZ(v),family:v.family})));else _(null,xZ(w[0]),w[0].family)}};if(G&&!F)B.servername=D;let M=(G?B7:Q7).request(B),L=null,I=(V)=>{X.removeEventListener("abort",S),M.destroy(),Q(V)},S=()=>I(X.aborted?X.reason:W.reason);X.addEventListener("abort",S,{once:!0});let P=(V)=>{let C=V?.remoteAddress;if(!C||L!==null)return!0;let _=HZ(C);if(!_||!T.some((x)=>m4(x,_)))return I(new P1($.href,D,C,"not-allowed")),!1;return L=xZ(r1(_)),!0};M.once("socket",(V)=>{let C=()=>{if(P(V)&&!G)clearTimeout(z)};if(V.connecting)V.once("connect",C);else C();if(G)V.once("secureConnect",()=>clearTimeout(z))}),M.once("response",(V)=>{if(clearTimeout(z),V.on("error",()=>{}),!P(V.socket))return;X.removeEventListener("abort",S),K({request:M,response:V,address:L})}),M.on("error",(V)=>{if(X.aborted)return I(X.reason);I(V instanceof T0?V:new H1($.href,V))}),M.end(j??void 0)})}finally{clearTimeout(z)}}function H7({url:$,hop:Z,method:O,request:j,response:J,address:W,policy:Y,signal:z,release:X}){let D=J.statusCode??0;if(D<200||D>599)throw j.destroy(),new H1($.href,Error(`Unexpected status ${D}`));let T=new Headers,F=J.rawHeaders;for(let C=0;C<F.length;C+=2)T.append(F[C],F[C+1]);if(Y.contentTypes){let C=T.get("content-type")?.split(";")[0].trim().toLowerCase()??null;if(!C||!Y.contentTypes.some((_)=>x7(C,_)))throw j.destroy(),new AZ($.href,C,Y.contentTypes)}let G={url:$.href,redirected:Z>0,address:W},U={status:D,statusText:J.statusMessage??"",headers:T};if(O==="HEAD"||C7.has(D))return j.destroy(),X(),new RZ(null,U,G);let K=T.get("content-encoding")?.trim().toLowerCase(),Q=K==="gzip"||K==="x-gzip"?q$.createGunzip():K==="deflate"?q$.createInflate():K==="br"?q$.createBrotliDecompress():null,B=Number(T.get("content-length"));if(!Q&&Number.isFinite(B)&&B>Y.maxSize)throw j.destroy(),new k$($.href,Y.maxSize);if(Q)T.delete("content-encoding"),T.delete("content-length");let M=Q?J.pipe(Q):J,L=0,I=!1,S=()=>{},P=()=>{I=!0,z.removeEventListener("abort",S),X()},V=new ReadableStream({start(C){let _=(w)=>{if(I)return;if(P(),w===void 0)C.close();else j.destroy(),Q?.destroy(),C.error(w)};if(S=()=>_(z.reason),z.addEventListener("abort",S,{once:!0}),z.aborted)return S();M.on("data",(w)=>{if(I)return;if(L+=w.byteLength,L>Y.maxSize)return _(new k$($.href,Y.maxSize));if(C.enqueue(new Uint8Array(w)),(C.desiredSize??1)<=0)M.pause()}),M.once("end",()=>_());let x=(w)=>_(w instanceof T0?w:new H1($.href,w));if(M.on("error",x),Q)J.on("error",x);J.once("aborted",()=>_(new H1($.href,Error("The response was cut off."))))},pull(){M.resume()},cancel(){if(I)return;P(),j.destroy(),Q?.destroy()}});return new RZ(V,U,G)}function x7($,Z){let O=Z.toLowerCase();return O.endsWith("/*")?$.startsWith(O.slice(0,-1)):$===O}import{createHmac as i4,randomBytes as A7}from"crypto";var Pj="v2.";function Hj($){return $.startsWith(Pj)}function A3(){let $=process.env.SECRET;if(!$)throw Error("Signing in needs a secret to mint session tokens with. Set SECRET in the environment.");return $}function u4($){let Z=A7(16).toString("hex"),O=i4("sha256",A3()).update(`${$}:${Z}`).digest("hex");return`${Pj}${O}`}function E3($,Z){let O=i4("sha256",A3()).update(`legacy-session:${Z}:${$}`).digest("hex");return`${Pj}${O}`}import{createHash as R7,createHmac as b7,randomInt as w7,timingSafeEqual as a4}from"crypto";function s4($,Z){return Math.floor($/Z)*Z}function E7($,Z){if(Z<=0)return 0;return Math.min(1,Math.max(0,(Z-$)/Z))}function xj($,Z,O,j){return Z*E7(O,j)+$}function v7($){let{current:Z,previous:O,elapsed:j,window:J,limit:W,cost:Y}=$,z=W-Y;if(z<0)return J;let X=Math.max(0,J-j);if(O>0){let T=J*(1-(z-Z)/O);if(T<=J)return Math.max(0,Math.ceil(T-j))}if(Z<=z)return X;if(Z<=0)return X;let D=J*(1-z/Z);return X+Math.max(0,Math.ceil(D))}function n4($){let{allowed:Z,current:O,previous:j,now:J,elapsed:W,window:Y,limit:z,cost:X}=$;if(Z){let T=xj(O,j,W,Y);return{allowed:!0,limit:z,remaining:Math.max(0,Math.floor(z-T)),resetAt:J-W+Y,retryAfter:0}}let D=v7({current:O,previous:j,elapsed:W,window:Y,limit:z,cost:X});return{allowed:!1,limit:z,remaining:0,resetAt:J+D,retryAfter:D}}class Aj{}class Ej extends Aj{buckets=new Map;maxKeys;constructor($={}){super();this.maxKeys=Math.max(1,$.maxKeys??1e5)}consume($){let{key:Z,limit:O,window:j}=$,J=$.cost??1,W=Date.now(),Y=s4(W,j),z=W-Y,X=this.roll(Z,j,Y);X.limit=O;let T=xj(X.current,X.previous,z,j)+J<=O;if(T)X.current+=J;if(this.buckets.delete(Z),this.buckets.set(Z,X),this.buckets.size>this.maxKeys)this.evict(W);return n4({allowed:T,current:X.current,previous:X.previous,now:W,elapsed:z,window:j,limit:O,cost:J})}clear(){this.buckets.clear()}get size(){return this.buckets.size}roll($,Z,O){let j=this.buckets.get($);if(!j||j.window!==Z)return{window:Z,limit:0,windowStart:O,current:0,previous:0};if(j.windowStart===O)return j;if(j.windowStart+Z===O)return j.previous=j.current,j.current=0,j.windowStart=O,j;return j.previous=0,j.current=0,j.windowStart=O,j}evict($){for(let[j,J]of this.buckets)if($-J.windowStart>=J.window*2)this.buckets.delete(j);let Z=this.maxKeys-Math.floor(this.maxKeys/10);if(this.buckets.size<=Z)return;let O=[...this.buckets].map(([j,J],W)=>({key:j,order:W,spent:J.limit>0?(J.current+J.previous)/J.limit:0}));O.sort((j,J)=>j.spent-J.spent||j.order-J.order);for(let{key:j}of O){if(this.buckets.size<=Z)break;this.buckets.delete(j)}}}var t4="h1.";function v3($,Z,O){let j=b7("sha256",A3()).update(`gemi:one-time:${$}:${Z}:${O}`).digest("hex");return`${t4}${j}`}function bZ($,Z,O,j){let J=typeof j==="string"?j:"",W=typeof O==="string"?O:"",Y=W.startsWith(t4),z=v3($,Z,J),X=Buffer.from(Y?z:J),D=Buffer.from(W);if(X.length!==D.length||J===""||W==="")return a4(X,X),!1;return a4(X,D)}function e4($){let Z="";for(let O=0;O<$;O++)Z+=String(w7(0,10));return Z}var $J=320;function wZ($){if(typeof $!=="string")return null;let Z=$.trim();if(Z===""||Z.length>$J)return null;return Z.toLowerCase()}function vj($){if(typeof $!=="string")return null;let Z=$.trim();if(Z.length>$J)return null;let O=Z.toLowerCase();if(O.length<3||O.length>254||!/^[^\s@]+@[^\s@]+$/.test(O))return null;return O}var o4=null;function ZJ(){try{let $=N();if(typeof $?.bound==="function"&&$.bound(t0))return $.make(t0)}catch{}return o4??=new t0({driver:new Ej,limit:1000,window:60}),o4}function r4($){return $.length<=64?$:`sha256:${R7("sha256").update($).digest("hex")}`}async function g$($,Z,O,j){let J=ZJ(),W=[[`auth:code-${$}:ip:${r4(A$(O))}`,j.perIp]];if(Z!==null)W.push([`auth:code-${$}:email:${r4(Z)}`,j.perEmail]);for(let[Y,z]of W){if(!z)continue;let[X,D]=z,T=await J.consume(Y,{limit:X,window:D});if(!T.allowed)throw new PZ(T)}}async function OJ($,Z,O,j=10){let J=Math.max(86400,Math.ceil(j*60*(O+1)));return(await ZJ().consume(`auth:code-attempt:${$}:${Z}`,{limit:O,window:J})).allowed}import{randomBytes as bj}from"crypto";class Rj extends A{schema={name:{string:"Invalid name",required:"Name is required","min:2":"Name must be at least 3 characters"},email:{string:"Invalid email",required:"Email is required",email:"Invalid email"},password:{"min:8":"Password must be at least 9 characters"}}}function R3($,Z,O,j=1/0){if(!Number.isInteger(Z)||Z<O||Z>j){let J=j===1/0?`an integer of at least ${O}`:`an integer from ${O} to ${j}`;throw Error(`auth.emailCode.${$} must be ${J}, got ${Z}`)}}function wj($={}){let Z=$.length??6,O=$.expiresInMinutes??10,j=$.linkExpiresInMinutes??10080,J=$.maxAttempts??5;return R3("length",Z,4,12),R3("expiresInMinutes",O,1),R3("linkExpiresInMinutes",j,1),R3("maxAttempts",J,1),{enabled:$.enabled??!1,createUser:$.createUser??!1,length:Z,expiresInMinutes:O,linkExpiresInMinutes:j,maxAttempts:J,requestLimit:{perEmail:$.requestLimit?.perEmail??[5,900],perIp:$.requestLimit?.perIp??[20,900]},verifyLimit:{perEmail:$.verifyLimit?.perEmail??[10,900],perIp:$.verifyLimit?.perIp??[50,900]},uniformMagicLinkResponse:$.uniformMagicLinkResponse??!1,send:$.send??(({email:W,code:Y})=>{if(Bun.env.NODE_ENV!=="production")console.info(`[gemi] email code for ${W}: ${Y} (set auth.emailCode.send to deliver it)`)})}}async function k7($,Z){if(typeof Z!=="string"||Z==="")return!1;try{return await Bun.password.verify($,Z)}catch{return!1}}function tU($){return $}function jJ($={}){return{basePath:"/auth",verifyEmail:!0,redirectPath:"/dashboard",signInPath:"/auth/sign-in",sessionExpiresInHours:24,sessionAbsoluteExpiresInHours:672,cookieDomain:null,migrateLegacySession:null,signUpRequest:Rj,oauthProviders:{},verifyPassword:k7,hashPassword:async(Z)=>await Bun.password.hash(Z),generateForgotPasswordToken:async()=>bj(32).toString("hex"),generateEmailVerificationToken:()=>{if(!($.verifyEmail??!0))return"";return bj(32).toString("hex")},generateMagicLinkToken:()=>bj(32).toString("hex"),extendSession:()=>({}),onUserCreated:async()=>{},onSignUp:()=>{},onSignIn:()=>{},onSignOut:()=>{},onForgotPassword:()=>{},onResetPassword:()=>{},onMagicLinkCreated:()=>{},emailCode:wj($.emailCode),generateCode:()=>{return},onAuthenticated:()=>{}}}function kj($){if($&&typeof $==="object")delete $.password;return $}function q7(){return new Proxy({},{get:($,Z)=>WJ(Z)})}var JJ=new WeakMap;function YJ($){if($&&typeof $==="object"){for(let Z of Object.values($))YJ(Z);Object.freeze($)}return $}var g7={select:{id:!0,publicId:!0,email:!0,name:!0,locale:!0,globalRole:!0,accounts:{select:{id:!0,publicId:!0,organizationRole:!0,organization:!0}}}},y7=YJ({token:!0,expiresAt:!0,absoluteExpiresAt:!0,updatedAt:!0,location:!0,userAgent:!0,user:g7});class qj{models;constructor($=q7()){this.models=$}run($){return this.models.User.asSystem($)}sessionSelect(){return y7}transaction($){return this.models.User.transaction($)}withLegacySessionLock($,Z){let O=this.models.User.$connection??qZ(),j=N(gZ).connection(O),J=()=>this.transaction(async()=>{if(j.dialect==="postgres"){let z=`gemi:legacy-session:${$}`;await kZ()`SELECT pg_advisory_xact_lock(hashtextextended(${z}, 0))`}return Z()});if(j.dialect!=="sqlite"||kZ())return J();let Y=(JJ.get(j)??Promise.resolve()).then(J,J);return JJ.set(j,Y.catch(()=>{})),Y}async createUser($){let Z=await this.run(()=>this.models.User.create({data:$}));return kj(Z)}async updateUserPassword($){let Z=await this.run(()=>this.models.User.update({where:{id:$.id},data:{password:$.password}}));return kj(Z)}async findUserByEmailAddress($,Z){return await this.run(()=>this.models.User.findUnique({where:Z?{email:$,emailVerifiedAt:{not:null}}:{email:$}}))}async findUserByVerificationToken($){if(typeof $!=="string"||$==="")return null;return await this.run(()=>this.models.User.findFirst({where:{verificationToken:$}}))}async verifyUser($){return await this.run(()=>this.models.User.update({where:{email:$},data:{emailVerifiedAt:new Date}}))}async createSession($){return await this.run(()=>this.models.Session.create({data:$,include:{user:!0}}))}async createSessionV2($){return await this.run(()=>this.models.Session.create({data:$,select:this.sessionSelect()}))}async findSession($){if(!$.token)return null;try{return await this.run(()=>this.models.Session.findUnique({where:{token:$.token},select:this.sessionSelect()}))}catch(Z){return console.error("findSession failed:",Z),null}}async updateSession($){return await this.run(()=>this.models.Session.update({where:{token:$.token},data:{expiresAt:$.expiresAt},select:this.sessionSelect()}))}async deleteSession($){if(!$.token)return;await this.run(()=>this.models.Session.deleteMany({where:{token:$.token}}))}async claimLegacySession($){if(!$.token)return!1;let{count:Z}=await this.run(()=>this.models.Session.deleteMany({where:{token:$.token}}));return Z>0}async deleteAllUserSessions($){await this.run(()=>this.models.Session.deleteMany({where:{userId:$}}))}async createPasswordResetToken($){return await this.run(()=>this.models.PasswordResetToken.create({data:{token:$.token,user:{connect:{id:$.user.id}}}}))}async findPasswordResetToken($){if(typeof $.token!=="string"||$.token==="")return null;return await this.run(()=>this.models.PasswordResetToken.findUnique({where:{token:$.token},include:{user:!0}}))}async deletePasswordResetToken($){return await this.run(()=>this.models.PasswordResetToken.delete({where:{token:$.token}}))}async findInvitation($,Z){if(typeof $!=="string"||typeof Z!=="string")return null;return await this.run(()=>this.models.OrganizationInvitation.findFirst({where:{publicId:$,email:Z}}))}async deleteInvitationById($){await this.run(()=>this.models.OrganizationInvitation.delete({where:{publicId:$}}))}async createAccount($){return await this.run(()=>this.models.Account.create({data:{userId:$.userId,organizationId:$.organizationId,organizationRole:$.organizationRole}}))}async createMagicLinkToken($){return await this.run(()=>this.models.MagicLinkToken.create({data:{email:$.email,token:$.token,pin:$.pin}}))}async findUserMagicLinkToken($){let Z=(O)=>typeof O==="string"&&O!=="";if(!Z($.email))return null;if($.token!==void 0&&!Z($.token))return null;if($.token===void 0&&!Z($.pin))return null;return await this.run(()=>$.token?this.models.MagicLinkToken.findUnique({where:{token_email:{token:$.token,email:$.email}}}):this.models.MagicLinkToken.findUnique({where:{pin_email:{pin:$.pin,email:$.email}}}))}async findMagicLinkTokenByEmail($){return await this.run(()=>this.models.MagicLinkToken.findFirst({where:{email:$},orderBy:{id:"desc"}}))}async claimMagicLinkToken($){let{count:Z}=await this.run(()=>this.models.MagicLinkToken.deleteMany({where:{id:$}}));return Z===1}async deleteMagicLinkToken($){await this.run(()=>this.models.MagicLinkToken.deleteMany({where:{email:$}}))}async createSocialAccount($){return await this.run(()=>this.models.SocialAccount.create({data:$}))}async findUserBySocialAccount($,Z){if(!Z)return null;let O=await this.run(()=>this.models.SocialAccount.findFirst({where:{provider:$,providerId:Z},include:{user:!0}}));return O?kj(O.user):null}async findSocialAccounts($,Z){return await this.run(()=>this.models.SocialAccount.findMany({where:{userId:$,provider:Z},orderBy:{id:"asc"}}))}async claimSocialAccount($,Z){let{count:O}=await this.run(()=>this.models.SocialAccount.updateMany({where:{id:$.id,providerId:$.providerId},data:{providerId:Z}}));return O===1}}import{randomBytes as NT}from"crypto";function x0($,Z,O,j,J){return p0(Z,LJ($,Z),O,j,J)}function p0($,Z,O,j,J,W){let Y=hj(Z,O,j);if(J&&Z!==Y)throw RangeError(Wz($,Z,O,j,W));return Y}function LJ($,Z){let O=$[Z];if(O===void 0)throw TypeError(B8(Z));return O}function X0($){return $!==null&&/object|function/.test(typeof $)}function v0($,Z=Map){let O=new Z;return(j,...J)=>{if(O.has(j))return O.get(j);let W=$(j,...J);return O.set(j,W),W}}function aj($){return Z$({name:$},1)}function Z$($,Z){return d0((O)=>({value:O,configurable:1,writable:!Z}),$)}function _J($){return d0((Z)=>({get:Z,configurable:1}),$)}function n3($){return{[Symbol.toStringTag]:{value:$,configurable:1}}}function d$($,Z){let O={},j=$.length;for(let J of Z)O[$[--j]]=J;return O}function d0($,Z,O){let j={};for(let J in Z)j[J]=$(Z[J],J,O);return j}function uZ($,Z,O){let j={};for(let J=0;J<Z.length;J++){let W=Z[J];j[W]=$(W,J,O)}return j}function m7($,Z,O){let j={};for(let J=0;J<$.length;J++)j[Z[J]]=O[$[J]];return j}function b0($,Z){let O={};for(let j of $)O[j]=Z[j];return O}function oj($,Z){let O={};for(let j in Z)$.has(j)||(O[j]=Z[j]);return O}function rj($){$={...$};let Z=Object.keys($);for(let O of Z)$[O]===void 0&&delete $[O];return $}function SJ($,Z){for(let O of Z)if(!(O in $))return 0;return 1}function fJ($,Z,O){for(let j of $)if(Z[j]!==O[j])return 0;return 1}function PJ($,Z,O){let j={...O};for(let J=0;J<Z;J++)j[$[J]]=0;return j}function b($,...Z){return(...O)=>$(...Z,...O)}function zJ($){return $[0].toUpperCase()+$.substring(1)}function sZ($){return $.slice().sort()}function m3($,Z){return String(Z).padStart($,"0")}function x1($,Z){return Math.sign($-Z)}function hj($,Z,O){return Math.min(Math.max($,Z),O)}function U1($,Z){return[Math.floor($/Z),mZ($,Z)]}function mZ($,Z){return($%Z+Z)%Z}function v1($,Z){return[a3($,Z),tj($,Z)]}function a3($,Z){return Math.trunc($/Z)||0}function tj($,Z){return $%Z||0}function b3($){return Math.abs($%1)===0.5}function HJ($,Z,O){let j=0,J=0;for(let z=0;z<=Z;z++){let X=$[O[z]],D=$1[z],T=h/D,[F,G]=v1(X,T);j+=G*D,J+=F}let[W,Y]=v1(j,h);return[J+W,Y]}function o3($,Z,O){let j={};for(let J=Z;J>=0;J--){let W=$1[J];j[O[J]]=a3($,W),$=tj($,W)}return j}function xJ($){return $===q?EO:[]}function AJ($){return $===q?j3:[]}function EJ($){return $===q?["year","day"]:[]}function vJ($){if($!==void 0)return a($)}function RJ($){if($!==void 0)return i0($)}function ej($){if($!==void 0)return nZ($)}function i0($){return kJ(nZ($))}function nZ($){return wJ(EX($))}function $6($){if($==null)throw TypeError("Cannot be null or undefined");return $}function bJ($,Z){if(Z==null)throw RangeError(B8($));return Z}function Q1($){if(!X0($))throw TypeError(Jz);return $}function r3($,Z,O=$){if(typeof Z!==$)throw TypeError($3(O,Z));return Z}function wJ($,Z="number"){if(!Number.isInteger($))throw RangeError(ZX(Z,$));return $||0}function kJ($,Z="number"){if($<=0)throw RangeError(OX(Z,$));return $}function Z6($){if(typeof $=="symbol")throw TypeError(YX);return String($)}function p3($,Z){return X0($)?String($):a($,Z)}function t3($){if(typeof $=="string")return BigInt($);if(typeof $!="bigint")throw TypeError(WX($));return $}function qJ($,Z="number"){if(typeof $=="bigint")throw TypeError(JX(Z));if($=Number($),!Number.isFinite($))throw RangeError(jX(Z,$));return $}function M0($,Z){return Math.trunc(qJ($,Z))||0}function gJ($,Z){return wJ(qJ($,Z),Z)}function XJ($,Z){return kJ(M0($,Z),Z)}function O6($,Z){let[O,j]=v1(Z,h),J=$+O,W=Math.sign(J);return W&&W===-Math.sign(j)&&(J-=W,j+=W*h),[J,j]}function m$($,Z,O=1){return O6($[0]+Z[0]*O,$[1]+Z[1]*O)}function p$($,Z){return O6($[0],$[1]+Z)}function g0($,Z){return m$(Z,$,-1)}function N0($,Z){return x1($[0],Z[0])||x1($[1],Z[1])}function yJ($,Z,O){return N0($,Z)===-1||N0($,O)===1}function e3($,Z=1){let O=BigInt(h/Z);return[Number($/O),Number($%O)*Z]}function h$($,Z=1){let O=h/Z,[j,J]=v1($,O);return[j,J*Z]}function mJ($,Z=1){let[O,j]=$,J=Math.floor(j/Z),W=h/Z;return BigInt(O)*BigInt(W)+BigInt(J)}function y0($,Z=1,O){let[j,J]=$,[W,Y]=v1(J,Z);return j*(h/Z)+(W+(O?Y/Z:0))}function j6($,Z,O=U1){let[j,J]=$,[W,Y]=O(J,Z);return[j*(h/Z)+W,Y]}function J6($,Z){let O=$.formatToParts(Z),j={};for(let J of O)j[J.type]=J.value;return j}function W6($){return x0($,"isoYear",iZ,dZ,1),$.isoYear===iZ?x0($,"isoMonth",4,12,1):$.isoYear===dZ&&x0($,"isoMonth",1,9,1),$}function A1($){return B1({...$,...l0,isoHour:12}),$}function B1($){let Z=x0($,"isoYear",iZ,dZ,1),O=Z===iZ?1:Z===dZ?-1:0;return O&&m0(I0({...$,isoDay:$.isoDay+O,isoNanosecond:$.isoNanosecond-O})),$}function m0($){if(!$||yJ($,gX,qX))throw RangeError(PO);return $}function R1($){return HJ($,5,a0)[1]}function $O($){let[Z,O]=U1($,h);return[o3(O,5,a0),Z]}function pJ($){return hJ($)[0]}function hJ($){return j6($,c0)}function L0($){return i$($.isoYear,$.isoMonth,$.isoDay,$.isoHour,$.isoMinute,$.isoSecond,$.isoMillisecond)}function I0($){let Z=L0($);if(Z!==void 0){let[O,j]=v1(Z,E0);return[O,j*Z1+($.isoMicrosecond||0)*T$+($.isoNanosecond||0)]}}function Y6($,Z){let[O,j]=$O(R1($)-Z);return m0(I0({...$,isoDay:$.isoDay+j,...O}))}function h3(...$){return i$(...$)/Bz}function i$(...$){let[Z,O]=cJ(...$),j=Z.valueOf();if(!isNaN(j))return j-O*E0}function cJ($,Z=1,O=1,j=0,J=0,W=0,Y=0){let z=$===iZ?1:$===dZ?-1:0,X=new Date;return X.setUTCHours(j,J,W,Y),X.setUTCFullYear($,Z-1,O+z),[X,z]}function w1($,Z){let[O,j]=p$($,Z);j<0&&(j+=h,O-=1);let[J,W]=U1(j,Z1),[Y,z]=U1(W,T$);return ZO(O*E0+J,Y,z)}function ZO($,Z=0,O=0){let j=Math.ceil(Math.max(0,Math.abs($)-kX)/E0)*Math.sign($),J=new Date($-j*E0);return d$(RO,[J.getUTCFullYear(),J.getUTCMonth()+1,J.getUTCDate()+j,J.getUTCHours(),J.getUTCMinutes(),J.getUTCSeconds(),J.getUTCMilliseconds(),Z,O])}function lJ($){return[$.isoYear,$.isoMonth,$.isoDay]}function dJ(){return F1}function z6($,Z){switch(Z){case 2:return X6($)?29:28;case 4:case 6:case 9:case 11:return 30}return 31}function iJ($){return X6($)?366:365}function X6($){return $%4==0&&($%100!=0||$%400==0)}function uJ($){let[Z,O]=cJ($.isoYear,$.isoMonth,$.isoDay);return mZ(Z.getUTCDay()-O,7)||7}function sJ({isoYear:$}){return $<1?["bce",1-$]:["ce",$]}function p7($){let Z=L0($);if(Z<mX)return sJ($);let O=J6(w8(c$),Z),{era:j,eraYear:J}=JY(O,c$);return[j,J]}function OO($){return O$($),jO($,1),$}function O$($){return nJ($,1),$}function DJ($){return fJ(P8,$,nJ($))}function nJ($,Z){let{isoYear:O}=$,j=x0($,"isoMonth",1,dJ(),Z);return{isoYear:O,isoMonth:j,isoDay:x0($,"isoDay",1,z6(O,j),Z)}}function jO($,Z){return d$(a0,[x0($,"isoHour",0,23,Z),x0($,"isoMinute",0,59,Z),x0($,"isoSecond",0,59,Z),x0($,"isoMillisecond",0,999,Z),x0($,"isoMicrosecond",0,999,Z),x0($,"isoNanosecond",0,999,Z)])}function g($){return $===void 0?0:bz(Q1($))}function aZ($,Z=0){$=u0($);let O=wz($),j=aX($,Z);return[bz($),j,O]}function D6($){return wz(u0($))}function aJ($){return $=u0($),A8($,9,6,1)}function u$($,Z,O,j=9,J=0,W=4){Z=u0(Z);let Y=A8(Z,j,J),z=F6(Z),X=W3(Z,W),D=J3(Z,j,J,1);return Y==null?Y=Math.max(O,D):eJ(Y,D),z=U6(z,D,1),$&&(X=((T)=>T<4?(T+2)%4:T)(X)),[Y,D,z,X]}function JO($,Z=6,O){let j=F6($=K6($,s3)),J=W3($,7),W=J3($,Z);return W=bJ(s3,W),j=U6(j,W,void 0,O),[W,j,J]}function T6($){return E8(u0($))}function oJ($,Z){return G6(u0($),Z)}function G6($,Z=4){let O=tJ($);return[W3($,4),...rJ(J3($,Z),O)]}function rJ($,Z){return $!=null?[$1[$],$<4?9-3*$:-1]:[Z===void 0?1:10**(9-Z),Z]}function F6($){let Z=$[pZ];return Z===void 0?1:M0(Z,pZ)}function U6($,Z,O,j){let J=j?h:$1[Z+1];if(J){let W=$1[Z];if(J%(($=p0(pZ,$,1,J/W-(j?0:1),1))*W))throw RangeError($3(pZ,$))}else $=p0(pZ,$,1,O?1e9:1,1);return $}function tJ($){let Z=$[pj];if(Z!==void 0){if(typeof Z!="number"){if(Z6(Z)==="auto")return;throw RangeError($3(pj,Z))}Z=p0(pj,Math.floor(Z),0,9,1)}return Z}function u0($){return $===void 0?{}:Q1($)}function K6($,Z){return typeof $=="string"?{[Z]:$}:Q1($)}function $0($){if($!==void 0){if(X0($))return Object.assign(Object.create(null),$);throw TypeError(Jz)}}function WO($,Z){return $&&Object.assign(Object.create(null),$,{overflow:hX[Z]})}function Q6($,Z,O=9,j=0,J){let W=Z[$];if(W===void 0)return J?j:void 0;if(W=Z6(W),W==="auto")return J?j:null;let Y=ij[W];if(Y===void 0&&(Y=bX[W]),Y===void 0)throw RangeError(Xz($,W,ij));return p0($,Y,j,O,1,O3),Y}function j$($,Z,O,j=0){let J=O[$];if(J===void 0)return j;let W=Z6(J),Y=Z[W];if(Y===void 0)throw RangeError(Xz($,W,Z));return Y}function eJ($,Z){if(Z>$)throw RangeError(fX)}function D0($){return{branding:wO,epochNanoseconds:$}}function U0($,Z,O){return{branding:I1,calendar:O,timeZone:Z,epochNanoseconds:$}}function Z0($,Z=$.calendar){return{branding:F$,calendar:Z,...b0(Az,$)}}function O0($,Z=$.calendar){return{branding:G$,calendar:Z,...b0(H8,$)}}function e1($,Z=$.calendar){return{branding:$Z,calendar:Z,...b0(H8,$)}}function c3($,Z=$.calendar){return{branding:ZZ,calendar:Z,...b0(H8,$)}}function s0($){return{branding:bO,...b0(xz,$)}}function i($){return{branding:kO,sign:k1($),...b0(_8,$)}}function $W($){return pJ($.epochNanoseconds)}function YO($){return j6($.epochNanoseconds,Z1)[0]}function ZW($){return mJ($.epochNanoseconds,T$)}function OW($){return mJ($.epochNanoseconds)}function jW($){return $.epochNanoseconds}function G0($){return typeof $=="string"?$:a($.id)}function s$($,Z){return $===Z||G0($)===G0(Z)}function JW($,Z,O,j,J){let W=$$(j),[Y,z]=((B,M)=>{let L=M((B=K6(B,nj))[vz]),I=nX(B);return I=bJ(nj,I),[I,L]})(J,$);if(cZ(Math.max(Y,W),z))return TJ(j,Y);if(!z)throw RangeError(HO);let[X,D,T]=FO(Z,O,z),F=m6(T),G=UO(T),U=p6(T),K=G(D,X,j),Q=U(D,X,K,Y);return cZ(Y,z)?TJ(Q,Y):((B,M,L,I,S,P,V)=>{let C=k1(B),[_,x]=B6(I,f8(L,B),L,C,S,P,V),w=V6(M,_,x);return B[y[L]]+w*C})(Q,F(K),Y,D,X,F,G)}function TJ($,Z){return y0(z0($),$1[Z],1)}function B6($,Z,O,j,J,W,Y){let z=y[O],X={...Z,[z]:Z[z]+j},D=Y($,J,Z),T=Y($,J,X);return[W(D),W(T)]}function V6($,Z,O){let j=y0(g0(Z,O));if(!j)throw RangeError(Z3);return y0(g0(Z,$))/j}function WW($,Z){let[O,j,J]=JO(Z,5,1);return D0(XO($.epochNanoseconds,O,j,J,1))}function YW($,Z,O){let{epochNanoseconds:j,timeZone:J,calendar:W}=Z,[Y,z,X]=JO(O);if(Y===0&&z===1)return Z;let D=$(J);if(Y===6)j=((T,F,G,U)=>{let K=_0(G,F),[Q,B]=T(K),M=G.epochNanoseconds,L=R0(F,Q),I=R0(F,B);if(yJ(M,L,I))throw RangeError(Z3);return QW(V6(M,L,I),U)?I:L})(UW,D,Z,X);else{let T=D.getOffsetNanosecondsFor(j);j=W$(D,GW(w1(j,T),Y,z,X),T,2,0,1)}return U0(j,J,W)}function zW($,Z){return Z0(GW($,...JO(Z)),$.calendar)}function XW($,Z){let[O,j,J]=JO(Z,5);var W;return s0((W=J,C6($,oZ(O,j),W)[0]))}function DW($,Z){let O=$(Z.timeZone),j=_0(Z,O),[J,W]=UW(j),Y=y0(g0(R0(O,J),R0(O,W)),AO,1);if(Y<=0)throw RangeError(Z3);return Y}function TW($,Z){let{timeZone:O,calendar:j}=Z,J=((W,Y,z)=>R0(Y,W(_0(z,Y))))(KW,$(O),Z);return U0(J,O,j)}function GW($,Z,O,j){return FW($,oZ(Z,O),j)}function FW($,Z,O){let[j,J]=C6($,Z,O);return B1({...Y$($,J),...j})}function C6($,Z,O){return $O(b1(R1($),Z,O))}function l3($){return b1($,xO,7)}function oZ($,Z){return $1[$]*Z}function UW($){let Z=KW($);return[Z,Y$(Z,1)]}function KW($){return wX(6,$)}function h7($,Z,O){let j=Math.min($$($),6);return a$(DO(z0($,j),Z,O),j)}function zO($,Z,O,j,J,W,Y,z,X,D){if(j===0&&J===1)return $;let T=cZ(j,z)?KO(z)&&j<6&&O>=6?l7:c7:d7,[F,G,U]=T($,Z,O,j,J,W,Y,z,X,D);return U&&j!==7&&(F=((K,Q,B,M,L,I,S,P)=>{let V=k1(K);for(let C=M+1;C<=B;C++){if(C===7&&B!==7)continue;let _=f8(C,K);_[y[C]]+=V;let x=y0(g0(S(P(L,I,_)),Q));if(x&&Math.sign(x)!==V)break;K=_}return K})(F,G,O,Math.max(6,j),Y,z,X,D)),F}function XO($,Z,O,j,J){if(Z===6){let W=((Y)=>Y[0]+Y[1]/h)($);return[b1(W,O,j),0]}return DO($,oZ(Z,O),j,J)}function DO($,Z,O,j){let[J,W]=$;j&&W<0&&(W+=h,J-=1);let[Y,z]=U1(b1(W,Z,O),h);return O6(J+Y,z)}function b1($,Z,O){return QW($/Z,O)*Z}function QW($,Z){return tX[Z]($)}function c7($,Z,O,j,J,W){let Y=k1($),z=z0($),X=XO(z,j,J,W),D=g0(z,X),T=Math.sign(X[0]-z[0])===Y,F=a$(X,Math.min(O,6));return[{...$,...F},m$(Z,D),T]}function l7($,Z,O,j,J,W,Y,z,X,D){let T=k1($),F=y0(z0($,5)),G=oZ(j,J),U=b1(F,G,W),[K,Q]=B6(Y,{...$,...S8},6,T,z,X,D),B=U-y0(g0(K,Q)),M=0;B&&Math.sign(B)!==T?Z=p$(K,U):(M+=T,U=b1(B,G,W),Z=p$(Q,U));let L=BO(U);return[{...$,...L,days:$.days+M},Z,Boolean(M)]}function d7($,Z,O,j,J,W,Y,z,X,D){let T=k1($),F=y[j],G=f8(j,$);j===7&&($={...$,weeks:$.weeks+Math.trunc($.days/7)});let U=a3($[F],J)*J;G[F]=U;let[K,Q]=B6(Y,G,j,J*T,z,X,D),B=U+V6(Z,K,Q)*T*J,M=b1(B,J,W),L=Math.sign(M-B)===T;return G[F]=M,[G,L?Q:K,L]}function M6($,Z,O,j){let[J,W,Y,z]=((D)=>{let T=G6(D=u0(D));return[D.timeZone,...T]})(j),X=J!==void 0;return((D,T,F,G,U,K)=>{F=DO(F,U,G,1);let Q=T.getOffsetNanosecondsFor(F);return P6(w1(F,Q),K)+(D?J$(l3(Q)):"Z")})(X,Z(X?$(J):U$),O.epochNanoseconds,W,Y,z)}function I6($,Z,O){let[j,J,W,Y,z,X]=((D)=>{D=u0(D);let T=E8(D),F=tJ(D),G=rX(D),U=W3(D,4),K=J3(D,4);return[T,oX(D),G,U,...rJ(K,F)]})(O);return((D,T,F,G,U,K,Q,B,M,L)=>{G=DO(G,M,B,1);let I=D(F).getOffsetNanosecondsFor(G);return P6(w1(G,I),L)+J$(l3(I),Q)+((S,P)=>P!==1?"["+(P===2?"!":"")+G0(S)+"]":"")(F,K)+H6(T,U)})($,Z.calendar,Z.timeZone,Z.epochNanoseconds,j,J,W,Y,z,X)}function N6($,Z){let[O,j,J,W]=((D)=>(D=u0(D),[E8(D),...G6(D)]))(Z);return Y=$.calendar,z=O,X=W,P6(FW($,J,j),X)+H6(Y,z);var Y,z,X}function L6($,Z){return O=$.calendar,j=$,J=T6(Z),d3(j)+H6(O,J);var O,j,J}function _6($,Z){return BW($.calendar,VW,$,T6(Z))}function S6($,Z){return BW($.calendar,i7,$,T6(Z))}function f6($,Z){let[O,j,J]=oJ(Z);return W=J,CW(C6($,j,O)[0],W);var W}function TO($,Z){let[O,j,J]=oJ(Z,3);return j>1&&($={...$,...h7($,j,O)}),((W,Y)=>{let{sign:z}=W,X=z===-1?S0(W):W,{hours:D,minutes:T}=X,[F,G]=j6(z0(X,3),c0,v1);PW(F);let U=x6(G,Y),K=Y>=0||!z||U;return(z<0?"-":"")+"P"+GJ({Y:t1(X.years),M:t1(X.months),W:t1(X.weeks),D:t1(X.days)})+(D||T||F||K?"T"+GJ({H:t1(D),M:t1(T),S:t1(F,K)+U}):"")})($,J)}function BW($,Z,O,j){let J=G0($),W=j>1||j===0&&J!==q;return j===1?J===q?Z(O):d3(O):W?d3(O)+MW(J,j===2):Z(O)}function GJ($){let Z=[];for(let O in $){let j=$[O];j&&Z.push(j,O)}return Z.join("")}function P6($,Z){return d3($)+"T"+CW($,Z)}function d3($){return VW($)+"-"+h0($.isoDay)}function VW($){let{isoYear:Z}=$;return(Z<0||Z>9999?IW(Z)+m3(6,Math.abs(Z)):m3(4,Z))+"-"+h0($.isoMonth)}function i7($){return h0($.isoMonth)+"-"+h0($.isoDay)}function CW($,Z){let O=[h0($.isoHour),h0($.isoMinute)];return Z!==-1&&O.push(h0($.isoSecond)+((j,J,W,Y)=>x6(j*Z1+J*T$+W,Y))($.isoMillisecond,$.isoMicrosecond,$.isoNanosecond,Z)),O.join(":")}function J$($,Z=0){if(Z===1)return"";let[O,j]=U1(Math.abs($),AO),[J,W]=U1(j,xO),[Y,z]=U1(W,c0);return IW($)+h0(O)+":"+h0(J)+(Y||z?":"+h0(Y)+x6(z):"")}function H6($,Z){if(Z!==1){let O=G0($);if(Z>1||Z===0&&O!==q)return MW(O,Z===2)}return""}function MW($,Z){return"["+(Z?"!":"")+"u-ca="+$+"]"}function x6($,Z){let O=m3(9,$);return O=Z===void 0?O.replace(ZD,""):O.slice(0,Z),O?"."+O:""}function IW($){return $<0?"-":"+"}function t1($,Z){return $||Z?$.toLocaleString("fullwide",{useGrouping:0}):""}function u7($,Z){let{epochNanoseconds:O}=$,j=(Z.getOffsetNanosecondsFor?Z:Z($.timeZone)).getOffsetNanosecondsFor(O),J=w1(O,j);return{calendar:$.calendar,...J,offsetNanoseconds:j}}function NW($,Z){let O=_0(Z,$);return{calendar:Z.calendar,...b0(Az,O),offset:J$(O.offsetNanoseconds),timeZone:Z.timeZone}}function W$($,Z,O,j=0,J=0,W,Y){if(O!==void 0&&j===1&&(j===1||Y))return Y6(Z,O);let z=$.getPossibleInstantsFor(Z);if(O!==void 0&&j!==3){let X=((D,T,F,G)=>{let U=I0(T);G&&(F=l3(F));for(let K of D){let Q=y0(g0(K,U));if(G&&(Q=l3(Q)),Q===F)return K}})(z,Z,O,W);if(X!==void 0)return X;if(j===0)throw RangeError(MX)}return Y?I0(Z):R0($,Z,J,z)}function R0($,Z,O=0,j=$.getPossibleInstantsFor(Z)){if(j.length===1)return j[0];if(O===1)throw RangeError(IX);if(j.length)return j[O===3?1:0];let J=I0(Z),W=((z,X)=>{let D=z.getOffsetNanosecondsFor(p$(X,-h));return E6(z.getOffsetNanosecondsFor(p$(X,h))-D)})($,J),Y=W*(O===2?-1:1);return(j=$.getPossibleInstantsFor(w1(J,Y)))[O===2?0:j.length-1]}function A6($){if(Math.abs($)>=h)throw RangeError(VX);return $}function E6($){if($>h)throw RangeError(CX);return $}function v6($,Z,O){return D0(m0(m$(Z.epochNanoseconds,((j)=>{if(HW(j))throw RangeError(_X);return z0(j,5)})($?S0(O):O))))}function R6($,Z,O,j,J,W=Object.create(null)){let Y=Z(j.timeZone),z=$(j.calendar);return{...j,...g6(Y,z,j,O?S0(J):J,W)}}function b6($,Z,O,j,J=Object.create(null)){let{calendar:W}=O;return Z0(y6($(W),O,Z?S0(j):j,J),W)}function w6($,Z,O,j,J){let{calendar:W}=O;return O0(GO($(W),O,Z?S0(j):j,J),W)}function k6($,Z,O,j,J=Object.create(null)){let W=O.calendar,Y=$(W),z=hZ(Y,O);Z&&(j=QO(j)),j.sign<0&&(z=Y.dateAdd(z,{...F0,months:1}),z=Y$(z,-1));let X=Y.dateAdd(z,j,J);return e1(hZ(Y,X),W)}function q6($,Z,O){return s0(LW(Z,$?S0(O):O)[0])}function g6($,Z,O,j,J){let W=z0(j,5),Y=O.epochNanoseconds;if(HW(j)){let z=_0(O,$);Y=m$(R0($,{...GO(Z,z,{...j,...S8},J),...b0(a0,z)}),W)}else Y=m$(Y,W),g(J);return{epochNanoseconds:m0(Y)}}function y6($,Z,O,j){let[J,W]=LW(Z,O);return B1({...GO($,Z,{...O,...S8,days:O.days+W},j),...J})}function GO($,Z,O,j){if(O.years||O.months||O.weeks)return $.dateAdd(Z,O,j);g(j);let J=O.days+z0(O,5)[0];return J?A1(Y$(Z,J)):Z}function hZ($,Z,O=1){return Y$(Z,O-$.day(Z))}function LW($,Z){let[O,j]=z0(Z,5),[J,W]=$O(R1($)+j);return[J,O+W]}function Y$($,Z){return Z?{...$,...ZO(L0($)+Z*E0)}:$}function FO($,Z,O){let j=$(O.calendar);return KO(O)?[O,j,Z(O.timeZone)]:[{...O,...l0},j]}function m6($){return $?jW:I0}function UO($){return $?b(g6,$):y6}function p6($){return $?b(n7,$):a7}function KO($){return $&&$.epochNanoseconds}function cZ($,Z){return $<=6-(KO(Z)?1:0)}function h6($,Z,O,j,J,W,Y){let z=$(u0(Y).relativeTo),X=Math.max($$(J),$$(W));if(cZ(X,z))return i(n$(((Q,B,M,L)=>{let I=m$(z0(Q),z0(B),L?-1:1);if(!Number.isFinite(I[0]))throw RangeError(PO);return{...F0,...a$(I,M)}})(J,W,X,j)));if(!z)throw RangeError(HO);j&&(W=S0(W));let[D,T,F]=FO(Z,O,z),G=UO(F),U=p6(F),K=G(T,D,J);return i(U(T,D,G(T,K,W),X))}function _W($,Z,O,j,J){let W=$$(j),[Y,z,X,D,T]=((V,C,_)=>{V=K6(V,s3);let x=A8(V),w=_(V[vz]),v=F6(V),m=W3(V,7),s=J3(V);if(x===void 0&&s===void 0)throw RangeError(SX);return s==null&&(s=0),x==null&&(x=Math.max(s,C)),eJ(x,s),v=U6(v,s,1),[x,s,v,m,w]})(J,W,$),F=Math.max(W,Y);if(!KO(T)&&F<=6)return i(n$(((V,C,_,x,w)=>{let v=XO(z0(V),_,x,w);return{...F0,...a$(v,C)}})(j,Y,z,X,D)));if(!T)throw RangeError(HO);let[G,U,K]=FO(Z,O,T),Q=m6(K),B=UO(K),M=p6(K),L=B(U,G,j),I=M(U,G,L,Y),S=j.sign,P=k1(I);if(S&&P&&S!==P)throw RangeError(Z3);return P&&(I=zO(I,Q(L),Y,z,X,D,U,G,Q,B)),i(I)}function SW($){return $.sign===-1?QO($):$}function QO($){return i(S0($))}function S0($){let Z={};for(let O of y)Z[O]=-1*$[O]||0;return Z}function fW($){return!$.sign}function k1($,Z=y){let O=0;for(let j of Z){let J=Math.sign($[j]);if(J){if(O&&O!==J)throw RangeError(LX);O=J}}return O}function n$($){for(let Z of RX)p0(Z,$[Z],-CJ,CJ,1);return PW(y0(z0($),c0)),$}function PW($){if(!Number.isSafeInteger($))throw RangeError(NX)}function z0($,Z=6){return HJ($,Z,y)}function a$($,Z=6){let[O,j]=$,J=o3(j,Z,y);if(J[y[Z]]+=O*(h/$1[Z]),!Number.isFinite(J[y[Z]]))throw RangeError(PO);return J}function BO($,Z=5){return o3($,Z,y)}function HW($){return Boolean(k1($,Hz))}function $$($){let Z=9;for(;Z>0&&!$[y[Z]];Z--);return Z}function s7($,Z){return[$,Z]}function FJ($){let Z=Math.floor($/g3)*g3;return[Z,Z+g3]}function xW($){let Z=q1($=p3($));if(!Z)throw RangeError(A0($));let O;if(Z.m)O=0;else{if(!Z.offset)throw RangeError(A0($));O=o$(Z.offset)}return Z.timeZone&&i6(Z.timeZone,1),D0(Y6(OO(Z),O))}function AW($){let Z=q1(a($));if(!Z)throw RangeError(A0($));if(Z.timeZone)return yW(Z,Z.offset?o$(Z.offset):void 0);if(Z.m)throw RangeError(A0($));return pW(Z)}function EW($,Z){let O=q1(a($));if(!O||!O.timeZone)throw RangeError(A0($));let{offset:j}=O,J=j?o$(j):void 0,[,W,Y]=aZ(Z);return yW(O,J,W,Y)}function o$($){let Z=i6($);if(Z===void 0)throw RangeError(A0($));return Z}function vW($){let Z=q1(a($));if(!Z||Z.m)throw RangeError(A0($));return Z0(mW(Z))}function VO($){let Z=q1(a($));if(!Z||Z.m)throw RangeError(A0($));return O0(Z.p?mW(Z):pW(Z))}function RW($,Z){let O=l6(a(Z));if(O)return c6(O),e1(W6(O$(O)));let j=VO(Z);return e1(hZ($(j.calendar),j))}function c6($){if($.calendar!==q)throw RangeError(K1($.calendar))}function bW($,Z){let O=d6(a(Z));if(O)return c6(O),c3(O$(O));let j=VO(Z),{calendar:J}=j,W=$(J),[Y,z,X]=W.h(j),[D,T]=W.I(Y,z),[F,G]=W.N(D,T,X);return c3(A1(W.P(F,G,X)),J)}function wW($){let Z,O=((j)=>{let J=YD.exec(j);return J?(CO(J[10]),lW(J)):void 0})(a($));if(!O){if(O=q1($),!O)throw RangeError(A0($));if(!O.p)throw RangeError(A0($));if(O.m)throw RangeError(K1("Z"));c6(O)}if((Z=l6($))&&DJ(Z))throw RangeError(A0($));if((Z=d6($))&&DJ(Z))throw RangeError(A0($));return s0(jO(O,1))}function kW($){let Z=((O)=>{let j=DD.exec(O);return j?((J)=>{function W(T,F,G){let U=0,K=0;if(G&&([U,X]=U1(X,$1[G])),T!==void 0){if(z)throw RangeError(K1(T));K=((Q)=>{let B=parseInt(Q);if(!Number.isFinite(B))throw RangeError(K1(Q));return B})(T),Y=1,F&&(X=u6(F)*($1[G]/c0),z=1)}return U+K}let Y=0,z=0,X=0,D={...d$(y,[W(J[2]),W(J[3]),W(J[4]),W(J[5]),W(J[6],J[7],5),W(J[8],J[9],4),W(J[10],J[11],3)]),...o3(X,2,y)};if(!Y)throw RangeError(Yz(y));return s6(J[1])<0&&(D=S0(D)),D})(j):void 0})(a($));if(!Z)throw RangeError(A0($));return i(n$(Z))}function qW($){let Z=q1($)||l6($)||d6($);return Z?Z.calendar:$}function gW($){let Z=q1($);return Z&&(Z.timeZone||Z.m&&U$||Z.offset)||$}function yW($,Z,O=0,j=0){let J=MO($.timeZone),W=qO(J);return U0(W$(W,OO($),Z,O,j,!W.v,$.m),J,rZ($.calendar))}function mW($){return hW(B1(OO($)))}function pW($){return hW(A1(O$($)))}function hW($){return{...$,calendar:rZ($.calendar)}}function q1($){let Z=WD.exec($);return Z?((O)=>{let j=O[10],J=(j||"").toUpperCase()==="Z";return{isoYear:cW(O),isoMonth:parseInt(O[4]),isoDay:parseInt(O[5]),...lW(O.slice(5)),...CO(O[16]),p:Boolean(O[6]),m:J,offset:J?void 0:j}})(Z):void 0}function l6($){let Z=jD.exec($);return Z?((O)=>({isoYear:cW(O),isoMonth:parseInt(O[4]),isoDay:1,...CO(O[5])}))(Z):void 0}function d6($){let Z=JD.exec($);return Z?((O)=>({isoYear:l$,isoMonth:parseInt(O[1]),isoDay:parseInt(O[2]),...CO(O[3])}))(Z):void 0}function i6($,Z){let O=zD.exec($);return O?((j,J)=>{let W=j[4]||j[5];if(J&&W)throw RangeError(K1(W));return A6((y$(j[2])*AO+y$(j[3])*xO+y$(j[4])*c0+u6(j[5]||""))*s6(j[1]))})(O,Z):void 0}function cW($){let Z=s6($[1]),O=parseInt($[2]||$[3]);if(Z<0&&!O)throw RangeError(K1(-0));return Z*O}function lW($){let Z=y$($[3]);return{...$O(u6($[4]||""))[0],isoHour:y$($[1]),isoMinute:y$($[2]),isoSecond:Z===60?59:Z}}function CO($){let Z,O,j=[];if($.replace(XD,(J,W,Y)=>{let z=Boolean(W),[X,D]=Y.split("=").reverse();if(D){if(D==="u-ca")j.push(X),Z||(Z=z);else if(z||/[A-Z]/.test(D))throw RangeError(K1(J))}else{if(O)throw RangeError(K1(J));O=X}return""}),j.length>1&&Z)throw RangeError(K1($));return{timeZone:O,calendar:j[0]||q}}function u6($){return parseInt($.padEnd(9,"0"))}function r$($){return new RegExp(`^${$}$`,"i")}function s6($){return $&&$!=="+"?-1:1}function y$($){return $===void 0?0:parseInt($)}function dW($){return MO(a($))}function MO($){let Z=n6($);return typeof Z=="number"?J$(Z):Z?((O)=>{if(GD.test(O))throw RangeError(BX);return O.toLowerCase().split("/").map((j,J)=>(j.length<=3||/\d/.test(j))&&!/etc|yap/.test(j)?j.toUpperCase():j.replace(/baja|dumont|[a-z]+/g,(W,Y)=>W.length<=2&&!J||W==="in"||W==="chat"?W.toUpperCase():W.length>2||!Y?zJ(W).replace(/island|noronha|murdo|rivadavia|urville/,zJ):W)).join("/")})($):U$}function UJ($){let Z=n6($);return typeof Z=="number"?Z:Z?Z.resolvedOptions().timeZone:U$}function n6($){let Z=i6($=$.toUpperCase(),1);return Z!==void 0?Z:$!==U$?TD($):void 0}function a6($,Z){return N0($.epochNanoseconds,Z.epochNanoseconds)}function o6($,Z){return N0($.epochNanoseconds,Z.epochNanoseconds)}function iW($,Z,O,j,J,W){let Y=$(u0(W).relativeTo),z=Math.max($$(j),$$(J));if(fJ(y,j,J))return 0;if(cZ(z,Y))return N0(z0(j),z0(J));if(!Y)throw RangeError(HO);let[X,D,T]=FO(Z,O,Y),F=m6(T),G=UO(T);return N0(F(G(D,X,j)),F(G(D,X,J)))}function r6($,Z){return z$($,Z)||IO($,Z)}function z$($,Z){return x1(L0($),L0(Z))}function IO($,Z){return x1(R1($),R1(Z))}function uW($,Z){return!a6($,Z)}function sW($,Z){return!o6($,Z)&&!!NO($.timeZone,Z.timeZone)&&s$($.calendar,Z.calendar)}function nW($,Z){return!r6($,Z)&&s$($.calendar,Z.calendar)}function aW($,Z){return!z$($,Z)&&s$($.calendar,Z.calendar)}function oW($,Z){return!z$($,Z)&&s$($.calendar,Z.calendar)}function rW($,Z){return!z$($,Z)&&s$($.calendar,Z.calendar)}function tW($,Z){return!IO($,Z)}function NO($,Z){if($===Z)return 1;let O=G0($),j=G0(Z);if(O===j)return 1;try{return UJ(O)===UJ(j)}catch(J){}}function t6($,Z,O,j){let J=u$($,$0(j),3,5),W=LO(Z.epochNanoseconds,O.epochNanoseconds,...J);return i($?S0(W):W)}function e6($,Z,O,j,J,W){let Y=SO(j.calendar,J.calendar),z=$0(W),[X,D,T,F]=u$(O,z,5),G=j.epochNanoseconds,U=J.epochNanoseconds,K=N0(U,G),Q;if(K)if(X<6)Q=LO(G,U,X,D,T,F);else{let B=Z(((L,I)=>{if(!NO(L,I))throw RangeError(Fz);return L})(j.timeZone,J.timeZone)),M=$(Y);Q=$Y(M,B,j,J,K,X,z),Q=zO(Q,U,X,D,T,F,M,j,jW,b(g6,B))}else Q=F0;return i(O?S0(Q):Q)}function $8($,Z,O,j,J){let W=SO(O.calendar,j.calendar),Y=$0(J),[z,X,D,T]=u$(Z,Y,6),F=I0(O),G=I0(j),U=N0(G,F),K;if(U)if(z<=6)K=LO(F,G,z,X,D,T);else{let Q=$(W);K=ZY(Q,O,j,U,z,Y),K=zO(K,G,z,X,D,T,Q,O,I0,y6)}else K=F0;return i(Z?S0(K):K)}function Z8($,Z,O,j,J){let W=SO(O.calendar,j.calendar),Y=$0(J);return eW(Z,()=>$(W),O,j,...u$(Z,Y,6,9,6),Y)}function O8($,Z,O,j,J){let W=SO(O.calendar,j.calendar),Y=$0(J),z=u$(Z,Y,9,9,8),X=$(W);return eW(Z,()=>X,hZ(X,O),hZ(X,j),...z,Y)}function eW($,Z,O,j,J,W,Y,z,X){let D=I0(O),T=I0(j),F;if(N0(T,D))if(J===6)F=LO(D,T,J,W,Y,z);else{let G=Z();F=G.dateUntil(O,j,J,X),W===6&&Y===1||(F=zO(F,T,J,W,Y,z,G,O,I0,GO))}else F=F0;return i($?S0(F):F)}function j8($,Z,O,j){let J=$0(j),[W,Y,z,X]=u$($,J,5,5),D=b1(J8(Z,O),oZ(Y,z),X),T={...F0,...BO(D,W)};return i($?S0(T):T)}function n7($,Z,O,j,J,W){let Y=N0(j.epochNanoseconds,O.epochNanoseconds);return Y?J<6?OY(O.epochNanoseconds,j.epochNanoseconds,J):$Y(Z,$,O,j,Y,J,W):F0}function a7($,Z,O,j,J){let W=I0(Z),Y=I0(O),z=N0(Y,W);return z?j<=6?OY(W,Y,j):ZY($,Z,O,z,j,J):F0}function $Y($,Z,O,j,J,W,Y){let[z,X,D]=((G,U,K,Q)=>{function B(){return C={...Y$(I,P++*-Q),...L},_=R0(G,C),N0(S,_)===-Q}let M=_0(U,G),L=b0(a0,M),I=_0(K,G),S=K.epochNanoseconds,P=0,V=J8(M,I),C,_;if(Math.sign(V)===-Q&&P++,B()&&(Q===-1||B()))throw RangeError(Z3);let x=y0(g0(_,S));return[M,C,x]})(Z,O,j,J);var T,F;return{...W===6?(T=z,F=X,{...F0,days:jY(T,F)}):$.dateUntil(z,X,W,Y),...BO(D)}}function ZY($,Z,O,j,J,W){let[Y,z,X]=((D,T,F)=>{let G=T,U=J8(D,T);return Math.sign(U)===-F&&(G=Y$(T,-F),U+=h*F),[D,G,U]})(Z,O,j);return{...$.dateUntil(Y,z,J,W),...BO(X)}}function LO($,Z,O,j,J,W){return{...F0,...a$(XO(g0($,Z),j,J,W),O)}}function OY($,Z,O){return{...F0,...a$(g0($,Z),O)}}function jY($,Z){return _O(L0($),L0(Z))}function _O($,Z){return Math.trunc((Z-$)/E0)}function J8($,Z){return R1(Z)-R1($)}function SO($,Z){if(!s$($,Z))throw RangeError(M8);return $}function o7($){function Z(J){return((W,Y)=>({...JY(W,Y),F:W.month,day:parseInt(W.day)}))(J6(O,J),j)}let O=w8($),j=i3($);return{id:$,O:r7(Z),B:t7(Z)}}function r7($){return v0((Z)=>{let O=L0(Z);return $(O)},WeakMap)}function t7($){let Z=$(0).year-yX;return v0((O)=>{let j,J=i$(O-Z),W=[],Y=[];do J+=400*E0;while((j=$(J)).year<=O);do J+=(1-j.day)*E0,j.year===O&&(W.push(J),Y.push(j.F)),J-=E0;while((j=$(J)).year>=O);return{k:W.reverse(),C:Qz(Y.reverse())}})}function JY($,Z){let O,j,J=WY($);if($.era){let W=Sz[Z];W!==void 0&&(O=Z==="islamic"?"ah":$.era.normalize("NFD").toLowerCase().replace(/[^a-z0-9]/g,""),O==="bc"||O==="b"?O="bce":O!=="ad"&&O!=="a"||(O="ce"),j=J,J=TY(j,W[O]||0))}return{era:O,eraYear:j,year:J}}function WY($){return parseInt($.relatedYear||$.year)}function cj($){let{year:Z,F:O,day:j}=this.O($),{C:J}=this.B(Z);return[Z,J[O]+1,j]}function lZ($,Z=1,O=1){return this.B($).k[Z-1]+(O-1)*E0}function w3($){let Z=QJ(this,$),O=QJ(this,$-1),j=Z.length;if(j>O.length){let J=GY(this);if(J<0)return-J;for(let W=0;W<j;W++)if(Z[W]!==O[W])return W+1}}function k3($){return _O(lZ.call(this,$),lZ.call(this,$+1))}function KJ($,Z){let{k:O}=this.B($),j=Z+1,J=O;return j>O.length&&(j=1,J=this.B($+1).k),_O(O[Z-1],J[j-1])}function q3($){return this.B($).k.length}function QJ($,Z){return Object.keys($.B(Z).C)}function YY($){return rZ(a($))}function rZ($){if(($=$.toLowerCase())!==q&&$!==vO&&i3($)!==i3(w8($).resolvedOptions().calendar))throw RangeError(QX($));return $}function i3($){return $==="islamicc"&&($="islamic"),$.split("-")[0]}function zY($){return this.R($)[0]}function XY($){return this.R($)[1]}function W8($){let[Z]=this.h($);return _O(this.q(Z),L0($))+1}function DY($){let Z=UD.exec($);if(!Z)throw RangeError(UX($));return[parseInt(Z[1]),Boolean(Z[2])]}function u3($,Z,O){return $+(Z||O&&$>=O?1:0)}function lj($,Z){return $-(Z&&$>=Z?1:0)}function TY($,Z){return(Z+$)*(Math.sign(Z)||1)||0}function dj($){return Sz[FY($)]}function GY($){return AX[FY($)]}function FY($){return i3($.id||q)}function UY($,Z,O,j){let J=g1(O,j,n0,[],Iz);if(J.timeZone!==void 0){let W=O.dateFromFields(J),Y=X$(J),z=$(J.timeZone);return{epochNanoseconds:W$(Z(z),{...W,...Y},J.offset!==void 0?o$(J.offset):void 0),timeZone:z}}return{...O.dateFromFields(J),...l0}}function KY($,Z,O,j,J,W){let Y=g1(O,J,n0,Cz,Iz),z=$(Y.timeZone),[X,D,T]=aZ(W),F=O.dateFromFields(Y,WO(W,X)),G=X$(Y,X);return U0(W$(Z(z),{...F,...G},Y.offset!==void 0?o$(Y.offset):void 0,D,T),z,j)}function QY($,Z,O){let j=g1($,Z,n0,[],M1),J=g(O);return Z0(B1({...$.dateFromFields(j,WO(O,J)),...X$(j,J)}))}function Y8($,Z,O,j=[]){let J=g1($,Z,n0,j);return $.dateFromFields(J,O)}function z8($,Z,O,j){let J=g1($,Z,L8,j);return $.yearMonthFromFields(J,O)}function X8($,Z,O,j,J=[]){let W=g1($,O,n0,J);return Z&&W.month!==void 0&&W.monthCode===void 0&&W.year===void 0&&(W.year=l$),$.monthDayFromFields(W,j)}function BY($,Z){let O=g(Z);return s0(X$(e0($,uj,[],1),O))}function VY($){let Z=e0($,_8);return i(n$({...F0,...Z}))}function g1($,Z,O,j=[],J=[]){return e0(Z,[...$.fields(O),...J].sort(),j)}function e0($,Z,O,j=!O){let J={},W,Y=0;for(let z of Z){if(z===W)throw RangeError(zX(z));if(z==="constructor"||z==="__proto__")throw RangeError(V8(z));let X=$[z];if(X!==void 0)Y=1,MJ[z]&&(X=MJ[z](X,z)),J[z]=X;else if(O){if(O.includes(z))throw TypeError(B8(z));J[z]=_z[z]}W=z}if(j&&!Y)throw TypeError(Yz(Z));return J}function X$($,Z){return jO(VD({..._z,...$}),Z)}function CY($,Z,O,j,J,W){let Y=$0(W),{calendar:z,timeZone:X}=O;return U0(((D,T,F,G,U)=>{let K=tZ(D,F,G,n0,Mz,Vz),[Q,B,M]=aZ(U,2);return W$(T,{...D.dateFromFields(K,WO(U,Q)),...X$(K,Q)},o$(K.offset),B,M)})($(z),Z(X),j,J,Y),X,z)}function MY($,Z,O,j,J){let W=$0(J);return Z0(((Y,z,X,D)=>{let T=tZ(Y,z,X,n0,M1),F=g(D);return B1({...Y.dateFromFields(T,WO(D,F)),...X$(T,F)})})($(Z.calendar),O,j,W))}function IY($,Z,O,j,J){let W=$0(J);return((Y,z,X,D)=>{let T=tZ(Y,z,X,n0);return Y.dateFromFields(T,D)})($(Z.calendar),O,j,W)}function NY($,Z,O,j,J){let W=$0(J);return e1(((Y,z,X,D)=>{let T=tZ(Y,z,X,L8);return Y.yearMonthFromFields(T,D)})($(Z.calendar),O,j,W))}function LY($,Z,O,j,J){let W=$0(J);return((Y,z,X,D)=>{let T=tZ(Y,z,X,n0);return Y.monthDayFromFields(T,D)})($(Z.calendar),O,j,W)}function _Y($,Z,O){return s0(((j,J,W)=>{let Y=g(W);return X$({...b0(uj,j),...e0(J,uj)},Y)})($,Z,O))}function SY($,Z){return i((O=$,j=Z,n$({...O,...e0(j,_8)})));var O,j}function tZ($,Z,O,j,J=[],W=[]){let Y=[...$.fields(j),...J].sort(),z=e0(Z,Y,W),X=e0(O,Y);return z=$.mergeFields(z,X),e0(z,Y,[])}function D8($,Z){let O=g1($,Z,Lz);return $.monthDayFromFields(O)}function T8($,Z,O){let j=g1($,Z,Nz);return $.yearMonthFromFields(j,O)}function fY($,Z,O,j,J){Z=b0(O=$.fields(O),Z),j=e0(j,J=$.fields(J),[]);let W=$.mergeFields(Z,j);return W=e0(W,[...O,...J].sort(),[]),$.dateFromFields(W)}function gj($,Z){let{era:O,eraYear:j,year:J}=Z,W=dj($);if(O!==void 0||j!==void 0){if(O===void 0||j===void 0)throw TypeError(DX);if(!W)throw RangeError(XX);let Y=W[O];if(Y===void 0)throw RangeError(GX(O));let z=TY(j,Y);if(J!==void 0&&J!==z)throw RangeError(TX);J=z}else if(J===void 0)throw TypeError(FX(W));return J}function yj($,Z,O,j){let{month:J,monthCode:W}=Z;if(W!==void 0){let Y=((z,X,D,T)=>{let F=z.U(D),[G,U]=DY(X),K=u3(G,U,F);if(U){let Q=GY(z);if(Q===void 0)throw RangeError(yZ);if(Q>0){if(K>Q)throw RangeError(yZ);if(F===void 0){if(T===1)throw RangeError(yZ);K--}}else{if(K!==-Q)throw RangeError(yZ);if(F===void 0&&T===1)throw RangeError(yZ)}}return K})($,W,O,j);if(J!==void 0&&J!==Y)throw RangeError(Tz);J=Y,j=1}else if(J===void 0)throw TypeError(KX);return p0("month",J,1,$.L(O),j)}function BJ($,Z,O,j,J){return x0(Z,"day",1,$.j(j,O),J)}function mj($,Z,O,j){let J=0,W=[];for(let Y of O)Z[Y]!==void 0?J=1:W.push(Y);if(Object.assign($,Z),J)for(let Y of j||W)delete $[Y]}function PY($){return D0(m0(e3(t3($))))}function HY($,Z,O,j,J=q){return U0(m0(e3(t3(O))),Z(j),$(J))}function xY($,Z,O,j,J=0,W=0,Y=0,z=0,X=0,D=0,T=q){return Z0(B1(OO(d0(M0,d$(RO,[Z,O,j,J,W,Y,z,X,D])))),$(T))}function AY($,Z,O,j,J=q){return O0(A1(O$(d0(M0,{isoYear:Z,isoMonth:O,isoDay:j}))),$(J))}function EY($,Z,O,j=q,J=1){let W=M0(Z),Y=M0(O),z=$(j);return e1(W6(O$({isoYear:W,isoMonth:Y,isoDay:M0(J)})),z)}function vY($,Z,O,j=q,J=l$){let W=M0(Z),Y=M0(O),z=$(j);return c3(A1(O$({isoYear:M0(J),isoMonth:W,isoDay:Y})),z)}function RY($=0,Z=0,O=0,j=0,J=0,W=0){return s0(jO(d0(M0,d$(a0,[$,Z,O,j,J,W])),1))}function bY($=0,Z=0,O=0,j=0,J=0,W=0,Y=0,z=0,X=0,D=0){return i(n$(d0(gJ,d$(y,[$,Z,O,j,J,W,Y,z,X,D]))))}function G8($,Z,O=q){return U0($.epochNanoseconds,Z,O)}function wY($){return D0($.epochNanoseconds)}function F8($,Z){return Z0(_0(Z,$))}function U8($,Z){return O0(_0(Z,$))}function kY($,Z,O){return T8($(Z.calendar),O)}function qY($,Z,O){return D8($(Z.calendar),O)}function K8($,Z){return s0(_0(Z,$))}function gY($,Z,O,j){let J=((W,Y,z,X)=>{let D=D6(X);return R0(W(Y),z,D)})($,O,Z,j);return U0(m0(J),O,Z.calendar)}function yY($,Z,O){let j=$(Z.calendar);return e1({...Z,...T8(j,O)})}function mY($,Z,O){return D8($(Z.calendar),O)}function pY($,Z,O,j,J){let W=$(J.timeZone),Y=J.plainTime,z=Y!==void 0?Z(Y):l0;return U0(R0(O(W),{...j,...z}),W,j.calendar)}function hY($,Z=l0){return Z0(B1({...$,...Z}))}function cY($,Z,O){return T8($(Z.calendar),O)}function lY($,Z,O){return D8($(Z.calendar),O)}function dY($,Z,O,j){return((J,W,Y)=>fY(J,W,Nz,Q1(Y),j3))($(Z.calendar),O,j)}function iY($,Z,O,j){return((J,W,Y)=>fY(J,W,Lz,Q1(Y),EO))($(Z.calendar),O,j)}function uY($,Z,O,j,J){let W=Q1(J),Y=Z(W.plainDate),z=$(W.timeZone);return U0(R0(O(z),{...Y,...j}),z,Y.calendar)}function sY($,Z){return Z0(B1({...$,...Z}))}function nY($){return D0(m0(h$($,c0)))}function aY($){return D0(m0(h$($,Z1)))}function oY($){return D0(m0(e3(t3($),T$)))}function rY($){return D0(m0(e3(t3($))))}function tY($,Z,O=l0){let j=Z.timeZone,J=$(j),W={..._0(Z,J),...O};return U0(W$(J,W,W.offsetNanoseconds,2),j,Z.calendar)}function eY($,Z,O){let j=Z.timeZone,J=$(j),W={..._0(Z,J),...O},Y=jz(Z.calendar,O.calendar);return U0(W$(J,W,W.offsetNanoseconds,2),j,Y)}function $z($,Z=l0){return Z0({...$,...Z})}function Zz($,Z){return Z0({...$,...Z},jz($.calendar,Z.calendar))}function fO($,Z){return{...$,calendar:Z}}function Oz($,Z){return{...$,timeZone:Z}}function jz($,Z){if($===Z)return $;let O=G0($),j=G0(Z);if(O===j||O===q)return Z;if(j===q)return $;throw RangeError(M8)}function e7($,Z){return(O)=>O===q?$:O===vO||O===c$?Object.assign(Object.create($),{id:O}):Object.assign(Object.create(Z),FD(O))}function D$($,Z,O){let j=new Set(O);return(J)=>(((W,Y)=>{for(let z of Y)if(z in W)return 1;return 0})(J=oj(j,J),$)||Object.assign(J,Z),O&&(J.timeZone=U$,["full","long"].includes(J.timeStyle)&&(J.timeStyle="medium")),J)}function V1($,Z=Q8){let[O,,,j]=$;return(J,W=bD,...Y)=>{let z=Z(j&&j(...Y),J,W,O),X=z.resolvedOptions();return[z,...$X($,X,Y)]}}function Q8($,Z,O,j){if(O=j(O),$){if(O.timeZone!==void 0)throw TypeError(PX);O.timeZone=$}return new y1(Z,O)}function $X($,Z,O){let[,j,J]=$;return O.map((W)=>(W.calendar&&((Y,z,X)=>{if((X||Y!==q)&&Y!==z)throw RangeError(M8)})(G0(W.calendar),Z.calendar,J),j(W,Z)))}function t$($){let Z=eZ();return w1(Z,$.getOffsetNanosecondsFor(Z))}function eZ(){return h$(Date.now(),Z1)}function C1(){return NJ||(NJ=new y1().resolvedOptions().timeZone)}var ZX=($,Z)=>`Non-integer ${$}: ${Z}`,OX=($,Z)=>`Non-positive ${$}: ${Z}`,jX=($,Z)=>`Non-finite ${$}: ${Z}`,JX=($)=>`Cannot convert bigint to ${$}`,WX=($)=>`Invalid bigint: ${$}`,YX="Cannot convert Symbol to string",Jz="Invalid object",Wz=($,Z,O,j,J)=>J?Wz($,J[Z],J[O],J[j]):$3($,Z)+`; must be between ${O}-${j}`,$3=($,Z)=>`Invalid ${$}: ${Z}`,B8=($)=>`Missing ${$}`,V8=($)=>`Invalid field ${$}`,zX=($)=>`Duplicate field ${$}`,Yz=($)=>"No valid fields: "+$.join(),zz="Invalid bag",Xz=($,Z,O)=>$3($,Z)+"; must be "+Object.keys(O).join(),Dz="Cannot use valueOf",C8="Invalid calling context",XX="Forbidden era/eraYear",DX="Mismatching era/eraYear",TX="Mismatching year/eraYear",GX=($)=>`Invalid era: ${$}`,FX=($)=>"Missing year"+($?"/era/eraYear":""),UX=($)=>`Invalid monthCode: ${$}`,Tz="Mismatching month/monthCode",KX="Missing month/monthCode",VJ="Cannot guess year",yZ="Invalid leap month",Gz="Invalid protocol",Z3="Invalid protocol results",M8="Mismatching Calendars",QX=($)=>`Invalid Calendar: ${$}`,Fz="Mismatching TimeZones",BX="Forbidden ICU TimeZone",VX="Out-of-bounds offset",CX="Out-of-bounds TimeZone gap",MX="Invalid TimeZone offset",IX="Ambiguous offset",PO="Out-of-bounds date",NX="Out-of-bounds duration",LX="Cannot mix duration signs",HO="Missing relativeTo",_X="Cannot use large units",SX="Required smallestUnit or largestUnit",fX="smallestUnit > largestUnit",A0=($)=>`Cannot parse: ${$}`,K1=($)=>`Invalid substring: ${$}`,Uz=($)=>`Cannot format ${$}`,Kz="Mismatching types for formatting",PX="Cannot specify TimeZone",Qz=b(uZ,($,Z)=>Z),e$=b(uZ,($,Z,O)=>O),h0=b(m3,2),ij={nanosecond:0,microsecond:1,millisecond:2,second:3,minute:4,hour:5,day:6,week:7,month:8,year:9},O3=Object.keys(ij),E0=86400000,Bz=1000,T$=1000,Z1=1e6,c0=1e9,xO=60000000000,AO=3600000000000,h=86400000000000,$1=[1,T$,Z1,c0,xO,AO,h],M1=O3.slice(0,6),uj=sZ(M1),Vz=["offset"],Cz=["timeZone"],Mz=M1.concat(Vz),Iz=Mz.concat(Cz),sj=["era","eraYear"],HX=sj.concat(["year"]),EO=["year"],I8=["monthCode"],N8=["month"].concat(I8),j3=["day"],L8=N8.concat(EO),Nz=I8.concat(EO),n0=j3.concat(L8),xX=j3.concat(N8),Lz=j3.concat(I8),_z=e$(M1,0),q="iso8601",vO="gregory",c$="japanese",Sz={[vO]:{bce:-1,ce:0},[c$]:{bce:-1,ce:0,meiji:1867,taisho:1911,showa:1925,heisei:1988,reiwa:2018},ethioaa:{era0:0},ethiopic:{era0:0,era1:5500},coptic:{era0:-1,era1:0},roc:{beforeroc:-1,minguo:0},buddhist:{be:0},islamic:{ah:0},indian:{saka:0},persian:{ap:0}},AX={chinese:13,dangi:13,hebrew:-6},a=b(r3,"string"),fz=b(r3,"boolean"),EX=b(r3,"number"),Pz=b(r3,"function"),y=O3.map(($)=>$+"s"),_8=sZ(y),vX=y.slice(0,6),Hz=y.slice(6),RX=Hz.slice(1),bX=Qz(y),F0=e$(y,0),S8=e$(vX,0),f8=b(PJ,y),a0=["isoNanosecond","isoMicrosecond","isoMillisecond","isoSecond","isoMinute","isoHour"],P8=["isoDay","isoMonth","isoYear"],RO=a0.concat(P8),H8=sZ(P8),xz=sZ(a0),Az=sZ(RO),l0=e$(xz,0),wX=b(PJ,RO),y1=Intl.DateTimeFormat,Ez="en-GB",x8=1e8,kX=x8*E0,qX=[x8,0],gX=[-x8,0],dZ=275760,iZ=-271821,yX=1970,l$=1972,F1=12,mX=i$(1868,9,8),pX=v0(p7,WeakMap),s3="smallestUnit",nj="unit",pZ="roundingIncrement",pj="fractionalSecondDigits",vz="relativeTo",Rz={constrain:0,reject:1},hX=Object.keys(Rz),cX={compatible:0,reject:1,earlier:2,later:3},lX={reject:0,use:1,prefer:2,ignore:3},dX={auto:0,never:1,critical:2,always:3},iX={auto:0,never:1,critical:2},uX={auto:0,never:1},sX={floor:0,halfFloor:1,ceil:2,halfCeil:3,trunc:4,halfTrunc:5,expand:6,halfExpand:7,halfEven:8},J3=b(Q6,s3),A8=b(Q6,"largestUnit"),nX=b(Q6,nj),bz=b(j$,"overflow",Rz),wz=b(j$,"disambiguation",cX),aX=b(j$,"offset",lX),E8=b(j$,"calendarName",dX),oX=b(j$,"timeZoneName",iX),rX=b(j$,"offset",uX),W3=b(j$,"roundingMode",sX),$Z="PlainYearMonth",ZZ="PlainMonthDay",G$="PlainDate",F$="PlainDateTime",bO="PlainTime",I1="ZonedDateTime",wO="Instant",kO="Duration",tX=[Math.floor,($)=>b3($)?Math.floor($):Math.round($),Math.ceil,($)=>b3($)?Math.ceil($):Math.round($),Math.trunc,($)=>b3($)?Math.trunc($)||0:Math.round($),($)=>$<0?Math.floor($):Math.ceil($),($)=>Math.sign($)*Math.round(Math.abs($))||0,($)=>b3($)?($=Math.trunc($)||0)+$%2:Math.round($)],U$="UTC",g3=5184000,eX=h3(1847),$D=h3(new Date().getUTCFullYear()+10),ZD=/0+$/,_0=v0(u7,WeakMap),CJ=4294967295,qO=v0(($)=>{let Z=n6($);return typeof Z=="object"?new qz(Z):new kz(Z||0)});class kz{constructor($){this.v=$}getOffsetNanosecondsFor(){return this.v}getPossibleInstantsFor($){return[Y6($,this.v)]}l(){}}class qz{constructor($){this.$=((Z)=>{function O(X){let D=hj(X,Y,z),[T,F]=FJ(D),G=J(T),U=J(F);return G===U?G:j(W(T,F),G,U,X)}function j(X,D,T,F){let G,U;for(;(F===void 0||(G=F<X[0]?D:F>=X[1]?T:void 0)===void 0)&&(U=X[1]-X[0]);){let K=X[0]+Math.floor(U/2);Z(K)===T?X[1]=K:X[0]=K+1}return G}let J=v0(Z),W=v0(s7),Y=eX,z=$D;return{G(X){let D=O(X-86400),T=O(X+86400),F=X-D,G=X-T;if(D===T)return[F];let U=O(F);return U===O(G)?[X-U]:D>T?[F,G]:[]},V:O,l(X,D){let T=hj(X,Y,z),[F,G]=FJ(T),U=g3*D,K=D<0?()=>G>Y||(Y=T,0):()=>F<z||(z=T,0);for(;K();){let Q=J(F),B=J(G);if(Q!==B){let M=W(F,G);j(M,Q,B);let L=M[0];if((x1(L,X)||1)===D)return L}F+=U,G+=U}}}})(((Z)=>(O)=>{let j=J6(Z,O*Bz);return h3(WY(j),parseInt(j.month),parseInt(j.day),parseInt(j.hour),parseInt(j.minute),parseInt(j.second))-O})($))}getOffsetNanosecondsFor($){return this.$.V(pJ($))*c0}getPossibleInstantsFor($){let[Z,O]=[h3((j=$).isoYear,j.isoMonth,j.isoDay,j.isoHour,j.isoMinute,j.isoSecond),j.isoMillisecond*Z1+j.isoMicrosecond*T$+j.isoNanosecond];var j;return this.$.G(Z).map((J)=>m0(p$(h$(J,c0),O)))}l($,Z){let[O,j]=hJ($),J=this.$.l(O+(Z>0||j?1:0),Z);if(J!==void 0)return h$(J,c0)}}var v8="([+\u2212-])",y3="(?:[.,](\\d{1,9}))?",gz=`(?:(?:${v8}(\\d{6}))|(\\d{4}))-?(\\d{2})`,R8="(\\d{2})(?::?(\\d{2})(?::?(\\d{2})"+y3+")?)?",b8=v8+R8,OD=gz+"-?(\\d{2})(?:[T ]"+R8+"(Z|"+b8+")?)?",yz="\\[(!?)([^\\]]*)\\]",gO=`((?:${yz}){0,9})`,jD=r$(gz+gO),JD=r$("(?:--)?(\\d{2})-?(\\d{2})"+gO),WD=r$(OD+gO),YD=r$("T?"+R8+"(?:"+b8+")?"+gO),zD=r$(b8),XD=new RegExp(yz,"g"),DD=r$(`${v8}?P(\\d+Y)?(\\d+M)?(\\d+W)?(\\d+D)?(?:T(?:(\\d+)${y3}H)?(?:(\\d+)${y3}M)?(?:(\\d+)${y3}S)?)?`),TD=v0(($)=>new y1(Ez,{timeZone:$,era:"short",year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"})),GD=/^(AC|AE|AG|AR|AS|BE|BS|CA|CN|CS|CT|EA|EC|IE|IS|JS|MI|NE|NS|PL|PN|PR|PS|SS|VS)T$/,FD=v0(o7),w8=v0(($)=>new y1(Ez,{calendar:$,timeZone:U$,era:"short",year:"numeric",month:"short",day:"numeric"})),UD=/^M(\d{2})(L?)$/,KD={era:p3,eraYear:M0,year:M0,month:XJ,monthCode:p3,day:XJ},QD=e$(M1,M0),BD=e$(y,gJ),MJ=Object.assign({},KD,QD,BD,{offset:p3}),VD=b(m7,M1,a0),IJ={dateAdd($,Z,O){let j=g(O),J,{years:W,months:Y,weeks:z,days:X}=Z;if(X+=z0(Z,5)[0],W||Y)J=((D,T,F,G,U)=>{let[K,Q,B]=D.h(T);if(F){let[M,L]=D.I(K,Q);K+=F,Q=u3(M,L,D.U(K)),Q=p0("month",Q,1,D.L(K),U)}return G&&([K,Q]=D._(K,Q,G)),B=p0("day",B,1,D.j(K,Q),U),D.q(K,Q,B)})(this,$,W,Y,j);else{if(!z&&!X)return $;J=L0($)}return J+=(7*z+X)*E0,A1(ZO(J))},dateUntil($,Z,O){if(O<=7){let X=0,D=jY({...$,...l0},{...Z,...l0});return O===7&&([X,D]=v1(D,7)),{...F0,weeks:X,days:D}}let j=this.h($),J=this.h(Z),[W,Y,z]=((X,D,T,F,G,U,K)=>{let Q=G-D,B=U-T,M=K-F;if(Q||B){let L=Math.sign(Q||B),I=X.j(G,U),S=0;if(Math.sign(M)===-L){let P=I;[G,U]=X._(G,U,-L),Q=G-D,B=U-T,I=X.j(G,U),S=L<0?-P:I}if(M=K-Math.min(F,I)+S,Q){let[P,V]=X.I(D,T),[C,_]=X.I(G,U);if(B=C-P||Number(_)-Number(V),Math.sign(B)===-L){let x=L<0&&-X.L(G);Q=(G-=L)-D,B=U-u3(P,V,X.U(G))+(x||X.L(G))}}}return[Q,B,M]})(this,...j,...J);return O===8&&(Y+=this.J(W,j[0]),W=0),{...F0,years:W,months:Y,days:z}},dateFromFields($,Z){let O=g(Z),j=gj(this,$),J=yj(this,$,j,O),W=BJ(this,$,J,j,O);return O0(A1(this.P(j,J,W)),this.id||q)},yearMonthFromFields($,Z){let O=g(Z),j=gj(this,$),J=yj(this,$,j,O);return e1(W6(this.P(j,J,1)),this.id||q)},monthDayFromFields($,Z){let O=g(Z),j=!this.id,{monthCode:J,year:W,month:Y}=$,z,X,D,T,F;if(J!==void 0){[z,X]=DY(J),F=LJ($,"day");let G=this.N(z,X,F);if(!G)throw RangeError(VJ);if([D,T]=G,Y!==void 0&&Y!==T)throw RangeError(Tz);j&&(T=p0("month",T,1,F1,1),F=p0("day",F,1,z6(W!==void 0?W:D,T),O))}else{D=W===void 0&&j?l$:gj(this,$),T=yj(this,$,D,O),F=BJ(this,$,T,D,O);let G=this.U(D);X=T===G,z=lj(T,G);let U=this.N(z,X,F);if(!U)throw RangeError(VJ);[D,T]=U}return c3(A1(this.P(D,T,F)),this.id||q)},fields($){return dj(this)&&$.includes("year")?[...$,...sj]:$},mergeFields($,Z){let O=Object.assign(Object.create(null),$);return mj(O,Z,N8),dj(this)&&(mj(O,Z,HX),this.id===c$&&mj(O,Z,xX,sj)),O},inLeapYear($){let[Z]=this.h($);return this.K(Z)},monthsInYear($){let[Z]=this.h($);return this.L(Z)},daysInMonth($){let[Z,O]=this.h($);return this.j(Z,O)},daysInYear($){let[Z]=this.h($);return this.X(Z)},dayOfYear:W8,era($){return this.ee($)[0]},eraYear($){return this.ee($)[1]},monthCode($){let[Z,O]=this.h($),[j,J]=this.I(Z,O);return((W,Y)=>"M"+h0(W)+(Y?"L":""))(j,J)},dayOfWeek:uJ,daysInWeek(){return 7}},CD={dayOfYear:W8,h:lJ,q:i$},MD=Object.assign({},CD,{weekOfYear:zY,yearOfWeek:XY,R($){function Z(U){return(7-U<j?7:0)-U}function O(U){let K=iJ(G+U),Q=U||1,B=Z(mZ(X+K*Q,7));return T=(K+(B-D)*Q)/7}let j=this.id?1:4,J=uJ($),W=this.dayOfYear($),Y=mZ(J-1,7),z=W-1,X=mZ(Y-z,7),D=Z(X),T,F=Math.floor((z-D)/7)+1,G=$.isoYear;return F?F>O(0)&&(F=1,G++):(F=O(-1),G--),[F,G,T]}}),ID={dayOfYear:W8,h:cj,q:lZ,weekOfYear:zY,yearOfWeek:XY,R(){return[]}},OZ=e7(Object.assign({},IJ,MD,{h:lJ,ee($){return this.id===vO?sJ($):this.id===c$?pX($):[]},I:($,Z)=>[Z,0],N($,Z){if(!Z)return[l$,$]},K:X6,U(){},L:dJ,J:($)=>$*F1,j:z6,X:iJ,P:($,Z,O)=>({isoYear:$,isoMonth:Z,isoDay:O}),q:i$,_:($,Z,O)=>($+=a3(O,F1),(Z+=tj(O,F1))<1?($--,Z+=F1):Z>F1&&($++,Z-=F1),[$,Z]),year($){return $.isoYear},month($){return $.isoMonth},day:($)=>$.isoDay}),Object.assign({},IJ,ID,{h:cj,ee($){let Z=this.O($);return[Z.era,Z.eraYear]},I($,Z){let O=w3.call(this,$);return[lj(Z,O),O===Z]},N($,Z,O){let[j,J,W]=cj.call(this,{isoYear:l$,isoMonth:F1,isoDay:31}),Y=w3.call(this,j),z=J===Y;(x1($,lj(J,Y))||x1(Number(Z),Number(z))||x1(O,W))===1&&j--;for(let X=0;X<100;X++){let D=j-X,T=w3.call(this,D),F=u3($,Z,T);if(Z===(F===T)&&O<=KJ.call(this,D,F))return[D,F]}},K($){let Z=k3.call(this,$);return Z>k3.call(this,$-1)&&Z>k3.call(this,$+1)},U:w3,L:q3,J($,Z){let O=Z+$,j=Math.sign($),J=j<0?-1:0,W=0;for(let Y=Z;Y!==O;Y+=j)W+=q3.call(this,Y+J);return W},j:KJ,X:k3,P($,Z,O){return ZO(lZ.call(this,$,Z,O))},q:lZ,_($,Z,O){if(O){if(Z+=O,!Number.isSafeInteger(Z))throw RangeError(PO);if(O<0)for(;Z<1;)Z+=q3.call(this,--$);else{let j;for(;Z>(j=q3.call(this,$));)Z-=j,$++}}return[$,Z]},year($){return this.O($).year},month($){let{year:Z,F:O}=this.O($),{C:j}=this.B(Z);return j[O]+1},day($){return this.O($).day}})),E1="numeric",jZ=["timeZoneName"],mz={month:E1,day:E1},k8={year:E1,month:E1},q8=Object.assign({},k8,{day:E1}),g8={hour:E1,minute:E1,second:E1},y8=Object.assign({},q8,g8),ND=Object.assign({},y8,{timeZoneName:"short"}),LD=Object.keys(k8),_D=Object.keys(mz),SD=Object.keys(q8),fD=Object.keys(g8),m8=["dateStyle"],PD=LD.concat(m8),HD=_D.concat(m8),p8=SD.concat(m8,["weekday"]),Y3=fD.concat(["dayPeriod","timeStyle"]),h8=p8.concat(Y3),xD=h8.concat(jZ),AD=jZ.concat(Y3),ED=jZ.concat(p8),vD=jZ.concat(["day","weekday"],Y3),RD=jZ.concat(["year","weekday"],Y3),bD={},c8=[D$(h8,y8),YO],pz=[D$(xD,ND),YO,0,($,Z)=>{let O=G0($.timeZone);if(Z&&G0(Z.timeZone)!==O)throw RangeError(Fz);return O}],l8=[D$(h8,y8,jZ),L0],d8=[D$(p8,q8,AD),L0],i8=[D$(Y3,g8,ED),($)=>R1($)/Z1],u8=[D$(PD,k8,vD),L0,1],s8=[D$(HD,mz,RD),L0,1],NJ;function J1($,Z,O,j,J){function W(...X){if(!(this instanceof W))throw TypeError(C8);dz(this,Z(...X))}function Y(X,D){return Object.defineProperties(function(...T){return X.call(this,z(this),...T)},aj(D))}function z(X){let D=B0(X);if(!D||D.branding!==$)throw TypeError(C8);return D}return Object.defineProperties(W.prototype,{..._J(d0(Y,O)),...Z$(d0(Y,j)),...n3("Temporal."+$)}),Object.defineProperties(W,{...Z$(J),...aj($)}),[W,(X)=>{let D=Object.create(W.prototype);return dz(D,X),D},z]}function sz($){return $=$.concat("id").sort(),(Z)=>{if(!SJ(Z,$))throw TypeError(Gz);return Z}}function zZ($){if(B0($)||$.calendar!==void 0||$.timeZone!==void 0)throw TypeError(zz);return $}function yO($,Z){let O={};for(let j in $)O[j]=({o:J},W)=>{let Y=B0(W)||{},{branding:z}=Y,X=z===G$||Z.includes(z)?Y:P0(W);return J[j](X)};return O}function o8($){let Z={};for(let O in $)Z[O]=(j)=>{let{calendar:J}=j;return(W=J,typeof W=="string"?OZ(W):(Y=W,Object.assign(Object.create(aD),{i:Y})))[O](j);var W,Y};return Z}function l1(){throw TypeError(Dz)}function X3({calendar:$}){return typeof $=="string"?new W2($):$}function hz($,Z){if(Z=$0(Z),X0($)){let j=B0($);if(j&&j.branding===ZZ)return g(Z),j;let J=oz($);return X8(iO(J||q),!J,$,Z)}let O=bW(OZ,$);return g(Z),O}function nz($,Z,O){return j=Z.call($,f0(D0(O))),A6(nZ(j));var j}function mO($,Z=$9){let O=Object.keys(Z).sort(),j={};for(let J of O)j[J]=b(Z[J],$,Pz($[J]));return j}function c($,Z){return typeof $=="string"?qO($):mO($,Z)}function J0($){return c($,a8)}function O1($){if(X0($)){let Z=B0($);if(Z)switch(Z.branding){case wO:return Z;case I1:return D0(Z.epochNanoseconds)}}return xW($)}function cz($,Z,O){let j=Z.l(O1(O).epochNanoseconds,$);return j?f0(D0(j)):null}function d($){return X0($)?(B0($)||{}).timeZone||ZT($):((Z)=>MO(gW(a(Z))))($)}function m1($,Z){if(X0($)){let O=B0($)||{};switch(O.branding){case bO:return g(Z),O;case F$:return g(Z),s0(O);case I1:return g(Z),K8(J0,O)}return BY($,Z)}return g(Z),wW($)}function r8($){return $===void 0?void 0:m1($)}function JZ($,Z){if(Z=$0(Z),X0($)){let j=B0($);return j&&j.branding===$Z?(g(Z),j):z8(lO(D3($)),$,Z)}let O=RW(OZ,$);return g(Z),O}function p1($,Z){if(Z=$0(Z),X0($)){let j=B0($)||{};switch(j.branding){case F$:return g(Z),j;case G$:return g(Z),Z0({...j,...l0});case I1:return g(Z),F8(J0,j)}return QY(dO(D3($)),$,Z)}let O=vW($);return g(Z),O}function P0($,Z){if(Z=$0(Z),X0($)){let j=B0($)||{};switch(j.branding){case G$:return g(Z),j;case F$:return g(Z),O0(j);case I1:return g(Z),U8(J0,j)}return Y8(dO(D3($)),$,Z)}let O=VO($);return g(Z),O}function az($,Z,O){return i0(Z.call($,r(O0(O,$))))}function W1($){return(Z)=>typeof Z=="string"?OZ(Z):((O,j)=>{let J=Object.keys(j).sort(),W={};for(let Y of J)W[Y]=b(j[Y],O,O[Y]);return W})(Z,$)}function o($){if(X0($)){let Z=B0($);return Z&&Z.branding===kO?Z:VY($)}return kW($)}function z3($){if($!==void 0){if(X0($)){let Z=B0($)||{};switch(Z.branding){case I1:case G$:return Z;case F$:return O0(Z)}let O=D3($);return{...UY(d,c,dO(O),$),calendar:O}}return AW($)}}function D3($){return oz($)||q}function oz($){let{calendar:Z}=$;if(Z!==void 0)return Q0(Z)}function Q0($){return X0($)?(B0($)||{}).calendar||BT($):((Z)=>rZ(qW(a(Z))))($)}function WZ($,Z){if(Z=$0(Z),X0($)){let O=B0($);if(O&&O.branding===I1)return aZ(Z),O;let j=D3($);return KY(d,c,dO(j),j,$,Z)}return EW($,Z)}function lz($){return d0((Z)=>(O)=>Z(n8(O)),$)}function n8($){return _0($,J0)}function wD(){let $=y1.prototype,Z=Object.getOwnPropertyDescriptors($),O=Object.getOwnPropertyDescriptors(y1),j=function(J,W={}){if(!(this instanceof j))return new j(J,W);Y2.set(this,((Y,z={})=>{let X=new y1(Y,z),D=X.resolvedOptions(),T=D.locale,F=b0(Object.keys(z),D),G=v0(gD),U=(...K)=>{let Q,B=K.map((M,L)=>{let I=B0(M),S=(I||{}).branding;if(L&&Q&&Q!==S)throw TypeError(Kz);return Q=S,I});return Q?G(Q)(T,F,...B):[X,...K]};return U.u=X,U})(J,W))};for(let J in Z){let W=Z[J],Y=J.startsWith("format")&&kD(J);typeof W.value=="function"?W.value=J==="constructor"?j:Y||qD(J):Y&&(W.get=function(){return Y.bind(this)})}return O.prototype.value=Object.create($,Z),Object.defineProperties(j,O),j}function kD($){return function(...Z){let O=Y2.get(this),[j,...J]=O(...Z);return j[$](...J)}}function qD($){return function(...Z){return Y2.get(this).u[$](...Z)}}function gD($){let Z=yD[$];if(!Z)throw TypeError(Uz($));return V1(Z,v0(Q8))}var yD={Instant:c8,PlainDateTime:l8,PlainDate:d8,PlainTime:i8,PlainYearMonth:u8,PlainMonthDay:s8},mD=V1(c8),pD=V1(pz),hD=V1(l8),cD=V1(d8),lD=V1(i8),dD=V1(u8),iD=V1(s8),t8={era:vJ,eraYear:ej,year:nZ,month:i0,daysInMonth:i0,daysInYear:i0,inLeapYear:fz,monthsInYear:i0},hO={monthCode:a},e8={day:i0},rz={dayOfWeek:i0,dayOfYear:i0,weekOfYear:RJ,yearOfWeek:ej,daysInWeek:i0},tz=Object.assign({},t8,hO,e8,rz),pO=new WeakMap,B0=pO.get.bind(pO),dz=pO.set.bind(pO),uD={...yO(t8,[$Z]),...yO(rz,[]),...yO(hO,[$Z,ZZ]),...yO(e8,[ZZ])},$2=o8(tz),sD=o8({...t8,...hO}),nD=o8({...hO,...e8}),T3={calendarId:($)=>G0($.calendar)},aD=d0(($,Z)=>function(O){let{i:j}=this;return $(j[Z](r(O0(O,j))))},tz),oD=uZ(($)=>(Z)=>Z[$],y.concat("sign")),Z2=uZ(($,Z)=>(O)=>O[a0[Z]],M1),ez={epochSeconds:$W,epochMilliseconds:YO,epochMicroseconds:ZW,epochNanoseconds:OW},G3=b(oj,new Set(["branding"])),[rD,YZ,tD]=J1(ZZ,b(vY,Q0),{...T3,...nD},{getISOFields:G3,getCalendar:X3,with($,Z,O){return YZ(LY(UT,$,this,zZ(Z),O))},equals:($,Z)=>rW($,hz(Z)),toPlainDate($,Z){return r(iY(F3,$,this,Z))},toLocaleString($,Z,O){let[j,J]=iD(Z,O,$);return j.format(J)},toString:S6,toJSON:($)=>S6($),valueOf:l1},{from:($,Z)=>YZ(hz($,Z))}),$9={getOffsetNanosecondsFor:nz,getPossibleInstantsFor($,Z,O){let j=[...Z.call($,K0(Z0(O,q)))].map((W)=>$T(W).epochNanoseconds),J=j.length;return J>1&&(j.sort(N0),E6(y0(g0(j[0],j[J-1])))),j}},a8={getOffsetNanosecondsFor:nz},[eD,f0,$T]=J1(wO,PY,ez,{add:($,Z)=>f0(v6(0,$,o(Z))),subtract:($,Z)=>f0(v6(1,$,o(Z))),until:($,Z,O)=>l(t6(0,$,O1(Z),O)),since:($,Z,O)=>l(t6(1,$,O1(Z),O)),round:($,Z)=>f0(WW($,Z)),equals:($,Z)=>uW($,O1(Z)),toZonedDateTime($,Z){let O=Q1(Z);return j0(G8($,d(O.timeZone),Q0(O.calendar)))},toZonedDateTimeISO:($,Z)=>j0(G8($,d(Z))),toLocaleString($,Z,O){let[j,J]=mD(Z,O,$);return j.format(J)},toString:($,Z)=>M6(d,J0,$,Z),toJSON:($)=>M6(d,J0,$),valueOf:l1},{from:($)=>f0(O1($)),fromEpochSeconds:($)=>f0(nY($)),fromEpochMilliseconds:($)=>f0(aY($)),fromEpochMicroseconds:($)=>f0(oY($)),fromEpochNanoseconds:($)=>f0(rY($)),compare:($,Z)=>a6(O1($),O1(Z))}),[cO,zK]=J1("TimeZone",($)=>{let Z=dW($);return{branding:"TimeZone",id:Z,o:qO(Z)}},{id:($)=>$.id},{getPossibleInstantsFor:({o:$},Z)=>$.getPossibleInstantsFor(p1(Z)).map((O)=>f0(D0(O))),getOffsetNanosecondsFor:({o:$},Z)=>$.getOffsetNanosecondsFor(O1(Z).epochNanoseconds),getOffsetStringFor($,Z){let O=O1(Z).epochNanoseconds,j=mO(this,a8).getOffsetNanosecondsFor(O);return J$(j)},getPlainDateTimeFor($,Z,O=q){let j=O1(Z).epochNanoseconds,J=mO(this,a8).getOffsetNanosecondsFor(j);return K0(Z0(w1(j,J),Q0(O)))},getInstantFor($,Z,O){let j=p1(Z),J=D6(O),W=mO(this);return f0(D0(R0(W,j,J)))},getNextTransition:({o:$},Z)=>cz(1,$,Z),getPreviousTransition:({o:$},Z)=>cz(-1,$,Z),equals($,Z){return!!NO(this,d(Z))},toString:($)=>$.id,toJSON:($)=>$.id},{from($){let Z=d($);return typeof Z=="string"?new cO(Z):Z}}),ZT=sz(Object.keys($9)),[OT,h1]=J1(bO,RY,Z2,{getISOFields:G3,with($,Z,O){return h1(_Y(this,zZ(Z),O))},add:($,Z)=>h1(q6(0,$,o(Z))),subtract:($,Z)=>h1(q6(1,$,o(Z))),until:($,Z,O)=>l(j8(0,$,m1(Z),O)),since:($,Z,O)=>l(j8(1,$,m1(Z),O)),round:($,Z)=>h1(XW($,Z)),equals:($,Z)=>tW($,m1(Z)),toZonedDateTime:($,Z)=>j0(uY(d,P0,c,$,Z)),toPlainDateTime:($,Z)=>K0(sY($,P0(Z))),toLocaleString($,Z,O){let[j,J]=lD(Z,O,$);return j.format(J)},toString:f6,toJSON:($)=>f6($),valueOf:l1},{from:($,Z)=>h1(m1($,Z)),compare:($,Z)=>IO(m1($),m1(Z))}),[jT,c1,JT]=J1($Z,b(EY,Q0),{...T3,...sD},{getISOFields:G3,getCalendar:X3,with($,Z,O){return c1(NY(FT,$,this,zZ(Z),O))},add:($,Z,O)=>c1(k6(iz,0,$,o(Z),O)),subtract:($,Z,O)=>c1(k6(iz,1,$,o(Z),O)),until:($,Z,O)=>l(O8(uz,0,$,JZ(Z),O)),since:($,Z,O)=>l(O8(uz,1,$,JZ(Z),O)),equals:($,Z)=>oW($,JZ(Z)),toPlainDate($,Z){return r(dY(F3,$,this,Z))},toLocaleString($,Z,O){let[j,J]=dD(Z,O,$);return j.format(J)},toString:_6,toJSON:($)=>_6($),valueOf:l1},{from:($,Z)=>c1(JZ($,Z)),compare:($,Z)=>z$(JZ($),JZ(Z))}),[WT,K0]=J1(F$,b(xY,Q0),{...T3,...$2,...Z2},{getISOFields:G3,getCalendar:X3,with($,Z,O){return K0(MY(F3,$,this,zZ(Z),O))},withCalendar:($,Z)=>K0(fO($,Q0(Z))),withPlainDate:($,Z)=>K0(Zz($,P0(Z))),withPlainTime:($,Z)=>K0($z($,r8(Z))),add:($,Z,O)=>K0(b6(K$,0,$,o(Z),O)),subtract:($,Z,O)=>K0(b6(K$,1,$,o(Z),O)),until:($,Z,O)=>l($8(j1,0,$,p1(Z),O)),since:($,Z,O)=>l($8(j1,1,$,p1(Z),O)),round:($,Z)=>K0(zW($,Z)),equals:($,Z)=>nW($,p1(Z)),toZonedDateTime:($,Z,O)=>j0(gY(c,$,d(Z),O)),toPlainDate:($)=>r(O0($)),toPlainTime:($)=>h1(s0($)),toPlainYearMonth($){return c1(yY(lO,$,this))},toPlainMonthDay($){return YZ(mY(iO,$,this))},toLocaleString($,Z,O){let[j,J]=hD(Z,O,$);return j.format(J)},toString:N6,toJSON:($)=>N6($),valueOf:l1},{from:($,Z)=>K0(p1($,Z)),compare:($,Z)=>r6(p1($),p1(Z))}),[YT,r,Z9]=J1(G$,b(AY,Q0),{...T3,...$2},{getISOFields:G3,getCalendar:X3,with($,Z,O){return r(IY(F3,$,this,zZ(Z),O))},withCalendar:($,Z)=>r(fO($,Q0(Z))),add:($,Z,O)=>r(w6(K$,0,$,o(Z),O)),subtract:($,Z,O)=>r(w6(K$,1,$,o(Z),O)),until:($,Z,O)=>l(Z8(j1,0,$,P0(Z),O)),since:($,Z,O)=>l(Z8(j1,1,$,P0(Z),O)),equals:($,Z)=>aW($,P0(Z)),toZonedDateTime($,Z){let O=!X0(Z)||Z instanceof cO?{timeZone:Z}:Z;return j0(pY(d,m1,c,$,O))},toPlainDateTime:($,Z)=>K0(hY($,r8(Z))),toPlainYearMonth($){return c1(cY(lO,$,this))},toPlainMonthDay($){return YZ(lY(iO,$,this))},toLocaleString($,Z,O){let[j,J]=cD(Z,O,$);return j.format(J)},toString:L6,toJSON:($)=>L6($),valueOf:l1},{from:($,Z)=>r(P0($,Z)),compare:($,Z)=>z$(P0($),P0(Z))}),O2={fields($,Z,O){return[...Z.call($,O)]}},O9=Object.assign({dateFromFields($,Z,O,j){return Z9(Z.call($,Object.assign(Object.create(null),O),j))}},O2),j9=Object.assign({yearMonthFromFields($,Z,O,j){return JT(Z.call($,Object.assign(Object.create(null),O),j))}},O2),J9=Object.assign({monthDayFromFields($,Z,O,j){return tD(Z.call($,Object.assign(Object.create(null),O),j))}},O2),j2={mergeFields($,Z,O,j){return Q1(Z.call($,Object.assign(Object.create(null),O),Object.assign(Object.create(null),j)))}},zT=Object.assign({},O9,j2),XT=Object.assign({},j9,j2),DT=Object.assign({},J9,j2),J2={dateAdd($,Z,O,j,J){return Z9(Z.call($,r(O0(O,$)),l(i(j)),J))}},W9=Object.assign({},J2,{dateUntil($,Z,O,j,J,W){return QT(Z.call($,r(O0(O,$)),r(O0(j,$)),Object.assign(Object.create(null),W,{largestUnit:O3[J]})))}}),TT=Object.assign({},J2,{day:az}),GT=Object.assign({},W9,{day:az}),lO=W1(j9),dO=W1(O9),iO=W1(J9),FT=W1(XT),F3=W1(zT),UT=W1(DT),K$=W1(J2),j1=W1(W9),iz=W1(TT),uz=W1(GT),[KT,l,QT]=J1(kO,bY,{...oD,blank:fW},{with:($,Z)=>l(SY($,Z)),negated:($)=>l(QO($)),abs:($)=>l(SW($)),add:($,Z,O)=>l(h6(z3,j1,c,0,$,o(Z),O)),subtract:($,Z,O)=>l(h6(z3,j1,c,1,$,o(Z),O)),round:($,Z)=>l(_W(z3,j1,c,$,Z)),total:($,Z)=>JW(z3,j1,c,$,Z),toLocaleString($,Z,O){return Intl.DurationFormat?new Intl.DurationFormat(Z,O).format(this):TO($)},toString:TO,toJSON:($)=>TO($),valueOf:l1},{from:($)=>l(o($)),compare:($,Z,O)=>iW(z3,K$,c,o($),o(Z),O)}),Y9={toString:($)=>$.id,toJSON:($)=>$.id,...uD,dateAdd:({id:$,o:Z},O,j,J)=>r(O0(Z.dateAdd(P0(O),o(j),J),$)),dateUntil:({o:$},Z,O,j)=>l(i($.dateUntil(P0(Z),P0(O),aJ(j)))),dateFromFields:({id:$,o:Z},O,j)=>r(Y8(Z,O,j,EJ($))),yearMonthFromFields:({id:$,o:Z},O,j)=>c1(z8(Z,O,j,xJ($))),monthDayFromFields:({id:$,o:Z},O,j)=>YZ(X8(Z,0,O,j,AJ($))),fields({o:$},Z){let O=new Set(n0),j=[];for(let J of Z){if(a(J),!O.has(J))throw RangeError(V8(J));O.delete(J),j.push(J)}return $.fields(j)},mergeFields:({o:$},Z,O)=>$.mergeFields(rj($6(Z)),rj($6(O)))},[W2]=J1("Calendar",($)=>{let Z=YY($);return{branding:"Calendar",id:Z,o:OZ(Z)}},{id:($)=>$.id},Y9,{from($){let Z=Q0($);return typeof Z=="string"?new W2(Z):Z}}),BT=sz(Object.keys(Y9).slice(4)),[VT,j0]=J1(I1,b(HY,Q0,d),{...ez,...T3,...lz($2),...lz(Z2),offset:($)=>J$(n8($).offsetNanoseconds),offsetNanoseconds:($)=>n8($).offsetNanoseconds,timeZoneId:($)=>G0($.timeZone),hoursInDay:($)=>DW(c,$)},{getISOFields:($)=>NW(J0,$),getCalendar:X3,getTimeZone:({timeZone:$})=>typeof $=="string"?new cO($):$,with($,Z,O){return j0(CY(F3,c,$,this,zZ(Z),O))},withCalendar:($,Z)=>j0(fO($,Q0(Z))),withTimeZone:($,Z)=>j0(Oz($,d(Z))),withPlainDate:($,Z)=>j0(eY(c,$,P0(Z))),withPlainTime:($,Z)=>j0(tY(c,$,r8(Z))),add:($,Z,O)=>j0(R6(K$,c,0,$,o(Z),O)),subtract:($,Z,O)=>j0(R6(K$,c,1,$,o(Z),O)),until:($,Z,O)=>l(i(e6(j1,c,0,$,WZ(Z),O))),since:($,Z,O)=>l(i(e6(j1,c,1,$,WZ(Z),O))),round:($,Z)=>j0(YW(c,$,Z)),startOfDay:($)=>j0(TW(c,$)),equals:($,Z)=>sW($,WZ(Z)),toInstant:($)=>f0(wY($)),toPlainDateTime:($)=>K0(F8(J0,$)),toPlainDate:($)=>r(U8(J0,$)),toPlainTime:($)=>h1(K8(J0,$)),toPlainYearMonth($){return c1(kY(lO,$,this))},toPlainMonthDay($){return YZ(qY(iO,$,this))},toLocaleString($,Z,O={}){let[j,J]=pD(Z,O,$);return j.format(J)},toString:($,Z)=>I6(J0,$,Z),toJSON:($)=>I6(J0,$),valueOf:l1},{from:($,Z)=>j0(WZ($,Z)),compare:($,Z)=>o6(WZ($),WZ(Z))}),CT=Object.defineProperties({},{...n3("Temporal.Now"),...Z$({timeZoneId:()=>C1(),instant:()=>f0(D0(eZ())),zonedDateTime:($,Z=C1())=>j0(U0(eZ(),d(Z),Q0($))),zonedDateTimeISO:($=C1())=>j0(U0(eZ(),d($),q)),plainDateTime:($,Z=C1())=>K0(Z0(t$(J0(d(Z))),Q0($))),plainDateTimeISO:($=C1())=>K0(Z0(t$(J0(d($))),q)),plainDate:($,Z=C1())=>r(O0(t$(J0(d(Z))),Q0($))),plainDateISO:($=C1())=>r(O0(t$(J0(d($))),q)),plainTimeISO:($=C1())=>h1(s0(t$(J0(d($)))))})}),XZ=Object.defineProperties({},{...n3("Temporal"),...Z$({PlainYearMonth:jT,PlainMonthDay:rD,PlainDate:YT,PlainTime:OT,PlainDateTime:WT,ZonedDateTime:VT,Instant:eD,Calendar:W2,TimeZone:cO,Duration:KT,Now:CT})}),MT=wD(),Y2=new WeakMap,IT=Object.defineProperties(Object.create(Intl),Z$({DateTimeFormat:MT}));var z2=new WeakMap;function LT($){let Z=z2.get($);if(!Z)Z=$(NT(32).toString("hex")),z2.set($,Z),Z.catch(()=>z2.delete($));return Z}async function X2($,Z,O){if(typeof O==="string"&&O!=="")return await $.verifyPassword(Z,O);try{await $.verifyPassword(Z,await LT($.hashPassword))}catch{}return!1}async function Q$($,Z){let O=Z.user??Z.session?.user;if(!O||!$.onAuthenticated)return;let{password:j,...J}=O;await $.onAuthenticated({...Z,user:J})}class G2 extends Error{}function D2($){return typeof $==="string"&&$!==""?$:null}function z9($){return wZ($)}var _T=256;function X9($){return typeof $==="string"&&$!==""&&$.length<=_T?$:null}var T2="intended_url";class F2 extends A{schema={email:{required:"Email is required",string:"Invalid email",email:"Invalid email"},password:{required:"Password is required"}}}class D9 extends A{schema={email:{required:"Email is required",email:"Invalid email"}}}class T9 extends A{schema={password:{required:"Password is required",password:"Invalid password"}}}class u extends _j{async me(){let $=await B$.user();if(!$)throw new Sj;return $}async verifyEmail($=new A){let Z=await $.input(),{userProvider:O}=N(E),j=D2(Z.get("token"));if(!j)return{email:null};let J=await O.findUserByVerificationToken(j);if(!J)return{email:null};return await O.verifyUser(J.email),{email:J.email}}async signInWithMagicLink($=new A){let Z=N(E),{userProvider:O}=Z,j=D2($.search.get("token")),J=null;try{J=wZ(decodeURIComponent($.search.get("email")??""))}catch{}if(await g$("link",null,$,{perIp:Z.config.emailCode.verifyLimit.perIp}),!J||!j||!await Z.verifyMagicLinkToken(J,j))return{error:"Invalid token"};await O.verifyUser(J);let W=await Z.createOrUpdateSession({email:J});return $.ctx().setCookie("access_token",W.token,N(E).accessTokenCookieOptions($,W.expiresAt)),await Z.config.onSignIn(W,$.search.toJSON()),await Q$(Z.config,{session:W,isNewUser:!1,method:"magic-link",req:$}),{session:W}}async verifyPinRequest($){let Z=N(E),O=await $.input(),{email:j,pin:J}=O.toJSON(),W=wZ(j),Y=X9(J);if(await g$("verify",W,$,Z.config.emailCode.verifyLimit),!W||!Y)throw new p({pin:["Invalid pin"]});let z=await Z.verifyOneTimeCode(W,Y);if(z.status==="too_many_attempts")throw new p({pin:["Too many attempts"]});if(z.status!=="ok")throw new p({pin:["Invalid pin"]});return await Z.userProvider.verifyUser(W),W}async signInWithPinV2($=new A){let Z=N(E),O=await this.verifyPinRequest($),j=await Z.createOrUpdateSessionV2({email:O});return $.ctx().setCookie("access_token",j.token,N(E).accessTokenCookieOptions($,j.expiresAt)),await Z.config.onSignIn(j,$.search.toJSON()),await Q$(Z.config,{session:j,isNewUser:!1,method:"magic-link",req:$}),j}async signInWithPin($=new A){let Z=N(E),O=await this.verifyPinRequest($),j=await Z.createOrUpdateSession({email:O});return $.ctx().setCookie("access_token",j.token,N(E).accessTokenCookieOptions($,j.expiresAt)),await Z.config.onSignIn(j,$.search.toJSON()),await Q$(Z.config,{session:j,isNewUser:!1,method:"magic-link",req:$}),{session:j}}async signInV2($=new F2){let Z=await $.input(),{email:O,password:j}=Z.toJSON(),J=O.toLowerCase().trim(),W=N(E),Y=await W.userProvider.findUserByEmailAddress(J,W.config.verifyEmail),z=typeof j==="string"&&await X2(W.config,j,Y?.password);if(!Y||!z)throw new p({invalid_credentials:["Invalid credentials"]});let X=await W.createOrUpdateSessionV2({email:Y.email,id:Y.id});$.ctx().setCookie("access_token",X.token,N(E).accessTokenCookieOptions($,X.expiresAt)),await W.config.onSignIn(Y,$.search.toJSON()),await Q$(W.config,{session:X,user:Y,isNewUser:!1,method:"password",req:$});let{password:D,...T}=Y;return T}async signIn($=new F2){let Z=await $.input(),{email:O,password:j}=Z.toJSON(),J=O.toLowerCase().trim(),W=N(E),Y=await W.userProvider.findUserByEmailAddress(J,W.config.verifyEmail),z=typeof j==="string"&&await X2(W.config,j,Y?.password);if(!Y||!z)throw new p({invalid_credentials:["Invalid credentials"]});let X=await W.createOrUpdateSession({email:Y.email,id:Y.id});$.ctx().setCookie("access_token",X.token,N(E).accessTokenCookieOptions($,X.expiresAt)),await W.config.onSignIn(Y,$.search.toJSON()),await Q$(W.config,{session:X,user:Y,isNewUser:!1,method:"password",req:$});let{password:D,...T}=Y;return T}async signUp(){let $=N(E),{userProvider:Z,config:O}=$,j=new O.signUpRequest,J=await j.input(),{email:W,password:Y,name:z,invitationId:X}=J.toJSON(),D=z9(W);if(!D)throw new p({email:["Invalid email"]});if(Y!=null&&typeof Y!=="string")throw new p({password:["Invalid password"]});if(X!=null&&typeof X!=="string")throw new p({invitationId:["Invalid invitation"]});if(await Z.findUserByEmailAddress(D,!1))throw new p({email:["Email address already exists"]});let F=await O.hashPassword(Y),G=N(n).detectLocale(j),U;if(X)U=await Z.findInvitation(X,D);let K,Q="";if(U)K=await Z.transaction(async()=>{await Z.deleteInvitationById(X);let B=await Z.createUser({email:D,name:z,password:F,emailVerifiedAt:new Date,locale:G});return await Z.createAccount({organizationId:U.organizationId,userId:B.id,organizationRole:U.role}),await O.onUserCreated(B),B});else Q=await O.generateEmailVerificationToken(D),K=await Z.transaction(async()=>{let B=await Z.createUser({email:D,name:z,password:F,verificationToken:Q,locale:G});return await O.onUserCreated(B),B});return await O.onSignUp(K,Q,j.search.toJSON()),K}async signOut($=new A){let Z=Nj($),O=N(E),{config:j}=O,J=await O.revokeSession(Z,$.headers.get("User-Agent"));if($.ctx().setCookie("access_token","",N(E).accessTokenCookieOptions($,new Date(0))),N(E).cookieDomain($))$.ctx().setCookie("access_token","",{...N(E).accessTokenCookieOptions($,new Date(0)),domain:void 0});if(J?.user)J.user.extension=await j.extendSession(J.user),await j.onSignOut(J.user);return{}}async forgotPassword($=new D9){let Z=await $.input(),O=z9(Z.get("email"));if(!O)return{};let{userProvider:j,config:J}=N(E),W=await j.findUserByEmailAddress(O,J.verifyEmail);if(!W)return{};let Y=await J.generateForgotPasswordToken(W);return await j.createPasswordResetToken({user:W,token:Y}),await J.onForgotPassword(W,Y),{}}async resetPassword($=new T9){let{userProvider:Z,config:O}=N(E),j=await $.input(),{password:J,token:W}=j.toJSON(),Y=D2(W),z=Y?await Z.findPasswordResetToken({token:Y}):null;if(!z)throw new p({token:["Invalid token"]});if(XZ.Instant.from(z.createdAt.toISOString()).add({hours:24}).until(XZ.Now.instant()).sign>=0)throw new p({token:["Token expired"]});await Z.deletePasswordResetToken({token:Y});let D=await Z.findUserByEmailAddress(z.user.email,O.verifyEmail);if(!D)throw new p({email:["User not found"]});let T=await O.hashPassword(J);return await Z.updateUserPassword({id:D.id,password:T}),await Z.deleteAllUserSessions(D.id),await O.onResetPassword(D),{}}async changePassword($=new A){let{userProvider:Z,config:O}=N(E),j=await B$.user(),J=await $.input(),{oldPassword:W,newPassword:Y}=J.toJSON();if(typeof Y!=="string")throw new p({newPassword:["Invalid password"]});let z=await Z.findUserByEmailAddress(j.email,O.verifyEmail);if(!(typeof W==="string"&&await X2(O,W,z?.password)))throw new p({oldPassword:["Incorrect password"]});let D=await O.hashPassword(Y);return await Z.updateUserPassword({id:j.id,password:D}),await Z.deleteAllUserSessions(j.id),{}}async oauthRedirect($=new A){let{provider:Z}=$.params,O=N(E).config.oauthProviders[Z];if(!O)throw Error(`Invalid provider: ${Z}`);let j=fZ($.search.get(x$),"");if(j)$.ctx().setCookie(T2,encodeURIComponent(j),{httpOnly:!0,sameSite:"Lax",secure:f4($.rawRequest),maxAge:600});return{destination:await O.getRedirectUrl($)}}async oauthCallback($=new A){let{provider:Z}=$.params,O=N(E),{userProvider:j,config:J}=O,W=J.oauthProviders[Z],{email:Y,name:z,username:X,providerId:D}=await W.onCallback($),T=D?await j.findUserBySocialAccount(Z,D):null,F="signin";if(!T){if(!Y)return console.error("Authentication error: No email returned from OAuth provider callback"),{session:null};let Q=N(n).detectLocale($);try{let B=await this.linkOAuthAccount({provider:Z,providerId:D,email:Y,name:z,username:X,locale:Q});if(B)T=B.user,F=B.action}catch(B){let M=D?await j.findUserBySocialAccount(Z,D):null;if(!M)throw B;T=M}if(!T)return{session:null}}let G=await O.createOrUpdateSessionV2({email:T.email,id:T.id});if($.ctx().setCookie("access_token",G.token,N(E).accessTokenCookieOptions($,G.expiresAt)),F==="signup")await J.onSignUp(T,"",$.search.toJSON());else await J.onSignIn(T,$.search.toJSON());await Q$(O.config,{session:G,user:T,isNewUser:F==="signup",method:"oauth",req:$});let U=$.cookies.get(T2),K=J.redirectPath;if(U){try{K=fZ(decodeURIComponent(U),K)}catch{}$.ctx().setCookie(T2,"",{maxAge:-1})}return{session:G,redirectTo:K}}async linkOAuthAccount($){let{provider:Z,providerId:O,email:j,name:J,username:W,locale:Y}=$,{userProvider:z,config:X}=N(E),D=(G)=>({provider:Z,userId:G,email:j,username:W,providerId:O,expiresAt:new Date,accessToken:"",refreshToken:""}),T=await z.findUserByEmailAddress(j,!1);if(T){if(!O)return{user:T,action:"signin"};let G=await z.findSocialAccounts(T.id,Z);if(G.some((K)=>K.providerId===O))return{user:T,action:"signin"};if(G.some((K)=>K.providerId))return console.error(`Authentication error: user ${T.id} is already linked to a different ${Z} account`),null;let U=G[0];if(U){if(!await z.claimSocialAccount(U,O))throw Error(`${Z} account link changed concurrently`)}else await z.createSocialAccount(D(T.id));return{user:T,action:"signin"}}return{user:await z.transaction(async()=>{let G=await z.createUser({email:j,name:J,locale:Y,emailVerifiedAt:new Date});if(O)await z.createSocialAccount(D(G.id));return await X.onUserCreated(G),G}),action:"signup"}}async createMagicLinkToken($=new A){let Z=await $.input(),O=wZ(Z.get("email")),j=N(E),{uniformMagicLinkResponse:J,requestLimit:W}=j.config.emailCode;if(await g$("request",O,$,W),!O)return{email:null};let{user:Y,pin:z,token:X}=await j.createMagicLinkToken(O);if(Y)return await j.config.onMagicLinkCreated(Y,{email:O,pin:z,token:X}),{email:O};return{email:J?O:null}}async requestEmailCode($=new A){let Z=N(E),O=Z.config.emailCode;if(!O.enabled)throw new q0("Not found",{status:404});let j=await $.input(),J=vj(j.get("email"));if(await g$("request",J,$,O.requestLimit),!J)throw new p({email:["Invalid email"]});let W=await Z.userProvider.findUserByEmailAddress(J,!1);if(W||O.createUser){let{pin:Y,token:z}=await Z.issueOneTimeCode(J,O.length);await O.send({email:J,code:Y,token:z,isNewUser:!W,req:$})}return{ok:!0}}async verifyEmailCode($=new A){let Z=N(E),{userProvider:O,config:j}=Z;if(!j.emailCode.enabled)throw new q0("Not found",{status:404});let J=await $.input(),{email:W,code:Y,name:z}=J.toJSON(),X=vj(W),D=X9(Y);if(await g$("verify",X,$,j.emailCode.verifyLimit),!X||!D)throw new p({code:["invalid_code"]});let T=await Z.verifyOneTimeCode(X,D,{claim:!1});if(T.status==="too_many_attempts")throw new p({code:["too_many_attempts"]});if(T.status!=="ok")throw new p({code:["invalid_code"]});let F=T.row,G=await O.findUserByEmailAddress(X,!1),U=!1;if(G){if(!await O.claimMagicLinkToken(F.id))throw new p({code:["invalid_code"]});await O.verifyUser(X)}else if(j.emailCode.createUser){let Q=N(n).detectLocale($);try{G=await O.transaction(async()=>{if(!await O.claimMagicLinkToken(F.id))throw new G2;let B=await O.createUser({email:X,name:typeof z==="string"?z.trim():"",emailVerifiedAt:new Date,locale:Q});return await j.onUserCreated(B),B}),U=!0}catch(B){if(B instanceof G2)throw new p({code:["invalid_code"]});throw B}}else throw await O.claimMagicLinkToken(F.id),new p({code:["invalid_code"]});let K=await Z.createOrUpdateSessionV2({email:X,id:G.id});return $.ctx().setCookie("access_token",K.token,N(E).accessTokenCookieOptions($,K.expiresAt)),await j.onSignIn(K,$.search.toJSON()),await Q$(Z.config,{session:K,isNewUser:U,method:"email-code",req:$}),{session:K,isNewUser:U}}}class G9 extends _1{middlewares=["cache:private"];routes={"/:provider":this.view("_Redirect",[u,"oauthRedirect"]),"/:provider/callback":this.view("auth/OauthCallback",[u,"oauthCallback"])}}class U2 extends _1{middlewares=["cache:private"];routes={"/sign-in/magic-link":this.view("auth/MagicLinkSignIn",[u,"signInWithMagicLink"]),"/oauth":G9}}class K2 extends H0{middlewares=["cache:private"];routes={"/sign-in":this.post(u,"signIn"),"/sign-in-v2":this.post(u,"signInV2"),"/sign-up":this.post(u,"signUp"),"/sign-out":this.post(u,"signOut"),"/forgot-password":this.post(u,"forgotPassword"),"/reset-password":this.post(u,"resetPassword"),"/change-password":this.post(u,"changePassword"),"/verify-email":this.post(u,"verifyEmail"),"/me":this.get(u,"me").middleware(["auth"]),"/magic-link":this.post(u,"createMagicLinkToken"),"/sign-in-with-pin":this.post(u,"signInWithPin"),"/sign-in-with-pin-v2":this.post(u,"signInWithPinV2"),"/email-code":this.post(u,"requestEmailCode"),"/email-code/verify":this.post(u,"verifyEmailCode")}}class Q2 extends H0{middlewares=["cache:private,0,no-store"];routes={"/set-locale/:locale":this.get(async()=>{let Z=new A().params.locale;return await N(n).onLocaleChange(Z),{locale:Z}}),"/translations/:locale/:scope*":this.get(async()=>{let $=new A,Z=`/${$.params.scope??""}`,O=$.params.locale,j=N(n),J=O??j.detectLocale($),W=j.getPageTranslations(J,Z);return $.ctx().setCookie("i18n-locale",J,{expires:new Date(Date.now()+31536000000)}),{[J]:W}})}}class B2{}class V2 extends B2{async resize($,Z){let{height:O,width:j,quality:J,fit:W}=Z;return await(await uO("The Sharp image optimization driver"))($).resize(j>0?j:void 0,O>0?O:void 0,{fit:W}).webp({quality:J>0?J:80,force:!0}).toBuffer()}}function pK($){return $}function F9(){return{driver:new V2}}class C2 extends H0{routes={"/resize":this.file(async()=>{let $=new A,Z=new URL($.rawRequest.url),O=Z.searchParams.get("url"),j=Number(Z.searchParams.get("w")),J=Number(Z.searchParams.get("h")),W=Z.searchParams.get("fit")??"cover",Y=Number(Z.searchParams.get("q"));if(!O)return new Response(JSON.stringify({error:"url query parameter is required"}),{headers:{"Content-Type":"application/json"},status:404});let X=`${O.startsWith("http")?"":`http://localhost:${process.env.PORT||5173}`}${O}`,D=await fetch(X);if(!D.ok)return new Response(JSON.stringify({error:"Image not found",info:X}),{headers:{"Content-Type":"application/json"},status:404});let T=Buffer.from(await D.arrayBuffer()),F=await N(U9).resize(T,{height:J,width:j,fit:W,quality:Y});D.headers.delete("Content-Type"),D.headers.delete("Content-Length");let G=new Headers(D.headers);return G.set("Content-Type","image/webp"),G.set("Content-Length",`${F.byteLength}`),new Response(new Uint8Array(F),{headers:G})})}}class U9{static token="image";driver;constructor($={}){this.driver=$.driver??F9().driver}resize($,Z){return this.driver.resize($,Z)}}class M2 extends H0{middlewares=["cache:private,0"];routes={"/live":this.get(async()=>{let $=Bun.file(N(K9).currentLogFilePath);return new Response(await $.text(),{headers:{"Content-Type":"text/plain"}})})}}function ST($){let Z=new Map;for(let O of $)if(typeof O==="string"){let[j,J=""]=O.split(":");if(j.startsWith("-")){if(Z.has(j.replace("-","")))Z.delete(j.replace("-",""))}else Z.set(j,J.split(",").filter(Boolean))}else Z.set(O,[]);return Z}var fT={"body-limit":x3};class DZ{config;static token="middleware";defaultBodyLimit;constructor($){this.config=$;this.defaultBodyLimit=$.bodyLimit===null||$.bodyLimit===void 0?null:SZ($.bodyLimit)}get aliases(){return{...fT,...this.config.aliases}}applyDefaultBodyLimit($){if(this.defaultBodyLimit!==null&&!X4($))S3($,this.defaultBodyLimit,{checkDeclared:!1})}assertGlobalMiddleware(){for(let $ of this.config.global){if(typeof $!=="string")continue;let[Z]=$.split(":");if(Z.startsWith("-"))throw Error(`Global middleware "${$}" cancels an alias, but nothing is inherited into the global list. Remove it.`);if(!this.aliases[Z])throw Error(`Global middleware "${Z}" is not a registered alias. Add it to \`aliases\` in the middleware config, or list the class itself.`)}}runGlobalMiddleware(){return this.runMiddleware(this.config.global)}runMiddleware($){let Z=new A,O=this.aliases;return Array.from(ST($).entries()).map(([j,J])=>{if(typeof j==="string"){let W=O[j];if(W){let Y=new W(Z);return()=>Y.run.call(Y,...J)}}else{if(L3(j)){let W=new j(Z);return W.run.bind(W)}return j}}).filter(Boolean).reduce((j,J)=>{return async()=>{return{...await j(),...await J()}}},()=>Promise.resolve({}))()}}function OQ($){return $}function Q9(){return{onRequestStart:()=>{},onRequestEnd:()=>{},onRequestFail:()=>{}}}function B9(){return{partialRendering:!0,onRequestStart:()=>{},onRequestEnd:()=>{},onRequestFail:()=>{},onStreamComplete:()=>{}}}function PT($){return"run"in $}function HT($){return Object.hasOwn($,"get")||Object.hasOwn($,"post")||Object.hasOwn($,"put")||Object.hasOwn($,"patch")||Object.hasOwn($,"delete")}function xT($){return Object.hasOwn($,"first")&&Object.hasOwn($,"second")}function AT($){if("__brand"in $)return $.__brand==="ApiRouter";return!1}function ET($){if("__internal_brand"in $)return $.__internal_brand==="ProxyHandler";return!1}function V9($){if("__internal_brand"in $)return $.__internal_brand==="StreamHandler";return!1}function I2($,Z="",O=[]){let j={};function J(W,Y,z,X,D){let T=W==="/"?"":W,F=Z==="/"?"":Z,G=(`${F}${T}`===""?"/":`${F}${T}`).replaceAll("//","/");if(!j[G])j[G]={};j[G][Y.toUpperCase()]={exec:z,middleware:[...O,...X],...D?{source:D}:{}},j[G].OPTIONS={exec:()=>{let K=new A().ctx().headers;return new Response(null,{headers:K,status:204})},middleware:[]}}for(let[W,Y]of Object.entries($)){if(ET(Y)){let z=Y;for(let X of["GET","POST","PUT","DELETE"])J(W,X,z.run.bind(z),z.middlewares);continue}if(PT(Y)){let z=Y,X=z.method,D=z.middlewares,T=z.run.bind(z);if(J(W,X,T,D,z.source),V9(Y))J(W,"HEAD",T,D,z.source)}if(HT(Y))for(let[z,X]of Object.entries(Y)){let D=X,T=D.middlewares,F=D.run.bind(D);if(J(W,z,F,T,D.source),z==="get"&&V9(D))J(W,"HEAD",F,T,D.source)}if(AT(Y)){let z=new Y,X=I2(z.routes,`${Z}${W}`,z.middlewares);for(let[D,T]of Object.entries(X))j[D.replaceAll("//","/")]=T}if(xT(Y)){let{first:z,second:X}=Y;for(let[D,T]of Object.entries(z)){let F=T.middlewares,G=T.run.bind(T),[U,...K]=W.split("/").reverse();if(!U.startsWith(":"))throw Error("Resource route must end with a dynamic segment");J(K.reverse().join("/"),D,G,F,T.source)}for(let[D,T]of Object.entries(X)){let F=T.middlewares,G=T.run.bind(T);J(W,D,G,F,T.source)}}}return Object.fromEntries(Object.entries(j).sort(([W],[Y])=>{let z=W.split("/").length+W.split(":").length,X=Y.split("/").length+Y.split(":").length;return z-X}))}function sO($){return $.replace(/\([^)]*\)/g,"").replace(/\/\//g,"/")}function N2($,Z){if($==="/")return Z;if(Z==="/")return $;return`${$}${Z}`}function L2($){let Z=sO($);return Z.length>1?Z.replace(/\/$/,""):Z}function C9($,Z){return Z.map((O)=>({...O,path:L2(N2($,O.path))}))}function nO($){let Z={};for(let[O,j]of Object.entries($))if("run"in j){let J=j;if("children"in J){let W=new J.children,Y=nO(W.routes);for(let[z,{exec:X,middleware:D,segments:T,features:F}]of Object.entries(Y)){let G=N2(O,z),U=(K)=>J.run.call(J,K,O);Z[sO(G)]={exec:[U,...X],middleware:[...J.middlewares,...D],features:[...J.featureGates,...F],viewPath:J.viewPath,segments:[{path:L2(O),viewPath:J.viewPath,...J.alwaysRuns?{alwaysRun:!0}:{}},...C9(O,T)]}}}else{let W=(Y)=>J.run.call(J,Y,O);Z[sO(O)]={exec:[W],middleware:J.middlewares,features:J.featureGates,viewPath:J.viewPath,segments:[{path:L2(O),viewPath:J.viewPath}]}}}else{let J=new j,W=nO(J.routes);for(let[Y,{exec:z,middleware:X,viewPath:D,segments:T,features:F}]of Object.entries(W)){let G=N2(O,Y);Z[sO(G)]={exec:z,middleware:[...J.middlewares,...X],features:[...J.featureGates,...F],viewPath:D,segments:C9(O,T)}}}return Object.fromEntries(Object.entries(Z).sort(([O],[j])=>{let J=O.split("/").length+O.split(":").length,W=j.split("/").length+j.split(":").length;return J-W}))}var vT=Object.defineProperty,f=($,Z)=>vT($,"name",{value:Z,configurable:!0}),FZ=class{type=3;name="";prefix="";value="";suffix="";modifier=3;constructor($,Z,O,j,J,W){this.type=$,this.name=Z,this.prefix=O,this.value=j,this.suffix=J,this.modifier=W}hasCustomName(){return this.name!==""&&typeof this.name!="number"}};f(FZ,"Part");var RT=/[$_\p{ID_Start}]/u,bT=/[$_\u200C\u200D\p{ID_Continue}]/u,S2=".*";function M9($,Z){return(Z?/^[\x00-\xFF]*$/:/^[\x00-\x7F]*$/).test($)}f(M9,"isASCII");function H2($,Z=!1){let O=[],j=0;for(;j<$.length;){let J=$[j],W=f(function(Y){if(!Z)throw TypeError(Y);O.push({type:"INVALID_CHAR",index:j,value:$[j++]})},"ErrorOrInvalid");if(J==="*"){O.push({type:"ASTERISK",index:j,value:$[j++]});continue}if(J==="+"||J==="?"){O.push({type:"OTHER_MODIFIER",index:j,value:$[j++]});continue}if(J==="\\"){O.push({type:"ESCAPED_CHAR",index:j++,value:$[j++]});continue}if(J==="{"){O.push({type:"OPEN",index:j,value:$[j++]});continue}if(J==="}"){O.push({type:"CLOSE",index:j,value:$[j++]});continue}if(J===":"){let Y="",z=j+1;for(;z<$.length;){let X=$.substr(z,1);if(z===j+1&&RT.test(X)||z!==j+1&&bT.test(X)){Y+=$[z++];continue}break}if(!Y){W(`Missing parameter name at ${j}`);continue}O.push({type:"NAME",index:j,value:Y}),j=z;continue}if(J==="("){let Y=1,z="",X=j+1,D=!1;if($[X]==="?"){W(`Pattern cannot start with "?" at ${X}`);continue}for(;X<$.length;){if(!M9($[X],!1)){W(`Invalid character '${$[X]}' at ${X}.`),D=!0;break}if($[X]==="\\"){z+=$[X++]+$[X++];continue}if($[X]===")"){if(Y--,Y===0){X++;break}}else if($[X]==="("&&(Y++,$[X+1]!=="?")){W(`Capturing groups are not allowed at ${X}`),D=!0;break}z+=$[X++]}if(D)continue;if(Y){W(`Unbalanced pattern at ${j}`);continue}if(!z){W(`Missing pattern at ${j}`);continue}O.push({type:"REGEX",index:j,value:z}),j=X;continue}O.push({type:"CHAR",index:j,value:$[j++]})}return O.push({type:"END",index:j,value:""}),O}f(H2,"lexer");function x2($,Z={}){let O=H2($);Z.delimiter??="/#?",Z.prefixes??="./";let j=`[^${w0(Z.delimiter)}]+?`,J=[],W=0,Y=0,z="",X=new Set,D=f((I)=>{if(Y<O.length&&O[Y].type===I)return O[Y++].value},"tryConsume"),T=f(()=>D("OTHER_MODIFIER")??D("ASTERISK"),"tryConsumeModifier"),F=f((I)=>{let S=D(I);if(S!==void 0)return S;let{type:P,index:V}=O[Y];throw TypeError(`Unexpected ${P} at ${V}, expected ${I}`)},"mustConsume"),G=f(()=>{let I="",S;for(;S=D("CHAR")??D("ESCAPED_CHAR");)I+=S;return I},"consumeText"),U=f((I)=>I,"DefaultEncodePart"),K=Z.encodePart||U,Q="",B=f((I)=>{Q+=I},"appendToPendingFixedValue"),M=f(()=>{Q.length&&(J.push(new FZ(3,"","",K(Q),"",3)),Q="")},"maybeAddPartFromPendingFixedValue"),L=f((I,S,P,V,C)=>{let _=3;switch(C){case"?":_=1;break;case"*":_=0;break;case"+":_=2;break}if(!S&&!P&&_===3){B(I);return}if(M(),!S&&!P){if(!I)return;J.push(new FZ(3,"","",K(I),"",_));return}let x;P?P==="*"?x=S2:x=P:x=j;let w=2;x===j?(w=1,x=""):x===S2&&(w=0,x="");let v;if(S?v=S:P&&(v=W++),X.has(v))throw TypeError(`Duplicate name '${v}'.`);X.add(v),J.push(new FZ(w,v,K(I),x,K(V),_))},"addPart");for(;Y<O.length;){let I=D("CHAR"),S=D("NAME"),P=D("REGEX");if(!S&&!P&&(P=D("ASTERISK")),S||P){let C=I??"";Z.prefixes.indexOf(C)===-1&&(B(C),C=""),M();let _=T();L(C,S,P,"",_);continue}let V=I??D("ESCAPED_CHAR");if(V){B(V);continue}if(D("OPEN")){let C=G(),_=D("NAME"),x=D("REGEX");!_&&!x&&(x=D("ASTERISK"));let w=G();F("CLOSE");let v=T();L(C,_,x,w,v);continue}M(),F("END")}return J}f(x2,"parse");function w0($){return $.replace(/([.+*?^${}()[\]|/\\])/g,"\\$1")}f(w0,"escapeString");function f2($){return $&&$.ignoreCase?"ui":"u"}f(f2,"flags");function I9($,Z,O){return A2(x2($,O),Z,O)}f(I9,"stringToRegexp");function V$($){switch($){case 0:return"*";case 1:return"?";case 2:return"+";case 3:return""}}f(V$,"modifierToString");function A2($,Z,O={}){O.delimiter??="/#?",O.prefixes??="./",O.sensitive??=!1,O.strict??=!1,O.end??=!0,O.start??=!0,O.endsWith="";let j=O.start?"^":"";for(let z of $){if(z.type===3){z.modifier===3?j+=w0(z.value):j+=`(?:${w0(z.value)})${V$(z.modifier)}`;continue}Z&&Z.push(z.name);let X=`[^${w0(O.delimiter)}]+?`,D=z.value;if(z.type===1?D=X:z.type===0&&(D=S2),!z.prefix.length&&!z.suffix.length){z.modifier===3||z.modifier===1?j+=`(${D})${V$(z.modifier)}`:j+=`((?:${D})${V$(z.modifier)})`;continue}if(z.modifier===3||z.modifier===1){j+=`(?:${w0(z.prefix)}(${D})${w0(z.suffix)})`,j+=V$(z.modifier);continue}j+=`(?:${w0(z.prefix)}`,j+=`((?:${D})(?:`,j+=w0(z.suffix),j+=w0(z.prefix),j+=`(?:${D}))*)${w0(z.suffix)})`,z.modifier===0&&(j+="?")}let J=`[${w0(O.endsWith)}]|$`,W=`[${w0(O.delimiter)}]`;if(O.end)return O.strict||(j+=`${W}?`),O.endsWith.length?j+=`(?=${J})`:j+="$",new RegExp(j,f2(O));O.strict||(j+=`(?:${W}(?=${J}))?`);let Y=!1;if($.length){let z=$[$.length-1];z.type===3&&z.modifier===3&&(Y=O.delimiter.indexOf(z)>-1)}return Y||(j+=`(?=${W}|${J})`),new RegExp(j,f2(O))}f(A2,"partsToRegexp");var i1={delimiter:"",prefixes:"",sensitive:!0,strict:!0},wT={delimiter:".",prefixes:"",sensitive:!0,strict:!0},kT={delimiter:"/",prefixes:"/",sensitive:!0,strict:!0};function N9($,Z){return $.length?$[0]==="/"?!0:!Z||$.length<2?!1:($[0]=="\\"||$[0]=="{")&&$[1]=="/":!1}f(N9,"isAbsolutePathname");function E2($,Z){return $.startsWith(Z)?$.substring(Z.length,$.length):$}f(E2,"maybeStripPrefix");function L9($,Z){return $.endsWith(Z)?$.substr(0,$.length-Z.length):$}f(L9,"maybeStripSuffix");function v2($){return!$||$.length<2?!1:$[0]==="["||($[0]==="\\"||$[0]==="{")&&$[1]==="["}f(v2,"treatAsIPv6Hostname");var _9=["ftp","file","http","https","ws","wss"];function R2($){if(!$)return!0;for(let Z of _9)if($.test(Z))return!0;return!1}f(R2,"isSpecialScheme");function S9($,Z){if($=E2($,"#"),Z||$==="")return $;let O=new URL("https://example.com");return O.hash=$,O.hash?O.hash.substring(1,O.hash.length):""}f(S9,"canonicalizeHash");function f9($,Z){if($=E2($,"?"),Z||$==="")return $;let O=new URL("https://example.com");return O.search=$,O.search?O.search.substring(1,O.search.length):""}f(f9,"canonicalizeSearch");function P9($,Z){return Z||$===""?$:v2($)?k2($):w2($)}f(P9,"canonicalizeHostname");function H9($,Z){if(Z||$==="")return $;let O=new URL("https://example.com");return O.password=$,O.password}f(H9,"canonicalizePassword");function x9($,Z){if(Z||$==="")return $;let O=new URL("https://example.com");return O.username=$,O.username}f(x9,"canonicalizeUsername");function A9($,Z,O){if(O||$==="")return $;if(Z&&!_9.includes(Z))return new URL(`${Z}:${$}`).pathname;let j=$[0]=="/";return $=new URL(j?$:"/-"+$,"https://example.com").pathname,j||($=$.substring(2,$.length)),$}f(A9,"canonicalizePathname");function E9($,Z,O){return b2(Z)===$&&($=""),O||$===""?$:q2($)}f(E9,"canonicalizePort");function v9($,Z){return $=L9($,":"),Z||$===""?$:aO($)}f(v9,"canonicalizeProtocol");function b2($){switch($){case"ws":case"http":return"80";case"wws":case"https":return"443";case"ftp":return"21";default:return""}}f(b2,"defaultPortForProtocol");function aO($){if($==="")return $;if(/^[-+.A-Za-z0-9]*$/.test($))return $.toLowerCase();throw TypeError(`Invalid protocol '${$}'.`)}f(aO,"protocolEncodeCallback");function R9($){if($==="")return $;let Z=new URL("https://example.com");return Z.username=$,Z.username}f(R9,"usernameEncodeCallback");function b9($){if($==="")return $;let Z=new URL("https://example.com");return Z.password=$,Z.password}f(b9,"passwordEncodeCallback");function w2($){if($==="")return $;if(/[\t\n\r #%/:<>?@[\]^\\|]/g.test($))throw TypeError(`Invalid hostname '${$}'`);let Z=new URL("https://example.com");return Z.hostname=$,Z.hostname}f(w2,"hostnameEncodeCallback");function k2($){if($==="")return $;if(/[^0-9a-fA-F[\]:]/g.test($))throw TypeError(`Invalid IPv6 hostname '${$}'`);return $.toLowerCase()}f(k2,"ipv6HostnameEncodeCallback");function q2($){if($===""||/^[0-9]*$/.test($)&&parseInt($)<=65535)return $;throw TypeError(`Invalid port '${$}'.`)}f(q2,"portEncodeCallback");function w9($){if($==="")return $;let Z=new URL("https://example.com");return Z.pathname=$[0]!=="/"?"/-"+$:$,$[0]!=="/"?Z.pathname.substring(2,Z.pathname.length):Z.pathname}f(w9,"standardURLPathnameEncodeCallback");function k9($){return $===""?$:new URL(`data:${$}`).pathname}f(k9,"pathURLPathnameEncodeCallback");function q9($){if($==="")return $;let Z=new URL("https://example.com");return Z.search=$,Z.search.substring(1,Z.search.length)}f(q9,"searchEncodeCallback");function g9($){if($==="")return $;let Z=new URL("https://example.com");return Z.hash=$,Z.hash.substring(1,Z.hash.length)}f(g9,"hashEncodeCallback");var y9=class{#J;#Z=[];#O={};#$=0;#W=1;#D=0;#z=0;#U=0;#K=0;#Q=!1;constructor($){this.#J=$}get result(){return this.#O}parse(){for(this.#Z=H2(this.#J,!0);this.#$<this.#Z.length;this.#$+=this.#W){if(this.#W=1,this.#Z[this.#$].type==="END"){if(this.#z===0){this.#M(),this.#T()?this.#j(9,1):this.#G()?this.#j(8,1):this.#j(7,0);continue}else if(this.#z===2){this.#F(5);continue}this.#j(10,0);break}if(this.#U>0)if(this.#P())this.#U-=1;else continue;if(this.#f()){this.#U+=1;continue}switch(this.#z){case 0:this.#I()&&this.#F(1);break;case 1:if(this.#I()){this.#A();let $=7,Z=1;this.#L()?($=2,Z=3):this.#Q&&($=2),this.#j($,Z)}break;case 2:this.#V()?this.#F(3):(this.#C()||this.#G()||this.#T())&&this.#F(5);break;case 3:this.#_()?this.#j(4,1):this.#V()&&this.#j(5,1);break;case 4:this.#V()&&this.#j(5,1);break;case 5:this.#H()?this.#K+=1:this.#x()&&(this.#K-=1),this.#S()&&!this.#K?this.#j(6,1):this.#C()?this.#j(7,0):this.#G()?this.#j(8,1):this.#T()&&this.#j(9,1);break;case 6:this.#C()?this.#j(7,0):this.#G()?this.#j(8,1):this.#T()&&this.#j(9,1);break;case 7:this.#G()?this.#j(8,1):this.#T()&&this.#j(9,1);break;case 8:this.#T()&&this.#j(9,1);break;case 9:break;case 10:break}}this.#O.hostname!==void 0&&this.#O.port===void 0&&(this.#O.port="")}#j($,Z){switch(this.#z){case 0:break;case 1:this.#O.protocol=this.#X();break;case 2:break;case 3:this.#O.username=this.#X();break;case 4:this.#O.password=this.#X();break;case 5:this.#O.hostname=this.#X();break;case 6:this.#O.port=this.#X();break;case 7:this.#O.pathname=this.#X();break;case 8:this.#O.search=this.#X();break;case 9:this.#O.hash=this.#X();break;case 10:break}this.#z!==0&&$!==10&&([1,2,3,4].includes(this.#z)&&[6,7,8,9].includes($)&&(this.#O.hostname??=""),[1,2,3,4,5,6].includes(this.#z)&&[8,9].includes($)&&(this.#O.pathname??=this.#Q?"/":""),[1,2,3,4,5,6,7].includes(this.#z)&&$===9&&(this.#O.search??="")),this.#N($,Z)}#N($,Z){this.#z=$,this.#D=this.#$+Z,this.#$+=Z,this.#W=0}#M(){this.#$=this.#D,this.#W=0}#F($){this.#M(),this.#z=$}#B($){return $<0&&($=this.#Z.length-$),$<this.#Z.length?this.#Z[$]:this.#Z[this.#Z.length-1]}#Y($,Z){let O=this.#B($);return O.value===Z&&(O.type==="CHAR"||O.type==="ESCAPED_CHAR"||O.type==="INVALID_CHAR")}#I(){return this.#Y(this.#$,":")}#L(){return this.#Y(this.#$+1,"/")&&this.#Y(this.#$+2,"/")}#V(){return this.#Y(this.#$,"@")}#_(){return this.#Y(this.#$,":")}#S(){return this.#Y(this.#$,":")}#C(){return this.#Y(this.#$,"/")}#G(){if(this.#Y(this.#$,"?"))return!0;if(this.#Z[this.#$].value!=="?")return!1;let $=this.#B(this.#$-1);return $.type!=="NAME"&&$.type!=="REGEX"&&$.type!=="CLOSE"&&$.type!=="ASTERISK"}#T(){return this.#Y(this.#$,"#")}#f(){return this.#Z[this.#$].type=="OPEN"}#P(){return this.#Z[this.#$].type=="CLOSE"}#H(){return this.#Y(this.#$,"[")}#x(){return this.#Y(this.#$,"]")}#X(){let $=this.#Z[this.#$],Z=this.#B(this.#D).index;return this.#J.substring(Z,$.index)}#A(){let $={};Object.assign($,i1),$.encodePart=aO;let Z=I9(this.#X(),void 0,$);this.#Q=R2(Z)}};f(y9,"Parser");var _2=["protocol","username","password","hostname","port","pathname","search","hash"],d1="*";function P2($,Z){if(typeof $!="string")throw TypeError("parameter 1 is not of type 'string'.");let O=new URL($,Z);return{protocol:O.protocol.substring(0,O.protocol.length-1),username:O.username,password:O.password,hostname:O.hostname,port:O.port,pathname:O.pathname,search:O.search!==""?O.search.substring(1,O.search.length):void 0,hash:O.hash!==""?O.hash.substring(1,O.hash.length):void 0}}f(P2,"extractValues");function Y1($,Z){return Z?GZ($):$}f(Y1,"processBaseURLString");function TZ($,Z,O){let j;if(typeof Z.baseURL=="string")try{j=new URL(Z.baseURL),Z.protocol===void 0&&($.protocol=Y1(j.protocol.substring(0,j.protocol.length-1),O)),!O&&Z.protocol===void 0&&Z.hostname===void 0&&Z.port===void 0&&Z.username===void 0&&($.username=Y1(j.username,O)),!O&&Z.protocol===void 0&&Z.hostname===void 0&&Z.port===void 0&&Z.username===void 0&&Z.password===void 0&&($.password=Y1(j.password,O)),Z.protocol===void 0&&Z.hostname===void 0&&($.hostname=Y1(j.hostname,O)),Z.protocol===void 0&&Z.hostname===void 0&&Z.port===void 0&&($.port=Y1(j.port,O)),Z.protocol===void 0&&Z.hostname===void 0&&Z.port===void 0&&Z.pathname===void 0&&($.pathname=Y1(j.pathname,O)),Z.protocol===void 0&&Z.hostname===void 0&&Z.port===void 0&&Z.pathname===void 0&&Z.search===void 0&&($.search=Y1(j.search.substring(1,j.search.length),O)),Z.protocol===void 0&&Z.hostname===void 0&&Z.port===void 0&&Z.pathname===void 0&&Z.search===void 0&&Z.hash===void 0&&($.hash=Y1(j.hash.substring(1,j.hash.length),O))}catch{throw TypeError(`invalid baseURL '${Z.baseURL}'.`)}if(typeof Z.protocol=="string"&&($.protocol=v9(Z.protocol,O)),typeof Z.username=="string"&&($.username=x9(Z.username,O)),typeof Z.password=="string"&&($.password=H9(Z.password,O)),typeof Z.hostname=="string"&&($.hostname=P9(Z.hostname,O)),typeof Z.port=="string"&&($.port=E9(Z.port,$.protocol,O)),typeof Z.pathname=="string"){if($.pathname=Z.pathname,j&&!N9($.pathname,O)){let J=j.pathname.lastIndexOf("/");J>=0&&($.pathname=Y1(j.pathname.substring(0,J+1),O)+$.pathname)}$.pathname=A9($.pathname,$.protocol,O)}return typeof Z.search=="string"&&($.search=f9(Z.search,O)),typeof Z.hash=="string"&&($.hash=S9(Z.hash,O)),$}f(TZ,"applyInit");function GZ($){return $.replace(/([+*?:{}()\\])/g,"\\$1")}f(GZ,"escapePatternString");function m9($){return $.replace(/([.+*?^${}()[\]|/\\])/g,"\\$1")}f(m9,"escapeRegexpString");function p9($,Z){Z.delimiter??="/#?",Z.prefixes??="./",Z.sensitive??=!1,Z.strict??=!1,Z.end??=!0,Z.start??=!0,Z.endsWith="";let O=".*",j=`[^${m9(Z.delimiter)}]+?`,J=/[$_\u200C\u200D\p{ID_Continue}]/u,W="";for(let Y=0;Y<$.length;++Y){let z=$[Y];if(z.type===3){if(z.modifier===3){W+=GZ(z.value);continue}W+=`{${GZ(z.value)}}${V$(z.modifier)}`;continue}let X=z.hasCustomName(),D=!!z.suffix.length||!!z.prefix.length&&(z.prefix.length!==1||!Z.prefixes.includes(z.prefix)),T=Y>0?$[Y-1]:null,F=Y<$.length-1?$[Y+1]:null;if(!D&&X&&z.type===1&&z.modifier===3&&F&&!F.prefix.length&&!F.suffix.length)if(F.type===3){let G=F.value.length>0?F.value[0]:"";D=J.test(G)}else D=!F.hasCustomName();if(!D&&!z.prefix.length&&T&&T.type===3){let G=T.value[T.value.length-1];D=Z.prefixes.includes(G)}D&&(W+="{"),W+=GZ(z.prefix),X&&(W+=`:${z.name}`),z.type===2?W+=`(${z.value})`:z.type===1?X||(W+=`(${j})`):z.type===0&&(!X&&(!T||T.type===3||T.modifier!==3||D||z.prefix!=="")?W+="*":W+=`(${O})`),z.type===1&&X&&z.suffix.length&&J.test(z.suffix[0])&&(W+="\\"),W+=GZ(z.suffix),D&&(W+="}"),z.modifier!==3&&(W+=V$(z.modifier))}return W}f(p9,"partsToPattern");var g2=class{#J;#Z={};#O={};#$={};#W={};#D=!1;constructor($={},Z,O){try{let j;if(typeof Z=="string"?j=Z:O=Z,typeof $=="string"){let z=new y9($);if(z.parse(),$=z.result,j===void 0&&typeof $.protocol!="string")throw TypeError("A base URL must be provided for a relative constructor string.");$.baseURL=j}else{if(!$||typeof $!="object")throw TypeError("parameter 1 is not of type 'string' and cannot convert to dictionary.");if(j)throw TypeError("parameter 1 is not of type 'string'.")}typeof O>"u"&&(O={ignoreCase:!1});let J={ignoreCase:O.ignoreCase===!0},W={pathname:d1,protocol:d1,username:d1,password:d1,hostname:d1,port:d1,search:d1,hash:d1};this.#J=TZ(W,$,!0),b2(this.#J.protocol)===this.#J.port&&(this.#J.port="");let Y;for(Y of _2){if(!(Y in this.#J))continue;let z={},X=this.#J[Y];switch(this.#O[Y]=[],Y){case"protocol":Object.assign(z,i1),z.encodePart=aO;break;case"username":Object.assign(z,i1),z.encodePart=R9;break;case"password":Object.assign(z,i1),z.encodePart=b9;break;case"hostname":Object.assign(z,wT),v2(X)?z.encodePart=k2:z.encodePart=w2;break;case"port":Object.assign(z,i1),z.encodePart=q2;break;case"pathname":R2(this.#Z.protocol)?(Object.assign(z,kT,J),z.encodePart=w9):(Object.assign(z,i1,J),z.encodePart=k9);break;case"search":Object.assign(z,i1,J),z.encodePart=q9;break;case"hash":Object.assign(z,i1,J),z.encodePart=g9;break}try{this.#W[Y]=x2(X,z),this.#Z[Y]=A2(this.#W[Y],this.#O[Y],z),this.#$[Y]=p9(this.#W[Y],z),this.#D=this.#D||this.#W[Y].some((D)=>D.type===2)}catch{throw TypeError(`invalid ${Y} pattern '${this.#J[Y]}'.`)}}}catch(j){throw TypeError(`Failed to construct 'URLPattern': ${j.message}`)}}get[Symbol.toStringTag](){return"URLPattern"}test($={},Z){let O={pathname:"",protocol:"",username:"",password:"",hostname:"",port:"",search:"",hash:""};if(typeof $!="string"&&Z)throw TypeError("parameter 1 is not of type 'string'.");if(typeof $>"u")return!1;try{typeof $=="object"?O=TZ(O,$,!1):O=TZ(O,P2($,Z),!1)}catch{return!1}let j;for(j of _2)if(!this.#Z[j].exec(O[j]))return!1;return!0}exec($={},Z){let O={pathname:"",protocol:"",username:"",password:"",hostname:"",port:"",search:"",hash:""};if(typeof $!="string"&&Z)throw TypeError("parameter 1 is not of type 'string'.");if(typeof $>"u")return;try{typeof $=="object"?O=TZ(O,$,!1):O=TZ(O,P2($,Z),!1)}catch{return null}let j={};Z?j.inputs=[$,Z]:j.inputs=[$];let J;for(J of _2){let W=this.#Z[J].exec(O[J]);if(!W)return null;let Y={};for(let[z,X]of this.#O[J].entries())if(typeof X=="string"||typeof X=="number"){let D=W[z+1];Y[X]=D}j[J]={input:O[J]??"",groups:Y}}return j}static compareComponent($,Z,O){let j=f((z,X)=>{for(let D of["type","modifier","prefix","value","suffix"]){if(z[D]<X[D])return-1;if(z[D]===X[D])continue;return 1}return 0},"comparePart"),J=new FZ(3,"","","","",3),W=new FZ(0,"","","","",3),Y=f((z,X)=>{let D=0;for(;D<Math.min(z.length,X.length);++D){let T=j(z[D],X[D]);if(T)return T}return z.length===X.length?0:j(z[D]??J,X[D]??J)},"comparePartList");return!Z.#$[$]&&!O.#$[$]?0:Z.#$[$]&&!O.#$[$]?Y(Z.#W[$],[W]):!Z.#$[$]&&O.#$[$]?Y([W],O.#W[$]):Y(Z.#W[$],O.#W[$])}get protocol(){return this.#$.protocol}get username(){return this.#$.username}get password(){return this.#$.password}get hostname(){return this.#$.hostname}get port(){return this.#$.port}get pathname(){return this.#$.pathname}get search(){return this.#$.search}get hash(){return this.#$.hash}get hasRegExpGroups(){return this.#D}};f(g2,"URLPattern");function U3($,Z){for(let[O,j]of Object.entries($)){let J=new g2({pathname:O});if(J.test({pathname:Z}))return{routePath:O,params:J.exec({pathname:Z})?.pathname.groups??{},route:j}}return null}var C$={startIndex:0,carriedViews:[]};function h9($,Z){let O=Y0($.path,Z);return O.includes("*")?null:O}function qT($,Z){if(!$)return C$;if($.search!==Z.search)return C$;let O=Math.min($.segments.length,Z.segments.length-1),j=0;while(j<O){let J=$.segments[j],W=Z.segments[j];if(W.alwaysRun)break;if(J.viewPath!==W.viewPath)break;let Y=h9(J,$.params),z=h9(W,Z.params);if(Y===null||z===null||Y!==z)break;j++}if(j===0)return C$;return{startIndex:j,carriedViews:Z.segments.slice(0,j).map(({viewPath:J})=>J)}}function gT($,Z){let[,O,...j]=$.split("/");if(!Z.includes(O))return $;let J=`/${j.join("/")}`;return J==="/"?"/":J.replace(/\/$/,"")}function c9($){let{flatViewRoutes:Z,supportedLocales:O,from:j,origin:J,to:W}=$;if(!j)return C$;let Y;try{Y=new URL(j,J)}catch{return C$}if(Y.origin!==J)return C$;let z=U3(Z,gT(Y.pathname,O));if(!z)return C$;return qT({segments:z.route.segments,params:z.params,search:Y.search},W)}var y2="x-gemi-from";import{createElement as CZ,Fragment as YG}from"react";function yT($){return $.replace(/\([^)]*\)/g,"").replace(/\/\//g,"/")}function oO($){let Z={};for(let[O,j]of Object.entries($))if("run"in j){let J=j.viewPath;if("children"in j){Z[O]=[J];let W=new j.children,Y=oO(W.routes);for(let[z,X]of Object.entries(Y)){let D=O==="/"?z:`${O}${z}`,T=z==="/"&&O!=="/"?O:D;Z[T]=[J,...X]}if(Z[O].length===1)delete Z[O]}else Z[O]=[J]}else{let J=new j,W=oO(J.routes);for(let[Y,z]of Object.entries(W)){let X=O==="/"?Y:`${O}${Y}`,D=Y==="/"&&O!=="/"?O:X;Z[D]=z}}return Object.fromEntries(Object.entries(Z).map(([O,j])=>[yT(O),j]))}function rO($,Z){let[O,j]=Z,J=$.find(([W])=>W===O);if(!J){$.push([O,[...j]]);return}for(let W of j)rO(J[1],W)}function tO($){let Z=[];for(let[O,j]of Object.entries($))if("run"in j){let J=j.viewPath;if(J==="__")continue;if(J==="REDIRECT")continue;if(J==="FILE")continue;if("children"in j){let W=new j.children,Y=tO(W.routes);rO(Z,[J,Y])}else rO(Z,[J,[]])}else{let J=new j,W=tO(J.routes);for(let Y of W)rO(Z,Y)}return Z}function m2($){let Z=[];for(let[O,j]of $)Z.push(O,...m2(j).flat());return Array.from(new Set(Z))}class u1 extends V0{static getFacadeAccessor(){return n}static getSupportedLocales(){return this.getFacadeRoot().supportedLocales}static getDefaultLocale(){return this.getFacadeRoot().defaultLocale}static locale(){let $=this.getFacadeRoot(),Z=H.getStore();if(Z)return Z.locale??$.detectLocale(Z.req);return $.defaultLocale}static timeZone(){return this.getFacadeRoot().detectTimeZone(H.getStore()?.req)}static formatter($={}){return this.getFacadeRoot().formatter($.locale??u1.locale(),$.timeZone??u1.timeZone())}static setLocale($=u1.locale()){let Z=this.getFacadeRoot(),O=$;if(!Z.supportedLocales.includes($))O=Z.defaultLocale;let j=H.getStore();return j.setCookie("i18n-locale",O,{expires:new Date(Date.now()+31536000000),secure:!1,httpOnly:!1}),j.setLocale(O),O}}class p2{id;static token="kernel.id";constructor($=crypto.randomUUID()){this.id=$}}var mT=new Set(["script","style","textarea","title","xmp","iframe","noembed","noframes","noscript"]),pT=new Set(["svg","math"]);function l9($){return $===32||$===9||$===10||$===12||$===13}function d9($){return $>=65&&$<=90||$>=97&&$<=122}function eO($){return $>=65&&$<=90?$+32:$}function i9(){let $="data",Z="",O=!1,j="",J=0,W=0,Y=!1,z=0,X=0,D=()=>$==="data"&&z===0&&X===0,T=()=>{if(!O&&mT.has(Z)){$="rawText",j=`</${Z}`,J=0,Z="";return}if($="data",Z==="template")if(O)z=Math.max(0,z-1);else z+=1;else if(pT.has(Z)){if(O)X=Math.max(0,X-1);else if(!Y)X+=1}Z=""},F=(G)=>{switch($){case"data":if(G===60)$="tagOpen";return;case"tagOpen":if(G===33)$="bang",W=0;else if(G===47)$="endTagOpen";else if(d9(G))$="tagName",O=!1,Y=!1,Z=String.fromCharCode(eO(G));else if(G===63)$="bogus";else if(G===60)$="tagOpen";else $="data";return;case"endTagOpen":if(d9(G))$="tagName",O=!0,Y=!1,Z=String.fromCharCode(eO(G));else if(G===62)$="data";else $="bogus";return;case"tagName":if(l9(G)||G===47)$="inTag",Y=G===47;else if(G===62)T();else Z+=String.fromCharCode(eO(G));return;case"inTag":if(G===62){T();return}if(Y=G===47,G===34)$="attrDouble";else if(G===39)$="attrSingle";return;case"attrDouble":if(G===34)$="inTag";Y=!1;return;case"attrSingle":if(G===39)$="inTag";Y=!1;return;case"bang":if(G===45){if(W+=1,W===2)$="comment",W=0}else if(G===62)$="data";else $="bogus";return;case"bogus":if(G===62)$="data";return;case"comment":if(G===45)W=W<2?W+1:2;else if(G===62&&W>=2)$="data",W=0;else W=0;return;case"rawText":{if(J<j.length){if(eO(G)===j.charCodeAt(J))J+=1;else J=G===60?1:0;return}if(G===62)$="data",Z="";else if(l9(G)||G===47)$="inTag",Z="";else J=G===60?1:0;return}}};return{scanToInsertionPoint(G){for(let U=0;U<G.length;U++){if(D())return U;F(G[U])}return G.length},write(G){for(let U=0;U<G.length;U++)F(G[U])},isSafe:D}}function M$($){let Z=JSON.stringify($);if(Z===void 0)return"undefined";return Z.replace(/</g,"\\u003c").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}function hT($){return`<script>(self.__GEMI_STREAM__=self.__GEMI_STREAM__||[]).push(${M$([$.path,$.variantKey,$.data])})</script>`}function cT($){return`<script>(self.__GEMI_DICT__=self.__GEMI_DICT__||[]).push(${M$([$.id,$.locale,$.strings])})</script>`}function h2($,Z,O={},j){let J=new TextEncoder,W=[],Y=!1,z=!1,X=()=>{if(z)return;z=!0,O.onClose?.()};Z.onSettle((K)=>{if(K.status!=="resolved")return;W.push(hT(K))}),j?.onUse((K)=>{W.push(cT(K))});let D=$.getReader(),T=i9(),F=(K,Q)=>{K.enqueue(Q),O.onChunk?.(Q)},G=(K)=>{while(W.length>0){let Q=J.encode(W.shift());T.write(Q),F(K,Q)}},U=(K,Q)=>{if(W.length===0){T.write(Q),F(K,Q);return}let B=T.scanToInsertionPoint(Q);if(B>0)F(K,Q.subarray(0,B));if(T.isSafe())G(K);let M=Q.subarray(B);if(M.length>0)T.write(M),F(K,M)};return new ReadableStream({async pull(K){let Q;try{Q=await D.read()}catch(L){throw X(),L}let{done:B,value:M}=Q;if(B){G(K),K.close(),X();return}if(!Y){if(Y=!0,T.write(M),F(K,M),O.onShell?.(),T.isSafe())G(K);return}U(K,M)},cancel(K){return X(),D.cancel(K)}})}var lT=/bot|crawler|spider|crawling|slurp|bingpreview|mediapartners|headless|lighthouse|prerender|facebookexternalhit|whatsapp|telegram|discord|twitterbot|linkedinbot/i;function $j($){if(!$)return!1;return lT.test($)}async function s9($,Z=()=>{}){let O=H.getStore(),j=O?.req??null,J=null;if(j?.rawRequest?.url)try{J=new URL(j.rawRequest.url).pathname}catch{J=null}return{user:O?.user??null,attributes:await dT($,Z),request:{path:J,routePath:j?.routePath??null,locale:O?.locale??null},anonymousId:u9(),isBot:$j(j?.rawRequest?.headers?.get("user-agent")??null),now:new Date}}function n9($){return{user:$.user??null,attributes:$.attributes??{},request:{path:null,routePath:null,locale:null},anonymousId:$.subjectId??null,isBot:!1,now:new Date}}async function dT($,Z){if(!$.context)return{};try{let O=H.getStore();return await $.context(O?.req??null)??{}}catch(O){return Z(`The \`context\` hook in app/config/features.ts threw; evaluating with no attributes. ${O instanceof Error?O.message:String(O)}`),{}}}function a9($,Z){return`${$}:${Z}`}function c2($){let Z=new Bun.CryptoHasher("sha1").update($).digest("hex"),O=Number.parseInt(Z.slice(0,8),16);return Math.floor(O/4294967296*1e4)}function o9($,Z){if(Z>=100)return!0;if(Z<=0)return!1;return $<Math.round(Z*100)}function r9($,Z,O,j){if(j.unavailable)return{value:!1,reason:"unavailable"};if(j.active!==!0)return{value:!1,reason:"inactive"};if(Z.when){let W;try{W=Z.when(O)}catch(Y){return j.warn?.(`The \`when\` for feature "${$}" threw; treating it as off. ${Y instanceof Error?Y.message:String(Y)}`),{value:!1,reason:"error"}}if(typeof W==="boolean")return{value:W,reason:"attributed"}}if(Z.rollout===void 0)return{value:!0,reason:"on"};if(O.isBot)return{value:!1,reason:"bot"};let J=uT($,Z,O,j.buckets);return o9(J,Z.rollout)?{value:!0,reason:"rollout"}:{value:!1,reason:"excluded"}}function iT($){let Z=$.user?.publicId??$.user?.id;if(Z!==void 0&&Z!==null)return String(Z);return $.anonymousId??""}function uT($,Z,O,j){let J=a9(Z.salt??$,iT(O));if(!j)return c2(J);let W=j.get(J);if(W!==void 0)return W;let Y=c2(J);return j.set(J,Y),Y}class t9 extends Error{cause;kind="FeatureReloadFailed";constructor($){super(`Could not reload feature switches after a write, so the cached switches may still predate it: ${$ instanceof Error?$.message:String($)}`);this.cause=$}}class l2{source;declared;ttlMs;warn;snapshot=null;inflight=null;lastFailureLoggedAt=0;generation=0;lastError=null;retryAfter=0;constructor($,Z,O,j=()=>{}){this.source=$;this.declared=Z;this.ttlMs=O;this.warn=j}async get(){let $=this.snapshot;if($&&Date.now()-$.loadedAt<this.ttlMs)return $;if($){if(Date.now()>=this.retryAfter)this.refresh().catch(()=>{});return $}return await this.refresh()}refresh(){return this.inflight??=this.load().finally(()=>{this.inflight=null}),this.inflight}async invalidate(){await this.inflight?.catch(()=>{});let $=this.generation,Z=await this.refresh();if(this.generation===$)throw new t9(this.lastError);return Z}peek(){return this.snapshot}async load(){try{let $=await this.source.load(),{active:Z,audit:O}=this.readRows($);return this.snapshot={active:Z,audit:O,loadedAt:Date.now(),unavailable:!1},this.generation++,this.lastError=null,this.retryAfter=0,this.snapshot}catch($){return this.handleFailure($)}}readRows($){let Z=new Map,O=new Map;for(let j of $??[]){let J=typeof j?.key==="string"?j.key:null;if(!J){this.warn("Ignoring a feature row with no `key`.");continue}if(!(J in this.declared)){this.warn(`Feature row "${J}" is not declared in app/features, so it is ignored. Delete the row, or declare the feature.`);continue}Z.set(J,j.active===!0);let W=sT(j);if(W)O.set(J,W)}return{active:Z,audit:O}}handleFailure($){let Z=$ instanceof Error?$.message:String($),O=Date.now();if(this.lastError=$,this.retryAfter=O+this.ttlMs,O-this.lastFailureLoggedAt>=this.ttlMs)this.lastFailureLoggedAt=O,this.warn(`Could not load feature switches: ${Z}`);if(this.snapshot)return this.snapshot;return this.snapshot={active:new Map,audit:new Map,loadedAt:O,unavailable:!0},this.snapshot}}function sT($){let Z={},O=$.updatedBy;if(typeof O==="string")Z.updatedBy=O;else if(O===null)Z.updatedBy=null;let j=$.updatedAt;if(j instanceof Date||typeof j==="string"||typeof j==="number"){let J=j instanceof Date?j:new Date(j);if(!Number.isNaN(J.getTime()))Z.updatedAt=J}return"updatedBy"in Z||"updatedAt"in Z?Z:null}class nT{}class aT extends Error{modelName;kind="FeatureModelMissing";constructor($){super(`No "${$}" model is registered, so every feature stays off. Add the model to prisma/schema.prisma and export it from app/models \u2014 see docs/feature-flags.md.`);this.modelName=$}}class d2 extends Error{sourceName;kind="FeatureSourceReadOnly";constructor($){super(`The feature source (${$}) is read-only, so Features.set() cannot write to it. Change the switch where that source reads from, or give the source a write() method.`);this.sourceName=$}}class e9 extends Error{key;kind="UndeclaredFeature";constructor($){super(`"${$}" is not declared in app/features, so it cannot be switched. A row for it would be ignored \u2014 declare the feature first.`);this.key=$}}class $5{manager;ctx;constructor($,Z){this.manager=$;this.ctx=Z}async enabled($){return(await this.explain($)).value}async explain($){return await this.manager.evaluateIn($,this.ctx,new Map)}async all(){return await this.manager.evaluateAllIn(this.ctx,new Map,{clientOnly:!1})}}class UZ{config;log;static token="features";store;declared;warnedAboutSize=!1;warnedAboutActor=!1;constructor($,Z=()=>{}){this.config=$;this.log=Z;this.declared=$.features??{},this.store=new l2($.source,this.declared,Math.max(0,$.ttl)*1000,this.log)}declarations(){return this.declared}async list(){let{active:$,audit:Z,unavailable:O}=await this.switches();return{unavailable:O,features:Object.entries(this.declared).map(([j,J])=>({key:j,describe:J.describe,rollout:J.rollout,targeted:J.when!==void 0,serverOnly:J.serverOnly,salt:J.salt,active:$.get(j),...Z.get(j)}))}}async refresh(){if(!this.config.enabled)return;if(Object.keys(this.declared).length===0)return;await this.store.refresh()}async invalidate(){try{if(this.config.enabled&&Object.keys(this.declared).length>0)await this.store.invalidate()}finally{H.getStore()?.featureEvaluations?.clear()}}async set($,Z,O={}){if(typeof $!=="string"||!Object.hasOwn(this.declared,$))throw new e9(String($));if(typeof Z!=="boolean")throw TypeError(`Features.set("${$}", \u2026) takes a boolean, not ${Z===null?"null":typeof Z}.`);let j=oT(O.actor),J=this.config.source;if(typeof J.write!=="function")throw new d2(J.constructor?.name||"an anonymous source");let{actorRecorded:W}=await J.write($,Z,{actor:j});if(j!==null&&!W&&!this.warnedAboutActor)this.warnedAboutActor=!0,this.log('Features.set() was given an actor, but the feature source has nowhere to record it. For the database source, add a nullable `updatedBy String?` column to the feature flag model to keep "last changed by".');await this.invalidate()}async enabled($){return(await this.explain($)).value}async explain($){let Z=await this.requestContext();return await this.evaluateIn($,Z,this.requestBuckets())}async all(){let $=await this.requestContext();return await this.evaluateAllIn($,this.requestBuckets(),{clientOnly:!1})}async forClient(){if(!this.config.enabled)return{};let $=await this.requestContext(),Z=await this.evaluateAllIn($,this.requestBuckets(),{clientOnly:!0});return this.warnIfOversized(Object.keys(Z).length),Z}for($){return new $5(this,n9($))}async evaluateIn($,Z,O){let j=this.memoFor(Z),J=j?.get($);if(J)return J;let W=this.declared[$];if(!W)return{value:!1,reason:"undeclared"};let{active:Y,unavailable:z}=await this.switchFor($),X=r9($,W,Z,{active:Y,unavailable:z,buckets:O,warn:this.log});return j?.set($,X),this.notify($,X,Z),X}async evaluateAllIn($,Z,O){let j={};for(let[J,W]of Object.entries(this.declared)){if(O.clientOnly&&W.serverOnly)continue;j[J]=(await this.evaluateIn(J,$,Z)).value}return j}async switches(){if(!this.config.enabled||Object.keys(this.declared).length===0)return{active:new Map,audit:new Map,unavailable:!1};let $=await this.store.get();return{active:$.active,audit:$.audit,unavailable:$.unavailable}}async switchFor($){if(!this.config.enabled)return{active:!1,unavailable:!1};let Z=await this.store.get();return{active:Z.active.get($),unavailable:Z.unavailable}}async requestContext(){let $=H.getStore();if($?.featureContext)return $.featureContext;let Z=await s9(this.config,this.log);if($)$.featureContext=Z;return Z}memoFor($){let Z=H.getStore();if(!Z||Z.featureContext!==$)return null;return Z.featureEvaluations??=new Map,Z.featureEvaluations}requestBuckets(){let $=H.getStore();if(!$)return new Map;return $.featureBuckets??=new Map,$.featureBuckets}notify($,Z,O){if(!this.config.onEvaluate)return;try{this.config.onEvaluate($,Z,O)}catch(j){this.log(`The \`onEvaluate\` hook in app/config/features.ts threw for "${$}". ${j instanceof Error?j.message:String(j)}`)}}warnIfOversized($){if(this.warnedAboutSize||$<=this.config.maxClientFlags)return;this.warnedAboutSize=!0,this.log(`${$} client-visible features are embedded in every document. Mark the ones only the server reads with \`serverOnly: true\` to keep them out of the payload.`)}}function oT($){if($===void 0||$===null)return null;if(typeof $==="string"){if($.length>0)return $}else if(typeof $==="object"){let{publicId:Z,id:O}=$;if(typeof Z==="string"&&Z.length>0)return Z;if(typeof O==="string"&&O.length>0||typeof O==="number")return String(O)}throw TypeError("Features.set() was given an `actor` that identifies nobody. Pass a string, or a user with a `publicId` or an `id`.")}function Z5($){return Object.fromEntries(Object.entries($).filter(([,Z])=>{return Z!==null&&Z!==void 0}))}var rT=50;class KZ{fetcher;entries=new Map;settleListener=null;failListener=null;shellAt=null;settledBacklog=[];shipped=new Set;requestStartedAt=performance.now();renderStartedAt=null;discoveryHintsMuted=!1;constructor($){this.fetcher=$}elapsed(){return Math.round(performance.now()-this.requestStartedAt)}keyFor($,Z){return[$,Z].filter((O)=>O.length>0).join("?")}markRenderStart(){if(this.renderStartedAt===null)this.renderStartedAt=performance.now()}markShell(){if(this.shellAt===null)this.shellAt=this.elapsed()}summarize($){let Z=this.elapsed();return{shellAt:this.shellAt??Z,settledAt:Z,aborted:$,queries:Array.from(this.entries.values(),(O)=>({path:O.path,variantKey:O.variantKey,startedAt:O.startedAt,settledAt:O.settledAt,status:O.status,source:O.source}))}}onQueryFail($){this.failListener=$}muteDiscoveryHints(){this.discoveryHintsMuted=!0}maybeLogLateDiscovery($){if(!$.lateBy||this.discoveryHintsMuted)return;if($.status!=="resolved")return;if(Bun.env.NODE_ENV==="production")return;let Z="";try{let J=JSON.stringify($.data)?.length??0;Z=J>=1024?`${(J/1024).toFixed(1)} kB`:`${J} B`}catch{Z="an unserializable payload"}let O=($.settledAt??0)-$.startedAt,j=$.variantKey?`, { search: ${JSON.stringify(Object.fromEntries(new URLSearchParams($.variantKey)))} }`:"";console.warn(`[gemi] useQuery("${$.patternPath}") was discovered ${$.lateBy}ms into the `+`server render \u2014 under a suspended segment, so its fetch (${O}ms, resolved ${Z}) could not overlap the others. It still streamed. If the query belongs on this route, \`Query.prefetch("${$.patternPath}"${j})\` in the view `+"handler starts it at request time \u2014 but note prefetched data is also re-fetched and "+`streamed into every client-side navigation payload for the route, even when the client already holds it, so weigh that bandwidth against the ${Z}. If the data is only needed conditionally (a closed popover, a hidden tab), \`{ lazy: true }\` + \`trigger()\` avoids running it here at all. \`Query.noPrefetch()\` in the handler marks the omission intentional and silences this hint for the route.`)}read($,Z){return this.entries.get(this.keyFor($,Z))}ensure($,Z={},O="render"){let j=Z.params??{},J=new URLSearchParams(Z5(Z.search??{}));J.delete("json"),J.sort();let W=Y0($,j),Y=J.toString(),z=this.keyFor(W,Y),X=this.entries.get(z);if(X)return X;let D;if(O==="render"&&this.renderStartedAt!==null){let U=Math.round(performance.now()-this.renderStartedAt);if(U>rT)D=U}let T,F=new Promise((U)=>{T=U}),G={path:W,patternPath:$,variantKey:Y,lateBy:D,status:"pending",promise:F,source:O,startedAt:this.elapsed()};return this.entries.set(z,G),this.fetcher($,j,J).then((U)=>{G.status="resolved",G.data=U},(U)=>{G.status="rejected",G.error=U}).then(()=>{if(G.settledAt=this.elapsed(),this.maybeLogLateDiscovery(G),G.status==="rejected"&&this.failListener)this.failListener(G);if(this.settleListener)this.settleListener(G);else this.settledBacklog.push(G);T()}),G}async allSettled(){let $=0;while($!==this.entries.size)$=this.entries.size,await Promise.all(Array.from(this.entries.values(),(Z)=>Z.promise))}snapshotResolved(){let $={};for(let[Z,O]of this.entries){if(O.status!=="resolved")continue;this.shipped.add(Z),$[O.path]??={},$[O.path][O.variantKey]=O.data}return $}onSettle($){this.settleListener=(O)=>{if(this.shipped.has(this.keyFor(O.path,O.variantKey)))return;$(O)};let Z=this.settledBacklog;this.settledBacklog=[];for(let O of Z)this.settleListener(O)}}class s1 extends Error{path;variantKey;status;body;retryAfter;constructor($,Z,O,j,J){super(typeof j?.message==="string"?j.message:`Request to /api${$} failed with status ${O}`);this.path=$;this.variantKey=Z;this.status=O;this.body=j;this.retryAfter=J;this.name="QueryError"}}function QZ(){let $=JSON.stringify({error:f1("permission","Forbidden",403)});return new Response($,{status:403,headers:{"Content-Type":"application/json","Content-Length":String(Buffer.byteLength($)),"Cache-Control":"no-store"}})}function i2(){return{status:403,error:{message:"Forbidden"}}}function K3($){let Z=BZ.getStore();return(O,j,J)=>{let W=new URL($.url).origin,Y=[Y0(O,j),J.toString()].filter((T)=>T.length>0).join("?"),z=new Request(`${W}/${Y}`,{headers:$.headers,signal:$.signal}),X=O5($);if(X)VZ(z,X);let D=new A(z,j);return BZ.run(Z,()=>H.run(D,async()=>{try{let T=await N(o0).dispatchers(X).api.getRouteData(O);if(H$(T)){if(!T.ok)throw new s1(Y0(O,j),J.toString(),T.status,T.body);return T.body}if(T instanceof Response){let F=await T.json().catch(()=>null);if(!T.ok)throw new s1(Y0(O,j),J.toString(),T.status,F);return F}return T}catch(T){if(T instanceof s1)throw T;let F=new s1(Y0(O,j),J.toString(),500,{message:T instanceof Error?T.message:String(T)});throw F.cause=T,F}}))}}var tT=new Set(["script","style","template","title"]),eT=/\shidden([\s=/]|$)/i,$G=/"[^"]*"|'[^']*'/g;function ZG($){let Z=0,O=0,j=0,J=0;while(J<$.length){let W=$.indexOf("<",J),Y=W===-1?$.length:W;if(Y>J){let F=$.slice(J,Y).replace(/\s+/g,"").length;if(j>0)O+=F;else Z+=F}if(W===-1)break;if($.startsWith("<!--",W)){let F=$.indexOf("-->",W+4);J=F===-1?$.length:F+3;continue}let z=$.indexOf(">",W);if(z===-1)break;let X=$.slice(W+1,z);J=z+1;let D=/^\/?([a-zA-Z][a-zA-Z0-9-]*)/.exec(X)?.[1]?.toLowerCase();if(!D)continue;let T=X.startsWith("/");if(!T&&tT.has(D)&&!X.endsWith("/")){let F=$.indexOf(`</${D}`,J);J=F===-1?$.length:F;continue}if(D!=="div")continue;if(T){if(j>0)j-=1}else if(j>0)j+=1;else if(eT.test(X.replace($G,'""')))j=1}return{shellChars:Z,deferredChars:O}}var OG=1000,jG=64;function JG($){return $>=1000?`${($/1000).toFixed(1)} kB`:`${$} chars`}function WG($,Z){if(Z.deferredChars<OG)return null;if(Z.shellChars>=jG)return null;return`[gemi] GET ${$} streams ${JG(Z.deferredChars)} of its `+`content behind reveal scripts \u2014 a no-JS visitor sees ~${Z.shellChars} chars. If this is a public/content route, add "no-stream" to its middleware.`}function j5($=console.warn){let Z=new Set;return{shouldObserve(O){return!Z.has(O)},report(O,j){if(Z.has(O))return;let J=WG(O,j);if(!J)return;Z.add(O),$(J)}}}function J5(){let $=new TextDecoder,Z="";return{onChunk(O){Z+=$.decode(O,{stream:!0})},measure(){return Z+=$.decode(),ZG(Z)}}}function W5($,Z,O=1e4,j){let J=new TextEncoder,W=()=>{};return new ReadableStream({start(Y){let z=!1,X=(T)=>{if(z)return;z=!0,clearTimeout(D);try{Y.close()}catch{}j?.({aborted:T})};W=X,Y.enqueue(J.encode(`${JSON.stringify($)}
3
- `)),Z.onSettle((T)=>{if(z||T.status!=="resolved")return;Y.enqueue(J.encode(`${JSON.stringify([T.path,T.variantKey,T.data])}
4
- `))});let D=setTimeout(()=>X(!0),O);Z.allSettled().then(()=>X(!1),()=>X(!1))},cancel(){W(!1)}})}var zG=async()=>(await import("./chunk-wedwkqe7.js")).default,u2,s2=async(...$)=>{return u2??=import("react-dom/server.browser").catch((Z)=>{throw u2=void 0,Z}),(await u2).renderToReadableStream(...$)},XG=1e4,DG=`
5
- !function(){try{var d=document.documentElement,c=d.classList;
6
- c.remove('light','dark');
7
- var e=localStorage.getItem('theme');
8
- if('system'===e||(!e&&'system'===defaultTheme)){
9
- var t='(prefers-color-scheme: dark)',m=window.matchMedia(t);
10
- if(m.media!==t||m.matches){d.style.colorScheme='dark';c.add('dark')}
11
- else{d.style.colorScheme='light';c.add('light')}
12
- }else if(e){
13
- c.add(e||'')
14
- }}catch(e){}}()
15
- `;async function TG($,Z,O){let j=`${O==="italic"?"italic,":""}wght@${O==="italic"?"1,":""}${Z}`,Y=(await(await fetch(`https://fonts.googleapis.com/css2?family=${$}:${j}&display=swap`,{headers:{"User-Agent":"Mozilla/5.0 Firefox/1.0"}})).text()).match(/url\(([^)]+)\)/)?.[1];return await fetch(Y).then((z)=>z.arrayBuffer())}var o2="/assets";function GG($){return $===o2||$.startsWith(`${o2}/`)}function FG($){let Z=$.filter(GG);if(Z.length>0){let O=Z.length>1;throw Error(`View route path${O?"s":""} ${Z.map((j)=>`"${j}"`).join(", ")} use${O?"":"s"} the reserved "${o2}" prefix. The client build output is served from there before the router runs, so the route would never match. Mount it somewhere else.`)}}function UG($){let Z=N(o0).resolver;return{...$.domain,root:Z.root,origin:Z.publicOrigin($.rawRequest)}}function n2($){let{status:Z=400,error:O}=$;return new Response(O?.message,{...$,status:Z})}function KG($){let{status:Z=400,data:O,directive:j,headers:J}=$;return new Response(JSON.stringify({data:O,directive:j}),{headers:J,status:Z})}class V3{static token="router.view";flatViewRoutes={};routeManifest={};clientRouteManifest={};componentTree=[];flatComponentTree=[];root=null;shellReporter=j5();preloadCache=new WeakMap;hooks;partialRendering;constructor($){let Z=B9();this.partialRendering=$.partialRendering??Z.partialRendering,this.hooks={onRequestStart:$.onRequestStart??Z.onRequestStart,onRequestEnd:$.onRequestEnd??Z.onRequestEnd,onRequestFail:$.onRequestFail??Z.onRequestFail,onStreamComplete:$.onStreamComplete??Z.onStreamComplete};let O={"/":$.rootRouter,"/auth":U2};this.flatViewRoutes=nO(O),FG(Object.keys(this.flatViewRoutes)),this.routeManifest=oO(O),this.clientRouteManifest=Object.fromEntries(Object.entries(this.routeManifest).filter(([,j])=>j.at(-1)!=="FILE")),this.componentTree=tO(O),this.flatComponentTree=m2(this.componentTree),this.root=$.root}async passesFeatureGates($){let Z=N(UZ);for(let O of $)if(!await Z.enabled(O))return!1;return!0}async onRequestEnd($){return a2(),await this.hooks.onRequestEnd($)}completeStream($,Z){let O=(j)=>{I$.error(j?.message??'Error in "onStreamComplete" event handler',{err:JSON.stringify(j)})};try{Promise.resolve(this.hooks.onStreamComplete($,Z)).catch(O)}catch(j){O(j)}}modulePreloadLinks($){let{clientEntry:Z,modulePreloadManifest:O,views:j,routeKey:J}=$,W=()=>{let X=new Set(Z?.preload??[]);for(let D of j)for(let T of O?.[D]??[])X.add(T);return[...X].map((D)=>CZ("link",{key:`modulepreload:${D}`,rel:"modulepreload",href:D}))};if(!O)return W();let Y=this.preloadCache.get(O);if(!Y||Y.clientEntry!==Z)Y={clientEntry:Z,byRoute:new Map},this.preloadCache.set(O,Y);let z=Y.byRoute.get(J);if(!z)z=W(),Y.byRoute.set(J,z);return z}async render($){let{req:Z,runInRequestScope:O,csrfTokenHMAC:j,currentPathName:J,headers:W,i18n:Y,params:z,pathname:X,serverQueries:D,userAgent:T,noStream:F,url:G,user:U,viewData:K,breadcrumbs:Q,urlLocaleSegment:B,meta:M,isOgRequest:L,appId:I,features:S}=$,P=X.replace(`/${B}`,""),V={kind:"view",data:{meta:M,pageData:{[P]:K},__csrf:j.toString("base64"),prefetchedData:{},i18n:Y,auth:{user:U},routeManifest:this.clientRouteManifest,breadcrumbs:Q,router:{urlLocaleSegment:B,pathname:J,params:z,currentPath:X,searchParams:G.search,is404:!J?!0:!1,domain:Z.domain?UG(Z):null},appId:I,features:S,componentTree:[["404",[]],...this.componentTree]},head:{}},C=this.root,_=this.routeManifest[J];return async(x)=>{let{bootstrapModules:w=[],loaders:v,getStyles:m,viewImportMap:s,cssManifest:zj,ogMap:C3,viewModules:M3,clientEntry:r0,modulePreloadManifest:n1,assetBase:L1}=x,W0=r0?[]:w,I3=(t)=>[t,`window.loaders=${v}`,...r0?[`import(${JSON.stringify(r0.module)}).catch(function(e){setTimeout(function(){throw e})})`]:[]].join(";");if(L){let t=null,_$=null;for(let S$ of _??[])if(typeof C3[S$]==="function")_$=S$,t=C3[S$];if(!t)return new Response("Not found",{status:404});let k5=Object.values(V.data.pageData)[0];try{await s2(CZ(t,k5[_$]),{onError:()=>{}})}catch(S$){let{fonts:q5,...g5}=S$.satoriOptions,y5=await Promise.all(q5.map((N3)=>{return TG(N3.name,N3.weight,N3.style).then((l5)=>({...N3,data:l5}))})),J4=new Headers(W);J4.set("Content-Type","image/png");let[m5,p5]=await Promise.all([zG(),uO("Rendering an OG image")]),h5=await m5(S$.jsx,{...g5,fonts:y5}),c5=await p5(Buffer.from(h5)).png({compressionLevel:0,effort:10}).toBuffer();return new Response(new Uint8Array(c5),{headers:J4})}return new Response("data")}if(V.data.cssManifest=zj,V.data.modulePreloadManifest=n1??{},L1&&L1!=="/")V.data.assetBase=L1;let Xj=this.modulePreloadLinks({clientEntry:r0,modulePreloadManifest:n1,views:_??["404"],routeKey:J??"404"}),N$=await m(_);V.data.prefetchedData=D.snapshotResolved(),D.markRenderStart();let X1=new AbortController,NZ=setTimeout(()=>X1.abort(),XG),L$=$j(T)||F,R=Bun.env.NODE_ENV!=="production"&&!L$&&J&&this.shellReporter.shouldObserve(J)?J5():null,k0=X5();try{let t=await s2(CZ(YG,{children:[...Xj,...N$,CZ("script",{key:"theme-script",dangerouslySetInnerHTML:{__html:DG}}),CZ(C,{data:V.data,viewImportMap:s,viewModules:M3,serverQueries:D,dictionarySink:k0,key:"root"})]}),{bootstrapScriptContent:I3(`window.__GEMI_DATA__ = ${M$(V.data)}`),bootstrapModules:W0,signal:X1.signal,...L$?{progressiveChunkSize:Number.MAX_SAFE_INTEGER}:{},onError(_$){if(Bun.env.NODE_ENV!=="production")console.error(_$)}});if(t.allReady.catch(()=>{}).finally(()=>clearTimeout(NZ)),L$)await t.allReady.catch(()=>{});return new Response(h2(t,D,{onShell:L$?void 0:()=>D.markShell(),onChunk:R?.onChunk,onClose:()=>O(()=>{if(this.completeStream(Z,D.summarize(X1.signal.aborted)),R)this.shellReporter.report(J,R.measure())})},k0),{status:!J?404:200,headers:W})}catch(t){if(clearTimeout(NZ),Bun.env.NODE_ENV==="production")throw O(()=>this.completeStream(Z,D.summarize(X1.signal.aborted))),t;let _$=await s2(CZ("div"),{bootstrapScriptContent:I3(`window.error= ${M$(t.message)}; window.stack_trace=${M$(t.stack)};window.__GEMI_DATA__ = ${M$(V.data)}`),bootstrapModules:Bun.env.NODE_ENV==="development"?["/render-error.js",...W0]:W0});return new Response(h2(_$,D,{onClose:()=>O(()=>this.completeStream(Z,D.summarize(X1.signal.aborted)))}),{status:!J?404:200,headers:W})}}}async handleViewRequest($,Z){let O=new URL($.url),j=O.pathname.endsWith(".json"),J=O.pathname.endsWith(".og"),W=O.pathname.replace(".json","").replace(".og",""),[,Y,...z]=W.split("/"),X=`/${z.join("/")}`,D=null,T=null,F=N(n);if(!F.supportedLocales.includes(Y))X=W;else D=Y,T=Y;let U=T===null&&U3(this.flatViewRoutes,X)!==null;if(F.isLocaleAware&&!J&&T===null&&!U){let V=Y5(Y,F.supportedLocales,F.defaultLocale);if(V){let C=z.length?`/${z.join("/")}`:"";return new Response("",{status:302,headers:{"Cache-Control":"private, no-cache, no-store, max-age=0, must-revalidate",Location:`/${V}${C}${j?".json":""}${O.search}`}})}}if(F.isLocaleAware&&!J){let V=N(n).detectLocale(new A($,{},"view",X));if(T===null&&V!==F.defaultLocale){let C=O.pathname==="/"?"":O.pathname;return new Response("",{status:302,headers:{"Cache-Control":"private, no-cache, no-store, max-age=0, must-revalidate",Location:`/${V}${C}${O.search}`}})}}X=X.replace("//","/");let K=[],Q=[],B=null,M={},L=null,I=!1,S=[];try{let V=U3(this.flatViewRoutes,X);if(V){if(B=V.routePath,M=V.params,K=V.route.exec,Q=V.route.middleware,S=V.route.features,I=Q.includes("no-stream"),j&&this.partialRendering){let C=$.headers.get(y2),_=c9({flatViewRoutes:this.flatViewRoutes,supportedLocales:N(n).supportedLocales,from:C,origin:O.origin,to:{segments:V.route.segments,params:M,search:O.search}});if(_.startIndex>0)K=K.slice(_.startIndex),L={from:C,carriedViews:_.carriedViews}}}}catch(V){throw V}let P=new A($,M,"view",B);return this.hooks.onRequestStart(P),await H.run(P,async()=>{let V=null,C=H.getStore(),_=BZ.getStore(),x=(m)=>BZ.run(_,()=>H.runWith(C,m));C.serverQueries=new KZ(K3($));let w=new Set;if(C.serverQueries.onQueryFail((m)=>{w.add(m.error);try{x(()=>Promise.resolve(this.hooks.onRequestFail(v,m.error)).catch(()=>{}))}catch{}}),T){let m=T.replaceAll("/","");u1.setLocale(m)}else u1.setLocale();let v=C.req;a2();try{let m=!1;try{await N(DZ).runMiddleware(Q)}catch(R){if(!MZ(R))throw R;m=!0}if(m||S.length>0&&!await this.passesFeatureGates(S))B=null,K=[],v.routePath="";let s=N(n),zj=s.isEnabled,C3=s.isLocaleAware,M3=new A($,v.params),r0={defaultLocale:s.defaultLocale,timeZone:s.detectTimeZone(M3)};if(C3){let R=null;if(T)R=T.replaceAll("/",""),C.setLocale(R);else R=s.detectLocale(M3),C.setLocale(R);let k0=zj?s.getPageTranslations(R,v.routePath):{};r0={...r0,supportedLocales:s.supportedLocales,currentLocale:R,dictionary:{[R]:k0},defaultLocale:s.defaultLocale}}await z5(r0.currentLocale??"");let n1;try{n1=await Promise.all(K.map((R)=>R(v)))}catch(R){if(!MZ(R))throw R;B=null,K=[],v.routePath="",n1=[]}let{cookies:L1,headers:W0}=C;V={data:n1,cookies:L1,headers:W0,user:C.user,prefetchedData:C.serverQueries.snapshotResolved(),currentPathName:B,params:v.params,urlLocaleSegment:D,meta:C.renderMeta(),appId:N(p2).id,features:await N(UZ).forClient()};let{params:I3,user:Xj}=V,N$={},X1={};for(let R of n1??[]){let[k0,t]=Object.entries(R)?.[0]??[];if(!k0||!t)continue;X1[`${k0}:${B}`]=t.breadcrumb,N$[k0]=t}let NZ=N$.FILE;if(NZ){for(let R of L1)W0.append("Set-Cookie",R.toString());try{await this.onRequestEnd(v)}catch(R){I$.error(R?.message??'Error in "onRequestEnd" event handler',{err:JSON.stringify(R)})}return await Ij(NZ,W0)}if(j){W0.set("Content-Type","application/x-ndjson; charset=utf-8"),W0.append("Vary",y2),L1.forEach((k0)=>W0.append("Set-Cookie",k0.toString())),await this.hooks.onRequestEnd(v);let R={meta:L&&!C.metadata.touched?null:V.meta,data:{[X]:N$},breadcrumbs:X1,prefetchedData:C.serverQueries.snapshotResolved(),i18n:r0,features:V.features,is404:!B,appId:V.appId,partial:L};return new Response(W5(R,C.serverQueries,void 0,({aborted:k0})=>x(()=>this.completeStream(v,C.serverQueries.summarize(k0)))),{headers:W0})}if(W0.set("Content-Type","text/html; charset=utf-8"),!I)W0.append("Vary","User-Agent");for(let R of L1)W0.append("Set-Cookie",R.toString());let L$=Bun.CSRF.generate(process.env.SECRET);W0.append("Set-Cookie",`csrf_token=${L$}; HttpOnly; Secure; SameSite=Strict; Expires=${new Date(Date.now()+86400000).toUTCString()}`);try{await this.onRequestEnd(v)}catch(R){I$.error(R?.message??'Error in "onRequestEnd" event handler',{err:JSON.stringify(R)})}return await this.render({req:v,runInRequestScope:x,csrfTokenHMAC:Buffer.from(""),currentPathName:B,headers:W0,i18n:r0,params:I3,pathname:O.pathname,serverQueries:C.serverQueries,userAgent:$.headers.get("user-agent"),noStream:I,url:O,user:Xj,viewData:N$,breadcrumbs:X1,urlLocaleSegment:D,meta:V.meta,appId:V.appId,features:V.features,isOgRequest:J})}catch(m){if(m.kind===Q3)if(j)return KG(m.payload.viewData??m.payload.api);else return n2(m.payload.view);if(!w.has(m))this.hooks.onRequestFail(v,m);if(B3(m))return console.error(m),j?QZ():n2(i2());if(m instanceof s1&&m.status===403)return j?QZ():n2(i2());throw m}},Z)}}function t2(){let $=JSON.stringify({error:f1("not_found","Not found",404)});return new Response($,{status:404,headers:{"Content-Type":"application/json","Content-Length":String(Buffer.byteLength($)),"Cache-Control":"no-store"}})}class K5 extends H0{routes={"/api-routes":this.get(()=>{let $=N(Zj).flatRoutes,Z=[];for(let[O,j]of Object.entries($))for(let[J,W]of Object.entries(j)){let{exec:Y,middleware:z}=W;Z.push({path:O,method:J,middleware:z})}return Z}),"/view-routes":this.get(()=>{let $=N(V3).flatViewRoutes,Z=[];for(let[O,{middleware:j,viewPath:J}]of Object.entries($))Z.push({path:O,method:"GET",viewPath:J,middleware:j});return Z})}}var QG=new Set([S1,"cookie","content-type","content-length","transfer-encoding","connection","host","user-agent","forwarded"]),BG=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,VG=/^[\x21\x23-\x2B\x2D-\x3A\x3C-\x5B\x5D-\x7E]*$/;function CG($,Z,O){for(let[j,J]of Object.entries(O.headers??{})){if(J===void 0||J===null)continue;let W=j.toLowerCase();if(QG.has(W)||W.startsWith("x-forwarded-"))throw Error(`dispatchAs: credentials may not set the "${j}" header. The access token stays the initiator's, and the request's framing is dispatchAs's own.`);$.set(j,J)}for(let[j,J]of Object.entries(O.cookies??{})){if(J===void 0||J===null)continue;if(j===S1)throw Error(`dispatchAs: credentials may not set the "${S1}" cookie. The access token stays the initiator's.`);if(!BG.test(j)||!VG.test(J))throw Error(`dispatchAs: "${j}" is not a cookie a Cookie header can carry.`);Z.push(`${j}=${J}`)}}function MG($,Z){let O=$.body.getReader(),j=!1,J=()=>{if(j)return;j=!0;try{Z()}catch(Y){console.error(Y)}},W=new ReadableStream({async pull(Y){let z;try{z=await O.read()}catch(X){J(),Y.error(X);return}if(z.done){J();try{Y.close()}catch{}return}try{Y.enqueue(z.value)}catch{}},async cancel(Y){try{await O.cancel(Y)}finally{J()}}},{highWaterMark:0});return new Response(W,{status:$.status,statusText:$.statusText,headers:$.headers})}function D5($){let{status:Z=400,data:O,headers:j}=$,J=new Headers({"Content-Type":"application/json",...j});if(!J.has("Cache-Control"))J.set("Cache-Control","no-store");return new Response(JSON.stringify(O),{status:Z,headers:J})}function T5($,Z,O){let j=[];Z?.forEach((Y,z)=>j.push([z,Y]));let J=[...typeof Z?.getSetCookie==="function"?Z.getSetCookie():[],...Array.from(O??[])];if(j.length===0&&J.length===0)return $;let W=(Y)=>{for(let[z,X]of j){if(z.toLowerCase()==="set-cookie")continue;if(!Y.has(z))Y.set(z,X)}for(let z of J)Y.append("Set-Cookie",z)};try{return W($.headers),$}catch{let Y=new Headers($.headers);return W(Y),new Response($.body,{status:$.status,statusText:$.statusText,headers:Y})}}class Zj{static token="router.api";flatRoutes={};onRequestStart;onRequestEnd;onRequestFail;constructor($){let Z=Q9();this.onRequestStart=$.onRequestStart??Z.onRequestStart,this.onRequestEnd=$.onRequestEnd??Z.onRequestEnd,this.onRequestFail=$.onRequestFail??Z.onRequestFail,this.flatRoutes=I2({"/":$.rootRouter,"/auth":K2,"/__gemi__/services/i18n":Q2,"/__gemi__/services/logs":M2,"/__gemi__/services/image":C2,"/__gemi__/debug":K5})}getRouteHandlerAndParams($){let Z=new URL($.url),O=U5(Z.pathname),j={},J;for(let[W]of Object.entries(this.flatRoutes))try{let Y=new URLPattern({pathname:W});if(Y.test({pathname:O})){J=W,j=Y.exec({pathname:O})?.pathname.groups;break}}catch(Y){console.error(Y)}return{params:j,path:J}}async runRouteMiddleware($,Z){let j=this.flatRoutes[$][Z.rawRequest.method].middleware;try{await N(DZ).runMiddleware(j)}catch(J){if(J.kind===Q3)return D5(J.payload.api);else{if(MZ(J))return t2();if(this.onRequestFail(Z,J),console.error(J),B3(J))return QZ();throw J}}}async getRouteData($){let Z=this.flatRoutes[$],O=H.getStore(),j=Z[O.req.rawRequest.method].exec??(()=>Promise.resolve({})),J={};try{J=await j()}catch(W){if(W.kind===Q3)return D5(W.payload.api);if(MZ(W))return t2();if(this.onRequestFail(O.req,W),console.error(W),B3(W))return QZ();throw W}return J}isFrameworkRoute($){return $.startsWith("/__gemi__")}async endRequest($,Z,O){let j=async()=>{try{if(!this.isFrameworkRoute(O))await this.onRequestEnd(Z)}catch(J){I$.error(J?.message??'Error in "onRequestEnd" event handler',{err:JSON.stringify(J)})}finally{$.destroy()}};if(!$.hasPendingWork()){await j();return}$.whenIdle().then(j).catch((J)=>{console.error(J)})}isOpenEndedBody($,Z){return $.method!=="HEAD"&&!Z.headers.has("Content-Length")&&Z.body!==null}async handleApiRequest($,Z){let{params:O,path:j}=this.getRouteHandlerAndParams($),J=this.flatRoutes[j];if(!J||!J[$.method])return new Response(JSON.stringify({error:f1("not_found","Not found",404)}),{status:404});let W=new A($,O,"api",j);if(!this.isFrameworkRoute(j))this.onRequestStart(W);return await H.run(W,async()=>{let Y=H.getStore(),z=!1,X=async()=>{z=!0,await this.endRequest(Y,W,j)};try{let D=N(n);if(D.isEnabled){let Q=D.detectLocale(W);Y.setLocale(Q)}Y.setRequest(W),N(DZ).applyDefaultBodyLimit($);let T=await this.runRouteMiddleware(j,W);if(T instanceof Response){let Q=T5(T,Y.headers,Y.cookies);return await X(),Q}let F=await this.getRouteData(j),G=Y.headers,U=Y.cookies;if(F instanceof Response){let Q=T5(F,G,U);if(this.isOpenEndedBody($,Q)){let B=MG(Q,()=>this.endRequest(Y,W,j));return z=!0,B}return await X(),Q}let K=(H$(F)?F:a1.json(F)).toResponse(G,U);return await X(),K}catch(D){if(!z)try{await X()}catch(T){console.error(T)}throw D}},Z)}async dispatchAs($,Z,O,j,J){let W=new URL($.rawRequest.url).origin,Y=new URL(`${W}/api${O}`),z=`/api${O.split(/[?#]/)[0]}`;if(!O.startsWith("/")||Y.origin!==W||Y.pathname!==z||Y.hash!==""||Y.pathname.startsWith("/api/__gemi__")||Y.pathname==="/api/auth"||Y.pathname.startsWith("/api/auth/"))throw Error(`dispatchAs: "${O}" is not an app api path. Pass the route's own path, without "/api", with every param encoded.`);let X=new Headers,D=[],T=$.cookies.get(S1);if(T)D.push(`${S1}=${T}`);if(J?.credentials)CG(X,D,J.credentials);if(D.length>0)X.set("Cookie",D.join("; "));let F=$.headers.get(S1);if(F)X.set(S1,F);let G=$.headers.get("User-Agent");if(G)X.set("User-Agent",G);let U;if(j instanceof FormData)U=j;else if(j!==void 0)X.set("Content-Type","application/json"),U=JSON.stringify(j);let K=new Request(Y,{method:Z,headers:X,body:U});if(G5(K,A$($)),$.domain)VZ(K,$.domain);return H.exit(()=>F5.exit(()=>this.handleApiRequest(K)))}}import{timingSafeEqual as IG}from"crypto";var jj="",Z4="*",NG=60000,LG=1e4,e2=/^[a-z0-9]([a-z0-9-]*[a-z0-9])?$/,Oj=16,Q5=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,$4="x-forwarded-host";function B5($){return $.startsWith(":")}function O4($,Z){if($===null)return!1;let O=Buffer.from($,"utf8"),j=Buffer.from(Z,"utf8");return O.length===j.length&&IG(O,j)}function _G($){if(!$)return null;if($===!0)return{header:$4,secret:null};return{header:($.hostHeader??$4).toLowerCase(),secret:$.secret?{header:$.secret.header.toLowerCase(),value:$.secret.value}:null}}function SG($){if(!$||$===!0)return;let{hostHeader:Z,secret:O}=$;if(Z!==void 0&&(typeof Z!=="string"||!Q5.test(Z)))throw Error(`\`route.domains.trustProxy.hostHeader\` must be a single header name, e.g. "x-forwarded-host". Got ${JSON.stringify(Z)}.`);if(!O)return;if(typeof O.header!=="string"||!Q5.test(O.header))throw Error(`\`route.domains.trustProxy.secret.header\` must be a header name. Got "${O.header}".`);if(O.header.toLowerCase()===(Z??$4).toLowerCase())throw Error("`route.domains.trustProxy.secret.header` names the same header as `hostHeader`; the secret needs a header of its own.");if(typeof O.value!=="string"||O.value.length<Oj)throw Error(`\`route.domains.trustProxy.secret.value\` must be at least ${Oj} characters. A guessable one lets any client name its own host.`)}function z1($){if(!$)return null;try{return new URL(`http://${$.trim()}`).hostname.toLowerCase().replace(/\.$/,"")||null}catch{return null}}function fG($){try{let Z=new URL(`http://${$.trim()}`),O=Z.hostname.toLowerCase().replace(/\.$/,"");return O?Z.port?`${O}:${Z.port}`:O:null}catch{return null}}function PG($){let Z=z1($.root),O=$.root?.trim().toLowerCase().replace(/\.$/,"");if(!Z||Z!==O||!Z.split(".").every((W)=>e2.test(W)))throw Error(`\`route.domains.root\` must be a bare hostname, e.g. "example.com" \u2014 no scheme, port or path. Got "${$.root}".`);if($.custom&&($.custom.cacheTtlMs??0)<0)throw Error(`\`route.domains.custom.cacheTtlMs\` is ${$.custom.cacheTtlMs}; it cannot be negative. Use 0 to disable the cache.`);if($.ask&&$.ask.secret.length<Oj)throw Error(`\`route.domains.ask.secret\` must be at least ${Oj} characters. A guessable one is worse than leaving \`ask\` out.`);SG($.trustProxy);let j=new Set,J=null;for(let W of $.groups??[]){let{subdomain:Y}=W;if(j.has(Y))throw Error(`\`route.domains\` declares the subdomain "${Y}" twice.`);if(j.add(Y),B5(Y)){if(!/^:[A-Za-z_][A-Za-z0-9_]*$/.test(Y))throw Error(`"${Y}" is not a valid param subdomain. It must be a single \`:name\` label.`);if(J)throw Error(`\`route.domains\` declares two param subdomains, "${J.subdomain}" and "${Y}"; a host could match either.`);J=W;continue}if(W.exists)throw Error(`The subdomain "${Y}" is fixed, so \`exists\` has no param to check. It only applies to a \`:param\` subdomain.`);if(!Y.split(".").every((z)=>e2.test(z)))throw Error(`"${Y}" is not a valid subdomain.`)}if($.custom&&!j.has($.custom.group))throw Error(`\`route.domains.custom.group\` is "${$.custom.group}", but no group declares that subdomain.`);if($.ask&&J&&!J.exists)throw Error(`\`route.domains.ask\` is set, so "${J.subdomain}" needs an \`exists\` to say which tenants are real. Without one every host under the root would be approved for a certificate.`)}class j4{root;hostTrust;fixed=new Map;param=null;custom;cacheTtlMs;cache=new Map;inFlight=new Map;askSecret;proxySecretHeader;constructor($){PG($),this.root=z1($.root),this.hostTrust=_G($.trustProxy);for(let Z of $.groups??[])if(B5(Z.subdomain))this.param={...Z,name:Z.subdomain.slice(1)};else this.fixed.set(Z.subdomain.toLowerCase(),Z);this.custom=$.custom??null,this.cacheTtlMs=this.custom?.cacheTtlMs??NG,this.askSecret=$.ask?.secret??null,this.proxySecretHeader=this.hostTrust?.secret?.header??null}forwardedHost($){let Z=this.hostTrust;if(!Z)return null;if(Z.secret&&!O4($.headers.get(Z.secret.header),Z.secret.value))return null;return $.headers.get(Z.header)?.split(",")[0]?.trim()||null}hostOf($){return z1(this.forwardedHost($))??z1(new URL($.url).host)}publicOrigin($){let Z=new URL($.url),O=$.headers.get("x-forwarded-proto")?.split(",")[0]?.trim(),j=O==="http"||O==="https"?O:Z.protocol.replace(/:$/,""),J=this.forwardedHost($),W=J&&z1(J)?fG(J):null;return`${j}://${W??Z.host}`}async resolve($){let Z=this.hostOf($);if(!Z)return null;let O=await this.match(Z,$);if(O)return O;if(this.custom?.fallback&&!this.isUnderRoot(Z))return{host:Z,group:Z4,params:{},custom:!0};return null}async allows($,Z){let O=z1($);return O?await this.match(O,Z)!==null:!1}isUnderRoot($){return $===this.root||$.endsWith(`.${this.root}`)}async match($,Z){if($===this.root)return{host:$,group:jj,params:{},custom:!1};if($.endsWith(`.${this.root}`)){let j=$.slice(0,-(this.root.length+1)),J=this.fixed.get(j);if(J)return{host:$,group:J.subdomain,params:{},custom:!1};if(this.param&&e2.test(j)){let W={[this.param.name]:j};if(this.param.exists&&!await this.param.exists(W,Z))return null;return{host:$,group:this.param.subdomain,params:W,custom:!1}}return null}if(!this.custom)return null;let O=await this.resolveCustom($);return O?{host:$,group:this.custom.group,params:O,custom:!0}:null}async resolveCustom($){let Z=Date.now(),O=this.cache.get($);if(O&&O.expiresAt>Z)return this.cache.delete($),this.cache.set($,O),O.value;let j=this.inFlight.get($);if(j)return j;let J=(async()=>await this.custom.resolve($)??null)();this.inFlight.set($,J);let W;try{W=await J}finally{this.inFlight.delete($)}if(this.cacheTtlMs>0){if(this.cache.size>=LG)this.cache.delete(this.cache.keys().next().value);this.cache.delete($),this.cache.set($,{value:W,expiresAt:Date.now()+this.cacheTtlMs})}return W}forget($){if($===void 0)this.cache.clear();else{let Z=z1($);if(Z)this.cache.delete(Z)}}}var HG="/__gemi__/domains/ask";class o0{static token="router.domains";resolver;acceptsCustomDomains;groups=new Map;constructor($,Z){this.groups.set(jj,$);let{domains:O}=Z;if(this.acceptsCustomDomains=Boolean(O?.custom),!O){this.resolver=null;return}this.resolver=new j4(O);let j=(J)=>({api:J.api?new Zj({...Z.api,...J.api}):$.api,view:J.view?new V3({...Z.view,...J.view}):$.view});for(let J of O.groups??[])this.groups.set(J.subdomain,j(J));if(O.custom?.fallback)this.groups.set(Z4,j(O.custom.fallback))}async route($){if(!this.resolver)return this.dispatchers(null);if(this.resolver.proxySecretHeader)V5($,this.resolver.proxySecretHeader);let Z=await this.resolver.resolve($);if(!Z)return null;return VZ($,Z),this.dispatchers(Z)}async ask($){if(!this.resolver?.askSecret||$.method!=="GET")return null;let Z=new URL($.url);if(Z.pathname!==HG)return null;if(!O4(Z.searchParams.get("secret"),this.resolver.askSecret))return null;let O=Z.searchParams.get("domain"),j=O?await this.resolver.allows(O,$):!1;return new Response(null,{status:j?200:404})}dispatchers($){return this.groups.get($?.group??jj)}viewDispatchers(){return Array.from(new Set(Array.from(this.groups.values(),($)=>$.view)))}}function Jj($){let Z=new Date($??0).getTime();return Number.isFinite(Z)?Z:0}var C5=600000;function M5($,Z){return[E3($,Z),E3($,Z-1)]}class E{static token="auth";config;provider;constructor($={},Z=new qj){this.config={...I5(jJ($),$),emailCode:wj($.emailCode)},this.provider=Z}get userProvider(){return this.provider}accessTokenCookieOptions($,Z){return{expires:Z,secure:this.publicOrigin($).startsWith("https://"),httpOnly:!0,domain:this.cookieDomain($)}}publicOrigin($){let Z=N().bound(o0)?N(o0).resolver:null;return Z?Z.publicOrigin($.rawRequest):new URL($.rawRequest.url).origin}cookieDomain($){let Z=this.config.cookieDomain;if(!Z)return;let O=Z==="root"?N(o0).resolver?.root:z1(Z);if(!O)throw Error('`auth.cookieDomain` is "root", but `route.domains` is not configured.');let j=$.domain?.host??z1(new URL($.rawRequest.url).host);return j===O||j?.endsWith(`.${O}`)?O:void 0}async getSession($,Z){if(!$)return null;if(!Hj($))return this.config.migrateLegacySession?this.convertLegacySession($,Z,this.config.migrateLegacySession):null;let O=await this.userProvider.findSession({token:$,userAgent:Z});if(!O?.user)return null;let j=Date.now(),J=Jj(O.expiresAt),W=Jj(O.absoluteExpiresAt);if(J<=j||W<=j)return await this.userProvider.deleteSession({token:$}),null;let z=await this.slideSession(O,j);return z.user.extension=await this.config.extendSession(z.user),z}async convertLegacySession($,Z,O){let j=H.getStore()?.req;if(!j)return null;let J=Date.now(),W=Math.floor(J/C5),Y=null,z=await this.userProvider.findSession({token:$,userAgent:Z});if(z?.user){if(!await O(z,{token:$,req:j,userAgent:Z}))return null;let D=E3($,W),T=z.user.id;if(await this.userProvider.withLegacySessionLock($,async()=>{if(!await this.userProvider.claimLegacySession({token:$}))return!1;return await this.userProvider.createSessionV2({token:D,userId:T,userAgent:Z,...this.freshLifetime(J)}),!0}))Y=D}if(!Y){for(let D of M5($,W))if((await this.userProvider.findSession({token:D,userAgent:Z}))?.user){Y=D;break}}if(!Y)return null;let X=await this.getSession(Y,Z);if(X)j.ctx().setCookie("access_token",Y,this.accessTokenCookieOptions(j,new Date(X.expiresAt)));return X}async revokeSession($,Z){if(!$)return await this.userProvider.deleteSession({token:$}),null;if(Hj($)||!this.config.migrateLegacySession){let J=await this.userProvider.findSession({token:$,userAgent:Z});return await this.userProvider.deleteSession({token:$}),J}let O=Math.floor(Date.now()/C5),j=M5($,O);return this.userProvider.withLegacySessionLock($,async()=>{let J=await this.userProvider.findSession({token:$,userAgent:Z});for(let W of j){if(J?.user)break;J=await this.userProvider.findSession({token:W,userAgent:Z})}await this.userProvider.deleteSession({token:$});for(let W of j)await this.userProvider.deleteSession({token:W});return J})}requestCarryingCookie($){let Z=H.getStore()?.req;return Z?.cookies.get("access_token")===$?Z:null}async slideSession($,Z){let O=this.config.sessionExpiresInHours*3600000;if(new Date($.expiresAt).getTime()-Z>=O/2)return $;let j=new Date(Math.min(Z+O,new Date($.absoluteExpiresAt).getTime())),J=await this.userProvider.updateSession({token:$.token,expiresAt:j}),W=this.requestCarryingCookie($.token);if(W)W.ctx().setCookie("access_token",$.token,this.accessTokenCookieOptions(W,j));if(!J)return $;return{...$,expiresAt:J.expiresAt??j}}freshLifetime($){return{expiresAt:new Date($+this.config.sessionExpiresInHours*3600000),absoluteExpiresAt:new Date($+this.config.sessionAbsoluteExpiresInHours*3600000)}}async generateMagicLink($){}async upsertSession($){await this.userProvider.findSession({token:"",userAgent:""})}async authenticate($){try{let Z=await this.userProvider.findUserByEmailAddress($,!1);if(!Z)throw Error(`User not found with email: ${$}`);let O=await this.createOrUpdateSession({email:$,id:Z.id}),j=new A;if(j.ctx().setCookie("access_token",O.token,this.accessTokenCookieOptions(j,O.expiresAt)),O?.user)O.user.extension=await this.config.extendSession(O.user);return O}catch(Z){console.log(Z)}}async createOrUpdateSessionV2($){let Z=await this.createOrUpdateSession($),O=null;if(Z?.user)O=await this.config.extendSession(Z.user),Z.user.extension=O;return Z}async createOrUpdateSession($){let Z=new A,O=$.id??(await this.userProvider.findUserByEmailAddress($.email,!1))?.id;if(!O)throw new o1;let j=Bun.env.NODE_ENV==="development"?"local":Z.headers.get("User-Agent"),J=u4(O),W=await this.userProvider.createSessionV2({token:J,userId:O,userAgent:j,...this.freshLifetime(Date.now())}),Y=await this.userProvider.findSession({token:J,userAgent:j??""});return Y?.user?Y:W}async createMagicLinkToken($){let Z=await this.userProvider.findUserByEmailAddress($,!1);if(Z){let{pin:O,token:j}=await this.issueOneTimeCode($,6);return{user:Z,email:$,pin:O,token:j}}return{}}async issueOneTimeCode($,Z){await this.userProvider.deleteMagicLinkToken($);let O=await this.config.generateMagicLinkToken($),j=await this.config.generateCode($),J=typeof j==="string"&&j!==""?j:e4(Z);return await this.userProvider.createMagicLinkToken({email:$,token:v3("link",$,O),pin:v3("pin",$,J)}),{email:$,pin:J,token:O}}async verifyOneTimeCode($,Z,O={}){let{expiresInMinutes:j,maxAttempts:J}=this.config.emailCode,W=await this.userProvider.findMagicLinkTokenByEmail($);if(!W)return bZ("pin",$,null,Z),{status:"invalid"};let Y=Jj(W.createdAt);if(Y+j*60000<=Date.now())return bZ("pin",$,null,Z),{status:"expired"};if(!await OJ(W.id,Y,J,j))return await this.userProvider.claimMagicLinkToken(W.id),{status:"too_many_attempts"};if(!bZ("pin",$,W.pin,Z))return{status:"invalid"};if(O.claim!==!1&&!await this.userProvider.claimMagicLinkToken(W.id))return{status:"invalid"};return{status:"ok",row:W}}async verifyMagicLinkToken($,Z){let O=await this.userProvider.findMagicLinkTokenByEmail($),j=bZ("link",$,O?.token,Z);if(!O||!j)return!1;if(Jj(O.createdAt)+this.config.emailCode.linkExpiresInMinutes*60000<=Date.now())return!1;return await this.userProvider.claimMagicLinkToken(O.id)}}class B$ extends V0{static getFacadeAccessor(){return E}static async user(){let $=H.getStore(),Z=$?.user;if(!Z){if(Z=await H3(this.getFacadeRoot(),$?.req),Z)$?.setUser(Z)}if(Z)return Z;throw new o1({redirectTo:P3($?.req,this.getFacadeRoot().config.signInPath)})}static intendedUrl($){let Z=H.getStore()?.req;return fZ(Z?.search.get(x$),$??this.getFacadeRoot().config.redirectPath)}static async guard($){let Z=await B$.user();if(!await $(Z))throw new fj}static async guardSafe($){let Z=await B$.user();try{return await $(Z)}catch(O){return!1}}static async authenticate($){return await this.getFacadeRoot().authenticate($)}static async createMagicLink($){return await this.getFacadeRoot().createMagicLinkToken($)}}class Wj{static ensure($,Z={}){let O=H.getStore();if(O.req.kind==="api")throw Error("Query.prefetch() cannot be called from an API request");return O.serverQueries??=new KZ(K3(O.req.rawRequest)),O.serverQueries.ensure($,Z,"prefetch")}static async instant($,...Z){let O=Wj.ensure($,Z[0]);if(await O.promise,O.status==="rejected")throw O.error;return O.data}static prefetch($,...Z){Wj.ensure($,Z[0])}static noPrefetch(){let $=H.getStore();if($.req.kind==="api")throw Error("Query.noPrefetch() cannot be called from an API request");$.serverQueries??=new KZ(K3($.req.rawRequest)),$.serverQueries.muteDiscoveryHints()}}function N5($,Z,O="/"){let j=new URL($.origin),J=Z.host?Z.host:Z.subdomain?`${Z.subdomain}.${$.root}`:$.root,W=new URL(O.startsWith("/")?O:`/${O}`,j),Y=xG(J);if(!Y)throw Error(`"${J}" is not a hostname, so there is no URL for it. Give a bare host, optionally with a port \u2014 no scheme, path or credentials.`);if(W.hostname=Y.hostname,Y.port)W.port=Y.port;return W.toString()}function xG($){try{let Z=new URL(`http://${$.trim()}`);return Z.host===$.trim().toLowerCase()&&Z.pathname==="/"?{hostname:Z.hostname,port:Z.port}:null}catch{return null}}class L5{static absolute($,...Z){return`${process.env.HOST_NAME}${Y0(String($),Z[0]??{})}`}static relative($,...Z){return Y0(String($),Z[0]??{})}static forDomain($,Z,...O){let j=N(o0).resolver;if(!j)throw Error("`Url.forDomain` needs `route.domains` to be configured.");let J=H.getStore()?.req?.rawRequest,W=J?j.publicOrigin(J):process.env.HOST_NAME;if(!W)throw Error("`Url.forDomain` outside a request needs `HOST_NAME` for the protocol.");return N5({root:j.root,origin:W},$,Y0(String(Z),O[0]??{}))}}class _5{name="Meta";static description($){H.getStore().metadata.description($)}static title($){H.getStore().metadata.title($)}static openGraph($){H.getStore().metadata.openGraph($)}}var AG={set($,Z,O){H.getStore().setCookie($,Z,O)},setIfAbsent($,Z,O){if(H.getStore().req.cookies.has($))return!1;return H.getStore().setCookie($,Z,O),!0},delete($,Z){H.getStore().deleteCookie($,Z)}};class N1 extends V0{static getFacadeAccessor(){return S5}static get client(){return this.getFacadeRoot().client}static get($){return N1.client.get($)}static set($,Z){return N1.client.set($,Z)}static del(...$){return N1.client.del(...$)}static exists($){return N1.client.exists($)}static incr($){return N1.client.incr($)}static expire($,Z){return N1.client.expire($,Z)}static ttl($){return N1.client.ttl($)}}class f5 extends V0{static getFacadeAccessor(){return t0}static consume($,Z={}){return this.getFacadeRoot().consume($,Z)}}class H5 extends V0{static getFacadeAccessor(){return P5}static run($,Z,O){return this.getFacadeRoot().run($,Z,O)}static acquire($,Z={}){return this.getFacadeRoot().acquire($,Z)}}class x5 extends V0{static getFacadeAccessor(){return UZ}static enabled($){return this.getFacadeRoot().enabled($)}static all(){return this.getFacadeRoot().forClient()}static explain($){return this.getFacadeRoot().explain($)}static for($){return this.getFacadeRoot().for($)}static list(){return this.getFacadeRoot().list()}static set($,Z,O){return this.getFacadeRoot().set($,Z,O)}static refresh(){return this.getFacadeRoot().refresh()}static invalidate(){return this.getFacadeRoot().invalidate()}}class Yj{bound;constructor($){this.bound=$}get name(){return this.bound??qZ()}get sql(){return this.connection().sql}get dialect(){return this.connection().dialect}async query($){return await this.run($,"query")}async execute($){let Z=await this.run($,"execute");return Number(Z?.count??0)}async transaction($){let Z=this.name,O=this.connection(Z);return v5(O.sql,(j)=>A5(Z,()=>$(j)),{slowTransactionThreshold:O.config.slowTransactionThreshold,connection:Z})}async schema(){let $=this.connection(),{introspect:Z}=await import("./chunk-2xqrh6d0.js");return Z(this.handle()??$.sql,$.dialect)}run($,Z){let O=this.connection(),{text:j,values:J}=b5($,R5(O.dialect),Z);return(this.handle()??O.sql).unsafe(j,J)}handle(){let $=kZ();if($===void 0)return;return qZ()===this.name?$:void 0}connection($=this.name){return E5($),N(gZ).connection($)}}var IZ=new Yj;class w5 extends V0{static getFacadeAccessor(){return gZ}static connection($){return new Yj($)}static get sql(){return IZ.sql}static get dialect(){return IZ.dialect}static query($){return IZ.query($)}static execute($){return IZ.execute($)}static transaction($){return IZ.transaction($)}static schema(){return IZ.schema()}static close(){return this.getFacadeRoot().close()}}export{D1 as ic,LZ as jc,Fj as kc,P$ as lc,SZ as mc,H0 as nc,Vj as oc,Cj as pc,C4 as qc,f3 as rc,a1 as sc,t5 as tc,Ij as uc,_1 as vc,C0 as wc,e5 as xc,$7 as yc,Pj as zc,Hj as Ac,u4 as Bc,t0 as Cc,PZ as Dc,R4 as Ec,A$ as Fc,s4 as Gc,n4 as Hc,Aj as Ic,Ej as Jc,v3 as Kc,bZ as Lc,tU as Mc,jJ as Nc,y7 as Oc,qj as Pc,B$ as Qc,u1 as Rc,Wj as Sc,L5 as Tc,_5 as Uc,AG as Vc,N1 as Wc,f5 as Xc,H5 as Yc,a9 as Zc,c2 as _c,o9 as $c,r9 as ad,iT as bd,t9 as cd,l2 as dd,nT as ed,aT as fd,d2 as gd,e9 as hd,$5 as id,UZ as jd,x5 as kd,Yj as ld,w5 as md,B2 as nd,V2 as od,pK as pd,F9 as qd,U9 as rd,x3 as sd,DZ as td,OQ as ud,Q9 as vd,B9 as wd,p2 as xd,QZ as yd,i2 as zd,o2 as Ad,GG as Bd,n2 as Cd,KG as Dd,V3 as Ed,t2 as Fd,D5 as Gd,T5 as Hd,Zj as Id,o0 as Jd,E as Kd,P4 as Ld,H4 as Md,x4 as Nd,k4 as Od,q4 as Pd,g4 as Qd,E$ as Rd,T0 as Sd,G1 as Td,R$ as Ud,P1 as Vd,b$ as Wd,w$ as Xd,k$ as Yd,AZ as Zd,EZ as _d,H1 as $d,RZ as ae,c4 as be};
16
-
17
- //# debugId=CF64A10B2526C2DA64756E2164756E21