@shumai-one/shumai 0.3.9 → 0.3.10

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 (171) hide show
  1. package/bin/{chunk-q3y6kdkh.js → chunk-02tqxzgz.js} +2 -2
  2. package/bin/chunk-09c03qdg.js +2 -0
  3. package/bin/{chunk-p65avrcv.js → chunk-0fpgfrv8.js} +2 -2
  4. package/bin/{chunk-fbqr4v70.js → chunk-0hbqkcsd.js} +1 -1
  5. package/bin/{chunk-zafjhkkk.js → chunk-0qcp4v52.js} +1 -1
  6. package/bin/chunk-0te5kcy3.js +2 -0
  7. package/bin/chunk-15zbprbe.js +1 -0
  8. package/bin/{chunk-ptmxkptc.js → chunk-1ev668rp.js} +2 -2
  9. package/bin/{chunk-z7m6sa7g.js → chunk-1qd83phd.js} +1 -1
  10. package/bin/{chunk-mwrheqe3.js → chunk-1whn0v5n.js} +1 -1
  11. package/bin/{chunk-s78r8f5v.js → chunk-28axgckk.js} +1 -1
  12. package/bin/{chunk-r0c9vmfm.js → chunk-2mxqjx3x.js} +1 -1
  13. package/bin/{chunk-x6ta6e2v.js → chunk-2sk6e4q0.js} +1 -1
  14. package/bin/{chunk-awaf0g5z.js → chunk-2sp0gkaw.js} +2 -2
  15. package/bin/{chunk-fhd9yadg.js → chunk-2t2wjzme.js} +2 -2
  16. package/bin/chunk-301pewt3.js +1 -0
  17. package/bin/chunk-33hax7fe.js +66 -0
  18. package/bin/{chunk-9fc118ea.js → chunk-34f4hk54.js} +2 -2
  19. package/bin/{chunk-331s5eb9.js → chunk-39s0cxq1.js} +2 -2
  20. package/bin/{chunk-c32x8x6z.js → chunk-41de755j.js} +1 -1
  21. package/bin/{chunk-naaa5ejw.js → chunk-42et2rqa.js} +2 -2
  22. package/bin/{chunk-pfwt5734.js → chunk-42f9r1sg.js} +2 -2
  23. package/bin/chunk-484yr1a7.js +1 -0
  24. package/bin/{chunk-jx9tqjh9.js → chunk-4shqnfq1.js} +1 -1
  25. package/bin/{chunk-h7jb1xb4.js → chunk-60xawsa6.js} +2 -2
  26. package/bin/chunk-62ag2nfa.js +2 -0
  27. package/bin/chunk-63emv4q3.js +1 -0
  28. package/bin/chunk-6529sh41.js +2 -0
  29. package/bin/{chunk-4yp5add5.js → chunk-661mcdxj.js} +2 -2
  30. package/bin/{chunk-n3997tqa.js → chunk-69sf7kb1.js} +1 -1
  31. package/bin/{chunk-0kfcfd0x.js → chunk-6gx6gdnk.js} +2 -2
  32. package/bin/chunk-6w395tfy.js +2 -0
  33. package/bin/chunk-7735r8d7.js +1 -0
  34. package/bin/{chunk-tx42kfdh.js → chunk-7m07t899.js} +1 -1
  35. package/bin/{chunk-dt9wfyf2.js → chunk-7r6h3fta.js} +2 -2
  36. package/bin/{chunk-5657zj59.js → chunk-7xwmj4ew.js} +1 -1
  37. package/bin/{chunk-vf6mpxrd.js → chunk-8r2agmv2.js} +2 -2
  38. package/bin/{chunk-dntwxkyf.js → chunk-8zmk029n.js} +1 -1
  39. package/bin/{chunk-hx2y4d75.js → chunk-90jcmarf.js} +2 -2
  40. package/bin/{chunk-7wh2mr72.js → chunk-94fyesf6.js} +1 -1
  41. package/bin/chunk-94yxj3yy.js +2 -0
  42. package/bin/{chunk-zwny8t7c.js → chunk-9rhckjgf.js} +1 -1
  43. package/bin/chunk-9ykcjdsv.js +3 -0
  44. package/bin/chunk-9yn5r2hh.js +2 -0
  45. package/bin/chunk-a80aab0f.js +2 -0
  46. package/bin/{chunk-rq6bvf0t.js → chunk-ag0pavv1.js} +1 -1
  47. package/bin/{chunk-6ja68bbj.js → chunk-at5ksmqs.js} +1 -1
  48. package/bin/{chunk-11j7ejan.js → chunk-bv5mh0e0.js} +3 -3
  49. package/bin/{chunk-7w01v7bw.js → chunk-bxexm2hd.js} +3 -3
  50. package/bin/{chunk-5ex69zt3.js → chunk-cc9fftnv.js} +2 -2
  51. package/bin/{chunk-r7crhkhn.js → chunk-ch25gq27.js} +2 -2
  52. package/bin/chunk-csky7q56.js +2 -0
  53. package/bin/{chunk-z71h48pj.js → chunk-d4ktgq49.js} +1 -1
  54. package/bin/{chunk-jvn0xnj8.js → chunk-day61cfg.js} +2 -2
  55. package/bin/{chunk-03ec6p4p.js → chunk-dgvcraag.js} +2 -2
  56. package/bin/{chunk-va9hwggw.js → chunk-e26p9vrv.js} +1 -1
  57. package/bin/{chunk-f37ywvvp.js → chunk-emyax05s.js} +1 -1
  58. package/bin/{chunk-3h4t28zz.js → chunk-enq1hf8g.js} +2 -2
  59. package/bin/{chunk-mffjg6zb.js → chunk-f03whbny.js} +2 -2
  60. package/bin/{chunk-vtm39m0n.js → chunk-fk9pd7ra.js} +1 -1
  61. package/bin/{chunk-8hex1hjk.js → chunk-fscyvjzb.js} +2 -2
  62. package/bin/{chunk-nw1ch5d8.js → chunk-g2bkj92r.js} +2 -2
  63. package/bin/chunk-g5qfxnz1.js +2 -0
  64. package/bin/{chunk-5efr8prc.js → chunk-g6aq2cyq.js} +1 -1
  65. package/bin/chunk-gh6j1nsm.js +1 -0
  66. package/bin/{chunk-wjk0f9fq.js → chunk-gra1fhdp.js} +2 -2
  67. package/bin/{chunk-79wjyt2p.js → chunk-gtenq4kq.js} +1 -1
  68. package/bin/chunk-h5jre78a.js +2 -0
  69. package/bin/{chunk-wth2f791.js → chunk-hcaw54dj.js} +2 -2
  70. package/bin/{chunk-8qryr65z.js → chunk-hsemzjvr.js} +2 -2
  71. package/bin/chunk-hte6gd36.js +1 -0
  72. package/bin/{chunk-vwayy6dy.js → chunk-j6dea33m.js} +3 -3
  73. package/bin/{chunk-bdwtaj3w.js → chunk-j99cr9mz.js} +2 -2
  74. package/bin/chunk-jn805ccq.js +1 -0
  75. package/bin/{chunk-tfwtxwth.js → chunk-k2w676wz.js} +2 -2
  76. package/bin/{chunk-ej18j83b.js → chunk-k33qdrdp.js} +1 -1
  77. package/bin/chunk-kmhkhcy6.js +68 -0
  78. package/bin/chunk-kp4kn4b4.js +2 -0
  79. package/bin/{chunk-9s1fdecm.js → chunk-m3ghgqc2.js} +1 -1
  80. package/bin/chunk-m84qgdyj.js +2 -0
  81. package/bin/{chunk-jt7fdhke.js → chunk-mk5hqjjd.js} +1 -1
  82. package/bin/{chunk-p2wyyvfa.js → chunk-mnhg12fm.js} +2 -2
  83. package/bin/{chunk-nc9hbzad.js → chunk-n3vzdzdw.js} +2 -2
  84. package/bin/{chunk-a6s80m0k.js → chunk-nw03w9pa.js} +1 -1
  85. package/bin/{chunk-7a4347xe.js → chunk-p31qe5mc.js} +2 -2
  86. package/bin/chunk-p48npmbh.js +2 -0
  87. package/bin/{chunk-6ts9djn2.js → chunk-p9w4ar11.js} +1 -1
  88. package/bin/chunk-pbztc6kv.js +1 -0
  89. package/bin/{chunk-v2dksv7p.js → chunk-pg55qp08.js} +2 -2
  90. package/bin/{chunk-agvb6bpw.js → chunk-pv4scagf.js} +1 -1
  91. package/bin/chunk-q0hrd0yw.js +2 -0
  92. package/bin/{chunk-wy82m4nq.js → chunk-qev7trtm.js} +2 -2
  93. package/bin/chunk-qk9npww4.js +2 -0
  94. package/bin/{chunk-zq665ybs.js → chunk-qphebjbv.js} +1 -1
  95. package/bin/{chunk-qp1hkx9k.js → chunk-rakz3pe6.js} +2 -2
  96. package/bin/chunk-rjga1vn2.js +2 -0
  97. package/bin/chunk-rt8yqz51.js +1 -0
  98. package/bin/chunk-s542e1y0.js +1 -0
  99. package/bin/{chunk-0rydta2q.js → chunk-s6e91ky2.js} +1 -1
  100. package/bin/{chunk-w4e52ade.js → chunk-s9s9hhet.js} +1 -1
  101. package/bin/{chunk-39j992fb.js → chunk-s9yzt7s3.js} +2 -2
  102. package/bin/chunk-sjsn35mp.js +1 -0
  103. package/bin/{chunk-0x6zt5yg.js → chunk-stggq92k.js} +1 -1
  104. package/bin/{chunk-zvq0btde.js → chunk-t16qt2ka.js} +3 -3
  105. package/bin/chunk-tc5evq8x.js +2 -0
  106. package/bin/chunk-tjrdsmdw.js +1 -0
  107. package/bin/{chunk-tk362keq.js → chunk-tkh0s7hg.js} +2 -2
  108. package/bin/{chunk-nn753fbs.js → chunk-tsym31yb.js} +2 -2
  109. package/bin/{chunk-a2m63585.js → chunk-v1ybpqrz.js} +1 -1
  110. package/bin/chunk-vbkwteh4.js +1 -0
  111. package/bin/chunk-vevscfh2.js +2 -0
  112. package/bin/chunk-vg33qt6z.js +11 -0
  113. package/bin/{chunk-wzw7rrfy.js → chunk-vgwjg37a.js} +2 -2
  114. package/bin/chunk-vwz2pa54.js +2 -0
  115. package/bin/chunk-we3vdyhb.js +1 -0
  116. package/bin/chunk-whn6dvak.js +1 -0
  117. package/bin/{chunk-j4byth37.js → chunk-wwjqqqr4.js} +1 -1
  118. package/bin/{chunk-mv4v52ah.js → chunk-xext4yvc.js} +1 -1
  119. package/bin/chunk-xr1wr22v.css +1 -0
  120. package/bin/chunk-xvpttxen.js +7 -0
  121. package/bin/chunk-y45tzhdn.js +2 -0
  122. package/bin/{chunk-c4yr75hy.js → chunk-y5ptk39s.js} +2 -2
  123. package/bin/{chunk-ytgtf0ak.js → chunk-y7b5gy17.js} +1 -1
  124. package/bin/{chunk-zcxajg6j.js → chunk-y8ffp5zj.js} +2 -2
  125. package/bin/chunk-yfgwknpa.js +78 -0
  126. package/bin/{chunk-yvknqnkb.js → chunk-z7b132c0.js} +2 -2
  127. package/bin/{chunk-v5c6t1w3.js → chunk-zdmcc6ps.js} +2 -2
  128. package/bin/shumai-app.html +1 -1
  129. package/bin/shumai-app.js +485 -291
  130. package/package.json +7 -7
  131. package/prisma/migrations/20260819091331_add_kanban_schema/migration.sql +164 -0
  132. package/prisma/migrations/20260821102514_add_kanban_notifications/migration.sql +26 -0
  133. package/prisma/migrations/20260821133500_add_c_collation_to_kanban_sort_index/migration.sql +10 -0
  134. package/prisma/migrations/20260822020609_add_kanban_task_assets/migration.sql +17 -0
  135. package/prisma/migrations/20260822071734_remove_kanban_task_cancelled_status/migration.sql +28 -0
  136. package/prisma/schema.prisma +187 -0
  137. package/bin/chunk-0h1yw3eq.js +0 -1
  138. package/bin/chunk-1eqdvehm.js +0 -2
  139. package/bin/chunk-2ckj039r.js +0 -2
  140. package/bin/chunk-2wcfw38x.js +0 -1
  141. package/bin/chunk-4st1t79p.js +0 -2
  142. package/bin/chunk-5ctpz542.js +0 -78
  143. package/bin/chunk-7t9c532y.js +0 -1
  144. package/bin/chunk-7zvv37z0.js +0 -7
  145. package/bin/chunk-9vjkb4vh.js +0 -1
  146. package/bin/chunk-ar79dg9g.js +0 -2
  147. package/bin/chunk-b0kh9jpt.js +0 -1
  148. package/bin/chunk-d5v9nz51.js +0 -1
  149. package/bin/chunk-ddt5224b.js +0 -2
  150. package/bin/chunk-eekmnfn4.js +0 -2
  151. package/bin/chunk-ff8zrme6.js +0 -1
  152. package/bin/chunk-g2qeb32y.js +0 -2
  153. package/bin/chunk-gtqchcj0.js +0 -2
  154. package/bin/chunk-hdx9q31r.js +0 -1
  155. package/bin/chunk-hk5pwxhf.js +0 -2
  156. package/bin/chunk-jkpxykx9.css +0 -1
  157. package/bin/chunk-jq28ge97.js +0 -1
  158. package/bin/chunk-n3e4agsa.js +0 -2
  159. package/bin/chunk-ppwy5dja.js +0 -1
  160. package/bin/chunk-px660tvj.js +0 -2
  161. package/bin/chunk-qbs0nvbn.js +0 -3
  162. package/bin/chunk-qt6j0fm6.js +0 -65
  163. package/bin/chunk-t6gqzden.js +0 -1
  164. package/bin/chunk-tn24as5d.js +0 -2
  165. package/bin/chunk-v2n1hwt3.js +0 -1
  166. package/bin/chunk-vhcsdnzv.js +0 -2
  167. package/bin/chunk-wk153p7c.js +0 -1
  168. package/bin/chunk-y8wj6g7y.js +0 -11
  169. package/bin/chunk-ympx92ct.js +0 -1
  170. package/bin/chunk-yx6mahz0.js +0 -1
  171. package/bin/chunk-z8s40zfa.js +0 -68
@@ -1,2 +1,2 @@
1
- import{$k as e,Nh as t,dl as a}from"./chunk-5ctpz542.js";function n({className:i,size:r="default",...s}){return t(e.Root,{"data-slot":"switch","data-size":r,className:a("peer group/switch inline-flex shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-[1.15rem] data-[size=default]:w-8 data-[size=sm]:h-3.5 data-[size=sm]:w-6 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input dark:data-[state=unchecked]:bg-input/80",i),...s,children:t(e.Thumb,{"data-slot":"switch-thumb",className:a("pointer-events-none block rounded-full bg-background ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0 dark:data-[state=checked]:bg-primary-foreground dark:data-[state=unchecked]:bg-foreground")})})}
2
- export{n as xa};
1
+ import{_h as t,ol as e,sl as a}from"./chunk-yfgwknpa.js";function n({className:i,size:r="default",...s}){return t(e.Root,{"data-slot":"switch","data-size":r,className:a("peer group/switch inline-flex shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-[1.15rem] data-[size=default]:w-8 data-[size=sm]:h-3.5 data-[size=sm]:w-6 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input dark:data-[state=unchecked]:bg-input/80",i),...s,children:t(e.Thumb,{"data-slot":"switch-thumb",className:a("pointer-events-none block rounded-full bg-background ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0 dark:data-[state=checked]:bg-primary-foreground dark:data-[state=unchecked]:bg-foreground")})})}
2
+ export{n as Eh};
@@ -0,0 +1,2 @@
1
+ import{l as qy,m as By}from"./chunk-s9s9hhet.js";import{r as Zy}from"./chunk-xvpttxen.js";import{t as _y,w as $y}from"./chunk-bxexm2hd.js";import{V as Wy}from"./chunk-ch25gq27.js";import{se as Yy}from"./chunk-csky7q56.js";import{Fe as p,Ge as v,He as g,Je as f}from"./chunk-gra1fhdp.js";import{Zf as Jy}from"./chunk-n3vzdzdw.js";import{$h as Z,Ai as $,Ei as Ky,Hl as Uy,Mi as R,Yh as oy,Zh as zy,_h as O,_j as Oy,di as Q,gi as w,li as by,ul as Xy,xl as Gy}from"./chunk-yfgwknpa.js";import{Mm as ty}from"./chunk-wwjqqqr4.js";var X=ty(oy(),1);function _z({shareId:b,initialFolderId:Hy,initialFileId:u,startTime:Ty,versionId:B,compare:Vy,compareLeftId:L,compareRightId:x,compareActiveSide:F="left"}){let W=by(),q=!!Vy&&!!L&&!!x,[J,c]=X.useState(()=>{return localStorage.getItem(`share_pwd_${b}`)||""}),[P,Qy]=X.useState(""),{data:K,error:H,isLoading:ky}=Q({queryKey:["share-info",b,J],queryFn:async()=>{let y=await $.api.shares[":shareId"].info.$get({param:{shareId:b}},{headers:{"x-share-password":J}});if(y.status===401)throw Error("Unauthorized");if(y.status===403){let z=await y.json();throw Error(z.error||"Forbidden")}if(!y.ok)throw Error("Failed to fetch share info");return await y.json()},retry:!1}),G=Hy||K?.rootFolderId,U=u||null,h=B||U,[l,m]=X.useState([]),{data:A}=Q({queryKey:["public-share-folder",b,G,J],queryFn:async()=>{let y=await $.api.shares[":shareId"].files[":fileId"].$get({param:{shareId:b,fileId:G}},{headers:{"x-share-password":J}});if(y.status===401)throw Error("Unauthorized");return await y.json()},enabled:!!K&&!!G});X.useEffect(()=>{if(A?.ancestorFolders&&K){let y=A.ancestorFolders.findIndex((z)=>z.id===K.rootFolderId);if(y!==-1)m(A.ancestorFolders.slice(0,y));else if(G===K.rootFolderId)m([])}},[A,K,G]);let[k,M]=X.useState(new Set),[My,Ny]=X.useState(360),[D,Ey]=X.useState(()=>!u),N=X.useRef(null),[n,C]=X.useState([]),[Ly,t]=X.useState(0),[xy,o]=X.useState(null),[I,Ay]=X.useState(null),[Ry,Py]=X.useState(void 0),{data:i,fetchNextPage:Dy,hasNextPage:Cy,isFetchingNextPage:jy,error:a}=w({queryKey:["public-share-children",b,G,"folder",J],queryFn:async({pageParam:y})=>{let z=await $.api.shares[":shareId"].folders[":folderId"].children.$get({param:{shareId:b,folderId:G},query:{assetType:"folder",after:y}},{headers:{"x-share-password":J}});if(z.status===401)throw Error("Unauthorized");if(z.status===403)throw Error("Expired");return await z.json()},enabled:!!K&&!!G,initialPageParam:"",getNextPageParam:(y)=>y.pageInfo?.cursor||void 0,retry:!1}),{data:d,fetchNextPage:Sy,hasNextPage:wy,isFetchingNextPage:py}=w({queryKey:["public-share-children",b,G,"file",J],queryFn:async({pageParam:y})=>{let z=await $.api.shares[":shareId"].folders[":folderId"].children.$get({param:{shareId:b,folderId:G},query:{assetType:"file",after:y}},{headers:{"x-share-password":J}});if(z.status===401)throw Error("Unauthorized");if(z.status===403)throw Error("Expired");return await z.json()},enabled:!!K&&!!G,initialPageParam:"",getNextPageParam:(y)=>y.pageInfo?.cursor||void 0,retry:!1}),{data:vy}=Q({queryKey:["public-share-fields",b,J],queryFn:async()=>{let y=await $.api.shares[":shareId"].fields.$get({param:{shareId:b}},{headers:{"x-share-password":J}});if(y.status===401)throw Error("Unauthorized");return await y.json()},enabled:!!K}),{data:_,isLoading:gy}=Q({queryKey:["public-share-file",b,U,J],queryFn:async()=>{let y=await $.api.shares[":shareId"].files[":fileId"].$get({param:{shareId:b,fileId:U}},{headers:{"x-share-password":J}});if(y.status===401)throw Error("Unauthorized");return await y.json()},enabled:!!U&&!!K}),{data:fy,isLoading:uy}=Q({queryKey:["public-share-file",b,B,J],queryFn:async()=>{let y=await $.api.shares[":shareId"].files[":fileId"].$get({param:{shareId:b,fileId:B}},{headers:{"x-share-password":J}});if(y.status===401)throw Error("Unauthorized");return await y.json()},enabled:!!B&&!!K}),Y=B?fy:_,Fy=gy||!!B&&uy;X.useEffect(()=>{if(a?.message==="Unauthorized")c(""),localStorage.removeItem(`share_pwd_${b}`)},[a,b]);let E=X.useMemo(()=>i?.pages.flatMap((y)=>y.data??[])??[],[i]),j=X.useMemo(()=>d?.pages.flatMap((y)=>y.data??[])??[],[d]),s=X.useMemo(()=>{if(Y)return Y;if(k.size!==1)return null;let y=Array.from(k)[0];return[...E,...j].find((z)=>z.id===y)||null},[k,E,j,Y]),cy=(y)=>{y.preventDefault(),c(P),localStorage.setItem(`share_pwd_${b}`,P)},hy=(y)=>{if(y.type==="folder"||y.targetType==="folder")W({to:"/share/$shareId/folders/$folderId",params:{shareId:b,folderId:y.id}});else W({to:"/share/$shareId/files/$fileId",params:{shareId:b,fileId:y.versionStack?y.versionStack.id:y.id}});M(new Set)},ly=(y)=>{if(!K)return;let z=y==="root"?K.rootFolderId:y;if(z===K.rootFolderId)W({to:"/share/$shareId",params:{shareId:b}});else W({to:"/share/$shareId/folders/$folderId",params:{shareId:b,folderId:z}});M(new Set)},my=(y)=>{o(y.id||null);let z=y.annotations;if(z&&z.length>0)C(z);else C([]);if(q){if(y.second!==null&&y.second!==void 0)Py({second:y.second,nonce:Date.now()});return}if(y.second!==null&&y.second!==void 0)N.current?.seekTo(y.second),N.current?.pause();else if(z&&z.length>0)N.current?.pause()},r=()=>{C([]),o(null)},S=(y)=>{if(!U)return;W({to:"/share/$shareId/files/$fileId",params:{shareId:b,fileId:U},search:(z)=>({...z,...y})})},ny=()=>{S({compare:void 0,cmpLeft:void 0,cmpRight:void 0,cmpActive:void 0,version:F==="left"?L:x})},{setProjectState:e,clearProjectState:yy}=Jy();X.useEffect(()=>{if(K&&G){let y=G===K.rootFolderId?K.name:E.find((z)=>z.id===G)?.name||K.name;e({teamId:"",projectId:K.projectId,projectName:K.name,ancestorFolders:l,currentAsset:{name:Y?.name||y,type:U?"file":"folder",version:_?.versionStack?_.versionStack.versions.find((z)=>z.id===h)?.version??_.versionStack.versions.length:void 0,proxyType:Y?.proxyType||null},isRootFolder:G===K.rootFolderId&&!U,isPublic:!0,shareId:b,fileId:U||void 0,allowDownload:K.allowDownload,downloadInfo:Y?{originalKey:Y.media?.original?.key,videoTranscodes:Y.media?.videoTranscodes?.map((z)=>({key:z.key,width:z.width,height:z.height}))}:void 0,onFolderClick:ly,isRightSidebarCollapsed:D,onRightSidebarToggle:()=>Ey((z)=>!z),versions:_?.versionStack?.versions,compareMode:q,canCompareVersions:(_?.versionStack?.versions?.length??0)>=2,onCompareVersions:()=>{let z=_y(_?.versionStack?.versions);if(!z||!U)return;W({to:"/share/$shareId/files/$fileId",params:{shareId:b,fileId:U},search:(V)=>({...V,compare:!0,cmpLeft:z.left.id,cmpRight:z.right.id,cmpActive:"left"})})}})}return()=>yy()},[K,G,E,Y,_,h,U,l,e,yy,D,q,W,b]);let T;if(ky&&!H)T=O("div",{className:"flex flex-1 items-center justify-center bg-background",children:O(R,{className:"h-8 w-8 animate-spin text-foreground"})});else if(H)if(H.message==="Unauthorized"){let y=J!=="";T=O("div",{className:"flex flex-1 items-center justify-center p-4",children:Z(p,{className:"w-full max-w-md",children:[Z(v,{className:"text-center",children:[O("div",{className:"mx-auto mb-4 flex h-12 w-12 items-center justify-center rounded-full bg-primary/10",children:O(Oy,{className:"h-6 w-6 text-primary"})}),O(g,{children:Gy.password_protected()})]}),O(f,{children:Z("form",{onSubmit:cy,className:"space-y-4",children:[Z("div",{className:"space-y-2",children:[O(Uy,{type:"password",placeholder:"Enter password",value:P,onChange:(z)=>Qy(z.target.value),autoFocus:!0}),y&&O("p",{className:"text-sm font-medium text-destructive",children:"Incorrect password. Please try again."})]}),O(Xy,{type:"submit",className:"w-full",children:"Access Share"})]})})]})})}else{let y=H.message.includes("expired"),z=H.message.includes("disabled");T=O("div",{className:"flex flex-1 items-center justify-center p-4",children:Z(p,{className:"w-full max-w-md",children:[Z(v,{className:"text-center",children:[O("div",{className:"mx-auto mb-4 flex h-12 w-12 items-center justify-center rounded-full bg-destructive/10",children:O(Ky,{className:"h-6 w-6 text-destructive"})}),O(g,{children:y?"Share Expired":z?"Share Disabled":"Error"})]}),O(f,{className:"text-center text-muted-foreground",children:H.message})]})})}else if(!K)T=O("div",{className:"flex flex-1 items-center justify-center bg-background",children:O(R,{className:"h-8 w-8 animate-spin text-foreground"})});else T=Z("div",{className:"flex flex-1 overflow-hidden relative",children:[U?Z("div",{className:"flex-1 relative bg-muted/30",children:[Fy&&!q&&O("div",{className:"absolute inset-0 z-10 flex items-center justify-center bg-background/50",children:O(R,{className:"h-8 w-8 animate-spin text-foreground"})}),q&&L&&x?O(By,{isPublic:!0,shareId:b,versions:Y?.versionStack?.versions??[],leftId:L,rightId:x,activeSide:F,annotations:n,seekRequest:Ry,allowDownload:K.allowDownload,onActiveSideChange:(y)=>S({cmpActive:y}),onSwitchVersion:(y,z)=>S(y==="left"?{cmpLeft:z}:{cmpRight:z}),onExit:ny,onActiveAssetChange:Ay,onPlay:r,onTimeUpdate:t}):Y&&O(qy,{file:Y,mediaControllerRef:N,onPlay:r,onTimeUpdate:t,annotations:n,startTime:Ty,shareId:b,allowDownload:K.allowDownload})]}):G&&O(Zy,{teamId:"",projectId:K.projectId,assetId:G,folders:E,files:j,selectedItem:null,selectedIds:k,onItemSelect:(y,z)=>{if(z.metaKey||z.ctrlKey){let V=new Set(k);if(V.has(y.id))V.delete(y.id);else V.add(y.id);M(V)}else M(new Set([y.id]))},onItemDoubleClick:hy,onSaveField:()=>{},displayStyle:K.viewMode??"card",onClearSelection:()=>M(new Set),fetchNextFoldersPage:Dy,hasNextFoldersPage:Cy,isFetchingNextFoldersPage:jy,fetchNextFilesPage:Sy,hasNextFilesPage:wy,isFetchingNextFilesPage:py,isShareView:!0,isPublic:!0,shareId:b,allowDownload:K.allowDownload}),!D&&Z(zy,{children:[O(Wy,{onResize:(y)=>Ny((z)=>Math.max(240,Math.min(600,z-y)))}),O("div",{style:{width:My},className:"flex-shrink-0 border-l",children:O($y,{teamId:"",projectId:K.projectId,file:q?I:s,onSaveField:()=>{},members:[],readOnly:!0,publicFields:vy,onCommentSelect:my,isPublic:!0,shareId:b,currentTime:Ly,onTyping:()=>{N.current?.pause()},selectedCommentId:xy,hideAnnotationControl:(q?I:s)?.proxyType==="audio"})})]})]});return Z("div",{className:"flex h-screen flex-col bg-background",children:[O(Yy,{}),T]})}
2
+ export{_z as k};
@@ -1,2 +1,2 @@
1
- import{Nh as r,Wk as o,dl as t}from"./chunk-5ctpz542.js";function m({className:e,value:s,...i}){return r(o.Root,{"data-slot":"progress",className:t("relative h-2 w-full overflow-hidden rounded-full bg-primary/20",e),...i,children:r(o.Indicator,{"data-slot":"progress-indicator",className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(s||0)}%)`}})})}
2
- export{m as Te};
1
+ import{_h as r,jl as o,sl as t}from"./chunk-yfgwknpa.js";function m({className:e,value:s,...i}){return r(o.Root,{"data-slot":"progress",className:t("relative h-2 w-full overflow-hidden rounded-full bg-primary/20",e),...i,children:r(o.Indicator,{"data-slot":"progress-indicator",className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(s||0)}%)`}})})}
2
+ export{m as je};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{rl as O}from"./chunk-r0c9vmfm.js";import{sl as C,tl as E}from"./chunk-jt7fdhke.js";import{ul as y,vl as K,wl as P}from"./chunk-wth2f791.js";import{xl as b}from"./chunk-zafjhkkk.js";import"./chunk-jx9tqjh9.js";import{zl as M}from"./chunk-a2m63585.js";import{Bl as H}from"./chunk-dntwxkyf.js";import{Cl as k}from"./chunk-nw1ch5d8.js";import"./chunk-dt9wfyf2.js";import{Rl as A,Sl as N}from"./chunk-tx42kfdh.js";import{Xl as $,Zl as S}from"./chunk-5efr8prc.js";import"./chunk-z71h48pj.js";import{bm as _}from"./chunk-mwrheqe3.js";import{im as f}from"./chunk-9fc118ea.js";import{jm as U}from"./chunk-ej18j83b.js";import"./chunk-j4byth37.js";var g=new Set(["openai","openai-codex","opencode"]),u=16;function V(j,D){if(!j)return!1;let w=D.toLowerCase();for(let[z,F]of Object.entries(j))if(z.toLowerCase()===w&&F!==null&&F.trim().length>0)return!0;return!1}function R(j,D,w){if(D)return D;if(V(w,"authorization")||V(w,"cf-aig-authorization"))return"unused";throw Error(`No API key for provider: ${j}`)}function c(j){return j.provider==="openrouter"||j.baseUrl.includes("openrouter.ai")?"openrouter":"openai"}function T(j,D){if(j)return j;if(k("PI_CACHE_RETENTION",D)==="long")return"long";return"short"}function q(j){return{supportsDeveloperRole:j.compat?.supportsDeveloperRole??!0,sessionAffinityFormat:j.compat?.sessionAffinityFormat??c(j),supportsLongCacheRetention:j.compat?.supportsLongCacheRetention??!0,supportsStrictMode:j.compat?.supportsStrictMode??!1,supportsOpenAIGrammarTools:j.compat?.supportsOpenAIGrammarTools??!1,supportsToolSearch:j.compat?.supportsToolSearch??!1,supportsExplicitPromptCacheMode:j.compat?.supportsExplicitPromptCacheMode??!1}}function r(j,D){return D==="long"&&j.supportsLongCacheRetention?"24h":void 0}function d(j){return N(A(j),"OpenAI API error")}var l=(j,D,w)=>{let z=new U;return(async()=>{let F={role:"assistant",content:[],api:j.api,provider:j.provider,model:j.id,usage:{input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},stopReason:"stop",timestamp:Date.now()};try{let Q=R(j.provider,w?.apiKey,w?.headers),W=T(w?.cacheRetention,w?.env)==="none"?void 0:w?.sessionId,X=q(j),J=$(D.tools,X.supportsOpenAIGrammarTools),Y=a(j,D,Q,w?.headers,W),Z=m(j,D,w,X,J),B=await w?.onPayload?.(Z,j);if(B!==void 0)Z=B;let v={...w?.signal?{signal:w.signal}:{},...w?.timeoutMs!==void 0?{timeout:w.timeoutMs}:{},maxRetries:0},{data:I,response:L}=await H(()=>Y.responses.create(Z,v).withResponse(),{maxRetries:w?.maxRetries,maxRetryDelayMs:w?.maxRetryDelayMs,signal:w?.signal});if(await w?.onResponse?.({status:L.status,headers:_(L.headers)},j),z.push({type:"start",partial:F}),await P(I,F,z,j,{serviceTier:w?.serviceTier,grammarToolInputProperties:J,applyServiceTierPricing:(x,h)=>n(x,h,j)}),w?.signal?.aborted)throw Error("Request was aborted");if(F.stopReason==="aborted"||F.stopReason==="error")throw Error("An unknown error occurred");z.push({type:"done",reason:F.stopReason,message:F}),z.end()}catch(Q){for(let G of F.content)delete G.index,delete G.partialJson,delete G.customInput;F.stopReason=w?.signal?.aborted?"aborted":"error",F.errorMessage=d(Q),z.push({type:"error",reason:F.stopReason,error:F}),z.end()}})(),z},Wj=(j,D,w)=>{R(j.provider,w?.apiKey,w?.headers);let z=S(j,D,w,w?.apiKey),F=w?.reasoning?f(j,w.reasoning):void 0;return l(j,D,{...z,reasoningEffort:F==="off"?void 0:F})};function a(j,D,w,z,F){let Q=q(j),G={...j.headers};if(j.provider==="github-copilot"){let W=C(D.messages),X=E({messages:D.messages,hasImages:W});Object.assign(G,X)}if(F)if(Q.sessionAffinityFormat==="openrouter")G["x-session-id"]=F;else{if(Q.sessionAffinityFormat==="openai")G.session_id=F;G["x-client-request-id"]=F}if(z)Object.assign(G,z);return new M({apiKey:w,baseURL:j.baseUrl,dangerouslyAllowBrowser:!0,defaultHeaders:G})}function m(j,D,w,z=q(j),F=$(D.tools,z.supportsOpenAIGrammarTools)){let Q=O(D,z.supportsToolSearch),G=y(j,D,g,{grammarToolInputProperties:F,deferredTools:Q.deferred,toolOptions:{supportsStrictMode:z.supportsStrictMode,supportsOpenAIGrammarTools:z.supportsOpenAIGrammarTools}}),W=T(w?.cacheRetention,w?.env),X=W==="none"&&z.supportsExplicitPromptCacheMode,J={model:j.id,input:G,stream:!0,prompt_cache_key:W==="none"?void 0:b(w?.sessionId),prompt_cache_retention:r(z,W),prompt_cache_options:X?{mode:"explicit"}:void 0,store:!1};if(w?.maxTokens)J.max_output_tokens=Math.max(w.maxTokens,u);if(w?.temperature!==void 0)J.temperature=w?.temperature;if(w?.serviceTier!==void 0)J.service_tier=w.serviceTier;if(Q.immediate.length>0)J.tools=K(Q.immediate,{supportsStrictMode:z.supportsStrictMode,supportsOpenAIGrammarTools:z.supportsOpenAIGrammarTools});if(w?.toolChoice!==void 0)J.tool_choice=w.toolChoice;if(j.reasoning){if(w?.reasoningEffort||w?.reasoningSummary){let Y=w?.reasoningEffort?j.thinkingLevelMap?.[w.reasoningEffort]??w.reasoningEffort:"medium";J.reasoning={effort:Y,summary:w?.reasoningSummary||"auto"},J.include=["reasoning.encrypted_content"]}else if(j.provider!=="github-copilot"&&j.thinkingLevelMap?.off!==null)J.reasoning={effort:j.thinkingLevelMap?.off??"none"};if(j.provider==="xai")J.include=["reasoning.encrypted_content"]}return J}function i(j,D){switch(D){case"flex":return 0.5;case"priority":return j.id==="gpt-5.5"?2.5:2;default:return 1}}function n(j,D,w){let z=i(w,D);if(z===1)return;j.cost.input*=z,j.cost.output*=z,j.cost.cacheRead*=z,j.cost.cacheWrite*=z,j.cost.total=j.cost.input+j.cost.output+j.cost.cacheRead+j.cost.cacheWrite}export{Wj as streamSimple,l as stream};
2
+ import{Ql as O}from"./chunk-2mxqjx3x.js";import{Rl as C,Sl as E}from"./chunk-mk5hqjjd.js";import{Tl as y,Ul as K,Vl as P}from"./chunk-hcaw54dj.js";import{Wl as b}from"./chunk-0qcp4v52.js";import"./chunk-4shqnfq1.js";import{Yl as M}from"./chunk-v1ybpqrz.js";import{_l as H}from"./chunk-8zmk029n.js";import{$l as k}from"./chunk-g2bkj92r.js";import"./chunk-7r6h3fta.js";import{om as A,pm as N}from"./chunk-7m07t899.js";import{um as $,wm as S}from"./chunk-g6aq2cyq.js";import"./chunk-d4ktgq49.js";import{Am as _}from"./chunk-1whn0v5n.js";import{Hm as f}from"./chunk-34f4hk54.js";import{Im as U}from"./chunk-k33qdrdp.js";import"./chunk-wwjqqqr4.js";var g=new Set(["openai","openai-codex","opencode"]),u=16;function V(j,D){if(!j)return!1;let w=D.toLowerCase();for(let[z,F]of Object.entries(j))if(z.toLowerCase()===w&&F!==null&&F.trim().length>0)return!0;return!1}function R(j,D,w){if(D)return D;if(V(w,"authorization")||V(w,"cf-aig-authorization"))return"unused";throw Error(`No API key for provider: ${j}`)}function c(j){return j.provider==="openrouter"||j.baseUrl.includes("openrouter.ai")?"openrouter":"openai"}function T(j,D){if(j)return j;if(k("PI_CACHE_RETENTION",D)==="long")return"long";return"short"}function q(j){return{supportsDeveloperRole:j.compat?.supportsDeveloperRole??!0,sessionAffinityFormat:j.compat?.sessionAffinityFormat??c(j),supportsLongCacheRetention:j.compat?.supportsLongCacheRetention??!0,supportsStrictMode:j.compat?.supportsStrictMode??!1,supportsOpenAIGrammarTools:j.compat?.supportsOpenAIGrammarTools??!1,supportsToolSearch:j.compat?.supportsToolSearch??!1,supportsExplicitPromptCacheMode:j.compat?.supportsExplicitPromptCacheMode??!1}}function r(j,D){return D==="long"&&j.supportsLongCacheRetention?"24h":void 0}function d(j){return N(A(j),"OpenAI API error")}var l=(j,D,w)=>{let z=new U;return(async()=>{let F={role:"assistant",content:[],api:j.api,provider:j.provider,model:j.id,usage:{input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},stopReason:"stop",timestamp:Date.now()};try{let Q=R(j.provider,w?.apiKey,w?.headers),W=T(w?.cacheRetention,w?.env)==="none"?void 0:w?.sessionId,X=q(j),J=$(D.tools,X.supportsOpenAIGrammarTools),Y=a(j,D,Q,w?.headers,W),Z=m(j,D,w,X,J),B=await w?.onPayload?.(Z,j);if(B!==void 0)Z=B;let v={...w?.signal?{signal:w.signal}:{},...w?.timeoutMs!==void 0?{timeout:w.timeoutMs}:{},maxRetries:0},{data:I,response:L}=await H(()=>Y.responses.create(Z,v).withResponse(),{maxRetries:w?.maxRetries,maxRetryDelayMs:w?.maxRetryDelayMs,signal:w?.signal});if(await w?.onResponse?.({status:L.status,headers:_(L.headers)},j),z.push({type:"start",partial:F}),await P(I,F,z,j,{serviceTier:w?.serviceTier,grammarToolInputProperties:J,applyServiceTierPricing:(x,h)=>n(x,h,j)}),w?.signal?.aborted)throw Error("Request was aborted");if(F.stopReason==="aborted"||F.stopReason==="error")throw Error("An unknown error occurred");z.push({type:"done",reason:F.stopReason,message:F}),z.end()}catch(Q){for(let G of F.content)delete G.index,delete G.partialJson,delete G.customInput;F.stopReason=w?.signal?.aborted?"aborted":"error",F.errorMessage=d(Q),z.push({type:"error",reason:F.stopReason,error:F}),z.end()}})(),z},Wj=(j,D,w)=>{R(j.provider,w?.apiKey,w?.headers);let z=S(j,D,w,w?.apiKey),F=w?.reasoning?f(j,w.reasoning):void 0;return l(j,D,{...z,reasoningEffort:F==="off"?void 0:F})};function a(j,D,w,z,F){let Q=q(j),G={...j.headers};if(j.provider==="github-copilot"){let W=C(D.messages),X=E({messages:D.messages,hasImages:W});Object.assign(G,X)}if(F)if(Q.sessionAffinityFormat==="openrouter")G["x-session-id"]=F;else{if(Q.sessionAffinityFormat==="openai")G.session_id=F;G["x-client-request-id"]=F}if(z)Object.assign(G,z);return new M({apiKey:w,baseURL:j.baseUrl,dangerouslyAllowBrowser:!0,defaultHeaders:G})}function m(j,D,w,z=q(j),F=$(D.tools,z.supportsOpenAIGrammarTools)){let Q=O(D,z.supportsToolSearch),G=y(j,D,g,{grammarToolInputProperties:F,deferredTools:Q.deferred,toolOptions:{supportsStrictMode:z.supportsStrictMode,supportsOpenAIGrammarTools:z.supportsOpenAIGrammarTools}}),W=T(w?.cacheRetention,w?.env),X=W==="none"&&z.supportsExplicitPromptCacheMode,J={model:j.id,input:G,stream:!0,prompt_cache_key:W==="none"?void 0:b(w?.sessionId),prompt_cache_retention:r(z,W),prompt_cache_options:X?{mode:"explicit"}:void 0,store:!1};if(w?.maxTokens)J.max_output_tokens=Math.max(w.maxTokens,u);if(w?.temperature!==void 0)J.temperature=w?.temperature;if(w?.serviceTier!==void 0)J.service_tier=w.serviceTier;if(Q.immediate.length>0)J.tools=K(Q.immediate,{supportsStrictMode:z.supportsStrictMode,supportsOpenAIGrammarTools:z.supportsOpenAIGrammarTools});if(w?.toolChoice!==void 0)J.tool_choice=w.toolChoice;if(j.reasoning){if(w?.reasoningEffort||w?.reasoningSummary){let Y=w?.reasoningEffort?j.thinkingLevelMap?.[w.reasoningEffort]??w.reasoningEffort:"medium";J.reasoning={effort:Y,summary:w?.reasoningSummary||"auto"},J.include=["reasoning.encrypted_content"]}else if(j.provider!=="github-copilot"&&j.thinkingLevelMap?.off!==null)J.reasoning={effort:j.thinkingLevelMap?.off??"none"};if(j.provider==="xai")J.include=["reasoning.encrypted_content"]}return J}function i(j,D){switch(D){case"flex":return 0.5;case"priority":return j.id==="gpt-5.5"?2.5:2;default:return 1}}function n(j,D,w){let z=i(w,D);if(z===1)return;j.cost.input*=z,j.cost.output*=z,j.cost.cacheRead*=z,j.cost.cacheWrite*=z,j.cost.total=j.cost.input+j.cost.output+j.cost.cacheRead+j.cost.cacheWrite}export{Wj as streamSimple,l as stream};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
2
  function f(b){if(b===void 0)return;let d=Array.from(b);if(d.length<=64)return b;return d.slice(0,64).join("")}
3
- export{f as xl};
3
+ export{f as Wl};
@@ -0,0 +1,2 @@
1
+ import{Ug as ZK,Wg as IJ}from"./chunk-kmhkhcy6.js";import{Yg as $J}from"./chunk-y8ffp5zj.js";import{$g as zJ}from"./chunk-rjga1vn2.js";import{Ih as UJ,Kh as BJ,Lh as bJ,Mh as F,Qh as WK,Vh as XK}from"./chunk-hsemzjvr.js";import{$h as X,Ai as U,Ak as KK,Al as SJ,Bl as fJ,Cl as hJ,Dl as DJ,El as YK,Fj as JK,Fl as z,Hl as _K,Il as $K,Jl as GK,Ki as HJ,Kl as zK,Lk as gJ,Ll as QK,Mi as c,Ml as HK,Nl as UK,Ol as BK,Pl as bK,Si as aJ,Tj as wJ,Ui as rJ,Yh as CK,Zh as lJ,_h as J,ai as dJ,dj as oJ,fi as y,gi as GJ,ji as nJ,ki as R,kj as sJ,li as QJ,mj as tJ,oj as ZJ,ok as TJ,pj as _J,rj as eJ,sl as A,ul as E,xj as uJ,xl as W,yl as RJ}from"./chunk-yfgwknpa.js";import{Mm as NK}from"./chunk-wwjqqqr4.js";var _=NK(CK(),1);function iK({teamId:B,projectId:Z,projectName:$,rootFolderId:O,dragState:b,onSelect:M,selectedFolderId:V,hideCollections:i,hideShares:v,hideRecentlyDeleted:S,ancestorFolders:f}){let q=QJ(),Q=dJ(),{canEdit:P}=XK(Z),h=nJ({from:"/projects/$projectId/recently-deleted",shouldThrow:!1}),[k,o]=_.useState(!0),[D,qJ]=_.useState(!0),[u,VJ]=_.useState(!0),{data:g,fetchNextPage:I,hasNextPage:x,isFetchingNextPage:l}=GJ({queryKey:["shares",Z],queryFn:async({pageParam:K})=>{let Y=await U.api.projects[":projectId"].shares.$get({param:{projectId:Z},query:{first:"20",after:K}});if(!Y.ok)throw Error(W.failed_fetch_share_links());return await Y.json()},initialPageParam:"",getNextPageParam:(K)=>K.pageInfo?.cursor||void 0,enabled:!!Z}),{data:d,fetchNextPage:n,hasNextPage:s,isFetchingNextPage:a}=GJ({queryKey:["collections",Z],queryFn:async({pageParam:K})=>{let Y=await U.api.projects[":projectId"].collections.$get({param:{projectId:Z},query:{first:"20",after:K}});if(!Y.ok)throw Error(W.failed_fetch_collections());return await Y.json()},initialPageParam:"",getNextPageParam:(K)=>K.pageInfo?.cursor||void 0,enabled:!!Z}),{ref:AJ,inView:t}=zJ(),{ref:OJ,inView:e}=zJ();_.useEffect(()=>{if(t&&s&&!a)n()},[t,s,a,n]),_.useEffect(()=>{if(e&&x&&!l)I()},[e,x,l,I]);let PJ=_.useMemo(()=>d?.pages.flatMap((K)=>K.data)||[],[d]),MJ=_.useMemo(()=>g?.pages.flatMap((K)=>K.data)||[],[g]),{mutate:LJ}=y({mutationFn:async()=>{let K=await U.api.projects[":projectId"].collections.$post({param:{projectId:Z},json:{name:W.untitled_collection(),filter:{sourceFolderId:O,searchFilter:{conditions:[],recursively:!0}}}});if(!K.ok)throw Error(W.failed_create_collection());return await K.json()},onSuccess:(K)=>{Q.invalidateQueries({queryKey:["collections",Z]}),z.success(W.collection_created()),q({to:"/projects/$projectId/collections/$collectionId",params:{projectId:Z,collectionId:K.id}})},onError:(K)=>{z.error(`Error: ${K.message}`)}}),{mutate:yJ}=y({mutationFn:async()=>{let K=await U.api.projects[":projectId"].shares.$post({param:{projectId:Z},json:{name:new Date().toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"})}});if(!K.ok)throw Error(W.failed_create_share_link());return await K.json()},onSuccess:(K)=>{Q.invalidateQueries({queryKey:["shares",Z]}),z.success(W.share_link_created()),q({to:"/projects/$projectId/shares/$shareId",params:{projectId:Z,shareId:K.id}})},onError:(K)=>{z.error(`Error: ${K.message}`)}}),JJ=R({from:"/projects/$projectId/collections/$collectionId",shouldThrow:!1}),G=R({from:"/projects/$projectId/shares/$shareId",shouldThrow:!1}),KJ=R({from:"/projects/$projectId/folders/$folderId",shouldThrow:!1}),[p,EJ]=_.useState(null),[N,vJ]=_.useState("collection"),[L,WJ]=_.useState(""),[VK,C]=_.useState(!1),[NJ,CJ]=_.useState(null),[w,FJ]=_.useState("collection"),[AK,T]=_.useState(!1),{mutate:xJ}=y({mutationFn:async({id:K,name:Y})=>{let H=await U.api.folders[":folderId"].$put({param:{folderId:K},json:{name:Y}});if(!H.ok)throw Error(W.failed_rename_folder());return await H.json()},onSuccess:()=>{Q.invalidateQueries({queryKey:["search",B]}),Q.invalidateQueries({queryKey:["folders"]}),z.success(W.folder_renamed()),C(!1)},onError:(K)=>{z.error(`Error: ${K.message}`)}}),{mutate:OK}=y({mutationFn:async(K)=>{if(!(await U.api.folders.$delete({json:{ids:[K]}})).ok)throw Error(W.failed_delete_folder());return K},onSuccess:(K)=>{if(Q.invalidateQueries({queryKey:["search",B]}),Q.invalidateQueries({queryKey:["folders"]}),z.success(W.folder_deleted()),T(!1),KJ?.folderId===K)q({to:"/projects/$projectId",params:{projectId:Z}})},onError:(K)=>{z.error(`Error: ${K.message}`)}}),[PK,r]=_.useState(!1),[XJ,pJ]=_.useState(!1),[kJ,mJ]=_.useState([]),MK=async(K)=>{r(!0),pJ(!0),mJ([]);try{let Y=await U.api.files["download-links"].$post({json:{ids:[K]}});if(!Y.ok)throw Error(W.failed_to_prepare_download_links());let H=await Y.json();mJ(H.files)}catch(Y){z.error(W.failed_to_prepare_download_links()),r(!1),console.error(Y)}finally{pJ(!1)}},LK=()=>{let K=[...kJ];if(r(!1),K.length===0)return;z.info(W.starting_download_files({count:K.length}),{duration:5000});let Y=(YJ)=>new Promise((m)=>setTimeout(m,YJ));(async()=>{for(let m=0;m<K.length;m+=5){let vK=K.slice(m,m+5);for(let iJ of vK){let j=document.createElement("a");j.href=iJ.url,j.download=iJ.name,j.target="_blank",document.body.appendChild(j),j.click(),j.remove()}await Y(1000)}})().catch((YJ)=>{console.error("Background downloads failed:",YJ),z.error(W.some_downloads_failed())})},{mutate:jJ}=y({mutationFn:async({id:K,name:Y})=>{let H=await U.api.collections[":collectionId"].$patch({param:{collectionId:K},json:{name:Y}});if(!H.ok)throw Error(W.failed_rename_collection());return await H.json()},onSuccess:()=>{Q.invalidateQueries({queryKey:["collections",Z]}),z.success(W.collection_renamed()),C(!1)},onError:(K)=>{z.error(`Error: ${K.message}`)}}),{mutate:yK}=y({mutationFn:async(K)=>{let Y=await U.api.collections[":collectionId"].$delete({param:{collectionId:K}});if(!Y.ok)throw Error(W.failed_delete_collection());return await Y.json()},onSuccess:(K,Y)=>{if(Q.invalidateQueries({queryKey:["collections",Z]}),z.success(W.collection_deleted()),T(!1),JJ?.collectionId===Y)q({to:"/projects/$projectId",params:{projectId:Z}})},onError:(K)=>{z.error(`Error: ${K.message}`)}}),{mutate:cJ}=y({mutationFn:async({id:K,name:Y})=>{let H=await U.api.shares[":shareId"].$put({param:{shareId:K},json:{name:Y}});if(!H.ok)throw Error(W.failed_rename_share_link());return await H.json()},onSuccess:()=>{Q.invalidateQueries({queryKey:["shares",Z]}),z.success(W.share_link_renamed()),C(!1)},onError:(K)=>{z.error(`Error: ${K.message}`)}}),{mutate:EK}=y({mutationFn:async(K)=>{if(!(await U.api.shares[":shareId"].$delete({param:{shareId:K}})).ok)throw Error(W.failed_delete_share_link());return K},onSuccess:(K)=>{if(Q.invalidateQueries({queryKey:["shares",Z]}),z.success(W.share_link_deleted()),T(!1),G?.shareId===K)q({to:"/projects/$projectId",params:{projectId:Z}})},onError:(K)=>{z.error(`Error: ${K.message}`)}});return X("div",{className:"flex flex-col h-full overflow-hidden p-3 gap-4 bg-background",children:[X("div",{className:A("flex flex-col overflow-hidden transition-all duration-300 ease-in-out border-b border-border pb-4",k?"flex-1 min-h-[50%] h-full":"flex-none h-[44px] max-h-[44px]"),children:[J("header",{className:"group flex items-center justify-between px-2 mb-1 flex-none",children:X("div",{className:"flex-1 flex items-center gap-1.5 cursor-pointer select-none text-muted-foreground hover:text-foreground transition-colors",onClick:()=>o(!k),children:[J("h3",{className:"text-xs font-semibold uppercase tracking-wider",children:W.folder_tree_assets()}),k?J(ZJ,{className:"h-3.5 w-3.5 opacity-0 group-hover:opacity-100 transition-opacity duration-200"}):J(_J,{className:"h-3.5 w-3.5 opacity-0 group-hover:opacity-100 transition-opacity duration-200"})]})}),J($J,{className:A("flex-1 min-h-0 transition-all duration-300 ease-in-out [&>div>div]:block!",k?"opacity-100 visible pointer-events-auto":"opacity-0 invisible pointer-events-none h-0"),children:X("div",{className:"space-y-0.5 pr-3",children:[J(qK,{teamId:B,projectId:Z,folder:{id:O,name:$,type:"folder",sizeByte:0,fileCount:0,status:"processed",createdAt:"",updatedAt:""},level:0,isRoot:!0,dragState:b,onSelect:M,selectedFolderId:V,canEdit:P,onRenameTrigger:(K,Y)=>{EJ(K),vJ("folder"),WJ(Y),C(!0)},onDeleteTrigger:(K)=>{CJ(K),FJ("folder"),T(!0)},onDownloadTrigger:(K)=>{MK(K)},ancestorFolders:f},O),P&&!S&&X("div",{className:A("group flex cursor-pointer items-center gap-2 rounded-md px-2 py-1.5 text-sm transition-colors hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",h&&"bg-sidebar-accent text-sidebar-accent-foreground font-medium"),onClick:()=>q({to:"/projects/$projectId/recently-deleted",params:{projectId:Z}}),children:[J("div",{className:"flex h-4 w-4 items-center justify-center",children:J(gJ,{className:"h-4 w-4 text-sidebar-primary"})}),J("span",{className:"flex-1 truncate text-sidebar-foreground",children:W.recently_deleted()})]})]})})]}),!i&&X("div",{className:A("flex flex-col overflow-hidden transition-all duration-300 ease-in-out border-b border-border pb-4",D?"flex-1 min-h-0 h-full":"flex-none h-[44px] max-h-[44px]"),children:[X("header",{className:"group flex items-center justify-between px-2 mb-1 flex-none",children:[X("div",{className:"flex-1 flex items-center gap-1.5 cursor-pointer select-none text-muted-foreground hover:text-foreground transition-colors",onClick:()=>qJ(!D),children:[J("h3",{className:"text-xs font-semibold uppercase tracking-wider",children:W.collections()}),D?J(ZJ,{className:"h-3.5 w-3.5 opacity-0 group-hover:opacity-100 transition-opacity duration-200"}):J(_J,{className:"h-3.5 w-3.5 opacity-0 group-hover:opacity-100 transition-opacity duration-200"})]}),P&&J("button",{"data-testid":"create-collection",onClick:()=>LJ(),className:"text-muted-foreground hover:text-foreground flex-none",children:J(TJ,{className:"h-3.5 w-3.5"})})]}),J($J,{className:A("flex-1 min-h-0 transition-all duration-300 ease-in-out [&>div>div]:block!",D?"opacity-100 visible pointer-events-auto":"opacity-0 invisible pointer-events-none h-0"),children:X("div",{className:"space-y-0.5 pr-3",children:[X("div",{className:"group flex cursor-pointer items-center gap-2 rounded-md px-2 py-1.5 text-sm transition-colors hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",onClick:()=>q({to:"/projects/$projectId/collections",params:{projectId:Z}}),children:[J("div",{className:"flex h-4 w-4 items-center justify-center",children:J(wJ,{className:"h-4 w-4 text-sidebar-primary"})}),J("span",{className:"flex-1 truncate text-sidebar-foreground",children:W.all_collections_count({count:d?.pages[0]?.pageInfo?.total||0})})]}),PJ.map((K)=>{let Y=JJ?.collectionId===K.id;return X("div",{className:A("group flex cursor-pointer items-center justify-between rounded-md px-2 py-1 text-sm transition-colors hover:bg-sidebar-accent hover:text-sidebar-accent-foreground min-w-0",Y&&"bg-sidebar-accent text-sidebar-accent-foreground font-medium"),onClick:()=>q({to:"/projects/$projectId/collections/$collectionId",params:{projectId:Z,collectionId:K.id}}),children:[X("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[J("div",{className:"flex h-4 w-4 items-center justify-center shrink-0",children:J(oJ,{className:"h-4 w-4 text-sidebar-primary"})}),J("span",{className:"truncate text-sidebar-foreground flex-1",children:K.name})]}),P&&J("div",{className:"opacity-0 group-hover:opacity-100 transition-opacity shrink-0",onClick:(H)=>H.stopPropagation(),children:X(UJ,{modal:!1,children:[J(BJ,{asChild:!0,children:J(E,{variant:"ghost",size:"icon-sm",className:"h-6 w-6 shrink-0 hover:bg-muted hover:text-muted-foreground p-0",children:J(HJ,{className:"h-3.5 w-3.5"})})}),X(bJ,{align:"end",className:"w-32",children:[J(F,{onClick:()=>{EJ(K.id),vJ("collection"),WJ(K.name),C(!0)},children:W.rename()}),J(F,{className:"text-destructive focus:text-destructive focus:bg-destructive/10",onClick:()=>{CJ(K.id),FJ("collection"),T(!0)},children:W.delete()})]})]})})]},K.id)}),J("div",{ref:AJ,className:"h-1"}),a&&J("div",{className:"flex justify-center p-2",children:J(c,{className:"h-4 w-4 animate-spin text-muted-foreground"})})]})})]}),!v&&X("div",{className:A("flex flex-col overflow-hidden transition-all duration-300 ease-in-out",u?"flex-1 min-h-0 h-full":"flex-none h-[44px] max-h-[44px]"),children:[X("header",{className:"group flex items-center justify-between px-2 mb-1 flex-none",children:[X("div",{className:"flex-1 flex items-center gap-1.5 cursor-pointer select-none text-muted-foreground hover:text-foreground transition-colors",onClick:()=>VJ(!u),children:[J("h3",{className:"text-xs font-semibold uppercase tracking-wider",children:W.share_links()}),u?J(ZJ,{className:"h-3.5 w-3.5 opacity-0 group-hover:opacity-100 transition-opacity duration-200"}):J(_J,{className:"h-3.5 w-3.5 opacity-0 group-hover:opacity-100 transition-opacity duration-200"})]}),P&&J("div",{className:"flex items-center gap-1 flex-none",children:J("button",{onClick:()=>yJ(),className:"text-muted-foreground hover:text-foreground",children:J(TJ,{className:"h-3.5 w-3.5"})})})]}),J($J,{className:A("flex-1 min-h-0 transition-all duration-300 ease-in-out [&>div>div]:block!",u?"opacity-100 visible pointer-events-auto":"opacity-0 invisible pointer-events-none h-0"),children:X("div",{className:"space-y-0.5 pr-3",children:[X("div",{className:"group flex cursor-pointer items-center gap-2 rounded-md px-2 py-1.5 text-sm transition-colors hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",onClick:()=>q({to:"/projects/$projectId/shares",params:{projectId:Z}}),children:[J("div",{className:"flex h-4 w-4 items-center justify-center",children:J(wJ,{className:"h-4 w-4 text-sidebar-primary"})}),J("span",{className:"flex-1 truncate text-sidebar-foreground",children:W.all_share_links_count({count:g?.pages[0]?.pageInfo?.total||0})})]}),MJ.map((K)=>J(FK,{link:K,projectId:Z,dragState:b,canEdit:P,onRenameTrigger:(Y,H)=>{EJ(Y),vJ("share"),WJ(H),C(!0)},onDeleteTrigger:(Y)=>{CJ(Y),FJ("share"),T(!0)}},K.id)),J("div",{ref:OJ,className:"h-1"}),l&&J("div",{className:"flex justify-center p-2",children:J(c,{className:"h-4 w-4 animate-spin text-muted-foreground"})})]})})]}),J(RJ,{open:VK,onOpenChange:C,children:X(SJ,{onClick:(K)=>K.stopPropagation(),children:[J(fJ,{children:J(DJ,{children:N==="collection"?W.rename_collection():N==="share"?W.rename_share_link():W.rename_folder()})}),J("div",{className:"py-4",children:J(_K,{value:L,onChange:(K)=>WJ(K.target.value),placeholder:W.enter_new_name(),onKeyDown:(K)=>{if(K.key==="Enter"&&L.trim()){if(N==="collection")jJ({id:p,name:L});else if(N==="share")cJ({id:p,name:L});else if(N==="folder")xJ({id:p,name:L})}}})}),X(hJ,{children:[J(E,{variant:"ghost",onClick:()=>C(!1),children:W.cancel()}),J(E,{disabled:!L.trim(),onClick:()=>{if(N==="collection")jJ({id:p,name:L});else if(N==="share")cJ({id:p,name:L});else if(N==="folder")xJ({id:p,name:L})},children:W.rename()})]})]})}),J($K,{open:AK,onOpenChange:T,children:X(GK,{onClick:(K)=>K.stopPropagation(),children:[X(zK,{children:[J(HK,{children:w==="collection"?W.delete_collection_confirm():w==="share"?W.delete_share_link_confirm():W.delete_folder_confirm()}),J(UK,{children:W.delete_confirm_description({type:w==="collection"?W.collection():w==="share"?W.share_link():W.folder().toLowerCase()})})]}),X(QK,{children:[J(bK,{children:W.cancel()}),J(BK,{className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",onClick:()=>{if(w==="collection")yK(NJ);else if(w==="share")EK(NJ);else if(w==="folder")OK(NJ)},children:W.delete()})]})]})}),J(RJ,{open:PK,onOpenChange:r,children:X(SJ,{className:"sm:max-w-md",children:[X(fJ,{children:[J(DJ,{children:XJ?W.preparing_download():W.confirm_download()}),J(YK,{children:XJ?W.resolving_files_wait():W.folder_files_download_description()})]}),XJ?X("div",{className:"space-y-4 py-6 flex flex-col items-center justify-center",children:[J(c,{className:"h-8 w-8 animate-spin text-primary"}),J("span",{className:"text-sm font-medium text-muted-foreground mt-2",children:W.preparing_download_links()})]}):X("div",{className:"space-y-4 py-2",children:[J("div",{className:"text-sm text-muted-foreground",children:W.download_includes_files({count:kJ.length})}),X("div",{className:"flex items-start gap-3 p-3 text-sm rounded-lg bg-amber-50 dark:bg-amber-950/30 text-amber-800 dark:text-amber-300 border border-amber-200 dark:border-amber-900/30",children:[J(rJ,{className:"h-5 w-5 shrink-0 mt-0.5"}),X("div",{children:[J("p",{className:"font-semibold",children:W.no_folder_structure()}),J("p",{className:"mt-0.5 text-xs text-amber-700/90 dark:text-amber-400/90",children:W.folder_structure_warning()})]})]})]}),J(hJ,{children:!XJ?X(lJ,{children:[J(E,{variant:"outline",onClick:()=>r(!1),children:W.cancel()}),X(E,{onClick:LK,className:"gap-2",disabled:kJ.length===0,children:[J(uJ,{className:"h-4 w-4"}),W.start_download()]})]}):J(E,{disabled:!0,variant:"outline",children:W.cancel()})})]})})]})}function FK({link:B,projectId:Z,dragState:$,canEdit:O,onRenameTrigger:b,onDeleteTrigger:M}){let V=QJ(),v=R({from:"/projects/$projectId/shares/$shareId",shouldThrow:!1})?.shareId===B.id,{ref:S,isDropTarget:f}=IJ({id:`share:${B.id}`,data:{type:"share-link",id:B.id}}),q=!!$?.isActive;return X("div",{ref:S,className:A("group flex cursor-pointer items-center justify-between rounded-md px-2 py-1 text-sm transition-colors hover:bg-sidebar-accent hover:text-sidebar-accent-foreground min-w-0",v&&"bg-sidebar-accent text-sidebar-accent-foreground font-medium",f&&q&&"bg-sidebar-accent ring-2 ring-primary ring-inset"),onClick:()=>V({to:"/projects/$projectId/shares/$shareId",params:{projectId:Z,shareId:B.id}}),children:[X("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[J("div",{className:"flex h-4 w-4 items-center justify-center shrink-0",children:J(KK,{className:"h-4 w-4 text-sidebar-primary"})}),J("span",{className:"truncate text-sidebar-foreground flex-1",children:B.name})]}),O&&J("div",{className:"opacity-0 group-hover:opacity-100 transition-opacity shrink-0",onClick:(Q)=>Q.stopPropagation(),children:X(UJ,{modal:!1,children:[J(BJ,{asChild:!0,children:J(E,{variant:"ghost",size:"icon-sm",className:"h-6 w-6 shrink-0 hover:bg-muted hover:text-muted-foreground p-0",children:J(HJ,{className:"h-3.5 w-3.5"})})}),X(bJ,{align:"end",className:"w-32",children:[J(F,{onClick:()=>{b(B.id,B.name)},children:W.rename()}),J(F,{className:"text-destructive focus:text-destructive focus:bg-destructive/10",onClick:()=>{M(B.id)},children:W.delete()})]})]})})]})}function qK({teamId:B,projectId:Z,folder:$,level:O,isRoot:b,dragState:M,onSelect:V,selectedFolderId:i,canEdit:v,onRenameTrigger:S,onDeleteTrigger:f,onDownloadTrigger:q,ancestorFolders:Q}){let P=_.useMemo(()=>{return Q?.some((G)=>G.id===$.id)??!1},[Q,$.id]),[h,k]=_.useState(b||P);_.useEffect(()=>{if(P)k(!0)},[P]);let o=QJ(),D=R({from:"/projects/$projectId/folders/$folderId",select:(G)=>({folderId:G.folderId}),shouldThrow:!1}),qJ=R({from:"/projects/$projectId/",shouldThrow:!1}),u=b?!!qJ:D?.folderId===$.id,{data:VJ,fetchNextPage:g,hasNextPage:I,isFetchingNextPage:x,isLoading:l}=GJ({queryKey:["folders",$.id,"children",{assetType:"folder"}],queryFn:async({pageParam:G})=>{let KJ=await U.api.folders[":folderId"].children.$get({param:{folderId:$.id},query:{assetType:"folder",after:G,first:"20"}});if(!KJ.ok)throw Error(W.failed_to_fetch_folder_children());return await KJ.json()},initialPageParam:"",getNextPageParam:(G)=>{return G.pageInfo?.cursor||void 0},enabled:h||!!b}),{ref:d,inView:n}=zJ();_.useEffect(()=>{if(n&&I&&!x)g()},[n,I,x,g]);let s=VJ?.pages.flatMap((G)=>G.data??[])??[],a=(G)=>{G.stopPropagation(),k(!h)},AJ=()=>{if(V){V($);return}if(b)o({to:"/projects/$projectId",params:{projectId:Z}});else o({to:"/projects/$projectId/folders/$folderId",params:{projectId:Z,folderId:$.id}})},{ref:t,isDragging:OJ}=ZK({id:`tree:${$.id}`,data:{type:"folder",item:$},disabled:!!b||!!V||!v}),{ref:e,isDropTarget:PJ}=IJ({id:`tree:${$.id}`,data:{type:"folder",item:$},disabled:M?.draggedIds.has($.id)||!!V||!v}),MJ=(G)=>{t(G),e(G)},LJ=_.useMemo(()=>{if(V)return!1;if(!M?.isActive)return!1;if(M.draggedIds.has($.id))return!1;return!0},[M,$.id,V]),yJ=PJ&&LJ,JJ=i===$.id;return X("div",{children:[X("div",{ref:MJ,className:A("group flex cursor-pointer items-center gap-1 rounded-md px-2 py-1.5 text-sm transition-colors hover:bg-sidebar-accent hover:text-sidebar-accent-foreground min-w-0",(u||JJ)&&"bg-sidebar-accent text-sidebar-accent-foreground font-medium",OJ&&"opacity-50",yJ&&"bg-sidebar-accent ring-2 ring-primary ring-inset"),style:{...b?{}:{paddingLeft:`${O*12+8}px`}},onClick:AJ,children:[!b&&J("button",{onClick:a,className:"flex h-4 w-4 items-center justify-center shrink-0",children:h?J(sJ,{className:"h-3 w-3"}):J(tJ,{className:"h-3 w-3"})}),b?J(eJ,{className:"h-4 w-4 text-sidebar-primary shrink-0"}):J(JK,{className:"h-4 w-4 text-sidebar-primary shrink-0"}),J("span",{className:"flex-1 truncate text-sidebar-foreground",children:$.name}),v&&!b&&J("div",{className:"opacity-0 group-hover:opacity-100 transition-opacity shrink-0",onClick:(G)=>G.stopPropagation(),children:X(UJ,{modal:!1,children:[J(BJ,{asChild:!0,children:J(E,{variant:"ghost",size:"icon-sm",className:"h-6 w-6 shrink-0 hover:bg-muted hover:text-muted-foreground p-0",children:J(HJ,{className:"h-3.5 w-3.5"})})}),X(bJ,{align:"end",className:"w-32",children:[X(F,{onClick:()=>{S($.id,$.name)},children:[J(aJ,{className:"mr-2 h-4 w-4"}),W.rename()]}),X(F,{onClick:()=>{q($.id)},children:[J(uJ,{className:"mr-2 h-4 w-4"}),W.download()]}),J(WK,{}),X(F,{className:"text-destructive focus:text-destructive focus:bg-destructive/10",onClick:()=>{f($.id)},children:[J(gJ,{className:"mr-2 h-4 w-4"}),W.delete()]})]})]})})]}),h&&X("div",{children:[l&&J("div",{className:"flex items-center justify-center p-2",style:{paddingLeft:`${(O+1)*12+8}px`},children:J(c,{className:"h-4 w-4 animate-spin"})}),s.map((G)=>J(qK,{teamId:B,projectId:Z,folder:G,level:O+1,dragState:M,onSelect:V,selectedFolderId:i,canEdit:v,onRenameTrigger:S,onDeleteTrigger:f,onDownloadTrigger:q,ancestorFolders:Q},G.id)),I&&J("div",{ref:d,className:"flex items-center justify-center p-2",style:{paddingLeft:`${(O+1)*12+8}px`},children:x&&J(c,{className:"h-4 w-4 animate-spin"})})]})]})}
2
+ export{iK as hg};
@@ -0,0 +1 @@
1
+ import{a as QJ,b as a,c as dJ}from"./chunk-7xwmj4ew.js";import{e as c,f as i,g as j,h as R,i as q,j as E}from"./chunk-ag0pavv1.js";import{S as LJ}from"./chunk-cc9fftnv.js";import{T as _J,U as u}from"./chunk-62ag2nfa.js";import{je as jJ}from"./chunk-0fpgfrv8.js";import{Fe as v,Ge as T,He as I,Ie as b,Je as g}from"./chunk-gra1fhdp.js";import{Df as O}from"./chunk-enq1hf8g.js";import{Ef as HJ}from"./chunk-vgwjg37a.js";import{Ff as kJ,Gf as FJ,Hf as MJ,Wf as mJ}from"./chunk-33hax7fe.js";import"./chunk-1ev668rp.js";import"./chunk-mnhg12fm.js";import"./chunk-6w395tfy.js";import{$g as KJ}from"./chunk-rjga1vn2.js";import{ih as JJ,kh as qJ}from"./chunk-qk9npww4.js";import"./chunk-y45tzhdn.js";import{Fh as S,Gh as C,Hh as A}from"./chunk-42et2rqa.js";import{$h as K,Ai as M,Bk as aJ,Di as rJ,Fi as GJ,Fl as EJ,Gj as x,Hl as XJ,Il as TJ,Jl as IJ,Kl as bJ,Li as wJ,Ll as gJ,Mi as k,Ml as nJ,Nl as uJ,Ol as cJ,Pl as iJ,Rk as pJ,Tk as vJ,Uk as NJ,Vi as l,Yh as t,Yk as lJ,Zh as hJ,_h as J,ai as SJ,ci as BJ,di as D,el as YJ,fi as CJ,gi as e,gk as r,kj as AJ,qi as tJ,sj as ZJ,sl as s,ul as n,xk as $J,xl as W}from"./chunk-yfgwknpa.js";import{Mm as o}from"./chunk-wwjqqqr4.js";var sJ=o(t(),1);var VJ=o(t(),1);function UJ({teamId:Y}){let[Z,z]=VJ.useState("team"),[G,Q]=VJ.useState("1h"),{data:V,isLoading:H}=D({queryKey:["teams",Y,"ai-usage",G,"team"],queryFn:async()=>{let _=await M.api.teams[":teamId"]["ai-usage"].$get({param:{teamId:Y},query:{timeframe:G}});if(!_.ok)throw Error("Failed to fetch team AI usage");return await _.json()},enabled:!!Y&&Z==="team"}),{data:f,isLoading:y}=D({queryKey:["teams",Y,"members"],queryFn:async()=>{let _=await M.api.teams[":teamId"].members.$get({param:{teamId:Y},query:{}});if(!_.ok)throw Error("Failed to fetch team members");return await _.json()},enabled:!!Y&&Z==="members"}),P=BJ({queries:(f||[]).map((_)=>({queryKey:["teams",Y,"ai-usage",G,_.id],queryFn:async()=>{let L=await M.api.teams[":teamId"]["ai-usage"].$get({param:{teamId:Y},query:{timeframe:G,userId:_.id}});if(!L.ok)throw Error(`Failed to fetch AI usage for member ${_.id}`);return await L.json()},enabled:!!Y&&Z==="members"}))}),B=y||P.some((_)=>_.isLoading),U=(_)=>{if(!_)return"U";let L=_.split(" ");if(L.length>1)return`${L[0][0]}${L[L.length-1][0]}`.toUpperCase();return _.substring(0,2).toUpperCase()},F=(_)=>{if(!_)return"";switch(_.toLowerCase()){case"owner":return W.owner();case"editor":return W.editor();case"reviewer":return W.reviewer();default:return _}},X=(_)=>(_??0).toLocaleString(),w=(_)=>`$${(_??0).toFixed(6)}`;return K(v,{className:"border-border/60 shadow-sm",children:[K(T,{className:"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between pb-6",children:[K("div",{children:[J(I,{className:"text-xl font-semibold tracking-tight",children:W.ai_usage()}),J(b,{className:"text-sm text-muted-foreground mt-1",children:W.ai_usage_description()})]}),K("div",{className:"flex flex-wrap items-center gap-3",children:[K(_J,{type:"single",value:Z,onValueChange:(_)=>{if(_)z(_)},className:"border rounded-lg p-1 bg-muted/30",children:[J(u,{value:"team",className:"px-3 py-1.5 text-xs font-medium",children:W.team_view()}),J(u,{value:"members",className:"px-3 py-1.5 text-xs font-medium",children:W.members_view()})]}),K(_J,{type:"single",value:G,onValueChange:(_)=>{if(_)Q(_)},className:"border rounded-lg p-1 bg-muted/30",children:[J(u,{value:"1h",className:"px-2.5 py-1.5 text-xs font-medium",children:"1h"}),J(u,{value:"24h",className:"px-2.5 py-1.5 text-xs font-medium",children:"24h"}),J(u,{value:"7d",className:"px-2.5 py-1.5 text-xs font-medium",children:"7d"}),J(u,{value:"30d",className:"px-2.5 py-1.5 text-xs font-medium",children:"30d"})]})]})]}),J(g,{children:Z==="team"?H?J("div",{className:"flex h-48 items-center justify-center",children:J(k,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):J("div",{className:"rounded-md border",children:K(c,{children:[J(i,{children:K(R,{children:[J(q,{children:W.team()}),J(q,{className:"text-right",children:W.input_tokens()}),J(q,{className:"text-right",children:W.output_tokens()}),J(q,{className:"text-right",children:W.cache_read_tokens()}),J(q,{className:"text-right",children:W.total_tokens()}),J(q,{className:"text-right",children:W.cost()})]})}),J(j,{children:K(R,{children:[J(E,{className:"font-medium",children:W.team()}),J(E,{className:"text-right",children:X(V?.team?.inputTokens)}),J(E,{className:"text-right",children:X(V?.team?.outputTokens)}),J(E,{className:"text-right",children:X(V?.team?.cacheReadTokens)}),J(E,{className:"text-right font-medium",children:X(V?.team?.totalTokens)}),J(E,{className:"text-right font-medium",children:w(V?.team?.cost)})]})})]})}):B?J("div",{className:"flex h-48 items-center justify-center",children:J(k,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):J("div",{className:"rounded-md border",children:K(c,{children:[J(i,{children:K(R,{children:[J(q,{children:W.members()}),J(q,{children:W.role()}),J(q,{className:"text-right",children:W.input_tokens()}),J(q,{className:"text-right",children:W.output_tokens()}),J(q,{className:"text-right",children:W.cache_read_tokens()}),J(q,{className:"text-right",children:W.total_tokens()}),J(q,{className:"text-right",children:W.cost()})]})}),J(j,{children:(f||[]).map((_,L)=>{let p=P[L]?.data?.member;return K(R,{children:[J(E,{children:K("div",{className:"flex items-center gap-3",children:[K(S,{className:"h-8 w-8 rounded-full",children:[_.image&&J(C,{src:_.image,alt:_.name,className:"object-cover"}),J(A,{className:"bg-primary/20 text-xs",children:U(_.name)})]}),K("div",{className:"flex flex-col",children:[J("span",{className:"text-sm font-medium leading-none",children:_.name}),J("span",{className:"text-xs text-muted-foreground mt-0.5",children:_.email})]})]})}),J(E,{className:"text-xs text-muted-foreground",children:F(_.role)}),J(E,{className:"text-right",children:X(p?.inputTokens)}),J(E,{className:"text-right",children:X(p?.outputTokens)}),J(E,{className:"text-right",children:X(p?.cacheReadTokens)}),J(E,{className:"text-right font-medium",children:X(p?.totalTokens)}),J(E,{className:"text-right font-medium",children:w(p?.cost)})]},_.id)})})]})})})]})}var WJ=o(t(),1);function yJ({teamId:Y}){let[Z,z]=WJ.useState(null),{ref:G,inView:Q}=KJ(),{data:V,isLoading:H,isError:f,fetchNextPage:y,hasNextPage:P,isFetchingNextPage:B}=e({queryKey:["teams",Y,"agent-sessions"],queryFn:async({pageParam:X})=>{let w=await M.api.teams[":teamId"]["agent-sessions"].$get({param:{teamId:Y},query:{first:"20",after:X?String(X):void 0}});if(!w.ok)throw Error("Failed to fetch agent sessions");return await w.json()},initialPageParam:"",getNextPageParam:(X)=>X.pageInfo.cursor||void 0,enabled:!!Y});WJ.useEffect(()=>{if(Q&&P&&!B)y()},[Q,P,B,y]);let U=V?.pages.flatMap((X)=>X.data).filter((X)=>X.id!=="pending")||[],F=(X)=>{switch(X){case"comment":return J(O,{variant:"outline",className:"bg-blue-500/10 text-blue-600 dark:text-blue-400 border-blue-500/20",children:W.session_type_comment()});case"chat":return J(O,{variant:"outline",className:"bg-violet-500/10 text-violet-600 dark:text-violet-400 border-violet-500/20",children:W.session_type_chat()});case"naming":return J(O,{variant:"outline",className:"bg-amber-500/10 text-amber-600 dark:text-amber-400 border-amber-500/20",children:W.session_type_naming()});default:return J(O,{variant:"outline",className:"bg-muted text-muted-foreground border-border",children:X})}};return K("div",{className:"space-y-6",children:[K(v,{className:"border border-border/50 shadow-xs",children:[J(T,{className:"pb-4",children:J("div",{className:"flex items-center justify-between",children:K("div",{children:[K(I,{className:"text-xl font-bold flex items-center gap-2",children:[J(r,{className:"w-5 h-5 text-violet-500"}),W.sessions()]}),J(b,{className:"mt-1 text-sm text-muted-foreground",children:W.sessions_description()})]})})}),J(g,{children:H?J("div",{className:"flex h-64 items-center justify-center",children:J(k,{className:"h-8 w-8 animate-spin text-muted-foreground"})}):f?J("div",{className:"flex h-64 items-center justify-center text-destructive",children:"Failed to load agent sessions."}):U.length===0?K("div",{className:"flex flex-col items-center justify-center py-12 text-center text-muted-foreground",children:[J(r,{className:"w-10 h-10 text-muted-foreground/40 mb-3"}),J("p",{className:"text-base font-medium",children:W.no_sessions_found()})]}):K("div",{className:"rounded-md border border-border/50 overflow-hidden",children:[K(c,{children:[J(i,{className:"bg-muted/40",children:K(R,{children:[J(q,{children:W.session_name()}),J(q,{children:W.creator()}),J(q,{children:W.session_type()}),J(q,{className:"text-right",children:W.create_time()})]})}),J(j,{children:U.map((X)=>K(R,{onClick:()=>z(X.id),className:"cursor-pointer hover:bg-muted/50 transition-colors",children:[J(E,{className:"font-medium",children:K("div",{className:"flex flex-col",children:[J("span",{className:"text-sm font-semibold text-foreground",children:X.name||W.untitled_session()}),J("span",{className:"text-xs font-mono text-muted-foreground/70",children:X.id})]})}),J(E,{children:K("div",{className:"flex items-center gap-2",children:[K(S,{className:"h-6 w-6",children:[J(C,{src:X.creator?.image||void 0}),J(A,{className:"text-[10px]",children:X.creator?.name?.[0]?.toUpperCase()||"?"})]}),J("span",{className:"text-sm text-foreground/90",children:X.creator?.name||"System / Agent"})]})}),J(E,{children:F(X.type)}),J(E,{className:"text-right text-xs text-muted-foreground",children:JJ(X.createdAt)})]},X.id))})]}),J("div",{ref:G,className:"py-4 flex justify-center",children:B&&J(k,{className:"h-6 w-6 animate-spin text-muted-foreground"})})]})})]}),J(LJ,{sessionId:Z,open:!!Z,onOpenChange:(X)=>{if(!X)z(null)}})]})}var d=o(t(),1);function RJ({...Y}){return J(YJ.Root,{"data-slot":"collapsible",...Y})}function fJ({...Y}){return J(YJ.CollapsibleTrigger,{"data-slot":"collapsible-trigger",...Y})}function DJ({...Y}){return J(YJ.CollapsibleContent,{"data-slot":"collapsible-content",...Y})}function OJ(Y){switch(Y.toLowerCase()){case"owner":return W.owner();case"editor":return W.editor();case"reviewer":return W.reviewer();default:return Y}}function YK(Y,Z){if(typeof Y==="object"&&Y!==null&&"message"in Y){let z=Y.message;if(typeof z==="string")return z}return Z}function ZK({rule:Y}){let Z=Y.resourceData??{};if(Y.resource==="agent_mcp_call_count")return J("span",{children:W.quota_target_server({value:String(Z.id??"")})});if(Y.resource==="agent_bash_call_count")return J("span",{children:W.quota_target_match({value:String(Z.match??"*")})});if(Y.resource==="agent_tool_call_count")return J("span",{children:W.quota_target_tool({value:String(Z.name??Z.toolName??"*")})});return null}function $K({rule:Y}){if(Y.scopeMode==="all_members")return K(O,{variant:"secondary",className:"gap-1 text-xs",children:[J(NJ,{className:"h-3 w-3"}),K("span",{children:[W.quota_scope_mode_all_members(),Y.role?` (${OJ(Y.role)})`:` (${W.quota_scope_team()})`]})]});if(Y.scopeMode==="each_member")return K(O,{variant:"secondary",className:"gap-1 text-xs",children:[J(vJ,{className:"h-3 w-3"}),K("span",{children:[W.quota_scope_mode_each_member(),Y.role?` (${OJ(Y.role)})`:` (${W.quota_scope_team()})`]})]});return K(O,{variant:"secondary",className:"gap-1 text-xs",children:[J(pJ,{className:"h-3 w-3"}),K("span",{children:[W.quota_scope_mode_selected_members()," (",Y.userIds?.length||0,")"]})]})}function XK({teamId:Y,rule:Z,record:z}){let G=SJ(),[Q,V]=d.useState(!1),[H,f]=d.useState(()=>new Date),y=QJ[Z.resource],P=Z.scopeMode==="all_members",B=z.percent>=100,U=P?Z.role?`${W.quota_role_shared_pool()}: ${OJ(Z.role)}`:W.quota_team_shared_pool():z.user?.name||z.userId||W.unknown();d.useEffect(()=>{if(!z.isWindowActive||!z.periodEnd)return;let X=window.setInterval(()=>f(new Date),60000);return()=>window.clearInterval(X)},[z.isWindowActive,z.periodEnd]);let F=CJ({mutationFn:async()=>{let X=await M.api.teams[":teamId"].quotas[":id"].records.reset.$post({param:{teamId:Y,id:Z.id},json:{userId:z.userId??null}});if(!X.ok){let w=await X.json().catch(()=>null);throw Error(YK(w,W.failed_to_reset_quota()))}return await X.json()},onSuccess:()=>{G.invalidateQueries({queryKey:["teams",Y,"quotas",Z.id,"records"]}),G.invalidateQueries({queryKey:["teams",Y,"quotas"]}),V(!1),EJ.success(W.quota_reset_successfully())},onError:(X)=>{let w=X instanceof Error?X.message:W.failed_to_reset_quota();V(!1),EJ.error(w)}});return K(hJ,{children:[K("div",{className:"space-y-3 rounded-xl border border-border/70 bg-card p-4 text-card-foreground shadow-2xs",children:[K("div",{className:"flex items-center justify-between gap-3",children:[K("div",{className:"flex min-w-0 items-center gap-3",children:[P?J("div",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-full bg-primary/10 text-primary",children:J(NJ,{className:"h-5 w-5"})}):K(S,{className:"h-9 w-9 shrink-0 border border-border/50",children:[J(C,{src:z.user?.image||void 0}),J(A,{className:"text-xs font-semibold",children:z.user?.name?.[0]?.toUpperCase()||"U"})]}),K("div",{className:"min-w-0",children:[J("div",{className:"truncate text-sm font-semibold text-foreground",children:U}),!P&&z.user?.email&&J("div",{className:"truncate text-xs text-muted-foreground",children:z.user.email})]})]}),K("div",{className:"flex shrink-0 items-center gap-2",children:[z.isWindowActive&&z.periodEnd?K(O,{variant:"outline",className:"hidden gap-1 border-primary/30 bg-primary/5 text-xs text-primary sm:flex",children:[J(ZJ,{className:"h-3 w-3"}),J("span",{children:W.quota_refreshes_in({time:qJ(z.periodEnd,H)})})]}):K(O,{variant:"secondary",className:"hidden gap-1 text-xs text-muted-foreground sm:flex",children:[J(GJ,{className:"h-3 w-3 text-primary"}),J("span",{children:W.quota_available()})]}),K(n,{type:"button",variant:"outline",size:"sm",className:"gap-1.5",onClick:()=>V(!0),disabled:F.isPending,children:[F.isPending?J(k,{className:"h-3.5 w-3.5 animate-spin"}):J(l,{className:"h-3.5 w-3.5"}),W.quota_reset_usage()]})]})]}),K("div",{className:"space-y-1.5 pt-1",children:[J(jJ,{value:Math.min(100,Math.max(0,z.percent)),className:"h-2"}),K("div",{className:"flex items-center justify-between gap-2 text-xs font-medium",children:[K("span",{className:B?"font-bold text-destructive":"text-foreground",children:[a(Z.resource,z.consumed)," /"," ",a(Z.resource,Z.limit)," ",y?.unit]}),K("span",{className:B?"font-bold text-destructive":"text-muted-foreground",children:[z.percent,"%"]})]})]}),K("div",{className:"flex items-center justify-between gap-2 text-xs text-muted-foreground sm:hidden",children:[z.isWindowActive&&z.periodEnd?K("span",{className:"flex items-center gap-1 text-primary",children:[J(ZJ,{className:"h-3 w-3"}),W.quota_refreshes_in({time:qJ(z.periodEnd,H)})]}):K("span",{className:"flex items-center gap-1",children:[J(GJ,{className:"h-3 w-3 text-primary"}),W.quota_available()]}),K("span",{children:[W.quota_remaining(),": ",a(Z.resource,z.remaining)," ",y?.unit]})]})]}),J(TJ,{open:Q,onOpenChange:V,children:K(IJ,{children:[K(bJ,{children:[J(nJ,{children:W.quota_reset_usage()}),J(uJ,{children:W.quota_reset_usage_confirm({target:U})})]}),K(gJ,{children:[J(iJ,{disabled:F.isPending,children:W.cancel()}),K(cJ,{onClick:(X)=>{X.preventDefault(),F.mutate()},disabled:F.isPending,children:[F.isPending&&J(k,{className:"mr-2 h-4 w-4 animate-spin"}),W.confirm()]})]})]})})]})}function zK({teamId:Y,rule:Z}){let[z,G]=d.useState(!1),[Q,V]=d.useState(""),H=QJ[Z.resource],f=H?.icon||x,{data:y,isLoading:P,isError:B}=D({queryKey:["teams",Y,"quotas",Z.id,"records"],queryFn:async()=>{let X=await M.api.teams[":teamId"].quotas[":id"].records.$get({param:{teamId:Y,id:Z.id}});if(!X.ok)throw Error(W.failed_to_load_quota_usage());return await X.json()},enabled:z,refetchInterval:z?1e4:!1}),U=y?.records??[],F=U.filter((X)=>{if(!Q.trim())return!0;let w=Q.toLowerCase();return X.user?.name.toLowerCase().includes(w)||X.user?.email.toLowerCase().includes(w)});return K(RJ,{open:z,onOpenChange:G,className:"rounded-xl border border-border/70",children:[J(fJ,{asChild:!0,children:K("button",{type:"button","aria-label":z?W.quota_collapse_rule():W.quota_expand_rule(),className:"flex w-full items-center justify-between gap-4 p-4 text-left transition-colors hover:bg-muted/40",children:[K("div",{className:"flex min-w-0 items-start gap-3",children:[J("div",{className:"mt-0.5 rounded-lg bg-primary/10 p-2 text-primary",children:J(f,{className:"h-5 w-5"})}),K("div",{className:"min-w-0",children:[K("div",{className:"flex flex-wrap items-center gap-2",children:[J("span",{className:"font-semibold text-foreground",children:H?.label()||Z.resource}),!Z.enabled&&J(O,{variant:"secondary",children:W.quota_disabled()})]}),K("div",{className:"mt-1 flex flex-wrap items-center gap-1.5 text-xs text-muted-foreground",children:[J($K,{rule:Z}),K(O,{variant:"outline",className:"gap-1 text-xs",children:[J(ZJ,{className:"h-3 w-3"}),a(Z.resource,Z.limit)," ",H?.unit," /"," ",dJ(Z.period)]}),J(ZK,{rule:Z})]})]})]}),J(AJ,{className:`h-5 w-5 shrink-0 text-muted-foreground transition-transform ${z?"rotate-180":""}`})]})}),J(DJ,{children:K("div",{className:"space-y-3 border-t border-border/60 bg-muted/10 p-4",children:[Z.scopeMode!=="all_members"&&U.length>3&&K("div",{className:"relative",children:[J($J,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),J(XJ,{value:Q,onChange:(X)=>V(X.target.value),placeholder:W.quota_search_members(),className:"h-9 pl-9 text-sm"})]}),P?J("div",{className:"flex justify-center py-10",children:J(k,{className:"h-7 w-7 animate-spin text-primary"})}):B?J("div",{className:"py-8 text-center text-sm text-destructive",children:W.failed_to_load_quota_usage()}):F.length===0?J("div",{className:"py-8 text-center text-sm text-muted-foreground",children:W.quota_no_usage_records()}):F.map((X,w)=>J(XK,{teamId:Y,rule:Z,record:X},X.id||X.userId||`record-${w}`))]})})]})}function xJ({teamId:Y}){let{data:Z,isLoading:z,isError:G}=D({queryKey:["teams",Y,"quotas"],queryFn:async()=>{let V=await M.api.teams[":teamId"].quotas.$get({param:{teamId:Y}});if(!V.ok)throw Error(W.failed_load_settings());return await V.json()},enabled:!!Y}),Q=Z?.rules??[];return K(v,{className:"border-border/60 shadow-sm",children:[K(T,{children:[K(I,{className:"flex items-center gap-2 text-xl font-semibold tracking-tight",children:[J(x,{className:"h-5 w-5 text-primary"}),W.quotas()]}),J(b,{children:W.quota_dashboard_description()})]}),J(g,{children:z?J("div",{className:"flex h-48 items-center justify-center",children:J(k,{className:"h-7 w-7 animate-spin text-muted-foreground"})}):G?J("div",{className:"py-10 text-center text-sm text-destructive",children:W.failed_load_settings()}):Q.length===0?K("div",{className:"flex flex-col items-center justify-center rounded-xl border-2 border-dashed border-border py-12 text-center",children:[J(x,{className:"mb-3 h-10 w-10 text-muted-foreground/50"}),J("p",{className:"text-base font-medium text-foreground",children:W.no_quotas_title()}),J("p",{className:"mt-1 max-w-md text-sm text-muted-foreground",children:W.no_quotas_description()})]}):J("div",{className:"space-y-3",children:Q.map((V)=>J(zK,{teamId:Y,rule:V},V.id))})})]})}var m=o(t(),1);var _K=Object.values(mJ);function oJ({teamId:Y}){let[Z,z]=m.useState([]),[G,Q]=m.useState([]),[V,H]=m.useState(""),{ref:f,inView:y}=KJ(),{data:P}=D({queryKey:["teams",Y,"members"],queryFn:async()=>{let $=await M.api.teams[":teamId"].members.$get({param:{teamId:Y},query:{}});if(!$.ok)return[];return await $.json()},enabled:!!Y}),B=P||[],{data:U,isLoading:F,isError:X,fetchNextPage:w,hasNextPage:_,isFetchingNextPage:L}=e({queryKey:["teams",Y,"audit-logs",Z,G,V],queryFn:async({pageParam:$})=>{let N=await M.api.teams[":teamId"]["audit-logs"].$get({param:{teamId:Y},query:{first:"20",after:$?String($):void 0,actions:Z.length>0?Z:void 0,userIds:G.length>0?G:void 0,itemId:V.trim()||void 0}});if(!N.ok)throw Error("Failed to fetch audit logs");return await N.json()},initialPageParam:"",getNextPageParam:($)=>$.pageInfo.endCursor||void 0,enabled:!!Y});m.useEffect(()=>{if(y&&_&&!L)w()},[y,_,L,w]);let p=U?.pages.flatMap(($)=>$.nodes)||[],PJ=U?.pages[0]?.total??0,eJ=($)=>{z((N)=>N.includes($)?N.filter((h)=>h!==$):[...N,$])},JK=($)=>{Q((N)=>N.includes($)?N.filter((h)=>h!==$):[...N,$])},KK=($)=>{if($.includes("delete")||$.includes("remove")||$.includes("revoke"))return J(O,{variant:"outline",className:"bg-destructive/10 text-destructive border-destructive/20 font-mono text-xs",children:$});if($.includes("create")||$.includes("add"))return J(O,{variant:"outline",className:"bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 border-emerald-500/20 font-mono text-xs",children:$});if($.includes("update")||$.includes("reparent")||$.includes("copy"))return J(O,{variant:"outline",className:"bg-blue-500/10 text-blue-600 dark:text-blue-400 border-blue-500/20 font-mono text-xs",children:$});return J(O,{variant:"outline",className:"bg-muted text-muted-foreground border-border font-mono text-xs",children:$})},WK=new Map(B.map(($)=>[$.userId||$.id,$]));return J("div",{className:"space-y-6",children:K(v,{className:"border border-border/50 shadow-xs",children:[K(T,{className:"pb-4",children:[K("div",{className:"flex flex-col md:flex-row md:items-center justify-between gap-4",children:[K("div",{children:[K(I,{className:"text-xl font-bold flex items-center gap-2",children:[J(l,{className:"h-5 w-5 text-primary"}),W.audit_logs()]}),J(b,{className:"mt-1",children:W.audit_logs_description()})]}),PJ>0&&K(O,{variant:"secondary",className:"w-fit text-xs font-normal",children:[PJ," ",W.audit_logs()]})]}),K("div",{className:"mt-4 flex flex-wrap items-center gap-3 pt-4 border-t border-border/40",children:[K(kJ,{children:[J(FJ,{asChild:!0,children:K(n,{variant:"outline",size:"sm",className:"h-9 gap-2 text-xs border-dashed",children:[J(wJ,{className:"h-3.5 w-3.5"}),W.filter_by_action(),Z.length>0&&J(O,{variant:"secondary",className:"ml-1 px-1.5 py-0 text-[10px]",children:Z.length})]})}),K(MJ,{className:"w-64 p-2",align:"start",children:[J("div",{className:"text-xs font-semibold text-muted-foreground px-2 py-1 mb-1",children:W.select_actions()}),J("div",{className:"max-h-60 overflow-y-auto space-y-1 pr-1",children:_K.map(($)=>K("label",{className:"flex items-center gap-2 px-2 py-1.5 hover:bg-accent rounded-md cursor-pointer text-xs",children:[J(HJ,{checked:Z.includes($),onCheckedChange:()=>eJ($)}),J("span",{className:"font-mono",children:$})]},$))}),Z.length>0&&J(n,{variant:"ghost",size:"sm",className:"w-full mt-2 h-7 text-xs text-muted-foreground hover:text-foreground",onClick:()=>z([]),children:"Clear Actions"})]})]}),K(kJ,{children:[J(FJ,{asChild:!0,children:K(n,{variant:"outline",size:"sm",className:"h-9 gap-2 text-xs border-dashed",children:[J(wJ,{className:"h-3.5 w-3.5"}),W.filter_by_user(),G.length>0&&J(O,{variant:"secondary",className:"ml-1 px-1.5 py-0 text-[10px]",children:G.length})]})}),K(MJ,{className:"w-64 p-2",align:"start",children:[J("div",{className:"text-xs font-semibold text-muted-foreground px-2 py-1 mb-1",children:W.select_users()}),J("div",{className:"max-h-60 overflow-y-auto space-y-1 pr-1",children:B.map(($)=>{let N=$.userId||$.user?.id||$.id,h=$.user?.name||$.name||N,zJ=$.user?.image||$.image;return K("label",{className:"flex items-center gap-2 px-2 py-1.5 hover:bg-accent rounded-md cursor-pointer text-xs",children:[J(HJ,{checked:G.includes(N),onCheckedChange:()=>JK(N)}),K(S,{className:"h-5 w-5",children:[J(C,{src:zJ||void 0}),J(A,{className:"text-[10px]",children:h.slice(0,2).toUpperCase()})]}),J("span",{className:"truncate",children:h})]},N)})}),G.length>0&&J(n,{variant:"ghost",size:"sm",className:"w-full mt-2 h-7 text-xs text-muted-foreground hover:text-foreground",onClick:()=>Q([]),children:"Clear Users"})]})]}),K("div",{className:"relative flex-1 min-w-[200px] max-w-xs",children:[J($J,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),J(XJ,{type:"text",placeholder:W.search_item_id(),value:V,onChange:($)=>H($.target.value),className:"pl-8 pr-8 h-9 text-xs"}),V&&J("button",{onClick:()=>H(""),className:"absolute right-2.5 top-2.5 text-muted-foreground hover:text-foreground",children:J(lJ,{className:"h-4 w-4"})})]}),(Z.length>0||G.length>0||V)&&J(n,{variant:"ghost",size:"sm",className:"h-9 px-2 text-xs text-muted-foreground hover:text-foreground",onClick:()=>{z([]),Q([]),H("")},children:"Clear all"})]})]}),K(g,{className:"p-0",children:[F?J("div",{className:"flex h-64 items-center justify-center",children:J(k,{className:"h-8 w-8 animate-spin text-muted-foreground"})}):X?J("div",{className:"p-8 text-center text-sm text-destructive",children:"Failed to load audit logs."}):p.length===0?J("div",{className:"p-12 text-center text-sm text-muted-foreground",children:W.no_audit_logs()}):K(c,{children:[J(i,{children:K(R,{className:"hover:bg-transparent border-b border-border/50",children:[J(q,{className:"w-[180px] text-xs font-semibold",children:W.action()}),J(q,{className:"w-[200px] text-xs font-semibold",children:W.user()}),J(q,{className:"text-xs font-semibold",children:W.item_id()}),J(q,{className:"text-xs font-semibold",children:W.project_id()}),J(q,{className:"w-[160px] text-right text-xs font-semibold",children:W.timestamp()})]})}),J(j,{children:p.map(($)=>{let N=$.userId?WK.get($.userId):null,h=N?.user?.name||N?.name||$.userId||"System",zJ=N?.user?.image||N?.image;return K(R,{className:"hover:bg-muted/40 transition-colors",children:[J(E,{className:"py-3 font-medium",children:KK($.action)}),J(E,{className:"py-3",children:K("div",{className:"flex items-center gap-2",children:[K(S,{className:"h-6 w-6",children:[J(C,{src:zJ||void 0}),J(A,{className:"text-[10px]",children:h.slice(0,2).toUpperCase()})]}),J("span",{className:"text-xs font-medium text-foreground truncate max-w-[140px]",children:h})]})}),J(E,{className:"py-3 text-xs font-mono text-muted-foreground",children:$.itemId||"-"}),J(E,{className:"py-3 text-xs font-mono text-muted-foreground",children:$.projectId||"-"}),J(E,{className:"py-3 text-right text-xs text-muted-foreground",children:JJ($.createdAt)})]},$.id)})})]}),J("div",{ref:f,className:"py-4 flex justify-center",children:L&&J(k,{className:"h-6 w-6 animate-spin text-muted-foreground"})})]})]})})}function VK(){let{teamId:Y}=GK.useParams(),[Z,z]=sJ.useState("audit-logs"),{data:G,isLoading:Q}=D({queryKey:["teams",Y,"me"],queryFn:async()=>{let V=await M.api.teams[":teamId"].me.$get({param:{teamId:Y}});if(!V.ok)throw Error("Failed to fetch me");return await V.json()},enabled:!!Y});if(Q)return J("div",{className:"flex h-screen items-center justify-center",children:J(k,{className:"h-8 w-8 animate-spin text-muted-foreground"})});if(G?.role?.toLowerCase()!=="owner")return K("div",{className:"flex h-full flex-col items-center justify-center p-8 text-center",children:[J(aJ,{className:"h-12 w-12 text-destructive mb-4"}),J("h2",{className:"text-xl font-bold tracking-tight mb-2",children:W.access_denied()}),J("p",{className:"text-sm text-muted-foreground max-w-md",children:W.only_owner_dashboard()})]});return J("div",{className:"h-full bg-background font-sans selection:bg-primary/20 transition-colors duration-300",children:K("div",{className:"flex flex-col md:flex-row h-full",children:[J("div",{className:"w-full h-full md:w-72 bg-sidebar border-b md:border-b-0 md:border-r border-sidebar-border z-10 md:left-16 overflow-y-auto transition-colors duration-300",children:K("nav",{className:"p-4 space-y-1 mt-4",children:[J("div",{className:"mb-2 px-4 text-xs font-semibold text-sidebar-foreground/60 uppercase tracking-wider",children:W.dashboard()}),J("div",{className:"mt-4 mb-2 px-4 text-xs font-semibold text-sidebar-foreground/60 uppercase tracking-wider pt-4 border-t border-sidebar-border",children:W.team_category()}),K("button",{onClick:()=>z("audit-logs"),className:s("w-full flex items-center gap-3 px-4 py-3 text-sm font-medium rounded-lg transition-all",Z==="audit-logs"?"bg-sidebar-accent text-sidebar-accent-foreground ring-1 ring-sidebar-border":"text-sidebar-foreground/75 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground"),children:[J(l,{className:"w-5 h-5"}),W.audit_logs(),Z==="audit-logs"&&J("div",{className:"ml-auto w-1.5 h-1.5 rounded-full bg-sidebar-primary"})]}),K("button",{onClick:()=>z("quotas"),className:s("w-full flex items-center gap-3 px-4 py-3 text-sm font-medium rounded-lg transition-all",Z==="quotas"?"bg-sidebar-accent text-sidebar-accent-foreground ring-1 ring-sidebar-border":"text-sidebar-foreground/75 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground"),children:[J(x,{className:"w-5 h-5"}),W.quotas(),Z==="quotas"&&J("div",{className:"ml-auto w-1.5 h-1.5 rounded-full bg-sidebar-primary"})]}),J("div",{className:"mt-4 mb-2 px-4 text-xs font-semibold text-sidebar-foreground/60 uppercase tracking-wider pt-4 border-t border-sidebar-border",children:W.ai()}),K("button",{onClick:()=>z("ai-usage"),className:s("w-full flex items-center gap-3 px-4 py-3 text-sm font-medium rounded-lg transition-all",Z==="ai-usage"?"bg-sidebar-accent text-sidebar-accent-foreground ring-1 ring-sidebar-border":"text-sidebar-foreground/75 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground"),children:[J(rJ,{className:"w-5 h-5"}),W.usage(),Z==="ai-usage"&&J("div",{className:"ml-auto w-1.5 h-1.5 rounded-full bg-sidebar-primary"})]}),K("button",{onClick:()=>z("ai-sessions"),className:s("w-full flex items-center gap-3 px-4 py-3 text-sm font-medium rounded-lg transition-all",Z==="ai-sessions"?"bg-sidebar-accent text-sidebar-accent-foreground ring-1 ring-sidebar-border":"text-sidebar-foreground/75 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground"),children:[J(r,{className:"w-5 h-5"}),W.sessions(),Z==="ai-sessions"&&J("div",{className:"ml-auto w-1.5 h-1.5 rounded-full bg-sidebar-primary"})]})]})}),J("div",{className:"flex-1 overflow-y-auto p-4 md:p-8",children:K("div",{className:"max-w-6xl mx-auto space-y-8",children:[Z==="audit-logs"&&J(oJ,{teamId:Y}),Z==="ai-usage"&&J(UJ,{teamId:Y}),Z==="ai-sessions"&&J(yJ,{teamId:Y}),Z==="quotas"&&J(xJ,{teamId:Y})]})})]})})}var GK=tJ("/teams/$teamId/dashboard")({component:VK});export{GK as Route};
@@ -1,4 +1,4 @@
1
- import{Lh as L9,Mh as K0,Nh as Q0,Oh as J0}from"./chunk-5ctpz542.js";import{nm as q7,om as o5,pm as QZ}from"./chunk-j4byth37.js";var VZ=o5((I1,_Z)=>{var qZ=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,A0=/\n/g,z0=/^\s*/,T0=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,C0=/^:\s*/,O0=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,w0=/^[;\s]*/,P0=/^\s+|\s+$/g,I0=`
1
+ import{$h as J0,Yh as L9,Zh as K0,_h as Q0}from"./chunk-yfgwknpa.js";import{Mm as q7,Nm as o5,Om as QZ}from"./chunk-wwjqqqr4.js";var VZ=o5((I1,_Z)=>{var qZ=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,A0=/\n/g,z0=/^\s*/,T0=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,C0=/^:\s*/,O0=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,w0=/^[;\s]*/,P0=/^\s+|\s+$/g,I0=`
2
2
  `,YZ="/",$Z="*",I5="",S0="comment",E0="declaration";function b0(Z,K){if(typeof Z!=="string")throw TypeError("First argument must be a string");if(!Z)return[];K=K||{};var Q=1,J=1;function X(F){var R=F.match(A0);if(R)Q+=R.length;var O=F.lastIndexOf(I0);J=~O?F.length-O:J+F.length}function H(){var F={line:Q,column:J};return function(R){return R.position=new W(F),$(),R}}function W(F){this.start=F,this.end={line:Q,column:J},this.source=K.source}W.prototype.content=Z;function G(F){var R=Error(K.source+":"+Q+":"+J+": "+F);if(R.reason=F,R.filename=K.source,R.line=Q,R.column=J,R.source=Z,K.silent);else throw R}function q(F){var R=F.exec(Z);if(!R)return;var O=R[0];return X(O),Z=Z.slice(O.length),R}function $(){q(z0)}function D(F){var R;F=F||[];while(R=N())if(R!==!1)F.push(R);return F}function N(){var F=H();if(YZ!=Z.charAt(0)||$Z!=Z.charAt(1))return;var R=2;while(I5!=Z.charAt(R)&&($Z!=Z.charAt(R)||YZ!=Z.charAt(R+1)))++R;if(R+=2,I5===Z.charAt(R-1))return G("End of comment missing");var O=Z.slice(2,R-2);return J+=2,X(O),Z=Z.slice(R),J+=2,F({type:S0,comment:O})}function _(){var F=H(),R=q(T0);if(!R)return;if(N(),!q(C0))return G("property missing ':'");var O=q(O0),j=F({type:E0,property:UZ(R[0].replace(qZ,I5)),value:O?UZ(O[0].replace(qZ,I5)):I5});return q(w0),j}function Y(){var F=[];D(F);var R;while(R=_())if(R!==!1)F.push(R),D(F);return F}return $(),Y()}function UZ(Z){return Z?Z.replace(P0,I5):I5}_Z.exports=b0});var NZ=o5((t5)=>{var g0=t5&&t5.__importDefault||function(Z){return Z&&Z.__esModule?Z:{default:Z}};Object.defineProperty(t5,"__esModule",{value:!0});t5.default=x0;var y0=g0(VZ());function x0(Z,K){let Q=null;if(!Z||typeof Z!=="string")return Q;let J=(0,y0.default)(Z),X=typeof K==="function";return J.forEach((H)=>{if(H.type!=="declaration")return;let{property:W,value:G}=H;if(X)K(W,G,H);else if(G)Q=Q||{},Q[W]=G}),Q}});var FZ=o5((LZ)=>{Object.defineProperty(LZ,"__esModule",{value:!0});LZ.camelCase=void 0;var h0=/^--[a-zA-Z0-9_-]+$/,k0=/-([a-z])/g,m0=/^[^-]+$/,v0=/^-(webkit|moz|ms|o|khtml)-/,p0=/^-(ms)-/,u0=function(Z){return!Z||m0.test(Z)||h0.test(Z)},l0=function(Z,K){return K.toUpperCase()},MZ=function(Z,K){return"".concat(K,"-")},f0=function(Z,K){if(K===void 0)K={};if(u0(Z))return Z;if(Z=Z.toLowerCase(),K.reactCompat)Z=Z.replace(p0,MZ);else Z=Z.replace(v0,MZ);return Z.replace(k0,l0)};LZ.camelCase=f0});var jZ=o5((W7,RZ)=>{var i0=W7&&W7.__importDefault||function(Z){return Z&&Z.__esModule?Z:{default:Z}},r0=i0(NZ()),a0=FZ();function H7(Z,K){var Q={};if(!Z||typeof Z!=="string")return Q;return(0,r0.default)(Z,function(J,X){if(J&&X)Q[(0,a0.camelCase)(J,K)]=X}),Q}H7.default=H7;RZ.exports=H7});var r4=o5((FH,i4)=>{var r6=Object.prototype.hasOwnProperty,f4=Object.prototype.toString,k4=Object.defineProperty,m4=Object.getOwnPropertyDescriptor,v4=function(K){if(typeof Array.isArray==="function")return Array.isArray(K);return f4.call(K)==="[object Array]"},p4=function(K){if(!K||f4.call(K)!=="[object Object]")return!1;var Q=r6.call(K,"constructor"),J=K.constructor&&K.constructor.prototype&&r6.call(K.constructor.prototype,"isPrototypeOf");if(K.constructor&&!Q&&!J)return!1;var X;for(X in K);return typeof X>"u"||r6.call(K,X)},u4=function(K,Q){if(k4&&Q.name==="__proto__")k4(K,Q.name,{enumerable:!0,configurable:!0,value:Q.newValue,writable:!0});else K[Q.name]=Q.newValue},l4=function(K,Q){if(Q==="__proto__"){if(!r6.call(K,Q))return;else if(m4)return m4(K,Q).value}return K[Q]};i4.exports=function Z(){var K,Q,J,X,H,W,G=arguments[0],q=1,$=arguments.length,D=!1;if(typeof G==="boolean")D=G,G=arguments[1]||{},q=2;if(G==null||typeof G!=="object"&&typeof G!=="function")G={};for(;q<$;++q)if(K=arguments[q],K!=null){for(Q in K)if(J=l4(G,Q),X=l4(K,Q),G!==X){if(D&&X&&(p4(X)||(H=v4(X)))){if(H)H=!1,W=J&&v4(J)?J:[];else W=J&&p4(J)?J:{};u4(G,{name:Q,newValue:Z(D,W,X)})}else if(typeof X<"u")u4(G,{name:Q,newValue:X})}}return G}});function Z5(){}function M6(){}function ZZ(Z,K){let Q=K||{};return(Z[Z.length-1]===""?[...Z,""]:Z).join((Q.padRight?" ":"")+","+(Q.padLeft===!1?"":" ")).trim()}var _0=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,V0=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,N0={};function L6(Z,K){return((K||N0).jsx?V0:_0).test(Z)}var M0=/[ \t\n\f\r]/g;function n6(Z){return typeof Z==="object"?Z.type==="text"?KZ(Z.value):!1:KZ(Z)}function KZ(Z){return Z.replace(M0,"")===""}class R5{constructor(Z,K,Q){if(this.normal=K,this.property=Z,Q)this.space=Q}}R5.prototype.normal={};R5.prototype.property={};R5.prototype.space=void 0;function o6(Z,K){let Q={},J={};for(let X of Z)Object.assign(Q,X.property),Object.assign(J,X.normal);return new R5(Q,J,K)}function s5(Z){return Z.toLowerCase()}class o{constructor(Z,K){this.attribute=K,this.property=Z}}o.prototype.attribute="";o.prototype.booleanish=!1;o.prototype.boolean=!1;o.prototype.commaOrSpaceSeparated=!1;o.prototype.commaSeparated=!1;o.prototype.defined=!1;o.prototype.mustUseProperty=!1;o.prototype.number=!1;o.prototype.overloadedBoolean=!1;o.prototype.property="";o.prototype.spaceSeparated=!1;o.prototype.space=void 0;var n5={};QZ(n5,{spaceSeparated:()=>x,overloadedBoolean:()=>B6,number:()=>L,commaSeparated:()=>B5,commaOrSpaceSeparated:()=>Q5,booleanish:()=>i,boolean:()=>w});var L0=0,w=P5(),i=P5(),B6=P5(),L=P5(),x=P5(),B5=P5(),Q5=P5();function P5(){return 2**++L0}var t6=Object.keys(n5);class h5 extends o{constructor(Z,K,Q,J){let X=-1;super(Z,K);if(JZ(this,"space",J),typeof Q==="number")while(++X<t6.length){let H=t6[X];JZ(this,t6[X],(Q&n5[H])===n5[H])}}}h5.prototype.defined=!0;function JZ(Z,K,Q){if(Q)Z[K]=Q}function W5(Z){let K={},Q={};for(let[J,X]of Object.entries(Z.properties)){let H=new h5(J,Z.transform(Z.attributes||{},J),X,Z.space);if(Z.mustUseProperty&&Z.mustUseProperty.includes(J))H.mustUseProperty=!0;K[J]=H,Q[s5(J)]=J,Q[s5(H.attribute)]=J}return new R5(K,Q,Z.space)}var e6=W5({properties:{ariaActiveDescendant:null,ariaAtomic:i,ariaAutoComplete:null,ariaBusy:i,ariaChecked:i,ariaColCount:L,ariaColIndex:L,ariaColSpan:L,ariaControls:x,ariaCurrent:null,ariaDescribedBy:x,ariaDetails:null,ariaDisabled:i,ariaDropEffect:x,ariaErrorMessage:null,ariaExpanded:i,ariaFlowTo:x,ariaGrabbed:i,ariaHasPopup:null,ariaHidden:i,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:x,ariaLevel:L,ariaLive:null,ariaModal:i,ariaMultiLine:i,ariaMultiSelectable:i,ariaOrientation:null,ariaOwns:x,ariaPlaceholder:null,ariaPosInSet:L,ariaPressed:i,ariaReadOnly:i,ariaRelevant:null,ariaRequired:i,ariaRoleDescription:x,ariaRowCount:L,ariaRowIndex:L,ariaRowSpan:L,ariaSelected:i,ariaSetSize:L,ariaSort:null,ariaValueMax:L,ariaValueMin:L,ariaValueNow:L,ariaValueText:null,role:null},transform(Z,K){return K==="role"?K:"aria-"+K.slice(4).toLowerCase()}});function F6(Z,K){return K in Z?Z[K]:K}function R6(Z,K){return F6(Z,K.toLowerCase())}var XZ=W5({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:B5,acceptCharset:x,accessKey:x,action:null,allow:null,allowFullScreen:w,allowPaymentRequest:w,allowUserMedia:w,alpha:w,alt:null,as:null,async:w,autoCapitalize:null,autoComplete:x,autoFocus:w,autoPlay:w,blocking:x,capture:null,charSet:null,checked:w,cite:null,className:x,closedBy:null,colorSpace:null,cols:L,colSpan:L,command:null,commandFor:null,content:null,contentEditable:i,controls:w,controlsList:x,coords:L|B5,crossOrigin:null,data:null,dateTime:null,decoding:null,default:w,defer:w,dir:null,dirName:null,disabled:w,download:B6,draggable:i,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:w,formTarget:null,headers:x,height:L,hidden:B6,high:L,href:null,hrefLang:null,htmlFor:x,httpEquiv:x,id:null,imageSizes:null,imageSrcSet:null,inert:w,inputMode:null,integrity:null,is:null,isMap:w,itemId:null,itemProp:x,itemRef:x,itemScope:w,itemType:x,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:w,low:L,manifest:null,max:null,maxLength:L,media:null,method:null,min:null,minLength:L,multiple:w,muted:w,name:null,nonce:null,noModule:w,noValidate:w,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:w,optimum:L,pattern:null,ping:x,placeholder:null,playsInline:w,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:w,referrerPolicy:null,rel:x,required:w,reversed:w,rows:L,rowSpan:L,sandbox:x,scope:null,scoped:w,seamless:w,selected:w,shadowRootClonable:w,shadowRootCustomElementRegistry:w,shadowRootDelegatesFocus:w,shadowRootMode:null,shadowRootSerializable:w,shape:null,size:L,sizes:null,slot:null,span:L,spellCheck:i,src:null,srcDoc:null,srcLang:null,srcSet:null,start:L,step:null,style:null,tabIndex:L,target:null,title:null,translate:null,type:null,typeMustMatch:w,useMap:null,value:i,width:L,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:x,axis:null,background:null,bgColor:null,border:L,borderColor:null,bottomMargin:L,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:w,declare:w,event:null,face:null,frame:null,frameBorder:null,hSpace:L,leftMargin:L,link:null,longDesc:null,lowSrc:null,marginHeight:L,marginWidth:L,noResize:w,noHref:w,noShade:w,noWrap:w,object:null,profile:null,prompt:null,rev:null,rightMargin:L,rules:null,scheme:null,scrolling:i,standby:null,summary:null,text:null,topMargin:L,valueType:null,version:null,vAlign:null,vLink:null,vSpace:L,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:w,disablePictureInPicture:w,disableRemotePlayback:w,exportParts:B5,part:x,prefix:null,property:null,results:L,security:null,unselectable:null},space:"html",transform:R6});var HZ=W5({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",maskType:"mask-type",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Q5,accentHeight:L,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:L,amplitude:L,arabicForm:null,ascent:L,attributeName:null,attributeType:null,azimuth:L,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:L,by:null,calcMode:null,capHeight:L,className:x,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:L,diffuseConstant:L,direction:null,display:null,dur:null,divisor:L,dominantBaseline:null,download:w,dx:null,dy:null,edgeMode:null,editable:null,elevation:L,enableBackground:null,end:null,event:null,exponent:L,externalResourcesRequired:null,fill:null,fillOpacity:L,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:B5,g2:B5,glyphName:B5,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:L,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:L,horizOriginX:L,horizOriginY:L,id:null,ideographic:L,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:L,k:L,k1:L,k2:L,k3:L,k4:L,kernelMatrix:Q5,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:L,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:L,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:L,overlineThickness:L,paintOrder:null,panose1:null,path:null,pathLength:L,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:x,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:L,pointsAtY:L,pointsAtZ:L,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Q5,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Q5,rev:Q5,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Q5,requiredFeatures:Q5,requiredFonts:Q5,requiredFormats:Q5,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:L,specularExponent:L,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:L,strikethroughThickness:L,string:null,stroke:null,strokeDashArray:Q5,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:L,strokeOpacity:L,strokeWidth:null,style:null,surfaceScale:L,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Q5,tabIndex:L,tableValues:null,target:null,targetX:L,targetY:L,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Q5,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:L,underlineThickness:L,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:L,values:null,vAlphabetic:L,vMathematical:L,vectorEffect:null,vHanging:L,vIdeographic:L,version:null,vertAdvY:L,vertOriginX:L,vertOriginY:L,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:L,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:F6});var Z7=W5({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(Z,K){return"xlink:"+K.slice(5).toLowerCase()}});var K7=W5({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:R6});var Q7=W5({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(Z,K){return"xml:"+K.slice(3).toLowerCase()}});var J7={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"};var B0=/[A-Z]/g,WZ=/-[a-z]/g,F0=/^data[-\w.:]+$/i;function X7(Z,K){let Q=s5(K),J=K,X=o;if(Q in Z.normal)return Z.property[Z.normal[Q]];if(Q.length>4&&Q.slice(0,4)==="data"&&F0.test(K)){if(K.charAt(4)==="-"){let H=K.slice(5).replace(WZ,j0);J="data"+H.charAt(0).toUpperCase()+H.slice(1)}else{let H=K.slice(4);if(!WZ.test(H)){let W=H.replace(B0,R0);if(W.charAt(0)!=="-")W="-"+W;K="data"+W}}X=h5}return new X(J,K)}function R0(Z){return"-"+Z.toLowerCase()}function j0(Z){return Z.charAt(1).toUpperCase()}var GZ=o6([e6,XZ,Z7,K7,Q7],"html"),j6=o6([e6,HZ,Z7,K7,Q7],"svg");function DZ(Z){return Z.join(" ").trim()}var CZ=q7(jZ(),1);var A6=AZ("end"),k5=AZ("start");function AZ(Z){return K;function K(Q){let J=Q&&Q.position&&Q.position[Z]||{};if(typeof J.line==="number"&&J.line>0&&typeof J.column==="number"&&J.column>0)return{line:J.line,column:J.column,offset:typeof J.offset==="number"&&J.offset>-1?J.offset:void 0}}}function G7(Z){let K=k5(Z),Q=A6(Z);if(K&&Q)return{start:K,end:Q}}function j5(Z){if(!Z||typeof Z!=="object")return"";if("position"in Z||"type"in Z)return zZ(Z.position);if("start"in Z||"end"in Z)return zZ(Z);if("line"in Z||"column"in Z)return D7(Z);return""}function D7(Z){return TZ(Z&&Z.line)+":"+TZ(Z&&Z.column)}function zZ(Z){return D7(Z&&Z.start)+"-"+D7(Z&&Z.end)}function TZ(Z){return Z&&typeof Z==="number"?Z:1}class d extends Error{constructor(Z,K,Q){super();if(typeof K==="string")Q=K,K=void 0;let J="",X={},H=!1;if(K)if("line"in K&&"column"in K)X={place:K};else if("start"in K&&"end"in K)X={place:K};else if("type"in K)X={ancestors:[K],place:K.position};else X={...K};if(typeof Z==="string")J=Z;else if(!X.cause&&Z)H=!0,J=Z.message,X.cause=Z;if(!X.ruleId&&!X.source&&typeof Q==="string"){let G=Q.indexOf(":");if(G===-1)X.ruleId=Q;else X.source=Q.slice(0,G),X.ruleId=Q.slice(G+1)}if(!X.place&&X.ancestors&&X.ancestors){let G=X.ancestors[X.ancestors.length-1];if(G)X.place=G.position}let W=X.place&&"start"in X.place?X.place.start:X.place;this.ancestors=X.ancestors||void 0,this.cause=X.cause||void 0,this.column=W?W.column:void 0,this.fatal=void 0,this.file="",this.message=J,this.line=W?W.line:void 0,this.name=j5(X.place)||"1:1",this.place=X.place||void 0,this.reason=this.message,this.ruleId=X.ruleId||void 0,this.source=X.source||void 0,this.stack=H&&X.cause&&typeof X.cause.stack==="string"?X.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}d.prototype.file="";d.prototype.name="";d.prototype.reason="";d.prototype.message="";d.prototype.stack="";d.prototype.column=void 0;d.prototype.line=void 0;d.prototype.ancestors=void 0;d.prototype.cause=void 0;d.prototype.fatal=void 0;d.prototype.place=void 0;d.prototype.ruleId=void 0;d.prototype.source=void 0;var Y7={}.hasOwnProperty,d0=new Map,c0=/[A-Z]/g,s0=new Set(["table","tbody","thead","tfoot","tr"]),n0=new Set(["td","th"]),OZ="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function $7(Z,K){if(!K||K.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let Q=K.filePath||void 0,J;if(K.development){if(typeof K.jsxDEV!=="function")throw TypeError("Expected `jsxDEV` in options when `development: true`");J=XK(Q,K.jsxDEV)}else{if(typeof K.jsx!=="function")throw TypeError("Expected `jsx` in production options");if(typeof K.jsxs!=="function")throw TypeError("Expected `jsxs` in production options");J=JK(Q,K.jsx,K.jsxs)}let X={Fragment:K.Fragment,ancestors:[],components:K.components||{},create:J,elementAttributeNameCase:K.elementAttributeNameCase||"react",evaluater:K.createEvaluater?K.createEvaluater():void 0,filePath:Q,ignoreInvalidStyle:K.ignoreInvalidStyle||!1,passKeys:K.passKeys!==!1,passNode:K.passNode||!1,schema:K.space==="svg"?j6:GZ,stylePropertyNameCase:K.stylePropertyNameCase||"dom",tableCellAlignToStyle:K.tableCellAlignToStyle!==!1},H=wZ(X,Z,void 0);if(H&&typeof H!=="string")return H;return X.create(Z,X.Fragment,{children:H||void 0},void 0)}function wZ(Z,K,Q){if(K.type==="element")return o0(Z,K,Q);if(K.type==="mdxFlowExpression"||K.type==="mdxTextExpression")return t0(Z,K);if(K.type==="mdxJsxFlowElement"||K.type==="mdxJsxTextElement")return ZK(Z,K,Q);if(K.type==="mdxjsEsm")return e0(Z,K);if(K.type==="root")return KK(Z,K,Q);if(K.type==="text")return QK(Z,K)}function o0(Z,K,Q){let J=Z.schema,X=J;if(K.tagName.toLowerCase()==="svg"&&J.space==="html")X=j6,Z.schema=X;Z.ancestors.push(K);let H=IZ(Z,K.tagName,!1),W=HK(Z,K),G=_7(Z,K);if(s0.has(K.tagName))G=G.filter(function(q){return typeof q==="string"?!n6(q):!0});return PZ(Z,W,H,K),U7(W,G),Z.ancestors.pop(),Z.schema=J,Z.create(K,H,W,Q)}function t0(Z,K){if(K.data&&K.data.estree&&Z.evaluater){let J=K.data.estree.body[0];return Z5(J.type==="ExpressionStatement"),Z.evaluater.evaluateExpression(J.expression)}e5(Z,K.position)}function e0(Z,K){if(K.data&&K.data.estree&&Z.evaluater)return Z.evaluater.evaluateProgram(K.data.estree);e5(Z,K.position)}function ZK(Z,K,Q){let J=Z.schema,X=J;if(K.name==="svg"&&J.space==="html")X=j6,Z.schema=X;Z.ancestors.push(K);let H=K.name===null?Z.Fragment:IZ(Z,K.name,!0),W=WK(Z,K),G=_7(Z,K);return PZ(Z,W,H,K),U7(W,G),Z.ancestors.pop(),Z.schema=J,Z.create(K,H,W,Q)}function KK(Z,K,Q){let J={};return U7(J,_7(Z,K)),Z.create(K,Z.Fragment,J,Q)}function QK(Z,K){return K.value}function PZ(Z,K,Q,J){if(typeof Q!=="string"&&Q!==Z.Fragment&&Z.passNode)K.node=J}function U7(Z,K){if(K.length>0){let Q=K.length>1?K:K[0];if(Q)Z.children=Q}}function JK(Z,K,Q){return J;function J(X,H,W,G){let $=Array.isArray(W.children)?Q:K;return G?$(H,W,G):$(H,W)}}function XK(Z,K){return Q;function Q(J,X,H,W){let G=Array.isArray(H.children),q=k5(J);return K(X,H,W,G,{columnNumber:q?q.column-1:void 0,fileName:Z,lineNumber:q?q.line:void 0},void 0)}}function HK(Z,K){let Q={},J,X;for(X in K.properties)if(X!=="children"&&Y7.call(K.properties,X)){let H=GK(Z,X,K.properties[X]);if(H){let[W,G]=H;if(Z.tableCellAlignToStyle&&W==="align"&&typeof G==="string"&&n0.has(K.tagName))J=G;else Q[W]=G}}if(J){let H=Q.style||(Q.style={});H[Z.stylePropertyNameCase==="css"?"text-align":"textAlign"]=J}return Q}function WK(Z,K){let Q={};for(let J of K.attributes)if(J.type==="mdxJsxExpressionAttribute")if(J.data&&J.data.estree&&Z.evaluater){let H=J.data.estree.body[0];Z5(H.type==="ExpressionStatement");let W=H.expression;Z5(W.type==="ObjectExpression");let G=W.properties[0];Z5(G.type==="SpreadElement"),Object.assign(Q,Z.evaluater.evaluateExpression(G.argument))}else e5(Z,K.position);else{let X=J.name,H;if(J.value&&typeof J.value==="object")if(J.value.data&&J.value.data.estree&&Z.evaluater){let G=J.value.data.estree.body[0];Z5(G.type==="ExpressionStatement"),H=Z.evaluater.evaluateExpression(G.expression)}else e5(Z,K.position);else H=J.value===null?!0:J.value;Q[X]=H}return Q}function _7(Z,K){let Q=[],J=-1,X=Z.passKeys?new Map:d0;while(++J<K.children.length){let H=K.children[J],W;if(Z.passKeys){let q=H.type==="element"?H.tagName:H.type==="mdxJsxFlowElement"||H.type==="mdxJsxTextElement"?H.name:void 0;if(q){let $=X.get(q)||0;W=q+"-"+$,X.set(q,$+1)}}let G=wZ(Z,H,W);if(G!==void 0)Q.push(G)}return Q}function GK(Z,K,Q){let J=X7(Z.schema,K);if(Q===null||Q===void 0||typeof Q==="number"&&Number.isNaN(Q))return;if(Array.isArray(Q))Q=J.commaSeparated?ZZ(Q):DZ(Q);if(J.property==="style"){let X=typeof Q==="object"?Q:DK(Z,String(Q));if(Z.stylePropertyNameCase==="css")X=qK(X);return["style",X]}return[Z.elementAttributeNameCase==="react"&&J.space?J7[J.property]||J.property:J.attribute,Q]}function DK(Z,K){try{return CZ.default(K,{reactCompat:!0})}catch(Q){if(Z.ignoreInvalidStyle)return{};let J=Q,X=new d("Cannot parse `style` attribute",{ancestors:Z.ancestors,cause:J,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw X.file=Z.filePath||void 0,X.url=OZ+"#cannot-parse-style-attribute",X}}function IZ(Z,K,Q){let J;if(!Q)J={type:"Literal",value:K};else if(K.includes(".")){let X=K.split("."),H=-1,W;while(++H<X.length){let G=L6(X[H])?{type:"Identifier",name:X[H]}:{type:"Literal",value:X[H]};W=W?{type:"MemberExpression",object:W,property:G,computed:Boolean(H&&G.type==="Literal"),optional:!1}:G}Z5(W,"always a result"),J=W}else J=L6(K)&&!/^[a-z]/.test(K)?{type:"Identifier",name:K}:{type:"Literal",value:K};if(J.type==="Literal"){let X=J.value;return Y7.call(Z.components,X)?Z.components[X]:X}if(Z.evaluater)return Z.evaluater.evaluateExpression(J);e5(Z)}function e5(Z,K){let Q=new d("Cannot handle MDX estrees without `createEvaluater`",{ancestors:Z.ancestors,place:K,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw Q.file=Z.filePath||void 0,Q.url=OZ+"#cannot-handle-mdx-estrees-without-createevaluater",Q}function qK(Z){let K={},Q;for(Q in Z)if(Y7.call(Z,Q))K[YK(Q)]=Z[Q];return K}function YK(Z){let K=Z.replace(c0,$K);if(K.slice(0,3)==="ms-")K="-"+K;return K}function $K(Z){return"-"+Z.toLowerCase()}var Z6={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]};var X0=q7(L9(),1);var UK={};function V7(Z,K){let Q=K||UK,J=typeof Q.includeImageAlt==="boolean"?Q.includeImageAlt:!0,X=typeof Q.includeHtml==="boolean"?Q.includeHtml:!0;return EZ(Z,J,X)}function EZ(Z,K,Q){if(_K(Z)){if("value"in Z)return Z.type==="html"&&!Q?"":Z.value;if(K&&"alt"in Z&&Z.alt)return Z.alt;if("children"in Z)return SZ(Z.children,K,Q)}if(Array.isArray(Z))return SZ(Z,K,Q);return""}function SZ(Z,K,Q){let J=[],X=-1;while(++X<Z.length)J[X]=EZ(Z[X],K,Q);return J.join("")}function _K(Z){return Boolean(Z&&typeof Z==="object")}var bZ=document.createElement("i");function m5(Z){let K="&"+Z+";";bZ.innerHTML=K;let Q=bZ.textContent;if(Q.charCodeAt(Q.length-1)===59&&Z!=="semi")return!1;return Q===K?!1:Q}function t(Z,K,Q,J){let X=Z.length,H=0,W;if(K<0)K=-K>X?0:X+K;else K=K>X?X:K;if(Q=Q>0?Q:0,J.length<1e4)W=Array.from(J),W.unshift(K,Q),Z.splice(...W);else{if(Q)Z.splice(K,Q);while(H<J.length)W=J.slice(H,H+1e4),W.unshift(K,0),Z.splice(...W),H+=1e4,K+=1e4}}function K5(Z,K){if(Z.length>0)return t(Z,Z.length,0,K),Z;return K}var gZ={}.hasOwnProperty;function yZ(Z){let K={},Q=-1;while(++Q<Z.length)VK(K,Z[Q]);return K}function VK(Z,K){let Q;for(Q in K){let X=(gZ.call(Z,Q)?Z[Q]:void 0)||(Z[Q]={}),H=K[Q],W;if(H)for(W in H){if(!gZ.call(X,W))X[W]=[];let G=H[W];NK(X[W],Array.isArray(G)?G:G?[G]:[])}}}function NK(Z,K){let Q=-1,J=[];while(++Q<K.length)(K[Q].add==="after"?Z:J).push(K[Q]);t(Z,0,0,J)}function z6(Z,K){let Q=Number.parseInt(Z,K);if(Q<9||Q===11||Q>13&&Q<32||Q>126&&Q<160||Q>55295&&Q<57344||Q>64975&&Q<65008||(Q&65535)===65535||(Q&65535)===65534||Q>1114111)return"�";return String.fromCodePoint(Q)}function F5(Z){return Z.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}var X5=A5(/[A-Za-z]/),s=A5(/[\dA-Za-z]/),xZ=A5(/[#-'*+\--9=?A-Z^-~]/);function K6(Z){return Z!==null&&(Z<32||Z===127)}var Q6=A5(/\d/),hZ=A5(/[\dA-Fa-f]/),kZ=A5(/[!-/:-@[-`{-~]/);function z(Z){return Z!==null&&Z<-2}function r(Z){return Z!==null&&(Z<0||Z===32)}function P(Z){return Z===-2||Z===-1||Z===32}var mZ=A5(/\p{P}|\p{S}/u),vZ=A5(/\s/);function A5(Z){return K;function K(Q){return Q!==null&&Q>-1&&Z.test(String.fromCharCode(Q))}}function G5(Z){let K=[],Q=-1,J=0,X=0;while(++Q<Z.length){let H=Z.charCodeAt(Q),W="";if(H===37&&s(Z.charCodeAt(Q+1))&&s(Z.charCodeAt(Q+2)))X=2;else if(H<128){if(!/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(H)))W=String.fromCharCode(H)}else if(H>55295&&H<57344){let G=Z.charCodeAt(Q+1);if(H<56320&&G>56319&&G<57344)W=String.fromCharCode(H,G),X=1;else W="�"}else W=String.fromCharCode(H);if(W)K.push(Z.slice(J,Q),encodeURIComponent(W)),J=Q+X+1,W="";if(X)Q+=X,X=0}return K.join("")+Z.slice(J)}function S(Z,K,Q,J){let X=J?J-1:Number.POSITIVE_INFINITY,H=0;return W;function W(q){if(P(q))return Z.enter(Q),G(q);return K(q)}function G(q){if(P(q)&&H++<X)return Z.consume(q),G;return Z.exit(Q),K(q)}}var pZ={tokenize:MK};function MK(Z){let K=Z.attempt(this.parser.constructs.contentInitial,J,X),Q;return K;function J(G){if(G===null){Z.consume(G);return}return Z.enter("lineEnding"),Z.consume(G),Z.exit("lineEnding"),S(Z,K,"linePrefix")}function X(G){return Z.enter("paragraph"),H(G)}function H(G){let q=Z.enter("chunkText",{contentType:"text",previous:Q});if(Q)Q.next=q;return Q=q,W(G)}function W(G){if(G===null){Z.exit("chunkText"),Z.exit("paragraph"),Z.consume(G);return}if(z(G))return Z.consume(G),Z.exit("chunkText"),H;return Z.consume(G),W}}var lZ={tokenize:LK},uZ={tokenize:BK};function LK(Z){let K=this,Q=[],J=0,X,H,W;return G;function G(T){if(J<Q.length){let p=Q[J];return K.containerState=p[1],Z.attempt(p[0].continuation,q,$)(T)}return $(T)}function q(T){if(J++,K.containerState._closeFlow){if(K.containerState._closeFlow=void 0,X)g();let p=K.events.length,l=p,B;while(l--)if(K.events[l][0]==="exit"&&K.events[l][1].type==="chunkFlow"){B=K.events[l][1].end;break}j(J);let v=p;while(v<K.events.length)K.events[v][1].end={...B},v++;return t(K.events,l+1,0,K.events.slice(p)),K.events.length=v,$(T)}return G(T)}function $(T){if(J===Q.length){if(!X)return _(T);if(X.currentConstruct&&X.currentConstruct.concrete)return F(T);K.interrupt=Boolean(X.currentConstruct&&!X._gfmTableDynamicInterruptHack)}return K.containerState={},Z.check(uZ,D,N)(T)}function D(T){if(X)g();return j(J),_(T)}function N(T){return K.parser.lazy[K.now().line]=J!==Q.length,W=K.now().offset,F(T)}function _(T){return K.containerState={},Z.attempt(uZ,Y,F)(T)}function Y(T){return J++,Q.push([K.currentConstruct,K.containerState]),_(T)}function F(T){if(T===null){if(X)g();j(0),Z.consume(T);return}return X=X||K.parser.flow(K.now()),Z.enter("chunkFlow",{_tokenizer:X,contentType:"flow",previous:H}),R(T)}function R(T){if(T===null){O(Z.exit("chunkFlow"),!0),j(0),Z.consume(T);return}if(z(T))return Z.consume(T),O(Z.exit("chunkFlow")),J=0,K.interrupt=void 0,G;return Z.consume(T),R}function O(T,p){let l=K.sliceStream(T);if(p)l.push(null);if(T.previous=H,H)H.next=T;if(H=T,X.defineSkip(T.start),X.write(l),K.parser.lazy[T.start.line]){let B=X.events.length;while(B--)if(X.events[B][1].start.offset<W&&(!X.events[B][1].end||X.events[B][1].end.offset>W))return;let v=K.events.length,a=v,h,u;while(a--)if(K.events[a][0]==="exit"&&K.events[a][1].type==="chunkFlow"){if(h){u=K.events[a][1].end;break}h=!0}j(J),B=v;while(B<K.events.length)K.events[B][1].end={...u},B++;t(K.events,a+1,0,K.events.slice(v)),K.events.length=B}}function j(T){let p=Q.length;while(p-- >T){let l=Q[p];K.containerState=l[1],l[0].exit.call(K,Z)}Q.length=T}function g(){X.write([null]),H=void 0,X=void 0,K.containerState._closeFlow=void 0}}function BK(Z,K,Q){return S(Z,Z.attempt(this.parser.constructs.document,K,Q),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function N7(Z){if(Z===null||r(Z)||vZ(Z))return 1;if(mZ(Z))return 2}function v5(Z,K,Q){let J=[],X=-1;while(++X<Z.length){let H=Z[X].resolveAll;if(H&&!J.includes(H))K=H(K,Q),J.push(H)}return K}var J6={name:"attention",resolveAll:FK,tokenize:RK};function FK(Z,K){let Q=-1,J,X,H,W,G,q,$,D;while(++Q<Z.length)if(Z[Q][0]==="enter"&&Z[Q][1].type==="attentionSequence"&&Z[Q][1]._close){J=Q;while(J--)if(Z[J][0]==="exit"&&Z[J][1].type==="attentionSequence"&&Z[J][1]._open&&K.sliceSerialize(Z[J][1]).charCodeAt(0)===K.sliceSerialize(Z[Q][1]).charCodeAt(0)){if((Z[J][1]._close||Z[Q][1]._open)&&(Z[Q][1].end.offset-Z[Q][1].start.offset)%3&&!((Z[J][1].end.offset-Z[J][1].start.offset+Z[Q][1].end.offset-Z[Q][1].start.offset)%3))continue;q=Z[J][1].end.offset-Z[J][1].start.offset>1&&Z[Q][1].end.offset-Z[Q][1].start.offset>1?2:1;let N={...Z[J][1].end},_={...Z[Q][1].start};if(fZ(N,-q),fZ(_,q),W={type:q>1?"strongSequence":"emphasisSequence",start:N,end:{...Z[J][1].end}},G={type:q>1?"strongSequence":"emphasisSequence",start:{...Z[Q][1].start},end:_},H={type:q>1?"strongText":"emphasisText",start:{...Z[J][1].end},end:{...Z[Q][1].start}},X={type:q>1?"strong":"emphasis",start:{...W.start},end:{...G.end}},Z[J][1].end={...W.start},Z[Q][1].start={...G.end},$=[],Z[J][1].end.offset-Z[J][1].start.offset)$=K5($,[["enter",Z[J][1],K],["exit",Z[J][1],K]]);if($=K5($,[["enter",X,K],["enter",W,K],["exit",W,K],["enter",H,K]]),$=K5($,v5(K.parser.constructs.insideSpan.null,Z.slice(J+1,Q),K)),$=K5($,[["exit",H,K],["enter",G,K],["exit",G,K],["exit",X,K]]),Z[Q][1].end.offset-Z[Q][1].start.offset)D=2,$=K5($,[["enter",Z[Q][1],K],["exit",Z[Q][1],K]]);else D=0;t(Z,J-1,Q-J+3,$),Q=J+$.length-D-2;break}}Q=-1;while(++Q<Z.length)if(Z[Q][1].type==="attentionSequence")Z[Q][1].type="data";return Z}function RK(Z,K){let Q=this.parser.constructs.attentionMarkers.null,J=this.previous,X=N7(J),H;return W;function W(q){return H=q,Z.enter("attentionSequence"),G(q)}function G(q){if(q===H)return Z.consume(q),G;let $=Z.exit("attentionSequence"),D=N7(q),N=!D||D===2&&X||Q.includes(q),_=!X||X===2&&D||Q.includes(J);return $._open=Boolean(H===42?N:N&&(X||!_)),$._close=Boolean(H===42?_:_&&(D||!N)),K(q)}}function fZ(Z,K){Z.column+=K,Z.offset+=K,Z._bufferIndex+=K}var M7={name:"autolink",tokenize:jK};function jK(Z,K,Q){let J=0;return X;function X(Y){return Z.enter("autolink"),Z.enter("autolinkMarker"),Z.consume(Y),Z.exit("autolinkMarker"),Z.enter("autolinkProtocol"),H}function H(Y){if(X5(Y))return Z.consume(Y),W;if(Y===64)return Q(Y);return $(Y)}function W(Y){if(Y===43||Y===45||Y===46||s(Y))return J=1,G(Y);return $(Y)}function G(Y){if(Y===58)return Z.consume(Y),J=0,q;if((Y===43||Y===45||Y===46||s(Y))&&J++<32)return Z.consume(Y),G;return J=0,$(Y)}function q(Y){if(Y===62)return Z.exit("autolinkProtocol"),Z.enter("autolinkMarker"),Z.consume(Y),Z.exit("autolinkMarker"),Z.exit("autolink"),K;if(Y===null||Y===32||Y===60||K6(Y))return Q(Y);return Z.consume(Y),q}function $(Y){if(Y===64)return Z.consume(Y),D;if(xZ(Y))return Z.consume(Y),$;return Q(Y)}function D(Y){return s(Y)?N(Y):Q(Y)}function N(Y){if(Y===46)return Z.consume(Y),J=0,D;if(Y===62)return Z.exit("autolinkProtocol").type="autolinkEmail",Z.enter("autolinkMarker"),Z.consume(Y),Z.exit("autolinkMarker"),Z.exit("autolink"),K;return _(Y)}function _(Y){if((Y===45||s(Y))&&J++<63){let F=Y===45?_:N;return Z.consume(Y),F}return Q(Y)}}var z5={partial:!0,tokenize:AK};function AK(Z,K,Q){return J;function J(H){return P(H)?S(Z,X,"linePrefix")(H):X(H)}function X(H){return H===null||z(H)?K(H):Q(H)}}var T6={continuation:{tokenize:TK},exit:CK,name:"blockQuote",tokenize:zK};function zK(Z,K,Q){let J=this;return X;function X(W){if(W===62){let G=J.containerState;if(!G.open)Z.enter("blockQuote",{_container:!0}),G.open=!0;return Z.enter("blockQuotePrefix"),Z.enter("blockQuoteMarker"),Z.consume(W),Z.exit("blockQuoteMarker"),H}return Q(W)}function H(W){if(P(W))return Z.enter("blockQuotePrefixWhitespace"),Z.consume(W),Z.exit("blockQuotePrefixWhitespace"),Z.exit("blockQuotePrefix"),K;return Z.exit("blockQuotePrefix"),K(W)}}function TK(Z,K,Q){let J=this;return X;function X(W){if(P(W))return S(Z,H,"linePrefix",J.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(W);return H(W)}function H(W){return Z.attempt(T6,K,Q)(W)}}function CK(Z){Z.exit("blockQuote")}var C6={name:"characterEscape",tokenize:OK};function OK(Z,K,Q){return J;function J(H){return Z.enter("characterEscape"),Z.enter("escapeMarker"),Z.consume(H),Z.exit("escapeMarker"),X}function X(H){if(kZ(H))return Z.enter("characterEscapeValue"),Z.consume(H),Z.exit("characterEscapeValue"),Z.exit("characterEscape"),K;return Q(H)}}var O6={name:"characterReference",tokenize:wK};function wK(Z,K,Q){let J=this,X=0,H,W;return G;function G(N){return Z.enter("characterReference"),Z.enter("characterReferenceMarker"),Z.consume(N),Z.exit("characterReferenceMarker"),q}function q(N){if(N===35)return Z.enter("characterReferenceMarkerNumeric"),Z.consume(N),Z.exit("characterReferenceMarkerNumeric"),$;return Z.enter("characterReferenceValue"),H=31,W=s,D(N)}function $(N){if(N===88||N===120)return Z.enter("characterReferenceMarkerHexadecimal"),Z.consume(N),Z.exit("characterReferenceMarkerHexadecimal"),Z.enter("characterReferenceValue"),H=6,W=hZ,D;return Z.enter("characterReferenceValue"),H=7,W=Q6,D(N)}function D(N){if(N===59&&X){let _=Z.exit("characterReferenceValue");if(W===s&&!m5(J.sliceSerialize(_)))return Q(N);return Z.enter("characterReferenceMarker"),Z.consume(N),Z.exit("characterReferenceMarker"),Z.exit("characterReference"),K}if(W(N)&&X++<H)return Z.consume(N),D;return Q(N)}}var iZ={partial:!0,tokenize:IK},w6={concrete:!0,name:"codeFenced",tokenize:PK};function PK(Z,K,Q){let J=this,X={partial:!0,tokenize:l},H=0,W=0,G;return q;function q(B){return $(B)}function $(B){let v=J.events[J.events.length-1];return H=v&&v[1].type==="linePrefix"?v[2].sliceSerialize(v[1],!0).length:0,G=B,Z.enter("codeFenced"),Z.enter("codeFencedFence"),Z.enter("codeFencedFenceSequence"),D(B)}function D(B){if(B===G)return W++,Z.consume(B),D;if(W<3)return Q(B);return Z.exit("codeFencedFenceSequence"),P(B)?S(Z,N,"whitespace")(B):N(B)}function N(B){if(B===null||z(B))return Z.exit("codeFencedFence"),J.interrupt?K(B):Z.check(iZ,R,p)(B);return Z.enter("codeFencedFenceInfo"),Z.enter("chunkString",{contentType:"string"}),_(B)}function _(B){if(B===null||z(B))return Z.exit("chunkString"),Z.exit("codeFencedFenceInfo"),N(B);if(P(B))return Z.exit("chunkString"),Z.exit("codeFencedFenceInfo"),S(Z,Y,"whitespace")(B);if(B===96&&B===G)return Q(B);return Z.consume(B),_}function Y(B){if(B===null||z(B))return N(B);return Z.enter("codeFencedFenceMeta"),Z.enter("chunkString",{contentType:"string"}),F(B)}function F(B){if(B===null||z(B))return Z.exit("chunkString"),Z.exit("codeFencedFenceMeta"),N(B);if(B===96&&B===G)return Q(B);return Z.consume(B),F}function R(B){return Z.attempt(X,p,O)(B)}function O(B){return Z.enter("lineEnding"),Z.consume(B),Z.exit("lineEnding"),j}function j(B){return H>0&&P(B)?S(Z,g,"linePrefix",H+1)(B):g(B)}function g(B){if(B===null||z(B))return Z.check(iZ,R,p)(B);return Z.enter("codeFlowValue"),T(B)}function T(B){if(B===null||z(B))return Z.exit("codeFlowValue"),g(B);return Z.consume(B),T}function p(B){return Z.exit("codeFenced"),K(B)}function l(B,v,a){let h=0;return u;function u(E){return B.enter("lineEnding"),B.consume(E),B.exit("lineEnding"),H5}function H5(E){return B.enter("codeFencedFence"),P(E)?S(B,k,"linePrefix",J.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(E):k(E)}function k(E){if(E===G)return B.enter("codeFencedFenceSequence"),C(E);return a(E)}function C(E){if(E===G)return h++,B.consume(E),C;if(h>=W)return B.exit("codeFencedFenceSequence"),P(E)?S(B,b,"whitespace")(E):b(E);return a(E)}function b(E){if(E===null||z(E))return B.exit("codeFencedFence"),v(E);return a(E)}}}function IK(Z,K,Q){let J=this;return X;function X(W){if(W===null)return Q(W);return Z.enter("lineEnding"),Z.consume(W),Z.exit("lineEnding"),H}function H(W){return J.parser.lazy[J.now().line]?Q(W):K(W)}}var X6={name:"codeIndented",tokenize:EK},SK={partial:!0,tokenize:bK};function EK(Z,K,Q){let J=this;return X;function X($){return Z.enter("codeIndented"),S(Z,H,"linePrefix",5)($)}function H($){let D=J.events[J.events.length-1];return D&&D[1].type==="linePrefix"&&D[2].sliceSerialize(D[1],!0).length>=4?W($):Q($)}function W($){if($===null)return q($);if(z($))return Z.attempt(SK,W,q)($);return Z.enter("codeFlowValue"),G($)}function G($){if($===null||z($))return Z.exit("codeFlowValue"),W($);return Z.consume($),G}function q($){return Z.exit("codeIndented"),K($)}}function bK(Z,K,Q){let J=this;return X;function X(W){if(J.parser.lazy[J.now().line])return Q(W);if(z(W))return Z.enter("lineEnding"),Z.consume(W),Z.exit("lineEnding"),X;return S(Z,H,"linePrefix",5)(W)}function H(W){let G=J.events[J.events.length-1];return G&&G[1].type==="linePrefix"&&G[2].sliceSerialize(G[1],!0).length>=4?K(W):z(W)?X(W):Q(W)}}var L7={name:"codeText",previous:yK,resolve:gK,tokenize:xK};function gK(Z){let K=Z.length-4,Q=3,J,X;if((Z[Q][1].type==="lineEnding"||Z[Q][1].type==="space")&&(Z[K][1].type==="lineEnding"||Z[K][1].type==="space")){J=Q;while(++J<K)if(Z[J][1].type==="codeTextData"){Z[Q][1].type="codeTextPadding",Z[K][1].type="codeTextPadding",Q+=2,K-=2;break}}J=Q-1,K++;while(++J<=K)if(X===void 0){if(J!==K&&Z[J][1].type!=="lineEnding")X=J}else if(J===K||Z[J][1].type==="lineEnding"){if(Z[X][1].type="codeTextData",J!==X+2)Z[X][1].end=Z[J-1][1].end,Z.splice(X+2,J-X-2),K-=J-X-2,J=X+2;X=void 0}return Z}function yK(Z){return Z!==96||this.events[this.events.length-1][1].type==="characterEscape"}function xK(Z,K,Q){let J=this,X=0,H,W;return G;function G(_){return Z.enter("codeText"),Z.enter("codeTextSequence"),q(_)}function q(_){if(_===96)return Z.consume(_),X++,q;return Z.exit("codeTextSequence"),$(_)}function $(_){if(_===null)return Q(_);if(_===32)return Z.enter("space"),Z.consume(_),Z.exit("space"),$;if(_===96)return W=Z.enter("codeTextSequence"),H=0,N(_);if(z(_))return Z.enter("lineEnding"),Z.consume(_),Z.exit("lineEnding"),$;return Z.enter("codeTextData"),D(_)}function D(_){if(_===null||_===32||_===96||z(_))return Z.exit("codeTextData"),$(_);return Z.consume(_),D}function N(_){if(_===96)return Z.consume(_),H++,N;if(H===X)return Z.exit("codeTextSequence"),Z.exit("codeText"),K(_);return W.type="codeTextData",D(_)}}class B7{constructor(Z){this.left=Z?[...Z]:[],this.right=[]}get(Z){if(Z<0||Z>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+Z+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");if(Z<this.left.length)return this.left[Z];return this.right[this.right.length-Z+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(Z,K){let Q=K===null||K===void 0?Number.POSITIVE_INFINITY:K;if(Q<this.left.length)return this.left.slice(Z,Q);if(Z>this.left.length)return this.right.slice(this.right.length-Q+this.left.length,this.right.length-Z+this.left.length).reverse();return this.left.slice(Z).concat(this.right.slice(this.right.length-Q+this.left.length).reverse())}splice(Z,K,Q){let J=K||0;this.setCursor(Math.trunc(Z));let X=this.right.splice(this.right.length-J,Number.POSITIVE_INFINITY);if(Q)H6(this.left,Q);return X.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(Z){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(Z)}pushMany(Z){this.setCursor(Number.POSITIVE_INFINITY),H6(this.left,Z)}unshift(Z){this.setCursor(0),this.right.push(Z)}unshiftMany(Z){this.setCursor(0),H6(this.right,Z.reverse())}setCursor(Z){if(Z===this.left.length||Z>this.left.length&&this.right.length===0||Z<0&&this.left.length===0)return;if(Z<this.left.length){let K=this.left.splice(Z,Number.POSITIVE_INFINITY);H6(this.right,K.reverse())}else{let K=this.right.splice(this.left.length+this.right.length-Z,Number.POSITIVE_INFINITY);H6(this.left,K.reverse())}}}function H6(Z,K){let Q=0;if(K.length<1e4)Z.push(...K);else while(Q<K.length)Z.push(...K.slice(Q,Q+1e4)),Q+=1e4}function P6(Z){let K={},Q=-1,J,X,H,W,G,q,$,D=new B7(Z);while(++Q<D.length){while(Q in K)Q=K[Q];if(J=D.get(Q),Q&&J[1].type==="chunkFlow"&&D.get(Q-1)[1].type==="listItemPrefix"){if(q=J[1]._tokenizer.events,H=0,H<q.length&&q[H][1].type==="lineEndingBlank")H+=2;if(H<q.length&&q[H][1].type==="content")while(++H<q.length){if(q[H][1].type==="content")break;if(q[H][1].type==="chunkText")q[H][1]._isInFirstContentOfListItem=!0,H++}}if(J[0]==="enter"){if(J[1].contentType)Object.assign(K,hK(D,Q)),Q=K[Q],$=!0}else if(J[1]._container){H=Q,X=void 0;while(H--)if(W=D.get(H),W[1].type==="lineEnding"||W[1].type==="lineEndingBlank"){if(W[0]==="enter"){if(X)D.get(X)[1].type="lineEndingBlank";W[1].type="lineEnding",X=H}}else if(W[1].type==="linePrefix"||W[1].type==="listItemIndent");else break;if(X)J[1].end={...D.get(X)[1].start},G=D.slice(X,Q),G.unshift(J),D.splice(X,Q-X+1,G)}}return t(Z,0,Number.POSITIVE_INFINITY,D.slice(0)),!$}function hK(Z,K){let Q=Z.get(K)[1],J=Z.get(K)[2],X=K-1,H=[],W=Q._tokenizer;if(!W){if(W=J.parser[Q.contentType](Q.start),Q._contentTypeTextTrailing)W._contentTypeTextTrailing=!0}let G=W.events,q=[],$={},D,N,_=-1,Y=Q,F=0,R=0,O=[R];while(Y){while(Z.get(++X)[1]!==Y);if(H.push(X),!Y._tokenizer){if(D=J.sliceStream(Y),!Y.next)D.push(null);if(N)W.defineSkip(Y.start);if(Y._isInFirstContentOfListItem)W._gfmTasklistFirstContentOfListItem=!0;if(W.write(D),Y._isInFirstContentOfListItem)W._gfmTasklistFirstContentOfListItem=void 0}N=Y,Y=Y.next}Y=Q;while(++_<G.length)if(G[_][0]==="exit"&&G[_-1][0]==="enter"&&G[_][1].type===G[_-1][1].type&&G[_][1].start.line!==G[_][1].end.line)R=_+1,O.push(R),Y._tokenizer=void 0,Y.previous=void 0,Y=Y.next;if(W.events=[],Y)Y._tokenizer=void 0,Y.previous=void 0;else O.pop();_=O.length;while(_--){let j=G.slice(O[_],O[_+1]),g=H.pop();q.push([g,g+j.length-1]),Z.splice(g,2,j)}q.reverse(),_=-1;while(++_<q.length)$[F+q[_][0]]=F+q[_][1],F+=q[_][1]-q[_][0]-1;return $}var F7={resolve:mK,tokenize:vK},kK={partial:!0,tokenize:pK};function mK(Z){return P6(Z),Z}function vK(Z,K){let Q;return J;function J(G){return Z.enter("content"),Q=Z.enter("chunkContent",{contentType:"content"}),X(G)}function X(G){if(G===null)return H(G);if(z(G))return Z.check(kK,W,H)(G);return Z.consume(G),X}function H(G){return Z.exit("chunkContent"),Z.exit("content"),K(G)}function W(G){return Z.consume(G),Z.exit("chunkContent"),Q.next=Z.enter("chunkContent",{contentType:"content",previous:Q}),Q=Q.next,X}}function pK(Z,K,Q){let J=this;return X;function X(W){return Z.exit("chunkContent"),Z.enter("lineEnding"),Z.consume(W),Z.exit("lineEnding"),S(Z,H,"linePrefix")}function H(W){if(W===null||z(W))return Q(W);let G=J.events[J.events.length-1];if(!J.parser.constructs.disable.null.includes("codeIndented")&&G&&G[1].type==="linePrefix"&&G[2].sliceSerialize(G[1],!0).length>=4)return K(W);return Z.interrupt(J.parser.constructs.flow,Q,K)(W)}}function I6(Z,K,Q,J,X,H,W,G,q){let $=q||Number.POSITIVE_INFINITY,D=0;return N;function N(j){if(j===60)return Z.enter(J),Z.enter(X),Z.enter(H),Z.consume(j),Z.exit(H),_;if(j===null||j===32||j===41||K6(j))return Q(j);return Z.enter(J),Z.enter(W),Z.enter(G),Z.enter("chunkString",{contentType:"string"}),R(j)}function _(j){if(j===62)return Z.enter(H),Z.consume(j),Z.exit(H),Z.exit(X),Z.exit(J),K;return Z.enter(G),Z.enter("chunkString",{contentType:"string"}),Y(j)}function Y(j){if(j===62)return Z.exit("chunkString"),Z.exit(G),_(j);if(j===null||j===60||z(j))return Q(j);return Z.consume(j),j===92?F:Y}function F(j){if(j===60||j===62||j===92)return Z.consume(j),Y;return Y(j)}function R(j){if(!D&&(j===null||j===41||r(j)))return Z.exit("chunkString"),Z.exit(G),Z.exit(W),Z.exit(J),K(j);if(D<$&&j===40)return Z.consume(j),D++,R;if(j===41)return Z.consume(j),D--,R;if(j===null||j===32||j===40||K6(j))return Q(j);return Z.consume(j),j===92?O:R}function O(j){if(j===40||j===41||j===92)return Z.consume(j),R;return R(j)}}function S6(Z,K,Q,J,X,H){let W=this,G=0,q;return $;function $(Y){return Z.enter(J),Z.enter(X),Z.consume(Y),Z.exit(X),Z.enter(H),D}function D(Y){if(G>999||Y===null||Y===91||Y===93&&!q||Y===94&&!G&&"_hiddenFootnoteSupport"in W.parser.constructs)return Q(Y);if(Y===93)return Z.exit(H),Z.enter(X),Z.consume(Y),Z.exit(X),Z.exit(J),K;if(z(Y))return Z.enter("lineEnding"),Z.consume(Y),Z.exit("lineEnding"),D;return Z.enter("chunkString",{contentType:"string"}),N(Y)}function N(Y){if(Y===null||Y===91||Y===93||z(Y)||G++>999)return Z.exit("chunkString"),D(Y);if(Z.consume(Y),!q)q=!P(Y);return Y===92?_:N}function _(Y){if(Y===91||Y===92||Y===93)return Z.consume(Y),G++,N;return N(Y)}}function E6(Z,K,Q,J,X,H){let W;return G;function G(_){if(_===34||_===39||_===40)return Z.enter(J),Z.enter(X),Z.consume(_),Z.exit(X),W=_===40?41:_,q;return Q(_)}function q(_){if(_===W)return Z.enter(X),Z.consume(_),Z.exit(X),Z.exit(J),K;return Z.enter(H),$(_)}function $(_){if(_===W)return Z.exit(H),q(W);if(_===null)return Q(_);if(z(_))return Z.enter("lineEnding"),Z.consume(_),Z.exit("lineEnding"),S(Z,$,"linePrefix");return Z.enter("chunkString",{contentType:"string"}),D(_)}function D(_){if(_===W||_===null||z(_))return Z.exit("chunkString"),$(_);return Z.consume(_),_===92?N:D}function N(_){if(_===W||_===92)return Z.consume(_),D;return D(_)}}function S5(Z,K){let Q;return J;function J(X){if(z(X))return Z.enter("lineEnding"),Z.consume(X),Z.exit("lineEnding"),Q=!0,J;if(P(X))return S(Z,J,Q?"linePrefix":"lineSuffix")(X);return K(X)}}var R7={name:"definition",tokenize:lK},uK={partial:!0,tokenize:fK};function lK(Z,K,Q){let J=this,X;return H;function H(Y){return Z.enter("definition"),W(Y)}function W(Y){return S6.call(J,Z,G,Q,"definitionLabel","definitionLabelMarker","definitionLabelString")(Y)}function G(Y){if(X=F5(J.sliceSerialize(J.events[J.events.length-1][1]).slice(1,-1)),Y===58)return Z.enter("definitionMarker"),Z.consume(Y),Z.exit("definitionMarker"),q;return Q(Y)}function q(Y){return r(Y)?S5(Z,$)(Y):$(Y)}function $(Y){return I6(Z,D,Q,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(Y)}function D(Y){return Z.attempt(uK,N,N)(Y)}function N(Y){return P(Y)?S(Z,_,"whitespace")(Y):_(Y)}function _(Y){if(Y===null||z(Y))return Z.exit("definition"),J.parser.defined.push(X),K(Y);return Q(Y)}}function fK(Z,K,Q){return J;function J(G){return r(G)?S5(Z,X)(G):Q(G)}function X(G){return E6(Z,H,Q,"definitionTitle","definitionTitleMarker","definitionTitleString")(G)}function H(G){return P(G)?S(Z,W,"whitespace")(G):W(G)}function W(G){return G===null||z(G)?K(G):Q(G)}}var j7={name:"hardBreakEscape",tokenize:iK};function iK(Z,K,Q){return J;function J(H){return Z.enter("hardBreakEscape"),Z.consume(H),X}function X(H){if(z(H))return Z.exit("hardBreakEscape"),K(H);return Q(H)}}var A7={name:"headingAtx",resolve:rK,tokenize:aK};function rK(Z,K){let Q=Z.length-2,J=3,X,H;if(Z[J][1].type==="whitespace")J+=2;if(Q-2>J&&Z[Q][1].type==="whitespace")Q-=2;if(Z[Q][1].type==="atxHeadingSequence"&&(J===Q-1||Q-4>J&&Z[Q-2][1].type==="whitespace"))Q-=J+1===Q?2:4;if(Q>J)X={type:"atxHeadingText",start:Z[J][1].start,end:Z[Q][1].end},H={type:"chunkText",start:Z[J][1].start,end:Z[Q][1].end,contentType:"text"},t(Z,J,Q-J+1,[["enter",X,K],["enter",H,K],["exit",H,K],["exit",X,K]]);return Z}function aK(Z,K,Q){let J=0;return X;function X(D){return Z.enter("atxHeading"),H(D)}function H(D){return Z.enter("atxHeadingSequence"),W(D)}function W(D){if(D===35&&J++<6)return Z.consume(D),W;if(D===null||r(D))return Z.exit("atxHeadingSequence"),G(D);return Q(D)}function G(D){if(D===35)return Z.enter("atxHeadingSequence"),q(D);if(D===null||z(D))return Z.exit("atxHeading"),K(D);if(P(D))return S(Z,G,"whitespace")(D);return Z.enter("atxHeadingText"),$(D)}function q(D){if(D===35)return Z.consume(D),q;return Z.exit("atxHeadingSequence"),G(D)}function $(D){if(D===null||D===35||r(D))return Z.exit("atxHeadingText"),G(D);return Z.consume(D),$}}var rZ=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],z7=["pre","script","style","textarea"];var T7={concrete:!0,name:"htmlFlow",resolveTo:sK,tokenize:nK},dK={partial:!0,tokenize:tK},cK={partial:!0,tokenize:oK};function sK(Z){let K=Z.length;while(K--)if(Z[K][0]==="enter"&&Z[K][1].type==="htmlFlow")break;if(K>1&&Z[K-2][1].type==="linePrefix")Z[K][1].start=Z[K-2][1].start,Z[K+1][1].start=Z[K-2][1].start,Z.splice(K-2,2);return Z}function nK(Z,K,Q){let J=this,X,H,W,G,q;return $;function $(V){return D(V)}function D(V){return Z.enter("htmlFlow"),Z.enter("htmlFlowData"),Z.consume(V),N}function N(V){if(V===33)return Z.consume(V),_;if(V===47)return Z.consume(V),H=!0,R;if(V===63)return Z.consume(V),X=3,J.interrupt?K:U;if(X5(V))return Z.consume(V),W=String.fromCharCode(V),O;return Q(V)}function _(V){if(V===45)return Z.consume(V),X=2,Y;if(V===91)return Z.consume(V),X=5,G=0,F;if(X5(V))return Z.consume(V),X=4,J.interrupt?K:U;return Q(V)}function Y(V){if(V===45)return Z.consume(V),J.interrupt?K:U;return Q(V)}function F(V){if(V==="CDATA[".charCodeAt(G++)){if(Z.consume(V),G===6)return J.interrupt?K:k;return F}return Q(V)}function R(V){if(X5(V))return Z.consume(V),W=String.fromCharCode(V),O;return Q(V)}function O(V){if(V===null||V===47||V===62||r(V)){let q5=V===47,C5=W.toLowerCase();if(!q5&&!H&&z7.includes(C5))return X=1,J.interrupt?K(V):k(V);if(rZ.includes(W.toLowerCase())){if(X=6,q5)return Z.consume(V),j;return J.interrupt?K(V):k(V)}return X=7,J.interrupt&&!J.parser.lazy[J.now().line]?Q(V):H?g(V):T(V)}if(V===45||s(V))return Z.consume(V),W+=String.fromCharCode(V),O;return Q(V)}function j(V){if(V===62)return Z.consume(V),J.interrupt?K:k;return Q(V)}function g(V){if(P(V))return Z.consume(V),g;return u(V)}function T(V){if(V===47)return Z.consume(V),u;if(V===58||V===95||X5(V))return Z.consume(V),p;if(P(V))return Z.consume(V),T;return u(V)}function p(V){if(V===45||V===46||V===58||V===95||s(V))return Z.consume(V),p;return l(V)}function l(V){if(V===61)return Z.consume(V),B;if(P(V))return Z.consume(V),l;return T(V)}function B(V){if(V===null||V===60||V===61||V===62||V===96)return Q(V);if(V===34||V===39)return Z.consume(V),q=V,v;if(P(V))return Z.consume(V),B;return a(V)}function v(V){if(V===q)return Z.consume(V),q=null,h;if(V===null||z(V))return Q(V);return Z.consume(V),v}function a(V){if(V===null||V===34||V===39||V===47||V===60||V===61||V===62||V===96||r(V))return l(V);return Z.consume(V),a}function h(V){if(V===47||V===62||P(V))return T(V);return Q(V)}function u(V){if(V===62)return Z.consume(V),H5;return Q(V)}function H5(V){if(V===null||z(V))return k(V);if(P(V))return Z.consume(V),H5;return Q(V)}function k(V){if(V===45&&X===2)return Z.consume(V),f;if(V===60&&X===1)return Z.consume(V),c;if(V===62&&X===4)return Z.consume(V),_5;if(V===63&&X===3)return Z.consume(V),U;if(V===93&&X===5)return Z.consume(V),U5;if(z(V)&&(X===6||X===7))return Z.exit("htmlFlowData"),Z.check(dK,V5,C)(V);if(V===null||z(V))return Z.exit("htmlFlowData"),C(V);return Z.consume(V),k}function C(V){return Z.check(cK,b,V5)(V)}function b(V){return Z.enter("lineEnding"),Z.consume(V),Z.exit("lineEnding"),E}function E(V){if(V===null||z(V))return C(V);return Z.enter("htmlFlowData"),k(V)}function f(V){if(V===45)return Z.consume(V),U;return k(V)}function c(V){if(V===47)return Z.consume(V),W="",D5;return k(V)}function D5(V){if(V===62){let q5=W.toLowerCase();if(z7.includes(q5))return Z.consume(V),_5;return k(V)}if(X5(V)&&W.length<8)return Z.consume(V),W+=String.fromCharCode(V),D5;return k(V)}function U5(V){if(V===93)return Z.consume(V),U;return k(V)}function U(V){if(V===62)return Z.consume(V),_5;if(V===45&&X===2)return Z.consume(V),U;return k(V)}function _5(V){if(V===null||z(V))return Z.exit("htmlFlowData"),V5(V);return Z.consume(V),_5}function V5(V){return Z.exit("htmlFlow"),K(V)}}function oK(Z,K,Q){let J=this;return X;function X(W){if(z(W))return Z.enter("lineEnding"),Z.consume(W),Z.exit("lineEnding"),H;return Q(W)}function H(W){return J.parser.lazy[J.now().line]?Q(W):K(W)}}function tK(Z,K,Q){return J;function J(X){return Z.enter("lineEnding"),Z.consume(X),Z.exit("lineEnding"),Z.attempt(z5,K,Q)}}var C7={name:"htmlText",tokenize:eK};function eK(Z,K,Q){let J=this,X,H,W;return G;function G(U){return Z.enter("htmlText"),Z.enter("htmlTextData"),Z.consume(U),q}function q(U){if(U===33)return Z.consume(U),$;if(U===47)return Z.consume(U),l;if(U===63)return Z.consume(U),T;if(X5(U))return Z.consume(U),a;return Q(U)}function $(U){if(U===45)return Z.consume(U),D;if(U===91)return Z.consume(U),H=0,F;if(X5(U))return Z.consume(U),g;return Q(U)}function D(U){if(U===45)return Z.consume(U),Y;return Q(U)}function N(U){if(U===null)return Q(U);if(U===45)return Z.consume(U),_;if(z(U))return W=N,c(U);return Z.consume(U),N}function _(U){if(U===45)return Z.consume(U),Y;return N(U)}function Y(U){return U===62?f(U):U===45?_(U):N(U)}function F(U){if(U==="CDATA[".charCodeAt(H++))return Z.consume(U),H===6?R:F;return Q(U)}function R(U){if(U===null)return Q(U);if(U===93)return Z.consume(U),O;if(z(U))return W=R,c(U);return Z.consume(U),R}function O(U){if(U===93)return Z.consume(U),j;return R(U)}function j(U){if(U===62)return f(U);if(U===93)return Z.consume(U),j;return R(U)}function g(U){if(U===null||U===62)return f(U);if(z(U))return W=g,c(U);return Z.consume(U),g}function T(U){if(U===null)return Q(U);if(U===63)return Z.consume(U),p;if(z(U))return W=T,c(U);return Z.consume(U),T}function p(U){return U===62?f(U):T(U)}function l(U){if(X5(U))return Z.consume(U),B;return Q(U)}function B(U){if(U===45||s(U))return Z.consume(U),B;return v(U)}function v(U){if(z(U))return W=v,c(U);if(P(U))return Z.consume(U),v;return f(U)}function a(U){if(U===45||s(U))return Z.consume(U),a;if(U===47||U===62||r(U))return h(U);return Q(U)}function h(U){if(U===47)return Z.consume(U),f;if(U===58||U===95||X5(U))return Z.consume(U),u;if(z(U))return W=h,c(U);if(P(U))return Z.consume(U),h;return f(U)}function u(U){if(U===45||U===46||U===58||U===95||s(U))return Z.consume(U),u;return H5(U)}function H5(U){if(U===61)return Z.consume(U),k;if(z(U))return W=H5,c(U);if(P(U))return Z.consume(U),H5;return h(U)}function k(U){if(U===null||U===60||U===61||U===62||U===96)return Q(U);if(U===34||U===39)return Z.consume(U),X=U,C;if(z(U))return W=k,c(U);if(P(U))return Z.consume(U),k;return Z.consume(U),b}function C(U){if(U===X)return Z.consume(U),X=void 0,E;if(U===null)return Q(U);if(z(U))return W=C,c(U);return Z.consume(U),C}function b(U){if(U===null||U===34||U===39||U===60||U===61||U===96)return Q(U);if(U===47||U===62||r(U))return h(U);return Z.consume(U),b}function E(U){if(U===47||U===62||r(U))return h(U);return Q(U)}function f(U){if(U===62)return Z.consume(U),Z.exit("htmlTextData"),Z.exit("htmlText"),K;return Q(U)}function c(U){return Z.exit("htmlTextData"),Z.enter("lineEnding"),Z.consume(U),Z.exit("lineEnding"),D5}function D5(U){return P(U)?S(Z,U5,"linePrefix",J.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(U):U5(U)}function U5(U){return Z.enter("htmlTextData"),W(U)}}var E5={name:"labelEnd",resolveAll:J2,resolveTo:X2,tokenize:H2},Z2={tokenize:W2},K2={tokenize:G2},Q2={tokenize:D2};function J2(Z){let K=-1,Q=[];while(++K<Z.length){let J=Z[K][1];if(Q.push(Z[K]),J.type==="labelImage"||J.type==="labelLink"||J.type==="labelEnd"){let X=J.type==="labelImage"?4:2;J.type="data",K+=X}}if(Z.length!==Q.length)t(Z,0,Z.length,Q);return Z}function X2(Z,K){let Q=Z.length,J=0,X,H,W,G;while(Q--)if(X=Z[Q][1],H){if(X.type==="link"||X.type==="labelLink"&&X._inactive)break;if(Z[Q][0]==="enter"&&X.type==="labelLink")X._inactive=!0}else if(W){if(Z[Q][0]==="enter"&&(X.type==="labelImage"||X.type==="labelLink")&&!X._balanced){if(H=Q,X.type!=="labelLink"){J=2;break}}}else if(X.type==="labelEnd")W=Q;let q={type:Z[H][1].type==="labelLink"?"link":"image",start:{...Z[H][1].start},end:{...Z[Z.length-1][1].end}},$={type:"label",start:{...Z[H][1].start},end:{...Z[W][1].end}},D={type:"labelText",start:{...Z[H+J+2][1].end},end:{...Z[W-2][1].start}};return G=[["enter",q,K],["enter",$,K]],G=K5(G,Z.slice(H+1,H+J+3)),G=K5(G,[["enter",D,K]]),G=K5(G,v5(K.parser.constructs.insideSpan.null,Z.slice(H+J+4,W-3),K)),G=K5(G,[["exit",D,K],Z[W-2],Z[W-1],["exit",$,K]]),G=K5(G,Z.slice(W+1)),G=K5(G,[["exit",q,K]]),t(Z,H,Z.length,G),Z}function H2(Z,K,Q){let J=this,X=J.events.length,H,W;while(X--)if((J.events[X][1].type==="labelImage"||J.events[X][1].type==="labelLink")&&!J.events[X][1]._balanced){H=J.events[X][1];break}return G;function G(_){if(!H)return Q(_);if(H._inactive)return N(_);return W=J.parser.defined.includes(F5(J.sliceSerialize({start:H.end,end:J.now()}))),Z.enter("labelEnd"),Z.enter("labelMarker"),Z.consume(_),Z.exit("labelMarker"),Z.exit("labelEnd"),q}function q(_){if(_===40)return Z.attempt(Z2,D,W?D:N)(_);if(_===91)return Z.attempt(K2,D,W?$:N)(_);return W?D(_):N(_)}function $(_){return Z.attempt(Q2,D,N)(_)}function D(_){return K(_)}function N(_){return H._balanced=!0,Q(_)}}function W2(Z,K,Q){return J;function J(N){return Z.enter("resource"),Z.enter("resourceMarker"),Z.consume(N),Z.exit("resourceMarker"),X}function X(N){return r(N)?S5(Z,H)(N):H(N)}function H(N){if(N===41)return D(N);return I6(Z,W,G,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(N)}function W(N){return r(N)?S5(Z,q)(N):D(N)}function G(N){return Q(N)}function q(N){if(N===34||N===39||N===40)return E6(Z,$,Q,"resourceTitle","resourceTitleMarker","resourceTitleString")(N);return D(N)}function $(N){return r(N)?S5(Z,D)(N):D(N)}function D(N){if(N===41)return Z.enter("resourceMarker"),Z.consume(N),Z.exit("resourceMarker"),Z.exit("resource"),K;return Q(N)}}function G2(Z,K,Q){let J=this;return X;function X(G){return S6.call(J,Z,H,W,"reference","referenceMarker","referenceString")(G)}function H(G){return J.parser.defined.includes(F5(J.sliceSerialize(J.events[J.events.length-1][1]).slice(1,-1)))?K(G):Q(G)}function W(G){return Q(G)}}function D2(Z,K,Q){return J;function J(H){return Z.enter("reference"),Z.enter("referenceMarker"),Z.consume(H),Z.exit("referenceMarker"),X}function X(H){if(H===93)return Z.enter("referenceMarker"),Z.consume(H),Z.exit("referenceMarker"),Z.exit("reference"),K;return Q(H)}}var O7={name:"labelStartImage",resolveAll:E5.resolveAll,tokenize:q2};function q2(Z,K,Q){let J=this;return X;function X(G){return Z.enter("labelImage"),Z.enter("labelImageMarker"),Z.consume(G),Z.exit("labelImageMarker"),H}function H(G){if(G===91)return Z.enter("labelMarker"),Z.consume(G),Z.exit("labelMarker"),Z.exit("labelImage"),W;return Q(G)}function W(G){return G===94&&"_hiddenFootnoteSupport"in J.parser.constructs?Q(G):K(G)}}var w7={name:"labelStartLink",resolveAll:E5.resolveAll,tokenize:Y2};function Y2(Z,K,Q){let J=this;return X;function X(W){return Z.enter("labelLink"),Z.enter("labelMarker"),Z.consume(W),Z.exit("labelMarker"),Z.exit("labelLink"),H}function H(W){return W===94&&"_hiddenFootnoteSupport"in J.parser.constructs?Q(W):K(W)}}var W6={name:"lineEnding",tokenize:$2};function $2(Z,K){return Q;function Q(J){return Z.enter("lineEnding"),Z.consume(J),Z.exit("lineEnding"),S(Z,K,"linePrefix")}}var b5={name:"thematicBreak",tokenize:U2};function U2(Z,K,Q){let J=0,X;return H;function H($){return Z.enter("thematicBreak"),W($)}function W($){return X=$,G($)}function G($){if($===X)return Z.enter("thematicBreakSequence"),q($);if(J>=3&&($===null||z($)))return Z.exit("thematicBreak"),K($);return Q($)}function q($){if($===X)return Z.consume($),J++,q;return Z.exit("thematicBreakSequence"),P($)?S(Z,G,"whitespace")($):G($)}}var e={continuation:{tokenize:M2},exit:B2,name:"list",tokenize:N2},_2={partial:!0,tokenize:F2},V2={partial:!0,tokenize:L2};function N2(Z,K,Q){let J=this,X=J.events[J.events.length-1],H=X&&X[1].type==="linePrefix"?X[2].sliceSerialize(X[1],!0).length:0,W=0;return G;function G(Y){let F=J.containerState.type||(Y===42||Y===43||Y===45?"listUnordered":"listOrdered");if(F==="listUnordered"?!J.containerState.marker||Y===J.containerState.marker:Q6(Y)){if(!J.containerState.type)J.containerState.type=F,Z.enter(F,{_container:!0});if(F==="listUnordered")return Z.enter("listItemPrefix"),Y===42||Y===45?Z.check(b5,Q,$)(Y):$(Y);if(!J.interrupt||Y===49)return Z.enter("listItemPrefix"),Z.enter("listItemValue"),q(Y)}return Q(Y)}function q(Y){if(Q6(Y)&&++W<10)return Z.consume(Y),q;if((!J.interrupt||W<2)&&(J.containerState.marker?Y===J.containerState.marker:Y===41||Y===46))return Z.exit("listItemValue"),$(Y);return Q(Y)}function $(Y){return Z.enter("listItemMarker"),Z.consume(Y),Z.exit("listItemMarker"),J.containerState.marker=J.containerState.marker||Y,Z.check(z5,J.interrupt?Q:D,Z.attempt(_2,_,N))}function D(Y){return J.containerState.initialBlankLine=!0,H++,_(Y)}function N(Y){if(P(Y))return Z.enter("listItemPrefixWhitespace"),Z.consume(Y),Z.exit("listItemPrefixWhitespace"),_;return Q(Y)}function _(Y){return J.containerState.size=H+J.sliceSerialize(Z.exit("listItemPrefix"),!0).length,K(Y)}}function M2(Z,K,Q){let J=this;return J.containerState._closeFlow=void 0,Z.check(z5,X,H);function X(G){return J.containerState.furtherBlankLines=J.containerState.furtherBlankLines||J.containerState.initialBlankLine,S(Z,K,"listItemIndent",J.containerState.size+1)(G)}function H(G){if(J.containerState.furtherBlankLines||!P(G))return J.containerState.furtherBlankLines=void 0,J.containerState.initialBlankLine=void 0,W(G);return J.containerState.furtherBlankLines=void 0,J.containerState.initialBlankLine=void 0,Z.attempt(V2,K,W)(G)}function W(G){return J.containerState._closeFlow=!0,J.interrupt=void 0,S(Z,Z.attempt(e,K,Q),"linePrefix",J.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(G)}}function L2(Z,K,Q){let J=this;return S(Z,X,"listItemIndent",J.containerState.size+1);function X(H){let W=J.events[J.events.length-1];return W&&W[1].type==="listItemIndent"&&W[2].sliceSerialize(W[1],!0).length===J.containerState.size?K(H):Q(H)}}function B2(Z){Z.exit(this.containerState.type)}function F2(Z,K,Q){let J=this;return S(Z,X,"listItemPrefixWhitespace",J.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function X(H){let W=J.events[J.events.length-1];return!P(H)&&W&&W[1].type==="listItemPrefixWhitespace"?K(H):Q(H)}}var b6={name:"setextUnderline",resolveTo:R2,tokenize:j2};function R2(Z,K){let Q=Z.length,J,X,H;while(Q--)if(Z[Q][0]==="enter"){if(Z[Q][1].type==="content"){J=Q;break}if(Z[Q][1].type==="paragraph")X=Q}else{if(Z[Q][1].type==="content")Z.splice(Q,1);if(!H&&Z[Q][1].type==="definition")H=Q}let W={type:"setextHeading",start:{...Z[J][1].start},end:{...Z[Z.length-1][1].end}};if(Z[X][1].type="setextHeadingText",H)Z.splice(X,0,["enter",W,K]),Z.splice(H+1,0,["exit",Z[J][1],K]),Z[J][1].end={...Z[H][1].end};else Z[J][1]=W;return Z.push(["exit",W,K]),Z}function j2(Z,K,Q){let J=this,X;return H;function H($){let D=J.events.length,N;while(D--)if(J.events[D][1].type!=="lineEnding"&&J.events[D][1].type!=="linePrefix"&&J.events[D][1].type!=="content"){N=J.events[D][1].type==="paragraph";break}if(!J.parser.lazy[J.now().line]&&(J.interrupt||N))return Z.enter("setextHeadingLine"),X=$,W($);return Q($)}function W($){return Z.enter("setextHeadingLineSequence"),G($)}function G($){if($===X)return Z.consume($),G;return Z.exit("setextHeadingLineSequence"),P($)?S(Z,q,"lineSuffix")($):q($)}function q($){if($===null||z($))return Z.exit("setextHeadingLine"),K($);return Q($)}}var aZ={tokenize:A2};function A2(Z){let K=this,Q=Z.attempt(z5,J,Z.attempt(this.parser.constructs.flowInitial,X,S(Z,Z.attempt(this.parser.constructs.flow,X,Z.attempt(F7,X)),"linePrefix")));return Q;function J(H){if(H===null){Z.consume(H);return}return Z.enter("lineEndingBlank"),Z.consume(H),Z.exit("lineEndingBlank"),K.currentConstruct=void 0,Q}function X(H){if(H===null){Z.consume(H);return}return Z.enter("lineEnding"),Z.consume(H),Z.exit("lineEnding"),K.currentConstruct=void 0,Q}}var dZ={resolveAll:oZ()},cZ=nZ("string"),sZ=nZ("text");function nZ(Z){return{resolveAll:oZ(Z==="text"?z2:void 0),tokenize:K};function K(Q){let J=this,X=this.parser.constructs[Z],H=Q.attempt(X,W,G);return W;function W(D){return $(D)?H(D):G(D)}function G(D){if(D===null){Q.consume(D);return}return Q.enter("data"),Q.consume(D),q}function q(D){if($(D))return Q.exit("data"),H(D);return Q.consume(D),q}function $(D){if(D===null)return!0;let N=X[D],_=-1;if(N)while(++_<N.length){let Y=N[_];if(!Y.previous||Y.previous.call(J,J.previous))return!0}return!1}}}function oZ(Z){return K;function K(Q,J){let X=-1,H;while(++X<=Q.length)if(H===void 0){if(Q[X]&&Q[X][1].type==="data")H=X,X++}else if(!Q[X]||Q[X][1].type!=="data"){if(X!==H+2)Q[H][1].end=Q[X-1][1].end,Q.splice(H+2,X-H-2),X=H+2;H=void 0}return Z?Z(Q,J):Q}}function z2(Z,K){let Q=0;while(++Q<=Z.length)if((Q===Z.length||Z[Q][1].type==="lineEnding")&&Z[Q-1][1].type==="data"){let J=Z[Q-1][1],X=K.sliceStream(J),H=X.length,W=-1,G=0,q;while(H--){let $=X[H];if(typeof $==="string"){W=$.length;while($.charCodeAt(W-1)===32)G++,W--;if(W)break;W=-1}else if($===-2)q=!0,G++;else if($===-1);else{H++;break}}if(K._contentTypeTextTrailing&&Q===Z.length)G=0;if(G){let $={type:Q===Z.length||q||G<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:H?W:J.start._bufferIndex+W,_index:J.start._index+H,line:J.end.line,column:J.end.column-G,offset:J.end.offset-G},end:{...J.end}};if(J.end={...$.start},J.start.offset===J.end.offset)Object.assign(J,$);else Z.splice(Q,0,["enter",$,K],["exit",$,K]),Q+=2}Q++}return Z}var P7={};QZ(P7,{text:()=>I2,string:()=>P2,insideSpan:()=>S2,flowInitial:()=>O2,flow:()=>w2,document:()=>T2,disable:()=>b2,contentInitial:()=>C2,attentionMarkers:()=>E2});var T2={[42]:e,[43]:e,[45]:e,[48]:e,[49]:e,[50]:e,[51]:e,[52]:e,[53]:e,[54]:e,[55]:e,[56]:e,[57]:e,[62]:T6},C2={[91]:R7},O2={[-2]:X6,[-1]:X6,[32]:X6},w2={[35]:A7,[42]:b5,[45]:[b6,b5],[60]:T7,[61]:b6,[95]:b5,[96]:w6,[126]:w6},P2={[38]:O6,[92]:C6},I2={[-5]:W6,[-4]:W6,[-3]:W6,[33]:O7,[38]:O6,[42]:J6,[60]:[M7,C7],[91]:w7,[92]:[j7,C6],[93]:E5,[95]:J6,[96]:L7},S2={null:[J6,dZ]},E2={null:[42,95]},b2={null:[]};function tZ(Z,K,Q){let J={_bufferIndex:-1,_index:0,line:Q&&Q.line||1,column:Q&&Q.column||1,offset:Q&&Q.offset||0},X={},H=[],W=[],G=[],q=!0,$={attempt:h(v),check:h(a),consume:p,enter:l,exit:B,interrupt:h(a,{interrupt:!0})},D={code:null,containerState:{},defineSkip:j,events:[],now:O,parser:Z,previous:null,sliceSerialize:F,sliceStream:R,write:Y},N=K.tokenize.call(D,$),_;if(K.resolveAll)H.push(K);return D;function Y(C){if(W=K5(W,C),g(),W[W.length-1]!==null)return[];return u(K,0),D.events=v5(H,D.events,D),D.events}function F(C,b){return y2(R(C),b)}function R(C){return g2(W,C)}function O(){let{_bufferIndex:C,_index:b,line:E,column:f,offset:c}=J;return{_bufferIndex:C,_index:b,line:E,column:f,offset:c}}function j(C){X[C.line]=C.column,k()}function g(){let C;while(J._index<W.length){let b=W[J._index];if(typeof b==="string"){if(C=J._index,J._bufferIndex<0)J._bufferIndex=0;while(J._index===C&&J._bufferIndex<b.length)T(b.charCodeAt(J._bufferIndex))}else T(b)}}function T(C){q=void 0,_=C,N=N(C)}function p(C){if(z(C))J.line++,J.column=1,J.offset+=C===-3?2:1,k();else if(C!==-1)J.column++,J.offset++;if(J._bufferIndex<0)J._index++;else if(J._bufferIndex++,J._bufferIndex===W[J._index].length)J._bufferIndex=-1,J._index++;D.previous=C,q=!0}function l(C,b){let E=b||{};return E.type=C,E.start=O(),D.events.push(["enter",E,D]),G.push(E),E}function B(C){let b=G.pop();return b.end=O(),D.events.push(["exit",b,D]),b}function v(C,b){u(C,b.from)}function a(C,b){b.restore()}function h(C,b){return E;function E(f,c,D5){let U5,U,_5,V5;return Array.isArray(f)?q5(f):("tokenize"in f)?q5([f]):V(f);function V(n){return a5;function a5(N5){let O5=N5!==null&&n[N5],y5=N5!==null&&n.null,s6=[...Array.isArray(O5)?O5:O5?[O5]:[],...Array.isArray(y5)?y5:y5?[y5]:[]];return q5(s6)(N5)}}function q5(n){if(U5=n,U=0,n.length===0)return D5;return C5(n[U])}function C5(n){return a5;function a5(N5){if(V5=H5(),_5=n,!n.partial)D.currentConstruct=n;if(n.name&&D.parser.constructs.disable.null.includes(n.name))return N6(N5);return n.tokenize.call(b?Object.assign(Object.create(D),b):D,$,c6,N6)(N5)}}function c6(n){return q=!0,C(_5,V5),c}function N6(n){if(q=!0,V5.restore(),++U<U5.length)return C5(U5[U]);return D5}}}function u(C,b){if(C.resolveAll&&!H.includes(C))H.push(C);if(C.resolve)t(D.events,b,D.events.length-b,C.resolve(D.events.slice(b),D));if(C.resolveTo)D.events=C.resolveTo(D.events,D)}function H5(){let C=O(),b=D.previous,E=D.currentConstruct,f=D.events.length,c=Array.from(G);return{from:f,restore:D5};function D5(){J=C,D.previous=b,D.currentConstruct=E,D.events.length=f,G=c,k()}}function k(){if(J.line in X&&J.column<2)J.column=X[J.line],J.offset+=X[J.line]-1}}function g2(Z,K){let Q=K.start._index,J=K.start._bufferIndex,X=K.end._index,H=K.end._bufferIndex,W;if(Q===X)W=[Z[Q].slice(J,H)];else{if(W=Z.slice(Q,X),J>-1){let G=W[0];if(typeof G==="string")W[0]=G.slice(J);else W.shift()}if(H>0)W.push(Z[X].slice(0,H))}return W}function y2(Z,K){let Q=-1,J=[],X;while(++Q<Z.length){let H=Z[Q],W;if(typeof H==="string")W=H;else switch(H){case-5:{W="\r";break}case-4:{W=`
3
3
  `;break}case-3:{W=`\r
4
4
  `;break}case-2:{W=K?" ":"\t";break}case-1:{if(!K&&X)continue;W=" ";break}default:W=String.fromCharCode(H)}X=H===-2,J.push(W)}return J.join("")}function I7(Z){let J={constructs:yZ([P7,...(Z||{}).extensions||[]]),content:X(pZ),defined:[],document:X(lZ),flow:X(aZ),lazy:{},string:X(cZ),text:X(sZ)};return J;function X(H){return W;function W(G){return tZ(J,H,G)}}}function S7(Z){while(!P6(Z));return Z}var eZ=/[\0\t\n\r]/g;function E7(){let Z=1,K="",Q=!0,J;return X;function X(H,W,G){let q=[],$,D,N,_,Y;if(H=K+(typeof H==="string"?H.toString():new TextDecoder(W||void 0).decode(H)),N=0,K="",Q){if(H.charCodeAt(0)===65279)N++;Q=void 0}while(N<H.length){if(eZ.lastIndex=N,$=eZ.exec(H),_=$&&$.index!==void 0?$.index:H.length,Y=H.charCodeAt(_),!$){K=H.slice(N);break}if(Y===10&&N===_&&J)q.push(-3),J=void 0;else{if(J)q.push(-5),J=void 0;if(N<_)q.push(H.slice(N,_)),Z+=_-N;switch(Y){case 0:{q.push(65533),Z++;break}case 9:{D=Math.ceil(Z/4)*4,q.push(-2);while(Z++<D)q.push(-1);break}case 10:{q.push(-4),Z=1;break}default:J=!0,Z=1}}N=_+1}if(G){if(J)q.push(-5);if(K)q.push(K);q.push(null)}return q}}var x2=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Z4(Z){return Z.replace(x2,h2)}function h2(Z,K,Q){if(K)return K;if(Q.charCodeAt(0)===35){let X=Q.charCodeAt(1),H=X===120||X===88;return z6(Q.slice(H?2:1),H?16:10)}return m5(Q)||Z}var Q4={}.hasOwnProperty;function b7(Z,K,Q){if(K&&typeof K==="object")Q=K,K=void 0;return k2(Q)(S7(I7(Q).document().write(E7()(Z,K,!0))))}function k2(Z){let K={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:H(t7),autolinkProtocol:h,autolinkEmail:h,atxHeading:H(s7),blockQuote:H(N5),characterEscape:h,characterReference:h,codeFenced:H(O5),codeFencedFenceInfo:W,codeFencedFenceMeta:W,codeIndented:H(O5,W),codeText:H(y5,W),codeTextData:h,data:h,codeFlowValue:h,definition:H(s6),definitionDestinationString:W,definitionLabelString:W,definitionTitleString:W,emphasis:H(W0),hardBreakEscape:H(n7),hardBreakTrailing:H(n7),htmlFlow:H(o7,W),htmlFlowData:h,htmlText:H(o7,W),htmlTextData:h,image:H(G0),label:W,link:H(t7),listItem:H(D0),listItemValue:_,listOrdered:H(e7,N),listUnordered:H(e7),paragraph:H(q0),reference:V,referenceString:W,resourceDestinationString:W,resourceTitleString:W,setextHeading:H(s7),strong:H(Y0),thematicBreak:H(U0)},exit:{atxHeading:q(),atxHeadingSequence:l,autolink:q(),autolinkEmail:a5,autolinkProtocol:n,blockQuote:q(),characterEscapeValue:u,characterReferenceMarkerHexadecimal:C5,characterReferenceMarkerNumeric:C5,characterReferenceValue:c6,characterReference:N6,codeFenced:q(O),codeFencedFence:R,codeFencedFenceInfo:Y,codeFencedFenceMeta:F,codeFlowValue:u,codeIndented:q(j),codeText:q(E),codeTextData:u,data:u,definition:q(),definitionDestinationString:p,definitionLabelString:g,definitionTitleString:T,emphasis:q(),hardBreakEscape:q(k),hardBreakTrailing:q(k),htmlFlow:q(C),htmlFlowData:u,htmlText:q(b),htmlTextData:u,image:q(c),label:U5,labelText:D5,lineEnding:H5,link:q(f),listItem:q(),listOrdered:q(),listUnordered:q(),paragraph:q(),referenceString:q5,resourceDestinationString:U,resourceTitleString:_5,resource:V5,setextHeading:q(a),setextHeadingLineSequence:v,setextHeadingText:B,strong:q(),thematicBreak:q()}};J4(K,(Z||{}).mdastExtensions||[]);let Q={};return J;function J(M){let A={type:"root",children:[]},I={stack:[A],tokenStack:[],config:K,enter:G,exit:$,buffer:W,resume:D,data:Q},y=[],m=-1;while(++m<M.length)if(M[m][1].type==="listOrdered"||M[m][1].type==="listUnordered")if(M[m][0]==="enter")y.push(m);else{let Y5=y.pop();m=X(M,Y5,m)}m=-1;while(++m<M.length){let Y5=K[M[m][0]];if(Q4.call(Y5,M[m][1].type))Y5[M[m][1].type].call(Object.assign({sliceSerialize:M[m][2].sliceSerialize},I),M[m][1])}if(I.tokenStack.length>0){let Y5=I.tokenStack[I.tokenStack.length-1];(Y5[1]||K4).call(I,void 0,Y5[0])}A.position={start:T5(M.length>0?M[0][1].start:{line:1,column:1,offset:0}),end:T5(M.length>0?M[M.length-2][1].end:{line:1,column:1,offset:0})},m=-1;while(++m<K.transforms.length)A=K.transforms[m](A)||A;return A}function X(M,A,I){let y=A-1,m=-1,Y5=!1,w5,M5,d5,c5;while(++y<=I){let J5=M[y];switch(J5[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{if(J5[0]==="enter")m++;else m--;c5=void 0;break}case"lineEndingBlank":{if(J5[0]==="enter"){if(w5&&!c5&&!m&&!d5)d5=y;c5=void 0}break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:c5=void 0}if(!m&&J5[0]==="enter"&&J5[1].type==="listItemPrefix"||m===-1&&J5[0]==="exit"&&(J5[1].type==="listUnordered"||J5[1].type==="listOrdered")){if(w5){let x5=y;M5=void 0;while(x5--){let L5=M[x5];if(L5[1].type==="lineEnding"||L5[1].type==="lineEndingBlank"){if(L5[0]==="exit")continue;if(M5)M[M5][1].type="lineEndingBlank",Y5=!0;L5[1].type="lineEnding",M5=x5}else if(L5[1].type==="linePrefix"||L5[1].type==="blockQuotePrefix"||L5[1].type==="blockQuotePrefixWhitespace"||L5[1].type==="blockQuoteMarker"||L5[1].type==="listItemIndent");else break}if(d5&&(!M5||d5<M5))w5._spread=!0;w5.end=Object.assign({},M5?M[M5][1].start:J5[1].end),M.splice(M5||y,0,["exit",w5,J5[2]]),y++,I++}if(J5[1].type==="listItemPrefix"){let x5={type:"listItem",_spread:!1,start:Object.assign({},J5[1].start),end:void 0};w5=x5,M.splice(y,0,["enter",x5,J5[2]]),y++,I++,d5=void 0,c5=!0}}}return M[A][1]._spread=Y5,I}function H(M,A){return I;function I(y){if(G.call(this,M(y),y),A)A.call(this,y)}}function W(){this.stack.push({type:"fragment",children:[]})}function G(M,A,I){this.stack[this.stack.length-1].children.push(M),this.stack.push(M),this.tokenStack.push([A,I||void 0]),M.position={start:T5(A.start),end:void 0}}function q(M){return A;function A(I){if(M)M.call(this,I);$.call(this,I)}}function $(M,A){let I=this.stack.pop(),y=this.tokenStack.pop();if(!y)throw Error("Cannot close `"+M.type+"` ("+j5({start:M.start,end:M.end})+"): it’s not open");else if(y[0].type!==M.type)if(A)A.call(this,M,y[0]);else(y[1]||K4).call(this,M,y[0]);I.position.end=T5(M.end)}function D(){return V7(this.stack.pop())}function N(){this.data.expectingFirstListItemValue=!0}function _(M){if(this.data.expectingFirstListItemValue){let A=this.stack[this.stack.length-2];A.start=Number.parseInt(this.sliceSerialize(M),10),this.data.expectingFirstListItemValue=void 0}}function Y(){let M=this.resume(),A=this.stack[this.stack.length-1];A.lang=M}function F(){let M=this.resume(),A=this.stack[this.stack.length-1];A.meta=M}function R(){if(this.data.flowCodeInside)return;this.buffer(),this.data.flowCodeInside=!0}function O(){let M=this.resume(),A=this.stack[this.stack.length-1];A.value=M.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function j(){let M=this.resume(),A=this.stack[this.stack.length-1];A.value=M.replace(/(\r?\n|\r)$/g,"")}function g(M){let A=this.resume(),I=this.stack[this.stack.length-1];I.label=A,I.identifier=F5(this.sliceSerialize(M)).toLowerCase()}function T(){let M=this.resume(),A=this.stack[this.stack.length-1];A.title=M}function p(){let M=this.resume(),A=this.stack[this.stack.length-1];A.url=M}function l(M){let A=this.stack[this.stack.length-1];if(!A.depth){let I=this.sliceSerialize(M).length;A.depth=I}}function B(){this.data.setextHeadingSlurpLineEnding=!0}function v(M){let A=this.stack[this.stack.length-1];A.depth=this.sliceSerialize(M).codePointAt(0)===61?1:2}function a(){this.data.setextHeadingSlurpLineEnding=void 0}function h(M){let I=this.stack[this.stack.length-1].children,y=I[I.length-1];if(!y||y.type!=="text")y=$0(),y.position={start:T5(M.start),end:void 0},I.push(y);this.stack.push(y)}function u(M){let A=this.stack.pop();A.value+=this.sliceSerialize(M),A.position.end=T5(M.end)}function H5(M){let A=this.stack[this.stack.length-1];if(this.data.atHardBreak){let I=A.children[A.children.length-1];I.position.end=T5(M.end),this.data.atHardBreak=void 0;return}if(!this.data.setextHeadingSlurpLineEnding&&K.canContainEols.includes(A.type))h.call(this,M),u.call(this,M)}function k(){this.data.atHardBreak=!0}function C(){let M=this.resume(),A=this.stack[this.stack.length-1];A.value=M}function b(){let M=this.resume(),A=this.stack[this.stack.length-1];A.value=M}function E(){let M=this.resume(),A=this.stack[this.stack.length-1];A.value=M}function f(){let M=this.stack[this.stack.length-1];if(this.data.inReference){let A=this.data.referenceType||"shortcut";M.type+="Reference",M.referenceType=A,delete M.url,delete M.title}else delete M.identifier,delete M.label;this.data.referenceType=void 0}function c(){let M=this.stack[this.stack.length-1];if(this.data.inReference){let A=this.data.referenceType||"shortcut";M.type+="Reference",M.referenceType=A,delete M.url,delete M.title}else delete M.identifier,delete M.label;this.data.referenceType=void 0}function D5(M){let A=this.sliceSerialize(M),I=this.stack[this.stack.length-2];I.label=Z4(A),I.identifier=F5(A).toLowerCase()}function U5(){let M=this.stack[this.stack.length-1],A=this.resume(),I=this.stack[this.stack.length-1];if(this.data.inReference=!0,I.type==="link"){let y=M.children;I.children=y}else I.alt=A}function U(){let M=this.resume(),A=this.stack[this.stack.length-1];A.url=M}function _5(){let M=this.resume(),A=this.stack[this.stack.length-1];A.title=M}function V5(){this.data.inReference=void 0}function V(){this.data.referenceType="collapsed"}function q5(M){let A=this.resume(),I=this.stack[this.stack.length-1];I.label=A,I.identifier=F5(this.sliceSerialize(M)).toLowerCase(),this.data.referenceType="full"}function C5(M){this.data.characterReferenceType=M.type}function c6(M){let A=this.sliceSerialize(M),I=this.data.characterReferenceType,y;if(I)y=z6(A,I==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0;else y=m5(A);let m=this.stack[this.stack.length-1];m.value+=y}function N6(M){let A=this.stack.pop();A.position.end=T5(M.end)}function n(M){u.call(this,M);let A=this.stack[this.stack.length-1];A.url=this.sliceSerialize(M)}function a5(M){u.call(this,M);let A=this.stack[this.stack.length-1];A.url="mailto:"+this.sliceSerialize(M)}function N5(){return{type:"blockquote",children:[]}}function O5(){return{type:"code",lang:null,meta:null,value:""}}function y5(){return{type:"inlineCode",value:""}}function s6(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function W0(){return{type:"emphasis",children:[]}}function s7(){return{type:"heading",depth:0,children:[]}}function n7(){return{type:"break"}}function o7(){return{type:"html",value:""}}function G0(){return{type:"image",title:null,url:"",alt:null}}function t7(){return{type:"link",title:null,url:"",children:[]}}function e7(M){return{type:"list",ordered:M.type==="listOrdered",start:null,spread:M._spread,children:[]}}function D0(M){return{type:"listItem",spread:M._spread,checked:null,children:[]}}function q0(){return{type:"paragraph",children:[]}}function Y0(){return{type:"strong",children:[]}}function $0(){return{type:"text",value:""}}function U0(){return{type:"thematicBreak"}}}function T5(Z){return{line:Z.line,column:Z.column,offset:Z.offset}}function J4(Z,K){let Q=-1;while(++Q<K.length){let J=K[Q];if(Array.isArray(J))J4(Z,J);else m2(Z,J)}}function m2(Z,K){let Q;for(Q in K)if(Q4.call(K,Q))switch(Q){case"canContainEols":{let J=K[Q];if(J)Z[Q].push(...J);break}case"transforms":{let J=K[Q];if(J)Z[Q].push(...J);break}case"enter":case"exit":{let J=K[Q];if(J)Object.assign(Z[Q],J);break}}}function K4(Z,K){if(Z)throw Error("Cannot close `"+Z.type+"` ("+j5({start:Z.start,end:Z.end})+"): a different token (`"+K.type+"`, "+j5({start:K.start,end:K.end})+") is open");else throw Error("Cannot close document, a token (`"+K.type+"`, "+j5({start:K.start,end:K.end})+") is still open")}function g6(Z){let K=this;K.parser=Q;function Q(J){return b7(J,{...K.data("settings"),...Z,extensions:K.data("micromarkExtensions")||[],mdastExtensions:K.data("fromMarkdownExtensions")||[]})}}var y6=-1,p5=0,g5=1,u5=2,G6=3,D6=4,q6=5,Y6=6,x6=7,h6=8;var v2=typeof self==="object"?self:globalThis,X4=(Z,K)=>{switch(Z){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw TypeError("unable to deserialize "+Z)}return new v2[Z](K)},p2=(Z,K)=>{let Q=(X,H)=>{return Z.set(H,X),X},J=(X)=>{if(Z.has(X))return Z.get(X);let[H,W]=K[X];switch(H){case p5:case y6:return Q(W,X);case g5:{let G=Q([],X);for(let q of W)G.push(J(q));return G}case u5:{let G=Q({},X);for(let[q,$]of W)G[J(q)]=J($);return G}case G6:return Q(new Date(W),X);case D6:{let{source:G,flags:q}=W;return Q(new RegExp(G,q),X)}case q6:{let G=Q(new Map,X);for(let[q,$]of W)G.set(J(q),J($));return G}case Y6:{let G=Q(new Set,X);for(let q of W)G.add(J(q));return G}case x6:{let{name:G,message:q}=W;return Q(X4(G,q),X)}case h6:return Q(BigInt(W),X);case"BigInt":return Q(Object(BigInt(W)),X);case"ArrayBuffer":return Q(new Uint8Array(W).buffer,W);case"DataView":{let{buffer:G}=new Uint8Array(W);return Q(new DataView(G),W)}}return Q(X4(H,W),X)};return J},g7=(Z)=>p2(new Map,Z)(0);var l5="",{toString:u2}={},{keys:l2}=Object,$6=(Z)=>{let K=typeof Z;if(K!=="object"||!Z)return[p5,K];let Q=u2.call(Z).slice(8,-1);switch(Q){case"Array":return[g5,l5];case"Object":return[u5,l5];case"Date":return[G6,l5];case"RegExp":return[D6,l5];case"Map":return[q6,l5];case"Set":return[Y6,l5];case"DataView":return[g5,Q]}if(Q.includes("Array"))return[g5,Q];if(Q.includes("Error"))return[x6,Q];return[u5,Q]},k6=([Z,K])=>Z===p5&&(K==="function"||K==="symbol"),f2=(Z,K,Q,J)=>{let X=(W,G)=>{let q=J.push(W)-1;return Q.set(G,q),q},H=(W)=>{if(Q.has(W))return Q.get(W);let[G,q]=$6(W);switch(G){case p5:{let D=W;switch(q){case"bigint":G=h6,D=W.toString();break;case"function":case"symbol":if(Z)throw TypeError("unable to serialize "+q);D=null;break;case"undefined":return X([y6],W)}return X([G,D],W)}case g5:{if(q){let _=W;if(q==="DataView")_=new Uint8Array(W.buffer);else if(q==="ArrayBuffer")_=new Uint8Array(W);return X([q,[..._]],W)}let D=[],N=X([G,D],W);for(let _ of W)D.push(H(_));return N}case u5:{if(q)switch(q){case"BigInt":return X([q,W.toString()],W);case"Boolean":case"Number":case"String":return X([q,W.valueOf()],W)}if(K&&"toJSON"in W)return H(W.toJSON());let D=[],N=X([G,D],W);for(let _ of l2(W))if(Z||!k6($6(W[_])))D.push([H(_),H(W[_])]);return N}case G6:return X([G,W.toISOString()],W);case D6:{let{source:D,flags:N}=W;return X([G,{source:D,flags:N}],W)}case q6:{let D=[],N=X([G,D],W);for(let[_,Y]of W)if(Z||!(k6($6(_))||k6($6(Y))))D.push([H(_),H(Y)]);return N}case Y6:{let D=[],N=X([G,D],W);for(let _ of W)if(Z||!k6($6(_)))D.push(H(_));return N}}let{message:$}=W;return X([G,{name:q,message:$}],W)};return H},y7=(Z,{json:K,lossy:Q}={})=>{let J=[];return f2(!(K||Q),!!K,new Map,J)(Z),J};var f5=typeof structuredClone==="function"?(Z,K)=>K&&(("json"in K)||("lossy"in K))?g7(y7(Z,K)):structuredClone(Z):(Z,K)=>g7(y7(Z,K));function i2(Z,K){let Q=[{type:"text",value:"↩"}];if(K>1)Q.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(K)}]});return Q}function r2(Z,K){return"Back to reference "+(Z+1)+(K>1?"-"+K:"")}function H4(Z){let K=typeof Z.options.clobberPrefix==="string"?Z.options.clobberPrefix:"user-content-",Q=Z.options.footnoteBackContent||i2,J=Z.options.footnoteBackLabel||r2,X=Z.options.footnoteLabel||"Footnotes",H=Z.options.footnoteLabelTagName||"h2",W=Z.options.footnoteLabelProperties||{className:["sr-only"]},G=[],q=-1;while(++q<Z.footnoteOrder.length){let $=Z.footnoteById.get(Z.footnoteOrder[q]);if(!$)continue;let D=Z.all($),N=String($.identifier).toUpperCase(),_=G5(N.toLowerCase()),Y=0,F=[],R=Z.footnoteCounts.get(N);while(R!==void 0&&++Y<=R){if(F.length>0)F.push({type:"text",value:" "});let g=typeof Q==="string"?Q:Q(q,Y);if(typeof g==="string")g={type:"text",value:g};F.push({type:"element",tagName:"a",properties:{href:"#"+K+"fnref-"+_+(Y>1?"-"+Y:""),dataFootnoteBackref:"",ariaLabel:typeof J==="string"?J:J(q,Y),className:["data-footnote-backref"]},children:Array.isArray(g)?g:[g]})}let O=D[D.length-1];if(O&&O.type==="element"&&O.tagName==="p"){let g=O.children[O.children.length-1];if(g&&g.type==="text")g.value+=" ";else O.children.push({type:"text",value:" "});O.children.push(...F)}else D.push(...F);let j={type:"element",tagName:"li",properties:{id:K+"fn-"+_},children:Z.wrap(D,!0)};Z.patch($,j),G.push(j)}if(G.length===0)return;return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:H,properties:{...f5(W),id:"footnote-label"},children:[{type:"text",value:X}]},{type:"text",value:`
@@ -11,4 +11,4 @@ import{Lh as L9,Mh as K0,Nh as Q0,Oh as J0}from"./chunk-5ctpz542.js";import{nm a
11
11
  `});while(++J<Z.length){if(J)Q.push({type:"text",value:`
12
12
  `});Q.push(Z[J])}if(K&&Z.length>0)Q.push({type:"text",value:`
13
13
  `});return Q}function x4(Z){let K=0,Q=Z.charCodeAt(K);while(Q===9||Q===32)K++,Q=Z.charCodeAt(K);return Z.slice(K)}function f6(Z,K){let Q=h4(Z,K),J=Q.one(Z,void 0),X=H4(Q),H=Array.isArray(J)?{type:"root",children:J}:J||{type:"root",children:[]};if(X)Z5("children"in H),H.children.push({type:"text",value:`
14
- `},X);return H}function i6(Z,K){if(Z&&"run"in Z)return async function(Q,J){let X=f6(Q,{file:J,...K});await Z.run(X,J)};return function(Q,J){return f6(Q,{file:J,...Z||K})}}function v7(Z){if(Z)throw Z}var d6=q7(r4(),1);function _6(Z){if(typeof Z!=="object"||Z===null)return!1;let K=Object.getPrototypeOf(Z);return(K===null||K===Object.prototype||Object.getPrototypeOf(K)===null)&&!(Symbol.toStringTag in Z)&&!(Symbol.iterator in Z)}function p7(){let Z=[],K={run:Q,use:J};return K;function Q(...X){let H=-1,W=X.pop();if(typeof W!=="function")throw TypeError("Expected function as last argument, not "+W);G(null,...X);function G(q,...$){let D=Z[++H],N=-1;if(q){W(q);return}while(++N<X.length)if($[N]===null||$[N]===void 0)$[N]=X[N];if(X=$,D)a4(D,G)(...$);else W(null,...$)}}function J(X){if(typeof X!=="function")throw TypeError("Expected `middelware` to be a function, not "+X);return Z.push(X),K}}function a4(Z,K){let Q;return J;function J(...W){let G=Z.length>W.length,q;if(G)W.push(X);try{q=Z.apply(this,W)}catch($){let D=$;if(G&&Q)throw D;return X(D)}if(!G)if(q&&q.then&&typeof q.then==="function")q.then(H,X);else if(q instanceof Error)X(q);else H(q)}function X(W,...G){if(!Q)Q=!0,K(W,...G)}function H(W){X(null,W)}}var $5={basename:X9,dirname:H9,extname:W9,join:G9,sep:"/"};function X9(Z,K){if(K!==void 0&&typeof K!=="string")throw TypeError('"ext" argument must be a string');V6(Z);let Q=0,J=-1,X=Z.length,H;if(K===void 0||K.length===0||K.length>Z.length){while(X--)if(Z.codePointAt(X)===47){if(H){Q=X+1;break}}else if(J<0)H=!0,J=X+1;return J<0?"":Z.slice(Q,J)}if(K===Z)return"";let W=-1,G=K.length-1;while(X--)if(Z.codePointAt(X)===47){if(H){Q=X+1;break}}else{if(W<0)H=!0,W=X+1;if(G>-1)if(Z.codePointAt(X)===K.codePointAt(G--)){if(G<0)J=X}else G=-1,J=W}if(Q===J)J=W;else if(J<0)J=Z.length;return Z.slice(Q,J)}function H9(Z){if(V6(Z),Z.length===0)return".";let K=-1,Q=Z.length,J;while(--Q)if(Z.codePointAt(Q)===47){if(J){K=Q;break}}else if(!J)J=!0;return K<0?Z.codePointAt(0)===47?"/":".":K===1&&Z.codePointAt(0)===47?"//":Z.slice(0,K)}function W9(Z){V6(Z);let K=Z.length,Q=-1,J=0,X=-1,H=0,W;while(K--){let G=Z.codePointAt(K);if(G===47){if(W){J=K+1;break}continue}if(Q<0)W=!0,Q=K+1;if(G===46){if(X<0)X=K;else if(H!==1)H=1}else if(X>-1)H=-1}if(X<0||Q<0||H===0||H===1&&X===Q-1&&X===J+1)return"";return Z.slice(X,Q)}function G9(...Z){let K=-1,Q;while(++K<Z.length)if(V6(Z[K]),Z[K])Q=Q===void 0?Z[K]:Q+"/"+Z[K];return Q===void 0?".":D9(Q)}function D9(Z){V6(Z);let K=Z.codePointAt(0)===47,Q=q9(Z,!K);if(Q.length===0&&!K)Q=".";if(Q.length>0&&Z.codePointAt(Z.length-1)===47)Q+="/";return K?"/"+Q:Q}function q9(Z,K){let Q="",J=0,X=-1,H=0,W=-1,G,q;while(++W<=Z.length){if(W<Z.length)G=Z.codePointAt(W);else if(G===47)break;else G=47;if(G===47){if(X===W-1||H===1);else if(X!==W-1&&H===2){if(Q.length<2||J!==2||Q.codePointAt(Q.length-1)!==46||Q.codePointAt(Q.length-2)!==46){if(Q.length>2){if(q=Q.lastIndexOf("/"),q!==Q.length-1){if(q<0)Q="",J=0;else Q=Q.slice(0,q),J=Q.length-1-Q.lastIndexOf("/");X=W,H=0;continue}}else if(Q.length>0){Q="",J=0,X=W,H=0;continue}}if(K)Q=Q.length>0?Q+"/..":"..",J=2}else{if(Q.length>0)Q+="/"+Z.slice(X+1,W);else Q=Z.slice(X+1,W);J=W-X-1}X=W,H=0}else if(G===46&&H>-1)H++;else H=-1}return Q}function V6(Z){if(typeof Z!=="string")throw TypeError("Path must be a string. Received "+JSON.stringify(Z))}var d4={cwd:Y9};function Y9(){return"/"}function i5(Z){return Boolean(Z!==null&&typeof Z==="object"&&"href"in Z&&Z.href&&"protocol"in Z&&Z.protocol&&Z.auth===void 0)}function c4(Z){if(typeof Z==="string")Z=new URL(Z);else if(!i5(Z)){let K=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+Z+"`");throw K.code="ERR_INVALID_ARG_TYPE",K}if(Z.protocol!=="file:"){let K=TypeError("The URL must be of scheme file");throw K.code="ERR_INVALID_URL_SCHEME",K}return $9(Z)}function $9(Z){if(Z.hostname!==""){let J=TypeError('File URL host must be "localhost" or empty on darwin');throw J.code="ERR_INVALID_FILE_URL_HOST",J}let K=Z.pathname,Q=-1;while(++Q<K.length)if(K.codePointAt(Q)===37&&K.codePointAt(Q+1)===50){let J=K.codePointAt(Q+2);if(J===70||J===102){let X=TypeError("File URL path must not include encoded / characters");throw X.code="ERR_INVALID_FILE_URL_PATH",X}}return decodeURIComponent(K)}var u7=["history","path","basename","stem","extname","dirname"];class r5{constructor(Z){let K;if(!Z)K={};else if(i5(Z))K={path:Z};else if(typeof Z==="string"||U9(Z))K={value:Z};else K=Z;this.cwd="cwd"in K?"":d4.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let Q=-1;while(++Q<u7.length){let X=u7[Q];if(X in K&&K[X]!==void 0&&K[X]!==null)this[X]=X==="history"?[...K[X]]:K[X]}let J;for(J in K)if(!u7.includes(J))this[J]=K[J]}get basename(){return typeof this.path==="string"?$5.basename(this.path):void 0}set basename(Z){f7(Z,"basename"),l7(Z,"basename"),this.path=$5.join(this.dirname||"",Z)}get dirname(){return typeof this.path==="string"?$5.dirname(this.path):void 0}set dirname(Z){s4(this.basename,"dirname"),this.path=$5.join(Z||"",this.basename)}get extname(){return typeof this.path==="string"?$5.extname(this.path):void 0}set extname(Z){if(l7(Z,"extname"),s4(this.dirname,"extname"),Z){if(Z.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if(Z.includes(".",1))throw Error("`extname` cannot contain multiple dots")}this.path=$5.join(this.dirname,this.stem+(Z||""))}get path(){return this.history[this.history.length-1]}set path(Z){if(i5(Z))Z=c4(Z);if(f7(Z,"path"),this.path!==Z)this.history.push(Z)}get stem(){return typeof this.path==="string"?$5.basename(this.path,this.extname):void 0}set stem(Z){f7(Z,"stem"),l7(Z,"stem"),this.path=$5.join(this.dirname||"",Z+(this.extname||""))}fail(Z,K,Q){let J=this.message(Z,K,Q);throw J.fatal=!0,J}info(Z,K,Q){let J=this.message(Z,K,Q);return J.fatal=void 0,J}message(Z,K,Q){let J=new d(Z,K,Q);if(this.path)J.name=this.path+":"+J.name,J.file=this.path;return J.fatal=!1,this.messages.push(J),J}toString(Z){if(this.value===void 0)return"";if(typeof this.value==="string")return this.value;return new TextDecoder(Z||void 0).decode(this.value)}}function l7(Z,K){if(Z&&Z.includes($5.sep))throw Error("`"+K+"` cannot be a path: did not expect `"+$5.sep+"`")}function f7(Z,K){if(!Z)throw Error("`"+K+"` cannot be empty")}function s4(Z,K){if(!Z)throw Error("Setting `"+K+"` requires `path` to be set too")}function U9(Z){return Boolean(Z&&typeof Z==="object"&&"byteLength"in Z&&"byteOffset"in Z)}var n4=function(Z){let J=this.constructor.prototype,X=J[Z],H=function(){return X.apply(H,arguments)};return Object.setPrototypeOf(H,J),H};var _9={}.hasOwnProperty;class d7 extends n4{constructor(){super("copy");this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=p7()}copy(){let Z=new d7,K=-1;while(++K<this.attachers.length){let Q=this.attachers[K];Z.use(...Q)}return Z.data(d6.default(!0,{},this.namespace)),Z}data(Z,K){if(typeof Z==="string"){if(arguments.length===2)return a7("data",this.frozen),this.namespace[Z]=K,this;return _9.call(this.namespace,Z)&&this.namespace[Z]||void 0}if(Z)return a7("data",this.frozen),this.namespace=Z,this;return this.namespace}freeze(){if(this.frozen)return this;let Z=this;while(++this.freezeIndex<this.attachers.length){let[K,...Q]=this.attachers[this.freezeIndex];if(Q[0]===!1)continue;if(Q[0]===!0)Q[0]=void 0;let J=K.call(Z,...Q);if(typeof J==="function")this.transformers.use(J)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(Z){this.freeze();let K=a6(Z),Q=this.parser||this.Parser;return i7("parse",Q),Q(String(K),K)}process(Z,K){let Q=this;return this.freeze(),i7("process",this.parser||this.Parser),r7("process",this.compiler||this.Compiler),K?J(void 0,K):new Promise(J);function J(X,H){let W=a6(Z),G=Q.parse(W);Q.run(G,W,function($,D,N){if($||!D||!N)return q($);let _=D,Y=Q.stringify(_,N);if(N9(Y))N.value=Y;else N.result=Y;q($,N)});function q($,D){if($||!D)H($);else if(X)X(D);else Z5(K,"`done` is defined if `resolve` is not"),K(void 0,D)}}}processSync(Z){let K=!1,Q;return this.freeze(),i7("processSync",this.parser||this.Parser),r7("processSync",this.compiler||this.Compiler),this.process(Z,J),t4("processSync","process",K),Z5(Q,"we either bailed on an error or have a tree"),Q;function J(X,H){K=!0,v7(X),Q=H}}run(Z,K,Q){o4(Z),this.freeze();let J=this.transformers;if(!Q&&typeof K==="function")Q=K,K=void 0;return Q?X(void 0,Q):new Promise(X);function X(H,W){Z5(typeof K!=="function","`file` can’t be a `done` anymore, we checked");let G=a6(K);J.run(Z,G,q);function q($,D,N){let _=D||Z;if($)W($);else if(H)H(_);else Z5(Q,"`done` is defined if `resolve` is not"),Q(void 0,_,N)}}}runSync(Z,K){let Q=!1,J;return this.run(Z,K,X),t4("runSync","run",Q),Z5(J,"we either bailed on an error or have a tree"),J;function X(H,W){v7(H),J=W,Q=!0}}stringify(Z,K){this.freeze();let Q=a6(K),J=this.compiler||this.Compiler;return r7("stringify",J),o4(Z),J(Z,Q)}use(Z,...K){let Q=this.attachers,J=this.namespace;if(a7("use",this.frozen),Z===null||Z===void 0);else if(typeof Z==="function")G(Z,K);else if(typeof Z==="object")if(Array.isArray(Z))W(Z);else H(Z);else throw TypeError("Expected usable value, not `"+Z+"`");return this;function X(q){if(typeof q==="function")G(q,[]);else if(typeof q==="object")if(Array.isArray(q)){let[$,...D]=q;G($,D)}else H(q);else throw TypeError("Expected usable value, not `"+q+"`")}function H(q){if(!("plugins"in q)&&!("settings"in q))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");if(W(q.plugins),q.settings)J.settings=d6.default(!0,J.settings,q.settings)}function W(q){let $=-1;if(q===null||q===void 0);else if(Array.isArray(q))while(++$<q.length){let D=q[$];X(D)}else throw TypeError("Expected a list of plugins, not `"+q+"`")}function G(q,$){let D=-1,N=-1;while(++D<Q.length)if(Q[D][0]===q){N=D;break}if(N===-1)Q.push([q,...$]);else if($.length>0){let[_,...Y]=$,F=Q[N][1];if(_6(F)&&_6(_))_=d6.default(!0,F,_);Q[N]=[q,_,...Y]}}}}var c7=new d7().freeze();function i7(Z,K){if(typeof K!=="function")throw TypeError("Cannot `"+Z+"` without `parser`")}function r7(Z,K){if(typeof K!=="function")throw TypeError("Cannot `"+Z+"` without `compiler`")}function a7(Z,K){if(K)throw Error("Cannot call `"+Z+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function o4(Z){if(!_6(Z)||typeof Z.type!=="string")throw TypeError("Expected node, got `"+Z+"`")}function t4(Z,K,Q){if(!Q)throw Error("`"+Z+"` finished async. Use `"+K+"` instead")}function a6(Z){return V9(Z)?Z:new r5(Z)}function V9(Z){return Boolean(Z&&typeof Z==="object"&&"message"in Z&&"messages"in Z)}function N9(Z){return typeof Z==="string"||M9(Z)}function M9(Z){return Boolean(Z&&typeof Z==="object"&&"byteLength"in Z&&"byteOffset"in Z)}var B9="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",e4=[],Z0={allowDangerousHtml:!0},F9=/^(https?|ircs?|mailto|xmpp)$/i,R9=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function j9(Z){let K=A9(Z),Q=z9(Z);return T9(K.runSync(K.parse(Q),Q),Z)}function A9(Z){let K=Z.rehypePlugins||e4,Q=Z.remarkPlugins||e4,J=Z.remarkRehypeOptions?{...Z.remarkRehypeOptions,...Z0}:Z0;return c7().use(g6).use(Q).use(i6,J).use(K)}function z9(Z){let K=Z.children||"",Q=new r5;if(typeof K==="string")Q.value=K;else M6("Unexpected value `"+K+"` for `children` prop, expected `string`");return Q}function T9(Z,K){let{allowedElements:Q,allowElement:J,components:X,disallowedElements:H,skipHtml:W,unwrapDisallowed:G}=K,q=K.urlTransform||H0;for(let D of R9)if(Object.hasOwn(K,D.from))M6("Unexpected `"+D.from+"` prop, "+(D.to?"use `"+D.to+"` instead":"remove it")+" (see <"+B9+"#"+D.id+"> for more info)");if(Q&&H)M6("Unexpected combined `allowedElements` and `disallowedElements`, expected one or the other");return U6(Z,$),$7(Z,{Fragment:K0,components:X,ignoreInvalidStyle:!0,jsx:Q0,jsxs:J0,passKeys:!0,passNode:!0});function $(D,N,_){if(D.type==="raw"&&_&&typeof N==="number"){if(W)_.children.splice(N,1);else _.children[N]={type:"text",value:D.value};return N}if(D.type==="element"){let Y;for(Y in Z6)if(Object.hasOwn(Z6,Y)&&Object.hasOwn(D.properties,Y)){let F=D.properties[Y],R=Z6[Y];if(R===null||R.includes(D.tagName))D.properties[Y]=q(String(F||""),Y,D)}}if(D.type==="element"){let Y=Q?!Q.includes(D.tagName):H?H.includes(D.tagName):!1;if(!Y&&J&&typeof N==="number")Y=!J(D,N,_);if(Y&&_&&typeof N==="number"){if(G&&D.children)_.children.splice(N,1,...D.children);else _.children.splice(N,1);return N}}}}function H0(Z){let K=Z.indexOf(":"),Q=Z.indexOf("?"),J=Z.indexOf("#"),X=Z.indexOf("/");if(K===-1||X!==-1&&K>X||Q!==-1&&K>Q||J!==-1&&K>J||F9.test(Z.slice(0,K)))return Z;return""}export{j9 as ra};
14
+ `},X);return H}function i6(Z,K){if(Z&&"run"in Z)return async function(Q,J){let X=f6(Q,{file:J,...K});await Z.run(X,J)};return function(Q,J){return f6(Q,{file:J,...Z||K})}}function v7(Z){if(Z)throw Z}var d6=q7(r4(),1);function _6(Z){if(typeof Z!=="object"||Z===null)return!1;let K=Object.getPrototypeOf(Z);return(K===null||K===Object.prototype||Object.getPrototypeOf(K)===null)&&!(Symbol.toStringTag in Z)&&!(Symbol.iterator in Z)}function p7(){let Z=[],K={run:Q,use:J};return K;function Q(...X){let H=-1,W=X.pop();if(typeof W!=="function")throw TypeError("Expected function as last argument, not "+W);G(null,...X);function G(q,...$){let D=Z[++H],N=-1;if(q){W(q);return}while(++N<X.length)if($[N]===null||$[N]===void 0)$[N]=X[N];if(X=$,D)a4(D,G)(...$);else W(null,...$)}}function J(X){if(typeof X!=="function")throw TypeError("Expected `middelware` to be a function, not "+X);return Z.push(X),K}}function a4(Z,K){let Q;return J;function J(...W){let G=Z.length>W.length,q;if(G)W.push(X);try{q=Z.apply(this,W)}catch($){let D=$;if(G&&Q)throw D;return X(D)}if(!G)if(q&&q.then&&typeof q.then==="function")q.then(H,X);else if(q instanceof Error)X(q);else H(q)}function X(W,...G){if(!Q)Q=!0,K(W,...G)}function H(W){X(null,W)}}var $5={basename:X9,dirname:H9,extname:W9,join:G9,sep:"/"};function X9(Z,K){if(K!==void 0&&typeof K!=="string")throw TypeError('"ext" argument must be a string');V6(Z);let Q=0,J=-1,X=Z.length,H;if(K===void 0||K.length===0||K.length>Z.length){while(X--)if(Z.codePointAt(X)===47){if(H){Q=X+1;break}}else if(J<0)H=!0,J=X+1;return J<0?"":Z.slice(Q,J)}if(K===Z)return"";let W=-1,G=K.length-1;while(X--)if(Z.codePointAt(X)===47){if(H){Q=X+1;break}}else{if(W<0)H=!0,W=X+1;if(G>-1)if(Z.codePointAt(X)===K.codePointAt(G--)){if(G<0)J=X}else G=-1,J=W}if(Q===J)J=W;else if(J<0)J=Z.length;return Z.slice(Q,J)}function H9(Z){if(V6(Z),Z.length===0)return".";let K=-1,Q=Z.length,J;while(--Q)if(Z.codePointAt(Q)===47){if(J){K=Q;break}}else if(!J)J=!0;return K<0?Z.codePointAt(0)===47?"/":".":K===1&&Z.codePointAt(0)===47?"//":Z.slice(0,K)}function W9(Z){V6(Z);let K=Z.length,Q=-1,J=0,X=-1,H=0,W;while(K--){let G=Z.codePointAt(K);if(G===47){if(W){J=K+1;break}continue}if(Q<0)W=!0,Q=K+1;if(G===46){if(X<0)X=K;else if(H!==1)H=1}else if(X>-1)H=-1}if(X<0||Q<0||H===0||H===1&&X===Q-1&&X===J+1)return"";return Z.slice(X,Q)}function G9(...Z){let K=-1,Q;while(++K<Z.length)if(V6(Z[K]),Z[K])Q=Q===void 0?Z[K]:Q+"/"+Z[K];return Q===void 0?".":D9(Q)}function D9(Z){V6(Z);let K=Z.codePointAt(0)===47,Q=q9(Z,!K);if(Q.length===0&&!K)Q=".";if(Q.length>0&&Z.codePointAt(Z.length-1)===47)Q+="/";return K?"/"+Q:Q}function q9(Z,K){let Q="",J=0,X=-1,H=0,W=-1,G,q;while(++W<=Z.length){if(W<Z.length)G=Z.codePointAt(W);else if(G===47)break;else G=47;if(G===47){if(X===W-1||H===1);else if(X!==W-1&&H===2){if(Q.length<2||J!==2||Q.codePointAt(Q.length-1)!==46||Q.codePointAt(Q.length-2)!==46){if(Q.length>2){if(q=Q.lastIndexOf("/"),q!==Q.length-1){if(q<0)Q="",J=0;else Q=Q.slice(0,q),J=Q.length-1-Q.lastIndexOf("/");X=W,H=0;continue}}else if(Q.length>0){Q="",J=0,X=W,H=0;continue}}if(K)Q=Q.length>0?Q+"/..":"..",J=2}else{if(Q.length>0)Q+="/"+Z.slice(X+1,W);else Q=Z.slice(X+1,W);J=W-X-1}X=W,H=0}else if(G===46&&H>-1)H++;else H=-1}return Q}function V6(Z){if(typeof Z!=="string")throw TypeError("Path must be a string. Received "+JSON.stringify(Z))}var d4={cwd:Y9};function Y9(){return"/"}function i5(Z){return Boolean(Z!==null&&typeof Z==="object"&&"href"in Z&&Z.href&&"protocol"in Z&&Z.protocol&&Z.auth===void 0)}function c4(Z){if(typeof Z==="string")Z=new URL(Z);else if(!i5(Z)){let K=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+Z+"`");throw K.code="ERR_INVALID_ARG_TYPE",K}if(Z.protocol!=="file:"){let K=TypeError("The URL must be of scheme file");throw K.code="ERR_INVALID_URL_SCHEME",K}return $9(Z)}function $9(Z){if(Z.hostname!==""){let J=TypeError('File URL host must be "localhost" or empty on darwin');throw J.code="ERR_INVALID_FILE_URL_HOST",J}let K=Z.pathname,Q=-1;while(++Q<K.length)if(K.codePointAt(Q)===37&&K.codePointAt(Q+1)===50){let J=K.codePointAt(Q+2);if(J===70||J===102){let X=TypeError("File URL path must not include encoded / characters");throw X.code="ERR_INVALID_FILE_URL_PATH",X}}return decodeURIComponent(K)}var u7=["history","path","basename","stem","extname","dirname"];class r5{constructor(Z){let K;if(!Z)K={};else if(i5(Z))K={path:Z};else if(typeof Z==="string"||U9(Z))K={value:Z};else K=Z;this.cwd="cwd"in K?"":d4.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let Q=-1;while(++Q<u7.length){let X=u7[Q];if(X in K&&K[X]!==void 0&&K[X]!==null)this[X]=X==="history"?[...K[X]]:K[X]}let J;for(J in K)if(!u7.includes(J))this[J]=K[J]}get basename(){return typeof this.path==="string"?$5.basename(this.path):void 0}set basename(Z){f7(Z,"basename"),l7(Z,"basename"),this.path=$5.join(this.dirname||"",Z)}get dirname(){return typeof this.path==="string"?$5.dirname(this.path):void 0}set dirname(Z){s4(this.basename,"dirname"),this.path=$5.join(Z||"",this.basename)}get extname(){return typeof this.path==="string"?$5.extname(this.path):void 0}set extname(Z){if(l7(Z,"extname"),s4(this.dirname,"extname"),Z){if(Z.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if(Z.includes(".",1))throw Error("`extname` cannot contain multiple dots")}this.path=$5.join(this.dirname,this.stem+(Z||""))}get path(){return this.history[this.history.length-1]}set path(Z){if(i5(Z))Z=c4(Z);if(f7(Z,"path"),this.path!==Z)this.history.push(Z)}get stem(){return typeof this.path==="string"?$5.basename(this.path,this.extname):void 0}set stem(Z){f7(Z,"stem"),l7(Z,"stem"),this.path=$5.join(this.dirname||"",Z+(this.extname||""))}fail(Z,K,Q){let J=this.message(Z,K,Q);throw J.fatal=!0,J}info(Z,K,Q){let J=this.message(Z,K,Q);return J.fatal=void 0,J}message(Z,K,Q){let J=new d(Z,K,Q);if(this.path)J.name=this.path+":"+J.name,J.file=this.path;return J.fatal=!1,this.messages.push(J),J}toString(Z){if(this.value===void 0)return"";if(typeof this.value==="string")return this.value;return new TextDecoder(Z||void 0).decode(this.value)}}function l7(Z,K){if(Z&&Z.includes($5.sep))throw Error("`"+K+"` cannot be a path: did not expect `"+$5.sep+"`")}function f7(Z,K){if(!Z)throw Error("`"+K+"` cannot be empty")}function s4(Z,K){if(!Z)throw Error("Setting `"+K+"` requires `path` to be set too")}function U9(Z){return Boolean(Z&&typeof Z==="object"&&"byteLength"in Z&&"byteOffset"in Z)}var n4=function(Z){let J=this.constructor.prototype,X=J[Z],H=function(){return X.apply(H,arguments)};return Object.setPrototypeOf(H,J),H};var _9={}.hasOwnProperty;class d7 extends n4{constructor(){super("copy");this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=p7()}copy(){let Z=new d7,K=-1;while(++K<this.attachers.length){let Q=this.attachers[K];Z.use(...Q)}return Z.data(d6.default(!0,{},this.namespace)),Z}data(Z,K){if(typeof Z==="string"){if(arguments.length===2)return a7("data",this.frozen),this.namespace[Z]=K,this;return _9.call(this.namespace,Z)&&this.namespace[Z]||void 0}if(Z)return a7("data",this.frozen),this.namespace=Z,this;return this.namespace}freeze(){if(this.frozen)return this;let Z=this;while(++this.freezeIndex<this.attachers.length){let[K,...Q]=this.attachers[this.freezeIndex];if(Q[0]===!1)continue;if(Q[0]===!0)Q[0]=void 0;let J=K.call(Z,...Q);if(typeof J==="function")this.transformers.use(J)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(Z){this.freeze();let K=a6(Z),Q=this.parser||this.Parser;return i7("parse",Q),Q(String(K),K)}process(Z,K){let Q=this;return this.freeze(),i7("process",this.parser||this.Parser),r7("process",this.compiler||this.Compiler),K?J(void 0,K):new Promise(J);function J(X,H){let W=a6(Z),G=Q.parse(W);Q.run(G,W,function($,D,N){if($||!D||!N)return q($);let _=D,Y=Q.stringify(_,N);if(N9(Y))N.value=Y;else N.result=Y;q($,N)});function q($,D){if($||!D)H($);else if(X)X(D);else Z5(K,"`done` is defined if `resolve` is not"),K(void 0,D)}}}processSync(Z){let K=!1,Q;return this.freeze(),i7("processSync",this.parser||this.Parser),r7("processSync",this.compiler||this.Compiler),this.process(Z,J),t4("processSync","process",K),Z5(Q,"we either bailed on an error or have a tree"),Q;function J(X,H){K=!0,v7(X),Q=H}}run(Z,K,Q){o4(Z),this.freeze();let J=this.transformers;if(!Q&&typeof K==="function")Q=K,K=void 0;return Q?X(void 0,Q):new Promise(X);function X(H,W){Z5(typeof K!=="function","`file` can’t be a `done` anymore, we checked");let G=a6(K);J.run(Z,G,q);function q($,D,N){let _=D||Z;if($)W($);else if(H)H(_);else Z5(Q,"`done` is defined if `resolve` is not"),Q(void 0,_,N)}}}runSync(Z,K){let Q=!1,J;return this.run(Z,K,X),t4("runSync","run",Q),Z5(J,"we either bailed on an error or have a tree"),J;function X(H,W){v7(H),J=W,Q=!0}}stringify(Z,K){this.freeze();let Q=a6(K),J=this.compiler||this.Compiler;return r7("stringify",J),o4(Z),J(Z,Q)}use(Z,...K){let Q=this.attachers,J=this.namespace;if(a7("use",this.frozen),Z===null||Z===void 0);else if(typeof Z==="function")G(Z,K);else if(typeof Z==="object")if(Array.isArray(Z))W(Z);else H(Z);else throw TypeError("Expected usable value, not `"+Z+"`");return this;function X(q){if(typeof q==="function")G(q,[]);else if(typeof q==="object")if(Array.isArray(q)){let[$,...D]=q;G($,D)}else H(q);else throw TypeError("Expected usable value, not `"+q+"`")}function H(q){if(!("plugins"in q)&&!("settings"in q))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");if(W(q.plugins),q.settings)J.settings=d6.default(!0,J.settings,q.settings)}function W(q){let $=-1;if(q===null||q===void 0);else if(Array.isArray(q))while(++$<q.length){let D=q[$];X(D)}else throw TypeError("Expected a list of plugins, not `"+q+"`")}function G(q,$){let D=-1,N=-1;while(++D<Q.length)if(Q[D][0]===q){N=D;break}if(N===-1)Q.push([q,...$]);else if($.length>0){let[_,...Y]=$,F=Q[N][1];if(_6(F)&&_6(_))_=d6.default(!0,F,_);Q[N]=[q,_,...Y]}}}}var c7=new d7().freeze();function i7(Z,K){if(typeof K!=="function")throw TypeError("Cannot `"+Z+"` without `parser`")}function r7(Z,K){if(typeof K!=="function")throw TypeError("Cannot `"+Z+"` without `compiler`")}function a7(Z,K){if(K)throw Error("Cannot call `"+Z+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function o4(Z){if(!_6(Z)||typeof Z.type!=="string")throw TypeError("Expected node, got `"+Z+"`")}function t4(Z,K,Q){if(!Q)throw Error("`"+Z+"` finished async. Use `"+K+"` instead")}function a6(Z){return V9(Z)?Z:new r5(Z)}function V9(Z){return Boolean(Z&&typeof Z==="object"&&"message"in Z&&"messages"in Z)}function N9(Z){return typeof Z==="string"||M9(Z)}function M9(Z){return Boolean(Z&&typeof Z==="object"&&"byteLength"in Z&&"byteOffset"in Z)}var B9="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",e4=[],Z0={allowDangerousHtml:!0},F9=/^(https?|ircs?|mailto|xmpp)$/i,R9=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function j9(Z){let K=A9(Z),Q=z9(Z);return T9(K.runSync(K.parse(Q),Q),Z)}function A9(Z){let K=Z.rehypePlugins||e4,Q=Z.remarkPlugins||e4,J=Z.remarkRehypeOptions?{...Z.remarkRehypeOptions,...Z0}:Z0;return c7().use(g6).use(Q).use(i6,J).use(K)}function z9(Z){let K=Z.children||"",Q=new r5;if(typeof K==="string")Q.value=K;else M6("Unexpected value `"+K+"` for `children` prop, expected `string`");return Q}function T9(Z,K){let{allowedElements:Q,allowElement:J,components:X,disallowedElements:H,skipHtml:W,unwrapDisallowed:G}=K,q=K.urlTransform||H0;for(let D of R9)if(Object.hasOwn(K,D.from))M6("Unexpected `"+D.from+"` prop, "+(D.to?"use `"+D.to+"` instead":"remove it")+" (see <"+B9+"#"+D.id+"> for more info)");if(Q&&H)M6("Unexpected combined `allowedElements` and `disallowedElements`, expected one or the other");return U6(Z,$),$7(Z,{Fragment:K0,components:X,ignoreInvalidStyle:!0,jsx:Q0,jsxs:J0,passKeys:!0,passNode:!0});function $(D,N,_){if(D.type==="raw"&&_&&typeof N==="number"){if(W)_.children.splice(N,1);else _.children[N]={type:"text",value:D.value};return N}if(D.type==="element"){let Y;for(Y in Z6)if(Object.hasOwn(Z6,Y)&&Object.hasOwn(D.properties,Y)){let F=D.properties[Y],R=Z6[Y];if(R===null||R.includes(D.tagName))D.properties[Y]=q(String(F||""),Y,D)}}if(D.type==="element"){let Y=Q?!Q.includes(D.tagName):H?H.includes(D.tagName):!1;if(!Y&&J&&typeof N==="number")Y=!J(D,N,_);if(Y&&_&&typeof N==="number"){if(G&&D.children)_.children.splice(N,1,...D.children);else _.children.splice(N,1);return N}}}}function H0(Z){let K=Z.indexOf(":"),Q=Z.indexOf("?"),J=Z.indexOf("#"),X=Z.indexOf("/");if(K===-1||X!==-1&&K>X||Q!==-1&&K>Q||J!==-1&&K>J||F9.test(Z.slice(0,K)))return Z;return""}export{j9 as eg};