studiograph 1.3.44-next.1 → 1.3.44-next.2

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 (85) hide show
  1. package/dist/server/index.js +36 -0
  2. package/dist/server/index.js.map +1 -1
  3. package/dist/server/routes/insights-api.d.ts +7 -3
  4. package/dist/server/routes/insights-api.js +46 -21
  5. package/dist/server/routes/insights-api.js.map +1 -1
  6. package/dist/server/ws-hub.d.ts +6 -1
  7. package/dist/server/ws-hub.js.map +1 -1
  8. package/dist/services/auth-service.d.ts +11 -0
  9. package/dist/services/auth-service.js +38 -0
  10. package/dist/services/auth-service.js.map +1 -1
  11. package/dist/services/insights.d.ts +18 -11
  12. package/dist/services/insights.js +121 -77
  13. package/dist/services/insights.js.map +1 -1
  14. package/dist/web/_app/immutable/assets/3.zsEg_MDN.css +1 -0
  15. package/dist/web/_app/immutable/assets/{7.CObh-s2-.css → 7.5LBMlZdT.css} +1 -1
  16. package/dist/web/_app/immutable/chunks/{Dv65pOU4.js → 0rsp5-Up.js} +1 -1
  17. package/dist/web/_app/immutable/chunks/{DTDfEpZd.js → 0wBGAod7.js} +1 -1
  18. package/dist/web/_app/immutable/chunks/{Be5VhuaI.js → APIqItee.js} +1 -1
  19. package/dist/web/_app/immutable/chunks/{JDb8RpWX.js → B3NI-DOv.js} +1 -1
  20. package/dist/web/_app/immutable/chunks/BAAbylyg.js +1 -0
  21. package/dist/web/_app/immutable/chunks/{SJusBvJH.js → BHue2Ock.js} +1 -1
  22. package/dist/web/_app/immutable/chunks/{DRJ9YW_E.js → BPXdu_FX.js} +1 -1
  23. package/dist/web/_app/immutable/chunks/BU2bHQbQ.js +4 -0
  24. package/dist/web/_app/immutable/chunks/{DYVSnKKh.js → BUcIsKRk.js} +1 -1
  25. package/dist/web/_app/immutable/chunks/{BJimep0Q.js → BgBJ0u3M.js} +1 -1
  26. package/dist/web/_app/immutable/chunks/{P7PfXw_H.js → Bnl5ADsW.js} +1 -1
  27. package/dist/web/_app/immutable/chunks/Bs4ovbtO.js +2 -0
  28. package/dist/web/_app/immutable/chunks/{7lzM-85A.js → Bt5_mycY.js} +1 -1
  29. package/dist/web/_app/immutable/chunks/{D0zbd2ZV.js → By_Wtb5J.js} +1 -1
  30. package/dist/web/_app/immutable/chunks/{DEyrdHQB.js → CFtRXHDP.js} +1 -1
  31. package/dist/web/_app/immutable/chunks/{BA_Wro7X.js → CRnhIQbv.js} +1 -1
  32. package/dist/web/_app/immutable/chunks/CSzKZPD4.js +1 -0
  33. package/dist/web/_app/immutable/chunks/{RGHlrGBn.js → D-yNNNdf.js} +1 -1
  34. package/dist/web/_app/immutable/chunks/DC9z5DEo.js +1 -0
  35. package/dist/web/_app/immutable/chunks/{BtJ5VKKi.js → DCVmM0L5.js} +1 -1
  36. package/dist/web/_app/immutable/chunks/{CdvQjHNy.js → DHtLlmE0.js} +1 -1
  37. package/dist/web/_app/immutable/chunks/{9QAsBMIK.js → DQ5NTKSo.js} +1 -1
  38. package/dist/web/_app/immutable/chunks/{B-eIKuyV.js → DQJwHeKh.js} +1 -1
  39. package/dist/web/_app/immutable/chunks/{CNVuHNwC.js → DQYNi3YK.js} +1 -1
  40. package/dist/web/_app/immutable/chunks/{CfuRx7rA.js → DSh-OF2y.js} +1 -1
  41. package/dist/web/_app/immutable/chunks/DSkxw4Ss.js +1 -0
  42. package/dist/web/_app/immutable/chunks/{Cwkp_c4R.js → DT3KtxWU.js} +1 -1
  43. package/dist/web/_app/immutable/chunks/DVx_0hnZ.js +1 -0
  44. package/dist/web/_app/immutable/chunks/{mkNdSDMf.js → DiWKchgv.js} +1 -1
  45. package/dist/web/_app/immutable/chunks/{Dg_GUhrt.js → Diui_MO0.js} +1 -1
  46. package/dist/web/_app/immutable/chunks/DodWDTE5.js +1 -0
  47. package/dist/web/_app/immutable/chunks/{fKdE_Jx_.js → KHKAD2Ng.js} +1 -1
  48. package/dist/web/_app/immutable/chunks/{BH82yShn.js → Sk0ODu4Y.js} +1 -1
  49. package/dist/web/_app/immutable/chunks/{Bypyvp-Q.js → azUmHUDT.js} +1 -1
  50. package/dist/web/_app/immutable/chunks/{CajNsaOw.js → b0XUoOIH.js} +2 -2
  51. package/dist/web/_app/immutable/chunks/{DP6MOIr2.js → lsAKkphT.js} +1 -1
  52. package/dist/web/_app/immutable/chunks/{BLi1Oegj.js → vZ2iBqLE.js} +1 -1
  53. package/dist/web/_app/immutable/entry/app.DA5OyPOi.js +2 -0
  54. package/dist/web/_app/immutable/entry/start.DTjSVtws.js +1 -0
  55. package/dist/web/_app/immutable/nodes/0.BIvpQ3Qk.js +2 -0
  56. package/dist/web/_app/immutable/nodes/1.y3j9wcQE.js +1 -0
  57. package/dist/web/_app/immutable/nodes/{10.BqjRpXN6.js → 10.D03BZcr1.js} +1 -1
  58. package/dist/web/_app/immutable/nodes/2.Du0xZVQg.js +84 -0
  59. package/dist/web/_app/immutable/nodes/3.weQEi2lI.js +1 -0
  60. package/dist/web/_app/immutable/nodes/4.DJyhWznw.js +11 -0
  61. package/dist/web/_app/immutable/nodes/{5.pB3H4l7g.js → 5.CipwuwB3.js} +1 -1
  62. package/dist/web/_app/immutable/nodes/6.Daxwm3Lw.js +2 -0
  63. package/dist/web/_app/immutable/nodes/7.TxeJDMtw.js +2 -0
  64. package/dist/web/_app/immutable/nodes/{8.B5sO5Rkn.js → 8.DWNdmB4l.js} +1 -1
  65. package/dist/web/_app/immutable/nodes/{9.DOysjWYm.js → 9.BuTZk7Le.js} +1 -1
  66. package/dist/web/_app/version.json +1 -1
  67. package/dist/web/index.html +11 -12
  68. package/package.json +1 -1
  69. package/dist/web/_app/immutable/assets/3.CHSDCrUY.css +0 -1
  70. package/dist/web/_app/immutable/chunks/BZd_7gpI.js +0 -1
  71. package/dist/web/_app/immutable/chunks/CAEA_aBe.js +0 -1
  72. package/dist/web/_app/immutable/chunks/CHDa87Lu.js +0 -1
  73. package/dist/web/_app/immutable/chunks/D18-Aspv.js +0 -1
  74. package/dist/web/_app/immutable/chunks/DQ_O96iG.js +0 -1
  75. package/dist/web/_app/immutable/chunks/DUsnWwWN.js +0 -1
  76. package/dist/web/_app/immutable/chunks/DgMUDNqD.js +0 -4
  77. package/dist/web/_app/immutable/entry/app.FJ-QaQhu.js +0 -2
  78. package/dist/web/_app/immutable/entry/start.Cae6DI7N.js +0 -1
  79. package/dist/web/_app/immutable/nodes/0.tyq0tjYR.js +0 -2
  80. package/dist/web/_app/immutable/nodes/1.D-QPCIcu.js +0 -1
  81. package/dist/web/_app/immutable/nodes/2.CogYiW3g.js +0 -84
  82. package/dist/web/_app/immutable/nodes/3.CQ8SfijF.js +0 -1
  83. package/dist/web/_app/immutable/nodes/4.BS-4PSr6.js +0 -11
  84. package/dist/web/_app/immutable/nodes/6.CKD5i0Ve.js +0 -2
  85. package/dist/web/_app/immutable/nodes/7.au7lCUbq.js +0 -2
@@ -1 +1 @@
1
- import{o as Je,p as qt,c as z,a as d,b as F,s as ce,f as dt,d as yr,g as He,t as jt}from"../chunks/CajNsaOw.js";import{e as L,s as h,g as e,ac as k,p as We,a0 as N,b as Ue,c as y,ae as $e,r as p,l as it,d as Be,a as Jt,n as kt,m as lt,t as re,a5 as mt,f as ot,a1 as T}from"../chunks/CfuRx7rA.js";import{i as E}from"../chunks/Cwkp_c4R.js";import{e as _e,i as ze}from"../chunks/CdvQjHNy.js";import{c as Q}from"../chunks/BtJ5VKKi.js";import{s as Ne,a as De,b as nt,c as _r}from"../chunks/BA_Wro7X.js";import{s as yt,c as br}from"../chunks/DEyrdHQB.js";import{g as gr}from"../chunks/DUsnWwWN.js";import{V as kr}from"../chunks/D0zbd2ZV.js";import{n as Cr}from"../chunks/BZd_7gpI.js";import{v as _t}from"../chunks/DTDfEpZd.js";import{w as Ht}from"../chunks/DQ_O96iG.js";import{f as Ze}from"../chunks/CdeYcEuU.js";import{i as Zt}from"../chunks/BLi1Oegj.js";import{p as D,s as zt,r as Qt,l as ut}from"../chunks/RGHlrGBn.js";import{A as wr,a as xr}from"../chunks/mkNdSDMf.js";import{w as Ct,q as Or,r as Fe,C as Pr,s as $t,t as Sr,u as ct,E as Tr,v as Ar,x as Rt,y as Nr,z as Dr,A as Lt,b as K,B as Fr,c as er,n as Le,P as Mr,f as Ir,m as at,h as Bt,k as Vr,F as Er,G as jr}from"../chunks/CNVuHNwC.js";import{C as Hr}from"../chunks/DRJ9YW_E.js";import{S as Wt,a as Ut,b as st,R as Kt,C as zr}from"../chunks/7lzM-85A.js";import{B as Lr}from"../chunks/9QAsBMIK.js";import{I as bt}from"../chunks/Be5VhuaI.js";function Yt(w,t){const[o,c]=w;let s=!1;const a=t.length;for(let f=0,l=a-1;f<a;l=f++){const[b,O]=t[f]??[0,0],[x,g]=t[l]??[0,0];O>=c!=g>=c&&o<=(x-b)*(c-O)/(g-O)+b&&(s=!s)}return s}function Xt(w,t){return w[0]>=t.left&&w[0]<=t.right&&w[1]>=t.top&&w[1]<=t.bottom}function Br(w,t){const o=w.left+w.width/2,c=w.top+w.height/2,s=t.left+t.width/2,a=t.top+t.height/2,f=s-o,l=a-c;return Math.abs(f)>Math.abs(l)?f>0?"right":"left":l>0?"bottom":"top"}class Wr{#e;#n;#r=null;#t=null;#s=null;#i(){this.#s!==null&&(cancelAnimationFrame(this.#s),this.#s=null)}#u(){this.#i(),this.#s=requestAnimationFrame(()=>{this.#s=null,!(!this.#r||!this.#t)&&(this.#o(),this.#e.onPointerExit())})}constructor(t){this.#e=t,this.#n=t.buffer??1,Ct([t.triggerNode,t.contentNode,t.enabled],([o,c,s])=>{if(!o||!c||!s){this.#o();return}const a=Or(o),f=g=>{this.#a([g.clientX,g.clientY],o,c)},l=g=>{const C=g.relatedTarget;if(Fe(C)&&c.contains(C))return;const Y=this.#e.ignoredTargets?.()??[];if(!(Fe(C)&&Y.some(M=>M===C||M.contains(C)))){if(Fe(C)&&!o.contains(C)&&!c.contains(C)&&!C.contains(c)){this.#o(),this.#e.onPointerExit();return}this.#r=[g.clientX,g.clientY],this.#t="content",this.#u()}},b=()=>{this.#o()},O=()=>{this.#o()},x=g=>{const C=g.relatedTarget;Fe(C)&&o.contains(C)||(this.#r=[g.clientX,g.clientY],this.#t="trigger",this.#u())};return[Je(a,"pointermove",f),Je(o,"pointerleave",l),Je(o,"pointerenter",b),Je(c,"pointerenter",O),Je(c,"pointerleave",x)].reduce((g,C)=>()=>{g(),C()},()=>{})})}#a(t,o,c){if(!this.#r||!this.#t)return;this.#i();const s=o.getBoundingClientRect(),a=c.getBoundingClientRect();if(this.#t==="content"&&Xt(t,a)){this.#o();return}if(this.#t==="trigger"&&Xt(t,s)){this.#o();return}const f=Br(s,a),l=this.#l(s,a,f);if(l&&Yt(t,l))return;const b=this.#t==="content"?a:s,O=this.#c(this.#r,b,f,this.#t);Yt(t,O)||(this.#o(),this.#e.onPointerExit())}#o(){this.#r=null,this.#t=null,this.#i()}#l(t,o,c){const s=this.#n;switch(c){case"top":return[[Math.min(t.left,o.left)-s,t.top],[Math.min(t.left,o.left)-s,o.bottom],[Math.max(t.right,o.right)+s,o.bottom],[Math.max(t.right,o.right)+s,t.top]];case"bottom":return[[Math.min(t.left,o.left)-s,t.bottom],[Math.min(t.left,o.left)-s,o.top],[Math.max(t.right,o.right)+s,o.top],[Math.max(t.right,o.right)+s,t.bottom]];case"left":return[[t.left,Math.min(t.top,o.top)-s],[o.right,Math.min(t.top,o.top)-s],[o.right,Math.max(t.bottom,o.bottom)+s],[t.left,Math.max(t.bottom,o.bottom)+s]];case"right":return[[t.right,Math.min(t.top,o.top)-s],[o.left,Math.min(t.top,o.top)-s],[o.left,Math.max(t.bottom,o.bottom)+s],[t.right,Math.max(t.bottom,o.bottom)+s]]}}#c(t,o,c,s){const a=this.#n*4,[f,l]=t;switch(s==="trigger"?this.#d(c):c){case"top":return[[f-a,l+a],[f+a,l+a],[o.right+a,o.bottom],[o.right+a,o.top],[o.left-a,o.top],[o.left-a,o.bottom]];case"bottom":return[[f-a,l-a],[f+a,l-a],[o.right+a,o.top],[o.right+a,o.bottom],[o.left-a,o.bottom],[o.left-a,o.top]];case"left":return[[f+a,l-a],[f+a,l+a],[o.right,o.bottom+a],[o.left,o.bottom+a],[o.left,o.top-a],[o.right,o.top-a]];case"right":return[[f-a,l-a],[f-a,l+a],[o.left,o.bottom+a],[o.right,o.bottom+a],[o.right,o.top-a],[o.left,o.top-a]]}}#d(t){switch(t){case"top":return"bottom";case"bottom":return"top";case"left":return"right";case"right":return"left"}}}const gt=Fr({component:"popover",parts:["root","trigger","content","close","overlay"]}),wt=new Pr("Popover.Root");class xt{static create(t){return wt.set(new xt(t))}opts;#e=L(null);get contentNode(){return e(this.#e)}set contentNode(t){h(this.#e,t,!0)}contentPresence;#n=L(null);get triggerNode(){return e(this.#n)}set triggerNode(t){h(this.#n,t,!0)}#r=L(null);get overlayNode(){return e(this.#r)}set overlayNode(t){h(this.#r,t,!0)}overlayPresence;#t=L(!1);get openedViaHover(){return e(this.#t)}set openedViaHover(t){h(this.#t,t,!0)}#s=L(!1);get hasInteractedWithContent(){return e(this.#s)}set hasInteractedWithContent(t){h(this.#s,t,!0)}#i=L(!1);get hoverCooldown(){return e(this.#i)}set hoverCooldown(t){h(this.#i,t,!0)}#u=L(0);get closeDelay(){return e(this.#u)}set closeDelay(t){h(this.#u,t,!0)}#a=null;#o=null;constructor(t){this.opts=t,this.contentPresence=new Lt({ref:K(()=>this.contentNode),open:this.opts.open,onComplete:()=>{this.opts.onOpenChangeComplete.current(this.opts.open.current)}}),this.overlayPresence=new Lt({ref:K(()=>this.overlayNode),open:this.opts.open}),Ct(()=>this.opts.open.current,o=>{o||(this.openedViaHover=!1,this.hasInteractedWithContent=!1,this.#l())})}setDomContext(t){this.#o=t}#l(){this.#a!==null&&this.#o&&(this.#o.clearTimeout(this.#a),this.#a=null)}toggleOpen(){this.#l(),this.opts.open.current=!this.opts.open.current}handleClose(){this.#l(),this.opts.open.current&&(this.opts.open.current=!1)}handleHoverOpen(){this.#l(),!this.opts.open.current&&(this.openedViaHover=!0,this.opts.open.current=!0)}handleHoverClose(){this.opts.open.current&&this.openedViaHover&&!this.hasInteractedWithContent&&(this.opts.open.current=!1)}handleDelayedHoverClose(){this.opts.open.current&&(!this.openedViaHover||this.hasInteractedWithContent||(this.#l(),this.closeDelay<=0?this.opts.open.current=!1:this.#o&&(this.#a=this.#o.setTimeout(()=>{this.openedViaHover&&!this.hasInteractedWithContent&&(this.opts.open.current=!1),this.#a=null},this.closeDelay))))}cancelDelayedClose(){this.#l()}markInteraction(){this.hasInteractedWithContent=!0,this.#l()}}class Ot{static create(t){return new Ot(t,wt.get())}opts;root;attachment;domContext;#e=null;#n=null;#r=L(!1);constructor(t,o){this.opts=t,this.root=o,this.attachment=$t(this.opts.ref,c=>this.root.triggerNode=c),this.domContext=new Sr(t.ref),this.root.setDomContext(this.domContext),this.onclick=this.onclick.bind(this),this.onkeydown=this.onkeydown.bind(this),this.onpointerenter=this.onpointerenter.bind(this),this.onpointerleave=this.onpointerleave.bind(this),Ct(()=>this.opts.closeDelay.current,c=>{this.root.closeDelay=c})}#t(){this.#e!==null&&(this.domContext.clearTimeout(this.#e),this.#e=null)}#s(){this.#n!==null&&(this.domContext.clearTimeout(this.#n),this.#n=null)}#i(){this.#t(),this.#s()}onpointerenter(t){if(this.opts.disabled.current||!this.opts.openOnHover.current||ct(t)||(h(this.#r,!0),this.#s(),this.root.cancelDelayedClose(),this.root.opts.open.current||this.root.hoverCooldown))return;const o=this.opts.openDelay.current;o<=0?this.root.handleHoverOpen():this.#e=this.domContext.setTimeout(()=>{this.root.handleHoverOpen(),this.#e=null},o)}onpointerleave(t){this.opts.disabled.current||this.opts.openOnHover.current&&(ct(t)||(h(this.#r,!1),this.#t(),this.root.hoverCooldown=!1))}onclick(t){if(!this.opts.disabled.current&&t.button===0){if(this.#i(),e(this.#r)&&this.root.opts.open.current&&this.root.openedViaHover){this.root.openedViaHover=!1,this.root.hasInteractedWithContent=!0;return}e(this.#r)&&this.opts.openOnHover.current&&this.root.opts.open.current&&(this.root.hoverCooldown=!0),this.root.hoverCooldown&&!this.root.opts.open.current&&(this.root.hoverCooldown=!1),this.root.toggleOpen()}}onkeydown(t){this.opts.disabled.current||(t.key===Tr||t.key===Ar)&&(t.preventDefault(),this.#i(),this.root.toggleOpen())}#u(){if(this.root.opts.open.current&&this.root.contentNode?.id)return this.root.contentNode?.id}#a=k(()=>({id:this.opts.id.current,"aria-haspopup":"dialog","aria-expanded":Nr(this.root.opts.open.current),"data-state":Rt(this.root.opts.open.current),"aria-controls":this.#u(),[gt.trigger]:"",disabled:this.opts.disabled.current,onkeydown:this.onkeydown,onclick:this.onclick,onpointerenter:this.onpointerenter,onpointerleave:this.onpointerleave,...this.attachment}));get props(){return e(this.#a)}set props(t){h(this.#a,t)}}class Pt{static create(t){return new Pt(t,wt.get())}opts;root;attachment;constructor(t,o){this.opts=t,this.root=o,this.attachment=$t(this.opts.ref,c=>this.root.contentNode=c),this.onpointerdown=this.onpointerdown.bind(this),this.onfocusin=this.onfocusin.bind(this),this.onpointerenter=this.onpointerenter.bind(this),this.onpointerleave=this.onpointerleave.bind(this),new Wr({triggerNode:()=>this.root.triggerNode,contentNode:()=>this.root.contentNode,enabled:()=>this.root.opts.open.current&&this.root.openedViaHover&&!this.root.hasInteractedWithContent,onPointerExit:()=>{this.root.handleDelayedHoverClose()}})}onpointerdown(t){this.root.markInteraction()}onfocusin(t){const o=t.target;Fe(o)&&Dr(o)&&this.root.markInteraction()}onpointerenter(t){ct(t)||this.root.cancelDelayedClose()}onpointerleave(t){ct(t)}onInteractOutside=t=>{if(this.opts.onInteractOutside.current(t),t.defaultPrevented||!Fe(t.target))return;const o=t.target.closest(gt.selector("trigger"));if(!(o&&o===this.root.triggerNode)){if(this.opts.customAnchor.current){if(Fe(this.opts.customAnchor.current)){if(this.opts.customAnchor.current.contains(t.target))return}else if(typeof this.opts.customAnchor.current=="string"){const c=document.querySelector(this.opts.customAnchor.current);if(c&&c.contains(t.target))return}}this.root.handleClose()}};onEscapeKeydown=t=>{this.opts.onEscapeKeydown.current(t),!t.defaultPrevented&&this.root.handleClose()};get shouldRender(){return this.root.contentPresence.shouldRender}get shouldTrapFocus(){return!(this.root.openedViaHover&&!this.root.hasInteractedWithContent)}#e=k(()=>({open:this.root.opts.open.current}));get snippetProps(){return e(this.#e)}set snippetProps(t){h(this.#e,t)}#n=k(()=>({id:this.opts.id.current,tabindex:-1,"data-state":Rt(this.root.opts.open.current),[gt.content]:"",style:{pointerEvents:"auto",contain:"layout style"},onpointerdown:this.onpointerdown,onfocusin:this.onfocusin,onpointerenter:this.onpointerenter,onpointerleave:this.onpointerleave,...this.attachment}));get props(){return e(this.#n)}set props(t){h(this.#n,t)}popperProps={onInteractOutside:this.onInteractOutside,onEscapeKeydown:this.onEscapeKeydown}}var Ur=F("<div><div><!></div></div>"),Kr=F("<div><div><!></div></div>");function Yr(w,t){const o=qt();We(t,!0);let c=D(t,"ref",15,null),s=D(t,"id",19,()=>er(o)),a=D(t,"forceMount",3,!1),f=D(t,"onOpenAutoFocus",3,Le),l=D(t,"onCloseAutoFocus",3,Le),b=D(t,"onEscapeKeydown",3,Le),O=D(t,"onInteractOutside",3,Le),x=D(t,"trapFocus",3,!0),g=D(t,"preventScroll",3,!1),C=D(t,"customAnchor",3,null),Y=Qt(t,["$$slots","$$events","$$legacy","child","children","ref","id","forceMount","onOpenAutoFocus","onCloseAutoFocus","onEscapeKeydown","onInteractOutside","trapFocus","preventScroll","customAnchor","style"]);const M=Pt.create({id:K(()=>s()),ref:K(()=>c(),q=>c(q)),onInteractOutside:K(()=>O()),onEscapeKeydown:K(()=>b()),customAnchor:K(()=>C())}),se=k(()=>at(Y,M.props)),Me=k(()=>x()&&M.shouldTrapFocus);function Ie(q){M.shouldTrapFocus||q.preventDefault(),f()(q)}var B=z(),ae=N(B);{var oe=q=>{Mr(q,zt(()=>e(se),()=>M.popperProps,{get ref(){return M.opts.ref},get enabled(){return M.root.opts.open.current},get id(){return s()},get trapFocus(){return e(Me)},get preventScroll(){return g()},loop:!0,forceMount:!0,get customAnchor(){return C()},onOpenAutoFocus:Ie,get onCloseAutoFocus(){return l()},get shouldRender(){return M.shouldRender},popper:(Ke,ge)=>{let Ye=()=>ge?.().props,we=()=>ge?.().wrapperProps;const xe=k(()=>at(Ye(),{style:Bt("popover")},{style:t.style}));var $=z(),ie=N($);{var Ve=W=>{var j=z(),X=N(j);{let de=k(()=>({props:e(xe),wrapperProps:we(),...M.snippetProps}));Ne(X,()=>t.child,()=>e(de))}d(W,j)},Xe=W=>{var j=Ur();De(j,()=>({...we()}));var X=y(j);De(X,()=>({...e(xe)}));var de=y(X);Ne(de,()=>t.children??$e),p(X),p(j),d(W,j)};E(ie,W=>{t.child?W(Ve):W(Xe,!1)})}d(Ke,$)},$$slots:{popper:!0}}))},be=q=>{Ir(q,zt(()=>e(se),()=>M.popperProps,{get ref(){return M.opts.ref},get open(){return M.root.opts.open.current},get id(){return s()},get trapFocus(){return e(Me)},get preventScroll(){return g()},loop:!0,forceMount:!1,get customAnchor(){return C()},onOpenAutoFocus:Ie,get onCloseAutoFocus(){return l()},get shouldRender(){return M.shouldRender},popper:(Ke,ge)=>{let Ye=()=>ge?.().props,we=()=>ge?.().wrapperProps;const xe=k(()=>at(Ye(),{style:Bt("popover")},{style:t.style}));var $=z(),ie=N($);{var Ve=W=>{var j=z(),X=N(j);{let de=k(()=>({props:e(xe),wrapperProps:we(),...M.snippetProps}));Ne(X,()=>t.child,()=>e(de))}d(W,j)},Xe=W=>{var j=Kr();De(j,()=>({...we()}));var X=y(j);De(X,()=>({...e(xe)}));var de=y(X);Ne(de,()=>t.children??$e),p(X),p(j),d(W,j)};E(ie,W=>{t.child?W(Ve):W(Xe,!1)})}d(Ke,$)},$$slots:{popper:!0}}))};E(ae,q=>{a()?q(oe):a()||q(be,1)})}d(w,B),Ue()}var Xr=F("<button><!></button>");function Gr(w,t){const o=qt();We(t,!0);let c=D(t,"id",19,()=>er(o)),s=D(t,"ref",15,null),a=D(t,"type",3,"button"),f=D(t,"disabled",3,!1),l=D(t,"openOnHover",3,!1),b=D(t,"openDelay",3,700),O=D(t,"closeDelay",3,300),x=Qt(t,["$$slots","$$events","$$legacy","children","child","id","ref","type","disabled","openOnHover","openDelay","closeDelay"]);const g=Ot.create({id:K(()=>c()),ref:K(()=>s(),Y=>s(Y)),disabled:K(()=>!!f()),openOnHover:K(()=>l()),openDelay:K(()=>b()),closeDelay:K(()=>O())}),C=k(()=>at(x,g.props,{type:a()}));Vr(w,{get id(){return c()},get ref(){return g.opts.ref},children:(Y,M)=>{var se=z(),Me=N(se);{var Ie=ae=>{var oe=z(),be=N(oe);Ne(be,()=>t.child,()=>({props:e(C)})),d(ae,oe)},B=ae=>{var oe=Xr();De(oe,()=>({...e(C)}));var be=y(oe);Ne(be,()=>t.children??$e),p(oe),d(ae,oe)};E(Me,ae=>{t.child?ae(Ie):ae(B,!1)})}d(Y,se)},$$slots:{default:!0}}),Ue()}function qr(w,t){We(t,!0);let o=D(t,"open",15,!1),c=D(t,"onOpenChange",3,Le),s=D(t,"onOpenChangeComplete",3,Le);xt.create({open:K(()=>o(),a=>{o(a),c()(a)}),onOpenChangeComplete:K(()=>s())}),Er(w,{children:(a,f)=>{var l=z(),b=N(l);Ne(b,()=>t.children??$e),d(a,l)},$$slots:{default:!0}}),Ue()}function Jr({params:w}){return{viewId:Number(w.id)}}const Ro=Object.freeze(Object.defineProperty({__proto__:null,load:Jr},Symbol.toStringTag,{value:"Module"})),Zr=[{key:"name",label:"Name",filter:"text"},{key:"entity_type",label:"Type",filter:"enum"},{key:"collection",label:"Collection",filter:"enum"},{key:"created_at",label:"Created",filter:"date",format:"date"}],Gt=[{key:"collection",label:"Collection",filter:"enum"},{key:"created_at",label:"Created",filter:"date",format:"date"}],Qr={task:[{key:"name",label:"Name",filter:"text"},{key:"status",label:"Status",filter:"enum",sortOrder:{open:0,"in-progress":1,done:2,cancelled:3}},{key:"priority",label:"Priority",filter:"enum",sortOrder:{urgent:0,high:1,medium:2,low:3}},{key:"assignee",label:"Assignee",filter:"enum",format:"wikilink"},{key:"due_date",label:"Due Date",filter:"date",format:"date"}],project:[{key:"name",label:"Name",filter:"text"},{key:"status",label:"Status",filter:"enum"},{key:"client",label:"Client",filter:"text"},{key:"start_date",label:"Start",filter:"date",format:"date"},{key:"end_date",label:"End",filter:"date",format:"date"}],person:[{key:"name",label:"Name",filter:"text"},{key:"role",label:"Role",filter:"text"},{key:"status",label:"Status",filter:"enum"},{key:"email",label:"Email",filter:"text"},{key:"organization",label:"Org",filter:"enum",format:"wikilink"}],meeting:[{key:"name",label:"Name",filter:"text"},{key:"attendees",label:"Attendees",filter:"text",format:"wikilink"},{key:"date",label:"Date",filter:"date",format:"date"}],deal:[{key:"name",label:"Name",filter:"text"},{key:"client",label:"Client",filter:"enum",format:"wikilink"},{key:"stage",label:"Stage",filter:"enum"},{key:"deal_value",label:"Value",filter:"none",format:"currency"},{key:"expected_close",label:"Close Date",filter:"date",format:"date"}],decision:[{key:"name",label:"Name",filter:"text"},{key:"status",label:"Status",filter:"enum"},{key:"decision_makers",label:"Decision Makers",filter:"text",format:"wikilink"}],document:[{key:"name",label:"Name",filter:"text"},{key:"category",label:"Category",filter:"enum"},{key:"project",label:"Project",filter:"enum",format:"wikilink"},{key:"status",label:"Status",filter:"enum"}],deliverable:[{key:"name",label:"Name",filter:"text"},{key:"project",label:"Project",filter:"enum",format:"wikilink"},{key:"status",label:"Status",filter:"enum"},{key:"due_date",label:"Due Date",filter:"date",format:"date"}],note:[{key:"name",label:"Name",filter:"text"},{key:"category",label:"Category",filter:"enum"}],publication:[{key:"name",label:"Name",filter:"text"},{key:"category",label:"Category",filter:"enum"},{key:"status",label:"Status",filter:"enum"},{key:"platform",label:"Platform",filter:"enum"}],organization:[{key:"name",label:"Name",filter:"text"},{key:"category",label:"Category",filter:"enum"},{key:"status",label:"Status",filter:"enum"},{key:"industry",label:"Industry",filter:"text"}]},$r=new Set(["name","entity_type","entity_id","created_at","updated_at","created_by","updated_by","tags","date"]);function Rr(w,t){if(!w)return Zr;const o=Qr[w];if(o)return[...o,...Gt];const c=[{key:"name",label:"Name",filter:"text"}];if(t)for(const s of t){if($r.has(s))continue;const a=s.replace(/_/g," ").replace(/\b\w/g,l=>l.toUpperCase()),f=s.endsWith("_date")||s==="date";c.push({key:s,label:a,filter:f?"date":"text",format:f?"date":void 0})}return[...c,...Gt]}const eo={"task.status":{open:"#f0c246","in-progress":"#3ecf8e",done:"#5c5c66",cancelled:"#e54d4d"},"task.priority":{urgent:"#e54d4d",high:"#f0c246",medium:"#5c5c66",low:"var(--color-text-tertiary)"},"project.status":{planning:"#f0c246",scoping:"#f0c246",active:"#3ecf8e","on-hold":"#5c5c66",completed:"#5c5c66",archived:"#5c5c66"},"deal.stage":{scoping:"#f0c246",proposal:"#5a70b0",negotiating:"#3ecf8e",won:"#78d098",lost:"#e54d4d"},"decision.status":{proposed:"#f0c246",accepted:"#3ecf8e",rejected:"#e54d4d",deprecated:"#5c5c66",superseded:"#5c5c66"},"document.status":{draft:"#f0c246",sent:"#5a70b0",accepted:"#3ecf8e",rejected:"#e54d4d",signed:"#78d098"},"deliverable.status":{planned:"#f0c246","in-progress":"#3ecf8e",delivered:"#5c5c66",accepted:"#78d098",rejected:"#e54d4d"},"publication.status":{draft:"#f0c246",review:"#5a70b0",scheduled:"#3ecf8e",published:"#5c5c66"}};function Qe(w,t,o){return eo[`${w}.${t}`]?.[o]}var to=dt("<title> </title>"),ro=dt('<svg><!><path d="M16 28 9 21 10.41 19.59 16 25.17 21.59 19.59 23 21 16 28z"></path><path d="M16 4 23 11 21.59 12.41 16 6.83 10.41 12.41 9 11 16 4z"></path></svg>');function oo(w,t){const o=ut(t,["children","$$slots","$$events","$$legacy"]),c=ut(o,["size","title"]);We(t,!1);const s=lt(),a=lt();let f=D(t,"size",8,16),l=D(t,"title",8,void 0);it(()=>(Be(o),Be(l())),()=>{h(s,o["aria-label"]||o["aria-labelledby"]||l())}),it(()=>(e(s),Be(o)),()=>{h(a,{"aria-hidden":e(s)?void 0:!0,role:e(s)?"img":void 0,focusable:Number(o.tabindex)===0?!0:void 0})}),Jt(),Zt();var b=ro();De(b,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:f(),height:f(),...e(a),...c}));var O=y(b);{var x=g=>{var C=to(),Y=y(C,!0);p(C),re(()=>ce(Y,l())),d(g,C)};E(O,g=>{l()&&g(x)})}kt(2),p(b),d(w,b),Ue()}var no=dt("<title> </title>"),so=dt('<svg><!><path d="M18,28H14a2,2,0,0,1-2-2V18.41L4.59,11A2,2,0,0,1,4,9.59V6A2,2,0,0,1,6,4H26a2,2,0,0,1,2,2V9.59A2,2,0,0,1,27.41,11L20,18.41V26A2,2,0,0,1,18,28ZM6,6V9.59l8,8V26h4V17.59l8-8V6Z"></path></svg>');function ao(w,t){const o=ut(t,["children","$$slots","$$events","$$legacy"]),c=ut(o,["size","title"]);We(t,!1);const s=lt(),a=lt();let f=D(t,"size",8,16),l=D(t,"title",8,void 0);it(()=>(Be(o),Be(l())),()=>{h(s,o["aria-label"]||o["aria-labelledby"]||l())}),it(()=>(e(s),Be(o)),()=>{h(a,{"aria-hidden":e(s)?void 0:!0,role:e(s)?"img":void 0,focusable:Number(o.tabindex)===0?!0:void 0})}),Jt(),Zt();var b=so();De(b,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:f(),height:f(),...e(a),...c}));var O=y(b);{var x=g=>{var C=no(),Y=y(C,!0);p(C),re(()=>ce(Y,l())),d(g,C)};E(O,g=>{l()&&g(x)})}kt(),p(b),d(w,b),Ue()}const io=qr,lo=Gr,uo=Yr;var co=F('<span class="colored-value svelte-1c4nuvk"><span class="status-dot svelte-1c4nuvk"></span> </span>'),fo=F("<td><!></td>"),po=F('<tr class="svelte-1c4nuvk"></tr>'),ho=F("<!> <!>",1),vo=F("<!> <!>",1),mo=F("<!> <!>",1),yo=F("<!> <!>",1),_o=F('<button class="filter-pill svelte-1c4nuvk"><span> </span> <!></button>'),bo=F('<div class="toolbar-filters svelte-1c4nuvk"><!> <button class="filter-clear-all svelte-1c4nuvk">Clear all</button></div>'),go=F('<div class="empty svelte-1c4nuvk"><p>No entities match your filters.</p> <!></div>'),ko=F('<div class="empty svelte-1c4nuvk"><p>No entities found.</p></div>'),Co=F('<span class="status-dot svelte-1c4nuvk"></span>'),wo=F('<div class="filter-check-label svelte-1c4nuvk"><!> <!> <span> </span></div>'),xo=F('<div class="filter-checks svelte-1c4nuvk"></div>'),Oo=F('<div class="filter-date-range svelte-1c4nuvk"><div class="filter-date-label svelte-1c4nuvk"><span>From</span> <!></div> <div class="filter-date-label svelte-1c4nuvk"><span>To</span> <!></div></div>'),Po=F("<!> <!>",1),So=F('<th class="svelte-1c4nuvk"><div class="th-controls svelte-1c4nuvk"><button><span class="th-label svelte-1c4nuvk"> </span> <span class="th-sort svelte-1c4nuvk"><!></span></button> <!></div></th>'),To=F('<span class="status-dot svelte-1c4nuvk"></span>'),Ao=F('<tr class="group-header svelte-1c4nuvk"><td class="svelte-1c4nuvk"><div class="group-header-content svelte-1c4nuvk"><span><!></span> <!> <span class="group-label svelte-1c4nuvk"> </span> <span class="group-count svelte-1c4nuvk"> </span></div></td></tr> <!>',1),No=F('<div class="table-scroll svelte-1c4nuvk"><table class="list-table svelte-1c4nuvk"><thead class="svelte-1c4nuvk"><tr class="svelte-1c4nuvk"></tr></thead><tbody class="svelte-1c4nuvk"><!></tbody></table></div>'),Do=F('<!> <div class="list-view svelte-1c4nuvk"><div class="list-toolbar svelte-1c4nuvk"><div class="toolbar-left svelte-1c4nuvk"><!> <!> <span class="row-count svelte-1c4nuvk"> </span></div> <!></div> <!></div>',1);function en(w,t){We(t,!0);const o=(r,n=$e)=>{var i=po();_e(i,21,()=>e(B),ze,(u,v)=>{const _=k(()=>$(n(),e(v).key)),A=k(()=>e(s)?Qe(e(s),e(v).key,e(_)):e(v).key==="entity_type"?void 0:Qe(n().entity.entityType,e(v).key,e(_)));var J=fo(),R=y(J);{var I=V=>{var P=co();let S;var ee=y(P);let G;var H=T(ee);p(P),re(te=>{S=nt(P,"",S,{color:e(A)}),G=nt(ee,"",G,{background:e(A)}),ce(H,` ${te??""}`)},[()=>X(e(_),e(v),n().entity.entityType)]),d(V,P)},m=V=>{var P=jt();re(S=>ce(P,S),[()=>X(e(_),e(v),n().entity.entityType)]),d(V,P)};E(R,V=>{e(A)?V(I):V(m,!1)})}p(J),re(()=>yt(J,1,br(e(v).key==="name"?"cell-name":e(v).format==="date"?"cell-date":e(v).key==="collection"||e(v).key==="entity_type"?"cell-meta":""),"svelte-1c4nuvk")),d(u,J)}),p(i),He("click",i,()=>de(n())),d(r,i)},c=k(()=>_t.views.find(r=>r.id===t.data.viewId));mt(()=>{t.data.viewId&&(Cr.showView(t.data.viewId),_t.setActive(t.data.viewId))});let s=L(null),a=L("name"),f=L(!0),l=L(null),b=L(ot({})),O=L(ot({})),x=L(ot({})),g=L(ot(new Set)),C=L(null);mt(()=>{if(e(c)&&e(c).id!==e(C)){h(C,e(c).id,!0);const r=e(c).config;h(s,r.selectedType??null,!0),h(a,r.sortKey??"name",!0),h(f,r.sortAsc??!0,!0),h(l,r.groupBy??null,!0),h(b,r.filters?.text??{},!0);const n={};for(const[i,u]of Object.entries(r.filters?.enum??{}))n[i]=new Set(u);h(O,n,!0),h(x,r.filters?.date??{},!0),h(g,new Set,!0)}});let Y;function M(){e(c)&&(clearTimeout(Y),Y=setTimeout(()=>{const r={selectedType:e(s),groupBy:e(l),sortKey:e(a),sortAsc:e(f),filters:{text:e(b),enum:Object.fromEntries(Object.entries(e(O)).map(([n,i])=>[n,[...i]])),date:e(x)}};_t.update(e(c).id,{config:r})},500))}mt(()=>{e(s),e(a),e(f),e(l),JSON.stringify(e(b)),JSON.stringify(Object.fromEntries(Object.entries(e(O)).map(([r,n])=>[r,[...n]]))),JSON.stringify(e(x)),e(C)&&M()});const se=k(()=>{const r=[];for(const n of Ht.repos)for(const i of n.entities)(!e(s)||i.entityType===e(s))&&r.push({entity:i,collection:n.displayName,repoName:n.name});return r}),Me=k(()=>{const r=new Set;for(const n of Ht.repos)for(const i of n.entities)r.add(i.entityType);return[...r].sort()}),Ie=k(()=>{const r=new Set;for(const n of e(se))for(const i of Object.keys(n.entity.fields))r.add(i);return r}),B=k(()=>Rr(e(s),e(Ie)));function ae(r){e(a)===r?h(f,!e(f)):(h(a,r,!0),h(f,!0))}function oe(r){const n=new Set(e(g));n.has(r)?n.delete(r):n.add(r),h(g,n,!0)}const be=k(()=>e(B).filter(r=>r.filter==="enum"));function q(r){h(l,r==="__none__"?null:r??null,!0),h(g,new Set,!0)}const ft=k(()=>{for(const r of Object.values(e(b)))if(r)return!0;for(const r of Object.values(e(O)))if(r.size)return!0;for(const r of Object.values(e(x)))if(r.from||r.to)return!0;return!1});function Ke(r){return r.filter==="text"?!!e(b)[r.key]:r.filter==="enum"?(e(O)[r.key]?.size??0)>0:r.filter==="date"?!!(e(x)[r.key]?.from||e(x)[r.key]?.to):!1}function ge(){h(b,{},!0),h(O,{},!0),h(x,{},!0)}function Ye(r,n){const i=e(O)[r]??new Set,u=new Set(i);u.has(n)?u.delete(n):u.add(n),h(O,{...e(O),[r]:u},!0)}const we=k(()=>{const r=[];for(const[n,i]of Object.entries(e(b)))if(i){const u=e(B).find(v=>v.key===n);r.push({label:`${u?.label??n}: "${i}"`,clear:()=>{h(b,{...e(b),[n]:""},!0)}})}for(const[n,i]of Object.entries(e(O)))if(i.size){const u=e(B).find(v=>v.key===n);r.push({label:`${u?.label??n}: ${[...i].join(", ")}`,clear:()=>{h(O,{...e(O),[n]:new Set},!0)}})}for(const[n,i]of Object.entries(e(x)))if(i.from||i.to){const u=e(B).find(v=>v.key===n);r.push({label:`${u?.label??n}: ${i.from||"..."} – ${i.to||"..."}`,clear:()=>{h(x,{...e(x),[n]:{from:"",to:""}},!0)}})}return r});function xe(r){const n=new Set;for(const i of e(se)){const u=$(i,r);u&&n.add(u)}return[...n].sort()}function $(r,n){if(n==="name")return r.entity.title;if(n==="entity_type")return r.entity.entityType;if(n==="collection")return r.collection;if(n==="created_at")return r.entity.createdAt??"";const i=r.entity.fields[n];return i==null?"":Array.isArray(i)?i.map(u=>String(u)).join(", "):String(i)}const ie=k(()=>{const r=e(se).filter(i=>{for(const u of e(B)){if(u.filter==="none")continue;const v=$(i,u.key);if(u.filter==="text"){const _=e(b)[u.key];if(_&&!v.toLowerCase().includes(_.toLowerCase()))return!1}else if(u.filter==="enum"){const _=e(O)[u.key];if(_?.size&&!_.has(v))return!1}else if(u.filter==="date"){const _=e(x)[u.key];if(_?.from&&v<_.from||_?.to&&v>_.to)return!1}}return!0}),n=e(B).find(i=>i.key===e(a));return r.sort((i,u)=>{const v=$(i,e(a)),_=$(u,e(a));let A;return n?.sortOrder?A=(n.sortOrder[v]??99)-(n.sortOrder[_]??99):n?.format==="date"?!v&&!_?A=0:v?_?A=v.localeCompare(_):A=-1:A=1:A=v.localeCompare(_),e(f)?A:-A}),r}),Ve=k(()=>{if(!e(l))return null;const r=e(B).find(u=>u.key===e(l)),n=new Map;for(const u of e(ie)){const _=$(u,e(l))||"(empty)";n.has(_)||n.set(_,[]),n.get(_).push(u)}const i=[...n.entries()];return r?.sortOrder&&i.sort((u,v)=>(r.sortOrder[u[0]]??99)-(r.sortOrder[v[0]]??99)),i.map(([u,v])=>({key:u,label:r?.key==="entity_type"?Ze(u):u,rows:v}))});function Xe(r){return r.replace(/\[\[|\]\]/g,"").replace(/[-_]/g," ").replace(/\b\w/g,n=>n.toUpperCase())}function W(r){if(!r)return"";try{return new Date(r).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})}catch{return r}}function j(r){if(!r)return"";const n=Number(r);return isNaN(n)?r:new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",maximumFractionDigits:0}).format(n)}function X(r,n,i){return r?n.format==="date"?W(r):n.format==="wikilink"?Xe(r):n.format==="currency"?j(r):n.key==="entity_type"?Ze(r):r:""}function de(r){gr(`/${r.repoName}/${r.entity.entityType}/${r.entity.id}`)}function tr(r){h(s,r==="__all__"?null:r??null,!0)}var St=Do(),Tt=N(St);kr(Tt,{activeView:"view"});var At=T(Tt,2),pt=y(At),ht=y(pt),Nt=y(ht);{let r=k(()=>e(s)??"__all__");Q(Nt,()=>Kt,(n,i)=>{i(n,{type:"single",get value(){return e(r)},onValueChange:tr,children:(u,v)=>{var _=vo(),A=N(_);{let R=k(()=>e(s)?Ze(e(s)):"All Types");Q(A,()=>Wt,(I,m)=>{m(I,{size:"sm",get value(){return e(R)}})})}var J=T(A,2);Q(J,()=>Ut,(R,I)=>{I(R,{children:(m,V)=>{var P=ho(),S=N(P);Q(S,()=>st,(G,H)=>{H(G,{value:"__all__",label:"All Types"})});var ee=T(S,2);_e(ee,17,()=>e(Me),ze,(G,H)=>{var te=z(),le=N(te);{let Z=k(()=>Ze(e(H)));Q(le,()=>st,(fe,Oe)=>{Oe(fe,{get value(){return e(H)},get label(){return e(Z)}})})}d(G,te)}),d(m,P)},$$slots:{default:!0}})}),d(u,_)},$$slots:{default:!0}})})}var Dt=T(Nt,2);{var rr=r=>{var n=z(),i=N(n);{let u=k(()=>e(l)??"__none__");Q(i,()=>Kt,(v,_)=>{_(v,{type:"single",get value(){return e(u)},onValueChange:q,children:(A,J)=>{var R=yo(),I=N(R);{let V=k(()=>e(l)?`Group: ${e(B).find(P=>P.key===e(l))?.label??e(l)}`:"No grouping");Q(I,()=>Wt,(P,S)=>{S(P,{size:"sm",get value(){return e(V)}})})}var m=T(I,2);Q(m,()=>Ut,(V,P)=>{P(V,{children:(S,ee)=>{var G=mo(),H=N(G);Q(H,()=>st,(le,Z)=>{Z(le,{value:"__none__",label:"No grouping"})});var te=T(H,2);_e(te,17,()=>e(be),ze,(le,Z)=>{var fe=z(),Oe=N(fe);Q(Oe,()=>st,(U,pe)=>{pe(U,{get value(){return e(Z).key},get label(){return e(Z).label}})}),d(le,fe)}),d(S,G)},$$slots:{default:!0}})}),d(A,R)},$$slots:{default:!0}})})}d(r,n)};E(Dt,r=>{e(be).length>0&&r(rr)})}var Ft=T(Dt,2),or=y(Ft);p(Ft),p(ht);var nr=T(ht,2);{var sr=r=>{var n=bo(),i=y(n);_e(i,17,()=>e(we),ze,(v,_)=>{var A=_o(),J=y(A),R=y(J,!0);p(J);var I=T(J,2);Hr(I,{size:10}),p(A),re(()=>ce(R,e(_).label)),He("click",A,function(...m){e(_).clear?.apply(this,m)}),d(v,A)});var u=T(i,2);p(n),He("click",u,ge),d(r,n)};E(nr,r=>{e(ft)&&r(sr)})}p(pt);var ar=T(pt,2);{var ir=r=>{var n=go(),i=T(y(n),2);Lr(i,{variant:"ghost",onclick:ge,children:(u,v)=>{kt();var _=jt("Clear filters");d(u,_)},$$slots:{default:!0}}),p(n),d(r,n)},lr=r=>{var n=ko();d(r,n)},ur=r=>{var n=No(),i=y(n),u=y(i),v=y(u);_e(v,21,()=>e(B),ze,(I,m)=>{var V=So(),P=y(V),S=y(P),ee=y(S),G=y(ee,!0);p(ee);var H=T(ee,2),te=y(H);{var le=U=>{var pe=z(),Pe=N(pe);{var Ge=ue=>{wr(ue,{size:12})},Ee=ue=>{xr(ue,{size:12})};E(Pe,ue=>{e(f)?ue(Ge):ue(Ee,!1)})}d(U,pe)},Z=U=>{oo(U,{size:12})};E(te,U=>{e(a)===e(m).key?U(le):U(Z,!1)})}p(H),p(S);var fe=T(S,2);{var Oe=U=>{var pe=z(),Pe=N(pe);Q(Pe,()=>io,(Ge,Ee)=>{Ee(Ge,{children:(ue,Mt)=>{var Re=Po(),et=N(Re);{let he=k(()=>Ke(e(m))?"filter-active":"");Q(et,()=>lo,(ke,ve)=>{ve(ke,{get class(){return`th-filter-btn ${e(he)??""}`},children:(tt,vt)=>{ao(tt,{size:12})},$$slots:{default:!0}})})}var ne=T(et,2);Q(ne,()=>uo,(he,ke)=>{ke(he,{class:"filter-popover",sideOffset:4,align:"start",children:(ve,tt)=>{var vt=z(),cr=N(vt);{var dr=me=>{{let ye=k(()=>e(b)[e(m).key]??"");bt(me,{class:"filter-text-input",type:"text",placeholder:"Filter...",get value(){return e(ye)},oninput:Se=>{h(b,{...e(b),[e(m).key]:Se.currentTarget.value},!0)}})}},fr=me=>{var ye=xo();_e(ye,21,()=>xe(e(m).key),ze,(Se,Ce)=>{var Te=wo(),rt=y(Te);{let Ae=k(()=>e(O)[e(m).key]?.has(e(Ce))??!1);zr(rt,{get checked(){return e(Ae)}})}var je=T(rt,2);{var qe=Ae=>{var Vt=Co();let Et;re(mr=>Et=nt(Vt,"",Et,mr),[()=>({background:Qe(e(s),e(m).key,e(Ce))})]),d(Ae,Vt)},hr=k(()=>e(m).key!=="entity_type"&&e(m).key!=="collection"&&e(s)&&Qe(e(s),e(m).key,e(Ce)));E(je,Ae=>{e(hr)&&Ae(qe)})}var It=T(je,2),vr=y(It,!0);p(It),p(Te),re(Ae=>ce(vr,Ae),[()=>e(m).key==="entity_type"?Ze(e(Ce)):e(Ce)]),He("click",Te,()=>Ye(e(m).key,e(Ce))),d(Se,Te)}),p(ye),d(me,ye)},pr=me=>{var ye=Oo(),Se=y(ye),Ce=T(y(Se),2);{let je=k(()=>e(x)[e(m).key]?.from??"");bt(Ce,{type:"date",class:"filter-date-input",get value(){return e(je)},oninput:qe=>{h(x,{...e(x),[e(m).key]:{from:qe.currentTarget.value,to:e(x)[e(m).key]?.to??""}},!0)}})}p(Se);var Te=T(Se,2),rt=T(y(Te),2);{let je=k(()=>e(x)[e(m).key]?.to??"");bt(rt,{type:"date",class:"filter-date-input",get value(){return e(je)},oninput:qe=>{h(x,{...e(x),[e(m).key]:{from:e(x)[e(m).key]?.from??"",to:qe.currentTarget.value}},!0)}})}p(Te),p(ye),d(me,ye)};E(cr,me=>{e(m).filter==="text"?me(dr):e(m).filter==="enum"?me(fr,1):e(m).filter==="date"&&me(pr,2)})}d(ve,vt)},$$slots:{default:!0}})}),d(ue,Re)},$$slots:{default:!0}})}),d(U,pe)};E(fe,U=>{e(m).filter!=="none"&&U(Oe)})}p(P),p(V),re(()=>{yt(S,1,`th-sort-btn ${e(a)===e(m).key?"sort-active":""}`,"svelte-1c4nuvk"),ce(G,e(m).label)}),He("click",S,()=>ae(e(m).key)),d(I,V)}),p(v),p(u);var _=T(u),A=y(_);{var J=I=>{var m=z(),V=N(m);_e(V,17,()=>e(Ve),P=>P.key,(P,S)=>{const ee=k(()=>e(s)&&e(l)?Qe(e(s),e(l),e(S).key):void 0);var G=Ao(),H=N(G),te=y(H),le=y(te),Z=y(le);let fe;var Oe=y(Z);jr(Oe,{size:14}),p(Z);var U=T(Z,2);{var pe=ne=>{var he=To();let ke;re(()=>ke=nt(he,"",ke,{background:e(ee)})),d(ne,he)};E(U,ne=>{e(ee)&&ne(pe)})}var Pe=T(U,2),Ge=y(Pe,!0);p(Pe);var Ee=T(Pe,2),ue=y(Ee,!0);p(Ee),p(le),p(te),p(H);var Mt=T(H,2);{var Re=ne=>{var he=z(),ke=N(he);_e(ke,17,()=>e(S).rows,ve=>ve.repoName+"/"+ve.entity.entityType+"/"+ve.entity.id,(ve,tt)=>{o(ve,()=>e(tt))}),d(ne,he)},et=k(()=>!e(g).has(e(S).key));E(Mt,ne=>{e(et)&&ne(Re)})}re(ne=>{_r(te,"colspan",e(B).length),fe=yt(Z,1,"group-chevron svelte-1c4nuvk",null,fe,ne),ce(Ge,e(S).label),ce(ue,e(S).rows.length)},[()=>({collapsed:e(g).has(e(S).key)})]),He("click",H,()=>oe(e(S).key)),d(P,G)}),d(I,m)},R=I=>{var m=z(),V=N(m);_e(V,17,()=>e(ie),P=>P.repoName+"/"+P.entity.entityType+"/"+P.entity.id,(P,S)=>{o(P,()=>e(S))}),d(I,m)};E(A,I=>{e(Ve)?I(J):I(R,!1)})}p(_),p(i),p(n),d(r,n)};E(ar,r=>{e(ie).length===0&&e(se).length>0?r(ir):e(ie).length===0?r(lr,1):r(ur,!1)})}p(At),re(()=>ce(or,`${e(ie).length??""} ${e(ie).length===1?"entity":"entities"}`)),d(w,St),Ue()}yr(["click"]);export{en as component,Ro as universal};
1
+ import{o as Je,p as qt,c as z,a as d,b as F,s as ce,f as dt,d as yr,e as He,t as jt}from"../chunks/b0XUoOIH.js";import{e as L,s as h,g as e,a4 as k,p as We,a0 as N,b as Ue,c as y,ae as $e,r as p,l as it,d as Be,a as Jt,n as kt,m as lt,t as re,a2 as mt,f as ot,a3 as T}from"../chunks/DSh-OF2y.js";import{i as E}from"../chunks/DT3KtxWU.js";import{e as _e,i as ze}from"../chunks/DHtLlmE0.js";import{c as Q}from"../chunks/DCVmM0L5.js";import{s as Ne,a as De,b as nt,c as _r}from"../chunks/CRnhIQbv.js";import{s as yt,c as br}from"../chunks/CFtRXHDP.js";import{g as gr}from"../chunks/BAAbylyg.js";import{V as kr}from"../chunks/By_Wtb5J.js";import{n as Cr}from"../chunks/DC9z5DEo.js";import{v as _t}from"../chunks/0wBGAod7.js";import{w as Ht}from"../chunks/DSkxw4Ss.js";import{f as Ze}from"../chunks/CdeYcEuU.js";import{i as Zt}from"../chunks/vZ2iBqLE.js";import{p as D,s as zt,r as Qt,l as ut}from"../chunks/D-yNNNdf.js";import{A as wr,a as xr}from"../chunks/DiWKchgv.js";import{w as Ct,q as Or,r as Fe,C as Pr,s as $t,t as Sr,u as ct,E as Tr,v as Ar,x as Rt,y as Nr,z as Dr,A as Lt,b as K,B as Fr,c as er,n as Le,P as Mr,f as Ir,m as at,h as Bt,k as Vr,F as Er,G as jr}from"../chunks/DQYNi3YK.js";import{C as Hr}from"../chunks/BPXdu_FX.js";import{S as Wt,a as Ut,b as st,R as Kt,C as zr}from"../chunks/Bt5_mycY.js";import{B as Lr}from"../chunks/DQ5NTKSo.js";import{I as bt}from"../chunks/APIqItee.js";function Yt(w,t){const[o,c]=w;let s=!1;const a=t.length;for(let f=0,l=a-1;f<a;l=f++){const[b,O]=t[f]??[0,0],[x,g]=t[l]??[0,0];O>=c!=g>=c&&o<=(x-b)*(c-O)/(g-O)+b&&(s=!s)}return s}function Xt(w,t){return w[0]>=t.left&&w[0]<=t.right&&w[1]>=t.top&&w[1]<=t.bottom}function Br(w,t){const o=w.left+w.width/2,c=w.top+w.height/2,s=t.left+t.width/2,a=t.top+t.height/2,f=s-o,l=a-c;return Math.abs(f)>Math.abs(l)?f>0?"right":"left":l>0?"bottom":"top"}class Wr{#e;#n;#r=null;#t=null;#s=null;#i(){this.#s!==null&&(cancelAnimationFrame(this.#s),this.#s=null)}#u(){this.#i(),this.#s=requestAnimationFrame(()=>{this.#s=null,!(!this.#r||!this.#t)&&(this.#o(),this.#e.onPointerExit())})}constructor(t){this.#e=t,this.#n=t.buffer??1,Ct([t.triggerNode,t.contentNode,t.enabled],([o,c,s])=>{if(!o||!c||!s){this.#o();return}const a=Or(o),f=g=>{this.#a([g.clientX,g.clientY],o,c)},l=g=>{const C=g.relatedTarget;if(Fe(C)&&c.contains(C))return;const Y=this.#e.ignoredTargets?.()??[];if(!(Fe(C)&&Y.some(M=>M===C||M.contains(C)))){if(Fe(C)&&!o.contains(C)&&!c.contains(C)&&!C.contains(c)){this.#o(),this.#e.onPointerExit();return}this.#r=[g.clientX,g.clientY],this.#t="content",this.#u()}},b=()=>{this.#o()},O=()=>{this.#o()},x=g=>{const C=g.relatedTarget;Fe(C)&&o.contains(C)||(this.#r=[g.clientX,g.clientY],this.#t="trigger",this.#u())};return[Je(a,"pointermove",f),Je(o,"pointerleave",l),Je(o,"pointerenter",b),Je(c,"pointerenter",O),Je(c,"pointerleave",x)].reduce((g,C)=>()=>{g(),C()},()=>{})})}#a(t,o,c){if(!this.#r||!this.#t)return;this.#i();const s=o.getBoundingClientRect(),a=c.getBoundingClientRect();if(this.#t==="content"&&Xt(t,a)){this.#o();return}if(this.#t==="trigger"&&Xt(t,s)){this.#o();return}const f=Br(s,a),l=this.#l(s,a,f);if(l&&Yt(t,l))return;const b=this.#t==="content"?a:s,O=this.#c(this.#r,b,f,this.#t);Yt(t,O)||(this.#o(),this.#e.onPointerExit())}#o(){this.#r=null,this.#t=null,this.#i()}#l(t,o,c){const s=this.#n;switch(c){case"top":return[[Math.min(t.left,o.left)-s,t.top],[Math.min(t.left,o.left)-s,o.bottom],[Math.max(t.right,o.right)+s,o.bottom],[Math.max(t.right,o.right)+s,t.top]];case"bottom":return[[Math.min(t.left,o.left)-s,t.bottom],[Math.min(t.left,o.left)-s,o.top],[Math.max(t.right,o.right)+s,o.top],[Math.max(t.right,o.right)+s,t.bottom]];case"left":return[[t.left,Math.min(t.top,o.top)-s],[o.right,Math.min(t.top,o.top)-s],[o.right,Math.max(t.bottom,o.bottom)+s],[t.left,Math.max(t.bottom,o.bottom)+s]];case"right":return[[t.right,Math.min(t.top,o.top)-s],[o.left,Math.min(t.top,o.top)-s],[o.left,Math.max(t.bottom,o.bottom)+s],[t.right,Math.max(t.bottom,o.bottom)+s]]}}#c(t,o,c,s){const a=this.#n*4,[f,l]=t;switch(s==="trigger"?this.#d(c):c){case"top":return[[f-a,l+a],[f+a,l+a],[o.right+a,o.bottom],[o.right+a,o.top],[o.left-a,o.top],[o.left-a,o.bottom]];case"bottom":return[[f-a,l-a],[f+a,l-a],[o.right+a,o.top],[o.right+a,o.bottom],[o.left-a,o.bottom],[o.left-a,o.top]];case"left":return[[f+a,l-a],[f+a,l+a],[o.right,o.bottom+a],[o.left,o.bottom+a],[o.left,o.top-a],[o.right,o.top-a]];case"right":return[[f-a,l-a],[f-a,l+a],[o.left,o.bottom+a],[o.right,o.bottom+a],[o.right,o.top-a],[o.left,o.top-a]]}}#d(t){switch(t){case"top":return"bottom";case"bottom":return"top";case"left":return"right";case"right":return"left"}}}const gt=Fr({component:"popover",parts:["root","trigger","content","close","overlay"]}),wt=new Pr("Popover.Root");class xt{static create(t){return wt.set(new xt(t))}opts;#e=L(null);get contentNode(){return e(this.#e)}set contentNode(t){h(this.#e,t,!0)}contentPresence;#n=L(null);get triggerNode(){return e(this.#n)}set triggerNode(t){h(this.#n,t,!0)}#r=L(null);get overlayNode(){return e(this.#r)}set overlayNode(t){h(this.#r,t,!0)}overlayPresence;#t=L(!1);get openedViaHover(){return e(this.#t)}set openedViaHover(t){h(this.#t,t,!0)}#s=L(!1);get hasInteractedWithContent(){return e(this.#s)}set hasInteractedWithContent(t){h(this.#s,t,!0)}#i=L(!1);get hoverCooldown(){return e(this.#i)}set hoverCooldown(t){h(this.#i,t,!0)}#u=L(0);get closeDelay(){return e(this.#u)}set closeDelay(t){h(this.#u,t,!0)}#a=null;#o=null;constructor(t){this.opts=t,this.contentPresence=new Lt({ref:K(()=>this.contentNode),open:this.opts.open,onComplete:()=>{this.opts.onOpenChangeComplete.current(this.opts.open.current)}}),this.overlayPresence=new Lt({ref:K(()=>this.overlayNode),open:this.opts.open}),Ct(()=>this.opts.open.current,o=>{o||(this.openedViaHover=!1,this.hasInteractedWithContent=!1,this.#l())})}setDomContext(t){this.#o=t}#l(){this.#a!==null&&this.#o&&(this.#o.clearTimeout(this.#a),this.#a=null)}toggleOpen(){this.#l(),this.opts.open.current=!this.opts.open.current}handleClose(){this.#l(),this.opts.open.current&&(this.opts.open.current=!1)}handleHoverOpen(){this.#l(),!this.opts.open.current&&(this.openedViaHover=!0,this.opts.open.current=!0)}handleHoverClose(){this.opts.open.current&&this.openedViaHover&&!this.hasInteractedWithContent&&(this.opts.open.current=!1)}handleDelayedHoverClose(){this.opts.open.current&&(!this.openedViaHover||this.hasInteractedWithContent||(this.#l(),this.closeDelay<=0?this.opts.open.current=!1:this.#o&&(this.#a=this.#o.setTimeout(()=>{this.openedViaHover&&!this.hasInteractedWithContent&&(this.opts.open.current=!1),this.#a=null},this.closeDelay))))}cancelDelayedClose(){this.#l()}markInteraction(){this.hasInteractedWithContent=!0,this.#l()}}class Ot{static create(t){return new Ot(t,wt.get())}opts;root;attachment;domContext;#e=null;#n=null;#r=L(!1);constructor(t,o){this.opts=t,this.root=o,this.attachment=$t(this.opts.ref,c=>this.root.triggerNode=c),this.domContext=new Sr(t.ref),this.root.setDomContext(this.domContext),this.onclick=this.onclick.bind(this),this.onkeydown=this.onkeydown.bind(this),this.onpointerenter=this.onpointerenter.bind(this),this.onpointerleave=this.onpointerleave.bind(this),Ct(()=>this.opts.closeDelay.current,c=>{this.root.closeDelay=c})}#t(){this.#e!==null&&(this.domContext.clearTimeout(this.#e),this.#e=null)}#s(){this.#n!==null&&(this.domContext.clearTimeout(this.#n),this.#n=null)}#i(){this.#t(),this.#s()}onpointerenter(t){if(this.opts.disabled.current||!this.opts.openOnHover.current||ct(t)||(h(this.#r,!0),this.#s(),this.root.cancelDelayedClose(),this.root.opts.open.current||this.root.hoverCooldown))return;const o=this.opts.openDelay.current;o<=0?this.root.handleHoverOpen():this.#e=this.domContext.setTimeout(()=>{this.root.handleHoverOpen(),this.#e=null},o)}onpointerleave(t){this.opts.disabled.current||this.opts.openOnHover.current&&(ct(t)||(h(this.#r,!1),this.#t(),this.root.hoverCooldown=!1))}onclick(t){if(!this.opts.disabled.current&&t.button===0){if(this.#i(),e(this.#r)&&this.root.opts.open.current&&this.root.openedViaHover){this.root.openedViaHover=!1,this.root.hasInteractedWithContent=!0;return}e(this.#r)&&this.opts.openOnHover.current&&this.root.opts.open.current&&(this.root.hoverCooldown=!0),this.root.hoverCooldown&&!this.root.opts.open.current&&(this.root.hoverCooldown=!1),this.root.toggleOpen()}}onkeydown(t){this.opts.disabled.current||(t.key===Tr||t.key===Ar)&&(t.preventDefault(),this.#i(),this.root.toggleOpen())}#u(){if(this.root.opts.open.current&&this.root.contentNode?.id)return this.root.contentNode?.id}#a=k(()=>({id:this.opts.id.current,"aria-haspopup":"dialog","aria-expanded":Nr(this.root.opts.open.current),"data-state":Rt(this.root.opts.open.current),"aria-controls":this.#u(),[gt.trigger]:"",disabled:this.opts.disabled.current,onkeydown:this.onkeydown,onclick:this.onclick,onpointerenter:this.onpointerenter,onpointerleave:this.onpointerleave,...this.attachment}));get props(){return e(this.#a)}set props(t){h(this.#a,t)}}class Pt{static create(t){return new Pt(t,wt.get())}opts;root;attachment;constructor(t,o){this.opts=t,this.root=o,this.attachment=$t(this.opts.ref,c=>this.root.contentNode=c),this.onpointerdown=this.onpointerdown.bind(this),this.onfocusin=this.onfocusin.bind(this),this.onpointerenter=this.onpointerenter.bind(this),this.onpointerleave=this.onpointerleave.bind(this),new Wr({triggerNode:()=>this.root.triggerNode,contentNode:()=>this.root.contentNode,enabled:()=>this.root.opts.open.current&&this.root.openedViaHover&&!this.root.hasInteractedWithContent,onPointerExit:()=>{this.root.handleDelayedHoverClose()}})}onpointerdown(t){this.root.markInteraction()}onfocusin(t){const o=t.target;Fe(o)&&Dr(o)&&this.root.markInteraction()}onpointerenter(t){ct(t)||this.root.cancelDelayedClose()}onpointerleave(t){ct(t)}onInteractOutside=t=>{if(this.opts.onInteractOutside.current(t),t.defaultPrevented||!Fe(t.target))return;const o=t.target.closest(gt.selector("trigger"));if(!(o&&o===this.root.triggerNode)){if(this.opts.customAnchor.current){if(Fe(this.opts.customAnchor.current)){if(this.opts.customAnchor.current.contains(t.target))return}else if(typeof this.opts.customAnchor.current=="string"){const c=document.querySelector(this.opts.customAnchor.current);if(c&&c.contains(t.target))return}}this.root.handleClose()}};onEscapeKeydown=t=>{this.opts.onEscapeKeydown.current(t),!t.defaultPrevented&&this.root.handleClose()};get shouldRender(){return this.root.contentPresence.shouldRender}get shouldTrapFocus(){return!(this.root.openedViaHover&&!this.root.hasInteractedWithContent)}#e=k(()=>({open:this.root.opts.open.current}));get snippetProps(){return e(this.#e)}set snippetProps(t){h(this.#e,t)}#n=k(()=>({id:this.opts.id.current,tabindex:-1,"data-state":Rt(this.root.opts.open.current),[gt.content]:"",style:{pointerEvents:"auto",contain:"layout style"},onpointerdown:this.onpointerdown,onfocusin:this.onfocusin,onpointerenter:this.onpointerenter,onpointerleave:this.onpointerleave,...this.attachment}));get props(){return e(this.#n)}set props(t){h(this.#n,t)}popperProps={onInteractOutside:this.onInteractOutside,onEscapeKeydown:this.onEscapeKeydown}}var Ur=F("<div><div><!></div></div>"),Kr=F("<div><div><!></div></div>");function Yr(w,t){const o=qt();We(t,!0);let c=D(t,"ref",15,null),s=D(t,"id",19,()=>er(o)),a=D(t,"forceMount",3,!1),f=D(t,"onOpenAutoFocus",3,Le),l=D(t,"onCloseAutoFocus",3,Le),b=D(t,"onEscapeKeydown",3,Le),O=D(t,"onInteractOutside",3,Le),x=D(t,"trapFocus",3,!0),g=D(t,"preventScroll",3,!1),C=D(t,"customAnchor",3,null),Y=Qt(t,["$$slots","$$events","$$legacy","child","children","ref","id","forceMount","onOpenAutoFocus","onCloseAutoFocus","onEscapeKeydown","onInteractOutside","trapFocus","preventScroll","customAnchor","style"]);const M=Pt.create({id:K(()=>s()),ref:K(()=>c(),q=>c(q)),onInteractOutside:K(()=>O()),onEscapeKeydown:K(()=>b()),customAnchor:K(()=>C())}),se=k(()=>at(Y,M.props)),Me=k(()=>x()&&M.shouldTrapFocus);function Ie(q){M.shouldTrapFocus||q.preventDefault(),f()(q)}var B=z(),ae=N(B);{var oe=q=>{Mr(q,zt(()=>e(se),()=>M.popperProps,{get ref(){return M.opts.ref},get enabled(){return M.root.opts.open.current},get id(){return s()},get trapFocus(){return e(Me)},get preventScroll(){return g()},loop:!0,forceMount:!0,get customAnchor(){return C()},onOpenAutoFocus:Ie,get onCloseAutoFocus(){return l()},get shouldRender(){return M.shouldRender},popper:(Ke,ge)=>{let Ye=()=>ge?.().props,we=()=>ge?.().wrapperProps;const xe=k(()=>at(Ye(),{style:Bt("popover")},{style:t.style}));var $=z(),ie=N($);{var Ve=W=>{var j=z(),X=N(j);{let de=k(()=>({props:e(xe),wrapperProps:we(),...M.snippetProps}));Ne(X,()=>t.child,()=>e(de))}d(W,j)},Xe=W=>{var j=Ur();De(j,()=>({...we()}));var X=y(j);De(X,()=>({...e(xe)}));var de=y(X);Ne(de,()=>t.children??$e),p(X),p(j),d(W,j)};E(ie,W=>{t.child?W(Ve):W(Xe,!1)})}d(Ke,$)},$$slots:{popper:!0}}))},be=q=>{Ir(q,zt(()=>e(se),()=>M.popperProps,{get ref(){return M.opts.ref},get open(){return M.root.opts.open.current},get id(){return s()},get trapFocus(){return e(Me)},get preventScroll(){return g()},loop:!0,forceMount:!1,get customAnchor(){return C()},onOpenAutoFocus:Ie,get onCloseAutoFocus(){return l()},get shouldRender(){return M.shouldRender},popper:(Ke,ge)=>{let Ye=()=>ge?.().props,we=()=>ge?.().wrapperProps;const xe=k(()=>at(Ye(),{style:Bt("popover")},{style:t.style}));var $=z(),ie=N($);{var Ve=W=>{var j=z(),X=N(j);{let de=k(()=>({props:e(xe),wrapperProps:we(),...M.snippetProps}));Ne(X,()=>t.child,()=>e(de))}d(W,j)},Xe=W=>{var j=Kr();De(j,()=>({...we()}));var X=y(j);De(X,()=>({...e(xe)}));var de=y(X);Ne(de,()=>t.children??$e),p(X),p(j),d(W,j)};E(ie,W=>{t.child?W(Ve):W(Xe,!1)})}d(Ke,$)},$$slots:{popper:!0}}))};E(ae,q=>{a()?q(oe):a()||q(be,1)})}d(w,B),Ue()}var Xr=F("<button><!></button>");function Gr(w,t){const o=qt();We(t,!0);let c=D(t,"id",19,()=>er(o)),s=D(t,"ref",15,null),a=D(t,"type",3,"button"),f=D(t,"disabled",3,!1),l=D(t,"openOnHover",3,!1),b=D(t,"openDelay",3,700),O=D(t,"closeDelay",3,300),x=Qt(t,["$$slots","$$events","$$legacy","children","child","id","ref","type","disabled","openOnHover","openDelay","closeDelay"]);const g=Ot.create({id:K(()=>c()),ref:K(()=>s(),Y=>s(Y)),disabled:K(()=>!!f()),openOnHover:K(()=>l()),openDelay:K(()=>b()),closeDelay:K(()=>O())}),C=k(()=>at(x,g.props,{type:a()}));Vr(w,{get id(){return c()},get ref(){return g.opts.ref},children:(Y,M)=>{var se=z(),Me=N(se);{var Ie=ae=>{var oe=z(),be=N(oe);Ne(be,()=>t.child,()=>({props:e(C)})),d(ae,oe)},B=ae=>{var oe=Xr();De(oe,()=>({...e(C)}));var be=y(oe);Ne(be,()=>t.children??$e),p(oe),d(ae,oe)};E(Me,ae=>{t.child?ae(Ie):ae(B,!1)})}d(Y,se)},$$slots:{default:!0}}),Ue()}function qr(w,t){We(t,!0);let o=D(t,"open",15,!1),c=D(t,"onOpenChange",3,Le),s=D(t,"onOpenChangeComplete",3,Le);xt.create({open:K(()=>o(),a=>{o(a),c()(a)}),onOpenChangeComplete:K(()=>s())}),Er(w,{children:(a,f)=>{var l=z(),b=N(l);Ne(b,()=>t.children??$e),d(a,l)},$$slots:{default:!0}}),Ue()}function Jr({params:w}){return{viewId:Number(w.id)}}const Ro=Object.freeze(Object.defineProperty({__proto__:null,load:Jr},Symbol.toStringTag,{value:"Module"})),Zr=[{key:"name",label:"Name",filter:"text"},{key:"entity_type",label:"Type",filter:"enum"},{key:"collection",label:"Collection",filter:"enum"},{key:"created_at",label:"Created",filter:"date",format:"date"}],Gt=[{key:"collection",label:"Collection",filter:"enum"},{key:"created_at",label:"Created",filter:"date",format:"date"}],Qr={task:[{key:"name",label:"Name",filter:"text"},{key:"status",label:"Status",filter:"enum",sortOrder:{open:0,"in-progress":1,done:2,cancelled:3}},{key:"priority",label:"Priority",filter:"enum",sortOrder:{urgent:0,high:1,medium:2,low:3}},{key:"assignee",label:"Assignee",filter:"enum",format:"wikilink"},{key:"due_date",label:"Due Date",filter:"date",format:"date"}],project:[{key:"name",label:"Name",filter:"text"},{key:"status",label:"Status",filter:"enum"},{key:"client",label:"Client",filter:"text"},{key:"start_date",label:"Start",filter:"date",format:"date"},{key:"end_date",label:"End",filter:"date",format:"date"}],person:[{key:"name",label:"Name",filter:"text"},{key:"role",label:"Role",filter:"text"},{key:"status",label:"Status",filter:"enum"},{key:"email",label:"Email",filter:"text"},{key:"organization",label:"Org",filter:"enum",format:"wikilink"}],meeting:[{key:"name",label:"Name",filter:"text"},{key:"attendees",label:"Attendees",filter:"text",format:"wikilink"},{key:"date",label:"Date",filter:"date",format:"date"}],deal:[{key:"name",label:"Name",filter:"text"},{key:"client",label:"Client",filter:"enum",format:"wikilink"},{key:"stage",label:"Stage",filter:"enum"},{key:"deal_value",label:"Value",filter:"none",format:"currency"},{key:"expected_close",label:"Close Date",filter:"date",format:"date"}],decision:[{key:"name",label:"Name",filter:"text"},{key:"status",label:"Status",filter:"enum"},{key:"decision_makers",label:"Decision Makers",filter:"text",format:"wikilink"}],document:[{key:"name",label:"Name",filter:"text"},{key:"category",label:"Category",filter:"enum"},{key:"project",label:"Project",filter:"enum",format:"wikilink"},{key:"status",label:"Status",filter:"enum"}],deliverable:[{key:"name",label:"Name",filter:"text"},{key:"project",label:"Project",filter:"enum",format:"wikilink"},{key:"status",label:"Status",filter:"enum"},{key:"due_date",label:"Due Date",filter:"date",format:"date"}],note:[{key:"name",label:"Name",filter:"text"},{key:"category",label:"Category",filter:"enum"}],publication:[{key:"name",label:"Name",filter:"text"},{key:"category",label:"Category",filter:"enum"},{key:"status",label:"Status",filter:"enum"},{key:"platform",label:"Platform",filter:"enum"}],organization:[{key:"name",label:"Name",filter:"text"},{key:"category",label:"Category",filter:"enum"},{key:"status",label:"Status",filter:"enum"},{key:"industry",label:"Industry",filter:"text"}]},$r=new Set(["name","entity_type","entity_id","created_at","updated_at","created_by","updated_by","tags","date"]);function Rr(w,t){if(!w)return Zr;const o=Qr[w];if(o)return[...o,...Gt];const c=[{key:"name",label:"Name",filter:"text"}];if(t)for(const s of t){if($r.has(s))continue;const a=s.replace(/_/g," ").replace(/\b\w/g,l=>l.toUpperCase()),f=s.endsWith("_date")||s==="date";c.push({key:s,label:a,filter:f?"date":"text",format:f?"date":void 0})}return[...c,...Gt]}const eo={"task.status":{open:"#f0c246","in-progress":"#3ecf8e",done:"#5c5c66",cancelled:"#e54d4d"},"task.priority":{urgent:"#e54d4d",high:"#f0c246",medium:"#5c5c66",low:"var(--color-text-tertiary)"},"project.status":{planning:"#f0c246",scoping:"#f0c246",active:"#3ecf8e","on-hold":"#5c5c66",completed:"#5c5c66",archived:"#5c5c66"},"deal.stage":{scoping:"#f0c246",proposal:"#5a70b0",negotiating:"#3ecf8e",won:"#78d098",lost:"#e54d4d"},"decision.status":{proposed:"#f0c246",accepted:"#3ecf8e",rejected:"#e54d4d",deprecated:"#5c5c66",superseded:"#5c5c66"},"document.status":{draft:"#f0c246",sent:"#5a70b0",accepted:"#3ecf8e",rejected:"#e54d4d",signed:"#78d098"},"deliverable.status":{planned:"#f0c246","in-progress":"#3ecf8e",delivered:"#5c5c66",accepted:"#78d098",rejected:"#e54d4d"},"publication.status":{draft:"#f0c246",review:"#5a70b0",scheduled:"#3ecf8e",published:"#5c5c66"}};function Qe(w,t,o){return eo[`${w}.${t}`]?.[o]}var to=dt("<title> </title>"),ro=dt('<svg><!><path d="M16 28 9 21 10.41 19.59 16 25.17 21.59 19.59 23 21 16 28z"></path><path d="M16 4 23 11 21.59 12.41 16 6.83 10.41 12.41 9 11 16 4z"></path></svg>');function oo(w,t){const o=ut(t,["children","$$slots","$$events","$$legacy"]),c=ut(o,["size","title"]);We(t,!1);const s=lt(),a=lt();let f=D(t,"size",8,16),l=D(t,"title",8,void 0);it(()=>(Be(o),Be(l())),()=>{h(s,o["aria-label"]||o["aria-labelledby"]||l())}),it(()=>(e(s),Be(o)),()=>{h(a,{"aria-hidden":e(s)?void 0:!0,role:e(s)?"img":void 0,focusable:Number(o.tabindex)===0?!0:void 0})}),Jt(),Zt();var b=ro();De(b,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:f(),height:f(),...e(a),...c}));var O=y(b);{var x=g=>{var C=to(),Y=y(C,!0);p(C),re(()=>ce(Y,l())),d(g,C)};E(O,g=>{l()&&g(x)})}kt(2),p(b),d(w,b),Ue()}var no=dt("<title> </title>"),so=dt('<svg><!><path d="M18,28H14a2,2,0,0,1-2-2V18.41L4.59,11A2,2,0,0,1,4,9.59V6A2,2,0,0,1,6,4H26a2,2,0,0,1,2,2V9.59A2,2,0,0,1,27.41,11L20,18.41V26A2,2,0,0,1,18,28ZM6,6V9.59l8,8V26h4V17.59l8-8V6Z"></path></svg>');function ao(w,t){const o=ut(t,["children","$$slots","$$events","$$legacy"]),c=ut(o,["size","title"]);We(t,!1);const s=lt(),a=lt();let f=D(t,"size",8,16),l=D(t,"title",8,void 0);it(()=>(Be(o),Be(l())),()=>{h(s,o["aria-label"]||o["aria-labelledby"]||l())}),it(()=>(e(s),Be(o)),()=>{h(a,{"aria-hidden":e(s)?void 0:!0,role:e(s)?"img":void 0,focusable:Number(o.tabindex)===0?!0:void 0})}),Jt(),Zt();var b=so();De(b,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:f(),height:f(),...e(a),...c}));var O=y(b);{var x=g=>{var C=no(),Y=y(C,!0);p(C),re(()=>ce(Y,l())),d(g,C)};E(O,g=>{l()&&g(x)})}kt(),p(b),d(w,b),Ue()}const io=qr,lo=Gr,uo=Yr;var co=F('<span class="colored-value svelte-1c4nuvk"><span class="status-dot svelte-1c4nuvk"></span> </span>'),fo=F("<td><!></td>"),po=F('<tr class="svelte-1c4nuvk"></tr>'),ho=F("<!> <!>",1),vo=F("<!> <!>",1),mo=F("<!> <!>",1),yo=F("<!> <!>",1),_o=F('<button class="filter-pill svelte-1c4nuvk"><span> </span> <!></button>'),bo=F('<div class="toolbar-filters svelte-1c4nuvk"><!> <button class="filter-clear-all svelte-1c4nuvk">Clear all</button></div>'),go=F('<div class="empty svelte-1c4nuvk"><p>No entities match your filters.</p> <!></div>'),ko=F('<div class="empty svelte-1c4nuvk"><p>No entities found.</p></div>'),Co=F('<span class="status-dot svelte-1c4nuvk"></span>'),wo=F('<div class="filter-check-label svelte-1c4nuvk"><!> <!> <span> </span></div>'),xo=F('<div class="filter-checks svelte-1c4nuvk"></div>'),Oo=F('<div class="filter-date-range svelte-1c4nuvk"><div class="filter-date-label svelte-1c4nuvk"><span>From</span> <!></div> <div class="filter-date-label svelte-1c4nuvk"><span>To</span> <!></div></div>'),Po=F("<!> <!>",1),So=F('<th class="svelte-1c4nuvk"><div class="th-controls svelte-1c4nuvk"><button><span class="th-label svelte-1c4nuvk"> </span> <span class="th-sort svelte-1c4nuvk"><!></span></button> <!></div></th>'),To=F('<span class="status-dot svelte-1c4nuvk"></span>'),Ao=F('<tr class="group-header svelte-1c4nuvk"><td class="svelte-1c4nuvk"><div class="group-header-content svelte-1c4nuvk"><span><!></span> <!> <span class="group-label svelte-1c4nuvk"> </span> <span class="group-count svelte-1c4nuvk"> </span></div></td></tr> <!>',1),No=F('<div class="table-scroll svelte-1c4nuvk"><table class="list-table svelte-1c4nuvk"><thead class="svelte-1c4nuvk"><tr class="svelte-1c4nuvk"></tr></thead><tbody class="svelte-1c4nuvk"><!></tbody></table></div>'),Do=F('<!> <div class="list-view svelte-1c4nuvk"><div class="list-toolbar svelte-1c4nuvk"><div class="toolbar-left svelte-1c4nuvk"><!> <!> <span class="row-count svelte-1c4nuvk"> </span></div> <!></div> <!></div>',1);function en(w,t){We(t,!0);const o=(r,n=$e)=>{var i=po();_e(i,21,()=>e(B),ze,(u,v)=>{const _=k(()=>$(n(),e(v).key)),A=k(()=>e(s)?Qe(e(s),e(v).key,e(_)):e(v).key==="entity_type"?void 0:Qe(n().entity.entityType,e(v).key,e(_)));var J=fo(),R=y(J);{var I=V=>{var P=co();let S;var ee=y(P);let G;var H=T(ee);p(P),re(te=>{S=nt(P,"",S,{color:e(A)}),G=nt(ee,"",G,{background:e(A)}),ce(H,` ${te??""}`)},[()=>X(e(_),e(v),n().entity.entityType)]),d(V,P)},m=V=>{var P=jt();re(S=>ce(P,S),[()=>X(e(_),e(v),n().entity.entityType)]),d(V,P)};E(R,V=>{e(A)?V(I):V(m,!1)})}p(J),re(()=>yt(J,1,br(e(v).key==="name"?"cell-name":e(v).format==="date"?"cell-date":e(v).key==="collection"||e(v).key==="entity_type"?"cell-meta":""),"svelte-1c4nuvk")),d(u,J)}),p(i),He("click",i,()=>de(n())),d(r,i)},c=k(()=>_t.views.find(r=>r.id===t.data.viewId));mt(()=>{t.data.viewId&&(Cr.showView(t.data.viewId),_t.setActive(t.data.viewId))});let s=L(null),a=L("name"),f=L(!0),l=L(null),b=L(ot({})),O=L(ot({})),x=L(ot({})),g=L(ot(new Set)),C=L(null);mt(()=>{if(e(c)&&e(c).id!==e(C)){h(C,e(c).id,!0);const r=e(c).config;h(s,r.selectedType??null,!0),h(a,r.sortKey??"name",!0),h(f,r.sortAsc??!0,!0),h(l,r.groupBy??null,!0),h(b,r.filters?.text??{},!0);const n={};for(const[i,u]of Object.entries(r.filters?.enum??{}))n[i]=new Set(u);h(O,n,!0),h(x,r.filters?.date??{},!0),h(g,new Set,!0)}});let Y;function M(){e(c)&&(clearTimeout(Y),Y=setTimeout(()=>{const r={selectedType:e(s),groupBy:e(l),sortKey:e(a),sortAsc:e(f),filters:{text:e(b),enum:Object.fromEntries(Object.entries(e(O)).map(([n,i])=>[n,[...i]])),date:e(x)}};_t.update(e(c).id,{config:r})},500))}mt(()=>{e(s),e(a),e(f),e(l),JSON.stringify(e(b)),JSON.stringify(Object.fromEntries(Object.entries(e(O)).map(([r,n])=>[r,[...n]]))),JSON.stringify(e(x)),e(C)&&M()});const se=k(()=>{const r=[];for(const n of Ht.repos)for(const i of n.entities)(!e(s)||i.entityType===e(s))&&r.push({entity:i,collection:n.displayName,repoName:n.name});return r}),Me=k(()=>{const r=new Set;for(const n of Ht.repos)for(const i of n.entities)r.add(i.entityType);return[...r].sort()}),Ie=k(()=>{const r=new Set;for(const n of e(se))for(const i of Object.keys(n.entity.fields))r.add(i);return r}),B=k(()=>Rr(e(s),e(Ie)));function ae(r){e(a)===r?h(f,!e(f)):(h(a,r,!0),h(f,!0))}function oe(r){const n=new Set(e(g));n.has(r)?n.delete(r):n.add(r),h(g,n,!0)}const be=k(()=>e(B).filter(r=>r.filter==="enum"));function q(r){h(l,r==="__none__"?null:r??null,!0),h(g,new Set,!0)}const ft=k(()=>{for(const r of Object.values(e(b)))if(r)return!0;for(const r of Object.values(e(O)))if(r.size)return!0;for(const r of Object.values(e(x)))if(r.from||r.to)return!0;return!1});function Ke(r){return r.filter==="text"?!!e(b)[r.key]:r.filter==="enum"?(e(O)[r.key]?.size??0)>0:r.filter==="date"?!!(e(x)[r.key]?.from||e(x)[r.key]?.to):!1}function ge(){h(b,{},!0),h(O,{},!0),h(x,{},!0)}function Ye(r,n){const i=e(O)[r]??new Set,u=new Set(i);u.has(n)?u.delete(n):u.add(n),h(O,{...e(O),[r]:u},!0)}const we=k(()=>{const r=[];for(const[n,i]of Object.entries(e(b)))if(i){const u=e(B).find(v=>v.key===n);r.push({label:`${u?.label??n}: "${i}"`,clear:()=>{h(b,{...e(b),[n]:""},!0)}})}for(const[n,i]of Object.entries(e(O)))if(i.size){const u=e(B).find(v=>v.key===n);r.push({label:`${u?.label??n}: ${[...i].join(", ")}`,clear:()=>{h(O,{...e(O),[n]:new Set},!0)}})}for(const[n,i]of Object.entries(e(x)))if(i.from||i.to){const u=e(B).find(v=>v.key===n);r.push({label:`${u?.label??n}: ${i.from||"..."} – ${i.to||"..."}`,clear:()=>{h(x,{...e(x),[n]:{from:"",to:""}},!0)}})}return r});function xe(r){const n=new Set;for(const i of e(se)){const u=$(i,r);u&&n.add(u)}return[...n].sort()}function $(r,n){if(n==="name")return r.entity.title;if(n==="entity_type")return r.entity.entityType;if(n==="collection")return r.collection;if(n==="created_at")return r.entity.createdAt??"";const i=r.entity.fields[n];return i==null?"":Array.isArray(i)?i.map(u=>String(u)).join(", "):String(i)}const ie=k(()=>{const r=e(se).filter(i=>{for(const u of e(B)){if(u.filter==="none")continue;const v=$(i,u.key);if(u.filter==="text"){const _=e(b)[u.key];if(_&&!v.toLowerCase().includes(_.toLowerCase()))return!1}else if(u.filter==="enum"){const _=e(O)[u.key];if(_?.size&&!_.has(v))return!1}else if(u.filter==="date"){const _=e(x)[u.key];if(_?.from&&v<_.from||_?.to&&v>_.to)return!1}}return!0}),n=e(B).find(i=>i.key===e(a));return r.sort((i,u)=>{const v=$(i,e(a)),_=$(u,e(a));let A;return n?.sortOrder?A=(n.sortOrder[v]??99)-(n.sortOrder[_]??99):n?.format==="date"?!v&&!_?A=0:v?_?A=v.localeCompare(_):A=-1:A=1:A=v.localeCompare(_),e(f)?A:-A}),r}),Ve=k(()=>{if(!e(l))return null;const r=e(B).find(u=>u.key===e(l)),n=new Map;for(const u of e(ie)){const _=$(u,e(l))||"(empty)";n.has(_)||n.set(_,[]),n.get(_).push(u)}const i=[...n.entries()];return r?.sortOrder&&i.sort((u,v)=>(r.sortOrder[u[0]]??99)-(r.sortOrder[v[0]]??99)),i.map(([u,v])=>({key:u,label:r?.key==="entity_type"?Ze(u):u,rows:v}))});function Xe(r){return r.replace(/\[\[|\]\]/g,"").replace(/[-_]/g," ").replace(/\b\w/g,n=>n.toUpperCase())}function W(r){if(!r)return"";try{return new Date(r).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})}catch{return r}}function j(r){if(!r)return"";const n=Number(r);return isNaN(n)?r:new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",maximumFractionDigits:0}).format(n)}function X(r,n,i){return r?n.format==="date"?W(r):n.format==="wikilink"?Xe(r):n.format==="currency"?j(r):n.key==="entity_type"?Ze(r):r:""}function de(r){gr(`/${r.repoName}/${r.entity.entityType}/${r.entity.id}`)}function tr(r){h(s,r==="__all__"?null:r??null,!0)}var St=Do(),Tt=N(St);kr(Tt,{activeView:"view"});var At=T(Tt,2),pt=y(At),ht=y(pt),Nt=y(ht);{let r=k(()=>e(s)??"__all__");Q(Nt,()=>Kt,(n,i)=>{i(n,{type:"single",get value(){return e(r)},onValueChange:tr,children:(u,v)=>{var _=vo(),A=N(_);{let R=k(()=>e(s)?Ze(e(s)):"All Types");Q(A,()=>Wt,(I,m)=>{m(I,{size:"sm",get value(){return e(R)}})})}var J=T(A,2);Q(J,()=>Ut,(R,I)=>{I(R,{children:(m,V)=>{var P=ho(),S=N(P);Q(S,()=>st,(G,H)=>{H(G,{value:"__all__",label:"All Types"})});var ee=T(S,2);_e(ee,17,()=>e(Me),ze,(G,H)=>{var te=z(),le=N(te);{let Z=k(()=>Ze(e(H)));Q(le,()=>st,(fe,Oe)=>{Oe(fe,{get value(){return e(H)},get label(){return e(Z)}})})}d(G,te)}),d(m,P)},$$slots:{default:!0}})}),d(u,_)},$$slots:{default:!0}})})}var Dt=T(Nt,2);{var rr=r=>{var n=z(),i=N(n);{let u=k(()=>e(l)??"__none__");Q(i,()=>Kt,(v,_)=>{_(v,{type:"single",get value(){return e(u)},onValueChange:q,children:(A,J)=>{var R=yo(),I=N(R);{let V=k(()=>e(l)?`Group: ${e(B).find(P=>P.key===e(l))?.label??e(l)}`:"No grouping");Q(I,()=>Wt,(P,S)=>{S(P,{size:"sm",get value(){return e(V)}})})}var m=T(I,2);Q(m,()=>Ut,(V,P)=>{P(V,{children:(S,ee)=>{var G=mo(),H=N(G);Q(H,()=>st,(le,Z)=>{Z(le,{value:"__none__",label:"No grouping"})});var te=T(H,2);_e(te,17,()=>e(be),ze,(le,Z)=>{var fe=z(),Oe=N(fe);Q(Oe,()=>st,(U,pe)=>{pe(U,{get value(){return e(Z).key},get label(){return e(Z).label}})}),d(le,fe)}),d(S,G)},$$slots:{default:!0}})}),d(A,R)},$$slots:{default:!0}})})}d(r,n)};E(Dt,r=>{e(be).length>0&&r(rr)})}var Ft=T(Dt,2),or=y(Ft);p(Ft),p(ht);var nr=T(ht,2);{var sr=r=>{var n=bo(),i=y(n);_e(i,17,()=>e(we),ze,(v,_)=>{var A=_o(),J=y(A),R=y(J,!0);p(J);var I=T(J,2);Hr(I,{size:10}),p(A),re(()=>ce(R,e(_).label)),He("click",A,function(...m){e(_).clear?.apply(this,m)}),d(v,A)});var u=T(i,2);p(n),He("click",u,ge),d(r,n)};E(nr,r=>{e(ft)&&r(sr)})}p(pt);var ar=T(pt,2);{var ir=r=>{var n=go(),i=T(y(n),2);Lr(i,{variant:"ghost",onclick:ge,children:(u,v)=>{kt();var _=jt("Clear filters");d(u,_)},$$slots:{default:!0}}),p(n),d(r,n)},lr=r=>{var n=ko();d(r,n)},ur=r=>{var n=No(),i=y(n),u=y(i),v=y(u);_e(v,21,()=>e(B),ze,(I,m)=>{var V=So(),P=y(V),S=y(P),ee=y(S),G=y(ee,!0);p(ee);var H=T(ee,2),te=y(H);{var le=U=>{var pe=z(),Pe=N(pe);{var Ge=ue=>{wr(ue,{size:12})},Ee=ue=>{xr(ue,{size:12})};E(Pe,ue=>{e(f)?ue(Ge):ue(Ee,!1)})}d(U,pe)},Z=U=>{oo(U,{size:12})};E(te,U=>{e(a)===e(m).key?U(le):U(Z,!1)})}p(H),p(S);var fe=T(S,2);{var Oe=U=>{var pe=z(),Pe=N(pe);Q(Pe,()=>io,(Ge,Ee)=>{Ee(Ge,{children:(ue,Mt)=>{var Re=Po(),et=N(Re);{let he=k(()=>Ke(e(m))?"filter-active":"");Q(et,()=>lo,(ke,ve)=>{ve(ke,{get class(){return`th-filter-btn ${e(he)??""}`},children:(tt,vt)=>{ao(tt,{size:12})},$$slots:{default:!0}})})}var ne=T(et,2);Q(ne,()=>uo,(he,ke)=>{ke(he,{class:"filter-popover",sideOffset:4,align:"start",children:(ve,tt)=>{var vt=z(),cr=N(vt);{var dr=me=>{{let ye=k(()=>e(b)[e(m).key]??"");bt(me,{class:"filter-text-input",type:"text",placeholder:"Filter...",get value(){return e(ye)},oninput:Se=>{h(b,{...e(b),[e(m).key]:Se.currentTarget.value},!0)}})}},fr=me=>{var ye=xo();_e(ye,21,()=>xe(e(m).key),ze,(Se,Ce)=>{var Te=wo(),rt=y(Te);{let Ae=k(()=>e(O)[e(m).key]?.has(e(Ce))??!1);zr(rt,{get checked(){return e(Ae)}})}var je=T(rt,2);{var qe=Ae=>{var Vt=Co();let Et;re(mr=>Et=nt(Vt,"",Et,mr),[()=>({background:Qe(e(s),e(m).key,e(Ce))})]),d(Ae,Vt)},hr=k(()=>e(m).key!=="entity_type"&&e(m).key!=="collection"&&e(s)&&Qe(e(s),e(m).key,e(Ce)));E(je,Ae=>{e(hr)&&Ae(qe)})}var It=T(je,2),vr=y(It,!0);p(It),p(Te),re(Ae=>ce(vr,Ae),[()=>e(m).key==="entity_type"?Ze(e(Ce)):e(Ce)]),He("click",Te,()=>Ye(e(m).key,e(Ce))),d(Se,Te)}),p(ye),d(me,ye)},pr=me=>{var ye=Oo(),Se=y(ye),Ce=T(y(Se),2);{let je=k(()=>e(x)[e(m).key]?.from??"");bt(Ce,{type:"date",class:"filter-date-input",get value(){return e(je)},oninput:qe=>{h(x,{...e(x),[e(m).key]:{from:qe.currentTarget.value,to:e(x)[e(m).key]?.to??""}},!0)}})}p(Se);var Te=T(Se,2),rt=T(y(Te),2);{let je=k(()=>e(x)[e(m).key]?.to??"");bt(rt,{type:"date",class:"filter-date-input",get value(){return e(je)},oninput:qe=>{h(x,{...e(x),[e(m).key]:{from:e(x)[e(m).key]?.from??"",to:qe.currentTarget.value}},!0)}})}p(Te),p(ye),d(me,ye)};E(cr,me=>{e(m).filter==="text"?me(dr):e(m).filter==="enum"?me(fr,1):e(m).filter==="date"&&me(pr,2)})}d(ve,vt)},$$slots:{default:!0}})}),d(ue,Re)},$$slots:{default:!0}})}),d(U,pe)};E(fe,U=>{e(m).filter!=="none"&&U(Oe)})}p(P),p(V),re(()=>{yt(S,1,`th-sort-btn ${e(a)===e(m).key?"sort-active":""}`,"svelte-1c4nuvk"),ce(G,e(m).label)}),He("click",S,()=>ae(e(m).key)),d(I,V)}),p(v),p(u);var _=T(u),A=y(_);{var J=I=>{var m=z(),V=N(m);_e(V,17,()=>e(Ve),P=>P.key,(P,S)=>{const ee=k(()=>e(s)&&e(l)?Qe(e(s),e(l),e(S).key):void 0);var G=Ao(),H=N(G),te=y(H),le=y(te),Z=y(le);let fe;var Oe=y(Z);jr(Oe,{size:14}),p(Z);var U=T(Z,2);{var pe=ne=>{var he=To();let ke;re(()=>ke=nt(he,"",ke,{background:e(ee)})),d(ne,he)};E(U,ne=>{e(ee)&&ne(pe)})}var Pe=T(U,2),Ge=y(Pe,!0);p(Pe);var Ee=T(Pe,2),ue=y(Ee,!0);p(Ee),p(le),p(te),p(H);var Mt=T(H,2);{var Re=ne=>{var he=z(),ke=N(he);_e(ke,17,()=>e(S).rows,ve=>ve.repoName+"/"+ve.entity.entityType+"/"+ve.entity.id,(ve,tt)=>{o(ve,()=>e(tt))}),d(ne,he)},et=k(()=>!e(g).has(e(S).key));E(Mt,ne=>{e(et)&&ne(Re)})}re(ne=>{_r(te,"colspan",e(B).length),fe=yt(Z,1,"group-chevron svelte-1c4nuvk",null,fe,ne),ce(Ge,e(S).label),ce(ue,e(S).rows.length)},[()=>({collapsed:e(g).has(e(S).key)})]),He("click",H,()=>oe(e(S).key)),d(P,G)}),d(I,m)},R=I=>{var m=z(),V=N(m);_e(V,17,()=>e(ie),P=>P.repoName+"/"+P.entity.entityType+"/"+P.entity.id,(P,S)=>{o(P,()=>e(S))}),d(I,m)};E(A,I=>{e(Ve)?I(J):I(R,!1)})}p(_),p(i),p(n),d(r,n)};E(ar,r=>{e(ie).length===0&&e(se).length>0?r(ir):e(ie).length===0?r(lr,1):r(ur,!1)})}p(At),re(()=>ce(or,`${e(ie).length??""} ${e(ie).length===1?"entity":"entities"}`)),d(w,St),Ue()}yr(["click"]);export{en as component,Ro as universal};
@@ -1 +1 @@
1
- import{e as G,a as b,t as H,s as _,b as P}from"../chunks/CajNsaOw.js";import{p as J,t as S,b as K,ab as L,g as s,e as v,a1 as l,ac as M,c as a,ad as O,r as t,s as o,n as Q}from"../chunks/CfuRx7rA.js";import{i as R}from"../chunks/Cwkp_c4R.js";import{h as V}from"../chunks/JDb8RpWX.js";import{g as W}from"../chunks/DUsnWwWN.js";import{a as q}from"../chunks/BH82yShn.js";import{B as X}from"../chunks/9QAsBMIK.js";import{I}from"../chunks/Be5VhuaI.js";var Y=P('<p class="error-msg svelte-1x05zx6"> </p>'),Z=P('<div class="login-page svelte-1x05zx6"><div class="login-card svelte-1x05zx6"><div class="logo svelte-1x05zx6"><div class="logo-icon svelte-1x05zx6"> </div> <span class="logo-text svelte-1x05zx6"> </span></div> <form class="svelte-1x05zx6"><label class="field svelte-1x05zx6"><span class="field-label svelte-1x05zx6">Email</span> <!></label> <label class="field svelte-1x05zx6"><span class="field-label svelte-1x05zx6">Password</span> <!></label> <!> <!></form></div></div>');function ne(k,B){J(B,!0);const p=M(()=>q.workspaceName||"Studiograph");let h=v(""),z=v(""),n=v(""),u=v(!1);async function E(e){e.preventDefault();const r=e.currentTarget,i=r.querySelector('input[type="email"]').value,j=r.querySelector('input[type="password"]').value;o(n,""),o(u,!0);try{await q.login(i,j),W("/")}catch(F){o(n,F.message||"Invalid credentials",!0)}finally{o(u,!1)}}var d=Z();V("1x05zx6",e=>{L(()=>{O.title=`Sign in — ${s(p)??""}`})});var y=a(d),c=a(y),m=a(c),N=a(m,!0);t(m);var $=l(m,2),A=a($,!0);t($),t(c);var f=l(c,2),x=a(f),C=l(a(x),2);I(C,{type:"email",required:!0,autocomplete:"email",autofocus:!0,class:"field-input",get value(){return s(h)},set value(e){o(h,e,!0)}}),t(x);var g=l(x,2),D=l(a(g),2);I(D,{type:"password",required:!0,autocomplete:"current-password",class:"field-input",get value(){return s(z)},set value(e){o(z,e,!0)}}),t(g);var w=l(g,2);{var T=e=>{var r=Y(),i=a(r,!0);t(r),S(()=>_(i,s(n))),b(e,r)};R(w,e=>{s(n)&&e(T)})}var U=l(w,2);X(U,{variant:"accent",type:"submit",class:"submit-btn",get disabled(){return s(u)},children:(e,r)=>{Q();var i=H("Sign in");b(e,i)},$$slots:{default:!0}}),t(f),t(y),t(d),S(e=>{_(N,e),_(A,s(p))},[()=>s(p).charAt(0).toUpperCase()]),G("submit",f,E),b(k,d),K()}export{ne as component};
1
+ import{g as G,a as _,t as H,s as b,b as P}from"../chunks/b0XUoOIH.js";import{p as J,t as S,b as K,ac as L,g as s,e as v,a3 as l,a4 as M,c as a,ad as O,r as t,s as o,n as Q}from"../chunks/DSh-OF2y.js";import{i as R}from"../chunks/DT3KtxWU.js";import{h as V}from"../chunks/B3NI-DOv.js";import{g as W}from"../chunks/BAAbylyg.js";import{a as q}from"../chunks/Sk0ODu4Y.js";import{B as X}from"../chunks/DQ5NTKSo.js";import{I}from"../chunks/APIqItee.js";var Y=P('<p class="error-msg svelte-1x05zx6"> </p>'),Z=P('<div class="login-page svelte-1x05zx6"><div class="login-card svelte-1x05zx6"><div class="logo svelte-1x05zx6"><div class="logo-icon svelte-1x05zx6"> </div> <span class="logo-text svelte-1x05zx6"> </span></div> <form class="svelte-1x05zx6"><label class="field svelte-1x05zx6"><span class="field-label svelte-1x05zx6">Email</span> <!></label> <label class="field svelte-1x05zx6"><span class="field-label svelte-1x05zx6">Password</span> <!></label> <!> <!></form></div></div>');function ne(k,B){J(B,!0);const p=M(()=>q.workspaceName||"Studiograph");let h=v(""),z=v(""),n=v(""),u=v(!1);async function E(e){e.preventDefault();const r=e.currentTarget,i=r.querySelector('input[type="email"]').value,j=r.querySelector('input[type="password"]').value;o(n,""),o(u,!0);try{await q.login(i,j),W("/")}catch(F){o(n,F.message||"Invalid credentials",!0)}finally{o(u,!1)}}var d=Z();V("1x05zx6",e=>{L(()=>{O.title=`Sign in — ${s(p)??""}`})});var y=a(d),c=a(y),m=a(c),N=a(m,!0);t(m);var $=l(m,2),A=a($,!0);t($),t(c);var f=l(c,2),x=a(f),C=l(a(x),2);I(C,{type:"email",required:!0,autocomplete:"email",autofocus:!0,class:"field-input",get value(){return s(h)},set value(e){o(h,e,!0)}}),t(x);var g=l(x,2),D=l(a(g),2);I(D,{type:"password",required:!0,autocomplete:"current-password",class:"field-input",get value(){return s(z)},set value(e){o(z,e,!0)}}),t(g);var w=l(g,2);{var T=e=>{var r=Y(),i=a(r,!0);t(r),S(()=>b(i,s(n))),_(e,r)};R(w,e=>{s(n)&&e(T)})}var U=l(w,2);X(U,{variant:"accent",type:"submit",class:"submit-btn",get disabled(){return s(u)},children:(e,r)=>{Q();var i=H("Sign in");_(e,i)},$$slots:{default:!0}}),t(f),t(y),t(d),S(e=>{b(N,e),b(A,s(p))},[()=>s(p).charAt(0).toUpperCase()]),G("submit",f,E),_(k,d),K()}export{ne as component};
@@ -1 +1 @@
1
- {"version":"1774746351272"}
1
+ {"version":"1774804755940"}
@@ -7,31 +7,30 @@
7
7
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
8
8
  <link href="https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600&family=IBM+Plex+Mono:wght@400;500&display=swap" rel="stylesheet" />
9
9
  <link rel="stylesheet" href="/api/chrome/chrome.css">
10
- <link href="/_app/immutable/entry/start.Cae6DI7N.js" rel="modulepreload">
11
- <link href="/_app/immutable/chunks/DUsnWwWN.js" rel="modulepreload">
12
- <link href="/_app/immutable/chunks/CfuRx7rA.js" rel="modulepreload">
13
- <link href="/_app/immutable/chunks/CHDa87Lu.js" rel="modulepreload">
14
- <link href="/_app/immutable/entry/app.FJ-QaQhu.js" rel="modulepreload">
10
+ <link href="/_app/immutable/entry/start.DTjSVtws.js" rel="modulepreload">
11
+ <link href="/_app/immutable/chunks/BAAbylyg.js" rel="modulepreload">
12
+ <link href="/_app/immutable/chunks/DSh-OF2y.js" rel="modulepreload">
13
+ <link href="/_app/immutable/entry/app.DA5OyPOi.js" rel="modulepreload">
15
14
  <link href="/_app/immutable/chunks/PPVm8Dsz.js" rel="modulepreload">
16
- <link href="/_app/immutable/chunks/CajNsaOw.js" rel="modulepreload">
17
- <link href="/_app/immutable/chunks/Cwkp_c4R.js" rel="modulepreload">
18
- <link href="/_app/immutable/chunks/BtJ5VKKi.js" rel="modulepreload">
19
- <link href="/_app/immutable/chunks/RGHlrGBn.js" rel="modulepreload">
15
+ <link href="/_app/immutable/chunks/b0XUoOIH.js" rel="modulepreload">
16
+ <link href="/_app/immutable/chunks/DT3KtxWU.js" rel="modulepreload">
17
+ <link href="/_app/immutable/chunks/DCVmM0L5.js" rel="modulepreload">
18
+ <link href="/_app/immutable/chunks/D-yNNNdf.js" rel="modulepreload">
20
19
 
21
20
  </head>
22
21
  <body data-sveltekit-preload-data="hover" data-sg-workspace="true">
23
22
  <div style="display: contents">
24
23
  <script>
25
24
  {
26
- __sveltekit_1mpwd3p = {
25
+ __sveltekit_uvehpy = {
27
26
  base: ""
28
27
  };
29
28
 
30
29
  const element = document.currentScript.parentElement;
31
30
 
32
31
  Promise.all([
33
- import("/_app/immutable/entry/start.Cae6DI7N.js"),
34
- import("/_app/immutable/entry/app.FJ-QaQhu.js")
32
+ import("/_app/immutable/entry/start.DTjSVtws.js"),
33
+ import("/_app/immutable/entry/app.DA5OyPOi.js")
35
34
  ]).then(([kit, app]) => {
36
35
  kit.start(app, element);
37
36
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "studiograph",
3
- "version": "1.3.44-next.1",
3
+ "version": "1.3.44-next.2",
4
4
  "description": "Team-based AI agent platform with Git-backed knowledge graphs",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -1 +0,0 @@
1
- .welcome.svelte-h7bcrl{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;color:var(--color-text-tertiary)}.welcome.svelte-h7bcrl h2:where(.svelte-h7bcrl){font-size:17px;font-weight:500;color:var(--color-text-secondary)}.welcome.svelte-h7bcrl p:where(.svelte-h7bcrl){font-size:14px}
@@ -1 +0,0 @@
1
- import{g as t,s as e,e as r}from"./CfuRx7rA.js";import{a as v}from"./DQ_O96iG.js";function E(){let l=r(null),i=r(null),u=r(null),o=r(null),s=r("entity"),g=r(null),h=r(null),d=r("general"),f=r(!1);function w(n,a){t(l)&&(t(l)!==n||t(u)!==a)&&v(t(l)).catch(()=>{})}function p(n,a,c,V){w(n,c),e(l,n,!0),e(i,a,!0),e(u,c,!0),e(o,V??null,!0)}function y(){e(s,"entity")}function b(){e(s,"graph")}function I(n){e(s,"view"),e(g,n,!0)}function S(){e(s,"settings"),e(d,"general")}function m(n,a,c){t(u)===c&&t(l)===n?(e(l,null),e(i,null),e(u,null)):(e(l,n,!0),e(i,a,!0),e(u,c,!0)),e(o,null)}function T(){t(l)&&v(t(l)).catch(()=>{}),e(l,null),e(i,null),e(u,null),e(o,null)}return{get selectedRepo(){return t(l)},get selectedType(){return t(i)},get selectedId(){return t(u)},get selectedSubPath(){return t(o)},get activeView(){return t(s)},get entityPath(){return t(l)&&t(i)&&t(u)?`/${t(l)}/${t(i)}/${t(u)}`:null},get hoveredEntityId(){return t(h)},set hoveredEntityId(n){e(h,n,!0)},get settingsTab(){return t(d)},set settingsTab(n){e(d,n,!0)},get hideSidebar(){return t(f)},set hideSidebar(n){e(f,n,!0)},select:p,deselect:T,selectOnGraph:m,showEntity:y,showGraph:b,get activeViewId(){return t(g)},showView:I,showSettings:S}}const $=E();export{$ as n};
@@ -1 +0,0 @@
1
- import{a as p,s as A,f as h}from"./CajNsaOw.js";import{i as M}from"./BLi1Oegj.js";import{p as k,l as c,s as m,d,g as i,a as B,c as _,n as C,r as u,b as N,m as v,t as P}from"./CfuRx7rA.js";import{i as R}from"./Cwkp_c4R.js";import{a as Y}from"./BA_Wro7X.js";import{l as g,p as b}from"./RGHlrGBn.js";var j=h("<title> </title>"),q=h('<svg><!><path d="M17 15 17 8 15 8 15 15 8 15 8 17 15 17 15 24 17 24 17 17 24 17 24 15z"></path></svg>');function J(x,t){const e=g(t,["children","$$slots","$$events","$$legacy"]),w=g(e,["size","title"]);k(t,!1);const a=v(),f=v();let n=b(t,"size",8,16),s=b(t,"title",8,void 0);c(()=>(d(e),d(s())),()=>{m(a,e["aria-label"]||e["aria-labelledby"]||s())}),c(()=>(i(a),d(e)),()=>{m(f,{"aria-hidden":i(a)?void 0:!0,role:i(a)?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})}),B(),M();var r=q();Y(r,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:n(),height:n(),...i(f),...w}));var y=_(r);{var z=o=>{var l=j(),$=_(l,!0);u(l),P(()=>A($,s())),p(o,l)};R(y,o=>{s()&&o(z)})}C(),u(r),p(x,r),N()}export{J as A};
@@ -1 +0,0 @@
1
- import{bp as R,aD as w,e as c,g as u,s as f}from"./CfuRx7rA.js";new URL("sveltekit-internal://");function j(t,e){return t==="/"||e==="ignore"?t:e==="never"?t.endsWith("/")?t.slice(0,-1):t:e==="always"&&!t.endsWith("/")?t+"/":t}function G(t){return t.split("%25").map(decodeURI).join("%25")}function Y(t){for(const e in t)t[e]=decodeURIComponent(t[e]);return t}function q({href:t}){return t.split("#")[0]}function D(t,e,n,r=!1){const s=new URL(t);Object.defineProperty(s,"searchParams",{value:new Proxy(s.searchParams,{get(a,o){if(o==="get"||o==="getAll"||o==="has")return(g,...E)=>(n(g),a[o](g,...E));e();const l=Reflect.get(a,o);return typeof l=="function"?l.bind(a):l}}),enumerable:!0,configurable:!0});const i=["href","pathname","search","toString","toJSON"];r&&i.push("hash");for(const a of i)Object.defineProperty(s,a,{get(){return e(),t[a]},enumerable:!0,configurable:!0});return s}function U(...t){let e=5381;for(const n of t)if(typeof n=="string"){let r=n.length;for(;r;)e=e*33^n.charCodeAt(--r)}else if(ArrayBuffer.isView(n)){const r=new Uint8Array(n.buffer,n.byteOffset,n.byteLength);let s=r.length;for(;s;)e=e*33^r[--s]}else throw new TypeError("value must be a string or TypedArray");return(e>>>0).toString(36)}new TextEncoder;new TextDecoder;function x(t){const e=atob(t),n=new Uint8Array(e.length);for(let r=0;r<e.length;r++)n[r]=e.charCodeAt(r);return n}const O=window.fetch;window.fetch=(t,e)=>((t instanceof Request?t.method:e?.method||"GET")!=="GET"&&h.delete(_(t)),O(t,e));const h=new Map;function H(t,e){const n=_(t,e),r=document.querySelector(n);if(r?.textContent){r.remove();let{body:s,...i}=JSON.parse(r.textContent);const a=r.getAttribute("data-ttl");return a&&h.set(n,{body:s,init:i,ttl:1e3*Number(a)}),r.getAttribute("data-b64")!==null&&(s=x(s)),Promise.resolve(new Response(s,i))}return window.fetch(t,e)}function K(t,e,n){if(h.size>0){const r=_(t,n),s=h.get(r);if(s){if(performance.now()<s.ttl&&["default","force-cache","only-if-cached",void 0].includes(n?.cache))return new Response(s.body,s.init);h.delete(r)}}return window.fetch(e,n)}function _(t,e){let r=`script[data-sveltekit-fetched][data-url=${JSON.stringify(t instanceof Request?t.url:t)}]`;if(e?.headers||e?.body){const s=[];e.headers&&s.push([...new Headers(e.headers)].join(",")),e.body&&(typeof e.body=="string"||ArrayBuffer.isView(e.body))&&s.push(e.body),r+=`[data-hash="${U(...s)}"]`}return r}const N=globalThis.__sveltekit_1mpwd3p?.base??"",I=globalThis.__sveltekit_1mpwd3p?.assets??N??"",L="1774746351272",B="sveltekit:snapshot",J="sveltekit:scroll",W="sveltekit:states",X="sveltekit:pageurl",z="sveltekit:history",M="sveltekit:navigation",m={tap:1,hover:2,viewport:3,eager:4,off:-1,false:-1},S=location.origin;function F(t){if(t instanceof URL)return t;let e=document.baseURI;if(!e){const n=document.getElementsByTagName("base");e=n.length?n[0].href:document.URL}return new URL(t,e)}function Q(){return{x:pageXOffset,y:pageYOffset}}function d(t,e){return t.getAttribute(`data-sveltekit-${e}`)}const v={...m,"":m.hover};function A(t){let e=t.assignedSlot??t.parentNode;return e?.nodeType===11&&(e=e.host),e}function Z(t,e){for(;t&&t!==e;){if(t.nodeName.toUpperCase()==="A"&&t.hasAttribute("href"))return t;t=A(t)}}function ee(t,e,n){let r;try{if(r=new URL(t instanceof SVGAElement?t.href.baseVal:t.href,document.baseURI),n&&r.hash.match(/^#[^/]/)){const o=location.hash.split("#")[1]||"/";r.hash=`#${o}${r.hash}`}}catch{}const s=t instanceof SVGAElement?t.target.baseVal:t.target,i=!r||!!s||P(r,e,n)||(t.getAttribute("rel")||"").split(/\s+/).includes("external"),a=r?.origin===S&&t.hasAttribute("download");return{url:r,external:i,target:s,download:a}}function te(t){let e=null,n=null,r=null,s=null,i=null,a=null,o=t;for(;o&&o!==document.documentElement;)r===null&&(r=d(o,"preload-code")),s===null&&(s=d(o,"preload-data")),e===null&&(e=d(o,"keepfocus")),n===null&&(n=d(o,"noscroll")),i===null&&(i=d(o,"reload")),a===null&&(a=d(o,"replacestate")),o=A(o);function l(g){switch(g){case"":case"true":return!0;case"off":case"false":return!1;default:return}}return{preload_code:v[r??"off"],preload_data:v[s??"off"],keepfocus:l(e),noscroll:l(n),reload:l(i),replace_state:l(a)}}function ne(t){const e=R(t);let n=!0;function r(){n=!0,e.update(a=>a)}function s(a){n=!1,e.set(a)}function i(a){let o;return e.subscribe(l=>{(o===void 0||n&&l!==o)&&a(o=l)})}return{notify:r,set:s,subscribe:i}}const k={v:()=>{}};function re(){const{set:t,subscribe:e}=R(!1);let n;async function r(){clearTimeout(n);try{const s=await fetch(`${I}/_app/version.json`,{headers:{pragma:"no-cache","cache-control":"no-cache"}});if(!s.ok)return!1;const a=(await s.json()).version!==L;return a&&(t(!0),k.v(),clearTimeout(n)),a}catch{return!1}}return{subscribe:e,check:r}}function P(t,e,n){return t.origin!==S||!t.pathname.startsWith(e)?!0:n?t.pathname!==location.pathname:!1}function se(t){}const T=new Set(["load","prerender","csr","ssr","trailingSlash","config"]);[...T];const $=new Set([...T]);[...$];let b,y,p;const C=w.toString().includes("$$")||/function \w+\(\) \{\}/.test(w.toString());C?(b={data:{},form:null,error:null,params:{},route:{id:null},state:{},status:-1,url:new URL("https://example.com")},y={current:null},p={current:!1}):(b=new class{#e=c({});get data(){return u(this.#e)}set data(e){f(this.#e,e)}#t=c(null);get form(){return u(this.#t)}set form(e){f(this.#t,e)}#n=c(null);get error(){return u(this.#n)}set error(e){f(this.#n,e)}#r=c({});get params(){return u(this.#r)}set params(e){f(this.#r,e)}#s=c({id:null});get route(){return u(this.#s)}set route(e){f(this.#s,e)}#a=c({});get state(){return u(this.#a)}set state(e){f(this.#a,e)}#o=c(-1);get status(){return u(this.#o)}set status(e){f(this.#o,e)}#i=c(new URL("https://example.com"));get url(){return u(this.#i)}set url(e){f(this.#i,e)}},y=new class{#e=c(null);get current(){return u(this.#e)}set current(e){f(this.#e,e)}},p=new class{#e=c(!1);get current(){return u(this.#e)}set current(e){f(this.#e,e)}},k.v=()=>p.current=!0);function le(t){Object.assign(b,t)}export{z as H,M as N,X as P,W as S,G as a,N as b,re as c,Y as d,j as e,K as f,H as g,Z as h,P as i,ee as j,te as k,q as l,D as m,y as n,S as o,b as p,m as q,F as r,Q as s,J as t,le as u,B as v,ne as w,se as x};
@@ -1 +0,0 @@
1
- import{aW as L,ay as A,aV as Y,e as S,f as H,g,s as c,a6 as N,ac as q}from"./CfuRx7rA.js";import{i as z}from"./DUsnWwWN.js";import{e as P,w as h}from"./DQ_O96iG.js";import{a as K}from"./BH82yShn.js";import{n as $}from"./BZd_7gpI.js";import{l as Q,o as D}from"./CajNsaOw.js";function Ot(...t){return t.filter(Boolean).join(" ")}const X=typeof document<"u",Z=typeof window<"u"?window:void 0;function v(t){let e=t.activeElement;for(;e?.shadowRoot;){const s=e.shadowRoot.activeElement;if(s===e)break;e=s}return e}class tt{#e;#t;constructor(e={}){const{window:s=Z,document:n=s?.document}=e;s!==void 0&&(this.#e=n,this.#t=Q(i=>{const r=D(s,"focusin",i),o=D(s,"focusout",i);return()=>{r(),o()}}))}get current(){return this.#t?.(),this.#e?v(this.#e):null}}new tt;class et{#e;#t;constructor(e){this.#e=e,this.#t=Symbol(e)}get key(){return this.#t}exists(){return L(this.#t)}get(){const e=A(this.#t);if(e===void 0)throw new Error(`Context "${this.#e}" not found`);return e}getOr(e){const s=A(this.#t);return s===void 0?e:s}set(e){return Y(this.#t,e)}}const st=new et("<Toaster/>");let U=0;class nt{#e=S(H([]));get toasts(){return g(this.#e)}set toasts(e){c(this.#e,e,!0)}#t=S(H([]));get heights(){return g(this.#t)}set heights(e){c(this.#t,e,!0)}#s=e=>{const s=this.toasts.findIndex(n=>n.id===e);return s===-1?null:s};addToast=e=>{X&&this.toasts.unshift(e)};updateToast=({id:e,data:s,type:n,message:i})=>{const r=this.toasts.findIndex(d=>d.id===e),o=this.toasts[r];this.toasts[r]={...o,...s,id:e,title:i,type:n,updated:!0}};create=e=>{const{message:s,...n}=e,i=typeof e?.id=="number"||e.id&&e.id?.length>0?e.id:U++,r=e.dismissible!==void 0?e.dismissible:e.dismissable!==void 0?e.dismissable:!0,o=e.type===void 0?"default":e.type;return N(()=>{this.toasts.find(E=>E.id===i)?this.updateToast({id:i,data:e,type:o,message:s,dismissible:r}):this.addToast({...n,id:i,title:s,dismissible:r,type:o})}),i};dismiss=e=>(N(()=>{if(e===void 0){this.toasts=this.toasts.map(n=>({...n,dismiss:!0}));return}const s=this.toasts.findIndex(n=>n.id===e);this.toasts[s]&&(this.toasts[s]={...this.toasts[s],dismiss:!0})}),e);remove=e=>{if(e===void 0){this.toasts=[];return}const s=this.#s(e);if(s!==null)return this.toasts.splice(s,1),e};message=(e,s)=>this.create({...s,type:"default",message:e});error=(e,s)=>this.create({...s,type:"error",message:e});success=(e,s)=>this.create({...s,type:"success",message:e});info=(e,s)=>this.create({...s,type:"info",message:e});warning=(e,s)=>this.create({...s,type:"warning",message:e});loading=(e,s)=>this.create({...s,type:"loading",message:e});promise=(e,s)=>{if(!s)return;let n;s.loading!==void 0&&(n=this.create({...s,promise:e,type:"loading",message:typeof s.loading=="string"?s.loading:s.loading()}));const i=e instanceof Promise?e:e();let r=n!==void 0;return i.then(o=>{if(typeof o=="object"&&o&&"ok"in o&&typeof o.ok=="boolean"&&!o.ok){r=!1;const d=it(o);this.create({id:n,type:"error",message:d})}else if(s.success!==void 0){r=!1;const d=typeof s.success=="function"?s.success(o):s.success;this.create({id:n,type:"success",message:d})}}).catch(o=>{if(s.error!==void 0){r=!1;const d=typeof s.error=="function"?s.error(o):s.error;this.create({id:n,type:"error",message:d})}}).finally(()=>{r&&(this.dismiss(n),n=void 0),s.finally?.()}),n};custom=(e,s)=>{const n=s?.id||U++;return this.create({component:e,id:n,...s}),n};removeHeight=e=>{this.heights=this.heights.filter(s=>s.toastId!==e)};setHeight=e=>{const s=this.#s(e.toastId);if(s===null){this.heights.push(e);return}this.heights[s]=e};reset=()=>{this.toasts=[],this.heights=[]}}function it(t){return t&&typeof t=="object"&&"status"in t?`HTTP error! Status: ${t.status}`:`Error! ${t}`}const f=new nt;function rt(t,e){return f.create({message:t,...e})}class _t{#e=q(()=>f.toasts.filter(e=>!e.dismiss));get toasts(){return g(this.#e)}}function At(){return st.get()}const ot=rt,u=Object.assign(ot,{success:f.success,info:f.info,warning:f.warning,error:f.error,custom:f.custom,message:f.message,promise:f.promise,dismiss:f.dismiss,loading:f.loading,getActiveToasts:()=>f.toasts.filter(t=>!t.dismiss)}),ct=800;function at(){let t=S(!1),e=S(null),s=S(null),n=null,i=null,r=!1;function o(p,w,y,l){n&&n.repo===p&&n.type===w&&n.id===y?(l.data!==void 0&&(n.payload.data=l.data),l.content!==void 0&&(n.payload.content=l.content)):n={repo:p,type:w,id:y,payload:{...l}},d()}function d(){i&&clearTimeout(i),i=setTimeout(E,ct)}async function E(){if(i=null,!r&&n){const{repo:p,type:w,id:y,payload:l}=n;n=null,r=!0,c(t,!0),c(s,null);try{if(await P(p,w,y,l),c(e,new Date,!0),l.data?.name){const b=h.repos.find(O=>O.name===p)?.entities.find(O=>O.id===y);b&&(b.title=l.data.name)}}catch(m){c(s,m.message??"Save failed",!0);const b=m.status??m.statusCode;(!b||b>=500)&&(n={repo:p,type:w,id:y,payload:l})}finally{c(t,!1),r=!1,n&&E()}}}function J(){i&&(clearTimeout(i),i=null),n&&E()}async function V(p,w,y,l){c(t,!0),c(s,null);try{const m=await P(p,w,y,l);return c(e,new Date,!0),m}catch(m){return c(s,m.message??"Save failed",!0),null}finally{c(t,!1)}}function G(){c(s,null),c(e,null),n=null,i&&(clearTimeout(i),i=null)}return{get saving(){return g(t)},get lastSaved(){return g(e)},get error(){return g(s)},get hasPending(){return!!(n||r)},scheduleAutoSave:o,flush:J,saveEntity:V,reset:G}}const ut=at();let a=null,B=null,W=null,F=[],k=null,I=1e3,C=S(!1),R=S(null);const T=new Map,x={},_={};function j(t,e){T.delete(t);const s=e.entities.length,n=s===1?`${t} updated ${e.entities[0]}`:`${t} updated ${s} entities`;u(n)}function lt(t){for(const[e,s]of T)s.repo===t&&(clearTimeout(s.timer),T.delete(e))}function ft(t){const e=K.user?.displayName;if(t.type==="sync_progress"){const s=x[t.repo];if(s){const n=t.message.trim(),i=n.match(/^Syncing from source:\s*(.+)$/i);i&&(_[t.repo]=`Syncing ${i[1].trim()}…`);const r=_[t.repo]??`Syncing ${t.repo}…`;u.loading(r,{id:s,description:n,duration:36e5})}return}if(t.type==="entity_change"){if(e&&t.actor===e&&t.source==="api"){h.refreshEntities(t.repo);return}if(h.refreshEntities(t.repo),$.selectedRepo===t.repo&&$.selectedType===t.entityType&&$.selectedId===t.entityId){ut.hasPending?u(`${t.actor} also saved changes to this entity`):z();return}const n=T.get(t.actor);if(n)clearTimeout(n.timer),n.entities.includes(t.entityId)||n.entities.push(t.entityId),n.timer=setTimeout(()=>j(t.actor,n),1e4);else{const i={entities:[t.entityId],repo:t.repo,timer:setTimeout(()=>j(t.actor,i),1e4)};T.set(t.actor,i)}return}if(t.type==="session_commit"){if(e&&t.actor===e){c(R,t.timestamp,!0);return}const s=t.entities.length,n=s===1?`${t.actor} saved changes to ${t.entities[0]}`:`${t.actor} saved ${s} changes in ${t.repo}`;u(n),h.refreshEntities(t.repo);return}if(t.type==="sync_complete"){if(lt(t.repo),!x[t.repo]){const s=t.created+t.updated+t.deleted,n=s===0?`Sync complete · no changes in ${t.repo}`:`Sync complete · ${s} ${s===1?"entity":"entities"} from ${t.source}`;u.success(n)}h.refreshEntities(t.repo);return}if(t.type==="collection_created"){u(`${t.actor} created collection ${t.repo}`),h.refreshEntities(t.repo);return}if(t.type==="collection_deleted"){u(`${t.actor} deleted collection ${t.repo}`);return}if(t.type==="repo_sync"){u(`${t.actor} pushed to ${t.repo}`),h.refreshEntities(t.repo);return}if(t.type==="presence"){B?.(t);return}if(t.type==="online"){W?.(t);return}if(t.type==="access_granted"||t.type==="access_revoked"){t.type==="access_revoked"&&$.selectedRepo===t.repo&&$.deselect(),h.load();return}}function M(){if(typeof window>"u"||a&&(a.readyState===WebSocket.OPEN||a.readyState===WebSocket.CONNECTING))return;const e=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws`;a=new WebSocket(e),a.binaryType="arraybuffer",a.onopen=()=>{c(C,!0),I=1e3,h.refreshAll();for(const s of F)s()},a.onmessage=s=>{if(!(s.data instanceof ArrayBuffer))try{const n=JSON.parse(s.data);if(n?.type==="ping"){a?.send(JSON.stringify({type:"pong"}));return}const i=n;i.type&&i.type!=="toast"&&ft(i)}catch{}},a.onclose=()=>{c(C,!1),a=null,k=setTimeout(()=>{I=Math.min(I*2,1e4),M()},I)},a.onerror=()=>{}}function dt(){k&&(clearTimeout(k),k=null),a&&(a.close(),a=null),c(C,!1);for(const[,t]of T)clearTimeout(t.timer);T.clear()}function ht(t,e=4e3){u(t,{duration:e})}function pt(t,e){const s=crypto.randomUUID();return e?.loading?u.loading(t,{id:s,duration:36e5}):u(t,{id:s}),s}function yt(t,e,s){if(s?.loading){u.loading(e,{id:t});return}/failed|error/i.test(e)?u.error(e,{id:t,duration:s?.duration??6e3}):u.success(e,{id:t,duration:s?.duration??4e3})}function mt(t){const e=crypto.randomUUID();x[t]=e,u.loading(`Syncing ${t}…`,{id:e,duration:36e5})}function gt(t,e,s){const n=x[t];n&&(delete x[t],delete _[t],s?u.error(e,{id:n,duration:6e3}):u.success(e,{id:n,duration:4e3}))}function wt(t){B=t}function St(t){W=t}function Tt(t){F.push(t)}function Et(t){a?.readyState===WebSocket.OPEN&&a.send(JSON.stringify(t))}const Ht={get connected(){return g(C)},get lastAutoSaved(){return g(R)},get ws(){return a},connect:M,disconnect:dt,showToast:ht,showPersistentToast:pt,updateToast:yt,startSyncToast:mt,finishSyncToast:gt,send:Et,setPresenceHandler:wt,setOnlineHandler:St,addConnectHandler:Tt};export{_t as S,f as a,Ot as c,ut as e,Ht as r,st as s,u as t,At as u};
@@ -1 +0,0 @@
1
- import{e as m,f as w,s as u,g as o,ac as rt}from"./CfuRx7rA.js";import{a as p}from"./DEyrdHQB.js";function at(){return p("/api/workspace")}function it(e){return p("/api/workspace",{method:"PUT",body:JSON.stringify(e)})}function Ct(){return p("/api/workspace/mcp-config")}function J(){return p("/api/repos")}function st(e,a,s,f){return p("/api/repos",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:e,display_name:a||void 0,description:s,...f?{private:!0}:{}})})}function ct(e,a,s){return p(`/api/repos/${encodeURIComponent(e)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:a,display_name:s||void 0})})}function lt(e){return p(`/api/repos/${encodeURIComponent(e)}`,{method:"DELETE"})}function ut(){return p("/api/apps")}function dt(e){return p(`/api/repos/${encodeURIComponent(e)}/entities?summary=true`)}function wt(e,a,s){return p(`/api/repos/${encodeURIComponent(e)}/entities/${encodeURIComponent(a)}/${encodeURIComponent(s)}`)}function Et(e,a,s,f,c){return p(`/api/repos/${encodeURIComponent(e)}/entities`,{method:"POST",body:JSON.stringify({entityType:a,entityId:s,data:f,content:c})})}function St(e,a,s){return p(`/api/repos/${encodeURIComponent(e)}/entities/${encodeURIComponent(a)}/${encodeURIComponent(s)}`,{method:"DELETE"})}function bt(e,a,s,f){return p(`/api/repos/${encodeURIComponent(e)}/entities/${encodeURIComponent(a)}/${encodeURIComponent(s)}`,{method:"PUT",body:JSON.stringify(f)})}function $t(e,a,s,f){return p(`/api/repos/${encodeURIComponent(e)}/change-type`,{method:"POST",body:JSON.stringify({entityType:a,entityId:s,newType:f})})}function It(e,a,s,f,c){return p(`/api/repos/${encodeURIComponent(e)}/transfer`,{method:"POST",body:JSON.stringify({entityType:a,entityId:s,targetRepo:f,mode:c})})}function Tt(){return p("/api/views")}function kt(e,a){return p("/api/views",{method:"POST",body:JSON.stringify({name:e,config:a})})}function vt(e,a){return p(`/api/views/${e}`,{method:"PUT",body:JSON.stringify(a)})}function Rt(e){return p(`/api/views/${e}`,{method:"DELETE"})}function Ut(e){return p(`/api/repos/${encodeURIComponent(e)}/commit`,{method:"POST"})}function pt(e){return e.replace(/-/g," ").replace(/\b\w/g,a=>a.toUpperCase())}function O(e,a){return a||e.split("-").map(s=>s.charAt(0).toUpperCase()+s.slice(1)).join(" ")}const ft="#e05050";function D(e){if(typeof document>"u")return;const a=e||ft,s=parseInt(a.slice(1,3),16),f=parseInt(a.slice(3,5),16),c=parseInt(a.slice(5,7),16),E=[document.documentElement,document.querySelector("[data-theme]")].filter(Boolean);for(const h of E)h.style.setProperty("--color-accent",a),h.style.setProperty("--color-accent-hover",mt(a,15)),h.style.setProperty("--color-accent-muted",`rgba(${s}, ${f}, ${c}, 0.08)`),h.style.setProperty("--color-link",j(a,15)),h.style.setProperty("--color-badge-bg",`rgba(${s}, ${f}, ${c}, 0.1)`),h.style.setProperty("--color-badge-text",j(a,20))}function mt(e,a){const s=Math.max(0,Math.round(parseInt(e.slice(1,3),16)*(1-a/100))),f=Math.max(0,Math.round(parseInt(e.slice(3,5),16)*(1-a/100))),c=Math.max(0,Math.round(parseInt(e.slice(5,7),16)*(1-a/100)));return`#${s.toString(16).padStart(2,"0")}${f.toString(16).padStart(2,"0")}${c.toString(16).padStart(2,"0")}`}function j(e,a){const s=Math.min(255,Math.round(parseInt(e.slice(1,3),16)+(255-parseInt(e.slice(1,3),16))*a/100)),f=Math.min(255,Math.round(parseInt(e.slice(3,5),16)+(255-parseInt(e.slice(3,5),16))*a/100)),c=Math.min(255,Math.round(parseInt(e.slice(5,7),16)+(255-parseInt(e.slice(5,7),16))*a/100));return`#${s.toString(16).padStart(2,"0")}${f.toString(16).padStart(2,"0")}${c.toString(16).padStart(2,"0")}`}function yt(){let e=m(""),a=m(null),s=m(null),f=m(!1),c=m(w([]));const E={};let h=m(w([])),v=m(!1),R=m(null),g=m(w({})),U=w({}),L=w({}),I=w({}),_=m(0),F=m(null),C=m(""),T=null,S=m(0),b=m(0),x=m("alpha");async function W(){u(v,!0),u(R,null),u(S,0),u(b,0);try{const[t,n,r]=await Promise.all([J(),ut().catch(()=>[]),at().catch(()=>({name:""}))]);u(h,n,!0),u(e,r.name,!0),u(a,r.about??null,!0),u(s,r.accent_color??null,!0),u(f,!0),D(o(s)),u(c,t.map(i=>({name:i.name,displayName:O(i.name,i.display_name),type:i.type,private:i.private,sync:i.sync,count:null,entities:[],loading:!1,loaded:!1})),!0),await Promise.all(o(c).map(i=>$(i.name)))}catch(t){u(R,t.message,!0)}finally{u(v,!1)}}function V(t,n,r){const i=o(c).find(l=>l.name===t);i&&(i.entities=i.entities.filter(l=>!(l.id===r&&l.entityType===n)),i.count=i.entities.length)}async function Q(t){o(c).find(r=>r.name===t)&&await $(t,!0)}async function B(){u(S,0),u(b,0),await Promise.all(o(c).map(t=>$(t.name,!0)))}async function $(t,n=!1){const r=o(c).find(l=>l.name===t);if(!r||r.loading||!n&&r.loaded)return;const i=(E[t]??0)+1;E[t]=i,n||(r.loading=!0);try{const l=await dt(t);if(E[t]!==i)return;let y=0,A=0;for(const d of l)y+=d.document?.wikilinks?.length??0,A+=d.subContentCount??0;u(S,o(S)+y),u(b,o(b)+A);const P=new Set(["name","created_at","updated_at"]);r.entities=l.filter(d=>!d.id.toLowerCase().startsWith("readme")).map(d=>({id:d.id,title:d.data?.name??pt(d.id),entityType:d.entityType,repo:t,hasSubContent:!!d.hasSubContent,wikilinks:d.document?.wikilinks??[],createdAt:d.data?.created_at??null,updatedAt:d.data?.updated_at??null,fields:Object.fromEntries(Object.entries(d.data??{}).filter(([M])=>!P.has(M))),status:d.data?.status??void 0,priority:d.data?.priority??void 0,assignee:d.data?.assignee??void 0,dueDate:d.data?.due_date??void 0})).sort((d,M)=>d.title.localeCompare(M.title)),r.count=r.entities.length,r.loaded=!0}catch(l){console.error(`Failed to load entities for ${t}:`,l)}finally{r.loading=!1}}function K(t){o(g)[t]=!o(g)[t]}function q(t){return o(g)[t]??!1}function k(t,n,r){return`${t}/${n}/${r}`}function H(t,n,r){const i=k(t,n,r),l=U[i]??!1;U[i]=!l,!l&&!L[i]?.loaded&&G(t,n,r)}function Y(t,n,r){return U[k(t,n,r)]??!1}function z(t,n,r){return L[k(t,n,r)]??{entries:[],loading:!1,loaded:!1}}async function G(t,n,r){const i=k(t,n,r);L[i]={entries:[],loading:!1,loaded:!0}}function N(t){const n=o(C).trim().toLowerCase();if(!n)return t;const r=[];for(const i of t){const l=i.entities.filter(y=>y.title.toLowerCase().includes(n)||y.id.toLowerCase().includes(n));l.length>0&&r.push({...i,entities:l,count:l.length})}return r}function X(t){if(t&&!o(C)?T={...o(g)}:!t&&o(C)&&T&&(u(g,T,!0),T=null),u(C,t,!0),t){const n=t.trim().toLowerCase();for(const r of o(c)){const i=r.entities.some(l=>l.title.toLowerCase().includes(n)||l.id.toLowerCase().includes(n));o(g)[r.name]=i}}}function Z(t){const n=t.startsWith("type:");I[t]=!(I[t]??n)}function tt(t){return I[t]??!1}function et(t){return I[t]===!1}const nt=rt(()=>o(c).reduce((t,n)=>t+(n.count??0),0));function ot(t){return o(h).find(n=>n.entityTypes.includes(t))}return{get name(){return o(e)},get about(){return o(a)},get accentColor(){return o(s)},get nameLoaded(){return o(f)},async updateWorkspace(t){t.accent_color!==void 0&&(u(s,t.accent_color,!0),D(t.accent_color)),await it(t),t.name?.trim()&&u(e,t.name.trim(),!0),typeof t.about=="string"&&u(a,t.about,!0)},get repos(){return o(c)},get apps(){return o(h)},get loading(){return o(v)},get error(){return o(R)},get totalEntities(){return o(nt)},get totalLinks(){return o(S)},get totalFiles(){return o(b)},get hasTasks(){return o(c).some(t=>t.entities.some(n=>n.entityType==="task"))},get sortedRepos(){const t=[...o(c)].sort((n,r)=>n.name.localeCompare(r.name));return N(t)},get filteredIds(){const t=o(C).trim().toLowerCase();if(!t)return null;const n=new Set;for(const r of o(c))for(const i of r.entities)(i.title.toLowerCase().includes(t)||i.id.toLowerCase().includes(t))&&n.add(i.id);return n},get filterQuery(){return o(C)},setFilterQuery:X,get sortMode(){return o(x)},set sortMode(t){u(x,t,!0)},get recentEntities(){const t=o(C).trim().toLowerCase();let n=[];for(const r of o(c))for(const i of r.entities)t&&!i.title.toLowerCase().includes(t)&&!i.id.toLowerCase().includes(t)||n.push(i);return n.sort((r,i)=>{const l=r.updatedAt??"";return(i.updatedAt??"").localeCompare(l)})},get sidebarScrollTop(){return o(_)},set sidebarScrollTop(t){u(_,t,!0)},get lastAutoExpandedFor(){return o(F)},set lastAutoExpandedFor(t){u(F,t,!0)},load:W,loadEntities:$,removeEntity:V,refreshEntities:Q,refreshAll:B,toggleRepo:K,isExpanded:q,toggleEntity:H,isEntityExpanded:Y,getEntityContents:z,toggleFolder:Z,isFolderExpanded:tt,isFolderCollapsed:et,getAppForEntityType:ot,async renameCollectionTo(t,n,r){await ct(t,n,r);const i=o(c).find(l=>l.name===t);i&&(i.name=n,i.displayName=r||O(n),o(g)[t]&&(o(g)[n]=!0,delete o(g)[t]))},async removeCollection(t){await lt(t),u(c,o(c).filter(n=>n.name!==t),!0),delete o(g)[t]},async addCollection(t,n,r,i){await st(t,n,r,i);const l=await J();u(c,l.map(y=>o(c).find(P=>P.name===y.name)??{name:y.name,displayName:O(y.name,y.display_name),type:y.type,private:y.private,count:null,entities:[],loading:!1,loaded:!1}),!0),o(g)[t]=!0,await $(t)}}}const Lt=yt();export{Ut as a,wt as b,kt as c,Rt as d,bt as e,Tt as f,Ct as g,$t as h,St as i,Et as j,It as t,vt as u,Lt as w};
@@ -1 +0,0 @@
1
- import{aE as J,bp as ot,bC as st}from"./CfuRx7rA.js";import{r as we,o as Ke,i as ye,b as x,s as O,p as S,n as de,d as it,c as lt,S as Fe,N as F,H as $,a as ct,m as ft,e as ut,f as dt,g as ht,u as He,h as Be,j as he,k as X,l as le,P as pt,q as D,t as Me,v as Ve,w as je}from"./CHDa87Lu.js";class be{constructor(t,a){this.status=t,typeof a=="string"?this.body={message:a}:a?this.body=a:this.body={message:`Error: ${t}`}}toString(){return JSON.stringify(this.body)}}class Ee{constructor(t,a){this.status=t,this.location=a}}class ke extends Error{constructor(t,a,n){super(n),this.status=t,this.text=a}}const _t=/^(\[)?(\.\.\.)?(\w+)(?:=(\w+))?(\])?$/;function mt(e){const t=[];return{pattern:e==="/"?/^\/$/:new RegExp(`^${vt(e).map(n=>{const r=/^\[\.\.\.(\w+)(?:=(\w+))?\]$/.exec(n);if(r)return t.push({name:r[1],matcher:r[2],optional:!1,rest:!0,chained:!0}),"(?:/([^]*))?";const o=/^\[\[(\w+)(?:=(\w+))?\]\]$/.exec(n);if(o)return t.push({name:o[1],matcher:o[2],optional:!0,rest:!1,chained:!0}),"(?:/([^/]+))?";if(!n)return;const i=n.split(/\[(.+?)\](?!\])/);return"/"+i.map((l,c)=>{if(c%2){if(l.startsWith("x+"))return ce(String.fromCharCode(parseInt(l.slice(2),16)));if(l.startsWith("u+"))return ce(String.fromCharCode(...l.slice(2).split("-").map(v=>parseInt(v,16))));const d=_t.exec(l),[,p,u,f,h]=d;return t.push({name:f,matcher:h,optional:!!p,rest:!!u,chained:u?c===1&&i[0]==="":!1}),u?"([^]*?)":p?"([^/]*)?":"([^/]+?)"}return ce(l)}).join("")}).join("")}/?$`),params:t}}function gt(e){return e!==""&&!/^\([^)]+\)$/.test(e)}function vt(e){return e.slice(1).split("/").filter(gt)}function wt(e,t,a){const n={},r=e.slice(1),o=r.filter(s=>s!==void 0);let i=0;for(let s=0;s<t.length;s+=1){const l=t[s];let c=r[s-i];if(l.chained&&l.rest&&i&&(c=r.slice(s-i,s+1).filter(d=>d).join("/"),i=0),c===void 0)if(l.rest)c="";else continue;if(!l.matcher||a[l.matcher](c)){n[l.name]=c;const d=t[s+1],p=r[s+1];d&&!d.rest&&d.optional&&p&&l.chained&&(i=0),!d&&!p&&Object.keys(n).length===o.length&&(i=0);continue}if(l.optional&&l.chained){i++;continue}return}if(!i)return n}function ce(e){return e.normalize().replace(/[[\]]/g,"\\$&").replace(/%/g,"%25").replace(/\//g,"%2[Ff]").replace(/\?/g,"%3[Ff]").replace(/#/g,"%23").replace(/[.*+?^${}()|\\]/g,"\\$&")}function yt({nodes:e,server_loads:t,dictionary:a,matchers:n}){const r=new Set(t);return Object.entries(a).map(([s,[l,c,d]])=>{const{pattern:p,params:u}=mt(s),f={id:s,exec:h=>{const v=p.exec(h);if(v)return wt(v,u,n)},errors:[1,...d||[]].map(h=>e[h]),layouts:[0,...c||[]].map(i),leaf:o(l)};return f.errors.length=f.layouts.length=Math.max(f.errors.length,f.layouts.length),f});function o(s){const l=s<0;return l&&(s=~s),[l,e[s]]}function i(s){return s===void 0?s:[r.has(s),e[s]]}}function Ye(e,t=JSON.parse){try{return t(sessionStorage[e])}catch{}}function $e(e,t,a=JSON.stringify){const n=a(t);try{sessionStorage[e]=n}catch{}}function bt(e){return e.filter(t=>t!=null)}function Se(e){return e instanceof be||e instanceof ke?e.status:500}function Et(e){return e instanceof ke?e.text:"Internal Error"}const Ne={spanContext(){return kt},setAttribute(){return this},setAttributes(){return this},addEvent(){return this},setStatus(){return this},updateName(){return this},end(){return this},isRecording(){return!1},recordException(){return this},addLink(){return this},addLinks(){return this}},kt={traceId:"",spanId:"",traceFlags:0},St=new Set(["icon","shortcut icon","apple-touch-icon"]),C=Ye(Me)??{},H=Ye(Ve)??{},T={url:je({}),page:je({}),navigating:ot(null),updated:lt()};function Re(e){C[e]=O()}function Rt(e,t){let a=e+1;for(;C[a];)delete C[a],a+=1;for(a=t+1;H[a];)delete H[a],a+=1}function B(e,t=!1){return t?location.replace(e.href):location.href=e.href,new Promise(()=>{})}async function ze(){if("serviceWorker"in navigator){const e=await navigator.serviceWorker.getRegistration(x||"/");e&&await e.update()}}function pe(){}let xe,_e,Q,P,me,w;const Z=[],ee=[];let L=null;function te(){L?.fork?.then(e=>e?.discard()),L=null}const W=new Map,Ge=new Set,xt=new Set,K=new Set;let g={branch:[],error:null,url:null},We=!1,ae=!1,De=!0,M=!1,q=!1,Je=!1,Y=!1,Le,y,R,A;const ne=new Set;let fe;const re=new Map;async function Mt(e,t,a){globalThis.__sveltekit_1mpwd3p?.data&&globalThis.__sveltekit_1mpwd3p.data,document.URL!==location.href&&(location.href=location.href),w=e,await e.hooks.init?.(),xe=yt(e),P=document.documentElement,me=t,_e=e.nodes[0],Q=e.nodes[1],_e(),Q(),y=history.state?.[$],R=history.state?.[F],y||(y=R=Date.now(),history.replaceState({...history.state,[$]:y,[F]:R},""));const n=C[y];function r(){n&&(history.scrollRestoration="manual",scrollTo(n.x,n.y))}a?(r(),await Dt(me,a)):(await N({type:"enter",url:we(w.hash?Ft(new URL(location.href)):location.href),replace_state:!0}),r()),Nt()}async function Lt(e=!0,t=!0){if(await(fe||=Promise.resolve()),!fe)return;fe=null;const a=A={},n=await z(g.url,!0);if(te(),Y&&re.forEach(({resource:r})=>{r.refresh?.()}),e){const r=S.state,o=n&&await Ie(n);if(!o||a!==A)return;if(o.type==="redirect")return Pe(new URL(o.location,g.url).href,{replaceState:!0},1,a);t||(o.props.page.state=r),He(o.props.page),g=o.state,ge(),Le.$set(o.props)}else ge();await Promise.all([...re.values()].map(({resource:r})=>r)).catch(pe)}function ge(){Z.length=0,Y=!1}function Xe(e){ee.some(t=>t?.snapshot)&&(H[e]=ee.map(t=>t?.snapshot?.capture()))}function Qe(e){H[e]?.forEach((t,a)=>{ee[a]?.snapshot?.restore(t)})}function qe(){Re(y),$e(Me,C),Xe(R),$e(Ve,H)}async function Pe(e,t,a,n){let r;t.invalidateAll&&te(),await N({type:"goto",url:we(e),keepfocus:t.keepFocus,noscroll:t.noScroll,replace_state:t.replaceState,state:t.state,redirect_count:a,nav_token:n,accept:()=>{t.invalidateAll&&(Y=!0,r=[...re.keys()]),t.invalidate&&t.invalidate.forEach($t)}}),t.invalidateAll&&J().then(J).then(()=>{re.forEach(({resource:o},i)=>{r?.includes(i)&&o.refresh?.()})})}async function Pt(e){if(e.id!==L?.id){te();const t={};ne.add(t),L={id:e.id,token:t,promise:Ie({...e,preload:t}).then(a=>(ne.delete(t),a.type==="loaded"&&a.state.error&&te(),a)),fork:null}}return L.promise}async function ue(e){const t=(await z(e,!1))?.route;t&&await Promise.all([...t.layouts,t.leaf].filter(Boolean).map(a=>a[1]()))}async function Ze(e,t,a){g=e.state;const n=document.querySelector("style[data-sveltekit]");if(n&&n.remove(),Object.assign(S,e.props.page),Le=new w.root({target:t,props:{...e.props,stores:T,components:ee},hydrate:a,sync:!1}),await Promise.resolve(),Qe(R),a){const r={from:null,to:{params:g.params,route:{id:g.route?.id??null},url:new URL(location.href),scroll:C[y]??O()},willUnload:!1,type:"enter",complete:Promise.resolve()};K.forEach(o=>o(r))}ae=!0}function oe({url:e,params:t,branch:a,status:n,error:r,route:o,form:i}){let s="never";if(x&&(e.pathname===x||e.pathname===x+"/"))s="always";else for(const f of a)f?.slash!==void 0&&(s=f.slash);e.pathname=ut(e.pathname,s),e.search=e.search;const l={type:"loaded",state:{url:e,params:t,branch:a,error:r,route:o},props:{constructors:bt(a).map(f=>f.node.component),page:Oe(S)}};i!==void 0&&(l.props.form=i);let c={},d=!S,p=0;for(let f=0;f<Math.max(a.length,g.branch.length);f+=1){const h=a[f],v=g.branch[f];h?.data!==v?.data&&(d=!0),h&&(c={...c,...h.data},d&&(l.props[`data_${p}`]=c),p+=1)}return(!g.url||e.href!==g.url.href||g.error!==r||i!==void 0&&i!==S.form||d)&&(l.props.page={error:r,params:t,route:{id:o?.id??null},state:{},status:n,url:new URL(e),form:i??null,data:d?c:S.data}),l}async function Ae({loader:e,parent:t,url:a,params:n,route:r,server_data_node:o}){let i=null,s=!0;const l={dependencies:new Set,params:new Set,parent:!1,route:!1,url:!1,search_params:new Set},c=await e();if(c.universal?.load){let d=function(...u){for(const f of u){const{href:h}=new URL(f,a);l.dependencies.add(h)}};const p={tracing:{enabled:!1,root:Ne,current:Ne},route:new Proxy(r,{get:(u,f)=>(s&&(l.route=!0),u[f])}),params:new Proxy(n,{get:(u,f)=>(s&&l.params.add(f),u[f])}),data:o?.data??null,url:ft(a,()=>{s&&(l.url=!0)},u=>{s&&l.search_params.add(u)},w.hash),async fetch(u,f){u instanceof Request&&(f={body:u.method==="GET"||u.method==="HEAD"?void 0:await u.blob(),cache:u.cache,credentials:u.credentials,headers:[...u.headers].length>0?u?.headers:void 0,integrity:u.integrity,keepalive:u.keepalive,method:u.method,mode:u.mode,redirect:u.redirect,referrer:u.referrer,referrerPolicy:u.referrerPolicy,signal:u.signal,...f});const{resolved:h,promise:v}=et(u,f,a);return s&&d(h.href),v},setHeaders:()=>{},depends:d,parent(){return s&&(l.parent=!0),t()},untrack(u){s=!1;try{return u()}finally{s=!0}}};i=await c.universal.load.call(null,p)??null}return{node:c,loader:e,server:o,universal:c.universal?.load?{type:"data",data:i,uses:l}:null,data:i??o?.data??null,slash:c.universal?.trailingSlash??o?.slash}}function et(e,t,a){let n=e instanceof Request?e.url:e;const r=new URL(n,a);r.origin===a.origin&&(n=r.href.slice(a.origin.length));const o=ae?dt(n,r.href,t):ht(n,t);return{resolved:r,promise:o}}function At(e,t,a,n,r,o){if(Y)return!0;if(!r)return!1;if(r.parent&&e||r.route&&t||r.url&&a)return!0;for(const i of r.search_params)if(n.has(i))return!0;for(const i of r.params)if(o[i]!==g.params[i])return!0;for(const i of r.dependencies)if(Z.some(s=>s(new URL(i))))return!0;return!1}function Ue(e,t){return e?.type==="data"?e:e?.type==="skip"?t??null:null}function Ut(e,t){if(!e)return new Set(t.searchParams.keys());const a=new Set([...e.searchParams.keys(),...t.searchParams.keys()]);for(const n of a){const r=e.searchParams.getAll(n),o=t.searchParams.getAll(n);r.every(i=>o.includes(i))&&o.every(i=>r.includes(i))&&a.delete(n)}return a}function It({error:e,url:t,route:a,params:n}){return{type:"loaded",state:{error:e,url:t,route:a,params:n,branch:[]},props:{page:Oe(S),constructors:[]}}}async function Ie({id:e,invalidating:t,url:a,params:n,route:r,preload:o}){if(L?.id===e)return ne.delete(L.token),L.promise;const{errors:i,layouts:s,leaf:l}=r,c=[...s,l];i.forEach(m=>m?.().catch(()=>{})),c.forEach(m=>m?.[1]().catch(()=>{}));const d=g.url?e!==se(g.url):!1,p=g.route?r.id!==g.route.id:!1,u=Ut(g.url,a);let f=!1;const h=c.map(async(m,_)=>{if(!m)return;const E=g.branch[_];return m[1]===E?.loader&&!At(f,p,d,u,E.universal?.uses,n)?E:(f=!0,Ae({loader:m[1],url:a,params:n,route:r,parent:async()=>{const U={};for(let I=0;I<_;I+=1)Object.assign(U,(await h[I])?.data);return U},server_data_node:Ue(m[0]?{type:"skip"}:null,m[0]?E?.server:void 0)}))});for(const m of h)m.catch(()=>{});const v=[];for(let m=0;m<c.length;m+=1)if(c[m])try{v.push(await h[m])}catch(_){if(_ instanceof Ee)return{type:"redirect",location:_.location};if(ne.has(o))return It({error:await V(_,{params:n,url:a,route:{id:r.id}}),url:a,params:n,route:r});let E=Se(_),k;if(_ instanceof be)k=_.body;else{if(await T.updated.check())return await ze(),await B(a);k=await V(_,{params:n,url:a,route:{id:r.id}})}const U=await Tt(m,v,i);return U?oe({url:a,params:n,branch:v.slice(0,U.idx).concat(U.node),status:E,error:k,route:r}):await at(a,{id:r.id},k,E)}else v.push(void 0);return oe({url:a,params:n,branch:v,status:200,error:null,route:r,form:t?void 0:null})}async function Tt(e,t,a){for(;e--;)if(a[e]){let n=e;for(;!t[n];)n-=1;try{return{idx:n+1,node:{node:await a[e](),loader:a[e],data:{},server:null,universal:null}}}catch{continue}}}async function Te({status:e,error:t,url:a,route:n}){const r={};let o=null;try{const i=await Ae({loader:_e,url:a,params:r,route:n,parent:()=>Promise.resolve({}),server_data_node:Ue(o)}),s={node:await Q(),loader:Q,universal:null,server:null,data:null};return oe({url:a,params:r,branch:[i,s],status:e,error:t,route:null})}catch(i){if(i instanceof Ee)return Pe(new URL(i.location,location.href),{},0);throw i}}async function Ct(e){const t=e.href;if(W.has(t))return W.get(t);let a;try{const n=(async()=>{let r=await w.hooks.reroute({url:new URL(e),fetch:async(o,i)=>et(o,i,e).promise})??e;if(typeof r=="string"){const o=new URL(e);w.hash?o.hash=r:o.pathname=r,r=o}return r})();W.set(t,n),a=await n}catch{W.delete(t);return}return a}async function z(e,t){if(e&&!ye(e,x,w.hash)){const a=await Ct(e);if(!a)return;const n=Ot(a);for(const r of xe){const o=r.exec(n);if(o)return{id:se(e),invalidating:t,route:r,params:it(o),url:e}}}}function Ot(e){return ct(w.hash?e.hash.replace(/^#/,"").replace(/[?#].+/,""):e.pathname.slice(x.length))||"/"}function se(e){return(w.hash?e.hash.replace(/^#/,""):e.pathname)+e.search}function tt({url:e,type:t,intent:a,delta:n,event:r,scroll:o}){let i=!1;const s=Ce(g,a,e,t,o??null);n!==void 0&&(s.navigation.delta=n),r!==void 0&&(s.navigation.event=r);const l={...s.navigation,cancel:()=>{i=!0,s.reject(new Error("navigation cancelled"))}};return M||Ge.forEach(c=>c(l)),i?null:s}async function N({type:e,url:t,popped:a,keepfocus:n,noscroll:r,replace_state:o,state:i={},redirect_count:s=0,nav_token:l={},accept:c=pe,block:d=pe,event:p}){const u=A;A=l;const f=await z(t,!1),h=e==="enter"?Ce(g,f,t,e):tt({url:t,type:e,delta:a?.delta,intent:f,scroll:a?.scroll,event:p});if(!h){d(),A===l&&(A=u);return}const v=y,m=R;c(),M=!0,ae&&h.navigation.type!=="enter"&&T.navigating.set(de.current=h.navigation);let _=f&&await Ie(f);if(!_){if(ye(t,x,w.hash))return await B(t,o);_=await at(t,{id:null},await V(new ke(404,"Not Found",`Not found: ${t.pathname}`),{url:t,params:{},route:{id:null}}),404,o)}if(t=f?.url||t,A!==l)return h.reject(new Error("navigation aborted")),!1;if(_.type==="redirect"){if(s<20){await N({type:e,url:new URL(_.location,t),popped:a,keepfocus:n,noscroll:r,replace_state:o,state:i,redirect_count:s+1,nav_token:l}),h.fulfil(void 0);return}_=await Te({status:500,error:await V(new Error("Redirect loop"),{url:t,params:{},route:{id:null}}),url:t,route:{id:null}})}else _.props.page.status>=400&&await T.updated.check()&&(await ze(),await B(t,o));if(ge(),Re(v),Xe(m),_.props.page.url.pathname!==t.pathname&&(t.pathname=_.props.page.url.pathname),i=a?a.state:i,!a){const b=o?0:1,G={[$]:y+=b,[F]:R+=b,[Fe]:i};(o?history.replaceState:history.pushState).call(history,G,"",t),o||Rt(y,R)}const E=f&&L?.id===f.id?L.fork:null;L=null,_.props.page.state=i;let k;if(ae){const b=(await Promise.all(Array.from(xt,j=>j(h.navigation)))).filter(j=>typeof j=="function");if(b.length>0){let j=function(){b.forEach(ie=>{K.delete(ie)})};b.push(j),b.forEach(ie=>{K.add(ie)})}g=_.state,_.props.page&&(_.props.page.url=t);const G=E&&await E;G?k=G.commit():(Le.$set(_.props),He(_.props.page),k=st?.()),Je=!0}else await Ze(_,me,!1);const{activeElement:U}=document;await k,await J(),await J();let I=null;if(De){const b=a?a.scroll:r?O():null;b?scrollTo(b.x,b.y):(I=t.hash&&document.getElementById(nt(t)))?I.scrollIntoView():scrollTo(0,0)}const rt=document.activeElement!==U&&document.activeElement!==document.body;!n&&!rt&&Kt(t,!I),De=!0,_.props.page&&Object.assign(S,_.props.page),M=!1,e==="popstate"&&Qe(R),h.fulfil(void 0),h.navigation.to&&(h.navigation.to.scroll=O()),K.forEach(b=>b(h.navigation)),T.navigating.set(de.current=null)}async function at(e,t,a,n,r){return e.origin===Ke&&e.pathname===location.pathname&&!We?await Te({status:n,error:a,url:e,route:t}):await B(e,r)}function jt(){let e,t={element:void 0,href:void 0},a;P.addEventListener("mousemove",s=>{const l=s.target;clearTimeout(e),e=setTimeout(()=>{o(l,D.hover)},20)});function n(s){s.defaultPrevented||o(s.composedPath()[0],D.tap)}P.addEventListener("mousedown",n),P.addEventListener("touchstart",n,{passive:!0});const r=new IntersectionObserver(s=>{for(const l of s)l.isIntersecting&&(ue(new URL(l.target.href)),r.unobserve(l.target))},{threshold:0});async function o(s,l){const c=Be(s,P),d=c===t.element&&c?.href===t.href&&l>=a;if(!c||d)return;const{url:p,external:u,download:f}=he(c,x,w.hash);if(u||f)return;const h=X(c),v=p&&se(g.url)===se(p);if(!(h.reload||v))if(l<=h.preload_data){t={element:c,href:c.href},a=D.tap;const m=await z(p,!1);if(!m)return;Pt(m)}else l<=h.preload_code&&(t={element:c,href:c.href},a=l,ue(p))}function i(){r.disconnect();for(const s of P.querySelectorAll("a")){const{url:l,external:c,download:d}=he(s,x,w.hash);if(c||d)continue;const p=X(s);p.reload||(p.preload_code===D.viewport&&r.observe(s),p.preload_code===D.eager&&ue(l))}}K.add(i),i()}function V(e,t){if(e instanceof be)return e.body;const a=Se(e),n=Et(e);return w.hooks.handleError({error:e,event:t,status:a,message:n})??{message:n}}function Vt(e,t={}){return e=new URL(we(e)),e.origin!==Ke?Promise.reject(new Error("goto: invalid URL")):Pe(e,t,0)}function $t(e){if(typeof e=="function")Z.push(e);else{const{href:t}=new URL(e,location.href);Z.push(a=>a.href===t)}}function Yt(){return Y=!0,Lt()}function Nt(){history.scrollRestoration="manual",addEventListener("beforeunload",t=>{let a=!1;if(qe(),!M){const n=Ce(g,void 0,null,"leave"),r={...n.navigation,cancel:()=>{a=!0,n.reject(new Error("navigation cancelled"))}};Ge.forEach(o=>o(r))}a?(t.preventDefault(),t.returnValue=""):history.scrollRestoration="auto"}),addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&qe()}),navigator.connection?.saveData||jt(),P.addEventListener("click",async t=>{if(t.button||t.which!==1||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.defaultPrevented)return;const a=Be(t.composedPath()[0],P);if(!a)return;const{url:n,external:r,target:o,download:i}=he(a,x,w.hash);if(!n)return;if(o==="_parent"||o==="_top"){if(window.parent!==window)return}else if(o&&o!=="_self")return;const s=X(a);if(!(a instanceof SVGAElement)&&n.protocol!==location.protocol&&!(n.protocol==="https:"||n.protocol==="http:")||i)return;const[c,d]=(w.hash?n.hash.replace(/^#/,""):n.href).split("#"),p=c===le(location);if(r||s.reload&&(!p||!d)){tt({url:n,type:"link",event:t})?M=!0:t.preventDefault();return}if(d!==void 0&&p){const[,u]=g.url.href.split("#");if(u===d){if(t.preventDefault(),d===""||d==="top"&&a.ownerDocument.getElementById("top")===null)scrollTo({top:0});else{const f=a.ownerDocument.getElementById(decodeURIComponent(d));f&&(f.scrollIntoView(),f.focus())}return}if(q=!0,Re(y),e(n),!s.replace_state)return;q=!1}t.preventDefault(),await new Promise(u=>{requestAnimationFrame(()=>{setTimeout(u,0)}),setTimeout(u,100)}),await N({type:"link",url:n,keepfocus:s.keepfocus,noscroll:s.noscroll,replace_state:s.replace_state??n.href===location.href,event:t})}),P.addEventListener("submit",t=>{if(t.defaultPrevented)return;const a=HTMLFormElement.prototype.cloneNode.call(t.target),n=t.submitter;if((n?.formTarget||a.target)==="_blank"||(n?.formMethod||a.method)!=="get")return;const i=new URL(n?.hasAttribute("formaction")&&n?.formAction||a.action);if(ye(i,x,!1))return;const s=t.target,l=X(s);if(l.reload)return;t.preventDefault(),t.stopPropagation();const c=new FormData(s,n);i.search=new URLSearchParams(c).toString(),N({type:"form",url:i,keepfocus:l.keepfocus,noscroll:l.noscroll,replace_state:l.replace_state??i.href===location.href,event:t})}),addEventListener("popstate",async t=>{if(!ve){if(t.state?.[$]){const a=t.state[$];if(A={},a===y)return;const n=C[a],r=t.state[Fe]??{},o=new URL(t.state[pt]??location.href),i=t.state[F],s=g.url?le(location)===le(g.url):!1;if(i===R&&(Je||s)){r!==S.state&&(S.state=r),e(o),C[y]=O(),n&&scrollTo(n.x,n.y),y=a;return}const c=a-y;await N({type:"popstate",url:o,popped:{state:r,scroll:n,delta:c},accept:()=>{y=a,R=i},block:()=>{history.go(-c)},nav_token:A,event:t})}else if(!q){const a=new URL(location.href);e(a),w.hash&&location.reload()}}}),addEventListener("hashchange",()=>{q&&(q=!1,history.replaceState({...history.state,[$]:++y,[F]:R},"",location.href))});for(const t of document.querySelectorAll("link"))St.has(t.rel)&&(t.href=t.href);addEventListener("pageshow",t=>{t.persisted&&T.navigating.set(de.current=null)});function e(t){g.url=S.url=t,T.page.set(Oe(S)),T.page.notify()}}async function Dt(e,{status:t=200,error:a,node_ids:n,params:r,route:o,server_route:i,data:s,form:l}){We=!0;const c=new URL(location.href);let d;({params:r={},route:o={id:null}}=await z(c,!1)||{}),d=xe.find(({id:f})=>f===o.id);let p,u=!0;try{const f=n.map(async(v,m)=>{const _=s[m];return _?.uses&&(_.uses=qt(_.uses)),Ae({loader:w.nodes[v],url:c,params:r,route:o,parent:async()=>{const E={};for(let k=0;k<m;k+=1)Object.assign(E,(await f[k]).data);return E},server_data_node:Ue(_)})}),h=await Promise.all(f);if(d){const v=d.layouts;for(let m=0;m<v.length;m++)v[m]||h.splice(m,0,void 0)}p=oe({url:c,params:r,branch:h,status:t,error:a,form:l,route:d??null})}catch(f){if(f instanceof Ee){await B(new URL(f.location,location.href));return}p=await Te({status:Se(f),error:await V(f,{url:c,params:r,route:o}),url:c,route:o}),e.textContent="",u=!1}p.props.page&&(p.props.page.state={}),await Ze(p,e,u)}function qt(e){return{dependencies:new Set(e?.dependencies??[]),params:new Set(e?.params??[]),parent:!!e?.parent,route:!!e?.route,url:!!e?.url,search_params:new Set(e?.search_params??[])}}let ve=!1;function Kt(e,t=!0){const a=document.querySelector("[autofocus]");if(a)a.focus();else{const n=nt(e);if(n&&document.getElementById(n)){const{x:o,y:i}=O();setTimeout(()=>{const s=history.state;ve=!0,location.replace(new URL(`#${n}`,location.href)),history.replaceState(s,"",e),t&&scrollTo(o,i),ve=!1})}else{const o=document.body,i=o.getAttribute("tabindex");o.tabIndex=-1,o.focus({preventScroll:!0,focusVisible:!1}),i!==null?o.setAttribute("tabindex",i):o.removeAttribute("tabindex")}const r=getSelection();if(r&&r.type!=="None"){const o=[];for(let i=0;i<r.rangeCount;i+=1)o.push(r.getRangeAt(i));setTimeout(()=>{if(r.rangeCount===o.length){for(let i=0;i<r.rangeCount;i+=1){const s=o[i],l=r.getRangeAt(i);if(s.commonAncestorContainer!==l.commonAncestorContainer||s.startContainer!==l.startContainer||s.endContainer!==l.endContainer||s.startOffset!==l.startOffset||s.endOffset!==l.endOffset)return}r.removeAllRanges()}})}}}function Ce(e,t,a,n,r=null){let o,i;const s=new Promise((c,d)=>{o=c,i=d});return s.catch(()=>{}),{navigation:{from:{params:e.params,route:{id:e.route?.id??null},url:e.url,scroll:O()},to:a&&{params:t?.params??null,route:{id:t?.route?.id??null},url:a,scroll:r},willUnload:!t,type:n,complete:s},fulfil:o,reject:i}}function Oe(e){return{data:e.data,error:e.error,form:e.form,params:e.params,route:e.route,state:e.state,status:e.status,url:e.url}}function Ft(e){const t=new URL(e);return t.hash=decodeURIComponent(e.hash),t}function nt(e){let t;if(w.hash){const[,,a]=e.hash.split("#",3);t=a??""}else t=e.hash.slice(1);return decodeURIComponent(t)}export{Mt as a,Vt as g,Yt as i,T as s};
@@ -1,4 +0,0 @@
1
- import{e as I,f as _,s as a,g as s,a2 as U}from"./CfuRx7rA.js";import{i as H,g as L}from"./DUsnWwWN.js";import{n as h}from"./BZd_7gpI.js";import{w as V}from"./DQ_O96iG.js";function W(g,c,n){fetch("/api/chat/stream",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(g),signal:n}).then(async o=>{if(!o.ok){c({type:"error",message:`HTTP ${o.status}`});return}const r=o.body?.getReader();if(!r){c({type:"error",message:"No response body"});return}const m=new TextDecoder;let f="";for(;;){const{done:b,value:O}=await r.read();if(b)break;f+=m.decode(O,{stream:!0});const C=f.split(`
2
- `);f=C.pop()??"";for(const p of C)if(p.startsWith("data: "))try{const x=JSON.parse(p.slice(6));c(x)}catch{}}}).catch(o=>{o.name!=="AbortError"&&c({type:"error",message:o.message})})}const D="sg-chat-sessions",J="sg-chat-version",X=14;function w(){try{const g=localStorage.getItem(D);if(!g)return[];if(localStorage.getItem(J)==="2")return JSON.parse(g);const o=JSON.parse(g).map(r=>({id:crypto.randomUUID(),createdAt:r.date+"T00:00:00.000Z",updatedAt:r.date+"T00:00:00.000Z",title:r.messages.find(m=>m.role==="user")?.content.slice(0,50)||"New chat",messages:r.messages}));return localStorage.setItem(D,JSON.stringify(o)),localStorage.setItem(J,"2"),o}catch{return[]}}function $(g){const n=[...g].sort((o,r)=>r.updatedAt.localeCompare(o.updatedAt)).slice(0,X);try{localStorage.setItem(D,JSON.stringify(n)),localStorage.setItem(J,"2")}catch{}}function k(g,c){const n=w(),o=c.map(({streaming:m,...f})=>f),r=n.findIndex(m=>m.id===g);r>=0&&(n[r].messages=o,n[r].updatedAt=new Date().toISOString()),$(n)}function z(){const c=w().sort((e,i)=>i.updatedAt.localeCompare(e.updatedAt))[0];let n=I(_(c?c.messages.map(e=>({...e,streaming:!1})):[])),o=I(_(c?.id??null)),r=I(!1),m=I(0),f=I(0),b=I(null),O=null,C=I(""),p=I(_(!!c));const x=new Set(["create_entity","update_entity","delete_entity","move_entity"]);function R(){N();const e=crypto.randomUUID();a(o,e,!0),a(n,[],!0),a(p,!1)}function M(){if(s(o)&&s(p))return s(o);const e=s(o)||crypto.randomUUID();a(o,e,!0);const i=new Date().toISOString(),d=w();return d.push({id:e,createdAt:i,updatedAt:i,title:"New chat",messages:[]}),$(d),a(p,!0),e}function E(e){if(!e.trim()||s(r))return;a(b,null);const i=M();s(n).push({role:"user",content:e}),s(n).push({role:"agent",content:"",segments:[],streaming:!0}),a(r,!0);const d=w(),l=d.find(t=>t.id===i);l&&l.title==="New chat"&&(l.title=e.slice(0,50),$(d)),k(i,s(n));let A=!1,T=null;O=new AbortController;const q=h.selectedSubPath?`${h.selectedRepo}/${h.selectedType}/${h.selectedId}/${h.selectedSubPath}`:h.selectedId?`${h.selectedRepo}/${h.selectedType}/${h.selectedId}`:null,P=s(n).slice(0,-2).map(t=>({role:t.role==="agent"?"assistant":t.role,content:t.content})),G={message:e,context:q??void 0,sessionId:i,history:P.length>0?P:void 0};W(G,t=>{const u=s(n)[s(n).length-1];if(!u||u.role!=="agent")return;const y=u.segments;switch(t.type){case"token":{u.content+=t.text??"";const S=y[y.length-1];S&&S.type==="text"?S.content+=t.text??"":y.push({type:"text",content:t.text??""}),u.segments=y,U(f);break}case"tool_start":if(t.name){x.has(t.name)&&(A=!0);const S=y[y.length-1];S&&S.type==="tools"?S.names=[...S.names,t.name]:y.push({type:"tools",names:[t.name]}),u.segments=y,U(f)}break;case"mutation":A=!0,t.action==="created"&&t.repo&&t.entityType&&t.entityId&&(T={repo:t.repo,entityType:t.entityType,entityId:t.entityId}),window.StudioChrome?.emitMutation?.({action:t.action,repo:t.repo,entityType:t.entityType,entityId:t.entityId});break;case"highlight":a(b,t.entityIds&&t.entityIds.length>0?new Set(t.entityIds):null,!0);break;case"done":t.message&&!u.content&&(u.content=t.message,u.segments=[{type:"text",content:t.message}]),u.streaming=!1,a(r,!1),k(i,s(n)),A&&(H().then(()=>{U(m)}),V.refreshAll().then(()=>{T&&L(`/${T.repo}/${T.entityType}/${T.entityId}`)}));break;case"error":u.content+=`
3
-
4
- Error: ${t.message}`,u.streaming=!1,a(r,!1),k(i,s(n));break}},O.signal)}function N(){O?.abort(),a(r,!1);const e=s(n)[s(n).length-1];e?.streaming&&(e.streaming=!1),fetch("/api/chat/abort",{method:"POST",credentials:"include"}).catch(()=>{})}function K(){N(),a(n,[],!0),s(o)&&s(p)&&k(s(o),s(n))}function Y(e){const d=w().filter(l=>l.id!==e);if($(d),s(o)===e){const l=d.sort((A,T)=>T.updatedAt.localeCompare(A.updatedAt));l.length>0?(a(o,l[0].id,!0),a(n,l[0].messages.map(A=>({...A,streaming:!1})),!0),a(p,!0)):(a(o,null),a(n,[],!0),a(p,!1))}}function Z(e){const d=w().find(l=>l.id===e);d&&(N(),a(o,d.id,!0),a(n,d.messages.map(l=>({...l,streaming:!1})),!0),a(p,!0))}function j(){return w().sort((e,i)=>i.updatedAt.localeCompare(e.updatedAt)).map(e=>({id:e.id,title:e.title,createdAt:e.createdAt,updatedAt:e.updatedAt,preview:e.messages.find(i=>i.role==="user")?.content.slice(0,80)||"",count:e.messages.length,active:e.id===s(o)}))}return{get messages(){return s(n)},get streaming(){return s(r)},get mutationCount(){return s(m)},get scrollTick(){return s(f)},get highlightedIds(){return s(b)},get activeSessionId(){return s(o)},get draftInput(){return s(C)},set draftInput(e){a(C,e,!0)},send:E,stop:N,clear:K,newSession:R,deleteSession:Y,getSessions:j,loadSession:Z}}const ee=z();export{ee as c};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../nodes/0.tyq0tjYR.js","../chunks/PPVm8Dsz.js","../chunks/CajNsaOw.js","../chunks/CfuRx7rA.js","../chunks/Cwkp_c4R.js","../chunks/BA_Wro7X.js","../chunks/DEyrdHQB.js","../chunks/JDb8RpWX.js","../chunks/DUsnWwWN.js","../chunks/CHDa87Lu.js","../chunks/DQ_O96iG.js","../chunks/BZd_7gpI.js","../chunks/BH82yShn.js","../chunks/D18-Aspv.js","../chunks/DTDfEpZd.js","../chunks/RGHlrGBn.js","../chunks/DYVSnKKh.js","../chunks/CdvQjHNy.js","../chunks/BtJ5VKKi.js","../chunks/BLi1Oegj.js","../assets/Toaster.rN8r_Hzv.css","../chunks/DP6MOIr2.js","../assets/0.n3qM-DRk.css","../nodes/1.D-QPCIcu.js","../nodes/2.CogYiW3g.js","../chunks/DRJ9YW_E.js","../chunks/CNVuHNwC.js","../chunks/P7PfXw_H.js","../chunks/CdeYcEuU.js","../chunks/BJimep0Q.js","../chunks/Bypyvp-Q.js","../chunks/Dv65pOU4.js","../chunks/SJusBvJH.js","../chunks/9QAsBMIK.js","../chunks/Be5VhuaI.js","../chunks/fKdE_Jx_.js","../assets/Copy.FS8bdfxr.css","../chunks/mkNdSDMf.js","../chunks/DgMUDNqD.js","../assets/2.DNpjFx0k.css","../nodes/3.CQ8SfijF.js","../chunks/D0zbd2ZV.js","../assets/ViewToolbar.BX74Ki7U.css","../assets/3.CHSDCrUY.css","../nodes/4.BS-4PSr6.js","../chunks/CAEA_aBe.js","../chunks/CqkleIqs.js","../assets/4.CjSyz-ka.css","../nodes/5.pB3H4l7g.js","../assets/5.DFeGxLYf.css","../nodes/6.CKD5i0Ve.js","../assets/6.CquhUpOu.css","../nodes/7.au7lCUbq.js","../chunks/7lzM-85A.js","../assets/checkbox.D6tMDJWk.css","../assets/7.CObh-s2-.css","../nodes/8.B5sO5Rkn.js","../assets/8.DfcI2i9H.css","../nodes/9.DOysjWYm.js","../assets/9.CT4xL4K3.css","../nodes/10.BqjRpXN6.js","../assets/10.BUrHkYry.css"])))=>i.map(i=>d[i]);
2
- import{_ as i}from"../chunks/PPVm8Dsz.js";import{s as I,av as $,g as m,aC as tt,ai as et,m as rt,p as at,a4 as st,a5 as ot,aD as nt,aE as it,a0 as v,a1 as mt,b as ct,e as j,ac as O,c as ut,r as _t,t as dt}from"../chunks/CfuRx7rA.js";import{h as lt,m as ft,u as vt,a as _,c as E,b as Y,t as gt,s as ht}from"../chunks/CajNsaOw.js";import{i as D,b as R}from"../chunks/Cwkp_c4R.js";import{c as A}from"../chunks/BtJ5VKKi.js";import{p as L}from"../chunks/RGHlrGBn.js";function Et(s){return class extends pt{constructor(t){super({component:s,...t})}}}class pt{#e;#t;constructor(t){var a=new Map,c=(r,e)=>{var u=rt(e,!1,!1);return a.set(r,u),u};const n=new Proxy({...t.props||{},$$events:{}},{get(r,e){return m(a.get(e)??c(e,Reflect.get(r,e)))},has(r,e){return e===$?!0:(m(a.get(e)??c(e,Reflect.get(r,e))),Reflect.has(r,e))},set(r,e,u){return I(a.get(e)??c(e,u),u),Reflect.set(r,e,u)}});this.#t=(t.hydrate?lt:ft)(t.component,{target:t.target,anchor:t.anchor,props:n,context:t.context,intro:t.intro??!1,recover:t.recover,transformError:t.transformError}),(!t?.props?.$$host||t.sync===!1)&&tt(),this.#e=n.$$events;for(const r of Object.keys(this.#t))r==="$set"||r==="$destroy"||r==="$on"||et(this,r,{get(){return this.#t[r]},set(e){this.#t[r]=e},enumerable:!0});this.#t.$set=r=>{Object.assign(n,r)},this.#t.$destroy=()=>{vt(this.#t)}}$set(t){this.#t.$set(t)}$on(t,a){this.#e[t]=this.#e[t]||[];const c=(...n)=>a.call(this,...n);return this.#e[t].push(c),()=>{this.#e[t]=this.#e[t].filter(n=>n!==c)}}$destroy(){this.#t.$destroy()}}const wt={};var yt=Y('<div id="svelte-announcer" aria-live="assertive" aria-atomic="true" style="position: absolute; left: 0; top: 0; clip: rect(0 0 0 0); clip-path: inset(50%); overflow: hidden; white-space: nowrap; width: 1px; height: 1px"><!></div>'),Pt=Y("<!> <!>",1);function bt(s,t){at(t,!0);let a=L(t,"components",23,()=>[]),c=L(t,"data_0",3,null),n=L(t,"data_1",3,null),r=L(t,"data_2",3,null);st(()=>t.stores.page.set(t.page)),ot(()=>{t.stores,t.page,t.constructors,a(),t.form,c(),n(),r(),t.stores.page.notify()});let e=j(!1),u=j(!1),k=j(null);nt(()=>{const o=t.stores.page.subscribe(()=>{m(e)&&(I(u,!0),it().then(()=>{I(k,document.title||"untitled page",!0)}))});return I(e,!0),o});const z=O(()=>t.constructors[2]);var C=Pt(),S=v(C);{var B=o=>{const d=O(()=>t.constructors[0]);var l=E(),p=v(l);A(p,()=>m(d),(f,g)=>{R(g(f,{get data(){return c()},get form(){return t.form},get params(){return t.page.params},children:(y,Rt)=>{var M=E(),K=v(M);{var N=h=>{const T=O(()=>t.constructors[1]);var P=E(),V=v(P);A(V,()=>m(T),(x,w)=>{R(w(x,{get data(){return n()},get form(){return t.form},get params(){return t.page.params},children:(b,At)=>{var G=E(),U=v(G);A(U,()=>m(z),(W,X)=>{R(X(W,{get data(){return r()},get form(){return t.form},get params(){return t.page.params}}),Z=>a()[2]=Z,()=>a()?.[2])}),_(b,G)},$$slots:{default:!0}}),b=>a()[1]=b,()=>a()?.[1])}),_(h,P)},Q=h=>{const T=O(()=>t.constructors[1]);var P=E(),V=v(P);A(V,()=>m(T),(x,w)=>{R(w(x,{get data(){return n()},get form(){return t.form},get params(){return t.page.params}}),b=>a()[1]=b,()=>a()?.[1])}),_(h,P)};D(K,h=>{t.constructors[2]?h(N):h(Q,!1)})}_(y,M)},$$slots:{default:!0}}),y=>a()[0]=y,()=>a()?.[0])}),_(o,l)},F=o=>{const d=O(()=>t.constructors[0]);var l=E(),p=v(l);A(p,()=>m(d),(f,g)=>{R(g(f,{get data(){return c()},get form(){return t.form},get params(){return t.page.params}}),y=>a()[0]=y,()=>a()?.[0])}),_(o,l)};D(S,o=>{t.constructors[1]?o(B):o(F,!1)})}var H=mt(S,2);{var J=o=>{var d=yt(),l=ut(d);{var p=f=>{var g=gt();dt(()=>ht(g,m(k))),_(f,g)};D(l,f=>{m(u)&&f(p)})}_t(d),_(o,d)};D(H,o=>{m(e)&&o(J)})}_(s,C),ct()}const jt=Et(bt),kt=[()=>i(()=>import("../nodes/0.tyq0tjYR.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22]),import.meta.url),()=>i(()=>import("../nodes/1.D-QPCIcu.js"),__vite__mapDeps([23,2,3,19,9,8]),import.meta.url),()=>i(()=>import("../nodes/2.CogYiW3g.js"),__vite__mapDeps([24,2,3,5,4,6,1,17,18,8,9,19,15,25,26,27,10,11,12,28,29,30,21,31,13,32,33,34,35,36,37,38,39]),import.meta.url),()=>i(()=>import("../nodes/3.CQ8SfijF.js"),__vite__mapDeps([40,2,3,19,4,41,5,6,17,33,15,8,9,29,30,11,10,14,42,43]),import.meta.url),()=>i(()=>import("../nodes/4.BS-4PSr6.js"),__vite__mapDeps([44,10,3,6,1,2,4,17,18,15,8,9,41,5,33,19,29,30,11,14,42,28,31,26,13,12,32,45,46,25,38,47]),import.meta.url),()=>i(()=>import("../nodes/5.pB3H4l7g.js"),__vite__mapDeps([48,10,3,6,2,4,8,9,11,49]),import.meta.url),()=>i(()=>import("../nodes/6.CKD5i0Ve.js"),__vite__mapDeps([50,2,3,41,5,4,6,17,33,15,8,9,19,29,30,11,10,14,42,1,28,38,51]),import.meta.url),()=>i(()=>import("../nodes/7.au7lCUbq.js"),__vite__mapDeps([52,2,3,19,4,26,5,6,15,17,18,53,33,27,54,32,35,36,34,30,45,1,12,10,21,9,11,55]),import.meta.url),()=>i(()=>import("../nodes/8.B5sO5Rkn.js"),__vite__mapDeps([56,2,3,4,17,18,5,6,8,9,41,33,15,19,29,30,11,10,14,42,28,37,26,25,53,27,54,34,57]),import.meta.url),()=>i(()=>import("../nodes/9.DOysjWYm.js"),__vite__mapDeps([58,2,3,4,7,8,9,12,6,33,5,15,34,59]),import.meta.url),()=>i(()=>import("../nodes/10.BqjRpXN6.js"),__vite__mapDeps([60,2,3,4,7,8,9,12,6,10,33,5,15,34,61]),import.meta.url)],Ct=[],St={"/(app)":[3,[2]],"/(app)/graph":[6,[2]],"/login":[9],"/(app)/settings":[7,[2]],"/setup":[10],"/(app)/views/[id]":[8,[2]],"/(app)/[repo]/[type]/[id]":[4,[2]],"/(app)/[repo]/[type]/[id]/edit":[5,[2]]},q={handleError:(({error:s})=>{console.error(s)}),reroute:(()=>{}),transport:{}},Ot=Object.fromEntries(Object.entries(q.transport).map(([s,t])=>[s,t.decode])),Mt=Object.fromEntries(Object.entries(q.transport).map(([s,t])=>[s,t.encode])),Gt=!1,Yt=(s,t)=>Ot[s](t);export{Yt as decode,Ot as decoders,St as dictionary,Mt as encoders,Gt as hash,q as hooks,wt as matchers,kt as nodes,jt as root,Ct as server_loads};
@@ -1 +0,0 @@
1
- import{a as r}from"../chunks/DUsnWwWN.js";import{x as t}from"../chunks/CHDa87Lu.js";export{t as load_css,r as start};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../chunks/BB_5th5W.js","../chunks/PPVm8Dsz.js","../chunks/CqkleIqs.js","../chunks/DnL9f0lc.js","../chunks/CX_61fY8.js","../chunks/CscoF-YL.js","../chunks/D7ZqAKi9.js","../chunks/C7VoTosa.js","../chunks/CrdV0ttd.js"])))=>i.map(i=>d[i]);
2
- import{_ as A}from"../chunks/PPVm8Dsz.js";import{a as _,s as O,f as y,b as ee,c as te}from"../chunks/CajNsaOw.js";import{p as E,l as M,s,d as f,g as t,a as k,c as b,n as T,r as w,b as P,m as $,t as R,ay as ae,e as V,f as B,aV as U,a5 as W,aD as re,a1 as oe,ab as ne,ad as ie,a0 as le}from"../chunks/CfuRx7rA.js";import{i as C}from"../chunks/Cwkp_c4R.js";import{a as D,c as se,s as de}from"../chunks/BA_Wro7X.js";import{h as ce}from"../chunks/JDb8RpWX.js";import{g as N}from"../chunks/DUsnWwWN.js";import{w as j}from"../chunks/DQ_O96iG.js";import{n as ue}from"../chunks/BZd_7gpI.js";import{a as S}from"../chunks/BH82yShn.js";import{r as G}from"../chunks/D18-Aspv.js";import{v as me}from"../chunks/DTDfEpZd.js";import{l as x,p as I,s as he,r as fe}from"../chunks/RGHlrGBn.js";import{T as pe}from"../chunks/DYVSnKKh.js";import{R as ve}from"../chunks/DP6MOIr2.js";import{i as F}from"../chunks/BLi1Oegj.js";var ge=y("<title> </title>"),_e=y('<svg><!><path d="M16,2A14,14,0,1,0,30,16,14,14,0,0,0,16,2ZM14,21.5908l-5-5L10.5906,15,14,18.4092,21.41,11l1.5957,1.5859Z"></path><path fill="none" d="M14 21.591 9 16.591 10.591 15 14 18.409 21.41 11 23.005 12.585 14 21.591z" data-icon-path="inner-path"></path></svg>');function be(p,o){const e=x(o,["children","$$slots","$$events","$$legacy"]),v=x(e,["size","title"]);E(o,!1);const a=$(),u=$();let d=I(o,"size",8,16),i=I(o,"title",8,void 0);M(()=>(f(e),f(i())),()=>{s(a,e["aria-label"]||e["aria-labelledby"]||i())}),M(()=>(t(a),f(e)),()=>{s(u,{"aria-hidden":t(a)?void 0:!0,role:t(a)?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})}),k(),F();var n=_e();D(n,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:d(),height:d(),...t(u),...v}));var r=b(n);{var g=l=>{var c=ge(),m=b(c,!0);w(c),R(()=>O(m,i())),_(l,c)};C(r,l=>{i()&&l(g)})}T(2),w(n),_(p,n),P()}var we=y("<title> </title>"),Me=y('<svg><!><path fill="none" d="M14.9 7.2H17.1V24.799H14.9z" data-icon-path="inner-path" transform="rotate(-45 16 16)"></path><path d="M16,2A13.914,13.914,0,0,0,2,16,13.914,13.914,0,0,0,16,30,13.914,13.914,0,0,0,30,16,13.914,13.914,0,0,0,16,2Zm5.4449,21L9,10.5557,10.5557,9,23,21.4448Z"></path></svg>');function $e(p,o){const e=x(o,["children","$$slots","$$events","$$legacy"]),v=x(e,["size","title"]);E(o,!1);const a=$(),u=$();let d=I(o,"size",8,16),i=I(o,"title",8,void 0);M(()=>(f(e),f(i())),()=>{s(a,e["aria-label"]||e["aria-labelledby"]||i())}),M(()=>(t(a),f(e)),()=>{s(u,{"aria-hidden":t(a)?void 0:!0,role:t(a)?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})}),k(),F();var n=Me();D(n,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:d(),height:d(),...t(u),...v}));var r=b(n);{var g=l=>{var c=we(),m=b(c,!0);w(c),R(()=>O(m,i())),_(l,c)};C(r,l=>{i()&&l(g)})}T(2),w(n),_(p,n),P()}var xe=y("<title> </title>"),Ie=y('<svg><!><path fill="none" d="M16,8a1.5,1.5,0,1,1-1.5,1.5A1.5,1.5,0,0,1,16,8Zm4,13.875H17.125v-8H13v2.25h1.875v5.75H12v2.25h8Z" data-icon-path="inner-path"></path><path d="M16,2A14,14,0,1,0,30,16,14,14,0,0,0,16,2Zm0,6a1.5,1.5,0,1,1-1.5,1.5A1.5,1.5,0,0,1,16,8Zm4,16.125H12v-2.25h2.875v-5.75H13v-2.25h4.125v8H20Z"></path></svg>');function ye(p,o){const e=x(o,["children","$$slots","$$events","$$legacy"]),v=x(e,["size","title"]);E(o,!1);const a=$(),u=$();let d=I(o,"size",8,16),i=I(o,"title",8,void 0);M(()=>(f(e),f(i())),()=>{s(a,e["aria-label"]||e["aria-labelledby"]||i())}),M(()=>(t(a),f(e)),()=>{s(u,{"aria-hidden":t(a)?void 0:!0,role:t(a)?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})}),k(),F();var n=Ie();D(n,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:d(),height:d(),...t(u),...v}));var r=b(n);{var g=l=>{var c=xe(),m=b(c,!0);w(c),R(()=>O(m,i())),_(l,c)};C(r,l=>{i()&&l(g)})}T(2),w(n),_(p,n),P()}var ze=y("<title> </title>"),Ae=y('<svg><!><path fill="none" d="M16,26a1.5,1.5,0,1,1,1.5-1.5A1.5,1.5,0,0,1,16,26Zm-1.125-5h2.25V12h-2.25Z" data-icon-path="inner-path"></path><path d="M16.002,6.1714h-.004L4.6487,27.9966,4.6506,28H27.3494l.0019-.0034ZM14.875,12h2.25v9h-2.25ZM16,26a1.5,1.5,0,1,1,1.5-1.5A1.5,1.5,0,0,1,16,26Z"></path><path d="M29,30H3a1,1,0,0,1-.8872-1.4614l13-25a1,1,0,0,1,1.7744,0l13,25A1,1,0,0,1,29,30ZM4.6507,28H27.3493l.002-.0033L16.002,6.1714h-.004L4.6487,27.9967Z"></path></svg>');function Ee(p,o){const e=x(o,["children","$$slots","$$events","$$legacy"]),v=x(e,["size","title"]);E(o,!1);const a=$(),u=$();let d=I(o,"size",8,16),i=I(o,"title",8,void 0);M(()=>(f(e),f(i())),()=>{s(a,e["aria-label"]||e["aria-labelledby"]||i())}),M(()=>(t(a),f(e)),()=>{s(u,{"aria-hidden":t(a)?void 0:!0,role:t(a)?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})}),k(),F();var n=Ae();D(n,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:d(),height:d(),...t(u),...v}));var r=b(n);{var g=l=>{var c=ze(),m=b(c,!0);w(c),R(()=>O(m,i())),_(l,c)};C(r,l=>{i()&&l(g)})}T(3),w(n),_(p,n),P()}function Pe(p,o){E(o,!0);const e=ae("theme");let v=fe(o,["$$slots","$$events","$$legacy"]);pe(p,he({get theme(){return e.current},class:"toaster group",style:"--normal-bg: var(--color-bg-elevated); --normal-text: var(--color-text-primary); --normal-border: var(--color-border-strong);"},()=>v,{loadingIcon:r=>{ve(r,{class:"size-4 animate-spin"})},successIcon:r=>{be(r,{class:"size-4"})},errorIcon:r=>{$e(r,{class:"size-4"})},infoIcon:r=>{ye(r,{class:"size-4"})},warningIcon:r=>{Ee(r,{class:"size-4"})},$$slots:{loadingIcon:!0,successIcon:!0,errorIcon:!0,infoIcon:!0,warningIcon:!0}})),P()}var Ze=ee('<div style="display: contents;"><!> <!></div>');function We(p,o){E(o,!0);const e=typeof localStorage<"u"?localStorage.getItem("theme"):null,v=typeof window<"u"&&window.matchMedia?.("(prefers-color-scheme: light)").matches?"light":"dark";let a=V(B(e||v));U("theme",{get current(){return t(a)},toggle(){s(a,t(a)==="dark"?"light":"dark",!0),localStorage.setItem("theme",t(a))}});const d=typeof localStorage<"u"?localStorage.getItem("chatMode"):null,i=typeof localStorage<"u"?localStorage.getItem("chatOpen"):null,n=d==="panel"||d==="full"?d:d==="closed"?"closed":i==="true"?"panel":"closed";let r=V(B(n)),g=V(B(n==="closed"?"panel":n));function l(){localStorage.setItem("chatMode",t(r))}U("chat",{get open(){return t(r)!=="closed"},get mode(){return t(r)},toggle(){s(r,t(r)==="closed"?t(g):"closed",!0),l()},close(){s(r,"closed"),l()},expand(){s(r,"full"),s(g,"full"),l()},collapse(){s(r,"panel"),s(g,"panel"),l()}}),W(()=>{document.documentElement.setAttribute("data-theme",t(a))});let m=V(null);W(()=>{if(S.loading)return;const h=S.user?.email??(S.authEnabled?null:"__open__");h&&h!==t(m)&&(t(m)!==null&&ue.deselect(),s(m,h,!0),j.load(),me.load(),G.connect()),!h&&t(m)&&(s(m,null),G.disconnect())}),re(async()=>{const h=window.location.pathname,z=h==="/login",Z=h==="/setup",{authenticated:q,authEnabled:Q,needsSetup:X}=await S.checkAuth();if(X&&!Z){N("/setup");return}if(Q&&!q&&!z){N("/login");return}if(q&&(z||Z)){N("/");return}z||Z||(A(()=>import("../chunks/BB_5th5W.js"),__vite__mapDeps([0,1,2]),import.meta.url).catch(()=>{}),Promise.all([A(()=>import("../chunks/CX_61fY8.js"),[],import.meta.url),A(()=>import("../chunks/DnL9f0lc.js").then(L=>L.i),__vite__mapDeps([3,4]),import.meta.url),A(()=>import("../chunks/CscoF-YL.js"),__vite__mapDeps([5,4,3,6,7,8]),import.meta.url),A(()=>import("../chunks/D7ZqAKi9.js"),__vite__mapDeps([6,7,4,3]),import.meta.url),A(()=>import("../chunks/C7VoTosa.js").then(L=>L.i),[],import.meta.url)]).catch(()=>{}),window.addEventListener("sg-theme-change",L=>{s(a,L.detail,!0)}))});var H=Ze();ce("12qhfyh",h=>{ne(()=>{ie.title=(j.name||"Studiograph")??""})});var Y=b(H);{var J=h=>{var z=te(),Z=le(z);de(Z,()=>o.children),_(h,z)};C(Y,h=>{S.loading||h(J)})}var K=oe(Y,2);Pe(K,{}),w(H),R(()=>se(H,"data-theme",t(a))),_(p,H),P()}export{We as component};
@@ -1 +0,0 @@
1
- import{a as u,b as h,s}from"../chunks/CajNsaOw.js";import{i as g}from"../chunks/BLi1Oegj.js";import{p as l,a0 as v,t as d,b as _,c as e,r as o,a1 as x}from"../chunks/CfuRx7rA.js";import{p}from"../chunks/CHDa87Lu.js";import{s as b}from"../chunks/DUsnWwWN.js";const $={get error(){return p.error},get status(){return p.status}};b.updated.check;const m=$;var k=h("<h1> </h1> <p> </p>",1);function z(i,c){l(c,!1),g();var t=k(),r=v(t),f=e(r,!0);o(r);var a=x(r,2),n=e(a,!0);o(a),d(()=>{s(f,m.status),s(n,m.error?.message)}),u(i,t),_()}export{z as component};