graview 0.1.36 → 0.1.37

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 (169) hide show
  1. package/dist/preview/{chunk.T47DLH5Z.js → chunk.24E4R4ZH.js} +1 -1
  2. package/dist/preview/{chunk.DSP62QYK.js → chunk.2JF254FO.js} +1 -1
  3. package/dist/preview/chunk.2TDB4D6Y.js +1 -0
  4. package/dist/preview/{chunk.YNE5QR7Q.js → chunk.3IVVXVG7.js} +1 -1
  5. package/dist/preview/{chunk.WJ2TWU2I.js → chunk.3KJQXYCA.js} +1 -1
  6. package/dist/preview/chunk.3V2M3S4U.js +1 -0
  7. package/dist/preview/{chunk.WHTQHU3M.js → chunk.4NCXMVPY.js} +1 -1
  8. package/dist/preview/chunk.57XTDW57.js +1 -0
  9. package/dist/preview/chunk.5CLFTXP3.js +1 -0
  10. package/dist/preview/chunk.5EXYDBAL.js +88 -0
  11. package/dist/preview/chunk.5JPRRV47.js +1 -0
  12. package/dist/preview/{chunk.ZVMIHXVK.js → chunk.67PVRVAC.js} +1 -1
  13. package/dist/preview/{chunk.FERBNBDE.js → chunk.6DYZBDWT.js} +1 -1
  14. package/dist/preview/chunk.6SK2K72G.js +1 -0
  15. package/dist/preview/{chunk.TGEF6TMM.js → chunk.74DXEKUV.js} +1 -1
  16. package/dist/preview/chunk.76QUEWYD.js +1 -0
  17. package/dist/preview/{chunk.QDHUDLJB.js → chunk.7MMNMZLF.js} +1 -1
  18. package/dist/preview/chunk.7OLVQ2FZ.js +1 -0
  19. package/dist/preview/{chunk.MXJS67W4.js → chunk.7UQOXYJX.js} +1 -1
  20. package/dist/preview/{chunk.ER5ILWKY.js → chunk.AHC4EXLW.js} +2 -2
  21. package/dist/preview/{chunk.ZWZ5SEXT.js → chunk.AWRS6TUN.js} +1 -1
  22. package/dist/preview/{chunk.H4T56OXM.js → chunk.AZ333RB3.js} +1 -1
  23. package/dist/preview/{chunk.HZPTBPJY.js → chunk.BA3REPV5.js} +1 -1
  24. package/dist/preview/{chunk.5PU3RWYY.js → chunk.BRBY5WJT.js} +2 -2
  25. package/dist/preview/{chunk.6KMXLUOS.js → chunk.BXWO6ILK.js} +1 -1
  26. package/dist/preview/chunk.CGQLE7JW.js +1 -0
  27. package/dist/preview/chunk.CV4CBHFT.js +1 -0
  28. package/dist/preview/chunk.CYPTJNES.js +1 -0
  29. package/dist/preview/{chunk.ACXA55GW.js → chunk.D2ILIAND.js} +1 -1
  30. package/dist/preview/chunk.DLCFCMKX.js +1 -0
  31. package/dist/preview/chunk.DMUUYZ37.js +1 -0
  32. package/dist/preview/chunk.DNNL7F3P.js +25 -0
  33. package/dist/preview/chunk.EHT4HBH5.js +35 -0
  34. package/dist/preview/chunk.EKUAI5YL.js +1 -0
  35. package/dist/preview/chunk.ELY2RMGE.js +19 -0
  36. package/dist/preview/{chunk.6ZZZBDEG.js → chunk.ENEOGGFM.js} +1 -1
  37. package/dist/preview/chunk.ENJKCSNX.js +1 -0
  38. package/dist/preview/chunk.FEPYKPZE.js +1 -0
  39. package/dist/preview/{chunk.ET76FISZ.js → chunk.FFW6XWHB.js} +1 -1
  40. package/dist/preview/{chunk.ZEW2OOZ5.js → chunk.FGYCYLUS.js} +1 -1
  41. package/dist/preview/{chunk.ITXIFDQ7.js → chunk.G7S7GLDK.js} +1 -1
  42. package/dist/preview/chunk.GMZAQGH7.js +1 -0
  43. package/dist/preview/chunk.GXPBRYSR.js +1 -0
  44. package/dist/preview/{chunk.42WJ6VJZ.js → chunk.H4LFJPDV.js} +1 -1
  45. package/dist/preview/chunk.HBBVVALN.js +5 -0
  46. package/dist/preview/{chunk.NWYOLGQ3.js → chunk.HCK4Y6C5.js} +1 -1
  47. package/dist/preview/chunk.HSRGYZOR.js +1 -0
  48. package/dist/preview/chunk.HYAKRLPT.js +4 -0
  49. package/dist/preview/chunk.IHBIRAC4.js +2 -0
  50. package/dist/preview/chunk.IWK5QL6P.js +1 -0
  51. package/dist/preview/{chunk.WQBDTLPZ.js → chunk.J2CR4RRH.js} +1 -1
  52. package/dist/preview/chunk.J2HQEUYA.js +1 -0
  53. package/dist/preview/{chunk.R45BF6JV.js → chunk.JBRXGPPM.js} +1 -1
  54. package/dist/preview/chunk.JDRM6XXD.js +2 -0
  55. package/dist/preview/chunk.JFLUVZNW.js +1 -0
  56. package/dist/preview/chunk.KAWP4RNR.js +1 -0
  57. package/dist/preview/{chunk.OF34OZ4V.js → chunk.KSXB4LDF.js} +1 -1
  58. package/dist/preview/{chunk.FUR4IHWG.js → chunk.LJE5J3JK.js} +1 -1
  59. package/dist/preview/chunk.LPJY6V5D.js +1 -0
  60. package/dist/preview/chunk.LVLAS5GL.js +1 -0
  61. package/dist/preview/{chunk.7CO7S6QM.js → chunk.LVNAB2BW.js} +1 -1
  62. package/dist/preview/{chunk.XRCGADKC.js → chunk.LYJXX6BU.js} +1 -1
  63. package/dist/preview/{chunk.CUCNT7MG.js → chunk.MJLUAGEV.js} +1 -1
  64. package/dist/preview/chunk.MKPJKZAP.js +1 -0
  65. package/dist/preview/chunk.MMBMVHIG.js +1 -0
  66. package/dist/preview/chunk.NNNVB6RV.js +1 -0
  67. package/dist/preview/chunk.NOZEHLWG.js +2 -0
  68. package/dist/preview/{chunk.SG23JC6D.js → chunk.NV6IZJKA.js} +1 -1
  69. package/dist/preview/{chunk.RKHEZ6KZ.js → chunk.NWHFFOXW.js} +1 -1
  70. package/dist/preview/chunk.NZJZIYDK.js +1 -0
  71. package/dist/preview/chunk.O6KNGFWH.js +1 -0
  72. package/dist/preview/chunk.PMK73A53.js +1 -0
  73. package/dist/preview/chunk.PQPZZ7ZW.js +117 -0
  74. package/dist/preview/{chunk.Y3IJDWNS.js → chunk.QJYALCIW.js} +1 -1
  75. package/dist/preview/chunk.QMZUKAPJ.js +1 -0
  76. package/dist/preview/{chunk.GUDKPK42.js → chunk.QNGFBJWP.js} +1 -1
  77. package/dist/preview/{chunk.LMVCWYYG.js → chunk.QOXTBRKE.js} +1 -1
  78. package/dist/preview/{chunk.BZ5VLPKB.js → chunk.QXARGANF.js} +6 -6
  79. package/dist/preview/{chunk.P75TPZWT.js → chunk.QYWBQ5NX.js} +1 -1
  80. package/dist/preview/{chunk.EDSPYKR4.js → chunk.RPOYSIVQ.js} +1 -1
  81. package/dist/preview/{chunk.HPX3F7XX.js → chunk.SNKOPWAD.js} +1 -1
  82. package/dist/preview/{chunk.EBLKEQ7O.js → chunk.SZMWJHU2.js} +1 -1
  83. package/dist/preview/{chunk.KU6NIMQX.js → chunk.TN4GY6LW.js} +1 -1
  84. package/dist/preview/{chunk.O3OALXCI.js → chunk.TRLVFHFT.js} +2 -2
  85. package/dist/preview/chunk.TSI4O3GH.js +1 -0
  86. package/dist/preview/chunk.TX5QIZEP.js +1 -0
  87. package/dist/preview/{chunk.UJR3Y7MP.js → chunk.TXS4I326.js} +1 -1
  88. package/dist/preview/chunk.U4URQDC5.js +1 -0
  89. package/dist/preview/chunk.UCVZG7S4.js +1 -0
  90. package/dist/preview/{chunk.LA7535VO.js → chunk.UPBUF7KR.js} +1 -1
  91. package/dist/preview/{chunk.DANDYIB5.js → chunk.UR5TT4JH.js} +1 -1
  92. package/dist/preview/{chunk.OREMUXB5.js → chunk.UV2TSAB4.js} +1 -1
  93. package/dist/preview/{chunk.IMRCAU4T.js → chunk.UVLPVHID.js} +1 -1
  94. package/dist/preview/chunk.VUKHDZNI.js +1 -0
  95. package/dist/preview/{chunk.S6GJGTJE.js → chunk.VW6WGFL6.js} +1 -1
  96. package/dist/preview/chunk.VX7MGVP5.js +1 -0
  97. package/dist/preview/{chunk.WGI5G6NM.js → chunk.WLV2QYTS.js} +1 -1
  98. package/dist/preview/{chunk.GOCUBIRW.js → chunk.WNKRXL3O.js} +1 -1
  99. package/dist/preview/chunk.WNMLA4YW.js +1 -0
  100. package/dist/preview/{chunk.T2CN7UTZ.js → chunk.WVEKYJSI.js} +2 -2
  101. package/dist/preview/{chunk.2B4WVCVV.js → chunk.X2OLXTRL.js} +1 -1
  102. package/dist/preview/{chunk.J3TEJBI5.js → chunk.XS3SAH6U.js} +1 -1
  103. package/dist/preview/chunk.XWJ2MRQF.js +1 -0
  104. package/dist/preview/{chunk.D6RDTUX3.js → chunk.Y44TR4WG.js} +1 -1
  105. package/dist/preview/{chunk.OXZRGP53.js → chunk.YAXOIJVH.js} +1 -1
  106. package/dist/preview/chunk.YFW5BF6J.js +1 -0
  107. package/dist/preview/chunk.YNJOLOFG.js +1 -0
  108. package/dist/preview/{chunk.6QDFBCV4.js → chunk.YW2BZ2LH.js} +2 -2
  109. package/dist/preview/chunk.YX354FRV.js +1 -0
  110. package/dist/preview/{chunk.QTITRX5Q.js → chunk.ZB7GV3IT.js} +1 -1
  111. package/dist/preview/{chunk.KBJG5SI2.js → chunk.ZOT4V66Q.js} +1 -1
  112. package/dist/preview/chunk.ZYPCE2LZ.js +1 -0
  113. package/dist/preview/index.html +42 -42
  114. package/dist/preview/page.js +5 -5
  115. package/package.json +6 -6
  116. package/dist/preview/chunk.272ZJXQP.js +0 -1
  117. package/dist/preview/chunk.27TLAVRR.js +0 -19
  118. package/dist/preview/chunk.2A2DLMT3.js +0 -1
  119. package/dist/preview/chunk.3PT55HXT.js +0 -1
  120. package/dist/preview/chunk.3SM2CHKF.js +0 -1
  121. package/dist/preview/chunk.3ZIOAPI5.js +0 -1
  122. package/dist/preview/chunk.4B73P2WA.js +0 -2
  123. package/dist/preview/chunk.4GXXD4NG.js +0 -1
  124. package/dist/preview/chunk.4Q56V7GS.js +0 -1
  125. package/dist/preview/chunk.4STIUIT6.js +0 -1
  126. package/dist/preview/chunk.53IKY7UP.js +0 -1
  127. package/dist/preview/chunk.56BPXB6E.js +0 -1
  128. package/dist/preview/chunk.64MJ5FRL.js +0 -1
  129. package/dist/preview/chunk.6II4BONS.js +0 -25
  130. package/dist/preview/chunk.6W7J76TK.js +0 -1
  131. package/dist/preview/chunk.7G3B5QPH.js +0 -1
  132. package/dist/preview/chunk.7TBSVQSH.js +0 -1
  133. package/dist/preview/chunk.7YQYWOZR.js +0 -1
  134. package/dist/preview/chunk.AAZFVCSP.js +0 -2
  135. package/dist/preview/chunk.ACEYGWMO.js +0 -1
  136. package/dist/preview/chunk.CE3NOADH.js +0 -1
  137. package/dist/preview/chunk.CNJENUPC.js +0 -1
  138. package/dist/preview/chunk.CRPT3ZT3.js +0 -1
  139. package/dist/preview/chunk.E77K6KBX.js +0 -1
  140. package/dist/preview/chunk.EQIGKXIG.js +0 -1
  141. package/dist/preview/chunk.F5BCCGFK.js +0 -5
  142. package/dist/preview/chunk.FQKH67BP.js +0 -1
  143. package/dist/preview/chunk.FWBQVPMI.js +0 -1
  144. package/dist/preview/chunk.GXLAZGYT.js +0 -1
  145. package/dist/preview/chunk.GZLYTPE7.js +0 -1
  146. package/dist/preview/chunk.IB32NOV5.js +0 -2
  147. package/dist/preview/chunk.JLXQ6ZLI.js +0 -1
  148. package/dist/preview/chunk.JZMA2AV7.js +0 -1
  149. package/dist/preview/chunk.K5NJTE3F.js +0 -35
  150. package/dist/preview/chunk.LNNFNJKN.js +0 -1
  151. package/dist/preview/chunk.M4FQ7SSM.js +0 -1
  152. package/dist/preview/chunk.NJ62C2GU.js +0 -1
  153. package/dist/preview/chunk.NNCTJSD3.js +0 -1
  154. package/dist/preview/chunk.O6ROFVFD.js +0 -88
  155. package/dist/preview/chunk.OFJH7LDC.js +0 -1
  156. package/dist/preview/chunk.OH5BBE2B.js +0 -1
  157. package/dist/preview/chunk.OZR5NI4J.js +0 -1
  158. package/dist/preview/chunk.PWOVXARZ.js +0 -1
  159. package/dist/preview/chunk.Q63RPNUS.js +0 -1
  160. package/dist/preview/chunk.QEALNWWL.js +0 -117
  161. package/dist/preview/chunk.QLMUGC7R.js +0 -1
  162. package/dist/preview/chunk.R7LRJS6B.js +0 -4
  163. package/dist/preview/chunk.SSRP5SBR.js +0 -1
  164. package/dist/preview/chunk.VHWUGSFW.js +0 -1
  165. package/dist/preview/chunk.W42P7NOL.js +0 -1
  166. package/dist/preview/chunk.XBTZXWJX.js +0 -1
  167. package/dist/preview/chunk.ZDNJK2SX.js +0 -1
  168. package/dist/preview/chunk.ZNS3LYJU.js +0 -1
  169. package/dist/preview/chunk.ZSSOTIFL.js +0 -1
@@ -1 +1 @@
1
- import{e as L}from"./chunk.YNE5QR7Q.js";import{a as R,b as O,c as v,d as P}from"./chunk.UGFDSE37.js";import"./chunk.GOCUBIRW.js";import"./chunk.6QDFBCV4.js";import"./chunk.4STIUIT6.js";import"./chunk.WHTQHU3M.js";import"./chunk.KU6NIMQX.js";import"./chunk.Y3IJDWNS.js";import"./chunk.OFJH7LDC.js";import"./chunk.5PU3RWYY.js";import"./chunk.27TLAVRR.js";import"./chunk.OREMUXB5.js";import"./chunk.ZDNJK2SX.js";import"./chunk.ZSSOTIFL.js";import"./chunk.QDHUDLJB.js";import"./chunk.ZVMIHXVK.js";import"./chunk.CUCNT7MG.js";import"./chunk.2A2DLMT3.js";import"./chunk.E77K6KBX.js";import{a as E,b as T}from"./chunk.MB7LKKUD.js";import"./chunk.WVUJXDXZ.js";import"./chunk.VHWUGSFW.js";import"./chunk.P75TPZWT.js";import"./chunk.6W7J76TK.js";import"./chunk.FUR4IHWG.js";import"./chunk.2B4WVCVV.js";import"./chunk.AAZFVCSP.js";import"./chunk.GZHZLJBF.js";import"./chunk.PWOVXARZ.js";import"./chunk.SG23JC6D.js";import"./chunk.OJGHDWI6.js";import"./chunk.GZLYTPE7.js";import"./chunk.4B73P2WA.js";import"./chunk.IMRCAU4T.js";import"./chunk.BZ5VLPKB.js";import{F as D,Q as C,ta as x}from"./chunk.6II4BONS.js";import{gc as k}from"./chunk.F5BCCGFK.js";import{b as S}from"./chunk.AJZBJBMO.js";var o=S(D(),1);var i=S(C(),1);function W(c){let e=document.activeElement;if(e!==null&&e!==document.body&&e!==document.documentElement&&e.isConnected)return;let r=c??document,a=r.querySelector("main")??r.querySelector("[data-graview-page]")??null,n=r.querySelector("[data-graview-page-title]")??a?.querySelector("h1, h2")??a;n instanceof HTMLElement&&(n.hasAttribute("tabindex")||n.setAttribute("tabindex","-1"),n.focus({preventScroll:!0}))}var H=1500;function z(c,e,r){let{store:a,principal:n}=c,u=L(a),l=(0,o.useMemo)(()=>R(a,n),[a,n,u]),b=(0,o.useRef)(r),[p,m]=(0,o.useState)(),[s,f]=(0,o.useState)("");(0,o.useEffect)(()=>{let t=O(a,n,b.current);b.current=a.batches().length,t&&(m({batch:t.batch,at:e,when:Date.now()}),f(""))},[a,n,u]),(0,o.useEffect)(()=>{m(t=>!t||t.at===e?t:Date.now()-t.when<H?{...t,at:e}:void 0)},[e]);let[g,h]=(0,o.useState)(null),y=(0,o.useCallback)(()=>{m(void 0),h(null)},[]),w=(0,o.useCallback)(()=>{h(null);try{let t=P(a,n);t&&f(`Took back \u201C${t.intent}\u201D`)}catch(t){h(t instanceof Error?t.message:String(t))}},[a,n]),d=l&&p?.batch===l.batch&&p.at===e?l:void 0;return{change:l,offered:d,close:y,takeBack:w,refused:g,said:s}}function Y({context:c,docked:e,at:r,since:a}){let{change:n,offered:u,close:l,takeBack:b,refused:p,said:m}=z(c,r,a),s=e?u:n,f=(0,o.useRef)(null),g=e&&(s!==void 0||p!==null);B(f,g),(0,o.useEffect)(()=>{if(!g)return;let d,t=()=>d=setTimeout(()=>f.current?.matches(":hover, :focus-within")?t():l(),1e4);return t(),()=>clearTimeout(d)},[g,s?.batch,p,l]);let h=m||(e&&s?v(s):""),y=e?{position:"fixed",inset:"auto",margin:0,padding:0,border:"none",background:"none",overflow:"visible",zIndex:k("toast"),width:"max-content",height:"auto",bottom:"calc(16px + env(safe-area-inset-bottom, 0px))",left:16,justifyItems:"start",color:"var(--graview-ink)",...g?{}:{display:"none"}}:{},w=s?(0,i.jsxs)("button",{type:"button","data-testid":"page-undo",title:`${v(s)} \u2014 \u2318Z or Ctrl+Z`,"aria-keyshortcuts":"Meta+Z Control+Z",onClick:d=>{let t=d.currentTarget.closest("[data-graview-face]");b(),requestAnimationFrame(()=>W(t))},style:e?I:A,children:[(0,i.jsx)("span",{"aria-hidden":"true",children:"\u21B6"}),(0,i.jsx)("span",{style:e?j:F,children:v(s)})]}):null;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("span",{role:"status","aria-live":"polite",style:N,children:h}),(0,i.jsxs)("div",{ref:f,...e?{popover:"manual","data-graview-foot":"","data-graview-offstage":""}:{},"data-testid":e?"face-undo-dock":"page-undo-place",style:{display:"grid",justifyItems:"end",gap:4,maxWidth:"100%",minWidth:0,...y},children:[e&&s?(0,i.jsxs)("div",{"data-testid":"page-undo-notice",style:_,children:[w,(0,i.jsx)("button",{type:"button","data-testid":"page-undo-dismiss","aria-label":`Dismiss: ${v(s)}`,title:"Dismiss",onClick:d=>{let t=d.currentTarget.closest("[data-graview-face]");l(),requestAnimationFrame(()=>W(t))},style:q,children:"\xD7"})]}):w,p?(0,i.jsx)("span",{"data-testid":"page-undo-refused",role:"alert",style:{fontSize:"0.8125rem",lineHeight:1.4,color:"var(--graview-warn)",background:e?"var(--graview-float)":void 0,padding:e?"4px 8px":void 0,borderRadius:6},children:p}):null]})]})}function B(c,e){(0,o.useLayoutEffect)(()=>{let r=c.current;if(!r||!e)return;if(typeof r.showPopover=="function"&&!x(r))try{r.showPopover()}catch{}let a=()=>r.parentElement?.closest("[data-embed-content]")??null,n=()=>{T(r,a()),dispatchEvent(new Event(E))};n(),addEventListener("resize",n),addEventListener("scroll",n,!0);let u=typeof ResizeObserver=="function"?new ResizeObserver(n):null;return u?.observe(r),()=>{if(u?.disconnect(),removeEventListener("resize",n),removeEventListener("scroll",n,!0),r.isConnected&&x(r))try{r.hidePopover()}catch{}dispatchEvent(new Event(E))}},[c,e])}var A={display:"inline-flex",alignItems:"center",gap:6,minHeight:36,maxWidth:"100%",minWidth:0,padding:"0 14px",borderRadius:999,border:"1px solid var(--graview-edge)",background:"var(--graview-float)",color:"var(--graview-ink)",font:"inherit",fontSize:"0.875rem",cursor:"pointer"},I={...A,textAlign:"start",lineHeight:1.4,padding:"8px 4px 8px 14px",border:"none",background:"none",color:"inherit"},_={display:"flex",alignItems:"center",gap:2,maxWidth:"100%",minWidth:0,paddingRight:6,borderRadius:"var(--graview-radius, 12px)",border:"1px solid var(--graview-edge)",background:"var(--graview-float)",boxShadow:"var(--graview-lift-high)"},q={flex:"0 0 auto",minWidth:28,minHeight:28,padding:0,border:"none",background:"none",boxShadow:"none",color:"var(--graview-ink-muted)",font:"inherit",fontSize:"1rem",cursor:"pointer"},F={minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},j={minWidth:0,overflow:"hidden",overflowWrap:"anywhere",display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:4},N={position:"absolute",width:1,height:1,margin:-1,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",whiteSpace:"nowrap",border:0};export{Y as TakeBack};
1
+ import{e as L}from"./chunk.3IVVXVG7.js";import{a as R,b as O,c as v,d as P}from"./chunk.UGFDSE37.js";import"./chunk.WNKRXL3O.js";import"./chunk.YW2BZ2LH.js";import"./chunk.CYPTJNES.js";import"./chunk.4NCXMVPY.js";import"./chunk.TN4GY6LW.js";import"./chunk.QJYALCIW.js";import"./chunk.HSRGYZOR.js";import"./chunk.BRBY5WJT.js";import"./chunk.ELY2RMGE.js";import"./chunk.UV2TSAB4.js";import"./chunk.6SK2K72G.js";import"./chunk.NNNVB6RV.js";import"./chunk.7MMNMZLF.js";import"./chunk.67PVRVAC.js";import"./chunk.MJLUAGEV.js";import"./chunk.WNMLA4YW.js";import"./chunk.VUKHDZNI.js";import{a as E,b as T}from"./chunk.MB7LKKUD.js";import"./chunk.WVUJXDXZ.js";import"./chunk.YFW5BF6J.js";import"./chunk.QYWBQ5NX.js";import"./chunk.ENJKCSNX.js";import"./chunk.LJE5J3JK.js";import"./chunk.X2OLXTRL.js";import"./chunk.JDRM6XXD.js";import"./chunk.GZHZLJBF.js";import"./chunk.GXPBRYSR.js";import"./chunk.NV6IZJKA.js";import"./chunk.OJGHDWI6.js";import"./chunk.7OLVQ2FZ.js";import"./chunk.NOZEHLWG.js";import"./chunk.UVLPVHID.js";import"./chunk.QXARGANF.js";import{F as D,Q as C,ta as x}from"./chunk.DNNL7F3P.js";import{qc as k}from"./chunk.HBBVVALN.js";import{b as S}from"./chunk.AJZBJBMO.js";var o=S(D(),1);var i=S(C(),1);function W(c){let e=document.activeElement;if(e!==null&&e!==document.body&&e!==document.documentElement&&e.isConnected)return;let r=c??document,a=r.querySelector("main")??r.querySelector("[data-graview-page]")??null,n=r.querySelector("[data-graview-page-title]")??a?.querySelector("h1, h2")??a;n instanceof HTMLElement&&(n.hasAttribute("tabindex")||n.setAttribute("tabindex","-1"),n.focus({preventScroll:!0}))}var H=1500;function z(c,e,r){let{store:a,principal:n}=c,u=L(a),l=(0,o.useMemo)(()=>R(a,n),[a,n,u]),b=(0,o.useRef)(r),[p,m]=(0,o.useState)(),[s,f]=(0,o.useState)("");(0,o.useEffect)(()=>{let t=O(a,n,b.current);b.current=a.batches().length,t&&(m({batch:t.batch,at:e,when:Date.now()}),f(""))},[a,n,u]),(0,o.useEffect)(()=>{m(t=>!t||t.at===e?t:Date.now()-t.when<H?{...t,at:e}:void 0)},[e]);let[g,h]=(0,o.useState)(null),y=(0,o.useCallback)(()=>{m(void 0),h(null)},[]),w=(0,o.useCallback)(()=>{h(null);try{let t=P(a,n);t&&f(`Took back \u201C${t.intent}\u201D`)}catch(t){h(t instanceof Error?t.message:String(t))}},[a,n]),d=l&&p?.batch===l.batch&&p.at===e?l:void 0;return{change:l,offered:d,close:y,takeBack:w,refused:g,said:s}}function Y({context:c,docked:e,at:r,since:a}){let{change:n,offered:u,close:l,takeBack:b,refused:p,said:m}=z(c,r,a),s=e?u:n,f=(0,o.useRef)(null),g=e&&(s!==void 0||p!==null);B(f,g),(0,o.useEffect)(()=>{if(!g)return;let d,t=()=>d=setTimeout(()=>f.current?.matches(":hover, :focus-within")?t():l(),1e4);return t(),()=>clearTimeout(d)},[g,s?.batch,p,l]);let h=m||(e&&s?v(s):""),y=e?{position:"fixed",inset:"auto",margin:0,padding:0,border:"none",background:"none",overflow:"visible",zIndex:k("toast"),width:"max-content",height:"auto",bottom:"calc(16px + env(safe-area-inset-bottom, 0px))",left:16,justifyItems:"start",color:"var(--graview-ink)",...g?{}:{display:"none"}}:{},w=s?(0,i.jsxs)("button",{type:"button","data-testid":"page-undo",title:`${v(s)} \u2014 \u2318Z or Ctrl+Z`,"aria-keyshortcuts":"Meta+Z Control+Z",onClick:d=>{let t=d.currentTarget.closest("[data-graview-face]");b(),requestAnimationFrame(()=>W(t))},style:e?I:A,children:[(0,i.jsx)("span",{"aria-hidden":"true",children:"\u21B6"}),(0,i.jsx)("span",{style:e?j:F,children:v(s)})]}):null;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("span",{role:"status","aria-live":"polite",style:N,children:h}),(0,i.jsxs)("div",{ref:f,...e?{popover:"manual","data-graview-foot":"","data-graview-offstage":""}:{},"data-testid":e?"face-undo-dock":"page-undo-place",style:{display:"grid",justifyItems:"end",gap:4,maxWidth:"100%",minWidth:0,...y},children:[e&&s?(0,i.jsxs)("div",{"data-testid":"page-undo-notice",style:_,children:[w,(0,i.jsx)("button",{type:"button","data-testid":"page-undo-dismiss","aria-label":`Dismiss: ${v(s)}`,title:"Dismiss",onClick:d=>{let t=d.currentTarget.closest("[data-graview-face]");l(),requestAnimationFrame(()=>W(t))},style:q,children:"\xD7"})]}):w,p?(0,i.jsx)("span",{"data-testid":"page-undo-refused",role:"alert",style:{fontSize:"0.8125rem",lineHeight:1.4,color:"var(--graview-warn)",background:e?"var(--graview-float)":void 0,padding:e?"4px 8px":void 0,borderRadius:6},children:p}):null]})]})}function B(c,e){(0,o.useLayoutEffect)(()=>{let r=c.current;if(!r||!e)return;if(typeof r.showPopover=="function"&&!x(r))try{r.showPopover()}catch{}let a=()=>r.parentElement?.closest("[data-embed-content]")??null,n=()=>{T(r,a()),dispatchEvent(new Event(E))};n(),addEventListener("resize",n),addEventListener("scroll",n,!0);let u=typeof ResizeObserver=="function"?new ResizeObserver(n):null;return u?.observe(r),()=>{if(u?.disconnect(),removeEventListener("resize",n),removeEventListener("scroll",n,!0),r.isConnected&&x(r))try{r.hidePopover()}catch{}dispatchEvent(new Event(E))}},[c,e])}var A={display:"inline-flex",alignItems:"center",gap:6,minHeight:36,maxWidth:"100%",minWidth:0,padding:"0 14px",borderRadius:999,border:"1px solid var(--graview-edge)",background:"var(--graview-float)",color:"var(--graview-ink)",font:"inherit",fontSize:"0.875rem",cursor:"pointer"},I={...A,textAlign:"start",lineHeight:1.4,padding:"8px 4px 8px 14px",border:"none",background:"none",color:"inherit"},_={display:"flex",alignItems:"center",gap:2,maxWidth:"100%",minWidth:0,paddingRight:6,borderRadius:"var(--graview-radius, 12px)",border:"1px solid var(--graview-edge)",background:"var(--graview-float)",boxShadow:"var(--graview-lift-high)"},q={flex:"0 0 auto",minWidth:28,minHeight:28,padding:0,border:"none",background:"none",boxShadow:"none",color:"var(--graview-ink-muted)",font:"inherit",fontSize:"1rem",cursor:"pointer"},F={minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},j={minWidth:0,overflow:"hidden",overflowWrap:"anywhere",display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:4},N={position:"absolute",width:1,height:1,margin:-1,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",whiteSpace:"nowrap",border:0};export{Y as TakeBack};
@@ -1,4 +1,4 @@
1
- import{b as J}from"./chunk.3ZIOAPI5.js";import{a as V,c as T,d as _,e as D}from"./chunk.QDHUDLJB.js";import"./chunk.ZVMIHXVK.js";import"./chunk.272ZJXQP.js";import"./chunk.3SM2CHKF.js";import"./chunk.CUCNT7MG.js";import"./chunk.2A2DLMT3.js";import"./chunk.E77K6KBX.js";import"./chunk.UT6642FC.js";import"./chunk.TI4OSTQV.js";import"./chunk.GZHZLJBF.js";import"./chunk.PWOVXARZ.js";import"./chunk.SG23JC6D.js";import"./chunk.OJGHDWI6.js";import"./chunk.GZLYTPE7.js";import"./chunk.4B73P2WA.js";import"./chunk.IMRCAU4T.js";import"./chunk.BZ5VLPKB.js";import{F as q,Q as k,Y as w,d as B,sa as j,wa as E,y as G}from"./chunk.6II4BONS.js";import{Ma as M,X as H,Z as I,aa as L,gb as W}from"./chunk.F5BCCGFK.js";import{b as f}from"./chunk.AJZBJBMO.js";function P(e){return{minHeight:24,padding:"3px 10px",borderRadius:6,fontSize:"0.875rem",borderWidth:1,borderStyle:"solid",borderColor:e?"transparent":"var(--graview-edge)",color:e?"var(--graview-ink)":"var(--graview-ink-muted)",fontWeight:e?600:400,background:e?"color-mix(in srgb, var(--graview-accent) 16%, transparent)":"transparent"}}var A=f(k(),1);function K(){let{seats:e,principal:n,takeSeat:i}=w();return e.length<2?null:(0,A.jsxs)("div",{role:"group","aria-label":"Seat","data-testid":"seats",style:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:6,rowGap:4},children:[(0,A.jsx)("span",{style:{fontSize:"0.75rem",letterSpacing:"0.12em",textTransform:"uppercase",color:"var(--graview-ink-faint)"},children:"As"}),e.map(r=>{let d=Q(n,r.principal);return(0,A.jsx)("button",{type:"button","aria-pressed":d,"data-testid":`seat-${r.principal.id??r.label}`,title:`Sit down as ${r.label}: the acts, the kinds and the pages narrow to what this seat may do`,onClick:()=>i(r.principal),style:{...P(d),whiteSpace:"nowrap"},children:r.label},r.principal.id??r.label)})]})}function Q(e,n){return e.kind===n.kind&&e.id===n.id}var C=f(q(),1),l=f(k(),1),X=`
1
+ import{b as J}from"./chunk.JFLUVZNW.js";import{a as V,c as T,d as _,e as D}from"./chunk.7MMNMZLF.js";import"./chunk.67PVRVAC.js";import"./chunk.GMZAQGH7.js";import"./chunk.57XTDW57.js";import"./chunk.MJLUAGEV.js";import"./chunk.WNMLA4YW.js";import"./chunk.VUKHDZNI.js";import"./chunk.UT6642FC.js";import"./chunk.TI4OSTQV.js";import"./chunk.GZHZLJBF.js";import"./chunk.GXPBRYSR.js";import"./chunk.NV6IZJKA.js";import"./chunk.OJGHDWI6.js";import"./chunk.7OLVQ2FZ.js";import"./chunk.NOZEHLWG.js";import"./chunk.UVLPVHID.js";import"./chunk.QXARGANF.js";import{F as q,Q as k,Y as w,d as B,sa as j,wa as E,y as G}from"./chunk.DNNL7F3P.js";import{Ua as M,ba as H,da as I,ga as L,ob as W}from"./chunk.HBBVVALN.js";import{b as f}from"./chunk.AJZBJBMO.js";function P(e){return{minHeight:24,padding:"3px 10px",borderRadius:6,fontSize:"0.875rem",borderWidth:1,borderStyle:"solid",borderColor:e?"transparent":"var(--graview-edge)",color:e?"var(--graview-ink)":"var(--graview-ink-muted)",fontWeight:e?600:400,background:e?"color-mix(in srgb, var(--graview-accent) 16%, transparent)":"transparent"}}var A=f(k(),1);function K(){let{seats:e,principal:n,takeSeat:i}=w();return e.length<2?null:(0,A.jsxs)("div",{role:"group","aria-label":"Seat","data-testid":"seats",style:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:6,rowGap:4},children:[(0,A.jsx)("span",{style:{fontSize:"0.75rem",letterSpacing:"0.12em",textTransform:"uppercase",color:"var(--graview-ink-faint)"},children:"As"}),e.map(r=>{let d=Q(n,r.principal);return(0,A.jsx)("button",{type:"button","aria-pressed":d,"data-testid":`seat-${r.principal.id??r.label}`,title:`Sit down as ${r.label}: the acts, the kinds and the pages narrow to what this seat may do`,onClick:()=>i(r.principal),style:{...P(d),whiteSpace:"nowrap"},children:r.label},r.principal.id??r.label)})]})}function Q(e,n){return e.kind===n.kind&&e.id===n.id}var C=f(q(),1),l=f(k(),1),X=`
2
2
  .graview-here{display:flex;flex:none}
3
3
  .graview-here>button{display:inline-flex;align-items:center;gap:4px;height:30px;margin:0;padding:0 4px;border:1px solid transparent;border-radius:8px;background:none;box-shadow:none;font:inherit;font-size:.75rem;color:var(--graview-ink-muted);cursor:pointer}
4
4
  .graview-here-mark{display:inline-flex;align-items:center;justify-content:center;flex:none;box-sizing:border-box;width:24px;height:24px;border-radius:50%;border:1.5px solid hsl(var(--graview-hue) 50% 48%);background:var(--graview-panel-muted);color:var(--graview-ink);font-size:.75rem;font-weight:600;box-shadow:0 0 0 2px var(--graview-bar)}
@@ -0,0 +1 @@
1
+ import{a,b}from"./chunk.5JPRRV47.js";import"./chunk.IHBIRAC4.js";import"./chunk.FGYCYLUS.js";import"./chunk.NZJZIYDK.js";import"./chunk.UT6642FC.js";import"./chunk.YFW5BF6J.js";import"./chunk.QYWBQ5NX.js";import"./chunk.ENJKCSNX.js";import"./chunk.LJE5J3JK.js";import"./chunk.X2OLXTRL.js";import"./chunk.JDRM6XXD.js";import"./chunk.7OLVQ2FZ.js";import"./chunk.NOZEHLWG.js";import"./chunk.UVLPVHID.js";import"./chunk.HBBVVALN.js";import"./chunk.AJZBJBMO.js";export{b as actOnSeveral,a as actsForSeveral};
@@ -1 +1 @@
1
- var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{n as v}from"./chunk.BZ5VLPKB.js";import{F as P,I as w,Q as p,Y as R,a as A,xa as b}from"./chunk.6II4BONS.js";import{Sc as h}from"./chunk.F5BCCGFK.js";import{b as a}from"./chunk.AJZBJBMO.js";var L=a(p(),1),B=v.part(e=>(0,L.jsx)(e.ActivityRail,{calls:[]}),{quiet:!0});var l=a(P(),1),S=a(p(),1),C=b(A(()=>(__graviewPreload(import.meta.url,["./chunk.TGEF6TMM.js","./chunk.D6RDTUX3.js","./chunk.3ZIOAPI5.js","./chunk.ZVMIHXVK.js","./chunk.272ZJXQP.js","./chunk.3SM2CHKF.js","./chunk.2A2DLMT3.js","./chunk.E77K6KBX.js","./chunk.UT6642FC.js","./chunk.TI4OSTQV.js","./chunk.GZHZLJBF.js","./chunk.PWOVXARZ.js","./chunk.SG23JC6D.js","./chunk.OJGHDWI6.js","./chunk.GZLYTPE7.js","./chunk.4B73P2WA.js","./chunk.IMRCAU4T.js","./chunk.BZ5VLPKB.js","./chunk.6II4BONS.js","./chunk.F5BCCGFK.js","./chunk.AJZBJBMO.js"]),import("./chunk.ACXA55GW.js")))),F=C.part((e,r)=>{let t=e.RecordInteractions;return(0,S.jsx)(t,{...r})},{quiet:!0});function I(e,r,t){let o=e.target;return(o.on==="record"||o.on==="field"?o.id===r:o.on==="selection"?o.ids.includes(r):o.on==="act"?o.id===r:!1)||e.offered.some(n=>n.id===`record:${r}`||n.id.startsWith(`fill:${r}:`))||(e.batches??[]).some(n=>t(n).includes(r))}function T({id:e,style:r,headingStyle:t,className:o}){let{ai:d,aiDesk:n,store:f}=R(),{entries:y}=w(n),s=d.off===!0;(0,l.useEffect)(()=>{s||n.load()},[n,s]);let g=f.log.length,m=(0,l.useMemo)(()=>{let x=u=>f.log.all().flatMap(k=>k.batch===u?k.writes:[]);return y.filter(u=>I(u,e,x))},[y,e,f,g]);return s||m.length===0?null:(0,S.jsx)(l.Suspense,{fallback:null,children:(0,S.jsx)(F,{entries:m,...r?{style:r}:{},...t?{headingStyle:t}:{},...o?{className:o}:{}})})}var c=a(P(),1),i=a(p(),1);function ro({context:e,stop:r,title:t,label:o,style:d,className:n,children:f,...y}){let s=h(e.views?.arrangement?.()),g=f??(0,i.jsxs)(i.Fragment,{children:["In ",s==="Scene"?"the scene":s.replace(/^The /,"the ")," ",(0,i.jsx)("span",{"aria-hidden":"true",children:"\u2197"})]}),m=o?{"aria-label":o}:{};if(e.overview){let x=e.overview;return(0,i.jsx)("a",{href:r,...y,...m,...t?{title:t}:{},style:d,...n?{className:n}:{},onClick:u=>{u.preventDefault(),x(r)},children:g})}return e.embedded?null:(0,i.jsx)("a",{href:`${e.sceneHref??"/"}${r}`,...y,...m,...t?{title:t}:{},style:d,...n?{className:n}:{},children:g})}function oo(){return(0,i.jsx)("a",{href:"#fresh","data-testid":"start-fresh",title:"Forget every edit made in this browser and return to the example",onClick:e=>{e.preventDefault();let r=new URL(window.location.href);r.searchParams.set("fresh","1"),window.location.assign(r.toString())},style:{color:"inherit",display:"inline-flex",alignItems:"center",minHeight:24,minWidth:24},children:"Start fresh"})}function to(e){let r=(0,c.useRef)(0),t=(0,c.useCallback)(o=>e.subscribe(()=>{r.current+=1,o()}),[e]);return(0,c.useSyncExternalStore)(t,()=>r.current,()=>0)}export{B as a,T as b,ro as c,oo as d,to as e};
1
+ var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{n as v}from"./chunk.QXARGANF.js";import{F as P,I as w,Q as p,Y as R,a as A,xa as b}from"./chunk.DNNL7F3P.js";import{ad as k}from"./chunk.HBBVVALN.js";import{b as a}from"./chunk.AJZBJBMO.js";var L=a(p(),1),B=v.part(e=>(0,L.jsx)(e.ActivityRail,{calls:[]}),{quiet:!0});var l=a(P(),1),S=a(p(),1),C=b(A(()=>(__graviewPreload(import.meta.url,["./chunk.74DXEKUV.js","./chunk.Y44TR4WG.js","./chunk.JFLUVZNW.js","./chunk.67PVRVAC.js","./chunk.GMZAQGH7.js","./chunk.57XTDW57.js","./chunk.WNMLA4YW.js","./chunk.VUKHDZNI.js","./chunk.UT6642FC.js","./chunk.TI4OSTQV.js","./chunk.GZHZLJBF.js","./chunk.GXPBRYSR.js","./chunk.NV6IZJKA.js","./chunk.OJGHDWI6.js","./chunk.7OLVQ2FZ.js","./chunk.NOZEHLWG.js","./chunk.UVLPVHID.js","./chunk.QXARGANF.js","./chunk.DNNL7F3P.js","./chunk.HBBVVALN.js","./chunk.AJZBJBMO.js"]),import("./chunk.D2ILIAND.js")))),F=C.part((e,r)=>{let t=e.RecordInteractions;return(0,S.jsx)(t,{...r})},{quiet:!0});function I(e,r,t){let o=e.target;return(o.on==="record"||o.on==="field"?o.id===r:o.on==="selection"?o.ids.includes(r):o.on==="act"?o.id===r:!1)||e.offered.some(n=>n.id===`record:${r}`||n.id.startsWith(`fill:${r}:`))||(e.batches??[]).some(n=>t(n).includes(r))}function T({id:e,style:r,headingStyle:t,className:o}){let{ai:d,aiDesk:n,store:f}=R(),{entries:y}=w(n),s=d.off===!0;(0,l.useEffect)(()=>{s||n.load()},[n,s]);let g=f.log.length,m=(0,l.useMemo)(()=>{let x=u=>f.log.all().flatMap(h=>h.batch===u?h.writes:[]);return y.filter(u=>I(u,e,x))},[y,e,f,g]);return s||m.length===0?null:(0,S.jsx)(l.Suspense,{fallback:null,children:(0,S.jsx)(F,{entries:m,...r?{style:r}:{},...t?{headingStyle:t}:{},...o?{className:o}:{}})})}var c=a(P(),1),i=a(p(),1);function ro({context:e,stop:r,title:t,label:o,style:d,className:n,children:f,...y}){let s=k(e.views?.arrangement?.()),g=f??(0,i.jsxs)(i.Fragment,{children:["In ",s==="Scene"?"the scene":s.replace(/^The /,"the ")," ",(0,i.jsx)("span",{"aria-hidden":"true",children:"\u2197"})]}),m=o?{"aria-label":o}:{};if(e.overview){let x=e.overview;return(0,i.jsx)("a",{href:r,...y,...m,...t?{title:t}:{},style:d,...n?{className:n}:{},onClick:u=>{u.preventDefault(),x(r)},children:g})}return e.embedded?null:(0,i.jsx)("a",{href:`${e.sceneHref??"/"}${r}`,...y,...m,...t?{title:t}:{},style:d,...n?{className:n}:{},children:g})}function oo(){return(0,i.jsx)("a",{href:"#fresh","data-testid":"start-fresh",title:"Forget every edit made in this browser and return to the example",onClick:e=>{e.preventDefault();let r=new URL(window.location.href);r.searchParams.set("fresh","1"),window.location.assign(r.toString())},style:{color:"inherit",display:"inline-flex",alignItems:"center",minHeight:24,minWidth:24},children:"Start fresh"})}function to(e){let r=(0,c.useRef)(0),t=(0,c.useCallback)(o=>e.subscribe(()=>{r.current+=1,o()}),[e]);return(0,c.useSyncExternalStore)(t,()=>r.current,()=>0)}export{B as a,T as b,ro as c,oo as d,to as e};
@@ -1 +1 @@
1
- import{a as r,b as m,d as k,e as h}from"./chunk.UGFDSE37.js";import"./chunk.BZ5VLPKB.js";import"./chunk.6II4BONS.js";import"./chunk.F5BCCGFK.js";import"./chunk.AJZBJBMO.js";var o="way-back",b='[data-testid="notices-toasts"]';function g(t){let a=document.activeElement;a!==null&&a!==document.body&&!a.closest(b)||(t??document).querySelector('[data-graview-app-bar] [data-testid="app-home"]')?.focus({preventScroll:!0})}function w(t,a,i,d,y){if(t.past)return i?.dismiss(o),()=>{};let c=y?.closest("[data-graview-embed]"),s,f=e=>{if(e!==void 0&&r(t,a)?.batch!==e)return!1;try{let n=k(t,a);return n&&i?.notify({kind:"toast",id:o,sentence:`Took back \u201C${n.intent}\u201D`}),n!==void 0}catch(n){return i?.notify({kind:"toast",id:o,tone:"warn",sentence:n instanceof Error?n.message:String(n)}),!0}},u=()=>{let e=m(t,a,d);if(d=t.batches().length,e){let n=s=e.batch;i?.notify({kind:"toast",id:o,sentence:e.intent,timeout:1e4,action:{label:"Take back",onSelect:()=>(g(c),f(n))}})}else s&&r(t,a)?.batch!==s&&(s=void 0,i?.dismiss(o))},l=e=>{h(e)&&(!c||c.contains(e.target))&&f()&&e.preventDefault()};u();let p=t.subscribe(u);return document.addEventListener("keydown",l),(e=!1)=>{p(),document.removeEventListener("keydown",l),e&&s&&i?.dismiss(o)}}export{w as sceneWay};
1
+ import{a as r,b as m,d as k,e as h}from"./chunk.UGFDSE37.js";import"./chunk.QXARGANF.js";import"./chunk.DNNL7F3P.js";import"./chunk.HBBVVALN.js";import"./chunk.AJZBJBMO.js";var o="way-back",b='[data-testid="notices-toasts"]';function g(t){let a=document.activeElement;a!==null&&a!==document.body&&!a.closest(b)||(t??document).querySelector('[data-graview-app-bar] [data-testid="app-home"]')?.focus({preventScroll:!0})}function w(t,a,i,d,y){if(t.past)return i?.dismiss(o),()=>{};let c=y?.closest("[data-graview-embed]"),s,f=e=>{if(e!==void 0&&r(t,a)?.batch!==e)return!1;try{let n=k(t,a);return n&&i?.notify({kind:"toast",id:o,sentence:`Took back \u201C${n.intent}\u201D`}),n!==void 0}catch(n){return i?.notify({kind:"toast",id:o,tone:"warn",sentence:n instanceof Error?n.message:String(n)}),!0}},u=()=>{let e=m(t,a,d);if(d=t.batches().length,e){let n=s=e.batch;i?.notify({kind:"toast",id:o,sentence:e.intent,timeout:1e4,action:{label:"Take back",onSelect:()=>(g(c),f(n))}})}else s&&r(t,a)?.batch!==s&&(s=void 0,i?.dismiss(o))},l=e=>{h(e)&&(!c||c.contains(e.target))&&f()&&e.preventDefault()};u();let p=t.subscribe(u);return document.addEventListener("keydown",l),(e=!1)=>{p(),document.removeEventListener("keydown",l),e&&s&&i?.dismiss(o)}}export{w as sceneWay};
@@ -0,0 +1 @@
1
+ import{a as f}from"./chunk.EKUAI5YL.js";import{ba as d}from"./chunk.HBBVVALN.js";function w(n){let o=n.indexOf("{"),r=n.indexOf("["),t=r!==-1&&(o===-1||r<o)?r:o;if(t===-1)return;let e=n[t],a=e==="["?"]":"}",i=0,c=!1,l=!1;for(let s=t;s<n.length;s++){let u=n[s];if(c){l?l=!1:u==="\\"?l=!0:u==='"'&&(c=!1);continue}if(u==='"')c=!0;else if(u===e)i+=1;else if(u===a&&(i-=1,i===0))try{return JSON.parse(n.slice(t,s+1))}catch{return}}}function v(n,o){let r;try{r=n.mutation(o.mutation)}catch{return o}let t={...o.args},e=!1;for(let a of f(r.input)){if(a.control!=="node")continue;let i=t[a.name];if(typeof i!="string"||i.length===0||n.graph.getNode(i))continue;let c=i.trim().toLowerCase(),l=[...n.graph.allNodes()].filter(s=>(a.kinds.includes("*")||a.kinds.includes(s.kind))&&d(n.schema.tryDefinition(s.kind),s).trim().toLowerCase()===c);l.length===1&&(t[a.name]=l[0].id,e=!0)}return e?{...o,args:t}:o}function P(n,o,r){let t=r===void 0?null:new Set(r),e=[];for(let a of o){if(typeof a.mutation!="string")continue;let i=!0;try{n.mutation(a.mutation)}catch{i=!1}i?t&&!t.has(a.mutation)&&e.push({proposal:a,why:"not-allowed"}):e.push({proposal:a,why:"unknown"})}return e}function x(n,o,r){let t=r===void 0?null:new Set(r);return o.filter(e=>{if(typeof e.mutation!="string"||t&&!t.has(e.mutation))return!1;try{n.mutation(e.mutation)}catch{return!1}return e.args!==null&&typeof e.args=="object"})}export{w as a,v as b,P as c,x as d};
@@ -1 +1 @@
1
- import{Q as w,k as c,m as h,n as b,na as y,pa as k,s as f}from"./chunk.6II4BONS.js";import{N as i}from"./chunk.F5BCCGFK.js";import{b as g}from"./chunk.AJZBJBMO.js";var s=null,a=new Set,v=e=>{s={kind:e,n:(s?.n??0)+1};for(let t of a)t()},A=()=>s,C=e=>(a.add(e),()=>a.delete(e)),V=()=>{s=null};var d=g(w(),1);function T(e,t){if(e.length===0||t.length===0)return[];let o=new Set(t.map(n=>n.id));return e.filter(n=>n.nodeIds.some(l=>o.has(l)))}var x=(e,t)=>`${i(e)} ${e===1?"problem":"problems"} in ${t}`;function q({kind:e,plural:t,problems:o,flag:n,listed:l=!1}){let{view:p,go:P}=k(),{set:$}=y();if(o.length===0)return null;let u=x(o.length,t),m=o.length===1?"it":"them";return(0,d.jsx)("button",{type:"button",className:"graview-district-problems","data-testid":`district-problems-${e}`,"data-graview-problems":o.length,"aria-expanded":l,"aria-label":u,title:`${u} \u2014 ${o[0].message}${o.length>1?` (and ${i(o.length-1)} more)`:""}. Press to see ${m} and how to fix ${m}.`,onClick:r=>{r.stopPropagation(),p.overview||P(h(c(b(p,!0),null),"view",null)),$([f(e)]),v(e)},onDoubleClick:r=>r.stopPropagation(),onPointerDown:r=>r.stopPropagation(),children:(0,d.jsx)("span",{"aria-hidden":"true",children:`${n} ${i(o.length)}`})})}export{A as a,C as b,V as c,T as d,x as e,q as f};
1
+ import{Q as w,k as c,m as h,n as b,na as y,pa as k,s as f}from"./chunk.DNNL7F3P.js";import{T as i}from"./chunk.HBBVVALN.js";import{b as g}from"./chunk.AJZBJBMO.js";var s=null,a=new Set,v=e=>{s={kind:e,n:(s?.n??0)+1};for(let t of a)t()},A=()=>s,C=e=>(a.add(e),()=>a.delete(e)),V=()=>{s=null};var d=g(w(),1);function T(e,t){if(e.length===0||t.length===0)return[];let o=new Set(t.map(n=>n.id));return e.filter(n=>n.nodeIds.some(l=>o.has(l)))}var x=(e,t)=>`${i(e)} ${e===1?"problem":"problems"} in ${t}`;function q({kind:e,plural:t,problems:o,flag:n,listed:l=!1}){let{view:p,go:P}=k(),{set:$}=y();if(o.length===0)return null;let u=x(o.length,t),m=o.length===1?"it":"them";return(0,d.jsx)("button",{type:"button",className:"graview-district-problems","data-testid":`district-problems-${e}`,"data-graview-problems":o.length,"aria-expanded":l,"aria-label":u,title:`${u} \u2014 ${o[0].message}${o.length>1?` (and ${i(o.length-1)} more)`:""}. Press to see ${m} and how to fix ${m}.`,onClick:r=>{r.stopPropagation(),p.overview||P(h(c(b(p,!0),null),"view",null)),$([f(e)]),v(e)},onDoubleClick:r=>r.stopPropagation(),onPointerDown:r=>r.stopPropagation(),children:(0,d.jsx)("span",{"aria-hidden":"true",children:`${n} ${i(o.length)}`})})}export{A as a,C as b,V as c,T as d,x as e,q as f};
@@ -0,0 +1 @@
1
+ import{a as ce,c as ge,d as ye,f as he}from"./chunk.VUKHDZNI.js";import{f as q,i as k,j as pe,k as ue,q as fe,r as me}from"./chunk.7OLVQ2FZ.js";import{b as de}from"./chunk.NOZEHLWG.js";import{c as se,f as le}from"./chunk.UVLPVHID.js";import{F as Ae,Q as ae,Z as ie,i as re,v as oe}from"./chunk.DNNL7F3P.js";import{Ca as ee,Na as ne,Oa as te,ba as Q,da as X,ka as Z}from"./chunk.HBBVVALN.js";import{b as T}from"./chunk.AJZBJBMO.js";var l=T(Ae(),1),i=T(ae(),1);function He({affordance:n,onApply:a,onCancel:p,store:b}){let y=ie(),s=b??y?.store,[S,G]=(0,l.useState)({}),[f,C]=(0,l.useState)(""),[F,I]=(0,l.useState)(B),[J,_]=(0,l.useState)(void 0),U=(0,l.useId)(),P=(0,l.useRef)(null),x=n.open.filter(e=>!(e.name in S)),o=x[0],w=s.allMutations().find(e=>e.name===n.mutation),j=(0,l.useMemo)(()=>Oe(w,s,n.args??{}),[w,s,n.args]),d=o?j[o.name]:void 0,$=me(n.open.filter(e=>e.shape?.type==="date").map(e=>e.name)),we=(()=>{if(!$||o?.name!==$.end||o.shape?.type!=="date")return;let e=S[$.start];if(typeof e!="string")return;let r=j[$.start];return fe(typeof r=="string"?r:void 0,e,typeof d=="string"?d:void 0,{time:o.shape.time===!0,instant:o.shape.instant===!0})})();if((0,l.useEffect)(()=>{C(we??be(d,o?.shape)),I(Array.isArray(d)?d:B),_(d)},[o?.name]),(0,l.useEffect)(()=>{P.current?.scrollIntoView?.({block:"nearest",inline:"nearest"})},[o?.name]),(0,l.useLayoutEffect)(()=>{let e=P.current,r=typeof document>"u"?null:document.activeElement;if(!e||r&&r!==document.body&&!e.contains(r))return;let u=e.querySelector("form input, [role=group] button:not([disabled])");u&&u!==r&&u.focus()},[o?.name]),!o)return null;let h=e=>{let r=d!==void 0&&JSON.stringify(e)===JSON.stringify(d)?void 0:e,u={...S,[o.name]:r};if(n.open.filter(R=>!(R.name in u)).length===0){let R=a(Object.fromEntries(Object.entries(u).filter(([,M])=>M!==void 0)));R&&R.length>0&&G(Object.fromEntries(Object.entries(u).filter(([M])=>!R.includes(M))))}else G(u)},A=o.optional?(0,i.jsx)("button",{type:"button",onClick:()=>h(void 0),style:{fontSize:"0.8125rem"},children:"Skip"}):null,t=o.shape??{type:"unknown"},c=t.type==="number"?t.amount:void 0,g=Ne(o,t),m=q(s.schema,w,o.name),V=ee((w?.input?.shape??{})[o.name]),ve=te((w?.input?.shape??{})[o.name]),O=ne(o.name),ke=typeof d=="boolean"?d?"yes":"no":d,[W,Se]=(0,l.useState)(""),Y=(0,l.useMemo)(()=>{let e=g.map(r=>s.graph.getNode(r)).filter(r=>r!==void 0);return de(e,r=>s.schema.tryDefinition(r))},[g,s]),L=e=>{let r=Ce(s,t,e),u=t.type==="choice"||t.type==="several"&&t.of.type==="choice"?m.option(e):r,N=Y.get(e);return N?`${u} \xB7 ${N}`:u},z=(0,l.useMemo)(()=>{let e=W.trim().toLowerCase();return e===""?g:g.filter(r=>L(r).toLowerCase().includes(e))},[g,W,s,t,Y]),v=t.type==="several",H=t.type==="file"?t:t.type==="several"&&t.of.type==="file"?t.of:void 0,K=v&&g.length===0,D=o.kinds&&o.kinds.length>0&&!o.kinds.includes("*")?o.kinds.map(e=>X(Z(s.schema.tryDefinition(e),e))).join(" or "):m.label,xe=n.open.length>1?`${D} \xB7 ${n.open.length-x.length+1} of ${n.open.length}`:D;return(0,i.jsxs)("div",{ref:P,"data-graview-asking":n.id,style:{display:"grid",gridTemplateColumns:"minmax(0, 1fr)",gap:4,padding:"5px 0 2px"},children:[n.open.length>1||g.length>0?(0,i.jsx)("span",{id:U,style:{fontSize:"0.75rem",color:"var(--graview-ink-faint)"},children:xe}):null,g.length>E?(0,i.jsx)("input",{type:"search",value:W,onChange:e=>Se(e.target.value),placeholder:`Filter ${g.length}\u2026`,"aria-label":`Filter ${D}`,"data-testid":"ask-filter",style:{font:"inherit",fontSize:"0.8125rem",minWidth:0,padding:"3px 7px"}}):null,ve?(0,i.jsxs)("form",{style:{display:"grid",gap:4},onSubmit:e=>{e.preventDefault(),h(J??(d===void 0?void 0:null))},children:[(0,i.jsx)(ye,{value:J,onChange:_,start:O?S[O]??j[O]:void 0,label:`${O?q(s.schema,w,O).label:m.label} repeats`,name:o.name}),(0,i.jsxs)("span",{style:{display:"flex",gap:4},children:[(0,i.jsx)("button",{type:"submit",style:{fontSize:"0.8125rem"},children:x.length>1?"Next":"Apply"}),A]})]}):V?(0,i.jsxs)("div",{style:{display:"grid",gap:4},children:[(0,i.jsx)(ge,{relation:V,value:d,onChange:h,label:m.label}),A]}):H?(0,i.jsxs)("div",{style:{display:"grid",gap:4},children:[(0,i.jsx)(ce,{as:"control",value:d,onChange:h,several:v,image:H.image===!0,video:H.video===!0,label:m.label}),A]}):g.length>0?(0,i.jsxs)("div",{role:"group","aria-labelledby":U,style:{display:"flex",flexWrap:"wrap",gap:4},children:[z.slice(0,E).map(e=>{let r=v?F.includes(e):e===ke;return(0,i.jsx)("button",{type:"button","aria-label":`${D}: ${L(e)}`,...v?{"aria-pressed":r}:r?{"aria-current":!0}:{},style:{padding:"3px 9px",fontSize:"0.8125rem",...r?{borderColor:"var(--graview-accent)",color:"var(--graview-accent)"}:{}},onClick:()=>v?I(u=>u.includes(e)?u.filter(N=>N!==e):[...u,e]):h(t.type==="boolean"?e==="yes":e),children:L(e)},e)}),z.length>E?(0,i.jsxs)("span",{"data-testid":"ask-more",style:{alignSelf:"center",fontSize:"0.75rem",color:"var(--graview-ink-faint)"},children:[z.length-E," more \u2014 type to narrow"]}):null,z.length===0?(0,i.jsxs)("span",{"data-testid":"ask-none",style:{alignSelf:"center",fontSize:"0.75rem",color:"var(--graview-ink-faint)"},children:["None of the ",g.length," match that."]}):null,v?(0,i.jsx)("button",{type:"button",disabled:F.length===0,style:{fontSize:"0.8125rem"},onClick:()=>{let e=F;I(B),h(e)},children:x.length>1?"Next":"Apply"}):null,A]}):(0,i.jsxs)("form",{style:{display:"flex",flexWrap:"wrap",gap:4},onSubmit:e=>{if(e.preventDefault(),d!==void 0&&f===be(d,t)){h(void 0);return}if(K){h(f.split(/[,\n]/).map(r=>r.trim()).filter(Boolean));return}if(f.trim().length!==0){if(c){let r=ue(f,c);r!==void 0&&h(r);return}h(t.type==="number"?t.duration?le(f)??f:Number(f):f)}},children:[t.type==="text"&&t.long?(0,i.jsx)("textarea",{autoFocus:!0,name:o.name,"aria-label":m.label,placeholder:m.label,value:f,rows:4,onChange:e=>C(e.target.value),onKeyDown:e=>{e.key==="Escape"?p():e.key==="Enter"&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),e.currentTarget.form?.requestSubmit())},style:{flex:"1 1 100%",minWidth:0,font:"inherit",fontSize:"0.875rem",lineHeight:1.45,padding:"5px 8px",borderRadius:7,border:"1px solid var(--graview-edge)",background:"var(--graview-panel)",color:"var(--graview-ink)",resize:"vertical",fieldSizing:"content",minHeight:"5.5em",maxHeight:"40vh"}}):t.type==="date"?(0,i.jsx)(he,{autoFocus:!0,name:o.name,label:m.label,value:f===""?void 0:f,time:t.time===!0,instant:t.instant===!0,onChange:e=>C(e??""),onCancel:p,boxStyle:{fontSize:"0.875rem",padding:"5px 8px",borderRadius:7,border:"1px solid var(--graview-edge)",background:"var(--graview-panel)",color:"var(--graview-ink)"}}):(0,i.jsx)("input",{autoFocus:!0,type:t.type==="number"&&!t.duration&&!c?"number":t.type==="text"&&t.holds==="phone"?"tel":"text",...c?{inputMode:"decimal","data-graview-amount":c.format??"unit"}:{},name:o.name,"aria-label":m.label,placeholder:K?`${m.label}, separated by commas`:c?`${m.label}, ${k(c).hint} \u2014 ${k(c).prefix??""}${k(c).placeholder}${k(c).suffix?` ${k(c).suffix}`:""}`:m.label,value:f,...t.type==="number"&&t.min!==void 0?{min:t.min}:{},...t.type==="number"&&t.max!==void 0?{max:t.max}:{},...t.type==="number"&&t.step!==void 0?{step:t.step}:{},onChange:e=>C(e.target.value),onKeyDown:e=>{e.key==="Escape"&&p()},style:{flex:1,minWidth:0,font:"inherit",fontSize:"0.875rem",padding:"5px 8px",borderRadius:7,border:"1px solid var(--graview-edge)",background:"var(--graview-panel)",color:"var(--graview-ink)"}}),(0,i.jsx)("button",{type:"submit",disabled:!K&&f.trim().length===0,style:{fontSize:"0.8125rem"},children:x.length>1?"Next":"Apply"}),A]})]})}var B=[];function Oe(n,a,p){let b=n?.derived?.act==="edit"&&n.subject?p[n.subject.arg]:void 0,y=typeof b=="string"?a.graph.getNode(b):void 0;return y?Object.fromEntries((n.writes??[]).filter(s=>y[s]!==void 0&&y[s]!==null).map(s=>[s,y[s]])):{}}function be(n,a){return typeof n=="number"?a?.type==="number"&&a.amount?pe(n,a.amount):String(n):Array.isArray(n)?n.every(p=>typeof p=="string")?n.join(", "):"":typeof n!="string"?"":n}var E=10;function Ne(n,a){return n.candidates&&n.candidates.length>0?n.candidates:a.type==="choice"?a.options:a.type==="several"&&a.of.type==="choice"?a.of.options:a.type==="boolean"?Re:[]}var Re=["yes","no"];function Ce(n,a,p){return a.type==="boolean"||a.type==="choice"||a.type==="several"&&a.of.type==="choice"?p:$e(n,p)}function $e(n,a){let p=re(a);if(p){let s=se(n.schema,n.graph.getNode(p.from)?.kind??"",p.kind,"out");return s.charAt(0).toUpperCase()+s.slice(1)}let b=oe(a);if(b.length>0)return b.map(s=>n.schema.tryDefinition(s)?.plural??`${s}s`).join(" + ");let y=n.graph.getNode(a);return y?Q(n.schema.tryDefinition(y.kind),y):a}export{He as a,$e as b};
@@ -0,0 +1 @@
1
+ import{H as $}from"./chunk.QXARGANF.js";import{F as L,b as I,c as R,d as E,e as f,f as k,k as W,n as F,pa as U,w as j}from"./chunk.DNNL7F3P.js";import{$c as s,fd as b,gd as r}from"./chunk.HBBVVALN.js";import{b as H}from"./chunk.AJZBJBMO.js";var u=H(L(),1),_=e=>typeof e=="object"&&e!==null&&"idx"in e;function S(e){let n=r(window.location.pathname,e);return n===null?null:n!==s&&n!=="/"?"pages":n===s||window.location.href.includes("#")?f(window.location.hash).overview?"graview":"scene":_(window.history.state)?"pages":null}function K(e){let n=e.face??(e.stop&&E(e.stop).overview?"graview":"scene");return e.routing!=="address"||typeof window>"u"?n:S(e.basePath)??n}function Q(e){return e.routing!=="address"||typeof window>"u"?!1:r(window.location.pathname,e.basePath)==="/"&&S(e.basePath)===null}function X(e){if(typeof window>"u")return;let n=r(window.location.pathname,e);return n===s||n==="/"&&window.location.href.includes("#")?R(f(window.location.hash)):void 0}function Z({basePath:e,pagesWere:n,shown:t,onFace:i,toggle:l,kinds:N,places:w,opens:B,landed:V}){let{view:O,go:p}=U(),g=(0,u.useRef)({shown:t,view:O,onFace:i,landed:V});g.current={shown:t,view:O,onFace:i,landed:V};let m=(0,u.useRef)(n??"/"),P=()=>{m.current=`${r(window.location.pathname,e)??"/"}${window.location.search}`};return l.current=(o,c,a)=>{let{shown:d,view:h,onFace:A}=g.current;if(o==="pages"&&d!=="pages")window.history.pushState(null,"",b(c??m.current,{basePath:e}));else if(o!=="pages"&&d==="pages"){P();let y=a===void 0?h:M(E(a),w),v=q(y)?z(B):y,T=v!==y&&v.overview?"graview":o,x=Y(T,v,N);p(x),window.history.pushState(null,"",`${b(s,{basePath:e})}${k(x)}`),A?.(T);return}A?.(o)},(0,u.useEffect)(()=>{let o=()=>{if(r(window.location.pathname,e)===null)return;let c=S(e)??"pages",{shown:a,onFace:d,landed:h}=g.current;if(c==="pages"){P(),h?.(m.current),a!=="pages"&&d?.("pages");return}a==="pages"&&(p(M(f(window.location.hash),w)),d?.(c))};return window.addEventListener("popstate",o),()=>window.removeEventListener("popstate",o)},[e,p,w]),null}function M(e,n){let t=e.within?.view,i=t!==void 0&&!e.focusId?n.find(l=>l.as===t):void 0;return i?{...e,focusId:j(i.kind)}:e}function Y(e,n,t){return e==="graview"?F(n,!0):n.overview?W(F(n,!1),$(n,t)):n}function q(e){return e.focusId===null&&e.overview!==!0}function z(e){return e??{...I,overview:!0}}export{K as a,Q as b,X as c,Z as d,M as e,Y as f,q as g,z as h};
@@ -0,0 +1,88 @@
1
+ import{a as qe,c as Be}from"./chunk.SNKOPWAD.js";import{b as Ve}from"./chunk.LVNAB2BW.js";import{a as Ie,b as Ke,c as Fe,d as j}from"./chunk.YW2BZ2LH.js";import{j as Me,k as Le}from"./chunk.HYAKRLPT.js";import"./chunk.IHBIRAC4.js";import"./chunk.CYPTJNES.js";import"./chunk.4NCXMVPY.js";import"./chunk.TN4GY6LW.js";import{e as Ee}from"./chunk.QJYALCIW.js";import"./chunk.HSRGYZOR.js";import"./chunk.BRBY5WJT.js";import{m as Pe}from"./chunk.ELY2RMGE.js";import{a as Te,b as Oe}from"./chunk.UV2TSAB4.js";import{h as $e}from"./chunk.6SK2K72G.js";import{e as Re,f as De}from"./chunk.NNNVB6RV.js";import"./chunk.HJCQ6I3S.js";import{e as ne}from"./chunk.AWRS6TUN.js";import"./chunk.KAWP4RNR.js";import{a as Se,b as Ne,j as Ae}from"./chunk.BXWO6ILK.js";import"./chunk.G4JJXA63.js";import"./chunk.UPBUF7KR.js";import"./chunk.FGYCYLUS.js";import"./chunk.NZJZIYDK.js";import"./chunk.3V2M3S4U.js";import"./chunk.EKUAI5YL.js";import{a as xe}from"./chunk.57XTDW57.js";import"./chunk.MJLUAGEV.js";import"./chunk.WNMLA4YW.js";import"./chunk.VUKHDZNI.js";import"./chunk.UT6642FC.js";import"./chunk.Q5WEOX3Q.js";import"./chunk.TX5QIZEP.js";import"./chunk.TSI4O3GH.js";import"./chunk.SZMWJHU2.js";import"./chunk.WVUJXDXZ.js";import"./chunk.YFW5BF6J.js";import{a as ye}from"./chunk.QYWBQ5NX.js";import"./chunk.ENJKCSNX.js";import"./chunk.LJE5J3JK.js";import"./chunk.X2OLXTRL.js";import"./chunk.JDRM6XXD.js";import"./chunk.GZHZLJBF.js";import{r as ke}from"./chunk.GXPBRYSR.js";import"./chunk.NV6IZJKA.js";import"./chunk.OJGHDWI6.js";import{g as be}from"./chunk.7OLVQ2FZ.js";import{d as te}from"./chunk.NOZEHLWG.js";import{c as me}from"./chunk.UVLPVHID.js";import{C as Ce,n as J}from"./chunk.QXARGANF.js";import{F as tt,Q as we,R as ve,Y as V,_ as X,ha as he,k as ge,m as ue,n as fe,oa as ee,pa as Y,s as U}from"./chunk.DNNL7F3P.js";import{H as se,N as de,T as D,Ta as Z,ba as G,ea as le,ga as pe,ia as ce}from"./chunk.HBBVVALN.js";import{b as Q}from"./chunk.AJZBJBMO.js";var f=Q(tt(),1);var nt=300,it=14,z=50,at=3,ot=2;function _e(e,n,o){let p=e.tryDefinition(n)?.fields?.shape;return(p?.[o]===void 0?void 0:ye(p[o]))?.type}var rt=(e,n)=>Object.keys(e.tryDefinition(n)?.fields?.shape??{}),st=e=>e==="date"||e==="datetime",Ge=/^(due|dueOn|dueAt|dueDate|deadline|by)$/i,dt=/^(date|on|day|when|at|start|starts|startsOn|startsAt|begins|from|sown|scheduled|scheduledFor|planned|plannedFor)$/i,lt=/^(done|finished|complete|completed|closed)$/i;function ae(e,n){let o=e.tryDefinition(n),p=rt(e,n),a=p.filter(u=>st(_e(e,n,u)));if(a.length===0)return;let i=o?.fieldRoles??{},s=u=>i[u]!==void 0&&a.includes(i[u])?i[u]:void 0,c=s("start")??s("when")??a.find(u=>Ge.test(u))??a.find(u=>dt.test(u));if(!c)return;let S=s("end")??a.find(u=>u!==c&&/^(end|ends|until|to|finish|finished|harvested|through)$/i.test(u)),g=p.find(u=>lt.test(u)&&_e(e,n,u)==="boolean");return{field:c,due:Ge.test(c),...S?{end:S}:{},...g?{done:g}:{}}}function ie(e,n){return Math.round((Date.parse(`${n.slice(0,10)}T00:00:00Z`)-Date.parse(`${e.slice(0,10)}T00:00:00Z`))/864e5)}var q=e=>typeof e=="string"&&/^\d{4}-\d{2}-\d{2}/.test(e)?e.slice(0,10):void 0;function je(e,n,o,p){let a=ne(e,n);if(a&&o.length>0&&o.length<=nt)return{shape:"board",field:a.field};let i=ae(e,n);if(i&&!i.due){let s=r=>{let y=q(r[i.field]),h=q(Z(r,i.field,p));return y&&h?ie(y,h):0},c=o.map(r=>({from:q(Z(r,i.field,p)),to:i.end&&q(r[i.end])?L(q(r[i.end]),s(r)):void 0})).filter(r=>r.from!==void 0).map(r=>({from:r.from,to:r.to&&r.to>r.from?r.to:r.from})),S=`${p.slice(0,7)}-01`,g=L(`${L(S,31).slice(0,7)}-01`,-1),u=c.filter(r=>r.from<=g&&r.to>=S),w=c.map(r=>ie(r.from,r.to)).sort((r,y)=>r-y),l=w[Math.floor(w.length/2)]??0;if(u.length>0&&l<=it){let r=L(p,-((new Date(`${p}T00:00:00Z`).getUTCDay()+6)%7)),y=L(r,6),h=u.every(m=>m.from>=r&&m.to<=y);return{shape:"calendar",start:i.field,...i.end?{end:i.end}:{},...i.done?{done:i.done}:{},range:h?"week":"month"}}}return{shape:"table"}}function ze(e,n){let o=ae(e,n);return o?{by:o.field,direction:o.due?"asc":"desc"}:void 0}function He(e,n,o={}){switch(n.shape){case"board":return{lens:"columns",kind:e,column:n.field};case"calendar":return{lens:"calendar",kind:e,start:n.start,...n.end?{end:n.end}:{},...n.done?{done:n.done}:{},range:n.range};case"table":return{lens:"blocks",kind:e,as:"row",...o.group?.by?{group:o.group.by}:{},...o.sort?{sort:{by:o.sort.by,...o.sort.direction==="desc"?{direction:"desc"}:{}}}:{}}}}var pt=60;function We(e,n,o,p){let a=e.tryDefinition(n),i=o.slice(0,pt),s=new Map;i.forEach(w=>{let l=G(a,w);te(w,a,{glance:!0,said:[l]}).forEach((r,y)=>{if(r.long||r.files||r.app)return;let h=s.get(r.key);h?h.count++:s.set(r.key,{label:r.label,count:1,at:y})})});let c=Math.max(1,Math.ceil(i.length/3)),S=[...s.entries()].filter(([,w])=>w.count>=c).sort((w,l)=>w[1].at-l[1].at).slice(0,at).map(([w,l])=>({about:"field",key:w,label:l.label})),g=new Map;for(let w of i){let l=new Set;for(let[r,y]of[["out",p.outEdges(w.id)],["in",p.inEdges(w.id)]])for(let h of y){let m=p.getNode(r==="out"?h.to:h.from);if(!m||m.id===w.id)continue;let b=`${h.kind}|${r}`;if(l.has(b))continue;l.add(b);let A=g.get(b);A?A.count++:g.set(b,{edge:h.kind,direction:r,far:m.kind,count:1})}}let u=[...g.entries()].sort((w,l)=>l[1].count-w[1].count).slice(0,ot).map(([w,l])=>{let r=me(e,l.direction==="out"?n:l.far,l.edge,l.direction);return{about:"edge",key:w,label:r.charAt(0).toUpperCase()+r.slice(1),edge:l.edge,direction:l.direction}});return[...S,...u]}function Ze(e,n,o,p){if(o.about==="field"){let s=e.tryDefinition(n.kind);return{text:te(n,s,{excerpt:!0}).find(S=>S.key===o.key)?.value??""}}let i=(o.direction==="out"?p.outEdges(n.id):p.inEdges(n.id)).filter(s=>s.kind===o.edge).map(s=>p.getNode(o.direction==="out"?s.to:s.from)).filter(s=>s!==void 0).map(s=>G(e.tryDefinition(s.kind),s));return i.length===0?{text:""}:i.length===1?{text:i[0]}:{text:`${i[0]} +${i.length-1}`,title:i.join(", ")}}function Ue(e,n,o=()=>{}){let p=new Map;for(let a of e){let i=a.nodeIds.filter(c=>n.has(c));if(i.length===0&&!(a.subjectId!==void 0&&n.has(a.subjectId)))continue;let s=p.get(a.invariant)??{invariant:a.invariant,label:o(a.invariant)||a.label||a.message,violations:[],records:new Set};s.violations.push(a);for(let c of i)s.records.add(c);a.subjectId!==void 0&&n.has(a.subjectId)&&s.records.add(a.subjectId),p.set(a.invariant,s)}return[...p.values()].sort((a,i)=>i.violations.length-a.violations.length).map(a=>({invariant:a.invariant,label:a.label,violations:a.violations,records:[...a.records]}))}var Ye=6;function Je(e,n,o,p){let a=ae(e,n);if(!a)return;let i=ne(e,n),s=g=>{if(a.done!==void 0&&g[a.done]===!0)return!0;if(!i)return!1;let u=i.values.indexOf(String(g[i.field]));return u>=0&&i.tiers[u]==="done"},c=0,S=0;for(let g of o){let u=q(Z(g,a.field,p));if(!u||s(g))continue;let w=ie(p,u);a.due&&w<0?c++:w>=0&&w<=Ye&&S++}if(!(c===0&&S===0))return{field:a.field,due:a.due,overdue:c,soon:S}}function L(e,n){return new Date(Date.parse(`${e.slice(0,10)}T00:00:00Z`)+n*864e5).toISOString().slice(0,10)}function oe(e,n,o){return n==="overdue"?[{key:e.field,value:`before:${o}`}]:[{key:e.field,value:`after:${L(o,-1)}`},{key:e.field,value:`before:${L(o,Ye+1)}`}]}function Qe(e,n,o,p){let a=new Set,i=new Set;for(let s of e)if(!(s.at<=o))for(let c of s.primitives)c.op==="add-node"&&c.node?.kind===n?a.add(c.node.id):c.op==="patch-node"&&c.id!==void 0&&p(c.id)===n&&i.add(c.id);for(let s of a)i.delete(s);return{added:[...a].filter(s=>p(s)===n).length,changed:[...i].filter(s=>p(s)===n).length}}var t=Q(we(),1),Xe="as",ct=(e,n)=>`graview:kind-seen:${e}:${n}`;function gt(e){try{return localStorage.getItem(e)}catch{return null}}function ut(e,n){try{localStorage.setItem(e,n)}catch{}}var ft=(e,n)=>({...ge(fe(e,!1),n),relation:null});function Jt({kind:e,members:n,flagged:o=[],label:p,retired:a=0}){let{store:i,brand:s,principal:c,views:S,view:g}=V(),{go:u}=Y(),w=X(),l=i.schema,r=l.tryDefinition(e),y=p??pe(l,e),h=i.today()??se(),m=n,b=(0,f.useId)(),A=(0,f.useMemo)(()=>je(l,e,m,h),[l,e,m,h]),x=g.within?.[Xe]==="table"?{shape:"table"}:A,k=Te(g),C=x.shape==="table"&&!k.sort?ze(l,e):void 0,v=C?{...k,sort:C}:k,R=(0,f.useMemo)(()=>new Set(o),[o]),T=(0,f.useMemo)(()=>$e(m,v,{schema:l,graph:i.graph,flagged:R,today:h}),[m,v,l,i,R,h,w]),I=(0,f.useMemo)(()=>De(l,Re(l,e)),[l,e]),M=S.arrangement?.()?.lists?.[e]?.filters,K=$=>u(Oe(g,$)),B=(0,f.useMemo)(()=>({name:s?.name??"app",schema:l,...i.policy?{policy:i.policy}:{}}),[s,l,i]),H=JSON.stringify(He(e,x,v)),P=(0,f.useMemo)(()=>{let $=Ae(JSON.parse(H),{app:B,sight:Ne(B,c)});return Se($)?void 0:$},[H,B,c]),W=x.shape!=="table"&&P!==void 0;return(0,t.jsxs)("section",{"aria-labelledby":b,className:"graview-kind-stop","data-testid":"kind-stop","data-graview-kind-stop":e,"data-graview-shape":x.shape,children:[(0,t.jsx)("style",{children:St}),(0,t.jsx)(wt,{kind:e,plural:y,count:m.length,headingId:b,description:r?.description}),(0,t.jsx)(ht,{kind:e,plural:y,members:m,today:h,arrangement:v,onArrange:K}),(m.length>1||a>0)&&!W?(0,t.jsx)(Pe,{schema:l,graph:i.graph,kind:e,arrangement:v,onChange:K,offers:I,...M?{filters:M}:{},kept:{shown:T.nodes.length,of:m.length},testId:"kind-arrange",chips:{nodes:m,flagged:R,today:h},...a>0?{past:{count:a,widen:()=>u(Ee(g,!0))}}:{}}):null,m.length>0?(0,t.jsx)(yt,{derived:A,shape:x,draft:P}):null,(0,t.jsx)("div",{className:"graview-kind-stop-body","data-testid":"kind-stop-body",children:m.length===0?(0,t.jsx)("p",{className:"graview-kind-stop-empty","data-testid":"kind-stop-empty",children:"Nothing here yet."}):W?(0,t.jsx)(kt,{draft:P,nodes:m}):T.nodes.length===0?(0,t.jsxs)("p",{className:"graview-kind-stop-empty","data-testid":"kind-stop-none-kept",children:["None of the ",D(m.length)," ",y.toLowerCase()," ",v.query?`says \u201C${v.query}\u201D`:"is kept by these filters","."," ",(0,t.jsx)("button",{type:"button",className:"graview-kind-stop-link",onClick:()=>K({}),children:"Show them all"})]}):(0,t.jsx)(xt,{kind:e,nodes:T.nodes,groups:T.grouped?T.groups.map($=>({key:$.key,label:$.label,nodes:$.nodes})):void 0,flagged:R,plural:y,arrangement:v})})]})}function wt({kind:e,plural:n,count:o,headingId:p,description:a}){let{store:i,setSelection:s,setMenuAt:c}=V(),S=(0,f.useMemo)(()=>({about:[U(e)]}),[e]),{affordances:g}=Me(S),{apply:u,preview:w}=Le(),l=(0,f.useMemo)(()=>{let x=k=>i.allMutations().find(C=>C.name===k.mutation)?.creates?.includes(e)??!1;return g.find(k=>!k.destructive&&!k.setsAside&&x(k))},[g,i,e]),[r,y]=(0,f.useState)(!1),[h,m]=(0,f.useState)(null),b=(0,f.useRef)(null),A=(0,f.useRef)(null);(0,f.useEffect)(()=>{let x=A.current;!x||x.closest('[data-testid="kind-stop"]')?.contains(document.activeElement)||x.focus({preventScroll:!0})},[e]);let O=(x,k)=>{try{w(x,k),u(x,k),m(null),y(!1),requestAnimationFrame(()=>b.current?.focus())}catch(C){return m(be(i.schema,i.allMutations(),C)),[]}};return(0,t.jsxs)("header",{className:"graview-kind-stop-head",children:[(0,t.jsxs)("div",{className:"graview-kind-stop-title",children:[(0,t.jsx)("h2",{id:p,ref:A,tabIndex:-1,"data-testid":"kind-stop-title",children:n}),(0,t.jsxs)("p",{"data-testid":"kind-stop-count",children:[le(i.schema,e,o),a?` \xB7 ${a}`:""]})]}),(0,t.jsxs)("div",{className:"graview-kind-stop-acts",children:[l?(0,t.jsx)("button",{ref:b,type:"button",className:"graview-kind-stop-primary","data-testid":"kind-stop-primary","data-affordance":l.id,"aria-expanded":l.open.length>0?r:void 0,onClick:()=>{m(null),l.open.length===0?O(l):y(x=>!x)},children:l.label}):null,(0,t.jsx)("button",{type:"button",className:"graview-kind-stop-quiet","data-testid":"kind-stop-acts","aria-haspopup":"menu","aria-label":`What can be done with the ${n.toLowerCase()}`,onClick:x=>{let k=x.currentTarget.getBoundingClientRect();s([U(e)]),c({x:Math.round(k.left),y:Math.round(k.bottom+4),on:U(e)})},children:"Acts\u2026"})]}),r&&l?(0,t.jsx)("div",{className:"graview-kind-stop-ask","data-testid":"kind-stop-ask","aria-label":l.label,role:"group",children:(0,t.jsx)(xe,{affordance:l,onApply:x=>O(l,x),onCancel:()=>{y(!1),b.current?.focus()}})}):null,h?(0,t.jsx)("p",{role:"alert",className:"graview-kind-stop-failed","data-testid":"kind-stop-failed",children:h}):null]})}var vt=J.part((e,n)=>(0,t.jsx)(e.ProblemRows,{...n}),{what:"The problems",as:"li"});function ht({kind:e,plural:n,members:o,today:p,arrangement:a,onArrange:i}){let{store:s,brand:c,setSelection:S}=V(),g=s.schema,u=ee(),w=(0,f.useMemo)(()=>new Set(o.map(v=>v.id)),[o]),l=(0,f.useMemo)(()=>Ue(u,w,v=>s.allInvariants().find(R=>R.name===v)?.label),[u,w,s]),r=(0,f.useMemo)(()=>Je(g,e,o,p),[g,e,o,p]),y=ct(Ce(c,g),e),[h]=(0,f.useState)(()=>gt(y));(0,f.useEffect)(()=>()=>ut(y,new Date().toISOString()),[y]);let m=X(),b=(0,f.useMemo)(()=>h?Qe(s.log.all(),e,h,v=>s.graph.getNode(v)?.kind):null,[h,s,e,m]),[A,O]=(0,f.useState)(null),x=v=>i({...a,filter:[...(a.filter??[]).filter(R=>!v?.some(T=>T.key===R.key)),...v??[]]}),k=l.reduce((v,R)=>v+R.violations.length,0),C=[];if(r&&(r.overdue>0||r.soon>0)){let v=r.field;C.push((0,t.jsxs)("li",{"data-testid":"kind-stop-dates",children:[r.overdue>0?(0,t.jsxs)("button",{type:"button",className:"graview-kind-stop-fact","data-tone":"warn",onClick:()=>x(oe(r,"overdue",p)),"aria-label":`${D(r.overdue)} overdue \u2014 show only these`,children:[D(r.overdue)," overdue"]}):null,r.soon>0?(0,t.jsxs)("button",{type:"button",className:"graview-kind-stop-fact",onClick:()=>x(oe(r,"soon",p)),"aria-label":`${D(r.soon)} in the next 7 days \u2014 show only these`,children:[D(r.soon)," ",r.due?"due":""," in the next 7 days"]}):null,(0,t.jsxs)("span",{className:"graview-kind-stop-quiet-text",children:[" by ",ce(g.tryDefinition(e),v).toLowerCase()]})]},"dates"))}if(l.length>0&&C.push((0,t.jsxs)("li",{"data-testid":"kind-stop-problems","data-graview-problems":k,children:[(0,t.jsxs)("span",{className:"graview-kind-stop-warn",children:[(0,t.jsx)("span",{"aria-hidden":"true",children:"\u26A0 "}),k===1?"1 problem":`${D(k)} problems`]}),(0,t.jsxs)("span",{className:"graview-kind-stop-quiet-text",children:[" in ",n.toLowerCase(),":"]}),(0,t.jsx)("ul",{className:"graview-kind-stop-rules",children:l.map(v=>(0,t.jsx)(mt,{group:v,open:A===v.invariant,onToggle:()=>O(R=>R===v.invariant?null:v.invariant),onPick:R=>S([R])},v.invariant))}),(0,t.jsxs)("button",{type:"button",className:"graview-kind-stop-link","data-testid":"kind-stop-only-problems",onClick:()=>x([{key:"is",value:"flagged"}]),children:["Show only the ",n.toLowerCase()," with a problem"]})]},"problems")),b&&(b.added>0||b.changed>0)){let v=[b.added>0?`${D(b.added)} added`:"",b.changed>0?`${D(b.changed)} changed`:""].filter(Boolean);C.push((0,t.jsxs)("li",{"data-testid":"kind-stop-since",children:[(0,t.jsxs)("span",{className:"graview-kind-stop-quiet-text",children:["Since you last looked (",de(h.slice(0,10)),"):"]})," ",v.join(", ")]},"since"))}return C.length===0?null:(0,t.jsx)("ul",{className:"graview-kind-stop-going-on","aria-label":`What is going on in the ${n.toLowerCase()}`,"data-testid":"kind-stop-going-on",children:C})}function mt({group:e,open:n,onToggle:o,onPick:p}){let a=(0,f.useId)();return(0,t.jsxs)("li",{"data-graview-rule":e.invariant,children:[(0,t.jsxs)("button",{type:"button",className:"graview-kind-stop-rule","aria-expanded":n,"aria-controls":a,onClick:o,onPointerEnter:J.prefetch,onFocus:J.prefetch,children:[(0,t.jsx)("span",{"aria-hidden":"true",className:"graview-kind-stop-chevron","data-open":n||void 0,children:"\u203A"}),e.label," ",(0,t.jsxs)("span",{className:"graview-kind-stop-quiet-text",children:["\xB7 ",D(e.violations.length)]})]}),n?(0,t.jsx)("ol",{id:a,className:"graview-kind-stop-problem-rows","data-testid":"kind-stop-problem-rows",children:(0,t.jsx)(f.Suspense,{fallback:null,children:(0,t.jsx)(vt,{violations:e.violations,pick:i=>{let s=i.subjectId??e.records[0]??i.nodeIds[0];s!==void 0&&p(s)}})})}):null]})}var bt={board:"Board",calendar:"Calendar",table:"Table"};function yt({derived:e,shape:n,draft:o}){let{view:p}=V(),{go:a}=Y(),{keep:i}=qe(Be()),[s,c]=(0,f.useState)(!1),S=e.shape==="table"?[]:[e.shape,"table"];return(0,t.jsxs)("div",{className:"graview-kind-stop-shape","data-testid":"kind-stop-shape",children:[S.length>0?(0,t.jsx)("span",{role:"group","aria-label":"Show as",className:"graview-kind-stop-switch",children:S.map(g=>(0,t.jsx)("button",{type:"button","aria-pressed":n.shape===g,"data-testid":`kind-stop-as-${g}`,onClick:()=>a(ue(p,Xe,g===e.shape?null:g)),children:bt[g]},g))}):null,(0,t.jsx)("span",{className:"graview-kind-stop-quiet-text","data-testid":"kind-stop-derived",children:o?`${o.said.replace(/\.$/,"")}, derived from the declaration`:"Derived from the declaration"}),o?(0,t.jsx)("button",{type:"button",className:"graview-kind-stop-link","data-testid":"kind-stop-keep",disabled:s,title:`Keep \u201C${o.title}\u201D as a lens: a place of its own`,onClick:()=>{c(!0),i(o).finally(()=>c(!1))},children:"Keep as a lens"}):null]})}function kt({draft:e,nodes:n}){let o=Ve(e.drawn);return(0,t.jsx)("div",{className:"graview-kind-stop-lens","data-graview-draft":e.lens.name,children:(0,t.jsx)(ve,{mode:"scene",children:(0,t.jsx)(ke,{kind:e.kind,view:e.title,children:(0,t.jsx)(o,{nodes:n,label:e.title,fidelity:"full",cardinality:"many",mode:"fullscreen",selected:!1})})})})}function xt({kind:e,nodes:n,groups:o,flagged:p,plural:a,arrangement:i}){let{store:s,views:c,view:S,selection:g,setSelection:u,setMenuAt:w,principal:l}=V(),{go:r}=Y(),y=s.schema,h=s.graph,m=(0,f.useMemo)(()=>(o?o.flatMap(d=>d.nodes):n).map(d=>d.id),[n,o]),b=Ie(m),A=(0,f.useMemo)(()=>s.permittedMutations(l).some(d=>{let N=d.subject?.kinds;return N!==void 0&&(N==="*"||N.includes(e))}),[s,l,e]),O=(0,f.useRef)(null),x=d=>{b.choose(d),requestAnimationFrame(()=>{let N=b.list.current;((d[0]===void 0?null:N?.querySelector(`[data-graview-choose-box="${CSS.escape(d[0])}"]`))??N)?.focus({preventScroll:!0})})},k=b.chosen.length,C=c.lookup(e,{cardinality:"one",fidelity:"glyph"}),v=C!==void 0&&!he(C)?C:void 0,R=d=>g.includes(d),T=ee(),I=(0,f.useMemo)(()=>We(y,e,n,h),[y,e,n,h]),[M,K]=(0,f.useState)(z);(0,f.useEffect)(()=>K(z),[i.query,i.filter?.length,i.sort?.by,i.group?.by]);let B=y.tryDefinition(e),H=d=>T.filter(N=>N.nodeIds.includes(d)||N.subjectId===d).map(N=>N.message),P=i.sort?.by,W=`${a}${i.sort?`, in order of ${I.find(d=>d.key===P)?.label.toLowerCase()??P}`:""}`,$=M,et=d=>{let N=G(B,d),F=p.has(d.id)?H(d.id):[];return(0,t.jsxs)("tr",{"data-graview-pick":d.id,tabIndex:-1,"data-graview-record":d.id,"data-flagged":F.length>0||void 0,...A?{"data-graview-choose":d.id}:{},children:[A?(0,t.jsx)("td",{className:"graview-choose-at",children:(0,t.jsx)("input",{...b.boxProps(d.id,N),onPointerEnter:j,onFocus:j})}):null,(0,t.jsxs)("th",{scope:"row",className:"graview-kind-stop-name",children:[v?(0,t.jsx)("div",{"data-graview-pick":d.id,className:"graview-kind-stop-own-row",children:(0,t.jsx)(v,{node:d,cardinality:"one",fidelity:"glyph",mode:"scene",selected:R(d.id),...F.length>0?{flagged:[d.id]}:{}})}):(0,t.jsx)("button",{type:"button","data-testid":"kind-stop-row-go",title:`Go to ${N}`,onClick:()=>r(ft(S,d.id)),children:N}),F.length>0?(0,t.jsxs)("span",{className:"graview-kind-stop-flag",title:F.join(" \xB7 "),children:[(0,t.jsx)("span",{"aria-hidden":"true",children:"\u26A0"}),(0,t.jsx)("span",{className:"graview-kind-stop-hidden",children:`Problem: ${F.join(". ")}`})]}):null]}),I.map(_=>{let E=Ze(y,d,_,h);return(0,t.jsx)("td",{"data-label":_.label,"data-short":E.text.length>0&&E.text.length<=14||void 0,"data-empty":E.text?void 0:"",...E.title?{title:E.title}:{},children:E.text?(0,t.jsx)("span",{children:E.text}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("b",{"aria-hidden":"true",children:"\u2014"}),(0,t.jsx)("i",{className:"graview-kind-stop-hidden",children:"none"})]})},_.key)}),(0,t.jsx)("td",{className:"graview-kind-stop-row-acts",children:(0,t.jsx)("button",{type:"button","data-testid":"kind-stop-row-acts","aria-haspopup":"menu","aria-label":`What can be done with ${N}`,onClick:_=>{let E=_.currentTarget.getBoundingClientRect();u([d.id]),w({x:Math.round(E.left),y:Math.round(E.bottom+4),on:d.id})},children:(0,t.jsx)("span",{"aria-hidden":"true",children:"\u22EF"})})})]},d.id)},re=d=>{let N=d.slice(0,Math.max(0,$));return $-=N.length,N.map(et)};return(0,t.jsxs)("div",{className:"graview-kind-stop-table-at",...A?{...b.listProps,ref:d=>{O.current=d,b.list.current=d},tabIndex:-1,role:"group","aria-label":k>0?`${a}, ${k} chosen`:a,"data-graview-choosable":""}:{},children:[A?(0,t.jsx)("style",{children:Ke}):null,(0,t.jsxs)("table",{className:"graview-kind-stop-table","data-testid":"kind-stop-table",children:[(0,t.jsx)("caption",{className:"graview-kind-stop-hidden",children:W}),(0,t.jsx)("thead",{children:(0,t.jsxs)("tr",{children:[A?(0,t.jsx)("td",{className:"graview-choose-at graview-choose-all",children:(0,t.jsx)("input",{type:"checkbox",className:"graview-choose-box","data-testid":"kind-stop-choose-all","aria-label":`Choose all ${D(n.length)} ${a.toLowerCase()}`,checked:k>0&&k===n.length,ref:d=>{d&&(d.indeterminate=k>0&&k<n.length)},onPointerEnter:j,onFocus:j,onChange:()=>k===n.length?b.clear():b.choose(m)})}):null,(0,t.jsx)("th",{scope:"col","aria-sort":P==="label"?i.sort?.direction==="desc"?"descending":"ascending":void 0,children:"Name"}),I.map(d=>(0,t.jsx)("th",{scope:"col","aria-sort":d.about==="field"&&d.key===P?i.sort?.direction==="desc"?"descending":"ascending":void 0,children:d.label},d.key)),(0,t.jsx)("th",{scope:"col",children:(0,t.jsx)("span",{className:"graview-kind-stop-hidden",children:"Acts"})})]})}),o?o.map(d=>$<=0?null:(0,t.jsxs)("tbody",{"data-graview-group":d.key,children:[(0,t.jsx)("tr",{className:"graview-kind-stop-group",children:(0,t.jsxs)("th",{scope:"rowgroup",colSpan:I.length+(A?3:2),children:[d.label," ",(0,t.jsxs)("span",{className:"graview-kind-stop-quiet-text",children:["\xB7 ",D(d.nodes.length)]})]})}),re(d.nodes)]},d.key||"-")):(0,t.jsx)("tbody",{children:re(n)})]}),A?(0,t.jsx)(Fe,{store:s,chosen:b.chosen,principal:l,anchor:()=>O.current?.closest('[data-testid="kind-stop"]')??null,of:m.length,onChooseAll:()=>b.choose(m),onClear:b.clear,onActed:x}):null,n.length>M?(0,t.jsxs)("p",{className:"graview-kind-stop-more",children:[(0,t.jsxs)("span",{className:"graview-kind-stop-quiet-text","data-testid":"kind-stop-shown",children:[D(M)," of ",D(n.length)," shown"]})," ",(0,t.jsxs)("button",{type:"button",className:"graview-kind-stop-link","data-testid":"kind-stop-more",onClick:()=>K(d=>d+z),children:["Show ",D(Math.min(z,n.length-M))," more"]})]}):null]})}var St=`
2
+ .graview-kind-stop{container-type:inline-size;box-sizing:border-box;height:100%;min-height:0;display:flex;flex-direction:column;gap:10px;padding:16px 18px 12px;border:1px solid var(--graview-edge);border-radius:var(--graview-radius,12px);background:var(--graview-panel);color:var(--graview-ink);box-shadow:var(--graview-lift-low);overflow:auto;overscroll-behavior:contain}
3
+ [data-graview-map-panel] .graview-kind-stop{height:auto;padding:4px 6px 12px;border:0;box-shadow:none;background:none;overflow:visible}
4
+ .graview-kind-stop :focus-visible{outline:2px solid var(--graview-accent);outline-offset:2px}
5
+ .graview-kind-stop button{font:inherit;cursor:pointer}
6
+ .graview-kind-stop :is(.graview-kind-stop-link,.graview-kind-stop-rule,.graview-kind-stop-name button,.graview-kind-stop-row-acts button,.graview-kind-stop-fact,.graview-kind-stop-switch button){box-shadow:none}
7
+ .graview-kind-stop-head{display:flex;flex-wrap:wrap;align-items:flex-start;gap:8px 16px}
8
+ .graview-kind-stop-title{flex:1 1 16rem;min-width:0}
9
+ .graview-kind-stop-title h2{margin:0;outline-offset:2px;font-size:var(--graview-text-heading);line-height:1.3;overflow-wrap:anywhere}
10
+ .graview-kind-stop-title p{margin:2px 0 0;font-size:.875rem;color:var(--graview-ink-muted);overflow-wrap:anywhere}
11
+ .graview-kind-stop-acts{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
12
+ .graview-kind-stop-primary,.graview-kind-stop-quiet{min-height:32px;padding:0 14px;border-radius:8px;font-size:.875rem}
13
+ .graview-kind-stop-primary{border:1px solid var(--graview-accent);background:var(--graview-accent);color:var(--graview-accent-ink);font-weight:600}
14
+ .graview-kind-stop-quiet{border:1px solid var(--graview-edge);background:transparent;color:var(--graview-ink)}
15
+ .graview-kind-stop-ask{flex:1 1 100%;min-width:0;padding:10px 12px;border:1px solid var(--graview-edge);border-radius:10px}
16
+ .graview-kind-stop-failed{flex:1 1 100%;margin:0;font-size:var(--graview-text-small);color:var(--graview-warn)}
17
+ .graview-kind-stop-hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}
18
+ .graview-kind-stop-going-on{list-style:none;margin:0;padding:0;display:grid;gap:6px;font-size:.875rem}
19
+ .graview-kind-stop-going-on>li{display:flex;flex-wrap:wrap;align-items:center;gap:4px 8px;min-width:0}
20
+ .graview-kind-stop-fact{min-height:28px;padding:0 10px;border:1px solid var(--graview-edge);border-radius:999px;background:transparent;color:var(--graview-ink)}
21
+ .graview-kind-stop-fact[data-tone=warn],.graview-kind-stop-warn{color:var(--graview-warn);font-weight:600}
22
+ .graview-kind-stop-quiet-text{color:var(--graview-ink-muted)}
23
+ .graview-kind-stop-rules{list-style:none;margin:0;padding:0;flex:1 1 100%;display:grid;gap:2px}
24
+ .graview-kind-stop-rule{display:inline-flex;align-items:center;gap:6px;min-height:28px;max-width:100%;padding:0 6px;border:1px solid transparent;border-radius:7px;background:none;color:var(--graview-ink);text-align:left;overflow-wrap:anywhere}
25
+ .graview-kind-stop-rule:hover{border-color:var(--graview-edge)}
26
+ .graview-kind-stop-chevron{display:inline-block;width:.8em}
27
+ .graview-kind-stop-chevron[data-open]{transform:rotate(90deg)}
28
+ .graview-kind-stop-problem-rows{list-style:none;margin:2px 0 6px 18px;padding:0;max-width:44rem}
29
+ .graview-kind-stop-link{min-height:28px;padding:0 4px;border:0;background:none;color:var(--graview-accent);text-decoration:underline;text-underline-offset:2px}
30
+ .graview-kind-stop-link:disabled{opacity:.6;cursor:default}
31
+ .graview-kind-stop-shape{display:flex;flex-wrap:wrap;align-items:center;gap:4px 10px;font-size:var(--graview-text-small)}
32
+ .graview-kind-stop-switch{display:inline-flex;border:1px solid var(--graview-edge);border-radius:8px;overflow:hidden}
33
+ .graview-kind-stop-switch button{min-height:28px;padding:0 12px;border:0;background:transparent;color:var(--graview-ink-muted)}
34
+ .graview-kind-stop-switch button+button{border-left:1px solid var(--graview-edge)}
35
+ .graview-kind-stop-switch button[aria-pressed=true]{background:color-mix(in srgb,var(--graview-accent) 16%,transparent);color:var(--graview-ink);font-weight:600}
36
+ .graview-kind-stop-body{flex:1 0 auto;min-width:0}
37
+ .graview-kind-stop-empty{margin:24px 0;color:var(--graview-ink-muted)}
38
+ .graview-kind-stop-lens{min-width:0}
39
+
40
+ .graview-kind-stop-table-at{min-width:0}
41
+ .graview-kind-stop-table{width:100%;border-collapse:collapse;font-size:.875rem}
42
+ .graview-kind-stop-table th,.graview-kind-stop-table td{padding:7px 8px;text-align:left;vertical-align:top;border-top:1px solid var(--graview-edge);overflow-wrap:break-word}
43
+ .graview-kind-stop-table td{color:var(--graview-ink)}
44
+ .graview-kind-stop-table td>span{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
45
+ .graview-kind-stop-table td[data-short]{white-space:nowrap;font-variant-numeric:tabular-nums}
46
+ .graview-kind-stop-table thead th{border-top:0;font-size:var(--graview-text-small);font-weight:600;letter-spacing:.04em;color:var(--graview-ink-muted)}
47
+ .graview-kind-stop-name{font-weight:500;min-width:8rem;max-width:22rem}
48
+ .graview-kind-stop-name button{display:inline-block;min-width:24px;min-height:24px;padding:0;border:0;background:none;color:var(--graview-ink);font-weight:500;text-align:left;text-decoration:underline;text-decoration-color:var(--graview-edge);text-underline-offset:3px}
49
+ .graview-kind-stop-name button:hover{text-decoration-color:currentColor}
50
+ .graview-kind-stop-own-row{display:inline-block;max-width:100%;cursor:pointer}
51
+ .graview-kind-stop-flag{margin-left:6px;color:var(--graview-warn)}
52
+ .graview-kind-stop-group th{padding-top:12px;font-weight:600;color:var(--graview-ink)}
53
+ .graview-kind-stop-row-acts{width:1%;white-space:nowrap;text-align:right}
54
+ .graview-kind-stop-row-acts button{min-width:32px;min-height:28px;border:1px solid var(--graview-edge-bright,var(--graview-edge));border-radius:7px;background:none;color:var(--graview-ink);font-size:1.125rem;font-weight:700;line-height:1}
55
+ .graview-kind-stop-row-acts button:hover{background:color-mix(in srgb,var(--graview-ink) 8%,transparent)}
56
+ .graview-kind-stop-table td[data-empty] b{font-weight:400;color:var(--graview-ink-faint)}
57
+ .graview-kind-stop-table tr[data-graview-pick]{cursor:default}
58
+ .graview-kind-stop-more{margin:10px 0 0;font-size:.875rem}
59
+ .graview-kind-stop-table-at[data-graview-choosable]{outline:none}
60
+ [data-graview-choosable]:hover .graview-choose-all .graview-choose-box{opacity:1}
61
+ .graview-kind-stop-table .graview-choose-at{width:1%;padding-right:0;vertical-align:middle}
62
+ @container (max-width: 559px){
63
+ .graview-kind-stop{padding:12px}
64
+ .graview-kind-stop-acts{flex:1 1 100%}
65
+ .graview-kind-stop-primary{flex:1 1 auto}
66
+ .graview-kind-stop-table thead{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
67
+ .graview-kind-stop-table,.graview-kind-stop-table tbody,.graview-kind-stop-table tr{display:block}
68
+ .graview-kind-stop-table tr{position:relative;padding:8px 40px 8px 0;border-top:1px solid var(--graview-edge)}
69
+ .graview-kind-stop-table th,.graview-kind-stop-table td{display:block;padding:1px 0;border:0}
70
+ .graview-kind-stop-table td>span{display:inline}
71
+ .graview-kind-stop-table td[data-short]{white-space:normal}
72
+ .graview-kind-stop-table td[data-label]::before{content:attr(data-label) " \xB7 ";color:var(--graview-ink-muted)}
73
+ .graview-kind-stop-row-acts{position:absolute;top:6px;right:0;width:auto}
74
+ .graview-kind-stop-table [data-graview-choose]{padding-left:34px}
75
+ .graview-kind-stop-table td.graview-choose-at{position:absolute;left:0;top:8px;width:auto;padding:0}
76
+ .graview-kind-stop-table thead .graview-choose-at{position:static}
77
+ }
78
+ @media (pointer: coarse){
79
+ .graview-kind-stop-table-at:not([data-graview-choosing]) .graview-choose-at{display:none}
80
+ .graview-kind-stop-table-at:not([data-graview-choosing]) [data-graview-choose]{padding-left:0}
81
+ }
82
+ @media (pointer: coarse){
83
+ .graview-kind-stop-primary,.graview-kind-stop-quiet,.graview-kind-stop-fact,.graview-kind-stop-rule,.graview-kind-stop-link,.graview-kind-stop-switch button,.graview-kind-stop-row-acts button{min-height:44px}
84
+ .graview-kind-stop-row-acts button{min-width:44px}
85
+ .graview-kind-stop-name button{min-height:44px}
86
+ }
87
+ @media (prefers-reduced-motion: reduce){.graview-kind-stop *{transition:none!important;animation:none!important}}
88
+ `;export{Jt as KindStop};
@@ -0,0 +1 @@
1
+ import{d as $}from"./chunk.IHBIRAC4.js";import{a as C}from"./chunk.NZJZIYDK.js";import{g as M}from"./chunk.7OLVQ2FZ.js";import{ba as k,ca as v,ea as j,sb as x}from"./chunk.HBBVVALN.js";function N(a,s){let c=a.tryDefinition(s),r=Object.keys(c?.fields?.shape??{}),m=[c?.lifecycle?.field,...r.filter(l=>/^(status|stage|state|phase)$/i.test(l))].filter(l=>l!==void 0&&r.includes(l));return[...new Set(m)].slice(0,1)}function P(a,s){return a.tryDefinition(s)?.fieldRoles?.title??"label"}function V(a,s,c={}){let r=s.map(e=>a.graph.getNode(e)).filter(e=>e!==void 0);if(r.length===0)return{acts:[],withheld:[]};let u=c.principal??{kind:"human"},m=C(a,r.map(e=>e.id),{...c.derive,principal:u,...c.context?{context:c.context}:{}}),l=new Map(a.allMutations().map(e=>[e.name,e])),g=[...new Set(r.map(e=>e.kind))],p=new Set(g.map(e=>P(a.schema,e))),h=new Set(m.affordances.filter(e=>e.provider==="schema").map(e=>e.mutation)),o=e=>{let n=l.get(e.mutation);if(!n?.subject)return;let t=r.length===1&&e.provider==="invariant"&&!h.has(e.mutation)&&e.args[n.subject.arg]===r[0].id;if(!(e.provider!=="schema"&&!t)&&!(r.length>1&&e.batch?.length!==r.length)&&n.derived?.act!=="edit"&&!e.open.some(i=>p.has(i.name)))return n},y=[],b=new Set;for(let e of m.affordances){let n=o(e);if(!n||b.has(n.name))continue;b.add(n.name);let{[n.subject.arg]:t,...i}=e.args;y.push({id:e.id,label:v(n),mutation:n.name,subject:n.subject.arg,args:i,open:e.open,...e.destructive||e.setsAside?{more:!0}:{},...e.destructive?{destructive:!0}:{},affordance:{...e,label:v(n)}})}if(g.length===1){let e=g[0];for(let n of N(a.schema,e))for(let t of $(a.schema,[...l.values()],e,n)){if(t.by==="none"||r.every(d=>d[n]===t.value))continue;let i=r.find(d=>d[n]!==t.value),f=t.acts.find(d=>{let D=t.by==="step"?{[d.subject.arg]:i.id}:{[d.subject.arg]:i.id,[n]:t.value};return a.permits({name:d.name,args:D},u).ok});if(!f)continue;let w=t.by==="step"?{}:{[n]:t.value};if(t.by==="step"&&y.some(d=>d.mutation===f.name))continue;let R=t.by==="step"?v(f):`Move to ${t.label}`,O=`set:${n}:${t.value}`;y.push({id:O,label:R,mutation:f.name,subject:f.subject.arg,args:w,open:[],affordance:{id:O,label:R,provider:"schema",mutation:f.name,args:{[f.subject.arg]:i.id,...w},open:[],score:0,why:`every one is ${e}`,nodeIds:r.map(d=>d.id)}})}}let S=[...y.filter(e=>!e.more),...y.filter(e=>e.more)],A=m.withheld.filter(e=>{let n=l.get(e.mutation);return n?.subject!==void 0&&n.derived?.act!=="edit"&&(r.length===1||e.batch?.length===r.length)}).map(e=>({label:v(l.get(e.mutation)),message:e.refusal.message}));return{acts:S,withheld:A}}function _(a,s,c,r={}){let u=r.author,m=a.allMutations().find(e=>e.name===s.mutation),l=e=>M(a.schema,a.allMutations(),e),g=e=>{let n=a.graph.getNode(e);return n?k(a.schema.tryDefinition(n.kind),n):e},p=[],h=[],o=[];for(let e of[...new Set(c)]){let n={name:s.mutation,args:{...s.args,[s.subject]:e}};if(!m){p.push({id:e,label:g(e),message:`There is no act \u201C${s.mutation}\u201D.`,reason:"invalid"});continue}let t=a.permits(n,u);if(!t.ok){p.push({id:e,label:g(e),message:t.refusal.message,reason:"forbidden"});continue}if(!a.wouldChange(n,u)){h.push(e);continue}o.push({id:e,call:n})}let y=e=>a.previewAll(e,{...u?{author:u}:{},...r.context?{context:r.context}:{}});for(let e=0;o.length>0;e+=1)try{y(o.map(n=>n.call));break}catch(n){let t=[];for(let i of o)try{y([i.call]),t.push(i)}catch(f){p.push({id:i.id,label:g(i.id),message:l(f),reason:x(f).reason})}if(t.length===o.length||e>o.length){for(let i of t)p.push({id:i.id,label:g(i.id),message:l(n),reason:x(n).reason});o=[];break}o=t}if(o.length===0)return{applied:[],unchanged:h,refused:p};let b=s.label??(m?v(m):s.mutation),S=[...new Set(o.map(e=>a.graph.getNode(e.id)?.kind))],A=`${b} \u2014 ${S.length===1&&S[0]?j(a.schema,S[0],o.length):`${o.length} records`}`;try{let e=a.applyAll(o.map(n=>n.call),{intent:A,...u?{author:u}:{},...r.via?{via:r.via}:{}});return{batch:e.batch,intent:A,applied:o.map(n=>n.id),unchanged:h,refused:p,result:e}}catch(e){let n=l(e),t=x(e).reason;return{applied:[],unchanged:h,refused:[...p,...o.map(i=>({id:i.id,label:g(i.id),message:n,reason:t}))],allOrNothing:!0}}}export{V as a,_ as b};
@@ -1 +1 @@
1
- var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{s as P}from"./chunk.PWOVXARZ.js";import{F as M,N as w,Q as y,Y as m,Z as I,a as p,t as b,x as T,xa as S,y as A}from"./chunk.6II4BONS.js";import{b as f}from"./chunk.AJZBJBMO.js";var x=f(M(),1),h=f(y(),1),C=S(p(()=>(__graviewPreload(import.meta.url,["./chunk.BZ5VLPKB.js","./chunk.6II4BONS.js","./chunk.F5BCCGFK.js","./chunk.AJZBJBMO.js"]),import("./chunk.NWYOLGQ3.js")))),O=C.part((e,n)=>(0,h.jsx)(e.Timeline,{...n}),{what:"The timeline"}),q=()=>C.prefetch();function H({face:e}){return w()?.open?(0,h.jsx)(x.Suspense,{fallback:null,children:(0,h.jsx)(O,{face:e})}):null}var i=f(M(),1),u=f(y(),1),v=new WeakMap,E=e=>{let n=v.get(e);return n||v.set(e,n={ask:null,doors:[],listeners:new Set}),n},k=e=>{for(let n of e.listeners)n()};function g(e,n){let t=E(e);t.ask=n,k(t)}var N=S(p(()=>(__graviewPreload(import.meta.url,["./chunk.NJ62C2GU.js","./chunk.FUR4IHWG.js","./chunk.2B4WVCVV.js","./chunk.AAZFVCSP.js","./chunk.BZ5VLPKB.js","./chunk.6II4BONS.js","./chunk.F5BCCGFK.js","./chunk.AJZBJBMO.js"]),import("./chunk.LMVCWYYG.js")))),B=N.part((e,n)=>{let t=e.NotifySheet;return(0,u.jsx)(t,{...n})},{what:"Notify me"}),W=N.part((e,n)=>{let t=e.NotifiedList;return(0,u.jsx)(t,{...n})},{quiet:!0}),D=(e,n)=>n===void 0&&(e.onBehalfOf??e).id!==void 0;function L(e,n,t){let c=d=>t.tryDefinition(d)?.noun??d.replace(/[-_]+/g," "),o=e.on!==void 0?e.on:e.about.length===1?e.about[0]:void 0;if(e.act!==void 0){let d=o!==void 0&&n(o)!==void 0?o:void 0;return{label:"Notify me when someone does this\u2026",choices:[{on:"act",act:e.act,...d!==void 0?{record:d}:{}},...d!==void 0?[{on:"act",act:e.act}]:[]]}}if(o===void 0)return null;let s=n(o);if(s!==void 0)return{label:"Notify me when this changes\u2026",choices:[{on:"changed",record:o},{on:"act",record:o},{on:"reaches",kind:s,condition:"",record:o}]};let r=b(o)!==null?[b(o)]:T(o)?A(o):[];if(r.length!==1||!t.kinds.includes(r[0]))return null;let l=r[0],a=c(l);return{label:`Notify me when ${/^[aeiou]/i.test(a)?"an":"a"} ${a} is added\u2026`,choices:[{on:"created",kind:l},{on:"changed",kind:l},{on:"reaches",kind:l,condition:""}]}}function F(){let{store:e,principal:n,subscriptions:t,signIn:c}=m(),o=D(n,c);return(0,i.useMemo)(()=>o?s=>{let r=L(s,a=>e.graph.getNode(a)?.kind,e.schema);return r?{id:"notify",items:[{id:"notify-me",label:r.label,run:()=>g(t,{choices:r.choices,returnTo:s.element??null})}],prepare:()=>N.prefetch()}:null}:null,[o,e,t])}var z=[];function U({children:e}){let n=F(),t=(0,i.useMemo)(()=>n?[n]:z,[n]);return(0,u.jsx)(P,{sections:t,children:e})}function V(){let{subscriptions:e}=m(),n=(0,i.useId)(),t=E(e);(0,i.useEffect)(()=>(t.doors.push(n),k(t),()=>{t.doors.splice(t.doors.indexOf(n),1),k(t)}),[t,n]);let c=(0,i.useMemo)(()=>r=>(t.listeners.add(r),()=>void t.listeners.delete(r)),[t]),o=(0,i.useSyncExternalStore)(c,()=>t.ask,()=>null),s=(0,i.useSyncExternalStore)(c,()=>t.doors[0]===n,()=>!1);return!o||!s?null:(0,u.jsx)(i.Suspense,{fallback:null,children:(0,u.jsx)(B,{ask:o,close:()=>g(e,null)})})}function X({choices:e,label:n="Notify me",style:t,className:c,testId:o="notify-me"}){let{principal:s,subscriptions:r,signIn:l}=m();return D(s,l)?(0,u.jsx)("button",{type:"button","data-testid":o,className:c,onClick:a=>g(r,{choices:e,returnTo:a.currentTarget}),style:t,children:n}):null}function G(){let e=I(),n=e?.subscriptions,t=e?(e.principal.onBehalfOf??e.principal).id:void 0,[c,o]=(0,i.useState)(0);return(0,i.useEffect)(()=>{if(t===void 0||!n)return;let s=!0,r=()=>void Promise.resolve(n.list(t)).then(a=>s&&o(a.length),()=>s&&o(0));r();let l=n.onChange?.(r);return()=>{s=!1,l?.()}},[n,t]),c}function Y({style:e}){return G()===0?null:(0,u.jsx)(i.Suspense,{fallback:null,children:(0,u.jsx)(W,{...e?{style:e}:{}})})}export{q as a,H as b,F as c,U as d,V as e,X as f,G as g,Y as h};
1
+ var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{s as P}from"./chunk.GXPBRYSR.js";import{F as M,N as w,Q as y,Y as m,Z as I,a as p,t as b,x as T,xa as S,y as A}from"./chunk.DNNL7F3P.js";import{b as f}from"./chunk.AJZBJBMO.js";var C=f(M(),1),h=f(y(),1),x=S(p(()=>(__graviewPreload(import.meta.url,["./chunk.QXARGANF.js","./chunk.DNNL7F3P.js","./chunk.HBBVVALN.js","./chunk.AJZBJBMO.js"]),import("./chunk.HCK4Y6C5.js")))),O=x.part((e,n)=>(0,h.jsx)(e.Timeline,{...n}),{what:"The timeline"}),q=()=>x.prefetch();function K({face:e}){return w()?.open?(0,h.jsx)(C.Suspense,{fallback:null,children:(0,h.jsx)(O,{face:e})}):null}var i=f(M(),1),u=f(y(),1),v=new WeakMap,D=e=>{let n=v.get(e);return n||v.set(e,n={ask:null,doors:[],listeners:new Set}),n},k=e=>{for(let n of e.listeners)n()};function g(e,n){let t=D(e);t.ask=n,k(t)}var N=S(p(()=>(__graviewPreload(import.meta.url,["./chunk.CV4CBHFT.js","./chunk.LJE5J3JK.js","./chunk.X2OLXTRL.js","./chunk.JDRM6XXD.js","./chunk.QXARGANF.js","./chunk.DNNL7F3P.js","./chunk.HBBVVALN.js","./chunk.AJZBJBMO.js"]),import("./chunk.QOXTBRKE.js")))),B=N.part((e,n)=>{let t=e.NotifySheet;return(0,u.jsx)(t,{...n})},{what:"Notify me"}),W=N.part((e,n)=>{let t=e.NotifiedList;return(0,u.jsx)(t,{...n})},{quiet:!0}),E=(e,n)=>n===void 0&&(e.onBehalfOf??e).id!==void 0;function F(e,n,t){let c=d=>t.tryDefinition(d)?.noun??d.replace(/[-_]+/g," "),o=e.on!==void 0?e.on:e.about.length===1?e.about[0]:void 0;if(e.act!==void 0){let d=o!==void 0&&n(o)!==void 0?o:void 0;return{label:"Notify me when someone does this\u2026",choices:[{on:"act",act:e.act,...d!==void 0?{record:d}:{}},...d!==void 0?[{on:"act",act:e.act}]:[]]}}if(o===void 0)return null;let s=n(o);if(s!==void 0)return{label:"Notify me when this changes\u2026",choices:[{on:"changed",record:o},{on:"act",record:o},{on:"reaches",kind:s,condition:"",record:o}]};let r=b(o)!==null?[b(o)]:T(o)?A(o):[];if(r.length!==1||!t.kinds.includes(r[0]))return null;let l=r[0],a=c(l);return{label:`Notify me when ${/^[aeiou]/i.test(a)?"an":"a"} ${a} is added\u2026`,choices:[{on:"created",kind:l},{on:"changed",kind:l},{on:"reaches",kind:l,condition:""}]}}function L(){let{store:e,principal:n,subscriptions:t,signIn:c}=m(),o=E(n,c);return(0,i.useMemo)(()=>o?s=>{let r=F(s,a=>e.graph.getNode(a)?.kind,e.schema);return r?{id:"notify",items:[{id:"notify-me",label:r.label,run:()=>g(t,{choices:r.choices,returnTo:s.element??null})}],prepare:()=>N.prefetch()}:null}:null,[o,e,t])}var z=[];function U({children:e}){let n=L(),t=(0,i.useMemo)(()=>n?[n]:z,[n]);return(0,u.jsx)(P,{sections:t,children:e})}function V(){let{subscriptions:e}=m(),n=(0,i.useId)(),t=D(e);(0,i.useEffect)(()=>(t.doors.push(n),k(t),()=>{t.doors.splice(t.doors.indexOf(n),1),k(t)}),[t,n]);let c=(0,i.useMemo)(()=>r=>(t.listeners.add(r),()=>void t.listeners.delete(r)),[t]),o=(0,i.useSyncExternalStore)(c,()=>t.ask,()=>null),s=(0,i.useSyncExternalStore)(c,()=>t.doors[0]===n,()=>!1);return!o||!s?null:(0,u.jsx)(i.Suspense,{fallback:null,children:(0,u.jsx)(B,{ask:o,close:()=>g(e,null)})})}function X({choices:e,label:n="Notify me",style:t,className:c,testId:o="notify-me"}){let{principal:s,subscriptions:r,signIn:l}=m();return E(s,l)?(0,u.jsx)("button",{type:"button","data-testid":o,className:c,onClick:a=>g(r,{choices:e,returnTo:a.currentTarget}),style:t,children:n}):null}function G(){let e=I(),n=e?.subscriptions,t=e?(e.principal.onBehalfOf??e.principal).id:void 0,[c,o]=(0,i.useState)(0);return(0,i.useEffect)(()=>{if(t===void 0||!n)return;let s=!0,r=()=>void Promise.resolve(n.list(t)).then(a=>s&&o(a.length),()=>s&&o(0));r();let l=n.onChange?.(r);return()=>{s=!1,l?.()}},[n,t]),c}function Y({style:e}){return G()===0?null:(0,u.jsx)(i.Suspense,{fallback:null,children:(0,u.jsx)(W,{...e?{style:e}:{}})})}export{q as a,K as b,L as c,U as d,V as e,X as f,G as g,Y as h};
@@ -1,4 +1,4 @@
1
- import{a as xt,d as Pt,e as re}from"./chunk.YNE5QR7Q.js";import{k as Et}from"./chunk.GOCUBIRW.js";import{g as pt}from"./chunk.ZVMIHXVK.js";import{a as ft}from"./chunk.CUCNT7MG.js";import{d as mt}from"./chunk.4B73P2WA.js";import{d as ht}from"./chunk.IMRCAU4T.js";import{F as St,G as bt,i as dt,j as Lr,o as yt,p as gt,s as vt,t as Rt,u as wt}from"./chunk.BZ5VLPKB.js";import{F as O,N as ut,Q as Z,Z as ct}from"./chunk.6II4BONS.js";import{Cc as at,Dc as nt,Ec as ot,Ma as et,Sc as it,Tc as lt,Uc as st,Wb as tt,Z as be,aa as le,fc as rt}from"./chunk.F5BCCGFK.js";import{b as D}from"./chunk.AJZBJBMO.js";function Dr(e,t){return at(e,t).slice(1)}function Ee(e,t){return e.kinds.find(r=>Dr(e,r)===t)}function Rn(e,t,r){return nt(e,t,r)}function wn(e,t){return ot(e,t)}var A=D(O(),1),g=D(O(),1),E=D(O(),1),ze=D(O(),1),lr=D(O(),1),b=D(O(),1),Xa=D(O(),1),Qa=D(O(),1),Za=D(O(),1),v=D(O(),1),Rr=D(O(),1);var Te=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,Ot=/^[\\/]{2}/;function Fr(e,t){return t+e.replace(/\\/g,"/")}var Ct="popstate";function fe(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function At(e={}){let{initialEntries:t=["/"],initialIndex:r,v5Compat:a=!1}=e,n;n=t.map((f,y)=>c(f,typeof f=="string"?null:f.state,y===0?"default":void 0,typeof f=="string"?void 0:f.mask));let o=s(r??n.length-1),i="POP",l=null;function s(f){return Math.min(Math.max(f,0),n.length-1)}function u(){return n[o]}function c(f,y=null,m,h){let S=he(n?u().pathname:"/",f,y,m,h);return T(S.pathname.charAt(0)==="/",`relative pathnames are not supported in memory history: ${JSON.stringify(f)}`),S}function d(f){return typeof f=="string"?f:z(f)}return{get index(){return o},get action(){return i},get location(){return u()},createHref:d,createURL(f){return new URL(d(f),"http://localhost")},encodeLocation(f){let y=typeof f=="string"?V(f):f;return{pathname:y.pathname||"",search:y.search||"",hash:y.hash||""}},push(f,y){i="PUSH";let m=fe(f)?f:c(f,y);o+=1,n.splice(o,n.length,m),a&&l&&l({action:i,location:m,delta:1})},replace(f,y){i="REPLACE";let m=fe(f)?f:c(f,y);n[o]=m,a&&l&&l({action:i,location:m,delta:0})},go(f){i="POP";let y=s(o+f),m=n[y];o=y,l&&l({action:i,location:m,delta:f})},listen(f){return l=f,()=>{l=null}}}}function _t(e={}){function t(a,n){let o=n.state?.masked,{pathname:i,search:l,hash:s}=o||a.location;return he("",{pathname:i,search:l,hash:s},n.state&&n.state.usr||null,n.state&&n.state.key||"default",o?{pathname:a.location.pathname,search:a.location.search,hash:a.location.hash}:void 0)}function r(a,n){return typeof n=="string"?n:z(n)}return Tr(t,r,null,e)}function P(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function T(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function kr(){return Math.random().toString(36).substring(2,10)}function Lt(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function he(e,t,r=null,a,n){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?V(t):t,state:r,key:t&&t.key||a||kr(),mask:n}}function z({pathname:e="/",search:t="",hash:r=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function V(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substring(r),e=e.substring(0,r));let a=e.indexOf("?");a>=0&&(t.search=e.substring(a),e=e.substring(0,a)),e&&(t.pathname=e)}return t}function Tr(e,t,r,a={}){let{window:n=document.defaultView,v5Compat:o=!1}=a,i=n.history,l="POP",s=null,u=c();u==null&&(u=0,i.replaceState({...i.state,idx:u},""));function c(){return(i.state||{idx:null}).idx}function d(){l="POP";let h=c(),S=h==null?null:h-u;u=h,s&&s({action:l,location:m.location,delta:S})}function p(h,S){l="PUSH";let R=fe(h)?h:he(m.location,h,S);r&&r(R,h),u=c()+1;let w=Lt(R,u),L=m.createHref(R.mask||R);try{i.pushState(w,"",L)}catch(x){if(x instanceof DOMException&&x.name==="DataCloneError")throw x;n.location.assign(L)}o&&s&&s({action:l,location:m.location,delta:1})}function f(h,S){l="REPLACE";let R=fe(h)?h:he(m.location,h,S);r&&r(R,h),u=c();let w=Lt(R,u),L=m.createHref(R.mask||R);i.replaceState(w,"",L),o&&s&&s({action:l,location:m.location,delta:0})}function y(h){return Nr(n,h)}let m={get action(){return l},get location(){return e(n,i)},listen(h){if(s)throw new Error("A history only accepts one active listener");return n.addEventListener(Ct,d),s=h,()=>{n.removeEventListener(Ct,d),s=null}},createHref(h){return t(n,h)},createURL:y,encodeLocation(h){let S=y(h);return{pathname:S.pathname,search:S.search,hash:S.hash}},push:p,replace:f,go(h){return i.go(h)}};return m}function Nr(e,t,r=!1){let a="http://localhost";e&&(a=e.location.origin!=="null"?e.location.origin:e.location.href),P(a,"No window.location.(origin|href) available to create URL");let n=typeof t=="string"?t:z(t);return n=n.replace(/ $/,"%20"),!r&&Ot.test(n)&&(n=a+n),new URL(n,a)}var Mr;Mr=new WeakMap;function Ne(e,t,r="/"){return Or(e,t,r,!1)}function Or(e,t,r,a,n){let o=typeof t=="string"?V(t):t,i=U(o.pathname||"/",r);if(i==null)return null;let l=n??_r(e),s=null,u=Jr(i);for(let c=0;s==null&&c<l.length;++c)s=Vr(l[c],u,a);return s}function Ar(e,t){let{route:r,pathname:a,params:n}=e;return{id:r.id,pathname:a,params:n,data:t[r.id],loaderData:t[r.id],handle:r.handle}}function _r(e){let t=$t(e);return $r(t),t}function $t(e,t=[],r=[],a="",n=!1){let o=(i,l,s=n,u)=>{let c={relativePath:u===void 0?i.path||"":u,caseSensitive:i.caseSensitive===!0,childrenIndex:l,route:i};if(c.relativePath.startsWith("/")){if(!c.relativePath.startsWith(a)&&s)return;P(c.relativePath.startsWith(a),`Absolute route path "${c.relativePath}" nested under path "${a}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(a.length)}let d=I([a,c.relativePath]),p=r.concat(c);i.children&&i.children.length>0&&(P(i.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${d}".`),$t(i.children,t,p,d,s)),!(i.path==null&&!i.index)&&t.push({path:d,score:Wr(d,i.index),routesMeta:p.map((f,y)=>{let[m,h]=Ut(f.relativePath,f.caseSensitive,y===p.length-1);return{...f,matcher:m,compiledParams:h}})})};return e.forEach((i,l)=>{if(i.path===""||!i.path?.includes("?"))o(i,l);else for(let s of It(i.path))o(i,l,!0,s)}),t}function It(e){let t=e.split("/");if(t.length===0)return[];let[r,...a]=t,n=r.endsWith("?"),o=r.replace(/\?$/,"");if(a.length===0)return n?[o,""]:[o];let i=It(a.join("/")),l=[];return l.push(...i.map(s=>s===""?o:[o,s].join("/"))),n&&l.push(...i),l.map(s=>e.startsWith("/")&&s===""?"/":s)}function $r(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:Yr(t.routesMeta.map(a=>a.childrenIndex),r.routesMeta.map(a=>a.childrenIndex)))}var Ir=/^:[\w-]+$/,Hr=3,Ur=2,jr=1,zr=10,Br=-2,Dt=e=>e==="*";function Wr(e,t){let r=e.split("/"),a=r.length;return r.some(Dt)&&(a+=Br),t&&(a+=Ur),r.filter(n=>!Dt(n)).reduce((n,o)=>n+(Ir.test(o)?Hr:o===""?jr:zr),a)}function Yr(e,t){return e.length===t.length&&e.slice(0,-1).every((a,n)=>a===t[n])?e[e.length-1]-t[t.length-1]:0}function Vr(e,t,r=!1){let{routesMeta:a}=e,n={},o="/",i=[];for(let l=0;l<a.length;++l){let s=a[l],u=l===a.length-1,c=o==="/"?t:t.slice(o.length)||"/",d={path:s.relativePath,caseSensitive:s.caseSensitive,end:u},p=s.matcher&&s.compiledParams?Ht(d,c,s.matcher,s.compiledParams):ne(d,c),f=s.route;if(!p&&u&&r&&!a[a.length-1].route.index&&(p=ne({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},c)),!p)return null;Object.assign(n,p.params),i.push({params:n,pathname:I([o,p.pathname]),pathnameBase:Gr(I([o,p.pathnameBase])),route:f}),p.pathnameBase!=="/"&&(o=I([o,p.pathnameBase]))}return i}function ne(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,a]=Ut(e.path,e.caseSensitive,e.end);return Ht(e,t,r,a)}function Ht(e,t,r,a){let n=t.match(r);if(!n)return null;let o=n[0],i=q(o,1),l=n.slice(1);return{params:a.reduce((u,{paramName:c,isOptional:d},p)=>{if(c==="*"){let y=l[p]||"";i=q(o.slice(0,o.length-y.length),1)}let f=l[p];return d&&!f?u[c]=void 0:u[c]=(f||"").replace(/%2F/g,"/"),u},{}),pathname:o,pathnameBase:i,pattern:e}}function Ut(e,t=!1,r=!0){T(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let a=[],n="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(i,l,s,u,c)=>{if(a.push({paramName:l,isOptional:s!=null}),s){let d=c.charAt(u+i.length);return d&&d!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(a.push({paramName:"*"}),n+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?n+="\\/*$":e!==""&&e!=="/"&&(n+="(?:(?=\\/|$))"),[new RegExp(n,t?void 0:"i"),a]}function Jr(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return T(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function U(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,a=e.charAt(r);return a&&a!=="/"?null:e.slice(r)||"/"}function jt(e,t="/"){let{pathname:r,search:a="",hash:n=""}=typeof e=="string"?V(e):e,o;return r?(r=zt(r),r.startsWith("/")||r.startsWith("\\")?o=Ft(r.substring(1),"/"):o=Ft(r,t)):o=t,{pathname:o,search:Xr(a),hash:Qr(n)}}function Ft(e,t){let r=q(t).split("/");return e.split("/").forEach(n=>{n===".."?r.length>1&&r.pop():n!=="."&&r.push(n)}),r.length>1?r.join("/"):"/"}function xe(e,t,r,a){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(a)}]. Please separate it out to the \`to.${r}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Kr(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function Me(e){let t=Kr(e);return t.map((r,a)=>a===t.length-1?r.pathname:r.pathnameBase)}function ye(e,t,r,a=!1){let n;typeof e=="string"?n=V(e):(n={...e},P(!n.pathname||!n.pathname.includes("?"),xe("?","pathname","search",n)),P(!n.pathname||!n.pathname.includes("#"),xe("#","pathname","hash",n)),P(!n.search||!n.search.includes("#"),xe("#","search","hash",n)));let o=e===""||n.pathname==="",i=o?"/":n.pathname,l;if(i==null)l=r;else{let d=t.length-1;if(!a&&i.startsWith("..")){let p=i.split("/");for(;p[0]==="..";)p.shift(),d-=1;n.pathname=p.join("/")}l=d>=0?t[d]:"/"}let s=jt(n,l),u=i&&i!=="/"&&i.endsWith("/"),c=(o||i===".")&&r.endsWith("/");return!s.pathname.endsWith("/")&&(u||c)&&(s.pathname+="/"),s}var zt=e=>e.replace(/[\\/]{2,}/g,"/"),I=e=>zt(e.join("/"));function q(e,t=0){let r=e.length;for(;r>t&&e.charCodeAt(r-1)===47;)r--;return r===e.length?e:e.slice(0,r)}var Gr=e=>q(e).replace(/^\/*/,"/"),Xr=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Qr=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;var Bt=class{constructor(e,t,r,a=!1){this.status=e,this.statusText=t||"",this.internal=a,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}};function Wt(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function Zr(e){let t=e.map(r=>r.route.path).filter(Boolean);return I(t)||"/"}var Yt=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Vt(e,t){let r=e;if(typeof r!="string"||!Te.test(r))return{absoluteURL:void 0,isExternal:!1,to:r};let a=r,n=!1;if(Yt)try{let o=new URL(window.location.href),i=Ot.test(r)?new URL(Fr(r,o.protocol)):new URL(r),l=U(i.pathname,t);i.origin===o.origin&&l!=null?r=l+i.search+i.hash:n=!0}catch{T(!1,`<Link to="${r}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:a,isExternal:n,to:r}}var bn=Symbol("Uninstrumented");var En=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var kt=new URL("http://localhost");function Oe(e){if(e.createURL)return e.createURL("/");try{return new URL(e.createHref("/"),kt)}catch{return kt}}function Pe(e,t){return e.origin===t.origin&&(e.origin!=="null"||e.protocol===t.protocol&&e.host===t.host)}function qr(e,t){if(e.startsWith("//"))return!0;let r=t.protocol.toLowerCase();return e.toLowerCase().startsWith(r)?t.host===""||e.slice(r.length).startsWith("//"):!1}function Ae(e,t,r,a){let n=null;try{n=e==null?null:new URL(e,r)}catch{}let o=new URL(t,r),i=n!=null&&!Pe(n,r),l=!Pe(o,r);if(a==="reject"){if(i||l)throw new Error("External navigation is not allowed")}else if(l&&(n==null||!qr(e,n)||!Pe(n,o)))throw new Error("External navigation is not allowed")}var Jt=["POST","PUT","PATCH","DELETE"],xn=new Set(Jt),ea=["GET",...Jt],Pn=new Set(ea);var Cn=Symbol("ResetLoaderData"),ta,ra,aa,na;ta=new WeakMap;ra=new WeakMap;aa=new WeakMap;na=new WeakMap;var oa=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function ia(e){try{return oa.includes(new URL(e).protocol)}catch{return!1}}var K=A.createContext(null);K.displayName="DataRouter";var ee=A.createContext(null);ee.displayName="DataRouterState";var Kt=A.createContext(!1);function la(){return A.useContext(Kt)}var _e=A.createContext({isTransitioning:!1});_e.displayName="ViewTransition";var Gt=A.createContext(new Map);Gt.displayName="Fetchers";var sa=A.createContext(null);sa.displayName="Await";var k=A.createContext(null);k.displayName="Navigation";var G=A.createContext(null);G.displayName="Location";var $=A.createContext({outlet:null,matches:[],isDataRoute:!1});$.displayName="Route";var $e=A.createContext(null);$e.displayName="RouteError";var De=!0,Xt="REACT_ROUTER_ERROR",ua="REDIRECT",ca="ROUTE_ERROR_RESPONSE";function da(e){if(e.startsWith(`${Xt}:${ua}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function fa(e){if(e.startsWith(`${Xt}:${ca}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new Bt(t.status,t.statusText,t.data)}catch{}}function ge(e,{relative:t}={}){P(X(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:a}=g.useContext(k),{hash:n,pathname:o,search:i}=te(e,{relative:t}),l=o;return r!=="/"&&(l=o==="/"?r:I([r,o])),a.createHref({pathname:l,search:i,hash:n})}function X(){return g.useContext(G)!=null}function F(){return P(X(),"useLocation() may be used only in the context of a <Router> component."),g.useContext(G).location}function ha(){return g.useContext(G).navigationType}var Qt="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Zt(e){g.useContext(k).static||g.useLayoutEffect(e)}function Q(){let{isDataRoute:e}=g.useContext($);return e?xa():ma()}function ma(){P(X(),"useNavigate() may be used only in the context of a <Router> component.");let e=g.useContext(K),{basename:t,navigator:r}=g.useContext(k),{matches:a}=g.useContext($),{pathname:n}=F(),o=JSON.stringify(Me(a)),i=g.useRef(!1);return Zt(()=>{i.current=!0}),g.useCallback((s,u={})=>{if(T(i.current,Qt),!i.current)return;if(typeof s=="number"){r.go(s);return}let c=ye(s,JSON.parse(o),n,u.relative==="path");e==null&&t!=="/"&&(c.pathname=c.pathname==="/"?t:I([t,c.pathname])),Ae(typeof s=="string"?s:z(s),r.createHref(c),Oe(r),"reject"),(u.replace?r.replace:r.push)(c,u.state,u)},[t,r,o,n,e])}var Ln=g.createContext(null);function pa(){let{matches:e}=g.useContext($);return e[e.length-1]?.params??{}}function te(e,{relative:t}={}){let{matches:r}=g.useContext($),{pathname:a}=F(),n=JSON.stringify(Me(r));return g.useMemo(()=>ye(e,JSON.parse(n),a,t==="path"),[e,n,a,t])}function qt(e,t){return er(e,t)}function er(e,t,r){P(X(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:a}=g.useContext(k),{matches:n}=g.useContext($),o=n[n.length-1],i=o?o.params:{},l=o?o.pathname:"/",s=o?o.pathnameBase:"/",u=o&&o.route;if(De){let h=u&&u.path||"";nr(l,!u||h.endsWith("*")||h.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${l}" (under <Route path="${h}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
1
+ import{a as xt,d as Pt,e as re}from"./chunk.3IVVXVG7.js";import{k as Et}from"./chunk.WNKRXL3O.js";import{g as pt}from"./chunk.67PVRVAC.js";import{a as ft}from"./chunk.MJLUAGEV.js";import{d as mt}from"./chunk.NOZEHLWG.js";import{d as ht}from"./chunk.UVLPVHID.js";import{F as St,G as bt,i as dt,j as Lr,o as yt,p as gt,s as vt,t as Rt,u as wt}from"./chunk.QXARGANF.js";import{F as O,N as ut,Q as Z,Z as ct}from"./chunk.DNNL7F3P.js";import{Mc as at,Nc as nt,Oc as ot,Ua as et,ad as it,bd as lt,cd as st,da as be,ec as tt,ga as le,pc as rt}from"./chunk.HBBVVALN.js";import{b as D}from"./chunk.AJZBJBMO.js";function Dr(e,t){return at(e,t).slice(1)}function Ee(e,t){return e.kinds.find(r=>Dr(e,r)===t)}function Rn(e,t,r){return nt(e,t,r)}function wn(e,t){return ot(e,t)}var A=D(O(),1),g=D(O(),1),E=D(O(),1),ze=D(O(),1),lr=D(O(),1),b=D(O(),1),Xa=D(O(),1),Qa=D(O(),1),Za=D(O(),1),v=D(O(),1),Rr=D(O(),1);var Te=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,Ot=/^[\\/]{2}/;function Fr(e,t){return t+e.replace(/\\/g,"/")}var Ct="popstate";function fe(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function At(e={}){let{initialEntries:t=["/"],initialIndex:r,v5Compat:a=!1}=e,n;n=t.map((f,y)=>c(f,typeof f=="string"?null:f.state,y===0?"default":void 0,typeof f=="string"?void 0:f.mask));let o=s(r??n.length-1),i="POP",l=null;function s(f){return Math.min(Math.max(f,0),n.length-1)}function u(){return n[o]}function c(f,y=null,m,h){let S=he(n?u().pathname:"/",f,y,m,h);return T(S.pathname.charAt(0)==="/",`relative pathnames are not supported in memory history: ${JSON.stringify(f)}`),S}function d(f){return typeof f=="string"?f:z(f)}return{get index(){return o},get action(){return i},get location(){return u()},createHref:d,createURL(f){return new URL(d(f),"http://localhost")},encodeLocation(f){let y=typeof f=="string"?V(f):f;return{pathname:y.pathname||"",search:y.search||"",hash:y.hash||""}},push(f,y){i="PUSH";let m=fe(f)?f:c(f,y);o+=1,n.splice(o,n.length,m),a&&l&&l({action:i,location:m,delta:1})},replace(f,y){i="REPLACE";let m=fe(f)?f:c(f,y);n[o]=m,a&&l&&l({action:i,location:m,delta:0})},go(f){i="POP";let y=s(o+f),m=n[y];o=y,l&&l({action:i,location:m,delta:f})},listen(f){return l=f,()=>{l=null}}}}function _t(e={}){function t(a,n){let o=n.state?.masked,{pathname:i,search:l,hash:s}=o||a.location;return he("",{pathname:i,search:l,hash:s},n.state&&n.state.usr||null,n.state&&n.state.key||"default",o?{pathname:a.location.pathname,search:a.location.search,hash:a.location.hash}:void 0)}function r(a,n){return typeof n=="string"?n:z(n)}return Tr(t,r,null,e)}function P(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function T(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function kr(){return Math.random().toString(36).substring(2,10)}function Lt(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function he(e,t,r=null,a,n){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?V(t):t,state:r,key:t&&t.key||a||kr(),mask:n}}function z({pathname:e="/",search:t="",hash:r=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function V(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substring(r),e=e.substring(0,r));let a=e.indexOf("?");a>=0&&(t.search=e.substring(a),e=e.substring(0,a)),e&&(t.pathname=e)}return t}function Tr(e,t,r,a={}){let{window:n=document.defaultView,v5Compat:o=!1}=a,i=n.history,l="POP",s=null,u=c();u==null&&(u=0,i.replaceState({...i.state,idx:u},""));function c(){return(i.state||{idx:null}).idx}function d(){l="POP";let h=c(),S=h==null?null:h-u;u=h,s&&s({action:l,location:m.location,delta:S})}function p(h,S){l="PUSH";let R=fe(h)?h:he(m.location,h,S);r&&r(R,h),u=c()+1;let w=Lt(R,u),L=m.createHref(R.mask||R);try{i.pushState(w,"",L)}catch(x){if(x instanceof DOMException&&x.name==="DataCloneError")throw x;n.location.assign(L)}o&&s&&s({action:l,location:m.location,delta:1})}function f(h,S){l="REPLACE";let R=fe(h)?h:he(m.location,h,S);r&&r(R,h),u=c();let w=Lt(R,u),L=m.createHref(R.mask||R);i.replaceState(w,"",L),o&&s&&s({action:l,location:m.location,delta:0})}function y(h){return Nr(n,h)}let m={get action(){return l},get location(){return e(n,i)},listen(h){if(s)throw new Error("A history only accepts one active listener");return n.addEventListener(Ct,d),s=h,()=>{n.removeEventListener(Ct,d),s=null}},createHref(h){return t(n,h)},createURL:y,encodeLocation(h){let S=y(h);return{pathname:S.pathname,search:S.search,hash:S.hash}},push:p,replace:f,go(h){return i.go(h)}};return m}function Nr(e,t,r=!1){let a="http://localhost";e&&(a=e.location.origin!=="null"?e.location.origin:e.location.href),P(a,"No window.location.(origin|href) available to create URL");let n=typeof t=="string"?t:z(t);return n=n.replace(/ $/,"%20"),!r&&Ot.test(n)&&(n=a+n),new URL(n,a)}var Mr;Mr=new WeakMap;function Ne(e,t,r="/"){return Or(e,t,r,!1)}function Or(e,t,r,a,n){let o=typeof t=="string"?V(t):t,i=U(o.pathname||"/",r);if(i==null)return null;let l=n??_r(e),s=null,u=Jr(i);for(let c=0;s==null&&c<l.length;++c)s=Vr(l[c],u,a);return s}function Ar(e,t){let{route:r,pathname:a,params:n}=e;return{id:r.id,pathname:a,params:n,data:t[r.id],loaderData:t[r.id],handle:r.handle}}function _r(e){let t=$t(e);return $r(t),t}function $t(e,t=[],r=[],a="",n=!1){let o=(i,l,s=n,u)=>{let c={relativePath:u===void 0?i.path||"":u,caseSensitive:i.caseSensitive===!0,childrenIndex:l,route:i};if(c.relativePath.startsWith("/")){if(!c.relativePath.startsWith(a)&&s)return;P(c.relativePath.startsWith(a),`Absolute route path "${c.relativePath}" nested under path "${a}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(a.length)}let d=I([a,c.relativePath]),p=r.concat(c);i.children&&i.children.length>0&&(P(i.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${d}".`),$t(i.children,t,p,d,s)),!(i.path==null&&!i.index)&&t.push({path:d,score:Wr(d,i.index),routesMeta:p.map((f,y)=>{let[m,h]=Ut(f.relativePath,f.caseSensitive,y===p.length-1);return{...f,matcher:m,compiledParams:h}})})};return e.forEach((i,l)=>{if(i.path===""||!i.path?.includes("?"))o(i,l);else for(let s of It(i.path))o(i,l,!0,s)}),t}function It(e){let t=e.split("/");if(t.length===0)return[];let[r,...a]=t,n=r.endsWith("?"),o=r.replace(/\?$/,"");if(a.length===0)return n?[o,""]:[o];let i=It(a.join("/")),l=[];return l.push(...i.map(s=>s===""?o:[o,s].join("/"))),n&&l.push(...i),l.map(s=>e.startsWith("/")&&s===""?"/":s)}function $r(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:Yr(t.routesMeta.map(a=>a.childrenIndex),r.routesMeta.map(a=>a.childrenIndex)))}var Ir=/^:[\w-]+$/,Hr=3,Ur=2,jr=1,zr=10,Br=-2,Dt=e=>e==="*";function Wr(e,t){let r=e.split("/"),a=r.length;return r.some(Dt)&&(a+=Br),t&&(a+=Ur),r.filter(n=>!Dt(n)).reduce((n,o)=>n+(Ir.test(o)?Hr:o===""?jr:zr),a)}function Yr(e,t){return e.length===t.length&&e.slice(0,-1).every((a,n)=>a===t[n])?e[e.length-1]-t[t.length-1]:0}function Vr(e,t,r=!1){let{routesMeta:a}=e,n={},o="/",i=[];for(let l=0;l<a.length;++l){let s=a[l],u=l===a.length-1,c=o==="/"?t:t.slice(o.length)||"/",d={path:s.relativePath,caseSensitive:s.caseSensitive,end:u},p=s.matcher&&s.compiledParams?Ht(d,c,s.matcher,s.compiledParams):ne(d,c),f=s.route;if(!p&&u&&r&&!a[a.length-1].route.index&&(p=ne({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},c)),!p)return null;Object.assign(n,p.params),i.push({params:n,pathname:I([o,p.pathname]),pathnameBase:Gr(I([o,p.pathnameBase])),route:f}),p.pathnameBase!=="/"&&(o=I([o,p.pathnameBase]))}return i}function ne(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,a]=Ut(e.path,e.caseSensitive,e.end);return Ht(e,t,r,a)}function Ht(e,t,r,a){let n=t.match(r);if(!n)return null;let o=n[0],i=q(o,1),l=n.slice(1);return{params:a.reduce((u,{paramName:c,isOptional:d},p)=>{if(c==="*"){let y=l[p]||"";i=q(o.slice(0,o.length-y.length),1)}let f=l[p];return d&&!f?u[c]=void 0:u[c]=(f||"").replace(/%2F/g,"/"),u},{}),pathname:o,pathnameBase:i,pattern:e}}function Ut(e,t=!1,r=!0){T(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let a=[],n="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(i,l,s,u,c)=>{if(a.push({paramName:l,isOptional:s!=null}),s){let d=c.charAt(u+i.length);return d&&d!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(a.push({paramName:"*"}),n+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?n+="\\/*$":e!==""&&e!=="/"&&(n+="(?:(?=\\/|$))"),[new RegExp(n,t?void 0:"i"),a]}function Jr(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return T(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function U(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,a=e.charAt(r);return a&&a!=="/"?null:e.slice(r)||"/"}function jt(e,t="/"){let{pathname:r,search:a="",hash:n=""}=typeof e=="string"?V(e):e,o;return r?(r=zt(r),r.startsWith("/")||r.startsWith("\\")?o=Ft(r.substring(1),"/"):o=Ft(r,t)):o=t,{pathname:o,search:Xr(a),hash:Qr(n)}}function Ft(e,t){let r=q(t).split("/");return e.split("/").forEach(n=>{n===".."?r.length>1&&r.pop():n!=="."&&r.push(n)}),r.length>1?r.join("/"):"/"}function xe(e,t,r,a){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(a)}]. Please separate it out to the \`to.${r}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Kr(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function Me(e){let t=Kr(e);return t.map((r,a)=>a===t.length-1?r.pathname:r.pathnameBase)}function ye(e,t,r,a=!1){let n;typeof e=="string"?n=V(e):(n={...e},P(!n.pathname||!n.pathname.includes("?"),xe("?","pathname","search",n)),P(!n.pathname||!n.pathname.includes("#"),xe("#","pathname","hash",n)),P(!n.search||!n.search.includes("#"),xe("#","search","hash",n)));let o=e===""||n.pathname==="",i=o?"/":n.pathname,l;if(i==null)l=r;else{let d=t.length-1;if(!a&&i.startsWith("..")){let p=i.split("/");for(;p[0]==="..";)p.shift(),d-=1;n.pathname=p.join("/")}l=d>=0?t[d]:"/"}let s=jt(n,l),u=i&&i!=="/"&&i.endsWith("/"),c=(o||i===".")&&r.endsWith("/");return!s.pathname.endsWith("/")&&(u||c)&&(s.pathname+="/"),s}var zt=e=>e.replace(/[\\/]{2,}/g,"/"),I=e=>zt(e.join("/"));function q(e,t=0){let r=e.length;for(;r>t&&e.charCodeAt(r-1)===47;)r--;return r===e.length?e:e.slice(0,r)}var Gr=e=>q(e).replace(/^\/*/,"/"),Xr=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Qr=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;var Bt=class{constructor(e,t,r,a=!1){this.status=e,this.statusText=t||"",this.internal=a,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}};function Wt(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function Zr(e){let t=e.map(r=>r.route.path).filter(Boolean);return I(t)||"/"}var Yt=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Vt(e,t){let r=e;if(typeof r!="string"||!Te.test(r))return{absoluteURL:void 0,isExternal:!1,to:r};let a=r,n=!1;if(Yt)try{let o=new URL(window.location.href),i=Ot.test(r)?new URL(Fr(r,o.protocol)):new URL(r),l=U(i.pathname,t);i.origin===o.origin&&l!=null?r=l+i.search+i.hash:n=!0}catch{T(!1,`<Link to="${r}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:a,isExternal:n,to:r}}var bn=Symbol("Uninstrumented");var En=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var kt=new URL("http://localhost");function Oe(e){if(e.createURL)return e.createURL("/");try{return new URL(e.createHref("/"),kt)}catch{return kt}}function Pe(e,t){return e.origin===t.origin&&(e.origin!=="null"||e.protocol===t.protocol&&e.host===t.host)}function qr(e,t){if(e.startsWith("//"))return!0;let r=t.protocol.toLowerCase();return e.toLowerCase().startsWith(r)?t.host===""||e.slice(r.length).startsWith("//"):!1}function Ae(e,t,r,a){let n=null;try{n=e==null?null:new URL(e,r)}catch{}let o=new URL(t,r),i=n!=null&&!Pe(n,r),l=!Pe(o,r);if(a==="reject"){if(i||l)throw new Error("External navigation is not allowed")}else if(l&&(n==null||!qr(e,n)||!Pe(n,o)))throw new Error("External navigation is not allowed")}var Jt=["POST","PUT","PATCH","DELETE"],xn=new Set(Jt),ea=["GET",...Jt],Pn=new Set(ea);var Cn=Symbol("ResetLoaderData"),ta,ra,aa,na;ta=new WeakMap;ra=new WeakMap;aa=new WeakMap;na=new WeakMap;var oa=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function ia(e){try{return oa.includes(new URL(e).protocol)}catch{return!1}}var K=A.createContext(null);K.displayName="DataRouter";var ee=A.createContext(null);ee.displayName="DataRouterState";var Kt=A.createContext(!1);function la(){return A.useContext(Kt)}var _e=A.createContext({isTransitioning:!1});_e.displayName="ViewTransition";var Gt=A.createContext(new Map);Gt.displayName="Fetchers";var sa=A.createContext(null);sa.displayName="Await";var k=A.createContext(null);k.displayName="Navigation";var G=A.createContext(null);G.displayName="Location";var $=A.createContext({outlet:null,matches:[],isDataRoute:!1});$.displayName="Route";var $e=A.createContext(null);$e.displayName="RouteError";var De=!0,Xt="REACT_ROUTER_ERROR",ua="REDIRECT",ca="ROUTE_ERROR_RESPONSE";function da(e){if(e.startsWith(`${Xt}:${ua}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function fa(e){if(e.startsWith(`${Xt}:${ca}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new Bt(t.status,t.statusText,t.data)}catch{}}function ge(e,{relative:t}={}){P(X(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:a}=g.useContext(k),{hash:n,pathname:o,search:i}=te(e,{relative:t}),l=o;return r!=="/"&&(l=o==="/"?r:I([r,o])),a.createHref({pathname:l,search:i,hash:n})}function X(){return g.useContext(G)!=null}function F(){return P(X(),"useLocation() may be used only in the context of a <Router> component."),g.useContext(G).location}function ha(){return g.useContext(G).navigationType}var Qt="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Zt(e){g.useContext(k).static||g.useLayoutEffect(e)}function Q(){let{isDataRoute:e}=g.useContext($);return e?xa():ma()}function ma(){P(X(),"useNavigate() may be used only in the context of a <Router> component.");let e=g.useContext(K),{basename:t,navigator:r}=g.useContext(k),{matches:a}=g.useContext($),{pathname:n}=F(),o=JSON.stringify(Me(a)),i=g.useRef(!1);return Zt(()=>{i.current=!0}),g.useCallback((s,u={})=>{if(T(i.current,Qt),!i.current)return;if(typeof s=="number"){r.go(s);return}let c=ye(s,JSON.parse(o),n,u.relative==="path");e==null&&t!=="/"&&(c.pathname=c.pathname==="/"?t:I([t,c.pathname])),Ae(typeof s=="string"?s:z(s),r.createHref(c),Oe(r),"reject"),(u.replace?r.replace:r.push)(c,u.state,u)},[t,r,o,n,e])}var Ln=g.createContext(null);function pa(){let{matches:e}=g.useContext($);return e[e.length-1]?.params??{}}function te(e,{relative:t}={}){let{matches:r}=g.useContext($),{pathname:a}=F(),n=JSON.stringify(Me(r));return g.useMemo(()=>ye(e,JSON.parse(n),a,t==="path"),[e,n,a,t])}function qt(e,t){return er(e,t)}function er(e,t,r){P(X(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:a}=g.useContext(k),{matches:n}=g.useContext($),o=n[n.length-1],i=o?o.params:{},l=o?o.pathname:"/",s=o?o.pathnameBase:"/",u=o&&o.route;if(De){let h=u&&u.path||"";nr(l,!u||h.endsWith("*")||h.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${l}" (under <Route path="${h}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
2
2
 
3
3
  Please change the parent <Route path="${h}"> to <Route path="${h==="/"?"*":`${h}/*`}">.`)}let c=F(),d;if(t){let h=typeof t=="string"?V(t):t;P(s==="/"||h.pathname?.startsWith(s),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${s}" but pathname "${h.pathname}" was given in the \`location\` prop.`),d=h}else d=c;let p=d.pathname||"/",f=p;if(s!=="/"){let h=s.replace(/^\//,"").split("/");f="/"+p.replace(/^\//,"").split("/").slice(h.length).join("/")}let y=r&&r.state.matches.length?r.state.matches.map(h=>Object.assign(h,{route:r.manifest[h.route.id]||h.route})):Ne(e,{pathname:f});De&&(T(u||y!=null,`No routes matched location "${d.pathname}${d.search}${d.hash}" `),T(y==null||y[y.length-1].route.element!==void 0||y[y.length-1].route.Component!==void 0||y[y.length-1].route.lazy!==void 0,`Matched leaf route at location "${d.pathname}${d.search}${d.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`));let m=wa(y&&y.map(h=>Object.assign({},h,{params:Object.assign({},i,h.params),pathname:I([s,a.encodeLocation?a.encodeLocation(h.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:h.pathname]),pathnameBase:h.pathnameBase==="/"?s:I([s,a.encodeLocation?a.encodeLocation(h.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:h.pathnameBase])})),n,r);return t&&m?g.createElement(G.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...d},navigationType:"POP"}},m):m}function ya(){let e=ar(),t=Wt(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,a="rgba(200,200,200, 0.5)",n={padding:"0.5rem",backgroundColor:a},o={padding:"2px 4px",backgroundColor:a},i=null;return De&&(console.error("Error handled by React Router default ErrorBoundary:",e),i=g.createElement(g.Fragment,null,g.createElement("p",null,"\u{1F4BF} Hey developer \u{1F44B}"),g.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",g.createElement("code",{style:o},"ErrorBoundary")," or"," ",g.createElement("code",{style:o},"errorElement")," prop on your route."))),g.createElement(g.Fragment,null,g.createElement("h2",null,"Unexpected Application Error!"),g.createElement("h3",{style:{fontStyle:"italic"}},t),r?g.createElement("pre",{style:n},r):null,i)}var ga=g.createElement(ya,null),tr=class extends g.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){let r=fa(e.digest);r&&(e=r)}let t=e!==void 0?g.createElement($.Provider,{value:this.props.routeContext},g.createElement($e.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?g.createElement(va,{error:e},t):t}};tr.contextType=Kt;var Ce=new WeakMap;function va({children:e,error:t}){let{basename:r,navigator:a}=g.useContext(k);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let n=da(t.digest);if(n){let o=Ce.get(t);if(o)throw o;let i=Vt(n.location,r),l=i.absoluteURL||i.to;if(Ae(n.location,l,Oe(a),"allow-explicit"),ia(l))throw new Error("Invalid redirect location");if(Yt&&!Ce.get(t))if(i.isExternal||n.reloadDocument)window.location.href=l;else{let s=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(i.to,{replace:n.replace}));throw Ce.set(t,s),s}return g.createElement("meta",{httpEquiv:"refresh",content:`0;url=${l}`})}}return e}function Ra({routeContext:e,match:t,children:r}){let a=g.useContext(K);return a&&a.static&&a.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=t.route.id),g.createElement($.Provider,{value:e},r)}function wa(e,t=[],r){let a=r?.state;if(e==null){if(!a)return null;if(a.errors)e=a.matches;else if(t.length===0&&!a.initialized&&a.matches.length>0)e=a.matches;else return null}let n=e,o=a?.errors;if(o!=null){let c=n.findIndex(d=>d.route.id&&o?.[d.route.id]!==void 0);P(c>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(",")}`),n=n.slice(0,Math.min(n.length,c+1))}let i=!1,l=-1;if(r&&a){i=a.renderFallback;for(let c=0;c<n.length;c++){let d=n[c];if((d.route.HydrateFallback||d.route.hydrateFallbackElement)&&(l=c),d.route.id){let{loaderData:p,errors:f}=a,y=d.route.loader&&!p.hasOwnProperty(d.route.id)&&(!f||f[d.route.id]===void 0);if(d.route.lazy||y){r.isStatic&&(i=!0),l>=0?n=n.slice(0,l+1):n=[n[0]];break}}}}let s=r?.onError,u=a&&s?(c,d)=>{s(c,{location:a.location,params:a.matches?.[0]?.params??{},pattern:Zr(a.matches),errorInfo:d})}:void 0;return n.reduceRight((c,d,p)=>{let f,y=!1,m=null,h=null;a&&(f=o&&d.route.id?o[d.route.id]:void 0,m=d.route.errorElement||ga,i&&(l<0&&p===0?(nr("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),y=!0,h=null):l===p&&(y=!0,h=d.route.hydrateFallbackElement||null)));let S=t.concat(n.slice(0,p+1)),R=()=>{let w;return f?w=m:y?w=h:d.route.Component?w=g.createElement(d.route.Component,null):d.route.element?w=d.route.element:w=c,g.createElement(Ra,{match:d,routeContext:{outlet:c,matches:S,isDataRoute:a!=null},children:w})};return a&&(d.route.ErrorBoundary||d.route.errorElement||p===0)?g.createElement(tr,{location:a.location,revalidation:a.revalidation,component:m,error:f,children:R(),routeContext:{outlet:null,matches:S,isDataRoute:!0},onError:u}):R()},null)}function Ie(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Sa(e){let t=g.useContext(K);return P(t,Ie(e)),t}function He(e){let t=g.useContext(ee);return P(t,Ie(e)),t}function ba(e){let t=g.useContext($);return P(t,Ie(e)),t}function Ue(e){let t=ba(e),r=t.matches[t.matches.length-1];return P(r.route.id,`${e} can only be used on routes that contain a unique "id"`),r.route.id}function Ea(){return Ue("useRouteId")}function rr(){let e=He("useNavigation");return g.useMemo(()=>{let{matches:t,historyAction:r,...a}=e.navigation;return a},[e.navigation])}function je(){let{matches:e,loaderData:t}=He("useMatches");return g.useMemo(()=>e.map(r=>Ar(r,t)),[e,t])}function ar(){let e=g.useContext($e),t=He("useRouteError"),r=Ue("useRouteError");return e!==void 0?e:t.errors?.[r]}function xa(){let{router:e}=Sa("useNavigate"),t=Ue("useNavigate"),r=g.useRef(!1);return Zt(()=>{r.current=!0}),g.useCallback(async(n,o={})=>{T(r.current,Qt),r.current&&(typeof n=="number"?await e.navigate(n):await e.navigate(n,{fromRouteId:t,...o}))},[e,t])}var Tt={};function nr(e,t,r){!t&&!Tt[e]&&(Tt[e]=!0,T(!1,r))}var Pa="useOptimistic",Dn=E[Pa];var Fn=E.memo(Ca);function Ca({routes:e,manifest:t,future:r,state:a,isStatic:n,onError:o}){return er(e,void 0,{manifest:t,state:a,isStatic:n,onError:o,future:r})}function La({basename:e,children:t,initialEntries:r,initialIndex:a,useTransitions:n}){let o=E.useRef();o.current==null&&(o.current=At({initialEntries:r,initialIndex:a,v5Compat:!0}));let i=o.current,[l,s]=E.useState({action:i.action,location:i.location}),u=E.useCallback(c=>{n===!1?s(c):E.startTransition(()=>s(c))},[n]);return E.useLayoutEffect(()=>i.listen(u),[i,u]),E.createElement(ve,{basename:e,children:t,location:l.location,navigationType:l.action,navigator:i,useTransitions:n})}function Da({to:e,replace:t,state:r,relative:a}){P(X(),"<Navigate> may be used only in the context of a <Router> component.");let{static:n,navigator:o}=E.useContext(k);T(!n,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:i}=E.useContext($),{pathname:l}=F(),s=Q(),u=ye(e,Me(i),l,a==="path");Ae(typeof e=="string"?e:z(e),o.createHref(u),Oe(o),"reject");let c=JSON.stringify(u);return E.useEffect(()=>{s(JSON.parse(c),{replace:t,state:r,relative:a})},[s,c,a,t,r]),null}function or(e){P(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function ve({basename:e="/",children:t=null,location:r,navigationType:a="POP",navigator:n,static:o=!1,useTransitions:i}){P(!X(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let l=e.replace(/^\/*/,"/"),s=E.useMemo(()=>({basename:l,navigator:n,static:o,useTransitions:i,future:{}}),[l,n,o,i]);typeof r=="string"&&(r=V(r));let{pathname:u="/",search:c="",hash:d="",state:p=null,key:f="default",mask:y}=r,m=E.useMemo(()=>{let h=U(u,l);return h==null?null:{location:{pathname:h,search:c,hash:d,state:p,key:f,mask:y},navigationType:a}},[l,u,c,d,p,f,a,y]);return T(m!=null,`<Router basename="${l}"> is not able to match the URL "${u}${c}${d}" because it does not start with the basename, so the <Router> won't render anything.`),m==null?null:E.createElement(k.Provider,{value:s},E.createElement(G.Provider,{children:t,value:m}))}function Fa({children:e,location:t}){return qt(me(e),t)}function me(e,t=[]){let r=[];return E.Children.forEach(e,(a,n)=>{if(!E.isValidElement(a))return;let o=[...t,n];if(a.type===E.Fragment){r.push.apply(r,me(a.props.children,o));return}P(a.type===or,`[${typeof a.type=="string"?a.type:a.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),P(!a.props.index||!a.props.children,"An index route cannot have child routes.");let i={id:a.props.id||o.join("-"),caseSensitive:a.props.caseSensitive,element:a.props.element,Component:a.props.Component,index:a.props.index,path:a.props.path,middleware:a.props.middleware,loader:a.props.loader,action:a.props.action,hydrateFallbackElement:a.props.hydrateFallbackElement,HydrateFallback:a.props.HydrateFallback,errorElement:a.props.errorElement,ErrorBoundary:a.props.ErrorBoundary,hasErrorBoundary:a.props.hasErrorBoundary===!0||a.props.ErrorBoundary!=null||a.props.errorElement!=null,shouldRevalidate:a.props.shouldRevalidate,handle:a.props.handle,lazy:a.props.lazy};a.props.children&&(i.children=me(a.props.children,o)),r.push(i)}),r}var ce="get",de="application/x-www-form-urlencoded";function Re(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function ka(e){return Re(e)&&e.tagName.toLowerCase()==="button"}function Ta(e){return Re(e)&&e.tagName.toLowerCase()==="form"}function Na(e){return Re(e)&&e.tagName.toLowerCase()==="input"}function Ma(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Oa(e,t){return e.button===0&&(!t||t==="_self")&&!Ma(e)}function pe(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,r)=>{let a=e[r];return t.concat(Array.isArray(a)?a.map(n=>[r,n]):[[r,a]])},[]))}function Aa(e,t){let r=pe(e);return t&&t.forEach((a,n)=>{r.has(n)||t.getAll(n).forEach(o=>{r.append(n,o)})}),r}var se=null;function _a(){if(se===null)try{new FormData(document.createElement("form"),0),se=!1}catch{se=!0}return se}var $a=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Le(e){return e!=null&&!$a.has(e)?(T(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${de}"`),null):e}function Ia(e,t){let r,a,n,o,i;if(Ta(e)){let l=e.getAttribute("action");a=l?U(l,t):null,r=e.getAttribute("method")||ce,n=Le(e.getAttribute("enctype"))||de,o=new FormData(e)}else if(ka(e)||Na(e)&&(e.type==="submit"||e.type==="image")){let l=e.form;if(l==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let s=e.getAttribute("formaction")||l.getAttribute("action");if(a=s?U(s,t):null,r=e.getAttribute("formmethod")||l.getAttribute("method")||ce,n=Le(e.getAttribute("formenctype"))||Le(l.getAttribute("enctype"))||de,o=new FormData(l,e),!_a()){let{name:u,type:c,value:d}=e;if(c==="image"){let p=u?`${u}.`:"";o.append(`${p}x`,"0"),o.append(`${p}y`,"0")}else u&&o.append(u,d)}}else{if(Re(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=ce,a=null,n=de,i=e}return o&&n==="text/plain"&&(i=o,o=void 0),{action:a,method:r.toLowerCase(),encType:n,formData:o,body:i}}var kn=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Ha={"&":"\\u0026",">":"\\u003e","<":"\\u003c","\u2028":"\\u2028","\u2029":"\\u2029"},Ua=/[&><\u2028\u2029]/g;function Nt(e){return e.replace(Ua,t=>Ha[t])}function Be(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}var ja=Symbol("SingleFetchRedirect");function ir(e,t,r,a){let n=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return r?n.pathname.endsWith("/")?n.pathname=`${n.pathname}_.${a}`:n.pathname=`${n.pathname}.${a}`:n.pathname==="/"?n.pathname=`_root.${a}`:t&&U(n.pathname,t)==="/"?n.pathname=`${q(t)}/_root.${a}`:n.pathname=`${q(n.pathname)}.${a}`,n}async function za(e,t){if(e.id in t)return t[e.id];try{let r=await import(e.module);return t[e.id]=r,r}catch(r){if(console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(r),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode&&import.meta.hot)throw r;return window.location.reload(),new Promise(()=>{})}}function Ba(e){return e!=null&&typeof e.page=="string"}function Wa(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function Ya(e,t,r){let a=await Promise.all(e.map(async n=>{let o=t.routes[n.route.id];if(o){let i=await za(o,r);return i.links?i.links():[]}return[]}));return Ga(a.flat(1).filter(Wa).filter(n=>n.rel==="stylesheet"||n.rel==="preload").map(n=>n.rel==="stylesheet"?{...n,rel:"prefetch",as:"style"}:{...n,rel:"prefetch"}))}function Mt(e,t,r,a,n,o){let i=(s,u)=>r[u]?s.route.id!==r[u].route.id:!0,l=(s,u)=>r[u].pathname!==s.pathname||r[u].route.path?.endsWith("*")&&r[u].params["*"]!==s.params["*"];return o==="assets"?t.filter((s,u)=>i(s,u)||l(s,u)):o==="data"?t.filter((s,u)=>{let c=a.routes[s.route.id];if(!c||!c.hasLoader)return!1;if(i(s,u)||l(s,u))return!0;if(s.route.shouldRevalidate){let d=s.route.shouldRevalidate({currentUrl:new URL(n.pathname+n.search+n.hash,window.origin),currentParams:r[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:s.params,defaultShouldRevalidate:!0});if(typeof d=="boolean")return d}return!0}):[]}function Va(e,t,{includeHydrateFallback:r}={}){return Ja(e.map(a=>{let n=t.routes[a.route.id];if(!n)return[];let o=[n.module];return n.clientActionModule&&(o=o.concat(n.clientActionModule)),n.clientLoaderModule&&(o=o.concat(n.clientLoaderModule)),r&&n.hydrateFallbackModule&&(o=o.concat(n.hydrateFallbackModule)),n.imports&&(o=o.concat(n.imports)),o}).flat(1))}function Ja(e){return[...new Set(e)]}function Ka(e){let t={},r=Object.keys(e).sort();for(let a of r)t[a]=e[a];return t}function Ga(e,t){let r=new Set,a=new Set(t);return e.reduce((n,o)=>{if(t&&!Ba(o)&&o.as==="script"&&o.href&&a.has(o.href))return n;let l=JSON.stringify(Ka(o));return r.has(l)||(r.add(l),n.push({key:l,link:o})),n},[])}function We(){let e=b.useContext(K);return Be(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function qa(){let e=b.useContext(ee);return Be(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var oe=b.createContext(void 0);oe.displayName="FrameworkContext";function we(){let e=b.useContext(oe);return Be(e,"You must render this element inside a <HydratedRouter> element"),e}function en(e,t){let r=b.useContext(oe),[a,n]=b.useState(!1),[o,i]=b.useState(!1),{onFocus:l,onBlur:s,onMouseEnter:u,onMouseLeave:c,onTouchStart:d}=t,p=b.useRef(null);b.useEffect(()=>{if(e==="render"&&i(!0),e==="viewport"){let m=S=>{S.forEach(R=>{i(R.isIntersecting)})},h=new IntersectionObserver(m,{threshold:.5});return p.current&&h.observe(p.current),()=>{h.disconnect()}}},[e]),b.useEffect(()=>{if(a){let m=setTimeout(()=>{i(!0)},100);return()=>{clearTimeout(m)}}},[a]);let f=()=>{n(!0)},y=()=>{n(!1),i(!1)};return r?e!=="intent"?[o,p,{}]:[o,p,{onFocus:ae(l,f),onBlur:ae(s,y),onMouseEnter:ae(u,f),onMouseLeave:ae(c,y),onTouchStart:ae(d,f)}]:[!1,p,{}]}function ae(e,t){return r=>{e&&e(r),r.defaultPrevented||t(r)}}function sr({page:e,...t}){let r=la(),{nonce:a}=we(),{router:n}=We(),o=b.useMemo(()=>Ne(n.routes,e,n.basename),[n.routes,e,n.basename]);return o?(t.nonce==null&&a&&(t={...t,nonce:a}),r?b.createElement(rn,{page:e,matches:o,...t}):b.createElement(an,{page:e,matches:o,...t})):null}function tn(e){let{manifest:t,routeModules:r}=we(),[a,n]=b.useState([]);return b.useEffect(()=>{let o=!1;return Ya(e,t,r).then(i=>{o||n(i)}),()=>{o=!0}},[e,t,r]),a}function rn({page:e,matches:t,...r}){let a=F(),{future:n}=we(),{basename:o}=We(),i=b.useMemo(()=>{if(e===a.pathname+a.search+a.hash)return[];let l=ir(e,o,n.v8_trailingSlashAwareDataRequests,"rsc"),s=!1,u=[];for(let c of t)typeof c.route.shouldRevalidate=="function"?s=!0:u.push(c.route.id);return s&&u.length>0&&l.searchParams.set("_routes",u.join(",")),[l.pathname+l.search]},[o,n.v8_trailingSlashAwareDataRequests,e,a,t]);return b.createElement(b.Fragment,null,i.map(l=>b.createElement("link",{key:l,rel:"prefetch",as:"fetch",href:l,...r})))}function an({page:e,matches:t,...r}){let a=F(),{future:n,manifest:o,routeModules:i}=we(),{basename:l}=We(),{loaderData:s,matches:u}=qa(),c=b.useMemo(()=>Mt(e,t,u,o,a,"data"),[e,t,u,o,a]),d=b.useMemo(()=>Mt(e,t,u,o,a,"assets"),[e,t,u,o,a]),p=b.useMemo(()=>{if(e===a.pathname+a.search+a.hash)return[];let m=new Set,h=!1;if(t.forEach(R=>{let w=o.routes[R.route.id];!w||!w.hasLoader||(!c.some(L=>L.route.id===R.route.id)&&R.route.id in s&&i[R.route.id]?.shouldRevalidate||w.hasClientLoader?h=!0:m.add(R.route.id))}),m.size===0)return[];let S=ir(e,l,n.v8_trailingSlashAwareDataRequests,"data");return h&&m.size>0&&S.searchParams.set("_routes",t.filter(R=>m.has(R.route.id)).map(R=>R.route.id).join(",")),[S.pathname+S.search]},[l,n.v8_trailingSlashAwareDataRequests,s,a,o,c,t,e,i]),f=b.useMemo(()=>Va(d,o),[d,o]),y=tn(d);return b.createElement(b.Fragment,null,p.map(m=>b.createElement("link",{key:m,rel:"prefetch",as:"fetch",href:m,...r})),f.map(m=>b.createElement("link",{key:m,rel:"modulepreload",href:m,...r})),y.map(({key:m,link:h})=>b.createElement("link",{key:m,nonce:r.nonce,...h,crossOrigin:h.crossOrigin??r.crossOrigin})))}function nn(...e){return t=>{e.forEach(r=>{typeof r=="function"?r(t):r!=null&&(r.current=t)})}}var on=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{on&&(window.__reactRouterVersion="7.18.3")}catch{}function ln({basename:e,children:t,useTransitions:r,window:a}){let n=v.useRef();n.current==null&&(n.current=_t({window:a,v5Compat:!0}));let o=n.current,[i,l]=v.useState({action:o.action,location:o.location}),s=v.useCallback(u=>{r===!1?l(u):v.startTransition(()=>l(u))},[r]);return v.useLayoutEffect(()=>o.listen(s),[o,s]),v.createElement(ve,{basename:e,children:t,location:i.location,navigationType:i.action,navigator:o,useTransitions:r})}function ur({basename:e,children:t,history:r,useTransitions:a}){let[n,o]=v.useState({action:r.action,location:r.location}),i=v.useCallback(l=>{a===!1?o(l):v.startTransition(()=>o(l))},[a]);return v.useLayoutEffect(()=>r.listen(i),[r,i]),v.createElement(ve,{basename:e,children:t,location:n.location,navigationType:n.action,navigator:r,useTransitions:a})}ur.displayName="unstable_HistoryRouter";var ie=v.forwardRef(function({onClick:t,discover:r="render",prefetch:a="none",relative:n,reloadDocument:o,replace:i,mask:l,state:s,target:u,to:c,preventScrollReset:d,viewTransition:p,defaultShouldRevalidate:f,...y},m){let{basename:h,navigator:S,useTransitions:R}=v.useContext(k),w=typeof c=="string"&&Te.test(c),L=Vt(c,h);c=L.to;let x=ge(c,{relative:n}),M=F(),H=null;if(l){let Y=ye(l,[],M.mask?M.mask.pathname:"/",!0);h!=="/"&&(Y.pathname=Y.pathname==="/"?h:I([h,Y.pathname])),H=S.createHref(Y)}let[_,B,W]=en(a,y),Se=mr(c,{replace:i,mask:l,state:s,target:u,preventScrollReset:d,relative:n,viewTransition:p,defaultShouldRevalidate:f,useTransitions:R});function Cr(Y){t&&t(Y),Y.defaultPrevented||Se(Y)}let Ze=!(L.isExternal||o),qe=v.createElement("a",{...y,...W,href:(Ze?H:void 0)||L.absoluteURL||x,onClick:Ze?Cr:t,ref:nn(m,B),target:u,"data-discover":!w&&r==="render"?"true":void 0});return _&&!w?v.createElement(v.Fragment,null,qe,v.createElement(sr,{page:x})):qe});ie.displayName="Link";var cr=v.forwardRef(function({"aria-current":t="page",caseSensitive:r=!1,className:a="",end:n=!1,style:o,to:i,viewTransition:l,children:s,...u},c){let d=te(i,{relative:u.relative}),p=F(),f=v.useContext(ee),{navigator:y,basename:m}=v.useContext(k),h=f!=null&&vr(d)&&l===!0,S=y.encodeLocation?y.encodeLocation(d).pathname:d.pathname,R=p.pathname,w=f&&f.navigation&&f.navigation.location?f.navigation.location.pathname:null;r||(R=R.toLowerCase(),w=w?w.toLowerCase():null,S=S.toLowerCase()),w&&m&&(w=U(w,m)||w);let L=S!=="/"&&S.endsWith("/")?S.length-1:S.length,x=R===S||!n&&R.startsWith(S)&&R.charAt(L)==="/",M=w!=null&&(w===S||!n&&w.startsWith(S)&&w.charAt(S.length)==="/"),H={isActive:x,isPending:M,isTransitioning:h},_=x?t:void 0,B;typeof a=="function"?B=a(H):B=[a,x?"active":null,M?"pending":null,h?"transitioning":null].filter(Boolean).join(" ");let W=typeof o=="function"?o(H):o;return v.createElement(ie,{...u,"aria-current":_,className:B,ref:c,style:W,to:i,viewTransition:l},typeof s=="function"?s(H):s)});cr.displayName="NavLink";var dr=v.forwardRef(({discover:e="render",fetcherKey:t,navigate:r,reloadDocument:a,replace:n,state:o,method:i=ce,action:l,onSubmit:s,relative:u,preventScrollReset:c,viewTransition:d,defaultShouldRevalidate:p,...f},y)=>{let{useTransitions:m}=v.useContext(k),h=pr(),S=yr(l,{relative:u}),R=i.toLowerCase()==="get"?"get":"post",w=typeof l=="string"&&Te.test(l);return v.createElement("form",{ref:y,method:R,action:S,onSubmit:a?s:x=>{if(s&&s(x),x.defaultPrevented)return;x.preventDefault();let M=x.nativeEvent.submitter,H=M?.getAttribute("formmethod")||i,_=()=>h(M||x.currentTarget,{fetcherKey:t,method:H,navigate:r,replace:n,state:o,relative:u,preventScrollReset:c,viewTransition:d,defaultShouldRevalidate:p});m&&r!==!1?v.startTransition(()=>_()):_()},...f,"data-discover":!w&&e==="render"?"true":void 0})});dr.displayName="Form";function fr({getKey:e,storageKey:t,...r}){let a=v.useContext(oe),{basename:n}=v.useContext(k),o=F(),i=je();gr({getKey:e,storageKey:t});let l=v.useMemo(()=>{if(!a||!e)return null;let u=ke(o,i,n,e);return u!==o.key?u:null},[]);if(!a||a.isSpaMode)return null;let s=((u,c)=>{if(!window.history.state||!window.history.state.key){let d=Math.random().toString(32).slice(2);window.history.replaceState({key:d},"")}try{let p=JSON.parse(sessionStorage.getItem(u)||"{}")[c||window.history.state.key];typeof p=="number"&&window.scrollTo(0,p)}catch(d){console.error(d),sessionStorage.removeItem(u)}}).toString();return r.nonce==null&&a?.nonce&&(r.nonce=a.nonce),v.createElement("script",{...r,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${s})(${Nt(JSON.stringify(t||Fe))}, ${Nt(JSON.stringify(l))})`}})}fr.displayName="ScrollRestoration";function hr(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Ye(e){let t=v.useContext(K);return P(t,hr(e)),t}function sn(e){let t=v.useContext(ee);return P(t,hr(e)),t}function mr(e,{target:t,replace:r,mask:a,state:n,preventScrollReset:o,relative:i,viewTransition:l,defaultShouldRevalidate:s,useTransitions:u}={}){let c=Q(),d=F(),p=te(e,{relative:i});return v.useCallback(f=>{if(Oa(f,t)){f.preventDefault();let y=r!==void 0?r:z(d)===z(p),m=()=>c(e,{replace:y,mask:a,state:n,preventScrollReset:o,relative:i,viewTransition:l,defaultShouldRevalidate:s});u?v.startTransition(()=>m()):m()}},[d,c,p,r,a,n,t,e,o,i,l,s,u])}function Ve(e){T(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=v.useRef(pe(e)),r=v.useRef(!1),a=F(),n=v.useMemo(()=>Aa(a.search,r.current?null:t.current),[a.search]),o=Q(),i=v.useCallback((l,s)=>{let u=pe(typeof l=="function"?l(new URLSearchParams(n)):l);r.current=!0,o("?"+u,s)},[o,n]);return[n,i]}var un=0,cn=()=>`__${String(++un)}__`;function pr(){let{router:e}=Ye("useSubmit"),{basename:t}=v.useContext(k),r=Ea(),a=e.fetch,n=e.navigate;return v.useCallback(async(o,i={})=>{let{action:l,method:s,encType:u,formData:c,body:d}=Ia(o,t);if(i.navigate===!1){let p=i.fetcherKey||cn();await a(p,r,i.action||l,{defaultShouldRevalidate:i.defaultShouldRevalidate,preventScrollReset:i.preventScrollReset,formData:c,body:d,formMethod:i.method||s,formEncType:i.encType||u,flushSync:i.flushSync})}else await n(i.action||l,{defaultShouldRevalidate:i.defaultShouldRevalidate,preventScrollReset:i.preventScrollReset,formData:c,body:d,formMethod:i.method||s,formEncType:i.encType||u,replace:i.replace,state:i.state,fromRouteId:r,flushSync:i.flushSync,viewTransition:i.viewTransition})},[a,n,t,r])}function yr(e,{relative:t}={}){let{basename:r}=v.useContext(k),a=v.useContext($);P(a,"useFormAction must be used inside a RouteContext");let[n]=a.matches.slice(-1),o={...te(e||".",{relative:t})},i=F();if(e==null){o.search=i.search;let l=new URLSearchParams(o.search),s=l.getAll("index");if(s.some(c=>c==="")){l.delete("index"),s.filter(d=>d).forEach(d=>l.append("index",d));let c=l.toString();o.search=c?`?${c}`:""}}return(!e||e===".")&&n.route.index&&(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(o.pathname=o.pathname==="/"?r:I([r,o.pathname])),z(o)}var Fe="react-router-scroll-positions",ue={};function ke(e,t,r,a){let n=null;return a&&(r!=="/"?n=a({...e,pathname:U(e.pathname,r)||e.pathname},t):n=a(e,t)),n==null&&(n=e.key),n}function gr({getKey:e,storageKey:t}={}){let{router:r}=Ye("useScrollRestoration"),{restoreScrollPosition:a,preventScrollReset:n}=sn("useScrollRestoration"),{basename:o}=v.useContext(k),i=F(),l=je(),s=rr();v.useEffect(()=>(window.history.scrollRestoration="manual",()=>{window.history.scrollRestoration="auto"}),[]),dn(v.useCallback(()=>{if(s.state==="idle"){let u=ke(i,l,o,e);ue[u]=window.scrollY}try{sessionStorage.setItem(t||Fe,JSON.stringify(ue))}catch(u){T(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${u}).`)}window.history.scrollRestoration="auto"},[s.state,e,o,i,l,t])),typeof document<"u"&&(v.useLayoutEffect(()=>{try{let u=sessionStorage.getItem(t||Fe);u&&(ue=JSON.parse(u))}catch{}},[t]),v.useLayoutEffect(()=>{let u=r?.enableScrollRestoration(ue,()=>window.scrollY,e?(c,d)=>ke(c,d,o,e):void 0);return()=>u&&u()},[r,o,e]),v.useLayoutEffect(()=>{if(a!==!1){if(typeof a=="number"){window.scrollTo(0,a);return}try{if(i.hash){let u=document.getElementById(decodeURIComponent(i.hash.slice(1)));if(u){u.scrollIntoView();return}}}catch{T(!1,`"${i.hash.slice(1)}" is not a decodable element ID. The view will not scroll to it.`)}n!==!0&&window.scrollTo(0,0)}},[i,a,n]))}function dn(e,t){let{capture:r}=t||{};v.useEffect(()=>{let a=r!=null?{capture:r}:void 0;return window.addEventListener("pagehide",e,a),()=>{window.removeEventListener("pagehide",e,a)}},[e,r])}function vr(e,{relative:t}={}){let r=v.useContext(_e);P(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:a}=Ye("useViewTransitionState"),n=te(e,{relative:t});if(!r.isTransitioning)return!1;let o=U(r.currentLocation.pathname,a)||r.currentLocation.pathname,i=U(r.nextLocation.pathname,a)||r.nextLocation.pathname;return ne(n.pathname,i)!=null||ne(n.pathname,o)!=null}var Je=D(O(),1),wr=D(Lr(),1);var j=D(Z(),1);function Sr({context:e,own:t}){re(e.store);let r=ct(),a=ut()?.live??e.store;re(a);let n=pt();if(!r||a.batches().length===0&&n===0)return null;let o=(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(Je.Suspense,{fallback:null,children:(0,j.jsx)(Et,{})}),(0,j.jsx)(Je.Suspense,{fallback:null,children:(0,j.jsx)(xt,{})})]});return t?(0,wr.createPortal)(o,t):(0,j.jsx)("div",{className:"graview-bar-own",children:o})}var N=D(O(),1);var J=D(O(),1),fn=(0,J.createContext)(null);function Go(){let e=new Map,t=new Set,r=()=>{for(let a of t)a()};return{count:a=>e.get(a)??0,place(a){return e.set(a,(e.get(a)??0)+1),r(),()=>{e.set(a,(e.get(a)??1)-1),r()}},subscribe(a){return t.add(a),()=>t.delete(a)}}}function br(e){let t=(0,J.useContext)(fn);(0,J.useLayoutEffect)(()=>t?.place(e),[t,e])}function Xo(e,t){return(0,J.useSyncExternalStore)(e.subscribe,()=>e.count(t)>0,()=>!1)}var Pr=D(Z(),1),Ke="var(--graview-text-small)",Ge="var(--graview-text-body)",ri="var(--graview-font-display, var(--graview-font-body, system-ui))",Xe={maxWidth:760,margin:"0 auto",padding:"40px 20px max(96px, calc(var(--graview-foot-room, 0px) + env(safe-area-inset-bottom, 0px)))",display:"grid",gridTemplateColumns:"minmax(0, 1fr)",gap:40},Qe=1160,ai={...Xe,maxWidth:Qe},Er={margin:0,fontSize:"var(--graview-text-title)",lineHeight:1.2,letterSpacing:"-0.012em",overflowWrap:"anywhere",textWrap:"balance"},ni={margin:0,fontSize:"var(--graview-text-heading)",lineHeight:1.3,textWrap:"balance"},oi={margin:0,fontSize:Ke,letterSpacing:"0.08em",textTransform:"uppercase",color:"var(--graview-ink-muted)"},ii={margin:0,fontSize:Ge,color:"var(--graview-ink-muted)",maxWidth:"60ch"},xr={color:"var(--graview-ink-muted)",fontSize:Ke},li={borderTop:"1px solid var(--graview-edge)",paddingTop:24},si={color:"var(--graview-accent)",textDecorationColor:"color-mix(in srgb, currentColor 50%, transparent)",textDecorationThickness:1,textUnderlineOffset:"0.2em",display:"inline-flex",alignItems:"center",minHeight:24},ui={color:"inherit",textDecoration:"none",display:"inline-flex",alignItems:"center",minHeight:24},ci=`.graview-list{container-type:inline-size}
4
4
  .graview-rows{display:grid;grid-template-columns:minmax(0,1fr);column-gap:1.5rem;margin:0;padding:0;list-style:none;border-top:1px solid var(--graview-edge)}
@@ -0,0 +1 @@
1
+ import{a as H,b as I,c as T,e as D,h as V,i as R,j as A,k,l as x,n as Y,o as Z}from"./chunk.NNNVB6RV.js";import{b as U}from"./chunk.NOZEHLWG.js";import{H as C,N as G,Ta as F,W as M,Wa as B,ba as W,da as j}from"./chunk.HBBVVALN.js";function re(e,r){return e===void 0||e===!0?!0:e===!1?!1:e[r]!==!1}function te(e){let r={};return e.query&&e.query.trim().length>0&&(r.q=e.query),e.archived!==void 0&&e.archived!==!1&&(r.archived=String(e.archived)),e.sort&&(r.sort=e.sort.direction==="desc"?`${e.sort.by}:desc`:e.sort.by),e.filter?.length&&(r.filter=e.filter.map(n=>`${n.key}:${n.value}`).join(",")),e.group&&(r.group=e.group.bucket?`${e.group.by}:${e.group.bucket}`:e.group.by),r}function ne(e,r){let n=[],s={};if(e.query&&(s.query=e.query),e.archived!==void 0&&e.archived!==!1&&(s.archived=e.archived),e.sort&&(r.sorts.some(u=>u.key===e.sort.by)?s.sort=e.sort:n.push(`sort ${e.sort.by}`)),e.filter){let u=e.filter.filter(c=>r.filters.find(f=>f.key===c.key)?!0:(n.push(`filter ${c.key}`),!1));u.length>0&&(s.filter=u)}return e.group&&(r.groups.some(u=>u.key===e.group.by)?s.group=e.group:n.push(`group ${e.group.by}`)),{arrangement:s,dropped:n}}function S(e,r){return W(e.schema.tryDefinition(r.kind),A(r))}var oe=(e,r)=>e==null?r==null?0:1:r==null?-1:typeof e=="number"&&typeof r=="number"?e-r:typeof e=="boolean"&&typeof r=="boolean"?e===r?0:e?1:-1:String(e).localeCompare(String(r),void 0,{numeric:!0,sensitivity:"base"});function ie(e,r,n){if(n==="label")return S(e,r);let s=e.schema.tryDefinition(r.kind);return s&&n in(s.fields.shape??{})?F(R(r),n,e.today??C()):s?.computed?.[n]!==void 0?e.read?.(r,n):k(e.graph,r.id,n).map(c=>S(e,c)).sort()[0]}var se=/^(\d{4})-(\d{2})-(\d{2})/;function _(e,r){let n=se.exec(e);if(!n)return;let[,s,u,c]=n;if(r==="day")return`${s}-${u}-${c}`;if(r==="month")return`${s}-${u}-01`;if(r==="year")return`${s}-01-01`;if(r==="decade")return`${String(Number(s)-Number(s)%10).padStart(4,"0")}-01-01`;let a=new Date(Date.UTC(Number(s),Number(u)-1,Number(c))),f=(a.getUTCDay()+6)%7;return a.setUTCDate(a.getUTCDate()-f),a.toISOString().slice(0,10)}function de(e,r){return r==="month"?M(e):r==="week"?`Week of ${G(e)}`:r==="year"?e.slice(0,4):r==="decade"?`The ${e.slice(0,4)}s`:G(e)}function ue(e,r,n){return z(e,n)(r)}function z(e,r){let{words:n,conditions:s}=Y(r);if(n.length===0&&s.length===0)return()=>!0;let u=new Map,c=a=>{let f=u.get(a);return f||(f=new Set(D(e.schema,a).filters.map(d=>d.key)),u.set(a,f)),f};return a=>{let f=c(a.kind),d=s.filter(i=>f.has(i.key));return d.every(i=>x(e,a,i))?n.length>0?Z(e.schema.tryDefinition(a.kind),A(a),n)!==void 0:d.length>0:!1}}function ae(e,r,n){let s=r.query?.trim(),u=r.archived===void 0?e:e.filter(t=>B(t,r.archived)),c=s?u.filter(z(n,s)):u,a=r.filter?.length?c.filter(t=>r.filter.every(l=>x(n,t,l))):[...c],f=[];for(let t=r.sort;t&&f.length<4;t=t.then)f.push(t);let d=f.length>0?a.map((t,l)=>({node:t,index:l,values:f.map(o=>ie(n,t,o.by))})).sort((t,l)=>{for(let[o,p]of f.entries()){let[h,K]=[t.values[o],l.values[o]],v=oe(h,K),E=p.direction==="desc"&&v!==0&&h!==void 0&&K!==void 0?-v:v;if(E!==0)return E}return t.index-l.index}).map(t=>t.node):a,i=r.group;if(!i)return{nodes:d,groups:[{key:"",label:"",nodes:d}],grouped:!1};let y=new Map,g=(t,l,o)=>{let p=y.get(t)??{label:l,nodes:[]};p.nodes.push(o),y.set(t,p)},N=d[0],m=N?n.schema.tryDefinition(N.kind):void 0,O=m?.fields.shape??{},J=m?H(m,i.by):j(i.by),$=i.by in O,b=$?I(O[i.by]):void 0,X=T(n.schema,N?.kind??"").find(t=>t.key===i.by)?.label,L=$?`No ${J.toLowerCase()}`:`Without ${(X??j(i.by)).toLowerCase()}`,q=$?new Map:U([...new Map(d.flatMap(t=>k(n.graph,t.id,i.by)).map(t=>[t.id,t])).values()].map(A),t=>n.schema.tryDefinition(t));for(let t of d){if($){let o=F(R(t),i.by,n.today??C());if(o==null||o==="")g("",L,t);else if(b==="date"){let p=i.bucket??"day",h=_(String(o),p);h?g(h,de(h,p),t):g("",L,t)}else if(b==="boolean")g(o?"1":"0",o?"Yes":"No",t);else{let p=m?.display?.format?.[i.by];g(String(o),p?p(o):String(o),t)}continue}let l=k(n.graph,t.id,i.by).map(o=>({id:o.id,label:q.has(o.id)?`${S(n,o)} \xB7 ${q.get(o.id)}`:S(n,o)})).sort((o,p)=>o.label.localeCompare(p.label));l.length===0?g("",L,t):g(l.map(o=>o.id).join(","),l.map(o=>o.label).join(", "),t)}let w=b==="choice"?V(O[i.by]):void 0,ee=[...y.entries()].sort(([t,l],[o,p])=>t===""?1:o===""?-1:w?w.indexOf(t)-w.indexOf(o):b==="boolean"?o.localeCompare(t):b==="date"?t.localeCompare(o):l.label.localeCompare(p.label)).map(([t,l])=>({key:t,label:l.label,nodes:l.nodes}));return{nodes:d,groups:ee,grouped:!0}}function P(e){if(e===void 0)return;if(typeof e=="string")return{by:e,direction:"asc"};let r=e.then===void 0?void 0:typeof e.then=="string"?{by:e.then,direction:"asc"}:{by:e.then.by,direction:e.then.direction??"asc"};return{by:e.by,direction:e.direction??"asc",...r?{then:r}:{}}}function Q(e){if(e!==void 0)return typeof e=="string"?{by:e}:e}function fe(e){let r=P(e?.sort),n=Q(e?.group);if(!(!r&&!n))return{...r?{sort:r}:{},...n?{group:{by:n.by}}:{}}}var le=(e,r)=>r?e==="1"?"true":"false":e;function ce(e,r,n){let s=n.type==="boolean",u=s?["true","false"]:n.options??[],c=[...new Set([...(r.order??[]).filter(d=>u.includes(d)),...u])],a=r.closed??[],f=d=>{if(d.key==="")return[1,0];let i=le(d.key,s);if(a.includes(i))return[2,a.indexOf(i)];let y=c.indexOf(i);return[0,y<0?c.length:y]};return e.map((d,i)=>({group:d,at:i,rank:f(d)})).sort((d,i)=>d.rank[0]-i.rank[0]||d.rank[1]-i.rank[1]||d.at-i.at).map(({group:d,rank:i})=>({...d,closed:i[0]===2}))}export{Q as a,fe as b,ce as c,re as d,te as e,ne as f,ue as g,ae as h};
@@ -1 +1 @@
1
- var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{a as y}from"./chunk.D6RDTUX3.js";import{E as v,F as I,Q as h,Y as w}from"./chunk.6II4BONS.js";import{Ma as g}from"./chunk.F5BCCGFK.js";import{b as d}from"./chunk.AJZBJBMO.js";var k=d(I(),1);var t=d(h(),1),r={display:"inline-flex",alignItems:"center",minHeight:24,minWidth:24,padding:"1px 8px",fontSize:"0.75rem"};function E({shows:e,onShows:i,mine:a,onMine:l}){let o={all:"All",changes:"Changes",ai:"AI"};return(0,t.jsxs)("div",{"data-testid":"activity-filter",role:"group","aria-label":"Show",style:{display:"flex",flexWrap:"wrap",gap:4,alignItems:"center"},children:[["all","changes","ai"].map(s=>(0,t.jsx)("button",{type:"button","data-shows":s,"aria-pressed":e===s,onClick:()=>i(s),style:{...r,...e===s?{borderColor:"var(--graview-accent)",color:"var(--graview-ink)"}:{}},children:o[s]},s)),(0,t.jsx)("button",{type:"button","data-testid":"activity-mine","aria-pressed":a,onClick:()=>l(!a),style:{...r,marginLeft:"auto",...a?{borderColor:"var(--graview-accent)",color:"var(--graview-ink)"}:{}},children:"Just mine"})]})}var x=e=>e.ask.kind==="suggest"?"suggest":e.ask.kind==="fill"?"fill in":e.ask.kind==="record"?"add one":e.ask.kind==="panel"?"draw a panel":`answer \u201C${e.ask.said}\u201D`;function $(e){let i=e.offered.filter(a=>e.accepted?.includes(a.id)).map(a=>a.label);switch(e.outcome){case"accepted":return i.length>0?`Took ${i.join(", ")}`:"Taken";case"partly":return`Took ${i.length} of ${e.offered.length}: ${i.join(", ")}`;case"dismissed":return"Dismissed";case"drawn":return e.panel?`Drew \u201C${e.panel.title}\u201D`:"Drew a panel";case"failed":return e.failed??"Failed";default:return"Offered, not yet taken"}}function C(e){let i=[...new Set((e.usage??[]).map(o=>o.model))];if(i.length===0)return null;let a=(e.usage??[]).flatMap(o=>o.costUsd===void 0?[]:[o.costUsd]),l=a.length>0?a.reduce((o,s)=>o+s,0):void 0;return`${i.join(", ")}${l!==void 0?` \xB7 $${l<.01?l.toPrecision(2):l.toFixed(2)}`:""}`}function F({entry:e,undo:i}){let{store:a,principal:l,seats:o,people:s,ai:b}=w(),c=y(),[p,u]=(0,k.useState)(!1),A=e.by.kind==="human"&&e.by.onBehalfOf===void 0&&(e.by.id===void 0||l.id===void 0||e.by.id===l.id)?"you":g(e.by,{graph:a.graph,schema:a.schema,seats:o,people:s}),f=C(e),S=v(b),m=n=>{u(!0),(__graviewPreload(import.meta.url,["./chunk.ER5ILWKY.js","./chunk.7YQYWOZR.js","./chunk.ACEYGWMO.js","./chunk.3PT55HXT.js","./chunk.D6RDTUX3.js","./chunk.UT6642FC.js","./chunk.TI4OSTQV.js","./chunk.P75TPZWT.js","./chunk.GZLYTPE7.js","./chunk.4B73P2WA.js","./chunk.IMRCAU4T.js","./chunk.BZ5VLPKB.js","./chunk.6II4BONS.js","./chunk.F5BCCGFK.js","./chunk.AJZBJBMO.js"]),import("./chunk.CE3NOADH.js")).then(n).finally(()=>u(!1))};return(0,t.jsxs)("li",{"data-testid":"activity-interaction","data-interaction":e.id,"data-outcome":e.outcome,style:{display:"grid",gap:3,lineHeight:1.45},children:[(0,t.jsx)("div",{style:{display:"flex",alignItems:"baseline",gap:6},children:(0,t.jsxs)("span",{style:{minWidth:0},children:[(0,t.jsx)("strong",{style:{fontWeight:600},children:A})," ",(0,t.jsxs)("span",{style:{color:"var(--graview-ink-muted)"},children:["asked AI to ",x(e)]}),(0,t.jsxs)("span",{style:{color:"var(--graview-ink-faint)"},children:[" \xB7 ",e.targetLabel]})]})}),e.offered.length>0&&e.outcome!=="accepted"&&e.outcome!=="partly"?(0,t.jsxs)("div",{"data-testid":"interaction-offered",style:{color:"var(--graview-ink-muted)"},children:["Offered ",e.offered.map(n=>n.label).join(", ")]}):null,(0,t.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:6,flexWrap:"wrap"},children:[(0,t.jsx)("span",{"data-testid":"interaction-outcome",style:{color:e.outcome==="failed"?"var(--graview-warn)":"var(--graview-ink)"},children:$(e)}),(e.batches??[]).map(n=>(0,t.jsx)("span",{"data-interaction-batch":n,style:{marginLeft:"auto"},children:i(n)},n))]}),f?(0,t.jsx)("div",{"data-testid":"interaction-model",style:{fontSize:"0.75rem",color:"var(--graview-ink-faint)"},children:f}):null,S?(0,t.jsxs)("div",{style:{display:"flex",gap:6,flexWrap:"wrap"},children:[e.panel?(0,t.jsx)("button",{type:"button","data-testid":"interaction-reopen",disabled:p,onClick:()=>m(n=>n.drawPanel(c,e.panel)),style:r,children:"Show the panel"}):null,(0,t.jsx)("button",{type:"button","data-testid":"interaction-again",disabled:p,onClick:()=>m(n=>n.askAgain(c,e)),style:r,children:"Ask again"})]}):null]})}export{E as a,F as b};
1
+ var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{a as y}from"./chunk.Y44TR4WG.js";import{E as v,F as I,Q as h,Y as w}from"./chunk.DNNL7F3P.js";import{Ua as g}from"./chunk.HBBVVALN.js";import{b as d}from"./chunk.AJZBJBMO.js";var k=d(I(),1);var t=d(h(),1),r={display:"inline-flex",alignItems:"center",minHeight:24,minWidth:24,padding:"1px 8px",fontSize:"0.75rem"};function E({shows:e,onShows:i,mine:a,onMine:l}){let o={all:"All",changes:"Changes",ai:"AI"};return(0,t.jsxs)("div",{"data-testid":"activity-filter",role:"group","aria-label":"Show",style:{display:"flex",flexWrap:"wrap",gap:4,alignItems:"center"},children:[["all","changes","ai"].map(s=>(0,t.jsx)("button",{type:"button","data-shows":s,"aria-pressed":e===s,onClick:()=>i(s),style:{...r,...e===s?{borderColor:"var(--graview-accent)",color:"var(--graview-ink)"}:{}},children:o[s]},s)),(0,t.jsx)("button",{type:"button","data-testid":"activity-mine","aria-pressed":a,onClick:()=>l(!a),style:{...r,marginLeft:"auto",...a?{borderColor:"var(--graview-accent)",color:"var(--graview-ink)"}:{}},children:"Just mine"})]})}var x=e=>e.ask.kind==="suggest"?"suggest":e.ask.kind==="fill"?"fill in":e.ask.kind==="record"?"add one":e.ask.kind==="panel"?"draw a panel":`answer \u201C${e.ask.said}\u201D`;function $(e){let i=e.offered.filter(a=>e.accepted?.includes(a.id)).map(a=>a.label);switch(e.outcome){case"accepted":return i.length>0?`Took ${i.join(", ")}`:"Taken";case"partly":return`Took ${i.length} of ${e.offered.length}: ${i.join(", ")}`;case"dismissed":return"Dismissed";case"drawn":return e.panel?`Drew \u201C${e.panel.title}\u201D`:"Drew a panel";case"failed":return e.failed??"Failed";default:return"Offered, not yet taken"}}function C(e){let i=[...new Set((e.usage??[]).map(o=>o.model))];if(i.length===0)return null;let a=(e.usage??[]).flatMap(o=>o.costUsd===void 0?[]:[o.costUsd]),l=a.length>0?a.reduce((o,s)=>o+s,0):void 0;return`${i.join(", ")}${l!==void 0?` \xB7 $${l<.01?l.toPrecision(2):l.toFixed(2)}`:""}`}function F({entry:e,undo:i}){let{store:a,principal:l,seats:o,people:s,ai:b}=w(),c=y(),[p,u]=(0,k.useState)(!1),A=e.by.kind==="human"&&e.by.onBehalfOf===void 0&&(e.by.id===void 0||l.id===void 0||e.by.id===l.id)?"you":g(e.by,{graph:a.graph,schema:a.schema,seats:o,people:s}),f=C(e),S=v(b),m=n=>{u(!0),(__graviewPreload(import.meta.url,["./chunk.AHC4EXLW.js","./chunk.NZJZIYDK.js","./chunk.3V2M3S4U.js","./chunk.EKUAI5YL.js","./chunk.Y44TR4WG.js","./chunk.UT6642FC.js","./chunk.TI4OSTQV.js","./chunk.QYWBQ5NX.js","./chunk.7OLVQ2FZ.js","./chunk.NOZEHLWG.js","./chunk.UVLPVHID.js","./chunk.QXARGANF.js","./chunk.DNNL7F3P.js","./chunk.HBBVVALN.js","./chunk.AJZBJBMO.js"]),import("./chunk.IWK5QL6P.js")).then(n).finally(()=>u(!1))};return(0,t.jsxs)("li",{"data-testid":"activity-interaction","data-interaction":e.id,"data-outcome":e.outcome,style:{display:"grid",gap:3,lineHeight:1.45},children:[(0,t.jsx)("div",{style:{display:"flex",alignItems:"baseline",gap:6},children:(0,t.jsxs)("span",{style:{minWidth:0},children:[(0,t.jsx)("strong",{style:{fontWeight:600},children:A})," ",(0,t.jsxs)("span",{style:{color:"var(--graview-ink-muted)"},children:["asked AI to ",x(e)]}),(0,t.jsxs)("span",{style:{color:"var(--graview-ink-faint)"},children:[" \xB7 ",e.targetLabel]})]})}),e.offered.length>0&&e.outcome!=="accepted"&&e.outcome!=="partly"?(0,t.jsxs)("div",{"data-testid":"interaction-offered",style:{color:"var(--graview-ink-muted)"},children:["Offered ",e.offered.map(n=>n.label).join(", ")]}):null,(0,t.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:6,flexWrap:"wrap"},children:[(0,t.jsx)("span",{"data-testid":"interaction-outcome",style:{color:e.outcome==="failed"?"var(--graview-warn)":"var(--graview-ink)"},children:$(e)}),(e.batches??[]).map(n=>(0,t.jsx)("span",{"data-interaction-batch":n,style:{marginLeft:"auto"},children:i(n)},n))]}),f?(0,t.jsx)("div",{"data-testid":"interaction-model",style:{fontSize:"0.75rem",color:"var(--graview-ink-faint)"},children:f}):null,S?(0,t.jsxs)("div",{style:{display:"flex",gap:6,flexWrap:"wrap"},children:[e.panel?(0,t.jsx)("button",{type:"button","data-testid":"interaction-reopen",disabled:p,onClick:()=>m(n=>n.drawPanel(c,e.panel)),style:r,children:"Show the panel"}):null,(0,t.jsx)("button",{type:"button","data-testid":"interaction-again",disabled:p,onClick:()=>m(n=>n.askAgain(c,e)),style:r,children:"Ask again"})]}):null]})}export{E as a,F as b};
@@ -0,0 +1 @@
1
+ import{a,b}from"./chunk.LVNAB2BW.js";import"./chunk.YW2BZ2LH.js";import"./chunk.HYAKRLPT.js";import"./chunk.IHBIRAC4.js";import"./chunk.CYPTJNES.js";import"./chunk.4NCXMVPY.js";import"./chunk.TN4GY6LW.js";import"./chunk.QJYALCIW.js";import"./chunk.HSRGYZOR.js";import"./chunk.BRBY5WJT.js";import"./chunk.ELY2RMGE.js";import"./chunk.UV2TSAB4.js";import"./chunk.6SK2K72G.js";import"./chunk.NNNVB6RV.js";import"./chunk.HJCQ6I3S.js";import"./chunk.AWRS6TUN.js";import"./chunk.KAWP4RNR.js";import"./chunk.UPBUF7KR.js";import"./chunk.FGYCYLUS.js";import"./chunk.NZJZIYDK.js";import"./chunk.MJLUAGEV.js";import"./chunk.WNMLA4YW.js";import"./chunk.VUKHDZNI.js";import"./chunk.UT6642FC.js";import"./chunk.SZMWJHU2.js";import"./chunk.WVUJXDXZ.js";import"./chunk.YFW5BF6J.js";import"./chunk.QYWBQ5NX.js";import"./chunk.ENJKCSNX.js";import"./chunk.LJE5J3JK.js";import"./chunk.X2OLXTRL.js";import"./chunk.JDRM6XXD.js";import"./chunk.GZHZLJBF.js";import"./chunk.GXPBRYSR.js";import"./chunk.NV6IZJKA.js";import"./chunk.OJGHDWI6.js";import"./chunk.7OLVQ2FZ.js";import"./chunk.NOZEHLWG.js";import"./chunk.UVLPVHID.js";import"./chunk.QXARGANF.js";import"./chunk.DNNL7F3P.js";import"./chunk.HBBVVALN.js";import"./chunk.AJZBJBMO.js";export{b as declaredLensView,a as formatFor};