studiograph 1.3.17 → 1.3.19

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 (31) hide show
  1. package/dist/integrations/granola.js +1 -1
  2. package/dist/integrations/granola.js.map +1 -1
  3. package/dist/services/sync/collection-sync.js +3 -1
  4. package/dist/services/sync/collection-sync.js.map +1 -1
  5. package/dist/services/sync/frontmatter-extractor.js +10 -3
  6. package/dist/services/sync/frontmatter-extractor.js.map +1 -1
  7. package/dist/services/sync/structured-extractor.js +11 -0
  8. package/dist/services/sync/structured-extractor.js.map +1 -1
  9. package/dist/services/sync/types.d.ts +4 -4
  10. package/dist/web/_app/immutable/chunks/{D8Tke-Cy.js → CIZkRAuY.js} +1 -1
  11. package/dist/web/_app/immutable/chunks/{DKIAzWea.js → CnKc_Tae.js} +1 -1
  12. package/dist/web/_app/immutable/chunks/DKIqe64p.js +64 -0
  13. package/dist/web/_app/immutable/chunks/{DlO1k6-D.js → DVuLyxG5.js} +1 -1
  14. package/dist/web/_app/immutable/chunks/{Bxlwy1pA.js → Scb_NG-a.js} +1 -1
  15. package/dist/web/_app/immutable/chunks/{DLX3YXva.js → glgUBDR2.js} +1 -1
  16. package/dist/web/_app/immutable/entry/{app.DdWuEeFT.js → app.DjTkwlaQ.js} +2 -2
  17. package/dist/web/_app/immutable/entry/start.Bupokdng.js +1 -0
  18. package/dist/web/_app/immutable/nodes/{0.B5o3d5X8.js → 0.Q3C-jhjE.js} +1 -1
  19. package/dist/web/_app/immutable/nodes/{1.B5Mts5LU.js → 1.BPCfgPXb.js} +1 -1
  20. package/dist/web/_app/immutable/nodes/{2.Byiqvg8R.js → 2.Bdsd2uts.js} +1 -1
  21. package/dist/web/_app/immutable/nodes/{3.D_YfR2w4.js → 3.Doh56lgy.js} +3 -3
  22. package/dist/web/_app/immutable/nodes/{4.DzzO-Wza.js → 4.CD5YzRYT.js} +1 -1
  23. package/dist/web/_app/immutable/nodes/{5.CWHutd51.js → 5.DN4bEWf-.js} +1 -1
  24. package/dist/web/_app/immutable/nodes/{6.CMT_d5RM.js → 6.BfA9chPb.js} +1 -1
  25. package/dist/web/_app/immutable/nodes/{7.B_36JWv3.js → 7.DhU0-U33.js} +1 -1
  26. package/dist/web/_app/immutable/nodes/{8.7DwRR4iA.js → 8.wSRycWoC.js} +1 -1
  27. package/dist/web/_app/version.json +1 -1
  28. package/dist/web/index.html +6 -6
  29. package/package.json +1 -1
  30. package/dist/web/_app/immutable/chunks/pFRFqWMS.js +0 -64
  31. package/dist/web/_app/immutable/entry/start.BzB3ns3v.js +0 -1
@@ -0,0 +1,64 @@
1
+ import{b as dt,c as V,a as w,f as P,j as ss,e as rs,g as gt,s as _e,t as ns}from"./0x0awhVy.js";import{A as le,l as ft,G as kt,a9 as as,bk as is,o as xt,C as ls,m as os,b6 as cs,b3 as hs,n as ps,aA as us,aB as ds,bl as gs,p as Fe,f as X,q as Tt,t as zt,v as At,x as D,w as R,z as _,y as Ie,F as ee,a7 as Ue,D as S,g as p,aj as Ve,R as fs,S as Xe,a as ks,bm as xs,T as Se}from"./8FUQuwgM.js";import{g as It,e as ms,w as bs,h as ws}from"./EDLlAC9C.js";import{l as me,s as be,p as vs,i as O,b as ys}from"./CbJfRYJV.js";import{n as E,e as Re,i as Te}from"./glgUBDR2.js";import{B as te}from"./BVmVTxxa.js";import"./Bl1mtM70.js";import{I as we,s as ve,X as $s,T as _s,a as Ss}from"./Scb_NG-a.js";import{i as Rs,g as Ts}from"./CIZkRAuY.js";function mt(r,e,s=!1,n=!1,t=!1){var i=r,a="";le(()=>{var o=as;if(a===(a=e()??"")){ft&&kt();return}if(o.nodes!==null&&(is(o.nodes.start,o.nodes.end),o.nodes=null),a!==""){if(ft){xt.data;for(var l=kt(),h=l;l!==null&&(l.nodeType!==ls||l.data!=="");)h=l,l=os(l);if(l===null)throw cs(),hs;dt(xt,h),i=ps(l);return}var c=s?ds:n?gs:void 0,u=us(s?"svg":n?"math":"template",c);u.innerHTML=a;var d=s||n?u:u.content;if(dt(Fe(d),d.lastChild),s||n)for(;Fe(d);)i.before(Fe(d));else i.before(d)}})}function bt(r,e){const s=me(e,["children","$$slots","$$events","$$legacy"]);const n=[["path",{d:"M3 5h.01"}],["path",{d:"M3 12h.01"}],["path",{d:"M3 19h.01"}],["path",{d:"M8 5h13"}],["path",{d:"M8 12h13"}],["path",{d:"M8 19h13"}]];we(r,be({name:"list"},()=>s,{get iconNode(){return n},children:(t,i)=>{var a=V(),o=X(a);ve(o,e,"default",{}),w(t,a)},$$slots:{default:!0}}))}function wt(r,e){const s=me(e,["children","$$slots","$$events","$$legacy"]);const n=[["circle",{cx:"18",cy:"5",r:"3"}],["circle",{cx:"6",cy:"12",r:"3"}],["circle",{cx:"18",cy:"19",r:"3"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49"}]];we(r,be({name:"share-2"},()=>s,{get iconNode(){return n},children:(t,i)=>{var a=V(),o=X(a);ve(o,e,"default",{}),w(t,a)},$$slots:{default:!0}}))}function zs(r,e){const s=me(e,["children","$$slots","$$events","$$legacy"]);const n=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z"}]];we(r,be({name:"message-square"},()=>s,{get iconNode(){return n},children:(t,i)=>{var a=V(),o=X(a);ve(o,e,"default",{}),w(t,a)},$$slots:{default:!0}}))}var As=P('<span class="toggle-btn active svelte-r6dy5f" aria-current="page"><!><span class="toggle-label">Details</span></span>'),Is=P('<a class="toggle-btn svelte-r6dy5f"><!><span class="toggle-label">Details</span></a>'),Ps=P('<span class="toggle-btn active svelte-r6dy5f" aria-current="page"><!><span class="toggle-label">Graph</span></span>'),Cs=P('<a class="toggle-btn svelte-r6dy5f" href="/graph"><!><span class="toggle-label">Graph</span></a>'),Es=P('<div class="view-toolbar svelte-r6dy5f"><div></div> <div class="view-toggles svelte-r6dy5f"><!> <!></div> <div class="toolbar-right svelte-r6dy5f"><!> <!></div></div>');function Kr(r,e){Tt(e,!0);let s=vs(e,"activeView",3,"entity");const n=zt("chat");var t=Es(),i=D(R(t),2),a=R(i);{var o=m=>{var b=As(),C=R(b);bt(C,{size:14}),Ie(),_(b),w(m,b)},l=m=>{var b=Is(),C=R(b);bt(C,{size:14}),Ie(),_(b),le(()=>It(b,"href",E.entityPath??"/")),w(m,b)};O(a,m=>{s()==="entity"?m(o):m(l,!1)})}var h=D(a,2);{var c=m=>{var b=Ps(),C=R(b);wt(C,{size:14}),Ie(),_(b),w(m,b)},u=m=>{var b=Cs(),C=R(b);wt(C,{size:14}),Ie(),_(b),w(m,b)};O(h,m=>{s()==="graph"?m(c):m(u,!1)})}_(i);var d=D(i,2),T=R(d);{var $=m=>{var b=V(),C=X(b);ms(C,()=>e.right),w(m,b)};O(T,m=>{e.right&&m($)})}var I=D(T,2);{var se=m=>{te(m,{variant:"accent",size:"icon",class:"chat-toggle",title:"Open Agent",get onclick(){return n.toggle},children:(b,C)=>{zs(b,{size:14})},$$slots:{default:!0}})};O(I,m=>{n.open||m(se)})}_(d),_(t),w(r,t),At()}function Ls(r,e){const s=me(e,["children","$$slots","$$events","$$legacy"]);const n=[["circle",{cx:"12",cy:"12",r:"10"}],["rect",{x:"9",y:"9",width:"6",height:"6",rx:"1"}]];we(r,be({name:"circle-stop"},()=>s,{get iconNode(){return n},children:(t,i)=>{var a=V(),o=X(a);ve(o,e,"default",{}),w(t,a)},$$slots:{default:!0}}))}function qs(r,e){const s=me(e,["children","$$slots","$$events","$$legacy"]);const n=[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z"}]];we(r,be({name:"square-pen"},()=>s,{get iconNode(){return n},children:(t,i)=>{var a=V(),o=X(a);ve(o,e,"default",{}),w(t,a)},$$slots:{default:!0}}))}function Bs(r,e){const s=me(e,["children","$$slots","$$events","$$legacy"]);const n=[["circle",{cx:"12",cy:"12",r:"10"}],["path",{d:"M12 6v6l4 2"}]];we(r,be({name:"clock"},()=>s,{get iconNode(){return n},children:(t,i)=>{var a=V(),o=X(a);ve(o,e,"default",{}),w(t,a)},$$slots:{default:!0}}))}function st(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var ge=st();function Pt(r){ge=r}var ue={exec:()=>null};function x(r,e=""){let s=typeof r=="string"?r:r.source,n={replace:(t,i)=>{let a=typeof i=="string"?i:i.source;return a=a.replace(M.caret,"$1"),s=s.replace(t,a),n},getRegex:()=>new RegExp(s,e)};return n}var Ms=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),M={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:r=>new RegExp(`^( {0,3}${r})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}#`),htmlBeginRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}>`)},Ns=/^(?:[ \t]*(?:\n|$))+/,js=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Ds=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Ce=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Os=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,rt=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Ct=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Et=x(Ct).replace(/bull/g,rt).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Zs=x(Ct).replace(/bull/g,rt).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),nt=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Hs=/^[^\n]+/,at=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Qs=x(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",at).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Ws=x(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,rt).getRegex(),je="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",it=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Gs=x("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",it).replace("tag",je).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Lt=x(nt).replace("hr",Ce).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",je).getRegex(),Fs=x(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Lt).getRegex(),lt={blockquote:Fs,code:js,def:Qs,fences:Ds,heading:Os,hr:Ce,html:Gs,lheading:Et,list:Ws,newline:Ns,paragraph:Lt,table:ue,text:Hs},vt=x("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Ce).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",je).getRegex(),Us={...lt,lheading:Zs,table:vt,paragraph:x(nt).replace("hr",Ce).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",vt).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",je).getRegex()},Vs={...lt,html:x(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",it).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:ue,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:x(nt).replace("hr",Ce).replace("heading",` *#{1,6} *[^
2
+ ]`).replace("lheading",Et).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Xs=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Js=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,qt=/^( {2,}|\\)\n(?!\s*$)/,Ks=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,De=/[\p{P}\p{S}]/u,ot=/[\s\p{P}\p{S}]/u,Bt=/[^\s\p{P}\p{S}]/u,Ys=x(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,ot).getRegex(),Mt=/(?!~)[\p{P}\p{S}]/u,er=/(?!~)[\s\p{P}\p{S}]/u,tr=/(?:[^\s\p{P}\p{S}]|~)/u,Nt=/(?![*_])[\p{P}\p{S}]/u,sr=/(?![*_])[\s\p{P}\p{S}]/u,rr=/(?:[^\s\p{P}\p{S}]|[*_])/u,nr=x(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Ms?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),jt=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,ar=x(jt,"u").replace(/punct/g,De).getRegex(),ir=x(jt,"u").replace(/punct/g,Mt).getRegex(),Dt="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",lr=x(Dt,"gu").replace(/notPunctSpace/g,Bt).replace(/punctSpace/g,ot).replace(/punct/g,De).getRegex(),or=x(Dt,"gu").replace(/notPunctSpace/g,tr).replace(/punctSpace/g,er).replace(/punct/g,Mt).getRegex(),cr=x("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Bt).replace(/punctSpace/g,ot).replace(/punct/g,De).getRegex(),hr=x(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,Nt).getRegex(),pr="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",ur=x(pr,"gu").replace(/notPunctSpace/g,rr).replace(/punctSpace/g,sr).replace(/punct/g,Nt).getRegex(),dr=x(/\\(punct)/,"gu").replace(/punct/g,De).getRegex(),gr=x(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),fr=x(it).replace("(?:-->|$)","-->").getRegex(),kr=x("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",fr).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Be=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,xr=x(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",Be).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Ot=x(/^!?\[(label)\]\[(ref)\]/).replace("label",Be).replace("ref",at).getRegex(),Zt=x(/^!?\[(ref)\](?:\[\])?/).replace("ref",at).getRegex(),mr=x("reflink|nolink(?!\\()","g").replace("reflink",Ot).replace("nolink",Zt).getRegex(),yt=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,ct={_backpedal:ue,anyPunctuation:dr,autolink:gr,blockSkip:nr,br:qt,code:Js,del:ue,delLDelim:ue,delRDelim:ue,emStrongLDelim:ar,emStrongRDelimAst:lr,emStrongRDelimUnd:cr,escape:Xs,link:xr,nolink:Zt,punctuation:Ys,reflink:Ot,reflinkSearch:mr,tag:kr,text:Ks,url:ue},br={...ct,link:x(/^!?\[(label)\]\((.*?)\)/).replace("label",Be).getRegex(),reflink:x(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Be).getRegex()},Je={...ct,emStrongRDelimAst:or,emStrongLDelim:ir,delLDelim:hr,delRDelim:ur,url:x(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",yt).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:x(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",yt).getRegex()},wr={...Je,br:x(qt).replace("{2,}","*").getRegex(),text:x(Je.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Ee={normal:lt,gfm:Us,pedantic:Vs},ze={normal:ct,gfm:Je,breaks:wr,pedantic:br},vr={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},$t=r=>vr[r];function U(r,e){if(e){if(M.escapeTest.test(r))return r.replace(M.escapeReplace,$t)}else if(M.escapeTestNoEncode.test(r))return r.replace(M.escapeReplaceNoEncode,$t);return r}function _t(r){try{r=encodeURI(r).replace(M.percentDecode,"%")}catch{return null}return r}function St(r,e){let s=r.replace(M.findPipe,(i,a,o)=>{let l=!1,h=a;for(;--h>=0&&o[h]==="\\";)l=!l;return l?"|":" |"}),n=s.split(M.splitPipe),t=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),e)if(n.length>e)n.splice(e);else for(;n.length<e;)n.push("");for(;t<n.length;t++)n[t]=n[t].trim().replace(M.slashPipe,"|");return n}function Ae(r,e,s){let n=r.length;if(n===0)return"";let t=0;for(;t<n&&r.charAt(n-t-1)===e;)t++;return r.slice(0,n-t)}function yr(r,e){if(r.indexOf(e[1])===-1)return-1;let s=0;for(let n=0;n<r.length;n++)if(r[n]==="\\")n++;else if(r[n]===e[0])s++;else if(r[n]===e[1]&&(s--,s<0))return n;return s>0?-2:-1}function $r(r,e=0){let s=e,n="";for(let t of r)if(t===" "){let i=4-s%4;n+=" ".repeat(i),s+=i}else n+=t,s++;return n}function Rt(r,e,s,n,t){let i=e.href,a=e.title||null,o=r[1].replace(t.other.outputLinkReplace,"$1");n.state.inLink=!0;let l={type:r[0].charAt(0)==="!"?"image":"link",raw:s,href:i,title:a,text:o,tokens:n.inlineTokens(o)};return n.state.inLink=!1,l}function _r(r,e,s){let n=r.match(s.other.indentCodeCompensation);if(n===null)return e;let t=n[1];return e.split(`
3
+ `).map(i=>{let a=i.match(s.other.beginningSpace);if(a===null)return i;let[o]=a;return o.length>=t.length?i.slice(t.length):i}).join(`
4
+ `)}var Me=class{options;rules;lexer;constructor(r){this.options=r||ge}space(r){let e=this.rules.block.newline.exec(r);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(r){let e=this.rules.block.code.exec(r);if(e){let s=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?s:Ae(s,`
5
+ `)}}}fences(r){let e=this.rules.block.fences.exec(r);if(e){let s=e[0],n=_r(s,e[3]||"",this.rules);return{type:"code",raw:s,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:n}}}heading(r){let e=this.rules.block.heading.exec(r);if(e){let s=e[2].trim();if(this.rules.other.endingHash.test(s)){let n=Ae(s,"#");(this.options.pedantic||!n||this.rules.other.endingSpaceChar.test(n))&&(s=n.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:s,tokens:this.lexer.inline(s)}}}hr(r){let e=this.rules.block.hr.exec(r);if(e)return{type:"hr",raw:Ae(e[0],`
6
+ `)}}blockquote(r){let e=this.rules.block.blockquote.exec(r);if(e){let s=Ae(e[0],`
7
+ `).split(`
8
+ `),n="",t="",i=[];for(;s.length>0;){let a=!1,o=[],l;for(l=0;l<s.length;l++)if(this.rules.other.blockquoteStart.test(s[l]))o.push(s[l]),a=!0;else if(!a)o.push(s[l]);else break;s=s.slice(l);let h=o.join(`
9
+ `),c=h.replace(this.rules.other.blockquoteSetextReplace,`
10
+ $1`).replace(this.rules.other.blockquoteSetextReplace2,"");n=n?`${n}
11
+ ${h}`:h,t=t?`${t}
12
+ ${c}`:c;let u=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(c,i,!0),this.lexer.state.top=u,s.length===0)break;let d=i.at(-1);if(d?.type==="code")break;if(d?.type==="blockquote"){let T=d,$=T.raw+`
13
+ `+s.join(`
14
+ `),I=this.blockquote($);i[i.length-1]=I,n=n.substring(0,n.length-T.raw.length)+I.raw,t=t.substring(0,t.length-T.text.length)+I.text;break}else if(d?.type==="list"){let T=d,$=T.raw+`
15
+ `+s.join(`
16
+ `),I=this.list($);i[i.length-1]=I,n=n.substring(0,n.length-d.raw.length)+I.raw,t=t.substring(0,t.length-T.raw.length)+I.raw,s=$.substring(i.at(-1).raw.length).split(`
17
+ `);continue}}return{type:"blockquote",raw:n,tokens:i,text:t}}}list(r){let e=this.rules.block.list.exec(r);if(e){let s=e[1].trim(),n=s.length>1,t={type:"list",raw:"",ordered:n,start:n?+s.slice(0,-1):"",loose:!1,items:[]};s=n?`\\d{1,9}\\${s.slice(-1)}`:`\\${s}`,this.options.pedantic&&(s=n?s:"[*+-]");let i=this.rules.other.listItemRegex(s),a=!1;for(;r;){let l=!1,h="",c="";if(!(e=i.exec(r))||this.rules.block.hr.test(r))break;h=e[0],r=r.substring(h.length);let u=$r(e[2].split(`
18
+ `,1)[0],e[1].length),d=r.split(`
19
+ `,1)[0],T=!u.trim(),$=0;if(this.options.pedantic?($=2,c=u.trimStart()):T?$=e[1].length+1:($=u.search(this.rules.other.nonSpaceChar),$=$>4?1:$,c=u.slice($),$+=e[1].length),T&&this.rules.other.blankLine.test(d)&&(h+=d+`
20
+ `,r=r.substring(d.length+1),l=!0),!l){let I=this.rules.other.nextBulletRegex($),se=this.rules.other.hrRegex($),m=this.rules.other.fencesBeginRegex($),b=this.rules.other.headingBeginRegex($),C=this.rules.other.htmlBeginRegex($),f=this.rules.other.blockquoteBeginRegex($);for(;r;){let z=r.split(`
21
+ `,1)[0],A;if(d=z,this.options.pedantic?(d=d.replace(this.rules.other.listReplaceNesting," "),A=d):A=d.replace(this.rules.other.tabCharGlobal," "),m.test(d)||b.test(d)||C.test(d)||f.test(d)||I.test(d)||se.test(d))break;if(A.search(this.rules.other.nonSpaceChar)>=$||!d.trim())c+=`
22
+ `+A.slice($);else{if(T||u.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||m.test(u)||b.test(u)||se.test(u))break;c+=`
23
+ `+d}T=!d.trim(),h+=z+`
24
+ `,r=r.substring(z.length+1),u=A.slice($)}}t.loose||(a?t.loose=!0:this.rules.other.doubleBlankLine.test(h)&&(a=!0)),t.items.push({type:"list_item",raw:h,task:!!this.options.gfm&&this.rules.other.listIsTask.test(c),loose:!1,text:c,tokens:[]}),t.raw+=h}let o=t.items.at(-1);if(o)o.raw=o.raw.trimEnd(),o.text=o.text.trimEnd();else return;t.raw=t.raw.trimEnd();for(let l of t.items){if(this.lexer.state.top=!1,l.tokens=this.lexer.blockTokens(l.text,[]),l.task){if(l.text=l.text.replace(this.rules.other.listReplaceTask,""),l.tokens[0]?.type==="text"||l.tokens[0]?.type==="paragraph"){l.tokens[0].raw=l.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),l.tokens[0].text=l.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let c=this.lexer.inlineQueue.length-1;c>=0;c--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[c].src)){this.lexer.inlineQueue[c].src=this.lexer.inlineQueue[c].src.replace(this.rules.other.listReplaceTask,"");break}}let h=this.rules.other.listTaskCheckbox.exec(l.raw);if(h){let c={type:"checkbox",raw:h[0]+" ",checked:h[0]!=="[ ]"};l.checked=c.checked,t.loose?l.tokens[0]&&["paragraph","text"].includes(l.tokens[0].type)&&"tokens"in l.tokens[0]&&l.tokens[0].tokens?(l.tokens[0].raw=c.raw+l.tokens[0].raw,l.tokens[0].text=c.raw+l.tokens[0].text,l.tokens[0].tokens.unshift(c)):l.tokens.unshift({type:"paragraph",raw:c.raw,text:c.raw,tokens:[c]}):l.tokens.unshift(c)}}if(!t.loose){let h=l.tokens.filter(u=>u.type==="space"),c=h.length>0&&h.some(u=>this.rules.other.anyLine.test(u.raw));t.loose=c}}if(t.loose)for(let l of t.items){l.loose=!0;for(let h of l.tokens)h.type==="text"&&(h.type="paragraph")}return t}}html(r){let e=this.rules.block.html.exec(r);if(e)return{type:"html",block:!0,raw:e[0],pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:e[0]}}def(r){let e=this.rules.block.def.exec(r);if(e){let s=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),n=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",t=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:s,raw:e[0],href:n,title:t}}}table(r){let e=this.rules.block.table.exec(r);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let s=St(e[1]),n=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),t=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
25
+ `):[],i={type:"table",raw:e[0],header:[],align:[],rows:[]};if(s.length===n.length){for(let a of n)this.rules.other.tableAlignRight.test(a)?i.align.push("right"):this.rules.other.tableAlignCenter.test(a)?i.align.push("center"):this.rules.other.tableAlignLeft.test(a)?i.align.push("left"):i.align.push(null);for(let a=0;a<s.length;a++)i.header.push({text:s[a],tokens:this.lexer.inline(s[a]),header:!0,align:i.align[a]});for(let a of t)i.rows.push(St(a,i.header.length).map((o,l)=>({text:o,tokens:this.lexer.inline(o),header:!1,align:i.align[l]})));return i}}lheading(r){let e=this.rules.block.lheading.exec(r);if(e)return{type:"heading",raw:e[0],depth:e[2].charAt(0)==="="?1:2,text:e[1],tokens:this.lexer.inline(e[1])}}paragraph(r){let e=this.rules.block.paragraph.exec(r);if(e){let s=e[1].charAt(e[1].length-1)===`
26
+ `?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:s,tokens:this.lexer.inline(s)}}}text(r){let e=this.rules.block.text.exec(r);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(r){let e=this.rules.inline.escape.exec(r);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(r){let e=this.rules.inline.tag.exec(r);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(r){let e=this.rules.inline.link.exec(r);if(e){let s=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(s)){if(!this.rules.other.endAngleBracket.test(s))return;let i=Ae(s.slice(0,-1),"\\");if((s.length-i.length)%2===0)return}else{let i=yr(e[2],"()");if(i===-2)return;if(i>-1){let a=(e[0].indexOf("!")===0?5:4)+e[1].length+i;e[2]=e[2].substring(0,i),e[0]=e[0].substring(0,a).trim(),e[3]=""}}let n=e[2],t="";if(this.options.pedantic){let i=this.rules.other.pedanticHrefTitle.exec(n);i&&(n=i[1],t=i[3])}else t=e[3]?e[3].slice(1,-1):"";return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(s)?n=n.slice(1):n=n.slice(1,-1)),Rt(e,{href:n&&n.replace(this.rules.inline.anyPunctuation,"$1"),title:t&&t.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(r,e){let s;if((s=this.rules.inline.reflink.exec(r))||(s=this.rules.inline.nolink.exec(r))){let n=(s[2]||s[1]).replace(this.rules.other.multipleSpaceGlobal," "),t=e[n.toLowerCase()];if(!t){let i=s[0].charAt(0);return{type:"text",raw:i,text:i}}return Rt(s,t,s[0],this.lexer,this.rules)}}emStrong(r,e,s=""){let n=this.rules.inline.emStrongLDelim.exec(r);if(!(!n||n[3]&&s.match(this.rules.other.unicodeAlphaNumeric))&&(!(n[1]||n[2])||!s||this.rules.inline.punctuation.exec(s))){let t=[...n[0]].length-1,i,a,o=t,l=0,h=n[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(h.lastIndex=0,e=e.slice(-1*r.length+t);(n=h.exec(e))!=null;){if(i=n[1]||n[2]||n[3]||n[4]||n[5]||n[6],!i)continue;if(a=[...i].length,n[3]||n[4]){o+=a;continue}else if((n[5]||n[6])&&t%3&&!((t+a)%3)){l+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o+l);let c=[...n[0]][0].length,u=r.slice(0,t+n.index+c+a);if(Math.min(t,a)%2){let T=u.slice(1,-1);return{type:"em",raw:u,text:T,tokens:this.lexer.inlineTokens(T)}}let d=u.slice(2,-2);return{type:"strong",raw:u,text:d,tokens:this.lexer.inlineTokens(d)}}}}codespan(r){let e=this.rules.inline.code.exec(r);if(e){let s=e[2].replace(this.rules.other.newLineCharGlobal," "),n=this.rules.other.nonSpaceChar.test(s),t=this.rules.other.startingSpaceChar.test(s)&&this.rules.other.endingSpaceChar.test(s);return n&&t&&(s=s.substring(1,s.length-1)),{type:"codespan",raw:e[0],text:s}}}br(r){let e=this.rules.inline.br.exec(r);if(e)return{type:"br",raw:e[0]}}del(r,e,s=""){let n=this.rules.inline.delLDelim.exec(r);if(n&&(!n[1]||!s||this.rules.inline.punctuation.exec(s))){let t=[...n[0]].length-1,i,a,o=t,l=this.rules.inline.delRDelim;for(l.lastIndex=0,e=e.slice(-1*r.length+t);(n=l.exec(e))!=null;){if(i=n[1]||n[2]||n[3]||n[4]||n[5]||n[6],!i||(a=[...i].length,a!==t))continue;if(n[3]||n[4]){o+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o);let h=[...n[0]][0].length,c=r.slice(0,t+n.index+h+a),u=c.slice(t,-t);return{type:"del",raw:c,text:u,tokens:this.lexer.inlineTokens(u)}}}}autolink(r){let e=this.rules.inline.autolink.exec(r);if(e){let s,n;return e[2]==="@"?(s=e[1],n="mailto:"+s):(s=e[1],n=s),{type:"link",raw:e[0],text:s,href:n,tokens:[{type:"text",raw:s,text:s}]}}}url(r){let e;if(e=this.rules.inline.url.exec(r)){let s,n;if(e[2]==="@")s=e[0],n="mailto:"+s;else{let t;do t=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??"";while(t!==e[0]);s=e[0],e[1]==="www."?n="http://"+e[0]:n=e[0]}return{type:"link",raw:e[0],text:s,href:n,tokens:[{type:"text",raw:s,text:s}]}}}inlineText(r){let e=this.rules.inline.text.exec(r);if(e){let s=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:s}}}},Q=class Ke{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||ge,this.options.tokenizer=this.options.tokenizer||new Me,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let s={other:M,block:Ee.normal,inline:ze.normal};this.options.pedantic?(s.block=Ee.pedantic,s.inline=ze.pedantic):this.options.gfm&&(s.block=Ee.gfm,this.options.breaks?s.inline=ze.breaks:s.inline=ze.gfm),this.tokenizer.rules=s}static get rules(){return{block:Ee,inline:ze}}static lex(e,s){return new Ke(s).lex(e)}static lexInline(e,s){return new Ke(s).inlineTokens(e)}lex(e){e=e.replace(M.carriageReturn,`
27
+ `),this.blockTokens(e,this.tokens);for(let s=0;s<this.inlineQueue.length;s++){let n=this.inlineQueue[s];this.inlineTokens(n.src,n.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,s=[],n=!1){for(this.options.pedantic&&(e=e.replace(M.tabCharGlobal," ").replace(M.spaceLine,""));e;){let t;if(this.options.extensions?.block?.some(a=>(t=a.call({lexer:this},e,s))?(e=e.substring(t.raw.length),s.push(t),!0):!1))continue;if(t=this.tokenizer.space(e)){e=e.substring(t.raw.length);let a=s.at(-1);t.raw.length===1&&a!==void 0?a.raw+=`
28
+ `:s.push(t);continue}if(t=this.tokenizer.code(e)){e=e.substring(t.raw.length);let a=s.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=(a.raw.endsWith(`
29
+ `)?"":`
30
+ `)+t.raw,a.text+=`
31
+ `+t.text,this.inlineQueue.at(-1).src=a.text):s.push(t);continue}if(t=this.tokenizer.fences(e)){e=e.substring(t.raw.length),s.push(t);continue}if(t=this.tokenizer.heading(e)){e=e.substring(t.raw.length),s.push(t);continue}if(t=this.tokenizer.hr(e)){e=e.substring(t.raw.length),s.push(t);continue}if(t=this.tokenizer.blockquote(e)){e=e.substring(t.raw.length),s.push(t);continue}if(t=this.tokenizer.list(e)){e=e.substring(t.raw.length),s.push(t);continue}if(t=this.tokenizer.html(e)){e=e.substring(t.raw.length),s.push(t);continue}if(t=this.tokenizer.def(e)){e=e.substring(t.raw.length);let a=s.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=(a.raw.endsWith(`
32
+ `)?"":`
33
+ `)+t.raw,a.text+=`
34
+ `+t.raw,this.inlineQueue.at(-1).src=a.text):this.tokens.links[t.tag]||(this.tokens.links[t.tag]={href:t.href,title:t.title},s.push(t));continue}if(t=this.tokenizer.table(e)){e=e.substring(t.raw.length),s.push(t);continue}if(t=this.tokenizer.lheading(e)){e=e.substring(t.raw.length),s.push(t);continue}let i=e;if(this.options.extensions?.startBlock){let a=1/0,o=e.slice(1),l;this.options.extensions.startBlock.forEach(h=>{l=h.call({lexer:this},o),typeof l=="number"&&l>=0&&(a=Math.min(a,l))}),a<1/0&&a>=0&&(i=e.substring(0,a+1))}if(this.state.top&&(t=this.tokenizer.paragraph(i))){let a=s.at(-1);n&&a?.type==="paragraph"?(a.raw+=(a.raw.endsWith(`
35
+ `)?"":`
36
+ `)+t.raw,a.text+=`
37
+ `+t.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):s.push(t),n=i.length!==e.length,e=e.substring(t.raw.length);continue}if(t=this.tokenizer.text(e)){e=e.substring(t.raw.length);let a=s.at(-1);a?.type==="text"?(a.raw+=(a.raw.endsWith(`
38
+ `)?"":`
39
+ `)+t.raw,a.text+=`
40
+ `+t.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):s.push(t);continue}if(e){let a="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(a);break}else throw new Error(a)}}return this.state.top=!0,s}inline(e,s=[]){return this.inlineQueue.push({src:e,tokens:s}),s}inlineTokens(e,s=[]){let n=e,t=null;if(this.tokens.links){let l=Object.keys(this.tokens.links);if(l.length>0)for(;(t=this.tokenizer.rules.inline.reflinkSearch.exec(n))!=null;)l.includes(t[0].slice(t[0].lastIndexOf("[")+1,-1))&&(n=n.slice(0,t.index)+"["+"a".repeat(t[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(t=this.tokenizer.rules.inline.anyPunctuation.exec(n))!=null;)n=n.slice(0,t.index)+"++"+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let i;for(;(t=this.tokenizer.rules.inline.blockSkip.exec(n))!=null;)i=t[2]?t[2].length:0,n=n.slice(0,t.index+i)+"["+"a".repeat(t[0].length-i-2)+"]"+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let a=!1,o="";for(;e;){a||(o=""),a=!1;let l;if(this.options.extensions?.inline?.some(c=>(l=c.call({lexer:this},e,s))?(e=e.substring(l.raw.length),s.push(l),!0):!1))continue;if(l=this.tokenizer.escape(e)){e=e.substring(l.raw.length),s.push(l);continue}if(l=this.tokenizer.tag(e)){e=e.substring(l.raw.length),s.push(l);continue}if(l=this.tokenizer.link(e)){e=e.substring(l.raw.length),s.push(l);continue}if(l=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(l.raw.length);let c=s.at(-1);l.type==="text"&&c?.type==="text"?(c.raw+=l.raw,c.text+=l.text):s.push(l);continue}if(l=this.tokenizer.emStrong(e,n,o)){e=e.substring(l.raw.length),s.push(l);continue}if(l=this.tokenizer.codespan(e)){e=e.substring(l.raw.length),s.push(l);continue}if(l=this.tokenizer.br(e)){e=e.substring(l.raw.length),s.push(l);continue}if(l=this.tokenizer.del(e,n,o)){e=e.substring(l.raw.length),s.push(l);continue}if(l=this.tokenizer.autolink(e)){e=e.substring(l.raw.length),s.push(l);continue}if(!this.state.inLink&&(l=this.tokenizer.url(e))){e=e.substring(l.raw.length),s.push(l);continue}let h=e;if(this.options.extensions?.startInline){let c=1/0,u=e.slice(1),d;this.options.extensions.startInline.forEach(T=>{d=T.call({lexer:this},u),typeof d=="number"&&d>=0&&(c=Math.min(c,d))}),c<1/0&&c>=0&&(h=e.substring(0,c+1))}if(l=this.tokenizer.inlineText(h)){e=e.substring(l.raw.length),l.raw.slice(-1)!=="_"&&(o=l.raw.slice(-1)),a=!0;let c=s.at(-1);c?.type==="text"?(c.raw+=l.raw,c.text+=l.text):s.push(l);continue}if(e){let c="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(c);break}else throw new Error(c)}}return s}},Ne=class{options;parser;constructor(r){this.options=r||ge}space(r){return""}code({text:r,lang:e,escaped:s}){let n=(e||"").match(M.notSpaceStart)?.[0],t=r.replace(M.endingNewline,"")+`
41
+ `;return n?'<pre><code class="language-'+U(n)+'">'+(s?t:U(t,!0))+`</code></pre>
42
+ `:"<pre><code>"+(s?t:U(t,!0))+`</code></pre>
43
+ `}blockquote({tokens:r}){return`<blockquote>
44
+ ${this.parser.parse(r)}</blockquote>
45
+ `}html({text:r}){return r}def(r){return""}heading({tokens:r,depth:e}){return`<h${e}>${this.parser.parseInline(r)}</h${e}>
46
+ `}hr(r){return`<hr>
47
+ `}list(r){let e=r.ordered,s=r.start,n="";for(let a=0;a<r.items.length;a++){let o=r.items[a];n+=this.listitem(o)}let t=e?"ol":"ul",i=e&&s!==1?' start="'+s+'"':"";return"<"+t+i+`>
48
+ `+n+"</"+t+`>
49
+ `}listitem(r){return`<li>${this.parser.parse(r.tokens)}</li>
50
+ `}checkbox({checked:r}){return"<input "+(r?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:r}){return`<p>${this.parser.parseInline(r)}</p>
51
+ `}table(r){let e="",s="";for(let t=0;t<r.header.length;t++)s+=this.tablecell(r.header[t]);e+=this.tablerow({text:s});let n="";for(let t=0;t<r.rows.length;t++){let i=r.rows[t];s="";for(let a=0;a<i.length;a++)s+=this.tablecell(i[a]);n+=this.tablerow({text:s})}return n&&(n=`<tbody>${n}</tbody>`),`<table>
52
+ <thead>
53
+ `+e+`</thead>
54
+ `+n+`</table>
55
+ `}tablerow({text:r}){return`<tr>
56
+ ${r}</tr>
57
+ `}tablecell(r){let e=this.parser.parseInline(r.tokens),s=r.header?"th":"td";return(r.align?`<${s} align="${r.align}">`:`<${s}>`)+e+`</${s}>
58
+ `}strong({tokens:r}){return`<strong>${this.parser.parseInline(r)}</strong>`}em({tokens:r}){return`<em>${this.parser.parseInline(r)}</em>`}codespan({text:r}){return`<code>${U(r,!0)}</code>`}br(r){return"<br>"}del({tokens:r}){return`<del>${this.parser.parseInline(r)}</del>`}link({href:r,title:e,tokens:s}){let n=this.parser.parseInline(s),t=_t(r);if(t===null)return n;r=t;let i='<a href="'+r+'"';return e&&(i+=' title="'+U(e)+'"'),i+=">"+n+"</a>",i}image({href:r,title:e,text:s,tokens:n}){n&&(s=this.parser.parseInline(n,this.parser.textRenderer));let t=_t(r);if(t===null)return U(s);r=t;let i=`<img src="${r}" alt="${U(s)}"`;return e&&(i+=` title="${U(e)}"`),i+=">",i}text(r){return"tokens"in r&&r.tokens?this.parser.parseInline(r.tokens):"escaped"in r&&r.escaped?r.text:U(r.text)}},ht=class{strong({text:r}){return r}em({text:r}){return r}codespan({text:r}){return r}del({text:r}){return r}html({text:r}){return r}text({text:r}){return r}link({text:r}){return""+r}image({text:r}){return""+r}br(){return""}checkbox({raw:r}){return r}},W=class Ye{options;renderer;textRenderer;constructor(e){this.options=e||ge,this.options.renderer=this.options.renderer||new Ne,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new ht}static parse(e,s){return new Ye(s).parse(e)}static parseInline(e,s){return new Ye(s).parseInline(e)}parse(e){let s="";for(let n=0;n<e.length;n++){let t=e[n];if(this.options.extensions?.renderers?.[t.type]){let a=t,o=this.options.extensions.renderers[a.type].call({parser:this},a);if(o!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(a.type)){s+=o||"";continue}}let i=t;switch(i.type){case"space":{s+=this.renderer.space(i);break}case"hr":{s+=this.renderer.hr(i);break}case"heading":{s+=this.renderer.heading(i);break}case"code":{s+=this.renderer.code(i);break}case"table":{s+=this.renderer.table(i);break}case"blockquote":{s+=this.renderer.blockquote(i);break}case"list":{s+=this.renderer.list(i);break}case"checkbox":{s+=this.renderer.checkbox(i);break}case"html":{s+=this.renderer.html(i);break}case"def":{s+=this.renderer.def(i);break}case"paragraph":{s+=this.renderer.paragraph(i);break}case"text":{s+=this.renderer.text(i);break}default:{let a='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return s}parseInline(e,s=this.renderer){let n="";for(let t=0;t<e.length;t++){let i=e[t];if(this.options.extensions?.renderers?.[i.type]){let o=this.options.extensions.renderers[i.type].call({parser:this},i);if(o!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(i.type)){n+=o||"";continue}}let a=i;switch(a.type){case"escape":{n+=s.text(a);break}case"html":{n+=s.html(a);break}case"link":{n+=s.link(a);break}case"image":{n+=s.image(a);break}case"checkbox":{n+=s.checkbox(a);break}case"strong":{n+=s.strong(a);break}case"em":{n+=s.em(a);break}case"codespan":{n+=s.codespan(a);break}case"br":{n+=s.br(a);break}case"del":{n+=s.del(a);break}case"text":{n+=s.text(a);break}default:{let o='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(o),"";throw new Error(o)}}}return n}},Pe=class{options;block;constructor(r){this.options=r||ge}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(r){return r}postprocess(r){return r}processAllTokens(r){return r}emStrongMask(r){return r}provideLexer(){return this.block?Q.lex:Q.lexInline}provideParser(){return this.block?W.parse:W.parseInline}},Sr=class{defaults=st();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=W;Renderer=Ne;TextRenderer=ht;Lexer=Q;Tokenizer=Me;Hooks=Pe;constructor(...r){this.use(...r)}walkTokens(r,e){let s=[];for(let n of r)switch(s=s.concat(e.call(this,n)),n.type){case"table":{let t=n;for(let i of t.header)s=s.concat(this.walkTokens(i.tokens,e));for(let i of t.rows)for(let a of i)s=s.concat(this.walkTokens(a.tokens,e));break}case"list":{let t=n;s=s.concat(this.walkTokens(t.items,e));break}default:{let t=n;this.defaults.extensions?.childTokens?.[t.type]?this.defaults.extensions.childTokens[t.type].forEach(i=>{let a=t[i].flat(1/0);s=s.concat(this.walkTokens(a,e))}):t.tokens&&(s=s.concat(this.walkTokens(t.tokens,e)))}}return s}use(...r){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return r.forEach(s=>{let n={...s};if(n.async=this.defaults.async||n.async||!1,s.extensions&&(s.extensions.forEach(t=>{if(!t.name)throw new Error("extension name required");if("renderer"in t){let i=e.renderers[t.name];i?e.renderers[t.name]=function(...a){let o=t.renderer.apply(this,a);return o===!1&&(o=i.apply(this,a)),o}:e.renderers[t.name]=t.renderer}if("tokenizer"in t){if(!t.level||t.level!=="block"&&t.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let i=e[t.level];i?i.unshift(t.tokenizer):e[t.level]=[t.tokenizer],t.start&&(t.level==="block"?e.startBlock?e.startBlock.push(t.start):e.startBlock=[t.start]:t.level==="inline"&&(e.startInline?e.startInline.push(t.start):e.startInline=[t.start]))}"childTokens"in t&&t.childTokens&&(e.childTokens[t.name]=t.childTokens)}),n.extensions=e),s.renderer){let t=this.defaults.renderer||new Ne(this.defaults);for(let i in s.renderer){if(!(i in t))throw new Error(`renderer '${i}' does not exist`);if(["options","parser"].includes(i))continue;let a=i,o=s.renderer[a],l=t[a];t[a]=(...h)=>{let c=o.apply(t,h);return c===!1&&(c=l.apply(t,h)),c||""}}n.renderer=t}if(s.tokenizer){let t=this.defaults.tokenizer||new Me(this.defaults);for(let i in s.tokenizer){if(!(i in t))throw new Error(`tokenizer '${i}' does not exist`);if(["options","rules","lexer"].includes(i))continue;let a=i,o=s.tokenizer[a],l=t[a];t[a]=(...h)=>{let c=o.apply(t,h);return c===!1&&(c=l.apply(t,h)),c}}n.tokenizer=t}if(s.hooks){let t=this.defaults.hooks||new Pe;for(let i in s.hooks){if(!(i in t))throw new Error(`hook '${i}' does not exist`);if(["options","block"].includes(i))continue;let a=i,o=s.hooks[a],l=t[a];Pe.passThroughHooks.has(i)?t[a]=h=>{if(this.defaults.async&&Pe.passThroughHooksRespectAsync.has(i))return(async()=>{let u=await o.call(t,h);return l.call(t,u)})();let c=o.call(t,h);return l.call(t,c)}:t[a]=(...h)=>{if(this.defaults.async)return(async()=>{let u=await o.apply(t,h);return u===!1&&(u=await l.apply(t,h)),u})();let c=o.apply(t,h);return c===!1&&(c=l.apply(t,h)),c}}n.hooks=t}if(s.walkTokens){let t=this.defaults.walkTokens,i=s.walkTokens;n.walkTokens=function(a){let o=[];return o.push(i.call(this,a)),t&&(o=o.concat(t.call(this,a))),o}}this.defaults={...this.defaults,...n}}),this}setOptions(r){return this.defaults={...this.defaults,...r},this}lexer(r,e){return Q.lex(r,e??this.defaults)}parser(r,e){return W.parse(r,e??this.defaults)}parseMarkdown(r){return(e,s)=>{let n={...s},t={...this.defaults,...n},i=this.onError(!!t.silent,!!t.async);if(this.defaults.async===!0&&n.async===!1)return i(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof e>"u"||e===null)return i(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return i(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));if(t.hooks&&(t.hooks.options=t,t.hooks.block=r),t.async)return(async()=>{let a=t.hooks?await t.hooks.preprocess(e):e,o=await(t.hooks?await t.hooks.provideLexer():r?Q.lex:Q.lexInline)(a,t),l=t.hooks?await t.hooks.processAllTokens(o):o;t.walkTokens&&await Promise.all(this.walkTokens(l,t.walkTokens));let h=await(t.hooks?await t.hooks.provideParser():r?W.parse:W.parseInline)(l,t);return t.hooks?await t.hooks.postprocess(h):h})().catch(i);try{t.hooks&&(e=t.hooks.preprocess(e));let a=(t.hooks?t.hooks.provideLexer():r?Q.lex:Q.lexInline)(e,t);t.hooks&&(a=t.hooks.processAllTokens(a)),t.walkTokens&&this.walkTokens(a,t.walkTokens);let o=(t.hooks?t.hooks.provideParser():r?W.parse:W.parseInline)(a,t);return t.hooks&&(o=t.hooks.postprocess(o)),o}catch(a){return i(a)}}}onError(r,e){return s=>{if(s.message+=`
59
+ Please report this to https://github.com/markedjs/marked.`,r){let n="<p>An error occurred:</p><pre>"+U(s.message+"",!0)+"</pre>";return e?Promise.resolve(n):n}if(e)return Promise.reject(s);throw s}}},de=new Sr;function v(r,e){return de.parse(r,e)}v.options=v.setOptions=function(r){return de.setOptions(r),v.defaults=de.defaults,Pt(v.defaults),v};v.getDefaults=st;v.defaults=ge;v.use=function(...r){return de.use(...r),v.defaults=de.defaults,Pt(v.defaults),v};v.walkTokens=function(r,e){return de.walkTokens(r,e)};v.parseInline=de.parseInline;v.Parser=W;v.parser=W.parse;v.Renderer=Ne;v.TextRenderer=ht;v.Lexer=Q;v.lexer=Q.lex;v.Tokenizer=Me;v.Hooks=Pe;v.parse=v;v.options;v.setOptions;v.use;v.walkTokens;v.parseInline;W.parse;Q.lex;function Rr(r,e,s){fetch("/api/chat/stream",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r),signal:s}).then(async n=>{if(!n.ok){e({type:"error",message:`HTTP ${n.status}`});return}const t=n.body?.getReader();if(!t){e({type:"error",message:"No response body"});return}const i=new TextDecoder;let a="";for(;;){const{done:o,value:l}=await t.read();if(o)break;a+=i.decode(l,{stream:!0});const h=a.split(`
60
+ `);a=h.pop()??"";for(const c of h)if(c.startsWith("data: "))try{const u=JSON.parse(c.slice(6));e(u)}catch{}}}).catch(n=>{n.name!=="AbortError"&&e({type:"error",message:n.message})})}const et="sg-chat-sessions",tt="sg-chat-version",Tr=14;function pe(){try{const r=localStorage.getItem(et);if(!r)return[];if(localStorage.getItem(tt)==="2")return JSON.parse(r);const n=JSON.parse(r).map(t=>({id:crypto.randomUUID(),createdAt:t.date+"T00:00:00.000Z",updatedAt:t.date+"T00:00:00.000Z",title:t.messages.find(i=>i.role==="user")?.content.slice(0,50)||"New chat",messages:t.messages}));return localStorage.setItem(et,JSON.stringify(n)),localStorage.setItem(tt,"2"),n}catch{return[]}}function qe(r){const s=[...r].sort((n,t)=>t.updatedAt.localeCompare(n.updatedAt)).slice(0,Tr);try{localStorage.setItem(et,JSON.stringify(s)),localStorage.setItem(tt,"2")}catch{}}function Le(r,e){const s=pe(),n=e.map(({streaming:i,...a})=>a),t=s.findIndex(i=>i.id===r);t>=0&&(s[t].messages=n,s[t].updatedAt=new Date().toISOString()),qe(s)}function zr(){const e=pe().sort((f,z)=>z.updatedAt.localeCompare(f.updatedAt))[0];let s=ee(Ue(e?e.messages.map(f=>({...f,streaming:!1})):[])),n=ee(Ue(e?.id??null)),t=ee(!1),i=ee(0),a=ee(0),o=ee(null),l=null,h=ee(""),c=ee(Ue(!!e));const u=new Set(["create_entity","update_entity","delete_entity","move_entity"]);function d(){I();const f=crypto.randomUUID();S(n,f,!0),S(s,[],!0),S(c,!1)}function T(){if(p(n)&&p(c))return p(n);const f=p(n)||crypto.randomUUID();S(n,f,!0);const z=new Date().toISOString(),A=pe();return A.push({id:f,createdAt:z,updatedAt:z,title:"New chat",messages:[]}),qe(A),S(c,!0),f}function $(f){if(!f.trim()||p(t))return;S(o,null);const z=T();p(s).push({role:"user",content:f}),p(s).push({role:"agent",content:"",segments:[],streaming:!0}),S(t,!0);const A=pe(),B=A.find(k=>k.id===z);B&&B.title==="New chat"&&(B.title=f.slice(0,50),qe(A)),Le(z,p(s));let G=!1,J=null;l=new AbortController;const Oe=E.selectedSubPath?`${E.selectedRepo}/${E.selectedType}/${E.selectedId}/${E.selectedSubPath}`:E.selectedId?`${E.selectedRepo}/${E.selectedType}/${E.selectedId}`:null,re=p(s).slice(0,-2).map(k=>({role:k.role==="agent"?"assistant":k.role,content:k.content})),Ze={message:f,context:Oe??void 0,sessionId:z,history:re.length>0?re:void 0};Rr(Ze,k=>{const N=p(s)[p(s).length-1];if(!N||N.role!=="agent")return;const Z=N.segments;switch(k.type){case"token":{N.content+=k.text??"";const H=Z[Z.length-1];H&&H.type==="text"?H.content+=k.text??"":Z.push({type:"text",content:k.text??""}),N.segments=Z,Ve(a);break}case"tool_start":if(k.name){u.has(k.name)&&(G=!0);const H=Z[Z.length-1];H&&H.type==="tools"?H.names=[...H.names,k.name]:Z.push({type:"tools",names:[k.name]}),N.segments=Z,Ve(a)}break;case"mutation":G=!0,k.action==="created"&&k.repo&&k.entityType&&k.entityId&&(J={repo:k.repo,entityType:k.entityType,entityId:k.entityId}),window.StudioChrome?.emitMutation?.({action:k.action,repo:k.repo,entityType:k.entityType,entityId:k.entityId});break;case"highlight":S(o,k.entityIds&&k.entityIds.length>0?new Set(k.entityIds):null,!0);break;case"done":k.message&&!N.content&&(N.content=k.message,N.segments=[{type:"text",content:k.message}]),N.streaming=!1,S(t,!1),Le(z,p(s)),G&&(Rs().then(()=>{Ve(i)}),bs.refreshAll().then(()=>{J&&Ts(`/${J.repo}/${J.entityType}/${J.entityId}`)}));break;case"error":N.content+=`
61
+
62
+ Error: ${k.message}`,N.streaming=!1,S(t,!1),Le(z,p(s));break}},l.signal)}function I(){l?.abort(),S(t,!1);const f=p(s)[p(s).length-1];f?.streaming&&(f.streaming=!1),fetch("/api/chat/abort",{method:"POST",credentials:"include"}).catch(()=>{})}function se(){I(),S(s,[],!0),p(n)&&p(c)&&Le(p(n),p(s))}function m(f){const A=pe().filter(B=>B.id!==f);if(qe(A),p(n)===f){const B=A.sort((G,J)=>J.updatedAt.localeCompare(G.updatedAt));B.length>0?(S(n,B[0].id,!0),S(s,B[0].messages.map(G=>({...G,streaming:!1})),!0),S(c,!0)):(S(n,null),S(s,[],!0),S(c,!1))}}function b(f){const A=pe().find(B=>B.id===f);A&&(I(),S(n,A.id,!0),S(s,A.messages.map(B=>({...B,streaming:!1})),!0),S(c,!0))}function C(){return pe().sort((f,z)=>z.updatedAt.localeCompare(f.updatedAt)).map(f=>({id:f.id,title:f.title,createdAt:f.createdAt,updatedAt:f.updatedAt,preview:f.messages.find(z=>z.role==="user")?.content.slice(0,80)||"",count:f.messages.length,active:f.id===p(n)}))}return{get messages(){return p(s)},get streaming(){return p(t)},get mutationCount(){return p(i)},get scrollTick(){return p(a)},get highlightedIds(){return p(o)},get activeSessionId(){return p(n)},get draftInput(){return p(h)},set draftInput(f){S(h,f,!0)},send:$,stop:I,clear:se,newSession:d,deleteSession:m,getSessions:C,loadSession:b}}const q=zr();var Ar=P('<span class="session-title svelte-1xwj6s7"> </span>'),Ir=P('<div class="session-row svelte-1xwj6s7"><!> <!></div>'),Pr=P('<div class="session-dropdown svelte-1xwj6s7"><div class="session-list svelte-1xwj6s7"></div></div>'),Cr=P('<div class="empty-state svelte-1xwj6s7"><div class="seed-prompts svelte-1xwj6s7"></div></div>'),Er=P('<div class="user-bubble svelte-1xwj6s7"> </div>'),Lr=P('<span class="tool-call svelte-1xwj6s7"> </span>'),qr=P('<div class="tool-calls svelte-1xwj6s7"></div>'),Br=P('<div class="agent-text prose svelte-1xwj6s7"><!></div>'),Mr=P('<div class="agent-text prose svelte-1xwj6s7"><!></div>'),Nr=P('<span class="streaming-dot svelte-1xwj6s7"></span>'),jr=P('<div class="agent-content svelte-1xwj6s7"><!> <!></div>'),Dr=P('<div class="message-group svelte-1xwj6s7"><!></div>'),Or=P('<div class="context-chip svelte-1xwj6s7"> </div>'),Zr=P('<aside class="chat-panel svelte-1xwj6s7"><div class="chat-header svelte-1xwj6s7"><div class="chat-header-left svelte-1xwj6s7"><!> <!></div> <!> <!></div> <div class="chat-messages svelte-1xwj6s7"><!></div> <div class="chat-input-area svelte-1xwj6s7"><!> <div class="text-input svelte-1xwj6s7"><textarea class="input-field svelte-1xwj6s7" rows="1"></textarea> <!></div></div></aside>');function Yr(r,e){Tt(e,!0);const s=/[\p{Emoji_Presentation}\p{Extended_Pictographic}]\uFE0F?/gu,n=/^\|[\s:|-]+\|$/,t=/^[ ]{0,3}([-*_])\s*(\1\s*){2,}$/;function i(g){return g.replace(s,"").replace(/^ +/gm,y=>y.replace(/ +/," ")).split(`
63
+ `).map(y=>n.test(y)||t.test(y)?y:y.replace(/--/g,"—")).join(`
64
+ `)}const a=zt("chat");let o=Se(()=>q.draftInput);function l(g){q.draftInput=g}let h=ee(!1);const c=Se(()=>(q.activeSessionId,q.getSessions().length>0));let u,d=!0;function T(){u&&(d=u.scrollHeight-u.scrollTop-u.clientHeight<40)}const $=Se(()=>{if(E.selectedSubPath)return["Summarize this document","Extract key points","What actions are here?","What decisions were made?"];if(E.selectedId){const g=E.selectedType??"entity";return[`Summarize this ${g}`,`What's related to this ${g}?`,"What actions should I take?","What decisions were made?"]}return E.activeView==="graph"?["What are the key relationships?","Which entities are most connected?","Find gaps in my graph","What decisions have been made recently?"]:["What's in my graph?","Summarize recent meetings","Who's working on what?","What decisions have been made recently?"]});async function I(){const g=p(o).trim();g&&(l(""),d=!0,q.send(g),await Xe(),m())}function se(g){g.key==="Enter"&&!g.shiftKey&&(g.preventDefault(),I())}function m(){u&&(u.scrollTop=u.scrollHeight)}fs(()=>{Xe().then(()=>{requestAnimationFrame(()=>{requestAnimationFrame(()=>m())})})}),ks(()=>{q.scrollTick,d&&m()});var b=Zr(),C=R(b),f=R(C),z=R(f);te(z,{variant:"ghost",size:"icon",class:"size-6",onclick:()=>q.newSession(),children:(g,y)=>{qs(g,{size:14})},$$slots:{default:!0}});var A=D(z,2);{var B=g=>{{let y=Se(()=>p(h)?"history-active":"");te(g,{variant:"ghost",size:"icon",get class(){return`size-6 ${p(y)??""}`},onclick:()=>S(h,!p(h)),children:(j,fe)=>{Bs(j,{size:14})},$$slots:{default:!0}})}};O(A,g=>{p(c)&&g(B)})}_(f);var G=D(f,2);te(G,{variant:"ghost",size:"icon",class:"size-6",get onclick(){return a.close},children:(g,y)=>{$s(g,{size:14})},$$slots:{default:!0}});var J=D(G,2);{var Oe=g=>{var y=Pr(),j=R(y);Re(j,21,()=>q.getSessions(),Te,(fe,L)=>{var K=Ir(),ye=R(K);{let ce=Se(()=>p(L).active?"active":"");te(ye,{variant:"ghost",get class(){return`session-item ${p(ce)??""}`},onclick:()=>{q.loadSession(p(L).id),S(h,!1)},children:(Y,ne)=>{var ae=Ar(),He=R(ae,!0);_(ae),le(()=>_e(He,p(L).title)),w(Y,ae)},$$slots:{default:!0}})}var ke=D(ye,2);te(ke,{variant:"ghost",size:"icon",class:"session-delete-btn",title:"Delete session",onclick:ce=>{ce.stopPropagation(),q.deleteSession(p(L).id)},children:(ce,Y)=>{_s(ce,{size:12})},$$slots:{default:!0}}),_(K),w(fe,K)}),_(j),_(y),w(g,y)};O(J,g=>{p(h)&&g(Oe)})}_(C);var re=D(C,2),Ze=R(re);{var k=g=>{var y=Cr(),j=R(y);Re(j,21,()=>p($),Te,(fe,L)=>{te(fe,{variant:"outline",class:"seed-prompt",onclick:()=>{d=!0,q.send(p(L)),Xe().then(()=>m())},children:(K,ye)=>{Ie();var ke=ns();le(()=>_e(ke,p(L))),w(K,ke)},$$slots:{default:!0}})}),_(j),_(y),w(g,y)},N=g=>{var y=V(),j=X(y);Re(j,17,()=>q.messages,Te,(fe,L)=>{var K=Dr(),ye=R(K);{var ke=Y=>{var ne=Er(),ae=R(ne,!0);_(ne),le(()=>_e(ae,p(L).content)),w(Y,ne)},ce=Y=>{var ne=jr(),ae=R(ne);{var He=F=>{var ie=V(),Qe=X(ie);Re(Qe,17,()=>p(L).segments,Te,(Xt,$e)=>{var ut=V(),Jt=X(ut);{var Kt=xe=>{var he=qr();Re(he,21,()=>p($e).names,Te,(We,es)=>{var Ge=Lr(),ts=R(Ge,!0);_(Ge),le(()=>_e(ts,p(es))),w(We,Ge)}),_(he),w(xe,he)},Yt=xe=>{var he=Br(),We=R(he);mt(We,()=>v.parse(i(p($e).content))),_(he),w(xe,he)};O(Jt,xe=>{p($e).type==="tools"?xe(Kt):p($e).type==="text"&&p($e).content&&xe(Yt,1)})}w(Xt,ut)}),w(F,ie)},Ft=F=>{var ie=Mr(),Qe=R(ie);mt(Qe,()=>v.parse(i(p(L).content))),_(ie),w(F,ie)};O(ae,F=>{p(L).segments&&p(L).segments.length>0?F(He):p(L).content&&F(Ft,1)})}var Ut=D(ae,2);{var Vt=F=>{var ie=Nr();w(F,ie)};O(Ut,F=>{p(L).streaming&&F(Vt)})}_(ne),w(Y,ne)};O(ye,Y=>{p(L).role==="user"?Y(ke):Y(ce,!1)})}_(K),w(fe,K)}),w(g,y)};O(Ze,g=>{q.messages.length===0?g(k):g(N,!1)})}_(re),ys(re,g=>u=g,()=>u);var Z=D(re,2),H=R(Z);{var Ht=g=>{var y=Or(),j=R(y);_(y),le(()=>_e(j,`${E.selectedType??""}/${E.selectedId??""}`)),w(g,y)};O(H,g=>{E.selectedId&&g(Ht)})}var pt=D(H,2),oe=R(pt);xs(oe);var Qt=D(oe,2);{var Wt=g=>{te(g,{variant:"ghost",size:"icon",class:"size-7 stop-btn send-btn",onclick:()=>q.stop(),children:(y,j)=>{Ls(y,{size:16})},$$slots:{default:!0}})},Gt=g=>{te(g,{variant:"ghost",size:"icon",class:"size-7 send-btn",onclick:I,children:(y,j)=>{Ss(y,{size:14})},$$slots:{default:!0}})};O(Qt,g=>{q.streaming?g(Wt):g(Gt,!1)})}_(pt),_(Z),_(b),le(()=>{It(oe,"placeholder",E.selectedId?"Ask about this entity...":"Ask about your workspace..."),ws(oe,p(o)),oe.disabled=q.streaming}),rs("scroll",re,T),gt("input",oe,g=>l(g.target.value)),gt("keydown",oe,se),w(r,b),At()}ss(["input","keydown"]);export{Yr as C,Kr as V,q as c};
@@ -1 +1 @@
1
- import{c,a as p}from"./0x0awhVy.js";import"./Bl1mtM70.js";import{f as i}from"./8FUQuwgM.js";import{I as l,s as m}from"./Bxlwy1pA.js";import{l as d,s as f}from"./CbJfRYJV.js";function k(t,o){const e=d(o,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M20 6 9 17l-5-5"}]];l(t,f({name:"check"},()=>e,{get iconNode(){return r},children:(a,$)=>{var s=c(),n=i(s);m(n,o,"default",{}),p(a,s)},$$slots:{default:!0}}))}export{k as C};
1
+ import{c,a as p}from"./0x0awhVy.js";import"./Bl1mtM70.js";import{f as i}from"./8FUQuwgM.js";import{I as l,s as m}from"./Scb_NG-a.js";import{l as d,s as f}from"./CbJfRYJV.js";function k(t,o){const e=d(o,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M20 6 9 17l-5-5"}]];l(t,f({name:"check"},()=>e,{get iconNode(){return r},children:(a,$)=>{var s=c(),n=i(s);m(n,o,"default",{}),p(a,s)},$$slots:{default:!0}}))}export{k as C};
@@ -1,5 +1,5 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./EDLlAC9C.js","./8FUQuwgM.js","./CbJfRYJV.js","./0x0awhVy.js"])))=>i.map(i=>d[i]);
2
- import{c as C,a as u,r as Va,q as xi,o as lt,p as Ft,f as T,m as Ua,u as Ha,t as Ut,s as Pe,j as ja,e as Gt,g as Or}from"./0x0awhVy.js";import{bd as qa,l as Si,G as Pi,bu as Ya,k as Ga,F as $,bv as Us,ai as Xa,g as o,D as x,aH as ir,q as Y,e as Vn,b as hr,w as R,f as b,x as F,z as k,v as G,T as _,bp as Za,a7 as Zt,br as Qa,t as Hs,bs as Ja,u as el,a as at,S as tl,aF as me,bw as nl,bt as Ci,R as Io,y as Ve,A as fe,aj as Ar,bn as Oi}from"./8FUQuwgM.js";import{B as rl,l as Le,p as S,s as re,i as z,r as Ce,b as Fo}from"./CbJfRYJV.js";import{d as Je,c as po,e as U,k as Et,j as Ro,s as ro,i as Pn,w as B,a as wt,q as js,t as ol,g as mo}from"./EDLlAC9C.js";import{c as L,_ as sl}from"./DJKRyj_1.js";import{e as It,b as il,i as Vt,r as Dt,n as st}from"./DLX3YXva.js";import{g as un}from"./D8Tke-Cy.js";import{c as vt,a as Kr,B as it,I as Br}from"./BVmVTxxa.js";import"./Bl1mtM70.js";import{i as al}from"./DxxhVGi2.js";function ll(){return Symbol(qa)}const cl=Symbol("NaN");function ul(t,e,n){Si&&Pi();var r=new rl(t),s=!Ya();Ga(()=>{var a=e();a!==a&&(a=cl),s&&a!==null&&typeof a=="object"&&(a={}),r.ensure(a,n)})}function Ue(t,e,n,r,s){Si&&Pi();var a=e.$$slots?.[n],i=!1;a===!0&&(a=e.children,i=!0),a===void 0||a(t,i?()=>r:r)}class xo extends Map{#e=new Map;#t=$(0);#n=$(0);#r=Us||-1;constructor(e){if(super(),e){for(var[n,r]of e)super.set(n,r);this.#n.v=super.size}}#o(e){return Us===this.#r?$(e):Xa(e)}has(e){var n=this.#e,r=n.get(e);if(r===void 0)if(super.has(e))r=this.#o(0),n.set(e,r);else return o(this.#t),!1;return o(r),!0}forEach(e,n){this.#s(),super.forEach(e,n)}get(e){var n=this.#e,r=n.get(e);if(r===void 0)if(super.has(e))r=this.#o(0),n.set(e,r);else{o(this.#t);return}return o(r),super.get(e)}set(e,n){var r=this.#e,s=r.get(e),a=super.get(e),i=super.set(e,n),l=this.#t;if(s===void 0)s=this.#o(0),r.set(e,s),x(this.#n,super.size),ir(l);else if(a!==n){ir(s);var c=l.reactions===null?null:new Set(l.reactions),h=c===null||!s.reactions?.every(m=>c.has(m));h&&ir(l)}return i}delete(e){var n=this.#e,r=n.get(e),s=super.delete(e);return r!==void 0&&(n.delete(e),x(r,-1)),s&&(x(this.#n,super.size),ir(this.#t)),s}clear(){if(super.size!==0){super.clear();var e=this.#e;x(this.#n,0);for(var n of e.values())x(n,-1);ir(this.#t),e.clear()}}#s(){o(this.#t);var e=this.#e;if(this.#n.v!==e.size){for(var n of super.keys())if(!e.has(n)){var r=this.#o(0);e.set(n,r)}}for([,r]of this.#e)o(r)}keys(){return o(this.#t),super.keys()}values(){return this.#s(),super.values()}entries(){return this.#s(),super.entries()}[Symbol.iterator](){return this.entries()}get size(){return o(this.#n),super.size}}var qs=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,dl=/\n/g,fl=/^\s*/,hl=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,vl=/^:\s*/,gl=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,pl=/^[;\s]*/,ml=/^\s+|\s+$/g,yl=`
2
+ import{c as C,a as u,r as Va,q as xi,o as lt,p as Ft,f as T,m as Ua,u as Ha,t as Ut,s as Pe,j as ja,e as Gt,g as Or}from"./0x0awhVy.js";import{bd as qa,l as Si,G as Pi,bu as Ya,k as Ga,F as $,bv as Us,ai as Xa,g as o,D as x,aH as ir,q as Y,e as Vn,b as hr,w as R,f as b,x as F,z as k,v as G,T as _,bp as Za,a7 as Zt,br as Qa,t as Hs,bs as Ja,u as el,a as at,S as tl,aF as me,bw as nl,bt as Ci,R as Io,y as Ve,A as fe,aj as Ar,bn as Oi}from"./8FUQuwgM.js";import{B as rl,l as Le,p as S,s as re,i as z,r as Ce,b as Fo}from"./CbJfRYJV.js";import{d as Je,c as po,e as U,k as Et,j as Ro,s as ro,i as Pn,w as B,a as wt,q as js,t as ol,g as mo}from"./EDLlAC9C.js";import{c as L,_ as sl}from"./DJKRyj_1.js";import{e as It,b as il,i as Vt,r as Dt,n as st}from"./glgUBDR2.js";import{g as un}from"./CIZkRAuY.js";import{c as vt,a as Kr,B as it,I as Br}from"./BVmVTxxa.js";import"./Bl1mtM70.js";import{i as al}from"./DxxhVGi2.js";function ll(){return Symbol(qa)}const cl=Symbol("NaN");function ul(t,e,n){Si&&Pi();var r=new rl(t),s=!Ya();Ga(()=>{var a=e();a!==a&&(a=cl),s&&a!==null&&typeof a=="object"&&(a={}),r.ensure(a,n)})}function Ue(t,e,n,r,s){Si&&Pi();var a=e.$$slots?.[n],i=!1;a===!0&&(a=e.children,i=!0),a===void 0||a(t,i?()=>r:r)}class xo extends Map{#e=new Map;#t=$(0);#n=$(0);#r=Us||-1;constructor(e){if(super(),e){for(var[n,r]of e)super.set(n,r);this.#n.v=super.size}}#o(e){return Us===this.#r?$(e):Xa(e)}has(e){var n=this.#e,r=n.get(e);if(r===void 0)if(super.has(e))r=this.#o(0),n.set(e,r);else return o(this.#t),!1;return o(r),!0}forEach(e,n){this.#s(),super.forEach(e,n)}get(e){var n=this.#e,r=n.get(e);if(r===void 0)if(super.has(e))r=this.#o(0),n.set(e,r);else{o(this.#t);return}return o(r),super.get(e)}set(e,n){var r=this.#e,s=r.get(e),a=super.get(e),i=super.set(e,n),l=this.#t;if(s===void 0)s=this.#o(0),r.set(e,s),x(this.#n,super.size),ir(l);else if(a!==n){ir(s);var c=l.reactions===null?null:new Set(l.reactions),h=c===null||!s.reactions?.every(m=>c.has(m));h&&ir(l)}return i}delete(e){var n=this.#e,r=n.get(e),s=super.delete(e);return r!==void 0&&(n.delete(e),x(r,-1)),s&&(x(this.#n,super.size),ir(this.#t)),s}clear(){if(super.size!==0){super.clear();var e=this.#e;x(this.#n,0);for(var n of e.values())x(n,-1);ir(this.#t),e.clear()}}#s(){o(this.#t);var e=this.#e;if(this.#n.v!==e.size){for(var n of super.keys())if(!e.has(n)){var r=this.#o(0);e.set(n,r)}}for([,r]of this.#e)o(r)}keys(){return o(this.#t),super.keys()}values(){return this.#s(),super.values()}entries(){return this.#s(),super.entries()}[Symbol.iterator](){return this.entries()}get size(){return o(this.#n),super.size}}var qs=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,dl=/\n/g,fl=/^\s*/,hl=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,vl=/^:\s*/,gl=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,pl=/^[;\s]*/,ml=/^\s+|\s+$/g,yl=`
3
3
  `,Ys="/",Gs="*",Nn="",bl="comment",wl="declaration";function _l(t,e){if(typeof t!="string")throw new TypeError("First argument must be a string");if(!t)return[];e=e||{};var n=1,r=1;function s(f){var v=f.match(dl);v&&(n+=v.length);var P=f.lastIndexOf(yl);r=~P?f.length-P:r+f.length}function a(){var f={line:n,column:r};return function(v){return v.position=new i(f),h(),v}}function i(f){this.start=f,this.end={line:n,column:r},this.source=e.source}i.prototype.content=t;function l(f){var v=new Error(e.source+":"+n+":"+r+": "+f);if(v.reason=f,v.filename=e.source,v.line=n,v.column=r,v.source=t,!e.silent)throw v}function c(f){var v=f.exec(t);if(v){var P=v[0];return s(P),t=t.slice(P.length),v}}function h(){c(fl)}function m(f){var v;for(f=f||[];v=y();)v!==!1&&f.push(v);return f}function y(){var f=a();if(!(Ys!=t.charAt(0)||Gs!=t.charAt(1))){for(var v=2;Nn!=t.charAt(v)&&(Gs!=t.charAt(v)||Ys!=t.charAt(v+1));)++v;if(v+=2,Nn===t.charAt(v-1))return l("End of comment missing");var P=t.slice(2,v-2);return r+=2,s(P),t=t.slice(v),r+=2,f({type:bl,comment:P})}}function p(){var f=a(),v=c(hl);if(v){if(y(),!c(vl))return l("property missing ':'");var P=c(gl),E=f({type:wl,property:Xs(v[0].replace(qs,Nn)),value:P?Xs(P[0].replace(qs,Nn)):Nn});return c(pl),E}}function d(){var f=[];m(f);for(var v;v=p();)v!==!1&&(f.push(v),m(f));return f}return h(),d()}function Xs(t){return t?t.replace(ml,Nn):Nn}function xl(t,e){let n=null;if(!t||typeof t!="string")return n;const r=_l(t),s=typeof e=="function";return r.forEach(a=>{if(a.type!=="declaration")return;const{property:i,value:l}=a;s?e(i,l,a):l&&(n=n||{},n[i]=l)}),n}const Sl={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};const Pl=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0;return!1};const Zs=(...t)=>t.filter((e,n,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===n).join(" ").trim();var Cl=Va("<svg><!><!></svg>");function je(t,e){const n=Le(e,["children","$$slots","$$events","$$legacy"]),r=Le(n,["name","color","size","strokeWidth","absoluteStrokeWidth","iconNode"]);Y(e,!1);let s=S(e,"name",8,void 0),a=S(e,"color",8,"currentColor"),i=S(e,"size",8,24),l=S(e,"strokeWidth",8,2),c=S(e,"absoluteStrokeWidth",8,!1),h=S(e,"iconNode",24,()=>[]);al();var m=Cl();Je(m,(d,f,v)=>({...Sl,...d,...r,width:i(),height:i(),stroke:a(),"stroke-width":f,class:v}),[()=>Pl(r)?void 0:{"aria-hidden":"true"},()=>(Vn(c()),Vn(l()),Vn(i()),hr(()=>c()?Number(l())*24/Number(i()):l())),()=>(Vn(Zs),Vn(s()),Vn(n),hr(()=>Zs("lucide-icon","lucide",s()?`lucide-${s()}`:"",n.class)))]);var y=R(m);It(y,1,h,Vt,(d,f)=>{var v=_(()=>Za(o(f),2));let P=()=>o(v)[0],E=()=>o(v)[1];var M=C(),N=b(M);il(N,P,!0,(I,X)=>{Je(I,()=>({...E()}))}),u(d,M)});var p=F(y);Ue(p,e,"default",{}),k(m),u(t,m),G()}function Ai(t,e){const n=Le(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"m21 21-4.34-4.34"}],["circle",{cx:"11",cy:"11",r:"8"}]];je(t,re({name:"search"},()=>n,{get iconNode(){return r},children:(s,a)=>{var i=C(),l=b(i);Ue(l,e,"default",{}),u(s,i)},$$slots:{default:!0}}))}function So(t,e){const n=Le(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M18 6 6 18"}],["path",{d:"m6 6 12 12"}]];je(t,re({name:"x"},()=>n,{get iconNode(){return r},children:(s,a)=>{var i=C(),l=b(i);Ue(l,e,"default",{}),u(s,i)},$$slots:{default:!0}}))}function Er(t,e){const n=Le(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"m9 18 6-6-6-6"}]];je(t,re({name:"chevron-right"},()=>n,{get iconNode(){return r},children:(s,a)=>{var i=C(),l=b(i);Ue(l,e,"default",{}),u(s,i)},$$slots:{default:!0}}))}function Tr(t,e){const n=Le(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"m6 9 6 6 6-6"}]];je(t,re({name:"chevron-down"},()=>n,{get iconNode(){return r},children:(s,a)=>{var i=C(),l=b(i);Ue(l,e,"default",{}),u(s,i)},$$slots:{default:!0}}))}function Ol(t,e){const n=Le(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"m16 17 5-5-5-5"}],["path",{d:"M21 12H9"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"}]];je(t,re({name:"log-out"},()=>n,{get iconNode(){return r},children:(s,a)=>{var i=C(),l=b(i);Ue(l,e,"default",{}),u(s,i)},$$slots:{default:!0}}))}const Al={project:"#6e6ee8",organization:"#00c2b2",person:"#f0c246",meeting:"#ff7a00",deal:"#3ecf8e",deliverable:"#ff3864",decision:"#00a8ff",dataset:"#be00ff",process:"#f5c800",deck:"#6e6ee8",doc:"#00a8ff",document:"#a855f7",note:"#94a3b8",publication:"#ec4899",reference:"#14b8a6",task:"#f97316",role:"#ff7a00","practice-area":"#8b5cf6","case-study":"#06b6d4",standard:"#ff2aa8"};function Un(t){return t?Al[t]??"#5c5c66":"#5c5c66"}const El={person:"people","practice-area":"practice-areas","case-study":"case-studies",process:"processes"};function Tl(t){return El[t]??t+"s"}function Qs(t,e){const n=Le(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M5 12h14"}],["path",{d:"M12 5v14"}]];je(t,re({name:"plus"},()=>n,{get iconNode(){return r},children:(s,a)=>{var i=C(),l=b(i);Ue(l,e,"default",{}),u(s,i)},$$slots:{default:!0}}))}function kl(t,e){const n=Le(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0"}],["circle",{cx:"12",cy:"12",r:"3"}]];je(t,re({name:"eye"},()=>n,{get iconNode(){return r},children:(s,a)=>{var i=C(),l=b(i);Ue(l,e,"default",{}),u(s,i)},$$slots:{default:!0}}))}function yo(t,e){const n=Le(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143"}],["path",{d:"m2 2 20 20"}]];je(t,re({name:"eye-off"},()=>n,{get iconNode(){return r},children:(s,a)=>{var i=C(),l=b(i);Ue(l,e,"default",{}),u(s,i)},$$slots:{default:!0}}))}function kr(t,e){const n=Le(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M10 11v6"}],["path",{d:"M14 11v6"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6"}],["path",{d:"M3 6h18"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"}]];je(t,re({name:"trash-2"},()=>n,{get iconNode(){return r},children:(s,a)=>{var i=C(),l=b(i);Ue(l,e,"default",{}),u(s,i)},$$slots:{default:!0}}))}function Ml(t,e){const n=Le(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915"}],["circle",{cx:"12",cy:"12",r:"3"}]];je(t,re({name:"settings"},()=>n,{get iconNode(){return r},children:(s,a)=>{var i=C(),l=b(i);Ue(l,e,"default",{}),u(s,i)},$$slots:{default:!0}}))}function Js(t,e){const n=Le(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8"}],["path",{d:"M21 3v5h-5"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16"}],["path",{d:"M8 16H3v5"}]];je(t,re({name:"refresh-cw"},()=>n,{get iconNode(){return r},children:(s,a)=>{var i=C(),l=b(i);Ue(l,e,"default",{}),u(s,i)},$$slots:{default:!0}}))}function Mr(t,e){const n=Le(e,["children","$$slots","$$events","$$legacy"]);const r=[["circle",{cx:"12",cy:"12",r:"1"}],["circle",{cx:"19",cy:"12",r:"1"}],["circle",{cx:"5",cy:"12",r:"1"}]];je(t,re({name:"ellipsis"},()=>n,{get iconNode(){return r},children:(s,a)=>{var i=C(),l=b(i);Ue(l,e,"default",{}),u(s,i)},$$slots:{default:!0}}))}function Il(t,e){const n=Le(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z"}],["path",{d:"m15 5 4 4"}]];je(t,re({name:"pencil"},()=>n,{get iconNode(){return r},children:(s,a)=>{var i=C(),l=b(i);Ue(l,e,"default",{}),u(s,i)},$$slots:{default:!0}}))}function ei(t,e){const n=Le(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M12 3v12"}],["path",{d:"m17 8-5-5-5 5"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}]];je(t,re({name:"upload"},()=>n,{get iconNode(){return r},children:(s,a)=>{var i=C(),l=b(i);Ue(l,e,"default",{}),u(s,i)},$$slots:{default:!0}}))}function Fl(t){return typeof t=="function"}function pr(t){return t!==null&&typeof t=="object"}const Rl=["string","number","bigint","boolean"];function Po(t){return t==null||Rl.includes(typeof t)?!0:Array.isArray(t)?t.every(e=>Po(e)):typeof t=="object"?Object.getPrototypeOf(t)===Object.prototype:!1}const qn=Symbol("box"),oo=Symbol("is-writable");function A(t,e){const n=_(t);return e?{[qn]:!0,[oo]:!0,get current(){return o(n)},set current(r){e(r)}}:{[qn]:!0,get current(){return t()}}}function mr(t){return pr(t)&&qn in t}function No(t){return mr(t)&&oo in t}function Ei(t){return mr(t)?t:Fl(t)?A(t):tn(t)}function Nl(t){return Object.entries(t).reduce((e,[n,r])=>mr(r)?(No(r)?Object.defineProperty(e,n,{get(){return r.current},set(s){r.current=s}}):Object.defineProperty(e,n,{get(){return r.current}}),e):Object.assign(e,{[n]:r}),{})}function Dl(t){return No(t)?{[qn]:!0,get current(){return t.current}}:t}function tn(t){let e=$(Zt(t));return{[qn]:!0,[oo]:!0,get current(){return o(e)},set current(n){x(e,n,!0)}}}function Ln(t){let e=$(Zt(t));return{[qn]:!0,[oo]:!0,get current(){return o(e)},set current(n){x(e,n,!0)}}}Ln.from=Ei;Ln.with=A;Ln.flatten=Nl;Ln.readonly=Dl;Ln.isBox=mr;Ln.isWritableBox=No;function Ti(...t){return function(e){for(const n of t)if(n){if(e.defaultPrevented)return;typeof n=="function"?n.call(this,e):n.current?.call(this,e)}}}const zl=/\d/,$l=["-","_","/","."];function Ll(t=""){if(!zl.test(t))return t!==t.toLowerCase()}function Bl(t){const e=[];let n="",r,s;for(const a of t){const i=$l.includes(a);if(i===!0){e.push(n),n="",r=void 0;continue}const l=Ll(a);if(s===!1){if(r===!1&&l===!0){e.push(n),n=a,r=l;continue}if(r===!0&&l===!1&&n.length>1){const c=n.at(-1);e.push(n.slice(0,Math.max(0,n.length-1))),n=c+a,r=l;continue}}n+=a,r=l,s=i}return e.push(n),e}function ki(t){return t?Bl(t).map(e=>Kl(e)).join(""):""}function Wl(t){return Vl(ki(t||""))}function Kl(t){return t?t[0].toUpperCase()+t.slice(1):""}function Vl(t){return t?t[0].toLowerCase()+t.slice(1):""}function dr(t){if(!t)return{};const e={};function n(r,s){if(r.startsWith("-moz-")||r.startsWith("-webkit-")||r.startsWith("-ms-")||r.startsWith("-o-")){e[ki(r)]=s;return}if(r.startsWith("--")){e[r]=s;return}e[Wl(r)]=s}return xl(t,n),e}function Dn(...t){return(...e)=>{for(const n of t)typeof n=="function"&&n(...e)}}function Ul(t,e){const n=RegExp(t,"g");return r=>{if(typeof r!="string")throw new TypeError(`expected an argument of type string, but got ${typeof r}`);return r.match(n)?r.replace(n,e):r}}const Hl=Ul(/[A-Z]/,t=>`-${t.toLowerCase()}`);function jl(t){if(!t||typeof t!="object"||Array.isArray(t))throw new TypeError(`expected an argument of type object, but got ${typeof t}`);return Object.keys(t).map(e=>`${Hl(e)}: ${t[e]};`).join(`
4
4
  `)}function Mi(t={}){return jl(t).replace(`
5
5
  `," ")}const ql=["onabort","onanimationcancel","onanimationend","onanimationiteration","onanimationstart","onauxclick","onbeforeinput","onbeforetoggle","onblur","oncancel","oncanplay","oncanplaythrough","onchange","onclick","onclose","oncompositionend","oncompositionstart","oncompositionupdate","oncontextlost","oncontextmenu","oncontextrestored","oncopy","oncuechange","oncut","ondblclick","ondrag","ondragend","ondragenter","ondragleave","ondragover","ondragstart","ondrop","ondurationchange","onemptied","onended","onerror","onfocus","onfocusin","onfocusout","onformdata","ongotpointercapture","oninput","oninvalid","onkeydown","onkeypress","onkeyup","onload","onloadeddata","onloadedmetadata","onloadstart","onlostpointercapture","onmousedown","onmouseenter","onmouseleave","onmousemove","onmouseout","onmouseover","onmouseup","onpaste","onpause","onplay","onplaying","onpointercancel","onpointerdown","onpointerenter","onpointerleave","onpointermove","onpointerout","onpointerover","onpointerup","onprogress","onratechange","onreset","onresize","onscroll","onscrollend","onsecuritypolicyviolation","onseeked","onseeking","onselect","onselectionchange","onselectstart","onslotchange","onstalled","onsubmit","onsuspend","ontimeupdate","ontoggle","ontouchcancel","ontouchend","ontouchmove","ontouchstart","ontransitioncancel","ontransitionend","ontransitionrun","ontransitionstart","onvolumechange","onwaiting","onwebkitanimationend","onwebkitanimationiteration","onwebkitanimationstart","onwebkittransitionend","onwheel"],Yl=new Set(ql);function Gl(t){return Yl.has(t)}function $e(...t){const e={...t[0]};for(let n=1;n<t.length;n++){const r=t[n];if(r){for(const s of Object.keys(r)){const a=e[s],i=r[s],l=typeof a=="function",c=typeof i=="function";if(l&&Gl(s)){const h=a,m=i;e[s]=Ti(h,m)}else if(l&&c)e[s]=Dn(a,i);else if(s==="class"){const h=Po(a),m=Po(i);h&&m?e[s]=po(a,i):h?e[s]=po(a):m&&(e[s]=po(i))}else if(s==="style"){const h=typeof a=="object",m=typeof i=="object",y=typeof a=="string",p=typeof i=="string";if(h&&m)e[s]={...a,...i};else if(h&&p){const d=dr(i);e[s]={...a,...d}}else if(y&&m){const d=dr(a);e[s]={...d,...i}}else if(y&&p){const d=dr(a),f=dr(i);e[s]={...d,...f}}else h?e[s]=a:m?e[s]=i:y?e[s]=a:p&&(e[s]=i)}else e[s]=i!==void 0?i:a}for(const s of Object.getOwnPropertySymbols(r)){const a=e[s],i=r[s];e[s]=i!==void 0?i:a}}}return typeof e.style=="object"&&(e.style=Mi(e.style).replaceAll(`
@@ -1 +1 @@
1
- import{j as J,k as fe,g as h,al as te,Y as we,X as K,am as be,_ as Ie,af as $e,an as Ae,ai as ne,ao as Ce,ap as xe,Q as Ne,l as w,n as B,p as de,G as Q,aq as Oe,ar as ee,J as ke,a0 as De,K as se,s as L,o as H,C as He,as as Re,at as N,U as pe,W as he,au as X,av as Me,aw as Pe,V as Fe,a2 as Be,m as Ue,ax as ge,ay as Ve,az as ze,I as Le,aA as Ge,aB as We,a9 as Je,aC as Ye,D as d,F as b,a7 as re,b as ie,T as qe}from"./8FUQuwgM.js";import{b as Xe,i as Ke}from"./0x0awhVy.js";import{B as Qe}from"./CbJfRYJV.js";import{i as je}from"./D8Tke-Cy.js";import{b as oe,u as ae,w as x,a as Ze}from"./EDLlAC9C.js";function xt(e,t){return t}function et(e,t,n){for(var s=[],i=t.length,a,o=t.length,c=0;c<i;c++){let T=t[c];he(T,()=>{if(a){if(a.pending.delete(T),a.done.add(T),a.pending.size===0){var p=e.outrogroups;j(ee(a.done)),p.delete(a),p.size===0&&(e.outrogroups=null)}}else o-=1},!1)}if(o===0){var u=s.length===0&&n!==null;if(u){var E=n,l=E.parentNode;Pe(l),l.append(E),e.items.clear()}j(t,!u)}else a={pending:new Set(t),done:new Set},(e.outrogroups??=new Set).add(a)}function j(e,t=!0){for(var n=0;n<e.length;n++)Fe(e[n],t)}var le;function Nt(e,t,n,s,i,a=null){var o=e,c=new Map,u=(t&ge)!==0;if(u){var E=e;o=w?B(de(E)):E.appendChild(J())}w&&Q();var l=null,T=$e(()=>{var f=n();return Oe(f)?f:f==null?[]:ee(f)}),p,g=!0;function m(){r.fallback=l,tt(r,p,o,t,s),l!==null&&(p.length===0?(l.f&N)===0?pe(l):(l.f^=N,z(l,null,o)):he(l,()=>{l=null}))}var y=fe(()=>{p=h(T);var f=p.length;let C=!1;if(w){var M=ke(o)===De;M!==(f===0)&&(o=se(),B(o),L(!1),C=!0)}for(var $=new Set,k=we,P=Ie(),I=0;I<f;I+=1){w&&H.nodeType===He&&H.data===Re&&(o=H,C=!0,L(!1));var D=p[I],F=s(D,I),v=g?null:c.get(F);v?(v.v&&te(v.v,D),v.i&&te(v.i,I),P&&k.unskip_effect(v.e)):(v=nt(c,g?o:le??=J(),D,F,I,i,t,n),g||(v.e.f|=N),c.set(F,v)),$.add(F)}if(f===0&&a&&!l&&(g?l=K(()=>a(o)):(l=K(()=>a(le??=J())),l.f|=N)),f>$.size&&be(),w&&f>0&&B(se()),!g)if(P){for(const[Se,ve]of c)$.has(Se)||k.skip_effect(ve.e);k.oncommit(m),k.ondiscard(()=>{})}else m();C&&L(!0),h(T)}),r={effect:y,items:c,outrogroups:null,fallback:l};g=!1,w&&(o=H)}function U(e){for(;e!==null&&(e.f&Me)===0;)e=e.next;return e}function tt(e,t,n,s,i){var a=(s&Ve)!==0,o=t.length,c=e.items,u=U(e.effect.first),E,l=null,T,p=[],g=[],m,y,r,f;if(a)for(f=0;f<o;f+=1)m=t[f],y=i(m,f),r=c.get(y).e,(r.f&N)===0&&(r.nodes?.a?.measure(),(T??=new Set).add(r));for(f=0;f<o;f+=1){if(m=t[f],y=i(m,f),r=c.get(y).e,e.outrogroups!==null)for(const v of e.outrogroups)v.pending.delete(r),v.done.delete(r);if((r.f&N)!==0)if(r.f^=N,r===u)z(r,null,n);else{var C=l?l.next:u;r===e.effect.last&&(e.effect.last=r.prev),r.prev&&(r.prev.next=r.next),r.next&&(r.next.prev=r.prev),O(e,l,r),O(e,r,C),z(r,C,n),l=r,p=[],g=[],u=U(l.next);continue}if((r.f&X)!==0&&(pe(r),a&&(r.nodes?.a?.unfix(),(T??=new Set).delete(r))),r!==u){if(E!==void 0&&E.has(r)){if(p.length<g.length){var M=g[0],$;l=M.prev;var k=p[0],P=p[p.length-1];for($=0;$<p.length;$+=1)z(p[$],M,n);for($=0;$<g.length;$+=1)E.delete(g[$]);O(e,k.prev,P.next),O(e,l,k),O(e,P,M),u=M,l=P,f-=1,p=[],g=[]}else E.delete(r),z(r,u,n),O(e,r.prev,r.next),O(e,r,l===null?e.effect.first:l.next),O(e,l,r),l=r;continue}for(p=[],g=[];u!==null&&u!==r;)(E??=new Set).add(u),g.push(u),u=U(u.next);if(u===null)continue}(r.f&N)===0&&p.push(r),l=r,u=U(r.next)}if(e.outrogroups!==null){for(const v of e.outrogroups)v.pending.size===0&&(j(ee(v.done)),e.outrogroups?.delete(v));e.outrogroups.size===0&&(e.outrogroups=null)}if(u!==null||E!==void 0){var I=[];if(E!==void 0)for(r of E)(r.f&X)===0&&I.push(r);for(;u!==null;)(u.f&X)===0&&u!==e.fallback&&I.push(u),u=U(u.next);var D=I.length;if(D>0){var F=(s&ge)!==0&&o===0?n:null;if(a){for(f=0;f<D;f+=1)I[f].nodes?.a?.measure();for(f=0;f<D;f+=1)I[f].nodes?.a?.fix()}et(e,I,F)}}a&&Be(()=>{if(T!==void 0)for(r of T)r.nodes?.a?.apply()})}function nt(e,t,n,s,i,a,o,c){var u=(o&Ce)!==0?(o&xe)===0?Ne(n,!1,!1):ne(n):null,E=(o&Ae)!==0?ne(i):null;return{v:u,i:E,e:K(()=>(a(t,u??n,E??i,c),()=>{e.delete(s)}))}}function z(e,t,n){if(e.nodes)for(var s=e.nodes.start,i=e.nodes.end,a=t&&(t.f&N)===0?t.nodes.start:n;s!==null;){var o=Ue(s);if(a.before(s),s===i)return;s=o}}function O(e,t,n){t===null?e.effect.first=n:t.next=n,n===null?e.effect.last=t:n.prev=t}function Ot(e,t,n,s,i,a){let o=w;w&&Q();var c=null;w&&H.nodeType===ze&&(c=H,Q());var u=w?H:e,E=new Qe(u,!1);fe(()=>{const l=t()||null;var T=n||l==="svg"?We:void 0;if(l===null){E.ensure(null,null);return}return E.ensure(l,p=>{if(l){if(c=w?c:Ge(l,T),Xe(c,c),s){w&&Ke(l)&&c.append(document.createComment(""));var g=w?de(c):c.appendChild(J());w&&(g===null?L(!1):B(g)),s(c,g)}Je.nodes.end=c,p.before(c)}w&&B(p)}),()=>{}},Le),Ye(()=>{}),o&&(L(!0),B(u))}function st(){let e=b(null),t=b(null),n=b(null),s=b(null),i=b("entity"),a=b(null),o=b("general");function c(m,y){h(e)&&(h(e)!==m||h(n)!==y)&&oe(h(e)).catch(()=>{})}function u(m,y,r,f){c(m,r),d(e,m,!0),d(t,y,!0),d(n,r,!0),d(s,f??null,!0)}function E(){d(i,"entity")}function l(){d(i,"graph")}function T(){d(i,"settings")}function p(m,y,r){h(n)===r&&h(e)===m?(d(e,null),d(t,null),d(n,null)):(d(e,m,!0),d(t,y,!0),d(n,r,!0)),d(s,null)}function g(){h(e)&&oe(h(e)).catch(()=>{}),d(e,null),d(t,null),d(n,null),d(s,null)}return{get selectedRepo(){return h(e)},get selectedType(){return h(t)},get selectedId(){return h(n)},get selectedSubPath(){return h(s)},get activeView(){return h(i)},get entityPath(){return h(e)&&h(t)&&h(n)?`/${h(e)}/${h(t)}/${h(n)}`:null},get hoveredEntityId(){return h(a)},set hoveredEntityId(m){d(a,m,!0)},get settingsTab(){return h(o)},set settingsTab(m){d(o,m,!0)},select:u,deselect:g,selectOnGraph:p,showEntity:E,showGraph:l,showSettings:T}}const V=st();function kt(...e){return e.filter(Boolean).join(" ")}const rt=typeof document<"u";let ue=0;class it{#e=b(re([]));get toasts(){return h(this.#e)}set toasts(t){d(this.#e,t,!0)}#t=b(re([]));get heights(){return h(this.#t)}set heights(t){d(this.#t,t,!0)}#n=t=>{const n=this.toasts.findIndex(s=>s.id===t);return n===-1?null:n};addToast=t=>{rt&&this.toasts.unshift(t)};updateToast=({id:t,data:n,type:s,message:i})=>{const a=this.toasts.findIndex(c=>c.id===t),o=this.toasts[a];this.toasts[a]={...o,...n,id:t,title:i,type:s,updated:!0}};create=t=>{const{message:n,...s}=t,i=typeof t?.id=="number"||t.id&&t.id?.length>0?t.id:ue++,a=t.dismissible!==void 0?t.dismissible:t.dismissable!==void 0?t.dismissable:!0,o=t.type===void 0?"default":t.type;return ie(()=>{this.toasts.find(u=>u.id===i)?this.updateToast({id:i,data:t,type:o,message:n,dismissible:a}):this.addToast({...s,id:i,title:n,dismissible:a,type:o})}),i};dismiss=t=>(ie(()=>{if(t===void 0){this.toasts=this.toasts.map(s=>({...s,dismiss:!0}));return}const n=this.toasts.findIndex(s=>s.id===t);this.toasts[n]&&(this.toasts[n]={...this.toasts[n],dismiss:!0})}),t);remove=t=>{if(t===void 0){this.toasts=[];return}const n=this.#n(t);if(n!==null)return this.toasts.splice(n,1),t};message=(t,n)=>this.create({...n,type:"default",message:t});error=(t,n)=>this.create({...n,type:"error",message:t});success=(t,n)=>this.create({...n,type:"success",message:t});info=(t,n)=>this.create({...n,type:"info",message:t});warning=(t,n)=>this.create({...n,type:"warning",message:t});loading=(t,n)=>this.create({...n,type:"loading",message:t});promise=(t,n)=>{if(!n)return;let s;n.loading!==void 0&&(s=this.create({...n,promise:t,type:"loading",message:typeof n.loading=="string"?n.loading:n.loading()}));const i=t instanceof Promise?t:t();let a=s!==void 0;return i.then(o=>{if(typeof o=="object"&&o&&"ok"in o&&typeof o.ok=="boolean"&&!o.ok){a=!1;const c=ot(o);this.create({id:s,type:"error",message:c})}else if(n.success!==void 0){a=!1;const c=typeof n.success=="function"?n.success(o):n.success;this.create({id:s,type:"success",message:c})}}).catch(o=>{if(n.error!==void 0){a=!1;const c=typeof n.error=="function"?n.error(o):n.error;this.create({id:s,type:"error",message:c})}}).finally(()=>{a&&(this.dismiss(s),s=void 0),n.finally?.()}),s};custom=(t,n)=>{const s=n?.id||ue++;return this.create({component:t,id:s,...n}),s};removeHeight=t=>{this.heights=this.heights.filter(n=>n.toastId!==t)};setHeight=t=>{const n=this.#n(t.toastId);if(n===null){this.heights.push(t);return}this.heights[n]=t};reset=()=>{this.toasts=[],this.heights=[]}}function ot(e){return e&&typeof e=="object"&&"status"in e?`HTTP error! Status: ${e.status}`:`Error! ${e}`}const A=new it;function at(e,t){return A.create({message:e,...t})}class Dt{#e=qe(()=>A.toasts.filter(t=>!t.dismiss));get toasts(){return h(this.#e)}}const lt=at,S=Object.assign(lt,{success:A.success,info:A.info,warning:A.warning,error:A.error,custom:A.custom,message:A.message,promise:A.promise,dismiss:A.dismiss,loading:A.loading,getActiveToasts:()=>A.toasts.filter(e=>!e.dismiss)}),ut=800;function ct(){let e=b(!1),t=b(null),n=b(null),s=null,i=null,a=!1;function o(p,g,m,y){s&&s.repo===p&&s.type===g&&s.id===m?(y.data!==void 0&&(s.payload.data=y.data),y.content!==void 0&&(s.payload.content=y.content)):s={repo:p,type:g,id:m,payload:{...y}},c()}function c(){i&&clearTimeout(i),i=setTimeout(u,ut)}async function u(){if(i=null,!a&&s){const{repo:p,type:g,id:m,payload:y}=s;s=null,a=!0,d(e,!0),d(n,null);try{if(await ae(p,g,m,y),d(t,new Date,!0),y.data?.name){const f=x.repos.find(C=>C.name===p)?.entities.find(C=>C.id===m);f&&(f.title=y.data.name)}}catch(r){d(n,r.message??"Save failed",!0);const f=r.status??r.statusCode;(!f||f>=500)&&(s={repo:p,type:g,id:m,payload:y})}finally{d(e,!1),a=!1,s&&u()}}}function E(){i&&(clearTimeout(i),i=null),s&&u()}async function l(p,g,m,y){d(e,!0),d(n,null);try{const r=await ae(p,g,m,y);return d(t,new Date,!0),r}catch(r){return d(n,r.message??"Save failed",!0),null}finally{d(e,!1)}}function T(){d(n,null),d(t,null),s=null,i&&(clearTimeout(i),i=null)}return{get saving(){return h(e)},get lastSaved(){return h(t)},get error(){return h(n)},get hasPending(){return!!(s||a)},scheduleAutoSave:o,flush:E,saveEntity:l,reset:T}}const ft=ct();let _=null,me=null,ye=null,Ee=[],Y=null,W=1e3,q=b(!1),Te=b(null);const R=new Map,G={},Z={};function ce(e,t){R.delete(e);const n=t.entities.length,s=n===1?`${e} updated ${t.entities[0]}`:`${e} updated ${n} entities`;S(s)}function dt(e){for(const[t,n]of R)n.repo===e&&(clearTimeout(n.timer),R.delete(t))}function pt(e){const t=Ze.user?.displayName;if(e.type==="sync_progress"){const n=G[e.repo];if(n){const s=e.message.trim(),i=s.match(/^Syncing from source:\s*(.+)$/i);i&&(Z[e.repo]=`Syncing ${i[1].trim()}…`);const a=Z[e.repo]??`Syncing ${e.repo}…`;S.loading(a,{id:n,description:s,duration:36e5})}return}if(e.type==="entity_change"){if(t&&e.actor===t&&e.source==="api"){x.refreshEntities(e.repo);return}if(x.refreshEntities(e.repo),V.selectedRepo===e.repo&&V.selectedType===e.entityType&&V.selectedId===e.entityId){ft.hasPending?S(`${e.actor} also saved changes to this entity`):je();return}const s=R.get(e.actor);if(s)clearTimeout(s.timer),s.entities.includes(e.entityId)||s.entities.push(e.entityId),s.timer=setTimeout(()=>ce(e.actor,s),1e4);else{const i={entities:[e.entityId],repo:e.repo,timer:setTimeout(()=>ce(e.actor,i),1e4)};R.set(e.actor,i)}return}if(e.type==="session_commit"){if(t&&e.actor===t){d(Te,e.timestamp,!0);return}const n=e.entities.length,s=n===1?`${e.actor} saved changes to ${e.entities[0]}`:`${e.actor} saved ${n} changes in ${e.repo}`;S(s),x.refreshEntities(e.repo);return}if(e.type==="sync_complete"){if(dt(e.repo),!G[e.repo]){const n=e.created+e.updated+e.deleted,s=n===0?`Sync complete · no changes in ${e.repo}`:`Sync complete · ${n} ${n===1?"entity":"entities"} from ${e.source}`;S.success(s)}x.refreshEntities(e.repo);return}if(e.type==="collection_created"){S(`${e.actor} created collection ${e.repo}`),x.refreshEntities(e.repo);return}if(e.type==="collection_deleted"){S(`${e.actor} deleted collection ${e.repo}`);return}if(e.type==="repo_sync"){S(`${e.actor} pushed to ${e.repo}`),x.refreshEntities(e.repo);return}if(e.type==="presence"){me?.(e);return}if(e.type==="online"){ye?.(e);return}if(e.type==="access_granted"||e.type==="access_revoked"){e.type==="access_revoked"&&V.selectedRepo===e.repo&&V.deselect(),x.load();return}}function _e(){if(typeof window>"u"||_&&(_.readyState===WebSocket.OPEN||_.readyState===WebSocket.CONNECTING))return;const t=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws`;_=new WebSocket(t),_.binaryType="arraybuffer",_.onopen=()=>{d(q,!0),W=1e3,x.refreshAll();for(const n of Ee)n()},_.onmessage=n=>{if(!(n.data instanceof ArrayBuffer))try{const s=JSON.parse(n.data);if(s?.type==="ping"){_?.send(JSON.stringify({type:"pong"}));return}const i=s;i.type&&i.type!=="toast"&&pt(i)}catch{}},_.onclose=()=>{d(q,!1),_=null,Y=setTimeout(()=>{W=Math.min(W*2,1e4),_e()},W)},_.onerror=()=>{}}function ht(){Y&&(clearTimeout(Y),Y=null),_&&(_.close(),_=null),d(q,!1);for(const[,e]of R)clearTimeout(e.timer);R.clear()}function gt(e,t=4e3){S(e,{duration:t})}function mt(e,t){const n=crypto.randomUUID();return t?.loading?S.loading(e,{id:n,duration:36e5}):S(e,{id:n}),n}function yt(e,t,n){if(n?.loading){S.loading(t,{id:e});return}/failed|error/i.test(t)?S.error(t,{id:e,duration:n?.duration??6e3}):S.success(t,{id:e,duration:n?.duration??4e3})}function Et(e){const t=crypto.randomUUID();G[e]=t,S.loading(`Syncing ${e}…`,{id:t,duration:36e5})}function Tt(e,t,n){const s=G[e];s&&(delete G[e],delete Z[e],n?S.error(t,{id:s,duration:6e3}):S.success(t,{id:s,duration:4e3}))}function _t(e){me=e}function St(e){ye=e}function vt(e){Ee.push(e)}function wt(e){_?.readyState===WebSocket.OPEN&&_.send(JSON.stringify(e))}const Ht={get connected(){return h(q)},get lastAutoSaved(){return h(Te)},get ws(){return _},connect:_e,disconnect:ht,showToast:gt,showPersistentToast:mt,updateToast:yt,startSyncToast:Et,finishSyncToast:Tt,send:wt,setPresenceHandler:_t,setOnlineHandler:St,addConnectHandler:vt};export{Dt as S,ft as a,Ot as b,kt as c,Nt as e,xt as i,V as n,Ht as r,A as t};
1
+ import{j as J,k as fe,g as h,al as te,Y as we,X as K,am as be,_ as Ie,af as $e,an as Ae,ai as ne,ao as Ce,ap as xe,Q as Ne,l as w,n as B,p as de,G as Q,aq as Oe,ar as ee,J as ke,a0 as De,K as se,s as L,o as H,C as He,as as Re,at as N,U as pe,W as he,au as X,av as Me,aw as Pe,V as Fe,a2 as Be,m as Ue,ax as ge,ay as Ve,az as ze,I as Le,aA as Ge,aB as We,a9 as Je,aC as Ye,D as d,F as b,a7 as re,b as ie,T as qe}from"./8FUQuwgM.js";import{b as Xe,i as Ke}from"./0x0awhVy.js";import{B as Qe}from"./CbJfRYJV.js";import{i as je}from"./CIZkRAuY.js";import{b as oe,u as ae,w as x,a as Ze}from"./EDLlAC9C.js";function xt(e,t){return t}function et(e,t,n){for(var s=[],i=t.length,a,o=t.length,c=0;c<i;c++){let T=t[c];he(T,()=>{if(a){if(a.pending.delete(T),a.done.add(T),a.pending.size===0){var p=e.outrogroups;j(ee(a.done)),p.delete(a),p.size===0&&(e.outrogroups=null)}}else o-=1},!1)}if(o===0){var u=s.length===0&&n!==null;if(u){var E=n,l=E.parentNode;Pe(l),l.append(E),e.items.clear()}j(t,!u)}else a={pending:new Set(t),done:new Set},(e.outrogroups??=new Set).add(a)}function j(e,t=!0){for(var n=0;n<e.length;n++)Fe(e[n],t)}var le;function Nt(e,t,n,s,i,a=null){var o=e,c=new Map,u=(t&ge)!==0;if(u){var E=e;o=w?B(de(E)):E.appendChild(J())}w&&Q();var l=null,T=$e(()=>{var f=n();return Oe(f)?f:f==null?[]:ee(f)}),p,g=!0;function m(){r.fallback=l,tt(r,p,o,t,s),l!==null&&(p.length===0?(l.f&N)===0?pe(l):(l.f^=N,z(l,null,o)):he(l,()=>{l=null}))}var y=fe(()=>{p=h(T);var f=p.length;let C=!1;if(w){var M=ke(o)===De;M!==(f===0)&&(o=se(),B(o),L(!1),C=!0)}for(var $=new Set,k=we,P=Ie(),I=0;I<f;I+=1){w&&H.nodeType===He&&H.data===Re&&(o=H,C=!0,L(!1));var D=p[I],F=s(D,I),v=g?null:c.get(F);v?(v.v&&te(v.v,D),v.i&&te(v.i,I),P&&k.unskip_effect(v.e)):(v=nt(c,g?o:le??=J(),D,F,I,i,t,n),g||(v.e.f|=N),c.set(F,v)),$.add(F)}if(f===0&&a&&!l&&(g?l=K(()=>a(o)):(l=K(()=>a(le??=J())),l.f|=N)),f>$.size&&be(),w&&f>0&&B(se()),!g)if(P){for(const[Se,ve]of c)$.has(Se)||k.skip_effect(ve.e);k.oncommit(m),k.ondiscard(()=>{})}else m();C&&L(!0),h(T)}),r={effect:y,items:c,outrogroups:null,fallback:l};g=!1,w&&(o=H)}function U(e){for(;e!==null&&(e.f&Me)===0;)e=e.next;return e}function tt(e,t,n,s,i){var a=(s&Ve)!==0,o=t.length,c=e.items,u=U(e.effect.first),E,l=null,T,p=[],g=[],m,y,r,f;if(a)for(f=0;f<o;f+=1)m=t[f],y=i(m,f),r=c.get(y).e,(r.f&N)===0&&(r.nodes?.a?.measure(),(T??=new Set).add(r));for(f=0;f<o;f+=1){if(m=t[f],y=i(m,f),r=c.get(y).e,e.outrogroups!==null)for(const v of e.outrogroups)v.pending.delete(r),v.done.delete(r);if((r.f&N)!==0)if(r.f^=N,r===u)z(r,null,n);else{var C=l?l.next:u;r===e.effect.last&&(e.effect.last=r.prev),r.prev&&(r.prev.next=r.next),r.next&&(r.next.prev=r.prev),O(e,l,r),O(e,r,C),z(r,C,n),l=r,p=[],g=[],u=U(l.next);continue}if((r.f&X)!==0&&(pe(r),a&&(r.nodes?.a?.unfix(),(T??=new Set).delete(r))),r!==u){if(E!==void 0&&E.has(r)){if(p.length<g.length){var M=g[0],$;l=M.prev;var k=p[0],P=p[p.length-1];for($=0;$<p.length;$+=1)z(p[$],M,n);for($=0;$<g.length;$+=1)E.delete(g[$]);O(e,k.prev,P.next),O(e,l,k),O(e,P,M),u=M,l=P,f-=1,p=[],g=[]}else E.delete(r),z(r,u,n),O(e,r.prev,r.next),O(e,r,l===null?e.effect.first:l.next),O(e,l,r),l=r;continue}for(p=[],g=[];u!==null&&u!==r;)(E??=new Set).add(u),g.push(u),u=U(u.next);if(u===null)continue}(r.f&N)===0&&p.push(r),l=r,u=U(r.next)}if(e.outrogroups!==null){for(const v of e.outrogroups)v.pending.size===0&&(j(ee(v.done)),e.outrogroups?.delete(v));e.outrogroups.size===0&&(e.outrogroups=null)}if(u!==null||E!==void 0){var I=[];if(E!==void 0)for(r of E)(r.f&X)===0&&I.push(r);for(;u!==null;)(u.f&X)===0&&u!==e.fallback&&I.push(u),u=U(u.next);var D=I.length;if(D>0){var F=(s&ge)!==0&&o===0?n:null;if(a){for(f=0;f<D;f+=1)I[f].nodes?.a?.measure();for(f=0;f<D;f+=1)I[f].nodes?.a?.fix()}et(e,I,F)}}a&&Be(()=>{if(T!==void 0)for(r of T)r.nodes?.a?.apply()})}function nt(e,t,n,s,i,a,o,c){var u=(o&Ce)!==0?(o&xe)===0?Ne(n,!1,!1):ne(n):null,E=(o&Ae)!==0?ne(i):null;return{v:u,i:E,e:K(()=>(a(t,u??n,E??i,c),()=>{e.delete(s)}))}}function z(e,t,n){if(e.nodes)for(var s=e.nodes.start,i=e.nodes.end,a=t&&(t.f&N)===0?t.nodes.start:n;s!==null;){var o=Ue(s);if(a.before(s),s===i)return;s=o}}function O(e,t,n){t===null?e.effect.first=n:t.next=n,n===null?e.effect.last=t:n.prev=t}function Ot(e,t,n,s,i,a){let o=w;w&&Q();var c=null;w&&H.nodeType===ze&&(c=H,Q());var u=w?H:e,E=new Qe(u,!1);fe(()=>{const l=t()||null;var T=n||l==="svg"?We:void 0;if(l===null){E.ensure(null,null);return}return E.ensure(l,p=>{if(l){if(c=w?c:Ge(l,T),Xe(c,c),s){w&&Ke(l)&&c.append(document.createComment(""));var g=w?de(c):c.appendChild(J());w&&(g===null?L(!1):B(g)),s(c,g)}Je.nodes.end=c,p.before(c)}w&&B(p)}),()=>{}},Le),Ye(()=>{}),o&&(L(!0),B(u))}function st(){let e=b(null),t=b(null),n=b(null),s=b(null),i=b("entity"),a=b(null),o=b("general");function c(m,y){h(e)&&(h(e)!==m||h(n)!==y)&&oe(h(e)).catch(()=>{})}function u(m,y,r,f){c(m,r),d(e,m,!0),d(t,y,!0),d(n,r,!0),d(s,f??null,!0)}function E(){d(i,"entity")}function l(){d(i,"graph")}function T(){d(i,"settings")}function p(m,y,r){h(n)===r&&h(e)===m?(d(e,null),d(t,null),d(n,null)):(d(e,m,!0),d(t,y,!0),d(n,r,!0)),d(s,null)}function g(){h(e)&&oe(h(e)).catch(()=>{}),d(e,null),d(t,null),d(n,null),d(s,null)}return{get selectedRepo(){return h(e)},get selectedType(){return h(t)},get selectedId(){return h(n)},get selectedSubPath(){return h(s)},get activeView(){return h(i)},get entityPath(){return h(e)&&h(t)&&h(n)?`/${h(e)}/${h(t)}/${h(n)}`:null},get hoveredEntityId(){return h(a)},set hoveredEntityId(m){d(a,m,!0)},get settingsTab(){return h(o)},set settingsTab(m){d(o,m,!0)},select:u,deselect:g,selectOnGraph:p,showEntity:E,showGraph:l,showSettings:T}}const V=st();function kt(...e){return e.filter(Boolean).join(" ")}const rt=typeof document<"u";let ue=0;class it{#e=b(re([]));get toasts(){return h(this.#e)}set toasts(t){d(this.#e,t,!0)}#t=b(re([]));get heights(){return h(this.#t)}set heights(t){d(this.#t,t,!0)}#n=t=>{const n=this.toasts.findIndex(s=>s.id===t);return n===-1?null:n};addToast=t=>{rt&&this.toasts.unshift(t)};updateToast=({id:t,data:n,type:s,message:i})=>{const a=this.toasts.findIndex(c=>c.id===t),o=this.toasts[a];this.toasts[a]={...o,...n,id:t,title:i,type:s,updated:!0}};create=t=>{const{message:n,...s}=t,i=typeof t?.id=="number"||t.id&&t.id?.length>0?t.id:ue++,a=t.dismissible!==void 0?t.dismissible:t.dismissable!==void 0?t.dismissable:!0,o=t.type===void 0?"default":t.type;return ie(()=>{this.toasts.find(u=>u.id===i)?this.updateToast({id:i,data:t,type:o,message:n,dismissible:a}):this.addToast({...s,id:i,title:n,dismissible:a,type:o})}),i};dismiss=t=>(ie(()=>{if(t===void 0){this.toasts=this.toasts.map(s=>({...s,dismiss:!0}));return}const n=this.toasts.findIndex(s=>s.id===t);this.toasts[n]&&(this.toasts[n]={...this.toasts[n],dismiss:!0})}),t);remove=t=>{if(t===void 0){this.toasts=[];return}const n=this.#n(t);if(n!==null)return this.toasts.splice(n,1),t};message=(t,n)=>this.create({...n,type:"default",message:t});error=(t,n)=>this.create({...n,type:"error",message:t});success=(t,n)=>this.create({...n,type:"success",message:t});info=(t,n)=>this.create({...n,type:"info",message:t});warning=(t,n)=>this.create({...n,type:"warning",message:t});loading=(t,n)=>this.create({...n,type:"loading",message:t});promise=(t,n)=>{if(!n)return;let s;n.loading!==void 0&&(s=this.create({...n,promise:t,type:"loading",message:typeof n.loading=="string"?n.loading:n.loading()}));const i=t instanceof Promise?t:t();let a=s!==void 0;return i.then(o=>{if(typeof o=="object"&&o&&"ok"in o&&typeof o.ok=="boolean"&&!o.ok){a=!1;const c=ot(o);this.create({id:s,type:"error",message:c})}else if(n.success!==void 0){a=!1;const c=typeof n.success=="function"?n.success(o):n.success;this.create({id:s,type:"success",message:c})}}).catch(o=>{if(n.error!==void 0){a=!1;const c=typeof n.error=="function"?n.error(o):n.error;this.create({id:s,type:"error",message:c})}}).finally(()=>{a&&(this.dismiss(s),s=void 0),n.finally?.()}),s};custom=(t,n)=>{const s=n?.id||ue++;return this.create({component:t,id:s,...n}),s};removeHeight=t=>{this.heights=this.heights.filter(n=>n.toastId!==t)};setHeight=t=>{const n=this.#n(t.toastId);if(n===null){this.heights.push(t);return}this.heights[n]=t};reset=()=>{this.toasts=[],this.heights=[]}}function ot(e){return e&&typeof e=="object"&&"status"in e?`HTTP error! Status: ${e.status}`:`Error! ${e}`}const A=new it;function at(e,t){return A.create({message:e,...t})}class Dt{#e=qe(()=>A.toasts.filter(t=>!t.dismiss));get toasts(){return h(this.#e)}}const lt=at,S=Object.assign(lt,{success:A.success,info:A.info,warning:A.warning,error:A.error,custom:A.custom,message:A.message,promise:A.promise,dismiss:A.dismiss,loading:A.loading,getActiveToasts:()=>A.toasts.filter(e=>!e.dismiss)}),ut=800;function ct(){let e=b(!1),t=b(null),n=b(null),s=null,i=null,a=!1;function o(p,g,m,y){s&&s.repo===p&&s.type===g&&s.id===m?(y.data!==void 0&&(s.payload.data=y.data),y.content!==void 0&&(s.payload.content=y.content)):s={repo:p,type:g,id:m,payload:{...y}},c()}function c(){i&&clearTimeout(i),i=setTimeout(u,ut)}async function u(){if(i=null,!a&&s){const{repo:p,type:g,id:m,payload:y}=s;s=null,a=!0,d(e,!0),d(n,null);try{if(await ae(p,g,m,y),d(t,new Date,!0),y.data?.name){const f=x.repos.find(C=>C.name===p)?.entities.find(C=>C.id===m);f&&(f.title=y.data.name)}}catch(r){d(n,r.message??"Save failed",!0);const f=r.status??r.statusCode;(!f||f>=500)&&(s={repo:p,type:g,id:m,payload:y})}finally{d(e,!1),a=!1,s&&u()}}}function E(){i&&(clearTimeout(i),i=null),s&&u()}async function l(p,g,m,y){d(e,!0),d(n,null);try{const r=await ae(p,g,m,y);return d(t,new Date,!0),r}catch(r){return d(n,r.message??"Save failed",!0),null}finally{d(e,!1)}}function T(){d(n,null),d(t,null),s=null,i&&(clearTimeout(i),i=null)}return{get saving(){return h(e)},get lastSaved(){return h(t)},get error(){return h(n)},get hasPending(){return!!(s||a)},scheduleAutoSave:o,flush:E,saveEntity:l,reset:T}}const ft=ct();let _=null,me=null,ye=null,Ee=[],Y=null,W=1e3,q=b(!1),Te=b(null);const R=new Map,G={},Z={};function ce(e,t){R.delete(e);const n=t.entities.length,s=n===1?`${e} updated ${t.entities[0]}`:`${e} updated ${n} entities`;S(s)}function dt(e){for(const[t,n]of R)n.repo===e&&(clearTimeout(n.timer),R.delete(t))}function pt(e){const t=Ze.user?.displayName;if(e.type==="sync_progress"){const n=G[e.repo];if(n){const s=e.message.trim(),i=s.match(/^Syncing from source:\s*(.+)$/i);i&&(Z[e.repo]=`Syncing ${i[1].trim()}…`);const a=Z[e.repo]??`Syncing ${e.repo}…`;S.loading(a,{id:n,description:s,duration:36e5})}return}if(e.type==="entity_change"){if(t&&e.actor===t&&e.source==="api"){x.refreshEntities(e.repo);return}if(x.refreshEntities(e.repo),V.selectedRepo===e.repo&&V.selectedType===e.entityType&&V.selectedId===e.entityId){ft.hasPending?S(`${e.actor} also saved changes to this entity`):je();return}const s=R.get(e.actor);if(s)clearTimeout(s.timer),s.entities.includes(e.entityId)||s.entities.push(e.entityId),s.timer=setTimeout(()=>ce(e.actor,s),1e4);else{const i={entities:[e.entityId],repo:e.repo,timer:setTimeout(()=>ce(e.actor,i),1e4)};R.set(e.actor,i)}return}if(e.type==="session_commit"){if(t&&e.actor===t){d(Te,e.timestamp,!0);return}const n=e.entities.length,s=n===1?`${e.actor} saved changes to ${e.entities[0]}`:`${e.actor} saved ${n} changes in ${e.repo}`;S(s),x.refreshEntities(e.repo);return}if(e.type==="sync_complete"){if(dt(e.repo),!G[e.repo]){const n=e.created+e.updated+e.deleted,s=n===0?`Sync complete · no changes in ${e.repo}`:`Sync complete · ${n} ${n===1?"entity":"entities"} from ${e.source}`;S.success(s)}x.refreshEntities(e.repo);return}if(e.type==="collection_created"){S(`${e.actor} created collection ${e.repo}`),x.refreshEntities(e.repo);return}if(e.type==="collection_deleted"){S(`${e.actor} deleted collection ${e.repo}`);return}if(e.type==="repo_sync"){S(`${e.actor} pushed to ${e.repo}`),x.refreshEntities(e.repo);return}if(e.type==="presence"){me?.(e);return}if(e.type==="online"){ye?.(e);return}if(e.type==="access_granted"||e.type==="access_revoked"){e.type==="access_revoked"&&V.selectedRepo===e.repo&&V.deselect(),x.load();return}}function _e(){if(typeof window>"u"||_&&(_.readyState===WebSocket.OPEN||_.readyState===WebSocket.CONNECTING))return;const t=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws`;_=new WebSocket(t),_.binaryType="arraybuffer",_.onopen=()=>{d(q,!0),W=1e3,x.refreshAll();for(const n of Ee)n()},_.onmessage=n=>{if(!(n.data instanceof ArrayBuffer))try{const s=JSON.parse(n.data);if(s?.type==="ping"){_?.send(JSON.stringify({type:"pong"}));return}const i=s;i.type&&i.type!=="toast"&&pt(i)}catch{}},_.onclose=()=>{d(q,!1),_=null,Y=setTimeout(()=>{W=Math.min(W*2,1e4),_e()},W)},_.onerror=()=>{}}function ht(){Y&&(clearTimeout(Y),Y=null),_&&(_.close(),_=null),d(q,!1);for(const[,e]of R)clearTimeout(e.timer);R.clear()}function gt(e,t=4e3){S(e,{duration:t})}function mt(e,t){const n=crypto.randomUUID();return t?.loading?S.loading(e,{id:n,duration:36e5}):S(e,{id:n}),n}function yt(e,t,n){if(n?.loading){S.loading(t,{id:e});return}/failed|error/i.test(t)?S.error(t,{id:e,duration:n?.duration??6e3}):S.success(t,{id:e,duration:n?.duration??4e3})}function Et(e){const t=crypto.randomUUID();G[e]=t,S.loading(`Syncing ${e}…`,{id:t,duration:36e5})}function Tt(e,t,n){const s=G[e];s&&(delete G[e],delete Z[e],n?S.error(t,{id:s,duration:6e3}):S.success(t,{id:s,duration:4e3}))}function _t(e){me=e}function St(e){ye=e}function vt(e){Ee.push(e)}function wt(e){_?.readyState===WebSocket.OPEN&&_.send(JSON.stringify(e))}const Ht={get connected(){return h(q)},get lastAutoSaved(){return h(Te)},get ws(){return _},connect:_e,disconnect:ht,showToast:gt,showPersistentToast:mt,updateToast:yt,startSyncToast:Et,finishSyncToast:Tt,send:wt,setPresenceHandler:_t,setOnlineHandler:St,addConnectHandler:vt};export{Dt as S,ft as a,Ot as b,kt as c,Nt as e,xt as i,V as n,Ht as r,A as t};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../nodes/0.B5o3d5X8.js","../chunks/DJKRyj_1.js","../chunks/8FUQuwgM.js","../chunks/CbJfRYJV.js","../chunks/0x0awhVy.js","../chunks/EDLlAC9C.js","../chunks/C7R6dA2m.js","../chunks/D8Tke-Cy.js","../chunks/DLX3YXva.js","../chunks/Bl1mtM70.js","../assets/0.CupILLQs.css","../nodes/1.B5Mts5LU.js","../chunks/DxxhVGi2.js","../nodes/2.Byiqvg8R.js","../chunks/Bxlwy1pA.js","../chunks/BVmVTxxa.js","../assets/AppShell.D3hRAjzT.css","../chunks/pFRFqWMS.js","../assets/ChatPanel.CP-_8txt.css","../assets/2.DRHi7ABa.css","../nodes/3.D_YfR2w4.js","../chunks/DlO1k6-D.js","../chunks/CqkleIqs.js","../assets/3.C-bIa9M8.css","../nodes/4.DzzO-Wza.js","../assets/4.BhKgiXd2.css","../nodes/5.CWHutd51.js","../assets/5.CydFyZSu.css","../nodes/6.CMT_d5RM.js","../assets/6.kqeOo0OW.css","../nodes/7.B_36JWv3.js","../assets/7.CseIx7qQ.css","../nodes/8.7DwRR4iA.js","../assets/8.BYpFDZHK.css"])))=>i.map(i=>d[i]);
2
- import{c as b,_ as u}from"../chunks/DJKRyj_1.js";import{D as y,N as G,g as m,O as N,P as Q,Q as Y,q as B,u as H,a as J,R as K,S as U,f as E,x as W,v as X,F as p,w as Z,z as $,T as P,A as tt}from"../chunks/8FUQuwgM.js";import{h as et,m as rt,u as st,a as h,c as O,f as I,t as at,s as ot}from"../chunks/0x0awhVy.js";import{p as R,i as x,b as A}from"../chunks/CbJfRYJV.js";function nt(a){return class extends it{constructor(t){super({component:a,...t})}}}class it{#e;#t;constructor(t){var s=new Map,n=(e,r)=>{var c=Y(r,!1,!1);return s.set(e,c),c};const i=new Proxy({...t.props||{},$$events:{}},{get(e,r){return m(s.get(r)??n(r,Reflect.get(e,r)))},has(e,r){return r===G?!0:(m(s.get(r)??n(r,Reflect.get(e,r))),Reflect.has(e,r))},set(e,r,c){return y(s.get(r)??n(r,c),c),Reflect.set(e,r,c)}});this.#t=(t.hydrate?et:rt)(t.component,{target:t.target,anchor:t.anchor,props:i,context:t.context,intro:t.intro??!1,recover:t.recover,transformError:t.transformError}),(!t?.props?.$$host||t.sync===!1)&&N(),this.#e=i.$$events;for(const e of Object.keys(this.#t))e==="$set"||e==="$destroy"||e==="$on"||Q(this,e,{get(){return this.#t[e]},set(r){this.#t[e]=r},enumerable:!0});this.#t.$set=e=>{Object.assign(i,e)},this.#t.$destroy=()=>{st(this.#t)}}$set(t){this.#t.$set(t)}$on(t,s){this.#e[t]=this.#e[t]||[];const n=(...i)=>s.call(this,...i);return this.#e[t].push(n),()=>{this.#e[t]=this.#e[t].filter(i=>i!==n)}}$destroy(){this.#t.$destroy()}}const gt={};var ct=I('<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>'),ut=I("<!> <!>",1);function mt(a,t){B(t,!0);let s=R(t,"components",23,()=>[]),n=R(t,"data_0",3,null),i=R(t,"data_1",3,null);H(()=>t.stores.page.set(t.page)),J(()=>{t.stores,t.page,t.constructors,s(),t.form,n(),i(),t.stores.page.notify()});let e=p(!1),r=p(!1),c=p(null);K(()=>{const o=t.stores.page.subscribe(()=>{m(e)&&(y(r,!0),U().then(()=>{y(c,document.title||"untitled page",!0)}))});return y(e,!0),o});const w=P(()=>t.constructors[1]);var D=ut(),L=E(D);{var j=o=>{const _=P(()=>t.constructors[0]);var d=O(),v=E(d);b(v,()=>m(_),(l,f)=>{A(f(l,{get data(){return n()},get form(){return t.form},get params(){return t.page.params},children:(g,dt)=>{var T=O(),M=E(T);b(M,()=>m(w),(q,z)=>{A(z(q,{get data(){return i()},get form(){return t.form},get params(){return t.page.params}}),F=>s()[1]=F,()=>s()?.[1])}),h(g,T)},$$slots:{default:!0}}),g=>s()[0]=g,()=>s()?.[0])}),h(o,d)},k=o=>{const _=P(()=>t.constructors[0]);var d=O(),v=E(d);b(v,()=>m(_),(l,f)=>{A(f(l,{get data(){return n()},get form(){return t.form},get params(){return t.page.params}}),g=>s()[0]=g,()=>s()?.[0])}),h(o,d)};x(L,o=>{t.constructors[1]?o(j):o(k,!1)})}var C=W(L,2);{var S=o=>{var _=ct(),d=Z(_);{var v=l=>{var f=at();tt(()=>ot(f,m(c))),h(l,f)};x(d,l=>{m(r)&&l(v)})}$(_),h(o,_)};x(C,o=>{m(e)&&o(S)})}h(a,D),X()}const Et=nt(mt),yt=[()=>u(()=>import("../nodes/0.B5o3d5X8.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10]),import.meta.url),()=>u(()=>import("../nodes/1.B5Mts5LU.js"),__vite__mapDeps([11,4,2,9,12,7]),import.meta.url),()=>u(()=>import("../nodes/2.Byiqvg8R.js"),__vite__mapDeps([13,4,2,9,3,12,14,5,1,8,7,15,16,17,18,19]),import.meta.url),()=>u(()=>import("../nodes/3.D_YfR2w4.js"),__vite__mapDeps([20,5,2,3,4,1,8,7,14,15,9,12,16,17,18,21,22,23]),import.meta.url),()=>u(()=>import("../nodes/4.DzzO-Wza.js"),__vite__mapDeps([24,5,2,3,4,14,1,8,7,15,9,12,16,25]),import.meta.url),()=>u(()=>import("../nodes/5.CWHutd51.js"),__vite__mapDeps([26,4,2,3,14,5,1,8,7,15,9,12,16,17,18,27]),import.meta.url),()=>u(()=>import("../nodes/6.CMT_d5RM.js"),__vite__mapDeps([28,4,2,3,6,7,5,15,29]),import.meta.url),()=>u(()=>import("../nodes/7.B_36JWv3.js"),__vite__mapDeps([30,4,2,9,12,14,3,5,1,8,7,15,16,21,31]),import.meta.url),()=>u(()=>import("../nodes/8.7DwRR4iA.js"),__vite__mapDeps([32,4,2,3,6,7,5,15,33]),import.meta.url)],bt=[],pt={"/":[2],"/graph":[5],"/login":[6],"/settings":[7],"/setup":[8],"/[repo]/[type]/[id]":[3],"/[repo]/[type]/[id]/edit":[4]},V={handleError:(({error:a})=>{console.error(a)}),reroute:(()=>{}),transport:{}},_t=Object.fromEntries(Object.entries(V.transport).map(([a,t])=>[a,t.decode])),Pt=Object.fromEntries(Object.entries(V.transport).map(([a,t])=>[a,t.encode])),Ot=!1,Rt=(a,t)=>_t[a](t);export{Rt as decode,_t as decoders,pt as dictionary,Pt as encoders,Ot as hash,V as hooks,gt as matchers,yt as nodes,Et as root,bt as server_loads};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../nodes/0.Q3C-jhjE.js","../chunks/DJKRyj_1.js","../chunks/8FUQuwgM.js","../chunks/CbJfRYJV.js","../chunks/0x0awhVy.js","../chunks/EDLlAC9C.js","../chunks/C7R6dA2m.js","../chunks/CIZkRAuY.js","../chunks/glgUBDR2.js","../chunks/Bl1mtM70.js","../assets/0.CupILLQs.css","../nodes/1.BPCfgPXb.js","../chunks/DxxhVGi2.js","../nodes/2.Bdsd2uts.js","../chunks/Scb_NG-a.js","../chunks/BVmVTxxa.js","../assets/AppShell.D3hRAjzT.css","../chunks/DKIqe64p.js","../assets/ChatPanel.CP-_8txt.css","../assets/2.DRHi7ABa.css","../nodes/3.Doh56lgy.js","../chunks/DVuLyxG5.js","../chunks/CqkleIqs.js","../assets/3.C-bIa9M8.css","../nodes/4.CD5YzRYT.js","../assets/4.BhKgiXd2.css","../nodes/5.DN4bEWf-.js","../assets/5.CydFyZSu.css","../nodes/6.BfA9chPb.js","../assets/6.kqeOo0OW.css","../nodes/7.DhU0-U33.js","../assets/7.CseIx7qQ.css","../nodes/8.wSRycWoC.js","../assets/8.BYpFDZHK.css"])))=>i.map(i=>d[i]);
2
+ import{c as b,_ as u}from"../chunks/DJKRyj_1.js";import{D as y,N as G,g as m,O as N,P as Q,Q as Y,q as B,u as H,a as J,R as K,S as U,f as E,x as W,v as X,F as p,w as Z,z as $,T as P,A as tt}from"../chunks/8FUQuwgM.js";import{h as et,m as rt,u as st,a as h,c as O,f as I,t as at,s as ot}from"../chunks/0x0awhVy.js";import{p as R,i as x,b as A}from"../chunks/CbJfRYJV.js";function nt(a){return class extends it{constructor(t){super({component:a,...t})}}}class it{#e;#t;constructor(t){var s=new Map,n=(e,r)=>{var c=Y(r,!1,!1);return s.set(e,c),c};const i=new Proxy({...t.props||{},$$events:{}},{get(e,r){return m(s.get(r)??n(r,Reflect.get(e,r)))},has(e,r){return r===G?!0:(m(s.get(r)??n(r,Reflect.get(e,r))),Reflect.has(e,r))},set(e,r,c){return y(s.get(r)??n(r,c),c),Reflect.set(e,r,c)}});this.#t=(t.hydrate?et:rt)(t.component,{target:t.target,anchor:t.anchor,props:i,context:t.context,intro:t.intro??!1,recover:t.recover,transformError:t.transformError}),(!t?.props?.$$host||t.sync===!1)&&N(),this.#e=i.$$events;for(const e of Object.keys(this.#t))e==="$set"||e==="$destroy"||e==="$on"||Q(this,e,{get(){return this.#t[e]},set(r){this.#t[e]=r},enumerable:!0});this.#t.$set=e=>{Object.assign(i,e)},this.#t.$destroy=()=>{st(this.#t)}}$set(t){this.#t.$set(t)}$on(t,s){this.#e[t]=this.#e[t]||[];const n=(...i)=>s.call(this,...i);return this.#e[t].push(n),()=>{this.#e[t]=this.#e[t].filter(i=>i!==n)}}$destroy(){this.#t.$destroy()}}const gt={};var ct=I('<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>'),ut=I("<!> <!>",1);function mt(a,t){B(t,!0);let s=R(t,"components",23,()=>[]),n=R(t,"data_0",3,null),i=R(t,"data_1",3,null);H(()=>t.stores.page.set(t.page)),J(()=>{t.stores,t.page,t.constructors,s(),t.form,n(),i(),t.stores.page.notify()});let e=p(!1),r=p(!1),c=p(null);K(()=>{const o=t.stores.page.subscribe(()=>{m(e)&&(y(r,!0),U().then(()=>{y(c,document.title||"untitled page",!0)}))});return y(e,!0),o});const w=P(()=>t.constructors[1]);var D=ut(),L=E(D);{var j=o=>{const _=P(()=>t.constructors[0]);var d=O(),v=E(d);b(v,()=>m(_),(l,f)=>{A(f(l,{get data(){return n()},get form(){return t.form},get params(){return t.page.params},children:(g,dt)=>{var T=O(),M=E(T);b(M,()=>m(w),(q,z)=>{A(z(q,{get data(){return i()},get form(){return t.form},get params(){return t.page.params}}),F=>s()[1]=F,()=>s()?.[1])}),h(g,T)},$$slots:{default:!0}}),g=>s()[0]=g,()=>s()?.[0])}),h(o,d)},k=o=>{const _=P(()=>t.constructors[0]);var d=O(),v=E(d);b(v,()=>m(_),(l,f)=>{A(f(l,{get data(){return n()},get form(){return t.form},get params(){return t.page.params}}),g=>s()[0]=g,()=>s()?.[0])}),h(o,d)};x(L,o=>{t.constructors[1]?o(j):o(k,!1)})}var C=W(L,2);{var S=o=>{var _=ct(),d=Z(_);{var v=l=>{var f=at();tt(()=>ot(f,m(c))),h(l,f)};x(d,l=>{m(r)&&l(v)})}$(_),h(o,_)};x(C,o=>{m(e)&&o(S)})}h(a,D),X()}const Et=nt(mt),yt=[()=>u(()=>import("../nodes/0.Q3C-jhjE.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10]),import.meta.url),()=>u(()=>import("../nodes/1.BPCfgPXb.js"),__vite__mapDeps([11,4,2,9,12,7]),import.meta.url),()=>u(()=>import("../nodes/2.Bdsd2uts.js"),__vite__mapDeps([13,4,2,9,3,12,14,5,1,8,7,15,16,17,18,19]),import.meta.url),()=>u(()=>import("../nodes/3.Doh56lgy.js"),__vite__mapDeps([20,5,2,3,4,1,8,7,14,15,9,12,16,17,18,21,22,23]),import.meta.url),()=>u(()=>import("../nodes/4.CD5YzRYT.js"),__vite__mapDeps([24,5,2,3,4,14,1,8,7,15,9,12,16,25]),import.meta.url),()=>u(()=>import("../nodes/5.DN4bEWf-.js"),__vite__mapDeps([26,4,2,3,14,5,1,8,7,15,9,12,16,17,18,27]),import.meta.url),()=>u(()=>import("../nodes/6.BfA9chPb.js"),__vite__mapDeps([28,4,2,3,6,7,5,15,29]),import.meta.url),()=>u(()=>import("../nodes/7.DhU0-U33.js"),__vite__mapDeps([30,4,2,9,12,14,3,5,1,8,7,15,16,21,31]),import.meta.url),()=>u(()=>import("../nodes/8.wSRycWoC.js"),__vite__mapDeps([32,4,2,3,6,7,5,15,33]),import.meta.url)],bt=[],pt={"/":[2],"/graph":[5],"/login":[6],"/settings":[7],"/setup":[8],"/[repo]/[type]/[id]":[3],"/[repo]/[type]/[id]/edit":[4]},V={handleError:(({error:a})=>{console.error(a)}),reroute:(()=>{}),transport:{}},_t=Object.fromEntries(Object.entries(V.transport).map(([a,t])=>[a,t.decode])),Pt=Object.fromEntries(Object.entries(V.transport).map(([a,t])=>[a,t.encode])),Ot=!1,Rt=(a,t)=>_t[a](t);export{Rt as decode,_t as decoders,pt as dictionary,Pt as encoders,Ot as hash,V as hooks,gt as matchers,yt as nodes,Et as root,bt as server_loads};
@@ -0,0 +1 @@
1
+ import{l as o,a as r}from"../chunks/CIZkRAuY.js";export{o as load_css,r as start};
@@ -1,5 +1,5 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../chunks/BaUG0bh_.js","../chunks/DJKRyj_1.js","../chunks/8FUQuwgM.js","../chunks/CbJfRYJV.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{c as Nt,_ as jt}from"../chunks/DJKRyj_1.js";import{a as s,f as rt,q as Qt,o as xt,g as qt,e as an,c as y,j as sn,t as Re,s as ie,r as Ut}from"../chunks/0x0awhVy.js";import{q as ht,w as it,z as $,A as nt,v as mt,br as cn,t as He,bs as Pe,F as B,a7 as Rt,a as ct,D as c,g as e,b as Xt,R as Ce,x as Mt,T as m,aF as J,f as g,u as Ge,bt as De,bp as ln,B as un,$ as dn}from"../chunks/8FUQuwgM.js";import{j as _t,s as bt,g as A,i as Se,e as U,d as Me,S as fn,a as re,w as We}from"../chunks/EDLlAC9C.js";import{h as hn}from"../chunks/C7R6dA2m.js";import{g as Ee}from"../chunks/D8Tke-Cy.js";import{e as le,t as Z,c as yt,S as mn,b as gn,i as vn,n as wn,r as Fe}from"../chunks/DLX3YXva.js";import{p as k,i as L,b as Qe,s as kt,r as Ct}from"../chunks/CbJfRYJV.js";import"../chunks/Bl1mtM70.js";const yn=Array(12).fill(0);var _n=rt('<div class="sonner-loading-bar"></div>'),bn=rt('<div><div class="sonner-spinner"></div></div>');function xn(n,t){ht(t,!0);var o=bn(),i=it(o);le(i,23,()=>yn,(r,u)=>`spinner-bar-${u}`,(r,u)=>{var a=_n();s(r,a)}),$(i),$(o),nt(r=>{bt(o,1,r),A(o,"data-visible",t.visible)},[()=>_t(["sonner-loading-wrapper",t.class].filter(Boolean).join(" "))]),s(n,o),mt()}const In=typeof window<"u"?window:void 0;function Tn(n){let t=n.activeElement;for(;t?.shadowRoot;){const o=t.shadowRoot.activeElement;if(o===t)break;t=o}return t}class Sn{#e;#t;constructor(t,o){this.#e=t,this.#t=Qt(o)}get current(){return this.#t(),this.#e()}}const En=/\(.+\)/,An=new Set(["all","print","screen","and","or","not","only"]);class kn extends Sn{constructor(t,o){let i=En.test(t)||t.split(/[\s,]+/).some(u=>An.has(u.trim()))?t:`(${t})`;const r=window.matchMedia(i);super(()=>r.matches,u=>xt(r,"change",u))}}let Bn=class{#e;#t;constructor(t={}){const{window:o=In,document:i=o?.document}=t;o!==void 0&&(this.#e=i,this.#t=Qt(r=>{const u=xt(o,"focusin",r),a=xt(o,"focusout",r);return()=>{u(),a()}}))}get current(){return this.#t?.(),this.#e?Tn(this.#e):null}};new Bn;class Pn{#e;#t;constructor(t){this.#e=t,this.#t=Symbol(t)}get key(){return this.#t}exists(){return cn(this.#t)}get(){const t=He(this.#t);if(t===void 0)throw new Error(`Context "${this.#e}" not found`);return t}getOr(t){const o=He(this.#t);return o===void 0?t:o}set(t){return Pe(this.#t,t)}}const Mn=new Pn("<Toaster/>");function ae(n){return n.label!==void 0}function Cn(){let n=B(Rt(typeof document<"u"?document.hidden:!1));return ct(()=>xt(document,"visibilitychange",()=>{c(n,document.hidden,!0)})),{get current(){return e(n)}}}const Ve=4e3,Dn=14,Ln=45,On=200,zn=.05,Nn={toast:"",title:"",description:"",loader:"",closeButton:"",cancelButton:"",actionButton:"",action:"",warning:"",error:"",success:"",default:"",info:"",loading:""};function Rn(n){const[t,o]=n.split("-"),i=[];return t&&i.push(t),o&&i.push(o),i}function je(n){return 1/(1.5+Math.abs(n)/20)}var Hn=rt("<div><!></div>"),Wn=rt('<button data-close-button=""><!></button>'),Fn=rt('<div data-icon=""><!> <!></div>'),Vn=rt('<div data-description=""><!></div>'),jn=rt('<button data-button="" data-cancel=""> </button>'),qn=rt('<button data-button=""> </button>'),Un=rt('<!> <div data-content=""><div data-title=""><!></div> <!></div> <!> <!>',1),Kn=rt('<li aria-atomic="true" data-sonner-toast=""><!> <!></li>');function Yn(n,t){ht(t,!0);const o=h=>{var w=y(),T=g(w);{var M=E=>{var K=Hn(),zt=it(K);U(zt,()=>t.loadingIcon),$(K),nt(Yt=>{bt(K,1,Yt),A(K,"data-visible",e(z)==="loading")},[()=>_t(yt(e(ot)?.loader,t.toast?.classes?.loader,"sonner-loader"))]),s(E,K)},C=E=>{{let K=m(()=>yt(e(ot)?.loader,t.toast.classes?.loader)),zt=m(()=>e(z)==="loading");xn(E,{get class(){return e(K)},get visible(){return e(zt)}})}};L(T,E=>{t.loadingIcon?E(M):E(C,!1)})}s(h,w)};let i=k(t,"cancelButtonStyle",3,""),r=k(t,"actionButtonStyle",3,""),u=k(t,"descriptionClass",3,""),a=k(t,"unstyled",3,!1),_=k(t,"defaultRichColors",3,!1);const v={...Nn};let P=B(!1),O=B(!1),at=B(!1),j=B(!1),st=B(!1),R=B(0),tt=B(0),lt=t.toast.duration||t.duration||Ve,X=B(void 0),q=B(null),Ht=B(null);const de=m(()=>t.index===0),fe=m(()=>t.index+1<=t.visibleToasts),z=m(()=>t.toast.type),et=m(()=>t.toast.dismissible!==void 0?t.toast.dismissible!==!1:t.toast.dismissable!==!1),Wt=m(()=>t.toast.class||""),Dt=m(()=>t.toast.descriptionClass||""),It=m(()=>Z.heights.findIndex(h=>h.toastId===t.toast.id)||0),Tt=m(()=>t.toast.closeButton??t.closeButton),Lt=m(()=>t.toast.duration??t.duration??Ve);let Bt=null;const pt=m(()=>t.position.split("-")),he=m(()=>Z.heights.reduce((h,w,T)=>T>=e(It)?h:h+w.height,0)),me=Cn(),ge=m(()=>t.toast.invert||t.invert),Kt=m(()=>e(z)==="loading"),ot=m(()=>({...v,...t.classes})),ve=m(()=>t.toast.title),we=m(()=>t.toast.description);let St=B(0),$t=B(0);const Ft=m(()=>Math.round(e(It)*Dn+e(he)));ct(()=>{e(ve),e(we);let h;t.expanded||t.expandByDefault?h=1:h=1-t.index*zn;const w=Xt(()=>e(X));if(w===void 0)return;w.style.setProperty("height","auto");const T=w.offsetHeight,M=w.getBoundingClientRect().height,C=Math.round(M/h+Number.EPSILON&100)/100;w.style.removeProperty("height");let E;Math.abs(C-T)<1?E=C:E=T,c(tt,E,!0),Z.setHeight({toastId:t.toast.id,height:E})});function l(){c(O,!0),c(R,e(Ft),!0),Z.removeHeight(t.toast.id),setTimeout(()=>{Z.remove(t.toast.id)},On)}let H;const gt=m(()=>t.toast.promise&&e(z)==="loading"||t.toast.duration===Number.POSITIVE_INFINITY);function vt(){c(St,new Date().getTime(),!0),H=setTimeout(()=>{t.toast.onAutoClose?.(t.toast),l()},lt)}function Ot(){if(e($t)<e(St)){const h=new Date().getTime()-e(St);lt=lt-h}c($t,new Date().getTime(),!0)}ct(()=>{t.toast.updated&&(clearTimeout(H),lt=e(Lt),vt())}),ct(()=>(e(gt)||(t.expanded||t.interacting||t.pauseWhenPageIsHidden&&me.current?Ot():vt()),()=>clearTimeout(H))),Ce(()=>{c(P,!0);const h=e(X)?.getBoundingClientRect().height;return c(tt,h,!0),Z.setHeight({toastId:t.toast.id,height:h}),()=>{Z.removeHeight(t.toast.id)}}),ct(()=>{t.toast.delete&&Xt(()=>{l(),t.toast.onDismiss?.(t.toast)})});const ye=h=>{if(e(Kt))return;c(R,e(Ft),!0);const w=h.target;w.setPointerCapture(h.pointerId),w.tagName!=="BUTTON"&&(c(at,!0),Bt={x:h.clientX,y:h.clientY})},ze=()=>{if(e(j)||!e(et))return;Bt=null;const h=Number(e(X)?.style.getPropertyValue("--swipe-amount-x").replace("px","")||0),w=Number(e(X)?.style.getPropertyValue("--swipe-amount-y").replace("px","")||0),T=new Date().getTime()-0,M=e(q)==="x"?h:w,C=Math.abs(M)/T;if(Math.abs(M)>=Ln||C>.11){c(R,e(Ft),!0),t.toast.onDismiss?.(t.toast),e(q)==="x"?c(Ht,h>0?"right":"left",!0):c(Ht,w>0?"down":"up",!0),l(),c(j,!0);return}else e(X)?.style.setProperty("--swipe-amount-x","0px"),e(X)?.style.setProperty("--swipe-amount-y","0px");c(st,!1),c(at,!1),c(q,null)},te=h=>{if(!Bt||!e(et)||(window.getSelection()?.toString().length??-1)>0)return;const T=h.clientY-Bt.y,M=h.clientX-Bt.x,C=t.swipeDirections??Rn(t.position);!e(q)&&(Math.abs(M)>1||Math.abs(T)>1)&&c(q,Math.abs(M)>Math.abs(T)?"x":"y",!0);let E={x:0,y:0};if(e(q)==="y"){if(C.includes("top")||C.includes("bottom"))if(C.includes("top")&&T<0||C.includes("bottom")&&T>0)E.y=T;else{const K=T*je(T);E.y=Math.abs(K)<Math.abs(T)?K:T}}else if(e(q)==="x"&&(C.includes("left")||C.includes("right")))if(C.includes("left")&&M<0||C.includes("right")&&M>0)E.x=M;else{const K=M*je(M);E.x=Math.abs(K)<Math.abs(M)?K:M}(Math.abs(E.x)>0||Math.abs(E.y)>0)&&c(st,!0),e(X)?.style.setProperty("--swipe-amount-x",`${E.x}px`),e(X)?.style.setProperty("--swipe-amount-y",`${E.y}px`)},wt=()=>{c(at,!1),c(q,null),Bt=null},Et=m(()=>t.toast.icon?t.toast.icon:e(z)==="success"?t.successIcon:e(z)==="error"?t.errorIcon:e(z)==="warning"?t.warningIcon:e(z)==="info"?t.infoIcon:e(z)==="loading"?t.loadingIcon:null);var f=Kn();A(f,"tabindex",0);let Vt;var ee=it(f);{var Ne=h=>{var w=Wn(),T=it(w);U(T,()=>t.closeIcon??J),$(w),nt(M=>{A(w,"aria-label",t.closeButtonAriaLabel),A(w,"data-disabled",e(Kt)),bt(w,1,M)},[()=>_t(yt(e(ot)?.closeButton,t.toast?.classes?.closeButton))]),qt("click",w,()=>{e(Kt)||!e(et)||(l(),t.toast.onDismiss?.(t.toast))}),s(h,w)};L(ee,h=>{e(Tt)&&!t.toast.component&&e(z)!=="loading"&&t.closeIcon!==null&&h(Ne)})}var _e=Mt(ee,2);{var be=h=>{const w=m(()=>t.toast.component);var T=y(),M=g(T);Nt(M,()=>e(w),(C,E)=>{E(C,kt(()=>t.toast.componentProps,{closeToast:l}))}),s(h,T)},xe=h=>{var w=Un(),T=g(w);{var M=x=>{var S=Fn(),d=it(S);{var D=b=>{var I=y(),p=g(I);{var W=Pt=>{var oe=y(),Te=g(oe);Nt(Te,()=>t.toast.icon,(Y,Q)=>{Q(Y,{})}),s(Pt,oe)},ft=Pt=>{o(Pt)};L(p,Pt=>{t.toast.icon?Pt(W):Pt(ft,!1)})}s(b,I)};L(d,b=>{(t.toast.promise||e(z)==="loading")&&b(D)})}var V=Mt(d,2);{var N=b=>{var I=y(),p=g(I);{var W=Y=>{var Q=y(),At=g(Q);Nt(At,()=>t.toast.icon,(on,rn)=>{rn(on,{})}),s(Y,Q)},ft=Y=>{var Q=y(),At=g(Q);U(At,()=>t.successIcon??J),s(Y,Q)},Pt=Y=>{var Q=y(),At=g(Q);U(At,()=>t.errorIcon??J),s(Y,Q)},oe=Y=>{var Q=y(),At=g(Q);U(At,()=>t.warningIcon??J),s(Y,Q)},Te=Y=>{var Q=y(),At=g(Q);U(At,()=>t.infoIcon??J),s(Y,Q)};L(p,Y=>{t.toast.icon?Y(W):e(z)==="success"?Y(ft,1):e(z)==="error"?Y(Pt,2):e(z)==="warning"?Y(oe,3):e(z)==="info"&&Y(Te,4)})}s(b,I)};L(V,b=>{t.toast.type!=="loading"&&b(N)})}$(S),nt(b=>bt(S,1,b),[()=>_t(yt(e(ot)?.icon,t.toast?.classes?.icon))]),s(x,S)};L(T,x=>{(e(z)||t.toast.icon||t.toast.promise)&&t.toast.icon!==null&&(e(Et)!==null||t.toast.icon)&&x(M)})}var C=Mt(T,2),E=it(C),K=it(E);{var zt=x=>{var S=y(),d=g(S);{var D=N=>{const b=m(()=>t.toast.title);var I=y(),p=g(I);Nt(p,()=>e(b),(W,ft)=>{ft(W,kt(()=>t.toast.componentProps))}),s(N,I)},V=N=>{var b=Re();nt(()=>ie(b,t.toast.title)),s(N,b)};L(d,N=>{typeof t.toast.title!="string"?N(D):N(V,!1)})}s(x,S)};L(K,x=>{t.toast.title&&x(zt)})}$(E);var Yt=Mt(E,2);{var Ie=x=>{var S=Vn(),d=it(S);{var D=N=>{const b=m(()=>t.toast.description);var I=y(),p=g(I);Nt(p,()=>e(b),(W,ft)=>{ft(W,kt(()=>t.toast.componentProps))}),s(N,I)},V=N=>{var b=Re();nt(()=>ie(b,t.toast.description)),s(N,b)};L(d,N=>{typeof t.toast.description!="string"?N(D):N(V,!1)})}$(S),nt(N=>bt(S,1,N),[()=>_t(yt(u(),e(Dt),e(ot)?.description,t.toast.classes?.description))]),s(x,S)};L(Yt,x=>{t.toast.description&&x(Ie)})}$(C);var ne=Mt(C,2);{var ut=x=>{var S=y(),d=g(S);{var D=b=>{var I=y(),p=g(I);Nt(p,()=>t.toast.cancel,(W,ft)=>{ft(W,{})}),s(b,I)},V=b=>{var I=jn(),p=it(I,!0);$(I),nt(W=>{Se(I,t.toast.cancelButtonStyle??i()),bt(I,1,W),ie(p,t.toast.cancel.label)},[()=>_t(yt(e(ot)?.cancelButton,t.toast?.classes?.cancelButton))]),qt("click",I,W=>{ae(t.toast.cancel)&&e(et)&&(t.toast.cancel?.onClick?.(W),l())}),s(b,I)},N=m(()=>ae(t.toast.cancel));L(d,b=>{typeof t.toast.cancel=="function"?b(D):e(N)&&b(V,1)})}s(x,S)};L(ne,x=>{t.toast.cancel&&x(ut)})}var G=Mt(ne,2);{var dt=x=>{var S=y(),d=g(S);{var D=b=>{var I=y(),p=g(I);Nt(p,()=>t.toast.action,(W,ft)=>{ft(W,{})}),s(b,I)},V=b=>{var I=qn(),p=it(I,!0);$(I),nt(W=>{Se(I,t.toast.actionButtonStyle??r()),bt(I,1,W),ie(p,t.toast.action.label)},[()=>_t(yt(e(ot)?.actionButton,t.toast?.classes?.actionButton))]),qt("click",I,W=>{ae(t.toast.action)&&(t.toast.action?.onClick(W),!W.defaultPrevented&&l())}),s(b,I)},N=m(()=>ae(t.toast.action));L(d,b=>{typeof t.toast.action=="function"?b(D):e(N)&&b(V,1)})}s(x,S)};L(G,x=>{t.toast.action&&x(dt)})}nt((x,S)=>{bt(C,1,x),bt(E,1,S)},[()=>_t(yt(e(ot)?.content,t.toast?.classes?.content)),()=>_t(yt(e(ot)?.title,t.toast?.classes?.title))]),s(h,w)};L(_e,h=>{t.toast.component?h(be):h(xe,!1)})}$(f),Qe(f,h=>c(X,h),()=>e(X)),nt((h,w,T)=>{bt(f,1,h),A(f,"aria-live",t.toast.important?"assertive":"polite"),A(f,"data-rich-colors",t.toast.richColors??_()),A(f,"data-styled",!(t.toast.component||t.toast.unstyled||a())),A(f,"data-mounted",e(P)),A(f,"data-promise",w),A(f,"data-swiped",e(st)),A(f,"data-removed",e(O)),A(f,"data-visible",e(fe)),A(f,"data-y-position",e(pt)[0]),A(f,"data-x-position",e(pt)[1]),A(f,"data-index",t.index),A(f,"data-front",e(de)),A(f,"data-swiping",e(at)),A(f,"data-dismissible",e(et)),A(f,"data-type",e(z)),A(f,"data-invert",e(ge)),A(f,"data-swipe-out",e(j)),A(f,"data-swipe-direction",e(Ht)),A(f,"data-expanded",T),Vt=Se(f,`${t.style} ${t.toast.style}`,Vt,{"--index":t.index,"--toasts-before":t.index,"--z-index":Z.toasts.length-t.index,"--offset":`${e(O)?e(R):e(Ft)}px`,"--initial-height":t.expandByDefault?"auto":`${e(tt)}px`})},[()=>_t(yt(t.class,e(Wt),e(ot)?.toast,t.toast?.classes?.toast,e(ot)?.[e(z)],t.toast?.classes?.[e(z)])),()=>!!t.toast.promise,()=>!!(t.expanded||t.expandByDefault&&e(P))]),qt("pointermove",f,te),qt("pointerup",f,ze),qt("pointerdown",f,ye),an("dragend",f,wt),s(n,f),mt()}sn(["pointermove","pointerup","pointerdown","click"]);var Zn=Ut('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" height="20" width="20" data-sonner-success-icon=""><path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z" clip-rule="evenodd"></path></svg>');function Xn(n){var t=Zn();s(n,t)}var Gn=Ut('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" height="20" width="20" data-sonner-error-icon=""><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z" clip-rule="evenodd"></path></svg>');function Qn(n){var t=Gn();s(n,t)}var Jn=Ut('<svg viewBox="0 0 64 64" fill="currentColor" height="20" width="20" data-sonner-warning-icon="" xmlns="http://www.w3.org/2000/svg"><path d="M32.427,7.987c2.183,0.124 4,1.165 5.096,3.281l17.936,36.208c1.739,3.66 -0.954,8.585 -5.373,8.656l-36.119,0c-4.022,-0.064 -7.322,-4.631 -5.352,-8.696l18.271,-36.207c0.342,-0.65 0.498,-0.838 0.793,-1.179c1.186,-1.375 2.483,-2.111 4.748,-2.063Zm-0.295,3.997c-0.687,0.034 -1.316,0.419 -1.659,1.017c-6.312,11.979 -12.397,24.081 -18.301,36.267c-0.546,1.225 0.391,2.797 1.762,2.863c12.06,0.195 24.125,0.195 36.185,0c1.325,-0.064 2.321,-1.584 1.769,-2.85c-5.793,-12.184 -11.765,-24.286 -17.966,-36.267c-0.366,-0.651 -0.903,-1.042 -1.79,-1.03Z"></path><path d="M33.631,40.581l-3.348,0l-0.368,-16.449l4.1,0l-0.384,16.449Zm-3.828,5.03c0,-0.609 0.197,-1.113 0.592,-1.514c0.396,-0.4 0.935,-0.601 1.618,-0.601c0.684,0 1.223,0.201 1.618,0.601c0.395,0.401 0.593,0.905 0.593,1.514c0,0.587 -0.193,1.078 -0.577,1.473c-0.385,0.395 -0.929,0.593 -1.634,0.593c-0.705,0 -1.249,-0.198 -1.634,-0.593c-0.384,-0.395 -0.576,-0.886 -0.576,-1.473Z"></path></svg>');function pn(n){var t=Jn();s(n,t)}var $n=Ut('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" height="20" width="20" data-sonner-info-icon=""><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z" clip-rule="evenodd"></path></svg>');function to(n){var t=$n();s(n,t)}var eo=Ut('<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" data-sonner-close-icon=""><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg>');function no(n){var t=eo();s(n,t)}const oo=3,Je="24px",pe="16px",io=4e3,ro=356,ao=14,Ae="dark",se="light";function so(n,t){const o={};return[n,t].forEach((i,r)=>{const u=r===1,a=u?"--mobile-offset":"--offset",_=u?pe:Je;function v(P){["top","right","bottom","left"].forEach(O=>{o[`${a}-${O}`]=typeof P=="number"?`${P}px`:P})}typeof i=="number"||typeof i=="string"?v(i):typeof i=="object"?["top","right","bottom","left"].forEach(P=>{const O=i[P];O===void 0?o[`${a}-${P}`]=_:o[`${a}-${P}`]=typeof O=="number"?`${O}px`:O}):v(_)}),o}var co=rt("<ol></ol>"),lo=rt('<section aria-live="polite" aria-relevant="additions text" aria-atomic="false" class="svelte-nbs0zk"><!></section>');function uo(n,t){ht(t,!0);function o(l){return l!=="system"?l:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?Ae:se}let i=k(t,"invert",3,!1),r=k(t,"position",3,"bottom-right"),u=k(t,"hotkey",19,()=>["altKey","KeyT"]),a=k(t,"expand",3,!1),_=k(t,"closeButton",3,!1),v=k(t,"offset",3,Je),P=k(t,"mobileOffset",3,pe),O=k(t,"theme",3,"light"),at=k(t,"richColors",3,!1),j=k(t,"duration",3,io),st=k(t,"visibleToasts",3,oo),R=k(t,"toastOptions",19,()=>({})),tt=k(t,"dir",7,"auto"),lt=k(t,"gap",3,ao),X=k(t,"pauseWhenPageIsHidden",3,!1),q=k(t,"containerAriaLabel",3,"Notifications"),Ht=k(t,"closeButtonAriaLabel",3,"Close toast"),de=Ct(t,["$$slots","$$events","$$legacy","invert","position","hotkey","expand","closeButton","offset","mobileOffset","theme","richColors","duration","visibleToasts","toastOptions","dir","gap","pauseWhenPageIsHidden","loadingIcon","successIcon","errorIcon","warningIcon","closeIcon","infoIcon","containerAriaLabel","class","closeButtonAriaLabel","onblur","onfocus","onmouseenter","onmousemove","onmouseleave","ondragend","onpointerdown","onpointerup"]);function fe(){if(tt()!=="auto")return tt();if(typeof window>"u"||typeof document>"u")return"ltr";const l=document.documentElement.getAttribute("dir");return l==="auto"||!l?(Xt(()=>tt(window.getComputedStyle(document.documentElement).direction??"ltr")),tt()):(Xt(()=>tt(l)),l)}const z=m(()=>Array.from(new Set([r(),...Z.toasts.filter(l=>l.position).map(l=>l.position)].filter(Boolean))));let et=B(!1),Wt=B(!1),Dt=B(Rt(o(O()))),It=B(void 0),Tt=B(null),Lt=B(!1);const Bt=m(()=>u().join("+").replace(/Key/g,"").replace(/Digit/g,""));ct(()=>{Z.toasts.length<=1&&c(et,!1)}),ct(()=>{const l=Z.toasts.filter(H=>H.dismiss&&!H.delete);if(l.length>0){const H=Z.toasts.map(gt=>l.find(Ot=>Ot.id===gt.id)?{...gt,delete:!0}:gt);Z.toasts=H}}),ct(()=>()=>{e(It)&&e(Tt)&&(e(Tt).focus({preventScroll:!0}),c(Tt,null),c(Lt,!1))}),Ce(()=>(Z.reset(),xt(document,"keydown",H=>{u().every(vt=>H[vt]||H.code===vt)&&(c(et,!0),e(It)?.focus()),H.code==="Escape"&&(document.activeElement===e(It)||e(It)?.contains(document.activeElement))&&c(et,!1)}))),ct(()=>{if(O()!=="system"&&c(Dt,O()),typeof window<"u"){O()==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?c(Dt,Ae):c(Dt,se));const l=window.matchMedia("(prefers-color-scheme: dark)"),H=({matches:gt})=>{O()==="system"&&c(Dt,gt?Ae:se,!0)};"addEventListener"in l?l.addEventListener("change",H):l.addListener(H)}});const pt=l=>{t.onblur?.(l),e(Lt)&&!l.currentTarget.contains(l.relatedTarget)&&(c(Lt,!1),e(Tt)&&(e(Tt).focus({preventScroll:!0}),c(Tt,null)))},he=l=>{t.onfocus?.(l),!(l.target instanceof HTMLElement&&l.target.dataset.dismissible==="false")&&(e(Lt)||(c(Lt,!0),c(Tt,l.relatedTarget,!0)))},me=l=>{t.onpointerdown?.(l),!(l.target instanceof HTMLElement&&l.target.dataset.dismissible==="false")&&c(Wt,!0)},ge=l=>{t.onmouseenter?.(l),c(et,!0)},Kt=l=>{t.onmouseleave?.(l),e(Wt)||c(et,!1)},ot=l=>{t.onmousemove?.(l),c(et,!0)},ve=l=>{t.ondragend?.(l),c(et,!1)},we=l=>{t.onpointerup?.(l),c(Wt,!1)};Mn.set(new mn);var St=lo();A(St,"tabindex",-1);var $t=it(St);{var Ft=l=>{var H=y(),gt=g(H);le(gt,18,()=>e(z),vt=>vt,(vt,Ot,ye,ze)=>{const te=m(()=>{const[f,Vt]=Ot.split("-");return{y:f,x:Vt}}),wt=m(()=>so(v(),P()));var Et=co();Me(Et,f=>({tabindex:-1,dir:f,class:t.class,"data-sonner-toaster":!0,"data-sonner-theme":e(Dt),"data-y-position":e(te).y,"data-x-position":e(te).x,style:t.style,onblur:pt,onfocus:he,onmouseenter:ge,onmousemove:ot,onmouseleave:Kt,ondragend:ve,onpointerdown:me,onpointerup:we,...de,[fn]:{"--front-toast-height":`${Z.heights[0]?.height}px`,"--width":`${ro}px`,"--gap":`${lt()}px`,"--offset-top":e(wt)["--offset-top"],"--offset-right":e(wt)["--offset-right"],"--offset-bottom":e(wt)["--offset-bottom"],"--offset-left":e(wt)["--offset-left"],"--mobile-offset-top":e(wt)["--mobile-offset-top"],"--mobile-offset-right":e(wt)["--mobile-offset-right"],"--mobile-offset-bottom":e(wt)["--mobile-offset-bottom"],"--mobile-offset-left":e(wt)["--mobile-offset-left"]}}),[fe],void 0,void 0,"svelte-nbs0zk"),le(Et,23,()=>Z.toasts.filter(f=>!f.position&&e(ye)===0||f.position===Ot),f=>f.id,(f,Vt,ee,Ne)=>{{const _e=ut=>{var G=y(),dt=g(G);{var x=d=>{var D=y(),V=g(D);U(V,()=>t.successIcon??J),s(d,D)},S=d=>{Xn(d)};L(dt,d=>{t.successIcon?d(x):t.successIcon!==null&&d(S,1)})}s(ut,G)},be=ut=>{var G=y(),dt=g(G);{var x=d=>{var D=y(),V=g(D);U(V,()=>t.errorIcon??J),s(d,D)},S=d=>{Qn(d)};L(dt,d=>{t.errorIcon?d(x):t.errorIcon!==null&&d(S,1)})}s(ut,G)},xe=ut=>{var G=y(),dt=g(G);{var x=d=>{var D=y(),V=g(D);U(V,()=>t.warningIcon??J),s(d,D)},S=d=>{pn(d)};L(dt,d=>{t.warningIcon?d(x):t.warningIcon!==null&&d(S,1)})}s(ut,G)},h=ut=>{var G=y(),dt=g(G);{var x=d=>{var D=y(),V=g(D);U(V,()=>t.infoIcon??J),s(d,D)},S=d=>{to(d)};L(dt,d=>{t.infoIcon?d(x):t.infoIcon!==null&&d(S,1)})}s(ut,G)},w=ut=>{var G=y(),dt=g(G);{var x=d=>{var D=y(),V=g(D);U(V,()=>t.closeIcon??J),s(d,D)},S=d=>{no(d)};L(dt,d=>{t.closeIcon?d(x):t.closeIcon!==null&&d(S,1)})}s(ut,G)};let T=m(()=>R()?.duration??j()),M=m(()=>R()?.class??""),C=m(()=>R()?.descriptionClass||""),E=m(()=>R()?.style??""),K=m(()=>R().classes||{}),zt=m(()=>R().unstyled??!1),Yt=m(()=>R()?.cancelButtonStyle??""),Ie=m(()=>R()?.actionButtonStyle??""),ne=m(()=>R()?.closeButtonAriaLabel??Ht());Yn(f,{get index(){return e(ee)},get toast(){return e(Vt)},get defaultRichColors(){return at()},get duration(){return e(T)},get class(){return e(M)},get descriptionClass(){return e(C)},get invert(){return i()},get visibleToasts(){return st()},get closeButton(){return _()},get interacting(){return e(Wt)},get position(){return Ot},get style(){return e(E)},get classes(){return e(K)},get unstyled(){return e(zt)},get cancelButtonStyle(){return e(Yt)},get actionButtonStyle(){return e(Ie)},get closeButtonAriaLabel(){return e(ne)},get expandByDefault(){return a()},get expanded(){return e(et)},get pauseWhenPageIsHidden(){return X()},get loadingIcon(){return t.loadingIcon},successIcon:_e,errorIcon:be,warningIcon:xe,infoIcon:h,closeIcon:w,$$slots:{successIcon:!0,errorIcon:!0,warningIcon:!0,infoIcon:!0,closeIcon:!0}})}}),$(Et),Qe(Et,f=>c(It,f),()=>e(It)),nt(()=>Et.dir=Et.dir),s(vt,Et)}),s(l,H)};L($t,l=>{Z.toasts.length>0&&l(Ft)})}$(St),nt(()=>A(St,"aria-label",`${q()??""} ${e(Bt)??""}`)),s(n,St),mt()}const $e=typeof window<"u"?window:void 0;function fo(n){let t=n.activeElement;for(;t?.shadowRoot;){const o=t.shadowRoot.activeElement;if(o===t)break;t=o}return t}let ho=class{#e;#t;constructor(t={}){const{window:o=$e,document:i=o?.document}=t;o!==void 0&&(this.#e=i,this.#t=Qt(r=>{const u=xt(o,"focusin",r),a=xt(o,"focusout",r);return()=>{u(),a()}}))}get current(){return this.#t?.(),this.#e?fo(this.#e):null}};new ho;function mo(n,t){switch(n){case"post":ct(t);break;case"pre":Ge(t);break}}function tn(n,t,o,i={}){const{lazy:r=!1}=i;let u=!r,a=Array.isArray(n)?[]:void 0;mo(t,()=>{const _=Array.isArray(n)?n.map(P=>P()):n();if(!u){u=!0,a=_;return}const v=Xt(()=>o(_,a));return a=_,v})}function Le(n,t,o){tn(n,"post",t,o)}function go(n,t,o){tn(n,"pre",t,o)}Le.pre=go;function vo(n,t){switch(n){case"local":return t.localStorage;case"session":return t.sessionStorage}}class en{#e;#t;#o;#n;#r;#i=B(0);constructor(t,o,i={}){const{storage:r="local",serializer:u={serialize:JSON.stringify,deserialize:JSON.parse},syncTabs:a=!0,window:_=$e}=i;if(this.#e=o,this.#t=t,this.#o=u,_===void 0)return;const v=vo(r,_);this.#n=v;const P=v.getItem(t);P!==null?this.#e=this.#a(P):this.#s(o),a&&r==="local"&&(this.#r=Qt(()=>xt(_,"storage",this.#c)))}get current(){this.#r?.(),e(this.#i);const t=this.#a(this.#n?.getItem(this.#t))??this.#e,o=new WeakMap,i=r=>{if(r===null||r?.constructor.name==="Date"||typeof r!="object")return r;let u=o.get(r);return u||(u=new Proxy(r,{get:(a,_)=>(e(this.#i),i(Reflect.get(a,_))),set:(a,_,v)=>(c(this.#i,e(this.#i)+1),Reflect.set(a,_,v),this.#s(t),!0)}),o.set(r,u)),u};return i(t)}set current(t){this.#s(t),c(this.#i,e(this.#i)+1)}#c=t=>{t.key!==this.#t||t.newValue===null||(this.#e=this.#a(t.newValue),c(this.#i,e(this.#i)+1))};#a(t){try{return this.#o.deserialize(t)}catch(o){console.error(`Error when parsing "${t}" from persisted store "${this.#t}"`,o);return}}#s(t){try{t!=null&&this.#n?.setItem(this.#t,this.#o.serialize(t))}catch(o){console.error(`Error when writing value from persisted store "${this.#t}" to ${this.#n}`,o)}}}function qe(n){return n.filter(t=>t.length>0)}const nn={getItem:n=>null,setItem:(n,t)=>{}},ue=typeof document<"u";function wo(n){return typeof n=="function"}function yo(n){return n!==null&&typeof n=="object"}const Gt=Symbol("box"),Oe=Symbol("is-writable");function _o(n){return yo(n)&&Gt in n}function bo(n){return F.isBox(n)&&Oe in n}function F(n){let t=B(Rt(n));return{[Gt]:!0,[Oe]:!0,get current(){return e(t)},set current(o){c(t,o,!0)}}}function xo(n,t){const o=m(n);return t?{[Gt]:!0,[Oe]:!0,get current(){return e(o)},set current(i){t(i)}}:{[Gt]:!0,get current(){return n()}}}function Io(n){return F.isBox(n)?n:wo(n)?F.with(n):F(n)}function To(n){return Object.entries(n).reduce((t,[o,i])=>F.isBox(i)?(F.isWritableBox(i)?Object.defineProperty(t,o,{get(){return i.current},set(r){i.current=r}}):Object.defineProperty(t,o,{get(){return i.current}}),t):Object.assign(t,{[o]:i}),{})}function So(n){return F.isWritableBox(n)?{[Gt]:!0,get current(){return n.current}}:n}F.from=Io;F.with=xo;F.flatten=To;F.readonly=So;F.isBox=_o;F.isWritableBox=bo;function Eo(n,t){const o=RegExp(n,"g");return i=>{if(typeof i!="string")throw new TypeError(`expected an argument of type string, but got ${typeof i}`);return i.match(o)?i.replace(o,t):i}}const Ao=Eo(/[A-Z]/,n=>`-${n.toLowerCase()}`);function ko(n){if(!n||typeof n!="object"||Array.isArray(n))throw new TypeError(`expected an argument of type object, but got ${typeof n}`);return Object.keys(n).map(t=>`${Ao(t)}: ${n[t]};`).join(`
2
+ import{c as Nt,_ as jt}from"../chunks/DJKRyj_1.js";import{a as s,f as rt,q as Qt,o as xt,g as qt,e as an,c as y,j as sn,t as Re,s as ie,r as Ut}from"../chunks/0x0awhVy.js";import{q as ht,w as it,z as $,A as nt,v as mt,br as cn,t as He,bs as Pe,F as B,a7 as Rt,a as ct,D as c,g as e,b as Xt,R as Ce,x as Mt,T as m,aF as J,f as g,u as Ge,bt as De,bp as ln,B as un,$ as dn}from"../chunks/8FUQuwgM.js";import{j as _t,s as bt,g as A,i as Se,e as U,d as Me,S as fn,a as re,w as We}from"../chunks/EDLlAC9C.js";import{h as hn}from"../chunks/C7R6dA2m.js";import{g as Ee}from"../chunks/CIZkRAuY.js";import{e as le,t as Z,c as yt,S as mn,b as gn,i as vn,n as wn,r as Fe}from"../chunks/glgUBDR2.js";import{p as k,i as L,b as Qe,s as kt,r as Ct}from"../chunks/CbJfRYJV.js";import"../chunks/Bl1mtM70.js";const yn=Array(12).fill(0);var _n=rt('<div class="sonner-loading-bar"></div>'),bn=rt('<div><div class="sonner-spinner"></div></div>');function xn(n,t){ht(t,!0);var o=bn(),i=it(o);le(i,23,()=>yn,(r,u)=>`spinner-bar-${u}`,(r,u)=>{var a=_n();s(r,a)}),$(i),$(o),nt(r=>{bt(o,1,r),A(o,"data-visible",t.visible)},[()=>_t(["sonner-loading-wrapper",t.class].filter(Boolean).join(" "))]),s(n,o),mt()}const In=typeof window<"u"?window:void 0;function Tn(n){let t=n.activeElement;for(;t?.shadowRoot;){const o=t.shadowRoot.activeElement;if(o===t)break;t=o}return t}class Sn{#e;#t;constructor(t,o){this.#e=t,this.#t=Qt(o)}get current(){return this.#t(),this.#e()}}const En=/\(.+\)/,An=new Set(["all","print","screen","and","or","not","only"]);class kn extends Sn{constructor(t,o){let i=En.test(t)||t.split(/[\s,]+/).some(u=>An.has(u.trim()))?t:`(${t})`;const r=window.matchMedia(i);super(()=>r.matches,u=>xt(r,"change",u))}}let Bn=class{#e;#t;constructor(t={}){const{window:o=In,document:i=o?.document}=t;o!==void 0&&(this.#e=i,this.#t=Qt(r=>{const u=xt(o,"focusin",r),a=xt(o,"focusout",r);return()=>{u(),a()}}))}get current(){return this.#t?.(),this.#e?Tn(this.#e):null}};new Bn;class Pn{#e;#t;constructor(t){this.#e=t,this.#t=Symbol(t)}get key(){return this.#t}exists(){return cn(this.#t)}get(){const t=He(this.#t);if(t===void 0)throw new Error(`Context "${this.#e}" not found`);return t}getOr(t){const o=He(this.#t);return o===void 0?t:o}set(t){return Pe(this.#t,t)}}const Mn=new Pn("<Toaster/>");function ae(n){return n.label!==void 0}function Cn(){let n=B(Rt(typeof document<"u"?document.hidden:!1));return ct(()=>xt(document,"visibilitychange",()=>{c(n,document.hidden,!0)})),{get current(){return e(n)}}}const Ve=4e3,Dn=14,Ln=45,On=200,zn=.05,Nn={toast:"",title:"",description:"",loader:"",closeButton:"",cancelButton:"",actionButton:"",action:"",warning:"",error:"",success:"",default:"",info:"",loading:""};function Rn(n){const[t,o]=n.split("-"),i=[];return t&&i.push(t),o&&i.push(o),i}function je(n){return 1/(1.5+Math.abs(n)/20)}var Hn=rt("<div><!></div>"),Wn=rt('<button data-close-button=""><!></button>'),Fn=rt('<div data-icon=""><!> <!></div>'),Vn=rt('<div data-description=""><!></div>'),jn=rt('<button data-button="" data-cancel=""> </button>'),qn=rt('<button data-button=""> </button>'),Un=rt('<!> <div data-content=""><div data-title=""><!></div> <!></div> <!> <!>',1),Kn=rt('<li aria-atomic="true" data-sonner-toast=""><!> <!></li>');function Yn(n,t){ht(t,!0);const o=h=>{var w=y(),T=g(w);{var M=E=>{var K=Hn(),zt=it(K);U(zt,()=>t.loadingIcon),$(K),nt(Yt=>{bt(K,1,Yt),A(K,"data-visible",e(z)==="loading")},[()=>_t(yt(e(ot)?.loader,t.toast?.classes?.loader,"sonner-loader"))]),s(E,K)},C=E=>{{let K=m(()=>yt(e(ot)?.loader,t.toast.classes?.loader)),zt=m(()=>e(z)==="loading");xn(E,{get class(){return e(K)},get visible(){return e(zt)}})}};L(T,E=>{t.loadingIcon?E(M):E(C,!1)})}s(h,w)};let i=k(t,"cancelButtonStyle",3,""),r=k(t,"actionButtonStyle",3,""),u=k(t,"descriptionClass",3,""),a=k(t,"unstyled",3,!1),_=k(t,"defaultRichColors",3,!1);const v={...Nn};let P=B(!1),O=B(!1),at=B(!1),j=B(!1),st=B(!1),R=B(0),tt=B(0),lt=t.toast.duration||t.duration||Ve,X=B(void 0),q=B(null),Ht=B(null);const de=m(()=>t.index===0),fe=m(()=>t.index+1<=t.visibleToasts),z=m(()=>t.toast.type),et=m(()=>t.toast.dismissible!==void 0?t.toast.dismissible!==!1:t.toast.dismissable!==!1),Wt=m(()=>t.toast.class||""),Dt=m(()=>t.toast.descriptionClass||""),It=m(()=>Z.heights.findIndex(h=>h.toastId===t.toast.id)||0),Tt=m(()=>t.toast.closeButton??t.closeButton),Lt=m(()=>t.toast.duration??t.duration??Ve);let Bt=null;const pt=m(()=>t.position.split("-")),he=m(()=>Z.heights.reduce((h,w,T)=>T>=e(It)?h:h+w.height,0)),me=Cn(),ge=m(()=>t.toast.invert||t.invert),Kt=m(()=>e(z)==="loading"),ot=m(()=>({...v,...t.classes})),ve=m(()=>t.toast.title),we=m(()=>t.toast.description);let St=B(0),$t=B(0);const Ft=m(()=>Math.round(e(It)*Dn+e(he)));ct(()=>{e(ve),e(we);let h;t.expanded||t.expandByDefault?h=1:h=1-t.index*zn;const w=Xt(()=>e(X));if(w===void 0)return;w.style.setProperty("height","auto");const T=w.offsetHeight,M=w.getBoundingClientRect().height,C=Math.round(M/h+Number.EPSILON&100)/100;w.style.removeProperty("height");let E;Math.abs(C-T)<1?E=C:E=T,c(tt,E,!0),Z.setHeight({toastId:t.toast.id,height:E})});function l(){c(O,!0),c(R,e(Ft),!0),Z.removeHeight(t.toast.id),setTimeout(()=>{Z.remove(t.toast.id)},On)}let H;const gt=m(()=>t.toast.promise&&e(z)==="loading"||t.toast.duration===Number.POSITIVE_INFINITY);function vt(){c(St,new Date().getTime(),!0),H=setTimeout(()=>{t.toast.onAutoClose?.(t.toast),l()},lt)}function Ot(){if(e($t)<e(St)){const h=new Date().getTime()-e(St);lt=lt-h}c($t,new Date().getTime(),!0)}ct(()=>{t.toast.updated&&(clearTimeout(H),lt=e(Lt),vt())}),ct(()=>(e(gt)||(t.expanded||t.interacting||t.pauseWhenPageIsHidden&&me.current?Ot():vt()),()=>clearTimeout(H))),Ce(()=>{c(P,!0);const h=e(X)?.getBoundingClientRect().height;return c(tt,h,!0),Z.setHeight({toastId:t.toast.id,height:h}),()=>{Z.removeHeight(t.toast.id)}}),ct(()=>{t.toast.delete&&Xt(()=>{l(),t.toast.onDismiss?.(t.toast)})});const ye=h=>{if(e(Kt))return;c(R,e(Ft),!0);const w=h.target;w.setPointerCapture(h.pointerId),w.tagName!=="BUTTON"&&(c(at,!0),Bt={x:h.clientX,y:h.clientY})},ze=()=>{if(e(j)||!e(et))return;Bt=null;const h=Number(e(X)?.style.getPropertyValue("--swipe-amount-x").replace("px","")||0),w=Number(e(X)?.style.getPropertyValue("--swipe-amount-y").replace("px","")||0),T=new Date().getTime()-0,M=e(q)==="x"?h:w,C=Math.abs(M)/T;if(Math.abs(M)>=Ln||C>.11){c(R,e(Ft),!0),t.toast.onDismiss?.(t.toast),e(q)==="x"?c(Ht,h>0?"right":"left",!0):c(Ht,w>0?"down":"up",!0),l(),c(j,!0);return}else e(X)?.style.setProperty("--swipe-amount-x","0px"),e(X)?.style.setProperty("--swipe-amount-y","0px");c(st,!1),c(at,!1),c(q,null)},te=h=>{if(!Bt||!e(et)||(window.getSelection()?.toString().length??-1)>0)return;const T=h.clientY-Bt.y,M=h.clientX-Bt.x,C=t.swipeDirections??Rn(t.position);!e(q)&&(Math.abs(M)>1||Math.abs(T)>1)&&c(q,Math.abs(M)>Math.abs(T)?"x":"y",!0);let E={x:0,y:0};if(e(q)==="y"){if(C.includes("top")||C.includes("bottom"))if(C.includes("top")&&T<0||C.includes("bottom")&&T>0)E.y=T;else{const K=T*je(T);E.y=Math.abs(K)<Math.abs(T)?K:T}}else if(e(q)==="x"&&(C.includes("left")||C.includes("right")))if(C.includes("left")&&M<0||C.includes("right")&&M>0)E.x=M;else{const K=M*je(M);E.x=Math.abs(K)<Math.abs(M)?K:M}(Math.abs(E.x)>0||Math.abs(E.y)>0)&&c(st,!0),e(X)?.style.setProperty("--swipe-amount-x",`${E.x}px`),e(X)?.style.setProperty("--swipe-amount-y",`${E.y}px`)},wt=()=>{c(at,!1),c(q,null),Bt=null},Et=m(()=>t.toast.icon?t.toast.icon:e(z)==="success"?t.successIcon:e(z)==="error"?t.errorIcon:e(z)==="warning"?t.warningIcon:e(z)==="info"?t.infoIcon:e(z)==="loading"?t.loadingIcon:null);var f=Kn();A(f,"tabindex",0);let Vt;var ee=it(f);{var Ne=h=>{var w=Wn(),T=it(w);U(T,()=>t.closeIcon??J),$(w),nt(M=>{A(w,"aria-label",t.closeButtonAriaLabel),A(w,"data-disabled",e(Kt)),bt(w,1,M)},[()=>_t(yt(e(ot)?.closeButton,t.toast?.classes?.closeButton))]),qt("click",w,()=>{e(Kt)||!e(et)||(l(),t.toast.onDismiss?.(t.toast))}),s(h,w)};L(ee,h=>{e(Tt)&&!t.toast.component&&e(z)!=="loading"&&t.closeIcon!==null&&h(Ne)})}var _e=Mt(ee,2);{var be=h=>{const w=m(()=>t.toast.component);var T=y(),M=g(T);Nt(M,()=>e(w),(C,E)=>{E(C,kt(()=>t.toast.componentProps,{closeToast:l}))}),s(h,T)},xe=h=>{var w=Un(),T=g(w);{var M=x=>{var S=Fn(),d=it(S);{var D=b=>{var I=y(),p=g(I);{var W=Pt=>{var oe=y(),Te=g(oe);Nt(Te,()=>t.toast.icon,(Y,Q)=>{Q(Y,{})}),s(Pt,oe)},ft=Pt=>{o(Pt)};L(p,Pt=>{t.toast.icon?Pt(W):Pt(ft,!1)})}s(b,I)};L(d,b=>{(t.toast.promise||e(z)==="loading")&&b(D)})}var V=Mt(d,2);{var N=b=>{var I=y(),p=g(I);{var W=Y=>{var Q=y(),At=g(Q);Nt(At,()=>t.toast.icon,(on,rn)=>{rn(on,{})}),s(Y,Q)},ft=Y=>{var Q=y(),At=g(Q);U(At,()=>t.successIcon??J),s(Y,Q)},Pt=Y=>{var Q=y(),At=g(Q);U(At,()=>t.errorIcon??J),s(Y,Q)},oe=Y=>{var Q=y(),At=g(Q);U(At,()=>t.warningIcon??J),s(Y,Q)},Te=Y=>{var Q=y(),At=g(Q);U(At,()=>t.infoIcon??J),s(Y,Q)};L(p,Y=>{t.toast.icon?Y(W):e(z)==="success"?Y(ft,1):e(z)==="error"?Y(Pt,2):e(z)==="warning"?Y(oe,3):e(z)==="info"&&Y(Te,4)})}s(b,I)};L(V,b=>{t.toast.type!=="loading"&&b(N)})}$(S),nt(b=>bt(S,1,b),[()=>_t(yt(e(ot)?.icon,t.toast?.classes?.icon))]),s(x,S)};L(T,x=>{(e(z)||t.toast.icon||t.toast.promise)&&t.toast.icon!==null&&(e(Et)!==null||t.toast.icon)&&x(M)})}var C=Mt(T,2),E=it(C),K=it(E);{var zt=x=>{var S=y(),d=g(S);{var D=N=>{const b=m(()=>t.toast.title);var I=y(),p=g(I);Nt(p,()=>e(b),(W,ft)=>{ft(W,kt(()=>t.toast.componentProps))}),s(N,I)},V=N=>{var b=Re();nt(()=>ie(b,t.toast.title)),s(N,b)};L(d,N=>{typeof t.toast.title!="string"?N(D):N(V,!1)})}s(x,S)};L(K,x=>{t.toast.title&&x(zt)})}$(E);var Yt=Mt(E,2);{var Ie=x=>{var S=Vn(),d=it(S);{var D=N=>{const b=m(()=>t.toast.description);var I=y(),p=g(I);Nt(p,()=>e(b),(W,ft)=>{ft(W,kt(()=>t.toast.componentProps))}),s(N,I)},V=N=>{var b=Re();nt(()=>ie(b,t.toast.description)),s(N,b)};L(d,N=>{typeof t.toast.description!="string"?N(D):N(V,!1)})}$(S),nt(N=>bt(S,1,N),[()=>_t(yt(u(),e(Dt),e(ot)?.description,t.toast.classes?.description))]),s(x,S)};L(Yt,x=>{t.toast.description&&x(Ie)})}$(C);var ne=Mt(C,2);{var ut=x=>{var S=y(),d=g(S);{var D=b=>{var I=y(),p=g(I);Nt(p,()=>t.toast.cancel,(W,ft)=>{ft(W,{})}),s(b,I)},V=b=>{var I=jn(),p=it(I,!0);$(I),nt(W=>{Se(I,t.toast.cancelButtonStyle??i()),bt(I,1,W),ie(p,t.toast.cancel.label)},[()=>_t(yt(e(ot)?.cancelButton,t.toast?.classes?.cancelButton))]),qt("click",I,W=>{ae(t.toast.cancel)&&e(et)&&(t.toast.cancel?.onClick?.(W),l())}),s(b,I)},N=m(()=>ae(t.toast.cancel));L(d,b=>{typeof t.toast.cancel=="function"?b(D):e(N)&&b(V,1)})}s(x,S)};L(ne,x=>{t.toast.cancel&&x(ut)})}var G=Mt(ne,2);{var dt=x=>{var S=y(),d=g(S);{var D=b=>{var I=y(),p=g(I);Nt(p,()=>t.toast.action,(W,ft)=>{ft(W,{})}),s(b,I)},V=b=>{var I=qn(),p=it(I,!0);$(I),nt(W=>{Se(I,t.toast.actionButtonStyle??r()),bt(I,1,W),ie(p,t.toast.action.label)},[()=>_t(yt(e(ot)?.actionButton,t.toast?.classes?.actionButton))]),qt("click",I,W=>{ae(t.toast.action)&&(t.toast.action?.onClick(W),!W.defaultPrevented&&l())}),s(b,I)},N=m(()=>ae(t.toast.action));L(d,b=>{typeof t.toast.action=="function"?b(D):e(N)&&b(V,1)})}s(x,S)};L(G,x=>{t.toast.action&&x(dt)})}nt((x,S)=>{bt(C,1,x),bt(E,1,S)},[()=>_t(yt(e(ot)?.content,t.toast?.classes?.content)),()=>_t(yt(e(ot)?.title,t.toast?.classes?.title))]),s(h,w)};L(_e,h=>{t.toast.component?h(be):h(xe,!1)})}$(f),Qe(f,h=>c(X,h),()=>e(X)),nt((h,w,T)=>{bt(f,1,h),A(f,"aria-live",t.toast.important?"assertive":"polite"),A(f,"data-rich-colors",t.toast.richColors??_()),A(f,"data-styled",!(t.toast.component||t.toast.unstyled||a())),A(f,"data-mounted",e(P)),A(f,"data-promise",w),A(f,"data-swiped",e(st)),A(f,"data-removed",e(O)),A(f,"data-visible",e(fe)),A(f,"data-y-position",e(pt)[0]),A(f,"data-x-position",e(pt)[1]),A(f,"data-index",t.index),A(f,"data-front",e(de)),A(f,"data-swiping",e(at)),A(f,"data-dismissible",e(et)),A(f,"data-type",e(z)),A(f,"data-invert",e(ge)),A(f,"data-swipe-out",e(j)),A(f,"data-swipe-direction",e(Ht)),A(f,"data-expanded",T),Vt=Se(f,`${t.style} ${t.toast.style}`,Vt,{"--index":t.index,"--toasts-before":t.index,"--z-index":Z.toasts.length-t.index,"--offset":`${e(O)?e(R):e(Ft)}px`,"--initial-height":t.expandByDefault?"auto":`${e(tt)}px`})},[()=>_t(yt(t.class,e(Wt),e(ot)?.toast,t.toast?.classes?.toast,e(ot)?.[e(z)],t.toast?.classes?.[e(z)])),()=>!!t.toast.promise,()=>!!(t.expanded||t.expandByDefault&&e(P))]),qt("pointermove",f,te),qt("pointerup",f,ze),qt("pointerdown",f,ye),an("dragend",f,wt),s(n,f),mt()}sn(["pointermove","pointerup","pointerdown","click"]);var Zn=Ut('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" height="20" width="20" data-sonner-success-icon=""><path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z" clip-rule="evenodd"></path></svg>');function Xn(n){var t=Zn();s(n,t)}var Gn=Ut('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" height="20" width="20" data-sonner-error-icon=""><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z" clip-rule="evenodd"></path></svg>');function Qn(n){var t=Gn();s(n,t)}var Jn=Ut('<svg viewBox="0 0 64 64" fill="currentColor" height="20" width="20" data-sonner-warning-icon="" xmlns="http://www.w3.org/2000/svg"><path d="M32.427,7.987c2.183,0.124 4,1.165 5.096,3.281l17.936,36.208c1.739,3.66 -0.954,8.585 -5.373,8.656l-36.119,0c-4.022,-0.064 -7.322,-4.631 -5.352,-8.696l18.271,-36.207c0.342,-0.65 0.498,-0.838 0.793,-1.179c1.186,-1.375 2.483,-2.111 4.748,-2.063Zm-0.295,3.997c-0.687,0.034 -1.316,0.419 -1.659,1.017c-6.312,11.979 -12.397,24.081 -18.301,36.267c-0.546,1.225 0.391,2.797 1.762,2.863c12.06,0.195 24.125,0.195 36.185,0c1.325,-0.064 2.321,-1.584 1.769,-2.85c-5.793,-12.184 -11.765,-24.286 -17.966,-36.267c-0.366,-0.651 -0.903,-1.042 -1.79,-1.03Z"></path><path d="M33.631,40.581l-3.348,0l-0.368,-16.449l4.1,0l-0.384,16.449Zm-3.828,5.03c0,-0.609 0.197,-1.113 0.592,-1.514c0.396,-0.4 0.935,-0.601 1.618,-0.601c0.684,0 1.223,0.201 1.618,0.601c0.395,0.401 0.593,0.905 0.593,1.514c0,0.587 -0.193,1.078 -0.577,1.473c-0.385,0.395 -0.929,0.593 -1.634,0.593c-0.705,0 -1.249,-0.198 -1.634,-0.593c-0.384,-0.395 -0.576,-0.886 -0.576,-1.473Z"></path></svg>');function pn(n){var t=Jn();s(n,t)}var $n=Ut('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" height="20" width="20" data-sonner-info-icon=""><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z" clip-rule="evenodd"></path></svg>');function to(n){var t=$n();s(n,t)}var eo=Ut('<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" data-sonner-close-icon=""><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg>');function no(n){var t=eo();s(n,t)}const oo=3,Je="24px",pe="16px",io=4e3,ro=356,ao=14,Ae="dark",se="light";function so(n,t){const o={};return[n,t].forEach((i,r)=>{const u=r===1,a=u?"--mobile-offset":"--offset",_=u?pe:Je;function v(P){["top","right","bottom","left"].forEach(O=>{o[`${a}-${O}`]=typeof P=="number"?`${P}px`:P})}typeof i=="number"||typeof i=="string"?v(i):typeof i=="object"?["top","right","bottom","left"].forEach(P=>{const O=i[P];O===void 0?o[`${a}-${P}`]=_:o[`${a}-${P}`]=typeof O=="number"?`${O}px`:O}):v(_)}),o}var co=rt("<ol></ol>"),lo=rt('<section aria-live="polite" aria-relevant="additions text" aria-atomic="false" class="svelte-nbs0zk"><!></section>');function uo(n,t){ht(t,!0);function o(l){return l!=="system"?l:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?Ae:se}let i=k(t,"invert",3,!1),r=k(t,"position",3,"bottom-right"),u=k(t,"hotkey",19,()=>["altKey","KeyT"]),a=k(t,"expand",3,!1),_=k(t,"closeButton",3,!1),v=k(t,"offset",3,Je),P=k(t,"mobileOffset",3,pe),O=k(t,"theme",3,"light"),at=k(t,"richColors",3,!1),j=k(t,"duration",3,io),st=k(t,"visibleToasts",3,oo),R=k(t,"toastOptions",19,()=>({})),tt=k(t,"dir",7,"auto"),lt=k(t,"gap",3,ao),X=k(t,"pauseWhenPageIsHidden",3,!1),q=k(t,"containerAriaLabel",3,"Notifications"),Ht=k(t,"closeButtonAriaLabel",3,"Close toast"),de=Ct(t,["$$slots","$$events","$$legacy","invert","position","hotkey","expand","closeButton","offset","mobileOffset","theme","richColors","duration","visibleToasts","toastOptions","dir","gap","pauseWhenPageIsHidden","loadingIcon","successIcon","errorIcon","warningIcon","closeIcon","infoIcon","containerAriaLabel","class","closeButtonAriaLabel","onblur","onfocus","onmouseenter","onmousemove","onmouseleave","ondragend","onpointerdown","onpointerup"]);function fe(){if(tt()!=="auto")return tt();if(typeof window>"u"||typeof document>"u")return"ltr";const l=document.documentElement.getAttribute("dir");return l==="auto"||!l?(Xt(()=>tt(window.getComputedStyle(document.documentElement).direction??"ltr")),tt()):(Xt(()=>tt(l)),l)}const z=m(()=>Array.from(new Set([r(),...Z.toasts.filter(l=>l.position).map(l=>l.position)].filter(Boolean))));let et=B(!1),Wt=B(!1),Dt=B(Rt(o(O()))),It=B(void 0),Tt=B(null),Lt=B(!1);const Bt=m(()=>u().join("+").replace(/Key/g,"").replace(/Digit/g,""));ct(()=>{Z.toasts.length<=1&&c(et,!1)}),ct(()=>{const l=Z.toasts.filter(H=>H.dismiss&&!H.delete);if(l.length>0){const H=Z.toasts.map(gt=>l.find(Ot=>Ot.id===gt.id)?{...gt,delete:!0}:gt);Z.toasts=H}}),ct(()=>()=>{e(It)&&e(Tt)&&(e(Tt).focus({preventScroll:!0}),c(Tt,null),c(Lt,!1))}),Ce(()=>(Z.reset(),xt(document,"keydown",H=>{u().every(vt=>H[vt]||H.code===vt)&&(c(et,!0),e(It)?.focus()),H.code==="Escape"&&(document.activeElement===e(It)||e(It)?.contains(document.activeElement))&&c(et,!1)}))),ct(()=>{if(O()!=="system"&&c(Dt,O()),typeof window<"u"){O()==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?c(Dt,Ae):c(Dt,se));const l=window.matchMedia("(prefers-color-scheme: dark)"),H=({matches:gt})=>{O()==="system"&&c(Dt,gt?Ae:se,!0)};"addEventListener"in l?l.addEventListener("change",H):l.addListener(H)}});const pt=l=>{t.onblur?.(l),e(Lt)&&!l.currentTarget.contains(l.relatedTarget)&&(c(Lt,!1),e(Tt)&&(e(Tt).focus({preventScroll:!0}),c(Tt,null)))},he=l=>{t.onfocus?.(l),!(l.target instanceof HTMLElement&&l.target.dataset.dismissible==="false")&&(e(Lt)||(c(Lt,!0),c(Tt,l.relatedTarget,!0)))},me=l=>{t.onpointerdown?.(l),!(l.target instanceof HTMLElement&&l.target.dataset.dismissible==="false")&&c(Wt,!0)},ge=l=>{t.onmouseenter?.(l),c(et,!0)},Kt=l=>{t.onmouseleave?.(l),e(Wt)||c(et,!1)},ot=l=>{t.onmousemove?.(l),c(et,!0)},ve=l=>{t.ondragend?.(l),c(et,!1)},we=l=>{t.onpointerup?.(l),c(Wt,!1)};Mn.set(new mn);var St=lo();A(St,"tabindex",-1);var $t=it(St);{var Ft=l=>{var H=y(),gt=g(H);le(gt,18,()=>e(z),vt=>vt,(vt,Ot,ye,ze)=>{const te=m(()=>{const[f,Vt]=Ot.split("-");return{y:f,x:Vt}}),wt=m(()=>so(v(),P()));var Et=co();Me(Et,f=>({tabindex:-1,dir:f,class:t.class,"data-sonner-toaster":!0,"data-sonner-theme":e(Dt),"data-y-position":e(te).y,"data-x-position":e(te).x,style:t.style,onblur:pt,onfocus:he,onmouseenter:ge,onmousemove:ot,onmouseleave:Kt,ondragend:ve,onpointerdown:me,onpointerup:we,...de,[fn]:{"--front-toast-height":`${Z.heights[0]?.height}px`,"--width":`${ro}px`,"--gap":`${lt()}px`,"--offset-top":e(wt)["--offset-top"],"--offset-right":e(wt)["--offset-right"],"--offset-bottom":e(wt)["--offset-bottom"],"--offset-left":e(wt)["--offset-left"],"--mobile-offset-top":e(wt)["--mobile-offset-top"],"--mobile-offset-right":e(wt)["--mobile-offset-right"],"--mobile-offset-bottom":e(wt)["--mobile-offset-bottom"],"--mobile-offset-left":e(wt)["--mobile-offset-left"]}}),[fe],void 0,void 0,"svelte-nbs0zk"),le(Et,23,()=>Z.toasts.filter(f=>!f.position&&e(ye)===0||f.position===Ot),f=>f.id,(f,Vt,ee,Ne)=>{{const _e=ut=>{var G=y(),dt=g(G);{var x=d=>{var D=y(),V=g(D);U(V,()=>t.successIcon??J),s(d,D)},S=d=>{Xn(d)};L(dt,d=>{t.successIcon?d(x):t.successIcon!==null&&d(S,1)})}s(ut,G)},be=ut=>{var G=y(),dt=g(G);{var x=d=>{var D=y(),V=g(D);U(V,()=>t.errorIcon??J),s(d,D)},S=d=>{Qn(d)};L(dt,d=>{t.errorIcon?d(x):t.errorIcon!==null&&d(S,1)})}s(ut,G)},xe=ut=>{var G=y(),dt=g(G);{var x=d=>{var D=y(),V=g(D);U(V,()=>t.warningIcon??J),s(d,D)},S=d=>{pn(d)};L(dt,d=>{t.warningIcon?d(x):t.warningIcon!==null&&d(S,1)})}s(ut,G)},h=ut=>{var G=y(),dt=g(G);{var x=d=>{var D=y(),V=g(D);U(V,()=>t.infoIcon??J),s(d,D)},S=d=>{to(d)};L(dt,d=>{t.infoIcon?d(x):t.infoIcon!==null&&d(S,1)})}s(ut,G)},w=ut=>{var G=y(),dt=g(G);{var x=d=>{var D=y(),V=g(D);U(V,()=>t.closeIcon??J),s(d,D)},S=d=>{no(d)};L(dt,d=>{t.closeIcon?d(x):t.closeIcon!==null&&d(S,1)})}s(ut,G)};let T=m(()=>R()?.duration??j()),M=m(()=>R()?.class??""),C=m(()=>R()?.descriptionClass||""),E=m(()=>R()?.style??""),K=m(()=>R().classes||{}),zt=m(()=>R().unstyled??!1),Yt=m(()=>R()?.cancelButtonStyle??""),Ie=m(()=>R()?.actionButtonStyle??""),ne=m(()=>R()?.closeButtonAriaLabel??Ht());Yn(f,{get index(){return e(ee)},get toast(){return e(Vt)},get defaultRichColors(){return at()},get duration(){return e(T)},get class(){return e(M)},get descriptionClass(){return e(C)},get invert(){return i()},get visibleToasts(){return st()},get closeButton(){return _()},get interacting(){return e(Wt)},get position(){return Ot},get style(){return e(E)},get classes(){return e(K)},get unstyled(){return e(zt)},get cancelButtonStyle(){return e(Yt)},get actionButtonStyle(){return e(Ie)},get closeButtonAriaLabel(){return e(ne)},get expandByDefault(){return a()},get expanded(){return e(et)},get pauseWhenPageIsHidden(){return X()},get loadingIcon(){return t.loadingIcon},successIcon:_e,errorIcon:be,warningIcon:xe,infoIcon:h,closeIcon:w,$$slots:{successIcon:!0,errorIcon:!0,warningIcon:!0,infoIcon:!0,closeIcon:!0}})}}),$(Et),Qe(Et,f=>c(It,f),()=>e(It)),nt(()=>Et.dir=Et.dir),s(vt,Et)}),s(l,H)};L($t,l=>{Z.toasts.length>0&&l(Ft)})}$(St),nt(()=>A(St,"aria-label",`${q()??""} ${e(Bt)??""}`)),s(n,St),mt()}const $e=typeof window<"u"?window:void 0;function fo(n){let t=n.activeElement;for(;t?.shadowRoot;){const o=t.shadowRoot.activeElement;if(o===t)break;t=o}return t}let ho=class{#e;#t;constructor(t={}){const{window:o=$e,document:i=o?.document}=t;o!==void 0&&(this.#e=i,this.#t=Qt(r=>{const u=xt(o,"focusin",r),a=xt(o,"focusout",r);return()=>{u(),a()}}))}get current(){return this.#t?.(),this.#e?fo(this.#e):null}};new ho;function mo(n,t){switch(n){case"post":ct(t);break;case"pre":Ge(t);break}}function tn(n,t,o,i={}){const{lazy:r=!1}=i;let u=!r,a=Array.isArray(n)?[]:void 0;mo(t,()=>{const _=Array.isArray(n)?n.map(P=>P()):n();if(!u){u=!0,a=_;return}const v=Xt(()=>o(_,a));return a=_,v})}function Le(n,t,o){tn(n,"post",t,o)}function go(n,t,o){tn(n,"pre",t,o)}Le.pre=go;function vo(n,t){switch(n){case"local":return t.localStorage;case"session":return t.sessionStorage}}class en{#e;#t;#o;#n;#r;#i=B(0);constructor(t,o,i={}){const{storage:r="local",serializer:u={serialize:JSON.stringify,deserialize:JSON.parse},syncTabs:a=!0,window:_=$e}=i;if(this.#e=o,this.#t=t,this.#o=u,_===void 0)return;const v=vo(r,_);this.#n=v;const P=v.getItem(t);P!==null?this.#e=this.#a(P):this.#s(o),a&&r==="local"&&(this.#r=Qt(()=>xt(_,"storage",this.#c)))}get current(){this.#r?.(),e(this.#i);const t=this.#a(this.#n?.getItem(this.#t))??this.#e,o=new WeakMap,i=r=>{if(r===null||r?.constructor.name==="Date"||typeof r!="object")return r;let u=o.get(r);return u||(u=new Proxy(r,{get:(a,_)=>(e(this.#i),i(Reflect.get(a,_))),set:(a,_,v)=>(c(this.#i,e(this.#i)+1),Reflect.set(a,_,v),this.#s(t),!0)}),o.set(r,u)),u};return i(t)}set current(t){this.#s(t),c(this.#i,e(this.#i)+1)}#c=t=>{t.key!==this.#t||t.newValue===null||(this.#e=this.#a(t.newValue),c(this.#i,e(this.#i)+1))};#a(t){try{return this.#o.deserialize(t)}catch(o){console.error(`Error when parsing "${t}" from persisted store "${this.#t}"`,o);return}}#s(t){try{t!=null&&this.#n?.setItem(this.#t,this.#o.serialize(t))}catch(o){console.error(`Error when writing value from persisted store "${this.#t}" to ${this.#n}`,o)}}}function qe(n){return n.filter(t=>t.length>0)}const nn={getItem:n=>null,setItem:(n,t)=>{}},ue=typeof document<"u";function wo(n){return typeof n=="function"}function yo(n){return n!==null&&typeof n=="object"}const Gt=Symbol("box"),Oe=Symbol("is-writable");function _o(n){return yo(n)&&Gt in n}function bo(n){return F.isBox(n)&&Oe in n}function F(n){let t=B(Rt(n));return{[Gt]:!0,[Oe]:!0,get current(){return e(t)},set current(o){c(t,o,!0)}}}function xo(n,t){const o=m(n);return t?{[Gt]:!0,[Oe]:!0,get current(){return e(o)},set current(i){t(i)}}:{[Gt]:!0,get current(){return n()}}}function Io(n){return F.isBox(n)?n:wo(n)?F.with(n):F(n)}function To(n){return Object.entries(n).reduce((t,[o,i])=>F.isBox(i)?(F.isWritableBox(i)?Object.defineProperty(t,o,{get(){return i.current},set(r){i.current=r}}):Object.defineProperty(t,o,{get(){return i.current}}),t):Object.assign(t,{[o]:i}),{})}function So(n){return F.isWritableBox(n)?{[Gt]:!0,get current(){return n.current}}:n}F.from=Io;F.with=xo;F.flatten=To;F.readonly=So;F.isBox=_o;F.isWritableBox=bo;function Eo(n,t){const o=RegExp(n,"g");return i=>{if(typeof i!="string")throw new TypeError(`expected an argument of type string, but got ${typeof i}`);return i.match(o)?i.replace(o,t):i}}const Ao=Eo(/[A-Z]/,n=>`-${n.toLowerCase()}`);function ko(n){if(!n||typeof n!="object"||Array.isArray(n))throw new TypeError(`expected an argument of type object, but got ${typeof n}`);return Object.keys(n).map(t=>`${Ao(t)}: ${n[t]};`).join(`
3
3
  `)}function Bo(n={}){return ko(n).replace(`
4
4
  `," ")}const Po={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",transform:"translateX(-100%)"};Bo(Po);const Mo=typeof window<"u"?window:void 0;function Co(n){let t=n.activeElement;for(;t?.shadowRoot;){const o=t.shadowRoot.activeElement;if(o===t)break;t=o}return t}class Do{#e;#t;constructor(t={}){const{window:o=Mo,document:i=o?.document}=t;o!==void 0&&(this.#e=i,this.#t=Qt(r=>{const u=xt(o,"focusin",r),a=xt(o,"focusout",r);return()=>{u(),a()}}))}get current(){return this.#t?.(),this.#e?Co(this.#e):null}}new Do;const ke=F("mode-watcher-mode"),Be=F("mode-watcher-theme"),Lo=["dark","light","system"];function Ue(n){return typeof n!="string"?!1:Lo.includes(n)}class Oo{#e="system";#t=ue?localStorage:nn;#o=this.#t.getItem(ke.current);#n=Ue(this.#o)?this.#o:this.#e;#r=B(Rt(this.#i()));#i(t=this.#n){return new en(ke.current,t,{serializer:{serialize:o=>o,deserialize:o=>Ue(o)?o:this.#e}})}constructor(){De(()=>Le.pre(()=>ke.current,(t,o)=>{const i=e(this.#r).current;c(this.#r,this.#i(i),!0),o&&localStorage.removeItem(o)}))}get current(){return e(this.#r).current}set current(t){e(this.#r).current=t}}class zo{#e=void 0;#t=!0;#o=B(Rt(this.#e));#n=typeof window<"u"&&typeof window.matchMedia=="function"?new kn("prefers-color-scheme: light"):{current:!1};query(){ue&&c(this.#o,this.#n.current?"light":"dark",!0)}tracking(t){this.#t=t}constructor(){De(()=>{Ge(()=>{this.#t&&this.query()})}),this.query=this.query.bind(this),this.tracking=this.tracking.bind(this)}get current(){return e(this.#o)}}const Ke=new Oo,No=new zo;class Ro{#e=ue?localStorage:nn;#t=this.#e.getItem(Be.current);#o=this.#t===null||this.#t===void 0?"":this.#t;#n=B(Rt(this.#r()));#r(t=this.#o){return new en(Be.current,t,{serializer:{serialize:o=>typeof o!="string"?"":o,deserialize:o=>o}})}constructor(){De(()=>Le.pre(()=>Be.current,(t,o)=>{const i=e(this.#n).current;c(this.#n,this.#r(i),!0),o&&localStorage.removeItem(o)}))}get current(){return e(this.#n).current}set current(t){e(this.#n).current=t}}new Ro;let Ye,Ze,Xe=!1,Zt=null;function Ho(){return Zt||(Zt=document.createElement("style"),Zt.appendChild(document.createTextNode(`* {
5
5
  -webkit-transition: none !important;
@@ -1 +1 @@
1
- import{a as u,f as h,s as a}from"../chunks/0x0awhVy.js";import"../chunks/Bl1mtM70.js";import{q as g,f as v,A as l,v as d,w as e,z as o,x}from"../chunks/8FUQuwgM.js";import{i as _}from"../chunks/DxxhVGi2.js";import{s as $,p}from"../chunks/D8Tke-Cy.js";const k={get error(){return p.error},get status(){return p.status}};$.updated.check;const m=k;var b=h("<h1> </h1> <p> </p>",1);function j(i,f){g(f,!1),_();var t=b(),r=v(t),n=e(r,!0);o(r);var s=x(r,2),c=e(s,!0);o(s),l(()=>{a(n,m.status),a(c,m.error?.message)}),u(i,t),d()}export{j as component};
1
+ import{a as u,f as h,s as a}from"../chunks/0x0awhVy.js";import"../chunks/Bl1mtM70.js";import{q as g,f as v,A as l,v as d,w as e,z as o,x}from"../chunks/8FUQuwgM.js";import{i as _}from"../chunks/DxxhVGi2.js";import{s as $,p}from"../chunks/CIZkRAuY.js";const k={get error(){return p.error},get status(){return p.status}};$.updated.check;const m=k;var b=h("<h1> </h1> <p> </p>",1);function j(i,f){g(f,!1),_();var t=b(),r=v(t),n=e(r,!0);o(r);var s=x(r,2),c=e(s,!0);o(s),l(()=>{a(n,m.status),a(c,m.error?.message)}),u(i,t),d()}export{j as component};
@@ -1 +1 @@
1
- import{a as n,s as $,f as d}from"../chunks/0x0awhVy.js";import"../chunks/Bl1mtM70.js";import{q as b,t as C,v as A,w as t,x as l,y as S,z as e,A as V}from"../chunks/8FUQuwgM.js";import{i as m}from"../chunks/CbJfRYJV.js";import{i as k}from"../chunks/DxxhVGi2.js";import{A as P}from"../chunks/Bxlwy1pA.js";import{V as q,C as z}from"../chunks/pFRFqWMS.js";import{w as p}from"../chunks/EDLlAC9C.js";import{n as E}from"../chunks/DLX3YXva.js";var L=d('<h2 class="svelte-1uha8ag"> </h2>'),T=d('<div class="content-row svelte-1uha8ag"><div class="entity-area svelte-1uha8ag"><!> <div class="welcome svelte-1uha8ag"><!> <p class="svelte-1uha8ag">Select an entity from the sidebar to get started.</p></div></div> <!></div>');function M(c,f){b(f,!1);const h=C("chat");E.showEntity(),k(),P(c,{children:(g,W)=>{var o=T(),s=t(o),i=t(s);q(i,{activeView:"entity"});var v=l(i,2),_=t(v);{var u=a=>{var r=L(),y=t(r);e(r),V(()=>$(y,`Welcome to ${(p.name||"Studiograph")??""}`)),n(a,r)};m(_,a=>{p.nameLoaded&&a(u)})}S(2),e(v),e(s);var w=l(s,2);{var x=a=>{z(a,{})};m(w,a=>{h.open&&a(x)})}e(o),n(g,o)},$$slots:{default:!0}}),A()}export{M as component};
1
+ import{a as n,s as $,f as d}from"../chunks/0x0awhVy.js";import"../chunks/Bl1mtM70.js";import{q as b,t as C,v as A,w as t,x as l,y as S,z as e,A as V}from"../chunks/8FUQuwgM.js";import{i as m}from"../chunks/CbJfRYJV.js";import{i as k}from"../chunks/DxxhVGi2.js";import{A as P}from"../chunks/Scb_NG-a.js";import{V as q,C as z}from"../chunks/DKIqe64p.js";import{w as p}from"../chunks/EDLlAC9C.js";import{n as E}from"../chunks/glgUBDR2.js";var L=d('<h2 class="svelte-1uha8ag"> </h2>'),T=d('<div class="content-row svelte-1uha8ag"><div class="entity-area svelte-1uha8ag"><!> <div class="welcome svelte-1uha8ag"><!> <p class="svelte-1uha8ag">Select an entity from the sidebar to get started.</p></div></div> <!></div>');function M(c,f){b(f,!1);const h=C("chat");E.showEntity(),k(),P(c,{children:(g,W)=>{var o=T(),s=t(o),i=t(s);q(i,{activeView:"entity"});var v=l(i,2),_=t(v);{var u=a=>{var r=L(),y=t(r);e(r),V(()=>$(y,`Welcome to ${(p.name||"Studiograph")??""}`)),n(a,r)};m(_,a=>{p.nameLoaded&&a(u)})}S(2),e(v),e(s);var w=l(s,2);{var x=a=>{z(a,{})};m(w,a=>{h.open&&a(x)})}e(o),n(g,o)},$$slots:{default:!0}}),A()}export{M as component};