ocean-brain 0.7.5 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +3 -3
- package/dist/mcp.js +180 -736
- package/package.json +4 -1
- package/server/client/dist/assets/ArrowRight.es-C4zlc54Z.js +1 -0
- package/server/client/dist/assets/{Calendar-Bc2zJueR.js → Calendar-COrN6Hjv.js} +2 -2
- package/server/client/dist/assets/Callout-BK0K9E74.js +1 -0
- package/server/client/dist/assets/Copy.es-zm8f_XXX.js +1 -0
- package/server/client/dist/assets/Graph-BH1fzhue.js +1 -0
- package/server/client/dist/assets/{Image-DxWhlIDG.js → Image-KXuHOG4b.js} +1 -1
- package/server/client/dist/assets/Image.es-BKahRbIm.js +1 -0
- package/server/client/dist/assets/Note-C143cKKw.js +12 -0
- package/server/client/dist/assets/Plus.es-BqeC8T8h.js +1 -0
- package/server/client/dist/assets/Reminders-BYG5rz1M.js +1 -0
- package/server/client/dist/assets/Search-DBWsIMDP.js +1 -0
- package/server/client/dist/assets/{SurfaceCard-CkAVMLPs.js → SurfaceCard-CNSQfYfM.js} +1 -1
- package/server/client/dist/assets/Tag-5aCfSO8Y.js +1 -0
- package/server/client/dist/assets/TagNotes-BPZjN-6l.js +1 -0
- package/server/client/dist/assets/Trash.es-CRQkTnXZ.js +1 -0
- package/server/client/dist/assets/ViewNotes-DGLNF96x.js +1 -0
- package/server/client/dist/assets/ViewSectionDialog-CzskgmMF.js +102 -0
- package/server/client/dist/assets/Views-DR5jT23G.js +1 -0
- package/server/client/dist/assets/{graph-vendor-CUxe67Lr.js → graph-vendor-UTvF2NS_.js} +2 -2
- package/server/client/dist/assets/image.api-8dlMwzMd.js +17 -0
- package/server/client/dist/assets/{index-C5BGzDgt.css → index-BEUqDuAZ.css} +1 -1
- package/server/client/dist/assets/{index-D3BfroIT.js → index-DGIAh3ZY.js} +1 -1
- package/server/client/dist/assets/index-VHp17GQX.js +342 -0
- package/server/client/dist/assets/manage-image-RqtWKas2.js +1 -0
- package/server/client/dist/assets/{manage-image-detail-C8Q7K7I3.js → manage-image-detail-BTSIbLlQ.js} +1 -1
- package/server/client/dist/assets/mcp-EDurbggR.js +4 -0
- package/server/client/dist/assets/mcp-admin-adapter-DmGUo5G8.js +1 -0
- package/server/client/dist/assets/{note-core-Z6kqulGB.js → note-core-BklwyZHk.js} +1 -1
- package/server/client/dist/assets/{note-vendor-i1M2FSI2.js → note-vendor-DkYKUmLo.js} +1 -1
- package/server/client/dist/assets/{placeholder-Cr_nI8UI.js → placeholder-DeKgSBnC.js} +4 -4
- package/server/client/dist/assets/{properties-CvYWJWUM.js → properties-BjrZvOYn.js} +1 -1
- package/server/client/dist/assets/tag.api-Dl8DQd0m.js +21 -0
- package/server/client/dist/assets/trash-C5ntddLu.js +1 -0
- package/server/client/dist/assets/{useReminderMutate-CDmIEwsw.js → useReminderMutate-CoXXqJY2.js} +1 -1
- package/server/client/dist/index.html +5 -5
- package/server/dist/features/auth/http/login-page.js +1 -1
- package/server/dist/features/image/http/upload.js +34 -23
- package/server/dist/features/image/http/upload.js.map +1 -1
- package/server/dist/features/image/services/validation.js +111 -0
- package/server/dist/features/image/services/validation.js.map +1 -0
- package/server/dist/features/mcp-admin/http/handlers.js +11 -3
- package/server/dist/features/mcp-admin/http/handlers.js.map +1 -1
- package/server/dist/features/note/http/mcp.js +8 -43
- package/server/dist/features/note/http/mcp.js.map +1 -1
- package/server/dist/features/note/services/cleanup.js +2 -2
- package/server/dist/features/note/services/cleanup.js.map +1 -1
- package/server/dist/features/note/services/markdown-intent-write.js +11 -43
- package/server/dist/features/note/services/markdown-intent-write.js.map +1 -1
- package/server/dist/features/note/services/markdown-patch.js +4 -123
- package/server/dist/features/note/services/markdown-patch.js.map +1 -1
- package/server/dist/features/note/services/write.js +13 -13
- package/server/dist/features/note/services/write.js.map +1 -1
- package/server/dist/features/tag/graphql/tag.query.resolver.js +16 -1
- package/server/dist/features/tag/graphql/tag.query.resolver.js.map +1 -1
- package/server/dist/features/tag/graphql/tag.type-defs.js +2 -0
- package/server/dist/features/tag/graphql/tag.type-defs.js.map +1 -1
- package/server/dist/modules/app-version.js +105 -0
- package/server/dist/modules/app-version.js.map +1 -0
- package/server/dist/modules/mcp-auth.js +62 -1
- package/server/dist/modules/mcp-auth.js.map +1 -1
- package/server/dist/paths.js +1 -0
- package/server/dist/paths.js.map +1 -1
- package/server/dist/routes/api.js +2 -8
- package/server/dist/routes/api.js.map +1 -1
- package/server/dist/routes/client.js +51 -1
- package/server/dist/routes/client.js.map +1 -1
- package/server/client/dist/assets/Callout-B4kA_Cvr.js +0 -1
- package/server/client/dist/assets/Graph-uq5jfJgt.js +0 -1
- package/server/client/dist/assets/Image.es-BpAOJjJT.js +0 -1
- package/server/client/dist/assets/Note-Bo8ZYRP-.js +0 -22
- package/server/client/dist/assets/Plus.es-Dc_js8AC.js +0 -1
- package/server/client/dist/assets/Reminders-lj7Equld.js +0 -1
- package/server/client/dist/assets/Search-1wcRO5--.js +0 -1
- package/server/client/dist/assets/Tag-CeygwFfv.js +0 -1
- package/server/client/dist/assets/TagNotes-B8DqItxw.js +0 -1
- package/server/client/dist/assets/Trash.es-OuQVb_SX.js +0 -1
- package/server/client/dist/assets/ViewNotes-BH7PbdOD.js +0 -1
- package/server/client/dist/assets/ViewSectionTableRenderer-BJwhd5be.js +0 -102
- package/server/client/dist/assets/Views-eYFtsdFj.js +0 -1
- package/server/client/dist/assets/image.api-C0eYGCeH.js +0 -17
- package/server/client/dist/assets/index-jIfkRdY_.js +0 -361
- package/server/client/dist/assets/manage-image-C0YwkLIP.js +0 -1
- package/server/client/dist/assets/mcp-DHHhTLC8.js +0 -1
- package/server/client/dist/assets/trash-DA27aW7L.js +0 -1
- package/server/dist/features/image/services/remote-fetch.js +0 -176
- package/server/dist/features/image/services/remote-fetch.js.map +0 -1
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import{h as g,c as ae,T as d,B as T,L as ze,N as _e,t as re,M as P,E as f,I as ne,at as ie,au as R,X as qe,S as N,e as m,as as Be,F as Me}from"./index-VHp17GQX.js";import{j as e}from"./note-vendor-DkYKUmLo.js";import{a as h}from"./graph-vendor-UTvF2NS_.js";const Z=`
|
|
2
|
+
id
|
|
3
|
+
tabId
|
|
4
|
+
title
|
|
5
|
+
displayType
|
|
6
|
+
displayOptions {
|
|
7
|
+
tableColumns
|
|
8
|
+
}
|
|
9
|
+
tagNames
|
|
10
|
+
mode
|
|
11
|
+
propertyFilters {
|
|
12
|
+
key
|
|
13
|
+
name
|
|
14
|
+
valueType
|
|
15
|
+
operator
|
|
16
|
+
value
|
|
17
|
+
}
|
|
18
|
+
sortBy
|
|
19
|
+
sortOrder
|
|
20
|
+
limit
|
|
21
|
+
order
|
|
22
|
+
`;function rt(){return g(`query FetchViewWorkspace {
|
|
23
|
+
viewWorkspace {
|
|
24
|
+
activeTabId
|
|
25
|
+
tabs {
|
|
26
|
+
id
|
|
27
|
+
title
|
|
28
|
+
order
|
|
29
|
+
sections {
|
|
30
|
+
${Z}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}`)}function nt(t){return g(`query FetchViewSection($id: ID!) {
|
|
35
|
+
viewSection(id: $id) {
|
|
36
|
+
${Z}
|
|
37
|
+
}
|
|
38
|
+
}`,{id:t})}function it(t,{limit:r=25,offset:a=0}={}){return g(`query FetchViewSectionNotes($id: ID!, $pagination: PaginationInput) {
|
|
39
|
+
viewSectionNotes(id: $id, pagination: $pagination) {
|
|
40
|
+
totalCount
|
|
41
|
+
notes {
|
|
42
|
+
id
|
|
43
|
+
title
|
|
44
|
+
pinned
|
|
45
|
+
tags {
|
|
46
|
+
id
|
|
47
|
+
name
|
|
48
|
+
}
|
|
49
|
+
createdAt
|
|
50
|
+
updatedAt
|
|
51
|
+
properties {
|
|
52
|
+
key
|
|
53
|
+
name
|
|
54
|
+
value
|
|
55
|
+
valueType
|
|
56
|
+
option { id label value color order }
|
|
57
|
+
createdAt
|
|
58
|
+
updatedAt
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}`,{id:t,pagination:{limit:r,offset:a}})}function lt(t){return g(`mutation CreateViewTab($title: String!) {
|
|
63
|
+
createViewTab(title: $title) {
|
|
64
|
+
id
|
|
65
|
+
}
|
|
66
|
+
}`,{title:t})}function ot(t,r){return g(`mutation UpdateViewTab($id: ID!, $title: String!) {
|
|
67
|
+
updateViewTab(id: $id, title: $title) {
|
|
68
|
+
id
|
|
69
|
+
}
|
|
70
|
+
}`,{id:t,title:r})}function dt(t){return g(`mutation DeleteViewTab($id: ID!) {
|
|
71
|
+
deleteViewTab(id: $id)
|
|
72
|
+
}`,{id:t})}function ct(t){return g(`mutation SetActiveViewTab($id: ID!) {
|
|
73
|
+
setActiveViewTab(id: $id) {
|
|
74
|
+
activeTabId
|
|
75
|
+
tabs {
|
|
76
|
+
id
|
|
77
|
+
title
|
|
78
|
+
order
|
|
79
|
+
sections {
|
|
80
|
+
${Z}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}`,{id:t})}function ut(t){return g(`mutation ReorderViewTabs($tabIds: [ID!]!) {
|
|
85
|
+
reorderViewTabs(tabIds: $tabIds) {
|
|
86
|
+
id
|
|
87
|
+
}
|
|
88
|
+
}`,{tabIds:t})}function pt(t,r){return g(`mutation CreateViewSection($tabId: ID!, $input: ViewSectionInput!) {
|
|
89
|
+
createViewSection(tabId: $tabId, input: $input) {
|
|
90
|
+
id
|
|
91
|
+
}
|
|
92
|
+
}`,{tabId:t,input:r})}function mt(t,r){return g(`mutation UpdateViewSection($id: ID!, $input: ViewSectionInput!) {
|
|
93
|
+
updateViewSection(id: $id, input: $input) {
|
|
94
|
+
id
|
|
95
|
+
}
|
|
96
|
+
}`,{id:t,input:r})}function bt(t){return g(`mutation DeleteViewSection($id: ID!) {
|
|
97
|
+
deleteViewSection(id: $id)
|
|
98
|
+
}`,{id:t})}function xt(t,r){return g(`mutation ReorderViewSections($tabId: ID!, $sectionIds: [ID!]!) {
|
|
99
|
+
reorderViewSections(tabId: $tabId, sectionIds: $sectionIds) {
|
|
100
|
+
id
|
|
101
|
+
}
|
|
102
|
+
}`,{tabId:t,sectionIds:r})}const Pe={compact:"h-[22px] px-2",regular:"h-7 px-2.5"};function W({children:t,className:r,contentClassName:a,size:n="regular",truncateContent:o=!0,...y}){return e.jsx("span",{className:ae("inline-flex min-w-0 items-center overflow-hidden whitespace-nowrap rounded-full border text-xs font-medium leading-none",Pe[n],r),...y,children:o?e.jsx("span",{className:ae("min-w-0 truncate",a),children:t}):t})}const J=["title","tags","properties","createdAt","updatedAt"],ht={activeTabId:null,tabs:[]},Re=t=>{const r=t.trim();return r?r.startsWith("@")?r:r.startsWith("#")?`@${r.slice(1)}`:`@${r}`:""},fe=(t,r,a)=>{if(r===a)return t;const n=t.findIndex(b=>b.id===r),o=t.findIndex(b=>b.id===a);if(n<0||o<0)return t;const y=[...t],[$]=y.splice(n,1);return y.splice(o,0,$),y},le=t=>{const r=t.flatMap(a=>typeof a=="string"?a.split(","):[]);return Array.from(new Set(r.map(Re).filter(Boolean)))},gt=t=>t.tabs.length===0?null:t.activeTabId?t.tabs.find(r=>r.id===t.activeTabId)??t.tabs[0]??null:t.tabs[0]??null,vt=(t,r)=>t.tabs.some(a=>a.id===r)?{...t,activeTabId:r}:t,yt=(t,r,a)=>({...t,tabs:fe(t.tabs,r,a)}),ft=(t,r,a,n)=>({...t,tabs:t.tabs.map(o=>o.id===r?{...o,sections:fe(o.sections,a,n)}:o)}),oe=t=>t==="or"?"OR — any selected tag":"AND — all selected tags",jt=t=>t==="or"?"OR":"AND",je=t=>{switch(t){case"notEquals":return"is not";case"contains":return"contains";case"notContains":return"does not contain";case"before":return"before";case"after":return"after";case"exists":return"is set";case"notExists":return"is empty";default:return"is"}},We=t=>{switch(t){case"table":return"Table";case"calendar":return"Unavailable";default:return"List"}},we=t=>{switch(t){case"tags":return"Tags";case"properties":return"Properties";case"createdAt":return"Created";case"updatedAt":return"Updated";default:return"Title"}},U=t=>{const r=new Set(J),a=(t??[]).filter(o=>r.has(o)),n=Array.from(new Set(a));return n.length===0?[...J]:n.includes("title")?n:["title",...n]},Ne=t=>({tableColumns:U(t?.tableColumns)}),wt=t=>{const r=je(t.operator);return t.operator==="exists"||t.operator==="notExists"?`${t.name} ${r}`:`${t.name} ${r} ${t.value??""}`.trim()},Nt=(t,r={})=>{const a={...t,...r};return{title:a.title,displayType:a.displayType,displayOptions:Ne(a.displayOptions),tagNames:a.tagNames,mode:a.mode,propertyFilters:a.propertyFilters.map(n=>({key:n.key,valueType:n.valueType,operator:n.operator,value:n.value})),sortBy:a.sortBy,sortOrder:a.sortOrder,limit:a.limit}},Tt=t=>({page:1,sectionId:t.id}),Ue=t=>t.valueType==="select"?t.option?.label??t.value:t.valueType==="boolean"?t.value==="true"?"True":"False":t.value,He=t=>(t.properties??[]).slice(0,3),Te={title:280,tags:190,properties:260,createdAt:132,updatedAt:132},Ye={title:"title",createdAt:"createdAt",updatedAt:"updatedAt"},Ve="flex h-[22px] min-w-0 max-w-full items-center gap-1.5 overflow-hidden whitespace-nowrap",Ce="text-xs leading-5 text-fg-tertiary",Ge=t=>{const r=t.reduce((a,n)=>a+Te[n],0);return Math.max(520,r)},Ke=(t,r={})=>{if(t.tags.length===0)return r.hideEmpty?null:e.jsx("span",{className:Ce,children:"—"});const a=t.tags.slice(0,3),n=t.tags.length-a.length;return e.jsxs("div",{className:Ve,children:[a.map(o=>e.jsx(W,{size:"compact",className:"max-w-[132px] shrink-0 border-border-subtle bg-transparent text-fg-secondary",children:o.name},o.id)),n>0&&e.jsxs(W,{size:"compact",className:"shrink-0 border-border-subtle bg-subtle text-fg-tertiary",children:["+",n]})]})},Qe=(t,r={})=>{const a=He(t);if(a.length===0)return r.hideEmpty?null:e.jsx("span",{className:Ce,children:"—"});const n=(t.properties?.length??0)-a.length;return e.jsxs("div",{className:Ve,children:[a.map(o=>e.jsxs(W,{size:"compact",truncateContent:!1,className:"max-w-[190px] shrink-0 gap-1 border-border-subtle bg-subtle text-fg-secondary",children:[e.jsx("span",{className:"min-w-0 max-w-[76px] shrink truncate text-fg-tertiary",children:o.name}),e.jsx("span",{className:"min-w-0 truncate",children:Ue(o)||"—"})]},o.key)),n>0&&e.jsxs(W,{size:"compact",className:"shrink-0 border-border-subtle bg-subtle text-fg-tertiary",children:["+",n]})]})};function Vt({section:t,notes:r,isPending:a,isError:n,onRetry:o,onSortChange:y,isSortPending:$,surface:b="flush"}){const V=U(t.displayOptions?.tableColumns),L=Ge(V),z=b==="card"?"overflow-x-auto rounded-[16px] border border-border-subtle bg-elevated":"overflow-x-auto bg-transparent",C=b==="card"?"overflow-hidden rounded-[16px] border border-border-subtle bg-elevated":"overflow-hidden bg-transparent",I=b==="card"?"bg-elevated":"bg-transparent",F=b==="card"?"bg-subtle/65":"bg-subtle/45",_=b==="card"?"bg-elevated":"bg-transparent",E=c=>{const u=Ye[c],O=we(c),k=u?t.sortBy===u:!1;return e.jsx("th",{"aria-sort":k?t.sortOrder==="asc"?"ascending":"descending":void 0,className:"px-3 py-2.5 text-xs font-semibold text-fg-tertiary",children:u?e.jsxs("button",{type:"button",className:"focus-ring-soft -ml-1 inline-flex items-center gap-1 rounded-[8px] px-1 py-0.5 outline-none transition-colors hover:bg-hover-subtle hover:text-fg-secondary disabled:cursor-wait disabled:opacity-60",disabled:$,onClick:()=>y(u),children:[e.jsx("span",{children:O}),e.jsx("span",{"aria-hidden":"true",className:"text-[10px] text-fg-tertiary",children:k?t.sortOrder==="asc"?"↑":"↓":"↕"})]}):O},c)},S=(c,u)=>{switch(u){case"tags":return e.jsx("td",{className:"overflow-hidden px-3 py-2.5 align-middle",children:Ke(c)},u);case"properties":return e.jsx("td",{className:"overflow-hidden px-3 py-2.5 align-middle",children:Qe(c)},u);case"createdAt":return e.jsx("td",{className:"whitespace-nowrap px-3 py-2.5 align-middle",children:e.jsx(d,{as:"span",variant:"meta",tone:"tertiary",children:re(Number(c.createdAt))})},u);case"updatedAt":return e.jsx("td",{className:"whitespace-nowrap px-3 py-2.5 align-middle",children:e.jsx(d,{as:"span",variant:"meta",tone:"tertiary",children:re(Number(c.updatedAt))})},u);default:return e.jsx("td",{className:"px-3 py-2.5 align-middle",children:e.jsx(d,{as:"div",variant:"body",weight:"semibold",className:"line-clamp-1",children:e.jsx(ze,{to:_e,params:{id:c.id},className:"focus-ring-soft rounded-[6px] outline-none transition-colors hover:text-fg-default/85",children:c.title||"Untitled"})})},u)}};return a?e.jsxs("div",{className:C,children:[e.jsx("div",{className:"h-11 animate-pulse bg-subtle/50"}),e.jsx("div",{className:`h-14 animate-pulse border-t border-border-subtle ${I}`}),e.jsx("div",{className:`h-14 animate-pulse border-t border-border-subtle ${I}`}),e.jsx("div",{className:`h-14 animate-pulse border-t border-border-subtle ${I}`})]}):n?e.jsxs("div",{className:"rounded-[16px] border border-border-subtle bg-subtle/30 p-4",children:[e.jsx(d,{as:"p",variant:"body",weight:"semibold",children:"Failed to load this table"}),e.jsx(d,{as:"p",variant:"meta",tone:"tertiary",className:"mt-1",children:"Retry to refresh this saved query."}),e.jsx("div",{className:"mt-3",children:e.jsx(T,{type:"button",variant:"ghost",size:"sm",onClick:o,children:"Retry"})})]}):r.length===0?e.jsxs("div",{className:"rounded-[16px] border border-dashed border-border-subtle px-4 py-5",children:[e.jsx(d,{as:"p",variant:"body",weight:"semibold",children:"No rows yet"}),e.jsx(d,{as:"p",variant:"meta",tone:"tertiary",className:"mt-1",children:"Add matching notes, or edit this view query."})]}):e.jsx("div",{className:z,children:e.jsxs("table",{className:"w-full table-fixed border-collapse text-left",style:{minWidth:L},children:[e.jsx("caption",{className:"sr-only",children:"View query results as a table"}),e.jsx("colgroup",{children:V.map(c=>e.jsx("col",{style:{width:Te[c]}},c))}),e.jsx("thead",{className:F,children:e.jsx("tr",{className:"border-b border-border-subtle",children:V.map(E)})}),e.jsx("tbody",{className:_,children:r.map(c=>e.jsx("tr",{className:"h-12 border-b border-border-subtle/70 last:border-b-0",children:V.map(u=>S(c,u))},c.id))})]})})}const Q="__choose_property__",Xe=["title","tags","properties","createdAt","updatedAt"],de=t=>String(t?.limit??5),ce=t=>t?.displayType==="table"?"table":"list",ue=t=>U(t?.displayOptions?.tableColumns??J),pe=t=>t?.mode??"and",me=t=>t?t.tagNames.join(", "):"",be=t=>t?.title??"",xe=t=>t?.sortBy??"updatedAt",he=t=>t?.sortOrder??"desc",Ie=t=>`property-filter-${Date.now()}-${t}`,ge=t=>(t?.propertyFilters??[]).map((r,a)=>({id:Ie(a),key:r.key,operator:r.operator,value:r.value??""})),ve=t=>t?t.valueType==="date"||t.valueType==="number"?["equals","notEquals","before","after","exists","notExists"]:t.valueType==="text"||t.valueType==="url"?["equals","notEquals","contains","notContains","exists","notExists"]:["equals","notEquals","exists","notExists"]:["exists","notExists"],ye=t=>t?"equals":"exists",Je=t=>t?t.valueType==="boolean"?"true":t.valueType==="select"?t.options[0]?.value??"":"":"",X=t=>t!=="exists"&&t!=="notExists",Se=t=>t==="contains"||t==="notContains",Ze=(t,r)=>t.valueType==="date"?"date":t.valueType==="number"?"number":t.valueType==="url"&&!Se(r)?"url":"text",et=(t,r)=>{if(t.valueType==="url")return Se(r)?"example.com":"https://example.com";if(t.valueType==="text")return"Value"};function Ct({open:t,mode:r,initialSection:a=null,availableTags:n,availableProperties:o,isTagsLoading:y=!1,isPropertiesLoading:$=!1,onClose:b,onSubmit:V}){const[L,z]=h.useState(be(a)),[C,I]=h.useState(ce(a)),[F,_]=h.useState(ue(a)),[E,S]=h.useState(me(a)),[c,u]=h.useState(pe(a)),[O,k]=h.useState(xe(a)),[ee,te]=h.useState(he(a)),[H,se]=h.useState(de(a)),[A,q]=h.useState(ge(a)),[Ae,Y]=h.useState((a?.tagNames.length??0)>0),[G,x]=h.useState(""),B=h.useMemo(()=>new Map(o.map(s=>[s.key,s])),[o]);h.useEffect(()=>{t&&(z(be(a)),I(ce(a)),_(ue(a)),S(me(a)),u(pe(a)),k(xe(a)),te(he(a)),se(de(a)),q(ge(a)),Y((a?.tagNames.length??0)>0),x(""))},[a,t]);const j=le([E]),M=Ae||j.length>0,$e=j.length===0&&A.length===0,Fe=s=>{s!=="title"&&(_(l=>{if(l.includes(s)){const v=l.filter(i=>i!==s);return v.length>0?v:l}return U([...l,s])}),x(""))},Ee=s=>{const l=j.includes(s)?j.filter(v=>v!==s):[...j,s];S(l.join(", ")),x("")},Oe=()=>{Y(!0),x("")},ke=()=>{S(""),u("and"),Y(!1),x("")},De=()=>{if(o.length===0){x("Create a shared property before adding a filter.");return}q(s=>[...s,{id:Ie(s.length),key:"",operator:"exists",value:""}]),x("")},D=(s,l)=>{q(v=>v.map(i=>{if(i.id!==s)return i;const w={...i,...l},p=B.get(w.key);return ve(p).includes(w.operator)||(w.operator=ye(p)),"key"in l&&(w.value=Je(p),w.operator=ye(p)),w})),x("")},Le=s=>{q(l=>l.filter(v=>v.id!==s)),x("")};return e.jsxs(P,{isOpen:t,onClose:b,variant:"form",className:"sm:max-w-[720px]",children:[e.jsx(P.Header,{title:r==="create"?"Create section":"Edit section",onClose:b}),e.jsx(P.Body,{children:e.jsxs("form",{id:"view-section-form",className:"flex flex-col gap-5",onSubmit:s=>{s.preventDefault();const l=le([E]);if(M&&l.length===0){x("Choose at least one tag, or remove this tag filter.");return}if(A.find(p=>!p.key||!B.has(p.key))){x("Choose a property for every filter.");return}const i=A.map(p=>{const K=B.get(p.key);return{key:K?.key??p.key,valueType:K?.valueType??"text",operator:p.operator,value:X(p.operator)?p.value:null}});if(i.some(p=>X(p.operator)&&!p.value?.trim())){x("Fill every filter value, or switch it to is set / is empty.");return}V({title:L,displayType:C,displayOptions:Ne({tableColumns:F}),tagNames:l,mode:c,propertyFilters:i,sortBy:O,sortOrder:ee,limit:Number(H)})},children:[e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(f,{htmlFor:"view-section-title",size:"md",children:"Section name"}),e.jsx(ne,{id:"view-section-title",value:L,onChange:s=>z(s.target.value),placeholder:"Doing notes",autoFocus:!0})]}),e.jsxs("section",{className:"flex flex-col gap-3 rounded-[18px] border border-border-subtle bg-elevated px-4 py-3",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx(f,{size:"md",children:"Display"}),e.jsx(d,{as:"p",variant:"meta",tone:"tertiary",className:"mt-1",children:"Show the same query as a compact list or a table."})]}),e.jsx(d,{as:"span",variant:"meta",tone:"tertiary",children:We(C)})]}),e.jsxs(ie,{type:"single",value:C,onValueChange:s=>{(s==="list"||s==="table")&&I(s)},variant:"quiet",size:"sm",className:"self-start",children:[e.jsx(R,{value:"list","aria-label":"Show as list",children:"List"}),e.jsx(R,{value:"table","aria-label":"Show as table",children:"Table"})]}),C==="table"?e.jsxs("div",{className:"rounded-[16px] border border-border-subtle bg-subtle/45 p-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[e.jsx(f,{size:"sm",children:"Table columns"}),e.jsxs(d,{as:"span",variant:"meta",tone:"tertiary",children:[F.length," shown"]})]}),e.jsx("div",{className:"mt-3 grid gap-2 sm:grid-cols-2",children:Xe.map(s=>{const l=we(s);return e.jsxs("div",{className:"flex items-center gap-2 rounded-[12px] border border-border-subtle bg-elevated px-3 py-2",children:[e.jsx(qe,{size:"sm",checked:F.includes(s),disabled:s==="title","aria-label":`Show ${l} column`,onChange:()=>Fe(s)}),e.jsx(d,{as:"span",variant:"label",tone:"secondary",children:l})]},s)})}),e.jsx(d,{as:"p",variant:"meta",tone:"tertiary",className:"mt-2",children:"Title is always shown because it opens the note."})]}):null]}),e.jsxs("section",{className:"flex flex-col gap-3 rounded-[20px] border border-border-subtle bg-subtle/40 p-4",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx(f,{size:"md",children:"Filters"}),e.jsx(d,{as:"p",variant:"meta",tone:"tertiary",className:"mt-1",children:"Use properties for structured fields, and tags for loose topics or context."})]}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx(T,{type:"button",variant:"subtle",size:"sm",onClick:De,children:"Add property filter"}),!M&&e.jsx(T,{type:"button",variant:"subtle",size:"sm",onClick:Oe,children:"Add tag filter"})]})]}),A.length===0&&!M?e.jsxs("div",{className:"rounded-[16px] border border-dashed border-border-subtle bg-elevated/60 px-4 py-3",children:[e.jsx(d,{as:"p",variant:"label",tone:"default",children:$e?"All notes":"No filters"}),e.jsx(d,{as:"p",variant:"meta",tone:"tertiary",className:"mt-1",children:"Add a property filter, a tag filter, or leave this view open to all notes."})]}):null,A.length>0?e.jsx("div",{className:"flex flex-col gap-2.5",children:A.map(s=>{const l=B.get(s.key),v=ve(l);return e.jsxs("div",{className:"grid gap-2 rounded-[16px] border border-border-subtle bg-elevated p-3 md:grid-cols-[minmax(0,1fr)_minmax(10.5rem,12rem)_minmax(0,1fr)_auto] md:items-center",children:[e.jsxs(N,{value:s.key||Q,ariaLabel:"Property filter property",className:"w-full min-w-0",onValueChange:i=>{i!==Q&&D(s.id,{key:i})},children:[e.jsx(m,{value:Q,disabled:!0,children:"Choose property"}),o.map(i=>e.jsx(m,{value:i.key,children:i.name},i.key))]}),e.jsx(N,{value:s.operator,disabled:!l,ariaLabel:"Property filter operator",className:"w-full min-w-0",onValueChange:i=>D(s.id,{operator:i}),children:v.map(i=>e.jsx(m,{value:i,children:je(i)},i))}),X(s.operator)&&l?l.valueType==="select"?e.jsx(N,{value:s.value,ariaLabel:"Property filter value",className:"w-full min-w-0",onValueChange:i=>D(s.id,{value:i}),children:l.options.map(i=>e.jsx(m,{value:i.value,children:i.label},i.value))}):l.valueType==="boolean"?e.jsxs(N,{value:s.value||"true",ariaLabel:"Property filter value",className:"w-full min-w-0",onValueChange:i=>D(s.id,{value:i}),children:[e.jsx(m,{value:"true",children:"True"}),e.jsx(m,{value:"false",children:"False"})]}):e.jsx(ne,{type:Ze(l,s.operator),value:s.value,onChange:i=>D(s.id,{value:i.target.value}),placeholder:et(l,s.operator),"aria-label":"Property filter value"}):e.jsx(d,{as:"span",variant:"label",tone:"tertiary",children:l?"No value needed":"Choose a property first"}),e.jsx(T,{type:"button",variant:"ghost",size:"sm",onClick:()=>Le(s.id),children:"Remove"})]},s.id)})}):null,M?e.jsxs("div",{className:"flex flex-col gap-3 rounded-[16px] border border-border-subtle bg-elevated p-3",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx(d,{as:"p",variant:"label",tone:"default",children:"Tag filter"}),e.jsx(d,{as:"p",variant:"meta",tone:"tertiary",className:"mt-1",children:"Match notes by selected tags."})]}),e.jsx(T,{type:"button",variant:"ghost",size:"sm",onClick:ke,children:"Remove"})]}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(f,{htmlFor:"view-section-tags",size:"sm",children:"Tag names"}),e.jsx(Be,{id:"view-section-tags",value:E,onChange:s=>{S(s.target.value),x("")},placeholder:"@OceanBrain, @todo",size:"sm"}),e.jsx(d,{as:"p",variant:"meta",tone:"tertiary",children:"You can use tags only, properties only, both together, or no filters."})]}),j.length>1?e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(f,{size:"sm",children:"Tag match"}),e.jsxs(ie,{type:"single",value:c,onValueChange:s=>{(s==="and"||s==="or")&&u(s)},variant:"quiet",size:"sm",className:"self-start",children:[e.jsx(R,{value:"and","aria-label":oe("and"),children:"AND"}),e.jsx(R,{value:"or","aria-label":oe("or"),children:"OR"})]}),e.jsx(d,{as:"p",variant:"meta",tone:"tertiary",children:"AND requires every selected tag. OR accepts any selected tag."})]}):null,e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx(f,{size:"sm",children:"Existing tags"}),e.jsx(d,{as:"span",variant:"meta",tone:"tertiary",children:y?"Loading...":`${n.length} available`})]}),n.length>0?e.jsx("div",{className:"max-h-44 overflow-y-auto rounded-[16px] border border-border-subtle bg-hover-subtle/60 p-3",children:e.jsx("div",{className:"flex flex-wrap gap-2",children:n.map(s=>{const l=j.includes(s.name);return e.jsx("button",{type:"button",className:`inline-flex items-center rounded-full border px-3 py-1.5 text-sm font-medium transition-colors ${l?"border-border-secondary bg-elevated text-fg-default":"border-border-subtle bg-transparent text-fg-secondary hover:border-border-secondary hover:bg-elevated hover:text-fg-default"}`,"aria-pressed":l,onClick:()=>Ee(s.name),children:s.name},s.id)})})}):e.jsx(d,{as:"p",variant:"meta",tone:"tertiary",children:"No tags yet. You can still type tag names manually."})]}):null,e.jsx(d,{as:"p",variant:"meta",tone:G?"default":"tertiary",className:G?"text-fg-error":void 0,children:G||($||y?"Loading filter options...":`${o.length} properties · ${n.length} tags available`)})]}),e.jsxs("details",{className:"group rounded-[18px] border border-border-subtle bg-elevated px-4 py-3",children:[e.jsx("summary",{className:"cursor-pointer list-none",children:e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx(d,{as:"span",variant:"label",tone:"default",children:"Sort and limit"}),e.jsx(d,{as:"p",variant:"meta",tone:"tertiary",className:"mt-1",children:"Controls how many matching notes appear on the Views page preview."})]}),e.jsxs(d,{as:"span",variant:"meta",tone:"tertiary",children:[H," notes"]})]})}),e.jsxs("div",{className:"mt-4 grid gap-4 md:grid-cols-3",children:[e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(f,{id:"view-section-sort-by-label",htmlFor:"view-section-sort-by",size:"sm",children:"Sort by"}),e.jsxs(N,{id:"view-section-sort-by",value:O,"aria-labelledby":"view-section-sort-by-label",onValueChange:s=>k(s),children:[e.jsx(m,{value:"updatedAt",children:"Updated time"}),e.jsx(m,{value:"createdAt",children:"Created time"}),e.jsx(m,{value:"title",children:"Title"})]})]}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(f,{id:"view-section-sort-order-label",htmlFor:"view-section-sort-order",size:"sm",children:"Order"}),e.jsxs(N,{id:"view-section-sort-order",value:ee,"aria-labelledby":"view-section-sort-order-label",onValueChange:s=>te(s),children:[e.jsx(m,{value:"desc",children:"Descending"}),e.jsx(m,{value:"asc",children:"Ascending"})]})]}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(f,{id:"view-section-limit-label",htmlFor:"view-section-limit",size:"sm",children:"Preview rows"}),e.jsxs(N,{id:"view-section-limit",value:H,"aria-labelledby":"view-section-limit-label",onValueChange:se,children:[e.jsx(m,{value:"3",children:"3 rows"}),e.jsx(m,{value:"5",children:"5 rows"}),e.jsx(m,{value:"8",children:"8 rows"}),e.jsx(m,{value:"10",children:"10 rows"}),e.jsx(m,{value:"12",children:"12 rows"})]})]})]})]})]})}),e.jsx(P.Footer,{children:e.jsxs(Me,{children:[e.jsx(T,{type:"button",variant:"ghost",size:"sm",onClick:b,children:"Cancel"}),e.jsx(T,{type:"submit",size:"sm",form:"view-section-form",children:r==="create"?"Create section":"Save section"})]})})]})}export{ht as E,W as V,Vt as a,Tt as b,We as c,wt as d,Nt as e,it as f,jt as g,rt as h,gt as i,Ct as j,ut as k,ct as l,ft as m,xt as n,lt as o,ot as p,dt as q,yt as r,vt as s,pt as t,mt as u,bt as v,nt as w,oe as x};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e}from"./note-vendor-DkYKUmLo.js";import{T as u,B as v,L as z,N as ue,t as xe,k as M,u as R,q as b,V as $,D as U,l as B,m as H,n as G,o as K,p as he,r as J,v as be,w as Y,x as X,y as fe,z as Z,c as L,A as ee,M as D,E as ge,I as we,F as ye,G as ve,H as je,K as Ne,J as Se,O as ke,P as Te,i as P,Q,R as Ce,U as Ve,W as De}from"./index-VHp17GQX.js";import{a as C}from"./graph-vendor-UTvF2NS_.js";import{f as Re}from"./tag.api-Dl8DQd0m.js";import{V as S,a as Ee,b as qe,f as We,g as Ae,c as Fe,d as Pe,u as se,e as te,h as ze,i as Ke,E as Le,j as Ie,r as Oe,k as $e,s as Qe,l as _e,m as Me,n as Ue,o as Be,p as He,q as Ge,t as _,v as Je}from"./ViewSectionDialog-CzskgmMF.js";import{S as I}from"./SurfaceCard-CNSQfYfM.js";import{s as Ye}from"./ArrowRight.es-C4zlc54Z.js";import{n as O}from"./Plus.es-BqeC8T8h.js";import"./note-core-BklwyZHk.js";const Xe="group flex min-h-[64px] items-start justify-between gap-3 px-3 py-2.5 transition-colors hover:bg-hover-subtle",Ze=t=>{const r=t.tags.slice(0,2),n=t.tags.length-r.length;return r.length===0?null:e.jsxs(e.Fragment,{children:[r.map(o=>e.jsx(S,{size:"compact",className:"max-w-[116px] shrink-0 border-border-subtle bg-transparent text-fg-secondary",children:o.name},o.id)),n>0&&e.jsxs(S,{size:"compact",className:"shrink-0 border-border-subtle bg-subtle text-fg-tertiary",children:["+",n]})]})};function es({notes:t,isPending:r,isError:n,onRetry:o}){return r?e.jsxs("div",{className:"overflow-hidden bg-transparent",children:[e.jsx("div",{className:"h-[64px] animate-pulse bg-subtle/35"}),e.jsx("div",{className:"h-[64px] animate-pulse border-t border-border-subtle/70 bg-subtle/35"}),e.jsx("div",{className:"h-[64px] animate-pulse border-t border-border-subtle/70 bg-subtle/35"})]}):n?e.jsxs("div",{className:"rounded-[16px] border border-border-subtle bg-subtle/30 p-4",children:[e.jsx(u,{as:"p",variant:"body",weight:"semibold",children:"Failed to load this section"}),e.jsx(u,{as:"p",variant:"meta",tone:"tertiary",className:"mt-1",children:"Retry to refresh this saved query."}),e.jsx("div",{className:"mt-3",children:e.jsx(v,{type:"button",variant:"ghost",size:"sm",onClick:o,children:"Retry"})})]}):t.length===0?e.jsxs("div",{className:"rounded-[16px] border border-dashed border-border-subtle px-4 py-5",children:[e.jsx(u,{as:"p",variant:"body",weight:"semibold",children:"No notes match yet"}),e.jsx(u,{as:"p",variant:"meta",tone:"tertiary",className:"mt-1",children:"Add matching notes, or edit this view query."})]}):e.jsx("div",{className:"divide-y divide-border-subtle/70 bg-transparent",children:t.map(i=>e.jsxs(z,{to:ue,params:{id:i.id},className:Xe,children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx(u,{as:"div",variant:"body",weight:"semibold",className:"line-clamp-1",children:i.title||"Untitled"}),e.jsxs("div",{className:"mt-1.5 flex min-w-0 flex-wrap items-center gap-1.5",children:[e.jsxs(u,{as:"span",variant:"label",weight:"medium",tone:"secondary",className:"mr-0.5",children:["Updated ",xe(Number(i.updatedAt))]}),Ze(i)]})]}),e.jsx(Ye,{className:"mt-0.5 h-4 w-4 shrink-0 text-fg-tertiary transition-transform group-hover:translate-x-0.5"})]},i.id))})}function ss({onEdit:t}){return e.jsxs("div",{className:"rounded-[16px] border border-dashed border-border-subtle bg-subtle/40 px-4 py-5",children:[e.jsx(u,{as:"p",variant:"body",weight:"semibold",children:"This display type is unavailable"}),e.jsx(u,{as:"p",variant:"meta",tone:"tertiary",className:"mt-1",children:"Switch this section to List or Table to preview the saved query here."}),e.jsx("div",{className:"mt-3",children:e.jsx(v,{type:"button",variant:"ghost",size:"sm",onClick:t,children:"Change display"})})]})}function ts({section:t,notes:r,isPending:n,isError:o,onRetry:i,onEdit:d,onSortChange:l,isSortPending:p}){return t.displayType==="table"?e.jsx(Ee,{section:t,notes:r,isPending:n,isError:o,onRetry:i,onSortChange:l,isSortPending:p}):t.displayType==="calendar"?e.jsx(ss,{onEdit:d}):e.jsx(es,{notes:r,isPending:n,isError:o,onRetry:i})}function rs({section:t,onEdit:r,onDuplicate:n,onDelete:o,dragHandle:i}){const d=M(),l=H(),[p,f]=C.useState(!1),g=qe(t),{data:j,isPending:w,isError:c,refetch:E}=R({queryKey:b.views.sectionNotes(t.id,{limit:t.limit,offset:0}),async queryFn(){const m=await We(t.id,{limit:t.limit,offset:0});if(m.type==="error")throw m;return m.viewSectionNotes}}),V=j?.notes??[],q=j?.totalCount??0,W=Ae(t.mode),A=t.tagNames.length>0||t.propertyFilters.length>0,F=async m=>{if(p)return;const h=t.sortBy===m?t.sortOrder==="asc"?"desc":"asc":m==="title"?"asc":"desc";f(!0);const x=await se(t.id,te(t,{sortBy:m,sortOrder:h}));if(x.type==="error"){l(x.errors[0]?.message??"Failed to update table sort."),f(!1);return}await d.invalidateQueries({queryKey:b.views.all(),exact:!1}),f(!1)};return e.jsxs(I,{flush:!0,className:"flex h-full flex-col overflow-hidden",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3 border-b border-border-subtle/75 px-4 py-3.5",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[i&&e.jsx("div",{className:"-mr-1 shrink-0 self-center",children:i}),e.jsx("div",{className:"min-w-0",children:e.jsx(u,{as:"h2",variant:"subheading",weight:"semibold",tracking:"tight",className:"min-w-0",children:e.jsx(z,{to:$,search:g,className:"truncate hover:text-fg-default/85",children:t.title})})})]}),e.jsxs("div",{className:"mt-3 flex flex-wrap gap-1.5",children:[e.jsx(S,{className:"max-w-full border-border-subtle/80 bg-elevated text-fg-secondary",children:Fe(t.displayType)}),t.tagNames.map((m,h)=>e.jsxs("div",{className:"flex min-w-0 items-center gap-1.5",children:[h>0&&e.jsx("span",{className:"px-0.5 text-[10px] font-semibold tracking-[0.08em] text-fg-tertiary/85",children:W}),e.jsx(S,{className:"max-w-full border-border-subtle/80 bg-transparent text-fg-secondary",children:m})]},m)),t.propertyFilters.map(m=>e.jsx(S,{className:"max-w-full border-border-subtle/80 bg-subtle text-fg-secondary",children:Pe(m)},`${m.key}-${m.operator}-${m.value??""}`)),!A&&e.jsx(S,{className:"max-w-full border-border-subtle/80 bg-transparent text-fg-tertiary",children:"All notes"})]})]}),e.jsx(U,{button:e.jsx(B,{label:"Section actions"}),items:[{name:"Edit section",onClick:r},{name:"Duplicate section",onClick:n},{type:"separator"},{name:"Delete section",onClick:o}]})]}),e.jsx("div",{className:"flex flex-1 flex-col",children:e.jsx(ts,{section:t,notes:V,isPending:w,isError:c,onRetry:()=>{E()},onEdit:r,onSortChange:F,isSortPending:p})}),e.jsxs("div",{className:"flex items-center justify-between gap-3 border-t border-border-subtle/75 px-4 py-3",children:[e.jsx(u,{as:"p",variant:"meta",tone:"tertiary",children:w?"Loading notes...":`Showing ${V.length} of ${q} notes`}),e.jsx(v,{asChild:!0,variant:"subtle",size:"sm",children:e.jsx(z,{to:$,search:g,children:"Open results"})})]})]})}const as="group flex h-10 max-w-[72vw] shrink-0 items-center rounded-[12px] border transition-[background-color,border-color,color,box-shadow] sm:max-w-[176px]",is="focus-ring-soft inline-flex h-full min-w-0 flex-1 touch-pan-x items-center gap-1 rounded-[11px] px-3 text-[13px] font-medium outline-none transition-colors";function ns({tab:t,isActive:r,onSelect:n}){const{attributes:o,listeners:i,setNodeRef:d,setActivatorNodeRef:l,transform:p,transition:f,isDragging:g}=Z({id:t.id});return e.jsx("div",{ref:d,style:{transform:ee.Translate.toString(p),transition:f,opacity:g?.6:1},className:L(as,r?"border-border-secondary/80 bg-elevated text-fg-default shadow-[0_8px_18px_-18px_rgba(15,18,24,0.28)]":"border-transparent bg-transparent text-fg-secondary hover:border-border-subtle/80 hover:bg-hover-subtle hover:text-fg-default"),children:e.jsxs("button",{type:"button",ref:l,...o,...i,role:"tab","aria-selected":r,title:`${t.title}. Drag to reorder.`,className:L(is,r?"text-fg-default":"text-fg-secondary group-hover:text-fg-default",g?"cursor-grabbing":"cursor-pointer"),onClick:n,children:[e.jsx("span",{className:"min-w-0 flex-1 truncate",children:t.title}),e.jsx("span",{className:"inline-flex min-w-4 shrink-0 items-center justify-center rounded-full bg-hover-subtle/75 px-1 py-0 text-[10px] leading-4 text-current/70",children:t.sections.length})]})})}function os({tabs:t,activeTabId:r,onSelectTab:n,onReorderTabs:o,onCreateTab:i}){const d=G(K(he,{activationConstraint:{distance:8}}));return e.jsx("div",{className:"-mx-1 rounded-[16px] border border-border-subtle/75 bg-subtle/50 p-1 sm:mx-0",children:e.jsx(J,{sensors:d,collisionDetection:Y,modifiers:[be],autoScroll:!1,onDragEnd:l=>{o(l)},children:e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(X,{items:t.map(l=>l.id),strategy:fe,children:e.jsx("div",{role:"tablist","aria-label":"Views tab list",className:"flex min-w-0 flex-1 items-center gap-1 overflow-x-auto overflow-y-hidden",children:t.map(l=>e.jsx(ns,{tab:l,isActive:l.id===r,onSelect:()=>{n(l)}},l.id))})}),e.jsxs(v,{type:"button","aria-label":"New view tab",variant:"ghost",size:"sm",className:"h-10 w-10 shrink-0 rounded-[12px] border-transparent bg-transparent px-0 text-[13px] text-fg-secondary hover:border-border-subtle/80 hover:bg-hover-subtle hover:text-fg-default sm:w-auto sm:px-2.5",onClick:i,children:[e.jsx(O,{className:"h-5 w-5 shrink-0"}),e.jsx("span",{className:"hidden sm:inline",children:"New view tab"})]})]})})})}function ls({open:t,mode:r,initialTitle:n="",onClose:o,onSubmit:i}){const[d,l]=C.useState(n);return C.useEffect(()=>{t&&l(n)},[n,t]),e.jsxs(D,{isOpen:t,onClose:o,variant:"form",className:"sm:max-w-[480px]",children:[e.jsx(D.Header,{title:r==="create"?"Create view tab":"Rename view tab",onClose:o}),e.jsx(D.Body,{children:e.jsxs("form",{id:"view-tab-form",className:"flex flex-col gap-4",onSubmit:p=>{p.preventDefault(),i(d)},children:[e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(ge,{htmlFor:"view-tab-title",size:"md",children:"Tab name"}),e.jsx(we,{id:"view-tab-title",value:d,onChange:p=>l(p.target.value),placeholder:"Now",autoFocus:!0})]}),e.jsx(u,{as:"p",variant:"meta",tone:"tertiary",children:"Each tab is one saved view inside the Views page."})]})}),e.jsx(D.Footer,{children:e.jsxs(ye,{children:[e.jsx(v,{type:"button",variant:"ghost",size:"sm",onClick:o,children:"Cancel"}),e.jsx(v,{type:"submit",size:"sm",form:"view-tab-form",children:r==="create"?"Create tab":"Save tab"})]})})]})}const cs="Save reusable note queries with tags, shared properties, and sorting.",ds="focus-ring-soft hidden h-8 w-8 items-center justify-center rounded-[10px] text-fg-default/70 outline-none transition-colors hover:bg-hover-subtle hover:text-fg-default sm:inline-flex touch-none",ms=({section:t,onEdit:r,onDuplicate:n,onDelete:o})=>{const{attributes:i,listeners:d,setNodeRef:l,setActivatorNodeRef:p,transform:f,transition:g,isDragging:j}=Z({id:t.id});return e.jsx("div",{ref:l,style:{transform:ee.Translate.toString(f),transition:g,opacity:j?.6:1},children:e.jsx(rs,{section:t,onEdit:r,onDuplicate:n,onDelete:o,dragHandle:e.jsx("button",{type:"button",ref:p,"aria-label":`Reorder section ${t.title}`,...i,...d,className:L(ds,j?"cursor-grabbing":"cursor-grab"),children:e.jsx(De,{className:"size-4"})})})})};function vs(){const t=ve(),r=H(),n=M(),[o,i]=C.useState(null),[d,l]=C.useState(null),{data:p,isPending:f,isError:g,refetch:j}=R({queryKey:b.views.workspace(),async queryFn(){const s=await ze();if(s.type==="error")throw s;return s.viewWorkspace}}),w=p??Le,c=Ke(w),{data:E,isPending:V}=R({queryKey:b.tags.list({limit:200}),async queryFn(){const s=await Re({limit:200});if(s.type==="error")throw s;return s.allTags}}),q=G(K(Se,{activationConstraint:{distance:8}}),K(Ne,{coordinateGetter:je})),W=E?.tags??[],{data:A,isPending:F}=R({queryKey:b.notes.propertyKeys({limit:100}),async queryFn(){const s=await ke({limit:100});if(s.type==="error")throw s;return s.notePropertyKeys}}),m=A?.keys??[],h=s=>{n.setQueryData(b.views.workspace(),s)},x=async()=>{await n.invalidateQueries({queryKey:b.views.all(),exact:!1})},re=async({active:s,over:a})=>{if(!a||s.id===a.id)return;const N=n.getQueryData(b.views.workspace())??w,y=Oe(N,String(s.id),String(a.id));h(y);const k=await $e(y.tabs.map(T=>T.id));if(k.type==="error"){h(N),r(k.errors[0].message);return}await x()},ae=async s=>{const a=n.getQueryData(b.views.workspace())??w,N=Qe(a,s.id);h(N);const y=await _e(s.id);if(y.type==="error"){h(a),r(y.errors[0].message);return}h(y.setActiveViewTab)},ie=async({active:s,over:a})=>{if(!c||!a||s.id===a.id)return;const N=n.getQueryData(b.views.workspace())??w,y=Me(N,c.id,String(s.id),String(a.id));h(y);const k=await Ue(c.id,y.tabs.find(T=>T.id===c.id)?.sections.map(T=>T.id)??[]);if(k.type==="error"){h(N),r(k.errors[0].message);return}await x()},ne=async s=>{const a=await Be(s);if(a.type==="error"){r(a.errors[0].message);return}await x(),i(null)},oe=async s=>{if(!c)return;const a=await He(c.id,s);if(a.type==="error"){r(a.errors[0].message);return}await x(),i(null)},le=async()=>{if(!c||!await t("Delete this view tab and all of its sections?"))return;const s=await Ge(c.id);if(s.type==="error"){r(s.errors[0].message);return}await x()},ce=async s=>{if(!c)return;const a=await _(c.id,s);if(a.type==="error"){r(a.errors[0].message);return}await x(),l(null)},de=async s=>{if(!c||!d||d.mode!=="edit")return;const a=await se(d.section.id,s);if(a.type==="error"){r(a.errors[0].message);return}await x(),l(null)},me=async s=>{const a=await _(s.tabId,{...te(s),title:`${s.title} copy`});if(a.type==="error"){r(a.errors[0].message);return}await x(),r("Section duplicated.")},pe=async s=>{if(!c||!await t("Delete this section from the current view tab?"))return;const a=await Je(s);if(a.type==="error"){r(a.errors[0].message);return}await x()};return e.jsxs(e.Fragment,{children:[e.jsx(Te,{title:"Views",description:cs,children:f&&!p?e.jsx(I,{className:"px-6 py-8 sm:px-8 sm:py-10",children:e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(P,{height:20,width:180,className:"rounded-full"}),e.jsx(P,{height:16,width:260,className:"rounded-full"}),e.jsx(P,{height:44,width:140,className:"rounded-[12px]"})]})}):g?e.jsxs(I,{className:"px-6 py-8 sm:px-8 sm:py-10",children:[e.jsx(u,{as:"p",variant:"body",weight:"semibold",children:"Failed to load saved views"}),e.jsx(u,{as:"p",variant:"meta",tone:"tertiary",className:"mt-1",children:"Retry loading your saved view tabs."}),e.jsx("div",{className:"mt-4",children:e.jsx(v,{type:"button",variant:"ghost",size:"sm",onClick:()=>{j()},children:"Retry"})})]}):w.tabs.length===0?e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(Q,{title:"Create your first view tab",description:"Start with a saved view tab, then add sections that query notes by tags, properties, or both.",className:"h-[320px]"}),e.jsx("div",{className:"flex justify-center",children:e.jsxs(v,{type:"button",onClick:()=>i({mode:"create"}),children:[e.jsx(O,{className:"h-4 w-4"}),"Create first tab"]})})]}):e.jsxs("div",{className:"flex flex-col gap-5",children:[e.jsx(os,{tabs:w.tabs,activeTabId:c?.id??null,onSelectTab:ae,onReorderTabs:re,onCreateTab:()=>i({mode:"create"})}),c&&e.jsxs("div",{className:"flex flex-col gap-5",children:[e.jsxs("div",{className:"flex flex-col gap-3 border-b border-border-subtle/80 px-1 pb-4 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx(u,{as:"h2",variant:"subheading",weight:"semibold",tracking:"tight",truncate:!0,children:c.title}),e.jsx(u,{as:"p",variant:"meta",tone:"tertiary",className:"mt-1",children:c.sections.length>0?`${c.sections.length} section${c.sections.length===1?"":"s"} in this view`:"Add sections to build this view"})]}),e.jsxs("div",{className:"inline-flex flex-wrap items-center gap-2 self-start sm:self-center",children:[e.jsxs(v,{type:"button",size:"sm",onClick:()=>l({mode:"create"}),children:[e.jsx(O,{className:"h-4 w-4"}),"Add section"]}),e.jsx(U,{button:e.jsx(B,{label:"View tab actions"}),items:[{name:"Rename tab",onClick:()=>i({mode:"edit",tab:c})},{type:"separator"},{name:"Delete tab",onClick:()=>{le()}}]})]})]}),c.sections.length===0?e.jsx(Q,{title:"Add the first section to this tab",description:"Sections can pull notes by tags, properties, or both.",className:"h-[300px]"}):e.jsx("div",{className:"flex flex-col",children:e.jsx(J,{sensors:q,collisionDetection:Y,modifiers:[Ce],onDragEnd:ie,children:e.jsx(X,{items:c.sections.map(s=>s.id),strategy:Ve,children:e.jsx("div",{className:"flex flex-col gap-4",children:c.sections.map(s=>e.jsx(ms,{section:s,onEdit:()=>l({mode:"edit",section:s}),onDuplicate:()=>{me(s)},onDelete:()=>{pe(s.id)}},s.id))})})})})]})]})}),e.jsx(ls,{open:o!==null,mode:o?.mode??"create",initialTitle:o?.mode==="edit"?o.tab.title:"",onClose:()=>i(null),onSubmit:s=>{if(o?.mode==="edit"){oe(s);return}ne(s)}}),e.jsx(Ie,{open:d!==null,mode:d?.mode??"create",initialSection:d?.mode==="edit"?d.section:null,availableTags:W,availableProperties:m,isTagsLoading:V,isPropertiesLoading:F,onClose:()=>l(null),onSubmit:s=>{if(d?.mode==="edit"){de(s);return}ce(s)}})]})}export{vs as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function Ao(e,n){for(var r=0;r<n.length;r++){const i=n[r];if(typeof i!="string"&&!Array.isArray(i)){for(const o in i)if(o!=="default"&&!(o in e)){const a=Object.getOwnPropertyDescriptor(i,o);a&&Object.defineProperty(e,o,a.get?a:{enumerable:!0,get:()=>i[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}function ui(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Je={exports:{}},V={};var Kn;function Co(){if(Kn)return V;Kn=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),a=Symbol.for("react.consumer"),s=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),l=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),c=Symbol.for("react.activity"),d=Symbol.iterator;function p(_){return _===null||typeof _!="object"?null:(_=d&&_[d]||_["@@iterator"],typeof _=="function"?_:null)}var y={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},x=Object.assign,v={};function g(_,M,U){this.props=_,this.context=M,this.refs=v,this.updater=U||y}g.prototype.isReactComponent={},g.prototype.setState=function(_,M){if(typeof _!="object"&&typeof _!="function"&&_!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,_,M,"setState")},g.prototype.forceUpdate=function(_){this.updater.enqueueForceUpdate(this,_,"forceUpdate")};function A(){}A.prototype=g.prototype;function T(_,M,U){this.props=_,this.context=M,this.refs=v,this.updater=U||y}var b=T.prototype=new A;b.constructor=T,x(b,g.prototype),b.isPureReactComponent=!0;var w=Array.isArray;function S(){}var k={H:null,A:null,T:null,S:null},E=Object.prototype.hasOwnProperty;function I(_,M,U){var j=U.ref;return{$$typeof:e,type:_,key:M,ref:j!==void 0?j:null,props:U}}function R(_,M){return I(_.type,M,_.props)}function z(_){return typeof _=="object"&&_!==null&&_.$$typeof===e}function $(_){var M={"=":"=0",":":"=2"};return"$"+_.replace(/[=:]/g,function(U){return M[U]})}var L=/\/+/g;function C(_,M){return typeof _=="object"&&_!==null&&_.key!=null?$(""+_.key):M.toString(36)}function N(_){switch(_.status){case"fulfilled":return _.value;case"rejected":throw _.reason;default:switch(typeof _.status=="string"?_.then(S,S):(_.status="pending",_.then(function(M){_.status==="pending"&&(_.status="fulfilled",_.value=M)},function(M){_.status==="pending"&&(_.status="rejected",_.reason=M)})),_.status){case"fulfilled":return _.value;case"rejected":throw _.reason}}throw _}function P(_,M,U,j,W){var B=typeof _;(B==="undefined"||B==="boolean")&&(_=null);var Y=!1;if(_===null)Y=!0;else switch(B){case"bigint":case"string":case"number":Y=!0;break;case"object":switch(_.$$typeof){case e:case n:Y=!0;break;case h:return Y=_._init,P(Y(_._payload),M,U,j,W)}}if(Y)return W=W(_),Y=j===""?"."+C(_,0):j,w(W)?(U="",Y!=null&&(U=Y.replace(L,"$&/")+"/"),P(W,M,U,"",function(ko){return ko})):W!=null&&(z(W)&&(W=R(W,U+(W.key==null||_&&_.key===W.key?"":(""+W.key).replace(L,"$&/")+"/")+Y)),M.push(W)),1;Y=0;var tt=j===""?".":j+":";if(w(_))for(var et=0;et<_.length;et++)j=_[et],B=tt+C(j,et),Y+=P(j,M,U,B,W);else if(et=p(_),typeof et=="function")for(_=et.call(_),et=0;!(j=_.next()).done;)j=j.value,B=tt+C(j,et++),Y+=P(j,M,U,B,W);else if(B==="object"){if(typeof _.then=="function")return P(N(_),M,U,j,W);throw M=String(_),Error("Objects are not valid as a React child (found: "+(M==="[object Object]"?"object with keys {"+Object.keys(_).join(", ")+"}":M)+"). If you meant to render a collection of children, use an array instead.")}return Y}function D(_,M,U){if(_==null)return _;var j=[],W=0;return P(_,j,"","",function(B){return M.call(U,B,W++)}),j}function H(_){if(_._status===-1){var M=_._result;M=M(),M.then(function(U){(_._status===0||_._status===-1)&&(_._status=1,_._result=U)},function(U){(_._status===0||_._status===-1)&&(_._status=2,_._result=U)}),_._status===-1&&(_._status=0,_._result=M)}if(_._status===1)return _._result.default;throw _._result}var q=typeof reportError=="function"?reportError:function(_){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var M=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof _=="object"&&_!==null&&typeof _.message=="string"?String(_.message):String(_),error:_});if(!window.dispatchEvent(M))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",_);return}console.error(_)},G={map:D,forEach:function(_,M,U){D(_,function(){M.apply(this,arguments)},U)},count:function(_){var M=0;return D(_,function(){M++}),M},toArray:function(_){return D(_,function(M){return M})||[]},only:function(_){if(!z(_))throw Error("React.Children.only expected to receive a single React element child.");return _}};return V.Activity=c,V.Children=G,V.Component=g,V.Fragment=r,V.Profiler=o,V.PureComponent=T,V.StrictMode=i,V.Suspense=f,V.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=k,V.__COMPILER_RUNTIME={__proto__:null,c:function(_){return k.H.useMemoCache(_)}},V.cache=function(_){return function(){return _.apply(null,arguments)}},V.cacheSignal=function(){return null},V.cloneElement=function(_,M,U){if(_==null)throw Error("The argument must be a React element, but you passed "+_+".");var j=x({},_.props),W=_.key;if(M!=null)for(B in M.key!==void 0&&(W=""+M.key),M)!E.call(M,B)||B==="key"||B==="__self"||B==="__source"||B==="ref"&&M.ref===void 0||(j[B]=M[B]);var B=arguments.length-2;if(B===1)j.children=U;else if(1<B){for(var Y=Array(B),tt=0;tt<B;tt++)Y[tt]=arguments[tt+2];j.children=Y}return I(_.type,W,j)},V.createContext=function(_){return _={$$typeof:s,_currentValue:_,_currentValue2:_,_threadCount:0,Provider:null,Consumer:null},_.Provider=_,_.Consumer={$$typeof:a,_context:_},_},V.createElement=function(_,M,U){var j,W={},B=null;if(M!=null)for(j in M.key!==void 0&&(B=""+M.key),M)E.call(M,j)&&j!=="key"&&j!=="__self"&&j!=="__source"&&(W[j]=M[j]);var Y=arguments.length-2;if(Y===1)W.children=U;else if(1<Y){for(var tt=Array(Y),et=0;et<Y;et++)tt[et]=arguments[et+2];W.children=tt}if(_&&_.defaultProps)for(j in Y=_.defaultProps,Y)W[j]===void 0&&(W[j]=Y[j]);return I(_,B,W)},V.createRef=function(){return{current:null}},V.forwardRef=function(_){return{$$typeof:u,render:_}},V.isValidElement=z,V.lazy=function(_){return{$$typeof:h,_payload:{_status:-1,_result:_},_init:H}},V.memo=function(_,M){return{$$typeof:l,type:_,compare:M===void 0?null:M}},V.startTransition=function(_){var M=k.T,U={};k.T=U;try{var j=_(),W=k.S;W!==null&&W(U,j),typeof j=="object"&&j!==null&&typeof j.then=="function"&&j.then(S,q)}catch(B){q(B)}finally{M!==null&&U.types!==null&&(M.types=U.types),k.T=M}},V.unstable_useCacheRefresh=function(){return k.H.useCacheRefresh()},V.use=function(_){return k.H.use(_)},V.useActionState=function(_,M,U){return k.H.useActionState(_,M,U)},V.useCallback=function(_,M){return k.H.useCallback(_,M)},V.useContext=function(_){return k.H.useContext(_)},V.useDebugValue=function(){},V.useDeferredValue=function(_,M){return k.H.useDeferredValue(_,M)},V.useEffect=function(_,M){return k.H.useEffect(_,M)},V.useEffectEvent=function(_){return k.H.useEffectEvent(_)},V.useId=function(){return k.H.useId()},V.useImperativeHandle=function(_,M,U){return k.H.useImperativeHandle(_,M,U)},V.useInsertionEffect=function(_,M){return k.H.useInsertionEffect(_,M)},V.useLayoutEffect=function(_,M){return k.H.useLayoutEffect(_,M)},V.useMemo=function(_,M){return k.H.useMemo(_,M)},V.useOptimistic=function(_,M){return k.H.useOptimistic(_,M)},V.useReducer=function(_,M,U){return k.H.useReducer(_,M,U)},V.useRef=function(_){return k.H.useRef(_)},V.useState=function(_){return k.H.useState(_)},V.useSyncExternalStore=function(_,M,U){return k.H.useSyncExternalStore(_,M,U)},V.useTransition=function(){return k.H.useTransition()},V.version="19.2.4",V}var Qn;function So(){return Qn||(Qn=1,Je.exports=Co()),Je.exports}var at=So();const fi=ui(at),md=Ao({__proto__:null,default:fi},[at]);var tn={exports:{}},en,Jn;function To(){if(Jn)return en;Jn=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return en=e,en}var nn,tr;function Eo(){if(tr)return nn;tr=1;var e=To();function n(){}function r(){}return r.resetWarningCache=n,nn=function(){function i(s,u,f,l,h,c){if(c!==e){var d=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw d.name="Invariant Violation",d}}i.isRequired=i;function o(){return i}var a={array:i,bigint:i,bool:i,func:i,number:i,object:i,string:i,symbol:i,any:i,arrayOf:o,element:i,elementType:i,instanceOf:o,node:i,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:r,resetWarningCache:n};return a.PropTypes=a,a},nn}var er;function Mo(){return er||(er=1,tn.exports=Eo()()),tn.exports}var Po=Mo();const m=ui(Po);function Oo(e,n){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var i,o,a,s,u=[],f=!0,l=!1;try{if(a=(r=r.call(e)).next,n===0){if(Object(r)!==r)return;f=!1}else for(;!(f=(i=a.call(r)).done)&&(u.push(i.value),u.length!==n);f=!0);}catch(h){l=!0,o=h}finally{try{if(!f&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(l)throw o}}return u}}function Ro(e,n,r){return n=Fo(n),n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function nr(e,n){return Io(e)||Oo(e,n)||li(e,n)||jo()}function zo(e){return No(e)||$o(e)||li(e)||Do()}function No(e){if(Array.isArray(e))return dn(e)}function Io(e){if(Array.isArray(e))return e}function $o(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function li(e,n){if(e){if(typeof e=="string")return dn(e,n);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return dn(e,n)}}function dn(e,n){(n==null||n>e.length)&&(n=e.length);for(var r=0,i=new Array(n);r<n;r++)i[r]=e[r];return i}function Do(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
1
|
+
function Ao(e,n){for(var r=0;r<n.length;r++){const i=n[r];if(typeof i!="string"&&!Array.isArray(i)){for(const o in i)if(o!=="default"&&!(o in e)){const a=Object.getOwnPropertyDescriptor(i,o);a&&Object.defineProperty(e,o,a.get?a:{enumerable:!0,get:()=>i[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var md=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ui(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Je={exports:{}},V={};var Kn;function Co(){if(Kn)return V;Kn=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),a=Symbol.for("react.consumer"),s=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),l=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),c=Symbol.for("react.activity"),d=Symbol.iterator;function p(_){return _===null||typeof _!="object"?null:(_=d&&_[d]||_["@@iterator"],typeof _=="function"?_:null)}var y={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},x=Object.assign,v={};function g(_,M,U){this.props=_,this.context=M,this.refs=v,this.updater=U||y}g.prototype.isReactComponent={},g.prototype.setState=function(_,M){if(typeof _!="object"&&typeof _!="function"&&_!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,_,M,"setState")},g.prototype.forceUpdate=function(_){this.updater.enqueueForceUpdate(this,_,"forceUpdate")};function A(){}A.prototype=g.prototype;function T(_,M,U){this.props=_,this.context=M,this.refs=v,this.updater=U||y}var b=T.prototype=new A;b.constructor=T,x(b,g.prototype),b.isPureReactComponent=!0;var w=Array.isArray;function S(){}var k={H:null,A:null,T:null,S:null},E=Object.prototype.hasOwnProperty;function I(_,M,U){var j=U.ref;return{$$typeof:e,type:_,key:M,ref:j!==void 0?j:null,props:U}}function R(_,M){return I(_.type,M,_.props)}function z(_){return typeof _=="object"&&_!==null&&_.$$typeof===e}function $(_){var M={"=":"=0",":":"=2"};return"$"+_.replace(/[=:]/g,function(U){return M[U]})}var L=/\/+/g;function C(_,M){return typeof _=="object"&&_!==null&&_.key!=null?$(""+_.key):M.toString(36)}function N(_){switch(_.status){case"fulfilled":return _.value;case"rejected":throw _.reason;default:switch(typeof _.status=="string"?_.then(S,S):(_.status="pending",_.then(function(M){_.status==="pending"&&(_.status="fulfilled",_.value=M)},function(M){_.status==="pending"&&(_.status="rejected",_.reason=M)})),_.status){case"fulfilled":return _.value;case"rejected":throw _.reason}}throw _}function P(_,M,U,j,W){var B=typeof _;(B==="undefined"||B==="boolean")&&(_=null);var Y=!1;if(_===null)Y=!0;else switch(B){case"bigint":case"string":case"number":Y=!0;break;case"object":switch(_.$$typeof){case e:case n:Y=!0;break;case h:return Y=_._init,P(Y(_._payload),M,U,j,W)}}if(Y)return W=W(_),Y=j===""?"."+C(_,0):j,w(W)?(U="",Y!=null&&(U=Y.replace(L,"$&/")+"/"),P(W,M,U,"",function(ko){return ko})):W!=null&&(z(W)&&(W=R(W,U+(W.key==null||_&&_.key===W.key?"":(""+W.key).replace(L,"$&/")+"/")+Y)),M.push(W)),1;Y=0;var tt=j===""?".":j+":";if(w(_))for(var et=0;et<_.length;et++)j=_[et],B=tt+C(j,et),Y+=P(j,M,U,B,W);else if(et=p(_),typeof et=="function")for(_=et.call(_),et=0;!(j=_.next()).done;)j=j.value,B=tt+C(j,et++),Y+=P(j,M,U,B,W);else if(B==="object"){if(typeof _.then=="function")return P(N(_),M,U,j,W);throw M=String(_),Error("Objects are not valid as a React child (found: "+(M==="[object Object]"?"object with keys {"+Object.keys(_).join(", ")+"}":M)+"). If you meant to render a collection of children, use an array instead.")}return Y}function D(_,M,U){if(_==null)return _;var j=[],W=0;return P(_,j,"","",function(B){return M.call(U,B,W++)}),j}function H(_){if(_._status===-1){var M=_._result;M=M(),M.then(function(U){(_._status===0||_._status===-1)&&(_._status=1,_._result=U)},function(U){(_._status===0||_._status===-1)&&(_._status=2,_._result=U)}),_._status===-1&&(_._status=0,_._result=M)}if(_._status===1)return _._result.default;throw _._result}var q=typeof reportError=="function"?reportError:function(_){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var M=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof _=="object"&&_!==null&&typeof _.message=="string"?String(_.message):String(_),error:_});if(!window.dispatchEvent(M))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",_);return}console.error(_)},G={map:D,forEach:function(_,M,U){D(_,function(){M.apply(this,arguments)},U)},count:function(_){var M=0;return D(_,function(){M++}),M},toArray:function(_){return D(_,function(M){return M})||[]},only:function(_){if(!z(_))throw Error("React.Children.only expected to receive a single React element child.");return _}};return V.Activity=c,V.Children=G,V.Component=g,V.Fragment=r,V.Profiler=o,V.PureComponent=T,V.StrictMode=i,V.Suspense=f,V.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=k,V.__COMPILER_RUNTIME={__proto__:null,c:function(_){return k.H.useMemoCache(_)}},V.cache=function(_){return function(){return _.apply(null,arguments)}},V.cacheSignal=function(){return null},V.cloneElement=function(_,M,U){if(_==null)throw Error("The argument must be a React element, but you passed "+_+".");var j=x({},_.props),W=_.key;if(M!=null)for(B in M.key!==void 0&&(W=""+M.key),M)!E.call(M,B)||B==="key"||B==="__self"||B==="__source"||B==="ref"&&M.ref===void 0||(j[B]=M[B]);var B=arguments.length-2;if(B===1)j.children=U;else if(1<B){for(var Y=Array(B),tt=0;tt<B;tt++)Y[tt]=arguments[tt+2];j.children=Y}return I(_.type,W,j)},V.createContext=function(_){return _={$$typeof:s,_currentValue:_,_currentValue2:_,_threadCount:0,Provider:null,Consumer:null},_.Provider=_,_.Consumer={$$typeof:a,_context:_},_},V.createElement=function(_,M,U){var j,W={},B=null;if(M!=null)for(j in M.key!==void 0&&(B=""+M.key),M)E.call(M,j)&&j!=="key"&&j!=="__self"&&j!=="__source"&&(W[j]=M[j]);var Y=arguments.length-2;if(Y===1)W.children=U;else if(1<Y){for(var tt=Array(Y),et=0;et<Y;et++)tt[et]=arguments[et+2];W.children=tt}if(_&&_.defaultProps)for(j in Y=_.defaultProps,Y)W[j]===void 0&&(W[j]=Y[j]);return I(_,B,W)},V.createRef=function(){return{current:null}},V.forwardRef=function(_){return{$$typeof:u,render:_}},V.isValidElement=z,V.lazy=function(_){return{$$typeof:h,_payload:{_status:-1,_result:_},_init:H}},V.memo=function(_,M){return{$$typeof:l,type:_,compare:M===void 0?null:M}},V.startTransition=function(_){var M=k.T,U={};k.T=U;try{var j=_(),W=k.S;W!==null&&W(U,j),typeof j=="object"&&j!==null&&typeof j.then=="function"&&j.then(S,q)}catch(B){q(B)}finally{M!==null&&U.types!==null&&(M.types=U.types),k.T=M}},V.unstable_useCacheRefresh=function(){return k.H.useCacheRefresh()},V.use=function(_){return k.H.use(_)},V.useActionState=function(_,M,U){return k.H.useActionState(_,M,U)},V.useCallback=function(_,M){return k.H.useCallback(_,M)},V.useContext=function(_){return k.H.useContext(_)},V.useDebugValue=function(){},V.useDeferredValue=function(_,M){return k.H.useDeferredValue(_,M)},V.useEffect=function(_,M){return k.H.useEffect(_,M)},V.useEffectEvent=function(_){return k.H.useEffectEvent(_)},V.useId=function(){return k.H.useId()},V.useImperativeHandle=function(_,M,U){return k.H.useImperativeHandle(_,M,U)},V.useInsertionEffect=function(_,M){return k.H.useInsertionEffect(_,M)},V.useLayoutEffect=function(_,M){return k.H.useLayoutEffect(_,M)},V.useMemo=function(_,M){return k.H.useMemo(_,M)},V.useOptimistic=function(_,M){return k.H.useOptimistic(_,M)},V.useReducer=function(_,M,U){return k.H.useReducer(_,M,U)},V.useRef=function(_){return k.H.useRef(_)},V.useState=function(_){return k.H.useState(_)},V.useSyncExternalStore=function(_,M,U){return k.H.useSyncExternalStore(_,M,U)},V.useTransition=function(){return k.H.useTransition()},V.version="19.2.4",V}var Qn;function So(){return Qn||(Qn=1,Je.exports=Co()),Je.exports}var at=So();const fi=ui(at),xd=Ao({__proto__:null,default:fi},[at]);var tn={exports:{}},en,Jn;function To(){if(Jn)return en;Jn=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return en=e,en}var nn,tr;function Eo(){if(tr)return nn;tr=1;var e=To();function n(){}function r(){}return r.resetWarningCache=n,nn=function(){function i(s,u,f,l,h,c){if(c!==e){var d=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw d.name="Invariant Violation",d}}i.isRequired=i;function o(){return i}var a={array:i,bigint:i,bool:i,func:i,number:i,object:i,string:i,symbol:i,any:i,arrayOf:o,element:i,elementType:i,instanceOf:o,node:i,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:r,resetWarningCache:n};return a.PropTypes=a,a},nn}var er;function Mo(){return er||(er=1,tn.exports=Eo()()),tn.exports}var Po=Mo();const m=ui(Po);function Oo(e,n){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var i,o,a,s,u=[],f=!0,l=!1;try{if(a=(r=r.call(e)).next,n===0){if(Object(r)!==r)return;f=!1}else for(;!(f=(i=a.call(r)).done)&&(u.push(i.value),u.length!==n);f=!0);}catch(h){l=!0,o=h}finally{try{if(!f&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(l)throw o}}return u}}function Ro(e,n,r){return n=Fo(n),n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function nr(e,n){return Io(e)||Oo(e,n)||li(e,n)||jo()}function zo(e){return No(e)||$o(e)||li(e)||Do()}function No(e){if(Array.isArray(e))return dn(e)}function Io(e){if(Array.isArray(e))return e}function $o(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function li(e,n){if(e){if(typeof e=="string")return dn(e,n);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return dn(e,n)}}function dn(e,n){(n==null||n>e.length)&&(n=e.length);for(var r=0,i=new Array(n);r<n;r++)i[r]=e[r];return i}function Do(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
2
2
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function jo(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
3
3
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Uo(e,n){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,n);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}function Fo(e){var n=Uo(e,"string");return typeof n=="symbol"?n:String(n)}var Lo=function(n,r){var i=new Set(r);return Object.assign.apply(Object,[{}].concat(zo(Object.entries(n).filter(function(o){var a=nr(o,1),s=a[0];return!i.has(s)}).map(function(o){var a=nr(o,2),s=a[0],u=a[1];return Ro({},s,u)}))))};function pn(e,n){(n==null||n>e.length)&&(n=e.length);for(var r=0,i=Array(n);r<n;r++)i[r]=e[r];return i}function Ho(e){if(Array.isArray(e))return e}function qo(e){if(Array.isArray(e))return pn(e)}function Go(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Vo(e,n){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var i,o,a,s,u=[],f=!0,l=!1;try{if(a=(r=r.call(e)).next,n!==0)for(;!(f=(i=a.call(r)).done)&&(u.push(i.value),u.length!==n);f=!0);}catch(h){l=!0,o=h}finally{try{if(!f&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(l)throw o}}return u}}function Wo(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
4
4
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Bo(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
@@ -43,4 +43,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
43
43
|
}
|
|
44
44
|
`;Qh(Jh);function Rn(e,n){(n==null||n>e.length)&&(n=e.length);for(var r=0,i=Array(n);r<n;r++)i[r]=e[r];return i}function td(e){if(Array.isArray(e))return e}function ed(e){if(Array.isArray(e))return Rn(e)}function ri(e,n,r){if(yo())return Reflect.construct.apply(null,arguments);var i=[null];i.push.apply(i,n);var o=new(e.bind.apply(e,i));return o}function _e(e,n,r){return(n=sd(n))in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function yo(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(yo=function(){return!!e})()}function nd(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function rd(e,n){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var i,o,a,s,u=[],f=!0,l=!1;try{if(a=(r=r.call(e)).next,n!==0)for(;!(f=(i=a.call(r)).done)&&(u.push(i.value),u.length!==n);f=!0);}catch(h){l=!0,o=h}finally{try{if(!f&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(l)throw o}}return u}}function id(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
45
45
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function od(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
46
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ii(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,i)}return r}function Gt(e){for(var n=1;n<arguments.length;n++){var r=arguments[n]!=null?arguments[n]:{};n%2?ii(Object(r),!0).forEach(function(i){_e(e,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ii(Object(r)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(r,i))})}return e}function le(e,n){return td(e)||rd(e,n)||_o(e,n)||id()}function pt(e){return ed(e)||nd(e)||_o(e)||od()}function ad(e,n){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,n);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}function sd(e){var n=ad(e,"string");return typeof n=="symbol"?n:n+""}function zn(e){"@babel/helpers - typeof";return zn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},zn(e)}function _o(e,n){if(e){if(typeof e=="string")return Rn(e,n);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Rn(e,n):void 0}}var ud=go(Kh);function oi(e,n,r){!n||typeof r!="string"||e.filter(function(i){return!i[r]}).forEach(function(i){i[r]=ud(n(i))})}function fd(e,n){var r=e.nodes,i=e.links,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a=o.nodeFilter,s=a===void 0?function(){return!0}:a,u=o.onLoopError,f=u===void 0?function(p){throw"Invalid DAG structure! Found cycle in node path: ".concat(p.join(" -> "),".")}:u,l={};r.forEach(function(p){return l[n(p)]={data:p,out:[],depth:-1,skip:!s(p)}}),i.forEach(function(p){var y=p.source,x=p.target,v=b(y),g=b(x);if(!l.hasOwnProperty(v))throw"Missing source node with id: ".concat(v);if(!l.hasOwnProperty(g))throw"Missing target node with id: ".concat(g);var A=l[v],T=l[g];A.out.push(T);function b(w){return zn(w)==="object"?n(w):w}});var h=[];d(Object.values(l));var c=Object.assign.apply(Object,[{}].concat(pt(Object.entries(l).filter(function(p){var y=le(p,2),x=y[1];return!x.skip}).map(function(p){var y=le(p,2),x=y[0],v=y[1];return _e({},x,v.depth)}))));return c;function d(p){for(var y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],x=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,v=function(){var b=p[g];if(y.indexOf(b)!==-1){var w=[].concat(pt(y.slice(y.indexOf(b))),[b]).map(function(S){return n(S.data)});return h.some(function(S){return S.length===w.length&&S.every(function(k,E){return k===w[E]})})||(h.push(w),f(w)),1}x>b.depth&&(b.depth=x,d(b.out,[].concat(pt(y),[b]),x+(b.skip?0:1)))},g=0,A=p.length;g<A;g++)v()}}var ld=2,rt=function(n,r){return r.onNeedsRedraw&&r.onNeedsRedraw()},ai=function(n,r){if(!r.isShadow){var i=X(r.linkDirectionalParticles);r.graphData.links.forEach(function(o){var a=Math.round(Math.abs(i(o)));a?o.__photons=pt(Array(a)).map(function(){return{}}):delete o.__photons})}},Ve=Hn({props:{graphData:{default:{nodes:[],links:[]},onChange:function(n,r){r.engineRunning=!1,ai(n,r)}},dagMode:{onChange:function(n,r){!n&&(r.graphData.nodes||[]).forEach(function(i){return i.fx=i.fy=void 0})}},dagLevelDistance:{},dagNodeFilter:{default:function(n){return!0}},onDagError:{triggerUpdate:!1},nodeRelSize:{default:4,triggerUpdate:!1,onChange:rt},nodeId:{default:"id"},nodeVal:{default:"val",triggerUpdate:!1,onChange:rt},nodeColor:{default:"color",triggerUpdate:!1,onChange:rt},nodeAutoColorBy:{},nodeCanvasObject:{triggerUpdate:!1,onChange:rt},nodeCanvasObjectMode:{default:function(){return"replace"},triggerUpdate:!1,onChange:rt},nodeVisibility:{default:!0,triggerUpdate:!1,onChange:rt},linkSource:{default:"source"},linkTarget:{default:"target"},linkVisibility:{default:!0,triggerUpdate:!1,onChange:rt},linkColor:{default:"color",triggerUpdate:!1,onChange:rt},linkAutoColorBy:{},linkLineDash:{triggerUpdate:!1,onChange:rt},linkWidth:{default:1,triggerUpdate:!1,onChange:rt},linkCurvature:{default:0,triggerUpdate:!1,onChange:rt},linkCanvasObject:{triggerUpdate:!1,onChange:rt},linkCanvasObjectMode:{default:function(){return"replace"},triggerUpdate:!1,onChange:rt},linkDirectionalArrowLength:{default:0,triggerUpdate:!1,onChange:rt},linkDirectionalArrowColor:{triggerUpdate:!1,onChange:rt},linkDirectionalArrowRelPos:{default:.5,triggerUpdate:!1,onChange:rt},linkDirectionalParticles:{default:0,triggerUpdate:!1,onChange:ai},linkDirectionalParticleSpeed:{default:.01,triggerUpdate:!1},linkDirectionalParticleOffset:{default:0,triggerUpdate:!1},linkDirectionalParticleWidth:{default:4,triggerUpdate:!1},linkDirectionalParticleColor:{triggerUpdate:!1},linkDirectionalParticleCanvasObject:{triggerUpdate:!1},globalScale:{default:1,triggerUpdate:!1},d3AlphaMin:{default:0,triggerUpdate:!1},d3AlphaDecay:{default:.0228,triggerUpdate:!1,onChange:function(n,r){r.forceLayout.alphaDecay(n)}},d3AlphaTarget:{default:0,triggerUpdate:!1,onChange:function(n,r){r.forceLayout.alphaTarget(n)}},d3VelocityDecay:{default:.4,triggerUpdate:!1,onChange:function(n,r){r.forceLayout.velocityDecay(n)}},warmupTicks:{default:0,triggerUpdate:!1},cooldownTicks:{default:1/0,triggerUpdate:!1},cooldownTime:{default:15e3,triggerUpdate:!1},onUpdate:{default:function(){},triggerUpdate:!1},onFinishUpdate:{default:function(){},triggerUpdate:!1},onEngineTick:{default:function(){},triggerUpdate:!1},onEngineStop:{default:function(){},triggerUpdate:!1},onNeedsRedraw:{triggerUpdate:!1},isShadow:{default:!1,triggerUpdate:!1}},methods:{d3Force:function(n,r,i){return i===void 0?n.forceLayout.force(r):(n.forceLayout.force(r,i),this)},d3ReheatSimulation:function(n){return n.forceLayout.alpha(1),this.resetCountdown(),this},resetCountdown:function(n){return n.cntTicks=0,n.startTickTime=new Date,n.engineRunning=!0,this},isEngineRunning:function(n){return!!n.engineRunning},tickFrame:function(n){return!n.isShadow&&r(),o(),!n.isShadow&&a(),!n.isShadow&&s(),i(),this;function r(){n.engineRunning&&(++n.cntTicks>n.cooldownTicks||new Date-n.startTickTime>n.cooldownTime||n.d3AlphaMin>0&&n.forceLayout.alpha()<n.d3AlphaMin?(n.engineRunning=!1,n.onEngineStop()):(n.forceLayout.tick(),n.onEngineTick()))}function i(){var u=X(n.nodeVisibility),f=X(n.nodeVal),l=X(n.nodeColor),h=X(n.nodeCanvasObjectMode),c=n.ctx,d=n.isShadow/n.globalScale,p=n.graphData.nodes.filter(u);c.save(),p.forEach(function(y){var x=h(y);if(n.nodeCanvasObject&&(x==="before"||x==="replace")&&(n.nodeCanvasObject(y,c,n.globalScale),x==="replace")){c.restore();return}var v=Math.sqrt(Math.max(0,f(y)||1))*n.nodeRelSize+d;c.beginPath(),c.arc(y.x,y.y,v,0,2*Math.PI,!1),c.fillStyle=l(y)||"rgba(31, 120, 180, 0.92)",c.fill(),n.nodeCanvasObject&&x==="after"&&n.nodeCanvasObject(y,n.ctx,n.globalScale)}),c.restore()}function o(){var u=X(n.linkVisibility),f=X(n.linkColor),l=X(n.linkWidth),h=X(n.linkLineDash),c=X(n.linkCurvature),d=X(n.linkCanvasObjectMode),p=n.ctx,y=n.isShadow*2,x=n.graphData.links.filter(u);x.forEach(S);var v=[],g=[],A=x;if(n.linkCanvasObject){var T=[],b=[];x.forEach(function(k){return({before:v,after:g,replace:T}[d(k)]||b).push(k)}),A=[].concat(pt(v),g,b),v=v.concat(T)}p.save(),v.forEach(function(k){return n.linkCanvasObject(k,p,n.globalScale)}),p.restore();var w=Yh(A,[f,l,h]);p.save(),Object.entries(w).forEach(function(k){var E=le(k,2),I=E[0],R=E[1],z=!I||I==="undefined"?"rgba(0,0,0,0.15)":I;Object.entries(R).forEach(function($){var L=le($,2),C=L[0],N=L[1],P=(C||1)/n.globalScale+y;Object.entries(N).forEach(function(D){var H=le(D,2);H[0];var q=H[1],G=h(q[0]);p.beginPath(),q.forEach(function(_){var M=_.source,U=_.target;if(!(!M||!U||!M.hasOwnProperty("x")||!U.hasOwnProperty("x"))){p.moveTo(M.x,M.y);var j=_.__controlPoints;j?p[j.length===2?"quadraticCurveTo":"bezierCurveTo"].apply(p,pt(j).concat([U.x,U.y])):p.lineTo(U.x,U.y)}}),p.strokeStyle=z,p.lineWidth=P,p.setLineDash(G||[]),p.stroke()})})}),p.restore(),p.save(),g.forEach(function(k){return n.linkCanvasObject(k,p,n.globalScale)}),p.restore();function S(k){var E=c(k);if(!E){k.__controlPoints=null;return}var I=k.source,R=k.target;if(!(!I||!R||!I.hasOwnProperty("x")||!R.hasOwnProperty("x"))){var z=Math.sqrt(Math.pow(R.x-I.x,2)+Math.pow(R.y-I.y,2));if(z>0){var $=Math.atan2(R.y-I.y,R.x-I.x),L=z*E,C={x:(I.x+R.x)/2+L*Math.cos($-Math.PI/2),y:(I.y+R.y)/2+L*Math.sin($-Math.PI/2)};k.__controlPoints=[C.x,C.y]}else{var N=E*70;k.__controlPoints=[R.x,R.y-N,R.x+N,R.y]}}}}function a(){var u=1.6,f=.2,l=X(n.linkDirectionalArrowLength),h=X(n.linkDirectionalArrowRelPos),c=X(n.linkVisibility),d=X(n.linkDirectionalArrowColor||n.linkColor),p=X(n.nodeVal),y=n.ctx;y.save(),n.graphData.links.filter(c).forEach(function(x){var v=l(x);if(!(!v||v<0)){var g=x.source,A=x.target;if(!(!g||!A||!g.hasOwnProperty("x")||!A.hasOwnProperty("x"))){var T=Math.sqrt(Math.max(0,p(g)||1))*n.nodeRelSize,b=Math.sqrt(Math.max(0,p(A)||1))*n.nodeRelSize,w=Math.min(1,Math.max(0,h(x))),S=d(x)||"rgba(0,0,0,0.28)",k=v/u/2,E=x.__controlPoints&&ri(K,[g.x,g.y].concat(pt(x.__controlPoints),[A.x,A.y])),I=E?function(P){return E.get(P)}:function(P){return{x:g.x+(A.x-g.x)*P||0,y:g.y+(A.y-g.y)*P||0}},R=E?E.length():Math.sqrt(Math.pow(A.x-g.x,2)+Math.pow(A.y-g.y,2)),z=T+v+(R-T-b-v)*w,$=I(z/R),L=I((z-v)/R),C=I((z-v*(1-f))/R),N=Math.atan2($.y-L.y,$.x-L.x)-Math.PI/2;y.beginPath(),y.moveTo($.x,$.y),y.lineTo(L.x+k*Math.cos(N),L.y+k*Math.sin(N)),y.lineTo(C.x,C.y),y.lineTo(L.x-k*Math.cos(N),L.y-k*Math.sin(N)),y.fillStyle=S,y.fill()}}}),y.restore()}function s(){var u=X(n.linkDirectionalParticles),f=X(n.linkDirectionalParticleSpeed),l=X(n.linkDirectionalParticleOffset),h=X(n.linkDirectionalParticleWidth),c=X(n.linkVisibility),d=X(n.linkDirectionalParticleColor||n.linkColor),p=n.ctx;p.save(),n.graphData.links.filter(c).forEach(function(y){var x=u(y);if(!(!y.hasOwnProperty("__photons")||!y.__photons.length)){var v=y.source,g=y.target;if(!(!v||!g||!v.hasOwnProperty("x")||!g.hasOwnProperty("x"))){var A=f(y),T=Math.abs(l(y)),b=y.__photons||[],w=Math.max(0,h(y)/2)/Math.sqrt(n.globalScale),S=d(y)||"rgba(0,0,0,0.28)";p.fillStyle=S;var k=y.__controlPoints?ri(K,[v.x,v.y].concat(pt(y.__controlPoints),[g.x,g.y])):null,E=0,I=!1;b.forEach(function(R){var z=!!R.__singleHop;if(R.hasOwnProperty("__progressRatio")||(R.__progressRatio=z?0:(E+T)/x),!z&&E++,R.__progressRatio+=A,R.__progressRatio>=1)if(!z)R.__progressRatio=R.__progressRatio%1;else{I=!0;return}var $=R.__progressRatio,L=k?k.get($):{x:v.x+(g.x-v.x)*$||0,y:v.y+(g.y-v.y)*$||0};n.linkDirectionalParticleCanvasObject?n.linkDirectionalParticleCanvasObject(L.x,L.y,y,p,n.globalScale):(p.beginPath(),p.arc(L.x,L.y,w,0,2*Math.PI,!1),p.fill())}),I&&(y.__photons=y.__photons.filter(function(R){return!R.__singleHop||R.__progressRatio<=1}))}}}),p.restore()}},emitParticle:function(n,r){return r&&(!r.__photons&&(r.__photons=[]),r.__photons.push({__singleHop:!0})),this}},stateInit:function(){return{forceLayout:Sh().force("link",vh()).force("charge",Th()).force("center",xc()).force("dagRadial",null).stop(),engineRunning:!1}},init:function(n,r){r.ctx=n},update:function(n,r){n.engineRunning=!1,n.onUpdate(),n.nodeAutoColorBy!==null&&oi(n.graphData.nodes,X(n.nodeAutoColorBy),n.nodeColor),n.linkAutoColorBy!==null&&oi(n.graphData.links,X(n.linkAutoColorBy),n.linkColor),n.graphData.links.forEach(function(d){d.source=d[n.linkSource],d.target=d[n.linkTarget]}),n.forceLayout.stop().alpha(1).nodes(n.graphData.nodes);var i=n.forceLayout.force("link");i&&i.id(function(d){return d[n.nodeId]}).links(n.graphData.links);var o=n.dagMode&&fd(n.graphData,function(d){return d[n.nodeId]},{nodeFilter:n.dagNodeFilter,onLoopError:n.onDagError||void 0}),a=Math.max.apply(Math,pt(Object.values(o||[]))),s=n.dagLevelDistance||n.graphData.nodes.length/(a||1)*ld*(["radialin","radialout"].indexOf(n.dagMode)!==-1?.7:1);if(["lr","rl","td","bu"].includes(r.dagMode)){var u=["lr","rl"].includes(r.dagMode)?"fx":"fy";n.graphData.nodes.filter(n.dagNodeFilter).forEach(function(d){return delete d[u]})}if(["lr","rl","td","bu"].includes(n.dagMode)){var f=["rl","bu"].includes(n.dagMode),l=function(p){return(o[p[n.nodeId]]-a/2)*s*(f?-1:1)},h=["lr","rl"].includes(n.dagMode)?"fx":"fy";n.graphData.nodes.filter(n.dagNodeFilter).forEach(function(d){return d[h]=l(d)})}n.forceLayout.force("dagRadial",["radialin","radialout"].indexOf(n.dagMode)!==-1?Eh(function(d){var p=o[d[n.nodeId]]||-1;return(n.dagMode==="radialin"?a-p:p)*s}).strength(function(d){return n.dagNodeFilter(d)?1:0}):null);for(var c=0;c<n.warmupTicks&&!(n.d3AlphaMin>0&&n.forceLayout.alpha()<n.d3AlphaMin);c++)n.forceLayout.tick();this.resetCountdown(),n.onFinishUpdate()}});function vo(e,n){var r=e instanceof Array?e:[e],i=new n;return i._destructor&&i._destructor(),{linkProp:function(a){return{default:i[a](),onChange:function(u,f){r.forEach(function(l){return f[l][a](u)})},triggerUpdate:!1}},linkMethod:function(a){return function(s){for(var u=arguments.length,f=new Array(u>1?u-1:0),l=1;l<u;l++)f[l-1]=arguments[l];var h=[];return r.forEach(function(c){var d=s[c],p=d[a].apply(d,f);p!==d&&h.push(p)}),h.length?h[0]:this}}}}var cd=800,hd=4,dd=5,mo=vo("forceGraph",Ve),pd=vo(["forceGraph","shadowGraph"],Ve),gd=Object.assign.apply(Object,pt(["nodeColor","nodeAutoColorBy","nodeCanvasObject","nodeCanvasObjectMode","linkColor","linkAutoColorBy","linkLineDash","linkWidth","linkCanvasObject","linkCanvasObjectMode","linkDirectionalArrowLength","linkDirectionalArrowColor","linkDirectionalArrowRelPos","linkDirectionalParticles","linkDirectionalParticleSpeed","linkDirectionalParticleOffset","linkDirectionalParticleWidth","linkDirectionalParticleColor","linkDirectionalParticleCanvasObject","dagMode","dagLevelDistance","dagNodeFilter","onDagError","d3AlphaMin","d3AlphaDecay","d3VelocityDecay","warmupTicks","cooldownTicks","cooldownTime","onEngineTick","onEngineStop"].map(function(e){return _e({},e,mo.linkProp(e))})).concat(pt(["nodeRelSize","nodeId","nodeVal","nodeVisibility","linkSource","linkTarget","linkVisibility","linkCurvature"].map(function(e){return _e({},e,pd.linkProp(e))})))),yd=Object.assign.apply(Object,pt(["d3Force","d3ReheatSimulation","emitParticle"].map(function(e){return _e({},e,mo.linkMethod(e))})));function hn(e){if(e.canvas){var n=e.canvas.width,r=e.canvas.height;n===300&&r===150&&(n=r=0);var i=window.devicePixelRatio;n/=i,r/=i,[e.canvas,e.shadowCanvas].forEach(function(a){a.style.width="".concat(e.width,"px"),a.style.height="".concat(e.height,"px"),a.width=e.width*i,a.height=e.height*i,!n&&!r&&a.getContext("2d").scale(i,i)});var o=mt(e.canvas).k;e.zoom.translateBy(e.zoom.__baseElem,(e.width-n)/2/o,(e.height-r)/2/o),e.needsRedraw=!0}}function xo(e){var n=window.devicePixelRatio;e.setTransform(n,0,0,n,0,0)}function si(e,n,r){e.save(),xo(e),e.clearRect(0,0,n,r),e.restore()}var _d=Hn({props:Gt({width:{default:window.innerWidth,onChange:function(n,r){return hn(r)},triggerUpdate:!1},height:{default:window.innerHeight,onChange:function(n,r){return hn(r)},triggerUpdate:!1},graphData:{default:{nodes:[],links:[]},onChange:function(n,r){[n.nodes,n.links].every(function(o){return(o||[]).every(function(a){return!a.hasOwnProperty("__indexColor")})})&&r.colorTracker.reset(),[{type:"Node",objs:n.nodes},{type:"Link",objs:n.links}].forEach(i),r.forceGraph.graphData(n),r.shadowGraph.graphData(n);function i(o){var a=o.type,s=o.objs;s.filter(function(u){if(!u.hasOwnProperty("__indexColor"))return!0;var f=r.colorTracker.lookup(u.__indexColor);return!f||!f.hasOwnProperty("d")||f.d!==u}).forEach(function(u){u.__indexColor=r.colorTracker.register({type:a,d:u})})}},triggerUpdate:!1},backgroundColor:{onChange:function(n,r){r.canvas&&n&&(r.canvas.style.background=n)},triggerUpdate:!1},nodeLabel:{default:"name",triggerUpdate:!1},nodePointerAreaPaint:{onChange:function(n,r){r.shadowGraph.nodeCanvasObject(n?function(i,o,a){return n(i,i.__indexColor,o,a)}:null),r.flushShadowCanvas&&r.flushShadowCanvas()},triggerUpdate:!1},linkPointerAreaPaint:{onChange:function(n,r){r.shadowGraph.linkCanvasObject(n?function(i,o,a){return n(i,i.__indexColor,o,a)}:null),r.flushShadowCanvas&&r.flushShadowCanvas()},triggerUpdate:!1},linkLabel:{default:"name",triggerUpdate:!1},linkHoverPrecision:{default:4,triggerUpdate:!1},minZoom:{default:.01,onChange:function(n,r){r.zoom.scaleExtent([n,r.zoom.scaleExtent()[1]])},triggerUpdate:!1},maxZoom:{default:1e3,onChange:function(n,r){r.zoom.scaleExtent([r.zoom.scaleExtent()[0],n])},triggerUpdate:!1},enableNodeDrag:{default:!0,triggerUpdate:!1},enableZoomInteraction:{default:!0,triggerUpdate:!1},enablePanInteraction:{default:!0,triggerUpdate:!1},enableZoomPanInteraction:{default:!0,triggerUpdate:!1},enablePointerInteraction:{default:!0,onChange:function(n,r){r.hoverObj=null},triggerUpdate:!1},autoPauseRedraw:{default:!0,triggerUpdate:!1},onNodeDrag:{default:function(){},triggerUpdate:!1},onNodeDragEnd:{default:function(){},triggerUpdate:!1},onNodeClick:{triggerUpdate:!1},onNodeRightClick:{triggerUpdate:!1},onNodeHover:{triggerUpdate:!1},onLinkClick:{triggerUpdate:!1},onLinkRightClick:{triggerUpdate:!1},onLinkHover:{triggerUpdate:!1},onBackgroundClick:{triggerUpdate:!1},onBackgroundRightClick:{triggerUpdate:!1},showPointerCursor:{default:!0,triggerUpdate:!1},onZoom:{triggerUpdate:!1},onZoomEnd:{triggerUpdate:!1},onRenderFramePre:{triggerUpdate:!1},onRenderFramePost:{triggerUpdate:!1}},gd),aliases:{stopAnimation:"pauseAnimation"},methods:Gt({graph2ScreenCoords:function(n,r,i){var o=mt(n.canvas);return{x:r*o.k+o.x,y:i*o.k+o.y}},screen2GraphCoords:function(n,r,i){var o=mt(n.canvas);return{x:(r-o.x)/o.k,y:(i-o.y)/o.k}},centerAt:function(n,r,i,o){if(!n.canvas)return null;if(r!==void 0||i!==void 0){var a=Object.assign({},r!==void 0?{x:r}:{},i!==void 0?{y:i}:{});return o?n.tweenGroup.add(new Pr(s()).to(a,o).easing(Lt.Quadratic.Out).onUpdate(u).start()):u(a),this}return s();function s(){var f=mt(n.canvas);return{x:(n.width/2-f.x)/f.k,y:(n.height/2-f.y)/f.k}}function u(f){var l=f.x,h=f.y;n.zoom.translateTo(n.zoom.__baseElem,l===void 0?s().x:l,h===void 0?s().y:h),n.needsRedraw=!0}},zoom:function(n,r,i){if(!n.canvas)return null;if(r!==void 0)return i?n.tweenGroup.add(new Pr({k:o()}).to({k:r},i).easing(Lt.Quadratic.Out).onUpdate(function(s){var u=s.k;return a(u)}).start()):a(r),this;return o();function o(){return mt(n.canvas).k}function a(s){n.zoom.scaleTo(n.zoom.__baseElem,s),n.needsRedraw=!0}},zoomToFit:function(n){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:10,o=arguments.length,a=new Array(o>3?o-3:0),s=3;s<o;s++)a[s-3]=arguments[s];var u=this.getGraphBbox.apply(this,a);if(u){var f={x:(u.x[0]+u.x[1])/2,y:(u.y[0]+u.y[1])/2},l=Math.max(1e-12,Math.min(1e12,(n.width-i*2)/(u.x[1]-u.x[0]),(n.height-i*2)/(u.y[1]-u.y[0])));this.centerAt(f.x,f.y,r),this.zoom(l,r)}return this},getGraphBbox:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:function(){return!0},i=X(n.nodeVal),o=function(u){return Math.sqrt(Math.max(0,i(u)||1))*n.nodeRelSize},a=n.graphData.nodes.filter(r).map(function(s){return{x:s.x,y:s.y,r:o(s)}});return a.length?{x:[Sr(a,function(s){return s.x-s.r}),Cr(a,function(s){return s.x+s.r})],y:[Sr(a,function(s){return s.y-s.r}),Cr(a,function(s){return s.y+s.r})]}:null},pauseAnimation:function(n){return n.animationFrameRequestId&&(cancelAnimationFrame(n.animationFrameRequestId),n.animationFrameRequestId=null),this},resumeAnimation:function(n){return n.animationFrameRequestId||this._animationCycle(),this},_destructor:function(){this.pauseAnimation(),this.graphData({nodes:[],links:[]})}},yd),stateInit:function(){return{lastSetZoom:1,zoom:Ef(),forceGraph:new Ve,shadowGraph:new Ve().cooldownTicks(0).nodeColor("__indexColor").linkColor("__indexColor").isShadow(!0),colorTracker:new Ql,tweenGroup:new Li}},init:function(n,r){var i=this;n.innerHTML="";var o=document.createElement("div");o.classList.add("force-graph-container"),o.style.position="relative",n.appendChild(o),r.canvas=document.createElement("canvas"),r.backgroundColor&&(r.canvas.style.background=r.backgroundColor),o.appendChild(r.canvas),r.shadowCanvas=document.createElement("canvas");var a=r.canvas.getContext("2d"),s=r.shadowCanvas.getContext("2d",{willReadFrequently:!0}),u={x:-1e12,y:-1e12},f=function(){var c=null,d=window.devicePixelRatio,p=u.x>0&&u.y>0?s.getImageData(u.x*d,u.y*d,1,1):null;return p&&(c=r.colorTracker.lookup(p.data)),c};dt(r.canvas).call(Ds().subject(function(){if(!r.enableNodeDrag)return null;var h=f();return h&&h.type==="Node"?h.d:null}).on("start",function(h){var c=h.subject;c.__initialDragPos={x:c.x,y:c.y,fx:c.fx,fy:c.fy},h.active||(c.fx=c.x,c.fy=c.y),r.canvas.classList.add("grabbable")}).on("drag",function(h){var c=h.subject,d=c.__initialDragPos,p=h,y=mt(r.canvas).k,x={x:d.x+(p.x-d.x)/y-c.x,y:d.y+(p.y-d.y)/y-c.y};["x","y"].forEach(function(v){return c["f".concat(v)]=c[v]=d[v]+(p[v]-d[v])/y}),!(!c.__dragged&&dd>=Math.sqrt(Rf(["x","y"].map(function(v){return Math.pow(h[v]-d[v],2)}))))&&(r.forceGraph.d3AlphaTarget(.3).resetCountdown(),r.isPointerDragging=!0,c.__dragged=!0,r.onNodeDrag(c,x))}).on("end",function(h){var c=h.subject,d=c.__initialDragPos,p={x:c.x-d.x,y:c.y-d.y};d.fx===void 0&&(c.fx=void 0),d.fy===void 0&&(c.fy=void 0),delete c.__initialDragPos,r.forceGraph.d3AlphaTarget()&&r.forceGraph.d3AlphaTarget(0).resetCountdown(),r.canvas.classList.remove("grabbable"),r.isPointerDragging=!1,c.__dragged&&(delete c.__dragged,r.onNodeDragEnd(c,p))})),r.zoom(r.zoom.__baseElem=dt(r.canvas)),r.zoom.__baseElem.on("dblclick.zoom",null),r.zoom.filter(function(h){return!h.button&&r.enableZoomPanInteraction&&(h.type!=="wheel"||X(r.enableZoomInteraction)(h))&&(h.type==="wheel"||X(r.enablePanInteraction)(h))}).on("zoom",function(h){var c=h.transform;[a,s].forEach(function(d){xo(d),d.translate(c.x,c.y),d.scale(c.k,c.k)}),r.isPointerDragging=!0,r.onZoom&&r.onZoom(Gt(Gt({},c),i.centerAt())),r.needsRedraw=!0}).on("end",function(h){r.isPointerDragging=!1,r.onZoomEnd&&r.onZoomEnd(Gt(Gt({},h.transform),i.centerAt()))}),hn(r),r.forceGraph.onNeedsRedraw(function(){return r.needsRedraw=!0}).onFinishUpdate(function(){mt(r.canvas).k===r.lastSetZoom&&r.graphData.nodes.length&&(r.zoom.scaleTo(r.zoom.__baseElem,r.lastSetZoom=hd/Math.cbrt(r.graphData.nodes.length)),r.needsRedraw=!0)}),r.tooltip=new mc(o),["pointermove","pointerdown"].forEach(function(h){return o.addEventListener(h,function(c){h==="pointerdown"&&(r.isPointerPressed=!0,r.pointerDownEvent=c),!r.isPointerDragging&&c.type==="pointermove"&&r.onBackgroundClick&&(c.pressure>0||r.isPointerPressed)&&(c.pointerType==="mouse"||c.movementX===void 0||[c.movementX,c.movementY].some(function(y){return Math.abs(y)>1}))&&(r.isPointerDragging=!0);var d=p(o);u.x=c.pageX-d.left,u.y=c.pageY-d.top;function p(y){var x=y.getBoundingClientRect(),v=window.pageXOffset||document.documentElement.scrollLeft,g=window.pageYOffset||document.documentElement.scrollTop;return{top:x.top+g,left:x.left+v}}},{passive:!0})}),o.addEventListener("pointerup",function(h){if(r.isPointerPressed){if(r.isPointerPressed=!1,r.isPointerDragging){r.isPointerDragging=!1;return}var c=[h,r.pointerDownEvent];requestAnimationFrame(function(){if(h.button===0)if(r.hoverObj){var d=r["on".concat(r.hoverObj.type,"Click")];d&&d.apply(void 0,[r.hoverObj.d].concat(c))}else r.onBackgroundClick&&r.onBackgroundClick.apply(r,c);if(h.button===2)if(r.hoverObj){var p=r["on".concat(r.hoverObj.type,"RightClick")];p&&p.apply(void 0,[r.hoverObj.d].concat(c))}else r.onBackgroundRightClick&&r.onBackgroundRightClick.apply(r,c)})}},{passive:!0}),o.addEventListener("contextmenu",function(h){return!r.onBackgroundRightClick&&!r.onNodeRightClick&&!r.onLinkRightClick?!0:(h.preventDefault(),!1)}),r.forceGraph(a),r.shadowGraph(s);var l=ol(function(){si(s,r.width,r.height),r.shadowGraph.linkWidth(function(c){return X(r.linkWidth)(c)+r.linkHoverPrecision});var h=mt(r.canvas);r.shadowGraph.globalScale(h.k).tickFrame()},cd);r.flushShadowCanvas=l.flush,(this._animationCycle=function h(){var c=!r.autoPauseRedraw||!!r.needsRedraw||r.forceGraph.isEngineRunning()||r.graphData.links.some(function(T){return T.__photons&&T.__photons.length});if(r.needsRedraw=!1,r.enablePointerInteraction){var d=r.isPointerDragging?null:f();if(d!==r.hoverObj){var p=r.hoverObj,y=p?p.type:null,x=d?d.type:null;if(y&&y!==x){var v=r["on".concat(y,"Hover")];v&&v(null,p.d)}if(x){var g=r["on".concat(x,"Hover")];g&&g(d.d,y===x?p.d:null)}r.tooltip.content(d&&X(r["".concat(d.type.toLowerCase(),"Label")])(d.d)||null),r.canvas.classList[(d&&r["on".concat(x,"Click")]||!d&&r.onBackgroundClick)&&X(r.showPointerCursor)(d?.d)?"add":"remove"]("clickable"),r.hoverObj=d}c&&l()}if(c){si(a,r.width,r.height);var A=mt(r.canvas).k;r.onRenderFramePre&&r.onRenderFramePre(a,A),r.forceGraph.globalScale(A).tickFrame(),r.onRenderFramePost&&r.onRenderFramePost(a,A)}r.tweenGroup.update(),r.animationFrameRequestId=requestAnimationFrame(h)})()},update:function(n){}});const Qe={width:m.number,height:m.number,graphData:m.shape({nodes:m.arrayOf(m.object).isRequired,links:m.arrayOf(m.object).isRequired}),backgroundColor:m.string,nodeRelSize:m.number,nodeId:m.string,nodeLabel:m.oneOfType([m.string,m.func]),nodeVal:m.oneOfType([m.number,m.string,m.func]),nodeVisibility:m.oneOfType([m.bool,m.string,m.func]),nodeColor:m.oneOfType([m.string,m.func]),nodeAutoColorBy:m.oneOfType([m.string,m.func]),onNodeHover:m.func,onNodeClick:m.func,linkSource:m.string,linkTarget:m.string,linkLabel:m.oneOfType([m.string,m.func]),linkVisibility:m.oneOfType([m.bool,m.string,m.func]),linkColor:m.oneOfType([m.string,m.func]),linkAutoColorBy:m.oneOfType([m.string,m.func]),linkWidth:m.oneOfType([m.number,m.string,m.func]),linkCurvature:m.oneOfType([m.number,m.string,m.func]),linkDirectionalArrowLength:m.oneOfType([m.number,m.string,m.func]),linkDirectionalArrowColor:m.oneOfType([m.string,m.func]),linkDirectionalArrowRelPos:m.oneOfType([m.number,m.string,m.func]),linkDirectionalParticles:m.oneOfType([m.number,m.string,m.func]),linkDirectionalParticleSpeed:m.oneOfType([m.number,m.string,m.func]),linkDirectionalParticleOffset:m.oneOfType([m.number,m.string,m.func]),linkDirectionalParticleWidth:m.oneOfType([m.number,m.string,m.func]),linkDirectionalParticleColor:m.oneOfType([m.string,m.func]),onLinkHover:m.func,onLinkClick:m.func,dagMode:m.oneOf(["td","bu","lr","rl","zin","zout","radialin","radialout"]),dagLevelDistance:m.number,dagNodeFilter:m.func,onDagError:m.func,d3AlphaMin:m.number,d3AlphaDecay:m.number,d3VelocityDecay:m.number,warmupTicks:m.number,cooldownTicks:m.number,cooldownTime:m.number,onEngineTick:m.func,onEngineStop:m.func,getGraphBbox:m.func},bo={zoomToFit:m.func,onNodeRightClick:m.func,onNodeDrag:m.func,onNodeDragEnd:m.func,onLinkRightClick:m.func,linkHoverPrecision:m.number,onBackgroundClick:m.func,onBackgroundRightClick:m.func,showPointerCursor:m.oneOfType([m.bool,m.func]),enablePointerInteraction:m.bool,enableNodeDrag:m.bool},Zn={showNavInfo:m.bool,nodeOpacity:m.number,nodeResolution:m.number,nodeThreeObject:m.oneOfType([m.object,m.string,m.func]),nodeThreeObjectExtend:m.oneOfType([m.bool,m.string,m.func]),nodePositionUpdate:m.func,linkOpacity:m.number,linkResolution:m.number,linkCurveRotation:m.oneOfType([m.number,m.string,m.func]),linkMaterial:m.oneOfType([m.object,m.string,m.func]),linkThreeObject:m.oneOfType([m.object,m.string,m.func]),linkThreeObjectExtend:m.oneOfType([m.bool,m.string,m.func]),linkPositionUpdate:m.func,linkDirectionalArrowResolution:m.number,linkDirectionalParticleResolution:m.number,linkDirectionalParticleThreeObject:m.oneOfType([m.object,m.string,m.func]),forceEngine:m.oneOf(["d3","ngraph"]),ngraphPhysics:m.object,numDimensions:m.oneOf([1,2,3])},vd=Object.assign({},Qe,bo,{linkLineDash:m.oneOfType([m.arrayOf(m.number),m.string,m.func]),nodeCanvasObjectMode:m.oneOfType([m.string,m.func]),nodeCanvasObject:m.func,nodePointerAreaPaint:m.func,linkCanvasObjectMode:m.oneOfType([m.string,m.func]),linkCanvasObject:m.func,linkPointerAreaPaint:m.func,linkDirectionalParticleCanvasObject:m.func,autoPauseRedraw:m.bool,minZoom:m.number,maxZoom:m.number,enableZoomInteraction:m.oneOfType([m.bool,m.func]),enablePanInteraction:m.oneOfType([m.bool,m.func]),onZoom:m.func,onZoomEnd:m.func,onRenderFramePre:m.func,onRenderFramePost:m.func});Object.assign({},Qe,bo,Zn,{enableNavigationControls:m.bool,controlType:m.oneOf(["trackball","orbit","fly"]),rendererConfig:m.object,extraRenderers:m.arrayOf(m.shape({render:m.func.isRequired}))});Object.assign({},Qe,Zn,{nodeDesc:m.oneOfType([m.string,m.func]),linkDesc:m.oneOfType([m.string,m.func])});Object.assign({},Qe,Zn,{markerAttrs:m.object,yOffset:m.number,glScale:m.number});const wo=Xo(_d,{methodNames:["emitParticle","d3Force","d3ReheatSimulation","stopAnimation","pauseAnimation","resumeAnimation","centerAt","zoom","zoomToFit","getGraphBbox","screen2GraphCoords","graph2ScreenCoords"]});wo.displayName="ForceGraph2D";wo.propTypes=vd;export{wo as F,fi as N,m as P,md as R,at as a,ui as g,So as r};
|
|
46
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ii(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,i)}return r}function Gt(e){for(var n=1;n<arguments.length;n++){var r=arguments[n]!=null?arguments[n]:{};n%2?ii(Object(r),!0).forEach(function(i){_e(e,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ii(Object(r)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(r,i))})}return e}function le(e,n){return td(e)||rd(e,n)||_o(e,n)||id()}function pt(e){return ed(e)||nd(e)||_o(e)||od()}function ad(e,n){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,n);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}function sd(e){var n=ad(e,"string");return typeof n=="symbol"?n:n+""}function zn(e){"@babel/helpers - typeof";return zn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},zn(e)}function _o(e,n){if(e){if(typeof e=="string")return Rn(e,n);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Rn(e,n):void 0}}var ud=go(Kh);function oi(e,n,r){!n||typeof r!="string"||e.filter(function(i){return!i[r]}).forEach(function(i){i[r]=ud(n(i))})}function fd(e,n){var r=e.nodes,i=e.links,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a=o.nodeFilter,s=a===void 0?function(){return!0}:a,u=o.onLoopError,f=u===void 0?function(p){throw"Invalid DAG structure! Found cycle in node path: ".concat(p.join(" -> "),".")}:u,l={};r.forEach(function(p){return l[n(p)]={data:p,out:[],depth:-1,skip:!s(p)}}),i.forEach(function(p){var y=p.source,x=p.target,v=b(y),g=b(x);if(!l.hasOwnProperty(v))throw"Missing source node with id: ".concat(v);if(!l.hasOwnProperty(g))throw"Missing target node with id: ".concat(g);var A=l[v],T=l[g];A.out.push(T);function b(w){return zn(w)==="object"?n(w):w}});var h=[];d(Object.values(l));var c=Object.assign.apply(Object,[{}].concat(pt(Object.entries(l).filter(function(p){var y=le(p,2),x=y[1];return!x.skip}).map(function(p){var y=le(p,2),x=y[0],v=y[1];return _e({},x,v.depth)}))));return c;function d(p){for(var y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],x=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,v=function(){var b=p[g];if(y.indexOf(b)!==-1){var w=[].concat(pt(y.slice(y.indexOf(b))),[b]).map(function(S){return n(S.data)});return h.some(function(S){return S.length===w.length&&S.every(function(k,E){return k===w[E]})})||(h.push(w),f(w)),1}x>b.depth&&(b.depth=x,d(b.out,[].concat(pt(y),[b]),x+(b.skip?0:1)))},g=0,A=p.length;g<A;g++)v()}}var ld=2,rt=function(n,r){return r.onNeedsRedraw&&r.onNeedsRedraw()},ai=function(n,r){if(!r.isShadow){var i=X(r.linkDirectionalParticles);r.graphData.links.forEach(function(o){var a=Math.round(Math.abs(i(o)));a?o.__photons=pt(Array(a)).map(function(){return{}}):delete o.__photons})}},Ve=Hn({props:{graphData:{default:{nodes:[],links:[]},onChange:function(n,r){r.engineRunning=!1,ai(n,r)}},dagMode:{onChange:function(n,r){!n&&(r.graphData.nodes||[]).forEach(function(i){return i.fx=i.fy=void 0})}},dagLevelDistance:{},dagNodeFilter:{default:function(n){return!0}},onDagError:{triggerUpdate:!1},nodeRelSize:{default:4,triggerUpdate:!1,onChange:rt},nodeId:{default:"id"},nodeVal:{default:"val",triggerUpdate:!1,onChange:rt},nodeColor:{default:"color",triggerUpdate:!1,onChange:rt},nodeAutoColorBy:{},nodeCanvasObject:{triggerUpdate:!1,onChange:rt},nodeCanvasObjectMode:{default:function(){return"replace"},triggerUpdate:!1,onChange:rt},nodeVisibility:{default:!0,triggerUpdate:!1,onChange:rt},linkSource:{default:"source"},linkTarget:{default:"target"},linkVisibility:{default:!0,triggerUpdate:!1,onChange:rt},linkColor:{default:"color",triggerUpdate:!1,onChange:rt},linkAutoColorBy:{},linkLineDash:{triggerUpdate:!1,onChange:rt},linkWidth:{default:1,triggerUpdate:!1,onChange:rt},linkCurvature:{default:0,triggerUpdate:!1,onChange:rt},linkCanvasObject:{triggerUpdate:!1,onChange:rt},linkCanvasObjectMode:{default:function(){return"replace"},triggerUpdate:!1,onChange:rt},linkDirectionalArrowLength:{default:0,triggerUpdate:!1,onChange:rt},linkDirectionalArrowColor:{triggerUpdate:!1,onChange:rt},linkDirectionalArrowRelPos:{default:.5,triggerUpdate:!1,onChange:rt},linkDirectionalParticles:{default:0,triggerUpdate:!1,onChange:ai},linkDirectionalParticleSpeed:{default:.01,triggerUpdate:!1},linkDirectionalParticleOffset:{default:0,triggerUpdate:!1},linkDirectionalParticleWidth:{default:4,triggerUpdate:!1},linkDirectionalParticleColor:{triggerUpdate:!1},linkDirectionalParticleCanvasObject:{triggerUpdate:!1},globalScale:{default:1,triggerUpdate:!1},d3AlphaMin:{default:0,triggerUpdate:!1},d3AlphaDecay:{default:.0228,triggerUpdate:!1,onChange:function(n,r){r.forceLayout.alphaDecay(n)}},d3AlphaTarget:{default:0,triggerUpdate:!1,onChange:function(n,r){r.forceLayout.alphaTarget(n)}},d3VelocityDecay:{default:.4,triggerUpdate:!1,onChange:function(n,r){r.forceLayout.velocityDecay(n)}},warmupTicks:{default:0,triggerUpdate:!1},cooldownTicks:{default:1/0,triggerUpdate:!1},cooldownTime:{default:15e3,triggerUpdate:!1},onUpdate:{default:function(){},triggerUpdate:!1},onFinishUpdate:{default:function(){},triggerUpdate:!1},onEngineTick:{default:function(){},triggerUpdate:!1},onEngineStop:{default:function(){},triggerUpdate:!1},onNeedsRedraw:{triggerUpdate:!1},isShadow:{default:!1,triggerUpdate:!1}},methods:{d3Force:function(n,r,i){return i===void 0?n.forceLayout.force(r):(n.forceLayout.force(r,i),this)},d3ReheatSimulation:function(n){return n.forceLayout.alpha(1),this.resetCountdown(),this},resetCountdown:function(n){return n.cntTicks=0,n.startTickTime=new Date,n.engineRunning=!0,this},isEngineRunning:function(n){return!!n.engineRunning},tickFrame:function(n){return!n.isShadow&&r(),o(),!n.isShadow&&a(),!n.isShadow&&s(),i(),this;function r(){n.engineRunning&&(++n.cntTicks>n.cooldownTicks||new Date-n.startTickTime>n.cooldownTime||n.d3AlphaMin>0&&n.forceLayout.alpha()<n.d3AlphaMin?(n.engineRunning=!1,n.onEngineStop()):(n.forceLayout.tick(),n.onEngineTick()))}function i(){var u=X(n.nodeVisibility),f=X(n.nodeVal),l=X(n.nodeColor),h=X(n.nodeCanvasObjectMode),c=n.ctx,d=n.isShadow/n.globalScale,p=n.graphData.nodes.filter(u);c.save(),p.forEach(function(y){var x=h(y);if(n.nodeCanvasObject&&(x==="before"||x==="replace")&&(n.nodeCanvasObject(y,c,n.globalScale),x==="replace")){c.restore();return}var v=Math.sqrt(Math.max(0,f(y)||1))*n.nodeRelSize+d;c.beginPath(),c.arc(y.x,y.y,v,0,2*Math.PI,!1),c.fillStyle=l(y)||"rgba(31, 120, 180, 0.92)",c.fill(),n.nodeCanvasObject&&x==="after"&&n.nodeCanvasObject(y,n.ctx,n.globalScale)}),c.restore()}function o(){var u=X(n.linkVisibility),f=X(n.linkColor),l=X(n.linkWidth),h=X(n.linkLineDash),c=X(n.linkCurvature),d=X(n.linkCanvasObjectMode),p=n.ctx,y=n.isShadow*2,x=n.graphData.links.filter(u);x.forEach(S);var v=[],g=[],A=x;if(n.linkCanvasObject){var T=[],b=[];x.forEach(function(k){return({before:v,after:g,replace:T}[d(k)]||b).push(k)}),A=[].concat(pt(v),g,b),v=v.concat(T)}p.save(),v.forEach(function(k){return n.linkCanvasObject(k,p,n.globalScale)}),p.restore();var w=Yh(A,[f,l,h]);p.save(),Object.entries(w).forEach(function(k){var E=le(k,2),I=E[0],R=E[1],z=!I||I==="undefined"?"rgba(0,0,0,0.15)":I;Object.entries(R).forEach(function($){var L=le($,2),C=L[0],N=L[1],P=(C||1)/n.globalScale+y;Object.entries(N).forEach(function(D){var H=le(D,2);H[0];var q=H[1],G=h(q[0]);p.beginPath(),q.forEach(function(_){var M=_.source,U=_.target;if(!(!M||!U||!M.hasOwnProperty("x")||!U.hasOwnProperty("x"))){p.moveTo(M.x,M.y);var j=_.__controlPoints;j?p[j.length===2?"quadraticCurveTo":"bezierCurveTo"].apply(p,pt(j).concat([U.x,U.y])):p.lineTo(U.x,U.y)}}),p.strokeStyle=z,p.lineWidth=P,p.setLineDash(G||[]),p.stroke()})})}),p.restore(),p.save(),g.forEach(function(k){return n.linkCanvasObject(k,p,n.globalScale)}),p.restore();function S(k){var E=c(k);if(!E){k.__controlPoints=null;return}var I=k.source,R=k.target;if(!(!I||!R||!I.hasOwnProperty("x")||!R.hasOwnProperty("x"))){var z=Math.sqrt(Math.pow(R.x-I.x,2)+Math.pow(R.y-I.y,2));if(z>0){var $=Math.atan2(R.y-I.y,R.x-I.x),L=z*E,C={x:(I.x+R.x)/2+L*Math.cos($-Math.PI/2),y:(I.y+R.y)/2+L*Math.sin($-Math.PI/2)};k.__controlPoints=[C.x,C.y]}else{var N=E*70;k.__controlPoints=[R.x,R.y-N,R.x+N,R.y]}}}}function a(){var u=1.6,f=.2,l=X(n.linkDirectionalArrowLength),h=X(n.linkDirectionalArrowRelPos),c=X(n.linkVisibility),d=X(n.linkDirectionalArrowColor||n.linkColor),p=X(n.nodeVal),y=n.ctx;y.save(),n.graphData.links.filter(c).forEach(function(x){var v=l(x);if(!(!v||v<0)){var g=x.source,A=x.target;if(!(!g||!A||!g.hasOwnProperty("x")||!A.hasOwnProperty("x"))){var T=Math.sqrt(Math.max(0,p(g)||1))*n.nodeRelSize,b=Math.sqrt(Math.max(0,p(A)||1))*n.nodeRelSize,w=Math.min(1,Math.max(0,h(x))),S=d(x)||"rgba(0,0,0,0.28)",k=v/u/2,E=x.__controlPoints&&ri(K,[g.x,g.y].concat(pt(x.__controlPoints),[A.x,A.y])),I=E?function(P){return E.get(P)}:function(P){return{x:g.x+(A.x-g.x)*P||0,y:g.y+(A.y-g.y)*P||0}},R=E?E.length():Math.sqrt(Math.pow(A.x-g.x,2)+Math.pow(A.y-g.y,2)),z=T+v+(R-T-b-v)*w,$=I(z/R),L=I((z-v)/R),C=I((z-v*(1-f))/R),N=Math.atan2($.y-L.y,$.x-L.x)-Math.PI/2;y.beginPath(),y.moveTo($.x,$.y),y.lineTo(L.x+k*Math.cos(N),L.y+k*Math.sin(N)),y.lineTo(C.x,C.y),y.lineTo(L.x-k*Math.cos(N),L.y-k*Math.sin(N)),y.fillStyle=S,y.fill()}}}),y.restore()}function s(){var u=X(n.linkDirectionalParticles),f=X(n.linkDirectionalParticleSpeed),l=X(n.linkDirectionalParticleOffset),h=X(n.linkDirectionalParticleWidth),c=X(n.linkVisibility),d=X(n.linkDirectionalParticleColor||n.linkColor),p=n.ctx;p.save(),n.graphData.links.filter(c).forEach(function(y){var x=u(y);if(!(!y.hasOwnProperty("__photons")||!y.__photons.length)){var v=y.source,g=y.target;if(!(!v||!g||!v.hasOwnProperty("x")||!g.hasOwnProperty("x"))){var A=f(y),T=Math.abs(l(y)),b=y.__photons||[],w=Math.max(0,h(y)/2)/Math.sqrt(n.globalScale),S=d(y)||"rgba(0,0,0,0.28)";p.fillStyle=S;var k=y.__controlPoints?ri(K,[v.x,v.y].concat(pt(y.__controlPoints),[g.x,g.y])):null,E=0,I=!1;b.forEach(function(R){var z=!!R.__singleHop;if(R.hasOwnProperty("__progressRatio")||(R.__progressRatio=z?0:(E+T)/x),!z&&E++,R.__progressRatio+=A,R.__progressRatio>=1)if(!z)R.__progressRatio=R.__progressRatio%1;else{I=!0;return}var $=R.__progressRatio,L=k?k.get($):{x:v.x+(g.x-v.x)*$||0,y:v.y+(g.y-v.y)*$||0};n.linkDirectionalParticleCanvasObject?n.linkDirectionalParticleCanvasObject(L.x,L.y,y,p,n.globalScale):(p.beginPath(),p.arc(L.x,L.y,w,0,2*Math.PI,!1),p.fill())}),I&&(y.__photons=y.__photons.filter(function(R){return!R.__singleHop||R.__progressRatio<=1}))}}}),p.restore()}},emitParticle:function(n,r){return r&&(!r.__photons&&(r.__photons=[]),r.__photons.push({__singleHop:!0})),this}},stateInit:function(){return{forceLayout:Sh().force("link",vh()).force("charge",Th()).force("center",xc()).force("dagRadial",null).stop(),engineRunning:!1}},init:function(n,r){r.ctx=n},update:function(n,r){n.engineRunning=!1,n.onUpdate(),n.nodeAutoColorBy!==null&&oi(n.graphData.nodes,X(n.nodeAutoColorBy),n.nodeColor),n.linkAutoColorBy!==null&&oi(n.graphData.links,X(n.linkAutoColorBy),n.linkColor),n.graphData.links.forEach(function(d){d.source=d[n.linkSource],d.target=d[n.linkTarget]}),n.forceLayout.stop().alpha(1).nodes(n.graphData.nodes);var i=n.forceLayout.force("link");i&&i.id(function(d){return d[n.nodeId]}).links(n.graphData.links);var o=n.dagMode&&fd(n.graphData,function(d){return d[n.nodeId]},{nodeFilter:n.dagNodeFilter,onLoopError:n.onDagError||void 0}),a=Math.max.apply(Math,pt(Object.values(o||[]))),s=n.dagLevelDistance||n.graphData.nodes.length/(a||1)*ld*(["radialin","radialout"].indexOf(n.dagMode)!==-1?.7:1);if(["lr","rl","td","bu"].includes(r.dagMode)){var u=["lr","rl"].includes(r.dagMode)?"fx":"fy";n.graphData.nodes.filter(n.dagNodeFilter).forEach(function(d){return delete d[u]})}if(["lr","rl","td","bu"].includes(n.dagMode)){var f=["rl","bu"].includes(n.dagMode),l=function(p){return(o[p[n.nodeId]]-a/2)*s*(f?-1:1)},h=["lr","rl"].includes(n.dagMode)?"fx":"fy";n.graphData.nodes.filter(n.dagNodeFilter).forEach(function(d){return d[h]=l(d)})}n.forceLayout.force("dagRadial",["radialin","radialout"].indexOf(n.dagMode)!==-1?Eh(function(d){var p=o[d[n.nodeId]]||-1;return(n.dagMode==="radialin"?a-p:p)*s}).strength(function(d){return n.dagNodeFilter(d)?1:0}):null);for(var c=0;c<n.warmupTicks&&!(n.d3AlphaMin>0&&n.forceLayout.alpha()<n.d3AlphaMin);c++)n.forceLayout.tick();this.resetCountdown(),n.onFinishUpdate()}});function vo(e,n){var r=e instanceof Array?e:[e],i=new n;return i._destructor&&i._destructor(),{linkProp:function(a){return{default:i[a](),onChange:function(u,f){r.forEach(function(l){return f[l][a](u)})},triggerUpdate:!1}},linkMethod:function(a){return function(s){for(var u=arguments.length,f=new Array(u>1?u-1:0),l=1;l<u;l++)f[l-1]=arguments[l];var h=[];return r.forEach(function(c){var d=s[c],p=d[a].apply(d,f);p!==d&&h.push(p)}),h.length?h[0]:this}}}}var cd=800,hd=4,dd=5,mo=vo("forceGraph",Ve),pd=vo(["forceGraph","shadowGraph"],Ve),gd=Object.assign.apply(Object,pt(["nodeColor","nodeAutoColorBy","nodeCanvasObject","nodeCanvasObjectMode","linkColor","linkAutoColorBy","linkLineDash","linkWidth","linkCanvasObject","linkCanvasObjectMode","linkDirectionalArrowLength","linkDirectionalArrowColor","linkDirectionalArrowRelPos","linkDirectionalParticles","linkDirectionalParticleSpeed","linkDirectionalParticleOffset","linkDirectionalParticleWidth","linkDirectionalParticleColor","linkDirectionalParticleCanvasObject","dagMode","dagLevelDistance","dagNodeFilter","onDagError","d3AlphaMin","d3AlphaDecay","d3VelocityDecay","warmupTicks","cooldownTicks","cooldownTime","onEngineTick","onEngineStop"].map(function(e){return _e({},e,mo.linkProp(e))})).concat(pt(["nodeRelSize","nodeId","nodeVal","nodeVisibility","linkSource","linkTarget","linkVisibility","linkCurvature"].map(function(e){return _e({},e,pd.linkProp(e))})))),yd=Object.assign.apply(Object,pt(["d3Force","d3ReheatSimulation","emitParticle"].map(function(e){return _e({},e,mo.linkMethod(e))})));function hn(e){if(e.canvas){var n=e.canvas.width,r=e.canvas.height;n===300&&r===150&&(n=r=0);var i=window.devicePixelRatio;n/=i,r/=i,[e.canvas,e.shadowCanvas].forEach(function(a){a.style.width="".concat(e.width,"px"),a.style.height="".concat(e.height,"px"),a.width=e.width*i,a.height=e.height*i,!n&&!r&&a.getContext("2d").scale(i,i)});var o=mt(e.canvas).k;e.zoom.translateBy(e.zoom.__baseElem,(e.width-n)/2/o,(e.height-r)/2/o),e.needsRedraw=!0}}function xo(e){var n=window.devicePixelRatio;e.setTransform(n,0,0,n,0,0)}function si(e,n,r){e.save(),xo(e),e.clearRect(0,0,n,r),e.restore()}var _d=Hn({props:Gt({width:{default:window.innerWidth,onChange:function(n,r){return hn(r)},triggerUpdate:!1},height:{default:window.innerHeight,onChange:function(n,r){return hn(r)},triggerUpdate:!1},graphData:{default:{nodes:[],links:[]},onChange:function(n,r){[n.nodes,n.links].every(function(o){return(o||[]).every(function(a){return!a.hasOwnProperty("__indexColor")})})&&r.colorTracker.reset(),[{type:"Node",objs:n.nodes},{type:"Link",objs:n.links}].forEach(i),r.forceGraph.graphData(n),r.shadowGraph.graphData(n);function i(o){var a=o.type,s=o.objs;s.filter(function(u){if(!u.hasOwnProperty("__indexColor"))return!0;var f=r.colorTracker.lookup(u.__indexColor);return!f||!f.hasOwnProperty("d")||f.d!==u}).forEach(function(u){u.__indexColor=r.colorTracker.register({type:a,d:u})})}},triggerUpdate:!1},backgroundColor:{onChange:function(n,r){r.canvas&&n&&(r.canvas.style.background=n)},triggerUpdate:!1},nodeLabel:{default:"name",triggerUpdate:!1},nodePointerAreaPaint:{onChange:function(n,r){r.shadowGraph.nodeCanvasObject(n?function(i,o,a){return n(i,i.__indexColor,o,a)}:null),r.flushShadowCanvas&&r.flushShadowCanvas()},triggerUpdate:!1},linkPointerAreaPaint:{onChange:function(n,r){r.shadowGraph.linkCanvasObject(n?function(i,o,a){return n(i,i.__indexColor,o,a)}:null),r.flushShadowCanvas&&r.flushShadowCanvas()},triggerUpdate:!1},linkLabel:{default:"name",triggerUpdate:!1},linkHoverPrecision:{default:4,triggerUpdate:!1},minZoom:{default:.01,onChange:function(n,r){r.zoom.scaleExtent([n,r.zoom.scaleExtent()[1]])},triggerUpdate:!1},maxZoom:{default:1e3,onChange:function(n,r){r.zoom.scaleExtent([r.zoom.scaleExtent()[0],n])},triggerUpdate:!1},enableNodeDrag:{default:!0,triggerUpdate:!1},enableZoomInteraction:{default:!0,triggerUpdate:!1},enablePanInteraction:{default:!0,triggerUpdate:!1},enableZoomPanInteraction:{default:!0,triggerUpdate:!1},enablePointerInteraction:{default:!0,onChange:function(n,r){r.hoverObj=null},triggerUpdate:!1},autoPauseRedraw:{default:!0,triggerUpdate:!1},onNodeDrag:{default:function(){},triggerUpdate:!1},onNodeDragEnd:{default:function(){},triggerUpdate:!1},onNodeClick:{triggerUpdate:!1},onNodeRightClick:{triggerUpdate:!1},onNodeHover:{triggerUpdate:!1},onLinkClick:{triggerUpdate:!1},onLinkRightClick:{triggerUpdate:!1},onLinkHover:{triggerUpdate:!1},onBackgroundClick:{triggerUpdate:!1},onBackgroundRightClick:{triggerUpdate:!1},showPointerCursor:{default:!0,triggerUpdate:!1},onZoom:{triggerUpdate:!1},onZoomEnd:{triggerUpdate:!1},onRenderFramePre:{triggerUpdate:!1},onRenderFramePost:{triggerUpdate:!1}},gd),aliases:{stopAnimation:"pauseAnimation"},methods:Gt({graph2ScreenCoords:function(n,r,i){var o=mt(n.canvas);return{x:r*o.k+o.x,y:i*o.k+o.y}},screen2GraphCoords:function(n,r,i){var o=mt(n.canvas);return{x:(r-o.x)/o.k,y:(i-o.y)/o.k}},centerAt:function(n,r,i,o){if(!n.canvas)return null;if(r!==void 0||i!==void 0){var a=Object.assign({},r!==void 0?{x:r}:{},i!==void 0?{y:i}:{});return o?n.tweenGroup.add(new Pr(s()).to(a,o).easing(Lt.Quadratic.Out).onUpdate(u).start()):u(a),this}return s();function s(){var f=mt(n.canvas);return{x:(n.width/2-f.x)/f.k,y:(n.height/2-f.y)/f.k}}function u(f){var l=f.x,h=f.y;n.zoom.translateTo(n.zoom.__baseElem,l===void 0?s().x:l,h===void 0?s().y:h),n.needsRedraw=!0}},zoom:function(n,r,i){if(!n.canvas)return null;if(r!==void 0)return i?n.tweenGroup.add(new Pr({k:o()}).to({k:r},i).easing(Lt.Quadratic.Out).onUpdate(function(s){var u=s.k;return a(u)}).start()):a(r),this;return o();function o(){return mt(n.canvas).k}function a(s){n.zoom.scaleTo(n.zoom.__baseElem,s),n.needsRedraw=!0}},zoomToFit:function(n){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:10,o=arguments.length,a=new Array(o>3?o-3:0),s=3;s<o;s++)a[s-3]=arguments[s];var u=this.getGraphBbox.apply(this,a);if(u){var f={x:(u.x[0]+u.x[1])/2,y:(u.y[0]+u.y[1])/2},l=Math.max(1e-12,Math.min(1e12,(n.width-i*2)/(u.x[1]-u.x[0]),(n.height-i*2)/(u.y[1]-u.y[0])));this.centerAt(f.x,f.y,r),this.zoom(l,r)}return this},getGraphBbox:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:function(){return!0},i=X(n.nodeVal),o=function(u){return Math.sqrt(Math.max(0,i(u)||1))*n.nodeRelSize},a=n.graphData.nodes.filter(r).map(function(s){return{x:s.x,y:s.y,r:o(s)}});return a.length?{x:[Sr(a,function(s){return s.x-s.r}),Cr(a,function(s){return s.x+s.r})],y:[Sr(a,function(s){return s.y-s.r}),Cr(a,function(s){return s.y+s.r})]}:null},pauseAnimation:function(n){return n.animationFrameRequestId&&(cancelAnimationFrame(n.animationFrameRequestId),n.animationFrameRequestId=null),this},resumeAnimation:function(n){return n.animationFrameRequestId||this._animationCycle(),this},_destructor:function(){this.pauseAnimation(),this.graphData({nodes:[],links:[]})}},yd),stateInit:function(){return{lastSetZoom:1,zoom:Ef(),forceGraph:new Ve,shadowGraph:new Ve().cooldownTicks(0).nodeColor("__indexColor").linkColor("__indexColor").isShadow(!0),colorTracker:new Ql,tweenGroup:new Li}},init:function(n,r){var i=this;n.innerHTML="";var o=document.createElement("div");o.classList.add("force-graph-container"),o.style.position="relative",n.appendChild(o),r.canvas=document.createElement("canvas"),r.backgroundColor&&(r.canvas.style.background=r.backgroundColor),o.appendChild(r.canvas),r.shadowCanvas=document.createElement("canvas");var a=r.canvas.getContext("2d"),s=r.shadowCanvas.getContext("2d",{willReadFrequently:!0}),u={x:-1e12,y:-1e12},f=function(){var c=null,d=window.devicePixelRatio,p=u.x>0&&u.y>0?s.getImageData(u.x*d,u.y*d,1,1):null;return p&&(c=r.colorTracker.lookup(p.data)),c};dt(r.canvas).call(Ds().subject(function(){if(!r.enableNodeDrag)return null;var h=f();return h&&h.type==="Node"?h.d:null}).on("start",function(h){var c=h.subject;c.__initialDragPos={x:c.x,y:c.y,fx:c.fx,fy:c.fy},h.active||(c.fx=c.x,c.fy=c.y),r.canvas.classList.add("grabbable")}).on("drag",function(h){var c=h.subject,d=c.__initialDragPos,p=h,y=mt(r.canvas).k,x={x:d.x+(p.x-d.x)/y-c.x,y:d.y+(p.y-d.y)/y-c.y};["x","y"].forEach(function(v){return c["f".concat(v)]=c[v]=d[v]+(p[v]-d[v])/y}),!(!c.__dragged&&dd>=Math.sqrt(Rf(["x","y"].map(function(v){return Math.pow(h[v]-d[v],2)}))))&&(r.forceGraph.d3AlphaTarget(.3).resetCountdown(),r.isPointerDragging=!0,c.__dragged=!0,r.onNodeDrag(c,x))}).on("end",function(h){var c=h.subject,d=c.__initialDragPos,p={x:c.x-d.x,y:c.y-d.y};d.fx===void 0&&(c.fx=void 0),d.fy===void 0&&(c.fy=void 0),delete c.__initialDragPos,r.forceGraph.d3AlphaTarget()&&r.forceGraph.d3AlphaTarget(0).resetCountdown(),r.canvas.classList.remove("grabbable"),r.isPointerDragging=!1,c.__dragged&&(delete c.__dragged,r.onNodeDragEnd(c,p))})),r.zoom(r.zoom.__baseElem=dt(r.canvas)),r.zoom.__baseElem.on("dblclick.zoom",null),r.zoom.filter(function(h){return!h.button&&r.enableZoomPanInteraction&&(h.type!=="wheel"||X(r.enableZoomInteraction)(h))&&(h.type==="wheel"||X(r.enablePanInteraction)(h))}).on("zoom",function(h){var c=h.transform;[a,s].forEach(function(d){xo(d),d.translate(c.x,c.y),d.scale(c.k,c.k)}),r.isPointerDragging=!0,r.onZoom&&r.onZoom(Gt(Gt({},c),i.centerAt())),r.needsRedraw=!0}).on("end",function(h){r.isPointerDragging=!1,r.onZoomEnd&&r.onZoomEnd(Gt(Gt({},h.transform),i.centerAt()))}),hn(r),r.forceGraph.onNeedsRedraw(function(){return r.needsRedraw=!0}).onFinishUpdate(function(){mt(r.canvas).k===r.lastSetZoom&&r.graphData.nodes.length&&(r.zoom.scaleTo(r.zoom.__baseElem,r.lastSetZoom=hd/Math.cbrt(r.graphData.nodes.length)),r.needsRedraw=!0)}),r.tooltip=new mc(o),["pointermove","pointerdown"].forEach(function(h){return o.addEventListener(h,function(c){h==="pointerdown"&&(r.isPointerPressed=!0,r.pointerDownEvent=c),!r.isPointerDragging&&c.type==="pointermove"&&r.onBackgroundClick&&(c.pressure>0||r.isPointerPressed)&&(c.pointerType==="mouse"||c.movementX===void 0||[c.movementX,c.movementY].some(function(y){return Math.abs(y)>1}))&&(r.isPointerDragging=!0);var d=p(o);u.x=c.pageX-d.left,u.y=c.pageY-d.top;function p(y){var x=y.getBoundingClientRect(),v=window.pageXOffset||document.documentElement.scrollLeft,g=window.pageYOffset||document.documentElement.scrollTop;return{top:x.top+g,left:x.left+v}}},{passive:!0})}),o.addEventListener("pointerup",function(h){if(r.isPointerPressed){if(r.isPointerPressed=!1,r.isPointerDragging){r.isPointerDragging=!1;return}var c=[h,r.pointerDownEvent];requestAnimationFrame(function(){if(h.button===0)if(r.hoverObj){var d=r["on".concat(r.hoverObj.type,"Click")];d&&d.apply(void 0,[r.hoverObj.d].concat(c))}else r.onBackgroundClick&&r.onBackgroundClick.apply(r,c);if(h.button===2)if(r.hoverObj){var p=r["on".concat(r.hoverObj.type,"RightClick")];p&&p.apply(void 0,[r.hoverObj.d].concat(c))}else r.onBackgroundRightClick&&r.onBackgroundRightClick.apply(r,c)})}},{passive:!0}),o.addEventListener("contextmenu",function(h){return!r.onBackgroundRightClick&&!r.onNodeRightClick&&!r.onLinkRightClick?!0:(h.preventDefault(),!1)}),r.forceGraph(a),r.shadowGraph(s);var l=ol(function(){si(s,r.width,r.height),r.shadowGraph.linkWidth(function(c){return X(r.linkWidth)(c)+r.linkHoverPrecision});var h=mt(r.canvas);r.shadowGraph.globalScale(h.k).tickFrame()},cd);r.flushShadowCanvas=l.flush,(this._animationCycle=function h(){var c=!r.autoPauseRedraw||!!r.needsRedraw||r.forceGraph.isEngineRunning()||r.graphData.links.some(function(T){return T.__photons&&T.__photons.length});if(r.needsRedraw=!1,r.enablePointerInteraction){var d=r.isPointerDragging?null:f();if(d!==r.hoverObj){var p=r.hoverObj,y=p?p.type:null,x=d?d.type:null;if(y&&y!==x){var v=r["on".concat(y,"Hover")];v&&v(null,p.d)}if(x){var g=r["on".concat(x,"Hover")];g&&g(d.d,y===x?p.d:null)}r.tooltip.content(d&&X(r["".concat(d.type.toLowerCase(),"Label")])(d.d)||null),r.canvas.classList[(d&&r["on".concat(x,"Click")]||!d&&r.onBackgroundClick)&&X(r.showPointerCursor)(d?.d)?"add":"remove"]("clickable"),r.hoverObj=d}c&&l()}if(c){si(a,r.width,r.height);var A=mt(r.canvas).k;r.onRenderFramePre&&r.onRenderFramePre(a,A),r.forceGraph.globalScale(A).tickFrame(),r.onRenderFramePost&&r.onRenderFramePost(a,A)}r.tweenGroup.update(),r.animationFrameRequestId=requestAnimationFrame(h)})()},update:function(n){}});const Qe={width:m.number,height:m.number,graphData:m.shape({nodes:m.arrayOf(m.object).isRequired,links:m.arrayOf(m.object).isRequired}),backgroundColor:m.string,nodeRelSize:m.number,nodeId:m.string,nodeLabel:m.oneOfType([m.string,m.func]),nodeVal:m.oneOfType([m.number,m.string,m.func]),nodeVisibility:m.oneOfType([m.bool,m.string,m.func]),nodeColor:m.oneOfType([m.string,m.func]),nodeAutoColorBy:m.oneOfType([m.string,m.func]),onNodeHover:m.func,onNodeClick:m.func,linkSource:m.string,linkTarget:m.string,linkLabel:m.oneOfType([m.string,m.func]),linkVisibility:m.oneOfType([m.bool,m.string,m.func]),linkColor:m.oneOfType([m.string,m.func]),linkAutoColorBy:m.oneOfType([m.string,m.func]),linkWidth:m.oneOfType([m.number,m.string,m.func]),linkCurvature:m.oneOfType([m.number,m.string,m.func]),linkDirectionalArrowLength:m.oneOfType([m.number,m.string,m.func]),linkDirectionalArrowColor:m.oneOfType([m.string,m.func]),linkDirectionalArrowRelPos:m.oneOfType([m.number,m.string,m.func]),linkDirectionalParticles:m.oneOfType([m.number,m.string,m.func]),linkDirectionalParticleSpeed:m.oneOfType([m.number,m.string,m.func]),linkDirectionalParticleOffset:m.oneOfType([m.number,m.string,m.func]),linkDirectionalParticleWidth:m.oneOfType([m.number,m.string,m.func]),linkDirectionalParticleColor:m.oneOfType([m.string,m.func]),onLinkHover:m.func,onLinkClick:m.func,dagMode:m.oneOf(["td","bu","lr","rl","zin","zout","radialin","radialout"]),dagLevelDistance:m.number,dagNodeFilter:m.func,onDagError:m.func,d3AlphaMin:m.number,d3AlphaDecay:m.number,d3VelocityDecay:m.number,warmupTicks:m.number,cooldownTicks:m.number,cooldownTime:m.number,onEngineTick:m.func,onEngineStop:m.func,getGraphBbox:m.func},bo={zoomToFit:m.func,onNodeRightClick:m.func,onNodeDrag:m.func,onNodeDragEnd:m.func,onLinkRightClick:m.func,linkHoverPrecision:m.number,onBackgroundClick:m.func,onBackgroundRightClick:m.func,showPointerCursor:m.oneOfType([m.bool,m.func]),enablePointerInteraction:m.bool,enableNodeDrag:m.bool},Zn={showNavInfo:m.bool,nodeOpacity:m.number,nodeResolution:m.number,nodeThreeObject:m.oneOfType([m.object,m.string,m.func]),nodeThreeObjectExtend:m.oneOfType([m.bool,m.string,m.func]),nodePositionUpdate:m.func,linkOpacity:m.number,linkResolution:m.number,linkCurveRotation:m.oneOfType([m.number,m.string,m.func]),linkMaterial:m.oneOfType([m.object,m.string,m.func]),linkThreeObject:m.oneOfType([m.object,m.string,m.func]),linkThreeObjectExtend:m.oneOfType([m.bool,m.string,m.func]),linkPositionUpdate:m.func,linkDirectionalArrowResolution:m.number,linkDirectionalParticleResolution:m.number,linkDirectionalParticleThreeObject:m.oneOfType([m.object,m.string,m.func]),forceEngine:m.oneOf(["d3","ngraph"]),ngraphPhysics:m.object,numDimensions:m.oneOf([1,2,3])},vd=Object.assign({},Qe,bo,{linkLineDash:m.oneOfType([m.arrayOf(m.number),m.string,m.func]),nodeCanvasObjectMode:m.oneOfType([m.string,m.func]),nodeCanvasObject:m.func,nodePointerAreaPaint:m.func,linkCanvasObjectMode:m.oneOfType([m.string,m.func]),linkCanvasObject:m.func,linkPointerAreaPaint:m.func,linkDirectionalParticleCanvasObject:m.func,autoPauseRedraw:m.bool,minZoom:m.number,maxZoom:m.number,enableZoomInteraction:m.oneOfType([m.bool,m.func]),enablePanInteraction:m.oneOfType([m.bool,m.func]),onZoom:m.func,onZoomEnd:m.func,onRenderFramePre:m.func,onRenderFramePost:m.func});Object.assign({},Qe,bo,Zn,{enableNavigationControls:m.bool,controlType:m.oneOf(["trackball","orbit","fly"]),rendererConfig:m.object,extraRenderers:m.arrayOf(m.shape({render:m.func.isRequired}))});Object.assign({},Qe,Zn,{nodeDesc:m.oneOfType([m.string,m.func]),linkDesc:m.oneOfType([m.string,m.func])});Object.assign({},Qe,Zn,{markerAttrs:m.object,yOffset:m.number,glScale:m.number});const wo=Xo(_d,{methodNames:["emitParticle","d3Force","d3ReheatSimulation","stopAnimation","pauseAnimation","resumeAnimation","centerAt","zoom","zoomToFit","getGraphBbox","screen2GraphCoords","graph2ScreenCoords"]});wo.displayName="ForceGraph2D";wo.propTypes=vd;export{wo as F,fi as N,m as P,xd as R,at as a,md as c,ui as g,So as r};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import{b0 as i,h as t}from"./index-VHp17GQX.js";async function n({base64:a}){if(a){const{data:e}=await i.post("/api/image",{image:a});return e.url}throw new Error("No file provided")}function r({limit:a=50,offset:e=0}={}){return t(`query FetchImages($pagination: PaginationInput) {
|
|
2
|
+
allImages(pagination: $pagination) {
|
|
3
|
+
totalCount
|
|
4
|
+
images {
|
|
5
|
+
id
|
|
6
|
+
url
|
|
7
|
+
referenceCount
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
}`,{pagination:{limit:a,offset:e}})}function u(a){return t(`query FetchImage($id: ID!) {
|
|
11
|
+
image(id: $id) {
|
|
12
|
+
id
|
|
13
|
+
url
|
|
14
|
+
}
|
|
15
|
+
}`,{id:a})}function g(a){return t(`mutation DeleteImage($id: ID!) {
|
|
16
|
+
deleteImage(id: $id)
|
|
17
|
+
}`,{id:a})}const m=n;export{u as a,g as d,r as f,m as u};
|