diff --git a/.nojekyll b/.nojekyll new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/.nojekyll @@ -0,0 +1 @@ + diff --git a/404.html b/404.html new file mode 100644 index 0000000..01e5146 --- /dev/null +++ b/404.html @@ -0,0 +1,23 @@ + + + + + + 404 | He Tree React + + + + + + + + + + + + +
Skip to content

404

PAGE NOT FOUND

But if you don't change your direction, and if you keep looking, you may end up where you are heading.
+ + + + \ No newline at end of file diff --git a/CNAME b/CNAME new file mode 100644 index 0000000..3d415ab --- /dev/null +++ b/CNAME @@ -0,0 +1 @@ +he-tree-react.phphe.com diff --git a/assets/app.B6XZencG.js b/assets/app.B6XZencG.js new file mode 100644 index 0000000..b6f3103 --- /dev/null +++ b/assets/app.B6XZencG.js @@ -0,0 +1,7 @@ +function __vite__mapDeps(indexes) { + if (!__vite__mapDeps.viteFileDeps) { + __vite__mapDeps.viteFileDeps = [] + } + return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) +} +import{j as o,a6 as p,a7 as u,a8 as c,a9 as l,aa as f,ab as d,ac as m,ad as h,ae as A,af as g,Y as v,d as P,u as w,l as y,z as C,ag as R,ah as _,ai as b,a4 as E}from"./chunks/framework.BthLuVtL.js";import{R as D}from"./chunks/theme.Dl8hKFPF.js";function i(e){if(e.extends){const a=i(e.extends);return{...a,...e,async enhanceApp(t){a.enhanceApp&&await a.enhanceApp(t),e.enhanceApp&&await e.enhanceApp(t)}}}return e}const s=i(D),T=P({name:"VitePressApp",setup(){const{site:e,lang:a,dir:t}=w();return y(()=>{C(()=>{document.documentElement.lang=a.value,document.documentElement.dir=t.value})}),e.value.router.prefetchLinks&&R(),_(),b(),s.setup&&s.setup(),()=>E(s.Layout)}});async function j(){const e=O(),a=L();a.provide(u,e);const t=c(e.route);return a.provide(l,t),a.component("Content",f),a.component("ClientOnly",d),Object.defineProperties(a.config.globalProperties,{$frontmatter:{get(){return t.frontmatter.value}},$params:{get(){return t.page.value.params}}}),s.enhanceApp&&await s.enhanceApp({app:a,router:e,siteData:m}),{app:a,router:e,data:t}}function L(){return h(T)}function O(){let e=o,a;return A(t=>{let n=g(t),r=null;return n&&(e&&(a=n),(e||a===n)&&(n=n.replace(/\.js$/,".lean.js")),r=v(()=>import(n),__vite__mapDeps([]))),o&&(e=!1),r},s.NotFound)}o&&j().then(({app:e,router:a,data:t})=>{a.go().then(()=>{p(a.route,t.site),e.mount("#app")})});export{j as createApp}; diff --git a/assets/chunks/@localSearchIndexroot.BUIZjLrr.js b/assets/chunks/@localSearchIndexroot.BUIZjLrr.js new file mode 100644 index 0000000..8b44bd0 --- /dev/null +++ b/assets/chunks/@localSearchIndexroot.BUIZjLrr.js @@ -0,0 +1 @@ +const e='{"documentCount":60,"nextId":60,"documentIds":{"0":"/#features","1":"/v1/api#api","2":"/v1/api#exported","3":"/v1/api#usehetree","4":"/v1/api#return-of-usehetree","5":"/v1/api#walktreedatagenerator","6":"/v1/api#walktreedata","7":"/v1/api#findtreedata","8":"/v1/api#filtertreedata","9":"/v1/api#openparentsintreedata","10":"/v1/api#updatecheckedintreedata","11":"/v1/api#sortflatdata","12":"/v1/api#walkflatdatagenerator","13":"/v1/api#walkflatdata","14":"/v1/api#openparentsinflatdata","15":"/v1/api#updatecheckedinflatdata","16":"/v1/api#convertindextotreeindexinflatdata","17":"/v1/api#addtoflatdata","18":"/v1/api#removebyidinflatdata","19":"/v1/api#walkparentsgenerator","20":"/v1/api#stat","21":"/v1/examples#examples","22":"/v1/examples#custom-style","23":"/v1/examples#flat-data","24":"/v1/examples#tree-shaped-data","25":"/v1/examples#trigger-element","26":"/v1/examples#placeholder","27":"/v1/examples#open","28":"/v1/examples#checked","29":"/v1/examples#draggable-droppable","30":"/v1/examples#open-when-drag-onto","31":"/v1/examples#update-flat-data","32":"/v1/examples#update-flat-data-with-immer","33":"/v1/examples#update-tree-data-with-immer","34":"/v1/examples#drag-from-external","35":"/v1/examples#big-data","36":"/v1/examples#scroll-to-node","37":"/v1/guide#guide","38":"/v1/guide#installation","39":"/v1/guide#data-types","40":"/v1/guide#no-components","41":"/v1/guide#options","42":"/v1/guide#tips","43":"/v1/guide#use-flat-data","44":"/v1/guide#use-tree-shaped-data","45":"/v1/guide#custom-drag-trigger-element","46":"/v1/guide#html-and-style-of-node","47":"/v1/guide#custom-drag-placeholder-and-node-box","48":"/v1/guide#open-close","49":"/v1/guide#checked","50":"/v1/guide#draggable-droppable","51":"/v1/guide#open-when-dragging-over","52":"/v1/guide#update-data","53":"/v1/guide#update-flat-data","54":"/v1/guide#update-flat-data-with-immer","55":"/v1/guide#update-tree-data-with-immer","56":"/v1/guide#drag-from-external","57":"/v1/guide#big-data","58":"/v1/guide#touch-mobile-device","59":"/v1/guide#others"},"fieldIds":{"title":0,"titles":1,"text":2},"fieldLength":{"0":[1,1,49],"1":[1,1,1],"2":[1,1,84],"3":[1,1,193],"4":[3,2,119],"5":[1,1,33],"6":[1,1,32],"7":[1,1,41],"8":[1,1,39],"9":[1,1,26],"10":[1,1,33],"11":[1,1,29],"12":[1,1,54],"13":[1,1,44],"14":[1,1,37],"15":[1,1,45],"16":[1,1,26],"17":[1,1,39],"18":[1,1,40],"19":[1,1,57],"20":[1,1,56],"21":[1,1,1],"22":[2,1,162],"23":[2,1,67],"24":[3,1,62],"25":[2,1,74],"26":[1,1,101],"27":[1,1,96],"28":[1,1,94],"29":[3,1,75],"30":[4,1,94],"31":[3,1,100],"32":[5,1,111],"33":[5,1,110],"34":[3,1,95],"35":[2,1,91],"36":[3,1,95],"37":[1,1,1],"38":[1,1,10],"39":[2,1,83],"40":[2,1,51],"41":[1,1,107],"42":[1,1,62],"43":[3,1,66],"44":[4,1,61],"45":[4,1,83],"46":[5,1,90],"47":[6,1,100],"48":[3,1,126],"49":[1,1,157],"50":[3,1,92],"51":[4,1,110],"52":[2,1,42],"53":[3,1,112],"54":[5,1,118],"55":[5,1,122],"56":[3,1,104],"57":[2,1,97],"58":[4,1,34],"59":[1,1,37]},"averageFieldLength":[2.1666666666666674,1.0166666666666668,72.83333333333333],"storedFields":{"0":{"title":"Features","titles":[null]},"1":{"title":"API","titles":[]},"2":{"title":"Exported","titles":["API"]},"3":{"title":"useHeTree","titles":["API"]},"4":{"title":"Return of useHeTree","titles":["API","useHeTree"]},"5":{"title":"walkTreeDataGenerator","titles":["API"]},"6":{"title":"walkTreeData","titles":["API"]},"7":{"title":"findTreeData","titles":["API"]},"8":{"title":"filterTreeData","titles":["API"]},"9":{"title":"openParentsInTreeData","titles":["API"]},"10":{"title":"updateCheckedInTreeData","titles":["API"]},"11":{"title":"sortFlatData","titles":["API"]},"12":{"title":"walkFlatDataGenerator","titles":["API"]},"13":{"title":"walkFlatData","titles":["API"]},"14":{"title":"openParentsInFlatData","titles":["API"]},"15":{"title":"updateCheckedInFlatData","titles":["API"]},"16":{"title":"convertIndexToTreeIndexInFlatData","titles":["API"]},"17":{"title":"addToFlatData","titles":["API"]},"18":{"title":"removeByIdInFlatData","titles":["API"]},"19":{"title":"walkParentsGenerator","titles":["API"]},"20":{"title":"Stat","titles":["API"]},"21":{"title":"Examples","titles":[]},"22":{"title":"Custom Style","titles":["Examples"]},"23":{"title":"Flat Data","titles":["Examples"]},"24":{"title":"Tree-shaped Data","titles":["Examples"]},"25":{"title":"Trigger Element","titles":["Examples"]},"26":{"title":"Placeholder","titles":["Examples"]},"27":{"title":"Open","titles":["Examples"]},"28":{"title":"Checked","titles":["Examples"]},"29":{"title":"Draggable & Droppable","titles":["Examples"]},"30":{"title":"Open when drag onto","titles":["Examples"]},"31":{"title":"Update Flat Data","titles":["Examples"]},"32":{"title":"Update Flat Data with immer","titles":["Examples"]},"33":{"title":"Update Tree Data with immer","titles":["Examples"]},"34":{"title":"Drag from External","titles":["Examples"]},"35":{"title":"Big Data","titles":["Examples"]},"36":{"title":"Scroll to Node","titles":["Examples"]},"37":{"title":"Guide","titles":[]},"38":{"title":"Installation","titles":["Guide"]},"39":{"title":"Data Types","titles":["Guide"]},"40":{"title":"No Components","titles":["Guide"]},"41":{"title":"Options","titles":["Guide"]},"42":{"title":"Tips","titles":["Guide"]},"43":{"title":"Use Flat Data","titles":["Guide"]},"44":{"title":"Use Tree-shaped Data","titles":["Guide"]},"45":{"title":"Custom Drag Trigger Element","titles":["Guide"]},"46":{"title":"HTML and Style of Node","titles":["Guide"]},"47":{"title":"Custom Drag Placeholder and Node Box","titles":["Guide"]},"48":{"title":"Open & Close","titles":["Guide"]},"49":{"title":"Checked","titles":["Guide"]},"50":{"title":"draggable & droppable","titles":["Guide"]},"51":{"title":"Open when dragging over","titles":["Guide"]},"52":{"title":"Update Data","titles":["Guide"]},"53":{"title":"Update Flat Data","titles":["Guide"]},"54":{"title":"Update Flat Data with immer","titles":["Guide"]},"55":{"title":"Update Tree Data with immer","titles":["Guide"]},"56":{"title":"Drag from External","titles":["Guide"]},"57":{"title":"Big Data","titles":["Guide"]},"58":{"title":"Touch & Mobile Device","titles":["Guide"]},"59":{"title":"Others","titles":["Guide"]}},"dirtCount":0,"index":[["9",{"2":{"46":1}}],["910",{"2":{"36":2}}],["jsimport",{"2":{"40":1}}],["js",{"2":{"39":2,"42":2}}],["json",{"2":{"28":2,"49":2}}],["j++",{"2":{"35":2,"36":2,"57":2}}],["j",{"2":{"35":4,"36":4,"57":4}}],["justify",{"2":{"22":2}}],["+",{"2":{"27":1,"30":1,"34":1,"35":1,"36":1,"48":1,"51":1,"56":1,"57":1}}],["xmlns=",{"2":{"22":1}}],["x3c",{"2":{"22":21,"23":4,"24":4,"25":6,"26":10,"27":15,"28":8,"29":4,"30":7,"31":13,"32":15,"33":15,"34":6,"35":10,"36":12,"40":2,"43":4,"44":4,"45":6,"46":9,"47":10,"48":15,"49":8,"50":4,"51":7,"53":13,"54":15,"55":15,"56":6,"57":10}}],["`updatecheckedintreedata",{"2":{"49":1}}],["`",{"2":{"22":3,"26":2,"47":2}}],["`my",{"2":{"22":1}}],["$",{"2":{"22":1}}],["0px",{"2":{"22":2,"46":1}}],["0",{"2":{"22":11,"26":1,"28":1,"31":1,"32":1,"35":3,"36":3,"47":1,"49":1,"53":1,"54":1,"57":3}}],["6",{"2":{"22":1,"23":1,"24":1,"25":1,"26":1,"27":1,"28":1,"29":1,"30":1,"31":1,"32":1,"33":1,"34":1,"43":1,"44":1,"45":1,"47":1,"48":1,"49":1,"50":1,"51":1,"53":1,"54":1,"55":1,"56":1}}],["600",{"2":{"3":1,"51":1}}],["7",{"2":{"22":1,"23":1,"24":1,"25":1,"26":1,"27":1,"28":1,"29":1,"30":1,"31":1,"32":1,"33":1,"34":1,"43":1,"44":1,"45":1,"46":1,"47":1,"48":1,"49":1,"50":1,"51":1,"53":1,"54":1,"55":1,"56":1}}],["30px",{"2":{"22":2,"26":2,"47":2}}],["300px",{"2":{"22":1,"23":1,"24":1,"25":1,"26":1,"27":1,"28":1,"29":1,"30":1,"31":1,"32":1,"33":1,"34":1,"35":2,"36":2,"43":1,"44":1,"45":1,"47":1,"48":1,"49":1,"50":1,"51":1,"53":1,"54":1,"55":1,"56":1,"57":2}}],["3px",{"2":{"22":3}}],["3",{"2":{"22":3,"23":3,"24":1,"25":3,"26":3,"27":3,"28":3,"29":5,"30":4,"31":3,"32":3,"33":1,"34":3,"39":2,"43":3,"44":1,"45":3,"47":3,"48":3,"49":3,"50":5,"51":4,"53":3,"54":3,"55":1,"56":3}}],["8",{"2":{"22":1,"23":1,"24":1,"25":1,"26":1,"27":3,"28":1,"29":1,"30":1,"31":1,"32":1,"33":1,"34":1,"43":1,"44":1,"45":1,"47":1,"48":3,"49":1,"50":1,"51":1,"53":1,"54":1,"55":1,"56":1}}],["40px",{"2":{"22":1}}],["4",{"2":{"22":2,"23":2,"24":1,"25":2,"26":2,"27":2,"28":2,"29":2,"30":2,"31":2,"32":2,"33":1,"34":2,"35":2,"36":2,"43":2,"44":1,"45":2,"46":1,"47":2,"48":2,"49":2,"50":2,"51":2,"53":2,"54":2,"55":1,"56":2,"57":2}}],["555",{"2":{"23":1,"24":1,"25":1,"26":1,"27":1,"28":1,"29":1,"30":1,"31":1,"32":1,"33":1,"34":1,"35":1,"36":1,"43":1,"44":1,"45":1,"47":1,"48":1,"49":1,"50":1,"51":1,"53":1,"54":1,"55":1,"56":1,"57":1}}],["5px",{"2":{"22":2,"26":2,"47":2}}],["5",{"2":{"22":2,"23":2,"24":1,"25":2,"26":2,"27":2,"28":2,"29":2,"30":2,"31":3,"32":3,"33":2,"34":2,"43":2,"44":1,"45":2,"47":2,"48":2,"49":2,"50":2,"51":2,"53":3,"54":3,"55":2,"56":2}}],["24",{"2":{"22":2}}],["2",{"2":{"22":3,"23":3,"24":1,"25":3,"26":3,"27":3,"28":3,"29":5,"30":3,"31":4,"32":4,"33":2,"34":3,"39":3,"43":3,"44":1,"45":3,"47":3,"48":3,"49":4,"50":5,"51":3,"53":5,"54":4,"55":2,"56":3}}],["2000",{"2":{"22":1}}],["20px",{"2":{"22":3,"23":1,"24":1,"25":1,"26":1,"27":1,"28":1,"29":1,"30":1,"31":1,"32":1,"33":1,"34":1,"35":1,"36":1,"43":1,"44":1,"45":1,"46":1,"47":1,"48":1,"49":1,"50":1,"51":1,"53":1,"54":1,"55":1,"56":1,"57":1}}],["20",{"2":{"3":1}}],["queryselector",{"2":{"19":1}}],["quot",{"2":{"3":4}}],[">scroll",{"2":{"36":1}}],[">edit",{"2":{"32":1,"33":1,"54":1,"55":1}}],[">restore",{"2":{"31":1,"32":1,"33":1,"53":1,"54":1,"55":1}}],[">+",{"2":{"31":1,"32":1,"33":1,"53":1,"54":1,"55":1}}],[">👉",{"2":{"31":1,"32":1,"33":1,"53":1,"54":1,"55":1}}],[">only",{"2":{"27":1,"48":1}}],[">open",{"2":{"27":2,"48":2}}],[">close",{"2":{"27":1,"48":1}}],[">drag",{"2":{"25":1,"34":1,"45":1,"56":1}}],[">draggable",{"2":{"22":1}}],[">drop",{"2":{"22":1,"26":1,"47":1}}],[">",{"2":{"8":1,"22":7,"26":2,"27":1,"28":4,"30":1,"31":1,"32":1,"33":1,"35":1,"36":1,"46":3,"47":2,"48":1,"49":4,"51":1,"53":1,"54":1,"55":1,"57":1}}],["13h3v15h21v13z",{"2":{"22":1}}],["11h3v9h21v11m21",{"2":{"22":1}}],["110px",{"2":{"22":1}}],["16px",{"2":{"22":1}}],["19",{"2":{"22":1}}],["1px",{"2":{"22":5,"23":1,"24":1,"25":1,"26":2,"27":1,"28":1,"29":1,"30":1,"31":1,"32":1,"33":1,"34":1,"35":1,"36":1,"43":1,"44":1,"45":1,"46":1,"47":2,"48":1,"49":1,"50":1,"51":1,"53":1,"54":1,"55":1,"56":1,"57":1}}],["1000",{"2":{"35":1,"36":1,"57":1}}],["10000",{"2":{"35":1,"36":1,"57":1}}],["100",{"2":{"22":1,"34":1,"56":1}}],["10px",{"2":{"22":2}}],["10",{"2":{"22":1,"23":1,"24":1,"25":1,"26":1,"27":1,"28":1,"29":1,"30":1,"31":1,"32":1,"33":1,"34":1,"43":1,"44":1,"45":1,"47":1,"48":1,"49":1,"50":1,"51":1,"53":1,"54":1,"55":1,"56":1}}],["1",{"2":{"7":1,"8":1,"20":1,"22":3,"23":3,"24":1,"25":3,"26":3,"27":3,"28":4,"29":2,"30":4,"31":3,"32":3,"33":2,"34":3,"39":3,"43":3,"44":1,"45":3,"46":2,"47":3,"48":3,"49":4,"50":2,"51":4,"53":3,"54":3,"55":2,"56":3}}],["guide",{"0":{"37":1},"1":{"38":1,"39":1,"40":1,"41":1,"42":1,"43":1,"44":1,"45":1,"46":1,"47":1,"48":1,"49":1,"50":1,"51":1,"52":1,"53":1,"54":1,"55":1,"56":1,"57":1,"58":1,"59":1}}],["grab",{"2":{"22":1}}],["genid",{"2":{"35":5,"36":5,"57":5}}],["generate",{"2":{"35":1,"36":1,"57":1}}],["generator",{"2":{"19":2}}],["get",{"2":{"4":1,"42":2,"49":1}}],["getstat",{"2":{"4":1,"42":2}}],["gt",{"2":{"3":11,"4":2,"46":3}}],["easily",{"2":{"40":1}}],["each",{"2":{"39":2}}],["e",{"2":{"34":2,"56":2}}],["edit",{"2":{"32":2,"33":2,"54":2,"55":2}}],["ebfeff",{"2":{"22":1}}],["e2e2e2",{"2":{"22":1}}],["eee",{"2":{"22":1,"26":1,"47":1}}],["else",{"2":{"27":1,"30":1,"35":1,"36":1,"48":1,"51":1,"57":1}}],["el",{"2":{"19":2}}],["element",{"0":{"25":1,"45":1},"2":{"4":1,"45":1}}],["every",{"2":{"4":1}}],["event",{"2":{"3":7}}],["enter",{"2":{"32":1,"33":1,"54":1,"55":1}}],["ensure",{"2":{"11":1}}],["end",{"2":{"5":1,"6":1,"7":1,"8":1,"12":1,"13":1}}],["ends",{"2":{"3":1}}],["ended",{"2":{"3":1}}],["enable",{"2":{"3":3,"41":2,"51":1,"57":1}}],["empty",{"2":{"3":3}}],["exitwalk",{"2":{"5":2,"6":2,"7":2,"8":2,"12":2,"13":2}}],["exist",{"2":{"4":2}}],["executing",{"2":{"5":2,"6":2,"7":2,"8":2,"12":2,"13":2}}],["example",{"2":{"4":1,"19":1,"46":1}}],["examples",{"0":{"21":1},"1":{"22":1,"23":1,"24":1,"25":1,"26":1,"27":1,"28":1,"29":1,"30":1,"31":1,"32":1,"33":1,"34":1,"35":1,"36":1},"2":{"0":1,"42":3}}],["explicitly",{"2":{"41":2}}],["exports",{"2":{"40":1,"48":1,"49":1}}],["export",{"2":{"2":1,"22":1,"23":1,"24":1,"25":1,"26":1,"27":1,"28":1,"29":1,"30":1,"31":1,"32":1,"33":1,"34":1,"35":1,"36":1,"40":2,"43":1,"44":1,"45":1,"47":1,"48":1,"49":1,"50":1,"51":1,"53":1,"54":1,"55":1,"56":1,"57":1}}],["exported",{"0":{"2":1},"2":{"2":1}}],["expand",{"2":{"0":1,"48":1}}],["external",{"0":{"34":1,"56":1},"2":{"0":1,"3":2,"56":2}}],["名",{"2":{"3":1}}],["==",{"2":{"27":1,"30":1,"35":1,"36":1,"48":1,"51":1,"57":1}}],["===",{"2":{"7":1,"29":4,"32":1,"33":4,"50":4,"54":1,"55":4}}],["=>",{"2":{"6":1,"7":1,"8":1,"13":1,"19":1,"22":2,"23":2,"24":2,"25":2,"26":2,"27":9,"28":4,"29":5,"30":5,"31":7,"32":13,"33":16,"34":5,"35":6,"36":7,"43":2,"44":2,"45":2,"46":1,"47":2,"48":9,"49":4,"50":5,"51":5,"53":7,"54":13,"55":16,"56":5,"57":6}}],["=",{"2":{"3":12,"4":2,"7":1,"8":1,"19":1,"22":3,"23":3,"24":2,"25":3,"26":3,"27":5,"28":7,"29":3,"30":5,"31":10,"32":11,"33":13,"34":4,"35":12,"36":12,"40":1,"42":1,"43":3,"44":2,"45":3,"46":1,"47":3,"48":5,"49":7,"50":3,"51":5,"53":10,"54":11,"55":13,"56":4,"57":12}}],["||",{"2":{"27":3,"28":1,"30":2,"31":1,"32":1,"33":1,"35":2,"36":2,"48":3,"49":1,"51":2,"53":1,"54":1,"55":1,"57":2}}],["|",{"2":{"2":1,"9":1,"10":1,"14":1,"15":1,"16":2,"17":1,"18":1,"19":2,"27":1,"30":1,"33":1,"35":2,"36":2,"48":1,"51":1,"55":1,"57":2}}],["keepplaceholder",{"2":{"3":1,"59":1}}],["key=",{"2":{"22":1,"26":1,"46":2,"47":1}}],["keys",{"2":{"19":1,"22":3,"23":3,"25":3,"26":3,"27":5,"28":4,"29":3,"30":3,"31":5,"32":5,"33":2,"34":4,"35":3,"36":3,"43":3,"45":3,"47":3,"48":5,"49":4,"50":3,"51":3,"53":5,"54":5,"55":2,"56":4,"57":3}}],["key",{"2":{"2":1,"3":3,"22":1,"26":1,"39":1,"46":1,"47":1}}],["kind",{"2":{"2":1,"19":1}}],["perform",{"2":{"52":1}}],["performance",{"2":{"3":1,"41":1}}],["push",{"2":{"35":4,"36":4,"57":4}}],["physics",{"2":{"22":1,"23":1,"24":1,"25":1,"26":1,"27":1,"28":1,"29":1,"30":1,"31":1,"32":1,"33":1,"34":1,"43":1,"44":1,"45":1,"47":1,"48":1,"49":1,"50":1,"51":1,"53":1,"54":1,"55":1,"56":1}}],["python",{"2":{"22":1,"23":1,"24":1,"25":1,"26":1,"27":3,"28":1,"29":1,"30":1,"31":1,"32":1,"33":1,"34":1,"43":1,"44":1,"45":1,"47":1,"48":3,"49":1,"50":1,"51":1,"53":1,"54":1,"55":1,"56":1}}],["pid",{"2":{"12":2,"13":1,"20":1,"31":2,"32":2,"33":6,"35":6,"36":6,"39":4,"53":2,"54":2,"55":6,"57":6}}],["polyfill",{"2":{"58":1}}],["position",{"2":{"3":2,"22":2}}],["pointing",{"2":{"2":1,"19":1}}],["pay",{"2":{"42":1}}],["path",{"2":{"22":1}}],["padding",{"2":{"22":4,"23":1,"24":1,"25":1,"26":3,"27":1,"28":1,"29":1,"30":1,"31":1,"32":1,"33":1,"34":1,"35":1,"36":1,"43":1,"44":1,"45":1,"46":3,"47":3,"48":1,"49":1,"50":1,"51":1,"53":1,"54":1,"55":1,"56":1,"57":1}}],["pass",{"2":{"17":1,"18":1,"53":1}}],["passed",{"2":{"4":1}}],["parseint",{"2":{"31":1,"32":1,"33":1,"53":1,"54":1,"55":1}}],["parameters",{"2":{"42":1}}],["parameter",{"2":{"3":1,"41":2,"42":1}}],["parentkeyorgetter",{"2":{"19":2}}],["parentid",{"2":{"16":1}}],["parentidkey",{"2":{"3":1,"11":1,"12":1,"13":1,"14":1,"15":1,"16":1,"17":1,"18":1,"22":1,"23":1,"25":1,"26":1,"27":1,"28":1,"29":1,"30":1,"31":1,"32":1,"34":1,"35":1,"36":1,"39":1,"41":1,"43":1,"45":1,"47":1,"48":1,"49":1,"50":1,"51":1,"53":1,"54":1,"56":1,"57":1}}],["parents",{"2":{"5":1,"6":1,"7":1,"8":1,"10":1,"12":1,"13":1,"15":1,"48":1}}],["parentstat",{"2":{"3":2,"4":1,"20":1,"34":2,"56":2}}],["parentelement",{"2":{"2":1,"19":2}}],["parent",{"2":{"2":2,"3":7,"5":1,"6":1,"7":1,"8":1,"9":1,"12":2,"13":2,"14":2,"15":1,"16":2,"17":1,"18":1,"19":4,"20":4,"22":10,"23":10,"25":10,"26":10,"27":10,"28":10,"29":9,"30":10,"31":11,"32":11,"34":11,"39":2,"41":1,"43":10,"45":10,"47":10,"48":10,"49":10,"50":9,"51":10,"53":11,"54":11,"56":11,"59":1}}],["page",{"2":{"3":1}}],["px",{"2":{"3":1}}],["preview",{"2":{"42":1}}],["present",{"2":{"41":1}}],["prettier",{"2":{"3":1,"25":1,"26":1,"27":1,"28":1,"29":1,"30":1,"31":1,"32":1,"33":1,"34":1,"35":1,"36":1,"45":1,"47":1,"48":1,"49":1,"50":1,"51":1,"53":1,"54":1,"55":1,"56":1,"57":1}}],["primary",{"2":{"41":1}}],["provides",{"2":{"52":1}}],["prompt",{"2":{"32":1,"33":1,"54":1,"55":1}}],["programming",{"2":{"22":1,"23":1,"24":1,"25":1,"26":1,"27":1,"28":1,"29":1,"30":1,"31":1,"32":1,"33":1,"34":1,"43":1,"44":1,"45":1,"47":1,"48":1,"49":1,"50":1,"51":1,"53":1,"54":1,"55":1,"56":1}}],["prototype",{"2":{"7":1,"8":1,"55":1}}],["properties",{"2":{"3":1,"4":2,"20":1}}],["processing",{"2":{"2":2}}],["placeholder",{"0":{"26":1,"47":1},"2":{"0":1,"3":1,"4":2,"22":4,"26":2,"46":3,"47":2,"59":1}}],["nature",{"2":{"52":1}}],["names",{"2":{"39":1}}],["name",{"2":{"3":2,"4":1,"20":1,"22":10,"23":10,"24":10,"25":10,"26":10,"27":10,"28":10,"29":9,"30":10,"31":11,"32":13,"33":13,"34":11,"43":10,"44":10,"45":10,"46":1,"47":10,"48":10,"49":10,"50":9,"51":10,"53":11,"54":13,"55":13,"56":11}}],["npmpnpmyarn",{"2":{"38":1,"52":1}}],["newname",{"2":{"32":3,"33":3,"54":3,"55":3}}],["newnode",{"2":{"17":1,"34":2,"56":2}}],["new",{"2":{"11":1,"31":1,"32":2,"33":2,"34":1,"41":1,"53":1,"54":2,"55":2,"56":1}}],["newsemicheckedids",{"2":{"10":1,"15":1}}],["newcheckedids",{"2":{"10":1,"15":1}}],["newopenids",{"2":{"9":1,"14":1}}],["newdata",{"2":{"3":1,"31":6,"53":6}}],["needed",{"2":{"41":2}}],["need",{"2":{"2":1,"39":1,"41":2,"42":1,"49":1,"58":1}}],["null",{"2":{"3":6,"4":3,"16":2,"17":1,"18":1,"20":3,"22":1,"23":1,"25":1,"26":1,"27":1,"28":1,"30":1,"31":1,"32":1,"33":1,"34":2,"35":3,"36":3,"39":2,"43":1,"45":1,"47":1,"48":1,"49":1,"51":1,"53":1,"54":1,"55":1,"56":2,"57":3}}],["number",{"2":{"2":1,"3":2,"20":2,"31":2,"32":2,"35":2,"36":2,"53":2,"54":2,"57":2}}],["no",{"0":{"40":1},"2":{"22":3,"39":1}}],["notice",{"2":{"58":1}}],["note",{"2":{"4":1,"54":1,"55":1}}],["not",{"2":{"0":1,"2":1,"3":2,"4":4,"22":1,"39":2,"40":1,"41":3,"49":1}}],["nodebox",{"2":{"3":1,"46":2}}],["nodes",{"2":{"3":3,"4":6,"5":1,"6":1,"7":1,"8":3,"9":2,"10":1,"11":1,"12":1,"13":1,"14":2,"15":1,"16":1,"20":1,"35":1,"36":1,"39":1,"48":3,"49":4,"50":4,"52":2,"57":1,"59":1}}],["node",{"0":{"36":1,"46":1,"47":1},"2":{"0":2,"2":3,"3":16,"4":6,"5":2,"6":2,"7":4,"8":3,"9":1,"10":1,"12":3,"13":2,"14":1,"15":1,"16":2,"17":1,"18":1,"19":4,"20":5,"22":8,"23":2,"24":2,"25":2,"26":3,"27":2,"28":2,"29":2,"30":2,"31":2,"32":4,"33":8,"34":3,"35":1,"36":1,"39":2,"42":6,"43":2,"44":2,"45":3,"46":7,"47":3,"48":3,"49":4,"50":5,"51":3,"53":2,"54":4,"55":8,"56":3,"57":1,"59":2}}],["your",{"2":{"11":1,"12":1,"13":1,"14":1,"15":1,"39":1,"41":3,"49":1}}],["you",{"2":{"2":1,"4":1,"39":2,"41":2,"42":4,"45":1,"46":2,"49":2,"52":2,"58":1}}],["minheight",{"2":{"46":1}}],["milliseconds",{"2":{"3":1,"51":1}}],["mobile",{"0":{"58":1},"2":{"58":1}}],["modify",{"2":{"46":1,"53":1}}],["most",{"2":{"42":1}}],["more",{"2":{"41":1,"49":1,"52":1}}],["m21",{"2":{"22":1}}],["mytree",{"2":{"26":4,"47":4}}],["mynode",{"2":{"26":2,"47":2}}],["my",{"2":{"22":10,"26":1,"47":1}}],["multiple",{"2":{"9":1,"10":1,"14":1,"15":1,"48":1}}],["must",{"2":{"3":1,"39":1,"41":1}}],["many",{"2":{"41":1}}],["math",{"2":{"31":1,"32":1,"33":1,"53":1,"54":1,"55":1}}],["margin",{"2":{"22":3}}],["make",{"2":{"9":1,"12":1,"13":1,"14":2,"15":1}}],["may",{"2":{"3":1,"4":1}}],["main",{"2":{"2":1,"3":1}}],["me",{"2":{"34":1,"56":1}}],["method",{"2":{"5":1,"6":3,"7":1,"8":1,"12":1,"13":3,"19":2,"39":1,"49":2}}],["methods",{"2":{"2":3,"4":1,"40":1,"48":1,"49":1,"52":1,"53":1}}],["means",{"2":{"3":2,"39":1}}],["using",{"2":{"12":1,"13":1,"14":1,"15":1,"39":1,"41":2}}],["user",{"2":{"58":1}}],["useref",{"2":{"31":2,"32":2,"33":2,"53":2,"54":2,"55":2}}],["usememo",{"2":{"41":1}}],["usecallback",{"2":{"41":1}}],["usestate",{"2":{"22":2,"23":2,"24":2,"25":2,"26":2,"27":3,"28":4,"29":2,"30":3,"31":2,"35":3,"36":3,"43":2,"44":2,"45":2,"47":2,"48":3,"49":4,"50":2,"51":3,"53":2,"54":1,"55":1,"57":3}}],["useimmer",{"2":{"17":1,"18":1,"32":2,"33":2,"34":2,"54":3,"55":3,"56":2}}],["used",{"2":{"3":1,"41":2}}],["use",{"0":{"43":1,"44":1},"2":{"2":1,"11":1,"17":1,"18":1,"32":1,"33":1,"34":1,"39":3,"40":1,"41":1,"42":3,"46":3,"48":1,"49":1,"50":1,"51":1,"52":4,"53":1,"54":2,"55":2,"56":1,"57":1}}],["usehetree",{"0":{"3":1,"4":1},"1":{"4":1},"2":{"2":3,"3":2,"4":1,"22":2,"23":2,"24":2,"25":2,"26":2,"27":2,"28":2,"29":2,"30":2,"31":2,"32":2,"33":2,"34":2,"35":2,"36":2,"40":4,"41":3,"42":2,"43":2,"44":2,"45":2,"47":2,"48":3,"49":2,"50":2,"51":2,"53":2,"54":2,"55":2,"56":2,"57":2}}],["unshift",{"2":{"33":1,"55":1}}],["undefined>",{"2":{"27":1,"30":1,"35":1,"36":1,"48":1,"51":1,"57":1}}],["undefined",{"2":{"3":4,"19":1,"29":2,"50":2}}],["unit",{"2":{"3":2}}],["updates",{"2":{"49":1}}],["updatecheckedinflatdata",{"0":{"15":1},"2":{"2":1,"28":2,"49":3}}],["updatecheckedintreedata",{"0":{"10":1},"2":{"2":1}}],["update",{"0":{"31":1,"32":1,"33":1,"52":1,"53":1,"54":1,"55":1},"2":{"0":1,"10":2,"15":2,"49":1,"52":2}}],["viewbox=",{"2":{"22":1}}],["visible",{"2":{"4":2,"9":1,"14":1}}],["visibleids",{"2":{"4":1}}],["virtuallistref",{"2":{"4":1}}],["virtualization",{"2":{"3":1}}],["virtual",{"2":{"0":1,"3":1,"4":2,"35":1,"36":1,"57":3}}],["void",{"2":{"3":11,"17":1}}],["variant",{"2":{"22":1}}],["variables",{"2":{"2":1}}],["values",{"2":{"41":4}}],["value",{"2":{"2":1,"3":1}}],["lt",{"2":{"46":2}}],["ltr",{"2":{"3":2}}],["last",{"2":{"22":1}}],["lacks",{"2":{"12":1}}],["logic",{"2":{"49":1}}],["loop",{"2":{"5":1,"12":1}}],["lot",{"2":{"3":1}}],["least",{"2":{"41":1}}],["length",{"2":{"34":1,"35":1,"36":1,"49":1,"56":1,"57":1}}],["let",{"2":{"31":3,"32":2,"33":2,"35":5,"36":5,"53":3,"54":2,"55":2,"57":5}}],["level=",{"2":{"46":1}}],["level",{"2":{"4":1,"20":1}}],["left",{"2":{"0":1,"3":1,"22":2,"26":1,"46":2,"47":1,"59":1}}],["lrt",{"2":{"3":1}}],["lines",{"2":{"42":1,"46":1}}],["line",{"2":{"26":1,"46":1,"47":1}}],["like",{"2":{"2":2,"7":1,"8":1,"19":2,"55":1}}],["library",{"2":{"2":1,"3":1,"39":2,"40":1,"48":1,"49":1,"52":1}}],["listen",{"2":{"3":1,"41":1}}],["list",{"2":{"0":1,"4":2,"57":1}}],["random",{"2":{"31":1,"32":1,"33":1,"53":1,"54":1,"55":1}}],["radius",{"2":{"22":3}}],["r",{"2":{"28":3,"49":3}}],["rgb",{"2":{"22":1}}],["rootstats",{"2":{"4":1}}],["rootnodes",{"2":{"4":1}}],["root",{"2":{"3":1,"4":4,"22":1,"23":1,"24":1,"25":1,"26":1,"27":1,"28":1,"30":1,"31":1,"32":1,"33":1,"34":1,"43":1,"44":1,"45":1,"47":1,"48":1,"49":1,"50":2,"51":1,"53":1,"54":1,"55":1,"56":1,"59":1}}],["rootids",{"2":{"4":1}}],["rootid",{"2":{"3":1,"59":1}}],["replace",{"2":{"49":1}}],["represents",{"2":{"3":1}}],["required",{"2":{"41":2}}],["requires",{"2":{"39":1}}],["result",{"2":{"35":7,"36":7,"57":7}}],["red",{"2":{"26":1,"47":1}}],["read",{"2":{"20":1}}],["reactnode",{"2":{"3":2,"4":1}}],["react",{"2":{"2":1,"3":2,"4":1,"22":2,"23":2,"24":2,"25":2,"26":2,"27":3,"28":3,"29":2,"30":3,"31":3,"32":3,"33":3,"34":1,"35":3,"36":3,"38":3,"40":1,"41":1,"43":2,"44":2,"45":2,"47":2,"48":3,"49":3,"50":2,"51":3,"52":1,"53":3,"54":4,"55":4,"56":1,"57":3}}],["relative",{"2":{"22":1}}],["related",{"2":{"20":1,"42":1,"56":1}}],["rely",{"2":{"4":2}}],["refer",{"2":{"42":1}}],["reference",{"2":{"3":3,"9":1,"10":1,"14":1,"15":1,"17":1,"18":1}}],["ref",{"2":{"4":2}}],["remember",{"2":{"57":1}}],["removeddata",{"2":{"18":1}}],["removeid",{"2":{"18":1}}],["remove",{"2":{"18":1,"31":2,"32":2,"33":2,"53":2,"54":2,"55":2}}],["removebyidinflatdata",{"0":{"18":1},"2":{"2":1,"31":2,"32":2,"53":3,"54":2}}],["remaining",{"2":{"3":1}}],["recommended",{"2":{"3":1,"17":1,"18":1,"52":1}}],["retain",{"2":{"3":1,"59":1}}],["returns",{"2":{"7":1,"8":1,"19":2,"49":1}}],["returning",{"2":{"3":2}}],["return",{"0":{"4":1},"2":{"3":2,"4":2,"7":1,"8":1,"11":1,"22":2,"23":1,"24":1,"25":1,"26":1,"27":1,"28":1,"29":1,"30":1,"31":1,"32":1,"33":1,"34":1,"35":2,"36":2,"40":2,"42":1,"43":1,"44":1,"45":1,"47":1,"48":1,"49":1,"50":1,"51":1,"53":1,"54":1,"55":1,"56":1,"57":2}}],["returned",{"2":{"2":1,"40":1,"48":1}}],["rendering",{"2":{"46":2}}],["rendernodebox",{"2":{"3":1,"22":1,"26":1,"41":1,"46":2,"47":1}}],["rendernode",{"2":{"3":1,"23":1,"24":1,"25":1,"27":1,"28":1,"29":1,"30":1,"31":1,"32":1,"33":1,"34":1,"35":1,"36":1,"41":1,"43":1,"44":1,"45":1,"46":3,"48":1,"49":1,"50":1,"51":1,"53":1,"54":1,"55":1,"56":1,"57":1}}],["render",{"2":{"2":1,"3":2,"4":1,"40":1}}],["rendertree",{"2":{"2":1,"4":1,"22":2,"23":2,"24":2,"25":2,"26":2,"27":2,"28":2,"29":2,"30":2,"31":2,"32":2,"33":2,"34":2,"35":2,"36":2,"40":4,"43":2,"44":2,"45":2,"47":2,"48":2,"49":2,"50":2,"51":2,"53":2,"54":2,"55":2,"56":2,"57":2}}],["right",{"2":{"0":1,"3":1,"46":1,"59":1}}],["rtl",{"2":{"0":1,"3":2}}],["close",{"0":{"48":1}}],["classname=",{"2":{"22":4,"26":2,"46":1,"47":2}}],["classname",{"2":{"4":2,"22":1,"26":1,"47":1}}],["createdata",{"2":{"35":2,"36":2,"57":2}}],["current",{"2":{"31":3,"32":3,"33":3,"53":3,"54":3,"55":3}}],["cursor",{"2":{"22":1}}],["custom",{"0":{"22":1,"45":1,"47":1},"2":{"3":1,"59":1}}],["customdragimage",{"2":{"3":1,"59":1}}],["customizable",{"2":{"0":1}}],["center",{"2":{"22":5,"26":1,"47":1}}],["ccc",{"2":{"22":1}}],["cssproperties",{"2":{"4":1}}],["cascade",{"2":{"49":1}}],["cascading",{"2":{"49":1}}],["cache",{"2":{"41":1}}],["category",{"2":{"22":1,"23":1,"24":1,"25":1,"26":1,"27":1,"28":1,"30":1,"31":1,"32":1,"33":1,"34":1,"43":1,"44":1,"45":1,"47":1,"48":1,"49":1,"51":1,"53":1,"54":1,"55":1,"56":1}}],["calculate",{"2":{"16":1}}],["called",{"2":{"3":4,"41":1,"46":1,"51":1}}],["callback",{"2":{"3":4,"6":2,"7":1,"8":1,"13":2,"41":4,"42":1,"56":1}}],["cannot",{"2":{"50":3}}],["can",{"2":{"4":3,"19":1,"39":1,"40":1,"41":1,"42":5,"45":1,"46":1,"48":2,"49":2,"50":5,"58":1}}],["candroptoroot",{"2":{"29":1,"50":2}}],["candrop",{"2":{"3":1,"29":1,"41":1,"50":2}}],["candrag",{"2":{"3":1,"29":1,"50":2}}],["childstats",{"2":{"20":1}}],["childids",{"2":{"20":1}}],["child",{"2":{"5":1,"6":1,"7":1,"8":1,"12":1,"13":1,"22":1,"39":1,"45":1,"49":2}}],["children",{"2":{"3":2,"5":1,"6":1,"7":1,"8":1,"10":1,"15":1,"20":2,"24":10,"33":21,"39":3,"41":1,"44":10,"55":21}}],["childrenkey",{"2":{"3":1,"9":1,"10":1,"24":1,"33":1,"39":1,"41":1,"44":1,"55":1}}],["changes",{"2":{"41":2,"49":1}}],["change",{"2":{"3":2,"4":1,"17":1,"18":1,"41":2}}],["checkbox",{"2":{"28":1,"49":1}}],["check",{"2":{"3":1,"4":1}}],["checked=",{"2":{"28":1,"49":1}}],["checkedids",{"2":{"3":1,"10":1,"15":1,"28":4,"49":6}}],["checked",{"0":{"28":1,"49":1},"2":{"0":2,"3":1,"10":2,"15":2,"20":1,"23":1,"24":1,"25":1,"27":1,"28":7,"29":1,"30":1,"34":1,"35":1,"36":1,"43":1,"44":1,"45":1,"48":1,"49":19,"50":1,"51":1,"56":1,"57":1}}],["copied",{"2":{"42":1}}],["copy",{"2":{"17":1,"18":1,"53":1}}],["code",{"2":{"42":3}}],["corresponding",{"2":{"39":1}}],["correct",{"2":{"12":1,"13":1,"14":1,"15":1}}],["color",{"2":{"22":5,"26":1,"47":1}}],["complex",{"2":{"52":1}}],["computer",{"2":{"22":1,"23":1,"24":1,"25":1,"26":1,"27":1,"28":1,"29":1,"30":1,"31":1,"32":1,"33":1,"34":1,"43":1,"44":1,"45":1,"47":1,"48":1,"49":1,"50":1,"51":1,"53":1,"54":1,"55":1,"56":1}}],["compared",{"2":{"12":1}}],["component",{"2":{"4":1}}],["components",{"0":{"40":1},"2":{"2":1,"22":1,"23":1,"24":1,"25":1,"26":1,"27":1,"28":1,"29":1,"30":1,"31":1,"32":1,"33":1,"34":1,"40":1,"43":1,"44":1,"45":1,"47":1,"48":1,"49":1,"50":1,"51":1,"53":1,"54":1,"55":1,"56":1}}],["converter",{"2":{"42":1}}],["convertindextotreeindexinflatdata",{"0":{"16":1},"2":{"2":1}}],["contain",{"2":{"39":1}}],["contains",{"2":{"2":1,"19":1,"20":1,"48":1}}],["content",{"2":{"22":2}}],["control",{"2":{"4":1,"41":1,"46":3,"50":1,"51":1}}],["const",{"2":{"3":1,"5":1,"12":1,"19":1,"22":3,"23":3,"24":2,"25":3,"26":3,"27":5,"28":7,"29":3,"30":5,"31":6,"32":7,"33":9,"34":4,"35":7,"36":7,"40":1,"42":1,"43":3,"44":2,"45":3,"47":3,"48":5,"49":7,"50":3,"51":5,"53":6,"54":7,"55":9,"56":4,"57":7}}],["i++",{"2":{"35":1,"36":1,"57":1}}],["i",{"2":{"27":2,"30":2,"35":4,"36":4,"48":2,"51":2,"57":4}}],["immutable",{"2":{"52":1}}],["immer",{"0":{"32":1,"33":1,"54":1,"55":1},"2":{"32":1,"33":1,"34":1,"52":7,"53":1,"54":1,"55":1,"56":1}}],["important",{"2":{"41":1}}],["import",{"2":{"22":1,"23":1,"24":1,"25":1,"26":1,"27":2,"28":2,"29":1,"30":2,"31":2,"32":3,"33":3,"34":1,"35":2,"36":2,"43":1,"44":1,"45":1,"47":1,"48":2,"49":2,"50":1,"51":2,"53":2,"54":3,"55":3,"56":1,"57":2}}],["improve",{"2":{"3":1}}],["image",{"2":{"3":1,"59":1}}],["if",{"2":{"3":1,"4":3,"27":1,"30":1,"32":1,"33":1,"35":1,"36":1,"39":1,"41":2,"42":1,"46":1,"48":1,"49":2,"51":1,"52":1,"54":1,"55":1,"57":1}}],["instead",{"2":{"54":1,"55":1}}],["install",{"2":{"38":1,"52":1}}],["installation",{"0":{"38":1}}],["inner",{"2":{"46":1}}],["internal",{"2":{"40":1}}],["input",{"2":{"28":1,"49":1}}],["include",{"2":{"19":1,"41":2}}],["including",{"2":{"4":1}}],["initializing",{"2":{"39":1}}],["initialized",{"2":{"11":1}}],["initialdata",{"2":{"31":4,"32":4,"33":4,"53":4,"54":4,"55":4}}],["initiated",{"2":{"4":1}}],["invisible",{"2":{"4":1}}],["info",{"2":{"4":1}}],["information",{"2":{"2":1,"20":1,"41":1,"42":1}}],["indicating",{"2":{"41":1}}],["indicate",{"2":{"3":1,"39":1,"48":1,"49":1,"56":1}}],["indicates",{"2":{"3":3,"19":1,"20":1}}],["indexinsiblings",{"2":{"16":1}}],["index",{"2":{"3":5,"4":1,"5":1,"6":1,"7":1,"8":1,"12":2,"13":1,"16":2,"17":1,"20":2,"29":1,"34":2,"39":1,"50":1,"56":2}}],["indentation",{"2":{"3":1,"46":1}}],["indent",{"2":{"3":1,"46":1}}],["inheriting",{"2":{"3":2}}],["in",{"2":{"3":4,"4":2,"5":1,"6":1,"7":1,"8":1,"11":1,"12":2,"13":1,"14":1,"15":1,"16":2,"17":1,"18":1,"20":2,"34":1,"39":6,"40":1,"42":3,"56":1,"58":2,"59":1}}],["ignore",{"2":{"3":1,"25":1,"26":1,"27":1,"28":1,"29":1,"30":1,"31":1,"32":1,"33":1,"34":1,"35":1,"36":1,"45":1,"47":1,"48":1,"49":2,"50":1,"51":1,"53":1,"54":1,"55":1,"56":1,"57":1}}],["id2",{"2":{"35":3,"36":3,"57":3}}],["id1",{"2":{"35":3,"36":3,"57":3}}],["idorids",{"2":{"9":1,"10":1,"14":1,"15":1}}],["idornodeorstat",{"2":{"4":2}}],["ids",{"2":{"4":2,"48":1,"49":2}}],["idkey",{"2":{"3":1,"9":1,"10":1,"11":1,"12":1,"13":1,"14":1,"15":1,"16":1,"17":1,"18":1,"22":1,"23":1,"25":1,"26":1,"27":1,"28":1,"29":1,"30":1,"31":1,"32":1,"33":1,"34":1,"35":1,"36":1,"39":1,"41":1,"43":1,"45":1,"47":1,"48":1,"49":1,"50":1,"51":1,"53":1,"54":1,"55":1,"56":1,"57":1}}],["id",{"2":{"2":3,"3":7,"4":3,"7":1,"8":1,"9":3,"10":3,"12":4,"13":3,"14":5,"15":5,"16":5,"17":3,"18":4,"20":7,"22":20,"23":21,"24":10,"25":21,"26":20,"27":29,"28":29,"29":26,"30":30,"31":32,"32":37,"33":30,"34":25,"35":15,"36":15,"39":11,"41":2,"42":1,"43":21,"44":10,"45":21,"47":20,"48":29,"49":29,"50":26,"51":30,"53":32,"54":37,"55":30,"56":25,"57":15,"59":1}}],["item",{"2":{"39":1,"49":3}}],["items",{"2":{"22":3}}],["iterate",{"2":{"2":1,"19":1}}],["its",{"2":{"16":2,"41":1,"46":1,"50":4}}],["it",{"2":{"0":1,"3":6,"4":4,"11":1,"12":2,"14":1,"15":1,"17":3,"18":3,"20":1,"41":2,"49":1,"52":2,"53":1,"58":2}}],["issues",{"2":{"41":1}}],["isstat",{"2":{"20":1}}],["isoutside",{"2":{"3":2}}],["isexternal",{"2":{"3":2}}],["isplaceholder",{"2":{"3":1,"22":2,"26":2,"46":2,"47":2}}],["isfunctionreactive",{"2":{"3":1,"41":2}}],["is",{"2":{"0":1,"2":1,"3":14,"4":3,"12":2,"13":1,"14":1,"15":1,"17":1,"18":1,"19":2,"20":1,"39":3,"40":1,"41":7,"42":1,"46":3,"49":4,"51":1,"52":2,"55":1,"58":1,"59":1}}],["works",{"2":{"58":1}}],["we",{"2":{"54":1,"55":1}}],["w3",{"2":{"22":1}}],["www",{"2":{"22":1}}],["width",{"2":{"22":3,"23":1,"24":1,"25":1,"26":1,"27":1,"28":1,"29":1,"30":1,"31":1,"32":1,"33":1,"34":1,"35":1,"36":1,"43":1,"44":1,"45":1,"47":1,"48":1,"49":1,"50":1,"51":1,"53":1,"54":1,"55":1,"56":1,"57":1}}],["will",{"2":{"4":1,"5":2,"6":2,"7":2,"8":2,"10":1,"12":2,"13":2,"15":1,"17":1,"18":1,"39":1,"40":1,"41":1,"46":1,"53":1}}],["withself",{"2":{"19":3}}],["with",{"0":{"32":1,"33":1,"54":1,"55":1},"2":{"0":1,"4":1,"17":1,"18":1,"49":1}}],["want",{"2":{"46":1,"49":1,"52":1}}],["waiting",{"2":{"3":1}}],["walkparentsgenerator",{"0":{"19":1},"2":{"2":1,"19":1}}],["walkflatdatagenerator",{"0":{"12":1},"2":{"2":1,"12":1}}],["walkflatdata",{"0":{"13":1},"2":{"2":1}}],["walktreedatagenerator",{"0":{"5":1},"2":{"2":1,"5":1,"12":1}}],["walktreedata",{"0":{"6":1},"2":{"2":1}}],["whether",{"2":{"3":9,"19":1,"20":1,"41":1,"50":3,"51":1,"56":1,"59":1}}],["when",{"0":{"30":1,"51":1},"2":{"0":1,"3":8,"4":1,"39":2,"41":3,"51":1,"56":1,"59":1}}],["which",{"2":{"2":1,"19":1,"39":1,"40":1,"46":1}}],["synchronously",{"2":{"41":1}}],["svg>",{"2":{"22":1}}],["svg",{"2":{"22":3}}],["small",{"2":{"22":1}}],["specified",{"2":{"39":1}}],["special",{"2":{"2":1,"19":1}}],["splice",{"2":{"33":1,"55":1}}],["span>",{"2":{"22":1}}],["span",{"2":{"22":1}}],["science",{"2":{"22":1,"23":1,"24":1,"25":1,"26":1,"27":1,"28":1,"29":1,"30":1,"31":1,"32":1,"33":1,"34":1,"43":1,"44":1,"45":1,"47":1,"48":1,"49":1,"50":3,"51":1,"53":1,"54":1,"55":1,"56":1}}],["scroll",{"0":{"36":1},"2":{"4":1,"59":1}}],["scrolltonode",{"2":{"4":1,"36":2,"59":1}}],["sub",{"2":{"50":4}}],["substring",{"2":{"31":1,"32":1,"33":1,"53":1,"54":1,"55":1}}],["such",{"2":{"41":1}}],["supports",{"2":{"39":1,"58":1}}],["supported",{"2":{"0":1}}],["sure",{"2":{"12":1,"13":1,"14":1,"15":1}}],["shyarn",{"2":{"38":1,"52":1}}],["shpnpm",{"2":{"38":1,"52":1}}],["shnpm",{"2":{"38":1,"52":1}}],["shadow",{"2":{"22":1}}],["shaped",{"0":{"24":1,"44":1},"2":{"0":1,"41":2}}],["should",{"2":{"11":1}}],["similar",{"2":{"39":1}}],["size",{"2":{"22":1}}],["siblingids",{"2":{"20":1}}],["sibling",{"2":{"16":1,"20":1}}],["siblingstats",{"2":{"20":1}}],["siblings",{"2":{"3":1,"5":1,"6":1,"7":1,"8":1,"12":1,"20":3}}],["single",{"2":{"9":1,"10":1,"14":1,"15":1,"42":1}}],["skip",{"2":{"5":1,"6":1,"7":1,"8":1,"12":1,"13":1}}],["skipchildren",{"2":{"5":2,"6":2,"7":2,"8":2,"12":2,"13":2}}],["same",{"2":{"4":1,"39":1}}],["second",{"2":{"49":2}}],["see",{"2":{"41":1}}],["set",{"2":{"39":1,"57":1}}],["setsemicheckedids",{"2":{"28":2,"49":2}}],["setcheckedids",{"2":{"28":2,"49":2}}],["setopenids",{"2":{"27":7,"30":3,"35":3,"36":3,"48":7,"51":3,"57":3}}],["setdata",{"2":{"22":2,"23":2,"24":2,"25":2,"26":2,"27":2,"28":2,"29":2,"30":2,"31":5,"32":6,"33":6,"34":3,"35":2,"36":2,"43":2,"44":2,"45":2,"47":2,"48":2,"49":2,"50":2,"51":2,"53":5,"54":6,"55":6,"56":3,"57":2}}],["setdragimage",{"2":{"3":1}}],["self",{"2":{"19":1}}],["semicheckedids",{"2":{"28":2,"49":2}}],["semi",{"2":{"0":1,"28":1,"49":5}}],["s",{"2":{"3":1,"4":1,"20":2,"39":1,"41":1,"49":1,"54":1,"55":1}}],["so",{"2":{"53":1,"58":1}}],["solid",{"2":{"22":2,"23":1,"24":1,"25":1,"26":1,"27":1,"28":1,"29":1,"30":1,"31":1,"32":1,"33":1,"34":1,"35":1,"36":1,"43":1,"44":1,"45":1,"47":1,"48":1,"49":1,"50":1,"51":1,"53":1,"54":1,"55":1,"56":1,"57":1}}],["source",{"2":{"22":1,"23":1,"24":1,"25":1,"26":1,"27":1,"28":1,"29":1,"30":1,"31":1,"32":1,"33":1,"34":1,"35":1,"36":1}}],["sorteddata",{"2":{"11":1}}],["sorted",{"2":{"11":1}}],["sort",{"2":{"11":1,"39":1}}],["sortflatdata",{"0":{"11":1},"2":{"2":1,"22":2,"23":2,"25":2,"26":2,"27":2,"28":2,"29":2,"30":2,"31":2,"32":2,"34":2,"35":2,"36":2,"39":1,"43":2,"45":2,"47":2,"48":2,"49":2,"50":2,"51":2,"53":2,"54":2,"56":2,"57":2}}],["some",{"2":{"3":1,"4":1,"40":1}}],["stored",{"2":{"39":1}}],["structures",{"2":{"39":1}}],["stringify",{"2":{"28":2,"49":2}}],["string",{"2":{"2":1,"3":4,"4":1,"9":2,"10":2,"11":2,"19":2}}],["style>",{"2":{"22":2,"26":2,"47":2}}],["style=",{"2":{"22":1,"46":2}}],["style",{"0":{"22":1,"46":1},"2":{"4":3,"23":1,"24":1,"25":1,"26":1,"27":1,"28":1,"29":1,"30":1,"31":1,"32":1,"33":1,"34":1,"35":1,"36":1,"43":1,"44":1,"45":1,"47":1,"48":1,"49":1,"50":1,"51":1,"53":1,"54":1,"55":1,"56":1,"57":1}}],["standard",{"2":{"46":1}}],["start",{"2":{"20":1}}],["started",{"2":{"3":1}}],["state",{"2":{"41":2}}],["states",{"2":{"4":1,"40":1}}],["stats",{"2":{"20":2}}],["status",{"2":{"10":1,"15":1,"48":1,"49":2}}],["stat",{"0":{"20":1},"2":{"2":1,"3":12,"4":9,"20":6,"22":3,"26":2,"30":2,"42":6,"46":1,"47":2,"48":1,"49":1,"51":2}}],["two",{"2":{"39":1,"46":1,"52":1}}],["t",{"2":{"33":2,"46":1,"49":2,"55":2}}],["text",{"2":{"26":1,"47":1}}],["technology",{"2":{"22":1,"23":1,"24":1,"25":1,"26":1,"27":1,"28":1,"29":1,"30":1,"31":1,"32":1,"33":1,"34":1,"43":1,"44":1,"45":1,"47":1,"48":1,"49":1,"50":3,"51":1,"53":1,"54":1,"55":1,"56":1}}],["tips",{"0":{"42":1}}],["title>",{"2":{"22":1}}],["title>drag",{"2":{"22":1}}],["time",{"2":{"3":1,"4":1}}],["ts",{"2":{"42":1}}],["tsxrendernodebox",{"2":{"46":1}}],["tsx",{"2":{"42":1}}],["tsximport",{"2":{"22":1,"23":1,"24":1,"25":1,"26":1,"27":1,"28":1,"29":1,"30":1,"31":1,"32":1,"33":1,"34":1,"35":1,"36":1,"43":1,"44":1,"45":1,"47":1,"48":1,"49":1,"50":1,"51":1,"53":1,"54":1,"55":1,"56":1,"57":1}}],["tswalkflatdata",{"2":{"13":1}}],["tswalktreedatagenerator",{"2":{"6":1}}],["tslet",{"2":{"7":1,"8":1,"19":1}}],["tsfor",{"2":{"5":1,"12":1}}],["tsimport",{"2":{"3":1}}],["target",{"2":{"3":2}}],["typeof",{"2":{"31":1,"32":1,"33":1,"53":1,"54":1,"55":1}}],["type=",{"2":{"28":1,"49":1}}],["type",{"2":{"2":1,"3":3,"4":1,"20":1,"27":1,"28":1,"30":1,"31":1,"32":1,"33":1,"35":1,"36":1,"41":1,"48":1,"49":1,"51":1,"53":1,"54":1,"55":1,"57":1}}],["types",{"0":{"39":1},"2":{"2":2,"3":2,"39":1}}],["typescript",{"2":{"2":2}}],["try",{"2":{"58":1}}],["trigger",{"0":{"25":1,"45":1},"2":{"58":1}}],["true",{"2":{"19":1,"29":2,"30":2,"34":2,"35":1,"36":1,"46":2,"50":2,"51":2,"56":2,"57":1}}],["traverse",{"2":{"6":1}}],["traversal",{"2":{"5":1,"6":1,"7":1,"8":1,"12":1,"13":1}}],["traversing",{"2":{"2":2,"5":1,"12":1,"13":1,"19":1}}],["treeindex",{"2":{"12":3,"13":1,"16":1}}],["treedata",{"2":{"9":1,"10":1}}],["tree",{"0":{"24":1,"33":1,"44":1,"55":1},"2":{"0":1,"2":2,"3":9,"4":3,"5":1,"6":1,"11":1,"12":1,"16":1,"20":1,"22":4,"23":1,"24":2,"25":1,"26":2,"27":2,"28":2,"29":1,"30":2,"31":2,"32":2,"33":3,"34":2,"35":2,"36":2,"38":3,"39":5,"40":2,"41":4,"43":1,"44":2,"45":1,"46":1,"47":2,"48":3,"49":3,"50":2,"51":2,"52":2,"53":2,"54":2,"55":3,"56":2,"57":3,"59":1}}],["through",{"2":{"5":1,"6":1,"12":1,"13":1,"16":1,"42":2,"48":1,"49":1}}],["that",{"2":{"3":1,"13":1,"19":1,"40":1,"48":1,"49":4,"52":1,"58":1}}],["this",{"2":{"2":3,"3":6,"4":4,"10":1,"15":1,"19":1,"39":2,"40":2,"41":3,"42":2,"48":1,"49":4,"52":1}}],["these",{"2":{"41":1,"42":1,"53":1}}],["then",{"2":{"41":1}}],["them",{"2":{"41":2}}],["their",{"2":{"10":1,"15":1}}],["therefore",{"2":{"17":1,"18":1}}],["there",{"2":{"3":1,"39":1,"41":2,"46":1,"49":2}}],["the",{"2":{"0":2,"2":4,"3":31,"4":10,"5":4,"6":5,"7":4,"8":3,"9":1,"10":1,"11":5,"12":9,"13":6,"14":2,"15":2,"16":3,"17":3,"18":3,"19":3,"20":2,"34":1,"39":13,"40":3,"41":6,"42":11,"45":2,"46":11,"48":6,"49":9,"50":5,"51":3,"52":1,"56":1,"59":3}}],["touch",{"0":{"58":1},"2":{"58":1}}],["tostring",{"2":{"31":1,"32":1,"33":1,"53":1,"54":1,"55":1}}],["top",{"2":{"22":1}}],["together",{"2":{"17":1,"18":1}}],["to",{"0":{"36":1},"2":{"0":1,"2":3,"3":11,"4":2,"6":1,"9":1,"11":2,"12":1,"14":1,"17":2,"18":1,"19":3,"20":1,"34":1,"36":1,"39":4,"40":2,"41":9,"42":3,"45":1,"46":4,"48":1,"49":3,"50":1,"51":2,"52":4,"53":1,"56":2,"57":2,"58":1,"59":3}}],["due",{"2":{"52":1}}],["d=",{"2":{"22":1}}],["dashed",{"2":{"22":1,"26":1,"46":1,"47":1}}],["database",{"2":{"39":1}}],["data>",{"2":{"31":1,"32":1,"33":1,"53":1,"54":1,"55":1}}],["datatransfer",{"2":{"3":1}}],["datatype",{"2":{"3":1,"22":1,"23":1,"24":1,"25":1,"26":1,"27":1,"28":1,"29":1,"30":1,"31":1,"32":1,"33":1,"34":1,"35":1,"36":1,"39":1,"41":1,"43":1,"44":1,"45":1,"47":1,"48":1,"49":1,"50":1,"51":1,"53":1,"54":1,"55":1,"56":1,"57":1}}],["data",{"0":{"23":1,"24":1,"31":1,"32":1,"33":1,"35":1,"39":1,"43":1,"44":1,"52":1,"53":1,"54":1,"55":1,"57":1},"2":{"0":4,"2":4,"3":9,"4":3,"5":2,"6":2,"7":1,"8":1,"11":2,"12":2,"13":2,"14":1,"15":1,"17":3,"18":3,"19":2,"20":2,"22":2,"23":2,"24":2,"25":2,"26":4,"27":4,"28":3,"29":2,"30":2,"31":5,"32":3,"33":3,"34":3,"35":2,"36":2,"39":10,"41":9,"42":2,"43":2,"44":2,"45":2,"46":3,"47":4,"48":6,"49":5,"50":2,"51":2,"52":4,"53":6,"54":3,"55":3,"56":3,"57":2,"59":1}}],["don",{"2":{"46":1,"49":2}}],["documentation",{"2":{"41":1}}],["document",{"2":{"19":1}}],["do",{"2":{"4":1,"41":1}}],["does",{"2":{"2":1,"4":2,"40":1}}],["difficult",{"2":{"52":1}}],["directly",{"2":{"42":1}}],["direction",{"2":{"3":2,"59":1}}],["dimensional",{"2":{"39":1}}],["div>node",{"2":{"46":1}}],["div>",{"2":{"22":5,"23":4,"24":4,"25":4,"26":5,"27":4,"28":4,"29":4,"30":4,"31":4,"32":4,"33":4,"34":4,"35":4,"36":4,"40":2,"43":4,"44":4,"45":4,"46":5,"47":5,"48":4,"49":4,"50":4,"51":4,"53":4,"54":4,"55":4,"56":4,"57":4}}],["div",{"2":{"19":1,"22":3,"26":3,"46":8,"47":3}}],["displayed",{"2":{"3":1}}],["display",{"2":{"0":1,"3":1,"22":3}}],["device",{"0":{"58":1},"2":{"58":1}}],["delete",{"2":{"52":1}}],["delay",{"2":{"51":1}}],["depth",{"2":{"20":1}}],["description",{"2":{"3":2,"4":1,"20":1}}],["default",{"2":{"2":1,"3":1,"22":1,"23":1,"24":1,"25":1,"26":1,"27":1,"28":1,"29":1,"30":1,"31":1,"32":1,"33":1,"34":1,"35":1,"36":1,"40":1,"41":6,"43":1,"44":1,"45":1,"47":1,"48":1,"49":1,"50":1,"51":3,"53":1,"54":1,"55":1,"56":1,"57":1,"59":1}}],["defaultprops",{"2":{"2":1}}],["draft",{"2":{"32":6,"33":6,"34":2,"54":6,"55":6,"56":2}}],["dragicon",{"2":{"22":2}}],["dragoverstat",{"2":{"4":1}}],["dragopendelay",{"2":{"3":1,"51":1}}],["dragopen",{"2":{"3":1,"30":1,"51":2}}],["dragend",{"2":{"3":1}}],["dragged",{"2":{"3":1,"4":1,"50":3}}],["draggable=",{"2":{"22":1,"25":1,"31":1,"32":1,"33":1,"34":1,"45":1,"46":1,"53":1,"54":1,"55":1,"56":1}}],["draggable",{"0":{"29":1,"50":1},"2":{"3":1,"20":1,"22":1,"25":2,"27":1,"28":1,"29":1,"30":1,"31":2,"32":2,"33":2,"34":1,"35":1,"36":1,"45":3,"48":1,"49":1,"50":1,"51":1,"53":2,"54":2,"55":2,"56":1,"57":1}}],["draggingstat",{"2":{"4":1}}],["dragging",{"0":{"51":1},"2":{"3":4,"4":1,"22":4,"59":1}}],["drag",{"0":{"30":1,"34":1,"45":1,"47":1,"56":1},"2":{"0":4,"3":6,"4":2,"22":3,"26":2,"46":3,"47":2,"56":1,"58":4,"59":2}}],["dropped",{"2":{"50":5}}],["droppable",{"0":{"29":1,"50":1},"2":{"3":1}}],["drop",{"2":{"0":1,"46":1,"56":1,"58":3}}],["br",{"2":{"28":1,"49":1}}],["background",{"2":{"22":5,"26":1,"47":1}}],["basepage",{"2":{"22":1,"23":1,"24":1,"25":1,"26":1,"27":1,"28":1,"29":1,"30":1,"31":1,"32":1,"33":1,"34":1,"35":1,"36":1,"43":1,"44":1,"45":1,"47":1,"48":1,"49":1,"50":1,"51":1,"53":1,"54":1,"55":1,"56":1,"57":1}}],["based",{"2":{"0":1,"58":1}}],["blue",{"2":{"22":1,"46":1}}],["biology",{"2":{"22":1,"23":1,"24":1,"25":1,"26":1,"27":1,"28":1,"29":1,"30":1,"31":1,"32":1,"33":1,"34":1,"43":1,"44":1,"45":1,"47":1,"48":1,"49":1,"50":1,"51":1,"53":1,"54":1,"55":1,"56":1}}],["big",{"0":{"35":1,"57":1},"2":{"0":1}}],["button>",{"2":{"25":1,"27":5,"30":1,"31":4,"32":5,"33":5,"34":1,"35":1,"36":2,"45":1,"48":5,"51":1,"53":4,"54":5,"55":5,"56":1,"57":1}}],["button",{"2":{"25":1,"27":5,"30":1,"31":4,"32":5,"33":5,"34":1,"35":1,"36":2,"45":1,"48":5,"51":1,"53":4,"54":5,"55":5,"56":1,"57":1}}],["but",{"2":{"4":1,"12":1,"40":1}}],["below",{"2":{"42":2}}],["better",{"2":{"41":2}}],["before",{"2":{"12":1,"13":1,"14":1,"15":1}}],["be",{"2":{"3":1,"4":3,"19":1,"39":1,"40":1,"41":2,"42":2,"48":1,"49":1,"50":8}}],["bottom",{"2":{"22":1}}],["both",{"2":{"0":1,"10":1,"15":1}}],["border",{"2":{"22":6,"23":1,"24":1,"25":1,"26":2,"27":1,"28":1,"29":1,"30":1,"31":1,"32":1,"33":1,"34":1,"35":1,"36":1,"43":1,"44":1,"45":1,"46":1,"47":2,"48":1,"49":1,"50":1,"51":1,"53":1,"54":1,"55":1,"56":1,"57":1}}],["box=",{"2":{"46":1}}],["box",{"0":{"47":1},"2":{"22":4,"26":2,"47":2}}],["boolean",{"2":{"3":8,"4":1,"10":1,"15":1,"19":1,"20":4,"27":1,"28":1,"30":1,"35":1,"36":1,"41":1,"48":1,"49":1,"51":1,"57":1}}],["by",{"2":{"2":1,"4":1,"18":1,"48":1}}],["highlighted",{"2":{"42":1}}],["http",{"2":{"22":1}}],["html5",{"2":{"58":1}}],["htmlelement",{"2":{"2":1,"19":2}}],["html",{"0":{"46":1},"2":{"0":1,"46":2}}],["hold",{"2":{"58":1}}],["horizontal",{"2":{"22":1}}],["hover",{"2":{"22":3,"26":1,"47":1}}],["hook",{"2":{"2":1,"3":1,"40":1}}],["h3>",{"2":{"22":1}}],["h3",{"2":{"22":1}}],["have",{"2":{"42":2}}],["hardware",{"2":{"22":1,"23":1,"24":1,"25":1,"26":1,"27":1,"28":1,"29":1,"30":1,"31":1,"32":1,"33":1,"34":1,"43":1,"44":1,"45":1,"47":1,"48":1,"49":1,"50":1,"51":1,"53":1,"54":1,"55":1,"56":1}}],["handlechecked",{"2":{"28":2,"49":2}}],["handleopen",{"2":{"27":2,"30":3,"35":2,"36":2,"48":2,"51":3,"57":2}}],["handler",{"2":{"22":3}}],["handle",{"2":{"3":1,"56":1}}],["has",{"2":{"3":1,"12":1}}],["here",{"2":{"19":1,"22":1,"26":1,"47":1,"54":1,"55":1}}],["he",{"2":{"3":1,"22":1,"23":1,"24":1,"25":1,"26":2,"27":2,"28":2,"29":1,"30":2,"31":2,"32":2,"33":2,"34":1,"35":2,"36":2,"38":3,"40":1,"43":1,"44":1,"45":1,"46":1,"47":2,"48":2,"49":2,"50":1,"51":2,"53":2,"54":2,"55":2,"56":1,"57":2}}],["hetreeprops",{"2":{"2":1}}],["height",{"2":{"0":1,"22":2,"26":2,"35":1,"36":1,"47":2,"57":2}}],["own",{"2":{"49":1}}],["others",{"0":{"59":1},"2":{"58":1}}],["otherwise",{"2":{"41":1}}],["other",{"2":{"41":1}}],["obtained",{"2":{"40":1,"48":1,"49":1}}],["object",{"2":{"3":1,"4":5,"20":5,"41":1,"42":1}}],["outer",{"2":{"46":1}}],["outside",{"2":{"3":2,"59":1}}],["out",{"2":{"3":1}}],["operations",{"2":{"52":1}}],["opened",{"2":{"51":1}}],["openids",{"2":{"3":1,"9":1,"14":1,"27":5,"30":4,"35":4,"36":4,"48":6,"51":4,"57":4}}],["openparentsinflatdata",{"0":{"14":1},"2":{"2":1,"27":3,"48":4}}],["openparentsintreedata",{"0":{"9":1},"2":{"2":1,"48":1}}],["open",{"0":{"27":1,"30":1,"48":1,"51":1},"2":{"0":2,"3":4,"9":1,"14":1,"20":1,"23":1,"24":1,"25":1,"27":6,"28":1,"29":1,"30":5,"34":1,"35":5,"36":5,"43":1,"44":1,"45":1,"48":9,"49":1,"50":1,"51":5,"56":1,"57":5}}],["option",{"2":{"46":3,"48":1,"49":1,"57":1,"59":4}}],["options",{"0":{"41":1},"2":{"2":2,"3":5,"4":3,"9":1,"10":1,"11":1,"14":1,"15":1,"16":1,"17":1,"18":1,"19":2,"39":1,"41":4,"50":1,"51":1,"56":1}}],["opposite",{"2":{"3":1}}],["override",{"2":{"46":1}}],["over",{"0":{"51":1},"2":{"2":1,"3":3,"4":1,"19":1}}],["org",{"2":{"22":1}}],["original",{"2":{"17":2,"18":2,"53":1}}],["order",{"2":{"11":2,"12":1,"13":1,"14":1,"15":1,"39":1}}],["or",{"2":{"0":1,"4":4,"9":1,"10":1,"14":1,"15":1,"17":1,"18":1,"19":1,"41":1,"46":1,"48":1,"49":2,"52":2,"53":1}}],["online",{"2":{"42":1}}],["only",{"2":{"3":3,"20":1,"42":1}}],["onclick=",{"2":{"27":5,"30":1,"31":3,"32":4,"33":4,"35":1,"36":2,"48":5,"51":1,"53":3,"54":4,"55":4,"57":1}}],["onchange=",{"2":{"28":1,"49":1}}],["onchange",{"2":{"3":1,"22":1,"23":1,"24":1,"25":1,"26":1,"27":1,"28":1,"29":1,"30":1,"31":1,"32":1,"33":1,"34":1,"35":1,"36":1,"41":2,"43":1,"44":1,"45":1,"47":1,"48":1,"49":1,"50":1,"51":1,"53":1,"54":1,"55":1,"56":1,"57":1}}],["ondragend",{"2":{"3":1}}],["ondragover",{"2":{"3":1}}],["ondragopen",{"2":{"3":1,"30":1,"51":2}}],["ondragstart",{"2":{"3":1}}],["onexternaldrop",{"2":{"3":1,"34":1,"56":2}}],["onexternaldragover",{"2":{"3":1,"34":1,"56":2}}],["one",{"2":{"3":1,"39":1,"41":1,"48":1,"49":1}}],["onto",{"0":{"30":1},"2":{"0":1}}],["on",{"2":{"0":1,"3":4,"4":2,"58":1}}],["of",{"0":{"4":1,"46":1},"2":{"0":1,"2":2,"3":13,"4":7,"5":4,"6":1,"7":1,"8":1,"9":1,"10":1,"11":1,"12":6,"13":3,"14":1,"15":1,"16":1,"17":1,"18":1,"19":3,"20":2,"39":2,"40":1,"41":1,"42":3,"45":1,"46":3,"48":3,"49":3,"52":1,"54":1,"55":1,"59":1}}],["f0f0f0",{"2":{"22":2}}],["flex",{"2":{"22":3}}],["flatdata",{"2":{"11":1,"12":1,"13":1,"14":1,"15":1,"16":1,"17":1,"18":1}}],["flat",{"0":{"23":1,"31":1,"32":1,"43":1,"53":1,"54":1},"2":{"0":1,"2":1,"3":4,"11":1,"12":1,"13":1,"17":1,"18":1,"22":1,"23":1,"25":1,"26":1,"27":1,"28":1,"29":1,"30":1,"31":1,"32":1,"34":1,"35":1,"36":1,"39":2,"41":3,"43":1,"45":1,"47":1,"48":2,"49":2,"50":1,"51":1,"52":2,"53":1,"54":1,"56":1,"57":1,"59":1}}],["f3ffff",{"2":{"22":1}}],["false",{"2":{"3":4,"4":1,"28":1,"29":3,"41":1,"49":1,"50":3,"51":1,"59":1}}],["font",{"2":{"22":1}}],["foundnode",{"2":{"7":1}}],["found",{"2":{"4":1,"7":1,"8":1}}],["following",{"2":{"3":1,"50":1,"51":1}}],["follows",{"2":{"3":1,"4":1,"20":1,"46":1}}],["format",{"2":{"42":2}}],["for",{"2":{"0":1,"2":3,"3":3,"5":1,"12":1,"19":1,"35":3,"36":3,"41":2,"42":1,"46":1,"48":2,"49":1,"52":1,"57":4,"58":1}}],["filter",{"2":{"8":1,"27":1,"30":1,"35":1,"36":1,"48":1,"51":1,"57":1}}],["filtertreedata",{"0":{"8":1},"2":{"2":1,"8":1}}],["first",{"2":{"7":1,"41":1,"49":1}}],["findindex",{"2":{"33":1,"55":1}}],["find",{"2":{"7":1,"32":1,"54":1,"55":1}}],["findtreedata",{"0":{"7":1},"2":{"2":1,"7":1,"33":4,"55":5}}],["fixed",{"2":{"0":1,"39":1}}],["functions",{"2":{"3":2,"41":4,"42":1}}],["function",{"2":{"2":1,"3":3,"22":2,"23":1,"24":1,"25":1,"26":1,"27":1,"28":1,"29":1,"30":1,"31":1,"32":1,"33":1,"34":1,"35":2,"36":2,"40":1,"41":2,"42":2,"43":1,"44":1,"45":1,"47":1,"48":1,"49":1,"50":1,"51":2,"53":1,"54":1,"55":1,"56":1,"57":2,"59":1}}],["from",{"0":{"34":1,"56":1},"2":{"0":2,"3":4,"4":1,"18":1,"20":1,"22":2,"23":2,"24":2,"25":2,"26":2,"27":3,"28":3,"29":2,"30":3,"31":3,"32":4,"33":4,"34":2,"35":3,"36":3,"40":1,"43":2,"44":2,"45":2,"47":2,"48":3,"49":3,"50":2,"51":3,"53":3,"54":4,"55":4,"56":3,"57":3,"59":1}}],["features",{"0":{"0":1}}],["above",{"2":{"46":1}}],["absolute",{"2":{"22":1}}],["avoid",{"2":{"41":1}}],["available",{"2":{"41":1}}],["attribute",{"2":{"45":1}}],["attrslist",{"2":{"4":1}}],["attrs",{"2":{"3":1,"4":1,"22":3,"26":3,"46":3,"47":3}}],["attention",{"2":{"42":1}}],["at",{"2":{"41":1}}],["app",{"2":{"40":1}}],["api",{"0":{"1":1},"1":{"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1,"9":1,"10":1,"11":1,"12":1,"13":1,"14":1,"15":1,"16":1,"17":1,"18":1,"19":1,"20":1},"2":{"0":1,"41":1,"42":1,"58":3}}],["advantage",{"2":{"40":1}}],["addition",{"2":{"40":1}}],["add",{"2":{"17":1,"31":2,"32":2,"33":2,"38":2,"45":1,"52":3,"53":2,"54":2,"55":2}}],["addtoflatdata",{"0":{"17":1},"2":{"2":1,"31":2,"32":2,"34":2,"53":3,"54":2,"56":2}}],["amp",{"0":{"29":1,"48":1,"50":1,"58":1}}],["among",{"2":{"3":1}}],["although",{"2":{"41":2}}],["also",{"2":{"40":1}}],["align",{"2":{"22":3,"26":1,"47":1}}],["allids",{"2":{"4":1,"27":5,"30":3,"34":1,"35":3,"36":3,"48":6,"51":3,"56":1,"57":3}}],["all",{"2":{"3":2,"4":6,"5":1,"6":1,"7":1,"8":2,"9":1,"12":1,"13":1,"14":1,"27":2,"41":1,"48":4,"49":2}}],["after",{"2":{"11":1,"49":1}}],["according",{"2":{"11":1}}],["as",{"2":{"3":1,"4":1,"20":1,"31":2,"32":2,"39":2,"41":1,"46":1,"53":2,"54":2}}],["argument",{"2":{"4":1}}],["arguments",{"2":{"3":1}}],["array",{"2":{"3":3,"4":6,"7":1,"8":1,"11":1,"17":1,"18":1,"39":2,"49":1,"55":1}}],["area",{"2":{"46":1}}],["are",{"2":{"3":2,"4":1,"20":1,"39":1,"41":4,"46":2,"49":4}}],["any",{"2":{"42":1,"45":1,"58":1}}],["an",{"2":{"4":1,"19":1,"39":2,"41":1,"49":1}}],["another",{"2":{"2":1,"19":1}}],["and",{"0":{"46":1,"47":1},"2":{"0":2,"2":3,"3":2,"4":2,"5":1,"6":1,"7":1,"8":1,"10":1,"12":1,"13":1,"15":1,"16":1,"40":1,"41":4,"46":1,"49":2,"50":4,"52":1,"58":4}}],["a",{"2":{"0":1,"2":1,"3":5,"4":1,"9":1,"10":1,"14":1,"15":1,"16":1,"17":2,"18":1,"19":3,"20":1,"39":3,"40":1,"41":1,"42":1,"59":1}}]],"serializationVersion":2}';export{e as default}; diff --git a/assets/chunks/@localSearchIndexzh.CJ3ezlAn.js b/assets/chunks/@localSearchIndexzh.CJ3ezlAn.js new file mode 100644 index 0000000..84cf600 --- /dev/null +++ b/assets/chunks/@localSearchIndexzh.CJ3ezlAn.js @@ -0,0 +1 @@ +const e='{"documentCount":60,"nextId":60,"documentIds":{"0":"/zh/#功能","1":"/zh/v1/examples#示例","2":"/zh/v1/examples#自定义样式","3":"/zh/v1/examples#扁平数据","4":"/zh/v1/examples#树形数据","5":"/zh/v1/examples#触发元素","6":"/zh/v1/examples#占位元素","7":"/zh/v1/examples#展开","8":"/zh/v1/examples#勾选","9":"/zh/v1/examples#拖拽控制","10":"/zh/v1/examples#拖拽时打开","11":"/zh/v1/examples#更新扁平数据","12":"/zh/v1/examples#更新扁平数据使用-immer","13":"/zh/v1/examples#更新树形数据使用-immer","14":"/zh/v1/examples#外部拖拽交互","15":"/zh/v1/examples#大数据-虚拟列表","16":"/zh/v1/examples#滚动到节点","17":"/zh/v1/api#api","18":"/zh/v1/api#导出","19":"/zh/v1/api#usehetree","20":"/zh/v1/api#usehetree的返回","21":"/zh/v1/api#walktreedatagenerator","22":"/zh/v1/api#walktreedata","23":"/zh/v1/api#findtreedata","24":"/zh/v1/api#filtertreedata","25":"/zh/v1/api#openparentsintreedata","26":"/zh/v1/api#updatecheckedintreedata","27":"/zh/v1/api#sortflatdata","28":"/zh/v1/api#walkflatdatagenerator","29":"/zh/v1/api#walkflatdata","30":"/zh/v1/api#openparentsinflatdata","31":"/zh/v1/api#updatecheckedinflatdata","32":"/zh/v1/api#convertindextotreeindexinflatdata","33":"/zh/v1/api#addtoflatdata","34":"/zh/v1/api#removebyidinflatdata","35":"/zh/v1/api#walkparentsgenerator","36":"/zh/v1/api#stat","37":"/zh/v1/guide#使用指南","38":"/zh/v1/guide#安装","39":"/zh/v1/guide#数据类型","40":"/zh/v1/guide#没有组件","41":"/zh/v1/guide#选项","42":"/zh/v1/guide#提示","43":"/zh/v1/guide#基础使用-扁平数据","44":"/zh/v1/guide#基础使用-树形数据","45":"/zh/v1/guide#自定义拖拽触发元素","46":"/zh/v1/guide#节点-html-结构和样式","47":"/zh/v1/guide#自定义拖拽占位节点和-node-box","48":"/zh/v1/guide#节点的展开与折叠","49":"/zh/v1/guide#节点的勾选","50":"/zh/v1/guide#控制是否可拖拽-可放入","51":"/zh/v1/guide#拖拽到节点上时打开节点","52":"/zh/v1/guide#更新数据","53":"/zh/v1/guide#使用内置方法更新扁平数据","54":"/zh/v1/guide#使用-immer-更新扁平数据","55":"/zh/v1/guide#使用-immer-更新树形数据","56":"/zh/v1/guide#从外部发起的拖拽","57":"/zh/v1/guide#超大数据","58":"/zh/v1/guide#触摸-移动设备","59":"/zh/v1/guide#其他"},"fieldIds":{"title":0,"titles":1,"text":2},"fieldLength":{"0":[1,1,20],"1":[1,1,1],"2":[1,1,162],"3":[1,1,67],"4":[1,1,62],"5":[1,1,74],"6":[1,1,101],"7":[1,1,96],"8":[1,1,94],"9":[1,1,75],"10":[1,1,94],"11":[1,1,100],"12":[2,1,111],"13":[2,1,110],"14":[1,1,95],"15":[2,1,91],"16":[1,1,95],"17":[1,1,1],"18":[1,1,46],"19":[1,1,142],"20":[1,2,70],"21":[1,1,19],"22":[1,1,16],"23":[1,1,27],"24":[1,1,27],"25":[1,1,14],"26":[1,1,17],"27":[1,1,10],"28":[1,1,27],"29":[1,1,20],"30":[1,1,16],"31":[1,1,19],"32":[1,1,16],"33":[1,1,18],"34":[1,1,18],"35":[1,1,33],"36":[1,1,49],"37":[1,1,1],"38":[1,1,10],"39":[1,1,30],"40":[1,1,24],"41":[1,1,45],"42":[1,1,26],"43":[2,1,66],"44":[2,1,61],"45":[1,1,74],"46":[3,1,64],"47":[3,1,100],"48":[1,1,110],"49":[1,1,112],"50":[2,1,83],"51":[1,1,102],"52":[1,1,19],"53":[1,1,104],"54":[3,1,114],"55":[3,1,114],"56":[1,1,97],"57":[1,1,92],"58":[3,1,15],"59":[1,1,19]},"averageFieldLength":[1.2666666666666666,1.0166666666666668,58.916666666666664],"storedFields":{"0":{"title":"功能","titles":[null]},"1":{"title":"示例","titles":[]},"2":{"title":"自定义样式","titles":["示例"]},"3":{"title":"扁平数据","titles":["示例"]},"4":{"title":"树形数据","titles":["示例"]},"5":{"title":"触发元素","titles":["示例"]},"6":{"title":"占位元素","titles":["示例"]},"7":{"title":"展开","titles":["示例"]},"8":{"title":"勾选","titles":["示例"]},"9":{"title":"拖拽控制","titles":["示例"]},"10":{"title":"拖拽时打开","titles":["示例"]},"11":{"title":"更新扁平数据","titles":["示例"]},"12":{"title":"更新扁平数据使用 immer","titles":["示例"]},"13":{"title":"更新树形数据使用 immer","titles":["示例"]},"14":{"title":"外部拖拽交互","titles":["示例"]},"15":{"title":"大数据, 虚拟列表","titles":["示例"]},"16":{"title":"滚动到节点","titles":["示例"]},"17":{"title":"API","titles":[]},"18":{"title":"导出","titles":["API"]},"19":{"title":"useHeTree","titles":["API"]},"20":{"title":"useHeTree的返回","titles":["API","useHeTree"]},"21":{"title":"walkTreeDataGenerator","titles":["API"]},"22":{"title":"walkTreeData","titles":["API"]},"23":{"title":"findTreeData","titles":["API"]},"24":{"title":"filterTreeData","titles":["API"]},"25":{"title":"openParentsInTreeData","titles":["API"]},"26":{"title":"updateCheckedInTreeData","titles":["API"]},"27":{"title":"sortFlatData","titles":["API"]},"28":{"title":"walkFlatDataGenerator","titles":["API"]},"29":{"title":"walkFlatData","titles":["API"]},"30":{"title":"openParentsInFlatData","titles":["API"]},"31":{"title":"updateCheckedInFlatData","titles":["API"]},"32":{"title":"convertIndexToTreeIndexInFlatData","titles":["API"]},"33":{"title":"addToFlatData","titles":["API"]},"34":{"title":"removeByIdInFlatData","titles":["API"]},"35":{"title":"walkParentsGenerator","titles":["API"]},"36":{"title":"Stat","titles":["API"]},"37":{"title":"使用指南","titles":[]},"38":{"title":"安装","titles":["使用指南"]},"39":{"title":"数据类型","titles":["使用指南"]},"40":{"title":"没有组件","titles":["使用指南"]},"41":{"title":"选项","titles":["使用指南"]},"42":{"title":"提示","titles":["使用指南"]},"43":{"title":"基础使用-扁平数据","titles":["使用指南"]},"44":{"title":"基础使用-树形数据","titles":["使用指南"]},"45":{"title":"自定义拖拽触发元素","titles":["使用指南"]},"46":{"title":"节点 HTML 结构和样式","titles":["使用指南"]},"47":{"title":"自定义拖拽占位节点和 node box","titles":["使用指南"]},"48":{"title":"节点的展开与折叠","titles":["使用指南"]},"49":{"title":"节点的勾选","titles":["使用指南"]},"50":{"title":"控制是否可拖拽, 可放入","titles":["使用指南"]},"51":{"title":"拖拽到节点上时打开节点","titles":["使用指南"]},"52":{"title":"更新数据","titles":["使用指南"]},"53":{"title":"使用内置方法更新扁平数据","titles":["使用指南"]},"54":{"title":"使用 immer 更新扁平数据","titles":["使用指南"]},"55":{"title":"使用 immer 更新树形数据","titles":["使用指南"]},"56":{"title":"从外部发起的拖拽","titles":["使用指南"]},"57":{"title":"超大数据","titles":["使用指南"]},"58":{"title":"触摸 & 移动设备","titles":["使用指南"]},"59":{"title":"其他","titles":["使用指南"]}},"dirtCount":0,"index":[["滚动到指定节点",{"2":{"59":1}}],["滚动到节点",{"0":{"16":1},"2":{"20":1}}],["辅助方法",{"2":{"59":1}}],["顶级节点的父",{"2":{"59":1}}],["移动设备",{"0":{"58":1}}],["触摸时",{"2":{"58":1}}],["触摸",{"0":{"58":1}}],["触发元素",{"0":{"5":1}}],["记得给树设置可见区域高度",{"2":{"57":1}}],["超大数据",{"0":{"57":1}}],["相关选项",{"2":{"56":1}}],["相比于walktreedatagenerator",{"2":{"28":1}}],["删除节点",{"2":{"53":1}}],["增加节点",{"2":{"53":1}}],["推荐你使用immer",{"2":{"52":1}}],["或者与immer一起使用",{"2":{"53":1}}],["或者与useimmer一起使用",{"2":{"33":1,"34":1}}],["或者更新树形数据",{"2":{"52":1}}],["针对扁平数据",{"2":{"52":1}}],["由于",{"2":{"52":1}}],["由此树发起拖拽时",{"2":{"20":1}}],["打开节点时调用的函数",{"2":{"51":1}}],["打开单个或多个节点的所有父节点",{"2":{"25":1,"30":1}}],["毫秒",{"2":{"51":1}}],["延时",{"2":{"51":1}}],["根节点不可放入",{"2":{"50":1}}],["根据",{"2":{"20":1}}],["控制是否可拖拽",{"0":{"50":1}}],["也有子节点未被勾选",{"2":{"49":1}}],["忽略第二项",{"2":{"49":1}}],["仅展开",{"2":{"48":1}}],["仅用于树形数据",{"2":{"19":1}}],["仅用于扁平数据",{"2":{"19":1}}],["折叠全部",{"2":{"48":1}}],["个按钮分别是",{"2":{"48":1}}],["行是节点元素",{"2":{"46":1}}],["行是拖拽占位节点",{"2":{"46":1}}],["9",{"2":{"46":1}}],["910",{"2":{"16":2}}],["到第",{"2":{"46":1}}],["第二项是所有半选的",{"2":{"49":1}}],["第一项是所有勾选的",{"2":{"49":1}}],["第",{"2":{"46":2}}],["标准的rendernodebox如下",{"2":{"46":1}}],["外层节点被称为nodebox",{"2":{"46":1}}],["外部拖拽交互",{"0":{"14":1}}],["上面有两个",{"2":{"46":1}}],["结构和样式",{"0":{"46":1}}],["给节点任意子元素添加draggable属性即可",{"2":{"45":1}}],["自定义",{"2":{"59":1}}],["自定义拖拽占位节点和",{"0":{"47":1}}],["自定义拖拽触发元素",{"0":{"45":1}}],["自定义样式",{"0":{"2":1}}],["基础使用",{"0":{"43":1,"44":1}}],["基于",{"2":{"0":1}}],["在线转换器",{"2":{"42":1}}],["在设置中",{"2":{"39":1}}],["下面的代码例子使用tsx格式",{"2":{"42":1}}],["下面的代码例子附带有运行效果",{"2":{"42":1}}],["下面是遍历",{"2":{"35":1}}],["此方法返回一个长度",{"2":{"49":1}}],["此方法对节点的checked的更新是级联的",{"2":{"49":1}}],["此例子顶部",{"2":{"48":1}}],["此函数在usehetree的返回对象中",{"2":{"42":1}}],["此库基于",{"2":{"58":1}}],["此库提供了两个方法",{"2":{"52":1}}],["此库导出了方法可以获取单个或多个节点checked变动后的checkedids",{"2":{"49":1}}],["此库导出了方法可以展开单个或多个节点的所有父级",{"2":{"48":1}}],["此库导出的变量",{"2":{"18":1}}],["此库没有导出组件",{"2":{"40":1}}],["此库将使用节点在树中的索引作为id",{"2":{"39":1}}],["此库支持两种结构的数据",{"2":{"39":1}}],["唯一参数可以是id",{"2":{"42":1}}],["大部分回调函数的参数里有stat",{"2":{"42":1}}],["大数据",{"0":{"15":1},"2":{"0":1}}],["单个节点的相关信息",{"2":{"42":1}}],["单位是毫秒",{"2":{"19":1}}],["单位是",{"2":{"19":1}}],["提示",{"0":{"42":1}}],["文档以了解更多",{"2":{"41":1}}],["查看usehetree的",{"2":{"41":1}}],["并且用",{"2":{"41":1}}],["否则你需要启用此项",{"2":{"41":1}}],["则不用启用此项",{"2":{"41":1}}],["如",{"2":{"46":1}}],["如下",{"2":{"46":1}}],["如onchange",{"2":{"41":1}}],["如果不支持",{"2":{"58":1}}],["如果不需要半选",{"2":{"49":1}}],["如果你要进行更复杂的操作",{"2":{"52":1}}],["如果你不想级联更新",{"2":{"49":1}}],["如果你想控制nodebox或拖拽占位节点的渲染",{"2":{"46":1}}],["如果你需要js格式",{"2":{"42":1}}],["如果你的回调函数和data是同步改变的",{"2":{"41":1}}],["如果你的树不会改变则不需要",{"2":{"41":1}}],["如果未指定id",{"2":{"39":1}}],["如果节点未找到或未显示",{"2":{"20":1}}],["如果是树形数据",{"2":{"20":1}}],["布尔",{"2":{"41":1}}],["但还是建议写明更好",{"2":{"41":2}}],["虽然有默认值",{"2":{"41":2}}],["默认false",{"2":{"41":1,"51":1,"59":1}}],["默认是children",{"2":{"41":1}}],["默认",{"2":{"41":1,"51":1}}],["默认值是id和parent",{"2":{"41":1}}],["默认值",{"2":{"19":1}}],["其他",{"0":{"59":1}}],["其他重要选项是",{"2":{"41":1}}],["其中包含类似于parentelement的指向父节点的键",{"2":{"18":1,"35":1}}],["必须两者中有一个的是rendernode",{"2":{"41":1}}],["必须的选项有data",{"2":{"41":1}}],["而是导出一个",{"2":{"40":1}}],["没有组件",{"0":{"40":1}}],["没有父级的节点的父级",{"2":{"19":1}}],["每项需要id",{"2":{"39":1}}],["即同时有子节点被勾选或半选",{"2":{"49":1}}],["即一个一维数组",{"2":{"39":1}}],["即节点在兄弟节点中的索引",{"2":{"19":1}}],["安装",{"0":{"38":1}}],["开始",{"2":{"36":1}}],["兄弟节点数组",{"2":{"36":1}}],["兄弟节点的",{"2":{"36":2}}],["子节点数组",{"2":{"36":1}}],["子节点的",{"2":{"36":2}}],["父节点的",{"2":{"36":1}}],["父节点的数据",{"2":{"36":1}}],["父级",{"2":{"18":1,"39":1}}],["对象",{"2":{"36":1}}],["表明是否处理外部拖拽",{"2":{"56":1}}],["表明是否是",{"2":{"36":1}}],["表明数据类型",{"2":{"41":1}}],["表示是否在树外部结束",{"2":{"19":1}}],["只读",{"2":{"36":1}}],["queryselector",{"2":{"35":1}}],["quot",{"2":{"19":2}}],["从外部发起的拖拽",{"0":{"56":1}}],["从",{"2":{"36":1}}],["从扁平数据删除一个节点",{"2":{"34":1}}],["从右往左显示",{"2":{"0":1,"59":1}}],["所以在支持",{"2":{"58":1}}],["所以把原数据的复制传给它",{"2":{"53":1}}],["所以推荐传入原始数据的拷贝",{"2":{"33":1,"34":1}}],["所有节点的",{"2":{"20":1}}],["所有勾选的节点的",{"2":{"19":1}}],["所有打开节点的",{"2":{"19":1}}],["它的第一个参数是选项对象",{"2":{"41":1}}],["它会改变原数据数组",{"2":{"33":1,"34":1}}],["它就是选项中的data",{"2":{"20":1}}],["向扁平数据添加一个节点",{"2":{"33":1}}],["计算出它在整棵树中的索引",{"2":{"32":1}}],["和它在兄弟节点中的索引",{"2":{"32":1}}],["和方法",{"2":{"20":1}}],["用户需要触摸并等一会儿才能触发拖拽",{"2":{"58":1}}],["用以增加节点或删除节点",{"2":{"52":1}}],["用前需确保你的数据的顺序是正确的",{"2":{"30":1,"31":1}}],["用来处理和遍历扁平数据的方法",{"2":{"18":1}}],["用来处理和遍历树形数据的方法",{"2":{"18":1}}],["多了",{"2":{"28":1}}],["少了siblings",{"2":{"28":1}}],["使用",{"0":{"54":1,"55":1}}],["使用内置方法更新扁平数据",{"0":{"53":1}}],["使用以下选项控制",{"2":{"50":1,"51":1}}],["使用你自己的逻辑替代",{"2":{"49":1}}],["使用选项virtual启用虚拟列表功能",{"2":{"57":1}}],["使用选项checkedids表明勾选的节点",{"2":{"49":1}}],["使用选项openids表明展开的节点",{"2":{"48":1}}],["使用选项indent控制节点的缩进",{"2":{"46":1}}],["使用rendernode选项控制内层",{"2":{"46":1}}],["使用树形数据时需要",{"2":{"41":1}}],["使用树形数据时需设置datatype",{"2":{"39":1}}],["使用它返回的rendertree渲染树",{"2":{"40":1}}],["使用idkey",{"2":{"39":1}}],["使用children数组包含子节点",{"2":{"39":1}}],["使用指南",{"0":{"37":1},"1":{"38":1,"39":1,"40":1,"41":1,"42":1,"43":1,"44":1,"45":1,"46":1,"47":1,"48":1,"49":1,"50":1,"51":1,"52":1,"53":1,"54":1,"55":1,"56":1,"57":1,"58":1,"59":1}}],["使用前需确保你的数据的顺序是正确的",{"2":{"28":1,"29":1}}],["使用扁平数据时需要",{"2":{"41":1}}],["使用扁平数据时",{"2":{"19":1,"59":1}}],["把扁平数据按照节点在树里的顺序排序",{"2":{"27":1}}],["类似与存储在数据库中的数据",{"2":{"39":1}}],["类似",{"2":{"23":1,"24":1}}],["类型是对象",{"2":{"19":1}}],["类型",{"2":{"18":2,"19":2,"20":1,"36":1}}],["回调方法中执行skipchildren",{"2":{"22":1,"23":1,"24":1,"29":1}}],["通过此函数可以获取stat",{"2":{"42":1}}],["通过stat",{"2":{"42":1}}],["通过某节点的父节点",{"2":{"32":1}}],["通过回调方法遍历扁平数据的方法",{"2":{"29":1}}],["通过回调方法遍历树形数据的方法",{"2":{"22":1}}],["通过for",{"2":{"21":1,"28":1}}],["执行exitwalk将结束遍历",{"2":{"21":1,"22":1,"23":1,"24":1,"28":1,"29":1}}],["将跳过该节点的所有子节点",{"2":{"21":1,"22":1,"23":1,"24":1,"28":1,"29":1}}],["循环中执行skipchildren",{"2":{"21":1,"28":1}}],["例子",{"2":{"20":1}}],["返回",{"2":{"35":1}}],["返回被删除的数据",{"2":{"34":1}}],["返回排序后的新数组",{"2":{"27":1}}],["返回找到的所有节点",{"2":{"24":1}}],["返回找到的第一个节点",{"2":{"23":1}}],["返回false",{"2":{"20":1}}],["返回null",{"2":{"19":2}}],["显示的所有节点的",{"2":{"20":2}}],["显示方向",{"2":{"19":1}}],["可放入",{"0":{"50":1}}],["可通过stat",{"2":{"48":1,"49":1}}],["可用值",{"2":{"41":1}}],["可以尝试添加兼容",{"2":{"58":1}}],["可以使用rendernodebox选项",{"2":{"46":1}}],["可以使用任意",{"2":{"42":1}}],["可以轻松的被获取",{"2":{"40":1}}],["可以依赖这个对象的属性",{"2":{"20":1}}],["可能为空",{"2":{"20":1}}],["被拖拽的节点的",{"2":{"20":1}}],["占位节点不存在时为空",{"2":{"20":1}}],["占位元素",{"0":{"6":1}}],["树根是否可放入",{"2":{"50":1}}],["树根级的所有节点的数据",{"2":{"20":1}}],["树根级的所有节点的",{"2":{"20":2}}],["树形数据",{"0":{"4":1,"44":1},"2":{"39":1,"41":1,"48":1,"49":1}}],["数组",{"2":{"20":6,"36":4}}],["数据改变时调用的函数",{"2":{"41":1}}],["数据中的id",{"2":{"39":1}}],["数据发生改变时调用",{"2":{"19":1}}],["数据类型",{"0":{"39":1},"2":{"19":1}}],["数据",{"2":{"19":1}}],["获得对应的",{"2":{"20":1}}],["渲染树",{"2":{"20":1}}],["属性如下",{"2":{"20":1,"36":1}}],["不要修改它的padding",{"2":{"46":1}}],["不要依赖这个对象",{"2":{"20":1}}],["不存在时为空",{"2":{"20":1}}],["不为空时表示将要放入节点的子级的位置",{"2":{"19":1}}],["这里使用了useimmer替代",{"2":{"54":1,"55":1}}],["这两个方法都会改变原数据",{"2":{"53":1}}],["这将覆盖rendernode",{"2":{"46":1}}],["这将同时更新它们的子节点和父节点",{"2":{"26":1,"31":1}}],["这些例子可以直接复制使用",{"2":{"42":1}}],["这样做的好处是除了rendertree",{"2":{"40":1}}],["这样才能确保该节点可见",{"2":{"25":1,"30":1}}],["这个对象每次更新都会改变",{"2":{"20":1}}],["这种数据类似htmlelement",{"2":{"18":1,"35":1}}],["注意其中的高亮行的代码",{"2":{"42":1}}],["注意",{"2":{"20":1,"54":1,"55":1,"58":1}}],["包含了一些",{"2":{"20":1}}],["为空时代表树的根级",{"2":{"19":1}}],["调用event",{"2":{"19":1}}],["中的剩余回调方法",{"2":{"19":1}}],["中的部分属性",{"2":{"19":1}}],["建议只在一个树的页面开启此项",{"2":{"19":1}}],["当外部拖拽放入树中时调用的回调函数",{"2":{"56":1}}],["当外部拖拽在此树结束时调用",{"2":{"19":1}}],["当此树发起的拖拽结束时调用",{"2":{"19":1}}],["当拖拽到树上方时",{"2":{"19":1}}],["当拖拽来自外部时调用",{"2":{"19":1}}],["当拖拽开始时",{"2":{"19":1}}],["当拖拽离开树的范围",{"2":{"19":1}}],["当数据非常多时用来提高性能",{"2":{"19":1}}],["keepplaceholder",{"2":{"19":1,"59":1}}],["key",{"2":{"2":1,"6":1,"46":1,"47":1}}],["key=",{"2":{"2":1,"6":1,"46":2,"47":1}}],["keys",{"2":{"2":3,"3":3,"5":3,"6":3,"7":5,"8":4,"9":3,"10":3,"11":5,"12":5,"13":2,"14":4,"15":3,"16":3,"43":3,"45":3,"47":3,"48":5,"49":4,"50":3,"51":3,"53":5,"54":5,"55":2,"56":4,"57":3}}],["与之相反",{"2":{"19":1}}],["是目标位置",{"2":{"19":1}}],["是目标父节点的",{"2":{"19":1}}],["是此次拖拽的节点的",{"2":{"19":1}}],["是否要保留拖拽占位节点",{"2":{"59":1}}],["是否要保留占位元素",{"2":{"19":1}}],["是否可拖动",{"2":{"36":1}}],["是否勾选",{"2":{"36":1}}],["是否展开",{"2":{"36":1}}],["是否监听回调函数的改变",{"2":{"19":1}}],["是否启用",{"2":{"51":1}}],["是否启用虚拟化",{"2":{"19":1}}],["是否启用功能",{"2":{"19":1}}],["是从左往右显示",{"2":{"19":1}}],["的库",{"2":{"58":1}}],["的移动设备上能工作",{"2":{"58":1}}],["的usestate",{"2":{"54":1,"55":1}}],["的usecallback或usememo缓存你的所有回调函数以避免性能问题",{"2":{"41":1}}],["的不可变特性",{"2":{"52":1}}],["的数组",{"2":{"49":1}}],["的渲染",{"2":{"46":1}}],["的渲染函数",{"2":{"19":1}}],["的例子",{"2":{"35":1}}],["的键名",{"2":{"19":2}}],["的类型",{"2":{"18":1}}],["你可以在初始化数据时使用sortflatdata方法给数据排序",{"2":{"39":1}}],["你的数据在初始化时应该使用它以保证顺序",{"2":{"27":1}}],["你的数据中子级的键名",{"2":{"19":1}}],["你的数据中父级",{"2":{"19":1}}],["你的数据中",{"2":{"19":1}}],["你必选返回布尔值表示是否处理此拖拽",{"2":{"19":1}}],["你需要使用此函数返回的rendertree渲染树",{"2":{"18":1}}],["参数是新数据",{"2":{"41":1}}],["参数可以是",{"2":{"20":1}}],["参数可以传入classname和style控制根元素的样式",{"2":{"20":1}}],["参数index可能为空",{"2":{"19":1}}],["参数如下",{"2":{"19":1}}],["参考stat",{"2":{"42":1}}],["参考虚拟列表",{"2":{"20":1}}],["参考",{"2":{"19":3,"25":1,"26":1,"30":1,"31":1,"33":1,"34":1}}],["参考数据类型",{"2":{"19":1}}],["描述",{"2":{"19":2,"20":1,"36":1}}],["名称",{"2":{"19":2,"20":1,"36":1}}],["以下是",{"2":{"19":2}}],["以下为",{"2":{"18":1}}],["选项",{"0":{"41":1},"2":{"19":1,"59":4}}],["本库的主要功能",{"2":{"19":1}}],["本库没有导出组件",{"2":{"18":1}}],["节点在树中的深度",{"2":{"36":1}}],["节点在兄弟节点中的索引",{"2":{"36":1}}],["节点数据或",{"2":{"20":2}}],["节点是否可放入",{"2":{"19":1,"50":1}}],["节点是否可拖拽",{"2":{"19":1,"50":1}}],["节点的勾选",{"0":{"49":1}}],["节点的所有父节点",{"2":{"48":2}}],["节点的展开与折叠",{"0":{"48":1}}],["节点的父级",{"2":{"36":1}}],["节点的数据",{"2":{"36":1,"42":1}}],["节点的渲染函数",{"2":{"19":1}}],["节点的相关信息",{"2":{"18":1}}],["节点缩进",{"2":{"19":1}}],["节点",{"0":{"46":1},"2":{"18":1,"46":1}}],["节点高度不固定",{"2":{"0":1}}],["遍历另一种特殊数据的方法",{"2":{"18":1,"35":1}}],["主要的",{"2":{"18":1}}],["方法",{"2":{"18":1}}],["导出",{"0":{"18":1}}],["getstat",{"2":{"20":1,"42":2}}],["generator",{"2":{"35":2}}],["generate",{"2":{"15":1,"16":1,"57":1}}],["genid",{"2":{"15":5,"16":5,"57":5}}],["gt",{"2":{"19":11,"20":2,"46":3}}],["grab",{"2":{"2":1}}],["更新树形数据",{"0":{"55":1}}],["更新树形数据使用",{"0":{"13":1}}],["更新数据",{"0":{"52":1}}],["更新数据的多个示例",{"2":{"0":1}}],["更新单个节点或多个节点的checked状态",{"2":{"26":1,"31":1}}],["更新扁平数据使用",{"0":{"12":1}}],["更新扁平数据",{"0":{"11":1,"54":1}}],["jsimport",{"2":{"40":1}}],["js",{"2":{"39":2,"42":1}}],["json",{"2":{"8":2,"49":2}}],["j++",{"2":{"15":2,"16":2,"57":2}}],["j",{"2":{"15":4,"16":4,"57":4}}],["justify",{"2":{"2":2}}],["+",{"2":{"7":1,"10":1,"14":1,"15":1,"16":1,"48":1,"51":1,"56":1,"57":1}}],["updatecheckedintreedata",{"0":{"26":1},"2":{"18":1}}],["updatecheckedinflatdata",{"0":{"31":1},"2":{"8":2,"18":1,"49":3}}],["unshift",{"2":{"13":1,"55":1}}],["undefined",{"2":{"9":2,"19":4,"35":1,"50":2}}],["undefined>",{"2":{"7":1,"10":1,"15":1,"16":1,"48":1,"51":1,"57":1}}],["use",{"2":{"12":1,"13":1,"14":1,"52":3,"54":1,"55":1,"56":1}}],["useimmer",{"2":{"12":2,"13":2,"14":2,"54":2,"55":2,"56":2}}],["useref",{"2":{"11":2,"12":2,"13":2,"53":2,"54":2,"55":2}}],["usestate",{"2":{"2":2,"3":2,"4":2,"5":2,"6":2,"7":3,"8":4,"9":2,"10":3,"11":2,"15":3,"16":3,"43":2,"44":2,"45":2,"47":2,"48":3,"49":4,"50":2,"51":3,"53":2,"57":3}}],["usehetree返回的allids包含所有节点的",{"2":{"48":1}}],["usehetree选项中包含许多回调函数",{"2":{"41":1}}],["usehetree是主要使用的函数",{"2":{"41":1}}],["usehetree还会返回一些内部状态和方法",{"2":{"40":1}}],["usehetree的返回是对象",{"2":{"20":1}}],["usehetree的返回",{"0":{"20":1}}],["usehetree的选项",{"2":{"18":1}}],["usehetree的选项的默认值",{"2":{"18":1}}],["usehetree",{"0":{"19":1},"1":{"20":1},"2":{"2":2,"3":2,"4":2,"5":2,"6":2,"7":2,"8":2,"9":2,"10":2,"11":2,"12":2,"13":2,"14":2,"15":2,"16":2,"18":1,"19":2,"40":3,"42":1,"43":2,"44":2,"45":2,"47":2,"48":2,"49":2,"50":2,"51":2,"53":2,"54":2,"55":2,"56":2,"57":2}}],["||",{"2":{"7":3,"8":1,"10":2,"11":1,"12":1,"13":1,"15":2,"16":2,"48":3,"49":1,"51":2,"53":1,"54":1,"55":1,"57":2}}],["|",{"2":{"7":1,"10":1,"13":1,"15":2,"16":2,"18":1,"25":1,"26":1,"30":1,"31":1,"32":2,"33":1,"34":1,"35":2,"48":1,"51":1,"55":1,"57":2}}],["展开全部",{"2":{"48":1}}],["展开",{"0":{"7":1},"2":{"48":1}}],["展开与折叠",{"2":{"0":1}}],["扁平数据和树形数据更新都很困难",{"2":{"52":1}}],["扁平数据的顺序必须跟树一样",{"2":{"39":1}}],["扁平数据",{"0":{"3":1,"43":1},"2":{"39":1,"41":1,"48":1,"49":1}}],["void表示继承父节点",{"2":{"19":2}}],["void",{"2":{"19":9,"33":1}}],["visibleids",{"2":{"20":1}}],["virtuallistref",{"2":{"20":1}}],["virtual",{"2":{"15":1,"16":1,"19":1,"57":1}}],["viewbox=",{"2":{"2":1}}],["variant",{"2":{"2":1}}],["object",{"2":{"36":4}}],["of遍历扁平数据的方法",{"2":{"28":1}}],["of遍历树形数据的方法",{"2":{"21":1}}],["of",{"2":{"21":1,"28":1,"35":1}}],["options",{"2":{"19":4,"20":1,"25":1,"26":1,"27":1,"30":1,"31":1,"32":1,"33":1,"34":1,"35":2}}],["open获取该节点的open状态",{"2":{"48":1}}],["openparentsintreedata",{"0":{"25":1},"2":{"18":1,"48":1}}],["openparentsinflatdata",{"0":{"30":1},"2":{"7":3,"18":1,"48":4}}],["openids",{"2":{"7":5,"10":4,"15":4,"16":4,"19":1,"25":1,"30":1,"48":5,"51":4,"57":4}}],["open",{"2":{"3":1,"4":1,"5":1,"7":6,"8":1,"9":1,"10":5,"14":1,"15":5,"16":5,"36":1,"43":1,"44":1,"45":1,"48":6,"49":1,"50":1,"51":5,"56":1,"57":5}}],["ondragend",{"2":{"19":1}}],["ondragover",{"2":{"19":1}}],["ondragopen",{"2":{"10":1,"19":1,"51":2}}],["ondragstart",{"2":{"19":1}}],["onexternaldrop",{"2":{"14":1,"19":1,"56":2}}],["onexternaldragover",{"2":{"14":1,"19":1,"56":2}}],["onclick=",{"2":{"7":5,"10":1,"11":3,"12":4,"13":4,"15":1,"16":2,"48":5,"51":1,"53":3,"54":4,"55":4,"57":1}}],["onchange=",{"2":{"8":1,"49":1}}],["onchange",{"2":{"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1,"9":1,"10":1,"11":1,"12":1,"13":1,"14":1,"15":1,"16":1,"19":1,"41":1,"43":1,"44":1,"45":1,"47":1,"48":1,"49":1,"50":1,"51":1,"53":1,"54":1,"55":1,"56":1,"57":1}}],["org",{"2":{"2":1}}],["withself表示是否包括传入的节点",{"2":{"35":1}}],["withself",{"2":{"35":2}}],["width",{"2":{"2":3,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1,"9":1,"10":1,"11":1,"12":1,"13":1,"14":1,"15":1,"16":1,"43":1,"44":1,"45":1,"47":1,"48":1,"49":1,"50":1,"51":1,"53":1,"54":1,"55":1,"56":1,"57":1}}],["walkparentsgenerator",{"0":{"35":1},"2":{"18":1,"35":1}}],["walkflatdatagenerator",{"0":{"28":1},"2":{"18":1,"28":1}}],["walkflatdata",{"0":{"29":1},"2":{"18":1}}],["walktreedatagenerator",{"0":{"21":1},"2":{"18":1,"21":1}}],["walktreedata",{"0":{"22":1},"2":{"18":1}}],["w3",{"2":{"2":1}}],["www",{"2":{"2":1}}],["xmlns=",{"2":{"2":1}}],["x3c",{"2":{"2":21,"3":4,"4":4,"5":6,"6":10,"7":15,"8":8,"9":4,"10":7,"11":13,"12":15,"13":15,"14":6,"15":10,"16":12,"40":2,"43":4,"44":4,"45":6,"46":9,"47":10,"48":15,"49":8,"50":4,"51":7,"53":13,"54":15,"55":15,"56":6,"57":10}}],["lt",{"2":{"46":2}}],["ltr",{"2":{"19":2}}],["lrt",{"2":{"19":1}}],["level=",{"2":{"46":1}}],["level",{"2":{"20":1,"36":1}}],["length",{"2":{"14":1,"15":1,"16":1,"56":1,"57":1}}],["let",{"2":{"11":3,"12":2,"13":2,"15":5,"16":5,"53":3,"54":2,"55":2,"57":5}}],["left",{"2":{"2":2,"6":1,"46":2,"47":1}}],["line",{"2":{"6":1,"47":1}}],["last",{"2":{"2":1}}],["el",{"2":{"35":2}}],["else",{"2":{"7":1,"10":1,"15":1,"16":1,"48":1,"51":1,"57":1}}],["exitwalk",{"2":{"21":1,"22":1,"23":1,"24":1,"28":1,"29":1}}],["export",{"2":{"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1,"9":1,"10":1,"11":1,"12":1,"13":1,"14":1,"15":1,"16":1,"40":1,"43":1,"44":1,"45":1,"47":1,"48":1,"49":1,"50":1,"51":1,"53":1,"54":1,"55":1,"56":1,"57":1}}],["event",{"2":{"19":6}}],["e",{"2":{"14":2,"56":2}}],["enter",{"2":{"12":1,"13":1,"54":1,"55":1}}],["edit",{"2":{"12":2,"13":2,"54":2,"55":2}}],["ebfeff",{"2":{"2":1}}],["e2e2e2",{"2":{"2":1}}],["eee",{"2":{"2":1,"6":1,"47":1}}],["`updatecheckedintreedata",{"2":{"49":1}}],["`",{"2":{"2":3,"6":2,"47":2}}],["`my",{"2":{"2":1}}],["$",{"2":{"2":1}}],["0px",{"2":{"2":2,"46":1}}],["0",{"2":{"2":11,"6":1,"8":1,"11":1,"12":1,"15":3,"16":3,"47":1,"49":1,"53":1,"54":1,"57":3}}],["minheight",{"2":{"46":1}}],["me",{"2":{"14":1,"56":1}}],["math",{"2":{"11":1,"12":1,"13":1,"53":1,"54":1,"55":1}}],["margin",{"2":{"2":3}}],["m21",{"2":{"2":1}}],["mytree",{"2":{"6":4,"47":4}}],["mynode",{"2":{"6":2,"47":2}}],["my",{"2":{"2":10,"6":1,"47":1}}],[">scroll",{"2":{"16":1}}],[">edit",{"2":{"12":1,"13":1,"54":1,"55":1}}],[">restore",{"2":{"11":1,"12":1,"13":1,"53":1,"54":1,"55":1}}],[">+",{"2":{"11":1,"12":1,"13":1,"53":1,"54":1,"55":1}}],[">👉",{"2":{"11":1,"12":1,"13":1,"53":1,"54":1,"55":1}}],[">only",{"2":{"7":1,"48":1}}],[">open",{"2":{"7":2,"48":2}}],[">close",{"2":{"7":1,"48":1}}],[">drag",{"2":{"5":1,"14":1,"45":1,"56":1}}],[">draggable",{"2":{"2":1}}],[">drop",{"2":{"2":1,"6":1,"47":1}}],[">",{"2":{"2":7,"6":2,"7":1,"8":4,"10":1,"11":1,"12":1,"13":1,"15":1,"16":1,"24":1,"46":3,"47":2,"48":1,"49":4,"51":1,"53":1,"54":1,"55":1,"57":1}}],["600",{"2":{"19":1,"51":1}}],["6",{"2":{"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1,"9":1,"10":1,"11":1,"12":1,"13":1,"14":1,"43":1,"44":1,"45":1,"47":1,"48":1,"49":1,"50":1,"51":1,"53":1,"54":1,"55":1,"56":1}}],["br",{"2":{"8":1,"49":1}}],["button>",{"2":{"5":1,"7":5,"10":1,"11":4,"12":5,"13":5,"14":1,"15":1,"16":2,"45":1,"48":5,"51":1,"53":4,"54":5,"55":5,"56":1,"57":1}}],["button",{"2":{"5":1,"7":5,"10":1,"11":4,"12":5,"13":5,"14":1,"15":1,"16":2,"45":1,"48":5,"51":1,"53":4,"54":5,"55":5,"56":1,"57":1}}],["background",{"2":{"2":5,"6":1,"47":1}}],["basepage",{"2":{"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1,"9":1,"10":1,"11":1,"12":1,"13":1,"14":1,"15":1,"16":1,"43":1,"44":1,"45":1,"47":1,"48":1,"49":1,"50":1,"51":1,"53":1,"54":1,"55":1,"56":1,"57":1}}],["blue",{"2":{"2":1,"46":1}}],["boolean",{"2":{"7":1,"8":1,"10":1,"15":1,"16":1,"19":7,"20":1,"26":1,"31":1,"35":1,"36":4,"48":1,"49":1,"51":1,"57":1}}],["bottom",{"2":{"2":1}}],["border",{"2":{"2":6,"3":1,"4":1,"5":1,"6":2,"7":1,"8":1,"9":1,"10":1,"11":1,"12":1,"13":1,"14":1,"15":1,"16":1,"43":1,"44":1,"45":1,"46":1,"47":2,"48":1,"49":1,"50":1,"51":1,"53":1,"54":1,"55":1,"56":1,"57":1}}],["box=",{"2":{"46":1}}],["box",{"0":{"47":1},"2":{"2":4,"6":2,"47":2}}],["biology",{"2":{"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1,"9":1,"10":1,"11":1,"12":1,"13":1,"14":1,"43":1,"44":1,"45":1,"47":1,"48":1,"49":1,"50":1,"51":1,"53":1,"54":1,"55":1,"56":1}}],["7",{"2":{"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1,"9":1,"10":1,"11":1,"12":1,"13":1,"14":1,"43":1,"44":1,"45":1,"46":1,"47":1,"48":1,"49":1,"50":1,"51":1,"53":1,"54":1,"55":1,"56":1}}],["30px",{"2":{"2":2,"6":2,"47":2}}],["300px",{"2":{"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1,"9":1,"10":1,"11":1,"12":1,"13":1,"14":1,"15":2,"16":2,"43":1,"44":1,"45":1,"47":1,"48":1,"49":1,"50":1,"51":1,"53":1,"54":1,"55":1,"56":1,"57":2}}],["3px",{"2":{"2":3}}],["3",{"2":{"2":3,"3":3,"4":1,"5":3,"6":3,"7":3,"8":3,"9":5,"10":4,"11":3,"12":3,"13":1,"14":3,"39":2,"43":3,"44":1,"45":3,"47":3,"48":3,"49":3,"50":5,"51":4,"53":3,"54":3,"55":1,"56":3}}],["8",{"2":{"2":1,"3":1,"4":1,"5":1,"6":1,"7":3,"8":1,"9":1,"10":1,"11":1,"12":1,"13":1,"14":1,"43":1,"44":1,"45":1,"47":1,"48":3,"49":1,"50":1,"51":1,"53":1,"54":1,"55":1,"56":1}}],["px",{"2":{"19":1}}],["push",{"2":{"15":4,"16":4,"57":4}}],["pid",{"2":{"11":2,"12":2,"13":6,"15":6,"16":6,"28":2,"29":1,"36":1,"39":4,"53":2,"54":2,"55":6,"57":6}}],["prototype",{"2":{"23":1,"24":1}}],["prompt",{"2":{"12":1,"13":1,"54":1,"55":1}}],["programming",{"2":{"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1,"9":1,"10":1,"11":1,"12":1,"13":1,"14":1,"43":1,"44":1,"45":1,"47":1,"48":1,"49":1,"50":1,"51":1,"53":1,"54":1,"55":1,"56":1}}],["prettier",{"2":{"5":1,"6":1,"7":1,"8":1,"9":1,"10":1,"11":1,"12":1,"13":1,"14":1,"15":1,"16":1,"19":1,"45":1,"47":1,"48":1,"49":1,"50":1,"51":1,"53":1,"54":1,"55":1,"56":1,"57":1}}],["position",{"2":{"2":2}}],["parseint",{"2":{"11":1,"12":1,"13":1,"53":1,"54":1,"55":1}}],["parentelement",{"2":{"35":1}}],["parentkeyorgetter可以是字符串或者返回父级的方法",{"2":{"35":1}}],["parentkeyorgetter",{"2":{"35":1}}],["parentid",{"2":{"32":1}}],["parentidkey",{"2":{"2":1,"3":1,"5":1,"6":1,"7":1,"8":1,"9":1,"10":1,"11":1,"12":1,"14":1,"15":1,"16":1,"19":1,"27":1,"28":1,"29":1,"30":1,"31":1,"32":1,"33":1,"34":1,"39":1,"41":1,"43":1,"45":1,"47":1,"48":1,"49":1,"50":1,"51":1,"53":1,"54":1,"56":1,"57":1}}],["parents",{"2":{"21":1,"22":1,"23":1,"24":1,"28":1,"29":1}}],["parentstat",{"2":{"14":2,"19":2,"20":1,"36":1,"56":2}}],["parent",{"2":{"2":10,"3":10,"5":10,"6":10,"7":10,"8":10,"9":9,"10":10,"11":11,"12":11,"14":11,"19":1,"21":1,"22":1,"23":1,"24":1,"28":2,"29":2,"30":1,"31":1,"32":1,"33":1,"34":1,"35":2,"36":1,"43":10,"45":10,"47":10,"48":10,"49":10,"50":9,"51":10,"53":11,"54":11,"56":11}}],["path",{"2":{"2":1}}],["padding",{"2":{"2":4,"3":1,"4":1,"5":1,"6":3,"7":1,"8":1,"9":1,"10":1,"11":1,"12":1,"13":1,"14":1,"15":1,"16":1,"43":1,"44":1,"45":1,"46":2,"47":3,"48":1,"49":1,"50":1,"51":1,"53":1,"54":1,"55":1,"56":1,"57":1}}],["placeholder",{"2":{"2":4,"6":2,"20":1,"46":1,"47":2}}],["physics",{"2":{"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1,"9":1,"10":1,"11":1,"12":1,"13":1,"14":1,"43":1,"44":1,"45":1,"47":1,"48":1,"49":1,"50":1,"51":1,"53":1,"54":1,"55":1,"56":1}}],["python",{"2":{"2":1,"3":1,"4":1,"5":1,"6":1,"7":3,"8":1,"9":1,"10":1,"11":1,"12":1,"13":1,"14":1,"43":1,"44":1,"45":1,"47":1,"48":5,"49":1,"50":1,"51":1,"53":1,"54":1,"55":1,"56":1}}],["40px",{"2":{"2":1}}],["4",{"2":{"2":2,"3":2,"4":1,"5":2,"6":2,"7":2,"8":2,"9":2,"10":2,"11":2,"12":2,"13":1,"14":2,"15":2,"16":2,"43":2,"44":1,"45":2,"46":1,"47":2,"48":3,"49":2,"50":2,"51":2,"53":2,"54":2,"55":1,"56":2,"57":2}}],["555",{"2":{"3":1,"4":1,"5":1,"6":1,"7":1,"8":1,"9":1,"10":1,"11":1,"12":1,"13":1,"14":1,"15":1,"16":1,"43":1,"44":1,"45":1,"47":1,"48":1,"49":1,"50":1,"51":1,"53":1,"54":1,"55":1,"56":1,"57":1}}],["5px",{"2":{"2":2,"6":2,"47":2}}],["5",{"2":{"2":2,"3":2,"4":1,"5":2,"6":2,"7":2,"8":2,"9":2,"10":2,"11":3,"12":3,"13":2,"14":2,"43":2,"44":1,"45":2,"47":2,"48":2,"49":2,"50":2,"51":2,"53":3,"54":3,"55":2,"56":2}}],["24",{"2":{"2":2}}],["20",{"2":{"19":1}}],["2000",{"2":{"2":1}}],["20px",{"2":{"2":3,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1,"9":1,"10":1,"11":1,"12":1,"13":1,"14":1,"15":1,"16":1,"43":1,"44":1,"45":1,"46":1,"47":1,"48":1,"49":1,"50":1,"51":1,"53":1,"54":1,"55":1,"56":1,"57":1}}],["2",{"2":{"2":3,"3":3,"4":1,"5":3,"6":3,"7":3,"8":3,"9":5,"10":3,"11":4,"12":4,"13":2,"14":3,"39":3,"43":3,"44":1,"45":3,"47":3,"48":3,"49":4,"50":5,"51":3,"53":4,"54":4,"55":2,"56":3}}],["cssproperties",{"2":{"20":1}}],["customdragimage",{"2":{"19":1,"59":1}}],["current",{"2":{"11":3,"12":3,"13":3,"53":3,"54":3,"55":3}}],["cursor",{"2":{"2":1}}],["createdata",{"2":{"15":2,"16":2,"57":2}}],["candroptoroot",{"2":{"9":1,"50":2}}],["candrop",{"2":{"9":1,"19":1,"41":1,"50":2}}],["candrag",{"2":{"9":1,"19":1,"50":2}}],["category",{"2":{"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1,"10":1,"11":1,"12":1,"13":1,"14":1,"43":1,"44":1,"45":1,"47":1,"48":1,"49":1,"51":1,"53":1,"54":1,"55":1,"56":1}}],["checkbox",{"2":{"8":1,"49":1}}],["checked获取该节点的checked状态",{"2":{"49":1}}],["checked=",{"2":{"8":1,"49":1}}],["checkedids",{"2":{"8":4,"19":1,"26":1,"31":1,"49":4}}],["checked",{"2":{"3":1,"4":1,"5":1,"7":1,"8":7,"9":1,"10":1,"14":1,"15":1,"16":1,"26":1,"31":1,"36":1,"43":1,"44":1,"45":1,"48":1,"49":7,"50":1,"51":1,"56":1,"57":1}}],["childstats",{"2":{"36":1}}],["childids",{"2":{"36":1}}],["children不是固定的",{"2":{"39":1}}],["childrenkey表明你的数据中的对应键名",{"2":{"39":1}}],["childrenkey",{"2":{"4":1,"13":1,"19":1,"25":1,"26":1,"41":1,"44":1,"55":1}}],["children",{"2":{"4":10,"13":21,"19":1,"21":1,"22":1,"23":1,"24":1,"36":1,"39":2,"44":10,"55":21}}],["child",{"2":{"2":1}}],["center",{"2":{"2":5,"6":1,"47":1}}],["ccc",{"2":{"2":1}}],["classname",{"2":{"2":1,"6":1,"20":1,"47":1}}],["classname=",{"2":{"2":4,"6":2,"46":1,"47":2}}],["convertindextotreeindexinflatdata",{"0":{"32":1},"2":{"18":1}}],["content",{"2":{"2":2}}],["const",{"2":{"2":3,"3":3,"4":2,"5":3,"6":3,"7":5,"8":7,"9":3,"10":5,"11":6,"12":7,"13":9,"14":4,"15":7,"16":7,"19":1,"21":1,"28":1,"35":1,"40":1,"42":1,"43":3,"44":2,"45":3,"47":3,"48":5,"49":7,"50":3,"51":5,"53":6,"54":7,"55":9,"56":4,"57":7}}],["color",{"2":{"2":5,"6":1,"47":1}}],["components",{"2":{"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1,"9":1,"10":1,"11":1,"12":1,"13":1,"14":1,"43":1,"44":1,"45":1,"47":1,"48":1,"49":1,"50":1,"51":1,"53":1,"54":1,"55":1,"56":1}}],["computer",{"2":{"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1,"9":1,"10":1,"11":1,"12":1,"13":1,"14":1,"43":1,"44":1,"45":1,"47":1,"48":1,"49":1,"50":1,"51":1,"53":1,"54":1,"55":1,"56":1}}],["npmpnpmyarn",{"2":{"38":1,"52":1}}],["newsemicheckedids",{"2":{"26":1,"31":1}}],["newcheckedids",{"2":{"26":1,"31":1}}],["newopenids",{"2":{"25":1,"30":1}}],["newnode",{"2":{"14":2,"33":1,"56":2}}],["newname",{"2":{"12":3,"13":3,"54":3,"55":3}}],["new",{"2":{"11":1,"12":2,"13":2,"14":1,"53":1,"54":2,"55":2,"56":1}}],["newdata",{"2":{"11":6,"19":1,"53":6}}],["number",{"2":{"11":2,"12":2,"15":2,"16":2,"18":1,"19":2,"36":2,"53":2,"54":2,"57":2}}],["null代表没有父级",{"2":{"39":1}}],["null",{"2":{"2":1,"3":1,"5":1,"6":1,"7":1,"8":1,"10":1,"11":1,"12":1,"13":1,"14":2,"15":3,"16":3,"19":4,"32":2,"33":1,"34":1,"36":3,"39":1,"43":1,"45":1,"47":1,"48":1,"49":1,"51":1,"53":1,"54":1,"55":1,"56":2,"57":3}}],["not",{"2":{"2":1}}],["no",{"2":{"2":3}}],["node可以获取节点数据",{"2":{"42":1}}],["nodebox",{"2":{"19":1}}],["nodes",{"2":{"15":1,"16":1,"24":1,"57":1}}],["node",{"0":{"47":1},"2":{"2":8,"3":2,"4":2,"5":2,"6":3,"7":2,"8":2,"9":2,"10":2,"11":2,"12":4,"13":8,"14":3,"15":1,"16":1,"21":1,"22":1,"23":2,"24":2,"28":1,"29":1,"35":2,"36":1,"42":2,"43":2,"44":2,"45":2,"46":4,"47":3,"48":2,"49":2,"50":2,"51":2,"53":2,"54":4,"55":8,"56":3,"57":1}}],["name",{"2":{"2":10,"3":10,"4":10,"5":10,"6":10,"7":10,"8":10,"9":9,"10":10,"11":11,"12":13,"13":13,"14":11,"43":10,"44":10,"45":10,"46":1,"47":10,"48":10,"49":10,"50":9,"51":10,"53":11,"54":13,"55":13,"56":11}}],["13h3v15h21v13z",{"2":{"2":1}}],["11h3v9h21v11m21",{"2":{"2":1}}],["110px",{"2":{"2":1}}],["16px",{"2":{"2":1}}],["19",{"2":{"2":1}}],["1px",{"2":{"2":5,"3":1,"4":1,"5":1,"6":2,"7":1,"8":1,"9":1,"10":1,"11":1,"12":1,"13":1,"14":1,"15":1,"16":1,"43":1,"44":1,"45":1,"46":1,"47":2,"48":1,"49":1,"50":1,"51":1,"53":1,"54":1,"55":1,"56":1,"57":1}}],["1000",{"2":{"15":1,"16":1,"57":1}}],["10000",{"2":{"15":1,"16":1,"57":1}}],["100",{"2":{"2":1,"14":1,"56":1}}],["10px",{"2":{"2":2}}],["10",{"2":{"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1,"9":1,"10":1,"11":1,"12":1,"13":1,"14":1,"43":1,"44":1,"45":1,"47":1,"48":1,"49":1,"50":1,"51":1,"53":1,"54":1,"55":1,"56":1}}],["1",{"2":{"2":3,"3":3,"4":1,"5":3,"6":3,"7":3,"8":4,"9":2,"10":4,"11":3,"12":3,"13":2,"14":3,"23":1,"24":1,"36":1,"39":3,"43":3,"44":1,"45":3,"46":2,"47":3,"48":3,"49":4,"50":2,"51":4,"53":3,"54":3,"55":2,"56":3}}],["shyarn",{"2":{"38":1,"52":1}}],["shpnpm",{"2":{"38":1,"52":1}}],["shnpm",{"2":{"38":1,"52":1}}],["shadow",{"2":{"2":1}}],["skipchildren",{"2":{"21":1,"22":1,"23":1,"24":1,"28":1,"29":1}}],["siblingids",{"2":{"36":1}}],["siblingstats",{"2":{"36":1}}],["siblings",{"2":{"21":1,"22":1,"23":1,"24":1,"36":1}}],["size",{"2":{"2":1}}],["scrolltonode",{"2":{"16":2,"20":1,"59":1}}],["science及子节点可以放入",{"2":{"50":1}}],["science及子节点不可以拖拽",{"2":{"50":1}}],["science",{"2":{"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1,"9":1,"10":1,"11":1,"12":1,"13":1,"14":1,"43":1,"44":1,"45":1,"47":1,"48":1,"49":1,"50":1,"51":1,"53":1,"54":1,"55":1,"56":1}}],["splice",{"2":{"13":1,"55":1}}],["span>",{"2":{"2":1}}],["span",{"2":{"2":1}}],["substring",{"2":{"11":1,"12":1,"13":1,"53":1,"54":1,"55":1}}],["semi",{"2":{"8":1,"49":1}}],["semicheckedids",{"2":{"8":2,"49":2}}],["setdragimage自定义",{"2":{"19":1}}],["setdata",{"2":{"2":2,"3":2,"4":2,"5":2,"6":2,"7":2,"8":2,"9":2,"10":2,"11":5,"12":6,"13":6,"14":3,"15":2,"16":2,"43":2,"44":2,"45":2,"47":2,"48":2,"49":2,"50":2,"51":2,"53":5,"54":6,"55":6,"56":3,"57":2}}],["setsemicheckedids",{"2":{"8":2,"49":2}}],["setcheckedids",{"2":{"8":2,"49":2}}],["setopenids",{"2":{"7":7,"10":3,"15":3,"16":3,"48":7,"51":3,"57":3}}],["svg>",{"2":{"2":1}}],["svg",{"2":{"2":3}}],["small",{"2":{"2":1}}],["sorteddata",{"2":{"27":1}}],["sortflatdata",{"0":{"27":1},"2":{"2":2,"3":2,"5":2,"6":2,"7":2,"8":2,"9":2,"10":2,"11":2,"12":2,"14":2,"15":2,"16":2,"18":1,"43":2,"45":2,"47":2,"48":2,"49":2,"50":2,"51":2,"53":2,"54":2,"56":2,"57":2}}],["solid",{"2":{"2":2,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1,"9":1,"10":1,"11":1,"12":1,"13":1,"14":1,"15":1,"16":1,"43":1,"44":1,"45":1,"47":1,"48":1,"49":1,"50":1,"51":1,"53":1,"54":1,"55":1,"56":1,"57":1}}],["string",{"2":{"18":1,"19":4,"20":1,"25":2,"26":2,"27":2,"35":1}}],["stringify",{"2":{"8":2,"49":2}}],["style",{"2":{"3":1,"4":1,"5":1,"6":1,"7":1,"8":1,"9":1,"10":1,"11":1,"12":1,"13":1,"14":1,"15":1,"16":1,"20":1,"43":1,"44":1,"45":1,"47":1,"48":1,"49":1,"50":1,"51":1,"53":1,"54":1,"55":1,"56":1,"57":1}}],["style>",{"2":{"2":2,"6":2,"47":2}}],["style=",{"2":{"2":1,"46":2}}],["stat包括和节点有关的信息",{"2":{"36":1}}],["states",{"2":{"20":1}}],["stat",{"0":{"36":1},"2":{"2":3,"6":2,"10":2,"18":1,"19":12,"20":8,"36":7,"42":2,"46":1,"47":2,"51":2}}],["isstat",{"2":{"36":1}}],["isoutside",{"2":{"19":2}}],["isexternal表示此次拖拽是否来自外部",{"2":{"19":1}}],["isexternal",{"2":{"19":1}}],["isfunctionreactive可用来控制是否监听这些回调函数的改变",{"2":{"41":1}}],["isfunctionreactive",{"2":{"19":1,"41":1}}],["isplaceholder",{"2":{"2":2,"6":2,"19":1,"46":2,"47":2}}],["i++",{"2":{"15":1,"16":1,"57":1}}],["image",{"2":{"19":1,"59":1}}],["immer",{"0":{"12":1,"13":1,"54":1,"55":1},"2":{"12":1,"13":1,"14":1,"52":6,"54":1,"55":1,"56":1}}],["import",{"2":{"2":1,"3":1,"4":1,"5":1,"6":1,"7":2,"8":2,"9":1,"10":2,"11":2,"12":3,"13":3,"14":1,"15":2,"16":2,"43":1,"44":1,"45":1,"47":1,"48":2,"49":2,"50":1,"51":2,"53":2,"54":3,"55":3,"56":1,"57":2}}],["install",{"2":{"38":1,"52":1}}],["indent",{"2":{"19":1}}],["indexinsiblings",{"2":{"32":1}}],["index",{"2":{"9":1,"14":2,"19":3,"20":1,"21":1,"22":1,"23":1,"24":1,"28":1,"29":1,"33":1,"36":1,"50":1,"56":2}}],["in",{"2":{"14":1,"56":1}}],["initialdata",{"2":{"11":4,"12":4,"13":4,"53":4,"54":4,"55":4}}],["input",{"2":{"8":1,"49":1}}],["i",{"2":{"7":2,"10":2,"15":4,"16":4,"48":2,"51":2,"57":4}}],["if",{"2":{"7":1,"10":1,"12":1,"13":1,"15":1,"16":1,"48":1,"51":1,"54":1,"55":1,"57":1}}],["ignore",{"2":{"5":1,"6":1,"7":1,"8":1,"9":1,"10":1,"11":1,"12":1,"13":1,"14":1,"15":1,"16":1,"19":1,"45":1,"47":1,"48":1,"49":1,"50":1,"51":1,"53":1,"54":1,"55":1,"56":1,"57":1}}],["items",{"2":{"2":3}}],["idorids",{"2":{"25":1,"26":1,"30":1,"31":1}}],["idornodeorstat",{"2":{"20":2}}],["id2",{"2":{"15":3,"16":3,"57":3}}],["id1",{"2":{"15":3,"16":3,"57":3}}],["id",{"2":{"2":20,"3":21,"4":10,"5":21,"6":20,"7":29,"8":29,"9":26,"10":30,"11":32,"12":37,"13":30,"14":25,"15":15,"16":15,"18":3,"19":7,"20":5,"23":1,"24":1,"25":3,"26":3,"28":4,"29":3,"30":5,"31":5,"32":5,"33":3,"34":3,"36":9,"39":7,"41":1,"43":21,"44":10,"45":21,"47":20,"48":30,"49":31,"50":26,"51":30,"53":32,"54":37,"55":30,"56":25,"57":15,"59":1}}],["idkey",{"2":{"2":1,"3":1,"5":1,"6":1,"7":1,"8":1,"9":1,"10":1,"11":1,"12":1,"13":1,"14":1,"15":1,"16":1,"19":1,"25":1,"26":1,"27":1,"28":1,"29":1,"30":1,"31":1,"32":1,"33":1,"34":1,"41":1,"43":1,"45":1,"47":1,"48":1,"49":1,"50":1,"51":1,"53":1,"54":1,"55":1,"56":1,"57":1}}],["===",{"2":{"9":4,"12":1,"13":4,"23":1,"50":4,"54":1,"55":4}}],["==",{"2":{"7":1,"10":1,"15":1,"16":1,"48":1,"51":1,"57":1}}],["=>",{"2":{"2":2,"3":2,"4":2,"5":2,"6":2,"7":9,"8":4,"9":5,"10":5,"11":7,"12":13,"13":16,"14":5,"15":6,"16":7,"22":1,"23":1,"24":1,"29":1,"35":1,"43":2,"44":2,"45":2,"46":1,"47":2,"48":9,"49":4,"50":5,"51":5,"53":7,"54":13,"55":16,"56":5,"57":6}}],["=",{"2":{"2":3,"3":3,"4":2,"5":3,"6":3,"7":5,"8":7,"9":3,"10":5,"11":10,"12":11,"13":13,"14":4,"15":12,"16":12,"19":12,"20":2,"23":1,"24":1,"35":1,"40":1,"42":1,"43":3,"44":2,"45":3,"46":1,"47":3,"48":5,"49":7,"50":3,"51":5,"53":10,"54":11,"55":13,"56":4,"57":12}}],["foundnode",{"2":{"23":1}}],["for",{"2":{"15":3,"16":3,"35":1,"57":3}}],["font",{"2":{"2":1}}],["findindex",{"2":{"13":1,"55":1}}],["findtreedata方法类似数组的find方法",{"2":{"55":1}}],["findtreedata",{"0":{"23":1},"2":{"13":4,"18":1,"23":1,"55":4}}],["find",{"2":{"12":1,"23":1,"54":1}}],["filtertreedata",{"0":{"24":1},"2":{"18":1,"24":1}}],["filter",{"2":{"7":1,"10":1,"15":1,"16":1,"24":1,"48":1,"51":1,"57":1}}],["false",{"2":{"8":1,"9":3,"19":4,"49":1,"50":3}}],["f0f0f0",{"2":{"2":2}}],["flex",{"2":{"2":3}}],["flatdata",{"2":{"27":1,"28":1,"29":1,"30":1,"31":1,"32":1,"33":1,"34":1}}],["flat",{"2":{"2":1,"3":1,"5":1,"6":1,"7":1,"8":1,"9":1,"10":1,"11":1,"12":1,"14":1,"15":1,"16":1,"19":2,"41":1,"43":1,"45":1,"47":1,"48":1,"49":1,"50":1,"51":1,"53":1,"54":1,"56":1,"57":1}}],["f3ffff",{"2":{"2":1}}],["function",{"2":{"2":2,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1,"9":1,"10":1,"11":1,"12":1,"13":1,"14":1,"15":2,"16":2,"19":1,"40":1,"43":1,"44":1,"45":1,"47":1,"48":1,"49":1,"50":1,"51":1,"53":1,"54":1,"55":1,"56":1,"57":2}}],["from",{"2":{"2":2,"3":2,"4":2,"5":2,"6":2,"7":3,"8":3,"9":2,"10":3,"11":3,"12":4,"13":4,"14":2,"15":3,"16":3,"19":1,"40":1,"43":2,"44":2,"45":2,"47":2,"48":3,"49":3,"50":2,"51":3,"53":3,"54":4,"55":4,"56":2,"57":3}}],["document",{"2":{"35":1}}],["d=",{"2":{"2":1}}],["direction",{"2":{"19":1,"59":1}}],["display",{"2":{"2":3}}],["div>node",{"2":{"46":1}}],["div>",{"2":{"2":5,"3":4,"4":4,"5":4,"6":5,"7":4,"8":4,"9":4,"10":4,"11":4,"12":4,"13":4,"14":4,"15":4,"16":4,"40":2,"43":4,"44":4,"45":4,"46":5,"47":5,"48":4,"49":4,"50":4,"51":4,"53":4,"54":4,"55":4,"56":4,"57":4}}],["div",{"2":{"2":3,"6":3,"35":1,"46":7,"47":3}}],["dashed",{"2":{"2":1,"6":1,"46":1,"47":1}}],["datatransfer",{"2":{"19":1}}],["datatype",{"2":{"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1,"9":1,"10":1,"11":1,"12":1,"13":1,"14":1,"15":1,"16":1,"19":1,"41":1,"43":1,"44":1,"45":1,"47":1,"48":1,"49":1,"50":1,"51":1,"53":1,"54":1,"55":1,"56":1,"57":1}}],["data>",{"2":{"11":1,"12":1,"13":1,"53":1,"54":1,"55":1}}],["data",{"2":{"2":2,"3":2,"4":2,"5":2,"6":4,"7":4,"8":3,"9":2,"10":2,"11":5,"12":3,"13":3,"14":3,"15":2,"16":2,"19":1,"21":1,"22":1,"23":1,"24":1,"43":2,"44":2,"45":2,"46":3,"47":4,"48":4,"49":3,"50":2,"51":2,"53":5,"54":3,"55":3,"56":3,"57":2}}],["defaultprops",{"2":{"18":1}}],["default",{"2":{"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1,"9":1,"10":1,"11":1,"12":1,"13":1,"14":1,"15":1,"16":1,"40":1,"43":1,"44":1,"45":1,"47":1,"48":1,"49":1,"50":1,"51":1,"53":1,"54":1,"55":1,"56":1,"57":1}}],["draft",{"2":{"12":6,"13":6,"14":2,"54":6,"55":6,"56":2}}],["dragoverstat",{"2":{"20":1}}],["dragopendelay",{"2":{"19":1,"51":1}}],["dragopen",{"2":{"10":1,"19":1,"51":2}}],["draggingstat",{"2":{"20":1}}],["dragging",{"2":{"2":4}}],["draggable",{"2":{"2":1,"5":2,"7":1,"8":1,"9":1,"10":1,"11":2,"12":2,"13":2,"14":1,"15":1,"16":1,"36":1,"45":2,"48":1,"49":1,"50":1,"51":1,"53":2,"54":2,"55":2,"56":1,"57":1}}],["draggable=",{"2":{"2":1,"5":1,"11":1,"12":1,"13":1,"14":1,"45":1,"46":1,"53":1,"54":1,"55":1,"56":1}}],["dragicon",{"2":{"2":2}}],["drag",{"2":{"0":1,"2":3,"6":2,"19":1,"46":1,"47":2,"58":3,"59":1}}],["drop",{"2":{"0":1,"58":3}}],["right",{"2":{"46":1}}],["random",{"2":{"11":1,"12":1,"13":1,"53":1,"54":1,"55":1}}],["radius",{"2":{"2":3}}],["r",{"2":{"8":3,"49":3}}],["rgb",{"2":{"2":1}}],["ref",{"2":{"20":2}}],["result",{"2":{"15":7,"16":7,"57":7}}],["removeddata",{"2":{"34":1}}],["removeid",{"2":{"34":1}}],["remove",{"2":{"11":2,"12":2,"13":2,"53":2,"54":2,"55":2}}],["removebyidinflatdata",{"0":{"34":1},"2":{"11":2,"12":2,"18":1,"53":3,"54":2}}],["red",{"2":{"6":1,"47":1}}],["relative",{"2":{"2":1}}],["return",{"2":{"2":2,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1,"9":1,"10":1,"11":1,"12":1,"13":1,"14":1,"15":2,"16":2,"19":1,"23":1,"24":1,"40":1,"43":1,"44":1,"45":1,"47":1,"48":1,"49":1,"50":1,"51":1,"53":1,"54":1,"55":1,"56":1,"57":2}}],["rendernode",{"2":{"3":1,"4":1,"5":1,"7":1,"8":1,"9":1,"10":1,"11":1,"12":1,"13":1,"14":1,"15":1,"16":1,"19":1,"43":1,"44":1,"45":1,"46":1,"48":1,"49":1,"50":1,"51":1,"53":1,"54":1,"55":1,"56":1,"57":1}}],["rendernodebox",{"2":{"2":1,"6":1,"19":1,"41":1,"47":1}}],["rendertree",{"2":{"2":2,"3":2,"4":2,"5":2,"6":2,"7":2,"8":2,"9":2,"10":2,"11":2,"12":2,"13":2,"14":2,"15":2,"16":2,"20":1,"40":2,"43":2,"44":2,"45":2,"47":2,"48":2,"49":2,"50":2,"51":2,"53":2,"54":2,"55":2,"56":2,"57":2}}],["reactnode",{"2":{"19":2,"20":1}}],["react",{"2":{"2":2,"3":2,"4":2,"5":2,"6":2,"7":3,"8":3,"9":2,"10":3,"11":3,"12":3,"13":3,"14":1,"15":3,"16":3,"18":1,"19":2,"20":1,"38":3,"40":1,"41":1,"43":2,"44":2,"45":2,"47":2,"48":3,"49":3,"50":2,"51":3,"52":1,"53":3,"54":4,"55":4,"56":1,"57":3}}],["rootstats",{"2":{"20":1}}],["rootnodes",{"2":{"20":1}}],["rootids",{"2":{"20":1}}],["rootid",{"2":{"19":1,"59":1}}],["root",{"2":{"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1,"10":1,"11":1,"12":1,"13":1,"14":1,"43":1,"44":1,"45":1,"47":1,"48":1,"49":1,"51":1,"53":1,"54":1,"55":1,"56":1}}],["rtl",{"2":{"0":1,"19":2}}],["tsxrendernodebox",{"2":{"46":1}}],["tsximport",{"2":{"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1,"9":1,"10":1,"11":1,"12":1,"13":1,"14":1,"15":1,"16":1,"43":1,"44":1,"45":1,"47":1,"48":1,"49":1,"50":1,"51":1,"53":1,"54":1,"55":1,"56":1,"57":1}}],["ts",{"2":{"42":1}}],["tswalkflatdata",{"2":{"29":1}}],["tswalktreedatagenerator",{"2":{"22":1}}],["tslet",{"2":{"23":1,"24":1,"35":1}}],["tsfor",{"2":{"21":1,"28":1}}],["tsimport",{"2":{"19":1}}],["the",{"2":{"14":1,"56":1}}],["t",{"2":{"13":2,"55":2}}],["to",{"2":{"14":1,"16":1,"56":1}}],["tostring",{"2":{"11":1,"12":1,"13":1,"53":1,"54":1,"55":1}}],["top",{"2":{"2":1}}],["true",{"2":{"9":2,"10":2,"14":2,"15":1,"16":1,"35":1,"46":2,"50":2,"51":2,"56":2,"57":1}}],["treeindex是节点在整个树中的索引",{"2":{"28":1}}],["treeindex",{"2":{"28":2,"29":1,"32":1}}],["treedata",{"2":{"25":1,"26":1}}],["tree",{"2":{"2":4,"3":1,"4":2,"5":1,"6":2,"7":2,"8":2,"9":1,"10":2,"11":2,"12":2,"13":3,"14":2,"15":2,"16":2,"19":2,"38":3,"39":1,"40":1,"41":1,"43":1,"44":2,"45":1,"46":1,"47":2,"48":2,"49":2,"50":1,"51":2,"53":2,"54":2,"55":3,"56":2,"57":2}}],["typescript",{"2":{"18":2}}],["typeof",{"2":{"11":1,"12":1,"13":1,"53":1,"54":1,"55":1}}],["type=",{"2":{"8":1,"49":1}}],["type",{"2":{"7":1,"8":1,"10":1,"11":1,"12":1,"13":1,"15":1,"16":1,"48":1,"49":1,"51":1,"53":1,"54":1,"55":1,"57":1}}],["text",{"2":{"6":1,"47":1}}],["technology及子节点不可以放入",{"2":{"50":1}}],["technology及子节点可以拖拽",{"2":{"50":1}}],["technology",{"2":{"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1,"9":1,"10":1,"11":1,"12":1,"13":1,"14":1,"43":1,"44":1,"45":1,"47":1,"48":1,"49":1,"50":1,"51":1,"53":1,"54":1,"55":1,"56":1}}],["title>",{"2":{"2":1}}],["title>drag",{"2":{"2":1}}],["hook",{"2":{"18":1,"19":1,"40":1}}],["horizontal",{"2":{"2":1}}],["hover",{"2":{"2":3,"6":1,"47":1}}],["http",{"2":{"2":1}}],["html5",{"2":{"58":1}}],["htmlelement",{"2":{"35":1}}],["html",{"0":{"46":1},"2":{"0":1,"46":2}}],["h3>",{"2":{"2":1}}],["h3",{"2":{"2":1}}],["handlechecked",{"2":{"8":2,"49":2}}],["handleopen",{"2":{"7":2,"10":3,"15":2,"16":2,"48":2,"51":3,"57":2}}],["handler",{"2":{"2":3}}],["hardware",{"2":{"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1,"9":1,"10":1,"11":1,"12":1,"13":1,"14":1,"43":1,"44":1,"45":1,"47":1,"48":1,"49":1,"50":1,"51":1,"53":1,"54":1,"55":1,"56":1}}],["hetreeprops",{"2":{"18":1}}],["height",{"2":{"2":2,"6":2,"15":1,"16":1,"47":2,"57":1}}],["here",{"2":{"2":1,"6":1,"47":1}}],["he",{"2":{"2":1,"3":1,"4":1,"5":1,"6":2,"7":2,"8":2,"9":1,"10":2,"11":2,"12":2,"13":2,"14":1,"15":2,"16":2,"19":1,"38":3,"40":1,"43":1,"44":1,"45":1,"46":1,"47":2,"48":2,"49":2,"50":1,"51":2,"53":2,"54":2,"55":2,"56":1,"57":2}}],["源代码",{"2":{"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1,"9":1,"10":1,"11":1,"12":1,"13":1,"14":1,"15":1,"16":1}}],["示例",{"0":{"1":1},"1":{"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1,"9":1,"10":1,"11":1,"12":1,"13":1,"14":1,"15":1,"16":1}}],["虚拟列表组件的",{"2":{"20":1}}],["虚拟列表",{"0":{"15":1},"2":{"0":1}}],["半选",{"2":{"0":1,"49":1}}],["勾选",{"0":{"8":1},"2":{"0":1}}],["拖拽到树外时",{"2":{"59":1}}],["拖拽到其上面的节点",{"2":{"20":1}}],["拖拽到节点上时打开节点的回调",{"2":{"19":1}}],["拖拽到节点上时打开节点的等待时间",{"2":{"19":1}}],["拖拽到节点上时打开节点",{"0":{"51":1},"2":{"19":1}}],["拖拽到节点上时展开它",{"2":{"0":1}}],["拖拽时占位节点的信息",{"2":{"20":1}}],["拖拽时打开",{"0":{"10":1}}],["拖拽时显示一个占位元素指示位置",{"2":{"0":1}}],["拖拽控制",{"0":{"9":1}}],["支持外部拖拽",{"2":{"0":1}}],["同时支持扁平数据和树形数据",{"2":{"0":1}}],["amp",{"0":{"58":1}}],["area",{"2":{"46":1}}],["array",{"2":{"19":3,"23":1,"24":1}}],["app",{"2":{"40":1}}],["api",{"0":{"17":1},"1":{"18":1,"19":1,"20":1,"21":1,"22":1,"23":1,"24":1,"25":1,"26":1,"27":1,"28":1,"29":1,"30":1,"31":1,"32":1,"33":1,"34":1,"35":1,"36":1},"2":{"0":1,"41":1,"42":1,"58":3}}],["as",{"2":{"11":2,"12":2,"53":2,"54":2}}],["add",{"2":{"11":2,"12":2,"13":2,"38":2,"52":2,"53":2,"54":2,"55":2}}],["addtoflatdata",{"0":{"33":1},"2":{"11":2,"12":2,"14":2,"18":1,"53":3,"54":2,"56":2}}],["all",{"2":{"7":2,"48":2}}],["allids",{"2":{"7":5,"10":3,"14":1,"15":3,"16":3,"20":1,"48":5,"51":3,"56":1,"57":3}}],["align",{"2":{"2":3,"6":1,"47":1}}],["absolute",{"2":{"2":1}}],["attrslist",{"2":{"20":1}}],["attrs",{"2":{"2":3,"6":3,"19":1,"20":1,"46":3,"47":3}}],["and",{"2":{"0":1,"58":3}}],["功能",{"0":{"0":1}}]],"serializationVersion":2}';export{e as default}; diff --git a/assets/chunks/VPLocalSearchBox.CYXDraNv.js b/assets/chunks/VPLocalSearchBox.CYXDraNv.js new file mode 100644 index 0000000..2d1a367 --- /dev/null +++ b/assets/chunks/VPLocalSearchBox.CYXDraNv.js @@ -0,0 +1,13 @@ +function __vite__mapDeps(indexes) { + if (!__vite__mapDeps.viteFileDeps) { + __vite__mapDeps.viteFileDeps = [] + } + return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) +} +var It=Object.defineProperty;var Dt=(o,e,t)=>e in o?It(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t;var _e=(o,e,t)=>(Dt(o,typeof e!="symbol"?e+"":e,t),t);import{Y as $e,h as oe,y as We,aj as kt,ak as _t,d as Ot,H as xe,al as rt,k as Fe,am as Rt,an as Mt,z as Lt,ao as Pt,l as Oe,U as de,S as Ee,ap as zt,aq as Vt,Z as Bt,j as $t,ar as Wt,o as ee,b as Kt,m as k,a2 as Jt,p as j,as as Ut,at as jt,au as Gt,c as re,n as at,e as Se,G as nt,F as it,a as ve,t as pe,av as qt,q as Ht,s as Qt,aw as ot,ax as Yt,a9 as Zt,af as Xt,ay as er,_ as tr}from"./framework.BthLuVtL.js";import{u as rr,c as ar}from"./theme.Dl8hKFPF.js";const nr={root:()=>$e(()=>import("./@localSearchIndexroot.BUIZjLrr.js"),__vite__mapDeps([])),zh:()=>$e(()=>import("./@localSearchIndexzh.CJ3ezlAn.js"),__vite__mapDeps([]))};/*! +* tabbable 6.2.0 +* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE +*/var mt=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],Ne=mt.join(","),gt=typeof Element>"u",ue=gt?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Ce=!gt&&Element.prototype.getRootNode?function(o){var e;return o==null||(e=o.getRootNode)===null||e===void 0?void 0:e.call(o)}:function(o){return o==null?void 0:o.ownerDocument},Ie=function o(e,t){var r;t===void 0&&(t=!0);var n=e==null||(r=e.getAttribute)===null||r===void 0?void 0:r.call(e,"inert"),a=n===""||n==="true",i=a||t&&e&&o(e.parentNode);return i},ir=function(e){var t,r=e==null||(t=e.getAttribute)===null||t===void 0?void 0:t.call(e,"contenteditable");return r===""||r==="true"},bt=function(e,t,r){if(Ie(e))return[];var n=Array.prototype.slice.apply(e.querySelectorAll(Ne));return t&&ue.call(e,Ne)&&n.unshift(e),n=n.filter(r),n},wt=function o(e,t,r){for(var n=[],a=Array.from(e);a.length;){var i=a.shift();if(!Ie(i,!1))if(i.tagName==="SLOT"){var s=i.assignedElements(),u=s.length?s:i.children,l=o(u,!0,r);r.flatten?n.push.apply(n,l):n.push({scopeParent:i,candidates:l})}else{var h=ue.call(i,Ne);h&&r.filter(i)&&(t||!e.includes(i))&&n.push(i);var d=i.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(i),v=!Ie(d,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(i));if(d&&v){var y=o(d===!0?i.children:d.children,!0,r);r.flatten?n.push.apply(n,y):n.push({scopeParent:i,candidates:y})}else a.unshift.apply(a,i.children)}}return n},xt=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},se=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||ir(e))&&!xt(e)?0:e.tabIndex},or=function(e,t){var r=se(e);return r<0&&t&&!xt(e)?0:r},sr=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},Ft=function(e){return e.tagName==="INPUT"},ur=function(e){return Ft(e)&&e.type==="hidden"},lr=function(e){var t=e.tagName==="DETAILS"&&Array.prototype.slice.apply(e.children).some(function(r){return r.tagName==="SUMMARY"});return t},cr=function(e,t){for(var r=0;rsummary:first-of-type"),i=a?e.parentElement:e;if(ue.call(i,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="legacy-full"){if(typeof n=="function"){for(var s=e;e;){var u=e.parentElement,l=Ce(e);if(u&&!u.shadowRoot&&n(u)===!0)return st(e);e.assignedSlot?e=e.assignedSlot:!u&&l!==e.ownerDocument?e=l.host:e=u}e=s}if(vr(e))return!e.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return st(e);return!1},yr=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if(t.tagName==="FIELDSET"&&t.disabled){for(var r=0;r=0)},gr=function o(e){var t=[],r=[];return e.forEach(function(n,a){var i=!!n.scopeParent,s=i?n.scopeParent:n,u=or(s,i),l=i?o(n.candidates):s;u===0?i?t.push.apply(t,l):t.push(s):r.push({documentOrder:a,tabIndex:u,item:n,isScope:i,content:l})}),r.sort(sr).reduce(function(n,a){return a.isScope?n.push.apply(n,a.content):n.push(a.content),n},[]).concat(t)},br=function(e,t){t=t||{};var r;return t.getShadowRoot?r=wt([e],t.includeContainer,{filter:Ke.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:mr}):r=bt(e,t.includeContainer,Ke.bind(null,t)),gr(r)},wr=function(e,t){t=t||{};var r;return t.getShadowRoot?r=wt([e],t.includeContainer,{filter:De.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):r=bt(e,t.includeContainer,De.bind(null,t)),r},le=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return ue.call(e,Ne)===!1?!1:Ke(t,e)},xr=mt.concat("iframe").join(","),Re=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return ue.call(e,xr)===!1?!1:De(t,e)};/*! +* focus-trap 7.5.4 +* @license MIT, https://github.com/focus-trap/focus-trap/blob/master/LICENSE +*/function ut(o,e){var t=Object.keys(o);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(o);e&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(o,n).enumerable})),t.push.apply(t,r)}return t}function lt(o){for(var e=1;e0){var r=e[e.length-1];r!==t&&r.pause()}var n=e.indexOf(t);n===-1||e.splice(n,1),e.push(t)},deactivateTrap:function(e,t){var r=e.indexOf(t);r!==-1&&e.splice(r,1),e.length>0&&e[e.length-1].unpause()}},Ar=function(e){return e.tagName&&e.tagName.toLowerCase()==="input"&&typeof e.select=="function"},Tr=function(e){return(e==null?void 0:e.key)==="Escape"||(e==null?void 0:e.key)==="Esc"||(e==null?void 0:e.keyCode)===27},ge=function(e){return(e==null?void 0:e.key)==="Tab"||(e==null?void 0:e.keyCode)===9},Nr=function(e){return ge(e)&&!e.shiftKey},Cr=function(e){return ge(e)&&e.shiftKey},ft=function(e){return setTimeout(e,0)},ht=function(e,t){var r=-1;return e.every(function(n,a){return t(n)?(r=a,!1):!0}),r},ye=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n1?p-1:0),I=1;I=0)c=r.activeElement;else{var f=i.tabbableGroups[0],p=f&&f.firstTabbableNode;c=p||h("fallbackFocus")}if(!c)throw new Error("Your focus-trap needs to have at least one focusable element");return c},v=function(){if(i.containerGroups=i.containers.map(function(c){var f=br(c,a.tabbableOptions),p=wr(c,a.tabbableOptions),C=f.length>0?f[0]:void 0,I=f.length>0?f[f.length-1]:void 0,M=p.find(function(m){return le(m)}),P=p.slice().reverse().find(function(m){return le(m)}),z=!!f.find(function(m){return se(m)>0});return{container:c,tabbableNodes:f,focusableNodes:p,posTabIndexesFound:z,firstTabbableNode:C,lastTabbableNode:I,firstDomTabbableNode:M,lastDomTabbableNode:P,nextTabbableNode:function(x){var $=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,K=f.indexOf(x);return K<0?$?p.slice(p.indexOf(x)+1).find(function(q){return le(q)}):p.slice(0,p.indexOf(x)).reverse().find(function(q){return le(q)}):f[K+($?1:-1)]}}}),i.tabbableGroups=i.containerGroups.filter(function(c){return c.tabbableNodes.length>0}),i.tabbableGroups.length<=0&&!h("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");if(i.containerGroups.find(function(c){return c.posTabIndexesFound})&&i.containerGroups.length>1)throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.")},y=function w(c){var f=c.activeElement;if(f)return f.shadowRoot&&f.shadowRoot.activeElement!==null?w(f.shadowRoot):f},b=function w(c){if(c!==!1&&c!==y(document)){if(!c||!c.focus){w(d());return}c.focus({preventScroll:!!a.preventScroll}),i.mostRecentlyFocusedNode=c,Ar(c)&&c.select()}},E=function(c){var f=h("setReturnFocus",c);return f||(f===!1?!1:c)},g=function(c){var f=c.target,p=c.event,C=c.isBackward,I=C===void 0?!1:C;f=f||Ae(p),v();var M=null;if(i.tabbableGroups.length>0){var P=l(f,p),z=P>=0?i.containerGroups[P]:void 0;if(P<0)I?M=i.tabbableGroups[i.tabbableGroups.length-1].lastTabbableNode:M=i.tabbableGroups[0].firstTabbableNode;else if(I){var m=ht(i.tabbableGroups,function(V){var U=V.firstTabbableNode;return f===U});if(m<0&&(z.container===f||Re(f,a.tabbableOptions)&&!le(f,a.tabbableOptions)&&!z.nextTabbableNode(f,!1))&&(m=P),m>=0){var x=m===0?i.tabbableGroups.length-1:m-1,$=i.tabbableGroups[x];M=se(f)>=0?$.lastTabbableNode:$.lastDomTabbableNode}else ge(p)||(M=z.nextTabbableNode(f,!1))}else{var K=ht(i.tabbableGroups,function(V){var U=V.lastTabbableNode;return f===U});if(K<0&&(z.container===f||Re(f,a.tabbableOptions)&&!le(f,a.tabbableOptions)&&!z.nextTabbableNode(f))&&(K=P),K>=0){var q=K===i.tabbableGroups.length-1?0:K+1,H=i.tabbableGroups[q];M=se(f)>=0?H.firstTabbableNode:H.firstDomTabbableNode}else ge(p)||(M=z.nextTabbableNode(f))}}else M=h("fallbackFocus");return M},S=function(c){var f=Ae(c);if(!(l(f,c)>=0)){if(ye(a.clickOutsideDeactivates,c)){s.deactivate({returnFocus:a.returnFocusOnDeactivate});return}ye(a.allowOutsideClick,c)||c.preventDefault()}},T=function(c){var f=Ae(c),p=l(f,c)>=0;if(p||f instanceof Document)p&&(i.mostRecentlyFocusedNode=f);else{c.stopImmediatePropagation();var C,I=!0;if(i.mostRecentlyFocusedNode)if(se(i.mostRecentlyFocusedNode)>0){var M=l(i.mostRecentlyFocusedNode),P=i.containerGroups[M].tabbableNodes;if(P.length>0){var z=P.findIndex(function(m){return m===i.mostRecentlyFocusedNode});z>=0&&(a.isKeyForward(i.recentNavEvent)?z+1=0&&(C=P[z-1],I=!1))}}else i.containerGroups.some(function(m){return m.tabbableNodes.some(function(x){return se(x)>0})})||(I=!1);else I=!1;I&&(C=g({target:i.mostRecentlyFocusedNode,isBackward:a.isKeyBackward(i.recentNavEvent)})),b(C||i.mostRecentlyFocusedNode||d())}i.recentNavEvent=void 0},F=function(c){var f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;i.recentNavEvent=c;var p=g({event:c,isBackward:f});p&&(ge(c)&&c.preventDefault(),b(p))},L=function(c){if(Tr(c)&&ye(a.escapeDeactivates,c)!==!1){c.preventDefault(),s.deactivate();return}(a.isKeyForward(c)||a.isKeyBackward(c))&&F(c,a.isKeyBackward(c))},R=function(c){var f=Ae(c);l(f,c)>=0||ye(a.clickOutsideDeactivates,c)||ye(a.allowOutsideClick,c)||(c.preventDefault(),c.stopImmediatePropagation())},B=function(){if(i.active)return ct.activateTrap(n,s),i.delayInitialFocusTimer=a.delayInitialFocus?ft(function(){b(d())}):b(d()),r.addEventListener("focusin",T,!0),r.addEventListener("mousedown",S,{capture:!0,passive:!1}),r.addEventListener("touchstart",S,{capture:!0,passive:!1}),r.addEventListener("click",R,{capture:!0,passive:!1}),r.addEventListener("keydown",L,{capture:!0,passive:!1}),s},N=function(){if(i.active)return r.removeEventListener("focusin",T,!0),r.removeEventListener("mousedown",S,!0),r.removeEventListener("touchstart",S,!0),r.removeEventListener("click",R,!0),r.removeEventListener("keydown",L,!0),s},O=function(c){var f=c.some(function(p){var C=Array.from(p.removedNodes);return C.some(function(I){return I===i.mostRecentlyFocusedNode})});f&&b(d())},A=typeof window<"u"&&"MutationObserver"in window?new MutationObserver(O):void 0,_=function(){A&&(A.disconnect(),i.active&&!i.paused&&i.containers.map(function(c){A.observe(c,{subtree:!0,childList:!0})}))};return s={get active(){return i.active},get paused(){return i.paused},activate:function(c){if(i.active)return this;var f=u(c,"onActivate"),p=u(c,"onPostActivate"),C=u(c,"checkCanFocusTrap");C||v(),i.active=!0,i.paused=!1,i.nodeFocusedBeforeActivation=r.activeElement,f==null||f();var I=function(){C&&v(),B(),_(),p==null||p()};return C?(C(i.containers.concat()).then(I,I),this):(I(),this)},deactivate:function(c){if(!i.active)return this;var f=lt({onDeactivate:a.onDeactivate,onPostDeactivate:a.onPostDeactivate,checkCanReturnFocus:a.checkCanReturnFocus},c);clearTimeout(i.delayInitialFocusTimer),i.delayInitialFocusTimer=void 0,N(),i.active=!1,i.paused=!1,_(),ct.deactivateTrap(n,s);var p=u(f,"onDeactivate"),C=u(f,"onPostDeactivate"),I=u(f,"checkCanReturnFocus"),M=u(f,"returnFocus","returnFocusOnDeactivate");p==null||p();var P=function(){ft(function(){M&&b(E(i.nodeFocusedBeforeActivation)),C==null||C()})};return M&&I?(I(E(i.nodeFocusedBeforeActivation)).then(P,P),this):(P(),this)},pause:function(c){if(i.paused||!i.active)return this;var f=u(c,"onPause"),p=u(c,"onPostPause");return i.paused=!0,f==null||f(),N(),_(),p==null||p(),this},unpause:function(c){if(!i.paused||!i.active)return this;var f=u(c,"onUnpause"),p=u(c,"onPostUnpause");return i.paused=!1,f==null||f(),v(),B(),_(),p==null||p(),this},updateContainerElements:function(c){var f=[].concat(c).filter(Boolean);return i.containers=f.map(function(p){return typeof p=="string"?r.querySelector(p):p}),i.active&&v(),_(),this}},s.updateContainerElements(e),s};function kr(o,e={}){let t;const{immediate:r,...n}=e,a=oe(!1),i=oe(!1),s=d=>t&&t.activate(d),u=d=>t&&t.deactivate(d),l=()=>{t&&(t.pause(),i.value=!0)},h=()=>{t&&(t.unpause(),i.value=!1)};return We(()=>kt(o),d=>{d&&(t=Dr(d,{...n,onActivate(){a.value=!0,e.onActivate&&e.onActivate()},onDeactivate(){a.value=!1,e.onDeactivate&&e.onDeactivate()}}),r&&s())},{flush:"post"}),_t(()=>u()),{hasFocus:a,isPaused:i,activate:s,deactivate:u,pause:l,unpause:h}}class fe{constructor(e,t=!0,r=[],n=5e3){this.ctx=e,this.iframes=t,this.exclude=r,this.iframesTimeout=n}static matches(e,t){const r=typeof t=="string"?[t]:t,n=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.oMatchesSelector||e.webkitMatchesSelector;if(n){let a=!1;return r.every(i=>n.call(e,i)?(a=!0,!1):!0),a}else return!1}getContexts(){let e,t=[];return typeof this.ctx>"u"||!this.ctx?e=[]:NodeList.prototype.isPrototypeOf(this.ctx)?e=Array.prototype.slice.call(this.ctx):Array.isArray(this.ctx)?e=this.ctx:typeof this.ctx=="string"?e=Array.prototype.slice.call(document.querySelectorAll(this.ctx)):e=[this.ctx],e.forEach(r=>{const n=t.filter(a=>a.contains(r)).length>0;t.indexOf(r)===-1&&!n&&t.push(r)}),t}getIframeContents(e,t,r=()=>{}){let n;try{const a=e.contentWindow;if(n=a.document,!a||!n)throw new Error("iframe inaccessible")}catch{r()}n&&t(n)}isIframeBlank(e){const t="about:blank",r=e.getAttribute("src").trim();return e.contentWindow.location.href===t&&r!==t&&r}observeIframeLoad(e,t,r){let n=!1,a=null;const i=()=>{if(!n){n=!0,clearTimeout(a);try{this.isIframeBlank(e)||(e.removeEventListener("load",i),this.getIframeContents(e,t,r))}catch{r()}}};e.addEventListener("load",i),a=setTimeout(i,this.iframesTimeout)}onIframeReady(e,t,r){try{e.contentWindow.document.readyState==="complete"?this.isIframeBlank(e)?this.observeIframeLoad(e,t,r):this.getIframeContents(e,t,r):this.observeIframeLoad(e,t,r)}catch{r()}}waitForIframes(e,t){let r=0;this.forEachIframe(e,()=>!0,n=>{r++,this.waitForIframes(n.querySelector("html"),()=>{--r||t()})},n=>{n||t()})}forEachIframe(e,t,r,n=()=>{}){let a=e.querySelectorAll("iframe"),i=a.length,s=0;a=Array.prototype.slice.call(a);const u=()=>{--i<=0&&n(s)};i||u(),a.forEach(l=>{fe.matches(l,this.exclude)?u():this.onIframeReady(l,h=>{t(l)&&(s++,r(h)),u()},u)})}createIterator(e,t,r){return document.createNodeIterator(e,t,r,!1)}createInstanceOnIframe(e){return new fe(e.querySelector("html"),this.iframes)}compareNodeIframe(e,t,r){const n=e.compareDocumentPosition(r),a=Node.DOCUMENT_POSITION_PRECEDING;if(n&a)if(t!==null){const i=t.compareDocumentPosition(r),s=Node.DOCUMENT_POSITION_FOLLOWING;if(i&s)return!0}else return!0;return!1}getIteratorNode(e){const t=e.previousNode();let r;return t===null?r=e.nextNode():r=e.nextNode()&&e.nextNode(),{prevNode:t,node:r}}checkIframeFilter(e,t,r,n){let a=!1,i=!1;return n.forEach((s,u)=>{s.val===r&&(a=u,i=s.handled)}),this.compareNodeIframe(e,t,r)?(a===!1&&!i?n.push({val:r,handled:!0}):a!==!1&&!i&&(n[a].handled=!0),!0):(a===!1&&n.push({val:r,handled:!1}),!1)}handleOpenIframes(e,t,r,n){e.forEach(a=>{a.handled||this.getIframeContents(a.val,i=>{this.createInstanceOnIframe(i).forEachNode(t,r,n)})})}iterateThroughNodes(e,t,r,n,a){const i=this.createIterator(t,e,n);let s=[],u=[],l,h,d=()=>({prevNode:h,node:l}=this.getIteratorNode(i),l);for(;d();)this.iframes&&this.forEachIframe(t,v=>this.checkIframeFilter(l,h,v,s),v=>{this.createInstanceOnIframe(v).forEachNode(e,y=>u.push(y),n)}),u.push(l);u.forEach(v=>{r(v)}),this.iframes&&this.handleOpenIframes(s,e,r,n),a()}forEachNode(e,t,r,n=()=>{}){const a=this.getContexts();let i=a.length;i||n(),a.forEach(s=>{const u=()=>{this.iterateThroughNodes(e,s,t,r,()=>{--i<=0&&n()})};this.iframes?this.waitForIframes(s,u):u()})}}let _r=class{constructor(e){this.ctx=e,this.ie=!1;const t=window.navigator.userAgent;(t.indexOf("MSIE")>-1||t.indexOf("Trident")>-1)&&(this.ie=!0)}set opt(e){this._opt=Object.assign({},{element:"",className:"",exclude:[],iframes:!1,iframesTimeout:5e3,separateWordSearch:!0,diacritics:!0,synonyms:{},accuracy:"partially",acrossElements:!1,caseSensitive:!1,ignoreJoiners:!1,ignoreGroups:0,ignorePunctuation:[],wildcards:"disabled",each:()=>{},noMatch:()=>{},filter:()=>!0,done:()=>{},debug:!1,log:window.console},e)}get opt(){return this._opt}get iterator(){return new fe(this.ctx,this.opt.iframes,this.opt.exclude,this.opt.iframesTimeout)}log(e,t="debug"){const r=this.opt.log;this.opt.debug&&typeof r=="object"&&typeof r[t]=="function"&&r[t](`mark.js: ${e}`)}escapeStr(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}createRegExp(e){return this.opt.wildcards!=="disabled"&&(e=this.setupWildcardsRegExp(e)),e=this.escapeStr(e),Object.keys(this.opt.synonyms).length&&(e=this.createSynonymsRegExp(e)),(this.opt.ignoreJoiners||this.opt.ignorePunctuation.length)&&(e=this.setupIgnoreJoinersRegExp(e)),this.opt.diacritics&&(e=this.createDiacriticsRegExp(e)),e=this.createMergedBlanksRegExp(e),(this.opt.ignoreJoiners||this.opt.ignorePunctuation.length)&&(e=this.createJoinersRegExp(e)),this.opt.wildcards!=="disabled"&&(e=this.createWildcardsRegExp(e)),e=this.createAccuracyRegExp(e),e}createSynonymsRegExp(e){const t=this.opt.synonyms,r=this.opt.caseSensitive?"":"i",n=this.opt.ignoreJoiners||this.opt.ignorePunctuation.length?"\0":"";for(let a in t)if(t.hasOwnProperty(a)){const i=t[a],s=this.opt.wildcards!=="disabled"?this.setupWildcardsRegExp(a):this.escapeStr(a),u=this.opt.wildcards!=="disabled"?this.setupWildcardsRegExp(i):this.escapeStr(i);s!==""&&u!==""&&(e=e.replace(new RegExp(`(${this.escapeStr(s)}|${this.escapeStr(u)})`,`gm${r}`),n+`(${this.processSynomyms(s)}|${this.processSynomyms(u)})`+n))}return e}processSynomyms(e){return(this.opt.ignoreJoiners||this.opt.ignorePunctuation.length)&&(e=this.setupIgnoreJoinersRegExp(e)),e}setupWildcardsRegExp(e){return e=e.replace(/(?:\\)*\?/g,t=>t.charAt(0)==="\\"?"?":""),e.replace(/(?:\\)*\*/g,t=>t.charAt(0)==="\\"?"*":"")}createWildcardsRegExp(e){let t=this.opt.wildcards==="withSpaces";return e.replace(/\u0001/g,t?"[\\S\\s]?":"\\S?").replace(/\u0002/g,t?"[\\S\\s]*?":"\\S*")}setupIgnoreJoinersRegExp(e){return e.replace(/[^(|)\\]/g,(t,r,n)=>{let a=n.charAt(r+1);return/[(|)\\]/.test(a)||a===""?t:t+"\0"})}createJoinersRegExp(e){let t=[];const r=this.opt.ignorePunctuation;return Array.isArray(r)&&r.length&&t.push(this.escapeStr(r.join(""))),this.opt.ignoreJoiners&&t.push("\\u00ad\\u200b\\u200c\\u200d"),t.length?e.split(/\u0000+/).join(`[${t.join("")}]*`):e}createDiacriticsRegExp(e){const t=this.opt.caseSensitive?"":"i",r=this.opt.caseSensitive?["aàáảãạăằắẳẵặâầấẩẫậäåāą","AÀÁẢÃẠĂẰẮẲẴẶÂẦẤẨẪẬÄÅĀĄ","cçćč","CÇĆČ","dđď","DĐĎ","eèéẻẽẹêềếểễệëěēę","EÈÉẺẼẸÊỀẾỂỄỆËĚĒĘ","iìíỉĩịîïī","IÌÍỈĨỊÎÏĪ","lł","LŁ","nñňń","NÑŇŃ","oòóỏõọôồốổỗộơởỡớờợöøō","OÒÓỎÕỌÔỒỐỔỖỘƠỞỠỚỜỢÖØŌ","rř","RŘ","sšśșş","SŠŚȘŞ","tťțţ","TŤȚŢ","uùúủũụưừứửữựûüůū","UÙÚỦŨỤƯỪỨỬỮỰÛÜŮŪ","yýỳỷỹỵÿ","YÝỲỶỸỴŸ","zžżź","ZŽŻŹ"]:["aàáảãạăằắẳẵặâầấẩẫậäåāąAÀÁẢÃẠĂẰẮẲẴẶÂẦẤẨẪẬÄÅĀĄ","cçćčCÇĆČ","dđďDĐĎ","eèéẻẽẹêềếểễệëěēęEÈÉẺẼẸÊỀẾỂỄỆËĚĒĘ","iìíỉĩịîïīIÌÍỈĨỊÎÏĪ","lłLŁ","nñňńNÑŇŃ","oòóỏõọôồốổỗộơởỡớờợöøōOÒÓỎÕỌÔỒỐỔỖỘƠỞỠỚỜỢÖØŌ","rřRŘ","sšśșşSŠŚȘŞ","tťțţTŤȚŢ","uùúủũụưừứửữựûüůūUÙÚỦŨỤƯỪỨỬỮỰÛÜŮŪ","yýỳỷỹỵÿYÝỲỶỸỴŸ","zžżźZŽŻŹ"];let n=[];return e.split("").forEach(a=>{r.every(i=>{if(i.indexOf(a)!==-1){if(n.indexOf(i)>-1)return!1;e=e.replace(new RegExp(`[${i}]`,`gm${t}`),`[${i}]`),n.push(i)}return!0})}),e}createMergedBlanksRegExp(e){return e.replace(/[\s]+/gmi,"[\\s]+")}createAccuracyRegExp(e){const t="!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~¡¿";let r=this.opt.accuracy,n=typeof r=="string"?r:r.value,a=typeof r=="string"?[]:r.limiters,i="";switch(a.forEach(s=>{i+=`|${this.escapeStr(s)}`}),n){case"partially":default:return`()(${e})`;case"complementary":return i="\\s"+(i||this.escapeStr(t)),`()([^${i}]*${e}[^${i}]*)`;case"exactly":return`(^|\\s${i})(${e})(?=$|\\s${i})`}}getSeparatedKeywords(e){let t=[];return e.forEach(r=>{this.opt.separateWordSearch?r.split(" ").forEach(n=>{n.trim()&&t.indexOf(n)===-1&&t.push(n)}):r.trim()&&t.indexOf(r)===-1&&t.push(r)}),{keywords:t.sort((r,n)=>n.length-r.length),length:t.length}}isNumeric(e){return Number(parseFloat(e))==e}checkRanges(e){if(!Array.isArray(e)||Object.prototype.toString.call(e[0])!=="[object Object]")return this.log("markRanges() will only accept an array of objects"),this.opt.noMatch(e),[];const t=[];let r=0;return e.sort((n,a)=>n.start-a.start).forEach(n=>{let{start:a,end:i,valid:s}=this.callNoMatchOnInvalidRanges(n,r);s&&(n.start=a,n.length=i-a,t.push(n),r=i)}),t}callNoMatchOnInvalidRanges(e,t){let r,n,a=!1;return e&&typeof e.start<"u"?(r=parseInt(e.start,10),n=r+parseInt(e.length,10),this.isNumeric(e.start)&&this.isNumeric(e.length)&&n-t>0&&n-r>0?a=!0:(this.log(`Ignoring invalid or overlapping range: ${JSON.stringify(e)}`),this.opt.noMatch(e))):(this.log(`Ignoring invalid range: ${JSON.stringify(e)}`),this.opt.noMatch(e)),{start:r,end:n,valid:a}}checkWhitespaceRanges(e,t,r){let n,a=!0,i=r.length,s=t-i,u=parseInt(e.start,10)-s;return u=u>i?i:u,n=u+parseInt(e.length,10),n>i&&(n=i,this.log(`End range automatically set to the max value of ${i}`)),u<0||n-u<0||u>i||n>i?(a=!1,this.log(`Invalid range: ${JSON.stringify(e)}`),this.opt.noMatch(e)):r.substring(u,n).replace(/\s+/g,"")===""&&(a=!1,this.log("Skipping whitespace only range: "+JSON.stringify(e)),this.opt.noMatch(e)),{start:u,end:n,valid:a}}getTextNodes(e){let t="",r=[];this.iterator.forEachNode(NodeFilter.SHOW_TEXT,n=>{r.push({start:t.length,end:(t+=n.textContent).length,node:n})},n=>this.matchesExclude(n.parentNode)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT,()=>{e({value:t,nodes:r})})}matchesExclude(e){return fe.matches(e,this.opt.exclude.concat(["script","style","title","head","html"]))}wrapRangeInTextNode(e,t,r){const n=this.opt.element?this.opt.element:"mark",a=e.splitText(t),i=a.splitText(r-t);let s=document.createElement(n);return s.setAttribute("data-markjs","true"),this.opt.className&&s.setAttribute("class",this.opt.className),s.textContent=a.textContent,a.parentNode.replaceChild(s,a),i}wrapRangeInMappedTextNode(e,t,r,n,a){e.nodes.every((i,s)=>{const u=e.nodes[s+1];if(typeof u>"u"||u.start>t){if(!n(i.node))return!1;const l=t-i.start,h=(r>i.end?i.end:r)-i.start,d=e.value.substr(0,i.start),v=e.value.substr(h+i.start);if(i.node=this.wrapRangeInTextNode(i.node,l,h),e.value=d+v,e.nodes.forEach((y,b)=>{b>=s&&(e.nodes[b].start>0&&b!==s&&(e.nodes[b].start-=h),e.nodes[b].end-=h)}),r-=h,a(i.node.previousSibling,i.start),r>i.end)t=i.end;else return!1}return!0})}wrapMatches(e,t,r,n,a){const i=t===0?0:t+1;this.getTextNodes(s=>{s.nodes.forEach(u=>{u=u.node;let l;for(;(l=e.exec(u.textContent))!==null&&l[i]!=="";){if(!r(l[i],u))continue;let h=l.index;if(i!==0)for(let d=1;d{let u;for(;(u=e.exec(s.value))!==null&&u[i]!=="";){let l=u.index;if(i!==0)for(let d=1;dr(u[i],d),(d,v)=>{e.lastIndex=v,n(d)})}a()})}wrapRangeFromIndex(e,t,r,n){this.getTextNodes(a=>{const i=a.value.length;e.forEach((s,u)=>{let{start:l,end:h,valid:d}=this.checkWhitespaceRanges(s,i,a.value);d&&this.wrapRangeInMappedTextNode(a,l,h,v=>t(v,s,a.value.substring(l,h),u),v=>{r(v,s)})}),n()})}unwrapMatches(e){const t=e.parentNode;let r=document.createDocumentFragment();for(;e.firstChild;)r.appendChild(e.removeChild(e.firstChild));t.replaceChild(r,e),this.ie?this.normalizeTextNode(t):t.normalize()}normalizeTextNode(e){if(e){if(e.nodeType===3)for(;e.nextSibling&&e.nextSibling.nodeType===3;)e.nodeValue+=e.nextSibling.nodeValue,e.parentNode.removeChild(e.nextSibling);else this.normalizeTextNode(e.firstChild);this.normalizeTextNode(e.nextSibling)}}markRegExp(e,t){this.opt=t,this.log(`Searching with expression "${e}"`);let r=0,n="wrapMatches";const a=i=>{r++,this.opt.each(i)};this.opt.acrossElements&&(n="wrapMatchesAcrossElements"),this[n](e,this.opt.ignoreGroups,(i,s)=>this.opt.filter(s,i,r),a,()=>{r===0&&this.opt.noMatch(e),this.opt.done(r)})}mark(e,t){this.opt=t;let r=0,n="wrapMatches";const{keywords:a,length:i}=this.getSeparatedKeywords(typeof e=="string"?[e]:e),s=this.opt.caseSensitive?"":"i",u=l=>{let h=new RegExp(this.createRegExp(l),`gm${s}`),d=0;this.log(`Searching with expression "${h}"`),this[n](h,1,(v,y)=>this.opt.filter(y,l,r,d),v=>{d++,r++,this.opt.each(v)},()=>{d===0&&this.opt.noMatch(l),a[i-1]===l?this.opt.done(r):u(a[a.indexOf(l)+1])})};this.opt.acrossElements&&(n="wrapMatchesAcrossElements"),i===0?this.opt.done(r):u(a[0])}markRanges(e,t){this.opt=t;let r=0,n=this.checkRanges(e);n&&n.length?(this.log("Starting to mark with the following ranges: "+JSON.stringify(n)),this.wrapRangeFromIndex(n,(a,i,s,u)=>this.opt.filter(a,i,s,u),(a,i)=>{r++,this.opt.each(a,i)},()=>{this.opt.done(r)})):this.opt.done(r)}unmark(e){this.opt=e;let t=this.opt.element?this.opt.element:"*";t+="[data-markjs]",this.opt.className&&(t+=`.${this.opt.className}`),this.log(`Removal selector "${t}"`),this.iterator.forEachNode(NodeFilter.SHOW_ELEMENT,r=>{this.unwrapMatches(r)},r=>{const n=fe.matches(r,t),a=this.matchesExclude(r);return!n||a?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT},this.opt.done)}};function Or(o){const e=new _r(o);return this.mark=(t,r)=>(e.mark(t,r),this),this.markRegExp=(t,r)=>(e.markRegExp(t,r),this),this.markRanges=(t,r)=>(e.markRanges(t,r),this),this.unmark=t=>(e.unmark(t),this),this}var W=function(){return W=Object.assign||function(e){for(var t,r=1,n=arguments.length;r0&&a[a.length-1])&&(l[0]===6||l[0]===2)){t=0;continue}if(l[0]===3&&(!a||l[1]>a[0]&&l[1]=o.length&&(o=void 0),{value:o&&o[r++],done:!o}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function J(o,e){var t=typeof Symbol=="function"&&o[Symbol.iterator];if(!t)return o;var r=t.call(o),n,a=[],i;try{for(;(e===void 0||e-- >0)&&!(n=r.next()).done;)a.push(n.value)}catch(s){i={error:s}}finally{try{n&&!n.done&&(t=r.return)&&t.call(r)}finally{if(i)throw i.error}}return a}var Lr="ENTRIES",Et="KEYS",St="VALUES",G="",Me=function(){function o(e,t){var r=e._tree,n=Array.from(r.keys());this.set=e,this._type=t,this._path=n.length>0?[{node:r,keys:n}]:[]}return o.prototype.next=function(){var e=this.dive();return this.backtrack(),e},o.prototype.dive=function(){if(this._path.length===0)return{done:!0,value:void 0};var e=ce(this._path),t=e.node,r=e.keys;if(ce(r)===G)return{done:!1,value:this.result()};var n=t.get(ce(r));return this._path.push({node:n,keys:Array.from(n.keys())}),this.dive()},o.prototype.backtrack=function(){if(this._path.length!==0){var e=ce(this._path).keys;e.pop(),!(e.length>0)&&(this._path.pop(),this.backtrack())}},o.prototype.key=function(){return this.set._prefix+this._path.map(function(e){var t=e.keys;return ce(t)}).filter(function(e){return e!==G}).join("")},o.prototype.value=function(){return ce(this._path).node.get(G)},o.prototype.result=function(){switch(this._type){case St:return this.value();case Et:return this.key();default:return[this.key(),this.value()]}},o.prototype[Symbol.iterator]=function(){return this},o}(),ce=function(o){return o[o.length-1]},Pr=function(o,e,t){var r=new Map;if(e===void 0)return r;for(var n=e.length+1,a=n+t,i=new Uint8Array(a*n).fill(t+1),s=0;st)continue e}At(o.get(y),e,t,r,n,E,i,s+y)}}}catch(f){u={error:f}}finally{try{v&&!v.done&&(l=d.return)&&l.call(d)}finally{if(u)throw u.error}}},Le=function(){function o(e,t){e===void 0&&(e=new Map),t===void 0&&(t=""),this._size=void 0,this._tree=e,this._prefix=t}return o.prototype.atPrefix=function(e){var t,r;if(!e.startsWith(this._prefix))throw new Error("Mismatched prefix");var n=J(ke(this._tree,e.slice(this._prefix.length)),2),a=n[0],i=n[1];if(a===void 0){var s=J(Ge(i),2),u=s[0],l=s[1];try{for(var h=D(u.keys()),d=h.next();!d.done;d=h.next()){var v=d.value;if(v!==G&&v.startsWith(l)){var y=new Map;return y.set(v.slice(l.length),u.get(v)),new o(y,e)}}}catch(b){t={error:b}}finally{try{d&&!d.done&&(r=h.return)&&r.call(h)}finally{if(t)throw t.error}}}return new o(a,e)},o.prototype.clear=function(){this._size=void 0,this._tree.clear()},o.prototype.delete=function(e){return this._size=void 0,zr(this._tree,e)},o.prototype.entries=function(){return new Me(this,Lr)},o.prototype.forEach=function(e){var t,r;try{for(var n=D(this),a=n.next();!a.done;a=n.next()){var i=J(a.value,2),s=i[0],u=i[1];e(s,u,this)}}catch(l){t={error:l}}finally{try{a&&!a.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}},o.prototype.fuzzyGet=function(e,t){return Pr(this._tree,e,t)},o.prototype.get=function(e){var t=Je(this._tree,e);return t!==void 0?t.get(G):void 0},o.prototype.has=function(e){var t=Je(this._tree,e);return t!==void 0&&t.has(G)},o.prototype.keys=function(){return new Me(this,Et)},o.prototype.set=function(e,t){if(typeof e!="string")throw new Error("key must be a string");this._size=void 0;var r=Pe(this._tree,e);return r.set(G,t),this},Object.defineProperty(o.prototype,"size",{get:function(){if(this._size)return this._size;this._size=0;for(var e=this.entries();!e.next().done;)this._size+=1;return this._size},enumerable:!1,configurable:!0}),o.prototype.update=function(e,t){if(typeof e!="string")throw new Error("key must be a string");this._size=void 0;var r=Pe(this._tree,e);return r.set(G,t(r.get(G))),this},o.prototype.fetch=function(e,t){if(typeof e!="string")throw new Error("key must be a string");this._size=void 0;var r=Pe(this._tree,e),n=r.get(G);return n===void 0&&r.set(G,n=t()),n},o.prototype.values=function(){return new Me(this,St)},o.prototype[Symbol.iterator]=function(){return this.entries()},o.from=function(e){var t,r,n=new o;try{for(var a=D(e),i=a.next();!i.done;i=a.next()){var s=J(i.value,2),u=s[0],l=s[1];n.set(u,l)}}catch(h){t={error:h}}finally{try{i&&!i.done&&(r=a.return)&&r.call(a)}finally{if(t)throw t.error}}return n},o.fromObject=function(e){return o.from(Object.entries(e))},o}(),ke=function(o,e,t){var r,n;if(t===void 0&&(t=[]),e.length===0||o==null)return[o,t];try{for(var a=D(o.keys()),i=a.next();!i.done;i=a.next()){var s=i.value;if(s!==G&&e.startsWith(s))return t.push([o,s]),ke(o.get(s),e.slice(s.length),t)}}catch(u){r={error:u}}finally{try{i&&!i.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}return t.push([o,e]),ke(void 0,"",t)},Je=function(o,e){var t,r;if(e.length===0||o==null)return o;try{for(var n=D(o.keys()),a=n.next();!a.done;a=n.next()){var i=a.value;if(i!==G&&e.startsWith(i))return Je(o.get(i),e.slice(i.length))}}catch(s){t={error:s}}finally{try{a&&!a.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}},Pe=function(o,e){var t,r,n=e.length;e:for(var a=0;o&&a0)throw new Error("Expected documents to be present. Omit the argument to remove all documents.");this._index=new Le,this._documentCount=0,this._documentIds=new Map,this._idToShortId=new Map,this._fieldLength=new Map,this._avgFieldLength=[],this._storedFields=new Map,this._nextId=0}},o.prototype.discard=function(e){var t=this,r=this._idToShortId.get(e);if(r==null)throw new Error("MiniSearch: cannot discard document with ID ".concat(e,": it is not in the index"));this._idToShortId.delete(e),this._documentIds.delete(r),this._storedFields.delete(r),(this._fieldLength.get(r)||[]).forEach(function(n,a){t.removeFieldLength(r,a,t._documentCount,n)}),this._fieldLength.delete(r),this._documentCount-=1,this._dirtCount+=1,this.maybeAutoVacuum()},o.prototype.maybeAutoVacuum=function(){if(this._options.autoVacuum!==!1){var e=this._options.autoVacuum,t=e.minDirtFactor,r=e.minDirtCount,n=e.batchSize,a=e.batchWait;this.conditionalVacuum({batchSize:n,batchWait:a},{minDirtCount:r,minDirtFactor:t})}},o.prototype.discardAll=function(e){var t,r,n=this._options.autoVacuum;try{this._options.autoVacuum=!1;try{for(var a=D(e),i=a.next();!i.done;i=a.next()){var s=i.value;this.discard(s)}}catch(u){t={error:u}}finally{try{i&&!i.done&&(r=a.return)&&r.call(a)}finally{if(t)throw t.error}}}finally{this._options.autoVacuum=n}this.maybeAutoVacuum()},o.prototype.replace=function(e){var t=this._options,r=t.idField,n=t.extractField,a=n(e,r);this.discard(a),this.add(e)},o.prototype.vacuum=function(e){return e===void 0&&(e={}),this.conditionalVacuum(e)},o.prototype.conditionalVacuum=function(e,t){var r=this;return this._currentVacuum?(this._enqueuedVacuumConditions=this._enqueuedVacuumConditions&&t,this._enqueuedVacuum!=null?this._enqueuedVacuum:(this._enqueuedVacuum=this._currentVacuum.then(function(){var n=r._enqueuedVacuumConditions;return r._enqueuedVacuumConditions=je,r.performVacuuming(e,n)}),this._enqueuedVacuum)):this.vacuumConditionsMet(t)===!1?Promise.resolve():(this._currentVacuum=this.performVacuuming(e),this._currentVacuum)},o.prototype.performVacuuming=function(e,t){return Rr(this,void 0,void 0,function(){var r,n,a,i,s,u,l,h,d,v,y,b,E,g,S,T,F,L,R,B,N,O,A,_,w;return Mr(this,function(c){switch(c.label){case 0:if(r=this._dirtCount,!this.vacuumConditionsMet(t))return[3,10];n=e.batchSize||Ue.batchSize,a=e.batchWait||Ue.batchWait,i=1,c.label=1;case 1:c.trys.push([1,7,8,9]),s=D(this._index),u=s.next(),c.label=2;case 2:if(u.done)return[3,6];l=J(u.value,2),h=l[0],d=l[1];try{for(v=(O=void 0,D(d)),y=v.next();!y.done;y=v.next()){b=J(y.value,2),E=b[0],g=b[1];try{for(S=(_=void 0,D(g)),T=S.next();!T.done;T=S.next())F=J(T.value,1),L=F[0],!this._documentIds.has(L)&&(g.size<=1?d.delete(E):g.delete(L))}catch(f){_={error:f}}finally{try{T&&!T.done&&(w=S.return)&&w.call(S)}finally{if(_)throw _.error}}}}catch(f){O={error:f}}finally{try{y&&!y.done&&(A=v.return)&&A.call(v)}finally{if(O)throw O.error}}return this._index.get(h).size===0&&this._index.delete(h),i%n!==0?[3,4]:[4,new Promise(function(f){return setTimeout(f,a)})];case 3:c.sent(),c.label=4;case 4:i+=1,c.label=5;case 5:return u=s.next(),[3,2];case 6:return[3,9];case 7:return R=c.sent(),B={error:R},[3,9];case 8:try{u&&!u.done&&(N=s.return)&&N.call(s)}finally{if(B)throw B.error}return[7];case 9:this._dirtCount-=r,c.label=10;case 10:return[4,null];case 11:return c.sent(),this._currentVacuum=this._enqueuedVacuum,this._enqueuedVacuum=null,[2]}})})},o.prototype.vacuumConditionsMet=function(e){if(e==null)return!0;var t=e.minDirtCount,r=e.minDirtFactor;return t=t||Be.minDirtCount,r=r||Be.minDirtFactor,this.dirtCount>=t&&this.dirtFactor>=r},Object.defineProperty(o.prototype,"isVacuuming",{get:function(){return this._currentVacuum!=null},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"dirtCount",{get:function(){return this._dirtCount},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"dirtFactor",{get:function(){return this._dirtCount/(1+this._documentCount+this._dirtCount)},enumerable:!1,configurable:!0}),o.prototype.has=function(e){return this._idToShortId.has(e)},o.prototype.getStoredFields=function(e){var t=this._idToShortId.get(e);if(t!=null)return this._storedFields.get(t)},o.prototype.search=function(e,t){var r,n;t===void 0&&(t={});var a=this.executeQuery(e,t),i=[];try{for(var s=D(a),u=s.next();!u.done;u=s.next()){var l=J(u.value,2),h=l[0],d=l[1],v=d.score,y=d.terms,b=d.match,E=y.length||1,g={id:this._documentIds.get(h),score:v*E,terms:Object.keys(b),queryTerms:y,match:b};Object.assign(g,this._storedFields.get(h)),(t.filter==null||t.filter(g))&&i.push(g)}}catch(S){r={error:S}}finally{try{u&&!u.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}return e===o.wildcard&&t.boostDocument==null&&this._options.searchOptions.boostDocument==null||i.sort(pt),i},o.prototype.autoSuggest=function(e,t){var r,n,a,i;t===void 0&&(t={}),t=W(W({},this._options.autoSuggestOptions),t);var s=new Map;try{for(var u=D(this.search(e,t)),l=u.next();!l.done;l=u.next()){var h=l.value,d=h.score,v=h.terms,y=v.join(" "),b=s.get(y);b!=null?(b.score+=d,b.count+=1):s.set(y,{score:d,terms:v,count:1})}}catch(R){r={error:R}}finally{try{l&&!l.done&&(n=u.return)&&n.call(u)}finally{if(r)throw r.error}}var E=[];try{for(var g=D(s),S=g.next();!S.done;S=g.next()){var T=J(S.value,2),b=T[0],F=T[1],d=F.score,v=F.terms,L=F.count;E.push({suggestion:b,terms:v,score:d/L})}}catch(R){a={error:R}}finally{try{S&&!S.done&&(i=g.return)&&i.call(g)}finally{if(a)throw a.error}}return E.sort(pt),E},Object.defineProperty(o.prototype,"documentCount",{get:function(){return this._documentCount},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"termCount",{get:function(){return this._index.size},enumerable:!1,configurable:!0}),o.loadJSON=function(e,t){if(t==null)throw new Error("MiniSearch: loadJSON should be given the same options used when serializing the index");return this.loadJS(JSON.parse(e),t)},o.getDefault=function(e){if(Ve.hasOwnProperty(e))return ze(Ve,e);throw new Error('MiniSearch: unknown option "'.concat(e,'"'))},o.loadJS=function(e,t){var r,n,a,i,s,u,l=e.index,h=e.documentCount,d=e.nextId,v=e.documentIds,y=e.fieldIds,b=e.fieldLength,E=e.averageFieldLength,g=e.storedFields,S=e.dirtCount,T=e.serializationVersion;if(T!==1&&T!==2)throw new Error("MiniSearch: cannot deserialize an index created with an incompatible version");var F=new o(t);F._documentCount=h,F._nextId=d,F._documentIds=Te(v),F._idToShortId=new Map,F._fieldIds=y,F._fieldLength=Te(b),F._avgFieldLength=E,F._storedFields=Te(g),F._dirtCount=S||0,F._index=new Le;try{for(var L=D(F._documentIds),R=L.next();!R.done;R=L.next()){var B=J(R.value,2),N=B[0],O=B[1];F._idToShortId.set(O,N)}}catch(z){r={error:z}}finally{try{R&&!R.done&&(n=L.return)&&n.call(L)}finally{if(r)throw r.error}}try{for(var A=D(l),_=A.next();!_.done;_=A.next()){var w=J(_.value,2),c=w[0],f=w[1],p=new Map;try{for(var C=(s=void 0,D(Object.keys(f))),I=C.next();!I.done;I=C.next()){var M=I.value,P=f[M];T===1&&(P=P.ds),p.set(parseInt(M,10),Te(P))}}catch(z){s={error:z}}finally{try{I&&!I.done&&(u=C.return)&&u.call(C)}finally{if(s)throw s.error}}F._index.set(c,p)}}catch(z){a={error:z}}finally{try{_&&!_.done&&(i=A.return)&&i.call(A)}finally{if(a)throw a.error}}return F},o.prototype.executeQuery=function(e,t){var r=this;if(t===void 0&&(t={}),e===o.wildcard)return this.executeWildcardQuery(t);if(typeof e!="string"){var n=W(W(W({},t),e),{queries:void 0}),a=e.queries.map(function(g){return r.executeQuery(g,n)});return this.combineResults(a,n.combineWith)}var i=this._options,s=i.tokenize,u=i.processTerm,l=i.searchOptions,h=W(W({tokenize:s,processTerm:u},l),t),d=h.tokenize,v=h.processTerm,y=d(e).flatMap(function(g){return v(g)}).filter(function(g){return!!g}),b=y.map(Jr(h)),E=b.map(function(g){return r.executeQuerySpec(g,h)});return this.combineResults(E,h.combineWith)},o.prototype.executeQuerySpec=function(e,t){var r,n,a,i,s=W(W({},this._options.searchOptions),t),u=(s.fields||this._options.fields).reduce(function(M,P){var z;return W(W({},M),(z={},z[P]=ze(s.boost,P)||1,z))},{}),l=s.boostDocument,h=s.weights,d=s.maxFuzzy,v=s.bm25,y=W(W({},dt.weights),h),b=y.fuzzy,E=y.prefix,g=this._index.get(e.term),S=this.termResults(e.term,e.term,1,g,u,l,v),T,F;if(e.prefix&&(T=this._index.atPrefix(e.term)),e.fuzzy){var L=e.fuzzy===!0?.2:e.fuzzy,R=L<1?Math.min(d,Math.round(e.term.length*L)):L;R&&(F=this._index.fuzzyGet(e.term,R))}if(T)try{for(var B=D(T),N=B.next();!N.done;N=B.next()){var O=J(N.value,2),A=O[0],_=O[1],w=A.length-e.term.length;if(w){F==null||F.delete(A);var c=E*A.length/(A.length+.3*w);this.termResults(e.term,A,c,_,u,l,v,S)}}}catch(M){r={error:M}}finally{try{N&&!N.done&&(n=B.return)&&n.call(B)}finally{if(r)throw r.error}}if(F)try{for(var f=D(F.keys()),p=f.next();!p.done;p=f.next()){var A=p.value,C=J(F.get(A),2),I=C[0],w=C[1];if(w){var c=b*A.length/(A.length+w);this.termResults(e.term,A,c,I,u,l,v,S)}}}catch(M){a={error:M}}finally{try{p&&!p.done&&(i=f.return)&&i.call(f)}finally{if(a)throw a.error}}return S},o.prototype.executeWildcardQuery=function(e){var t,r,n=new Map,a=W(W({},this._options.searchOptions),e);try{for(var i=D(this._documentIds),s=i.next();!s.done;s=i.next()){var u=J(s.value,2),l=u[0],h=u[1],d=a.boostDocument?a.boostDocument(h,"",this._storedFields.get(l)):1;n.set(l,{score:d,terms:[],match:{}})}}catch(v){t={error:v}}finally{try{s&&!s.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}return n},o.prototype.combineResults=function(e,t){if(t===void 0&&(t=qe),e.length===0)return new Map;var r=t.toLowerCase();return e.reduce($r[r])||new Map},o.prototype.toJSON=function(){var e,t,r,n,a=[];try{for(var i=D(this._index),s=i.next();!s.done;s=i.next()){var u=J(s.value,2),l=u[0],h=u[1],d={};try{for(var v=(r=void 0,D(h)),y=v.next();!y.done;y=v.next()){var b=J(y.value,2),E=b[0],g=b[1];d[E]=Object.fromEntries(g)}}catch(S){r={error:S}}finally{try{y&&!y.done&&(n=v.return)&&n.call(v)}finally{if(r)throw r.error}}a.push([l,d])}}catch(S){e={error:S}}finally{try{s&&!s.done&&(t=i.return)&&t.call(i)}finally{if(e)throw e.error}}return{documentCount:this._documentCount,nextId:this._nextId,documentIds:Object.fromEntries(this._documentIds),fieldIds:this._fieldIds,fieldLength:Object.fromEntries(this._fieldLength),averageFieldLength:this._avgFieldLength,storedFields:Object.fromEntries(this._storedFields),dirtCount:this._dirtCount,index:a,serializationVersion:2}},o.prototype.termResults=function(e,t,r,n,a,i,s,u){var l,h,d,v,y;if(u===void 0&&(u=new Map),n==null)return u;try{for(var b=D(Object.keys(a)),E=b.next();!E.done;E=b.next()){var g=E.value,S=a[g],T=this._fieldIds[g],F=n.get(T);if(F!=null){var L=F.size,R=this._avgFieldLength[T];try{for(var B=(d=void 0,D(F.keys())),N=B.next();!N.done;N=B.next()){var O=N.value;if(!this._documentIds.has(O)){this.removeTerm(T,O,t),L-=1;continue}var A=i?i(this._documentIds.get(O),t,this._storedFields.get(O)):1;if(A){var _=F.get(O),w=this._fieldLength.get(O)[T],c=Kr(_,L,this._documentCount,w,R,s),f=r*S*A*c,p=u.get(O);if(p){p.score+=f,jr(p.terms,e);var C=ze(p.match,t);C?C.push(g):p.match[t]=[g]}else u.set(O,{score:f,terms:[e],match:(y={},y[t]=[g],y)})}}}catch(I){d={error:I}}finally{try{N&&!N.done&&(v=B.return)&&v.call(B)}finally{if(d)throw d.error}}}}}catch(I){l={error:I}}finally{try{E&&!E.done&&(h=b.return)&&h.call(b)}finally{if(l)throw l.error}}return u},o.prototype.addTerm=function(e,t,r){var n=this._index.fetch(r,yt),a=n.get(e);if(a==null)a=new Map,a.set(t,1),n.set(e,a);else{var i=a.get(t);a.set(t,(i||0)+1)}},o.prototype.removeTerm=function(e,t,r){if(!this._index.has(r)){this.warnDocumentChanged(t,e,r);return}var n=this._index.fetch(r,yt),a=n.get(e);a==null||a.get(t)==null?this.warnDocumentChanged(t,e,r):a.get(t)<=1?a.size<=1?n.delete(e):a.delete(t):a.set(t,a.get(t)-1),this._index.get(r).size===0&&this._index.delete(r)},o.prototype.warnDocumentChanged=function(e,t,r){var n,a;try{for(var i=D(Object.keys(this._fieldIds)),s=i.next();!s.done;s=i.next()){var u=s.value;if(this._fieldIds[u]===t){this._options.logger("warn","MiniSearch: document with ID ".concat(this._documentIds.get(e),' has changed before removal: term "').concat(r,'" was not present in field "').concat(u,'". Removing a document after it has changed can corrupt the index!'),"version_conflict");return}}}catch(l){n={error:l}}finally{try{s&&!s.done&&(a=i.return)&&a.call(i)}finally{if(n)throw n.error}}},o.prototype.addDocumentId=function(e){var t=this._nextId;return this._idToShortId.set(e,t),this._documentIds.set(t,e),this._documentCount+=1,this._nextId+=1,t},o.prototype.addFields=function(e){for(var t=0;t(Ht("data-v-43c4f204"),o=o(),Qt(),o),Hr=["aria-owns"],Qr={class:"shell"},Yr=["title"],Zr=Y(()=>k("span",{"aria-hidden":"true",class:"vpi-search search-icon local-search-icon"},null,-1)),Xr=[Zr],ea={class:"search-actions before"},ta=["title"],ra=Y(()=>k("span",{class:"vpi-arrow-left local-search-icon"},null,-1)),aa=[ra],na=["placeholder"],ia={class:"search-actions"},oa=["title"],sa=Y(()=>k("span",{class:"vpi-layout-list local-search-icon"},null,-1)),ua=[sa],la=["disabled","title"],ca=Y(()=>k("span",{class:"vpi-delete local-search-icon"},null,-1)),fa=[ca],ha=["id","role","aria-labelledby"],da=["aria-selected"],va=["href","aria-label","onMouseenter","onFocusin"],pa={class:"titles"},ya=Y(()=>k("span",{class:"title-icon"},"#",-1)),ma=["innerHTML"],ga=Y(()=>k("span",{class:"vpi-chevron-right local-search-icon"},null,-1)),ba={class:"title main"},wa=["innerHTML"],xa={key:0,class:"excerpt-wrapper"},Fa={key:0,class:"excerpt",inert:""},Ea=["innerHTML"],Sa=Y(()=>k("div",{class:"excerpt-gradient-bottom"},null,-1)),Aa=Y(()=>k("div",{class:"excerpt-gradient-top"},null,-1)),Ta={key:0,class:"no-results"},Na={class:"search-keyboard-shortcuts"},Ca=["aria-label"],Ia=Y(()=>k("span",{class:"vpi-arrow-up navigate-icon"},null,-1)),Da=[Ia],ka=["aria-label"],_a=Y(()=>k("span",{class:"vpi-arrow-down navigate-icon"},null,-1)),Oa=[_a],Ra=["aria-label"],Ma=Y(()=>k("span",{class:"vpi-corner-down-left navigate-icon"},null,-1)),La=[Ma],Pa=["aria-label"],za=Ot({__name:"VPLocalSearchBox",emits:["close"],setup(o,{emit:e}){var P,z;const t=e,r=xe(),n=xe(),a=xe(nr),i=rr(),{activate:s}=kr(r,{immediate:!0,allowOutsideClick:!0,clickOutsideDeactivates:!0,escapeDeactivates:!0}),{localeIndex:u,theme:l}=i,h=rt(async()=>{var m,x,$,K,q,H,V,U,Z;return ot(Br.loadJSON(($=await((x=(m=a.value)[u.value])==null?void 0:x.call(m)))==null?void 0:$.default,{fields:["title","titles","text"],storeFields:["title","titles"],searchOptions:{fuzzy:.2,prefix:!0,boost:{title:4,text:2,titles:1},...((K=l.value.search)==null?void 0:K.provider)==="local"&&((H=(q=l.value.search.options)==null?void 0:q.miniSearch)==null?void 0:H.searchOptions)},...((V=l.value.search)==null?void 0:V.provider)==="local"&&((Z=(U=l.value.search.options)==null?void 0:U.miniSearch)==null?void 0:Z.options)}))}),v=Fe(()=>{var m,x;return((m=l.value.search)==null?void 0:m.provider)==="local"&&((x=l.value.search.options)==null?void 0:x.disableQueryPersistence)===!0}).value?oe(""):Rt("vitepress:local-search-filter",""),y=Mt("vitepress:local-search-detailed-list",((P=l.value.search)==null?void 0:P.provider)==="local"&&((z=l.value.search.options)==null?void 0:z.detailedView)===!0),b=Fe(()=>{var m,x,$;return((m=l.value.search)==null?void 0:m.provider)==="local"&&(((x=l.value.search.options)==null?void 0:x.disableDetailedView)===!0||(($=l.value.search.options)==null?void 0:$.detailedView)===!1)}),E=Fe(()=>{var x,$,K,q,H,V,U;const m=((x=l.value.search)==null?void 0:x.options)??l.value.algolia;return((H=(q=(K=($=m==null?void 0:m.locales)==null?void 0:$[u.value])==null?void 0:K.translations)==null?void 0:q.button)==null?void 0:H.buttonText)||((U=(V=m==null?void 0:m.translations)==null?void 0:V.button)==null?void 0:U.buttonText)||"Search"});Lt(()=>{b.value&&(y.value=!1)});const g=xe([]),S=oe(!1);We(v,()=>{S.value=!1});const T=rt(async()=>{if(n.value)return ot(new Or(n.value))},null),F=new qr(16);Pt(()=>[h.value,v.value,y.value],async([m,x,$],K,q)=>{var be,He,Qe,Ye;(K==null?void 0:K[0])!==m&&F.clear();let H=!1;if(q(()=>{H=!0}),!m)return;g.value=m.search(x).slice(0,16),S.value=!0;const V=$?await Promise.all(g.value.map(Q=>L(Q.id))):[];if(H)return;for(const{id:Q,mod:ae}of V){const ne=Q.slice(0,Q.indexOf("#"));let te=F.get(ne);if(te)continue;te=new Map,F.set(ne,te);const X=ae.default??ae;if(X!=null&&X.render||X!=null&&X.setup){const ie=Yt(X);ie.config.warnHandler=()=>{},ie.provide(Zt,i),Object.defineProperties(ie.config.globalProperties,{$frontmatter:{get(){return i.frontmatter.value}},$params:{get(){return i.page.value.params}}});const Ze=document.createElement("div");ie.mount(Ze),Ze.querySelectorAll("h1, h2, h3, h4, h5, h6").forEach(he=>{var tt;const we=(tt=he.querySelector("a"))==null?void 0:tt.getAttribute("href"),Xe=(we==null?void 0:we.startsWith("#"))&&we.slice(1);if(!Xe)return;let et="";for(;(he=he.nextElementSibling)&&!/^h[1-6]$/i.test(he.tagName);)et+=he.outerHTML;te.set(Xe,et)}),ie.unmount()}if(H)return}const U=new Set;if(g.value=g.value.map(Q=>{const[ae,ne]=Q.id.split("#"),te=F.get(ae),X=(te==null?void 0:te.get(ne))??"";for(const ie in Q.match)U.add(ie);return{...Q,text:X}}),await de(),H)return;await new Promise(Q=>{var ae;(ae=T.value)==null||ae.unmark({done:()=>{var ne;(ne=T.value)==null||ne.markRegExp(M(U),{done:Q})}})});const Z=((be=r.value)==null?void 0:be.querySelectorAll(".result .excerpt"))??[];for(const Q of Z)(He=Q.querySelector('mark[data-markjs="true"]'))==null||He.scrollIntoView({block:"center"});(Ye=(Qe=n.value)==null?void 0:Qe.firstElementChild)==null||Ye.scrollIntoView({block:"start"})},{debounce:200,immediate:!0});async function L(m){const x=Xt(m.slice(0,m.indexOf("#")));try{if(!x)throw new Error(`Cannot find file for id: ${m}`);return{id:m,mod:await $e(()=>import(x),__vite__mapDeps([]))}}catch($){return console.error($),{id:m,mod:{}}}}const R=oe(),B=Fe(()=>{var m;return((m=v.value)==null?void 0:m.length)<=0});function N(m=!0){var x,$;(x=R.value)==null||x.focus(),m&&(($=R.value)==null||$.select())}Oe(()=>{N()});function O(m){m.pointerType==="mouse"&&N()}const A=oe(-1),_=oe(!1);We(g,m=>{A.value=m.length?0:-1,w()});function w(){de(()=>{const m=document.querySelector(".result.selected");m&&m.scrollIntoView({block:"nearest"})})}Ee("ArrowUp",m=>{m.preventDefault(),A.value--,A.value<0&&(A.value=g.value.length-1),_.value=!0,w()}),Ee("ArrowDown",m=>{m.preventDefault(),A.value++,A.value>=g.value.length&&(A.value=0),_.value=!0,w()});const c=zt();Ee("Enter",m=>{if(m.isComposing||m.target instanceof HTMLButtonElement&&m.target.type!=="submit")return;const x=g.value[A.value];if(m.target instanceof HTMLInputElement&&!x){m.preventDefault();return}x&&(c.go(x.id),t("close"))}),Ee("Escape",()=>{t("close")});const p=ar({modal:{displayDetails:"Display detailed list",resetButtonTitle:"Reset search",backButtonTitle:"Close search",noResultsText:"No results for",footer:{selectText:"to select",selectKeyAriaLabel:"enter",navigateText:"to navigate",navigateUpKeyAriaLabel:"up arrow",navigateDownKeyAriaLabel:"down arrow",closeText:"to close",closeKeyAriaLabel:"escape"}}});Oe(()=>{window.history.pushState(null,"",null)}),Vt("popstate",m=>{m.preventDefault(),t("close")});const C=Bt($t?document.body:null);Oe(()=>{de(()=>{C.value=!0,de().then(()=>s())})}),Wt(()=>{C.value=!1});function I(){v.value="",de().then(()=>N(!1))}function M(m){return new RegExp([...m].sort((x,$)=>$.length-x.length).map(x=>`(${er(x)})`).join("|"),"gi")}return(m,x)=>{var $,K,q,H;return ee(),Kt(qt,{to:"body"},[k("div",{ref_key:"el",ref:r,role:"button","aria-owns":($=g.value)!=null&&$.length?"localsearch-list":void 0,"aria-expanded":"true","aria-haspopup":"listbox","aria-labelledby":"localsearch-label",class:"VPLocalSearchBox"},[k("div",{class:"backdrop",onClick:x[0]||(x[0]=V=>m.$emit("close"))}),k("div",Qr,[k("form",{class:"search-bar",onPointerup:x[4]||(x[4]=V=>O(V)),onSubmit:x[5]||(x[5]=Jt(()=>{},["prevent"]))},[k("label",{title:E.value,id:"localsearch-label",for:"localsearch-input"},Xr,8,Yr),k("div",ea,[k("button",{class:"back-button",title:j(p)("modal.backButtonTitle"),onClick:x[1]||(x[1]=V=>m.$emit("close"))},aa,8,ta)]),Ut(k("input",{ref_key:"searchInput",ref:R,"onUpdate:modelValue":x[2]||(x[2]=V=>Gt(v)?v.value=V:null),placeholder:E.value,id:"localsearch-input","aria-labelledby":"localsearch-label",class:"search-input"},null,8,na),[[jt,j(v)]]),k("div",ia,[b.value?Se("",!0):(ee(),re("button",{key:0,class:at(["toggle-layout-button",{"detailed-list":j(y)}]),type:"button",title:j(p)("modal.displayDetails"),onClick:x[3]||(x[3]=V=>A.value>-1&&(y.value=!j(y)))},ua,10,oa)),k("button",{class:"clear-button",type:"reset",disabled:B.value,title:j(p)("modal.resetButtonTitle"),onClick:I},fa,8,la)])],32),k("ul",{ref_key:"resultsEl",ref:n,id:(K=g.value)!=null&&K.length?"localsearch-list":void 0,role:(q=g.value)!=null&&q.length?"listbox":void 0,"aria-labelledby":(H=g.value)!=null&&H.length?"localsearch-label":void 0,class:"results",onMousemove:x[7]||(x[7]=V=>_.value=!1)},[(ee(!0),re(it,null,nt(g.value,(V,U)=>(ee(),re("li",{key:V.id,role:"option","aria-selected":A.value===U?"true":"false"},[k("a",{href:V.id,class:at(["result",{selected:A.value===U}]),"aria-label":[...V.titles,V.title].join(" > "),onMouseenter:Z=>!_.value&&(A.value=U),onFocusin:Z=>A.value=U,onClick:x[6]||(x[6]=Z=>m.$emit("close"))},[k("div",null,[k("div",pa,[ya,(ee(!0),re(it,null,nt(V.titles,(Z,be)=>(ee(),re("span",{key:be,class:"title"},[k("span",{class:"text",innerHTML:Z},null,8,ma),ga]))),128)),k("span",ba,[k("span",{class:"text",innerHTML:V.title},null,8,wa)])]),j(y)?(ee(),re("div",xa,[V.text?(ee(),re("div",Fa,[k("div",{class:"vp-doc",innerHTML:V.text},null,8,Ea)])):Se("",!0),Sa,Aa])):Se("",!0)])],42,va)],8,da))),128)),j(v)&&!g.value.length&&S.value?(ee(),re("li",Ta,[ve(pe(j(p)("modal.noResultsText"))+' "',1),k("strong",null,pe(j(v)),1),ve('" ')])):Se("",!0)],40,ha),k("div",Na,[k("span",null,[k("kbd",{"aria-label":j(p)("modal.footer.navigateUpKeyAriaLabel")},Da,8,Ca),k("kbd",{"aria-label":j(p)("modal.footer.navigateDownKeyAriaLabel")},Oa,8,ka),ve(" "+pe(j(p)("modal.footer.navigateText")),1)]),k("span",null,[k("kbd",{"aria-label":j(p)("modal.footer.selectKeyAriaLabel")},La,8,Ra),ve(" "+pe(j(p)("modal.footer.selectText")),1)]),k("span",null,[k("kbd",{"aria-label":j(p)("modal.footer.closeKeyAriaLabel")},"esc",8,Pa),ve(" "+pe(j(p)("modal.footer.closeText")),1)])])])],8,Hr)])}}}),Ja=tr(za,[["__scopeId","data-v-43c4f204"]]);export{Ja as default}; diff --git a/assets/chunks/framework.BthLuVtL.js b/assets/chunks/framework.BthLuVtL.js new file mode 100644 index 0000000..dae5a28 --- /dev/null +++ b/assets/chunks/framework.BthLuVtL.js @@ -0,0 +1,17 @@ +/** +* @vue/shared v3.4.21 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/function Sr(e,t){const n=new Set(e.split(","));return t?r=>n.has(r.toLowerCase()):r=>n.has(r)}const ee={},_t=[],xe=()=>{},Ti=()=>!1,Wt=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),Tr=e=>e.startsWith("onUpdate:"),ce=Object.assign,Ar=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},Ai=Object.prototype.hasOwnProperty,Y=(e,t)=>Ai.call(e,t),U=Array.isArray,vt=e=>Rn(e)==="[object Map]",Zs=e=>Rn(e)==="[object Set]",q=e=>typeof e=="function",ne=e=>typeof e=="string",At=e=>typeof e=="symbol",Z=e=>e!==null&&typeof e=="object",eo=e=>(Z(e)||q(e))&&q(e.then)&&q(e.catch),to=Object.prototype.toString,Rn=e=>to.call(e),Ri=e=>Rn(e).slice(8,-1),no=e=>Rn(e)==="[object Object]",Rr=e=>ne(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,bt=Sr(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),On=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},Oi=/-(\w)/g,Fe=On(e=>e.replace(Oi,(t,n)=>n?n.toUpperCase():"")),Li=/\B([A-Z])/g,ft=On(e=>e.replace(Li,"-$1").toLowerCase()),Ln=On(e=>e.charAt(0).toUpperCase()+e.slice(1)),hn=On(e=>e?`on${Ln(e)}`:""),Ze=(e,t)=>!Object.is(e,t),pn=(e,t)=>{for(let n=0;n{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,value:n})},ur=e=>{const t=parseFloat(e);return isNaN(t)?e:t},Ii=e=>{const t=ne(e)?Number(e):NaN;return isNaN(t)?e:t};let ns;const ro=()=>ns||(ns=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Or(e){if(U(e)){const t={};for(let n=0;n{if(n){const r=n.split(Pi);r.length>1&&(t[r[0].trim()]=r[1].trim())}}),t}function Lr(e){let t="";if(ne(e))t=e;else if(U(e))for(let n=0;nne(e)?e:e==null?"":U(e)||Z(e)&&(e.toString===to||!q(e.toString))?JSON.stringify(e,oo,2):String(e),oo=(e,t)=>t&&t.__v_isRef?oo(e,t.value):vt(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[r,s],o)=>(n[Gn(r,o)+" =>"]=s,n),{})}:Zs(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>Gn(n))}:At(t)?Gn(t):Z(t)&&!U(t)&&!no(t)?String(t):t,Gn=(e,t="")=>{var n;return At(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};/** +* @vue/reactivity v3.4.21 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/let ve;class ji{constructor(t=!1){this.detached=t,this._active=!0,this.effects=[],this.cleanups=[],this.parent=ve,!t&&ve&&(this.index=(ve.scopes||(ve.scopes=[])).push(this)-1)}get active(){return this._active}run(t){if(this._active){const n=ve;try{return ve=this,t()}finally{ve=n}}}on(){ve=this}off(){ve=this.parent}stop(t){if(this._active){let n,r;for(n=0,r=this.effects.length;n=4))break}this._dirtyLevel===1&&(this._dirtyLevel=0),ht()}return this._dirtyLevel>=4}set dirty(t){this._dirtyLevel=t?4:0}run(){if(this._dirtyLevel=0,!this.active)return this.fn();let t=Ye,n=ct;try{return Ye=!0,ct=this,this._runnings++,rs(this),this.fn()}finally{ss(this),this._runnings--,ct=n,Ye=t}}stop(){var t;this.active&&(rs(this),ss(this),(t=this.onStop)==null||t.call(this),this.active=!1)}}function Bi(e){return e.value}function rs(e){e._trackId++,e._depsLength=0}function ss(e){if(e.deps.length>e._depsLength){for(let t=e._depsLength;t{const n=new Map;return n.cleanup=e,n.computed=t,n},vn=new WeakMap,at=Symbol(""),hr=Symbol("");function ye(e,t,n){if(Ye&&ct){let r=vn.get(e);r||vn.set(e,r=new Map);let s=r.get(n);s||r.set(n,s=fo(()=>r.delete(n))),ao(ct,s)}}function je(e,t,n,r,s,o){const i=vn.get(e);if(!i)return;let l=[];if(t==="clear")l=[...i.values()];else if(n==="length"&&U(e)){const c=Number(r);i.forEach((a,f)=>{(f==="length"||!At(f)&&f>=c)&&l.push(a)})}else switch(n!==void 0&&l.push(i.get(n)),t){case"add":U(e)?Rr(n)&&l.push(i.get("length")):(l.push(i.get(at)),vt(e)&&l.push(i.get(hr)));break;case"delete":U(e)||(l.push(i.get(at)),vt(e)&&l.push(i.get(hr)));break;case"set":vt(e)&&l.push(i.get(at));break}Mr();for(const c of l)c&&uo(c,4);Pr()}function Ui(e,t){var n;return(n=vn.get(e))==null?void 0:n.get(t)}const ki=Sr("__proto__,__v_isRef,__isVue"),ho=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(At)),os=Ki();function Ki(){const e={};return["includes","indexOf","lastIndexOf"].forEach(t=>{e[t]=function(...n){const r=J(this);for(let o=0,i=this.length;o{e[t]=function(...n){dt(),Mr();const r=J(this)[t].apply(this,n);return Pr(),ht(),r}}),e}function Wi(e){const t=J(this);return ye(t,"has",e),t.hasOwnProperty(e)}class po{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,r){const s=this._isReadonly,o=this._isShallow;if(n==="__v_isReactive")return!s;if(n==="__v_isReadonly")return s;if(n==="__v_isShallow")return o;if(n==="__v_raw")return r===(s?o?sl:_o:o?yo:mo).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(r)?t:void 0;const i=U(t);if(!s){if(i&&Y(os,n))return Reflect.get(os,n,r);if(n==="hasOwnProperty")return Wi}const l=Reflect.get(t,n,r);return(At(n)?ho.has(n):ki(n))||(s||ye(t,"get",n),o)?l:de(l)?i&&Rr(n)?l:l.value:Z(l)?s?Pn(l):Mn(l):l}}class go extends po{constructor(t=!1){super(!1,t)}set(t,n,r,s){let o=t[n];if(!this._isShallow){const c=St(o);if(!bn(r)&&!St(r)&&(o=J(o),r=J(r)),!U(t)&&de(o)&&!de(r))return c?!1:(o.value=r,!0)}const i=U(t)&&Rr(n)?Number(n)e,In=e=>Reflect.getPrototypeOf(e);function Qt(e,t,n=!1,r=!1){e=e.__v_raw;const s=J(e),o=J(t);n||(Ze(t,o)&&ye(s,"get",t),ye(s,"get",o));const{has:i}=In(s),l=r?Nr:n?Hr:Dt;if(i.call(s,t))return l(e.get(t));if(i.call(s,o))return l(e.get(o));e!==s&&e.get(t)}function Zt(e,t=!1){const n=this.__v_raw,r=J(n),s=J(e);return t||(Ze(e,s)&&ye(r,"has",e),ye(r,"has",s)),e===s?n.has(e):n.has(e)||n.has(s)}function en(e,t=!1){return e=e.__v_raw,!t&&ye(J(e),"iterate",at),Reflect.get(e,"size",e)}function is(e){e=J(e);const t=J(this);return In(t).has.call(t,e)||(t.add(e),je(t,"add",e,e)),this}function ls(e,t){t=J(t);const n=J(this),{has:r,get:s}=In(n);let o=r.call(n,e);o||(e=J(e),o=r.call(n,e));const i=s.call(n,e);return n.set(e,t),o?Ze(t,i)&&je(n,"set",e,t):je(n,"add",e,t),this}function cs(e){const t=J(this),{has:n,get:r}=In(t);let s=n.call(t,e);s||(e=J(e),s=n.call(t,e)),r&&r.call(t,e);const o=t.delete(e);return s&&je(t,"delete",e,void 0),o}function as(){const e=J(this),t=e.size!==0,n=e.clear();return t&&je(e,"clear",void 0,void 0),n}function tn(e,t){return function(r,s){const o=this,i=o.__v_raw,l=J(i),c=t?Nr:e?Hr:Dt;return!e&&ye(l,"iterate",at),i.forEach((a,f)=>r.call(s,c(a),c(f),o))}}function nn(e,t,n){return function(...r){const s=this.__v_raw,o=J(s),i=vt(o),l=e==="entries"||e===Symbol.iterator&&i,c=e==="keys"&&i,a=s[e](...r),f=n?Nr:t?Hr:Dt;return!t&&ye(o,"iterate",c?hr:at),{next(){const{value:h,done:p}=a.next();return p?{value:h,done:p}:{value:l?[f(h[0]),f(h[1])]:f(h),done:p}},[Symbol.iterator](){return this}}}}function Ue(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function Yi(){const e={get(o){return Qt(this,o)},get size(){return en(this)},has:Zt,add:is,set:ls,delete:cs,clear:as,forEach:tn(!1,!1)},t={get(o){return Qt(this,o,!1,!0)},get size(){return en(this)},has:Zt,add:is,set:ls,delete:cs,clear:as,forEach:tn(!1,!0)},n={get(o){return Qt(this,o,!0)},get size(){return en(this,!0)},has(o){return Zt.call(this,o,!0)},add:Ue("add"),set:Ue("set"),delete:Ue("delete"),clear:Ue("clear"),forEach:tn(!0,!1)},r={get(o){return Qt(this,o,!0,!0)},get size(){return en(this,!0)},has(o){return Zt.call(this,o,!0)},add:Ue("add"),set:Ue("set"),delete:Ue("delete"),clear:Ue("clear"),forEach:tn(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach(o=>{e[o]=nn(o,!1,!1),n[o]=nn(o,!0,!1),t[o]=nn(o,!1,!0),r[o]=nn(o,!0,!0)}),[e,n,t,r]}const[Ji,Qi,Zi,el]=Yi();function Fr(e,t){const n=t?e?el:Zi:e?Qi:Ji;return(r,s,o)=>s==="__v_isReactive"?!e:s==="__v_isReadonly"?e:s==="__v_raw"?r:Reflect.get(Y(n,s)&&s in r?n:r,s,o)}const tl={get:Fr(!1,!1)},nl={get:Fr(!1,!0)},rl={get:Fr(!0,!1)},mo=new WeakMap,yo=new WeakMap,_o=new WeakMap,sl=new WeakMap;function ol(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function il(e){return e.__v_skip||!Object.isExtensible(e)?0:ol(Ri(e))}function Mn(e){return St(e)?e:$r(e,!1,Gi,tl,mo)}function ll(e){return $r(e,!1,Xi,nl,yo)}function Pn(e){return $r(e,!0,zi,rl,_o)}function $r(e,t,n,r,s){if(!Z(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;const o=s.get(e);if(o)return o;const i=il(e);if(i===0)return e;const l=new Proxy(e,i===2?r:n);return s.set(e,l),l}function wt(e){return St(e)?wt(e.__v_raw):!!(e&&e.__v_isReactive)}function St(e){return!!(e&&e.__v_isReadonly)}function bn(e){return!!(e&&e.__v_isShallow)}function vo(e){return wt(e)||St(e)}function J(e){const t=e&&e.__v_raw;return t?J(t):e}function Mt(e){return Object.isExtensible(e)&&_n(e,"__v_skip",!0),e}const Dt=e=>Z(e)?Mn(e):e,Hr=e=>Z(e)?Pn(e):e;class bo{constructor(t,n,r,s){this.getter=t,this._setter=n,this.dep=void 0,this.__v_isRef=!0,this.__v_isReadonly=!1,this.effect=new Ir(()=>t(this._value),()=>Pt(this,this.effect._dirtyLevel===2?2:3)),this.effect.computed=this,this.effect.active=this._cacheable=!s,this.__v_isReadonly=r}get value(){const t=J(this);return(!t._cacheable||t.effect.dirty)&&Ze(t._value,t._value=t.effect.run())&&Pt(t,4),jr(t),t.effect._dirtyLevel>=2&&Pt(t,2),t._value}set value(t){this._setter(t)}get _dirty(){return this.effect.dirty}set _dirty(t){this.effect.dirty=t}}function cl(e,t,n=!1){let r,s;const o=q(e);return o?(r=e,s=xe):(r=e.get,s=e.set),new bo(r,s,o||!s,n)}function jr(e){var t;Ye&&ct&&(e=J(e),ao(ct,(t=e.dep)!=null?t:e.dep=fo(()=>e.dep=void 0,e instanceof bo?e:void 0)))}function Pt(e,t=4,n){e=J(e);const r=e.dep;r&&uo(r,t)}function de(e){return!!(e&&e.__v_isRef===!0)}function se(e){return wo(e,!1)}function Vr(e){return wo(e,!0)}function wo(e,t){return de(e)?e:new al(e,t)}class al{constructor(t,n){this.__v_isShallow=n,this.dep=void 0,this.__v_isRef=!0,this._rawValue=n?t:J(t),this._value=n?t:Dt(t)}get value(){return jr(this),this._value}set value(t){const n=this.__v_isShallow||bn(t)||St(t);t=n?t:J(t),Ze(t,this._rawValue)&&(this._rawValue=t,this._value=n?t:Dt(t),Pt(this,4))}}function Eo(e){return de(e)?e.value:e}const ul={get:(e,t,n)=>Eo(Reflect.get(e,t,n)),set:(e,t,n,r)=>{const s=e[t];return de(s)&&!de(n)?(s.value=n,!0):Reflect.set(e,t,n,r)}};function Co(e){return wt(e)?e:new Proxy(e,ul)}class fl{constructor(t){this.dep=void 0,this.__v_isRef=!0;const{get:n,set:r}=t(()=>jr(this),()=>Pt(this));this._get=n,this._set=r}get value(){return this._get()}set value(t){this._set(t)}}function dl(e){return new fl(e)}class hl{constructor(t,n,r){this._object=t,this._key=n,this._defaultValue=r,this.__v_isRef=!0}get value(){const t=this._object[this._key];return t===void 0?this._defaultValue:t}set value(t){this._object[this._key]=t}get dep(){return Ui(J(this._object),this._key)}}class pl{constructor(t){this._getter=t,this.__v_isRef=!0,this.__v_isReadonly=!0}get value(){return this._getter()}}function gl(e,t,n){return de(e)?e:q(e)?new pl(e):Z(e)&&arguments.length>1?ml(e,t,n):se(e)}function ml(e,t,n){const r=e[t];return de(r)?r:new hl(e,t,n)}/** +* @vue/runtime-core v3.4.21 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/function Je(e,t,n,r){try{return r?e(...r):e()}catch(s){qt(s,t,n)}}function Se(e,t,n,r){if(q(e)){const o=Je(e,t,n,r);return o&&eo(o)&&o.catch(i=>{qt(i,t,n)}),o}const s=[];for(let o=0;o>>1,s=he[r],o=Ut(s);oPe&&he.splice(t,1)}function bl(e){U(e)?Et.push(...e):(!qe||!qe.includes(e,e.allowRecurse?ot+1:ot))&&Et.push(e),So()}function us(e,t,n=Bt?Pe+1:0){for(;nUt(n)-Ut(r));if(Et.length=0,qe){qe.push(...t);return}for(qe=t,ot=0;ote.id==null?1/0:e.id,wl=(e,t)=>{const n=Ut(e)-Ut(t);if(n===0){if(e.pre&&!t.pre)return-1;if(t.pre&&!e.pre)return 1}return n};function To(e){pr=!1,Bt=!0,he.sort(wl);try{for(Pe=0;Pene(y)?y.trim():y)),h&&(s=n.map(ur))}let l,c=r[l=hn(t)]||r[l=hn(Fe(t))];!c&&o&&(c=r[l=hn(ft(t))]),c&&Se(c,e,6,s);const a=r[l+"Once"];if(a){if(!e.emitted)e.emitted={};else if(e.emitted[l])return;e.emitted[l]=!0,Se(a,e,6,s)}}function Ao(e,t,n=!1){const r=t.emitsCache,s=r.get(e);if(s!==void 0)return s;const o=e.emits;let i={},l=!1;if(!q(e)){const c=a=>{const f=Ao(a,t,!0);f&&(l=!0,ce(i,f))};!n&&t.mixins.length&&t.mixins.forEach(c),e.extends&&c(e.extends),e.mixins&&e.mixins.forEach(c)}return!o&&!l?(Z(e)&&r.set(e,null),null):(U(o)?o.forEach(c=>i[c]=null):ce(i,o),Z(e)&&r.set(e,i),i)}function $n(e,t){return!e||!Wt(t)?!1:(t=t.slice(2).replace(/Once$/,""),Y(e,t[0].toLowerCase()+t.slice(1))||Y(e,ft(t))||Y(e,t))}let le=null,Hn=null;function En(e){const t=le;return le=e,Hn=e&&e.type.__scopeId||null,t}function Za(e){Hn=e}function eu(){Hn=null}function Cl(e,t=le,n){if(!t||e._n)return e;const r=(...s)=>{r._d&&xs(-1);const o=En(t);let i;try{i=e(...s)}finally{En(o),r._d&&xs(1)}return i};return r._n=!0,r._c=!0,r._d=!0,r}function zn(e){const{type:t,vnode:n,proxy:r,withProxy:s,props:o,propsOptions:[i],slots:l,attrs:c,emit:a,render:f,renderCache:h,data:p,setupState:y,ctx:w,inheritAttrs:I}=e;let N,K;const k=En(e);try{if(n.shapeFlag&4){const _=s||r,M=_;N=Re(f.call(M,_,h,o,y,p,w)),K=c}else{const _=t;N=Re(_.length>1?_(o,{attrs:c,slots:l,emit:a}):_(o,null)),K=t.props?c:xl(c)}}catch(_){jt.length=0,qt(_,e,1),N=oe(be)}let g=N;if(K&&I!==!1){const _=Object.keys(K),{shapeFlag:M}=g;_.length&&M&7&&(i&&_.some(Tr)&&(K=Sl(K,i)),g=et(g,K))}return n.dirs&&(g=et(g),g.dirs=g.dirs?g.dirs.concat(n.dirs):n.dirs),n.transition&&(g.transition=n.transition),N=g,En(k),N}const xl=e=>{let t;for(const n in e)(n==="class"||n==="style"||Wt(n))&&((t||(t={}))[n]=e[n]);return t},Sl=(e,t)=>{const n={};for(const r in e)(!Tr(r)||!(r.slice(9)in t))&&(n[r]=e[r]);return n};function Tl(e,t,n){const{props:r,children:s,component:o}=e,{props:i,children:l,patchFlag:c}=t,a=o.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&c>=0){if(c&1024)return!0;if(c&16)return r?fs(r,i,a):!!i;if(c&8){const f=t.dynamicProps;for(let h=0;he.__isSuspense;function Lo(e,t){t&&t.pendingBranch?U(e)?t.effects.push(...e):t.effects.push(e):bl(e)}const Ol=Symbol.for("v-scx"),Ll=()=>xt(Ol);function Ur(e,t){return jn(e,null,t)}function ru(e,t){return jn(e,null,{flush:"post"})}const rn={};function Ve(e,t,n){return jn(e,t,n)}function jn(e,t,{immediate:n,deep:r,flush:s,once:o,onTrack:i,onTrigger:l}=ee){if(t&&o){const O=t;t=(...F)=>{O(...F),M()}}const c=ue,a=O=>r===!0?O:lt(O,r===!1?1:void 0);let f,h=!1,p=!1;if(de(e)?(f=()=>e.value,h=bn(e)):wt(e)?(f=()=>a(e),h=!0):U(e)?(p=!0,h=e.some(O=>wt(O)||bn(O)),f=()=>e.map(O=>{if(de(O))return O.value;if(wt(O))return a(O);if(q(O))return Je(O,c,2)})):q(e)?t?f=()=>Je(e,c,2):f=()=>(y&&y(),Se(e,c,3,[w])):f=xe,t&&r){const O=f;f=()=>lt(O())}let y,w=O=>{y=g.onStop=()=>{Je(O,c,4),y=g.onStop=void 0}},I;if(Xt)if(w=xe,t?n&&Se(t,c,3,[f(),p?[]:void 0,w]):f(),s==="sync"){const O=Ll();I=O.__watcherHandles||(O.__watcherHandles=[])}else return xe;let N=p?new Array(e.length).fill(rn):rn;const K=()=>{if(!(!g.active||!g.dirty))if(t){const O=g.run();(r||h||(p?O.some((F,T)=>Ze(F,N[T])):Ze(O,N)))&&(y&&y(),Se(t,c,3,[O,N===rn?void 0:p&&N[0]===rn?[]:N,w]),N=O)}else g.run()};K.allowRecurse=!!t;let k;s==="sync"?k=K:s==="post"?k=()=>ge(K,c&&c.suspense):(K.pre=!0,c&&(K.id=c.uid),k=()=>Fn(K));const g=new Ir(f,xe,k),_=io(),M=()=>{g.stop(),_&&Ar(_.effects,g)};return t?n?K():N=g.run():s==="post"?ge(g.run.bind(g),c&&c.suspense):g.run(),I&&I.push(M),M}function Il(e,t,n){const r=this.proxy,s=ne(e)?e.includes(".")?Io(r,e):()=>r[e]:e.bind(r,r);let o;q(t)?o=t:(o=t.handler,n=t);const i=zt(this),l=jn(s,o.bind(r),n);return i(),l}function Io(e,t){const n=t.split(".");return()=>{let r=e;for(let s=0;s0){if(n>=t)return e;n++}if(r=r||new Set,r.has(e))return e;if(r.add(e),de(e))lt(e.value,t,n,r);else if(U(e))for(let s=0;s{lt(s,t,n,r)});else if(no(e))for(const s in e)lt(e[s],t,n,r);return e}function su(e,t){if(le===null)return e;const n=kn(le)||le.proxy,r=e.dirs||(e.dirs=[]);for(let s=0;s{e.isMounted=!0}),$o(()=>{e.isUnmounting=!0}),e}const we=[Function,Array],Mo={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:we,onEnter:we,onAfterEnter:we,onEnterCancelled:we,onBeforeLeave:we,onLeave:we,onAfterLeave:we,onLeaveCancelled:we,onBeforeAppear:we,onAppear:we,onAfterAppear:we,onAppearCancelled:we},Pl={name:"BaseTransition",props:Mo,setup(e,{slots:t}){const n=Un(),r=Ml();return()=>{const s=t.default&&No(t.default(),!0);if(!s||!s.length)return;let o=s[0];if(s.length>1){for(const p of s)if(p.type!==be){o=p;break}}const i=J(e),{mode:l}=i;if(r.isLeaving)return Xn(o);const c=hs(o);if(!c)return Xn(o);const a=gr(c,i,r,n);mr(c,a);const f=n.subTree,h=f&&hs(f);if(h&&h.type!==be&&!it(c,h)){const p=gr(h,i,r,n);if(mr(h,p),l==="out-in")return r.isLeaving=!0,p.afterLeave=()=>{r.isLeaving=!1,n.update.active!==!1&&(n.effect.dirty=!0,n.update())},Xn(o);l==="in-out"&&c.type!==be&&(p.delayLeave=(y,w,I)=>{const N=Po(r,h);N[String(h.key)]=h,y[Ge]=()=>{w(),y[Ge]=void 0,delete a.delayedLeave},a.delayedLeave=I})}return o}}},Nl=Pl;function Po(e,t){const{leavingVNodes:n}=e;let r=n.get(t.type);return r||(r=Object.create(null),n.set(t.type,r)),r}function gr(e,t,n,r){const{appear:s,mode:o,persisted:i=!1,onBeforeEnter:l,onEnter:c,onAfterEnter:a,onEnterCancelled:f,onBeforeLeave:h,onLeave:p,onAfterLeave:y,onLeaveCancelled:w,onBeforeAppear:I,onAppear:N,onAfterAppear:K,onAppearCancelled:k}=t,g=String(e.key),_=Po(n,e),M=(T,$)=>{T&&Se(T,r,9,$)},O=(T,$)=>{const E=$[1];M(T,$),U(T)?T.every(j=>j.length<=1)&&E():T.length<=1&&E()},F={mode:o,persisted:i,beforeEnter(T){let $=l;if(!n.isMounted)if(s)$=I||l;else return;T[Ge]&&T[Ge](!0);const E=_[g];E&&it(e,E)&&E.el[Ge]&&E.el[Ge](),M($,[T])},enter(T){let $=c,E=a,j=f;if(!n.isMounted)if(s)$=N||c,E=K||a,j=k||f;else return;let A=!1;const G=T[sn]=ie=>{A||(A=!0,ie?M(j,[T]):M(E,[T]),F.delayedLeave&&F.delayedLeave(),T[sn]=void 0)};$?O($,[T,G]):G()},leave(T,$){const E=String(e.key);if(T[sn]&&T[sn](!0),n.isUnmounting)return $();M(h,[T]);let j=!1;const A=T[Ge]=G=>{j||(j=!0,$(),G?M(w,[T]):M(y,[T]),T[Ge]=void 0,_[E]===e&&delete _[E])};_[E]=e,p?O(p,[T,A]):A()},clone(T){return gr(T,t,n,r)}};return F}function Xn(e){if(Gt(e))return e=et(e),e.children=null,e}function hs(e){return Gt(e)?e.children?e.children[0]:void 0:e}function mr(e,t){e.shapeFlag&6&&e.component?mr(e.component.subTree,t):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function No(e,t=!1,n){let r=[],s=0;for(let o=0;o1)for(let o=0;o!!e.type.__asyncLoader;/*! #__NO_SIDE_EFFECTS__ */function ou(e){q(e)&&(e={loader:e});const{loader:t,loadingComponent:n,errorComponent:r,delay:s=200,timeout:o,suspensible:i=!0,onError:l}=e;let c=null,a,f=0;const h=()=>(f++,c=null,p()),p=()=>{let y;return c||(y=c=t().catch(w=>{if(w=w instanceof Error?w:new Error(String(w)),l)return new Promise((I,N)=>{l(w,()=>I(h()),()=>N(w),f+1)});throw w}).then(w=>y!==c&&c?c:(w&&(w.__esModule||w[Symbol.toStringTag]==="Module")&&(w=w.default),a=w,w)))};return kr({name:"AsyncComponentWrapper",__asyncLoader:p,get __asyncResolved(){return a},setup(){const y=ue;if(a)return()=>Yn(a,y);const w=k=>{c=null,qt(k,y,13,!r)};if(i&&y.suspense||Xt)return p().then(k=>()=>Yn(k,y)).catch(k=>(w(k),()=>r?oe(r,{error:k}):null));const I=se(!1),N=se(),K=se(!!s);return s&&setTimeout(()=>{K.value=!1},s),o!=null&&setTimeout(()=>{if(!I.value&&!N.value){const k=new Error(`Async component timed out after ${o}ms.`);w(k),N.value=k}},o),p().then(()=>{I.value=!0,y.parent&&Gt(y.parent.vnode)&&(y.parent.effect.dirty=!0,Fn(y.parent.update))}).catch(k=>{w(k),N.value=k}),()=>{if(I.value&&a)return Yn(a,y);if(N.value&&r)return oe(r,{error:N.value});if(n&&!K.value)return oe(n)}}})}function Yn(e,t){const{ref:n,props:r,children:s,ce:o}=t.vnode,i=oe(e,r,s);return i.ref=n,i.ce=o,delete t.vnode.ce,i}const Gt=e=>e.type.__isKeepAlive;function Fl(e,t){Fo(e,"a",t)}function $l(e,t){Fo(e,"da",t)}function Fo(e,t,n=ue){const r=e.__wdc||(e.__wdc=()=>{let s=n;for(;s;){if(s.isDeactivated)return;s=s.parent}return e()});if(Vn(t,r,n),n){let s=n.parent;for(;s&&s.parent;)Gt(s.parent.vnode)&&Hl(r,t,n,s),s=s.parent}}function Hl(e,t,n,r){const s=Vn(t,e,r,!0);Dn(()=>{Ar(r[t],s)},n)}function Vn(e,t,n=ue,r=!1){if(n){const s=n[e]||(n[e]=[]),o=t.__weh||(t.__weh=(...i)=>{if(n.isUnmounted)return;dt();const l=zt(n),c=Se(t,n,e,i);return l(),ht(),c});return r?s.unshift(o):s.push(o),o}}const Be=e=>(t,n=ue)=>(!Xt||e==="sp")&&Vn(e,(...r)=>t(...r),n),jl=Be("bm"),Rt=Be("m"),Vl=Be("bu"),Dl=Be("u"),$o=Be("bum"),Dn=Be("um"),Bl=Be("sp"),Ul=Be("rtg"),kl=Be("rtc");function Kl(e,t=ue){Vn("ec",e,t)}function iu(e,t,n,r){let s;const o=n&&n[r];if(U(e)||ne(e)){s=new Array(e.length);for(let i=0,l=e.length;it(i,l,void 0,o&&o[l]));else{const i=Object.keys(e);s=new Array(i.length);for(let l=0,c=i.length;lSn(t)?!(t.type===be||t.type===me&&!Ho(t.children)):!0)?e:null}function cu(e,t){const n={};for(const r in e)n[t&&/[A-Z]/.test(r)?`on:${r}`:hn(r)]=e[r];return n}const yr=e=>e?ti(e)?kn(e)||e.proxy:yr(e.parent):null,Nt=ce(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>yr(e.parent),$root:e=>yr(e.root),$emit:e=>e.emit,$options:e=>Kr(e),$forceUpdate:e=>e.f||(e.f=()=>{e.effect.dirty=!0,Fn(e.update)}),$nextTick:e=>e.n||(e.n=Nn.bind(e.proxy)),$watch:e=>Il.bind(e)}),Jn=(e,t)=>e!==ee&&!e.__isScriptSetup&&Y(e,t),Wl={get({_:e},t){const{ctx:n,setupState:r,data:s,props:o,accessCache:i,type:l,appContext:c}=e;let a;if(t[0]!=="$"){const y=i[t];if(y!==void 0)switch(y){case 1:return r[t];case 2:return s[t];case 4:return n[t];case 3:return o[t]}else{if(Jn(r,t))return i[t]=1,r[t];if(s!==ee&&Y(s,t))return i[t]=2,s[t];if((a=e.propsOptions[0])&&Y(a,t))return i[t]=3,o[t];if(n!==ee&&Y(n,t))return i[t]=4,n[t];_r&&(i[t]=0)}}const f=Nt[t];let h,p;if(f)return t==="$attrs"&&ye(e,"get",t),f(e);if((h=l.__cssModules)&&(h=h[t]))return h;if(n!==ee&&Y(n,t))return i[t]=4,n[t];if(p=c.config.globalProperties,Y(p,t))return p[t]},set({_:e},t,n){const{data:r,setupState:s,ctx:o}=e;return Jn(s,t)?(s[t]=n,!0):r!==ee&&Y(r,t)?(r[t]=n,!0):Y(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(o[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:r,appContext:s,propsOptions:o}},i){let l;return!!n[i]||e!==ee&&Y(e,i)||Jn(t,i)||(l=o[0])&&Y(l,i)||Y(r,i)||Y(Nt,i)||Y(s.config.globalProperties,i)},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:Y(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function au(){return ql().slots}function ql(){const e=Un();return e.setupContext||(e.setupContext=ri(e))}function ps(e){return U(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}let _r=!0;function Gl(e){const t=Kr(e),n=e.proxy,r=e.ctx;_r=!1,t.beforeCreate&&gs(t.beforeCreate,e,"bc");const{data:s,computed:o,methods:i,watch:l,provide:c,inject:a,created:f,beforeMount:h,mounted:p,beforeUpdate:y,updated:w,activated:I,deactivated:N,beforeDestroy:K,beforeUnmount:k,destroyed:g,unmounted:_,render:M,renderTracked:O,renderTriggered:F,errorCaptured:T,serverPrefetch:$,expose:E,inheritAttrs:j,components:A,directives:G,filters:ie}=t;if(a&&zl(a,r,null),i)for(const X in i){const V=i[X];q(V)&&(r[X]=V.bind(n))}if(s){const X=s.call(n,n);Z(X)&&(e.data=Mn(X))}if(_r=!0,o)for(const X in o){const V=o[X],$e=q(V)?V.bind(n,n):q(V.get)?V.get.bind(n,n):xe,Yt=!q(V)&&q(V.set)?V.set.bind(n):xe,tt=re({get:$e,set:Yt});Object.defineProperty(r,X,{enumerable:!0,configurable:!0,get:()=>tt.value,set:Le=>tt.value=Le})}if(l)for(const X in l)jo(l[X],r,n,X);if(c){const X=q(c)?c.call(n):c;Reflect.ownKeys(X).forEach(V=>{ec(V,X[V])})}f&&gs(f,e,"c");function D(X,V){U(V)?V.forEach($e=>X($e.bind(n))):V&&X(V.bind(n))}if(D(jl,h),D(Rt,p),D(Vl,y),D(Dl,w),D(Fl,I),D($l,N),D(Kl,T),D(kl,O),D(Ul,F),D($o,k),D(Dn,_),D(Bl,$),U(E))if(E.length){const X=e.exposed||(e.exposed={});E.forEach(V=>{Object.defineProperty(X,V,{get:()=>n[V],set:$e=>n[V]=$e})})}else e.exposed||(e.exposed={});M&&e.render===xe&&(e.render=M),j!=null&&(e.inheritAttrs=j),A&&(e.components=A),G&&(e.directives=G)}function zl(e,t,n=xe){U(e)&&(e=vr(e));for(const r in e){const s=e[r];let o;Z(s)?"default"in s?o=xt(s.from||r,s.default,!0):o=xt(s.from||r):o=xt(s),de(o)?Object.defineProperty(t,r,{enumerable:!0,configurable:!0,get:()=>o.value,set:i=>o.value=i}):t[r]=o}}function gs(e,t,n){Se(U(e)?e.map(r=>r.bind(t.proxy)):e.bind(t.proxy),t,n)}function jo(e,t,n,r){const s=r.includes(".")?Io(n,r):()=>n[r];if(ne(e)){const o=t[e];q(o)&&Ve(s,o)}else if(q(e))Ve(s,e.bind(n));else if(Z(e))if(U(e))e.forEach(o=>jo(o,t,n,r));else{const o=q(e.handler)?e.handler.bind(n):t[e.handler];q(o)&&Ve(s,o,e)}}function Kr(e){const t=e.type,{mixins:n,extends:r}=t,{mixins:s,optionsCache:o,config:{optionMergeStrategies:i}}=e.appContext,l=o.get(t);let c;return l?c=l:!s.length&&!n&&!r?c=t:(c={},s.length&&s.forEach(a=>Cn(c,a,i,!0)),Cn(c,t,i)),Z(t)&&o.set(t,c),c}function Cn(e,t,n,r=!1){const{mixins:s,extends:o}=t;o&&Cn(e,o,n,!0),s&&s.forEach(i=>Cn(e,i,n,!0));for(const i in t)if(!(r&&i==="expose")){const l=Xl[i]||n&&n[i];e[i]=l?l(e[i],t[i]):t[i]}return e}const Xl={data:ms,props:ys,emits:ys,methods:It,computed:It,beforeCreate:pe,created:pe,beforeMount:pe,mounted:pe,beforeUpdate:pe,updated:pe,beforeDestroy:pe,beforeUnmount:pe,destroyed:pe,unmounted:pe,activated:pe,deactivated:pe,errorCaptured:pe,serverPrefetch:pe,components:It,directives:It,watch:Jl,provide:ms,inject:Yl};function ms(e,t){return t?e?function(){return ce(q(e)?e.call(this,this):e,q(t)?t.call(this,this):t)}:t:e}function Yl(e,t){return It(vr(e),vr(t))}function vr(e){if(U(e)){const t={};for(let n=0;n1)return n&&q(t)?t.call(r&&r.proxy):t}}function tc(e,t,n,r=!1){const s={},o={};_n(o,Bn,1),e.propsDefaults=Object.create(null),Do(e,t,s,o);for(const i in e.propsOptions[0])i in s||(s[i]=void 0);n?e.props=r?s:ll(s):e.type.props?e.props=s:e.props=o,e.attrs=o}function nc(e,t,n,r){const{props:s,attrs:o,vnode:{patchFlag:i}}=e,l=J(s),[c]=e.propsOptions;let a=!1;if((r||i>0)&&!(i&16)){if(i&8){const f=e.vnode.dynamicProps;for(let h=0;h{c=!0;const[p,y]=Bo(h,t,!0);ce(i,p),y&&l.push(...y)};!n&&t.mixins.length&&t.mixins.forEach(f),e.extends&&f(e.extends),e.mixins&&e.mixins.forEach(f)}if(!o&&!c)return Z(e)&&r.set(e,_t),_t;if(U(o))for(let f=0;f-1,y[1]=I<0||w-1||Y(y,"default"))&&l.push(h)}}}const a=[i,l];return Z(e)&&r.set(e,a),a}function _s(e){return e[0]!=="$"&&!bt(e)}function vs(e){return e===null?"null":typeof e=="function"?e.name||"":typeof e=="object"&&e.constructor&&e.constructor.name||""}function bs(e,t){return vs(e)===vs(t)}function ws(e,t){return U(t)?t.findIndex(n=>bs(n,e)):q(t)&&bs(t,e)?0:-1}const Uo=e=>e[0]==="_"||e==="$stable",Wr=e=>U(e)?e.map(Re):[Re(e)],rc=(e,t,n)=>{if(t._n)return t;const r=Cl((...s)=>Wr(t(...s)),n);return r._c=!1,r},ko=(e,t,n)=>{const r=e._ctx;for(const s in e){if(Uo(s))continue;const o=e[s];if(q(o))t[s]=rc(s,o,r);else if(o!=null){const i=Wr(o);t[s]=()=>i}}},Ko=(e,t)=>{const n=Wr(t);e.slots.default=()=>n},sc=(e,t)=>{if(e.vnode.shapeFlag&32){const n=t._;n?(e.slots=J(t),_n(t,"_",n)):ko(t,e.slots={})}else e.slots={},t&&Ko(e,t);_n(e.slots,Bn,1)},oc=(e,t,n)=>{const{vnode:r,slots:s}=e;let o=!0,i=ee;if(r.shapeFlag&32){const l=t._;l?n&&l===1?o=!1:(ce(s,t),!n&&l===1&&delete s._):(o=!t.$stable,ko(t,s)),i=t}else t&&(Ko(e,t),i={default:1});if(o)for(const l in s)!Uo(l)&&i[l]==null&&delete s[l]};function xn(e,t,n,r,s=!1){if(U(e)){e.forEach((p,y)=>xn(p,t&&(U(t)?t[y]:t),n,r,s));return}if(Ct(r)&&!s)return;const o=r.shapeFlag&4?kn(r.component)||r.component.proxy:r.el,i=s?null:o,{i:l,r:c}=e,a=t&&t.r,f=l.refs===ee?l.refs={}:l.refs,h=l.setupState;if(a!=null&&a!==c&&(ne(a)?(f[a]=null,Y(h,a)&&(h[a]=null)):de(a)&&(a.value=null)),q(c))Je(c,l,12,[i,f]);else{const p=ne(c),y=de(c);if(p||y){const w=()=>{if(e.f){const I=p?Y(h,c)?h[c]:f[c]:c.value;s?U(I)&&Ar(I,o):U(I)?I.includes(o)||I.push(o):p?(f[c]=[o],Y(h,c)&&(h[c]=f[c])):(c.value=[o],e.k&&(f[e.k]=c.value))}else p?(f[c]=i,Y(h,c)&&(h[c]=i)):y&&(c.value=i,e.k&&(f[e.k]=i))};i?(w.id=-1,ge(w,n)):w()}}}let ke=!1;const ic=e=>e.namespaceURI.includes("svg")&&e.tagName!=="foreignObject",lc=e=>e.namespaceURI.includes("MathML"),on=e=>{if(ic(e))return"svg";if(lc(e))return"mathml"},ln=e=>e.nodeType===8;function cc(e){const{mt:t,p:n,o:{patchProp:r,createText:s,nextSibling:o,parentNode:i,remove:l,insert:c,createComment:a}}=e,f=(g,_)=>{if(!_.hasChildNodes()){n(null,g,_),wn(),_._vnode=g;return}ke=!1,h(_.firstChild,g,null,null,null),wn(),_._vnode=g,ke&&console.error("Hydration completed but contains mismatches.")},h=(g,_,M,O,F,T=!1)=>{const $=ln(g)&&g.data==="[",E=()=>I(g,_,M,O,F,$),{type:j,ref:A,shapeFlag:G,patchFlag:ie}=_;let fe=g.nodeType;_.el=g,ie===-2&&(T=!1,_.dynamicChildren=null);let D=null;switch(j){case Tt:fe!==3?_.children===""?(c(_.el=s(""),i(g),g),D=g):D=E():(g.data!==_.children&&(ke=!0,g.data=_.children),D=o(g));break;case be:k(g)?(D=o(g),K(_.el=g.content.firstChild,g,M)):fe!==8||$?D=E():D=o(g);break;case Ht:if($&&(g=o(g),fe=g.nodeType),fe===1||fe===3){D=g;const X=!_.children.length;for(let V=0;V<_.staticCount;V++)X&&(_.children+=D.nodeType===1?D.outerHTML:D.data),V===_.staticCount-1&&(_.anchor=D),D=o(D);return $?o(D):D}else E();break;case me:$?D=w(g,_,M,O,F,T):D=E();break;default:if(G&1)(fe!==1||_.type.toLowerCase()!==g.tagName.toLowerCase())&&!k(g)?D=E():D=p(g,_,M,O,F,T);else if(G&6){_.slotScopeIds=F;const X=i(g);if($?D=N(g):ln(g)&&g.data==="teleport start"?D=N(g,g.data,"teleport end"):D=o(g),t(_,X,null,M,O,on(X),T),Ct(_)){let V;$?(V=oe(me),V.anchor=D?D.previousSibling:X.lastChild):V=g.nodeType===3?ei(""):oe("div"),V.el=g,_.component.subTree=V}}else G&64?fe!==8?D=E():D=_.type.hydrate(g,_,M,O,F,T,e,y):G&128&&(D=_.type.hydrate(g,_,M,O,on(i(g)),F,T,e,h))}return A!=null&&xn(A,null,O,_),D},p=(g,_,M,O,F,T)=>{T=T||!!_.dynamicChildren;const{type:$,props:E,patchFlag:j,shapeFlag:A,dirs:G,transition:ie}=_,fe=$==="input"||$==="option";if(fe||j!==-1){G&&Me(_,null,M,"created");let D=!1;if(k(g)){D=qo(O,ie)&&M&&M.vnode.props&&M.vnode.props.appear;const V=g.content.firstChild;D&&ie.beforeEnter(V),K(V,g,M),_.el=g=V}if(A&16&&!(E&&(E.innerHTML||E.textContent))){let V=y(g.firstChild,_,g,M,O,F,T);for(;V;){ke=!0;const $e=V;V=V.nextSibling,l($e)}}else A&8&&g.textContent!==_.children&&(ke=!0,g.textContent=_.children);if(E)if(fe||!T||j&48)for(const V in E)(fe&&(V.endsWith("value")||V==="indeterminate")||Wt(V)&&!bt(V)||V[0]===".")&&r(g,V,null,E[V],void 0,void 0,M);else E.onClick&&r(g,"onClick",null,E.onClick,void 0,void 0,M);let X;(X=E&&E.onVnodeBeforeMount)&&Ee(X,M,_),G&&Me(_,null,M,"beforeMount"),((X=E&&E.onVnodeMounted)||G||D)&&Lo(()=>{X&&Ee(X,M,_),D&&ie.enter(g),G&&Me(_,null,M,"mounted")},O)}return g.nextSibling},y=(g,_,M,O,F,T,$)=>{$=$||!!_.dynamicChildren;const E=_.children,j=E.length;for(let A=0;A{const{slotScopeIds:$}=_;$&&(F=F?F.concat($):$);const E=i(g),j=y(o(g),_,E,M,O,F,T);return j&&ln(j)&&j.data==="]"?o(_.anchor=j):(ke=!0,c(_.anchor=a("]"),E,j),j)},I=(g,_,M,O,F,T)=>{if(ke=!0,_.el=null,T){const j=N(g);for(;;){const A=o(g);if(A&&A!==j)l(A);else break}}const $=o(g),E=i(g);return l(g),n(null,_,E,$,M,O,on(E),F),$},N=(g,_="[",M="]")=>{let O=0;for(;g;)if(g=o(g),g&&ln(g)&&(g.data===_&&O++,g.data===M)){if(O===0)return o(g);O--}return g},K=(g,_,M)=>{const O=_.parentNode;O&&O.replaceChild(g,_);let F=M;for(;F;)F.vnode.el===_&&(F.vnode.el=F.subTree.el=g),F=F.parent},k=g=>g.nodeType===1&&g.tagName.toLowerCase()==="template";return[f,h]}const ge=Lo;function ac(e){return Wo(e)}function uc(e){return Wo(e,cc)}function Wo(e,t){const n=ro();n.__VUE__=!0;const{insert:r,remove:s,patchProp:o,createElement:i,createText:l,createComment:c,setText:a,setElementText:f,parentNode:h,nextSibling:p,setScopeId:y=xe,insertStaticContent:w}=e,I=(u,d,m,v=null,b=null,S=null,L=void 0,x=null,R=!!d.dynamicChildren)=>{if(u===d)return;u&&!it(u,d)&&(v=Jt(u),Le(u,b,S,!0),u=null),d.patchFlag===-2&&(R=!1,d.dynamicChildren=null);const{type:C,ref:P,shapeFlag:B}=d;switch(C){case Tt:N(u,d,m,v);break;case be:K(u,d,m,v);break;case Ht:u==null&&k(d,m,v,L);break;case me:A(u,d,m,v,b,S,L,x,R);break;default:B&1?M(u,d,m,v,b,S,L,x,R):B&6?G(u,d,m,v,b,S,L,x,R):(B&64||B&128)&&C.process(u,d,m,v,b,S,L,x,R,pt)}P!=null&&b&&xn(P,u&&u.ref,S,d||u,!d)},N=(u,d,m,v)=>{if(u==null)r(d.el=l(d.children),m,v);else{const b=d.el=u.el;d.children!==u.children&&a(b,d.children)}},K=(u,d,m,v)=>{u==null?r(d.el=c(d.children||""),m,v):d.el=u.el},k=(u,d,m,v)=>{[u.el,u.anchor]=w(u.children,d,m,v,u.el,u.anchor)},g=({el:u,anchor:d},m,v)=>{let b;for(;u&&u!==d;)b=p(u),r(u,m,v),u=b;r(d,m,v)},_=({el:u,anchor:d})=>{let m;for(;u&&u!==d;)m=p(u),s(u),u=m;s(d)},M=(u,d,m,v,b,S,L,x,R)=>{d.type==="svg"?L="svg":d.type==="math"&&(L="mathml"),u==null?O(d,m,v,b,S,L,x,R):$(u,d,b,S,L,x,R)},O=(u,d,m,v,b,S,L,x)=>{let R,C;const{props:P,shapeFlag:B,transition:H,dirs:W}=u;if(R=u.el=i(u.type,S,P&&P.is,P),B&8?f(R,u.children):B&16&&T(u.children,R,null,v,b,Qn(u,S),L,x),W&&Me(u,null,v,"created"),F(R,u,u.scopeId,L,v),P){for(const Q in P)Q!=="value"&&!bt(Q)&&o(R,Q,null,P[Q],S,u.children,v,b,He);"value"in P&&o(R,"value",null,P.value,S),(C=P.onVnodeBeforeMount)&&Ee(C,v,u)}W&&Me(u,null,v,"beforeMount");const z=qo(b,H);z&&H.beforeEnter(R),r(R,d,m),((C=P&&P.onVnodeMounted)||z||W)&&ge(()=>{C&&Ee(C,v,u),z&&H.enter(R),W&&Me(u,null,v,"mounted")},b)},F=(u,d,m,v,b)=>{if(m&&y(u,m),v)for(let S=0;S{for(let C=R;C{const x=d.el=u.el;let{patchFlag:R,dynamicChildren:C,dirs:P}=d;R|=u.patchFlag&16;const B=u.props||ee,H=d.props||ee;let W;if(m&&nt(m,!1),(W=H.onVnodeBeforeUpdate)&&Ee(W,m,d,u),P&&Me(d,u,m,"beforeUpdate"),m&&nt(m,!0),C?E(u.dynamicChildren,C,x,m,v,Qn(d,b),S):L||V(u,d,x,null,m,v,Qn(d,b),S,!1),R>0){if(R&16)j(x,d,B,H,m,v,b);else if(R&2&&B.class!==H.class&&o(x,"class",null,H.class,b),R&4&&o(x,"style",B.style,H.style,b),R&8){const z=d.dynamicProps;for(let Q=0;Q{W&&Ee(W,m,d,u),P&&Me(d,u,m,"updated")},v)},E=(u,d,m,v,b,S,L)=>{for(let x=0;x{if(m!==v){if(m!==ee)for(const x in m)!bt(x)&&!(x in v)&&o(u,x,m[x],null,L,d.children,b,S,He);for(const x in v){if(bt(x))continue;const R=v[x],C=m[x];R!==C&&x!=="value"&&o(u,x,C,R,L,d.children,b,S,He)}"value"in v&&o(u,"value",m.value,v.value,L)}},A=(u,d,m,v,b,S,L,x,R)=>{const C=d.el=u?u.el:l(""),P=d.anchor=u?u.anchor:l("");let{patchFlag:B,dynamicChildren:H,slotScopeIds:W}=d;W&&(x=x?x.concat(W):W),u==null?(r(C,m,v),r(P,m,v),T(d.children||[],m,P,b,S,L,x,R)):B>0&&B&64&&H&&u.dynamicChildren?(E(u.dynamicChildren,H,m,b,S,L,x),(d.key!=null||b&&d===b.subTree)&&qr(u,d,!0)):V(u,d,m,P,b,S,L,x,R)},G=(u,d,m,v,b,S,L,x,R)=>{d.slotScopeIds=x,u==null?d.shapeFlag&512?b.ctx.activate(d,m,v,L,R):ie(d,m,v,b,S,L,R):fe(u,d,R)},ie=(u,d,m,v,b,S,L)=>{const x=u.component=wc(u,v,b);if(Gt(u)&&(x.ctx.renderer=pt),Ec(x),x.asyncDep){if(b&&b.registerDep(x,D),!u.el){const R=x.subTree=oe(be);K(null,R,d,m)}}else D(x,u,d,m,b,S,L)},fe=(u,d,m)=>{const v=d.component=u.component;if(Tl(u,d,m))if(v.asyncDep&&!v.asyncResolved){X(v,d,m);return}else v.next=d,vl(v.update),v.effect.dirty=!0,v.update();else d.el=u.el,v.vnode=d},D=(u,d,m,v,b,S,L)=>{const x=()=>{if(u.isMounted){let{next:P,bu:B,u:H,parent:W,vnode:z}=u;{const gt=Go(u);if(gt){P&&(P.el=z.el,X(u,P,L)),gt.asyncDep.then(()=>{u.isUnmounted||x()});return}}let Q=P,te;nt(u,!1),P?(P.el=z.el,X(u,P,L)):P=z,B&&pn(B),(te=P.props&&P.props.onVnodeBeforeUpdate)&&Ee(te,W,P,z),nt(u,!0);const ae=zn(u),Ae=u.subTree;u.subTree=ae,I(Ae,ae,h(Ae.el),Jt(Ae),u,b,S),P.el=ae.el,Q===null&&Al(u,ae.el),H&&ge(H,b),(te=P.props&&P.props.onVnodeUpdated)&&ge(()=>Ee(te,W,P,z),b)}else{let P;const{el:B,props:H}=d,{bm:W,m:z,parent:Q}=u,te=Ct(d);if(nt(u,!1),W&&pn(W),!te&&(P=H&&H.onVnodeBeforeMount)&&Ee(P,Q,d),nt(u,!0),B&&qn){const ae=()=>{u.subTree=zn(u),qn(B,u.subTree,u,b,null)};te?d.type.__asyncLoader().then(()=>!u.isUnmounted&&ae()):ae()}else{const ae=u.subTree=zn(u);I(null,ae,m,v,u,b,S),d.el=ae.el}if(z&&ge(z,b),!te&&(P=H&&H.onVnodeMounted)){const ae=d;ge(()=>Ee(P,Q,ae),b)}(d.shapeFlag&256||Q&&Ct(Q.vnode)&&Q.vnode.shapeFlag&256)&&u.a&&ge(u.a,b),u.isMounted=!0,d=m=v=null}},R=u.effect=new Ir(x,xe,()=>Fn(C),u.scope),C=u.update=()=>{R.dirty&&R.run()};C.id=u.uid,nt(u,!0),C()},X=(u,d,m)=>{d.component=u;const v=u.vnode.props;u.vnode=d,u.next=null,nc(u,d.props,v,m),oc(u,d.children,m),dt(),us(u),ht()},V=(u,d,m,v,b,S,L,x,R=!1)=>{const C=u&&u.children,P=u?u.shapeFlag:0,B=d.children,{patchFlag:H,shapeFlag:W}=d;if(H>0){if(H&128){Yt(C,B,m,v,b,S,L,x,R);return}else if(H&256){$e(C,B,m,v,b,S,L,x,R);return}}W&8?(P&16&&He(C,b,S),B!==C&&f(m,B)):P&16?W&16?Yt(C,B,m,v,b,S,L,x,R):He(C,b,S,!0):(P&8&&f(m,""),W&16&&T(B,m,v,b,S,L,x,R))},$e=(u,d,m,v,b,S,L,x,R)=>{u=u||_t,d=d||_t;const C=u.length,P=d.length,B=Math.min(C,P);let H;for(H=0;HP?He(u,b,S,!0,!1,B):T(d,m,v,b,S,L,x,R,B)},Yt=(u,d,m,v,b,S,L,x,R)=>{let C=0;const P=d.length;let B=u.length-1,H=P-1;for(;C<=B&&C<=H;){const W=u[C],z=d[C]=R?ze(d[C]):Re(d[C]);if(it(W,z))I(W,z,m,null,b,S,L,x,R);else break;C++}for(;C<=B&&C<=H;){const W=u[B],z=d[H]=R?ze(d[H]):Re(d[H]);if(it(W,z))I(W,z,m,null,b,S,L,x,R);else break;B--,H--}if(C>B){if(C<=H){const W=H+1,z=WH)for(;C<=B;)Le(u[C],b,S,!0),C++;else{const W=C,z=C,Q=new Map;for(C=z;C<=H;C++){const _e=d[C]=R?ze(d[C]):Re(d[C]);_e.key!=null&&Q.set(_e.key,C)}let te,ae=0;const Ae=H-z+1;let gt=!1,Zr=0;const Ot=new Array(Ae);for(C=0;C=Ae){Le(_e,b,S,!0);continue}let Ie;if(_e.key!=null)Ie=Q.get(_e.key);else for(te=z;te<=H;te++)if(Ot[te-z]===0&&it(_e,d[te])){Ie=te;break}Ie===void 0?Le(_e,b,S,!0):(Ot[Ie-z]=C+1,Ie>=Zr?Zr=Ie:gt=!0,I(_e,d[Ie],m,null,b,S,L,x,R),ae++)}const es=gt?fc(Ot):_t;for(te=es.length-1,C=Ae-1;C>=0;C--){const _e=z+C,Ie=d[_e],ts=_e+1{const{el:S,type:L,transition:x,children:R,shapeFlag:C}=u;if(C&6){tt(u.component.subTree,d,m,v);return}if(C&128){u.suspense.move(d,m,v);return}if(C&64){L.move(u,d,m,pt);return}if(L===me){r(S,d,m);for(let B=0;Bx.enter(S),b);else{const{leave:B,delayLeave:H,afterLeave:W}=x,z=()=>r(S,d,m),Q=()=>{B(S,()=>{z(),W&&W()})};H?H(S,z,Q):Q()}else r(S,d,m)},Le=(u,d,m,v=!1,b=!1)=>{const{type:S,props:L,ref:x,children:R,dynamicChildren:C,shapeFlag:P,patchFlag:B,dirs:H}=u;if(x!=null&&xn(x,null,m,u,!0),P&256){d.ctx.deactivate(u);return}const W=P&1&&H,z=!Ct(u);let Q;if(z&&(Q=L&&L.onVnodeBeforeUnmount)&&Ee(Q,d,u),P&6)Si(u.component,m,v);else{if(P&128){u.suspense.unmount(m,v);return}W&&Me(u,null,d,"beforeUnmount"),P&64?u.type.remove(u,d,m,b,pt,v):C&&(S!==me||B>0&&B&64)?He(C,d,m,!1,!0):(S===me&&B&384||!b&&P&16)&&He(R,d,m),v&&Jr(u)}(z&&(Q=L&&L.onVnodeUnmounted)||W)&&ge(()=>{Q&&Ee(Q,d,u),W&&Me(u,null,d,"unmounted")},m)},Jr=u=>{const{type:d,el:m,anchor:v,transition:b}=u;if(d===me){xi(m,v);return}if(d===Ht){_(u);return}const S=()=>{s(m),b&&!b.persisted&&b.afterLeave&&b.afterLeave()};if(u.shapeFlag&1&&b&&!b.persisted){const{leave:L,delayLeave:x}=b,R=()=>L(m,S);x?x(u.el,S,R):R()}else S()},xi=(u,d)=>{let m;for(;u!==d;)m=p(u),s(u),u=m;s(d)},Si=(u,d,m)=>{const{bum:v,scope:b,update:S,subTree:L,um:x}=u;v&&pn(v),b.stop(),S&&(S.active=!1,Le(L,u,d,m)),x&&ge(x,d),ge(()=>{u.isUnmounted=!0},d),d&&d.pendingBranch&&!d.isUnmounted&&u.asyncDep&&!u.asyncResolved&&u.suspenseId===d.pendingId&&(d.deps--,d.deps===0&&d.resolve())},He=(u,d,m,v=!1,b=!1,S=0)=>{for(let L=S;Lu.shapeFlag&6?Jt(u.component.subTree):u.shapeFlag&128?u.suspense.next():p(u.anchor||u.el);let Kn=!1;const Qr=(u,d,m)=>{u==null?d._vnode&&Le(d._vnode,null,null,!0):I(d._vnode||null,u,d,null,null,null,m),Kn||(Kn=!0,us(),wn(),Kn=!1),d._vnode=u},pt={p:I,um:Le,m:tt,r:Jr,mt:ie,mc:T,pc:V,pbc:E,n:Jt,o:e};let Wn,qn;return t&&([Wn,qn]=t(pt)),{render:Qr,hydrate:Wn,createApp:Zl(Qr,Wn)}}function Qn({type:e,props:t},n){return n==="svg"&&e==="foreignObject"||n==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:n}function nt({effect:e,update:t},n){e.allowRecurse=t.allowRecurse=n}function qo(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function qr(e,t,n=!1){const r=e.children,s=t.children;if(U(r)&&U(s))for(let o=0;o>1,e[n[l]]0&&(t[r]=n[o-1]),n[o]=r)}}for(o=n.length,i=n[o-1];o-- >0;)n[o]=i,i=t[i];return n}function Go(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:Go(t)}const dc=e=>e.__isTeleport,$t=e=>e&&(e.disabled||e.disabled===""),Es=e=>typeof SVGElement<"u"&&e instanceof SVGElement,Cs=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,wr=(e,t)=>{const n=e&&e.to;return ne(n)?t?t(n):null:n},hc={name:"Teleport",__isTeleport:!0,process(e,t,n,r,s,o,i,l,c,a){const{mc:f,pc:h,pbc:p,o:{insert:y,querySelector:w,createText:I,createComment:N}}=a,K=$t(t.props);let{shapeFlag:k,children:g,dynamicChildren:_}=t;if(e==null){const M=t.el=I(""),O=t.anchor=I("");y(M,n,r),y(O,n,r);const F=t.target=wr(t.props,w),T=t.targetAnchor=I("");F&&(y(T,F),i==="svg"||Es(F)?i="svg":(i==="mathml"||Cs(F))&&(i="mathml"));const $=(E,j)=>{k&16&&f(g,E,j,s,o,i,l,c)};K?$(n,O):F&&$(F,T)}else{t.el=e.el;const M=t.anchor=e.anchor,O=t.target=e.target,F=t.targetAnchor=e.targetAnchor,T=$t(e.props),$=T?n:O,E=T?M:F;if(i==="svg"||Es(O)?i="svg":(i==="mathml"||Cs(O))&&(i="mathml"),_?(p(e.dynamicChildren,_,$,s,o,i,l),qr(e,t,!0)):c||h(e,t,$,E,s,o,i,l,!1),K)T?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):cn(t,n,M,a,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const j=t.target=wr(t.props,w);j&&cn(t,j,null,a,0)}else T&&cn(t,O,F,a,1)}zo(t)},remove(e,t,n,r,{um:s,o:{remove:o}},i){const{shapeFlag:l,children:c,anchor:a,targetAnchor:f,target:h,props:p}=e;if(h&&o(f),i&&o(a),l&16){const y=i||!$t(p);for(let w=0;w0?Oe||_t:null,gc(),kt>0&&Oe&&Oe.push(e),e}function fu(e,t,n,r,s,o){return Yo(Zo(e,t,n,r,s,o,!0))}function Jo(e,t,n,r,s){return Yo(oe(e,t,n,r,s,!0))}function Sn(e){return e?e.__v_isVNode===!0:!1}function it(e,t){return e.type===t.type&&e.key===t.key}const Bn="__vInternal",Qo=({key:e})=>e??null,gn=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?ne(e)||de(e)||q(e)?{i:le,r:e,k:t,f:!!n}:e:null);function Zo(e,t=null,n=null,r=0,s=null,o=e===me?0:1,i=!1,l=!1){const c={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Qo(t),ref:t&&gn(t),scopeId:Hn,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetAnchor:null,staticCount:0,shapeFlag:o,patchFlag:r,dynamicProps:s,dynamicChildren:null,appContext:null,ctx:le};return l?(Gr(c,n),o&128&&e.normalize(c)):n&&(c.shapeFlag|=ne(n)?8:16),kt>0&&!i&&Oe&&(c.patchFlag>0||o&6)&&c.patchFlag!==32&&Oe.push(c),c}const oe=mc;function mc(e,t=null,n=null,r=0,s=null,o=!1){if((!e||e===Ro)&&(e=be),Sn(e)){const l=et(e,t,!0);return n&&Gr(l,n),kt>0&&!o&&Oe&&(l.shapeFlag&6?Oe[Oe.indexOf(e)]=l:Oe.push(l)),l.patchFlag|=-2,l}if(Tc(e)&&(e=e.__vccOpts),t){t=yc(t);let{class:l,style:c}=t;l&&!ne(l)&&(t.class=Lr(l)),Z(c)&&(vo(c)&&!U(c)&&(c=ce({},c)),t.style=Or(c))}const i=ne(e)?1:Rl(e)?128:dc(e)?64:Z(e)?4:q(e)?2:0;return Zo(e,t,n,r,s,i,o,!0)}function yc(e){return e?vo(e)||Bn in e?ce({},e):e:null}function et(e,t,n=!1){const{props:r,ref:s,patchFlag:o,children:i}=e,l=t?_c(r||{},t):r;return{__v_isVNode:!0,__v_skip:!0,type:e.type,props:l,key:l&&Qo(l),ref:t&&t.ref?n&&s?U(s)?s.concat(gn(t)):[s,gn(t)]:gn(t):s,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:i,target:e.target,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==me?o===-1?16:o|16:o,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:e.transition,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&et(e.ssContent),ssFallback:e.ssFallback&&et(e.ssFallback),el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce}}function ei(e=" ",t=0){return oe(Tt,null,e,t)}function du(e,t){const n=oe(Ht,null,e);return n.staticCount=t,n}function hu(e="",t=!1){return t?(Xo(),Jo(be,null,e)):oe(be,null,e)}function Re(e){return e==null||typeof e=="boolean"?oe(be):U(e)?oe(me,null,e.slice()):typeof e=="object"?ze(e):oe(Tt,null,String(e))}function ze(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:et(e)}function Gr(e,t){let n=0;const{shapeFlag:r}=e;if(t==null)t=null;else if(U(t))n=16;else if(typeof t=="object")if(r&65){const s=t.default;s&&(s._c&&(s._d=!1),Gr(e,s()),s._c&&(s._d=!0));return}else{n=32;const s=t._;!s&&!(Bn in t)?t._ctx=le:s===3&&le&&(le.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else q(t)?(t={default:t,_ctx:le},n=32):(t=String(t),r&64?(n=16,t=[ei(t)]):n=8);e.children=t,e.shapeFlag|=n}function _c(...e){const t={};for(let n=0;nue||le;let Tn,Er;{const e=ro(),t=(n,r)=>{let s;return(s=e[n])||(s=e[n]=[]),s.push(r),o=>{s.length>1?s.forEach(i=>i(o)):s[0](o)}};Tn=t("__VUE_INSTANCE_SETTERS__",n=>ue=n),Er=t("__VUE_SSR_SETTERS__",n=>Xt=n)}const zt=e=>{const t=ue;return Tn(e),e.scope.on(),()=>{e.scope.off(),Tn(t)}},Ss=()=>{ue&&ue.scope.off(),Tn(null)};function ti(e){return e.vnode.shapeFlag&4}let Xt=!1;function Ec(e,t=!1){t&&Er(t);const{props:n,children:r}=e.vnode,s=ti(e);tc(e,n,s,t),sc(e,r);const o=s?Cc(e,t):void 0;return t&&Er(!1),o}function Cc(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=Mt(new Proxy(e.ctx,Wl));const{setup:r}=n;if(r){const s=e.setupContext=r.length>1?ri(e):null,o=zt(e);dt();const i=Je(r,e,0,[e.props,s]);if(ht(),o(),eo(i)){if(i.then(Ss,Ss),t)return i.then(l=>{Ts(e,l,t)}).catch(l=>{qt(l,e,0)});e.asyncDep=i}else Ts(e,i,t)}else ni(e,t)}function Ts(e,t,n){q(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:Z(t)&&(e.setupState=Co(t)),ni(e,n)}let As;function ni(e,t,n){const r=e.type;if(!e.render){if(!t&&As&&!r.render){const s=r.template||Kr(e).template;if(s){const{isCustomElement:o,compilerOptions:i}=e.appContext.config,{delimiters:l,compilerOptions:c}=r,a=ce(ce({isCustomElement:o,delimiters:l},i),c);r.render=As(s,a)}}e.render=r.render||xe}{const s=zt(e);dt();try{Gl(e)}finally{ht(),s()}}}function xc(e){return e.attrsProxy||(e.attrsProxy=new Proxy(e.attrs,{get(t,n){return ye(e,"get","$attrs"),t[n]}}))}function ri(e){const t=n=>{e.exposed=n||{}};return{get attrs(){return xc(e)},slots:e.slots,emit:e.emit,expose:t}}function kn(e){if(e.exposed)return e.exposeProxy||(e.exposeProxy=new Proxy(Co(Mt(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in Nt)return Nt[n](e)},has(t,n){return n in t||n in Nt}}))}function Sc(e,t=!0){return q(e)?e.displayName||e.name:e.name||t&&e.__name}function Tc(e){return q(e)&&"__vccOpts"in e}const re=(e,t)=>cl(e,t,Xt);function Cr(e,t,n){const r=arguments.length;return r===2?Z(t)&&!U(t)?Sn(t)?oe(e,null,[t]):oe(e,t):oe(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&Sn(n)&&(n=[n]),oe(e,t,n))}const Ac="3.4.21";/** +* @vue/runtime-dom v3.4.21 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/const Rc="http://www.w3.org/2000/svg",Oc="http://www.w3.org/1998/Math/MathML",Xe=typeof document<"u"?document:null,Rs=Xe&&Xe.createElement("template"),Lc={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,r)=>{const s=t==="svg"?Xe.createElementNS(Rc,e):t==="mathml"?Xe.createElementNS(Oc,e):Xe.createElement(e,n?{is:n}:void 0);return e==="select"&&r&&r.multiple!=null&&s.setAttribute("multiple",r.multiple),s},createText:e=>Xe.createTextNode(e),createComment:e=>Xe.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>Xe.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,r,s,o){const i=n?n.previousSibling:t.lastChild;if(s&&(s===o||s.nextSibling))for(;t.insertBefore(s.cloneNode(!0),n),!(s===o||!(s=s.nextSibling)););else{Rs.innerHTML=r==="svg"?`${e}`:r==="mathml"?`${e}`:e;const l=Rs.content;if(r==="svg"||r==="mathml"){const c=l.firstChild;for(;c.firstChild;)l.appendChild(c.firstChild);l.removeChild(c)}t.insertBefore(l,n)}return[i?i.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},Ke="transition",Lt="animation",Kt=Symbol("_vtc"),si=(e,{slots:t})=>Cr(Nl,Ic(e),t);si.displayName="Transition";const oi={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String};si.props=ce({},Mo,oi);const rt=(e,t=[])=>{U(e)?e.forEach(n=>n(...t)):e&&e(...t)},Os=e=>e?U(e)?e.some(t=>t.length>1):e.length>1:!1;function Ic(e){const t={};for(const A in e)A in oi||(t[A]=e[A]);if(e.css===!1)return t;const{name:n="v",type:r,duration:s,enterFromClass:o=`${n}-enter-from`,enterActiveClass:i=`${n}-enter-active`,enterToClass:l=`${n}-enter-to`,appearFromClass:c=o,appearActiveClass:a=i,appearToClass:f=l,leaveFromClass:h=`${n}-leave-from`,leaveActiveClass:p=`${n}-leave-active`,leaveToClass:y=`${n}-leave-to`}=e,w=Mc(s),I=w&&w[0],N=w&&w[1],{onBeforeEnter:K,onEnter:k,onEnterCancelled:g,onLeave:_,onLeaveCancelled:M,onBeforeAppear:O=K,onAppear:F=k,onAppearCancelled:T=g}=t,$=(A,G,ie)=>{st(A,G?f:l),st(A,G?a:i),ie&&ie()},E=(A,G)=>{A._isLeaving=!1,st(A,h),st(A,y),st(A,p),G&&G()},j=A=>(G,ie)=>{const fe=A?F:k,D=()=>$(G,A,ie);rt(fe,[G,D]),Ls(()=>{st(G,A?c:o),We(G,A?f:l),Os(fe)||Is(G,r,I,D)})};return ce(t,{onBeforeEnter(A){rt(K,[A]),We(A,o),We(A,i)},onBeforeAppear(A){rt(O,[A]),We(A,c),We(A,a)},onEnter:j(!1),onAppear:j(!0),onLeave(A,G){A._isLeaving=!0;const ie=()=>E(A,G);We(A,h),Fc(),We(A,p),Ls(()=>{A._isLeaving&&(st(A,h),We(A,y),Os(_)||Is(A,r,N,ie))}),rt(_,[A,ie])},onEnterCancelled(A){$(A,!1),rt(g,[A])},onAppearCancelled(A){$(A,!0),rt(T,[A])},onLeaveCancelled(A){E(A),rt(M,[A])}})}function Mc(e){if(e==null)return null;if(Z(e))return[Zn(e.enter),Zn(e.leave)];{const t=Zn(e);return[t,t]}}function Zn(e){return Ii(e)}function We(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[Kt]||(e[Kt]=new Set)).add(t)}function st(e,t){t.split(/\s+/).forEach(r=>r&&e.classList.remove(r));const n=e[Kt];n&&(n.delete(t),n.size||(e[Kt]=void 0))}function Ls(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let Pc=0;function Is(e,t,n,r){const s=e._endId=++Pc,o=()=>{s===e._endId&&r()};if(n)return setTimeout(o,n);const{type:i,timeout:l,propCount:c}=Nc(e,t);if(!i)return r();const a=i+"end";let f=0;const h=()=>{e.removeEventListener(a,p),o()},p=y=>{y.target===e&&++f>=c&&h()};setTimeout(()=>{f(n[w]||"").split(", "),s=r(`${Ke}Delay`),o=r(`${Ke}Duration`),i=Ms(s,o),l=r(`${Lt}Delay`),c=r(`${Lt}Duration`),a=Ms(l,c);let f=null,h=0,p=0;t===Ke?i>0&&(f=Ke,h=i,p=o.length):t===Lt?a>0&&(f=Lt,h=a,p=c.length):(h=Math.max(i,a),f=h>0?i>a?Ke:Lt:null,p=f?f===Ke?o.length:c.length:0);const y=f===Ke&&/\b(transform|all)(,|$)/.test(r(`${Ke}Property`).toString());return{type:f,timeout:h,propCount:p,hasTransform:y}}function Ms(e,t){for(;e.lengthPs(n)+Ps(e[r])))}function Ps(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function Fc(){return document.body.offsetHeight}function $c(e,t,n){const r=e[Kt];r&&(t=(t?[t,...r]:[...r]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const Ns=Symbol("_vod"),Hc=Symbol("_vsh"),jc=Symbol(""),Vc=/(^|;)\s*display\s*:/;function Dc(e,t,n){const r=e.style,s=ne(n);let o=!1;if(n&&!s){if(t)if(ne(t))for(const i of t.split(";")){const l=i.slice(0,i.indexOf(":")).trim();n[l]==null&&mn(r,l,"")}else for(const i in t)n[i]==null&&mn(r,i,"");for(const i in n)i==="display"&&(o=!0),mn(r,i,n[i])}else if(s){if(t!==n){const i=r[jc];i&&(n+=";"+i),r.cssText=n,o=Vc.test(n)}}else t&&e.removeAttribute("style");Ns in e&&(e[Ns]=o?r.display:"",e[Hc]&&(r.display="none"))}const Fs=/\s*!important$/;function mn(e,t,n){if(U(n))n.forEach(r=>mn(e,t,r));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const r=Bc(e,t);Fs.test(n)?e.setProperty(ft(r),n.replace(Fs,""),"important"):e[r]=n}}const $s=["Webkit","Moz","ms"],er={};function Bc(e,t){const n=er[t];if(n)return n;let r=Fe(t);if(r!=="filter"&&r in e)return er[t]=r;r=Ln(r);for(let s=0;s<$s.length;s++){const o=$s[s]+r;if(o in e)return er[t]=o}return t}const Hs="http://www.w3.org/1999/xlink";function Uc(e,t,n,r,s){if(r&&t.startsWith("xlink:"))n==null?e.removeAttributeNS(Hs,t.slice(6,t.length)):e.setAttributeNS(Hs,t,n);else{const o=Hi(t);n==null||o&&!so(n)?e.removeAttribute(t):e.setAttribute(t,o?"":n)}}function kc(e,t,n,r,s,o,i){if(t==="innerHTML"||t==="textContent"){r&&i(r,s,o),e[t]=n??"";return}const l=e.tagName;if(t==="value"&&l!=="PROGRESS"&&!l.includes("-")){const a=l==="OPTION"?e.getAttribute("value")||"":e.value,f=n??"";(a!==f||!("_value"in e))&&(e.value=f),n==null&&e.removeAttribute(t),e._value=n;return}let c=!1;if(n===""||n==null){const a=typeof e[t];a==="boolean"?n=so(n):n==null&&a==="string"?(n="",c=!0):a==="number"&&(n=0,c=!0)}try{e[t]=n}catch{}c&&e.removeAttribute(t)}function mt(e,t,n,r){e.addEventListener(t,n,r)}function Kc(e,t,n,r){e.removeEventListener(t,n,r)}const js=Symbol("_vei");function Wc(e,t,n,r,s=null){const o=e[js]||(e[js]={}),i=o[t];if(r&&i)i.value=r;else{const[l,c]=qc(t);if(r){const a=o[t]=Xc(r,s);mt(e,l,a,c)}else i&&(Kc(e,l,i,c),o[t]=void 0)}}const Vs=/(?:Once|Passive|Capture)$/;function qc(e){let t;if(Vs.test(e)){t={};let r;for(;r=e.match(Vs);)e=e.slice(0,e.length-r[0].length),t[r[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):ft(e.slice(2)),t]}let tr=0;const Gc=Promise.resolve(),zc=()=>tr||(Gc.then(()=>tr=0),tr=Date.now());function Xc(e,t){const n=r=>{if(!r._vts)r._vts=Date.now();else if(r._vts<=n.attached)return;Se(Yc(r,n.value),t,5,[r])};return n.value=e,n.attached=zc(),n}function Yc(e,t){if(U(t)){const n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map(r=>s=>!s._stopped&&r&&r(s))}else return t}const Ds=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,Jc=(e,t,n,r,s,o,i,l,c)=>{const a=s==="svg";t==="class"?$c(e,r,a):t==="style"?Dc(e,n,r):Wt(t)?Tr(t)||Wc(e,t,n,r,i):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):Qc(e,t,r,a))?kc(e,t,r,o,i,l,c):(t==="true-value"?e._trueValue=r:t==="false-value"&&(e._falseValue=r),Uc(e,t,r,a))};function Qc(e,t,n,r){if(r)return!!(t==="innerHTML"||t==="textContent"||t in e&&Ds(t)&&q(n));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const s=e.tagName;if(s==="IMG"||s==="VIDEO"||s==="CANVAS"||s==="SOURCE")return!1}return Ds(t)&&ne(n)?!1:t in e}const Bs=e=>{const t=e.props["onUpdate:modelValue"]||!1;return U(t)?n=>pn(t,n):t};function Zc(e){e.target.composing=!0}function Us(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const nr=Symbol("_assign"),pu={created(e,{modifiers:{lazy:t,trim:n,number:r}},s){e[nr]=Bs(s);const o=r||s.props&&s.props.type==="number";mt(e,t?"change":"input",i=>{if(i.target.composing)return;let l=e.value;n&&(l=l.trim()),o&&(l=ur(l)),e[nr](l)}),n&&mt(e,"change",()=>{e.value=e.value.trim()}),t||(mt(e,"compositionstart",Zc),mt(e,"compositionend",Us),mt(e,"change",Us))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,modifiers:{lazy:n,trim:r,number:s}},o){if(e[nr]=Bs(o),e.composing)return;const i=s||e.type==="number"?ur(e.value):e.value,l=t??"";i!==l&&(document.activeElement===e&&e.type!=="range"&&(n||r&&e.value.trim()===l)||(e.value=l))}},ea=["ctrl","shift","alt","meta"],ta={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>ea.some(n=>e[`${n}Key`]&&!t.includes(n))},gu=(e,t)=>{const n=e._withMods||(e._withMods={}),r=t.join(".");return n[r]||(n[r]=(s,...o)=>{for(let i=0;i{const n=e._withKeys||(e._withKeys={}),r=t.join(".");return n[r]||(n[r]=s=>{if(!("key"in s))return;const o=ft(s.key);if(t.some(i=>i===o||na[i]===o))return e(s)})},ii=ce({patchProp:Jc},Lc);let Vt,ks=!1;function ra(){return Vt||(Vt=ac(ii))}function sa(){return Vt=ks?Vt:uc(ii),ks=!0,Vt}const yu=(...e)=>{const t=ra().createApp(...e),{mount:n}=t;return t.mount=r=>{const s=ci(r);if(!s)return;const o=t._component;!q(o)&&!o.render&&!o.template&&(o.template=s.innerHTML),s.innerHTML="";const i=n(s,!1,li(s));return s instanceof Element&&(s.removeAttribute("v-cloak"),s.setAttribute("data-v-app","")),i},t},_u=(...e)=>{const t=sa().createApp(...e),{mount:n}=t;return t.mount=r=>{const s=ci(r);if(s)return n(s,!0,li(s))},t};function li(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function ci(e){return ne(e)?document.querySelector(e):e}const vu=(e,t)=>{const n=e.__vccOpts||e;for(const[r,s]of t)n[r]=s;return n},oa="modulepreload",ia=function(e){return"/"+e},Ks={},bu=function(t,n,r){let s=Promise.resolve();if(n&&n.length>0){const o=document.getElementsByTagName("link");s=Promise.all(n.map(i=>{if(i=ia(i),i in Ks)return;Ks[i]=!0;const l=i.endsWith(".css"),c=l?'[rel="stylesheet"]':"";if(!!r)for(let h=o.length-1;h>=0;h--){const p=o[h];if(p.href===i&&(!l||p.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${i}"]${c}`))return;const f=document.createElement("link");if(f.rel=l?"stylesheet":oa,l||(f.as="script",f.crossOrigin=""),f.href=i,document.head.appendChild(f),l)return new Promise((h,p)=>{f.addEventListener("load",h),f.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${i}`)))})}))}return s.then(()=>t()).catch(o=>{const i=new Event("vite:preloadError",{cancelable:!0});if(i.payload=o,window.dispatchEvent(i),!i.defaultPrevented)throw o})},la=window.__VP_SITE_DATA__;function zr(e){return io()?(Di(e),!0):!1}function Ne(e){return typeof e=="function"?e():Eo(e)}const ai=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const ca=Object.prototype.toString,aa=e=>ca.call(e)==="[object Object]",Qe=()=>{},xr=ua();function ua(){var e,t;return ai&&((e=window==null?void 0:window.navigator)==null?void 0:e.userAgent)&&(/iP(ad|hone|od)/.test(window.navigator.userAgent)||((t=window==null?void 0:window.navigator)==null?void 0:t.maxTouchPoints)>2&&/iPad|Macintosh/.test(window==null?void 0:window.navigator.userAgent))}function fa(e,t){function n(...r){return new Promise((s,o)=>{Promise.resolve(e(()=>t.apply(this,r),{fn:t,thisArg:this,args:r})).then(s).catch(o)})}return n}const ui=e=>e();function da(e,t={}){let n,r,s=Qe;const o=l=>{clearTimeout(l),s(),s=Qe};return l=>{const c=Ne(e),a=Ne(t.maxWait);return n&&o(n),c<=0||a!==void 0&&a<=0?(r&&(o(r),r=null),Promise.resolve(l())):new Promise((f,h)=>{s=t.rejectOnCancel?h:f,a&&!r&&(r=setTimeout(()=>{n&&o(n),r=null,f(l())},a)),n=setTimeout(()=>{r&&o(r),r=null,f(l())},c)})}}function ha(e=ui){const t=se(!0);function n(){t.value=!1}function r(){t.value=!0}const s=(...o)=>{t.value&&e(...o)};return{isActive:Pn(t),pause:n,resume:r,eventFilter:s}}function pa(e){return e||Un()}function fi(...e){if(e.length!==1)return gl(...e);const t=e[0];return typeof t=="function"?Pn(dl(()=>({get:t,set:Qe}))):se(t)}function di(e,t,n={}){const{eventFilter:r=ui,...s}=n;return Ve(e,fa(r,t),s)}function ga(e,t,n={}){const{eventFilter:r,...s}=n,{eventFilter:o,pause:i,resume:l,isActive:c}=ha(r);return{stop:di(e,t,{...s,eventFilter:o}),pause:i,resume:l,isActive:c}}function Xr(e,t=!0,n){pa()?Rt(e,n):t?e():Nn(e)}function wu(e,t,n={}){const{debounce:r=0,maxWait:s=void 0,...o}=n;return di(e,t,{...o,eventFilter:da(r,{maxWait:s})})}function Eu(e,t,n){let r;de(n)?r={evaluating:n}:r=n||{};const{lazy:s=!1,evaluating:o=void 0,shallow:i=!0,onError:l=Qe}=r,c=se(!s),a=i?Vr(t):se(t);let f=0;return Ur(async h=>{if(!c.value)return;f++;const p=f;let y=!1;o&&Promise.resolve().then(()=>{o.value=!0});try{const w=await e(I=>{h(()=>{o&&(o.value=!1),y||I()})});p===f&&(a.value=w)}catch(w){l(w)}finally{o&&p===f&&(o.value=!1),y=!0}}),s?re(()=>(c.value=!0,a.value)):a}function yt(e){var t;const n=Ne(e);return(t=n==null?void 0:n.$el)!=null?t:n}const Te=ai?window:void 0;function De(...e){let t,n,r,s;if(typeof e[0]=="string"||Array.isArray(e[0])?([n,r,s]=e,t=Te):[t,n,r,s]=e,!t)return Qe;Array.isArray(n)||(n=[n]),Array.isArray(r)||(r=[r]);const o=[],i=()=>{o.forEach(f=>f()),o.length=0},l=(f,h,p,y)=>(f.addEventListener(h,p,y),()=>f.removeEventListener(h,p,y)),c=Ve(()=>[yt(t),Ne(s)],([f,h])=>{if(i(),!f)return;const p=aa(h)?{...h}:h;o.push(...n.flatMap(y=>r.map(w=>l(f,y,w,p))))},{immediate:!0,flush:"post"}),a=()=>{c(),i()};return zr(a),a}let Ws=!1;function Cu(e,t,n={}){const{window:r=Te,ignore:s=[],capture:o=!0,detectIframe:i=!1}=n;if(!r)return Qe;xr&&!Ws&&(Ws=!0,Array.from(r.document.body.children).forEach(p=>p.addEventListener("click",Qe)),r.document.documentElement.addEventListener("click",Qe));let l=!0;const c=p=>s.some(y=>{if(typeof y=="string")return Array.from(r.document.querySelectorAll(y)).some(w=>w===p.target||p.composedPath().includes(w));{const w=yt(y);return w&&(p.target===w||p.composedPath().includes(w))}}),f=[De(r,"click",p=>{const y=yt(e);if(!(!y||y===p.target||p.composedPath().includes(y))){if(p.detail===0&&(l=!c(p)),!l){l=!0;return}t(p)}},{passive:!0,capture:o}),De(r,"pointerdown",p=>{const y=yt(e);l=!c(p)&&!!(y&&!p.composedPath().includes(y))},{passive:!0}),i&&De(r,"blur",p=>{setTimeout(()=>{var y;const w=yt(e);((y=r.document.activeElement)==null?void 0:y.tagName)==="IFRAME"&&!(w!=null&&w.contains(r.document.activeElement))&&t(p)},0)})].filter(Boolean);return()=>f.forEach(p=>p())}function ma(e){return typeof e=="function"?e:typeof e=="string"?t=>t.key===e:Array.isArray(e)?t=>e.includes(t.key):()=>!0}function xu(...e){let t,n,r={};e.length===3?(t=e[0],n=e[1],r=e[2]):e.length===2?typeof e[1]=="object"?(t=!0,n=e[0],r=e[1]):(t=e[0],n=e[1]):(t=!0,n=e[0]);const{target:s=Te,eventName:o="keydown",passive:i=!1,dedupe:l=!1}=r,c=ma(t);return De(s,o,f=>{f.repeat&&Ne(l)||c(f)&&n(f)},i)}function ya(){const e=se(!1),t=Un();return t&&Rt(()=>{e.value=!0},t),e}function _a(e){const t=ya();return re(()=>(t.value,!!e()))}function hi(e,t={}){const{window:n=Te}=t,r=_a(()=>n&&"matchMedia"in n&&typeof n.matchMedia=="function");let s;const o=se(!1),i=a=>{o.value=a.matches},l=()=>{s&&("removeEventListener"in s?s.removeEventListener("change",i):s.removeListener(i))},c=Ur(()=>{r.value&&(l(),s=n.matchMedia(Ne(e)),"addEventListener"in s?s.addEventListener("change",i):s.addListener(i),o.value=s.matches)});return zr(()=>{c(),l(),s=void 0}),o}const an=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},un="__vueuse_ssr_handlers__",va=ba();function ba(){return un in an||(an[un]=an[un]||{}),an[un]}function pi(e,t){return va[e]||t}function wa(e){return e==null?"any":e instanceof Set?"set":e instanceof Map?"map":e instanceof Date?"date":typeof e=="boolean"?"boolean":typeof e=="string"?"string":typeof e=="object"?"object":Number.isNaN(e)?"any":"number"}const Ea={boolean:{read:e=>e==="true",write:e=>String(e)},object:{read:e=>JSON.parse(e),write:e=>JSON.stringify(e)},number:{read:e=>Number.parseFloat(e),write:e=>String(e)},any:{read:e=>e,write:e=>String(e)},string:{read:e=>e,write:e=>String(e)},map:{read:e=>new Map(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e.entries()))},set:{read:e=>new Set(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e))},date:{read:e=>new Date(e),write:e=>e.toISOString()}},qs="vueuse-storage";function Yr(e,t,n,r={}){var s;const{flush:o="pre",deep:i=!0,listenToStorageChanges:l=!0,writeDefaults:c=!0,mergeDefaults:a=!1,shallow:f,window:h=Te,eventFilter:p,onError:y=E=>{console.error(E)},initOnMounted:w}=r,I=(f?Vr:se)(typeof t=="function"?t():t);if(!n)try{n=pi("getDefaultStorage",()=>{var E;return(E=Te)==null?void 0:E.localStorage})()}catch(E){y(E)}if(!n)return I;const N=Ne(t),K=wa(N),k=(s=r.serializer)!=null?s:Ea[K],{pause:g,resume:_}=ga(I,()=>O(I.value),{flush:o,deep:i,eventFilter:p});h&&l&&Xr(()=>{De(h,"storage",T),De(h,qs,$),w&&T()}),w||T();function M(E,j){h&&h.dispatchEvent(new CustomEvent(qs,{detail:{key:e,oldValue:E,newValue:j,storageArea:n}}))}function O(E){try{const j=n.getItem(e);if(E==null)M(j,null),n.removeItem(e);else{const A=k.write(E);j!==A&&(n.setItem(e,A),M(j,A))}}catch(j){y(j)}}function F(E){const j=E?E.newValue:n.getItem(e);if(j==null)return c&&N!=null&&n.setItem(e,k.write(N)),N;if(!E&&a){const A=k.read(j);return typeof a=="function"?a(A,N):K==="object"&&!Array.isArray(A)?{...N,...A}:A}else return typeof j!="string"?j:k.read(j)}function T(E){if(!(E&&E.storageArea!==n)){if(E&&E.key==null){I.value=N;return}if(!(E&&E.key!==e)){g();try{(E==null?void 0:E.newValue)!==k.write(I.value)&&(I.value=F(E))}catch(j){y(j)}finally{E?Nn(_):_()}}}}function $(E){T(E.detail)}return I}function gi(e){return hi("(prefers-color-scheme: dark)",e)}function Ca(e={}){const{selector:t="html",attribute:n="class",initialValue:r="auto",window:s=Te,storage:o,storageKey:i="vueuse-color-scheme",listenToStorageChanges:l=!0,storageRef:c,emitAuto:a,disableTransition:f=!0}=e,h={auto:"",light:"light",dark:"dark",...e.modes||{}},p=gi({window:s}),y=re(()=>p.value?"dark":"light"),w=c||(i==null?fi(r):Yr(i,r,o,{window:s,listenToStorageChanges:l})),I=re(()=>w.value==="auto"?y.value:w.value),N=pi("updateHTMLAttrs",(_,M,O)=>{const F=typeof _=="string"?s==null?void 0:s.document.querySelector(_):yt(_);if(!F)return;let T;if(f&&(T=s.document.createElement("style"),T.appendChild(document.createTextNode("*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),s.document.head.appendChild(T)),M==="class"){const $=O.split(/\s/g);Object.values(h).flatMap(E=>(E||"").split(/\s/g)).filter(Boolean).forEach(E=>{$.includes(E)?F.classList.add(E):F.classList.remove(E)})}else F.setAttribute(M,O);f&&(s.getComputedStyle(T).opacity,document.head.removeChild(T))});function K(_){var M;N(t,n,(M=h[_])!=null?M:_)}function k(_){e.onChanged?e.onChanged(_,K):K(_)}Ve(I,k,{flush:"post",immediate:!0}),Xr(()=>k(I.value));const g=re({get(){return a?w.value:I.value},set(_){w.value=_}});try{return Object.assign(g,{store:w,system:y,state:I})}catch{return g}}function xa(e={}){const{valueDark:t="dark",valueLight:n="",window:r=Te}=e,s=Ca({...e,onChanged:(l,c)=>{var a;e.onChanged?(a=e.onChanged)==null||a.call(e,l==="dark",c,l):c(l)},modes:{dark:t,light:n}}),o=re(()=>s.system?s.system.value:gi({window:r}).value?"dark":"light");return re({get(){return s.value==="dark"},set(l){const c=l?"dark":"light";o.value===c?s.value="auto":s.value=c}})}function rr(e){return typeof Window<"u"&&e instanceof Window?e.document.documentElement:typeof Document<"u"&&e instanceof Document?e.documentElement:e}function Su(e,t,n={}){const{window:r=Te}=n;return Yr(e,t,r==null?void 0:r.localStorage,n)}function mi(e){const t=window.getComputedStyle(e);if(t.overflowX==="scroll"||t.overflowY==="scroll"||t.overflowX==="auto"&&e.clientWidth1?!0:(t.preventDefault&&t.preventDefault(),!1)}const fn=new WeakMap;function Tu(e,t=!1){const n=se(t);let r=null;Ve(fi(e),i=>{const l=rr(Ne(i));if(l){const c=l;fn.get(c)||fn.set(c,c.style.overflow),n.value&&(c.style.overflow="hidden")}},{immediate:!0});const s=()=>{const i=rr(Ne(e));!i||n.value||(xr&&(r=De(i,"touchmove",l=>{Sa(l)},{passive:!1})),i.style.overflow="hidden",n.value=!0)},o=()=>{var i;const l=rr(Ne(e));!l||!n.value||(xr&&(r==null||r()),l.style.overflow=(i=fn.get(l))!=null?i:"",fn.delete(l),n.value=!1)};return zr(o),re({get(){return n.value},set(i){i?s():o()}})}function Au(e,t,n={}){const{window:r=Te}=n;return Yr(e,t,r==null?void 0:r.sessionStorage,n)}function Ru(e={}){const{window:t=Te,behavior:n="auto"}=e;if(!t)return{x:se(0),y:se(0)};const r=se(t.scrollX),s=se(t.scrollY),o=re({get(){return r.value},set(l){scrollTo({left:l,behavior:n})}}),i=re({get(){return s.value},set(l){scrollTo({top:l,behavior:n})}});return De(t,"scroll",()=>{r.value=t.scrollX,s.value=t.scrollY},{capture:!1,passive:!0}),{x:o,y:i}}function Ou(e={}){const{window:t=Te,initialWidth:n=Number.POSITIVE_INFINITY,initialHeight:r=Number.POSITIVE_INFINITY,listenOrientation:s=!0,includeScrollbar:o=!0}=e,i=se(n),l=se(r),c=()=>{t&&(o?(i.value=t.innerWidth,l.value=t.innerHeight):(i.value=t.document.documentElement.clientWidth,l.value=t.document.documentElement.clientHeight))};if(c(),Xr(c),De("resize",c,{passive:!0}),s){const a=hi("(orientation: portrait)");Ve(a,()=>c())}return{width:i,height:l}}var sr={BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1},or={};const yi=/^(?:[a-z]+:|\/\/)/i,Ta="vitepress-theme-appearance",Aa=/#.*$/,Ra=/[?#].*$/,Oa=/(?:(^|\/)index)?\.(?:md|html)$/,Ce=typeof document<"u",_i={relativePath:"",filePath:"",title:"404",description:"Not Found",headers:[],frontmatter:{sidebar:!1,layout:"page"},lastUpdated:0,isNotFound:!0};function La(e,t,n=!1){if(t===void 0)return!1;if(e=Gs(`/${e}`),n)return new RegExp(t).test(e);if(Gs(t)!==e)return!1;const r=t.match(Aa);return r?(Ce?location.hash:"")===r[0]:!0}function Gs(e){return decodeURI(e).replace(Ra,"").replace(Oa,"$1")}function Ia(e){return yi.test(e)}function Ma(e,t){var r,s,o,i,l,c,a;const n=Object.keys(e.locales).find(f=>f!=="root"&&!Ia(f)&&La(t,`/${f}/`,!0))||"root";return Object.assign({},e,{localeIndex:n,lang:((r=e.locales[n])==null?void 0:r.lang)??e.lang,dir:((s=e.locales[n])==null?void 0:s.dir)??e.dir,title:((o=e.locales[n])==null?void 0:o.title)??e.title,titleTemplate:((i=e.locales[n])==null?void 0:i.titleTemplate)??e.titleTemplate,description:((l=e.locales[n])==null?void 0:l.description)??e.description,head:bi(e.head,((c=e.locales[n])==null?void 0:c.head)??[]),themeConfig:{...e.themeConfig,...(a=e.locales[n])==null?void 0:a.themeConfig}})}function vi(e,t){const n=t.title||e.title,r=t.titleTemplate??e.titleTemplate;if(typeof r=="string"&&r.includes(":title"))return r.replace(/:title/g,n);const s=Pa(e.title,r);return n===s.slice(3)?n:`${n}${s}`}function Pa(e,t){return t===!1?"":t===!0||t===void 0?` | ${e}`:e===t?"":` | ${t}`}function Na(e,t){const[n,r]=t;if(n!=="meta")return!1;const s=Object.entries(r)[0];return s==null?!1:e.some(([o,i])=>o===n&&i[s[0]]===s[1])}function bi(e,t){return[...e.filter(n=>!Na(t,n)),...t]}const Fa=/[\u0000-\u001F"#$&*+,:;<=>?[\]^`{|}\u007F]/g,$a=/^[a-z]:/i;function zs(e){const t=$a.exec(e),n=t?t[0]:"";return n+e.slice(n.length).replace(Fa,"_").replace(/(^|\/)_+(?=[^/]*$)/,"$1")}const ir=new Set;function Ha(e){if(ir.size===0){const n=typeof process=="object"&&(or==null?void 0:or.VITE_EXTRA_EXTENSIONS)||(sr==null?void 0:sr.VITE_EXTRA_EXTENSIONS)||"";("3g2,3gp,aac,ai,apng,au,avif,bin,bmp,cer,class,conf,crl,css,csv,dll,doc,eps,epub,exe,gif,gz,ics,ief,jar,jpe,jpeg,jpg,js,json,jsonld,m4a,man,mid,midi,mjs,mov,mp2,mp3,mp4,mpe,mpeg,mpg,mpp,oga,ogg,ogv,ogx,opus,otf,p10,p7c,p7m,p7s,pdf,png,ps,qt,roff,rtf,rtx,ser,svg,t,tif,tiff,tr,ts,tsv,ttf,txt,vtt,wav,weba,webm,webp,woff,woff2,xhtml,xml,yaml,yml,zip"+(n&&typeof n=="string"?","+n:"")).split(",").forEach(r=>ir.add(r))}const t=e.split(".").pop();return t==null||!ir.has(t.toLowerCase())}function Lu(e){return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}const ja=Symbol(),ut=Vr(la);function Iu(e){const t=re(()=>Ma(ut.value,e.data.relativePath)),n=t.value.appearance,r=n==="force-dark"?se(!0):n?xa({storageKey:Ta,initialValue:()=>typeof n=="string"?n:"auto",...typeof n=="object"?n:{}}):se(!1);return{site:t,theme:re(()=>t.value.themeConfig),page:re(()=>e.data),frontmatter:re(()=>e.data.frontmatter),params:re(()=>e.data.params),lang:re(()=>t.value.lang),dir:re(()=>e.data.frontmatter.dir||t.value.dir),localeIndex:re(()=>t.value.localeIndex||"root"),title:re(()=>vi(t.value,e.data)),description:re(()=>e.data.description||t.value.description),isDark:r}}function Va(){const e=xt(ja);if(!e)throw new Error("vitepress data not properly injected in app");return e}function Da(e,t){return`${e}${t}`.replace(/\/+/g,"/")}function Xs(e){return yi.test(e)||!e.startsWith("/")?e:Da(ut.value.base,e)}function Ba(e){let t=e.replace(/\.html$/,"");if(t=decodeURIComponent(t),t=t.replace(/\/$/,"/index"),Ce){const n="/";t=zs(t.slice(n.length).replace(/\//g,"_")||"index")+".md";let r=__VP_HASH_MAP__[t.toLowerCase()];if(r||(t=t.endsWith("_index.md")?t.slice(0,-9)+".md":t.slice(0,-3)+"_index.md",r=__VP_HASH_MAP__[t.toLowerCase()]),!r)return null;t=`${n}assets/${t}.${r}.js`}else t=`./${zs(t.slice(1).replace(/\//g,"_"))}.md.js`;return t}let yn=[];function Mu(e){yn.push(e),Dn(()=>{yn=yn.filter(t=>t!==e)})}function Ua(){let e=ut.value.scrollOffset,t=0,n=24;if(typeof e=="object"&&"padding"in e&&(n=e.padding,e=e.selector),typeof e=="number")t=e;else if(typeof e=="string")t=Ys(e,n);else if(Array.isArray(e))for(const r of e){const s=Ys(r,n);if(s){t=s;break}}return t}function Ys(e,t){const n=document.querySelector(e);if(!n)return 0;const r=n.getBoundingClientRect().bottom;return r<0?0:r+t}const ka=Symbol(),wi="http://a.com",Ka=()=>({path:"/",component:null,data:_i});function Pu(e,t){const n=Mn(Ka()),r={route:n,go:s};async function s(l=Ce?location.href:"/"){var c,a;l=An(l),await((c=r.onBeforeRouteChange)==null?void 0:c.call(r,l))!==!1&&(Qs(l),await i(l),await((a=r.onAfterRouteChanged)==null?void 0:a.call(r,l)))}let o=null;async function i(l,c=0,a=!1){var p;if(await((p=r.onBeforePageLoad)==null?void 0:p.call(r,l))===!1)return;const f=new URL(l,wi),h=o=f.pathname;try{let y=await e(h);if(!y)throw new Error(`Page not found: ${h}`);if(o===h){o=null;const{default:w,__pageData:I}=y;if(!w)throw new Error(`Invalid route component: ${w}`);n.path=Ce?h:Xs(h),n.component=Mt(w),n.data=Mt(I),Ce&&Nn(()=>{let N=ut.value.base+I.relativePath.replace(/(?:(^|\/)index)?\.md$/,"$1");if(!ut.value.cleanUrls&&!N.endsWith("/")&&(N+=".html"),N!==f.pathname&&(f.pathname=N,l=N+f.search+f.hash,history.replaceState(null,"",l)),f.hash&&!c){let K=null;try{K=document.getElementById(decodeURIComponent(f.hash).slice(1))}catch(k){console.warn(k)}if(K){Js(K,f.hash);return}}window.scrollTo(0,c)})}}catch(y){if(!/fetch|Page not found/.test(y.message)&&!/^\/404(\.html|\/)?$/.test(l)&&console.error(y),!a)try{const w=await fetch(ut.value.base+"hashmap.json");window.__VP_HASH_MAP__=await w.json(),await i(l,c,!0);return}catch{}o===h&&(o=null,n.path=Ce?h:Xs(h),n.component=t?Mt(t):null,n.data=_i)}}return Ce&&(window.addEventListener("click",l=>{if(l.target.closest("button"))return;const a=l.target.closest("a");if(a&&!a.closest(".vp-raw")&&(a instanceof SVGElement||!a.download)){const{target:f}=a,{href:h,origin:p,pathname:y,hash:w,search:I}=new URL(a.href instanceof SVGAnimatedString?a.href.animVal:a.href,a.baseURI),N=window.location;!l.ctrlKey&&!l.shiftKey&&!l.altKey&&!l.metaKey&&!f&&p===N.origin&&Ha(y)&&(l.preventDefault(),y===N.pathname&&I===N.search?(w!==N.hash&&(history.pushState(null,"",w),window.dispatchEvent(new Event("hashchange"))),w?Js(a,w,a.classList.contains("header-anchor")):(Qs(h),window.scrollTo(0,0))):s(h))}},{capture:!0}),window.addEventListener("popstate",async l=>{var c;await i(An(location.href),l.state&&l.state.scrollPosition||0),(c=r.onAfterRouteChanged)==null||c.call(r,location.href)}),window.addEventListener("hashchange",l=>{l.preventDefault()})),r}function Wa(){const e=xt(ka);if(!e)throw new Error("useRouter() is called without provider.");return e}function Ei(){return Wa().route}function Js(e,t,n=!1){let r=null;try{r=e.classList.contains("header-anchor")?e:document.getElementById(decodeURIComponent(t).slice(1))}catch(s){console.warn(s)}if(r){let s=function(){!n||Math.abs(i-window.scrollY)>window.innerHeight?window.scrollTo(0,i):window.scrollTo({left:0,top:i,behavior:"smooth"})};const o=parseInt(window.getComputedStyle(r).paddingTop,10),i=window.scrollY+r.getBoundingClientRect().top-Ua()+o;requestAnimationFrame(s)}}function Qs(e){Ce&&An(e)!==An(location.href)&&(history.replaceState({scrollPosition:window.scrollY},document.title),history.pushState(null,"",e))}function An(e){const t=new URL(e,wi);return t.pathname=t.pathname.replace(/(^|\/)index(\.html)?$/,"$1"),ut.value.cleanUrls?t.pathname=t.pathname.replace(/\.html$/,""):!t.pathname.endsWith("/")&&!t.pathname.endsWith(".html")&&(t.pathname+=".html"),t.pathname+t.search+t.hash}const lr=()=>yn.forEach(e=>e()),Nu=kr({name:"VitePressContent",props:{as:{type:[Object,String],default:"div"}},setup(e){const t=Ei(),{site:n}=Va();return()=>Cr(e.as,n.value.contentProps??{style:{position:"relative"}},[t.component?Cr(t.component,{onVnodeMounted:lr,onVnodeUpdated:lr,onVnodeUnmounted:lr}):"404 Page Not Found"])}}),Fu=kr({setup(e,{slots:t}){const n=se(!1);return Rt(()=>{n.value=!0}),()=>n.value&&t.default?t.default():null}});function $u(){Ce&&window.addEventListener("click",e=>{var n;const t=e.target;if(t.matches(".vp-code-group input")){const r=(n=t.parentElement)==null?void 0:n.parentElement;if(!r)return;const s=Array.from(r.querySelectorAll("input")).indexOf(t);if(s<0)return;const o=r.querySelector(".blocks");if(!o)return;const i=Array.from(o.children).find(a=>a.classList.contains("active"));if(!i)return;const l=o.children[s];if(!l||i===l)return;i.classList.remove("active"),l.classList.add("active");const c=r==null?void 0:r.querySelector(`label[for="${t.id}"]`);c==null||c.scrollIntoView({block:"nearest"})}})}function Hu(){if(Ce){const e=new WeakMap;window.addEventListener("click",t=>{var r;const n=t.target;if(n.matches('div[class*="language-"] > button.copy')){const s=n.parentElement,o=(r=n.nextElementSibling)==null?void 0:r.nextElementSibling;if(!s||!o)return;const i=/language-(shellscript|shell|bash|sh|zsh)/.test(s.className),l=[".vp-copy-ignore",".diff.remove"],c=o.cloneNode(!0);c.querySelectorAll(l.join(",")).forEach(f=>f.remove());let a=c.textContent||"";i&&(a=a.replace(/^ *(\$|>) /gm,"").trim()),qa(a).then(()=>{n.classList.add("copied"),clearTimeout(e.get(n));const f=setTimeout(()=>{n.classList.remove("copied"),n.blur(),e.delete(n)},2e3);e.set(n,f)})}})}}async function qa(e){try{return navigator.clipboard.writeText(e)}catch{const t=document.createElement("textarea"),n=document.activeElement;t.value=e,t.setAttribute("readonly",""),t.style.contain="strict",t.style.position="absolute",t.style.left="-9999px",t.style.fontSize="12pt";const r=document.getSelection(),s=r?r.rangeCount>0&&r.getRangeAt(0):null;document.body.appendChild(t),t.select(),t.selectionStart=0,t.selectionEnd=e.length,document.execCommand("copy"),document.body.removeChild(t),s&&(r.removeAllRanges(),r.addRange(s)),n&&n.focus()}}function ju(e,t){let n=!0,r=[];const s=o=>{if(n){n=!1,o.forEach(l=>{const c=cr(l);for(const a of document.head.children)if(a.isEqualNode(c)){r.push(a);return}});return}const i=o.map(cr);r.forEach((l,c)=>{const a=i.findIndex(f=>f==null?void 0:f.isEqualNode(l??null));a!==-1?delete i[a]:(l==null||l.remove(),delete r[c])}),i.forEach(l=>l&&document.head.appendChild(l)),r=[...r,...i].filter(Boolean)};Ur(()=>{const o=e.data,i=t.value,l=o&&o.description,c=o&&o.frontmatter.head||[],a=vi(i,o);a!==document.title&&(document.title=a);const f=l||i.description;let h=document.querySelector("meta[name=description]");h?h.getAttribute("content")!==f&&h.setAttribute("content",f):cr(["meta",{name:"description",content:f}]),s(bi(i.head,za(c)))})}function cr([e,t,n]){const r=document.createElement(e);for(const s in t)r.setAttribute(s,t[s]);return n&&(r.innerHTML=n),e==="script"&&!t.async&&(r.async=!1),r}function Ga(e){return e[0]==="meta"&&e[1]&&e[1].name==="description"}function za(e){return e.filter(t=>!Ga(t))}const ar=new Set,Ci=()=>document.createElement("link"),Xa=e=>{const t=Ci();t.rel="prefetch",t.href=e,document.head.appendChild(t)},Ya=e=>{const t=new XMLHttpRequest;t.open("GET",e,t.withCredentials=!0),t.send()};let dn;const Ja=Ce&&(dn=Ci())&&dn.relList&&dn.relList.supports&&dn.relList.supports("prefetch")?Xa:Ya;function Vu(){if(!Ce||!window.IntersectionObserver)return;let e;if((e=navigator.connection)&&(e.saveData||/2g/.test(e.effectiveType)))return;const t=window.requestIdleCallback||setTimeout;let n=null;const r=()=>{n&&n.disconnect(),n=new IntersectionObserver(o=>{o.forEach(i=>{if(i.isIntersecting){const l=i.target;n.unobserve(l);const{pathname:c}=l;if(!ar.has(c)){ar.add(c);const a=Ba(c);a&&Ja(a)}}})}),t(()=>{document.querySelectorAll("#app a").forEach(o=>{const{hostname:i,pathname:l}=new URL(o.href instanceof SVGAnimatedString?o.href.animVal:o.href,o.baseURI),c=l.match(/\.\w+$/);c&&c[0]!==".html"||o.target!=="_blank"&&i===location.hostname&&(l!==location.pathname?n.observe(o):ar.add(l))})})};Rt(r);const s=Ei();Ve(()=>s.path,r),Dn(()=>{n&&n.disconnect()})}export{ec as $,Dn as A,ru as B,Dl as C,Ua as D,tu as E,me as F,iu as G,Vr as H,Mu as I,oe as J,nu as K,yi as L,Ei as M,_c as N,xt as O,Ou as P,Or as Q,Cu as R,xu as S,si as T,Nn as U,Ru as V,Pn as W,ou as X,bu as Y,Tu as Z,vu as _,ei as a,mu as a0,cu as a1,gu as a2,au as a3,Cr as a4,du as a5,ju as a6,ka as a7,Iu as a8,ja as a9,Nu as aa,Fu as ab,ut as ac,_u as ad,Pu as ae,Ba as af,Vu as ag,Hu as ah,$u as ai,yt as aj,zr as ak,Eu as al,Au as am,Su as an,wu as ao,Wa as ap,De as aq,$o as ar,su as as,pu as at,de as au,uu as av,Mt as aw,yu as ax,Lu as ay,Jo as b,fu as c,kr as d,hu as e,Ha as f,Xs as g,se as h,Ia as i,Ce as j,re as k,Rt as l,Zo as m,Lr as n,Xo as o,Eo as p,Za as q,lu as r,eu as s,Qa as t,Va as u,La as v,Cl as w,hi as x,Ve as y,Ur as z}; diff --git a/assets/chunks/theme.Dl8hKFPF.js b/assets/chunks/theme.Dl8hKFPF.js new file mode 100644 index 0000000..7962d55 --- /dev/null +++ b/assets/chunks/theme.Dl8hKFPF.js @@ -0,0 +1,7 @@ +function __vite__mapDeps(indexes) { + if (!__vite__mapDeps.viteFileDeps) { + __vite__mapDeps.viteFileDeps = ["assets/chunks/VPLocalSearchBox.CYXDraNv.js","assets/chunks/framework.BthLuVtL.js"] + } + return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) +} +import{d as _,o as a,c,r as l,n as N,a as D,t as S,b as g,w as v,T as ve,e as f,_ as k,u as Ve,i as ze,f as Re,g as pe,h as I,j as q,k as b,l as j,m as d,p as r,q as B,s as H,v as G,x as ie,y as z,z as x,A as he,B as Se,C as We,D as Ke,E as R,F as M,G as E,H as we,I as ee,J as m,K,L as Ie,M as te,N as Y,O as oe,P as qe,Q as fe,R as Je,S as le,U as Xe,V as Te,W as Ye,X as Qe,Y as Ze,Z as Ne,$ as Me,a0 as xe,a1 as et,a2 as tt,a3 as ot,a4 as st}from"./framework.BthLuVtL.js";const nt=_({__name:"VPBadge",props:{text:{},type:{default:"tip"}},setup(o){return(e,t)=>(a(),c("span",{class:N(["VPBadge",e.type])},[l(e.$slots,"default",{},()=>[D(S(e.text),1)])],2))}}),at={key:0,class:"VPBackdrop"},rt=_({__name:"VPBackdrop",props:{show:{type:Boolean}},setup(o){return(e,t)=>(a(),g(ve,{name:"fade"},{default:v(()=>[e.show?(a(),c("div",at)):f("",!0)]),_:1}))}}),it=k(rt,[["__scopeId","data-v-c79a1216"]]),L=Ve;function lt(o,e){let t,n=!1;return()=>{t&&clearTimeout(t),n?t=setTimeout(o,e):(o(),(n=!0)&&setTimeout(()=>n=!1,e))}}function ce(o){return/^\//.test(o)?o:`/${o}`}function _e(o){const{pathname:e,search:t,hash:n,protocol:s}=new URL(o,"http://a.com");if(ze(o)||o.startsWith("#")||!s.startsWith("http")||!Re(e))return o;const{site:i}=L(),u=e.endsWith("/")||e.endsWith(".html")?o:o.replace(/(?:(^\.+)\/)?.*$/,`$1${e.replace(/(\.md)?$/,i.value.cleanUrls?"":".html")}${t}${n}`);return pe(u)}const me=I(q?location.hash:"");q&&window.addEventListener("hashchange",()=>{me.value=location.hash});function J({removeCurrent:o=!0,correspondingLink:e=!1}={}){const{site:t,localeIndex:n,page:s,theme:i}=L(),u=b(()=>{var p,$;return{label:(p=t.value.locales[n.value])==null?void 0:p.label,link:(($=t.value.locales[n.value])==null?void 0:$.link)||(n.value==="root"?"/":`/${n.value}/`)}});return{localeLinks:b(()=>Object.entries(t.value.locales).flatMap(([p,$])=>o&&u.value.label===$.label?[]:{text:$.label,link:ct($.link||(p==="root"?"/":`/${p}/`),i.value.i18nRouting!==!1&&e,s.value.relativePath.slice(u.value.link.length-1),!t.value.cleanUrls)+me.value})),currentLang:u}}function ct(o,e,t,n){return e?o.replace(/\/$/,"")+ce(t.replace(/(^|\/)index\.md$/,"$1").replace(/\.md$/,n?".html":"")):o}const ut=o=>(B("data-v-f87ff6e4"),o=o(),H(),o),dt={class:"NotFound"},vt={class:"code"},pt={class:"title"},ht=ut(()=>d("div",{class:"divider"},null,-1)),ft={class:"quote"},_t={class:"action"},mt=["href","aria-label"],kt=_({__name:"NotFound",setup(o){const{site:e,theme:t}=L(),{localeLinks:n}=J({removeCurrent:!1}),s=I("/");return j(()=>{var u;const i=window.location.pathname.replace(e.value.base,"").replace(/(^.*?\/).*$/,"/$1");n.value.length&&(s.value=((u=n.value.find(({link:h})=>h.startsWith(i)))==null?void 0:u.link)||n.value[0].link)}),(i,u)=>{var h,p,$,P,y;return a(),c("div",dt,[d("p",vt,S(((h=r(t).notFound)==null?void 0:h.code)??"404"),1),d("h1",pt,S(((p=r(t).notFound)==null?void 0:p.title)??"PAGE NOT FOUND"),1),ht,d("blockquote",ft,S((($=r(t).notFound)==null?void 0:$.quote)??"But if you don't change your direction, and if you keep looking, you may end up where you are heading."),1),d("div",_t,[d("a",{class:"link",href:r(pe)(s.value),"aria-label":((P=r(t).notFound)==null?void 0:P.linkLabel)??"go to home"},S(((y=r(t).notFound)==null?void 0:y.linkText)??"Take me home"),9,mt)])])}}}),$t=k(kt,[["__scopeId","data-v-f87ff6e4"]]);function Ce(o,e){if(Array.isArray(o))return Q(o);if(o==null)return[];e=ce(e);const t=Object.keys(o).sort((s,i)=>i.split("/").length-s.split("/").length).find(s=>e.startsWith(ce(s))),n=t?o[t]:[];return Array.isArray(n)?Q(n):Q(n.items,n.base)}function gt(o){const e=[];let t=0;for(const n in o){const s=o[n];if(s.items){t=e.push(s);continue}e[t]||e.push({items:[]}),e[t].items.push(s)}return e}function bt(o){const e=[];function t(n){for(const s of n)s.text&&s.link&&e.push({text:s.text,link:s.link,docFooterText:s.docFooterText}),s.items&&t(s.items)}return t(o),e}function ue(o,e){return Array.isArray(e)?e.some(t=>ue(o,t)):G(o,e.link)?!0:e.items?ue(o,e.items):!1}function Q(o,e){return[...o].map(t=>{const n={...t},s=n.base||e;return s&&n.link&&(n.link=s+n.link),n.items&&(n.items=Q(n.items,s)),n})}function O(){const{frontmatter:o,page:e,theme:t}=L(),n=ie("(min-width: 960px)"),s=I(!1),i=b(()=>{const A=t.value.sidebar,T=e.value.relativePath;return A?Ce(A,T):[]}),u=I(i.value);z(i,(A,T)=>{JSON.stringify(A)!==JSON.stringify(T)&&(u.value=i.value)});const h=b(()=>o.value.sidebar!==!1&&u.value.length>0&&o.value.layout!=="home"),p=b(()=>$?o.value.aside==null?t.value.aside==="left":o.value.aside==="left":!1),$=b(()=>o.value.layout==="home"?!1:o.value.aside!=null?!!o.value.aside:t.value.aside!==!1),P=b(()=>h.value&&n.value),y=b(()=>h.value?gt(u.value):[]);function V(){s.value=!0}function w(){s.value=!1}function C(){s.value?w():V()}return{isOpen:s,sidebar:u,sidebarGroups:y,hasSidebar:h,hasAside:$,leftAside:p,isSidebarEnabled:P,open:V,close:w,toggle:C}}function yt(o,e){let t;x(()=>{t=o.value?document.activeElement:void 0}),j(()=>{window.addEventListener("keyup",n)}),he(()=>{window.removeEventListener("keyup",n)});function n(s){s.key==="Escape"&&o.value&&(e(),t==null||t.focus())}}function Pt(o){const{page:e}=L(),t=I(!1),n=b(()=>o.value.collapsed!=null),s=b(()=>!!o.value.link),i=I(!1),u=()=>{i.value=G(e.value.relativePath,o.value.link)};z([e,o,me],u),j(u);const h=b(()=>i.value?!0:o.value.items?ue(e.value.relativePath,o.value.items):!1),p=b(()=>!!(o.value.items&&o.value.items.length));x(()=>{t.value=!!(n.value&&o.value.collapsed)}),Se(()=>{(i.value||h.value)&&(t.value=!1)});function $(){n.value&&(t.value=!t.value)}return{collapsed:t,collapsible:n,isLink:s,isActiveLink:i,hasActiveLink:h,hasChildren:p,toggle:$}}function Lt(){const{hasSidebar:o}=O(),e=ie("(min-width: 960px)"),t=ie("(min-width: 1280px)");return{isAsideEnabled:b(()=>!t.value&&!e.value?!1:o.value?t.value:e.value)}}const de=[];function Ae(o){return typeof o.outline=="object"&&!Array.isArray(o.outline)&&o.outline.label||o.outlineTitle||"On this page"}function ke(o){const e=[...document.querySelectorAll(".VPDoc :where(h1,h2,h3,h4,h5,h6)")].filter(t=>t.id&&t.hasChildNodes()).map(t=>{const n=Number(t.tagName[1]);return{element:t,title:Vt(t),link:"#"+t.id,level:n}});return St(e,o)}function Vt(o){let e="";for(const t of o.childNodes)if(t.nodeType===1){if(t.classList.contains("VPBadge")||t.classList.contains("header-anchor")||t.classList.contains("ignore-header"))continue;e+=t.textContent}else t.nodeType===3&&(e+=t.textContent);return e.trim()}function St(o,e){if(e===!1)return[];const t=(typeof e=="object"&&!Array.isArray(e)?e.level:e)||2,[n,s]=typeof t=="number"?[t,t]:t==="deep"?[2,6]:t;o=o.filter(u=>u.level>=n&&u.level<=s),de.length=0;for(const{element:u,link:h}of o)de.push({element:u,link:h});const i=[];e:for(let u=0;u=0;p--){const $=o[p];if($.level{requestAnimationFrame(i),window.addEventListener("scroll",n)}),We(()=>{u(location.hash)}),he(()=>{window.removeEventListener("scroll",n)});function i(){if(!t.value)return;const h=window.scrollY,p=window.innerHeight,$=document.body.offsetHeight,P=Math.abs(h+p-$)<1,y=de.map(({element:w,link:C})=>({link:C,top:It(w)})).filter(({top:w})=>!Number.isNaN(w)).sort((w,C)=>w.top-C.top);if(!y.length){u(null);return}if(h<1){u(null);return}if(P){u(y[y.length-1].link);return}let V=null;for(const{link:w,top:C}of y){if(C>h+Ke()+4)break;V=w}u(V)}function u(h){s&&s.classList.remove("active"),h==null?s=null:s=o.value.querySelector(`a[href="${decodeURIComponent(h)}"]`);const p=s;p?(p.classList.add("active"),e.value.style.top=p.offsetTop+39+"px",e.value.style.opacity="1"):(e.value.style.top="33px",e.value.style.opacity="0")}}function It(o){let e=0;for(;o!==document.body;){if(o===null)return NaN;e+=o.offsetTop,o=o.offsetParent}return e}const Tt=["href","title"],Nt=_({__name:"VPDocOutlineItem",props:{headers:{},root:{type:Boolean}},setup(o){function e({target:t}){const n=t.href.split("#")[1],s=document.getElementById(decodeURIComponent(n));s==null||s.focus({preventScroll:!0})}return(t,n)=>{const s=R("VPDocOutlineItem",!0);return a(),c("ul",{class:N(["VPDocOutlineItem",t.root?"root":"nested"])},[(a(!0),c(M,null,E(t.headers,({children:i,link:u,title:h})=>(a(),c("li",null,[d("a",{class:"outline-link",href:u,onClick:e,title:h},S(h),9,Tt),i!=null&&i.length?(a(),g(s,{key:0,headers:i},null,8,["headers"])):f("",!0)]))),256))],2)}}}),Be=k(Nt,[["__scopeId","data-v-b933a997"]]),Mt=o=>(B("data-v-935f8a84"),o=o(),H(),o),Ct={class:"content"},At={class:"outline-title",role:"heading","aria-level":"2"},Bt={"aria-labelledby":"doc-outline-aria-label"},Ht=Mt(()=>d("span",{class:"visually-hidden",id:"doc-outline-aria-label"}," Table of Contents for current page ",-1)),Et=_({__name:"VPDocAsideOutline",setup(o){const{frontmatter:e,theme:t}=L(),n=we([]);ee(()=>{n.value=ke(e.value.outline??t.value.outline)});const s=I(),i=I();return wt(s,i),(u,h)=>(a(),c("div",{class:N(["VPDocAsideOutline",{"has-outline":n.value.length>0}]),ref_key:"container",ref:s,role:"navigation"},[d("div",Ct,[d("div",{class:"outline-marker",ref_key:"marker",ref:i},null,512),d("div",At,S(r(Ae)(r(t))),1),d("nav",Bt,[Ht,m(Be,{headers:n.value,root:!0},null,8,["headers"])])])],2))}}),Dt=k(Et,[["__scopeId","data-v-935f8a84"]]),Ft={class:"VPDocAsideCarbonAds"},Ot=_({__name:"VPDocAsideCarbonAds",props:{carbonAds:{}},setup(o){const e=()=>null;return(t,n)=>(a(),c("div",Ft,[m(r(e),{"carbon-ads":t.carbonAds},null,8,["carbon-ads"])]))}}),Ut=o=>(B("data-v-3f215769"),o=o(),H(),o),Gt={class:"VPDocAside"},jt=Ut(()=>d("div",{class:"spacer"},null,-1)),zt=_({__name:"VPDocAside",setup(o){const{theme:e}=L();return(t,n)=>(a(),c("div",Gt,[l(t.$slots,"aside-top",{},void 0,!0),l(t.$slots,"aside-outline-before",{},void 0,!0),m(Dt),l(t.$slots,"aside-outline-after",{},void 0,!0),jt,l(t.$slots,"aside-ads-before",{},void 0,!0),r(e).carbonAds?(a(),g(Ot,{key:0,"carbon-ads":r(e).carbonAds},null,8,["carbon-ads"])):f("",!0),l(t.$slots,"aside-ads-after",{},void 0,!0),l(t.$slots,"aside-bottom",{},void 0,!0)]))}}),Rt=k(zt,[["__scopeId","data-v-3f215769"]]);function Wt(){const{theme:o,page:e}=L();return b(()=>{const{text:t="Edit this page",pattern:n=""}=o.value.editLink||{};let s;return typeof n=="function"?s=n(e.value):s=n.replace(/:path/g,e.value.filePath),{url:s,text:t}})}function Kt(){const{page:o,theme:e,frontmatter:t}=L();return b(()=>{var p,$,P,y,V,w,C,A;const n=Ce(e.value.sidebar,o.value.relativePath),s=bt(n),i=s.findIndex(T=>G(o.value.relativePath,T.link)),u=((p=e.value.docFooter)==null?void 0:p.prev)===!1&&!t.value.prev||t.value.prev===!1,h=(($=e.value.docFooter)==null?void 0:$.next)===!1&&!t.value.next||t.value.next===!1;return{prev:u?void 0:{text:(typeof t.value.prev=="string"?t.value.prev:typeof t.value.prev=="object"?t.value.prev.text:void 0)??((P=s[i-1])==null?void 0:P.docFooterText)??((y=s[i-1])==null?void 0:y.text),link:(typeof t.value.prev=="object"?t.value.prev.link:void 0)??((V=s[i-1])==null?void 0:V.link)},next:h?void 0:{text:(typeof t.value.next=="string"?t.value.next:typeof t.value.next=="object"?t.value.next.text:void 0)??((w=s[i+1])==null?void 0:w.docFooterText)??((C=s[i+1])==null?void 0:C.text),link:(typeof t.value.next=="object"?t.value.next.link:void 0)??((A=s[i+1])==null?void 0:A.link)}}})}const F=_({__name:"VPLink",props:{tag:{},href:{},noIcon:{type:Boolean},target:{},rel:{}},setup(o){const e=o,t=b(()=>e.tag??(e.href?"a":"span")),n=b(()=>e.href&&Ie.test(e.href));return(s,i)=>(a(),g(K(t.value),{class:N(["VPLink",{link:s.href,"vp-external-link-icon":n.value,"no-icon":s.noIcon}]),href:s.href?r(_e)(s.href):void 0,target:s.target??(n.value?"_blank":void 0),rel:s.rel??(n.value?"noreferrer":void 0)},{default:v(()=>[l(s.$slots,"default")]),_:3},8,["class","href","target","rel"]))}}),qt={class:"VPLastUpdated"},Jt=["datetime"],Xt=_({__name:"VPDocFooterLastUpdated",setup(o){const{theme:e,page:t,frontmatter:n,lang:s}=L(),i=b(()=>new Date(n.value.lastUpdated??t.value.lastUpdated)),u=b(()=>i.value.toISOString()),h=I("");return j(()=>{x(()=>{var p,$,P;h.value=new Intl.DateTimeFormat(($=(p=e.value.lastUpdated)==null?void 0:p.formatOptions)!=null&&$.forceLocale?s.value:void 0,((P=e.value.lastUpdated)==null?void 0:P.formatOptions)??{dateStyle:"short",timeStyle:"short"}).format(i.value)})}),(p,$)=>{var P;return a(),c("p",qt,[D(S(((P=r(e).lastUpdated)==null?void 0:P.text)||r(e).lastUpdatedText||"Last updated")+": ",1),d("time",{datetime:u.value},S(h.value),9,Jt)])}}}),Yt=k(Xt,[["__scopeId","data-v-7e05ebdb"]]),Qt=o=>(B("data-v-09de1c0f"),o=o(),H(),o),Zt={key:0,class:"VPDocFooter"},xt={key:0,class:"edit-info"},eo={key:0,class:"edit-link"},to=Qt(()=>d("span",{class:"vpi-square-pen edit-link-icon"},null,-1)),oo={key:1,class:"last-updated"},so={key:1,class:"prev-next"},no={class:"pager"},ao=["innerHTML"],ro=["innerHTML"],io={class:"pager"},lo=["innerHTML"],co=["innerHTML"],uo=_({__name:"VPDocFooter",setup(o){const{theme:e,page:t,frontmatter:n}=L(),s=Wt(),i=Kt(),u=b(()=>e.value.editLink&&n.value.editLink!==!1),h=b(()=>t.value.lastUpdated&&n.value.lastUpdated!==!1),p=b(()=>u.value||h.value||i.value.prev||i.value.next);return($,P)=>{var y,V,w,C;return p.value?(a(),c("footer",Zt,[l($.$slots,"doc-footer-before",{},void 0,!0),u.value||h.value?(a(),c("div",xt,[u.value?(a(),c("div",eo,[m(F,{class:"edit-link-button",href:r(s).url,"no-icon":!0},{default:v(()=>[to,D(" "+S(r(s).text),1)]),_:1},8,["href"])])):f("",!0),h.value?(a(),c("div",oo,[m(Yt)])):f("",!0)])):f("",!0),(y=r(i).prev)!=null&&y.link||(V=r(i).next)!=null&&V.link?(a(),c("nav",so,[d("div",no,[(w=r(i).prev)!=null&&w.link?(a(),g(F,{key:0,class:"pager-link prev",href:r(i).prev.link},{default:v(()=>{var A;return[d("span",{class:"desc",innerHTML:((A=r(e).docFooter)==null?void 0:A.prev)||"Previous page"},null,8,ao),d("span",{class:"title",innerHTML:r(i).prev.text},null,8,ro)]}),_:1},8,["href"])):f("",!0)]),d("div",io,[(C=r(i).next)!=null&&C.link?(a(),g(F,{key:0,class:"pager-link next",href:r(i).next.link},{default:v(()=>{var A;return[d("span",{class:"desc",innerHTML:((A=r(e).docFooter)==null?void 0:A.next)||"Next page"},null,8,lo),d("span",{class:"title",innerHTML:r(i).next.text},null,8,co)]}),_:1},8,["href"])):f("",!0)])])):f("",!0)])):f("",!0)}}}),vo=k(uo,[["__scopeId","data-v-09de1c0f"]]),po=o=>(B("data-v-39a288b8"),o=o(),H(),o),ho={class:"container"},fo=po(()=>d("div",{class:"aside-curtain"},null,-1)),_o={class:"aside-container"},mo={class:"aside-content"},ko={class:"content"},$o={class:"content-container"},go={class:"main"},bo=_({__name:"VPDoc",setup(o){const{theme:e}=L(),t=te(),{hasSidebar:n,hasAside:s,leftAside:i}=O(),u=b(()=>t.path.replace(/[./]+/g,"_").replace(/_html$/,""));return(h,p)=>{const $=R("Content");return a(),c("div",{class:N(["VPDoc",{"has-sidebar":r(n),"has-aside":r(s)}])},[l(h.$slots,"doc-top",{},void 0,!0),d("div",ho,[r(s)?(a(),c("div",{key:0,class:N(["aside",{"left-aside":r(i)}])},[fo,d("div",_o,[d("div",mo,[m(Rt,null,{"aside-top":v(()=>[l(h.$slots,"aside-top",{},void 0,!0)]),"aside-bottom":v(()=>[l(h.$slots,"aside-bottom",{},void 0,!0)]),"aside-outline-before":v(()=>[l(h.$slots,"aside-outline-before",{},void 0,!0)]),"aside-outline-after":v(()=>[l(h.$slots,"aside-outline-after",{},void 0,!0)]),"aside-ads-before":v(()=>[l(h.$slots,"aside-ads-before",{},void 0,!0)]),"aside-ads-after":v(()=>[l(h.$slots,"aside-ads-after",{},void 0,!0)]),_:3})])])],2)):f("",!0),d("div",ko,[d("div",$o,[l(h.$slots,"doc-before",{},void 0,!0),d("main",go,[m($,{class:N(["vp-doc",[u.value,r(e).externalLinkIcon&&"external-link-icon-enabled"]])},null,8,["class"])]),m(vo,null,{"doc-footer-before":v(()=>[l(h.$slots,"doc-footer-before",{},void 0,!0)]),_:3}),l(h.$slots,"doc-after",{},void 0,!0)])])]),l(h.$slots,"doc-bottom",{},void 0,!0)],2)}}}),yo=k(bo,[["__scopeId","data-v-39a288b8"]]),Po=_({__name:"VPButton",props:{tag:{},size:{default:"medium"},theme:{default:"brand"},text:{},href:{},target:{},rel:{}},setup(o){const e=o,t=b(()=>e.href&&Ie.test(e.href)),n=b(()=>e.tag||e.href?"a":"button");return(s,i)=>(a(),g(K(n.value),{class:N(["VPButton",[s.size,s.theme]]),href:s.href?r(_e)(s.href):void 0,target:e.target??(t.value?"_blank":void 0),rel:e.rel??(t.value?"noreferrer":void 0)},{default:v(()=>[D(S(s.text),1)]),_:1},8,["class","href","target","rel"]))}}),Lo=k(Po,[["__scopeId","data-v-cad61b99"]]),Vo=["src","alt"],So=_({inheritAttrs:!1,__name:"VPImage",props:{image:{},alt:{}},setup(o){return(e,t)=>{const n=R("VPImage",!0);return e.image?(a(),c(M,{key:0},[typeof e.image=="string"||"src"in e.image?(a(),c("img",Y({key:0,class:"VPImage"},typeof e.image=="string"?e.$attrs:{...e.image,...e.$attrs},{src:r(pe)(typeof e.image=="string"?e.image:e.image.src),alt:e.alt??(typeof e.image=="string"?"":e.image.alt||"")}),null,16,Vo)):(a(),c(M,{key:1},[m(n,Y({class:"dark",image:e.image.dark,alt:e.image.alt},e.$attrs),null,16,["image","alt"]),m(n,Y({class:"light",image:e.image.light,alt:e.image.alt},e.$attrs),null,16,["image","alt"])],64))],64)):f("",!0)}}}),Z=k(So,[["__scopeId","data-v-8426fc1a"]]),wo=o=>(B("data-v-303bb580"),o=o(),H(),o),Io={class:"container"},To={class:"main"},No={key:0,class:"name"},Mo=["innerHTML"],Co=["innerHTML"],Ao=["innerHTML"],Bo={key:0,class:"actions"},Ho={key:0,class:"image"},Eo={class:"image-container"},Do=wo(()=>d("div",{class:"image-bg"},null,-1)),Fo=_({__name:"VPHero",props:{name:{},text:{},tagline:{},image:{},actions:{}},setup(o){const e=oe("hero-image-slot-exists");return(t,n)=>(a(),c("div",{class:N(["VPHero",{"has-image":t.image||r(e)}])},[d("div",Io,[d("div",To,[l(t.$slots,"home-hero-info-before",{},void 0,!0),l(t.$slots,"home-hero-info",{},()=>[t.name?(a(),c("h1",No,[d("span",{innerHTML:t.name,class:"clip"},null,8,Mo)])):f("",!0),t.text?(a(),c("p",{key:1,innerHTML:t.text,class:"text"},null,8,Co)):f("",!0),t.tagline?(a(),c("p",{key:2,innerHTML:t.tagline,class:"tagline"},null,8,Ao)):f("",!0)],!0),l(t.$slots,"home-hero-info-after",{},void 0,!0),t.actions?(a(),c("div",Bo,[(a(!0),c(M,null,E(t.actions,s=>(a(),c("div",{key:s.link,class:"action"},[m(Lo,{tag:"a",size:"medium",theme:s.theme,text:s.text,href:s.link,target:s.target,rel:s.rel},null,8,["theme","text","href","target","rel"])]))),128))])):f("",!0),l(t.$slots,"home-hero-actions-after",{},void 0,!0)]),t.image||r(e)?(a(),c("div",Ho,[d("div",Eo,[Do,l(t.$slots,"home-hero-image",{},()=>[t.image?(a(),g(Z,{key:0,class:"image-src",image:t.image},null,8,["image"])):f("",!0)],!0)])])):f("",!0)])],2))}}),Oo=k(Fo,[["__scopeId","data-v-303bb580"]]),Uo=_({__name:"VPHomeHero",setup(o){const{frontmatter:e}=L();return(t,n)=>r(e).hero?(a(),g(Oo,{key:0,class:"VPHomeHero",name:r(e).hero.name,text:r(e).hero.text,tagline:r(e).hero.tagline,image:r(e).hero.image,actions:r(e).hero.actions},{"home-hero-info-before":v(()=>[l(t.$slots,"home-hero-info-before")]),"home-hero-info":v(()=>[l(t.$slots,"home-hero-info")]),"home-hero-info-after":v(()=>[l(t.$slots,"home-hero-info-after")]),"home-hero-actions-after":v(()=>[l(t.$slots,"home-hero-actions-after")]),"home-hero-image":v(()=>[l(t.$slots,"home-hero-image")]),_:3},8,["name","text","tagline","image","actions"])):f("",!0)}}),Go=o=>(B("data-v-a3976bdc"),o=o(),H(),o),jo={class:"box"},zo={key:0,class:"icon"},Ro=["innerHTML"],Wo=["innerHTML"],Ko=["innerHTML"],qo={key:4,class:"link-text"},Jo={class:"link-text-value"},Xo=Go(()=>d("span",{class:"vpi-arrow-right link-text-icon"},null,-1)),Yo=_({__name:"VPFeature",props:{icon:{},title:{},details:{},link:{},linkText:{},rel:{},target:{}},setup(o){return(e,t)=>(a(),g(F,{class:"VPFeature",href:e.link,rel:e.rel,target:e.target,"no-icon":!0,tag:e.link?"a":"div"},{default:v(()=>[d("article",jo,[typeof e.icon=="object"&&e.icon.wrap?(a(),c("div",zo,[m(Z,{image:e.icon,alt:e.icon.alt,height:e.icon.height||48,width:e.icon.width||48},null,8,["image","alt","height","width"])])):typeof e.icon=="object"?(a(),g(Z,{key:1,image:e.icon,alt:e.icon.alt,height:e.icon.height||48,width:e.icon.width||48},null,8,["image","alt","height","width"])):e.icon?(a(),c("div",{key:2,class:"icon",innerHTML:e.icon},null,8,Ro)):f("",!0),d("h2",{class:"title",innerHTML:e.title},null,8,Wo),e.details?(a(),c("p",{key:3,class:"details",innerHTML:e.details},null,8,Ko)):f("",!0),e.linkText?(a(),c("div",qo,[d("p",Jo,[D(S(e.linkText)+" ",1),Xo])])):f("",!0)])]),_:1},8,["href","rel","target","tag"]))}}),Qo=k(Yo,[["__scopeId","data-v-a3976bdc"]]),Zo={key:0,class:"VPFeatures"},xo={class:"container"},es={class:"items"},ts=_({__name:"VPFeatures",props:{features:{}},setup(o){const e=o,t=b(()=>{const n=e.features.length;if(n){if(n===2)return"grid-2";if(n===3)return"grid-3";if(n%3===0)return"grid-6";if(n>3)return"grid-4"}else return});return(n,s)=>n.features?(a(),c("div",Zo,[d("div",xo,[d("div",es,[(a(!0),c(M,null,E(n.features,i=>(a(),c("div",{key:i.title,class:N(["item",[t.value]])},[m(Qo,{icon:i.icon,title:i.title,details:i.details,link:i.link,"link-text":i.linkText,rel:i.rel,target:i.target},null,8,["icon","title","details","link","link-text","rel","target"])],2))),128))])])])):f("",!0)}}),os=k(ts,[["__scopeId","data-v-a6181336"]]),ss=_({__name:"VPHomeFeatures",setup(o){const{frontmatter:e}=L();return(t,n)=>r(e).features?(a(),g(os,{key:0,class:"VPHomeFeatures",features:r(e).features},null,8,["features"])):f("",!0)}}),ns=_({__name:"VPHomeContent",setup(o){const{width:e}=qe({includeScrollbar:!1});return(t,n)=>(a(),c("div",{class:"vp-doc container",style:fe(r(e)?{"--vp-offset":`calc(50% - ${r(e)/2}px)`}:{})},[l(t.$slots,"default",{},void 0,!0)],4))}}),as=k(ns,[["__scopeId","data-v-82d4af08"]]),rs={class:"VPHome"},is=_({__name:"VPHome",setup(o){const{frontmatter:e}=L();return(t,n)=>{const s=R("Content");return a(),c("div",rs,[l(t.$slots,"home-hero-before",{},void 0,!0),m(Uo,null,{"home-hero-info-before":v(()=>[l(t.$slots,"home-hero-info-before",{},void 0,!0)]),"home-hero-info":v(()=>[l(t.$slots,"home-hero-info",{},void 0,!0)]),"home-hero-info-after":v(()=>[l(t.$slots,"home-hero-info-after",{},void 0,!0)]),"home-hero-actions-after":v(()=>[l(t.$slots,"home-hero-actions-after",{},void 0,!0)]),"home-hero-image":v(()=>[l(t.$slots,"home-hero-image",{},void 0,!0)]),_:3}),l(t.$slots,"home-hero-after",{},void 0,!0),l(t.$slots,"home-features-before",{},void 0,!0),m(ss),l(t.$slots,"home-features-after",{},void 0,!0),r(e).markdownStyles!==!1?(a(),g(as,{key:0},{default:v(()=>[m(s)]),_:1})):(a(),g(s,{key:1}))])}}}),ls=k(is,[["__scopeId","data-v-686f80a6"]]),cs={},us={class:"VPPage"};function ds(o,e){const t=R("Content");return a(),c("div",us,[l(o.$slots,"page-top"),m(t),l(o.$slots,"page-bottom")])}const vs=k(cs,[["render",ds]]),ps=_({__name:"VPContent",setup(o){const{page:e,frontmatter:t}=L(),{hasSidebar:n}=O();return(s,i)=>(a(),c("div",{class:N(["VPContent",{"has-sidebar":r(n),"is-home":r(t).layout==="home"}]),id:"VPContent"},[r(e).isNotFound?l(s.$slots,"not-found",{key:0},()=>[m($t)],!0):r(t).layout==="page"?(a(),g(vs,{key:1},{"page-top":v(()=>[l(s.$slots,"page-top",{},void 0,!0)]),"page-bottom":v(()=>[l(s.$slots,"page-bottom",{},void 0,!0)]),_:3})):r(t).layout==="home"?(a(),g(ls,{key:2},{"home-hero-before":v(()=>[l(s.$slots,"home-hero-before",{},void 0,!0)]),"home-hero-info-before":v(()=>[l(s.$slots,"home-hero-info-before",{},void 0,!0)]),"home-hero-info":v(()=>[l(s.$slots,"home-hero-info",{},void 0,!0)]),"home-hero-info-after":v(()=>[l(s.$slots,"home-hero-info-after",{},void 0,!0)]),"home-hero-actions-after":v(()=>[l(s.$slots,"home-hero-actions-after",{},void 0,!0)]),"home-hero-image":v(()=>[l(s.$slots,"home-hero-image",{},void 0,!0)]),"home-hero-after":v(()=>[l(s.$slots,"home-hero-after",{},void 0,!0)]),"home-features-before":v(()=>[l(s.$slots,"home-features-before",{},void 0,!0)]),"home-features-after":v(()=>[l(s.$slots,"home-features-after",{},void 0,!0)]),_:3})):r(t).layout&&r(t).layout!=="doc"?(a(),g(K(r(t).layout),{key:3})):(a(),g(yo,{key:4},{"doc-top":v(()=>[l(s.$slots,"doc-top",{},void 0,!0)]),"doc-bottom":v(()=>[l(s.$slots,"doc-bottom",{},void 0,!0)]),"doc-footer-before":v(()=>[l(s.$slots,"doc-footer-before",{},void 0,!0)]),"doc-before":v(()=>[l(s.$slots,"doc-before",{},void 0,!0)]),"doc-after":v(()=>[l(s.$slots,"doc-after",{},void 0,!0)]),"aside-top":v(()=>[l(s.$slots,"aside-top",{},void 0,!0)]),"aside-outline-before":v(()=>[l(s.$slots,"aside-outline-before",{},void 0,!0)]),"aside-outline-after":v(()=>[l(s.$slots,"aside-outline-after",{},void 0,!0)]),"aside-ads-before":v(()=>[l(s.$slots,"aside-ads-before",{},void 0,!0)]),"aside-ads-after":v(()=>[l(s.$slots,"aside-ads-after",{},void 0,!0)]),"aside-bottom":v(()=>[l(s.$slots,"aside-bottom",{},void 0,!0)]),_:3}))],2))}}),hs=k(ps,[["__scopeId","data-v-1428d186"]]),fs={class:"container"},_s=["innerHTML"],ms=["innerHTML"],ks=_({__name:"VPFooter",setup(o){const{theme:e,frontmatter:t}=L(),{hasSidebar:n}=O();return(s,i)=>r(e).footer&&r(t).footer!==!1?(a(),c("footer",{key:0,class:N(["VPFooter",{"has-sidebar":r(n)}])},[d("div",fs,[r(e).footer.message?(a(),c("p",{key:0,class:"message",innerHTML:r(e).footer.message},null,8,_s)):f("",!0),r(e).footer.copyright?(a(),c("p",{key:1,class:"copyright",innerHTML:r(e).footer.copyright},null,8,ms)):f("",!0)])],2)):f("",!0)}}),$s=k(ks,[["__scopeId","data-v-e315a0ad"]]);function He(){const{theme:o,frontmatter:e}=L(),t=we([]),n=b(()=>t.value.length>0);return ee(()=>{t.value=ke(e.value.outline??o.value.outline)}),{headers:t,hasLocalNav:n}}const gs=o=>(B("data-v-d2ecc192"),o=o(),H(),o),bs=gs(()=>d("span",{class:"vpi-chevron-right icon"},null,-1)),ys={class:"header"},Ps={class:"outline"},Ls=_({__name:"VPLocalNavOutlineDropdown",props:{headers:{},navHeight:{}},setup(o){const e=o,{theme:t}=L(),n=I(!1),s=I(0),i=I(),u=I();Je(i,()=>{n.value=!1}),le("Escape",()=>{n.value=!1}),ee(()=>{n.value=!1});function h(){n.value=!n.value,s.value=window.innerHeight+Math.min(window.scrollY-e.navHeight,0)}function p(P){P.target.classList.contains("outline-link")&&(u.value&&(u.value.style.transition="none"),Xe(()=>{n.value=!1}))}function $(){n.value=!1,window.scrollTo({top:0,left:0,behavior:"smooth"})}return(P,y)=>(a(),c("div",{class:"VPLocalNavOutlineDropdown",style:fe({"--vp-vh":s.value+"px"}),ref_key:"main",ref:i},[P.headers.length>0?(a(),c("button",{key:0,onClick:h,class:N({open:n.value})},[D(S(r(Ae)(r(t)))+" ",1),bs],2)):(a(),c("button",{key:1,onClick:$},S(r(t).returnToTopLabel||"Return to top"),1)),m(ve,{name:"flyout"},{default:v(()=>[n.value?(a(),c("div",{key:0,ref_key:"items",ref:u,class:"items",onClick:p},[d("div",ys,[d("a",{class:"top-link",href:"#",onClick:$},S(r(t).returnToTopLabel||"Return to top"),1)]),d("div",Ps,[m(Be,{headers:P.headers},null,8,["headers"])])],512)):f("",!0)]),_:1})],4))}}),Vs=k(Ls,[["__scopeId","data-v-d2ecc192"]]),Ss=o=>(B("data-v-a6f0e41e"),o=o(),H(),o),ws={class:"container"},Is=["aria-expanded"],Ts=Ss(()=>d("span",{class:"vpi-align-left menu-icon"},null,-1)),Ns={class:"menu-text"},Ms=_({__name:"VPLocalNav",props:{open:{type:Boolean}},emits:["open-menu"],setup(o){const{theme:e,frontmatter:t}=L(),{hasSidebar:n}=O(),{headers:s}=He(),{y:i}=Te(),u=I(0);j(()=>{u.value=parseInt(getComputedStyle(document.documentElement).getPropertyValue("--vp-nav-height"))}),ee(()=>{s.value=ke(t.value.outline??e.value.outline)});const h=b(()=>s.value.length===0),p=b(()=>h.value&&!n.value),$=b(()=>({VPLocalNav:!0,"has-sidebar":n.value,empty:h.value,fixed:p.value}));return(P,y)=>r(t).layout!=="home"&&(!p.value||r(i)>=u.value)?(a(),c("div",{key:0,class:N($.value)},[d("div",ws,[r(n)?(a(),c("button",{key:0,class:"menu","aria-expanded":P.open,"aria-controls":"VPSidebarNav",onClick:y[0]||(y[0]=V=>P.$emit("open-menu"))},[Ts,d("span",Ns,S(r(e).sidebarMenuLabel||"Menu"),1)],8,Is)):f("",!0),m(Vs,{headers:r(s),navHeight:u.value},null,8,["headers","navHeight"])])],2)):f("",!0)}}),Cs=k(Ms,[["__scopeId","data-v-a6f0e41e"]]);function As(){const o=I(!1);function e(){o.value=!0,window.addEventListener("resize",s)}function t(){o.value=!1,window.removeEventListener("resize",s)}function n(){o.value?t():e()}function s(){window.outerWidth>=768&&t()}const i=te();return z(()=>i.path,t),{isScreenOpen:o,openScreen:e,closeScreen:t,toggleScreen:n}}const Bs={},Hs={class:"VPSwitch",type:"button",role:"switch"},Es={class:"check"},Ds={key:0,class:"icon"};function Fs(o,e){return a(),c("button",Hs,[d("span",Es,[o.$slots.default?(a(),c("span",Ds,[l(o.$slots,"default",{},void 0,!0)])):f("",!0)])])}const Os=k(Bs,[["render",Fs],["__scopeId","data-v-1d5665e3"]]),Ee=o=>(B("data-v-d1f28634"),o=o(),H(),o),Us=Ee(()=>d("span",{class:"vpi-sun sun"},null,-1)),Gs=Ee(()=>d("span",{class:"vpi-moon moon"},null,-1)),js=_({__name:"VPSwitchAppearance",setup(o){const{isDark:e,theme:t}=L(),n=oe("toggle-appearance",()=>{e.value=!e.value}),s=b(()=>e.value?t.value.lightModeSwitchTitle||"Switch to light theme":t.value.darkModeSwitchTitle||"Switch to dark theme");return(i,u)=>(a(),g(Os,{title:s.value,class:"VPSwitchAppearance","aria-checked":r(e),onClick:r(n)},{default:v(()=>[Us,Gs]),_:1},8,["title","aria-checked","onClick"]))}}),$e=k(js,[["__scopeId","data-v-d1f28634"]]),zs={key:0,class:"VPNavBarAppearance"},Rs=_({__name:"VPNavBarAppearance",setup(o){const{site:e}=L();return(t,n)=>r(e).appearance&&r(e).appearance!=="force-dark"?(a(),c("div",zs,[m($e)])):f("",!0)}}),Ws=k(Rs,[["__scopeId","data-v-e6aabb21"]]),ge=I();let De=!1,re=0;function Ks(o){const e=I(!1);if(q){!De&&qs(),re++;const t=z(ge,n=>{var s,i,u;n===o.el.value||(s=o.el.value)!=null&&s.contains(n)?(e.value=!0,(i=o.onFocus)==null||i.call(o)):(e.value=!1,(u=o.onBlur)==null||u.call(o))});he(()=>{t(),re--,re||Js()})}return Ye(e)}function qs(){document.addEventListener("focusin",Fe),De=!0,ge.value=document.activeElement}function Js(){document.removeEventListener("focusin",Fe)}function Fe(){ge.value=document.activeElement}const Xs={class:"VPMenuLink"},Ys=_({__name:"VPMenuLink",props:{item:{}},setup(o){const{page:e}=L();return(t,n)=>(a(),c("div",Xs,[m(F,{class:N({active:r(G)(r(e).relativePath,t.item.activeMatch||t.item.link,!!t.item.activeMatch)}),href:t.item.link,target:t.item.target,rel:t.item.rel},{default:v(()=>[D(S(t.item.text),1)]),_:1},8,["class","href","target","rel"])]))}}),se=k(Ys,[["__scopeId","data-v-43f1e123"]]),Qs={class:"VPMenuGroup"},Zs={key:0,class:"title"},xs=_({__name:"VPMenuGroup",props:{text:{},items:{}},setup(o){return(e,t)=>(a(),c("div",Qs,[e.text?(a(),c("p",Zs,S(e.text),1)):f("",!0),(a(!0),c(M,null,E(e.items,n=>(a(),c(M,null,["link"in n?(a(),g(se,{key:0,item:n},null,8,["item"])):f("",!0)],64))),256))]))}}),en=k(xs,[["__scopeId","data-v-69e747b5"]]),tn={class:"VPMenu"},on={key:0,class:"items"},sn=_({__name:"VPMenu",props:{items:{}},setup(o){return(e,t)=>(a(),c("div",tn,[e.items?(a(),c("div",on,[(a(!0),c(M,null,E(e.items,n=>(a(),c(M,{key:n.text},["link"in n?(a(),g(se,{key:0,item:n},null,8,["item"])):(a(),g(en,{key:1,text:n.text,items:n.items},null,8,["text","items"]))],64))),128))])):f("",!0),l(e.$slots,"default",{},void 0,!0)]))}}),nn=k(sn,[["__scopeId","data-v-e7ea1737"]]),an=o=>(B("data-v-b6c34ac9"),o=o(),H(),o),rn=["aria-expanded","aria-label"],ln={key:0,class:"text"},cn=["innerHTML"],un=an(()=>d("span",{class:"vpi-chevron-down text-icon"},null,-1)),dn={key:1,class:"vpi-more-horizontal icon"},vn={class:"menu"},pn=_({__name:"VPFlyout",props:{icon:{},button:{},label:{},items:{}},setup(o){const e=I(!1),t=I();Ks({el:t,onBlur:n});function n(){e.value=!1}return(s,i)=>(a(),c("div",{class:"VPFlyout",ref_key:"el",ref:t,onMouseenter:i[1]||(i[1]=u=>e.value=!0),onMouseleave:i[2]||(i[2]=u=>e.value=!1)},[d("button",{type:"button",class:"button","aria-haspopup":"true","aria-expanded":e.value,"aria-label":s.label,onClick:i[0]||(i[0]=u=>e.value=!e.value)},[s.button||s.icon?(a(),c("span",ln,[s.icon?(a(),c("span",{key:0,class:N([s.icon,"option-icon"])},null,2)):f("",!0),s.button?(a(),c("span",{key:1,innerHTML:s.button},null,8,cn)):f("",!0),un])):(a(),c("span",dn))],8,rn),d("div",vn,[m(nn,{items:s.items},{default:v(()=>[l(s.$slots,"default",{},void 0,!0)]),_:3},8,["items"])])],544))}}),be=k(pn,[["__scopeId","data-v-b6c34ac9"]]),hn=["href","aria-label","innerHTML"],fn=_({__name:"VPSocialLink",props:{icon:{},link:{},ariaLabel:{}},setup(o){const e=o,t=b(()=>typeof e.icon=="object"?e.icon.svg:``);return(n,s)=>(a(),c("a",{class:"VPSocialLink no-icon",href:n.link,"aria-label":n.ariaLabel??(typeof n.icon=="string"?n.icon:""),target:"_blank",rel:"noopener",innerHTML:t.value},null,8,hn))}}),_n=k(fn,[["__scopeId","data-v-eee4e7cb"]]),mn={class:"VPSocialLinks"},kn=_({__name:"VPSocialLinks",props:{links:{}},setup(o){return(e,t)=>(a(),c("div",mn,[(a(!0),c(M,null,E(e.links,({link:n,icon:s,ariaLabel:i})=>(a(),g(_n,{key:n,icon:s,link:n,ariaLabel:i},null,8,["icon","link","ariaLabel"]))),128))]))}}),ye=k(kn,[["__scopeId","data-v-7bc22406"]]),$n={key:0,class:"group translations"},gn={class:"trans-title"},bn={key:1,class:"group"},yn={class:"item appearance"},Pn={class:"label"},Ln={class:"appearance-action"},Vn={key:2,class:"group"},Sn={class:"item social-links"},wn=_({__name:"VPNavBarExtra",setup(o){const{site:e,theme:t}=L(),{localeLinks:n,currentLang:s}=J({correspondingLink:!0}),i=b(()=>n.value.length&&s.value.label||e.value.appearance||t.value.socialLinks);return(u,h)=>i.value?(a(),g(be,{key:0,class:"VPNavBarExtra",label:"extra navigation"},{default:v(()=>[r(n).length&&r(s).label?(a(),c("div",$n,[d("p",gn,S(r(s).label),1),(a(!0),c(M,null,E(r(n),p=>(a(),g(se,{key:p.link,item:p},null,8,["item"]))),128))])):f("",!0),r(e).appearance&&r(e).appearance!=="force-dark"?(a(),c("div",bn,[d("div",yn,[d("p",Pn,S(r(t).darkModeSwitchLabel||"Appearance"),1),d("div",Ln,[m($e)])])])):f("",!0),r(t).socialLinks?(a(),c("div",Vn,[d("div",Sn,[m(ye,{class:"social-links-list",links:r(t).socialLinks},null,8,["links"])])])):f("",!0)]),_:1})):f("",!0)}}),In=k(wn,[["__scopeId","data-v-d0bd9dde"]]),Tn=o=>(B("data-v-e5dd9c1c"),o=o(),H(),o),Nn=["aria-expanded"],Mn=Tn(()=>d("span",{class:"container"},[d("span",{class:"top"}),d("span",{class:"middle"}),d("span",{class:"bottom"})],-1)),Cn=[Mn],An=_({__name:"VPNavBarHamburger",props:{active:{type:Boolean}},emits:["click"],setup(o){return(e,t)=>(a(),c("button",{type:"button",class:N(["VPNavBarHamburger",{active:e.active}]),"aria-label":"mobile navigation","aria-expanded":e.active,"aria-controls":"VPNavScreen",onClick:t[0]||(t[0]=n=>e.$emit("click"))},Cn,10,Nn))}}),Bn=k(An,[["__scopeId","data-v-e5dd9c1c"]]),Hn=["innerHTML"],En=_({__name:"VPNavBarMenuLink",props:{item:{}},setup(o){const{page:e}=L();return(t,n)=>(a(),g(F,{class:N({VPNavBarMenuLink:!0,active:r(G)(r(e).relativePath,t.item.activeMatch||t.item.link,!!t.item.activeMatch)}),href:t.item.link,target:t.item.target,rel:t.item.rel,tabindex:"0"},{default:v(()=>[d("span",{innerHTML:t.item.text},null,8,Hn)]),_:1},8,["class","href","target","rel"]))}}),Dn=k(En,[["__scopeId","data-v-42ef59de"]]),Fn=_({__name:"VPNavBarMenuGroup",props:{item:{}},setup(o){const e=o,{page:t}=L(),n=i=>"link"in i?G(t.value.relativePath,i.link,!!e.item.activeMatch):i.items.some(n),s=b(()=>n(e.item));return(i,u)=>(a(),g(be,{class:N({VPNavBarMenuGroup:!0,active:r(G)(r(t).relativePath,i.item.activeMatch,!!i.item.activeMatch)||s.value}),button:i.item.text,items:i.item.items},null,8,["class","button","items"]))}}),On=o=>(B("data-v-7f418b0f"),o=o(),H(),o),Un={key:0,"aria-labelledby":"main-nav-aria-label",class:"VPNavBarMenu"},Gn=On(()=>d("span",{id:"main-nav-aria-label",class:"visually-hidden"},"Main Navigation",-1)),jn=_({__name:"VPNavBarMenu",setup(o){const{theme:e}=L();return(t,n)=>r(e).nav?(a(),c("nav",Un,[Gn,(a(!0),c(M,null,E(r(e).nav,s=>(a(),c(M,{key:s.text},["link"in s?(a(),g(Dn,{key:0,item:s},null,8,["item"])):(a(),g(Fn,{key:1,item:s},null,8,["item"]))],64))),128))])):f("",!0)}}),zn=k(jn,[["__scopeId","data-v-7f418b0f"]]);function Rn(o){const{localeIndex:e,theme:t}=L();function n(s){var C,A,T;const i=s.split("."),u=(C=t.value.search)==null?void 0:C.options,h=u&&typeof u=="object",p=h&&((T=(A=u.locales)==null?void 0:A[e.value])==null?void 0:T.translations)||null,$=h&&u.translations||null;let P=p,y=$,V=o;const w=i.pop();for(const X of i){let U=null;const W=V==null?void 0:V[X];W&&(U=V=W);const ne=y==null?void 0:y[X];ne&&(U=y=ne);const ae=P==null?void 0:P[X];ae&&(U=P=ae),W||(V=U),ne||(y=U),ae||(P=U)}return(P==null?void 0:P[w])??(y==null?void 0:y[w])??(V==null?void 0:V[w])??""}return n}const Wn=["aria-label"],Kn={class:"DocSearch-Button-Container"},qn=d("span",{class:"vp-icon DocSearch-Search-Icon"},null,-1),Jn={class:"DocSearch-Button-Placeholder"},Xn=d("span",{class:"DocSearch-Button-Keys"},[d("kbd",{class:"DocSearch-Button-Key"}),d("kbd",{class:"DocSearch-Button-Key"},"K")],-1),Pe=_({__name:"VPNavBarSearchButton",setup(o){const t=Rn({button:{buttonText:"Search",buttonAriaLabel:"Search"}});return(n,s)=>(a(),c("button",{type:"button",class:"DocSearch DocSearch-Button","aria-label":r(t)("button.buttonAriaLabel")},[d("span",Kn,[qn,d("span",Jn,S(r(t)("button.buttonText")),1)]),Xn],8,Wn))}}),Yn={class:"VPNavBarSearch"},Qn={id:"local-search"},Zn={key:1,id:"docsearch"},xn=_({__name:"VPNavBarSearch",setup(o){const e=Qe(()=>Ze(()=>import("./VPLocalSearchBox.CYXDraNv.js"),__vite__mapDeps([0,1]))),t=()=>null,{theme:n}=L(),s=I(!1),i=I(!1);j(()=>{});function u(){s.value||(s.value=!0,setTimeout(h,16))}function h(){const y=new Event("keydown");y.key="k",y.metaKey=!0,window.dispatchEvent(y),setTimeout(()=>{document.querySelector(".DocSearch-Modal")||h()},16)}function p(y){const V=y.target,w=V.tagName;return V.isContentEditable||w==="INPUT"||w==="SELECT"||w==="TEXTAREA"}const $=I(!1);le("k",y=>{(y.ctrlKey||y.metaKey)&&(y.preventDefault(),$.value=!0)}),le("/",y=>{p(y)||(y.preventDefault(),$.value=!0)});const P="local";return(y,V)=>{var w;return a(),c("div",Yn,[r(P)==="local"?(a(),c(M,{key:0},[$.value?(a(),g(r(e),{key:0,onClose:V[0]||(V[0]=C=>$.value=!1)})):f("",!0),d("div",Qn,[m(Pe,{onClick:V[1]||(V[1]=C=>$.value=!0)})])],64)):r(P)==="algolia"?(a(),c(M,{key:1},[s.value?(a(),g(r(t),{key:0,algolia:((w=r(n).search)==null?void 0:w.options)??r(n).algolia,onVnodeBeforeMount:V[2]||(V[2]=C=>i.value=!0)},null,8,["algolia"])):f("",!0),i.value?f("",!0):(a(),c("div",Zn,[m(Pe,{onClick:u})]))],64)):f("",!0)])}}}),ea=_({__name:"VPNavBarSocialLinks",setup(o){const{theme:e}=L();return(t,n)=>r(e).socialLinks?(a(),g(ye,{key:0,class:"VPNavBarSocialLinks",links:r(e).socialLinks},null,8,["links"])):f("",!0)}}),ta=k(ea,[["__scopeId","data-v-0394ad82"]]),oa=["href","rel","target"],sa={key:1},na={key:2},aa=_({__name:"VPNavBarTitle",setup(o){const{site:e,theme:t}=L(),{hasSidebar:n}=O(),{currentLang:s}=J(),i=b(()=>{var p;return typeof t.value.logoLink=="string"?t.value.logoLink:(p=t.value.logoLink)==null?void 0:p.link}),u=b(()=>{var p;return typeof t.value.logoLink=="string"||(p=t.value.logoLink)==null?void 0:p.rel}),h=b(()=>{var p;return typeof t.value.logoLink=="string"||(p=t.value.logoLink)==null?void 0:p.target});return(p,$)=>(a(),c("div",{class:N(["VPNavBarTitle",{"has-sidebar":r(n)}])},[d("a",{class:"title",href:i.value??r(_e)(r(s).link),rel:u.value,target:h.value},[l(p.$slots,"nav-bar-title-before",{},void 0,!0),r(t).logo?(a(),g(Z,{key:0,class:"logo",image:r(t).logo},null,8,["image"])):f("",!0),r(t).siteTitle?(a(),c("span",sa,S(r(t).siteTitle),1)):r(t).siteTitle===void 0?(a(),c("span",na,S(r(e).title),1)):f("",!0),l(p.$slots,"nav-bar-title-after",{},void 0,!0)],8,oa)],2))}}),ra=k(aa,[["__scopeId","data-v-ab179fa1"]]),ia={class:"items"},la={class:"title"},ca=_({__name:"VPNavBarTranslations",setup(o){const{theme:e}=L(),{localeLinks:t,currentLang:n}=J({correspondingLink:!0});return(s,i)=>r(t).length&&r(n).label?(a(),g(be,{key:0,class:"VPNavBarTranslations",icon:"vpi-languages",label:r(e).langMenuLabel||"Change language"},{default:v(()=>[d("div",ia,[d("p",la,S(r(n).label),1),(a(!0),c(M,null,E(r(t),u=>(a(),g(se,{key:u.link,item:u},null,8,["item"]))),128))])]),_:1},8,["label"])):f("",!0)}}),ua=k(ca,[["__scopeId","data-v-88af2de4"]]),da=o=>(B("data-v-19c990f1"),o=o(),H(),o),va={class:"wrapper"},pa={class:"container"},ha={class:"title"},fa={class:"content"},_a={class:"content-body"},ma=da(()=>d("div",{class:"divider"},[d("div",{class:"divider-line"})],-1)),ka=_({__name:"VPNavBar",props:{isScreenOpen:{type:Boolean}},emits:["toggle-screen"],setup(o){const{y:e}=Te(),{hasSidebar:t}=O(),{hasLocalNav:n}=He(),{frontmatter:s}=L(),i=I({});return Se(()=>{i.value={"has-sidebar":t.value,"has-local-nav":n.value,top:s.value.layout==="home"&&e.value===0}}),(u,h)=>(a(),c("div",{class:N(["VPNavBar",i.value])},[d("div",va,[d("div",pa,[d("div",ha,[m(ra,null,{"nav-bar-title-before":v(()=>[l(u.$slots,"nav-bar-title-before",{},void 0,!0)]),"nav-bar-title-after":v(()=>[l(u.$slots,"nav-bar-title-after",{},void 0,!0)]),_:3})]),d("div",fa,[d("div",_a,[l(u.$slots,"nav-bar-content-before",{},void 0,!0),m(xn,{class:"search"}),m(zn,{class:"menu"}),m(ua,{class:"translations"}),m(Ws,{class:"appearance"}),m(ta,{class:"social-links"}),m(In,{class:"extra"}),l(u.$slots,"nav-bar-content-after",{},void 0,!0),m(Bn,{class:"hamburger",active:u.isScreenOpen,onClick:h[0]||(h[0]=p=>u.$emit("toggle-screen"))},null,8,["active"])])])])]),ma],2))}}),$a=k(ka,[["__scopeId","data-v-19c990f1"]]),ga={key:0,class:"VPNavScreenAppearance"},ba={class:"text"},ya=_({__name:"VPNavScreenAppearance",setup(o){const{site:e,theme:t}=L();return(n,s)=>r(e).appearance&&r(e).appearance!=="force-dark"?(a(),c("div",ga,[d("p",ba,S(r(t).darkModeSwitchLabel||"Appearance"),1),m($e)])):f("",!0)}}),Pa=k(ya,[["__scopeId","data-v-2d7af913"]]),La=_({__name:"VPNavScreenMenuLink",props:{item:{}},setup(o){const e=oe("close-screen");return(t,n)=>(a(),g(F,{class:"VPNavScreenMenuLink",href:t.item.link,target:t.item.target,rel:t.item.rel,onClick:r(e)},{default:v(()=>[D(S(t.item.text),1)]),_:1},8,["href","target","rel","onClick"]))}}),Va=k(La,[["__scopeId","data-v-05f27b2a"]]),Sa=_({__name:"VPNavScreenMenuGroupLink",props:{item:{}},setup(o){const e=oe("close-screen");return(t,n)=>(a(),g(F,{class:"VPNavScreenMenuGroupLink",href:t.item.link,target:t.item.target,rel:t.item.rel,onClick:r(e)},{default:v(()=>[D(S(t.item.text),1)]),_:1},8,["href","target","rel","onClick"]))}}),Oe=k(Sa,[["__scopeId","data-v-19976ae1"]]),wa={class:"VPNavScreenMenuGroupSection"},Ia={key:0,class:"title"},Ta=_({__name:"VPNavScreenMenuGroupSection",props:{text:{},items:{}},setup(o){return(e,t)=>(a(),c("div",wa,[e.text?(a(),c("p",Ia,S(e.text),1)):f("",!0),(a(!0),c(M,null,E(e.items,n=>(a(),g(Oe,{key:n.text,item:n},null,8,["item"]))),128))]))}}),Na=k(Ta,[["__scopeId","data-v-8133b170"]]),Ma=o=>(B("data-v-ff6087d4"),o=o(),H(),o),Ca=["aria-controls","aria-expanded"],Aa=["innerHTML"],Ba=Ma(()=>d("span",{class:"vpi-plus button-icon"},null,-1)),Ha=["id"],Ea={key:1,class:"group"},Da=_({__name:"VPNavScreenMenuGroup",props:{text:{},items:{}},setup(o){const e=o,t=I(!1),n=b(()=>`NavScreenGroup-${e.text.replace(" ","-").toLowerCase()}`);function s(){t.value=!t.value}return(i,u)=>(a(),c("div",{class:N(["VPNavScreenMenuGroup",{open:t.value}])},[d("button",{class:"button","aria-controls":n.value,"aria-expanded":t.value,onClick:s},[d("span",{class:"button-text",innerHTML:i.text},null,8,Aa),Ba],8,Ca),d("div",{id:n.value,class:"items"},[(a(!0),c(M,null,E(i.items,h=>(a(),c(M,{key:h.text},["link"in h?(a(),c("div",{key:h.text,class:"item"},[m(Oe,{item:h},null,8,["item"])])):(a(),c("div",Ea,[m(Na,{text:h.text,items:h.items},null,8,["text","items"])]))],64))),128))],8,Ha)],2))}}),Fa=k(Da,[["__scopeId","data-v-ff6087d4"]]),Oa={key:0,class:"VPNavScreenMenu"},Ua=_({__name:"VPNavScreenMenu",setup(o){const{theme:e}=L();return(t,n)=>r(e).nav?(a(),c("nav",Oa,[(a(!0),c(M,null,E(r(e).nav,s=>(a(),c(M,{key:s.text},["link"in s?(a(),g(Va,{key:0,item:s},null,8,["item"])):(a(),g(Fa,{key:1,text:s.text||"",items:s.items},null,8,["text","items"]))],64))),128))])):f("",!0)}}),Ga=_({__name:"VPNavScreenSocialLinks",setup(o){const{theme:e}=L();return(t,n)=>r(e).socialLinks?(a(),g(ye,{key:0,class:"VPNavScreenSocialLinks",links:r(e).socialLinks},null,8,["links"])):f("",!0)}}),Ue=o=>(B("data-v-858fe1a4"),o=o(),H(),o),ja=Ue(()=>d("span",{class:"vpi-languages icon lang"},null,-1)),za=Ue(()=>d("span",{class:"vpi-chevron-down icon chevron"},null,-1)),Ra={class:"list"},Wa=_({__name:"VPNavScreenTranslations",setup(o){const{localeLinks:e,currentLang:t}=J({correspondingLink:!0}),n=I(!1);function s(){n.value=!n.value}return(i,u)=>r(e).length&&r(t).label?(a(),c("div",{key:0,class:N(["VPNavScreenTranslations",{open:n.value}])},[d("button",{class:"title",onClick:s},[ja,D(" "+S(r(t).label)+" ",1),za]),d("ul",Ra,[(a(!0),c(M,null,E(r(e),h=>(a(),c("li",{key:h.link,class:"item"},[m(F,{class:"link",href:h.link},{default:v(()=>[D(S(h.text),1)]),_:2},1032,["href"])]))),128))])],2)):f("",!0)}}),Ka=k(Wa,[["__scopeId","data-v-858fe1a4"]]),qa={class:"container"},Ja=_({__name:"VPNavScreen",props:{open:{type:Boolean}},setup(o){const e=I(null),t=Ne(q?document.body:null);return(n,s)=>(a(),g(ve,{name:"fade",onEnter:s[0]||(s[0]=i=>t.value=!0),onAfterLeave:s[1]||(s[1]=i=>t.value=!1)},{default:v(()=>[n.open?(a(),c("div",{key:0,class:"VPNavScreen",ref_key:"screen",ref:e,id:"VPNavScreen"},[d("div",qa,[l(n.$slots,"nav-screen-content-before",{},void 0,!0),m(Ua,{class:"menu"}),m(Ka,{class:"translations"}),m(Pa,{class:"appearance"}),m(Ga,{class:"social-links"}),l(n.$slots,"nav-screen-content-after",{},void 0,!0)])],512)):f("",!0)]),_:3}))}}),Xa=k(Ja,[["__scopeId","data-v-cc5739dd"]]),Ya={key:0,class:"VPNav"},Qa=_({__name:"VPNav",setup(o){const{isScreenOpen:e,closeScreen:t,toggleScreen:n}=As(),{frontmatter:s}=L(),i=b(()=>s.value.navbar!==!1);return Me("close-screen",t),x(()=>{q&&document.documentElement.classList.toggle("hide-nav",!i.value)}),(u,h)=>i.value?(a(),c("header",Ya,[m($a,{"is-screen-open":r(e),onToggleScreen:r(n)},{"nav-bar-title-before":v(()=>[l(u.$slots,"nav-bar-title-before",{},void 0,!0)]),"nav-bar-title-after":v(()=>[l(u.$slots,"nav-bar-title-after",{},void 0,!0)]),"nav-bar-content-before":v(()=>[l(u.$slots,"nav-bar-content-before",{},void 0,!0)]),"nav-bar-content-after":v(()=>[l(u.$slots,"nav-bar-content-after",{},void 0,!0)]),_:3},8,["is-screen-open","onToggleScreen"]),m(Xa,{open:r(e)},{"nav-screen-content-before":v(()=>[l(u.$slots,"nav-screen-content-before",{},void 0,!0)]),"nav-screen-content-after":v(()=>[l(u.$slots,"nav-screen-content-after",{},void 0,!0)]),_:3},8,["open"])])):f("",!0)}}),Za=k(Qa,[["__scopeId","data-v-ae24b3ad"]]),Ge=o=>(B("data-v-93e7e794"),o=o(),H(),o),xa=["role","tabindex"],er=Ge(()=>d("div",{class:"indicator"},null,-1)),tr=Ge(()=>d("span",{class:"vpi-chevron-right caret-icon"},null,-1)),or=[tr],sr={key:1,class:"items"},nr=_({__name:"VPSidebarItem",props:{item:{},depth:{}},setup(o){const e=o,{collapsed:t,collapsible:n,isLink:s,isActiveLink:i,hasActiveLink:u,hasChildren:h,toggle:p}=Pt(b(()=>e.item)),$=b(()=>h.value?"section":"div"),P=b(()=>s.value?"a":"div"),y=b(()=>h.value?e.depth+2===7?"p":`h${e.depth+2}`:"p"),V=b(()=>s.value?void 0:"button"),w=b(()=>[[`level-${e.depth}`],{collapsible:n.value},{collapsed:t.value},{"is-link":s.value},{"is-active":i.value},{"has-active":u.value}]);function C(T){"key"in T&&T.key!=="Enter"||!e.item.link&&p()}function A(){e.item.link&&p()}return(T,X)=>{const U=R("VPSidebarItem",!0);return a(),g(K($.value),{class:N(["VPSidebarItem",w.value])},{default:v(()=>[T.item.text?(a(),c("div",Y({key:0,class:"item",role:V.value},et(T.item.items?{click:C,keydown:C}:{},!0),{tabindex:T.item.items&&0}),[er,T.item.link?(a(),g(F,{key:0,tag:P.value,class:"link",href:T.item.link,rel:T.item.rel,target:T.item.target},{default:v(()=>[(a(),g(K(y.value),{class:"text",innerHTML:T.item.text},null,8,["innerHTML"]))]),_:1},8,["tag","href","rel","target"])):(a(),g(K(y.value),{key:1,class:"text",innerHTML:T.item.text},null,8,["innerHTML"])),T.item.collapsed!=null?(a(),c("div",{key:2,class:"caret",role:"button","aria-label":"toggle section",onClick:A,onKeydown:xe(A,["enter"]),tabindex:"0"},or,32)):f("",!0)],16,xa)):f("",!0),T.item.items&&T.item.items.length?(a(),c("div",sr,[T.depth<5?(a(!0),c(M,{key:0},E(T.item.items,W=>(a(),g(U,{key:W.text,item:W,depth:T.depth+1},null,8,["item","depth"]))),128)):f("",!0)])):f("",!0)]),_:1},8,["class"])}}}),ar=k(nr,[["__scopeId","data-v-93e7e794"]]),je=o=>(B("data-v-575e6a36"),o=o(),H(),o),rr=je(()=>d("div",{class:"curtain"},null,-1)),ir={class:"nav",id:"VPSidebarNav","aria-labelledby":"sidebar-aria-label",tabindex:"-1"},lr=je(()=>d("span",{class:"visually-hidden",id:"sidebar-aria-label"}," Sidebar Navigation ",-1)),cr=_({__name:"VPSidebar",props:{open:{type:Boolean}},setup(o){const{sidebarGroups:e,hasSidebar:t}=O(),n=o,s=I(null),i=Ne(q?document.body:null);return z([n,s],()=>{var u;n.open?(i.value=!0,(u=s.value)==null||u.focus()):i.value=!1},{immediate:!0,flush:"post"}),(u,h)=>r(t)?(a(),c("aside",{key:0,class:N(["VPSidebar",{open:u.open}]),ref_key:"navEl",ref:s,onClick:h[0]||(h[0]=tt(()=>{},["stop"]))},[rr,d("nav",ir,[lr,l(u.$slots,"sidebar-nav-before",{},void 0,!0),(a(!0),c(M,null,E(r(e),p=>(a(),c("div",{key:p.text,class:"group"},[m(ar,{item:p,depth:0},null,8,["item"])]))),128)),l(u.$slots,"sidebar-nav-after",{},void 0,!0)])],2)):f("",!0)}}),ur=k(cr,[["__scopeId","data-v-575e6a36"]]),dr=_({__name:"VPSkipLink",setup(o){const e=te(),t=I();z(()=>e.path,()=>t.value.focus());function n({target:s}){const i=document.getElementById(decodeURIComponent(s.hash).slice(1));if(i){const u=()=>{i.removeAttribute("tabindex"),i.removeEventListener("blur",u)};i.setAttribute("tabindex","-1"),i.addEventListener("blur",u),i.focus(),window.scrollTo(0,0)}}return(s,i)=>(a(),c(M,null,[d("span",{ref_key:"backToTop",ref:t,tabindex:"-1"},null,512),d("a",{href:"#VPContent",class:"VPSkipLink visually-hidden",onClick:n}," Skip to content ")],64))}}),vr=k(dr,[["__scopeId","data-v-0f60ec36"]]),pr=_({__name:"Layout",setup(o){const{isOpen:e,open:t,close:n}=O(),s=te();z(()=>s.path,n),yt(e,n);const{frontmatter:i}=L(),u=ot(),h=b(()=>!!u["home-hero-image"]);return Me("hero-image-slot-exists",h),(p,$)=>{const P=R("Content");return r(i).layout!==!1?(a(),c("div",{key:0,class:N(["Layout",r(i).pageClass])},[l(p.$slots,"layout-top",{},void 0,!0),m(vr),m(it,{class:"backdrop",show:r(e),onClick:r(n)},null,8,["show","onClick"]),m(Za,null,{"nav-bar-title-before":v(()=>[l(p.$slots,"nav-bar-title-before",{},void 0,!0)]),"nav-bar-title-after":v(()=>[l(p.$slots,"nav-bar-title-after",{},void 0,!0)]),"nav-bar-content-before":v(()=>[l(p.$slots,"nav-bar-content-before",{},void 0,!0)]),"nav-bar-content-after":v(()=>[l(p.$slots,"nav-bar-content-after",{},void 0,!0)]),"nav-screen-content-before":v(()=>[l(p.$slots,"nav-screen-content-before",{},void 0,!0)]),"nav-screen-content-after":v(()=>[l(p.$slots,"nav-screen-content-after",{},void 0,!0)]),_:3}),m(Cs,{open:r(e),onOpenMenu:r(t)},null,8,["open","onOpenMenu"]),m(ur,{open:r(e)},{"sidebar-nav-before":v(()=>[l(p.$slots,"sidebar-nav-before",{},void 0,!0)]),"sidebar-nav-after":v(()=>[l(p.$slots,"sidebar-nav-after",{},void 0,!0)]),_:3},8,["open"]),m(hs,null,{"page-top":v(()=>[l(p.$slots,"page-top",{},void 0,!0)]),"page-bottom":v(()=>[l(p.$slots,"page-bottom",{},void 0,!0)]),"not-found":v(()=>[l(p.$slots,"not-found",{},void 0,!0)]),"home-hero-before":v(()=>[l(p.$slots,"home-hero-before",{},void 0,!0)]),"home-hero-info-before":v(()=>[l(p.$slots,"home-hero-info-before",{},void 0,!0)]),"home-hero-info":v(()=>[l(p.$slots,"home-hero-info",{},void 0,!0)]),"home-hero-info-after":v(()=>[l(p.$slots,"home-hero-info-after",{},void 0,!0)]),"home-hero-actions-after":v(()=>[l(p.$slots,"home-hero-actions-after",{},void 0,!0)]),"home-hero-image":v(()=>[l(p.$slots,"home-hero-image",{},void 0,!0)]),"home-hero-after":v(()=>[l(p.$slots,"home-hero-after",{},void 0,!0)]),"home-features-before":v(()=>[l(p.$slots,"home-features-before",{},void 0,!0)]),"home-features-after":v(()=>[l(p.$slots,"home-features-after",{},void 0,!0)]),"doc-footer-before":v(()=>[l(p.$slots,"doc-footer-before",{},void 0,!0)]),"doc-before":v(()=>[l(p.$slots,"doc-before",{},void 0,!0)]),"doc-after":v(()=>[l(p.$slots,"doc-after",{},void 0,!0)]),"doc-top":v(()=>[l(p.$slots,"doc-top",{},void 0,!0)]),"doc-bottom":v(()=>[l(p.$slots,"doc-bottom",{},void 0,!0)]),"aside-top":v(()=>[l(p.$slots,"aside-top",{},void 0,!0)]),"aside-bottom":v(()=>[l(p.$slots,"aside-bottom",{},void 0,!0)]),"aside-outline-before":v(()=>[l(p.$slots,"aside-outline-before",{},void 0,!0)]),"aside-outline-after":v(()=>[l(p.$slots,"aside-outline-after",{},void 0,!0)]),"aside-ads-before":v(()=>[l(p.$slots,"aside-ads-before",{},void 0,!0)]),"aside-ads-after":v(()=>[l(p.$slots,"aside-ads-after",{},void 0,!0)]),_:3}),m($s),l(p.$slots,"layout-bottom",{},void 0,!0)],2)):(a(),g(P,{key:1}))}}}),hr=k(pr,[["__scopeId","data-v-5d98c3a5"]]),Le={Layout:hr,enhanceApp:({app:o})=>{o.component("Badge",nt)}},fr={props:{url:{}},setup(o){const{isDark:e,lang:t}=Ve();return{isDark:e,lang:t}},data(){return{shouldLoad:!1,loadedOnce:!1,iframe_id:"",height:"",bg:"",color:""}},computed:{fullUrl(){return`/v1-demo-windowed#${this.url}?bg=${this.bg}&color=${this.color}&iframe_id=${this.iframe_id}`}},watch:{},methods:{resizeIframe(o){o.style.height=o.contentWindow.document.documentElement.scrollHeight+"px"},checkShouldLoad(){if(this.loadedOnce)return;const o=200;let e=this.$el.getBoundingClientRect();const t=n=>n>-o&&n{await this.$nextTick();const e=getComputedStyle(document.body);this.bg=encodeURIComponent(e.backgroundColor),this.color=encodeURIComponent(e.color)},{immediate:!0}),this.iframe_id=Math.random().toString(36).substring(2,15),this._messageListener=o=>{var e;((e=o.data)==null?void 0:e.type)==="iframeHeight"&&o.data.id===this.iframe_id&&(this.height=o.data.height)},window.addEventListener("message",this._messageListener,!1),window.addEventListener("scroll",this.checkShouldLoad),this.checkShouldLoad()},beforeUnmount(){window.removeEventListener("message",this._messageListener,!1),window.removeEventListener("scroll",this.checkShouldLoad)}},_r={class:"DemoIframe"},mr={class:"iframeWrapper"},kr=["src"];function $r(o,e,t,n,s,i){return a(),c("div",_r,[d("div",null,[d("strong",null,S(n.lang==="zh"?"请看效果":"Preview"),1)]),d("div",mr,[s.iframe_id?(a(),c("iframe",{key:0,src:s.shouldLoad?i.fullUrl:void 0,scrolling:"no",style:fe({height:s.height+"px"})},null,12,kr)):f("",!0)])])}const gr=k(fr,[["render",$r],["__scopeId","data-v-d2bc7091"]]),yr={extends:Le,Layout:()=>st(Le.Layout,null,{}),enhanceApp({app:o,router:e,siteData:t}){o.component("DemoIframe",gr)}};export{yr as R,Rn as c,L as u}; diff --git a/assets/index.md.Dnn-p8GL.js b/assets/index.md.Dnn-p8GL.js new file mode 100644 index 0000000..c7903d9 --- /dev/null +++ b/assets/index.md.Dnn-p8GL.js @@ -0,0 +1 @@ +import{_ as e,c as t,o as a,a5 as l}from"./chunks/framework.BthLuVtL.js";const _=JSON.parse('{"title":"","description":"","frontmatter":{"layout":"home","hero":{"name":"He Tree React","tagline":"React draggable sortable tree component","actions":[{"theme":"brand","text":"Get started","link":"./v1/guide"},{"theme":"alt","text":"Online Examples","link":"./v1/examples"}]},"features":[{"title":"Draggable","details":"When drag, show a placeholder to help user."},{"title":"High-performance","details":"Supports virtual list to handle large data calmly."},{"title":"Easy to customize","details":"Simple structure, few built-in style, so the style and UI can be easily customized."}]},"headers":[],"relativePath":"index.md","filePath":"index.md"}'),i={name:"index.md"},r=l('

Features

  • Drag with a customizable placeholder.
  • The height of the node is not fixed.
  • Based on HTML Drag and Drop API.
  • Both flat data and tree-shaped data supported.
  • Drag from external.
  • Open or expand. Open node when drag onto it.
  • Checked, semi-checked.
  • Big data, virtual list.
  • Examples for update data.
  • rtl, display from right to left.
',2),o=[r];function s(n,d,c,h,p,u){return a(),t("div",null,o)}const f=e(i,[["render",s]]);export{_ as __pageData,f as default}; diff --git a/assets/index.md.Dnn-p8GL.lean.js b/assets/index.md.Dnn-p8GL.lean.js new file mode 100644 index 0000000..4ad82ac --- /dev/null +++ b/assets/index.md.Dnn-p8GL.lean.js @@ -0,0 +1 @@ +import{_ as e,c as t,o as a,a5 as l}from"./chunks/framework.BthLuVtL.js";const _=JSON.parse('{"title":"","description":"","frontmatter":{"layout":"home","hero":{"name":"He Tree React","tagline":"React draggable sortable tree component","actions":[{"theme":"brand","text":"Get started","link":"./v1/guide"},{"theme":"alt","text":"Online Examples","link":"./v1/examples"}]},"features":[{"title":"Draggable","details":"When drag, show a placeholder to help user."},{"title":"High-performance","details":"Supports virtual list to handle large data calmly."},{"title":"Easy to customize","details":"Simple structure, few built-in style, so the style and UI can be easily customized."}]},"headers":[],"relativePath":"index.md","filePath":"index.md"}'),i={name:"index.md"},r=l("",2),o=[r];function s(n,d,c,h,p,u){return a(),t("div",null,o)}const f=e(i,[["render",s]]);export{_ as __pageData,f as default}; diff --git a/assets/inter-italic-cyrillic-ext.5XJwZIOp.woff2 b/assets/inter-italic-cyrillic-ext.5XJwZIOp.woff2 new file mode 100644 index 0000000..2a68729 Binary files /dev/null and b/assets/inter-italic-cyrillic-ext.5XJwZIOp.woff2 differ diff --git a/assets/inter-italic-cyrillic.D6csxwjC.woff2 b/assets/inter-italic-cyrillic.D6csxwjC.woff2 new file mode 100644 index 0000000..f640351 Binary files /dev/null and b/assets/inter-italic-cyrillic.D6csxwjC.woff2 differ diff --git a/assets/inter-italic-greek-ext.CHOfFY1k.woff2 b/assets/inter-italic-greek-ext.CHOfFY1k.woff2 new file mode 100644 index 0000000..0021896 Binary files /dev/null and b/assets/inter-italic-greek-ext.CHOfFY1k.woff2 differ diff --git a/assets/inter-italic-greek.9J96vYpw.woff2 b/assets/inter-italic-greek.9J96vYpw.woff2 new file mode 100644 index 0000000..71c265f Binary files /dev/null and b/assets/inter-italic-greek.9J96vYpw.woff2 differ diff --git a/assets/inter-italic-latin-ext.BGcWXLrn.woff2 b/assets/inter-italic-latin-ext.BGcWXLrn.woff2 new file mode 100644 index 0000000..9c1b944 Binary files /dev/null and b/assets/inter-italic-latin-ext.BGcWXLrn.woff2 differ diff --git a/assets/inter-italic-latin.DbsTr1gm.woff2 b/assets/inter-italic-latin.DbsTr1gm.woff2 new file mode 100644 index 0000000..01fcf20 Binary files /dev/null and b/assets/inter-italic-latin.DbsTr1gm.woff2 differ diff --git a/assets/inter-italic-vietnamese.DHNAd7Wr.woff2 b/assets/inter-italic-vietnamese.DHNAd7Wr.woff2 new file mode 100644 index 0000000..e4f788e Binary files /dev/null and b/assets/inter-italic-vietnamese.DHNAd7Wr.woff2 differ diff --git a/assets/inter-roman-cyrillic-ext.DxP3Awbn.woff2 b/assets/inter-roman-cyrillic-ext.DxP3Awbn.woff2 new file mode 100644 index 0000000..28593cc Binary files /dev/null and b/assets/inter-roman-cyrillic-ext.DxP3Awbn.woff2 differ diff --git a/assets/inter-roman-cyrillic.CMhn1ESj.woff2 b/assets/inter-roman-cyrillic.CMhn1ESj.woff2 new file mode 100644 index 0000000..a20adc1 Binary files /dev/null and b/assets/inter-roman-cyrillic.CMhn1ESj.woff2 differ diff --git a/assets/inter-roman-greek-ext.D0mI3NpI.woff2 b/assets/inter-roman-greek-ext.D0mI3NpI.woff2 new file mode 100644 index 0000000..e3b0be7 Binary files /dev/null and b/assets/inter-roman-greek-ext.D0mI3NpI.woff2 differ diff --git a/assets/inter-roman-greek.JvnBZ4YD.woff2 b/assets/inter-roman-greek.JvnBZ4YD.woff2 new file mode 100644 index 0000000..f790e04 Binary files /dev/null and b/assets/inter-roman-greek.JvnBZ4YD.woff2 differ diff --git a/assets/inter-roman-latin-ext.ZlYT4o7i.woff2 b/assets/inter-roman-latin-ext.ZlYT4o7i.woff2 new file mode 100644 index 0000000..715bd90 Binary files /dev/null and b/assets/inter-roman-latin-ext.ZlYT4o7i.woff2 differ diff --git a/assets/inter-roman-latin.Bu8hRsVA.woff2 b/assets/inter-roman-latin.Bu8hRsVA.woff2 new file mode 100644 index 0000000..a540b7a Binary files /dev/null and b/assets/inter-roman-latin.Bu8hRsVA.woff2 differ diff --git a/assets/inter-roman-vietnamese.ClpjcLMQ.woff2 b/assets/inter-roman-vietnamese.ClpjcLMQ.woff2 new file mode 100644 index 0000000..5a9f9cb Binary files /dev/null and b/assets/inter-roman-vietnamese.ClpjcLMQ.woff2 differ diff --git a/assets/style.CN68qRN9.css b/assets/style.CN68qRN9.css new file mode 100644 index 0000000..9ba4ffd --- /dev/null +++ b/assets/style.CN68qRN9.css @@ -0,0 +1 @@ +@font-face{font-family:Inter var;font-weight:100 900;font-display:swap;font-style:normal;font-named-instance:"Regular";src:url(/assets/inter-roman-cyrillic.CMhn1ESj.woff2) format("woff2");unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}@font-face{font-family:Inter var;font-weight:100 900;font-display:swap;font-style:normal;font-named-instance:"Regular";src:url(/assets/inter-roman-cyrillic-ext.DxP3Awbn.woff2) format("woff2");unicode-range:U+0460-052F,U+1C80-1C88,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}@font-face{font-family:Inter var;font-weight:100 900;font-display:swap;font-style:normal;font-named-instance:"Regular";src:url(/assets/inter-roman-greek.JvnBZ4YD.woff2) format("woff2");unicode-range:U+0370-03FF}@font-face{font-family:Inter var;font-weight:100 900;font-display:swap;font-style:normal;font-named-instance:"Regular";src:url(/assets/inter-roman-greek-ext.D0mI3NpI.woff2) format("woff2");unicode-range:U+1F00-1FFF}@font-face{font-family:Inter var;font-weight:100 900;font-display:swap;font-style:normal;font-named-instance:"Regular";src:url(/assets/inter-roman-latin.Bu8hRsVA.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Inter var;font-weight:100 900;font-display:swap;font-style:normal;font-named-instance:"Regular";src:url(/assets/inter-roman-latin-ext.ZlYT4o7i.woff2) format("woff2");unicode-range:U+0100-024F,U+0259,U+1E00-1EFF,U+2020,U+20A0-20AB,U+20AD-20CF,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Inter var;font-weight:100 900;font-display:swap;font-style:normal;font-named-instance:"Regular";src:url(/assets/inter-roman-vietnamese.ClpjcLMQ.woff2) format("woff2");unicode-range:U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+1EA0-1EF9,U+20AB}@font-face{font-family:Inter var;font-weight:100 900;font-display:swap;font-style:italic;font-named-instance:"Italic";src:url(/assets/inter-italic-cyrillic.D6csxwjC.woff2) format("woff2");unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}@font-face{font-family:Inter var;font-weight:100 900;font-display:swap;font-style:italic;font-named-instance:"Italic";src:url(/assets/inter-italic-cyrillic-ext.5XJwZIOp.woff2) format("woff2");unicode-range:U+0460-052F,U+1C80-1C88,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}@font-face{font-family:Inter var;font-weight:100 900;font-display:swap;font-style:italic;font-named-instance:"Italic";src:url(/assets/inter-italic-greek.9J96vYpw.woff2) format("woff2");unicode-range:U+0370-03FF}@font-face{font-family:Inter var;font-weight:100 900;font-display:swap;font-style:italic;font-named-instance:"Italic";src:url(/assets/inter-italic-greek-ext.CHOfFY1k.woff2) format("woff2");unicode-range:U+1F00-1FFF}@font-face{font-family:Inter var;font-weight:100 900;font-display:swap;font-style:italic;font-named-instance:"Italic";src:url(/assets/inter-italic-latin.DbsTr1gm.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Inter var;font-weight:100 900;font-display:swap;font-style:italic;font-named-instance:"Italic";src:url(/assets/inter-italic-latin-ext.BGcWXLrn.woff2) format("woff2");unicode-range:U+0100-024F,U+0259,U+1E00-1EFF,U+2020,U+20A0-20AB,U+20AD-20CF,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Inter var;font-weight:100 900;font-display:swap;font-style:italic;font-named-instance:"Italic";src:url(/assets/inter-italic-vietnamese.DHNAd7Wr.woff2) format("woff2");unicode-range:U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+1EA0-1EF9,U+20AB}@font-face{font-family:Chinese Quotes;src:local("PingFang SC Regular"),local("PingFang SC"),local("SimHei"),local("Source Han Sans SC");unicode-range:U+2018,U+2019,U+201C,U+201D}:root{--vp-c-white: #ffffff;--vp-c-black: #000000;--vp-c-neutral: var(--vp-c-black);--vp-c-neutral-inverse: var(--vp-c-white)}.dark{--vp-c-neutral: var(--vp-c-white);--vp-c-neutral-inverse: var(--vp-c-black)}:root{--vp-c-gray-1: #dddde3;--vp-c-gray-2: #e4e4e9;--vp-c-gray-3: #ebebef;--vp-c-gray-soft: rgba(142, 150, 170, .14);--vp-c-indigo-1: #3451b2;--vp-c-indigo-2: #3a5ccc;--vp-c-indigo-3: #5672cd;--vp-c-indigo-soft: rgba(100, 108, 255, .14);--vp-c-purple-1: #6f42c1;--vp-c-purple-2: #7e4cc9;--vp-c-purple-3: #8e5cd9;--vp-c-purple-soft: rgba(159, 122, 234, .14);--vp-c-green-1: #18794e;--vp-c-green-2: #299764;--vp-c-green-3: #30a46c;--vp-c-green-soft: rgba(16, 185, 129, .14);--vp-c-yellow-1: #915930;--vp-c-yellow-2: #946300;--vp-c-yellow-3: #9f6a00;--vp-c-yellow-soft: rgba(234, 179, 8, .14);--vp-c-red-1: #b8272c;--vp-c-red-2: #d5393e;--vp-c-red-3: #e0575b;--vp-c-red-soft: rgba(244, 63, 94, .14);--vp-c-sponsor: #db2777}.dark{--vp-c-gray-1: #515c67;--vp-c-gray-2: #414853;--vp-c-gray-3: #32363f;--vp-c-gray-soft: rgba(101, 117, 133, .16);--vp-c-indigo-1: #a8b1ff;--vp-c-indigo-2: #5c73e7;--vp-c-indigo-3: #3e63dd;--vp-c-indigo-soft: rgba(100, 108, 255, .16);--vp-c-purple-1: #c8abfa;--vp-c-purple-2: #a879e6;--vp-c-purple-3: #8e5cd9;--vp-c-purple-soft: rgba(159, 122, 234, .16);--vp-c-green-1: #3dd68c;--vp-c-green-2: #30a46c;--vp-c-green-3: #298459;--vp-c-green-soft: rgba(16, 185, 129, .16);--vp-c-yellow-1: #f9b44e;--vp-c-yellow-2: #da8b17;--vp-c-yellow-3: #a46a0a;--vp-c-yellow-soft: rgba(234, 179, 8, .16);--vp-c-red-1: #f66f81;--vp-c-red-2: #f14158;--vp-c-red-3: #b62a3c;--vp-c-red-soft: rgba(244, 63, 94, .16)}:root{--vp-c-bg: #ffffff;--vp-c-bg-alt: #f6f6f7;--vp-c-bg-elv: #ffffff;--vp-c-bg-soft: #f6f6f7}.dark{--vp-c-bg: #1b1b1f;--vp-c-bg-alt: #161618;--vp-c-bg-elv: #202127;--vp-c-bg-soft: #202127}:root{--vp-c-border: #c2c2c4;--vp-c-divider: #e2e2e3;--vp-c-gutter: #e2e2e3}.dark{--vp-c-border: #3c3f44;--vp-c-divider: #2e2e32;--vp-c-gutter: #000000}:root{--vp-c-text-1: rgba(60, 60, 67);--vp-c-text-2: rgba(60, 60, 67, .78);--vp-c-text-3: rgba(60, 60, 67, .56)}.dark{--vp-c-text-1: rgba(255, 255, 245, .86);--vp-c-text-2: rgba(235, 235, 245, .6);--vp-c-text-3: rgba(235, 235, 245, .38)}:root{--vp-c-default-1: var(--vp-c-gray-1);--vp-c-default-2: var(--vp-c-gray-2);--vp-c-default-3: var(--vp-c-gray-3);--vp-c-default-soft: var(--vp-c-gray-soft);--vp-c-brand-1: var(--vp-c-indigo-1);--vp-c-brand-2: var(--vp-c-indigo-2);--vp-c-brand-3: var(--vp-c-indigo-3);--vp-c-brand-soft: var(--vp-c-indigo-soft);--vp-c-brand: var(--vp-c-brand-1);--vp-c-tip-1: var(--vp-c-brand-1);--vp-c-tip-2: var(--vp-c-brand-2);--vp-c-tip-3: var(--vp-c-brand-3);--vp-c-tip-soft: var(--vp-c-brand-soft);--vp-c-note-1: var(--vp-c-brand-1);--vp-c-note-2: var(--vp-c-brand-2);--vp-c-note-3: var(--vp-c-brand-3);--vp-c-note-soft: var(--vp-c-brand-soft);--vp-c-success-1: var(--vp-c-green-1);--vp-c-success-2: var(--vp-c-green-2);--vp-c-success-3: var(--vp-c-green-3);--vp-c-success-soft: var(--vp-c-green-soft);--vp-c-important-1: var(--vp-c-purple-1);--vp-c-important-2: var(--vp-c-purple-2);--vp-c-important-3: var(--vp-c-purple-3);--vp-c-important-soft: var(--vp-c-purple-soft);--vp-c-warning-1: var(--vp-c-yellow-1);--vp-c-warning-2: var(--vp-c-yellow-2);--vp-c-warning-3: var(--vp-c-yellow-3);--vp-c-warning-soft: var(--vp-c-yellow-soft);--vp-c-danger-1: var(--vp-c-red-1);--vp-c-danger-2: var(--vp-c-red-2);--vp-c-danger-3: var(--vp-c-red-3);--vp-c-danger-soft: var(--vp-c-red-soft);--vp-c-caution-1: var(--vp-c-red-1);--vp-c-caution-2: var(--vp-c-red-2);--vp-c-caution-3: var(--vp-c-red-3);--vp-c-caution-soft: var(--vp-c-red-soft)}:root{--vp-font-family-base: "Chinese Quotes", "Inter var", "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Helvetica, Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--vp-font-family-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace}:root{--vp-shadow-1: 0 1px 2px rgba(0, 0, 0, .04), 0 1px 2px rgba(0, 0, 0, .06);--vp-shadow-2: 0 3px 12px rgba(0, 0, 0, .07), 0 1px 4px rgba(0, 0, 0, .07);--vp-shadow-3: 0 12px 32px rgba(0, 0, 0, .1), 0 2px 6px rgba(0, 0, 0, .08);--vp-shadow-4: 0 14px 44px rgba(0, 0, 0, .12), 0 3px 9px rgba(0, 0, 0, .12);--vp-shadow-5: 0 18px 56px rgba(0, 0, 0, .16), 0 4px 12px rgba(0, 0, 0, .16)}:root{--vp-z-index-footer: 10;--vp-z-index-local-nav: 20;--vp-z-index-nav: 30;--vp-z-index-layout-top: 40;--vp-z-index-backdrop: 50;--vp-z-index-sidebar: 60}@media (min-width: 960px){:root{--vp-z-index-sidebar: 25}}:root{--vp-layout-max-width: 1440px}:root{--vp-header-anchor-symbol: "#"}:root{--vp-code-line-height: 1.7;--vp-code-font-size: .875em;--vp-code-color: var(--vp-c-brand-1);--vp-code-link-color: var(--vp-c-brand-1);--vp-code-link-hover-color: var(--vp-c-brand-2);--vp-code-bg: var(--vp-c-default-soft);--vp-code-block-color: var(--vp-c-text-2);--vp-code-block-bg: var(--vp-c-bg-alt);--vp-code-block-divider-color: var(--vp-c-gutter);--vp-code-lang-color: var(--vp-c-text-3);--vp-code-line-highlight-color: var(--vp-c-default-soft);--vp-code-line-number-color: var(--vp-c-text-3);--vp-code-line-diff-add-color: var(--vp-c-success-soft);--vp-code-line-diff-add-symbol-color: var(--vp-c-success-1);--vp-code-line-diff-remove-color: var(--vp-c-danger-soft);--vp-code-line-diff-remove-symbol-color: var(--vp-c-danger-1);--vp-code-line-warning-color: var(--vp-c-warning-soft);--vp-code-line-error-color: var(--vp-c-danger-soft);--vp-code-copy-code-border-color: var(--vp-c-divider);--vp-code-copy-code-bg: var(--vp-c-bg-soft);--vp-code-copy-code-hover-border-color: var(--vp-c-divider);--vp-code-copy-code-hover-bg: var(--vp-c-bg);--vp-code-copy-code-active-text: var(--vp-c-text-2);--vp-code-copy-copied-text-content: "Copied";--vp-code-tab-divider: var(--vp-code-block-divider-color);--vp-code-tab-text-color: var(--vp-c-text-2);--vp-code-tab-bg: var(--vp-code-block-bg);--vp-code-tab-hover-text-color: var(--vp-c-text-1);--vp-code-tab-active-text-color: var(--vp-c-text-1);--vp-code-tab-active-bar-color: var(--vp-c-brand-1)}:root{--vp-button-brand-border: transparent;--vp-button-brand-text: var(--vp-c-white);--vp-button-brand-bg: var(--vp-c-brand-3);--vp-button-brand-hover-border: transparent;--vp-button-brand-hover-text: var(--vp-c-white);--vp-button-brand-hover-bg: var(--vp-c-brand-2);--vp-button-brand-active-border: transparent;--vp-button-brand-active-text: var(--vp-c-white);--vp-button-brand-active-bg: var(--vp-c-brand-1);--vp-button-alt-border: transparent;--vp-button-alt-text: var(--vp-c-text-1);--vp-button-alt-bg: var(--vp-c-default-3);--vp-button-alt-hover-border: transparent;--vp-button-alt-hover-text: var(--vp-c-text-1);--vp-button-alt-hover-bg: var(--vp-c-default-2);--vp-button-alt-active-border: transparent;--vp-button-alt-active-text: var(--vp-c-text-1);--vp-button-alt-active-bg: var(--vp-c-default-1);--vp-button-sponsor-border: var(--vp-c-text-2);--vp-button-sponsor-text: var(--vp-c-text-2);--vp-button-sponsor-bg: transparent;--vp-button-sponsor-hover-border: var(--vp-c-sponsor);--vp-button-sponsor-hover-text: var(--vp-c-sponsor);--vp-button-sponsor-hover-bg: transparent;--vp-button-sponsor-active-border: var(--vp-c-sponsor);--vp-button-sponsor-active-text: var(--vp-c-sponsor);--vp-button-sponsor-active-bg: transparent}:root{--vp-custom-block-font-size: 14px;--vp-custom-block-code-font-size: 13px;--vp-custom-block-info-border: transparent;--vp-custom-block-info-text: var(--vp-c-text-1);--vp-custom-block-info-bg: var(--vp-c-default-soft);--vp-custom-block-info-code-bg: var(--vp-c-default-soft);--vp-custom-block-note-border: transparent;--vp-custom-block-note-text: var(--vp-c-text-1);--vp-custom-block-note-bg: var(--vp-c-default-soft);--vp-custom-block-note-code-bg: var(--vp-c-default-soft);--vp-custom-block-tip-border: transparent;--vp-custom-block-tip-text: var(--vp-c-text-1);--vp-custom-block-tip-bg: var(--vp-c-tip-soft);--vp-custom-block-tip-code-bg: var(--vp-c-tip-soft);--vp-custom-block-important-border: transparent;--vp-custom-block-important-text: var(--vp-c-text-1);--vp-custom-block-important-bg: var(--vp-c-important-soft);--vp-custom-block-important-code-bg: var(--vp-c-important-soft);--vp-custom-block-warning-border: transparent;--vp-custom-block-warning-text: var(--vp-c-text-1);--vp-custom-block-warning-bg: var(--vp-c-warning-soft);--vp-custom-block-warning-code-bg: var(--vp-c-warning-soft);--vp-custom-block-danger-border: transparent;--vp-custom-block-danger-text: var(--vp-c-text-1);--vp-custom-block-danger-bg: var(--vp-c-danger-soft);--vp-custom-block-danger-code-bg: var(--vp-c-danger-soft);--vp-custom-block-caution-border: transparent;--vp-custom-block-caution-text: var(--vp-c-text-1);--vp-custom-block-caution-bg: var(--vp-c-caution-soft);--vp-custom-block-caution-code-bg: var(--vp-c-caution-soft);--vp-custom-block-details-border: var(--vp-custom-block-info-border);--vp-custom-block-details-text: var(--vp-custom-block-info-text);--vp-custom-block-details-bg: var(--vp-custom-block-info-bg);--vp-custom-block-details-code-bg: var(--vp-custom-block-info-code-bg)}:root{--vp-input-border-color: var(--vp-c-border);--vp-input-bg-color: var(--vp-c-bg-alt);--vp-input-switch-bg-color: var(--vp-c-default-soft)}:root{--vp-nav-height: 64px;--vp-nav-bg-color: var(--vp-c-bg);--vp-nav-screen-bg-color: var(--vp-c-bg);--vp-nav-logo-height: 24px}.hide-nav{--vp-nav-height: 0px}.hide-nav .VPSidebar{--vp-nav-height: 22px}:root{--vp-local-nav-bg-color: var(--vp-c-bg)}:root{--vp-sidebar-width: 272px;--vp-sidebar-bg-color: var(--vp-c-bg-alt)}:root{--vp-backdrop-bg-color: rgba(0, 0, 0, .6)}:root{--vp-home-hero-name-color: var(--vp-c-brand-1);--vp-home-hero-name-background: transparent;--vp-home-hero-image-background-image: none;--vp-home-hero-image-filter: none}:root{--vp-badge-info-border: transparent;--vp-badge-info-text: var(--vp-c-text-2);--vp-badge-info-bg: var(--vp-c-default-soft);--vp-badge-tip-border: transparent;--vp-badge-tip-text: var(--vp-c-tip-1);--vp-badge-tip-bg: var(--vp-c-tip-soft);--vp-badge-warning-border: transparent;--vp-badge-warning-text: var(--vp-c-warning-1);--vp-badge-warning-bg: var(--vp-c-warning-soft);--vp-badge-danger-border: transparent;--vp-badge-danger-text: var(--vp-c-danger-1);--vp-badge-danger-bg: var(--vp-c-danger-soft)}:root{--vp-carbon-ads-text-color: var(--vp-c-text-1);--vp-carbon-ads-poweredby-color: var(--vp-c-text-2);--vp-carbon-ads-bg-color: var(--vp-c-bg-soft);--vp-carbon-ads-hover-text-color: var(--vp-c-brand-1);--vp-carbon-ads-hover-poweredby-color: var(--vp-c-text-1)}:root{--vp-local-search-bg: var(--vp-c-bg);--vp-local-search-result-bg: var(--vp-c-bg);--vp-local-search-result-border: var(--vp-c-divider);--vp-local-search-result-selected-bg: var(--vp-c-bg);--vp-local-search-result-selected-border: var(--vp-c-brand-1);--vp-local-search-highlight-bg: var(--vp-c-brand-1);--vp-local-search-highlight-text: var(--vp-c-neutral-inverse)}@media (prefers-reduced-motion: reduce){*,:before,:after{animation-delay:-1ms!important;animation-duration:1ms!important;animation-iteration-count:1!important;background-attachment:initial!important;scroll-behavior:auto!important;transition-duration:0s!important;transition-delay:0s!important}}*,:before,:after{box-sizing:border-box}html{line-height:1.4;font-size:16px;-webkit-text-size-adjust:100%}html.dark{color-scheme:dark}body{margin:0;width:100%;min-width:320px;min-height:100vh;line-height:24px;font-family:var(--vp-font-family-base);font-size:16px;font-weight:400;color:var(--vp-c-text-1);background-color:var(--vp-c-bg);font-synthesis:style;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}main{display:block}h1,h2,h3,h4,h5,h6{margin:0;line-height:24px;font-size:16px;font-weight:400}p{margin:0}strong,b{font-weight:600}a,area,button,[role=button],input,label,select,summary,textarea{touch-action:manipulation}a{color:inherit;text-decoration:inherit}ol,ul{list-style:none;margin:0;padding:0}blockquote{margin:0}pre,code,kbd,samp{font-family:var(--vp-font-family-mono)}img,svg,video,canvas,audio,iframe,embed,object{display:block}figure{margin:0}img,video{max-width:100%;height:auto}button,input,optgroup,select,textarea{border:0;padding:0;line-height:inherit;color:inherit}button{padding:0;font-family:inherit;background-color:transparent;background-image:none}button:enabled,[role=button]:enabled{cursor:pointer}button:focus,button:focus-visible{outline:1px dotted;outline:4px auto -webkit-focus-ring-color}button:focus:not(:focus-visible){outline:none!important}input:focus,textarea:focus,select:focus{outline:none}table{border-collapse:collapse}input{background-color:transparent}input:-ms-input-placeholder,textarea:-ms-input-placeholder{color:var(--vp-c-text-3)}input::-ms-input-placeholder,textarea::-ms-input-placeholder{color:var(--vp-c-text-3)}input::placeholder,textarea::placeholder{color:var(--vp-c-text-3)}input::-webkit-outer-spin-button,input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}input[type=number]{-moz-appearance:textfield}textarea{resize:vertical}select{-webkit-appearance:none}fieldset{margin:0;padding:0}h1,h2,h3,h4,h5,h6,li,p{overflow-wrap:break-word}vite-error-overlay{z-index:9999}mjx-container{display:inline-block;margin:auto 2px -2px}mjx-container>svg{display:inline-block;margin:auto}[class^=vpi-],[class*=" vpi-"],.vp-icon{width:1em;height:1em}[class^=vpi-].bg,[class*=" vpi-"].bg,.vp-icon.bg{background-size:100% 100%;background-color:transparent}[class^=vpi-]:not(.bg),[class*=" vpi-"]:not(.bg),.vp-icon:not(.bg){-webkit-mask:var(--icon) no-repeat;mask:var(--icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit}.vpi-align-left{--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='M21 6H3M15 12H3M17 18H3'/%3E%3C/svg%3E")}.vpi-arrow-right,.vpi-arrow-down,.vpi-arrow-left,.vpi-arrow-up{--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='M5 12h14M12 5l7 7-7 7'/%3E%3C/svg%3E")}.vpi-chevron-right,.vpi-chevron-down,.vpi-chevron-left,.vpi-chevron-up{--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='m9 18 6-6-6-6'/%3E%3C/svg%3E")}.vpi-chevron-down,.vpi-arrow-down{transform:rotate(90deg)}.vpi-chevron-left,.vpi-arrow-left{transform:rotate(180deg)}.vpi-chevron-up,.vpi-arrow-up{transform:rotate(-90deg)}.vpi-square-pen{--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7'/%3E%3Cpath d='M18.375 2.625a2.121 2.121 0 1 1 3 3L12 15l-4 1 1-4Z'/%3E%3C/svg%3E")}.vpi-plus{--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='M5 12h14M12 5v14'/%3E%3C/svg%3E")}.vpi-sun{--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='4'/%3E%3Cpath d='M12 2v2M12 20v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2M6.34 17.66l-1.41 1.41M19.07 4.93l-1.41 1.41'/%3E%3C/svg%3E")}.vpi-moon{--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z'/%3E%3C/svg%3E")}.vpi-more-horizontal{--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='1'/%3E%3Ccircle cx='19' cy='12' r='1'/%3E%3Ccircle cx='5' cy='12' r='1'/%3E%3C/svg%3E")}.vpi-languages{--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='m5 8 6 6M4 14l6-6 2-3M2 5h12M7 2h1M22 22l-5-10-5 10M14 18h6'/%3E%3C/svg%3E")}.vpi-heart{--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z'/%3E%3C/svg%3E")}.vpi-search{--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E")}.vpi-layout-list{--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Crect width='7' height='7' x='3' y='3' rx='1'/%3E%3Crect width='7' height='7' x='3' y='14' rx='1'/%3E%3Cpath d='M14 4h7M14 9h7M14 15h7M14 20h7'/%3E%3C/svg%3E")}.vpi-delete{--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='M20 5H9l-7 7 7 7h11a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2ZM18 9l-6 6M12 9l6 6'/%3E%3C/svg%3E")}.vpi-corner-down-left{--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='m9 10-5 5 5 5'/%3E%3Cpath d='M20 4v7a4 4 0 0 1-4 4H4'/%3E%3C/svg%3E")}:root{--vp-icon-copy: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='rgba(128,128,128,1)' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Crect width='8' height='4' x='8' y='2' rx='1' ry='1'/%3E%3Cpath d='M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2'/%3E%3C/svg%3E");--vp-icon-copied: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='rgba(128,128,128,1)' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Crect width='8' height='4' x='8' y='2' rx='1' ry='1'/%3E%3Cpath d='M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2'/%3E%3Cpath d='m9 14 2 2 4-4'/%3E%3C/svg%3E")}.vpi-social-discord{--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M20.317 4.37a19.791 19.791 0 0 0-4.885-1.515.074.074 0 0 0-.079.037c-.21.375-.444.864-.608 1.25a18.27 18.27 0 0 0-5.487 0 12.64 12.64 0 0 0-.617-1.25.077.077 0 0 0-.079-.037A19.736 19.736 0 0 0 3.677 4.37a.07.07 0 0 0-.032.027C.533 9.046-.32 13.58.099 18.057a.082.082 0 0 0 .031.057 19.9 19.9 0 0 0 5.993 3.03.078.078 0 0 0 .084-.028c.462-.63.874-1.295 1.226-1.994a.076.076 0 0 0-.041-.106 13.107 13.107 0 0 1-1.872-.892.077.077 0 0 1-.008-.128 10.2 10.2 0 0 0 .372-.292.074.074 0 0 1 .077-.01c3.928 1.793 8.18 1.793 12.062 0a.074.074 0 0 1 .078.01c.12.098.246.198.373.292a.077.077 0 0 1-.006.127 12.299 12.299 0 0 1-1.873.892.077.077 0 0 0-.041.107c.36.698.772 1.362 1.225 1.993a.076.076 0 0 0 .084.028 19.839 19.839 0 0 0 6.002-3.03.077.077 0 0 0 .032-.054c.5-5.177-.838-9.674-3.549-13.66a.061.061 0 0 0-.031-.03zM8.02 15.33c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.956-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.956 2.418-2.157 2.418zm7.975 0c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.955-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.946 2.418-2.157 2.418Z'/%3E%3C/svg%3E")}.vpi-social-facebook{--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9.101 23.691v-7.98H6.627v-3.667h2.474v-1.58c0-4.085 1.848-5.978 5.858-5.978.401 0 .955.042 1.468.103a8.68 8.68 0 0 1 1.141.195v3.325a8.623 8.623 0 0 0-.653-.036 26.805 26.805 0 0 0-.733-.009c-.707 0-1.259.096-1.675.309a1.686 1.686 0 0 0-.679.622c-.258.42-.374.995-.374 1.752v1.297h3.919l-.386 2.103-.287 1.564h-3.246v8.245C19.396 23.238 24 18.179 24 12.044c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.628 3.874 10.35 9.101 11.647Z'/%3E%3C/svg%3E")}.vpi-social-github{--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12'/%3E%3C/svg%3E")}.vpi-social-instagram{--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7.03.084c-1.277.06-2.149.264-2.91.563a5.874 5.874 0 0 0-2.124 1.388 5.878 5.878 0 0 0-1.38 2.127C.321 4.926.12 5.8.064 7.076.008 8.354-.005 8.764.001 12.023c.007 3.259.021 3.667.083 4.947.061 1.277.264 2.149.563 2.911.308.789.72 1.457 1.388 2.123a5.872 5.872 0 0 0 2.129 1.38c.763.295 1.636.496 2.913.552 1.278.056 1.689.069 4.947.063 3.257-.007 3.668-.021 4.947-.082 1.28-.06 2.147-.265 2.91-.563a5.881 5.881 0 0 0 2.123-1.388 5.881 5.881 0 0 0 1.38-2.129c.295-.763.496-1.636.551-2.912.056-1.28.07-1.69.063-4.948-.006-3.258-.02-3.667-.081-4.947-.06-1.28-.264-2.148-.564-2.911a5.892 5.892 0 0 0-1.387-2.123 5.857 5.857 0 0 0-2.128-1.38C19.074.322 18.202.12 16.924.066 15.647.009 15.236-.006 11.977 0 8.718.008 8.31.021 7.03.084m.14 21.693c-1.17-.05-1.805-.245-2.228-.408a3.736 3.736 0 0 1-1.382-.895 3.695 3.695 0 0 1-.9-1.378c-.165-.423-.363-1.058-.417-2.228-.06-1.264-.072-1.644-.08-4.848-.006-3.204.006-3.583.061-4.848.05-1.169.246-1.805.408-2.228.216-.561.477-.96.895-1.382a3.705 3.705 0 0 1 1.379-.9c.423-.165 1.057-.361 2.227-.417 1.265-.06 1.644-.072 4.848-.08 3.203-.006 3.583.006 4.85.062 1.168.05 1.804.244 2.227.408.56.216.96.475 1.382.895.421.42.681.817.9 1.378.165.422.362 1.056.417 2.227.06 1.265.074 1.645.08 4.848.005 3.203-.006 3.583-.061 4.848-.051 1.17-.245 1.805-.408 2.23-.216.56-.477.96-.896 1.38a3.705 3.705 0 0 1-1.378.9c-.422.165-1.058.362-2.226.418-1.266.06-1.645.072-4.85.079-3.204.007-3.582-.006-4.848-.06m9.783-16.192a1.44 1.44 0 1 0 1.437-1.442 1.44 1.44 0 0 0-1.437 1.442M5.839 12.012a6.161 6.161 0 1 0 12.323-.024 6.162 6.162 0 0 0-12.323.024M8 12.008A4 4 0 1 1 12.008 16 4 4 0 0 1 8 12.008'/%3E%3C/svg%3E")}.vpi-social-linkedin{--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433a2.062 2.062 0 0 1-2.063-2.065 2.064 2.064 0 1 1 2.063 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z'/%3E%3C/svg%3E")}.vpi-social-mastodon{--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M23.268 5.313c-.35-2.578-2.617-4.61-5.304-5.004C17.51.242 15.792 0 11.813 0h-.03c-3.98 0-4.835.242-5.288.309C3.882.692 1.496 2.518.917 5.127.64 6.412.61 7.837.661 9.143c.074 1.874.088 3.745.26 5.611.118 1.24.325 2.47.62 3.68.55 2.237 2.777 4.098 4.96 4.857 2.336.792 4.849.923 7.256.38.265-.061.527-.132.786-.213.585-.184 1.27-.39 1.774-.753a.057.057 0 0 0 .023-.043v-1.809a.052.052 0 0 0-.02-.041.053.053 0 0 0-.046-.01 20.282 20.282 0 0 1-4.709.545c-2.73 0-3.463-1.284-3.674-1.818a5.593 5.593 0 0 1-.319-1.433.053.053 0 0 1 .066-.054c1.517.363 3.072.546 4.632.546.376 0 .75 0 1.125-.01 1.57-.044 3.224-.124 4.768-.422.038-.008.077-.015.11-.024 2.435-.464 4.753-1.92 4.989-5.604.008-.145.03-1.52.03-1.67.002-.512.167-3.63-.024-5.545zm-3.748 9.195h-2.561V8.29c0-1.309-.55-1.976-1.67-1.976-1.23 0-1.846.79-1.846 2.35v3.403h-2.546V8.663c0-1.56-.617-2.35-1.848-2.35-1.112 0-1.668.668-1.67 1.977v6.218H4.822V8.102c0-1.31.337-2.35 1.011-3.12.696-.77 1.608-1.164 2.74-1.164 1.311 0 2.302.5 2.962 1.498l.638 1.06.638-1.06c.66-.999 1.65-1.498 2.96-1.498 1.13 0 2.043.395 2.74 1.164.675.77 1.012 1.81 1.012 3.12z'/%3E%3C/svg%3E")}.vpi-social-npm{--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M1.763 0C.786 0 0 .786 0 1.763v20.474C0 23.214.786 24 1.763 24h20.474c.977 0 1.763-.786 1.763-1.763V1.763C24 .786 23.214 0 22.237 0zM5.13 5.323l13.837.019-.009 13.836h-3.464l.01-10.382h-3.456L12.04 19.17H5.113z'/%3E%3C/svg%3E")}.vpi-social-slack{--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5.042 15.165a2.528 2.528 0 0 1-2.52 2.523A2.528 2.528 0 0 1 0 15.165a2.527 2.527 0 0 1 2.522-2.52h2.52v2.52zm1.271 0a2.527 2.527 0 0 1 2.521-2.52 2.527 2.527 0 0 1 2.521 2.52v6.313A2.528 2.528 0 0 1 8.834 24a2.528 2.528 0 0 1-2.521-2.522v-6.313zM8.834 5.042a2.528 2.528 0 0 1-2.521-2.52A2.528 2.528 0 0 1 8.834 0a2.528 2.528 0 0 1 2.521 2.522v2.52H8.834zm0 1.271a2.528 2.528 0 0 1 2.521 2.521 2.528 2.528 0 0 1-2.521 2.521H2.522A2.528 2.528 0 0 1 0 8.834a2.528 2.528 0 0 1 2.522-2.521h6.312zm10.122 2.521a2.528 2.528 0 0 1 2.522-2.521A2.528 2.528 0 0 1 24 8.834a2.528 2.528 0 0 1-2.522 2.521h-2.522V8.834zm-1.268 0a2.528 2.528 0 0 1-2.523 2.521 2.527 2.527 0 0 1-2.52-2.521V2.522A2.527 2.527 0 0 1 15.165 0a2.528 2.528 0 0 1 2.523 2.522v6.312zm-2.523 10.122a2.528 2.528 0 0 1 2.523 2.522A2.528 2.528 0 0 1 15.165 24a2.527 2.527 0 0 1-2.52-2.522v-2.522h2.52zm0-1.268a2.527 2.527 0 0 1-2.52-2.523 2.526 2.526 0 0 1 2.52-2.52h6.313A2.527 2.527 0 0 1 24 15.165a2.528 2.528 0 0 1-2.522 2.523h-6.313z'/%3E%3C/svg%3E")}.vpi-social-twitter,.vpi-social-x{--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M18.901 1.153h3.68l-8.04 9.19L24 22.846h-7.406l-5.8-7.584-6.638 7.584H.474l8.6-9.83L0 1.154h7.594l5.243 6.932ZM17.61 20.644h2.039L6.486 3.24H4.298Z'/%3E%3C/svg%3E")}.vpi-social-youtube{--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M23.498 6.186a3.016 3.016 0 0 0-2.122-2.136C19.505 3.545 12 3.545 12 3.545s-7.505 0-9.377.505A3.017 3.017 0 0 0 .502 6.186C0 8.07 0 12 0 12s0 3.93.502 5.814a3.016 3.016 0 0 0 2.122 2.136c1.871.505 9.376.505 9.376.505s7.505 0 9.377-.505a3.015 3.015 0 0 0 2.122-2.136C24 15.93 24 12 24 12s0-3.93-.502-5.814zM9.545 15.568V8.432L15.818 12l-6.273 3.568z'/%3E%3C/svg%3E")}.visually-hidden{position:absolute;width:1px;height:1px;white-space:nowrap;clip:rect(0 0 0 0);clip-path:inset(50%);overflow:hidden}.custom-block{border:1px solid transparent;border-radius:8px;padding:16px 16px 8px;line-height:24px;font-size:var(--vp-custom-block-font-size);color:var(--vp-c-text-2)}.custom-block.info{border-color:var(--vp-custom-block-info-border);color:var(--vp-custom-block-info-text);background-color:var(--vp-custom-block-info-bg)}.custom-block.info a,.custom-block.info code{color:var(--vp-c-brand-1)}.custom-block.info a:hover,.custom-block.info a:hover>code{color:var(--vp-c-brand-2)}.custom-block.info code{background-color:var(--vp-custom-block-info-code-bg)}.custom-block.note{border-color:var(--vp-custom-block-note-border);color:var(--vp-custom-block-note-text);background-color:var(--vp-custom-block-note-bg)}.custom-block.note a,.custom-block.note code{color:var(--vp-c-brand-1)}.custom-block.note a:hover,.custom-block.note a:hover>code{color:var(--vp-c-brand-2)}.custom-block.note code{background-color:var(--vp-custom-block-note-code-bg)}.custom-block.tip{border-color:var(--vp-custom-block-tip-border);color:var(--vp-custom-block-tip-text);background-color:var(--vp-custom-block-tip-bg)}.custom-block.tip a,.custom-block.tip code{color:var(--vp-c-tip-1)}.custom-block.tip a:hover,.custom-block.tip a:hover>code{color:var(--vp-c-tip-2)}.custom-block.tip code{background-color:var(--vp-custom-block-tip-code-bg)}.custom-block.important{border-color:var(--vp-custom-block-important-border);color:var(--vp-custom-block-important-text);background-color:var(--vp-custom-block-important-bg)}.custom-block.important a,.custom-block.important code{color:var(--vp-c-important-1)}.custom-block.important a:hover,.custom-block.important a:hover>code{color:var(--vp-c-important-2)}.custom-block.important code{background-color:var(--vp-custom-block-important-code-bg)}.custom-block.warning{border-color:var(--vp-custom-block-warning-border);color:var(--vp-custom-block-warning-text);background-color:var(--vp-custom-block-warning-bg)}.custom-block.warning a,.custom-block.warning code{color:var(--vp-c-warning-1)}.custom-block.warning a:hover,.custom-block.warning a:hover>code{color:var(--vp-c-warning-2)}.custom-block.warning code{background-color:var(--vp-custom-block-warning-code-bg)}.custom-block.danger{border-color:var(--vp-custom-block-danger-border);color:var(--vp-custom-block-danger-text);background-color:var(--vp-custom-block-danger-bg)}.custom-block.danger a,.custom-block.danger code{color:var(--vp-c-danger-1)}.custom-block.danger a:hover,.custom-block.danger a:hover>code{color:var(--vp-c-danger-2)}.custom-block.danger code{background-color:var(--vp-custom-block-danger-code-bg)}.custom-block.caution{border-color:var(--vp-custom-block-caution-border);color:var(--vp-custom-block-caution-text);background-color:var(--vp-custom-block-caution-bg)}.custom-block.caution a,.custom-block.caution code{color:var(--vp-c-caution-1)}.custom-block.caution a:hover,.custom-block.caution a:hover>code{color:var(--vp-c-caution-2)}.custom-block.caution code{background-color:var(--vp-custom-block-caution-code-bg)}.custom-block.details{border-color:var(--vp-custom-block-details-border);color:var(--vp-custom-block-details-text);background-color:var(--vp-custom-block-details-bg)}.custom-block.details a{color:var(--vp-c-brand-1)}.custom-block.details a:hover,.custom-block.details a:hover>code{color:var(--vp-c-brand-2)}.custom-block.details code{background-color:var(--vp-custom-block-details-code-bg)}.custom-block-title{font-weight:600}.custom-block p+p{margin:8px 0}.custom-block.details summary{margin:0 0 8px;font-weight:700;cursor:pointer;-webkit-user-select:none;user-select:none}.custom-block.details summary+p{margin:8px 0}.custom-block a{color:inherit;font-weight:600;text-decoration:underline;text-underline-offset:2px;transition:opacity .25s}.custom-block a:hover{opacity:.75}.custom-block code{font-size:var(--vp-custom-block-code-font-size)}.custom-block.custom-block th,.custom-block.custom-block blockquote>p{font-size:var(--vp-custom-block-font-size);color:inherit}.dark .vp-code span{color:var(--shiki-dark, inherit)}html:not(.dark) .vp-code span{color:var(--shiki-light, inherit)}.vp-code-group{margin-top:16px}.vp-code-group .tabs{position:relative;display:flex;margin-right:-24px;margin-left:-24px;padding:0 12px;background-color:var(--vp-code-tab-bg);overflow-x:auto;overflow-y:hidden;box-shadow:inset 0 -1px var(--vp-code-tab-divider)}@media (min-width: 640px){.vp-code-group .tabs{margin-right:0;margin-left:0;border-radius:8px 8px 0 0}}.vp-code-group .tabs input{position:fixed;opacity:0;pointer-events:none}.vp-code-group .tabs label{position:relative;display:inline-block;border-bottom:1px solid transparent;padding:0 12px;line-height:48px;font-size:14px;font-weight:500;color:var(--vp-code-tab-text-color);white-space:nowrap;cursor:pointer;transition:color .25s}.vp-code-group .tabs label:after{position:absolute;right:8px;bottom:-1px;left:8px;z-index:1;height:2px;border-radius:2px;content:"";background-color:transparent;transition:background-color .25s}.vp-code-group label:hover{color:var(--vp-code-tab-hover-text-color)}.vp-code-group input:checked+label{color:var(--vp-code-tab-active-text-color)}.vp-code-group input:checked+label:after{background-color:var(--vp-code-tab-active-bar-color)}.vp-code-group div[class*=language-],.vp-block{display:none;margin-top:0!important;border-top-left-radius:0!important;border-top-right-radius:0!important}.vp-code-group div[class*=language-].active,.vp-block.active{display:block}.vp-block{padding:20px 24px}.vp-doc h1,.vp-doc h2,.vp-doc h3,.vp-doc h4,.vp-doc h5,.vp-doc h6{position:relative;font-weight:600;outline:none}.vp-doc h1{letter-spacing:-.02em;line-height:40px;font-size:28px}.vp-doc h2{margin:48px 0 16px;border-top:1px solid var(--vp-c-divider);padding-top:24px;letter-spacing:-.02em;line-height:32px;font-size:24px}.vp-doc h3{margin:32px 0 0;letter-spacing:-.01em;line-height:28px;font-size:20px}.vp-doc .header-anchor{position:absolute;top:0;left:0;margin-left:-.87em;font-weight:500;-webkit-user-select:none;user-select:none;opacity:0;text-decoration:none;transition:color .25s,opacity .25s}.vp-doc .header-anchor:before{content:var(--vp-header-anchor-symbol)}.vp-doc h1:hover .header-anchor,.vp-doc h1 .header-anchor:focus,.vp-doc h2:hover .header-anchor,.vp-doc h2 .header-anchor:focus,.vp-doc h3:hover .header-anchor,.vp-doc h3 .header-anchor:focus,.vp-doc h4:hover .header-anchor,.vp-doc h4 .header-anchor:focus,.vp-doc h5:hover .header-anchor,.vp-doc h5 .header-anchor:focus,.vp-doc h6:hover .header-anchor,.vp-doc h6 .header-anchor:focus{opacity:1}@media (min-width: 768px){.vp-doc h1{letter-spacing:-.02em;line-height:40px;font-size:32px}}.vp-doc h2 .header-anchor{top:24px}.vp-doc p,.vp-doc summary{margin:16px 0}.vp-doc p{line-height:28px}.vp-doc blockquote{margin:16px 0;border-left:2px solid var(--vp-c-divider);padding-left:16px;transition:border-color .5s}.vp-doc blockquote>p{margin:0;font-size:16px;color:var(--vp-c-text-2);transition:color .5s}.vp-doc a{font-weight:500;color:var(--vp-c-brand-1);text-decoration:underline;text-underline-offset:2px;transition:color .25s,opacity .25s}.vp-doc a:hover{color:var(--vp-c-brand-2)}.vp-doc strong{font-weight:600}.vp-doc ul,.vp-doc ol{padding-left:1.25rem;margin:16px 0}.vp-doc ul{list-style:disc}.vp-doc ol{list-style:decimal}.vp-doc li+li{margin-top:8px}.vp-doc li>ol,.vp-doc li>ul{margin:8px 0 0}.vp-doc table{display:block;border-collapse:collapse;margin:20px 0;overflow-x:auto}.vp-doc tr{background-color:var(--vp-c-bg);border-top:1px solid var(--vp-c-divider);transition:background-color .5s}.vp-doc tr:nth-child(2n){background-color:var(--vp-c-bg-soft)}.vp-doc th,.vp-doc td{border:1px solid var(--vp-c-divider);padding:8px 16px}.vp-doc th{text-align:left;font-size:14px;font-weight:600;color:var(--vp-c-text-2);background-color:var(--vp-c-bg-soft)}.vp-doc td{font-size:14px}.vp-doc hr{margin:16px 0;border:none;border-top:1px solid var(--vp-c-divider)}.vp-doc .custom-block{margin:16px 0}.vp-doc .custom-block p{margin:8px 0;line-height:24px}.vp-doc .custom-block p:first-child{margin:0}.vp-doc .custom-block div[class*=language-]{margin:8px 0;border-radius:8px}.vp-doc .custom-block div[class*=language-] code{font-weight:400;background-color:transparent}.vp-doc .custom-block .vp-code-group .tabs{margin:0;border-radius:8px 8px 0 0}.vp-doc :not(pre,h1,h2,h3,h4,h5,h6)>code{font-size:var(--vp-code-font-size);color:var(--vp-code-color)}.vp-doc :not(pre)>code{border-radius:4px;padding:3px 6px;background-color:var(--vp-code-bg);transition:color .25s,background-color .5s}.vp-doc a>code{color:var(--vp-code-link-color)}.vp-doc a:hover>code{color:var(--vp-code-link-hover-color)}.vp-doc h1>code,.vp-doc h2>code,.vp-doc h3>code{font-size:.9em}.vp-doc div[class*=language-],.vp-block{position:relative;margin:16px -24px;background-color:var(--vp-code-block-bg);overflow-x:auto;transition:background-color .5s}@media (min-width: 640px){.vp-doc div[class*=language-],.vp-block{border-radius:8px;margin:16px 0}}@media (max-width: 639px){.vp-doc li div[class*=language-]{border-radius:8px 0 0 8px}}.vp-doc div[class*=language-]+div[class*=language-],.vp-doc div[class$=-api]+div[class*=language-],.vp-doc div[class*=language-]+div[class$=-api]>div[class*=language-]{margin-top:-8px}.vp-doc [class*=language-] pre,.vp-doc [class*=language-] code{direction:ltr;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none}.vp-doc [class*=language-] pre{position:relative;z-index:1;margin:0;padding:20px 0;background:transparent;overflow-x:auto}.vp-doc [class*=language-] code{display:block;padding:0 24px;width:fit-content;min-width:100%;line-height:var(--vp-code-line-height);font-size:var(--vp-code-font-size);color:var(--vp-code-block-color);transition:color .5s}.vp-doc [class*=language-] code .highlighted{background-color:var(--vp-code-line-highlight-color);transition:background-color .5s;margin:0 -24px;padding:0 24px;width:calc(100% + 48px);display:inline-block}.vp-doc [class*=language-] code .highlighted.error{background-color:var(--vp-code-line-error-color)}.vp-doc [class*=language-] code .highlighted.warning{background-color:var(--vp-code-line-warning-color)}.vp-doc [class*=language-] code .diff{transition:background-color .5s;margin:0 -24px;padding:0 24px;width:calc(100% + 48px);display:inline-block}.vp-doc [class*=language-] code .diff:before{position:absolute;left:10px}.vp-doc [class*=language-] .has-focused-lines .line:not(.has-focus){filter:blur(.095rem);opacity:.4;transition:filter .35s,opacity .35s}.vp-doc [class*=language-] .has-focused-lines .line:not(.has-focus){opacity:.7;transition:filter .35s,opacity .35s}.vp-doc [class*=language-]:hover .has-focused-lines .line:not(.has-focus){filter:blur(0);opacity:1}.vp-doc [class*=language-] code .diff.remove{background-color:var(--vp-code-line-diff-remove-color);opacity:.7}.vp-doc [class*=language-] code .diff.remove:before{content:"-";color:var(--vp-code-line-diff-remove-symbol-color)}.vp-doc [class*=language-] code .diff.add{background-color:var(--vp-code-line-diff-add-color)}.vp-doc [class*=language-] code .diff.add:before{content:"+";color:var(--vp-code-line-diff-add-symbol-color)}.vp-doc div[class*=language-].line-numbers-mode{padding-left:32px}.vp-doc .line-numbers-wrapper{position:absolute;top:0;bottom:0;left:0;z-index:3;border-right:1px solid var(--vp-code-block-divider-color);padding-top:20px;width:32px;text-align:center;font-family:var(--vp-font-family-mono);line-height:var(--vp-code-line-height);font-size:var(--vp-code-font-size);color:var(--vp-code-line-number-color);transition:border-color .5s,color .5s}.vp-doc [class*=language-]>button.copy{direction:ltr;position:absolute;top:12px;right:12px;z-index:3;border:1px solid var(--vp-code-copy-code-border-color);border-radius:4px;width:40px;height:40px;background-color:var(--vp-code-copy-code-bg);opacity:0;cursor:pointer;background-image:var(--vp-icon-copy);background-position:50%;background-size:20px;background-repeat:no-repeat;transition:border-color .25s,background-color .25s,opacity .25s}.vp-doc [class*=language-]:hover>button.copy,.vp-doc [class*=language-]>button.copy:focus{opacity:1}.vp-doc [class*=language-]>button.copy:hover,.vp-doc [class*=language-]>button.copy.copied{border-color:var(--vp-code-copy-code-hover-border-color);background-color:var(--vp-code-copy-code-hover-bg)}.vp-doc [class*=language-]>button.copy.copied,.vp-doc [class*=language-]>button.copy:hover.copied{border-radius:0 4px 4px 0;background-color:var(--vp-code-copy-code-hover-bg);background-image:var(--vp-icon-copied)}.vp-doc [class*=language-]>button.copy.copied:before,.vp-doc [class*=language-]>button.copy:hover.copied:before{position:relative;top:-1px;transform:translate(calc(-100% - 1px));display:flex;justify-content:center;align-items:center;border:1px solid var(--vp-code-copy-code-hover-border-color);border-right:0;border-radius:4px 0 0 4px;padding:0 10px;width:fit-content;height:40px;text-align:center;font-size:12px;font-weight:500;color:var(--vp-code-copy-code-active-text);background-color:var(--vp-code-copy-code-hover-bg);white-space:nowrap;content:var(--vp-code-copy-copied-text-content)}.vp-doc [class*=language-]>span.lang{position:absolute;top:2px;right:8px;z-index:2;font-size:12px;font-weight:500;color:var(--vp-code-lang-color);transition:color .4s,opacity .4s}.vp-doc [class*=language-]:hover>button.copy+span.lang,.vp-doc [class*=language-]>button.copy:focus+span.lang{opacity:0}.vp-doc .VPTeamMembers{margin-top:24px}.vp-doc .VPTeamMembers.small.count-1 .container{margin:0!important;max-width:calc((100% - 24px)/2)!important}.vp-doc .VPTeamMembers.small.count-2 .container,.vp-doc .VPTeamMembers.small.count-3 .container{max-width:100%!important}.vp-doc .VPTeamMembers.medium.count-1 .container{margin:0!important;max-width:calc((100% - 24px)/2)!important}:is(.vp-external-link-icon,.vp-doc a[href*="://"],.vp-doc a[target=_blank]):not(.no-icon):after{display:inline-block;margin-top:-1px;margin-left:4px;width:11px;height:11px;background:currentColor;color:var(--vp-c-text-3);flex-shrink:0;--icon: url("data:image/svg+xml, %3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' %3E%3Cpath d='M0 0h24v24H0V0z' fill='none' /%3E%3Cpath d='M9 5v2h6.59L4 18.59 5.41 20 17 8.41V15h2V5H9z' /%3E%3C/svg%3E");-webkit-mask-image:var(--icon);mask-image:var(--icon)}.vp-external-link-icon:after{content:""}.external-link-icon-enabled :is(.vp-doc a[href*="://"],.vp-doc a[target=_blank]):after{content:"";color:currentColor}.vp-sponsor{border-radius:16px;overflow:hidden}.vp-sponsor.aside{border-radius:12px}.vp-sponsor-section+.vp-sponsor-section{margin-top:4px}.vp-sponsor-tier{margin:0 0 4px!important;text-align:center;letter-spacing:1px!important;line-height:24px;width:100%;font-weight:600;color:var(--vp-c-text-2);background-color:var(--vp-c-bg-soft)}.vp-sponsor.normal .vp-sponsor-tier{padding:13px 0 11px;font-size:14px}.vp-sponsor.aside .vp-sponsor-tier{padding:9px 0 7px;font-size:12px}.vp-sponsor-grid+.vp-sponsor-tier{margin-top:4px}.vp-sponsor-grid{display:flex;flex-wrap:wrap;gap:4px}.vp-sponsor-grid.xmini .vp-sponsor-grid-link{height:64px}.vp-sponsor-grid.xmini .vp-sponsor-grid-image{max-width:64px;max-height:22px}.vp-sponsor-grid.mini .vp-sponsor-grid-link{height:72px}.vp-sponsor-grid.mini .vp-sponsor-grid-image{max-width:96px;max-height:24px}.vp-sponsor-grid.small .vp-sponsor-grid-link{height:96px}.vp-sponsor-grid.small .vp-sponsor-grid-image{max-width:96px;max-height:24px}.vp-sponsor-grid.medium .vp-sponsor-grid-link{height:112px}.vp-sponsor-grid.medium .vp-sponsor-grid-image{max-width:120px;max-height:36px}.vp-sponsor-grid.big .vp-sponsor-grid-link{height:184px}.vp-sponsor-grid.big .vp-sponsor-grid-image{max-width:192px;max-height:56px}.vp-sponsor-grid[data-vp-grid="2"] .vp-sponsor-grid-item{width:calc((100% - 4px)/2)}.vp-sponsor-grid[data-vp-grid="3"] .vp-sponsor-grid-item{width:calc((100% - 4px * 2) / 3)}.vp-sponsor-grid[data-vp-grid="4"] .vp-sponsor-grid-item{width:calc((100% - 12px)/4)}.vp-sponsor-grid[data-vp-grid="5"] .vp-sponsor-grid-item{width:calc((100% - 16px)/5)}.vp-sponsor-grid[data-vp-grid="6"] .vp-sponsor-grid-item{width:calc((100% - 4px * 5) / 6)}.vp-sponsor-grid-item{flex-shrink:0;width:100%;background-color:var(--vp-c-bg-soft);transition:background-color .25s}.vp-sponsor-grid-item:hover{background-color:var(--vp-c-default-soft)}.vp-sponsor-grid-item:hover .vp-sponsor-grid-image{filter:grayscale(0) invert(0)}.vp-sponsor-grid-item.empty:hover{background-color:var(--vp-c-bg-soft)}.dark .vp-sponsor-grid-item:hover{background-color:var(--vp-c-white)}.dark .vp-sponsor-grid-item.empty:hover{background-color:var(--vp-c-bg-soft)}.vp-sponsor-grid-link{display:flex}.vp-sponsor-grid-box{display:flex;justify-content:center;align-items:center;width:100%}.vp-sponsor-grid-image{max-width:100%;filter:grayscale(1);transition:filter .25s}.dark .vp-sponsor-grid-image{filter:grayscale(1) invert(1)}.VPBadge{display:inline-block;margin-left:2px;border:1px solid transparent;border-radius:12px;padding:0 10px;line-height:22px;font-size:12px;font-weight:500;transform:translateY(-2px)}.VPBadge.small{padding:0 6px;line-height:18px;font-size:10px;transform:translateY(-8px)}.VPDocFooter .VPBadge{display:none}.vp-doc h1>.VPBadge{margin-top:4px;vertical-align:top}.vp-doc h2>.VPBadge{margin-top:3px;padding:0 8px;vertical-align:top}.vp-doc h3>.VPBadge{vertical-align:middle}.vp-doc h4>.VPBadge,.vp-doc h5>.VPBadge,.vp-doc h6>.VPBadge{vertical-align:middle;line-height:18px}.VPBadge.info{border-color:var(--vp-badge-info-border);color:var(--vp-badge-info-text);background-color:var(--vp-badge-info-bg)}.VPBadge.tip{border-color:var(--vp-badge-tip-border);color:var(--vp-badge-tip-text);background-color:var(--vp-badge-tip-bg)}.VPBadge.warning{border-color:var(--vp-badge-warning-border);color:var(--vp-badge-warning-text);background-color:var(--vp-badge-warning-bg)}.VPBadge.danger{border-color:var(--vp-badge-danger-border);color:var(--vp-badge-danger-text);background-color:var(--vp-badge-danger-bg)}.VPBackdrop[data-v-c79a1216]{position:fixed;top:0;right:0;bottom:0;left:0;z-index:var(--vp-z-index-backdrop);background:var(--vp-backdrop-bg-color);transition:opacity .5s}.VPBackdrop.fade-enter-from[data-v-c79a1216],.VPBackdrop.fade-leave-to[data-v-c79a1216]{opacity:0}.VPBackdrop.fade-leave-active[data-v-c79a1216]{transition-duration:.25s}@media (min-width: 1280px){.VPBackdrop[data-v-c79a1216]{display:none}}.NotFound[data-v-f87ff6e4]{padding:64px 24px 96px;text-align:center}@media (min-width: 768px){.NotFound[data-v-f87ff6e4]{padding:96px 32px 168px}}.code[data-v-f87ff6e4]{line-height:64px;font-size:64px;font-weight:600}.title[data-v-f87ff6e4]{padding-top:12px;letter-spacing:2px;line-height:20px;font-size:20px;font-weight:700}.divider[data-v-f87ff6e4]{margin:24px auto 18px;width:64px;height:1px;background-color:var(--vp-c-divider)}.quote[data-v-f87ff6e4]{margin:0 auto;max-width:256px;font-size:14px;font-weight:500;color:var(--vp-c-text-2)}.action[data-v-f87ff6e4]{padding-top:20px}.link[data-v-f87ff6e4]{display:inline-block;border:1px solid var(--vp-c-brand-1);border-radius:16px;padding:3px 16px;font-size:14px;font-weight:500;color:var(--vp-c-brand-1);transition:border-color .25s,color .25s}.link[data-v-f87ff6e4]:hover{border-color:var(--vp-c-brand-2);color:var(--vp-c-brand-2)}.root[data-v-b933a997]{position:relative;z-index:1}.nested[data-v-b933a997]{padding-right:16px;padding-left:16px}.outline-link[data-v-b933a997]{display:block;line-height:32px;font-size:14px;font-weight:400;color:var(--vp-c-text-2);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;transition:color .5s}.outline-link[data-v-b933a997]:hover,.outline-link.active[data-v-b933a997]{color:var(--vp-c-text-1);transition:color .25s}.outline-link.nested[data-v-b933a997]{padding-left:13px}.VPDocAsideOutline[data-v-935f8a84]{display:none}.VPDocAsideOutline.has-outline[data-v-935f8a84]{display:block}.content[data-v-935f8a84]{position:relative;border-left:1px solid var(--vp-c-divider);padding-left:16px;font-size:13px;font-weight:500}.outline-marker[data-v-935f8a84]{position:absolute;top:32px;left:-1px;z-index:0;opacity:0;width:2px;border-radius:2px;height:18px;background-color:var(--vp-c-brand-1);transition:top .25s cubic-bezier(0,1,.5,1),background-color .5s,opacity .25s}.outline-title[data-v-935f8a84]{line-height:32px;font-size:14px;font-weight:600}.VPDocAside[data-v-3f215769]{display:flex;flex-direction:column;flex-grow:1}.spacer[data-v-3f215769]{flex-grow:1}.VPDocAside[data-v-3f215769] .spacer+.VPDocAsideSponsors,.VPDocAside[data-v-3f215769] .spacer+.VPDocAsideCarbonAds{margin-top:24px}.VPDocAside[data-v-3f215769] .VPDocAsideSponsors+.VPDocAsideCarbonAds{margin-top:16px}.VPLastUpdated[data-v-7e05ebdb]{line-height:24px;font-size:14px;font-weight:500;color:var(--vp-c-text-2)}@media (min-width: 640px){.VPLastUpdated[data-v-7e05ebdb]{line-height:32px;font-size:14px;font-weight:500}}.VPDocFooter[data-v-09de1c0f]{margin-top:64px}.edit-info[data-v-09de1c0f]{padding-bottom:18px}@media (min-width: 640px){.edit-info[data-v-09de1c0f]{display:flex;justify-content:space-between;align-items:center;padding-bottom:14px}}.edit-link-button[data-v-09de1c0f]{display:flex;align-items:center;border:0;line-height:32px;font-size:14px;font-weight:500;color:var(--vp-c-brand-1);transition:color .25s}.edit-link-button[data-v-09de1c0f]:hover{color:var(--vp-c-brand-2)}.edit-link-icon[data-v-09de1c0f]{margin-right:8px}.prev-next[data-v-09de1c0f]{border-top:1px solid var(--vp-c-divider);padding-top:24px;display:grid;grid-row-gap:8px}@media (min-width: 640px){.prev-next[data-v-09de1c0f]{grid-template-columns:repeat(2,1fr);grid-column-gap:16px}}.pager-link[data-v-09de1c0f]{display:block;border:1px solid var(--vp-c-divider);border-radius:8px;padding:11px 16px 13px;width:100%;height:100%;transition:border-color .25s}.pager-link[data-v-09de1c0f]:hover{border-color:var(--vp-c-brand-1)}.pager-link.next[data-v-09de1c0f]{margin-left:auto;text-align:right}.desc[data-v-09de1c0f]{display:block;line-height:20px;font-size:12px;font-weight:500;color:var(--vp-c-text-2)}.title[data-v-09de1c0f]{display:block;line-height:20px;font-size:14px;font-weight:500;color:var(--vp-c-brand-1);transition:color .25s}.VPDoc[data-v-39a288b8]{padding:32px 24px 96px;width:100%}@media (min-width: 768px){.VPDoc[data-v-39a288b8]{padding:48px 32px 128px}}@media (min-width: 960px){.VPDoc[data-v-39a288b8]{padding:48px 32px 0}.VPDoc:not(.has-sidebar) .container[data-v-39a288b8]{display:flex;justify-content:center;max-width:992px}.VPDoc:not(.has-sidebar) .content[data-v-39a288b8]{max-width:752px}}@media (min-width: 1280px){.VPDoc .container[data-v-39a288b8]{display:flex;justify-content:center}.VPDoc .aside[data-v-39a288b8]{display:block}}@media (min-width: 1440px){.VPDoc:not(.has-sidebar) .content[data-v-39a288b8]{max-width:784px}.VPDoc:not(.has-sidebar) .container[data-v-39a288b8]{max-width:1104px}}.container[data-v-39a288b8]{margin:0 auto;width:100%}.aside[data-v-39a288b8]{position:relative;display:none;order:2;flex-grow:1;padding-left:32px;width:100%;max-width:256px}.left-aside[data-v-39a288b8]{order:1;padding-left:unset;padding-right:32px}.aside-container[data-v-39a288b8]{position:fixed;top:0;padding-top:calc(var(--vp-nav-height) + var(--vp-layout-top-height, 0px) + var(--vp-doc-top-height, 0px) + 48px);width:224px;height:100vh;overflow-x:hidden;overflow-y:auto;scrollbar-width:none}.aside-container[data-v-39a288b8]::-webkit-scrollbar{display:none}.aside-curtain[data-v-39a288b8]{position:fixed;bottom:0;z-index:10;width:224px;height:32px;background:linear-gradient(transparent,var(--vp-c-bg) 70%)}.aside-content[data-v-39a288b8]{display:flex;flex-direction:column;min-height:calc(100vh - (var(--vp-nav-height) + var(--vp-layout-top-height, 0px) + 48px));padding-bottom:32px}.content[data-v-39a288b8]{position:relative;margin:0 auto;width:100%}@media (min-width: 960px){.content[data-v-39a288b8]{padding:0 32px 128px}}@media (min-width: 1280px){.content[data-v-39a288b8]{order:1;margin:0;min-width:640px}}.content-container[data-v-39a288b8]{margin:0 auto}.VPDoc.has-aside .content-container[data-v-39a288b8]{max-width:688px}.VPButton[data-v-cad61b99]{display:inline-block;border:1px solid transparent;text-align:center;font-weight:600;white-space:nowrap;transition:color .25s,border-color .25s,background-color .25s}.VPButton[data-v-cad61b99]:active{transition:color .1s,border-color .1s,background-color .1s}.VPButton.medium[data-v-cad61b99]{border-radius:20px;padding:0 20px;line-height:38px;font-size:14px}.VPButton.big[data-v-cad61b99]{border-radius:24px;padding:0 24px;line-height:46px;font-size:16px}.VPButton.brand[data-v-cad61b99]{border-color:var(--vp-button-brand-border);color:var(--vp-button-brand-text);background-color:var(--vp-button-brand-bg)}.VPButton.brand[data-v-cad61b99]:hover{border-color:var(--vp-button-brand-hover-border);color:var(--vp-button-brand-hover-text);background-color:var(--vp-button-brand-hover-bg)}.VPButton.brand[data-v-cad61b99]:active{border-color:var(--vp-button-brand-active-border);color:var(--vp-button-brand-active-text);background-color:var(--vp-button-brand-active-bg)}.VPButton.alt[data-v-cad61b99]{border-color:var(--vp-button-alt-border);color:var(--vp-button-alt-text);background-color:var(--vp-button-alt-bg)}.VPButton.alt[data-v-cad61b99]:hover{border-color:var(--vp-button-alt-hover-border);color:var(--vp-button-alt-hover-text);background-color:var(--vp-button-alt-hover-bg)}.VPButton.alt[data-v-cad61b99]:active{border-color:var(--vp-button-alt-active-border);color:var(--vp-button-alt-active-text);background-color:var(--vp-button-alt-active-bg)}.VPButton.sponsor[data-v-cad61b99]{border-color:var(--vp-button-sponsor-border);color:var(--vp-button-sponsor-text);background-color:var(--vp-button-sponsor-bg)}.VPButton.sponsor[data-v-cad61b99]:hover{border-color:var(--vp-button-sponsor-hover-border);color:var(--vp-button-sponsor-hover-text);background-color:var(--vp-button-sponsor-hover-bg)}.VPButton.sponsor[data-v-cad61b99]:active{border-color:var(--vp-button-sponsor-active-border);color:var(--vp-button-sponsor-active-text);background-color:var(--vp-button-sponsor-active-bg)}html:not(.dark) .VPImage.dark[data-v-8426fc1a]{display:none}.dark .VPImage.light[data-v-8426fc1a]{display:none}.VPHero[data-v-303bb580]{margin-top:calc((var(--vp-nav-height) + var(--vp-layout-top-height, 0px)) * -1);padding:calc(var(--vp-nav-height) + var(--vp-layout-top-height, 0px) + 48px) 24px 48px}@media (min-width: 640px){.VPHero[data-v-303bb580]{padding:calc(var(--vp-nav-height) + var(--vp-layout-top-height, 0px) + 80px) 48px 64px}}@media (min-width: 960px){.VPHero[data-v-303bb580]{padding:calc(var(--vp-nav-height) + var(--vp-layout-top-height, 0px) + 80px) 64px 64px}}.container[data-v-303bb580]{display:flex;flex-direction:column;margin:0 auto;max-width:1152px}@media (min-width: 960px){.container[data-v-303bb580]{flex-direction:row}}.main[data-v-303bb580]{position:relative;z-index:10;order:2;flex-grow:1;flex-shrink:0}.VPHero.has-image .container[data-v-303bb580]{text-align:center}@media (min-width: 960px){.VPHero.has-image .container[data-v-303bb580]{text-align:left}}@media (min-width: 960px){.main[data-v-303bb580]{order:1;width:calc((100% / 3) * 2)}.VPHero.has-image .main[data-v-303bb580]{max-width:592px}}.name[data-v-303bb580],.text[data-v-303bb580]{max-width:392px;letter-spacing:-.4px;line-height:40px;font-size:32px;font-weight:700;white-space:pre-wrap}.VPHero.has-image .name[data-v-303bb580],.VPHero.has-image .text[data-v-303bb580]{margin:0 auto}.name[data-v-303bb580]{color:var(--vp-home-hero-name-color)}.clip[data-v-303bb580]{background:var(--vp-home-hero-name-background);-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:var(--vp-home-hero-name-color)}@media (min-width: 640px){.name[data-v-303bb580],.text[data-v-303bb580]{max-width:576px;line-height:56px;font-size:48px}}@media (min-width: 960px){.name[data-v-303bb580],.text[data-v-303bb580]{line-height:64px;font-size:56px}.VPHero.has-image .name[data-v-303bb580],.VPHero.has-image .text[data-v-303bb580]{margin:0}}.tagline[data-v-303bb580]{padding-top:8px;max-width:392px;line-height:28px;font-size:18px;font-weight:500;white-space:pre-wrap;color:var(--vp-c-text-2)}.VPHero.has-image .tagline[data-v-303bb580]{margin:0 auto}@media (min-width: 640px){.tagline[data-v-303bb580]{padding-top:12px;max-width:576px;line-height:32px;font-size:20px}}@media (min-width: 960px){.tagline[data-v-303bb580]{line-height:36px;font-size:24px}.VPHero.has-image .tagline[data-v-303bb580]{margin:0}}.actions[data-v-303bb580]{display:flex;flex-wrap:wrap;margin:-6px;padding-top:24px}.VPHero.has-image .actions[data-v-303bb580]{justify-content:center}@media (min-width: 640px){.actions[data-v-303bb580]{padding-top:32px}}@media (min-width: 960px){.VPHero.has-image .actions[data-v-303bb580]{justify-content:flex-start}}.action[data-v-303bb580]{flex-shrink:0;padding:6px}.image[data-v-303bb580]{order:1;margin:-76px -24px -48px}@media (min-width: 640px){.image[data-v-303bb580]{margin:-108px -24px -48px}}@media (min-width: 960px){.image[data-v-303bb580]{flex-grow:1;order:2;margin:0;min-height:100%}}.image-container[data-v-303bb580]{position:relative;margin:0 auto;width:320px;height:320px}@media (min-width: 640px){.image-container[data-v-303bb580]{width:392px;height:392px}}@media (min-width: 960px){.image-container[data-v-303bb580]{display:flex;justify-content:center;align-items:center;width:100%;height:100%;transform:translate(-32px,-32px)}}.image-bg[data-v-303bb580]{position:absolute;top:50%;left:50%;border-radius:50%;width:192px;height:192px;background-image:var(--vp-home-hero-image-background-image);filter:var(--vp-home-hero-image-filter);transform:translate(-50%,-50%)}@media (min-width: 640px){.image-bg[data-v-303bb580]{width:256px;height:256px}}@media (min-width: 960px){.image-bg[data-v-303bb580]{width:320px;height:320px}}[data-v-303bb580] .image-src{position:absolute;top:50%;left:50%;max-width:192px;max-height:192px;transform:translate(-50%,-50%)}@media (min-width: 640px){[data-v-303bb580] .image-src{max-width:256px;max-height:256px}}@media (min-width: 960px){[data-v-303bb580] .image-src{max-width:320px;max-height:320px}}.VPFeature[data-v-a3976bdc]{display:block;border:1px solid var(--vp-c-bg-soft);border-radius:12px;height:100%;background-color:var(--vp-c-bg-soft);transition:border-color .25s,background-color .25s}.VPFeature.link[data-v-a3976bdc]:hover{border-color:var(--vp-c-brand-1)}.box[data-v-a3976bdc]{display:flex;flex-direction:column;padding:24px;height:100%}.box[data-v-a3976bdc]>.VPImage{margin-bottom:20px}.icon[data-v-a3976bdc]{display:flex;justify-content:center;align-items:center;margin-bottom:20px;border-radius:6px;background-color:var(--vp-c-default-soft);width:48px;height:48px;font-size:24px;transition:background-color .25s}.title[data-v-a3976bdc]{line-height:24px;font-size:16px;font-weight:600}.details[data-v-a3976bdc]{flex-grow:1;padding-top:8px;line-height:24px;font-size:14px;font-weight:500;color:var(--vp-c-text-2)}.link-text[data-v-a3976bdc]{padding-top:8px}.link-text-value[data-v-a3976bdc]{display:flex;align-items:center;font-size:14px;font-weight:500;color:var(--vp-c-brand-1)}.link-text-icon[data-v-a3976bdc]{margin-left:6px}.VPFeatures[data-v-a6181336]{position:relative;padding:0 24px}@media (min-width: 640px){.VPFeatures[data-v-a6181336]{padding:0 48px}}@media (min-width: 960px){.VPFeatures[data-v-a6181336]{padding:0 64px}}.container[data-v-a6181336]{margin:0 auto;max-width:1152px}.items[data-v-a6181336]{display:flex;flex-wrap:wrap;margin:-8px}.item[data-v-a6181336]{padding:8px;width:100%}@media (min-width: 640px){.item.grid-2[data-v-a6181336],.item.grid-4[data-v-a6181336],.item.grid-6[data-v-a6181336]{width:50%}}@media (min-width: 768px){.item.grid-2[data-v-a6181336],.item.grid-4[data-v-a6181336]{width:50%}.item.grid-3[data-v-a6181336],.item.grid-6[data-v-a6181336]{width:calc(100% / 3)}}@media (min-width: 960px){.item.grid-4[data-v-a6181336]{width:25%}}.container[data-v-82d4af08]{margin:auto;width:100%;max-width:1280px;padding:0 24px}@media (min-width: 640px){.container[data-v-82d4af08]{padding:0 48px}}@media (min-width: 960px){.container[data-v-82d4af08]{width:100%;padding:0 64px}}.vp-doc[data-v-82d4af08] .VPHomeSponsors,.vp-doc[data-v-82d4af08] .VPTeamPage{margin-left:var(--vp-offset, calc(50% - 50vw) );margin-right:var(--vp-offset, calc(50% - 50vw) )}.vp-doc[data-v-82d4af08] .VPHomeSponsors h2{border-top:none;letter-spacing:normal}.vp-doc[data-v-82d4af08] .VPHomeSponsors a,.vp-doc[data-v-82d4af08] .VPTeamPage a{text-decoration:none}.VPHome[data-v-686f80a6]{margin-bottom:96px}@media (min-width: 768px){.VPHome[data-v-686f80a6]{margin-bottom:128px}}.VPContent[data-v-1428d186]{flex-grow:1;flex-shrink:0;margin:var(--vp-layout-top-height, 0px) auto 0;width:100%}.VPContent.is-home[data-v-1428d186]{width:100%;max-width:100%}.VPContent.has-sidebar[data-v-1428d186]{margin:0}@media (min-width: 960px){.VPContent[data-v-1428d186]{padding-top:var(--vp-nav-height)}.VPContent.has-sidebar[data-v-1428d186]{margin:var(--vp-layout-top-height, 0px) 0 0;padding-left:var(--vp-sidebar-width)}}@media (min-width: 1440px){.VPContent.has-sidebar[data-v-1428d186]{padding-right:calc((100vw - var(--vp-layout-max-width)) / 2);padding-left:calc((100vw - var(--vp-layout-max-width)) / 2 + var(--vp-sidebar-width))}}.VPFooter[data-v-e315a0ad]{position:relative;z-index:var(--vp-z-index-footer);border-top:1px solid var(--vp-c-gutter);padding:32px 24px;background-color:var(--vp-c-bg)}.VPFooter.has-sidebar[data-v-e315a0ad]{display:none}.VPFooter[data-v-e315a0ad] a{text-decoration-line:underline;text-underline-offset:2px;transition:color .25s}.VPFooter[data-v-e315a0ad] a:hover{color:var(--vp-c-text-1)}@media (min-width: 768px){.VPFooter[data-v-e315a0ad]{padding:32px}}.container[data-v-e315a0ad]{margin:0 auto;max-width:var(--vp-layout-max-width);text-align:center}.message[data-v-e315a0ad],.copyright[data-v-e315a0ad]{line-height:24px;font-size:14px;font-weight:500;color:var(--vp-c-text-2)}.VPLocalNavOutlineDropdown[data-v-d2ecc192]{padding:12px 20px 11px}@media (min-width: 960px){.VPLocalNavOutlineDropdown[data-v-d2ecc192]{padding:12px 36px 11px}}.VPLocalNavOutlineDropdown button[data-v-d2ecc192]{display:block;font-size:12px;font-weight:500;line-height:24px;color:var(--vp-c-text-2);transition:color .5s;position:relative}.VPLocalNavOutlineDropdown button[data-v-d2ecc192]:hover{color:var(--vp-c-text-1);transition:color .25s}.VPLocalNavOutlineDropdown button.open[data-v-d2ecc192]{color:var(--vp-c-text-1)}.icon[data-v-d2ecc192]{display:inline-block;vertical-align:middle;margin-left:2px;font-size:14px;transform:rotate(0);transition:transform .25s}@media (min-width: 960px){.VPLocalNavOutlineDropdown button[data-v-d2ecc192]{font-size:14px}.icon[data-v-d2ecc192]{font-size:16px}}.open>.icon[data-v-d2ecc192]{transform:rotate(90deg)}.items[data-v-d2ecc192]{position:absolute;top:40px;right:16px;left:16px;display:grid;gap:1px;border:1px solid var(--vp-c-border);border-radius:8px;background-color:var(--vp-c-gutter);max-height:calc(var(--vp-vh, 100vh) - 86px);overflow:hidden auto;box-shadow:var(--vp-shadow-3)}@media (min-width: 960px){.items[data-v-d2ecc192]{right:auto;left:calc(var(--vp-sidebar-width) + 32px);width:320px}}.header[data-v-d2ecc192]{background-color:var(--vp-c-bg-soft)}.top-link[data-v-d2ecc192]{display:block;padding:0 16px;line-height:48px;font-size:14px;font-weight:500;color:var(--vp-c-brand-1)}.outline[data-v-d2ecc192]{padding:8px 0;background-color:var(--vp-c-bg-soft)}.flyout-enter-active[data-v-d2ecc192]{transition:all .2s ease-out}.flyout-leave-active[data-v-d2ecc192]{transition:all .15s ease-in}.flyout-enter-from[data-v-d2ecc192],.flyout-leave-to[data-v-d2ecc192]{opacity:0;transform:translateY(-16px)}.VPLocalNav[data-v-a6f0e41e]{position:sticky;top:0;left:0;z-index:var(--vp-z-index-local-nav);border-bottom:1px solid var(--vp-c-gutter);padding-top:var(--vp-layout-top-height, 0px);width:100%;background-color:var(--vp-local-nav-bg-color)}.VPLocalNav.fixed[data-v-a6f0e41e]{position:fixed}@media (min-width: 960px){.VPLocalNav[data-v-a6f0e41e]{top:var(--vp-nav-height)}.VPLocalNav.has-sidebar[data-v-a6f0e41e]{padding-left:var(--vp-sidebar-width)}.VPLocalNav.empty[data-v-a6f0e41e]{display:none}}@media (min-width: 1280px){.VPLocalNav[data-v-a6f0e41e]{display:none}}@media (min-width: 1440px){.VPLocalNav.has-sidebar[data-v-a6f0e41e]{padding-left:calc((100vw - var(--vp-layout-max-width)) / 2 + var(--vp-sidebar-width))}}.container[data-v-a6f0e41e]{display:flex;justify-content:space-between;align-items:center}.menu[data-v-a6f0e41e]{display:flex;align-items:center;padding:12px 24px 11px;line-height:24px;font-size:12px;font-weight:500;color:var(--vp-c-text-2);transition:color .5s}.menu[data-v-a6f0e41e]:hover{color:var(--vp-c-text-1);transition:color .25s}@media (min-width: 768px){.menu[data-v-a6f0e41e]{padding:0 32px}}@media (min-width: 960px){.menu[data-v-a6f0e41e]{display:none}}.menu-icon[data-v-a6f0e41e]{margin-right:8px;font-size:14px}.VPOutlineDropdown[data-v-a6f0e41e]{padding:12px 24px 11px}@media (min-width: 768px){.VPOutlineDropdown[data-v-a6f0e41e]{padding:12px 32px 11px}}.VPSwitch[data-v-1d5665e3]{position:relative;border-radius:11px;display:block;width:40px;height:22px;flex-shrink:0;border:1px solid var(--vp-input-border-color);background-color:var(--vp-input-switch-bg-color);transition:border-color .25s!important}.VPSwitch[data-v-1d5665e3]:hover{border-color:var(--vp-c-brand-1)}.check[data-v-1d5665e3]{position:absolute;top:1px;left:1px;width:18px;height:18px;border-radius:50%;background-color:var(--vp-c-neutral-inverse);box-shadow:var(--vp-shadow-1);transition:transform .25s!important}.icon[data-v-1d5665e3]{position:relative;display:block;width:18px;height:18px;border-radius:50%;overflow:hidden}.icon[data-v-1d5665e3] [class^=vpi-]{position:absolute;top:3px;left:3px;width:12px;height:12px;color:var(--vp-c-text-2)}.dark .icon[data-v-1d5665e3] [class^=vpi-]{color:var(--vp-c-text-1);transition:opacity .25s!important}.sun[data-v-d1f28634]{opacity:1}.moon[data-v-d1f28634],.dark .sun[data-v-d1f28634]{opacity:0}.dark .moon[data-v-d1f28634]{opacity:1}.dark .VPSwitchAppearance[data-v-d1f28634] .check{transform:translate(18px)}.VPNavBarAppearance[data-v-e6aabb21]{display:none}@media (min-width: 1280px){.VPNavBarAppearance[data-v-e6aabb21]{display:flex;align-items:center}}.VPMenuGroup+.VPMenuLink[data-v-43f1e123]{margin:12px -12px 0;border-top:1px solid var(--vp-c-divider);padding:12px 12px 0}.link[data-v-43f1e123]{display:block;border-radius:6px;padding:0 12px;line-height:32px;font-size:14px;font-weight:500;color:var(--vp-c-text-1);white-space:nowrap;transition:background-color .25s,color .25s}.link[data-v-43f1e123]:hover{color:var(--vp-c-brand-1);background-color:var(--vp-c-default-soft)}.link.active[data-v-43f1e123]{color:var(--vp-c-brand-1)}.VPMenuGroup[data-v-69e747b5]{margin:12px -12px 0;border-top:1px solid var(--vp-c-divider);padding:12px 12px 0}.VPMenuGroup[data-v-69e747b5]:first-child{margin-top:0;border-top:0;padding-top:0}.VPMenuGroup+.VPMenuGroup[data-v-69e747b5]{margin-top:12px;border-top:1px solid var(--vp-c-divider)}.title[data-v-69e747b5]{padding:0 12px;line-height:32px;font-size:14px;font-weight:600;color:var(--vp-c-text-2);white-space:nowrap;transition:color .25s}.VPMenu[data-v-e7ea1737]{border-radius:12px;padding:12px;min-width:128px;border:1px solid var(--vp-c-divider);background-color:var(--vp-c-bg-elv);box-shadow:var(--vp-shadow-3);transition:background-color .5s;max-height:calc(100vh - var(--vp-nav-height));overflow-y:auto}.VPMenu[data-v-e7ea1737] .group{margin:0 -12px;padding:0 12px 12px}.VPMenu[data-v-e7ea1737] .group+.group{border-top:1px solid var(--vp-c-divider);padding:11px 12px 12px}.VPMenu[data-v-e7ea1737] .group:last-child{padding-bottom:0}.VPMenu[data-v-e7ea1737] .group+.item{border-top:1px solid var(--vp-c-divider);padding:11px 16px 0}.VPMenu[data-v-e7ea1737] .item{padding:0 16px;white-space:nowrap}.VPMenu[data-v-e7ea1737] .label{flex-grow:1;line-height:28px;font-size:12px;font-weight:500;color:var(--vp-c-text-2);transition:color .5s}.VPMenu[data-v-e7ea1737] .action{padding-left:24px}.VPFlyout[data-v-b6c34ac9]{position:relative}.VPFlyout[data-v-b6c34ac9]:hover{color:var(--vp-c-brand-1);transition:color .25s}.VPFlyout:hover .text[data-v-b6c34ac9]{color:var(--vp-c-text-2)}.VPFlyout:hover .icon[data-v-b6c34ac9]{fill:var(--vp-c-text-2)}.VPFlyout.active .text[data-v-b6c34ac9]{color:var(--vp-c-brand-1)}.VPFlyout.active:hover .text[data-v-b6c34ac9]{color:var(--vp-c-brand-2)}.VPFlyout:hover .menu[data-v-b6c34ac9],.button[aria-expanded=true]+.menu[data-v-b6c34ac9]{opacity:1;visibility:visible;transform:translateY(0)}.button[aria-expanded=false]+.menu[data-v-b6c34ac9]{opacity:0;visibility:hidden;transform:translateY(0)}.button[data-v-b6c34ac9]{display:flex;align-items:center;padding:0 12px;height:var(--vp-nav-height);color:var(--vp-c-text-1);transition:color .5s}.text[data-v-b6c34ac9]{display:flex;align-items:center;line-height:var(--vp-nav-height);font-size:14px;font-weight:500;color:var(--vp-c-text-1);transition:color .25s}.option-icon[data-v-b6c34ac9]{margin-right:0;font-size:16px}.text-icon[data-v-b6c34ac9]{margin-left:4px;font-size:14px}.icon[data-v-b6c34ac9]{font-size:20px;transition:fill .25s}.menu[data-v-b6c34ac9]{position:absolute;top:calc(var(--vp-nav-height) / 2 + 20px);right:0;opacity:0;visibility:hidden;transition:opacity .25s,visibility .25s,transform .25s}.VPSocialLink[data-v-eee4e7cb]{display:flex;justify-content:center;align-items:center;width:36px;height:36px;color:var(--vp-c-text-2);transition:color .5s}.VPSocialLink[data-v-eee4e7cb]:hover{color:var(--vp-c-text-1);transition:color .25s}.VPSocialLink[data-v-eee4e7cb]>svg,.VPSocialLink[data-v-eee4e7cb]>[class^=vpi-social-]{width:20px;height:20px;fill:currentColor}.VPSocialLinks[data-v-7bc22406]{display:flex;justify-content:center}.VPNavBarExtra[data-v-d0bd9dde]{display:none;margin-right:-12px}@media (min-width: 768px){.VPNavBarExtra[data-v-d0bd9dde]{display:block}}@media (min-width: 1280px){.VPNavBarExtra[data-v-d0bd9dde]{display:none}}.trans-title[data-v-d0bd9dde]{padding:0 24px 0 12px;line-height:32px;font-size:14px;font-weight:700;color:var(--vp-c-text-1)}.item.appearance[data-v-d0bd9dde],.item.social-links[data-v-d0bd9dde]{display:flex;align-items:center;padding:0 12px}.item.appearance[data-v-d0bd9dde]{min-width:176px}.appearance-action[data-v-d0bd9dde]{margin-right:-2px}.social-links-list[data-v-d0bd9dde]{margin:-4px -8px}.VPNavBarHamburger[data-v-e5dd9c1c]{display:flex;justify-content:center;align-items:center;width:48px;height:var(--vp-nav-height)}@media (min-width: 768px){.VPNavBarHamburger[data-v-e5dd9c1c]{display:none}}.container[data-v-e5dd9c1c]{position:relative;width:16px;height:14px;overflow:hidden}.VPNavBarHamburger:hover .top[data-v-e5dd9c1c]{top:0;left:0;transform:translate(4px)}.VPNavBarHamburger:hover .middle[data-v-e5dd9c1c]{top:6px;left:0;transform:translate(0)}.VPNavBarHamburger:hover .bottom[data-v-e5dd9c1c]{top:12px;left:0;transform:translate(8px)}.VPNavBarHamburger.active .top[data-v-e5dd9c1c]{top:6px;transform:translate(0) rotate(225deg)}.VPNavBarHamburger.active .middle[data-v-e5dd9c1c]{top:6px;transform:translate(16px)}.VPNavBarHamburger.active .bottom[data-v-e5dd9c1c]{top:6px;transform:translate(0) rotate(135deg)}.VPNavBarHamburger.active:hover .top[data-v-e5dd9c1c],.VPNavBarHamburger.active:hover .middle[data-v-e5dd9c1c],.VPNavBarHamburger.active:hover .bottom[data-v-e5dd9c1c]{background-color:var(--vp-c-text-2);transition:top .25s,background-color .25s,transform .25s}.top[data-v-e5dd9c1c],.middle[data-v-e5dd9c1c],.bottom[data-v-e5dd9c1c]{position:absolute;width:16px;height:2px;background-color:var(--vp-c-text-1);transition:top .25s,background-color .5s,transform .25s}.top[data-v-e5dd9c1c]{top:0;left:0;transform:translate(0)}.middle[data-v-e5dd9c1c]{top:6px;left:0;transform:translate(8px)}.bottom[data-v-e5dd9c1c]{top:12px;left:0;transform:translate(4px)}.VPNavBarMenuLink[data-v-42ef59de]{display:flex;align-items:center;padding:0 12px;line-height:var(--vp-nav-height);font-size:14px;font-weight:500;color:var(--vp-c-text-1);transition:color .25s}.VPNavBarMenuLink.active[data-v-42ef59de],.VPNavBarMenuLink[data-v-42ef59de]:hover{color:var(--vp-c-brand-1)}.VPNavBarMenu[data-v-7f418b0f]{display:none}@media (min-width: 768px){.VPNavBarMenu[data-v-7f418b0f]{display:flex}}/*! @docsearch/css 3.6.0 | MIT License | © Algolia, Inc. and contributors | https://docsearch.algolia.com */:root{--docsearch-primary-color:#5468ff;--docsearch-text-color:#1c1e21;--docsearch-spacing:12px;--docsearch-icon-stroke-width:1.4;--docsearch-highlight-color:var(--docsearch-primary-color);--docsearch-muted-color:#969faf;--docsearch-container-background:rgba(101,108,133,.8);--docsearch-logo-color:#5468ff;--docsearch-modal-width:560px;--docsearch-modal-height:600px;--docsearch-modal-background:#f5f6f7;--docsearch-modal-shadow:inset 1px 1px 0 0 hsla(0,0%,100%,.5),0 3px 8px 0 #555a64;--docsearch-searchbox-height:56px;--docsearch-searchbox-background:#ebedf0;--docsearch-searchbox-focus-background:#fff;--docsearch-searchbox-shadow:inset 0 0 0 2px var(--docsearch-primary-color);--docsearch-hit-height:56px;--docsearch-hit-color:#444950;--docsearch-hit-active-color:#fff;--docsearch-hit-background:#fff;--docsearch-hit-shadow:0 1px 3px 0 #d4d9e1;--docsearch-key-gradient:linear-gradient(-225deg,#d5dbe4,#f8f8f8);--docsearch-key-shadow:inset 0 -2px 0 0 #cdcde6,inset 0 0 1px 1px #fff,0 1px 2px 1px rgba(30,35,90,.4);--docsearch-key-pressed-shadow:inset 0 -2px 0 0 #cdcde6,inset 0 0 1px 1px #fff,0 1px 1px 0 rgba(30,35,90,.4);--docsearch-footer-height:44px;--docsearch-footer-background:#fff;--docsearch-footer-shadow:0 -1px 0 0 #e0e3e8,0 -3px 6px 0 rgba(69,98,155,.12)}html[data-theme=dark]{--docsearch-text-color:#f5f6f7;--docsearch-container-background:rgba(9,10,17,.8);--docsearch-modal-background:#15172a;--docsearch-modal-shadow:inset 1px 1px 0 0 #2c2e40,0 3px 8px 0 #000309;--docsearch-searchbox-background:#090a11;--docsearch-searchbox-focus-background:#000;--docsearch-hit-color:#bec3c9;--docsearch-hit-shadow:none;--docsearch-hit-background:#090a11;--docsearch-key-gradient:linear-gradient(-26.5deg,#565872,#31355b);--docsearch-key-shadow:inset 0 -2px 0 0 #282d55,inset 0 0 1px 1px #51577d,0 2px 2px 0 rgba(3,4,9,.3);--docsearch-key-pressed-shadow:inset 0 -2px 0 0 #282d55,inset 0 0 1px 1px #51577d,0 1px 1px 0 rgba(3,4,9,.30196078431372547);--docsearch-footer-background:#1e2136;--docsearch-footer-shadow:inset 0 1px 0 0 rgba(73,76,106,.5),0 -4px 8px 0 rgba(0,0,0,.2);--docsearch-logo-color:#fff;--docsearch-muted-color:#7f8497}.DocSearch-Button{align-items:center;background:var(--docsearch-searchbox-background);border:0;border-radius:40px;color:var(--docsearch-muted-color);cursor:pointer;display:flex;font-weight:500;height:36px;justify-content:space-between;margin:0 0 0 16px;padding:0 8px;-webkit-user-select:none;user-select:none}.DocSearch-Button:active,.DocSearch-Button:focus,.DocSearch-Button:hover{background:var(--docsearch-searchbox-focus-background);box-shadow:var(--docsearch-searchbox-shadow);color:var(--docsearch-text-color);outline:none}.DocSearch-Button-Container{align-items:center;display:flex}.DocSearch-Search-Icon{stroke-width:1.6}.DocSearch-Button .DocSearch-Search-Icon{color:var(--docsearch-text-color)}.DocSearch-Button-Placeholder{font-size:1rem;padding:0 12px 0 6px}.DocSearch-Button-Keys{display:flex;min-width:calc(40px + .8em)}.DocSearch-Button-Key{align-items:center;background:var(--docsearch-key-gradient);border-radius:3px;box-shadow:var(--docsearch-key-shadow);color:var(--docsearch-muted-color);display:flex;height:18px;justify-content:center;margin-right:.4em;position:relative;padding:0 0 2px;border:0;top:-1px;width:20px}.DocSearch-Button-Key--pressed{transform:translate3d(0,1px,0);box-shadow:var(--docsearch-key-pressed-shadow)}@media (max-width:768px){.DocSearch-Button-Keys,.DocSearch-Button-Placeholder{display:none}}.DocSearch--active{overflow:hidden!important}.DocSearch-Container,.DocSearch-Container *{box-sizing:border-box}.DocSearch-Container{background-color:var(--docsearch-container-background);height:100vh;left:0;position:fixed;top:0;width:100vw;z-index:200}.DocSearch-Container a{text-decoration:none}.DocSearch-Link{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:none;border:0;color:var(--docsearch-highlight-color);cursor:pointer;font:inherit;margin:0;padding:0}.DocSearch-Modal{background:var(--docsearch-modal-background);border-radius:6px;box-shadow:var(--docsearch-modal-shadow);flex-direction:column;margin:60px auto auto;max-width:var(--docsearch-modal-width);position:relative}.DocSearch-SearchBar{display:flex;padding:var(--docsearch-spacing) var(--docsearch-spacing) 0}.DocSearch-Form{align-items:center;background:var(--docsearch-searchbox-focus-background);border-radius:4px;box-shadow:var(--docsearch-searchbox-shadow);display:flex;height:var(--docsearch-searchbox-height);margin:0;padding:0 var(--docsearch-spacing);position:relative;width:100%}.DocSearch-Input{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:transparent;border:0;color:var(--docsearch-text-color);flex:1;font:inherit;font-size:1.2em;height:100%;outline:none;padding:0 0 0 8px;width:80%}.DocSearch-Input::placeholder{color:var(--docsearch-muted-color);opacity:1}.DocSearch-Input::-webkit-search-cancel-button,.DocSearch-Input::-webkit-search-decoration,.DocSearch-Input::-webkit-search-results-button,.DocSearch-Input::-webkit-search-results-decoration{display:none}.DocSearch-LoadingIndicator,.DocSearch-MagnifierLabel,.DocSearch-Reset{margin:0;padding:0}.DocSearch-MagnifierLabel,.DocSearch-Reset{align-items:center;color:var(--docsearch-highlight-color);display:flex;justify-content:center}.DocSearch-Container--Stalled .DocSearch-MagnifierLabel,.DocSearch-LoadingIndicator{display:none}.DocSearch-Container--Stalled .DocSearch-LoadingIndicator{align-items:center;color:var(--docsearch-highlight-color);display:flex;justify-content:center}@media screen and (prefers-reduced-motion:reduce){.DocSearch-Reset{animation:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:none;border:0;border-radius:50%;color:var(--docsearch-icon-color);cursor:pointer;right:0;stroke-width:var(--docsearch-icon-stroke-width)}}.DocSearch-Reset{animation:fade-in .1s ease-in forwards;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:none;border:0;border-radius:50%;color:var(--docsearch-icon-color);cursor:pointer;padding:2px;right:0;stroke-width:var(--docsearch-icon-stroke-width)}.DocSearch-Reset[hidden]{display:none}.DocSearch-Reset:hover{color:var(--docsearch-highlight-color)}.DocSearch-LoadingIndicator svg,.DocSearch-MagnifierLabel svg{height:24px;width:24px}.DocSearch-Cancel{display:none}.DocSearch-Dropdown{max-height:calc(var(--docsearch-modal-height) - var(--docsearch-searchbox-height) - var(--docsearch-spacing) - var(--docsearch-footer-height));min-height:var(--docsearch-spacing);overflow-y:auto;overflow-y:overlay;padding:0 var(--docsearch-spacing);scrollbar-color:var(--docsearch-muted-color) var(--docsearch-modal-background);scrollbar-width:thin}.DocSearch-Dropdown::-webkit-scrollbar{width:12px}.DocSearch-Dropdown::-webkit-scrollbar-track{background:transparent}.DocSearch-Dropdown::-webkit-scrollbar-thumb{background-color:var(--docsearch-muted-color);border:3px solid var(--docsearch-modal-background);border-radius:20px}.DocSearch-Dropdown ul{list-style:none;margin:0;padding:0}.DocSearch-Label{font-size:.75em;line-height:1.6em}.DocSearch-Help,.DocSearch-Label{color:var(--docsearch-muted-color)}.DocSearch-Help{font-size:.9em;margin:0;-webkit-user-select:none;user-select:none}.DocSearch-Title{font-size:1.2em}.DocSearch-Logo a{display:flex}.DocSearch-Logo svg{color:var(--docsearch-logo-color);margin-left:8px}.DocSearch-Hits:last-of-type{margin-bottom:24px}.DocSearch-Hits mark{background:none;color:var(--docsearch-highlight-color)}.DocSearch-HitsFooter{color:var(--docsearch-muted-color);display:flex;font-size:.85em;justify-content:center;margin-bottom:var(--docsearch-spacing);padding:var(--docsearch-spacing)}.DocSearch-HitsFooter a{border-bottom:1px solid;color:inherit}.DocSearch-Hit{border-radius:4px;display:flex;padding-bottom:4px;position:relative}@media screen and (prefers-reduced-motion:reduce){.DocSearch-Hit--deleting{transition:none}}.DocSearch-Hit--deleting{opacity:0;transition:all .25s linear}@media screen and (prefers-reduced-motion:reduce){.DocSearch-Hit--favoriting{transition:none}}.DocSearch-Hit--favoriting{transform:scale(0);transform-origin:top center;transition:all .25s linear;transition-delay:.25s}.DocSearch-Hit a{background:var(--docsearch-hit-background);border-radius:4px;box-shadow:var(--docsearch-hit-shadow);display:block;padding-left:var(--docsearch-spacing);width:100%}.DocSearch-Hit-source{background:var(--docsearch-modal-background);color:var(--docsearch-highlight-color);font-size:.85em;font-weight:600;line-height:32px;margin:0 -4px;padding:8px 4px 0;position:sticky;top:0;z-index:10}.DocSearch-Hit-Tree{color:var(--docsearch-muted-color);height:var(--docsearch-hit-height);opacity:.5;stroke-width:var(--docsearch-icon-stroke-width);width:24px}.DocSearch-Hit[aria-selected=true] a{background-color:var(--docsearch-highlight-color)}.DocSearch-Hit[aria-selected=true] mark{text-decoration:underline}.DocSearch-Hit-Container{align-items:center;color:var(--docsearch-hit-color);display:flex;flex-direction:row;height:var(--docsearch-hit-height);padding:0 var(--docsearch-spacing) 0 0}.DocSearch-Hit-icon{height:20px;width:20px}.DocSearch-Hit-action,.DocSearch-Hit-icon{color:var(--docsearch-muted-color);stroke-width:var(--docsearch-icon-stroke-width)}.DocSearch-Hit-action{align-items:center;display:flex;height:22px;width:22px}.DocSearch-Hit-action svg{display:block;height:18px;width:18px}.DocSearch-Hit-action+.DocSearch-Hit-action{margin-left:6px}.DocSearch-Hit-action-button{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:none;border:0;border-radius:50%;color:inherit;cursor:pointer;padding:2px}svg.DocSearch-Hit-Select-Icon{display:none}.DocSearch-Hit[aria-selected=true] .DocSearch-Hit-Select-Icon{display:block}.DocSearch-Hit-action-button:focus,.DocSearch-Hit-action-button:hover{background:#0003;transition:background-color .1s ease-in}@media screen and (prefers-reduced-motion:reduce){.DocSearch-Hit-action-button:focus,.DocSearch-Hit-action-button:hover{transition:none}}.DocSearch-Hit-action-button:focus path,.DocSearch-Hit-action-button:hover path{fill:#fff}.DocSearch-Hit-content-wrapper{display:flex;flex:1 1 auto;flex-direction:column;font-weight:500;justify-content:center;line-height:1.2em;margin:0 8px;overflow-x:hidden;position:relative;text-overflow:ellipsis;white-space:nowrap;width:80%}.DocSearch-Hit-title{font-size:.9em}.DocSearch-Hit-path{color:var(--docsearch-muted-color);font-size:.75em}.DocSearch-Hit[aria-selected=true] .DocSearch-Hit-action,.DocSearch-Hit[aria-selected=true] .DocSearch-Hit-icon,.DocSearch-Hit[aria-selected=true] .DocSearch-Hit-path,.DocSearch-Hit[aria-selected=true] .DocSearch-Hit-text,.DocSearch-Hit[aria-selected=true] .DocSearch-Hit-title,.DocSearch-Hit[aria-selected=true] .DocSearch-Hit-Tree,.DocSearch-Hit[aria-selected=true] mark{color:var(--docsearch-hit-active-color)!important}@media screen and (prefers-reduced-motion:reduce){.DocSearch-Hit-action-button:focus,.DocSearch-Hit-action-button:hover{background:#0003;transition:none}}.DocSearch-ErrorScreen,.DocSearch-NoResults,.DocSearch-StartScreen{font-size:.9em;margin:0 auto;padding:36px 0;text-align:center;width:80%}.DocSearch-Screen-Icon{color:var(--docsearch-muted-color);padding-bottom:12px}.DocSearch-NoResults-Prefill-List{display:inline-block;padding-bottom:24px;text-align:left}.DocSearch-NoResults-Prefill-List ul{display:inline-block;padding:8px 0 0}.DocSearch-NoResults-Prefill-List li{list-style-position:inside;list-style-type:"» "}.DocSearch-Prefill{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:none;border:0;border-radius:1em;color:var(--docsearch-highlight-color);cursor:pointer;display:inline-block;font-size:1em;font-weight:700;padding:0}.DocSearch-Prefill:focus,.DocSearch-Prefill:hover{outline:none;text-decoration:underline}.DocSearch-Footer{align-items:center;background:var(--docsearch-footer-background);border-radius:0 0 8px 8px;box-shadow:var(--docsearch-footer-shadow);display:flex;flex-direction:row-reverse;flex-shrink:0;height:var(--docsearch-footer-height);justify-content:space-between;padding:0 var(--docsearch-spacing);position:relative;-webkit-user-select:none;user-select:none;width:100%;z-index:300}.DocSearch-Commands{color:var(--docsearch-muted-color);display:flex;list-style:none;margin:0;padding:0}.DocSearch-Commands li{align-items:center;display:flex}.DocSearch-Commands li:not(:last-of-type){margin-right:.8em}.DocSearch-Commands-Key{align-items:center;background:var(--docsearch-key-gradient);border-radius:2px;box-shadow:var(--docsearch-key-shadow);display:flex;height:18px;justify-content:center;margin-right:.4em;padding:0 0 1px;color:var(--docsearch-muted-color);border:0;width:20px}.DocSearch-VisuallyHiddenForAccessibility{clip:rect(0 0 0 0);clip-path:inset(50%);height:1px;overflow:hidden;position:absolute;white-space:nowrap;width:1px}@media (max-width:768px){:root{--docsearch-spacing:10px;--docsearch-footer-height:40px}.DocSearch-Dropdown{height:100%}.DocSearch-Container{height:100vh;height:-webkit-fill-available;height:calc(var(--docsearch-vh, 1vh)*100);position:absolute}.DocSearch-Footer{border-radius:0;bottom:0;position:absolute}.DocSearch-Hit-content-wrapper{display:flex;position:relative;width:80%}.DocSearch-Modal{border-radius:0;box-shadow:none;height:100vh;height:-webkit-fill-available;height:calc(var(--docsearch-vh, 1vh)*100);margin:0;max-width:100%;width:100%}.DocSearch-Dropdown{max-height:calc(var(--docsearch-vh, 1vh)*100 - var(--docsearch-searchbox-height) - var(--docsearch-spacing) - var(--docsearch-footer-height))}.DocSearch-Cancel{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:none;border:0;color:var(--docsearch-highlight-color);cursor:pointer;display:inline-block;flex:none;font:inherit;font-size:1em;font-weight:500;margin-left:var(--docsearch-spacing);outline:none;overflow:hidden;padding:0;-webkit-user-select:none;user-select:none;white-space:nowrap}.DocSearch-Commands,.DocSearch-Hit-Tree{display:none}}@keyframes fade-in{0%{opacity:0}to{opacity:1}}[class*=DocSearch]{--docsearch-primary-color: var(--vp-c-brand-1);--docsearch-highlight-color: var(--docsearch-primary-color);--docsearch-text-color: var(--vp-c-text-1);--docsearch-muted-color: var(--vp-c-text-2);--docsearch-searchbox-shadow: none;--docsearch-searchbox-background: transparent;--docsearch-searchbox-focus-background: transparent;--docsearch-key-gradient: transparent;--docsearch-key-shadow: none;--docsearch-modal-background: var(--vp-c-bg-soft);--docsearch-footer-background: var(--vp-c-bg)}.dark [class*=DocSearch]{--docsearch-modal-shadow: none;--docsearch-footer-shadow: none;--docsearch-logo-color: var(--vp-c-text-2);--docsearch-hit-background: var(--vp-c-default-soft);--docsearch-hit-color: var(--vp-c-text-2);--docsearch-hit-shadow: none}.DocSearch-Button{display:flex;justify-content:center;align-items:center;margin:0;padding:0;width:48px;height:55px;background:transparent;transition:border-color .25s}.DocSearch-Button:hover{background:transparent}.DocSearch-Button:focus{outline:1px dotted;outline:5px auto -webkit-focus-ring-color}.DocSearch-Button:focus:not(:focus-visible){outline:none!important}@media (min-width: 768px){.DocSearch-Button{justify-content:flex-start;border:1px solid transparent;border-radius:8px;padding:0 10px 0 12px;width:100%;height:40px;background-color:var(--vp-c-bg-alt)}.DocSearch-Button:hover{border-color:var(--vp-c-brand-1);background:var(--vp-c-bg-alt)}}.DocSearch-Button .DocSearch-Button-Container{display:flex;align-items:center}.DocSearch-Button .DocSearch-Search-Icon{position:relative;width:16px;height:16px;color:var(--vp-c-text-1);fill:currentColor;transition:color .5s}.DocSearch-Button:hover .DocSearch-Search-Icon{color:var(--vp-c-text-1)}@media (min-width: 768px){.DocSearch-Button .DocSearch-Search-Icon{top:1px;margin-right:8px;width:14px;height:14px;color:var(--vp-c-text-2)}}.DocSearch-Button .DocSearch-Button-Placeholder{display:none;margin-top:2px;padding:0 16px 0 0;font-size:13px;font-weight:500;color:var(--vp-c-text-2);transition:color .5s}.DocSearch-Button:hover .DocSearch-Button-Placeholder{color:var(--vp-c-text-1)}@media (min-width: 768px){.DocSearch-Button .DocSearch-Button-Placeholder{display:inline-block}}.DocSearch-Button .DocSearch-Button-Keys{direction:ltr;display:none;min-width:auto}@media (min-width: 768px){.DocSearch-Button .DocSearch-Button-Keys{display:flex;align-items:center}}.DocSearch-Button .DocSearch-Button-Key{display:block;margin:2px 0 0;border:1px solid var(--vp-c-divider);border-right:none;border-radius:4px 0 0 4px;padding-left:6px;min-width:0;width:auto;height:22px;line-height:22px;font-family:var(--vp-font-family-base);font-size:12px;font-weight:500;transition:color .5s,border-color .5s}.DocSearch-Button .DocSearch-Button-Key+.DocSearch-Button-Key{border-right:1px solid var(--vp-c-divider);border-left:none;border-radius:0 4px 4px 0;padding-left:2px;padding-right:6px}.DocSearch-Button .DocSearch-Button-Key:first-child{font-size:0!important}.DocSearch-Button .DocSearch-Button-Key:first-child:after{content:"Ctrl";font-size:12px;letter-spacing:normal;color:var(--docsearch-muted-color)}.mac .DocSearch-Button .DocSearch-Button-Key:first-child:after{content:"⌘"}.DocSearch-Button .DocSearch-Button-Key:first-child>*{display:none}.DocSearch-Search-Icon{--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' stroke-width='1.6' viewBox='0 0 20 20'%3E%3Cpath fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' d='m14.386 14.386 4.088 4.088-4.088-4.088A7.533 7.533 0 1 1 3.733 3.733a7.533 7.533 0 0 1 10.653 10.653z'/%3E%3C/svg%3E")}.VPNavBarSearch{display:flex;align-items:center}@media (min-width: 768px){.VPNavBarSearch{flex-grow:1;padding-left:24px}}@media (min-width: 960px){.VPNavBarSearch{padding-left:32px}}.dark .DocSearch-Footer{border-top:1px solid var(--vp-c-divider)}.DocSearch-Form{border:1px solid var(--vp-c-brand-1);background-color:var(--vp-c-white)}.dark .DocSearch-Form{background-color:var(--vp-c-default-soft)}.DocSearch-Screen-Icon>svg{margin:auto}.VPNavBarSocialLinks[data-v-0394ad82]{display:none}@media (min-width: 1280px){.VPNavBarSocialLinks[data-v-0394ad82]{display:flex;align-items:center}}.title[data-v-ab179fa1]{display:flex;align-items:center;border-bottom:1px solid transparent;width:100%;height:var(--vp-nav-height);font-size:16px;font-weight:600;color:var(--vp-c-text-1);transition:opacity .25s}@media (min-width: 960px){.title[data-v-ab179fa1]{flex-shrink:0}.VPNavBarTitle.has-sidebar .title[data-v-ab179fa1]{border-bottom-color:var(--vp-c-divider)}}[data-v-ab179fa1] .logo{margin-right:8px;height:var(--vp-nav-logo-height)}.VPNavBarTranslations[data-v-88af2de4]{display:none}@media (min-width: 1280px){.VPNavBarTranslations[data-v-88af2de4]{display:flex;align-items:center}}.title[data-v-88af2de4]{padding:0 24px 0 12px;line-height:32px;font-size:14px;font-weight:700;color:var(--vp-c-text-1)}.VPNavBar[data-v-19c990f1]{position:relative;height:var(--vp-nav-height);pointer-events:none;white-space:nowrap;transition:background-color .5s}.VPNavBar.has-local-nav[data-v-19c990f1]{background-color:var(--vp-nav-bg-color)}@media (min-width: 960px){.VPNavBar.has-local-nav[data-v-19c990f1]{background-color:transparent}.VPNavBar[data-v-19c990f1]:not(.has-sidebar):not(.top){background-color:var(--vp-nav-bg-color)}}.wrapper[data-v-19c990f1]{padding:0 8px 0 24px}@media (min-width: 768px){.wrapper[data-v-19c990f1]{padding:0 32px}}@media (min-width: 960px){.VPNavBar.has-sidebar .wrapper[data-v-19c990f1]{padding:0}}.container[data-v-19c990f1]{display:flex;justify-content:space-between;margin:0 auto;max-width:calc(var(--vp-layout-max-width) - 64px);height:var(--vp-nav-height);pointer-events:none}.container>.title[data-v-19c990f1],.container>.content[data-v-19c990f1]{pointer-events:none}.container[data-v-19c990f1] *{pointer-events:auto}@media (min-width: 960px){.VPNavBar.has-sidebar .container[data-v-19c990f1]{max-width:100%}}.title[data-v-19c990f1]{flex-shrink:0;height:calc(var(--vp-nav-height) - 1px);transition:background-color .5s}@media (min-width: 960px){.VPNavBar.has-sidebar .title[data-v-19c990f1]{position:absolute;top:0;left:0;z-index:2;padding:0 32px;width:var(--vp-sidebar-width);height:var(--vp-nav-height);background-color:transparent}}@media (min-width: 1440px){.VPNavBar.has-sidebar .title[data-v-19c990f1]{padding-left:max(32px,calc((100% - (var(--vp-layout-max-width) - 64px)) / 2));width:calc((100% - (var(--vp-layout-max-width) - 64px)) / 2 + var(--vp-sidebar-width) - 32px)}}.content[data-v-19c990f1]{flex-grow:1}@media (min-width: 960px){.VPNavBar.has-sidebar .content[data-v-19c990f1]{position:relative;z-index:1;padding-right:32px;padding-left:var(--vp-sidebar-width)}}@media (min-width: 1440px){.VPNavBar.has-sidebar .content[data-v-19c990f1]{padding-right:calc((100vw - var(--vp-layout-max-width)) / 2 + 32px);padding-left:calc((100vw - var(--vp-layout-max-width)) / 2 + var(--vp-sidebar-width))}}.content-body[data-v-19c990f1]{display:flex;justify-content:flex-end;align-items:center;height:var(--vp-nav-height);transition:background-color .5s}@media (min-width: 960px){.VPNavBar:not(.top) .content-body[data-v-19c990f1]{position:relative;background-color:var(--vp-nav-bg-color)}.VPNavBar:not(.has-sidebar):not(.top) .content-body[data-v-19c990f1]{background-color:transparent}}@media (max-width: 767px){.content-body[data-v-19c990f1]{column-gap:.5rem}}.menu+.translations[data-v-19c990f1]:before,.menu+.appearance[data-v-19c990f1]:before,.menu+.social-links[data-v-19c990f1]:before,.translations+.appearance[data-v-19c990f1]:before,.appearance+.social-links[data-v-19c990f1]:before{margin-right:8px;margin-left:8px;width:1px;height:24px;background-color:var(--vp-c-divider);content:""}.menu+.appearance[data-v-19c990f1]:before,.translations+.appearance[data-v-19c990f1]:before{margin-right:16px}.appearance+.social-links[data-v-19c990f1]:before{margin-left:16px}.social-links[data-v-19c990f1]{margin-right:-8px}.divider[data-v-19c990f1]{width:100%;height:1px}@media (min-width: 960px){.VPNavBar.has-sidebar .divider[data-v-19c990f1]{padding-left:var(--vp-sidebar-width)}}@media (min-width: 1440px){.VPNavBar.has-sidebar .divider[data-v-19c990f1]{padding-left:calc((100vw - var(--vp-layout-max-width)) / 2 + var(--vp-sidebar-width))}}.divider-line[data-v-19c990f1]{width:100%;height:1px;transition:background-color .5s}.VPNavBar.has-local-nav .divider-line[data-v-19c990f1]{background-color:var(--vp-c-gutter)}@media (min-width: 960px){.VPNavBar:not(.top) .divider-line[data-v-19c990f1]{background-color:var(--vp-c-gutter)}.VPNavBar:not(.has-sidebar):not(.top) .divider[data-v-19c990f1]{background-color:var(--vp-c-gutter)}}.VPNavScreenAppearance[data-v-2d7af913]{display:flex;justify-content:space-between;align-items:center;border-radius:8px;padding:12px 14px 12px 16px;background-color:var(--vp-c-bg-soft)}.text[data-v-2d7af913]{line-height:24px;font-size:12px;font-weight:500;color:var(--vp-c-text-2)}.VPNavScreenMenuLink[data-v-05f27b2a]{display:block;border-bottom:1px solid var(--vp-c-divider);padding:12px 0 11px;line-height:24px;font-size:14px;font-weight:500;color:var(--vp-c-text-1);transition:border-color .25s,color .25s}.VPNavScreenMenuLink[data-v-05f27b2a]:hover{color:var(--vp-c-brand-1)}.VPNavScreenMenuGroupLink[data-v-19976ae1]{display:block;margin-left:12px;line-height:32px;font-size:14px;font-weight:400;color:var(--vp-c-text-1);transition:color .25s}.VPNavScreenMenuGroupLink[data-v-19976ae1]:hover{color:var(--vp-c-brand-1)}.VPNavScreenMenuGroupSection[data-v-8133b170]{display:block}.title[data-v-8133b170]{line-height:32px;font-size:13px;font-weight:700;color:var(--vp-c-text-2);transition:color .25s}.VPNavScreenMenuGroup[data-v-ff6087d4]{border-bottom:1px solid var(--vp-c-divider);height:48px;overflow:hidden;transition:border-color .5s}.VPNavScreenMenuGroup .items[data-v-ff6087d4]{visibility:hidden}.VPNavScreenMenuGroup.open .items[data-v-ff6087d4]{visibility:visible}.VPNavScreenMenuGroup.open[data-v-ff6087d4]{padding-bottom:10px;height:auto}.VPNavScreenMenuGroup.open .button[data-v-ff6087d4]{padding-bottom:6px;color:var(--vp-c-brand-1)}.VPNavScreenMenuGroup.open .button-icon[data-v-ff6087d4]{transform:rotate(45deg)}.button[data-v-ff6087d4]{display:flex;justify-content:space-between;align-items:center;padding:12px 4px 11px 0;width:100%;line-height:24px;font-size:14px;font-weight:500;color:var(--vp-c-text-1);transition:color .25s}.button[data-v-ff6087d4]:hover{color:var(--vp-c-brand-1)}.button-icon[data-v-ff6087d4]{transition:transform .25s}.group[data-v-ff6087d4]:first-child{padding-top:0}.group+.group[data-v-ff6087d4],.group+.item[data-v-ff6087d4]{padding-top:4px}.VPNavScreenTranslations[data-v-858fe1a4]{height:24px;overflow:hidden}.VPNavScreenTranslations.open[data-v-858fe1a4]{height:auto}.title[data-v-858fe1a4]{display:flex;align-items:center;font-size:14px;font-weight:500;color:var(--vp-c-text-1)}.icon[data-v-858fe1a4]{font-size:16px}.icon.lang[data-v-858fe1a4]{margin-right:8px}.icon.chevron[data-v-858fe1a4]{margin-left:4px}.list[data-v-858fe1a4]{padding:4px 0 0 24px}.link[data-v-858fe1a4]{line-height:32px;font-size:13px;color:var(--vp-c-text-1)}.VPNavScreen[data-v-cc5739dd]{position:fixed;top:calc(var(--vp-nav-height) + var(--vp-layout-top-height, 0px) + 1px);right:0;bottom:0;left:0;padding:0 32px;width:100%;background-color:var(--vp-nav-screen-bg-color);overflow-y:auto;transition:background-color .5s;pointer-events:auto}.VPNavScreen.fade-enter-active[data-v-cc5739dd],.VPNavScreen.fade-leave-active[data-v-cc5739dd]{transition:opacity .25s}.VPNavScreen.fade-enter-active .container[data-v-cc5739dd],.VPNavScreen.fade-leave-active .container[data-v-cc5739dd]{transition:transform .25s ease}.VPNavScreen.fade-enter-from[data-v-cc5739dd],.VPNavScreen.fade-leave-to[data-v-cc5739dd]{opacity:0}.VPNavScreen.fade-enter-from .container[data-v-cc5739dd],.VPNavScreen.fade-leave-to .container[data-v-cc5739dd]{transform:translateY(-8px)}@media (min-width: 768px){.VPNavScreen[data-v-cc5739dd]{display:none}}.container[data-v-cc5739dd]{margin:0 auto;padding:24px 0 96px;max-width:288px}.menu+.translations[data-v-cc5739dd],.menu+.appearance[data-v-cc5739dd],.translations+.appearance[data-v-cc5739dd]{margin-top:24px}.menu+.social-links[data-v-cc5739dd]{margin-top:16px}.appearance+.social-links[data-v-cc5739dd]{margin-top:16px}.VPNav[data-v-ae24b3ad]{position:relative;top:var(--vp-layout-top-height, 0px);left:0;z-index:var(--vp-z-index-nav);width:100%;pointer-events:none;transition:background-color .5s}@media (min-width: 960px){.VPNav[data-v-ae24b3ad]{position:fixed}}.VPSidebarItem.level-0[data-v-93e7e794]{padding-bottom:24px}.VPSidebarItem.collapsed.level-0[data-v-93e7e794]{padding-bottom:10px}.item[data-v-93e7e794]{position:relative;display:flex;width:100%}.VPSidebarItem.collapsible>.item[data-v-93e7e794]{cursor:pointer}.indicator[data-v-93e7e794]{position:absolute;top:6px;bottom:6px;left:-17px;width:2px;border-radius:2px;transition:background-color .25s}.VPSidebarItem.level-2.is-active>.item>.indicator[data-v-93e7e794],.VPSidebarItem.level-3.is-active>.item>.indicator[data-v-93e7e794],.VPSidebarItem.level-4.is-active>.item>.indicator[data-v-93e7e794],.VPSidebarItem.level-5.is-active>.item>.indicator[data-v-93e7e794]{background-color:var(--vp-c-brand-1)}.link[data-v-93e7e794]{display:flex;align-items:center;flex-grow:1}.text[data-v-93e7e794]{flex-grow:1;padding:4px 0;line-height:24px;font-size:14px;transition:color .25s}.VPSidebarItem.level-0 .text[data-v-93e7e794]{font-weight:700;color:var(--vp-c-text-1)}.VPSidebarItem.level-1 .text[data-v-93e7e794],.VPSidebarItem.level-2 .text[data-v-93e7e794],.VPSidebarItem.level-3 .text[data-v-93e7e794],.VPSidebarItem.level-4 .text[data-v-93e7e794],.VPSidebarItem.level-5 .text[data-v-93e7e794]{font-weight:500;color:var(--vp-c-text-2)}.VPSidebarItem.level-0.is-link>.item>.link:hover .text[data-v-93e7e794],.VPSidebarItem.level-1.is-link>.item>.link:hover .text[data-v-93e7e794],.VPSidebarItem.level-2.is-link>.item>.link:hover .text[data-v-93e7e794],.VPSidebarItem.level-3.is-link>.item>.link:hover .text[data-v-93e7e794],.VPSidebarItem.level-4.is-link>.item>.link:hover .text[data-v-93e7e794],.VPSidebarItem.level-5.is-link>.item>.link:hover .text[data-v-93e7e794]{color:var(--vp-c-brand-1)}.VPSidebarItem.level-0.has-active>.item>.text[data-v-93e7e794],.VPSidebarItem.level-1.has-active>.item>.text[data-v-93e7e794],.VPSidebarItem.level-2.has-active>.item>.text[data-v-93e7e794],.VPSidebarItem.level-3.has-active>.item>.text[data-v-93e7e794],.VPSidebarItem.level-4.has-active>.item>.text[data-v-93e7e794],.VPSidebarItem.level-5.has-active>.item>.text[data-v-93e7e794],.VPSidebarItem.level-0.has-active>.item>.link>.text[data-v-93e7e794],.VPSidebarItem.level-1.has-active>.item>.link>.text[data-v-93e7e794],.VPSidebarItem.level-2.has-active>.item>.link>.text[data-v-93e7e794],.VPSidebarItem.level-3.has-active>.item>.link>.text[data-v-93e7e794],.VPSidebarItem.level-4.has-active>.item>.link>.text[data-v-93e7e794],.VPSidebarItem.level-5.has-active>.item>.link>.text[data-v-93e7e794]{color:var(--vp-c-text-1)}.VPSidebarItem.level-0.is-active>.item .link>.text[data-v-93e7e794],.VPSidebarItem.level-1.is-active>.item .link>.text[data-v-93e7e794],.VPSidebarItem.level-2.is-active>.item .link>.text[data-v-93e7e794],.VPSidebarItem.level-3.is-active>.item .link>.text[data-v-93e7e794],.VPSidebarItem.level-4.is-active>.item .link>.text[data-v-93e7e794],.VPSidebarItem.level-5.is-active>.item .link>.text[data-v-93e7e794]{color:var(--vp-c-brand-1)}.caret[data-v-93e7e794]{display:flex;justify-content:center;align-items:center;margin-right:-7px;width:32px;height:32px;color:var(--vp-c-text-3);cursor:pointer;transition:color .25s;flex-shrink:0}.item:hover .caret[data-v-93e7e794]{color:var(--vp-c-text-2)}.item:hover .caret[data-v-93e7e794]:hover{color:var(--vp-c-text-1)}.caret-icon[data-v-93e7e794]{font-size:18px;transform:rotate(90deg);transition:transform .25s}.VPSidebarItem.collapsed .caret-icon[data-v-93e7e794]{transform:rotate(0)}.VPSidebarItem.level-1 .items[data-v-93e7e794],.VPSidebarItem.level-2 .items[data-v-93e7e794],.VPSidebarItem.level-3 .items[data-v-93e7e794],.VPSidebarItem.level-4 .items[data-v-93e7e794],.VPSidebarItem.level-5 .items[data-v-93e7e794]{border-left:1px solid var(--vp-c-divider);padding-left:16px}.VPSidebarItem.collapsed .items[data-v-93e7e794]{display:none}.VPSidebar[data-v-575e6a36]{position:fixed;top:var(--vp-layout-top-height, 0px);bottom:0;left:0;z-index:var(--vp-z-index-sidebar);padding:32px 32px 96px;width:calc(100vw - 64px);max-width:320px;background-color:var(--vp-sidebar-bg-color);opacity:0;box-shadow:var(--vp-c-shadow-3);overflow-x:hidden;overflow-y:auto;transform:translate(-100%);transition:opacity .5s,transform .25s ease;overscroll-behavior:contain}.VPSidebar.open[data-v-575e6a36]{opacity:1;visibility:visible;transform:translate(0);transition:opacity .25s,transform .5s cubic-bezier(.19,1,.22,1)}.dark .VPSidebar[data-v-575e6a36]{box-shadow:var(--vp-shadow-1)}@media (min-width: 960px){.VPSidebar[data-v-575e6a36]{padding-top:var(--vp-nav-height);width:var(--vp-sidebar-width);max-width:100%;background-color:var(--vp-sidebar-bg-color);opacity:1;visibility:visible;box-shadow:none;transform:translate(0)}}@media (min-width: 1440px){.VPSidebar[data-v-575e6a36]{padding-left:max(32px,calc((100% - (var(--vp-layout-max-width) - 64px)) / 2));width:calc((100% - (var(--vp-layout-max-width) - 64px)) / 2 + var(--vp-sidebar-width) - 32px)}}@media (min-width: 960px){.curtain[data-v-575e6a36]{position:sticky;top:-64px;left:0;z-index:1;margin-top:calc(var(--vp-nav-height) * -1);margin-right:-32px;margin-left:-32px;height:var(--vp-nav-height);background-color:var(--vp-sidebar-bg-color)}}.nav[data-v-575e6a36]{outline:0}.group+.group[data-v-575e6a36]{border-top:1px solid var(--vp-c-divider);padding-top:10px}@media (min-width: 960px){.group[data-v-575e6a36]{padding-top:10px;width:calc(var(--vp-sidebar-width) - 64px)}}.VPSkipLink[data-v-0f60ec36]{top:8px;left:8px;padding:8px 16px;z-index:999;border-radius:8px;font-size:12px;font-weight:700;text-decoration:none;color:var(--vp-c-brand-1);box-shadow:var(--vp-shadow-3);background-color:var(--vp-c-bg)}.VPSkipLink[data-v-0f60ec36]:focus{height:auto;width:auto;clip:auto;clip-path:none}@media (min-width: 1280px){.VPSkipLink[data-v-0f60ec36]{top:14px;left:16px}}.Layout[data-v-5d98c3a5]{display:flex;flex-direction:column;min-height:100vh}.VPHomeSponsors[data-v-3d121b4a]{border-top:1px solid var(--vp-c-gutter);padding-top:88px!important}.VPHomeSponsors[data-v-3d121b4a]{margin:96px 0}@media (min-width: 768px){.VPHomeSponsors[data-v-3d121b4a]{margin:128px 0}}.VPHomeSponsors[data-v-3d121b4a]{padding:0 24px}@media (min-width: 768px){.VPHomeSponsors[data-v-3d121b4a]{padding:0 48px}}@media (min-width: 960px){.VPHomeSponsors[data-v-3d121b4a]{padding:0 64px}}.container[data-v-3d121b4a]{margin:0 auto;max-width:1152px}.love[data-v-3d121b4a]{margin:0 auto;width:fit-content;font-size:28px;color:var(--vp-c-text-3)}.icon[data-v-3d121b4a]{display:inline-block}.message[data-v-3d121b4a]{margin:0 auto;padding-top:10px;max-width:320px;text-align:center;line-height:24px;font-size:16px;font-weight:500;color:var(--vp-c-text-2)}.sponsors[data-v-3d121b4a]{padding-top:32px}.action[data-v-3d121b4a]{padding-top:40px;text-align:center}.VPTeamPage[data-v-7c57f839]{margin:96px 0}@media (min-width: 768px){.VPTeamPage[data-v-7c57f839]{margin:128px 0}}.VPHome .VPTeamPageTitle[data-v-7c57f839-s]{border-top:1px solid var(--vp-c-gutter);padding-top:88px!important}.VPTeamPageSection+.VPTeamPageSection[data-v-7c57f839-s],.VPTeamMembers+.VPTeamPageSection[data-v-7c57f839-s]{margin-top:64px}.VPTeamMembers+.VPTeamMembers[data-v-7c57f839-s]{margin-top:24px}@media (min-width: 768px){.VPTeamPageTitle+.VPTeamPageSection[data-v-7c57f839-s]{margin-top:16px}.VPTeamPageSection+.VPTeamPageSection[data-v-7c57f839-s],.VPTeamMembers+.VPTeamPageSection[data-v-7c57f839-s]{margin-top:96px}}.VPTeamMembers[data-v-7c57f839-s]{padding:0 24px}@media (min-width: 768px){.VPTeamMembers[data-v-7c57f839-s]{padding:0 48px}}@media (min-width: 960px){.VPTeamMembers[data-v-7c57f839-s]{padding:0 64px}}.VPTeamPageTitle[data-v-bf2cbdac]{padding:48px 32px;text-align:center}@media (min-width: 768px){.VPTeamPageTitle[data-v-bf2cbdac]{padding:64px 48px 48px}}@media (min-width: 960px){.VPTeamPageTitle[data-v-bf2cbdac]{padding:80px 64px 48px}}.title[data-v-bf2cbdac]{letter-spacing:0;line-height:44px;font-size:36px;font-weight:500}@media (min-width: 768px){.title[data-v-bf2cbdac]{letter-spacing:-.5px;line-height:56px;font-size:48px}}.lead[data-v-bf2cbdac]{margin:0 auto;max-width:512px;padding-top:12px;line-height:24px;font-size:16px;font-weight:500;color:var(--vp-c-text-2)}@media (min-width: 768px){.lead[data-v-bf2cbdac]{max-width:592px;letter-spacing:.15px;line-height:28px;font-size:20px}}.VPTeamPageSection[data-v-b1a88750]{padding:0 32px}@media (min-width: 768px){.VPTeamPageSection[data-v-b1a88750]{padding:0 48px}}@media (min-width: 960px){.VPTeamPageSection[data-v-b1a88750]{padding:0 64px}}.title[data-v-b1a88750]{position:relative;margin:0 auto;max-width:1152px;text-align:center;color:var(--vp-c-text-2)}.title-line[data-v-b1a88750]{position:absolute;top:16px;left:0;width:100%;height:1px;background-color:var(--vp-c-divider)}.title-text[data-v-b1a88750]{position:relative;display:inline-block;padding:0 24px;letter-spacing:0;line-height:32px;font-size:20px;font-weight:500;background-color:var(--vp-c-bg)}.lead[data-v-b1a88750]{margin:0 auto;max-width:480px;padding-top:12px;text-align:center;line-height:24px;font-size:16px;font-weight:500;color:var(--vp-c-text-2)}.members[data-v-b1a88750]{padding-top:40px}.VPTeamMembersItem[data-v-f3fa364a]{display:flex;flex-direction:column;gap:2px;border-radius:12px;width:100%;height:100%;overflow:hidden}.VPTeamMembersItem.small .profile[data-v-f3fa364a]{padding:32px}.VPTeamMembersItem.small .data[data-v-f3fa364a]{padding-top:20px}.VPTeamMembersItem.small .avatar[data-v-f3fa364a]{width:64px;height:64px}.VPTeamMembersItem.small .name[data-v-f3fa364a]{line-height:24px;font-size:16px}.VPTeamMembersItem.small .affiliation[data-v-f3fa364a]{padding-top:4px;line-height:20px;font-size:14px}.VPTeamMembersItem.small .desc[data-v-f3fa364a]{padding-top:12px;line-height:20px;font-size:14px}.VPTeamMembersItem.small .links[data-v-f3fa364a]{margin:0 -16px -20px;padding:10px 0 0}.VPTeamMembersItem.medium .profile[data-v-f3fa364a]{padding:48px 32px}.VPTeamMembersItem.medium .data[data-v-f3fa364a]{padding-top:24px;text-align:center}.VPTeamMembersItem.medium .avatar[data-v-f3fa364a]{width:96px;height:96px}.VPTeamMembersItem.medium .name[data-v-f3fa364a]{letter-spacing:.15px;line-height:28px;font-size:20px}.VPTeamMembersItem.medium .affiliation[data-v-f3fa364a]{padding-top:4px;font-size:16px}.VPTeamMembersItem.medium .desc[data-v-f3fa364a]{padding-top:16px;max-width:288px;font-size:16px}.VPTeamMembersItem.medium .links[data-v-f3fa364a]{margin:0 -16px -12px;padding:16px 12px 0}.profile[data-v-f3fa364a]{flex-grow:1;background-color:var(--vp-c-bg-soft)}.data[data-v-f3fa364a]{text-align:center}.avatar[data-v-f3fa364a]{position:relative;flex-shrink:0;margin:0 auto;border-radius:50%;box-shadow:var(--vp-shadow-3)}.avatar-img[data-v-f3fa364a]{position:absolute;top:0;right:0;bottom:0;left:0;border-radius:50%;object-fit:cover}.name[data-v-f3fa364a]{margin:0;font-weight:600}.affiliation[data-v-f3fa364a]{margin:0;font-weight:500;color:var(--vp-c-text-2)}.org.link[data-v-f3fa364a]{color:var(--vp-c-text-2);transition:color .25s}.org.link[data-v-f3fa364a]:hover{color:var(--vp-c-brand-1)}.desc[data-v-f3fa364a]{margin:0 auto}.desc[data-v-f3fa364a] a{font-weight:500;color:var(--vp-c-brand-1);text-decoration-style:dotted;transition:color .25s}.links[data-v-f3fa364a]{display:flex;justify-content:center;height:56px}.sp-link[data-v-f3fa364a]{display:flex;justify-content:center;align-items:center;text-align:center;padding:16px;font-size:14px;font-weight:500;color:var(--vp-c-sponsor);background-color:var(--vp-c-bg-soft);transition:color .25s,background-color .25s}.sp .sp-link.link[data-v-f3fa364a]:hover,.sp .sp-link.link[data-v-f3fa364a]:focus{outline:none;color:var(--vp-c-white);background-color:var(--vp-c-sponsor)}.sp-icon[data-v-f3fa364a]{margin-right:8px;font-size:16px}.VPTeamMembers.small .container[data-v-6cb0dbc4]{grid-template-columns:repeat(auto-fit,minmax(224px,1fr))}.VPTeamMembers.small.count-1 .container[data-v-6cb0dbc4]{max-width:276px}.VPTeamMembers.small.count-2 .container[data-v-6cb0dbc4]{max-width:576px}.VPTeamMembers.small.count-3 .container[data-v-6cb0dbc4]{max-width:876px}.VPTeamMembers.medium .container[data-v-6cb0dbc4]{grid-template-columns:repeat(auto-fit,minmax(256px,1fr))}@media (min-width: 375px){.VPTeamMembers.medium .container[data-v-6cb0dbc4]{grid-template-columns:repeat(auto-fit,minmax(288px,1fr))}}.VPTeamMembers.medium.count-1 .container[data-v-6cb0dbc4]{max-width:368px}.VPTeamMembers.medium.count-2 .container[data-v-6cb0dbc4]{max-width:760px}.container[data-v-6cb0dbc4]{display:grid;gap:24px;margin:0 auto;max-width:1152px}:root{--vp-c-default-1: var(--vp-c-gray-1);--vp-c-default-2: var(--vp-c-gray-2);--vp-c-default-3: var(--vp-c-gray-3);--vp-c-default-soft: var(--vp-c-gray-soft);--vp-c-brand-1: var(--vp-c-indigo-1);--vp-c-brand-2: var(--vp-c-indigo-2);--vp-c-brand-3: var(--vp-c-indigo-3);--vp-c-brand-soft: var(--vp-c-indigo-soft);--vp-c-tip-1: var(--vp-c-brand-1);--vp-c-tip-2: var(--vp-c-brand-2);--vp-c-tip-3: var(--vp-c-brand-3);--vp-c-tip-soft: var(--vp-c-brand-soft);--vp-c-warning-1: var(--vp-c-yellow-1);--vp-c-warning-2: var(--vp-c-yellow-2);--vp-c-warning-3: var(--vp-c-yellow-3);--vp-c-warning-soft: var(--vp-c-yellow-soft);--vp-c-danger-1: var(--vp-c-red-1);--vp-c-danger-2: var(--vp-c-red-2);--vp-c-danger-3: var(--vp-c-red-3);--vp-c-danger-soft: var(--vp-c-red-soft)}:root{--vp-button-brand-border: transparent;--vp-button-brand-text: var(--vp-c-white);--vp-button-brand-bg: var(--vp-c-brand-3);--vp-button-brand-hover-border: transparent;--vp-button-brand-hover-text: var(--vp-c-white);--vp-button-brand-hover-bg: var(--vp-c-brand-2);--vp-button-brand-active-border: transparent;--vp-button-brand-active-text: var(--vp-c-white);--vp-button-brand-active-bg: var(--vp-c-brand-1)}:root{--vp-home-hero-name-color: transparent;--vp-home-hero-name-background: -webkit-linear-gradient( 120deg, #bd34fe 30%, #41d1ff );--vp-home-hero-image-background-image: linear-gradient( -45deg, #bd34fe 50%, #47caff 50% );--vp-home-hero-image-filter: blur(44px)}@media (min-width: 640px){:root{--vp-home-hero-image-filter: blur(56px)}}@media (min-width: 960px){:root{--vp-home-hero-image-filter: blur(68px)}}:root{--vp-custom-block-tip-border: transparent;--vp-custom-block-tip-text: var(--vp-c-text-1);--vp-custom-block-tip-bg: var(--vp-c-brand-soft);--vp-custom-block-tip-code-bg: var(--vp-c-brand-soft)}.DocSearch{--docsearch-primary-color: var(--vp-c-brand-1) !important}.DemoIframe[data-v-d2bc7091]{margin:16px 0}.DemoIframe .iframeWrapper[data-v-d2bc7091]{margin-top:10px;padding:10px;border:1px solid var(--vp-c-divider, #ccc);border-radius:8px}.DemoIframe iframe[data-v-d2bc7091]{border:0;width:100%}.VPLocalSearchBox[data-v-43c4f204]{position:fixed;z-index:100;top:0;right:0;bottom:0;left:0;display:flex}.backdrop[data-v-43c4f204]{position:absolute;top:0;right:0;bottom:0;left:0;background:var(--vp-backdrop-bg-color);transition:opacity .5s}.shell[data-v-43c4f204]{position:relative;padding:12px;margin:64px auto;display:flex;flex-direction:column;gap:16px;background:var(--vp-local-search-bg);width:min(100vw - 60px,900px);height:min-content;max-height:min(100vh - 128px,900px);border-radius:6px}@media (max-width: 767px){.shell[data-v-43c4f204]{margin:0;width:100vw;height:100vh;max-height:none;border-radius:0}}.search-bar[data-v-43c4f204]{border:1px solid var(--vp-c-divider);border-radius:4px;display:flex;align-items:center;padding:0 12px;cursor:text}@media (max-width: 767px){.search-bar[data-v-43c4f204]{padding:0 8px}}.search-bar[data-v-43c4f204]:focus-within{border-color:var(--vp-c-brand-1)}.local-search-icon[data-v-43c4f204]{display:block;font-size:18px}.navigate-icon[data-v-43c4f204]{display:block;font-size:14px}.search-icon[data-v-43c4f204]{margin:8px}@media (max-width: 767px){.search-icon[data-v-43c4f204]{display:none}}.search-input[data-v-43c4f204]{padding:6px 12px;font-size:inherit;width:100%}@media (max-width: 767px){.search-input[data-v-43c4f204]{padding:6px 4px}}.search-actions[data-v-43c4f204]{display:flex;gap:4px}@media (any-pointer: coarse){.search-actions[data-v-43c4f204]{gap:8px}}@media (min-width: 769px){.search-actions.before[data-v-43c4f204]{display:none}}.search-actions button[data-v-43c4f204]{padding:8px}.search-actions button[data-v-43c4f204]:not([disabled]):hover,.toggle-layout-button.detailed-list[data-v-43c4f204]{color:var(--vp-c-brand-1)}.search-actions button.clear-button[data-v-43c4f204]:disabled{opacity:.37}.search-keyboard-shortcuts[data-v-43c4f204]{font-size:.8rem;opacity:75%;display:flex;flex-wrap:wrap;gap:16px;line-height:14px}.search-keyboard-shortcuts span[data-v-43c4f204]{display:flex;align-items:center;gap:4px}@media (max-width: 767px){.search-keyboard-shortcuts[data-v-43c4f204]{display:none}}.search-keyboard-shortcuts kbd[data-v-43c4f204]{background:#8080801a;border-radius:4px;padding:3px 6px;min-width:24px;display:inline-block;text-align:center;vertical-align:middle;border:1px solid rgba(128,128,128,.15);box-shadow:0 2px 2px #0000001a}.results[data-v-43c4f204]{display:flex;flex-direction:column;gap:6px;overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain}.result[data-v-43c4f204]{display:flex;align-items:center;gap:8px;border-radius:4px;transition:none;line-height:1rem;border:solid 2px var(--vp-local-search-result-border);outline:none}.result>div[data-v-43c4f204]{margin:12px;width:100%;overflow:hidden}@media (max-width: 767px){.result>div[data-v-43c4f204]{margin:8px}}.titles[data-v-43c4f204]{display:flex;flex-wrap:wrap;gap:4px;position:relative;z-index:1001;padding:2px 0}.title[data-v-43c4f204]{display:flex;align-items:center;gap:4px}.title.main[data-v-43c4f204]{font-weight:500}.title-icon[data-v-43c4f204]{opacity:.5;font-weight:500;color:var(--vp-c-brand-1)}.title svg[data-v-43c4f204]{opacity:.5}.result.selected[data-v-43c4f204]{--vp-local-search-result-bg: var(--vp-local-search-result-selected-bg);border-color:var(--vp-local-search-result-selected-border)}.excerpt-wrapper[data-v-43c4f204]{position:relative}.excerpt[data-v-43c4f204]{opacity:75%;pointer-events:none;max-height:140px;overflow:hidden;position:relative;opacity:.5;margin-top:4px}.result.selected .excerpt[data-v-43c4f204]{opacity:1}.excerpt[data-v-43c4f204] *{font-size:.8rem!important;line-height:130%!important}.titles[data-v-43c4f204] mark,.excerpt[data-v-43c4f204] mark{background-color:var(--vp-local-search-highlight-bg);color:var(--vp-local-search-highlight-text);border-radius:2px;padding:0 2px}.excerpt[data-v-43c4f204] .vp-code-group .tabs{display:none}.excerpt[data-v-43c4f204] .vp-code-group div[class*=language-]{border-radius:8px!important}.excerpt-gradient-bottom[data-v-43c4f204]{position:absolute;bottom:-1px;left:0;width:100%;height:8px;background:linear-gradient(transparent,var(--vp-local-search-result-bg));z-index:1000}.excerpt-gradient-top[data-v-43c4f204]{position:absolute;top:-1px;left:0;width:100%;height:8px;background:linear-gradient(var(--vp-local-search-result-bg),transparent);z-index:1000}.result.selected .titles[data-v-43c4f204],.result.selected .title-icon[data-v-43c4f204]{color:var(--vp-c-brand-1)!important}.no-results[data-v-43c4f204]{font-size:.9rem;text-align:center;padding:12px}svg[data-v-43c4f204]{flex:none} diff --git a/assets/v1_api.md.8ChaXgfD.js b/assets/v1_api.md.8ChaXgfD.js new file mode 100644 index 0000000..76ff84f --- /dev/null +++ b/assets/v1_api.md.8ChaXgfD.js @@ -0,0 +1,110 @@ +import{_ as a,c as t,o as e,a5 as s}from"./chunks/framework.BthLuVtL.js";const E=JSON.parse('{"title":"API","description":"","frontmatter":{},"headers":[],"relativePath":"v1/api.md","filePath":"v1/api.md"}'),i={name:"v1/api.md"},n=s(`

API

Exported

The exported variables, methods, and Typescript types.

Typescript types:

  • Id: node id, parent id. Type: string | number.
  • Stat: Node information.
  • HeTreeProps: Options for useHeTree.

useHeTree

ts
import { useHeTree } from "he-tree-react";
+const {/* return */} = useHeTree({/* options */}) // prettier-ignore

The main function of this library. React hook. The arguments are as follows:

  • options: Options, type is object. The following are some properties in options:

    NameTypeDefaultDescription
    dataArrayData. Check Data Types.
    dataType'flat', 'tree''flat'Data Types
    idKeystring'id'key of id 名.
    parentIdKeystring'parent_id'key of the parent id. For flat data only.
    childrenKeystring'children'key of children nodes. For tree data only.
    indentnumber20Node indentation, unit is px.
    dragOpenbooleanfalseWhether to enable the function "Open node when dragging over node".
    dragOpenDelaynumber600The waiting time to open the node when dragging over the node. The unit is milliseconds.
    onDragOpenfunction(stat): voidThe callback of "Open node when dragging over node".
    direction'lrt', 'rtl''ltr'Display direction, ltr is displayed from left to right, rtl is the opposite.
    rootIdstring, nullnullThe parent id of a node that has not parent in flat data.
    virtualbooleanfalseWhether to enable virtualization. Used to improve performance when there is a lot of data.
    keepPlaceholderbooleanfalseWhether to retain placeholder when dragging out of the tree. It is recommended to enable this only on one tree page.
    openIdsArrayAll open nodes' id.
    checkedIdsArrayAll checked nodes' id.
    isFunctionReactivebooleanfalseWhether to listen for change of the callback functions. Reference

    The remaining callback functions in options:

    NameTypeDescription
    renderNode(stat)=> ReactNodeNode render.
    renderNodeBox({stat, attrs, isPlaceholder})=> ReactNodenodeBox's render. Reference.
    onChange(newData)=>voidCallback on data change
    canDrag(stat)=>boolean, null, undefined, voidWhether a node draggable. Returning null, undefined, void means inheriting the parent node.
    canDrop(stat, index)=>boolean, null, undefined, voidWhether a node droppable. Returning null, undefined, void means inheriting the parent node. The parameter index may be empty. If it is not empty, it indicates the position.
    customDragImage(event, stat)=> voidCalled event.dataTransfer.setDragImage to custom drag image. Reference.
    onDragStart(event, stat)=> void
    onExternalDragOver(event)=>booleanCalled when drag from external. Must return a Boolean value to indicate whether to handle this drag.
    onDragOver(event, stat, isExternal)=> voidisExternal indicates whether the drag is from outside.
    onDragEnd(event, stat, isOutside)=>voidCalled on dragend and this drag is started in this tree. stat is the stat of the dragged node. isOutside indicates whether it ended outside the tree.
    onExternalDrop(event, parentStat, index)=>voidCalled when the external drag ends on this tree. parentStat is the stat of the target parent node, and when it is empty, it represents the root of the tree. Index is the target position, the index of the node among siblings.

Return of useHeTree

The return of useHeTree is an object, including some states and methods. Note, this object will change every time. Do not rely on this object, but you can rely on the properties of this object. The properties are as follows:

NameTypeDescription
renderTree(options?: { className?: string, style?: React.CSSProperties }): ReactNodeTree render. Options can be passed in className and style to control the style of the root element.
getStat(idOrNodeOrStat)=>statGet stat by id, or node data, or stat object.
allIdsArrayThe ids of all nodes.
rootIdsArrayThe ids of all root nodes
rootNodesArrayAll root nodes. In tree data, it is same with options.data.
rootStatsArrayAll root nodes' stat.
placeholder{parentStat, index, level}Drag placeholder info. Null if it does not exist.
draggingStatstatWhen a drag is initiated from this tree, the stat of the dragged node. Null if it does not exist.
dragOverStatstatDragging over node's stat. May be null.
visibleIdsArrayAll visible nodes' id.
attrsListArrayAll visible nodes' attrs.
virtualListRefrefref of virtual list component, Check virtual list.
scrollToNode(idOrNodeOrStat)=>booleanScroll to node. The argument can be id, node or stat. If node not found or invisible, it return false. Example

walkTreeDataGenerator

The method of traversing tree data through for of. Executing skipChildren() in the loop will skip all child nodes of the node, and executing exitWalk will end the traversal.

ts
for (const [
+  node,
+  { parent, parents, siblings, index, skipChildren, exitWalk },
+] of walkTreeDataGenerator(data, "children")) {
+  // ...
+}

walkTreeData

The method to traverse tree data through the callback method. Executing skipChildren() in the callback method will skip all child nodes of the node, and executing exitWalk will end the traversal.

ts
walkTreeDataGenerator(
+  data,
+  (node, { parent, parents, siblings, index, skipChildren, exitWalk }) => {
+    // ...
+  },
+  "children"
+);

findTreeData

Like Array.prototype.find. Returns the first node found. Executing skipChildren() in the callback method will skip all child nodes of the node, and executing exitWalk will end the traversal.

ts
let foundNode = findTreeData(
+  data,
+  (node, { parent, parents, siblings, index, skipChildren, exitWalk }) => {
+    // return node.id === 1;
+  },
+  "children"
+);

filterTreeData

Like Array.prototype.filter. Returns all nodes found. Executing skipChildren() in the callback method will skip all child nodes of the node, and executing exitWalk will end the traversal.

ts
let nodes = filterTreeData(
+  data,
+  (node, { parent, parents, siblings, index, skipChildren, exitWalk }) => {
+    // return node.id > 1;
+  },
+  "children"
+);

openParentsInTreeData

Open all parent nodes of a single or multiple nodes to make the node visible. Reference.

(
+  treeData,
+  openIds: Id[],
+  idOrIds: Id | Id[],
+  options?: {idKey: string, childrenKey: string}
+): newOpenIds

updateCheckedInTreeData

Update the checked status of a single node or multiple nodes. This will update both their children and parents. Reference.

(
+  treeData,
+  checkedIds: Id[],
+  idOrIds: Id | Id[],
+  checked: boolean,
+  options?: {idKey: string, childrenKey: string}
+): [newCheckedIds, newSemiCheckedIds]

sortFlatData

Sort the flat data according to the order of the nodes in the tree. Return the new sorted array. Your data should use it to ensure order after initialized.

(
+  flatData,
+  options?: {idKey: string, parentIdKey: string}
+): sortedData

walkFlatDataGenerator

The method of traversing flat data through for of. Executing skipChildren() in the loop will skip all the child nodes of the node, and executing exitWalk will end the traversal. Make sure the order of your data is correct before using it.

Compared to walkTreeDataGenerator, it lacks siblings, but has treeIndex, id, pid. treeIndex is the index of the node in the tree.

ts
for (const [
+  node,
+  { parent, parents, index, treeIndex, id, pid, skipChildren, exitWalk },
+] of walkFlatDataGenerator(flatData, {
+  idKey: "id",
+  parentIdKey: "parent_id",
+})) {
+  // ...
+}

walkFlatData

The method of traversing flat data through the callback method. Executing skipChildren() in the callback method will skip all child nodes of the node, and executing exitWalk will end the traversal. Before using, make sure that the order of your data is correct.

ts
walkFlatData(
+  flatData,
+  (
+    node,
+    { parent, parents, index, treeIndex, id, pid, skipChildren, exitWalk }
+  ) => {
+    // ...
+  },
+  {
+    idKey: "id",
+    parentIdKey: "parent_id",
+  }
+);

openParentsInFlatData

Open all parent nodes of a single or multiple nodes to make the node visible. Make sure your data is in the correct order before using it. Reference.

(
+  flatData,
+  openIds: Id[],
+  idOrIds: Id | Id[],
+  options?: {
+    idKey: "id",
+    parentIdKey: "parent_id",
+  }
+): newOpenIds

updateCheckedInFlatData

Update the checked status of a single node or multiple nodes. This will update both their children and parents. Make sure your data is in the correct order before using it. Reference.

(
+  flatData,
+  checkedIds: Id[],
+  idOrIds: Id | Id[],
+  checked: boolean,
+  options?: {
+    idKey: "id",
+    parentIdKey: "parent_id",
+  }
+): [newCheckedIds, newSemiCheckedIds]

convertIndexToTreeIndexInFlatData

Calculate the index of a node in the tree through its parent node id and its index in the sibling nodes.

(
+  flatData,
+  parentId: Id | null,
+  indexInSiblings: Id | null,
+  options?: {
+    idKey: "id",
+    parentIdKey: "parent_id",
+  }
+): treeIndex

addToFlatData

Add a node to the flat data. It will change the original data array. Therefore, it is recommended to pass in a copy of the original data, or use it together with useImmer. Reference

(
+  flatData,
+  newNode,
+  index: Id | null,
+  options?: {
+    idKey: "id",
+    parentIdKey: "parent_id",
+  }
+):void

removeByIdInFlatData

Remove node by id from the flat data. It will change the original data array. Therefore, it is recommended to pass in a copy of the original data, or use it together with useImmer. Reference

(
+  flatData,
+  removeId: Id | null,
+  options?: {
+    idKey: "id",
+    parentIdKey: "parent_id",
+  }
+): removedData

walkParentsGenerator

A method to iterate over another special kind of data. This data is like HTMLElement, which contains keys pointing to the parent node like parentElement.

(
+  node,
+  parentKeyOrGetter: string | ((node) => parent | undefined),
+  options?: {
+    withSelf: boolean;
+  }
+): Generator

parentKeyOrGetter can be a string or a method that returns the parent. options.withSelf indicates whether to include the node self. Returns Generator. Here is an example of traversing HTMLElement:

ts
let el = document.querySelector("div");
+for (const parent of walkParentsGenerator(el, "parentElement", {
+  withSelf: true,
+})) {
+  // ...
+}

Stat

stat contains information related to the node. Read-only. The properties are as follows:

NameTypeDescription
_isStatbooleanIndicates whether it is a stat object
nodeobjectnode data
idIdid
pidId, nullparent id
parentobject, nullparent data
parentStatstat, nullparent stat
childIdsId[]
childrenobject[]
childStatsstat[]stats of children
siblingIdsId[]
siblingsobject[]sibling nodes
siblingStatsstat[]stats of siblings
indexnumbernode's index in siblings
levelnumbernode's depth in tree. Start from 1
openboolean
checkedboolean
draggableboolean
`,64),d=[n];function l(r,p,h,o,k,c){return e(),t("div",null,d)}const y=a(i,[["render",l]]);export{E as __pageData,y as default}; diff --git a/assets/v1_api.md.8ChaXgfD.lean.js b/assets/v1_api.md.8ChaXgfD.lean.js new file mode 100644 index 0000000..3fe422e --- /dev/null +++ b/assets/v1_api.md.8ChaXgfD.lean.js @@ -0,0 +1 @@ +import{_ as a,c as t,o as e,a5 as s}from"./chunks/framework.BthLuVtL.js";const E=JSON.parse('{"title":"API","description":"","frontmatter":{},"headers":[],"relativePath":"v1/api.md","filePath":"v1/api.md"}'),i={name:"v1/api.md"},n=s("",64),d=[n];function l(r,p,h,o,k,c){return e(),t("div",null,d)}const y=a(i,[["render",l]]);export{E as __pageData,y as default}; diff --git a/assets/v1_examples.md.DA1MhYZf.js b/assets/v1_examples.md.DA1MhYZf.js new file mode 100644 index 0000000..7331db9 --- /dev/null +++ b/assets/v1_examples.md.DA1MhYZf.js @@ -0,0 +1,715 @@ +import{_ as k,E as t,c as l,J as i,m as h,a as n,a5 as a,o as p}from"./chunks/framework.BthLuVtL.js";const N=JSON.parse('{"title":"Examples","description":"","frontmatter":{},"headers":[],"relativePath":"v1/examples.md","filePath":"v1/examples.md"}'),E={name:"v1/examples.md"},e=h("h1",{id:"examples",tabindex:"-1"},[n("Examples "),h("a",{class:"header-anchor",href:"#examples","aria-label":'Permalink to "Examples"'},"​")],-1),d=h("h2",{id:"custom-style",tabindex:"-1"},[n("Custom Style "),h("a",{class:"header-anchor",href:"#custom-style","aria-label":'Permalink to "Custom Style"'},"​")],-1),r=a(`

Source

tsx
import { useHeTree, sortFlatData } from "he-tree-react";
+import { useState } from 'react';
+
+export default function BasePage() {
+  const keys = { idKey: 'id', parentIdKey: 'parent_id' };
+  const [data, setdata] = useState(() => sortFlatData([
+    {
+      id: 1,
+      parent_id: null,
+      name: "Root Category",
+    },
+    {
+      id: 2,
+      parent_id: 1,
+      name: "Technology",
+    },
+    {
+      id: 5,
+      parent_id: 2,
+      name: "Hardware",
+    },
+    {
+      id: 10,
+      parent_id: 5,
+      name: "Computer Components",
+    },
+    {
+      id: 4,
+      parent_id: 2,
+      name: "Programming",
+    },
+    {
+      id: 8,
+      parent_id: 4,
+      name: "Python",
+    },
+    {
+      id: 3,
+      parent_id: 1,
+      name: "Science",
+    },
+    {
+      id: 7,
+      parent_id: 3,
+      name: "Biology",
+    },
+    {
+      id: 6,
+      parent_id: 3,
+      name: "Physics",
+    },
+  ], keys));
+  const { renderTree, placeholder } = useHeTree({
+    ...keys,
+    data,
+    dataType: 'flat',
+    onChange: setdata,
+    renderNodeBox: ({ stat, attrs, isPlaceholder }) => (
+      <div {...attrs} key={attrs.key} className="my-node-box">
+        {isPlaceholder ? <div className="my-placeholder">DROP HERE</div>
+          : <div className="my-node">
+            <span className="drag-handler" draggable={stat.draggable}>{dragIcon()}</span>
+            {stat.node.name}
+          </div>
+        }
+      </div>
+    ),
+  })
+  return <>
+    <h3 style={{ margin: '0 0 0 110px', padding: '20px 0 0px' }}>Draggable Tree</h3>
+    <div>
+      {renderTree({ className: \`my-tree \${placeholder ? 'dragging' : 'no-dragging'}\` })}
+    </div>
+    <style>{\`
+    .my-tree{
+      width: 300px; 
+      border: 1px solid #ccc; 
+      border-radius: 5px;
+      margin: 20px; 
+      padding: 20px;
+    }
+    .my-placeholder{
+      height:40px;
+      border: 1px dashed blue;
+      border-radius: 3px;
+      background-color: #f3ffff;
+      display: flex;
+      align-items: center;
+      justify-content: center;
+      font-size: small;
+    }
+    /*.no-dragging .my-node-box:hover{
+      background-color: #eee;
+    }*/
+    .my-node-box:not(:last-child){
+      margin-bottom: 10px;
+    }
+    .my-node{
+      padding: 5px 10px;
+      padding-left: 30px;
+      border: 1px solid #e2e2e2;
+      border-radius: 3px;
+      background-color: #f0f0f0;
+      display: flex;
+      align-items: center;
+      position: relative;
+      box-shadow: 1px 1px 3px 0px rgb(0 0 0 / 19%);
+    }
+    .no-dragging .my-node:hover{
+      background-color: #ebfeff;
+    }
+    .drag-handler{
+      position: absolute;
+      left: 0;
+      top: 0;
+      width: 30px;
+      height: 100%;
+      display: flex;
+      align-items: center;
+      justify-content: center;
+      cursor: grab;
+    }
+    .drag-handler:hover{
+      background-color: #f0f0f0;
+    }
+    .my-node svg{
+      width:16px;
+    }
+    \`}</style>
+  </>
+}
+
+function dragIcon() {
+  return <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>drag-horizontal-variant</title><path d="M21 11H3V9H21V11M21 13H3V15H21V13Z" /></svg>
+}

Flat Data

`,3),g=a(`

Source

tsx
import { useHeTree, sortFlatData } from "he-tree-react";
+import { useState } from 'react';
+
+export default function BasePage() {
+  const keys = { idKey: 'id', parentIdKey: 'parent_id' };
+  const [data, setdata] = useState(() => sortFlatData([
+    {
+      id: 1,
+      parent_id: null,
+      name: "Root Category",
+    },
+    {
+      id: 2,
+      parent_id: 1,
+      name: "Technology",
+    },
+    {
+      id: 5,
+      parent_id: 2,
+      name: "Hardware",
+    },
+    {
+      id: 10,
+      parent_id: 5,
+      name: "Computer Components",
+    },
+    {
+      id: 4,
+      parent_id: 2,
+      name: "Programming",
+    },
+    {
+      id: 8,
+      parent_id: 4,
+      name: "Python",
+    },
+    {
+      id: 3,
+      parent_id: 1,
+      name: "Science",
+    },
+    {
+      id: 7,
+      parent_id: 3,
+      name: "Biology",
+    },
+    {
+      id: 6,
+      parent_id: 3,
+      name: "Physics",
+    },
+  ], keys));
+  const { renderTree } = useHeTree({
+    ...keys,
+    data,
+    dataType: 'flat',
+    onChange: setdata,
+    renderNode: ({ id, node, open, checked }) => <div>
+      {node.name}
+    </div>,
+  })
+  return <div>
+    {renderTree({ style: { width: '300px', border: '1px solid #555', padding: '20px' } })}
+  </div>
+}

Tree-shaped Data

`,3),y=a(`

Source

tsx
import { useHeTree } from "he-tree-react";
+import { useState } from 'react';
+
+export default function BasePage() {
+  const [data, setdata] = useState(() => [
+    {
+      id: 1,
+      name: "Root Category",
+      children: [
+        {
+          id: 2,
+          name: "Technology",
+          children: [
+            {
+              id: 5,
+              name: "Hardware",
+              children: [
+                {
+                  id: 10,
+                  name: "Computer Components",
+                  children: [],
+                },
+              ],
+            },
+            {
+              id: 4,
+              name: "Programming",
+              children: [
+                {
+                  id: 8,
+                  name: "Python",
+                  children: [],
+                },
+              ],
+            },
+          ],
+        },
+        {
+          id: 3,
+          name: "Science",
+          children: [
+            {
+              id: 7,
+              name: "Biology",
+              children: [],
+            },
+            {
+              id: 6,
+              name: "Physics",
+              children: [],
+            },
+          ],
+        },
+      ],
+    },
+  ]);
+  const { renderTree } = useHeTree({
+    data,
+    dataType: 'tree',
+    childrenKey: 'children',
+    onChange: setdata,
+    renderNode: ({ id, node, open, checked }) => <div>
+      {node.name}
+    </div>,
+  })
+  return <div>
+    {renderTree({ style: { width: '300px', border: '1px solid #555', padding: '20px' } })}
+  </div>
+}

Trigger Element

`,3),F=a(`

Source

tsx
import { useHeTree, sortFlatData } from "he-tree-react";
+import { useState } from 'react';
+
+export default function BasePage() {
+  const keys = { idKey: 'id', parentIdKey: 'parent_id' };
+  // prettier-ignore
+  const [data, setdata] = useState(() => sortFlatData([{ id: 1, parent_id: null, name: "Root Category", }, { id: 2, parent_id: 1, name: "Technology", }, { id: 5, parent_id: 2, name: "Hardware", }, { id: 10, parent_id: 5, name: "Computer Components", }, { id: 4, parent_id: 2, name: "Programming", }, { id: 8, parent_id: 4, name: "Python", }, { id: 3, parent_id: 1, name: "Science", }, { id: 7, parent_id: 3, name: "Biology", }, { id: 6, parent_id: 3, name: "Physics", },], keys));
+  const { renderTree } = useHeTree({
+    ...keys,
+    data,
+    dataType: 'flat',
+    onChange: setdata,
+    renderNode: ({ id, node, open, checked, draggable }) => <div>
+      <button draggable={draggable}>Drag</button>
+      {node.name}
+    </div>,
+  })
+  return <div>
+    {renderTree({ style: { width: '300px', border: '1px solid #555', padding: '20px' } })}
+  </div>
+}

Placeholder

`,3),C=a(`

Source

tsx
import { useHeTree, sortFlatData } from "he-tree-react";
+import { useState } from 'react';
+
+export default function BasePage() {
+  const keys = { idKey: 'id', parentIdKey: 'parent_id' };
+  // prettier-ignore
+  const [data, setdata] = useState(() => sortFlatData([{ id: 1, parent_id: null, name: "Root Category", }, { id: 2, parent_id: 1, name: "Technology", }, { id: 5, parent_id: 2, name: "Hardware", }, { id: 10, parent_id: 5, name: "Computer Components", }, { id: 4, parent_id: 2, name: "Programming", }, { id: 8, parent_id: 4, name: "Python", }, { id: 3, parent_id: 1, name: "Science", }, { id: 7, parent_id: 3, name: "Biology", }, { id: 6, parent_id: 3, name: "Physics", },], keys));
+  const { renderTree } = useHeTree({
+    ...keys,
+    data,
+    dataType: 'flat',
+    onChange: setdata,
+    renderNodeBox: ({ stat, attrs, isPlaceholder }) => (
+      <div {...attrs} key={attrs.key}>
+        {isPlaceholder ? <div className="my-drag-placeholder">drop here</div>
+          : <div className="mynode">{stat.node.name}</div>
+        }
+      </div>
+    ),
+  })
+  return <div>
+    {renderTree({ className: 'mytree', style: { width: '300px', border: '1px solid #555', padding: '20px' } })}
+    <style>{\`
+    .mytree [data-node-box]{
+      padding: 5px 0;
+    }
+    .mytree [data-node-box]:hover{
+      background-color: #eee;
+    }
+    .mytree .he-tree-drag-placeholder{
+      height: 30px;
+      line-height: 30px;
+      text-align: center;
+      border: 1px dashed red;
+    }
+    .mynode{
+      padding-left:5px;
+    }
+    \`}</style>
+  </div>
+}

Open

`,3),o=a(`

Source

tsx
import { useHeTree, sortFlatData, openParentsInFlatData } from "he-tree-react";
+import type { Id } from "he-tree-react";
+import { useState } from 'react';
+
+export default function BasePage() {
+  const keys = { idKey: 'id', parentIdKey: 'parent_id' };
+  // prettier-ignore
+  const [data, setdata] = useState(() => sortFlatData([{ id: 1, parent_id: null, name: "Root Category", }, { id: 2, parent_id: 1, name: "Technology", }, { id: 5, parent_id: 2, name: "Hardware", }, { id: 10, parent_id: 5, name: "Computer Components", }, { id: 4, parent_id: 2, name: "Programming", }, { id: 8, parent_id: 4, name: "Python", }, { id: 3, parent_id: 1, name: "Science", }, { id: 7, parent_id: 3, name: "Biology", }, { id: 6, parent_id: 3, name: "Physics", },], keys));
+  const [openIds, setopenIds] = useState<Id[] | undefined>([]);
+  const handleOpen = (id: Id, open: boolean) => {
+    if (open) {
+      setopenIds([...(openIds || allIds), id]);
+    } else {
+      setopenIds((openIds || allIds).filter((i) => i !== id));
+    }
+  }
+  const { renderTree, allIds } = useHeTree({
+    ...keys,
+    data,
+    dataType: 'flat',
+    onChange: setdata,
+    openIds,
+    renderNode: ({ id, node, open, checked, draggable }) => <div>
+      <button onClick={() => handleOpen(id, !open)}>{open ? '-' : '+'}</button>
+      {node.name} - {id}
+    </div>,
+  })
+  return <div>
+    <button onClick={() => setopenIds(allIds)}>Open All</button>
+    <button onClick={() => setopenIds([])}>Close All</button>
+    <button onClick={() => setopenIds(openParentsInFlatData(data, openIds || allIds, 8, keys))}>Open 'Python'</button>
+    <button onClick={() => setopenIds(openParentsInFlatData(data, [], 8, keys))}>Only Open 'Python'</button>
+    {renderTree({ style: { width: '300px', border: '1px solid #555', padding: '20px' } })}
+  </div>
+}

Checked

`,3),c=a(`

Source

tsx
import { useHeTree, sortFlatData, updateCheckedInFlatData } from "he-tree-react";
+import type { Id } from "he-tree-react";
+import { useState } from 'react';
+
+export default function BasePage() {
+  const keys = { idKey: 'id', parentIdKey: 'parent_id' };
+  // prettier-ignore
+  const [data, setdata] = useState(() => sortFlatData([{ id: 1, parent_id: null, name: "Root Category", }, { id: 2, parent_id: 1, name: "Technology", }, { id: 5, parent_id: 2, name: "Hardware", }, { id: 10, parent_id: 5, name: "Computer Components", }, { id: 4, parent_id: 2, name: "Programming", }, { id: 8, parent_id: 4, name: "Python", }, { id: 3, parent_id: 1, name: "Science", }, { id: 7, parent_id: 3, name: "Biology", }, { id: 6, parent_id: 3, name: "Physics", },], keys));
+  const [checkedIds, setcheckedIds] = useState<Id[]>([]);
+  const [semiCheckedIds, setsemiCheckedIds] = useState<Id[]>([]);
+  const handleChecked = (id: Id, checked: boolean) => {
+    const r = updateCheckedInFlatData(data, checkedIds, id, checked, keys);
+    setcheckedIds(r[0]);
+    setsemiCheckedIds(r[1]);
+  }
+  const { renderTree } = useHeTree({
+    ...keys,
+    data,
+    dataType: 'flat',
+    onChange: setdata,
+    checkedIds,
+    renderNode: ({ id, node, open, checked, draggable }) => <div>
+      <input type="checkbox" checked={checked || false} onChange={() => handleChecked(id, !checked)} />
+      {node.name} - {id}
+    </div>,
+  })
+  return <div>
+    Checked: {JSON.stringify(checkedIds)} <br />
+    Semi-Checked: {JSON.stringify(semiCheckedIds)}
+    {renderTree({ style: { width: '300px', border: '1px solid #555', padding: '20px' } })}
+  </div>
+}

Draggable & Droppable

`,3),B=a(`

Source

tsx
import { useHeTree, sortFlatData } from "he-tree-react";
+import { useState } from 'react';
+
+export default function BasePage() {
+  const keys = { idKey: 'id', parentIdKey: 'parent_id' };
+  // prettier-ignore
+  const [data, setdata] = useState(() => sortFlatData([{ id: 2, parent_id: 1, name: "Technology", }, { id: 5, parent_id: 2, name: "Hardware", }, { id: 10, parent_id: 5, name: "Computer Components", }, { id: 4, parent_id: 2, name: "Programming", }, { id: 8, parent_id: 4, name: "Python", }, { id: 3, parent_id: 1, name: "Science", }, { id: 7, parent_id: 3, name: "Biology", }, { id: 6, parent_id: 3, name: "Physics", },], keys));
+  const { renderTree } = useHeTree({
+    ...keys,
+    data,
+    dataType: 'flat',
+    onChange: setdata,
+    renderNode: ({ id, node, open, checked, draggable }) => <div>
+      {node.name} - {id}
+    </div>,
+    canDrag: ({ id }) => id === 2 ? true : (id === 3 ? false : undefined),
+    canDrop: ({ id }) => id === 3 ? true : (id === 2 ? false : undefined),
+    canDropToRoot: (index) => false,
+  })
+  return <div>
+    {renderTree({ style: { width: '300px', border: '1px solid #555', padding: '20px' } })}
+  </div>
+}

Open when drag onto

`,3),A=a(`

Source

tsx
import { useHeTree, sortFlatData } from "he-tree-react";
+import type { Id } from "he-tree-react";
+import { useState } from 'react';
+
+export default function BasePage() {
+  const keys = { idKey: 'id', parentIdKey: 'parent_id' };
+  // prettier-ignore
+  const [data, setdata] = useState(() => sortFlatData([{ id: 1, parent_id: null, name: "Root Category", }, { id: 2, parent_id: 1, name: "Technology", }, { id: 5, parent_id: 2, name: "Hardware", }, { id: 10, parent_id: 5, name: "Computer Components", }, { id: 4, parent_id: 2, name: "Programming", }, { id: 8, parent_id: 4, name: "Python", }, { id: 3, parent_id: 1, name: "Science", }, { id: 7, parent_id: 3, name: "Biology", }, { id: 6, parent_id: 3, name: "Physics", },], keys));
+  const [openIds, setopenIds] = useState<Id[] | undefined>([1, 3]);
+  const handleOpen = (id: Id, open: boolean) => {
+    if (open) {
+      setopenIds([...(openIds || allIds), id]);
+    } else {
+      setopenIds((openIds || allIds).filter((i) => i !== id));
+    }
+  }
+  const { renderTree, allIds } = useHeTree({
+    ...keys,
+    data,
+    dataType: 'flat',
+    onChange: setdata,
+    openIds,
+    renderNode: ({ id, node, open, checked, draggable }) => <div>
+      <button onClick={() => handleOpen(id, !open)}>{open ? '-' : '+'}</button>
+      {node.name} - {id}
+    </div>,
+    dragOpen: true,
+    onDragOpen(stat) {
+      handleOpen(stat.id, true)
+    },
+  })
+  return <div>
+    {renderTree({ style: { width: '300px', border: '1px solid #555', padding: '20px' } })}
+  </div>
+}

Update Flat Data

`,3),D=a(`

Source

tsx
import {
+  useHeTree, sortFlatData,
+  addToFlatData, removeByIdInFlatData
+} from "he-tree-react";
+import type { Id } from "he-tree-react";
+import { useRef, useState } from 'react';
+
+export default function BasePage() {
+  const keys = { idKey: 'id', parentIdKey: 'parent_id' };
+  // prettier-ignore
+  const [data, setdata] = useState(() => sortFlatData([{ id: 1, parent_id: null, name: "Root Category", }, { id: 2, parent_id: 1, name: "Technology", }, { id: 5, parent_id: 2, name: "Hardware", }, { id: 10, parent_id: 5, name: "Computer Components", }, { id: 4, parent_id: 2, name: "Programming", }, { id: 8, parent_id: 4, name: "Python", }, { id: 3, parent_id: 1, name: "Science", }, { id: 7, parent_id: 3, name: "Biology", }, { id: 6, parent_id: 3, name: "Physics", },], keys));
+  const add = (pid: Id) => {
+    let id = parseInt(Math.random().toString().substring(2, 5));
+    let newData = [...data];
+    addToFlatData(newData, { id, parent_id: pid as number, name: "New" }, 0, keys)
+    setdata(newData);
+  }
+  const remove = (id: Id) => {
+    let newData = [...data];
+    removeByIdInFlatData(newData, id as number, keys)
+    setdata(newData);
+  }
+  const initialData = useRef<typeof data>();
+  initialData.current = initialData.current || data;
+  const { renderTree } = useHeTree({
+    ...keys,
+    data,
+    dataType: 'flat',
+    onChange: setdata,
+    renderNode: ({ id, node, draggable }) => <div>
+      <button draggable={draggable}>👉</button>
+      {node.name} - {id} -
+      <button onClick={() => add(id)}>+</button>
+      <button onClick={() => remove(id)}>-</button>
+    </div>,
+  })
+  return <div>
+    <button onClick={() => setdata(initialData.current!)}>Restore</button>
+    {renderTree({ style: { width: '300px', border: '1px solid #555', padding: '20px' } })}
+  </div>
+}

Update Flat Data with immer

`,3),u=a(`

Source

tsx
import {
+  useHeTree, sortFlatData,
+  addToFlatData, removeByIdInFlatData
+} from "he-tree-react";
+import type { Id } from "he-tree-react";
+import { useRef } from 'react';
+import { useImmer } from "use-immer";
+
+export default function BasePage() {
+  const keys = { idKey: 'id', parentIdKey: 'parent_id' };
+  // prettier-ignore
+  const [data, setdata] = useImmer(() => sortFlatData([{ id: 1, parent_id: null, name: "Root Category", }, { id: 2, parent_id: 1, name: "Technology", }, { id: 5, parent_id: 2, name: "Hardware", }, { id: 10, parent_id: 5, name: "Computer Components", }, { id: 4, parent_id: 2, name: "Programming", }, { id: 8, parent_id: 4, name: "Python", }, { id: 3, parent_id: 1, name: "Science", }, { id: 7, parent_id: 3, name: "Biology", }, { id: 6, parent_id: 3, name: "Physics", },], keys));
+  const add = (pid: Id) => {
+    let id = parseInt(Math.random().toString().substring(2, 5));
+    setdata(draft => {
+      addToFlatData(draft, { id, parent_id: pid as number, name: "New" }, 0, keys)
+    });
+  }
+  const remove = (id: Id) => {
+    setdata(draft => {
+      removeByIdInFlatData(draft, id as number, keys)
+    })
+  }
+  const edit = (id: Id) => {
+    let newName = prompt("Enter new name")
+    setdata(draft => {
+      if (newName) {
+        draft.find(node => node.id === id)!.name = newName
+      }
+    })
+  }
+  const initialData = useRef<typeof data>();
+  initialData.current = initialData.current || data;
+  const { renderTree } = useHeTree({
+    ...keys,
+    data,
+    dataType: 'flat',
+    onChange: setdata,
+    renderNode: ({ id, node, draggable }) => <div>
+      <button draggable={draggable}>👉</button>
+      {node.name} - {id} -
+      <button onClick={() => add(id)}>+</button>
+      <button onClick={() => remove(id)}>-</button>
+      <button onClick={() => edit(id)}>Edit</button>
+    </div>,
+  })
+  return <div>
+    <button onClick={() => setdata(initialData.current!)}>Restore</button>
+    {renderTree({ style: { width: '300px', border: '1px solid #555', padding: '20px' } })}
+  </div>
+}

Update Tree Data with immer

`,3),m=a(`

Source

tsx
import { useHeTree, findTreeData } from "he-tree-react";
+import type { Id } from "he-tree-react";
+import { useRef } from 'react';
+import { useImmer } from "use-immer";
+
+export default function BasePage() {
+  const CHILDREN = 'children'
+  const keys = { idKey: 'id', childrenKey: CHILDREN };
+  // prettier-ignore
+  const [data, setdata] = useImmer(() => [{ id: 1, name: "Root Category", children: [{ id: 2, name: "Technology", children: [{ id: 5, name: "Hardware", children: [{ id: 10, name: "Computer Components", children: [], },], }, { id: 4, name: "Programming", children: [{ id: 8, name: "Python", children: [], },], },], }, { id: 3, name: "Science", children: [{ id: 7, name: "Biology", children: [], }, { id: 6, name: "Physics", children: [], },], },], },]);
+  const add = (pid: Id) => {
+    let id = parseInt(Math.random().toString().substring(2, 5));
+    setdata(draft => {
+      findTreeData(draft, (node) => node.id === pid, CHILDREN)![CHILDREN].unshift({ id, name: "New", [CHILDREN]: [], })
+    })
+  }
+  const remove = (id: Id, pid: Id | null) => {
+    setdata(draft => {
+      const children = findTreeData(draft, (node,) => node.id === pid, CHILDREN)![CHILDREN]
+      children.splice(children.findIndex(t => t.id === id), 1)
+    })
+  }
+  const edit = (id: Id) => {
+    let newName = prompt("Enter new name")
+    setdata(draft => {
+      if (newName) {
+        findTreeData(draft, (node) => node.id === id, CHILDREN)!.name = newName
+      }
+    })
+  }
+  const initialData = useRef<typeof data>();
+  initialData.current = initialData.current || data;
+  const { renderTree } = useHeTree({
+    ...keys,
+    data,
+    dataType: 'tree',
+    onChange: setdata,
+    renderNode: ({ id, pid, node, draggable }) => <div>
+      <button draggable={draggable}>👉</button>
+      {node.name} - {id} -
+      <button onClick={() => add(id)}>+</button>
+      <button onClick={() => remove(id, pid)}>-</button>
+      <button onClick={() => edit(id)}>Edit</button>
+    </div>,
+  })
+  return <div>
+    <button onClick={() => setdata(initialData.current!)}>Restore</button>
+    {renderTree({ style: { width: '300px', border: '1px solid #555', padding: '20px' } })}
+  </div>
+}

Drag from External

`,3),_=a(`

Source

tsx
import { useHeTree, sortFlatData, addToFlatData } from "he-tree-react";
+import { useImmer } from "use-immer";
+
+export default function BasePage() {
+  const keys = { idKey: 'id', parentIdKey: 'parent_id' };
+  // prettier-ignore
+  const [data, setdata] = useImmer(() => sortFlatData([{ id: 1, parent_id: null, name: "Root Category", }, { id: 2, parent_id: 1, name: "Technology", }, { id: 5, parent_id: 2, name: "Hardware", }, { id: 10, parent_id: 5, name: "Computer Components", }, { id: 4, parent_id: 2, name: "Programming", }, { id: 8, parent_id: 4, name: "Python", }, { id: 3, parent_id: 1, name: "Science", }, { id: 7, parent_id: 3, name: "Biology", }, { id: 6, parent_id: 3, name: "Physics", },], keys));
+  const { renderTree, allIds } = useHeTree({
+    ...keys,
+    data,
+    dataType: 'flat',
+    onChange: setdata,
+    renderNode: ({ id, node, open, checked, draggable }) => <div>
+      {node.name} - {id}
+    </div>,
+    onExternalDragOver: (e) => true,
+    onExternalDrop: (e, parentStat, index) => {
+      setdata(draft => {
+        const newNode = { id: 100 + data.length, parent_id: parentStat?.id ?? null, name: "New Node" }
+        addToFlatData(draft, newNode, index, keys)
+      })
+    },
+  })
+  return <div>
+    <button draggable={true}>Drag me in to the tree</button>
+    {renderTree({ style: { width: '300px', border: '1px solid #555', padding: '20px' } })}
+  </div>
+}

Big Data

`,3),q=a(`

Source

tsx
import { useHeTree, sortFlatData } from "he-tree-react";
+import type { Id } from "he-tree-react";
+import { useState } from 'react';
+
+export default function BasePage() {
+  const keys = { idKey: 'id', parentIdKey: 'pid' };
+  // prettier-ignore
+  const [data, setdata] = useState(() => sortFlatData(createData(), keys));
+  const [openIds, setopenIds] = useState<Id[] | undefined>([]);
+  const handleOpen = (id: Id, open: boolean) => {
+    if (open) {
+      setopenIds([...(openIds || allIds), id]);
+    } else {
+      setopenIds((openIds || allIds).filter((i) => i !== id));
+    }
+  }
+  const { renderTree, allIds } = useHeTree({
+    ...keys,
+    data,
+    dataType: 'flat',
+    onChange: setdata,
+    openIds,
+    virtual: true,
+    renderNode: ({ id, node, open, checked, draggable }) => <div>
+      <button onClick={() => handleOpen(id, !open)}>{open ? '-' : '+'}</button>
+      {id}
+    </div>,
+  })
+  return <div>
+    {renderTree({ style: { width: '300px', height: '300px', border: '1px solid #555', padding: '20px' } })}
+  </div>
+}
+
+// generate 10000 nodes
+function createData() {
+  const genId = () => result.length
+  const result: { id: number, pid: number | null }[] = [];
+  for (let i = 0; i < 1000; i++) {
+    let id1 = genId()
+    result.push({ id: id1, pid: null })
+    for (let j = 0; j < 4; j++) {
+      result.push({ id: genId(), pid: id1 })
+    }
+    let id2 = genId()
+    result.push({ id: id2, pid: null })
+    for (let j = 0; j < 4; j++) {
+      result.push({ id: genId(), pid: id2 })
+    }
+  }
+  return result;
+}

Scroll to Node

`,3),b=a(`

Source

tsx
import { useHeTree, sortFlatData } from "he-tree-react";
+import type { Id } from "he-tree-react";
+import { useState } from 'react';
+
+export default function BasePage() {
+  const keys = { idKey: 'id', parentIdKey: 'pid' };
+  // prettier-ignore
+  const [data, setdata] = useState(() => sortFlatData(createData(), keys));
+  const [openIds, setopenIds] = useState<Id[] | undefined>([]);
+  const handleOpen = (id: Id, open: boolean) => {
+    if (open) {
+      setopenIds([...(openIds || allIds), id]);
+    } else {
+      setopenIds((openIds || allIds).filter((i) => i !== id));
+    }
+  }
+  const { renderTree, allIds, scrollToNode } = useHeTree({
+    ...keys,
+    data,
+    dataType: 'flat',
+    onChange: setdata,
+    openIds,
+    virtual: true,
+    renderNode: ({ id, node, open, checked, draggable }) => <div>
+      <button onClick={() => handleOpen(id, !open)}>{open ? '-' : '+'}</button>
+      {id}
+    </div>,
+  })
+  return <div>
+    <button onClick={() => scrollToNode(910)}>Scroll to 910</button>
+    {renderTree({ style: { width: '300px', height: '300px', border: '1px solid #555', padding: '20px' } })}
+  </div>
+}
+
+// generate 10000 nodes
+function createData() {
+  const genId = () => result.length
+  const result: { id: number, pid: number | null }[] = [];
+  for (let i = 0; i < 1000; i++) {
+    let id1 = genId()
+    result.push({ id: id1, pid: null })
+    for (let j = 0; j < 4; j++) {
+      result.push({ id: genId(), pid: id1 })
+    }
+    let id2 = genId()
+    result.push({ id: id2, pid: null })
+    for (let j = 0; j < 4; j++) {
+      result.push({ id: genId(), pid: id2 })
+    }
+  }
+  return result;
+}
`,2);function f(T,v,I,x,S,P){const s=t("DemoIframe");return p(),l("div",null,[e,d,i(s,{url:"/custom_style"}),r,i(s,{url:"/base_flat_data"}),g,i(s,{url:"/base_tree_data"}),y,i(s,{url:"/custom_drag_trigger_flat_data"}),F,i(s,{url:"/customize_placeholder_and_node_box"}),C,i(s,{url:"/open_ids"}),o,i(s,{url:"/checked_ids"}),c,i(s,{url:"/draggable_droppable"}),B,i(s,{url:"/dragopen"}),A,i(s,{url:"/update_data"}),D,i(s,{url:"/update_flat_data_with_immer"}),u,i(s,{url:"/update_tree_data_with_immer"}),m,i(s,{url:"/external_drag"}),_,i(s,{url:"/virtual_list"}),q,i(s,{url:"/scroll_to_node"}),b])}const H=k(E,[["render",f]]);export{N as __pageData,H as default}; diff --git a/assets/v1_examples.md.DA1MhYZf.lean.js b/assets/v1_examples.md.DA1MhYZf.lean.js new file mode 100644 index 0000000..a0b6f61 --- /dev/null +++ b/assets/v1_examples.md.DA1MhYZf.lean.js @@ -0,0 +1 @@ +import{_ as k,E as t,c as l,J as i,m as h,a as n,a5 as a,o as p}from"./chunks/framework.BthLuVtL.js";const N=JSON.parse('{"title":"Examples","description":"","frontmatter":{},"headers":[],"relativePath":"v1/examples.md","filePath":"v1/examples.md"}'),E={name:"v1/examples.md"},e=h("h1",{id:"examples",tabindex:"-1"},[n("Examples "),h("a",{class:"header-anchor",href:"#examples","aria-label":'Permalink to "Examples"'},"​")],-1),d=h("h2",{id:"custom-style",tabindex:"-1"},[n("Custom Style "),h("a",{class:"header-anchor",href:"#custom-style","aria-label":'Permalink to "Custom Style"'},"​")],-1),r=a("",3),g=a("",3),y=a("",3),F=a("",3),C=a("",3),o=a("",3),c=a("",3),B=a("",3),A=a("",3),D=a("",3),u=a("",3),m=a("",3),_=a("",3),q=a("",3),b=a("",2);function f(T,v,I,x,S,P){const s=t("DemoIframe");return p(),l("div",null,[e,d,i(s,{url:"/custom_style"}),r,i(s,{url:"/base_flat_data"}),g,i(s,{url:"/base_tree_data"}),y,i(s,{url:"/custom_drag_trigger_flat_data"}),F,i(s,{url:"/customize_placeholder_and_node_box"}),C,i(s,{url:"/open_ids"}),o,i(s,{url:"/checked_ids"}),c,i(s,{url:"/draggable_droppable"}),B,i(s,{url:"/dragopen"}),A,i(s,{url:"/update_data"}),D,i(s,{url:"/update_flat_data_with_immer"}),u,i(s,{url:"/update_tree_data_with_immer"}),m,i(s,{url:"/external_drag"}),_,i(s,{url:"/virtual_list"}),q,i(s,{url:"/scroll_to_node"}),b])}const H=k(E,[["render",f]]);export{N as __pageData,H as default}; diff --git a/assets/v1_guide.md.DSikYvGc.js b/assets/v1_guide.md.DSikYvGc.js new file mode 100644 index 0000000..f60d94b --- /dev/null +++ b/assets/v1_guide.md.DSikYvGc.js @@ -0,0 +1,570 @@ +import{_ as h,E as n,c as k,J as a,a5 as s,o as t}from"./chunks/framework.BthLuVtL.js";const I=JSON.parse('{"title":"Guide","description":"","frontmatter":{},"headers":[],"relativePath":"v1/guide.md","filePath":"v1/guide.md"}'),l={name:"v1/guide.md"},p=s(`

Guide

Installation

sh
npm install he-tree-react
sh
pnpm add he-tree-react
sh
yarn add he-tree-react

Data Types

This library supports two types of data structures:

  • Flat data, which is a one-dimensional array. Similar to data stored in a database. Each item requires an id, a parent id, null means there is no parent. The order of flat data must be the same as the tree, you can use the sortFlatData method to sort the data when initializing the data.
    js
    [
    +  { id: 1, pid: null },
    +  { id: 2, pid: 1 },
    +  { id: 3, pid: 2 },
    +];
  • Tree data. Each node contain child nodes in an array. If id is not specified, this library will use the node's index in the tree as the id. When using tree data, you need to set dataType: 'tree'.
    js
    [
    +  {
    +    id: 1,
    +    children: [
    +      {
    +        id: 2,
    +        children: [{ id: 3 }],
    +      },
    +    ],
    +  },
    +];

The id, pid, children in the data are not fixed. In the options, use idKey, parentIdKey, childrenKey to indicate the corresponding key names in your data.

No Components

This library does not export components, but exports a hook useHeTree. Use the returned renderTree to render the tree. The advantage of this is that in addition to renderTree, useHeTree will also return some internal states and methods, which can be easily obtained.

js
import { useHeTree } from "he-tree-react";
+
+export default function App() {
+  const { renderTree } = useHeTree({...})
+  return <div>
+    {renderTree()}
+  </div>
+}

Options

useHeTree is the primary function used, its first parameter is an options object. The required options are data, and at least one of renderNode, renderNodeBox must be present. Other important options include:

  • dataType, indicating data type. Available values:
    • flat, default. Flat data.
    • tree, tree-shaped data.
  • idKey, parentIdKey, the default values are id and parent_id. Needed when using flat data. Although there are default values, it is better to explicitly state them.
  • childrenKey, the default is children. Needed when using tree-shaped data. Although there are default values, it is better to explicitly state them.
  • onChange, a function called when data changes, the parameter is new data. If your tree will not change then this is not required.
  • isFunctionReactive, boolean. Default false. useHeTree options include many callback functions, such as onChange, canDrop. isFunctionReactive can be used to control whether to listen for changes to these callback functions. If your callback functions and data change synchronously, you do not need to enable this. Otherwise, you need to enable this and use React's useCallback or useMemo to cache all your callback functions to avoid performance issues.

See the useHeTree API documentation for more information.

Tips

  • stat, information related to a single node. Most of the parameters in callback functions have stat. Refer to Stat API.
  • node, the data of the node. You can get node data through stat.node.
  • getStat, through this function you can get stat, the only parameter can be id, node, stat. This function is in the return object of useHeTree: const {getStat} = useHeTree({...}).
  • The code examples below have preview. These examples can be directly copied for use. Pay attention to the the highlighted lines in code.
  • The code examples below use the tsx format, if you need the js format, you can use any ts js online converter.

Use Flat Data

tsx
import { useHeTree, sortFlatData } from "he-tree-react";
+import { useState } from 'react';
+
+export default function BasePage() {
+  const keys = { idKey: 'id', parentIdKey: 'parent_id' };
+  const [data, setdata] = useState(() => sortFlatData([
+    {
+      id: 1,
+      parent_id: null,
+      name: "Root Category",
+    },
+    {
+      id: 2,
+      parent_id: 1,
+      name: "Technology",
+    },
+    {
+      id: 5,
+      parent_id: 2,
+      name: "Hardware",
+    },
+    {
+      id: 10,
+      parent_id: 5,
+      name: "Computer Components",
+    },
+    {
+      id: 4,
+      parent_id: 2,
+      name: "Programming",
+    },
+    {
+      id: 8,
+      parent_id: 4,
+      name: "Python",
+    },
+    {
+      id: 3,
+      parent_id: 1,
+      name: "Science",
+    },
+    {
+      id: 7,
+      parent_id: 3,
+      name: "Biology",
+    },
+    {
+      id: 6,
+      parent_id: 3,
+      name: "Physics",
+    },
+  ], keys));
+  const { renderTree } = useHeTree({
+    ...keys,
+    data,
+    dataType: 'flat',
+    onChange: setdata,
+    renderNode: ({ id, node, open, checked }) => <div>
+      {node.name}
+    </div>,
+  })
+  return <div>
+    {renderTree({ style: { width: '300px', border: '1px solid #555', padding: '20px' } })}
+  </div>
+}
`,18),e=s(`

Use Tree-shaped Data

tsx
import { useHeTree } from "he-tree-react";
+import { useState } from 'react';
+
+export default function BasePage() {
+  const [data, setdata] = useState(() => [
+    {
+      id: 1,
+      name: "Root Category",
+      children: [
+        {
+          id: 2,
+          name: "Technology",
+          children: [
+            {
+              id: 5,
+              name: "Hardware",
+              children: [
+                {
+                  id: 10,
+                  name: "Computer Components",
+                  children: [],
+                },
+              ],
+            },
+            {
+              id: 4,
+              name: "Programming",
+              children: [
+                {
+                  id: 8,
+                  name: "Python",
+                  children: [],
+                },
+              ],
+            },
+          ],
+        },
+        {
+          id: 3,
+          name: "Science",
+          children: [
+            {
+              id: 7,
+              name: "Biology",
+              children: [],
+            },
+            {
+              id: 6,
+              name: "Physics",
+              children: [],
+            },
+          ],
+        },
+      ],
+    },
+  ]);
+  const { renderTree } = useHeTree({
+    data,
+    dataType: 'tree',
+    childrenKey: 'children',
+    onChange: setdata,
+    renderNode: ({ id, node, open, checked }) => <div>
+      {node.name}
+    </div>,
+  })
+  return <div>
+    {renderTree({ style: { width: '300px', border: '1px solid #555', padding: '20px' } })}
+  </div>
+}
`,2),E=s(`

Custom Drag Trigger Element

You can add the draggable attribute to any child element of the node.

tsx
import { useHeTree, sortFlatData } from "he-tree-react";
+import { useState } from 'react';
+
+export default function BasePage() {
+  const keys = { idKey: 'id', parentIdKey: 'parent_id' };
+  // prettier-ignore
+  const [data, setdata] = useState(() => sortFlatData([{ id: 1, parent_id: null, name: "Root Category", }, { id: 2, parent_id: 1, name: "Technology", }, { id: 5, parent_id: 2, name: "Hardware", }, { id: 10, parent_id: 5, name: "Computer Components", }, { id: 4, parent_id: 2, name: "Programming", }, { id: 8, parent_id: 4, name: "Python", }, { id: 3, parent_id: 1, name: "Science", }, { id: 7, parent_id: 3, name: "Biology", }, { id: 6, parent_id: 3, name: "Physics", },], keys));
+  const { renderTree } = useHeTree({
+    ...keys,
+    data,
+    dataType: 'flat',
+    onChange: setdata,
+    renderNode: ({ id, node, open, checked, draggable }) => <div>
+      <button draggable={draggable}>Drag</button>
+      {node.name}
+    </div>,
+  })
+  return <div>
+    {renderTree({ style: { width: '300px', border: '1px solid #555', padding: '20px' } })}
+  </div>
+}
`,3),d=s(`

HTML and Style of Node

Node HTML:

html
<div
+  draggable="true"
+  data-key="1"
+  data-level="1"
+  data-node-box="true"
+  style="padding-left: 0px;"
+>
+  <div>Node</div>
+</div>

There are two div above. Use the renderNode option to control the rendering of the inner div. For example: renderNode: ({node}) => <div>{node.name}</div>.

The outer div is called nodeBox, don't modify its padding-left, padding-right. Use the indent option to control the indentation of the node. If you want to control the rendering of nodeBox or the drag placeholder, you can use the renderNodeBox option, which will override renderNode. The standard renderNodeBox is as follows:

tsx
renderNodeBox: ({ stat, attrs, isPlaceholder }) => (
+  <div {...attrs} key={attrs.key}>
+    {isPlaceholder ? (
+      <div
+        className="he-tree-drag-placeholder"
+        style={{ minHeight: "20px", border: "1px dashed blue" }}
+      />
+    ) : (
+      <div>{/* node area */}</div>
+    )}
+  </div>
+);

Lines 4 to 7 are drag-and-drop placeholder. Line 9 is node.

Custom Drag Placeholder and Node Box

tsx
import { useHeTree, sortFlatData } from "he-tree-react";
+import { useState } from 'react';
+
+export default function BasePage() {
+  const keys = { idKey: 'id', parentIdKey: 'parent_id' };
+  // prettier-ignore
+  const [data, setdata] = useState(() => sortFlatData([{ id: 1, parent_id: null, name: "Root Category", }, { id: 2, parent_id: 1, name: "Technology", }, { id: 5, parent_id: 2, name: "Hardware", }, { id: 10, parent_id: 5, name: "Computer Components", }, { id: 4, parent_id: 2, name: "Programming", }, { id: 8, parent_id: 4, name: "Python", }, { id: 3, parent_id: 1, name: "Science", }, { id: 7, parent_id: 3, name: "Biology", }, { id: 6, parent_id: 3, name: "Physics", },], keys));
+  const { renderTree } = useHeTree({
+    ...keys,
+    data,
+    dataType: 'flat',
+    onChange: setdata,
+    renderNodeBox: ({ stat, attrs, isPlaceholder }) => (
+      <div {...attrs} key={attrs.key}>
+        {isPlaceholder ? <div className="my-drag-placeholder">drop here</div>
+          : <div className="mynode">{stat.node.name}</div>
+        }
+      </div>
+    ),
+  })
+  return <div>
+    {renderTree({ className: 'mytree', style: { width: '300px', border: '1px solid #555', padding: '20px' } })}
+    <style>{\`
+    .mytree [data-node-box]{
+      padding: 5px 0;
+    }
+    .mytree [data-node-box]:hover{
+      background-color: #eee;
+    }
+    .mytree .he-tree-drag-placeholder{
+      height: 30px;
+      line-height: 30px;
+      text-align: center;
+      border: 1px dashed red;
+    }
+    .mynode{
+      padding-left:5px;
+    }
+    \`}</style>
+  </div>
+}
`,9),r=s(`

Open & Close

  • Use the openIds option to indicate the open nodes.
  • The open status of the node can be obtained through stat.open.
  • The allIds returned by useHeTree contains the ids of all nodes.
  • This library exports methods that can expand all parents of one or multiple nodes. For flat data: openParentsInFlatData. For tree data: openParentsInTreeData.
tsx
import { useHeTree, sortFlatData, openParentsInFlatData } from "he-tree-react";
+import type { Id } from "he-tree-react";
+import { useState } from 'react';
+
+export default function BasePage() {
+  const keys = { idKey: 'id', parentIdKey: 'parent_id' };
+  // prettier-ignore
+  const [data, setdata] = useState(() => sortFlatData([{ id: 1, parent_id: null, name: "Root Category", }, { id: 2, parent_id: 1, name: "Technology", }, { id: 5, parent_id: 2, name: "Hardware", }, { id: 10, parent_id: 5, name: "Computer Components", }, { id: 4, parent_id: 2, name: "Programming", }, { id: 8, parent_id: 4, name: "Python", }, { id: 3, parent_id: 1, name: "Science", }, { id: 7, parent_id: 3, name: "Biology", }, { id: 6, parent_id: 3, name: "Physics", },], keys));
+  const [openIds, setopenIds] = useState<Id[] | undefined>([]);
+  const handleOpen = (id: Id, open: boolean) => {
+    if (open) {
+      setopenIds([...(openIds || allIds), id]);
+    } else {
+      setopenIds((openIds || allIds).filter((i) => i !== id));
+    }
+  }
+  const { renderTree, allIds } = useHeTree({
+    ...keys,
+    data,
+    dataType: 'flat',
+    onChange: setdata,
+    openIds,
+    renderNode: ({ id, node, open, checked, draggable }) => <div>
+      <button onClick={() => handleOpen(id, !open)}>{open ? '-' : '+'}</button>
+      {node.name} - {id}
+    </div>,
+  })
+  return <div>
+    <button onClick={() => setopenIds(allIds)}>Open All</button>
+    <button onClick={() => setopenIds([])}>Close All</button>
+    <button onClick={() => setopenIds(openParentsInFlatData(data, openIds || allIds, 8, keys))}>Open 'Python'</button>
+    <button onClick={() => setopenIds(openParentsInFlatData(data, [], 8, keys))}>Only Open 'Python'</button>
+    {renderTree({ style: { width: '300px', border: '1px solid #555', padding: '20px' } })}
+  </div>
+}
`,3),g=s(`

Checked

  • Use the option checkedIds to indicate the checked nodes.
  • The checked status of this node can be obtained through stat.checked.
  • This library exports methods that can get checkedIds for one or more nodes after the checked status changes. Flat data: updateCheckedInFlatData. Tree data: \`updateCheckedInTreeData.
    • The update of this method to the node's checked is cascading. If you don't want to cascade updates, replace it with your own logic.
    • This method returns an array of length 2. The first item is all checked ids, and the second item is all semi-checked ids. If you don't need semi-checked, ignore the second item.
    • Semi-checked, that is, there are child nodes that are checked or semi-checked, and there are child nodes that are not checked.
tsx
import { useHeTree, sortFlatData, updateCheckedInFlatData } from "he-tree-react";
+import type { Id } from "he-tree-react";
+import { useState } from 'react';
+
+export default function BasePage() {
+  const keys = { idKey: 'id', parentIdKey: 'parent_id' };
+  // prettier-ignore
+  const [data, setdata] = useState(() => sortFlatData([{ id: 1, parent_id: null, name: "Root Category", }, { id: 2, parent_id: 1, name: "Technology", }, { id: 5, parent_id: 2, name: "Hardware", }, { id: 10, parent_id: 5, name: "Computer Components", }, { id: 4, parent_id: 2, name: "Programming", }, { id: 8, parent_id: 4, name: "Python", }, { id: 3, parent_id: 1, name: "Science", }, { id: 7, parent_id: 3, name: "Biology", }, { id: 6, parent_id: 3, name: "Physics", },], keys));
+  const [checkedIds, setcheckedIds] = useState<Id[]>([]);
+  const [semiCheckedIds, setsemiCheckedIds] = useState<Id[]>([]);
+  const handleChecked = (id: Id, checked: boolean) => {
+    const r = updateCheckedInFlatData(data, checkedIds, id, checked, keys);
+    setcheckedIds(r[0]);
+    setsemiCheckedIds(r[1]);
+  }
+  const { renderTree } = useHeTree({
+    ...keys,
+    data,
+    dataType: 'flat',
+    onChange: setdata,
+    checkedIds,
+    renderNode: ({ id, node, open, checked, draggable }) => <div>
+      <input type="checkbox" checked={checked || false} onChange={() => handleChecked(id, !checked)} />
+      {node.name} - {id}
+    </div>,
+  })
+  return <div>
+    Checked: {JSON.stringify(checkedIds)} <br />
+    Semi-Checked: {JSON.stringify(semiCheckedIds)}
+    {renderTree({ style: { width: '300px', border: '1px solid #555', padding: '20px' } })}
+  </div>
+}
`,3),y=s(`

draggable & droppable

Use the following options to control:

tsx
import { useHeTree, sortFlatData } from "he-tree-react";
+import { useState } from 'react';
+
+export default function BasePage() {
+  const keys = { idKey: 'id', parentIdKey: 'parent_id' };
+  // prettier-ignore
+  const [data, setdata] = useState(() => sortFlatData([{ id: 2, parent_id: 1, name: "Technology", }, { id: 5, parent_id: 2, name: "Hardware", }, { id: 10, parent_id: 5, name: "Computer Components", }, { id: 4, parent_id: 2, name: "Programming", }, { id: 8, parent_id: 4, name: "Python", }, { id: 3, parent_id: 1, name: "Science", }, { id: 7, parent_id: 3, name: "Biology", }, { id: 6, parent_id: 3, name: "Physics", },], keys));
+  const { renderTree } = useHeTree({
+    ...keys,
+    data,
+    dataType: 'flat',
+    onChange: setdata,
+    renderNode: ({ id, node, open, checked, draggable }) => <div>
+      {node.name} - {id}
+    </div>,
+    canDrag: ({ id }) => id === 2 ? true : (id === 3 ? false : undefined),
+    canDrop: ({ id }) => id === 3 ? true : (id === 2 ? false : undefined),
+    canDropToRoot: (index) => false,
+  })
+  return <div>
+    {renderTree({ style: { width: '300px', border: '1px solid #555', padding: '20px' } })}
+  </div>
+}
`,4),F=s(`
  • The root node cannot be dropped.
  • Technology and its sub-nodes can be dragged. Science and its sub-nodes cannot be dragged.
  • Science and its sub-nodes can be dropped. Technology and its sub-nodes cannot be dropped.

Open when dragging over

Use the following options to control:

tsx
import { useHeTree, sortFlatData } from "he-tree-react";
+import type { Id } from "he-tree-react";
+import { useState } from 'react';
+
+export default function BasePage() {
+  const keys = { idKey: 'id', parentIdKey: 'parent_id' };
+  // prettier-ignore
+  const [data, setdata] = useState(() => sortFlatData([{ id: 1, parent_id: null, name: "Root Category", }, { id: 2, parent_id: 1, name: "Technology", }, { id: 5, parent_id: 2, name: "Hardware", }, { id: 10, parent_id: 5, name: "Computer Components", }, { id: 4, parent_id: 2, name: "Programming", }, { id: 8, parent_id: 4, name: "Python", }, { id: 3, parent_id: 1, name: "Science", }, { id: 7, parent_id: 3, name: "Biology", }, { id: 6, parent_id: 3, name: "Physics", },], keys));
+  const [openIds, setopenIds] = useState<Id[] | undefined>([1, 3]);
+  const handleOpen = (id: Id, open: boolean) => {
+    if (open) {
+      setopenIds([...(openIds || allIds), id]);
+    } else {
+      setopenIds((openIds || allIds).filter((i) => i !== id));
+    }
+  }
+  const { renderTree, allIds } = useHeTree({
+    ...keys,
+    data,
+    dataType: 'flat',
+    onChange: setdata,
+    openIds,
+    renderNode: ({ id, node, open, checked, draggable }) => <div>
+      <button onClick={() => handleOpen(id, !open)}>{open ? '-' : '+'}</button>
+      {node.name} - {id}
+    </div>,
+    dragOpen: true,
+    onDragOpen(stat) {
+      handleOpen(stat.id, true)
+    },
+  })
+  return <div>
+    {renderTree({ style: { width: '300px', border: '1px solid #555', padding: '20px' } })}
+  </div>
+}
`,5),o=s(`

Update Data

Due to the immutable nature of React, it is difficult to update flat data and tree data. For flat data, this library provides two methods to add nodes or delete nodes. If you want to perform more complex operations, or update tree data, it is recommended that you use immer.

sh
npm install immer use-immer
sh
pnpm add immer use-immer
sh
yarn add immer use-immer

Update Flat Data

addToFlatData. removeByIdInFlatData. These 2 methods will modify original data, so pass copy to it, or use immer.

tsx
import {
+  useHeTree, sortFlatData,
+  addToFlatData, removeByIdInFlatData
+} from "he-tree-react";
+import type { Id } from "he-tree-react";
+import { useRef, useState } from 'react';
+
+export default function BasePage() {
+  const keys = { idKey: 'id', parentIdKey: 'parent_id' };
+  // prettier-ignore
+  const [data, setdata] = useState(() => sortFlatData([{ id: 1, parent_id: null, name: "Root Category", }, { id: 2, parent_id: 1, name: "Technology", }, { id: 5, parent_id: 2, name: "Hardware", }, { id: 10, parent_id: 5, name: "Computer Components", }, { id: 4, parent_id: 2, name: "Programming", }, { id: 8, parent_id: 4, name: "Python", }, { id: 3, parent_id: 1, name: "Science", }, { id: 7, parent_id: 3, name: "Biology", }, { id: 6, parent_id: 3, name: "Physics", },], keys));
+  const add = (pid: Id) => {
+    let id = parseInt(Math.random().toString().substring(2, 5));
+    let newData = [...data];
+    addToFlatData(newData, { id, parent_id: pid as number, name: "New" }, 0, keys)
+    setdata(newData);
+  }
+  const remove = (id: Id) => {
+    let newData = [...data];
+    removeByIdInFlatData(newData, id as number, keys)
+    setdata(newData);
+  }
+  const initialData = useRef<typeof data>();
+  initialData.current = initialData.current || data;
+  const { renderTree } = useHeTree({
+    ...keys,
+    data,
+    dataType: 'flat',
+    onChange: setdata,
+    renderNode: ({ id, node, draggable }) => <div>
+      <button draggable={draggable}>👉</button>
+      {node.name} - {id} -
+      <button onClick={() => add(id)}>+</button>
+      <button onClick={() => remove(id)}>-</button>
+    </div>,
+  })
+  return <div>
+    <button onClick={() => setdata(initialData.current!)}>Restore</button>
+    {renderTree({ style: { width: '300px', border: '1px solid #555', padding: '20px' } })}
+  </div>
+}
`,6),c=s(`

Update Flat Data with immer

Note, here we use useImmer instead of React's useState.

tsx
import {
+  useHeTree, sortFlatData,
+  addToFlatData, removeByIdInFlatData
+} from "he-tree-react";
+import type { Id } from "he-tree-react";
+import { useRef } from 'react';
+import { useImmer } from "use-immer";
+
+export default function BasePage() {
+  const keys = { idKey: 'id', parentIdKey: 'parent_id' };
+  // prettier-ignore
+  const [data, setdata] = useImmer(() => sortFlatData([{ id: 1, parent_id: null, name: "Root Category", }, { id: 2, parent_id: 1, name: "Technology", }, { id: 5, parent_id: 2, name: "Hardware", }, { id: 10, parent_id: 5, name: "Computer Components", }, { id: 4, parent_id: 2, name: "Programming", }, { id: 8, parent_id: 4, name: "Python", }, { id: 3, parent_id: 1, name: "Science", }, { id: 7, parent_id: 3, name: "Biology", }, { id: 6, parent_id: 3, name: "Physics", },], keys));
+  const add = (pid: Id) => {
+    let id = parseInt(Math.random().toString().substring(2, 5));
+    setdata(draft => {
+      addToFlatData(draft, { id, parent_id: pid as number, name: "New" }, 0, keys)
+    });
+  }
+  const remove = (id: Id) => {
+    setdata(draft => {
+      removeByIdInFlatData(draft, id as number, keys)
+    })
+  }
+  const edit = (id: Id) => {
+    let newName = prompt("Enter new name")
+    setdata(draft => {
+      if (newName) {
+        draft.find(node => node.id === id)!.name = newName
+      }
+    })
+  }
+  const initialData = useRef<typeof data>();
+  initialData.current = initialData.current || data;
+  const { renderTree } = useHeTree({
+    ...keys,
+    data,
+    dataType: 'flat',
+    onChange: setdata,
+    renderNode: ({ id, node, draggable }) => <div>
+      <button draggable={draggable}>👉</button>
+      {node.name} - {id} -
+      <button onClick={() => add(id)}>+</button>
+      <button onClick={() => remove(id)}>-</button>
+      <button onClick={() => edit(id)}>Edit</button>
+    </div>,
+  })
+  return <div>
+    <button onClick={() => setdata(initialData.current!)}>Restore</button>
+    {renderTree({ style: { width: '300px', border: '1px solid #555', padding: '20px' } })}
+  </div>
+}
`,3),C=s(`

Update Tree Data with immer

Note, here we use useImmer instead of React's useState. findTreeData is like Array.prototype.find.

tsx
import { useHeTree, findTreeData } from "he-tree-react";
+import type { Id } from "he-tree-react";
+import { useRef } from 'react';
+import { useImmer } from "use-immer";
+
+export default function BasePage() {
+  const CHILDREN = 'children'
+  const keys = { idKey: 'id', childrenKey: CHILDREN };
+  // prettier-ignore
+  const [data, setdata] = useImmer(() => [{ id: 1, name: "Root Category", children: [{ id: 2, name: "Technology", children: [{ id: 5, name: "Hardware", children: [{ id: 10, name: "Computer Components", children: [], },], }, { id: 4, name: "Programming", children: [{ id: 8, name: "Python", children: [], },], },], }, { id: 3, name: "Science", children: [{ id: 7, name: "Biology", children: [], }, { id: 6, name: "Physics", children: [], },], },], },]);
+  const add = (pid: Id) => {
+    let id = parseInt(Math.random().toString().substring(2, 5));
+    setdata(draft => {
+      findTreeData(draft, (node) => node.id === pid, CHILDREN)![CHILDREN].unshift({ id, name: "New", [CHILDREN]: [], })
+    })
+  }
+  const remove = (id: Id, pid: Id | null) => {
+    setdata(draft => {
+      const children = findTreeData(draft, (node,) => node.id === pid, CHILDREN)![CHILDREN]
+      children.splice(children.findIndex(t => t.id === id), 1)
+    })
+  }
+  const edit = (id: Id) => {
+    let newName = prompt("Enter new name")
+    setdata(draft => {
+      if (newName) {
+        findTreeData(draft, (node) => node.id === id, CHILDREN)!.name = newName
+      }
+    })
+  }
+  const initialData = useRef<typeof data>();
+  initialData.current = initialData.current || data;
+  const { renderTree } = useHeTree({
+    ...keys,
+    data,
+    dataType: 'tree',
+    onChange: setdata,
+    renderNode: ({ id, pid, node, draggable }) => <div>
+      <button draggable={draggable}>👉</button>
+      {node.name} - {id} -
+      <button onClick={() => add(id)}>+</button>
+      <button onClick={() => remove(id, pid)}>-</button>
+      <button onClick={() => edit(id)}>Edit</button>
+    </div>,
+  })
+  return <div>
+    <button onClick={() => setdata(initialData.current!)}>Restore</button>
+    {renderTree({ style: { width: '300px', border: '1px solid #555', padding: '20px' } })}
+  </div>
+}
`,3),B=s(`

Drag from External

Related options:

tsx
import { useHeTree, sortFlatData, addToFlatData } from "he-tree-react";
+import { useImmer } from "use-immer";
+
+export default function BasePage() {
+  const keys = { idKey: 'id', parentIdKey: 'parent_id' };
+  // prettier-ignore
+  const [data, setdata] = useImmer(() => sortFlatData([{ id: 1, parent_id: null, name: "Root Category", }, { id: 2, parent_id: 1, name: "Technology", }, { id: 5, parent_id: 2, name: "Hardware", }, { id: 10, parent_id: 5, name: "Computer Components", }, { id: 4, parent_id: 2, name: "Programming", }, { id: 8, parent_id: 4, name: "Python", }, { id: 3, parent_id: 1, name: "Science", }, { id: 7, parent_id: 3, name: "Biology", }, { id: 6, parent_id: 3, name: "Physics", },], keys));
+  const { renderTree, allIds } = useHeTree({
+    ...keys,
+    data,
+    dataType: 'flat',
+    onChange: setdata,
+    renderNode: ({ id, node, open, checked, draggable }) => <div>
+      {node.name} - {id}
+    </div>,
+    onExternalDragOver: (e) => true,
+    onExternalDrop: (e, parentStat, index) => {
+      setdata(draft => {
+        const newNode = { id: 100 + data.length, parent_id: parentStat?.id ?? null, name: "New Node" }
+        addToFlatData(draft, newNode, index, keys)
+      })
+    },
+  })
+  return <div>
+    <button draggable={true}>Drag me in to the tree</button>
+    {renderTree({ style: { width: '300px', border: '1px solid #555', padding: '20px' } })}
+  </div>
+}
`,4),u=s(`

Big Data

Use option virtual to enable virtual list. Remember to set height for tree.

tsx
import { useHeTree, sortFlatData } from "he-tree-react";
+import type { Id } from "he-tree-react";
+import { useState } from 'react';
+
+export default function BasePage() {
+  const keys = { idKey: 'id', parentIdKey: 'pid' };
+  // prettier-ignore
+  const [data, setdata] = useState(() => sortFlatData(createData(), keys));
+  const [openIds, setopenIds] = useState<Id[] | undefined>([]);
+  const handleOpen = (id: Id, open: boolean) => {
+    if (open) {
+      setopenIds([...(openIds || allIds), id]);
+    } else {
+      setopenIds((openIds || allIds).filter((i) => i !== id));
+    }
+  }
+  const { renderTree, allIds } = useHeTree({
+    ...keys,
+    data,
+    dataType: 'flat',
+    onChange: setdata,
+    openIds,
+    virtual: true,
+    renderNode: ({ id, node, open, checked, draggable }) => <div>
+      <button onClick={() => handleOpen(id, !open)}>{open ? '-' : '+'}</button>
+      {id}
+    </div>,
+  })
+  return <div>
+    {renderTree({ style: { width: '300px', height: '300px', border: '1px solid #555', padding: '20px' } })}
+  </div>
+}
+
+// generate 10000 nodes
+function createData() {
+  const genId = () => result.length
+  const result: { id: number, pid: number | null }[] = [];
+  for (let i = 0; i < 1000; i++) {
+    let id1 = genId()
+    result.push({ id: id1, pid: null })
+    for (let j = 0; j < 4; j++) {
+      result.push({ id: genId(), pid: id1 })
+    }
+    let id2 = genId()
+    result.push({ id: id2, pid: null })
+    for (let j = 0; j < 4; j++) {
+      result.push({ id: genId(), pid: id2 })
+    }
+  }
+  return result;
+}
`,3),A=s('

Touch & Mobile Device

It is based on HTML5 Drag and Drop API. So it works in any device that supports Drag and Drop API. For others, you can try Drag and Drop API polyfill.

Notice

In mobile, user need touch and hold to trigger drag.

Others

  • Option direction: from right to left.
  • Option customDragImage: custom drag image.
  • Option rootId: the parent id of root nodes in flat data.
  • Option keepPlaceholder: whether to retain the drag placeholder node when dragging outside the tree. Default is false.
  • Function scrollToNode: Scroll to a node.
',5);function D(m,_,b,q,f,v){const i=n("DemoIframe");return t(),k("div",null,[p,a(i,{url:"/base_flat_data"}),e,a(i,{url:"/base_tree_data"}),E,a(i,{url:"/custom_drag_trigger_flat_data"}),d,a(i,{url:"/customize_placeholder_and_node_box"}),r,a(i,{url:"/open_ids"}),g,a(i,{url:"/checked_ids"}),y,a(i,{url:"/draggable_droppable"}),F,a(i,{url:"/dragopen"}),o,a(i,{url:"/update_data"}),c,a(i,{url:"/update_flat_data_with_immer"}),C,a(i,{url:"/update_tree_data_with_immer"}),B,a(i,{url:"/external_drag"}),u,a(i,{url:"/virtual_list"}),A])}const x=h(l,[["render",D]]);export{I as __pageData,x as default}; diff --git a/assets/v1_guide.md.DSikYvGc.lean.js b/assets/v1_guide.md.DSikYvGc.lean.js new file mode 100644 index 0000000..f4c55b5 --- /dev/null +++ b/assets/v1_guide.md.DSikYvGc.lean.js @@ -0,0 +1 @@ +import{_ as h,E as n,c as k,J as a,a5 as s,o as t}from"./chunks/framework.BthLuVtL.js";const I=JSON.parse('{"title":"Guide","description":"","frontmatter":{},"headers":[],"relativePath":"v1/guide.md","filePath":"v1/guide.md"}'),l={name:"v1/guide.md"},p=s("",18),e=s("",2),E=s("",3),d=s("",9),r=s("",3),g=s("",3),y=s("",4),F=s("",5),o=s("",6),c=s("",3),C=s("",3),B=s("",4),u=s("",3),A=s("",5);function D(m,_,b,q,f,v){const i=n("DemoIframe");return t(),k("div",null,[p,a(i,{url:"/base_flat_data"}),e,a(i,{url:"/base_tree_data"}),E,a(i,{url:"/custom_drag_trigger_flat_data"}),d,a(i,{url:"/customize_placeholder_and_node_box"}),r,a(i,{url:"/open_ids"}),g,a(i,{url:"/checked_ids"}),y,a(i,{url:"/draggable_droppable"}),F,a(i,{url:"/dragopen"}),o,a(i,{url:"/update_data"}),c,a(i,{url:"/update_flat_data_with_immer"}),C,a(i,{url:"/update_tree_data_with_immer"}),B,a(i,{url:"/external_drag"}),u,a(i,{url:"/virtual_list"}),A])}const x=h(l,[["render",D]]);export{I as __pageData,x as default}; diff --git a/assets/zh_index.md.Ct9xdv7q.js b/assets/zh_index.md.Ct9xdv7q.js new file mode 100644 index 0000000..658ac1b --- /dev/null +++ b/assets/zh_index.md.Ct9xdv7q.js @@ -0,0 +1 @@ +import{_ as e,c as t,o as i,a5 as a}from"./chunks/framework.BthLuVtL.js";const u=JSON.parse('{"title":"","description":"","frontmatter":{"layout":"home","hero":{"name":"He Tree React","tagline":"React 可拖拽树组件","actions":[{"theme":"brand","text":"开始使用","link":"./v1/guide"},{"theme":"alt","text":"演示","link":"./v1/examples"}]},"features":[{"title":"可拖拽","details":"拖拽时显示占位框辅助用户选择位置."},{"title":"高性能","details":"支持虚拟列表, 从容处理大量数据."},{"title":"易定制","details":"结构简单, 很少内置样式, 可以容易的修改样式和UI."}]},"headers":[],"relativePath":"zh/index.md","filePath":"zh/index.md"}'),l={name:"zh/index.md"},n=a('

功能

  • 拖拽时显示一个占位元素指示位置.
  • 节点高度不固定.
  • 基于 HTML Drag and Drop API.
  • 同时支持扁平数据和树形数据.
  • 支持外部拖拽.
  • 展开与折叠, 拖拽到节点上时展开它.
  • 勾选, 半选.
  • 大数据, 虚拟列表.
  • 更新数据的多个示例.
  • rtl, 从右往左显示.
',2),o=[n];function r(s,_,d,c,h,m){return i(),t("div",null,o)}const x=e(l,[["render",r]]);export{u as __pageData,x as default}; diff --git a/assets/zh_index.md.Ct9xdv7q.lean.js b/assets/zh_index.md.Ct9xdv7q.lean.js new file mode 100644 index 0000000..4c010db --- /dev/null +++ b/assets/zh_index.md.Ct9xdv7q.lean.js @@ -0,0 +1 @@ +import{_ as e,c as t,o as i,a5 as a}from"./chunks/framework.BthLuVtL.js";const u=JSON.parse('{"title":"","description":"","frontmatter":{"layout":"home","hero":{"name":"He Tree React","tagline":"React 可拖拽树组件","actions":[{"theme":"brand","text":"开始使用","link":"./v1/guide"},{"theme":"alt","text":"演示","link":"./v1/examples"}]},"features":[{"title":"可拖拽","details":"拖拽时显示占位框辅助用户选择位置."},{"title":"高性能","details":"支持虚拟列表, 从容处理大量数据."},{"title":"易定制","details":"结构简单, 很少内置样式, 可以容易的修改样式和UI."}]},"headers":[],"relativePath":"zh/index.md","filePath":"zh/index.md"}'),l={name:"zh/index.md"},n=a("",2),o=[n];function r(s,_,d,c,h,m){return i(),t("div",null,o)}const x=e(l,[["render",r]]);export{u as __pageData,x as default}; diff --git a/assets/zh_v1_api.md.BHPyDvs2.js b/assets/zh_v1_api.md.BHPyDvs2.js new file mode 100644 index 0000000..09622f5 --- /dev/null +++ b/assets/zh_v1_api.md.BHPyDvs2.js @@ -0,0 +1,110 @@ +import{_ as a,c as s,o as t,a5 as e}from"./chunks/framework.BthLuVtL.js";const g=JSON.parse('{"title":"API","description":"","frontmatter":{},"headers":[],"relativePath":"zh/v1/api.md","filePath":"zh/v1/api.md"}'),i={name:"zh/v1/api.md"},n=e(`

API

导出

此库导出的变量, 方法, Typescript 类型.

以下为 Typescript 的类型:

  • Id: 节点 id, 父级 id. 类型: string | number.
  • Stat: 节点的相关信息.
  • HeTreeProps: useHeTree的选项.

useHeTree

ts
import { useHeTree } from "he-tree-react";
+const {/* return */} = useHeTree({/* options */}) // prettier-ignore

本库的主要功能. React hook. 参数如下:

  • options: 选项, 类型是对象. 以下是 options 中的部分属性:

    名称类型默认值描述
    dataArray数据. 参考数据类型.
    dataType'flat', 'tree''flat'数据类型
    idKeystring'id'你的数据中 id 的键名.
    parentIdKeystring'parent_id'你的数据中父级 id 的键名. 仅用于扁平数据.
    childrenKeystring'children'你的数据中子级的键名. 仅用于树形数据.
    indentnumber20节点缩进, 单位是 px.
    dragOpenbooleanfalse是否启用功能"拖拽到节点上时打开节点".
    dragOpenDelaynumber600拖拽到节点上时打开节点的等待时间. 单位是毫秒.
    onDragOpenfunction(stat): void拖拽到节点上时打开节点的回调.
    direction'lrt', 'rtl''ltr'显示方向, ltr 是从左往右显示, rtl 与之相反.
    rootIdstring, nullnull使用扁平数据时, 没有父级的节点的父级 id.
    virtualbooleanfalse是否启用虚拟化. 当数据非常多时用来提高性能.
    keepPlaceholderbooleanfalse当拖拽离开树的范围, 是否要保留占位元素. 建议只在一个树的页面开启此项.
    openIdsArray所有打开节点的 id.
    checkedIdsArray所有勾选的节点的 id.
    isFunctionReactivebooleanfalse是否监听回调函数的改变. 参考

    以下是 options 中的剩余回调方法:

    名称类型描述
    renderNode(stat)=> ReactNode节点的渲染函数.
    renderNodeBox({stat, attrs, isPlaceholder})=> ReactNodenodeBox 的渲染函数. 参考.
    onChange(newData)=>void数据发生改变时调用.
    canDrag(stat)=>boolean, null, undefined, void节点是否可拖拽. 返回null, undefined, void表示继承父节点.
    canDrop(stat, index)=>boolean, null, undefined, void节点是否可放入. 返回null, undefined, void表示继承父节点. 参数index可能为空, 不为空时表示将要放入节点的子级的位置.
    customDragImage(event, stat)=> void调用event.dataTransfer.setDragImage自定义 drag image. 参考.
    onDragStart(event, stat)=> void当拖拽开始时
    onExternalDragOver(event)=>boolean当拖拽来自外部时调用. 你必选返回布尔值表示是否处理此拖拽.
    onDragOver(event, stat, isExternal)=> void当拖拽到树上方时, isExternal表示此次拖拽是否来自外部.
    onDragEnd(event, stat, isOutside)=>void当此树发起的拖拽结束时调用. stat 是此次拖拽的节点的 stat.isOutside 表示是否在树外部结束.
    onExternalDrop(event, parentStat, index)=>void当外部拖拽在此树结束时调用. parentStat 是目标父节点的 stat, 为空时代表树的根级. index 是目标位置, 即节点在兄弟节点中的索引.

useHeTree的返回

useHeTree的返回是对象, 包含了一些 states 和方法. 注意, 这个对象每次更新都会改变, 不要依赖这个对象, 可以依赖这个对象的属性. 属性如下:

名称类型描述
renderTree(options?: { className?: string, style?: React.CSSProperties }): ReactNode渲染树. 参数可以传入classNamestyle控制根元素的样式.
getStat(idOrNodeOrStat)=>stat根据 id, 节点数据或 stat, 获得对应的 stat.
allIds数组所有节点的 id.
rootIds数组树根级的所有节点的 id.
rootNodes数组树根级的所有节点的数据. 如果是树形数据, 它就是选项中的data.
rootStats数组树根级的所有节点的 stat.
placeholder{parentStat, index, level}拖拽时占位节点的信息. 占位节点不存在时为空.
draggingStatstat由此树发起拖拽时, 被拖拽的节点的 stat. 不存在时为空.
dragOverStatstat拖拽到其上面的节点. 可能为空.
visibleIds数组显示的所有节点的 id.
attrsList数组显示的所有节点的 attrs.
virtualListRefref虚拟列表组件的 ref, 参考虚拟列表.
scrollToNode(idOrNodeOrStat)=>boolean滚动到节点. 参数可以是 id, 节点数据或 stat. 如果节点未找到或未显示, 返回false. 例子

walkTreeDataGenerator

通过for of遍历树形数据的方法. 循环中执行skipChildren()将跳过该节点的所有子节点, 执行exitWalk将结束遍历.

ts
for (const [
+  node,
+  { parent, parents, siblings, index, skipChildren, exitWalk },
+] of walkTreeDataGenerator(data, "children")) {
+  // ...
+}

walkTreeData

通过回调方法遍历树形数据的方法. 回调方法中执行skipChildren()将跳过该节点的所有子节点, 执行exitWalk将结束遍历.

ts
walkTreeDataGenerator(
+  data,
+  (node, { parent, parents, siblings, index, skipChildren, exitWalk }) => {
+    // ...
+  },
+  "children"
+);

findTreeData

类似 Array.prototype.find. 返回找到的第一个节点. 回调方法中执行skipChildren()将跳过该节点的所有子节点, 执行exitWalk将结束遍历.

ts
let foundNode = findTreeData(
+  data,
+  (node, { parent, parents, siblings, index, skipChildren, exitWalk }) => {
+    // return node.id === 1;
+  },
+  "children"
+);

filterTreeData

类似 Array.prototype.filter. 返回找到的所有节点. 回调方法中执行skipChildren()将跳过该节点的所有子节点, 执行exitWalk将结束遍历.

ts
let nodes = filterTreeData(
+  data,
+  (node, { parent, parents, siblings, index, skipChildren, exitWalk }) => {
+    // return node.id > 1;
+  },
+  "children"
+);

openParentsInTreeData

打开单个或多个节点的所有父节点, 这样才能确保该节点可见. 参考.

(
+  treeData,
+  openIds: Id[],
+  idOrIds: Id | Id[],
+  options?: {idKey: string, childrenKey: string}
+): newOpenIds

updateCheckedInTreeData

更新单个节点或多个节点的checked状态. 这将同时更新它们的子节点和父节点. 参考.

(
+  treeData,
+  checkedIds: Id[],
+  idOrIds: Id | Id[],
+  checked: boolean,
+  options?: {idKey: string, childrenKey: string}
+): [newCheckedIds, newSemiCheckedIds]

sortFlatData

把扁平数据按照节点在树里的顺序排序. 返回排序后的新数组. 你的数据在初始化时应该使用它以保证顺序.

(
+  flatData,
+  options?: {idKey: string, parentIdKey: string}
+): sortedData

walkFlatDataGenerator

通过for of遍历扁平数据的方法. 循环中执行skipChildren()将跳过该节点的所有子节点, 执行exitWalk将结束遍历. 使用前需确保你的数据的顺序是正确的.

相比于walkTreeDataGenerator, 少了siblings, 多了 treeIndex, id, pid. treeIndex是节点在整个树中的索引.

ts
for (const [
+  node,
+  { parent, parents, index, treeIndex, id, pid, skipChildren, exitWalk },
+] of walkFlatDataGenerator(flatData, {
+  idKey: "id",
+  parentIdKey: "parent_id",
+})) {
+  // ...
+}

walkFlatData

通过回调方法遍历扁平数据的方法. 回调方法中执行skipChildren()将跳过该节点的所有子节点, 执行exitWalk将结束遍历. 使用前需确保你的数据的顺序是正确的.

ts
walkFlatData(
+  flatData,
+  (
+    node,
+    { parent, parents, index, treeIndex, id, pid, skipChildren, exitWalk }
+  ) => {
+    // ...
+  },
+  {
+    idKey: "id",
+    parentIdKey: "parent_id",
+  }
+);

openParentsInFlatData

打开单个或多个节点的所有父节点, 这样才能确保该节点可见. 用前需确保你的数据的顺序是正确的. 参考.

(
+  flatData,
+  openIds: Id[],
+  idOrIds: Id | Id[],
+  options?: {
+    idKey: "id",
+    parentIdKey: "parent_id",
+  }
+): newOpenIds

updateCheckedInFlatData

更新单个节点或多个节点的checked状态. 这将同时更新它们的子节点和父节点. 用前需确保你的数据的顺序是正确的. 参考.

(
+  flatData,
+  checkedIds: Id[],
+  idOrIds: Id | Id[],
+  checked: boolean,
+  options?: {
+    idKey: "id",
+    parentIdKey: "parent_id",
+  }
+): [newCheckedIds, newSemiCheckedIds]

convertIndexToTreeIndexInFlatData

通过某节点的父节点 id 和它在兄弟节点中的索引, 计算出它在整棵树中的索引.

(
+  flatData,
+  parentId: Id | null,
+  indexInSiblings: Id | null,
+  options?: {
+    idKey: "id",
+    parentIdKey: "parent_id",
+  }
+): treeIndex

addToFlatData

向扁平数据添加一个节点. 它会改变原数据数组. 所以推荐传入原始数据的拷贝, 或者与useImmer一起使用. 参考

(
+  flatData,
+  newNode,
+  index: Id | null,
+  options?: {
+    idKey: "id",
+    parentIdKey: "parent_id",
+  }
+):void

removeByIdInFlatData

从扁平数据删除一个节点. 返回被删除的数据. 它会改变原数据数组. 所以推荐传入原始数据的拷贝, 或者与useImmer一起使用. 参考

(
+  flatData,
+  removeId: Id | null,
+  options?: {
+    idKey: "id",
+    parentIdKey: "parent_id",
+  }
+): removedData

walkParentsGenerator

遍历另一种特殊数据的方法. 这种数据类似HTMLElement, 其中包含类似于parentElement的指向父节点的键.

(
+  node,
+  parentKeyOrGetter: string | ((node) => parent | undefined),
+  options?: {
+    withSelf: boolean;
+  }
+): Generator

parentKeyOrGetter可以是字符串或者返回父级的方法. options.withSelf表示是否包括传入的节点. 返回 Generator. 下面是遍历 HTMLElement 的例子:

ts
let el = document.querySelector("div");
+for (const parent of walkParentsGenerator(el, "parentElement", {
+  withSelf: true,
+})) {
+  // ...
+}

Stat

stat包括和节点有关的信息. 只读. 属性如下:

名称类型描述
_isStatboolean表明是否是 stat 对象
nodeobject节点的数据
idIdid
pidId, null节点的父级 id
parentobject, null父节点的数据
parentStatstat, null父节点的 stat
childIdsId[]子节点的 id 数组
childrenobject[]子节点数组
childStatsstat[]子节点的 stat 数组
siblingIdsId[]兄弟节点的 id 数组
siblingsobject[]兄弟节点数组
siblingStatsstat[]兄弟节点的 stat 数组
indexnumber节点在兄弟节点中的索引
levelnumber节点在树中的深度. 从 1 开始
openboolean是否展开
checkedboolean是否勾选
draggableboolean是否可拖动
`,64),d=[n];function l(p,h,r,k,o,c){return t(),s("div",null,d)}const y=a(i,[["render",l]]);export{g as __pageData,y as default}; diff --git a/assets/zh_v1_api.md.BHPyDvs2.lean.js b/assets/zh_v1_api.md.BHPyDvs2.lean.js new file mode 100644 index 0000000..398cf3e --- /dev/null +++ b/assets/zh_v1_api.md.BHPyDvs2.lean.js @@ -0,0 +1 @@ +import{_ as a,c as s,o as t,a5 as e}from"./chunks/framework.BthLuVtL.js";const g=JSON.parse('{"title":"API","description":"","frontmatter":{},"headers":[],"relativePath":"zh/v1/api.md","filePath":"zh/v1/api.md"}'),i={name:"zh/v1/api.md"},n=e("",64),d=[n];function l(p,h,r,k,o,c){return t(),s("div",null,d)}const y=a(i,[["render",l]]);export{g as __pageData,y as default}; diff --git a/assets/zh_v1_examples.md.N-IWpcWm.js b/assets/zh_v1_examples.md.N-IWpcWm.js new file mode 100644 index 0000000..6fc1a67 --- /dev/null +++ b/assets/zh_v1_examples.md.N-IWpcWm.js @@ -0,0 +1,715 @@ +import{_ as k,E as t,c as l,J as i,m as h,a as n,a5 as a,o as p}from"./chunks/framework.BthLuVtL.js";const w=JSON.parse('{"title":"示例","description":"","frontmatter":{},"headers":[],"relativePath":"zh/v1/examples.md","filePath":"zh/v1/examples.md"}'),E={name:"zh/v1/examples.md"},e=h("h1",{id:"示例",tabindex:"-1"},[n("示例 "),h("a",{class:"header-anchor",href:"#示例","aria-label":'Permalink to "示例"'},"​")],-1),d=h("h2",{id:"自定义样式",tabindex:"-1"},[n("自定义样式 "),h("a",{class:"header-anchor",href:"#自定义样式","aria-label":'Permalink to "自定义样式"'},"​")],-1),r=a(`

源代码

tsx
import { useHeTree, sortFlatData } from "he-tree-react";
+import { useState } from 'react';
+
+export default function BasePage() {
+  const keys = { idKey: 'id', parentIdKey: 'parent_id' };
+  const [data, setdata] = useState(() => sortFlatData([
+    {
+      id: 1,
+      parent_id: null,
+      name: "Root Category",
+    },
+    {
+      id: 2,
+      parent_id: 1,
+      name: "Technology",
+    },
+    {
+      id: 5,
+      parent_id: 2,
+      name: "Hardware",
+    },
+    {
+      id: 10,
+      parent_id: 5,
+      name: "Computer Components",
+    },
+    {
+      id: 4,
+      parent_id: 2,
+      name: "Programming",
+    },
+    {
+      id: 8,
+      parent_id: 4,
+      name: "Python",
+    },
+    {
+      id: 3,
+      parent_id: 1,
+      name: "Science",
+    },
+    {
+      id: 7,
+      parent_id: 3,
+      name: "Biology",
+    },
+    {
+      id: 6,
+      parent_id: 3,
+      name: "Physics",
+    },
+  ], keys));
+  const { renderTree, placeholder } = useHeTree({
+    ...keys,
+    data,
+    dataType: 'flat',
+    onChange: setdata,
+    renderNodeBox: ({ stat, attrs, isPlaceholder }) => (
+      <div {...attrs} key={attrs.key} className="my-node-box">
+        {isPlaceholder ? <div className="my-placeholder">DROP HERE</div>
+          : <div className="my-node">
+            <span className="drag-handler" draggable={stat.draggable}>{dragIcon()}</span>
+            {stat.node.name}
+          </div>
+        }
+      </div>
+    ),
+  })
+  return <>
+    <h3 style={{ margin: '0 0 0 110px', padding: '20px 0 0px' }}>Draggable Tree</h3>
+    <div>
+      {renderTree({ className: \`my-tree \${placeholder ? 'dragging' : 'no-dragging'}\` })}
+    </div>
+    <style>{\`
+    .my-tree{
+      width: 300px; 
+      border: 1px solid #ccc; 
+      border-radius: 5px;
+      margin: 20px; 
+      padding: 20px;
+    }
+    .my-placeholder{
+      height:40px;
+      border: 1px dashed blue;
+      border-radius: 3px;
+      background-color: #f3ffff;
+      display: flex;
+      align-items: center;
+      justify-content: center;
+      font-size: small;
+    }
+    /*.no-dragging .my-node-box:hover{
+      background-color: #eee;
+    }*/
+    .my-node-box:not(:last-child){
+      margin-bottom: 10px;
+    }
+    .my-node{
+      padding: 5px 10px;
+      padding-left: 30px;
+      border: 1px solid #e2e2e2;
+      border-radius: 3px;
+      background-color: #f0f0f0;
+      display: flex;
+      align-items: center;
+      position: relative;
+      box-shadow: 1px 1px 3px 0px rgb(0 0 0 / 19%);
+    }
+    .no-dragging .my-node:hover{
+      background-color: #ebfeff;
+    }
+    .drag-handler{
+      position: absolute;
+      left: 0;
+      top: 0;
+      width: 30px;
+      height: 100%;
+      display: flex;
+      align-items: center;
+      justify-content: center;
+      cursor: grab;
+    }
+    .drag-handler:hover{
+      background-color: #f0f0f0;
+    }
+    .my-node svg{
+      width:16px;
+    }
+    \`}</style>
+  </>
+}
+
+function dragIcon() {
+  return <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>drag-horizontal-variant</title><path d="M21 11H3V9H21V11M21 13H3V15H21V13Z" /></svg>
+}

扁平数据

`,3),g=a(`

源代码

tsx
import { useHeTree, sortFlatData } from "he-tree-react";
+import { useState } from 'react';
+
+export default function BasePage() {
+  const keys = { idKey: 'id', parentIdKey: 'parent_id' };
+  const [data, setdata] = useState(() => sortFlatData([
+    {
+      id: 1,
+      parent_id: null,
+      name: "Root Category",
+    },
+    {
+      id: 2,
+      parent_id: 1,
+      name: "Technology",
+    },
+    {
+      id: 5,
+      parent_id: 2,
+      name: "Hardware",
+    },
+    {
+      id: 10,
+      parent_id: 5,
+      name: "Computer Components",
+    },
+    {
+      id: 4,
+      parent_id: 2,
+      name: "Programming",
+    },
+    {
+      id: 8,
+      parent_id: 4,
+      name: "Python",
+    },
+    {
+      id: 3,
+      parent_id: 1,
+      name: "Science",
+    },
+    {
+      id: 7,
+      parent_id: 3,
+      name: "Biology",
+    },
+    {
+      id: 6,
+      parent_id: 3,
+      name: "Physics",
+    },
+  ], keys));
+  const { renderTree } = useHeTree({
+    ...keys,
+    data,
+    dataType: 'flat',
+    onChange: setdata,
+    renderNode: ({ id, node, open, checked }) => <div>
+      {node.name}
+    </div>,
+  })
+  return <div>
+    {renderTree({ style: { width: '300px', border: '1px solid #555', padding: '20px' } })}
+  </div>
+}

树形数据

`,3),y=a(`

源代码

tsx
import { useHeTree } from "he-tree-react";
+import { useState } from 'react';
+
+export default function BasePage() {
+  const [data, setdata] = useState(() => [
+    {
+      id: 1,
+      name: "Root Category",
+      children: [
+        {
+          id: 2,
+          name: "Technology",
+          children: [
+            {
+              id: 5,
+              name: "Hardware",
+              children: [
+                {
+                  id: 10,
+                  name: "Computer Components",
+                  children: [],
+                },
+              ],
+            },
+            {
+              id: 4,
+              name: "Programming",
+              children: [
+                {
+                  id: 8,
+                  name: "Python",
+                  children: [],
+                },
+              ],
+            },
+          ],
+        },
+        {
+          id: 3,
+          name: "Science",
+          children: [
+            {
+              id: 7,
+              name: "Biology",
+              children: [],
+            },
+            {
+              id: 6,
+              name: "Physics",
+              children: [],
+            },
+          ],
+        },
+      ],
+    },
+  ]);
+  const { renderTree } = useHeTree({
+    data,
+    dataType: 'tree',
+    childrenKey: 'children',
+    onChange: setdata,
+    renderNode: ({ id, node, open, checked }) => <div>
+      {node.name}
+    </div>,
+  })
+  return <div>
+    {renderTree({ style: { width: '300px', border: '1px solid #555', padding: '20px' } })}
+  </div>
+}

触发元素

`,3),F=a(`

源代码

tsx
import { useHeTree, sortFlatData } from "he-tree-react";
+import { useState } from 'react';
+
+export default function BasePage() {
+  const keys = { idKey: 'id', parentIdKey: 'parent_id' };
+  // prettier-ignore
+  const [data, setdata] = useState(() => sortFlatData([{ id: 1, parent_id: null, name: "Root Category", }, { id: 2, parent_id: 1, name: "Technology", }, { id: 5, parent_id: 2, name: "Hardware", }, { id: 10, parent_id: 5, name: "Computer Components", }, { id: 4, parent_id: 2, name: "Programming", }, { id: 8, parent_id: 4, name: "Python", }, { id: 3, parent_id: 1, name: "Science", }, { id: 7, parent_id: 3, name: "Biology", }, { id: 6, parent_id: 3, name: "Physics", },], keys));
+  const { renderTree } = useHeTree({
+    ...keys,
+    data,
+    dataType: 'flat',
+    onChange: setdata,
+    renderNode: ({ id, node, open, checked, draggable }) => <div>
+      <button draggable={draggable}>Drag</button>
+      {node.name}
+    </div>,
+  })
+  return <div>
+    {renderTree({ style: { width: '300px', border: '1px solid #555', padding: '20px' } })}
+  </div>
+}

占位元素

`,3),C=a(`

源代码

tsx
import { useHeTree, sortFlatData } from "he-tree-react";
+import { useState } from 'react';
+
+export default function BasePage() {
+  const keys = { idKey: 'id', parentIdKey: 'parent_id' };
+  // prettier-ignore
+  const [data, setdata] = useState(() => sortFlatData([{ id: 1, parent_id: null, name: "Root Category", }, { id: 2, parent_id: 1, name: "Technology", }, { id: 5, parent_id: 2, name: "Hardware", }, { id: 10, parent_id: 5, name: "Computer Components", }, { id: 4, parent_id: 2, name: "Programming", }, { id: 8, parent_id: 4, name: "Python", }, { id: 3, parent_id: 1, name: "Science", }, { id: 7, parent_id: 3, name: "Biology", }, { id: 6, parent_id: 3, name: "Physics", },], keys));
+  const { renderTree } = useHeTree({
+    ...keys,
+    data,
+    dataType: 'flat',
+    onChange: setdata,
+    renderNodeBox: ({ stat, attrs, isPlaceholder }) => (
+      <div {...attrs} key={attrs.key}>
+        {isPlaceholder ? <div className="my-drag-placeholder">drop here</div>
+          : <div className="mynode">{stat.node.name}</div>
+        }
+      </div>
+    ),
+  })
+  return <div>
+    {renderTree({ className: 'mytree', style: { width: '300px', border: '1px solid #555', padding: '20px' } })}
+    <style>{\`
+    .mytree [data-node-box]{
+      padding: 5px 0;
+    }
+    .mytree [data-node-box]:hover{
+      background-color: #eee;
+    }
+    .mytree .he-tree-drag-placeholder{
+      height: 30px;
+      line-height: 30px;
+      text-align: center;
+      border: 1px dashed red;
+    }
+    .mynode{
+      padding-left:5px;
+    }
+    \`}</style>
+  </div>
+}

展开

`,3),o=a(`

源代码

tsx
import { useHeTree, sortFlatData, openParentsInFlatData } from "he-tree-react";
+import type { Id } from "he-tree-react";
+import { useState } from 'react';
+
+export default function BasePage() {
+  const keys = { idKey: 'id', parentIdKey: 'parent_id' };
+  // prettier-ignore
+  const [data, setdata] = useState(() => sortFlatData([{ id: 1, parent_id: null, name: "Root Category", }, { id: 2, parent_id: 1, name: "Technology", }, { id: 5, parent_id: 2, name: "Hardware", }, { id: 10, parent_id: 5, name: "Computer Components", }, { id: 4, parent_id: 2, name: "Programming", }, { id: 8, parent_id: 4, name: "Python", }, { id: 3, parent_id: 1, name: "Science", }, { id: 7, parent_id: 3, name: "Biology", }, { id: 6, parent_id: 3, name: "Physics", },], keys));
+  const [openIds, setopenIds] = useState<Id[] | undefined>([]);
+  const handleOpen = (id: Id, open: boolean) => {
+    if (open) {
+      setopenIds([...(openIds || allIds), id]);
+    } else {
+      setopenIds((openIds || allIds).filter((i) => i !== id));
+    }
+  }
+  const { renderTree, allIds } = useHeTree({
+    ...keys,
+    data,
+    dataType: 'flat',
+    onChange: setdata,
+    openIds,
+    renderNode: ({ id, node, open, checked, draggable }) => <div>
+      <button onClick={() => handleOpen(id, !open)}>{open ? '-' : '+'}</button>
+      {node.name} - {id}
+    </div>,
+  })
+  return <div>
+    <button onClick={() => setopenIds(allIds)}>Open All</button>
+    <button onClick={() => setopenIds([])}>Close All</button>
+    <button onClick={() => setopenIds(openParentsInFlatData(data, openIds || allIds, 8, keys))}>Open 'Python'</button>
+    <button onClick={() => setopenIds(openParentsInFlatData(data, [], 8, keys))}>Only Open 'Python'</button>
+    {renderTree({ style: { width: '300px', border: '1px solid #555', padding: '20px' } })}
+  </div>
+}

勾选

`,3),c=a(`

源代码

tsx
import { useHeTree, sortFlatData, updateCheckedInFlatData } from "he-tree-react";
+import type { Id } from "he-tree-react";
+import { useState } from 'react';
+
+export default function BasePage() {
+  const keys = { idKey: 'id', parentIdKey: 'parent_id' };
+  // prettier-ignore
+  const [data, setdata] = useState(() => sortFlatData([{ id: 1, parent_id: null, name: "Root Category", }, { id: 2, parent_id: 1, name: "Technology", }, { id: 5, parent_id: 2, name: "Hardware", }, { id: 10, parent_id: 5, name: "Computer Components", }, { id: 4, parent_id: 2, name: "Programming", }, { id: 8, parent_id: 4, name: "Python", }, { id: 3, parent_id: 1, name: "Science", }, { id: 7, parent_id: 3, name: "Biology", }, { id: 6, parent_id: 3, name: "Physics", },], keys));
+  const [checkedIds, setcheckedIds] = useState<Id[]>([]);
+  const [semiCheckedIds, setsemiCheckedIds] = useState<Id[]>([]);
+  const handleChecked = (id: Id, checked: boolean) => {
+    const r = updateCheckedInFlatData(data, checkedIds, id, checked, keys);
+    setcheckedIds(r[0]);
+    setsemiCheckedIds(r[1]);
+  }
+  const { renderTree } = useHeTree({
+    ...keys,
+    data,
+    dataType: 'flat',
+    onChange: setdata,
+    checkedIds,
+    renderNode: ({ id, node, open, checked, draggable }) => <div>
+      <input type="checkbox" checked={checked || false} onChange={() => handleChecked(id, !checked)} />
+      {node.name} - {id}
+    </div>,
+  })
+  return <div>
+    Checked: {JSON.stringify(checkedIds)} <br />
+    Semi-Checked: {JSON.stringify(semiCheckedIds)}
+    {renderTree({ style: { width: '300px', border: '1px solid #555', padding: '20px' } })}
+  </div>
+}

拖拽控制

`,3),B=a(`

源代码

tsx
import { useHeTree, sortFlatData } from "he-tree-react";
+import { useState } from 'react';
+
+export default function BasePage() {
+  const keys = { idKey: 'id', parentIdKey: 'parent_id' };
+  // prettier-ignore
+  const [data, setdata] = useState(() => sortFlatData([{ id: 2, parent_id: 1, name: "Technology", }, { id: 5, parent_id: 2, name: "Hardware", }, { id: 10, parent_id: 5, name: "Computer Components", }, { id: 4, parent_id: 2, name: "Programming", }, { id: 8, parent_id: 4, name: "Python", }, { id: 3, parent_id: 1, name: "Science", }, { id: 7, parent_id: 3, name: "Biology", }, { id: 6, parent_id: 3, name: "Physics", },], keys));
+  const { renderTree } = useHeTree({
+    ...keys,
+    data,
+    dataType: 'flat',
+    onChange: setdata,
+    renderNode: ({ id, node, open, checked, draggable }) => <div>
+      {node.name} - {id}
+    </div>,
+    canDrag: ({ id }) => id === 2 ? true : (id === 3 ? false : undefined),
+    canDrop: ({ id }) => id === 3 ? true : (id === 2 ? false : undefined),
+    canDropToRoot: (index) => false,
+  })
+  return <div>
+    {renderTree({ style: { width: '300px', border: '1px solid #555', padding: '20px' } })}
+  </div>
+}

拖拽时打开

`,3),A=a(`

源代码

tsx
import { useHeTree, sortFlatData } from "he-tree-react";
+import type { Id } from "he-tree-react";
+import { useState } from 'react';
+
+export default function BasePage() {
+  const keys = { idKey: 'id', parentIdKey: 'parent_id' };
+  // prettier-ignore
+  const [data, setdata] = useState(() => sortFlatData([{ id: 1, parent_id: null, name: "Root Category", }, { id: 2, parent_id: 1, name: "Technology", }, { id: 5, parent_id: 2, name: "Hardware", }, { id: 10, parent_id: 5, name: "Computer Components", }, { id: 4, parent_id: 2, name: "Programming", }, { id: 8, parent_id: 4, name: "Python", }, { id: 3, parent_id: 1, name: "Science", }, { id: 7, parent_id: 3, name: "Biology", }, { id: 6, parent_id: 3, name: "Physics", },], keys));
+  const [openIds, setopenIds] = useState<Id[] | undefined>([1, 3]);
+  const handleOpen = (id: Id, open: boolean) => {
+    if (open) {
+      setopenIds([...(openIds || allIds), id]);
+    } else {
+      setopenIds((openIds || allIds).filter((i) => i !== id));
+    }
+  }
+  const { renderTree, allIds } = useHeTree({
+    ...keys,
+    data,
+    dataType: 'flat',
+    onChange: setdata,
+    openIds,
+    renderNode: ({ id, node, open, checked, draggable }) => <div>
+      <button onClick={() => handleOpen(id, !open)}>{open ? '-' : '+'}</button>
+      {node.name} - {id}
+    </div>,
+    dragOpen: true,
+    onDragOpen(stat) {
+      handleOpen(stat.id, true)
+    },
+  })
+  return <div>
+    {renderTree({ style: { width: '300px', border: '1px solid #555', padding: '20px' } })}
+  </div>
+}

更新扁平数据

`,3),D=a(`

源代码

tsx
import {
+  useHeTree, sortFlatData,
+  addToFlatData, removeByIdInFlatData
+} from "he-tree-react";
+import type { Id } from "he-tree-react";
+import { useRef, useState } from 'react';
+
+export default function BasePage() {
+  const keys = { idKey: 'id', parentIdKey: 'parent_id' };
+  // prettier-ignore
+  const [data, setdata] = useState(() => sortFlatData([{ id: 1, parent_id: null, name: "Root Category", }, { id: 2, parent_id: 1, name: "Technology", }, { id: 5, parent_id: 2, name: "Hardware", }, { id: 10, parent_id: 5, name: "Computer Components", }, { id: 4, parent_id: 2, name: "Programming", }, { id: 8, parent_id: 4, name: "Python", }, { id: 3, parent_id: 1, name: "Science", }, { id: 7, parent_id: 3, name: "Biology", }, { id: 6, parent_id: 3, name: "Physics", },], keys));
+  const add = (pid: Id) => {
+    let id = parseInt(Math.random().toString().substring(2, 5));
+    let newData = [...data];
+    addToFlatData(newData, { id, parent_id: pid as number, name: "New" }, 0, keys)
+    setdata(newData);
+  }
+  const remove = (id: Id) => {
+    let newData = [...data];
+    removeByIdInFlatData(newData, id as number, keys)
+    setdata(newData);
+  }
+  const initialData = useRef<typeof data>();
+  initialData.current = initialData.current || data;
+  const { renderTree } = useHeTree({
+    ...keys,
+    data,
+    dataType: 'flat',
+    onChange: setdata,
+    renderNode: ({ id, node, draggable }) => <div>
+      <button draggable={draggable}>👉</button>
+      {node.name} - {id} -
+      <button onClick={() => add(id)}>+</button>
+      <button onClick={() => remove(id)}>-</button>
+    </div>,
+  })
+  return <div>
+    <button onClick={() => setdata(initialData.current!)}>Restore</button>
+    {renderTree({ style: { width: '300px', border: '1px solid #555', padding: '20px' } })}
+  </div>
+}

更新扁平数据使用 immer

`,3),u=a(`

源代码

tsx
import {
+  useHeTree, sortFlatData,
+  addToFlatData, removeByIdInFlatData
+} from "he-tree-react";
+import type { Id } from "he-tree-react";
+import { useRef } from 'react';
+import { useImmer } from "use-immer";
+
+export default function BasePage() {
+  const keys = { idKey: 'id', parentIdKey: 'parent_id' };
+  // prettier-ignore
+  const [data, setdata] = useImmer(() => sortFlatData([{ id: 1, parent_id: null, name: "Root Category", }, { id: 2, parent_id: 1, name: "Technology", }, { id: 5, parent_id: 2, name: "Hardware", }, { id: 10, parent_id: 5, name: "Computer Components", }, { id: 4, parent_id: 2, name: "Programming", }, { id: 8, parent_id: 4, name: "Python", }, { id: 3, parent_id: 1, name: "Science", }, { id: 7, parent_id: 3, name: "Biology", }, { id: 6, parent_id: 3, name: "Physics", },], keys));
+  const add = (pid: Id) => {
+    let id = parseInt(Math.random().toString().substring(2, 5));
+    setdata(draft => {
+      addToFlatData(draft, { id, parent_id: pid as number, name: "New" }, 0, keys)
+    });
+  }
+  const remove = (id: Id) => {
+    setdata(draft => {
+      removeByIdInFlatData(draft, id as number, keys)
+    })
+  }
+  const edit = (id: Id) => {
+    let newName = prompt("Enter new name")
+    setdata(draft => {
+      if (newName) {
+        draft.find(node => node.id === id)!.name = newName
+      }
+    })
+  }
+  const initialData = useRef<typeof data>();
+  initialData.current = initialData.current || data;
+  const { renderTree } = useHeTree({
+    ...keys,
+    data,
+    dataType: 'flat',
+    onChange: setdata,
+    renderNode: ({ id, node, draggable }) => <div>
+      <button draggable={draggable}>👉</button>
+      {node.name} - {id} -
+      <button onClick={() => add(id)}>+</button>
+      <button onClick={() => remove(id)}>-</button>
+      <button onClick={() => edit(id)}>Edit</button>
+    </div>,
+  })
+  return <div>
+    <button onClick={() => setdata(initialData.current!)}>Restore</button>
+    {renderTree({ style: { width: '300px', border: '1px solid #555', padding: '20px' } })}
+  </div>
+}

更新树形数据使用 immer

`,3),m=a(`

源代码

tsx
import { useHeTree, findTreeData } from "he-tree-react";
+import type { Id } from "he-tree-react";
+import { useRef } from 'react';
+import { useImmer } from "use-immer";
+
+export default function BasePage() {
+  const CHILDREN = 'children'
+  const keys = { idKey: 'id', childrenKey: CHILDREN };
+  // prettier-ignore
+  const [data, setdata] = useImmer(() => [{ id: 1, name: "Root Category", children: [{ id: 2, name: "Technology", children: [{ id: 5, name: "Hardware", children: [{ id: 10, name: "Computer Components", children: [], },], }, { id: 4, name: "Programming", children: [{ id: 8, name: "Python", children: [], },], },], }, { id: 3, name: "Science", children: [{ id: 7, name: "Biology", children: [], }, { id: 6, name: "Physics", children: [], },], },], },]);
+  const add = (pid: Id) => {
+    let id = parseInt(Math.random().toString().substring(2, 5));
+    setdata(draft => {
+      findTreeData(draft, (node) => node.id === pid, CHILDREN)![CHILDREN].unshift({ id, name: "New", [CHILDREN]: [], })
+    })
+  }
+  const remove = (id: Id, pid: Id | null) => {
+    setdata(draft => {
+      const children = findTreeData(draft, (node,) => node.id === pid, CHILDREN)![CHILDREN]
+      children.splice(children.findIndex(t => t.id === id), 1)
+    })
+  }
+  const edit = (id: Id) => {
+    let newName = prompt("Enter new name")
+    setdata(draft => {
+      if (newName) {
+        findTreeData(draft, (node) => node.id === id, CHILDREN)!.name = newName
+      }
+    })
+  }
+  const initialData = useRef<typeof data>();
+  initialData.current = initialData.current || data;
+  const { renderTree } = useHeTree({
+    ...keys,
+    data,
+    dataType: 'tree',
+    onChange: setdata,
+    renderNode: ({ id, pid, node, draggable }) => <div>
+      <button draggable={draggable}>👉</button>
+      {node.name} - {id} -
+      <button onClick={() => add(id)}>+</button>
+      <button onClick={() => remove(id, pid)}>-</button>
+      <button onClick={() => edit(id)}>Edit</button>
+    </div>,
+  })
+  return <div>
+    <button onClick={() => setdata(initialData.current!)}>Restore</button>
+    {renderTree({ style: { width: '300px', border: '1px solid #555', padding: '20px' } })}
+  </div>
+}

外部拖拽交互

`,3),_=a(`

源代码

tsx
import { useHeTree, sortFlatData, addToFlatData } from "he-tree-react";
+import { useImmer } from "use-immer";
+
+export default function BasePage() {
+  const keys = { idKey: 'id', parentIdKey: 'parent_id' };
+  // prettier-ignore
+  const [data, setdata] = useImmer(() => sortFlatData([{ id: 1, parent_id: null, name: "Root Category", }, { id: 2, parent_id: 1, name: "Technology", }, { id: 5, parent_id: 2, name: "Hardware", }, { id: 10, parent_id: 5, name: "Computer Components", }, { id: 4, parent_id: 2, name: "Programming", }, { id: 8, parent_id: 4, name: "Python", }, { id: 3, parent_id: 1, name: "Science", }, { id: 7, parent_id: 3, name: "Biology", }, { id: 6, parent_id: 3, name: "Physics", },], keys));
+  const { renderTree, allIds } = useHeTree({
+    ...keys,
+    data,
+    dataType: 'flat',
+    onChange: setdata,
+    renderNode: ({ id, node, open, checked, draggable }) => <div>
+      {node.name} - {id}
+    </div>,
+    onExternalDragOver: (e) => true,
+    onExternalDrop: (e, parentStat, index) => {
+      setdata(draft => {
+        const newNode = { id: 100 + data.length, parent_id: parentStat?.id ?? null, name: "New Node" }
+        addToFlatData(draft, newNode, index, keys)
+      })
+    },
+  })
+  return <div>
+    <button draggable={true}>Drag me in to the tree</button>
+    {renderTree({ style: { width: '300px', border: '1px solid #555', padding: '20px' } })}
+  </div>
+}

大数据, 虚拟列表

`,3),q=a(`

源代码

tsx
import { useHeTree, sortFlatData } from "he-tree-react";
+import type { Id } from "he-tree-react";
+import { useState } from 'react';
+
+export default function BasePage() {
+  const keys = { idKey: 'id', parentIdKey: 'pid' };
+  // prettier-ignore
+  const [data, setdata] = useState(() => sortFlatData(createData(), keys));
+  const [openIds, setopenIds] = useState<Id[] | undefined>([]);
+  const handleOpen = (id: Id, open: boolean) => {
+    if (open) {
+      setopenIds([...(openIds || allIds), id]);
+    } else {
+      setopenIds((openIds || allIds).filter((i) => i !== id));
+    }
+  }
+  const { renderTree, allIds } = useHeTree({
+    ...keys,
+    data,
+    dataType: 'flat',
+    onChange: setdata,
+    openIds,
+    virtual: true,
+    renderNode: ({ id, node, open, checked, draggable }) => <div>
+      <button onClick={() => handleOpen(id, !open)}>{open ? '-' : '+'}</button>
+      {id}
+    </div>,
+  })
+  return <div>
+    {renderTree({ style: { width: '300px', height: '300px', border: '1px solid #555', padding: '20px' } })}
+  </div>
+}
+
+// generate 10000 nodes
+function createData() {
+  const genId = () => result.length
+  const result: { id: number, pid: number | null }[] = [];
+  for (let i = 0; i < 1000; i++) {
+    let id1 = genId()
+    result.push({ id: id1, pid: null })
+    for (let j = 0; j < 4; j++) {
+      result.push({ id: genId(), pid: id1 })
+    }
+    let id2 = genId()
+    result.push({ id: id2, pid: null })
+    for (let j = 0; j < 4; j++) {
+      result.push({ id: genId(), pid: id2 })
+    }
+  }
+  return result;
+}

滚动到节点

`,3),b=a(`

源代码

tsx
import { useHeTree, sortFlatData } from "he-tree-react";
+import type { Id } from "he-tree-react";
+import { useState } from 'react';
+
+export default function BasePage() {
+  const keys = { idKey: 'id', parentIdKey: 'pid' };
+  // prettier-ignore
+  const [data, setdata] = useState(() => sortFlatData(createData(), keys));
+  const [openIds, setopenIds] = useState<Id[] | undefined>([]);
+  const handleOpen = (id: Id, open: boolean) => {
+    if (open) {
+      setopenIds([...(openIds || allIds), id]);
+    } else {
+      setopenIds((openIds || allIds).filter((i) => i !== id));
+    }
+  }
+  const { renderTree, allIds, scrollToNode } = useHeTree({
+    ...keys,
+    data,
+    dataType: 'flat',
+    onChange: setdata,
+    openIds,
+    virtual: true,
+    renderNode: ({ id, node, open, checked, draggable }) => <div>
+      <button onClick={() => handleOpen(id, !open)}>{open ? '-' : '+'}</button>
+      {id}
+    </div>,
+  })
+  return <div>
+    <button onClick={() => scrollToNode(910)}>Scroll to 910</button>
+    {renderTree({ style: { width: '300px', height: '300px', border: '1px solid #555', padding: '20px' } })}
+  </div>
+}
+
+// generate 10000 nodes
+function createData() {
+  const genId = () => result.length
+  const result: { id: number, pid: number | null }[] = [];
+  for (let i = 0; i < 1000; i++) {
+    let id1 = genId()
+    result.push({ id: id1, pid: null })
+    for (let j = 0; j < 4; j++) {
+      result.push({ id: genId(), pid: id1 })
+    }
+    let id2 = genId()
+    result.push({ id: id2, pid: null })
+    for (let j = 0; j < 4; j++) {
+      result.push({ id: genId(), pid: id2 })
+    }
+  }
+  return result;
+}
`,2);function f(T,v,I,x,P,S){const s=t("DemoIframe");return p(),l("div",null,[e,d,i(s,{url:"/custom_style"}),r,i(s,{url:"/base_flat_data"}),g,i(s,{url:"/base_tree_data"}),y,i(s,{url:"/custom_drag_trigger_flat_data"}),F,i(s,{url:"/customize_placeholder_and_node_box"}),C,i(s,{url:"/open_ids"}),o,i(s,{url:"/checked_ids"}),c,i(s,{url:"/draggable_droppable"}),B,i(s,{url:"/dragopen"}),A,i(s,{url:"/update_data"}),D,i(s,{url:"/update_flat_data_with_immer"}),u,i(s,{url:"/update_tree_data_with_immer"}),m,i(s,{url:"/external_drag"}),_,i(s,{url:"/virtual_list"}),q,i(s,{url:"/scroll_to_node"}),b])}const H=k(E,[["render",f]]);export{w as __pageData,H as default}; diff --git a/assets/zh_v1_examples.md.N-IWpcWm.lean.js b/assets/zh_v1_examples.md.N-IWpcWm.lean.js new file mode 100644 index 0000000..13c7abe --- /dev/null +++ b/assets/zh_v1_examples.md.N-IWpcWm.lean.js @@ -0,0 +1 @@ +import{_ as k,E as t,c as l,J as i,m as h,a as n,a5 as a,o as p}from"./chunks/framework.BthLuVtL.js";const w=JSON.parse('{"title":"示例","description":"","frontmatter":{},"headers":[],"relativePath":"zh/v1/examples.md","filePath":"zh/v1/examples.md"}'),E={name:"zh/v1/examples.md"},e=h("h1",{id:"示例",tabindex:"-1"},[n("示例 "),h("a",{class:"header-anchor",href:"#示例","aria-label":'Permalink to "示例"'},"​")],-1),d=h("h2",{id:"自定义样式",tabindex:"-1"},[n("自定义样式 "),h("a",{class:"header-anchor",href:"#自定义样式","aria-label":'Permalink to "自定义样式"'},"​")],-1),r=a("",3),g=a("",3),y=a("",3),F=a("",3),C=a("",3),o=a("",3),c=a("",3),B=a("",3),A=a("",3),D=a("",3),u=a("",3),m=a("",3),_=a("",3),q=a("",3),b=a("",2);function f(T,v,I,x,P,S){const s=t("DemoIframe");return p(),l("div",null,[e,d,i(s,{url:"/custom_style"}),r,i(s,{url:"/base_flat_data"}),g,i(s,{url:"/base_tree_data"}),y,i(s,{url:"/custom_drag_trigger_flat_data"}),F,i(s,{url:"/customize_placeholder_and_node_box"}),C,i(s,{url:"/open_ids"}),o,i(s,{url:"/checked_ids"}),c,i(s,{url:"/draggable_droppable"}),B,i(s,{url:"/dragopen"}),A,i(s,{url:"/update_data"}),D,i(s,{url:"/update_flat_data_with_immer"}),u,i(s,{url:"/update_tree_data_with_immer"}),m,i(s,{url:"/external_drag"}),_,i(s,{url:"/virtual_list"}),q,i(s,{url:"/scroll_to_node"}),b])}const H=k(E,[["render",f]]);export{w as __pageData,H as default}; diff --git a/assets/zh_v1_guide.md.Cm8pKdlq.js b/assets/zh_v1_guide.md.Cm8pKdlq.js new file mode 100644 index 0000000..30ab8eb --- /dev/null +++ b/assets/zh_v1_guide.md.Cm8pKdlq.js @@ -0,0 +1,570 @@ +import{_ as h,E as n,c as k,J as a,a5 as s,o as t}from"./chunks/framework.BthLuVtL.js";const I=JSON.parse('{"title":"使用指南","description":"","frontmatter":{},"headers":[],"relativePath":"zh/v1/guide.md","filePath":"zh/v1/guide.md"}'),l={name:"zh/v1/guide.md"},p=s(`

使用指南

安装

sh
npm install he-tree-react
sh
pnpm add he-tree-react
sh
yarn add he-tree-react

数据类型

此库支持两种结构的数据:

  • 扁平数据, 即一个一维数组. 类似与存储在数据库中的数据. 每项需要id, 父级 id, null代表没有父级. 扁平数据的顺序必须跟树一样, 你可以在初始化数据时使用sortFlatData方法给数据排序.
    js
    [
    +  { id: 1, pid: null },
    +  { id: 2, pid: 1 },
    +  { id: 3, pid: 2 },
    +];
  • 树形数据. 使用children数组包含子节点. 如果未指定id, 此库将使用节点在树中的索引作为id. 使用树形数据时需设置dataType: 'tree'.
js
[
+  {
+    id: 1,
+    children: [
+      {
+        id: 2,
+        children: [{ id: 3 }],
+      },
+    ],
+  },
+];

数据中的id, pid, children不是固定的. 在设置中, 使用idKey, parentIdKey, childrenKey表明你的数据中的对应键名.

没有组件

此库没有导出组件,而是导出一个 hook useHeTree. 使用它返回的renderTree渲染树. 这样做的好处是除了renderTree, useHeTree还会返回一些内部状态和方法, 可以轻松的被获取.

js
import { useHeTree } from "he-tree-react";
+
+export default function App() {
+  const { renderTree } = useHeTree({...})
+  return <div>
+    {renderTree()}
+  </div>
+}

选项

useHeTree是主要使用的函数, 它的第一个参数是选项对象. 必须的选项有data, 必须两者中有一个的是renderNode, renderNodeBox. 其他重要选项是:

  • dataType, 表明数据类型. 可用值:
    • flat, 默认. 扁平数据.
    • tree, 树形数据.
  • idKey, parentIdKey, 默认值是idparent_id. 使用扁平数据时需要. 虽然有默认值, 但还是建议写明更好.
  • childrenKey, 默认是children. 使用树形数据时需要. 虽然有默认值, 但还是建议写明更好.
  • onChange, 数据改变时调用的函数, 参数是新数据. 如果你的树不会改变则不需要.
  • isFunctionReactive, 布尔. 默认false. useHeTree选项中包含许多回调函数, 如onChange, canDrop. isFunctionReactive可用来控制是否监听这些回调函数的改变. 如果你的回调函数和data是同步改变的, 则不用启用此项. 否则你需要启用此项, 并且用 React 的useCallbackuseMemo缓存你的所有回调函数以避免性能问题.

查看useHeTree的 API 文档以了解更多.

提示

  • stat, 单个节点的相关信息. 大部分回调函数的参数里有stat. 参考Stat API.
  • node, 节点的数据. 通过stat.node可以获取节点数据.
  • getStat, 通过此函数可以获取stat, 唯一参数可以是id, node, stat. 此函数在useHeTree的返回对象中: const {getStat} = useHeTree({...}).
  • 下面的代码例子附带有运行效果. 这些例子可以直接复制使用. 注意其中的高亮行的代码.
  • 下面的代码例子使用tsx格式, 如果你需要js格式, 可以使用任意 ts js 在线转换器.

基础使用-扁平数据

tsx
import { useHeTree, sortFlatData } from "he-tree-react";
+import { useState } from 'react';
+
+export default function BasePage() {
+  const keys = { idKey: 'id', parentIdKey: 'parent_id' };
+  const [data, setdata] = useState(() => sortFlatData([
+    {
+      id: 1,
+      parent_id: null,
+      name: "Root Category",
+    },
+    {
+      id: 2,
+      parent_id: 1,
+      name: "Technology",
+    },
+    {
+      id: 5,
+      parent_id: 2,
+      name: "Hardware",
+    },
+    {
+      id: 10,
+      parent_id: 5,
+      name: "Computer Components",
+    },
+    {
+      id: 4,
+      parent_id: 2,
+      name: "Programming",
+    },
+    {
+      id: 8,
+      parent_id: 4,
+      name: "Python",
+    },
+    {
+      id: 3,
+      parent_id: 1,
+      name: "Science",
+    },
+    {
+      id: 7,
+      parent_id: 3,
+      name: "Biology",
+    },
+    {
+      id: 6,
+      parent_id: 3,
+      name: "Physics",
+    },
+  ], keys));
+  const { renderTree } = useHeTree({
+    ...keys,
+    data,
+    dataType: 'flat',
+    onChange: setdata,
+    renderNode: ({ id, node, open, checked }) => <div>
+      {node.name}
+    </div>,
+  })
+  return <div>
+    {renderTree({ style: { width: '300px', border: '1px solid #555', padding: '20px' } })}
+  </div>
+}
`,19),E=s(`

基础使用-树形数据

tsx
import { useHeTree } from "he-tree-react";
+import { useState } from 'react';
+
+export default function BasePage() {
+  const [data, setdata] = useState(() => [
+    {
+      id: 1,
+      name: "Root Category",
+      children: [
+        {
+          id: 2,
+          name: "Technology",
+          children: [
+            {
+              id: 5,
+              name: "Hardware",
+              children: [
+                {
+                  id: 10,
+                  name: "Computer Components",
+                  children: [],
+                },
+              ],
+            },
+            {
+              id: 4,
+              name: "Programming",
+              children: [
+                {
+                  id: 8,
+                  name: "Python",
+                  children: [],
+                },
+              ],
+            },
+          ],
+        },
+        {
+          id: 3,
+          name: "Science",
+          children: [
+            {
+              id: 7,
+              name: "Biology",
+              children: [],
+            },
+            {
+              id: 6,
+              name: "Physics",
+              children: [],
+            },
+          ],
+        },
+      ],
+    },
+  ]);
+  const { renderTree } = useHeTree({
+    data,
+    dataType: 'tree',
+    childrenKey: 'children',
+    onChange: setdata,
+    renderNode: ({ id, node, open, checked }) => <div>
+      {node.name}
+    </div>,
+  })
+  return <div>
+    {renderTree({ style: { width: '300px', border: '1px solid #555', padding: '20px' } })}
+  </div>
+}
`,2),e=s(`

自定义拖拽触发元素

给节点任意子元素添加draggable属性即可.

tsx
import { useHeTree, sortFlatData } from "he-tree-react";
+import { useState } from 'react';
+
+export default function BasePage() {
+  const keys = { idKey: 'id', parentIdKey: 'parent_id' };
+  // prettier-ignore
+  const [data, setdata] = useState(() => sortFlatData([{ id: 1, parent_id: null, name: "Root Category", }, { id: 2, parent_id: 1, name: "Technology", }, { id: 5, parent_id: 2, name: "Hardware", }, { id: 10, parent_id: 5, name: "Computer Components", }, { id: 4, parent_id: 2, name: "Programming", }, { id: 8, parent_id: 4, name: "Python", }, { id: 3, parent_id: 1, name: "Science", }, { id: 7, parent_id: 3, name: "Biology", }, { id: 6, parent_id: 3, name: "Physics", },], keys));
+  const { renderTree } = useHeTree({
+    ...keys,
+    data,
+    dataType: 'flat',
+    onChange: setdata,
+    renderNode: ({ id, node, open, checked, draggable }) => <div>
+      <button draggable={draggable}>Drag</button>
+      {node.name}
+    </div>,
+  })
+  return <div>
+    {renderTree({ style: { width: '300px', border: '1px solid #555', padding: '20px' } })}
+  </div>
+}
`,3),d=s(`

节点 HTML 结构和样式

节点 HTML 如下:

html
<div
+  draggable="true"
+  data-key="1"
+  data-level="1"
+  data-node-box="true"
+  style="padding-left: 0px;"
+>
+  <div>Node</div>
+</div>

上面有两个 div. 使用renderNode选项控制内层 div 的渲染. 如: renderNode: ({node}) => <div>{node.name}</div>.

外层节点被称为nodeBox, 不要修改它的padding-left, padding-right. 使用选项indent控制节点的缩进. 如果你想控制nodeBox或拖拽占位节点的渲染, 可以使用renderNodeBox选项, 这将覆盖renderNode. 标准的renderNodeBox如下:

tsx
renderNodeBox: ({ stat, attrs, isPlaceholder }) => (
+  <div {...attrs} key={attrs.key}>
+    {isPlaceholder ? (
+      <div
+        className="he-tree-drag-placeholder"
+        style={{ minHeight: "20px", border: "1px dashed blue" }}
+      />
+    ) : (
+      <div>{/* node area */}</div>
+    )}
+  </div>
+);

第 4 到第 7 行是拖拽占位节点. 第 9 行是节点元素.

自定义拖拽占位节点和 node box

tsx
import { useHeTree, sortFlatData } from "he-tree-react";
+import { useState } from 'react';
+
+export default function BasePage() {
+  const keys = { idKey: 'id', parentIdKey: 'parent_id' };
+  // prettier-ignore
+  const [data, setdata] = useState(() => sortFlatData([{ id: 1, parent_id: null, name: "Root Category", }, { id: 2, parent_id: 1, name: "Technology", }, { id: 5, parent_id: 2, name: "Hardware", }, { id: 10, parent_id: 5, name: "Computer Components", }, { id: 4, parent_id: 2, name: "Programming", }, { id: 8, parent_id: 4, name: "Python", }, { id: 3, parent_id: 1, name: "Science", }, { id: 7, parent_id: 3, name: "Biology", }, { id: 6, parent_id: 3, name: "Physics", },], keys));
+  const { renderTree } = useHeTree({
+    ...keys,
+    data,
+    dataType: 'flat',
+    onChange: setdata,
+    renderNodeBox: ({ stat, attrs, isPlaceholder }) => (
+      <div {...attrs} key={attrs.key}>
+        {isPlaceholder ? <div className="my-drag-placeholder">drop here</div>
+          : <div className="mynode">{stat.node.name}</div>
+        }
+      </div>
+    ),
+  })
+  return <div>
+    {renderTree({ className: 'mytree', style: { width: '300px', border: '1px solid #555', padding: '20px' } })}
+    <style>{\`
+    .mytree [data-node-box]{
+      padding: 5px 0;
+    }
+    .mytree [data-node-box]:hover{
+      background-color: #eee;
+    }
+    .mytree .he-tree-drag-placeholder{
+      height: 30px;
+      line-height: 30px;
+      text-align: center;
+      border: 1px dashed red;
+    }
+    .mynode{
+      padding-left:5px;
+    }
+    \`}</style>
+  </div>
+}
`,9),r=s(`

节点的展开与折叠

  • 使用选项openIds表明展开的节点.
  • 可通过stat.open获取该节点的open状态.
  • useHeTree返回的allIds包含所有节点的 id.
  • 此库导出了方法可以展开单个或多个节点的所有父级. 扁平数据: openParentsInFlatData. 树形数据: openParentsInTreeData.
tsx
import { useHeTree, sortFlatData, openParentsInFlatData } from "he-tree-react";
+import type { Id } from "he-tree-react";
+import { useState } from 'react';
+
+export default function BasePage() {
+  const keys = { idKey: 'id', parentIdKey: 'parent_id' };
+  // prettier-ignore
+  const [data, setdata] = useState(() => sortFlatData([{ id: 1, parent_id: null, name: "Root Category", }, { id: 2, parent_id: 1, name: "Technology", }, { id: 5, parent_id: 2, name: "Hardware", }, { id: 10, parent_id: 5, name: "Computer Components", }, { id: 4, parent_id: 2, name: "Programming", }, { id: 8, parent_id: 4, name: "Python", }, { id: 3, parent_id: 1, name: "Science", }, { id: 7, parent_id: 3, name: "Biology", }, { id: 6, parent_id: 3, name: "Physics", },], keys));
+  const [openIds, setopenIds] = useState<Id[] | undefined>([]);
+  const handleOpen = (id: Id, open: boolean) => {
+    if (open) {
+      setopenIds([...(openIds || allIds), id]);
+    } else {
+      setopenIds((openIds || allIds).filter((i) => i !== id));
+    }
+  }
+  const { renderTree, allIds } = useHeTree({
+    ...keys,
+    data,
+    dataType: 'flat',
+    onChange: setdata,
+    openIds,
+    renderNode: ({ id, node, open, checked, draggable }) => <div>
+      <button onClick={() => handleOpen(id, !open)}>{open ? '-' : '+'}</button>
+      {node.name} - {id}
+    </div>,
+  })
+  return <div>
+    <button onClick={() => setopenIds(allIds)}>Open All</button>
+    <button onClick={() => setopenIds([])}>Close All</button>
+    <button onClick={() => setopenIds(openParentsInFlatData(data, openIds || allIds, 8, keys))}>Open 'Python'</button>
+    <button onClick={() => setopenIds(openParentsInFlatData(data, [], 8, keys))}>Only Open 'Python'</button>
+    {renderTree({ style: { width: '300px', border: '1px solid #555', padding: '20px' } })}
+  </div>
+}
`,3),g=s(`

此例子顶部 4 个按钮分别是: 展开全部, 折叠全部, 展开'Python'节点的所有父节点, 仅展开'Python'节点的所有父节点.

节点的勾选

  • 使用选项checkedIds表明勾选的节点.
  • 可通过stat.checked获取该节点的checked状态.
  • 此库导出了方法可以获取单个或多个节点checked变动后的checkedIds. 扁平数据: updateCheckedInFlatData. 树形数据: \`updateCheckedInTreeData.
    • 此方法对节点的checked的更新是级联的. 如果你不想级联更新, 使用你自己的逻辑替代.
    • 此方法返回一个长度 2 的数组. 第一项是所有勾选的 id, 第二项是所有半选的 id. 如果不需要半选, 忽略第二项.
    • 半选, 即同时有子节点被勾选或半选, 也有子节点未被勾选.
tsx
import { useHeTree, sortFlatData, updateCheckedInFlatData } from "he-tree-react";
+import type { Id } from "he-tree-react";
+import { useState } from 'react';
+
+export default function BasePage() {
+  const keys = { idKey: 'id', parentIdKey: 'parent_id' };
+  // prettier-ignore
+  const [data, setdata] = useState(() => sortFlatData([{ id: 1, parent_id: null, name: "Root Category", }, { id: 2, parent_id: 1, name: "Technology", }, { id: 5, parent_id: 2, name: "Hardware", }, { id: 10, parent_id: 5, name: "Computer Components", }, { id: 4, parent_id: 2, name: "Programming", }, { id: 8, parent_id: 4, name: "Python", }, { id: 3, parent_id: 1, name: "Science", }, { id: 7, parent_id: 3, name: "Biology", }, { id: 6, parent_id: 3, name: "Physics", },], keys));
+  const [checkedIds, setcheckedIds] = useState<Id[]>([]);
+  const [semiCheckedIds, setsemiCheckedIds] = useState<Id[]>([]);
+  const handleChecked = (id: Id, checked: boolean) => {
+    const r = updateCheckedInFlatData(data, checkedIds, id, checked, keys);
+    setcheckedIds(r[0]);
+    setsemiCheckedIds(r[1]);
+  }
+  const { renderTree } = useHeTree({
+    ...keys,
+    data,
+    dataType: 'flat',
+    onChange: setdata,
+    checkedIds,
+    renderNode: ({ id, node, open, checked, draggable }) => <div>
+      <input type="checkbox" checked={checked || false} onChange={() => handleChecked(id, !checked)} />
+      {node.name} - {id}
+    </div>,
+  })
+  return <div>
+    Checked: {JSON.stringify(checkedIds)} <br />
+    Semi-Checked: {JSON.stringify(semiCheckedIds)}
+    {renderTree({ style: { width: '300px', border: '1px solid #555', padding: '20px' } })}
+  </div>
+}
`,4),y=s(`

控制是否可拖拽, 可放入

使用以下选项控制:

tsx
import { useHeTree, sortFlatData } from "he-tree-react";
+import { useState } from 'react';
+
+export default function BasePage() {
+  const keys = { idKey: 'id', parentIdKey: 'parent_id' };
+  // prettier-ignore
+  const [data, setdata] = useState(() => sortFlatData([{ id: 2, parent_id: 1, name: "Technology", }, { id: 5, parent_id: 2, name: "Hardware", }, { id: 10, parent_id: 5, name: "Computer Components", }, { id: 4, parent_id: 2, name: "Programming", }, { id: 8, parent_id: 4, name: "Python", }, { id: 3, parent_id: 1, name: "Science", }, { id: 7, parent_id: 3, name: "Biology", }, { id: 6, parent_id: 3, name: "Physics", },], keys));
+  const { renderTree } = useHeTree({
+    ...keys,
+    data,
+    dataType: 'flat',
+    onChange: setdata,
+    renderNode: ({ id, node, open, checked, draggable }) => <div>
+      {node.name} - {id}
+    </div>,
+    canDrag: ({ id }) => id === 2 ? true : (id === 3 ? false : undefined),
+    canDrop: ({ id }) => id === 3 ? true : (id === 2 ? false : undefined),
+    canDropToRoot: (index) => false,
+  })
+  return <div>
+    {renderTree({ style: { width: '300px', border: '1px solid #555', padding: '20px' } })}
+  </div>
+}
`,4),F=s(`
  • 根节点不可放入.
  • Technology及子节点可以拖拽. Science及子节点不可以拖拽.
  • Science及子节点可以放入. Technology及子节点不可以放入.

拖拽到节点上时打开节点

使用以下选项控制:

tsx
import { useHeTree, sortFlatData } from "he-tree-react";
+import type { Id } from "he-tree-react";
+import { useState } from 'react';
+
+export default function BasePage() {
+  const keys = { idKey: 'id', parentIdKey: 'parent_id' };
+  // prettier-ignore
+  const [data, setdata] = useState(() => sortFlatData([{ id: 1, parent_id: null, name: "Root Category", }, { id: 2, parent_id: 1, name: "Technology", }, { id: 5, parent_id: 2, name: "Hardware", }, { id: 10, parent_id: 5, name: "Computer Components", }, { id: 4, parent_id: 2, name: "Programming", }, { id: 8, parent_id: 4, name: "Python", }, { id: 3, parent_id: 1, name: "Science", }, { id: 7, parent_id: 3, name: "Biology", }, { id: 6, parent_id: 3, name: "Physics", },], keys));
+  const [openIds, setopenIds] = useState<Id[] | undefined>([1, 3]);
+  const handleOpen = (id: Id, open: boolean) => {
+    if (open) {
+      setopenIds([...(openIds || allIds), id]);
+    } else {
+      setopenIds((openIds || allIds).filter((i) => i !== id));
+    }
+  }
+  const { renderTree, allIds } = useHeTree({
+    ...keys,
+    data,
+    dataType: 'flat',
+    onChange: setdata,
+    openIds,
+    renderNode: ({ id, node, open, checked, draggable }) => <div>
+      <button onClick={() => handleOpen(id, !open)}>{open ? '-' : '+'}</button>
+      {node.name} - {id}
+    </div>,
+    dragOpen: true,
+    onDragOpen(stat) {
+      handleOpen(stat.id, true)
+    },
+  })
+  return <div>
+    {renderTree({ style: { width: '300px', border: '1px solid #555', padding: '20px' } })}
+  </div>
+}
`,5),o=s(`

更新数据

由于 React 的不可变特性, 扁平数据和树形数据更新都很困难. 针对扁平数据, 此库提供了两个方法, 用以增加节点或删除节点. 如果你要进行更复杂的操作, 或者更新树形数据, 推荐你使用immer.

sh
npm install immer use-immer
sh
pnpm add immer use-immer
sh
yarn add immer use-immer

使用内置方法更新扁平数据

addToFlatData: 增加节点. removeByIdInFlatData: 删除节点. 这两个方法都会改变原数据, 所以把原数据的复制传给它, 或者与immer一起使用.

tsx
import {
+  useHeTree, sortFlatData,
+  addToFlatData, removeByIdInFlatData
+} from "he-tree-react";
+import type { Id } from "he-tree-react";
+import { useRef, useState } from 'react';
+
+export default function BasePage() {
+  const keys = { idKey: 'id', parentIdKey: 'parent_id' };
+  // prettier-ignore
+  const [data, setdata] = useState(() => sortFlatData([{ id: 1, parent_id: null, name: "Root Category", }, { id: 2, parent_id: 1, name: "Technology", }, { id: 5, parent_id: 2, name: "Hardware", }, { id: 10, parent_id: 5, name: "Computer Components", }, { id: 4, parent_id: 2, name: "Programming", }, { id: 8, parent_id: 4, name: "Python", }, { id: 3, parent_id: 1, name: "Science", }, { id: 7, parent_id: 3, name: "Biology", }, { id: 6, parent_id: 3, name: "Physics", },], keys));
+  const add = (pid: Id) => {
+    let id = parseInt(Math.random().toString().substring(2, 5));
+    let newData = [...data];
+    addToFlatData(newData, { id, parent_id: pid as number, name: "New" }, 0, keys)
+    setdata(newData);
+  }
+  const remove = (id: Id) => {
+    let newData = [...data];
+    removeByIdInFlatData(newData, id as number, keys)
+    setdata(newData);
+  }
+  const initialData = useRef<typeof data>();
+  initialData.current = initialData.current || data;
+  const { renderTree } = useHeTree({
+    ...keys,
+    data,
+    dataType: 'flat',
+    onChange: setdata,
+    renderNode: ({ id, node, draggable }) => <div>
+      <button draggable={draggable}>👉</button>
+      {node.name} - {id} -
+      <button onClick={() => add(id)}>+</button>
+      <button onClick={() => remove(id)}>-</button>
+    </div>,
+  })
+  return <div>
+    <button onClick={() => setdata(initialData.current!)}>Restore</button>
+    {renderTree({ style: { width: '300px', border: '1px solid #555', padding: '20px' } })}
+  </div>
+}
`,6),c=s(`

使用 immer 更新扁平数据

注意, 这里使用了useImmer替代 React 的useState.

tsx
import {
+  useHeTree, sortFlatData,
+  addToFlatData, removeByIdInFlatData
+} from "he-tree-react";
+import type { Id } from "he-tree-react";
+import { useRef } from 'react';
+import { useImmer } from "use-immer";
+
+export default function BasePage() {
+  const keys = { idKey: 'id', parentIdKey: 'parent_id' };
+  // prettier-ignore
+  const [data, setdata] = useImmer(() => sortFlatData([{ id: 1, parent_id: null, name: "Root Category", }, { id: 2, parent_id: 1, name: "Technology", }, { id: 5, parent_id: 2, name: "Hardware", }, { id: 10, parent_id: 5, name: "Computer Components", }, { id: 4, parent_id: 2, name: "Programming", }, { id: 8, parent_id: 4, name: "Python", }, { id: 3, parent_id: 1, name: "Science", }, { id: 7, parent_id: 3, name: "Biology", }, { id: 6, parent_id: 3, name: "Physics", },], keys));
+  const add = (pid: Id) => {
+    let id = parseInt(Math.random().toString().substring(2, 5));
+    setdata(draft => {
+      addToFlatData(draft, { id, parent_id: pid as number, name: "New" }, 0, keys)
+    });
+  }
+  const remove = (id: Id) => {
+    setdata(draft => {
+      removeByIdInFlatData(draft, id as number, keys)
+    })
+  }
+  const edit = (id: Id) => {
+    let newName = prompt("Enter new name")
+    setdata(draft => {
+      if (newName) {
+        draft.find(node => node.id === id)!.name = newName
+      }
+    })
+  }
+  const initialData = useRef<typeof data>();
+  initialData.current = initialData.current || data;
+  const { renderTree } = useHeTree({
+    ...keys,
+    data,
+    dataType: 'flat',
+    onChange: setdata,
+    renderNode: ({ id, node, draggable }) => <div>
+      <button draggable={draggable}>👉</button>
+      {node.name} - {id} -
+      <button onClick={() => add(id)}>+</button>
+      <button onClick={() => remove(id)}>-</button>
+      <button onClick={() => edit(id)}>Edit</button>
+    </div>,
+  })
+  return <div>
+    <button onClick={() => setdata(initialData.current!)}>Restore</button>
+    {renderTree({ style: { width: '300px', border: '1px solid #555', padding: '20px' } })}
+  </div>
+}
`,3),C=s(`

使用 immer 更新树形数据

注意, 这里使用了useImmer替代 React 的useState. findTreeData方法类似数组的find方法.

tsx
import { useHeTree, findTreeData } from "he-tree-react";
+import type { Id } from "he-tree-react";
+import { useRef } from 'react';
+import { useImmer } from "use-immer";
+
+export default function BasePage() {
+  const CHILDREN = 'children'
+  const keys = { idKey: 'id', childrenKey: CHILDREN };
+  // prettier-ignore
+  const [data, setdata] = useImmer(() => [{ id: 1, name: "Root Category", children: [{ id: 2, name: "Technology", children: [{ id: 5, name: "Hardware", children: [{ id: 10, name: "Computer Components", children: [], },], }, { id: 4, name: "Programming", children: [{ id: 8, name: "Python", children: [], },], },], }, { id: 3, name: "Science", children: [{ id: 7, name: "Biology", children: [], }, { id: 6, name: "Physics", children: [], },], },], },]);
+  const add = (pid: Id) => {
+    let id = parseInt(Math.random().toString().substring(2, 5));
+    setdata(draft => {
+      findTreeData(draft, (node) => node.id === pid, CHILDREN)![CHILDREN].unshift({ id, name: "New", [CHILDREN]: [], })
+    })
+  }
+  const remove = (id: Id, pid: Id | null) => {
+    setdata(draft => {
+      const children = findTreeData(draft, (node,) => node.id === pid, CHILDREN)![CHILDREN]
+      children.splice(children.findIndex(t => t.id === id), 1)
+    })
+  }
+  const edit = (id: Id) => {
+    let newName = prompt("Enter new name")
+    setdata(draft => {
+      if (newName) {
+        findTreeData(draft, (node) => node.id === id, CHILDREN)!.name = newName
+      }
+    })
+  }
+  const initialData = useRef<typeof data>();
+  initialData.current = initialData.current || data;
+  const { renderTree } = useHeTree({
+    ...keys,
+    data,
+    dataType: 'tree',
+    onChange: setdata,
+    renderNode: ({ id, pid, node, draggable }) => <div>
+      <button draggable={draggable}>👉</button>
+      {node.name} - {id} -
+      <button onClick={() => add(id)}>+</button>
+      <button onClick={() => remove(id, pid)}>-</button>
+      <button onClick={() => edit(id)}>Edit</button>
+    </div>,
+  })
+  return <div>
+    <button onClick={() => setdata(initialData.current!)}>Restore</button>
+    {renderTree({ style: { width: '300px', border: '1px solid #555', padding: '20px' } })}
+  </div>
+}
`,3),B=s(`

从外部发起的拖拽

相关选项:

tsx
import { useHeTree, sortFlatData, addToFlatData } from "he-tree-react";
+import { useImmer } from "use-immer";
+
+export default function BasePage() {
+  const keys = { idKey: 'id', parentIdKey: 'parent_id' };
+  // prettier-ignore
+  const [data, setdata] = useImmer(() => sortFlatData([{ id: 1, parent_id: null, name: "Root Category", }, { id: 2, parent_id: 1, name: "Technology", }, { id: 5, parent_id: 2, name: "Hardware", }, { id: 10, parent_id: 5, name: "Computer Components", }, { id: 4, parent_id: 2, name: "Programming", }, { id: 8, parent_id: 4, name: "Python", }, { id: 3, parent_id: 1, name: "Science", }, { id: 7, parent_id: 3, name: "Biology", }, { id: 6, parent_id: 3, name: "Physics", },], keys));
+  const { renderTree, allIds } = useHeTree({
+    ...keys,
+    data,
+    dataType: 'flat',
+    onChange: setdata,
+    renderNode: ({ id, node, open, checked, draggable }) => <div>
+      {node.name} - {id}
+    </div>,
+    onExternalDragOver: (e) => true,
+    onExternalDrop: (e, parentStat, index) => {
+      setdata(draft => {
+        const newNode = { id: 100 + data.length, parent_id: parentStat?.id ?? null, name: "New Node" }
+        addToFlatData(draft, newNode, index, keys)
+      })
+    },
+  })
+  return <div>
+    <button draggable={true}>Drag me in to the tree</button>
+    {renderTree({ style: { width: '300px', border: '1px solid #555', padding: '20px' } })}
+  </div>
+}
`,4),A=s(`

超大数据

使用选项virtual启用虚拟列表功能. 记得给树设置可见区域高度.

tsx
import { useHeTree, sortFlatData } from "he-tree-react";
+import type { Id } from "he-tree-react";
+import { useState } from 'react';
+
+export default function BasePage() {
+  const keys = { idKey: 'id', parentIdKey: 'pid' };
+  // prettier-ignore
+  const [data, setdata] = useState(() => sortFlatData(createData(), keys));
+  const [openIds, setopenIds] = useState<Id[] | undefined>([]);
+  const handleOpen = (id: Id, open: boolean) => {
+    if (open) {
+      setopenIds([...(openIds || allIds), id]);
+    } else {
+      setopenIds((openIds || allIds).filter((i) => i !== id));
+    }
+  }
+  const { renderTree, allIds } = useHeTree({
+    ...keys,
+    data,
+    dataType: 'flat',
+    onChange: setdata,
+    openIds,
+    virtual: true,
+    renderNode: ({ id, node, open, checked, draggable }) => <div>
+      <button onClick={() => handleOpen(id, !open)}>{open ? '-' : '+'}</button>
+      {id}
+    </div>,
+  })
+  return <div>
+    {renderTree({ style: { width: '300px', height: '300px', border: '1px solid #555', padding: '20px' } })}
+  </div>
+}
+
+// generate 10000 nodes
+function createData() {
+  const genId = () => result.length
+  const result: { id: number, pid: number | null }[] = [];
+  for (let i = 0; i < 1000; i++) {
+    let id1 = genId()
+    result.push({ id: id1, pid: null })
+    for (let j = 0; j < 4; j++) {
+      result.push({ id: genId(), pid: id1 })
+    }
+    let id2 = genId()
+    result.push({ id: id2, pid: null })
+    for (let j = 0; j < 4; j++) {
+      result.push({ id: genId(), pid: id2 })
+    }
+  }
+  return result;
+}
`,3),u=s('

触摸 & 移动设备

此库基于 HTML5 Drag and Drop API, 所以在支持 Drag and Drop API 的移动设备上能工作. 如果不支持, 可以尝试添加兼容 Drag and Drop API 的库.

注意

触摸时, 用户需要触摸并等一会儿才能触发拖拽。

其他

',5);function D(m,_,q,b,v,f){const i=n("DemoIframe");return t(),k("div",null,[p,a(i,{url:"/base_flat_data"}),E,a(i,{url:"/base_tree_data"}),e,a(i,{url:"/custom_drag_trigger_flat_data"}),d,a(i,{url:"/customize_placeholder_and_node_box"}),r,a(i,{url:"/open_ids"}),g,a(i,{url:"/checked_ids"}),y,a(i,{url:"/draggable_droppable"}),F,a(i,{url:"/dragopen"}),o,a(i,{url:"/update_data"}),c,a(i,{url:"/update_flat_data_with_immer"}),C,a(i,{url:"/update_tree_data_with_immer"}),B,a(i,{url:"/external_drag"}),A,a(i,{url:"/virtual_list"}),u])}const x=h(l,[["render",D]]);export{I as __pageData,x as default}; diff --git a/assets/zh_v1_guide.md.Cm8pKdlq.lean.js b/assets/zh_v1_guide.md.Cm8pKdlq.lean.js new file mode 100644 index 0000000..c1e8f0a --- /dev/null +++ b/assets/zh_v1_guide.md.Cm8pKdlq.lean.js @@ -0,0 +1 @@ +import{_ as h,E as n,c as k,J as a,a5 as s,o as t}from"./chunks/framework.BthLuVtL.js";const I=JSON.parse('{"title":"使用指南","description":"","frontmatter":{},"headers":[],"relativePath":"zh/v1/guide.md","filePath":"zh/v1/guide.md"}'),l={name:"zh/v1/guide.md"},p=s("",19),E=s("",2),e=s("",3),d=s("",9),r=s("",3),g=s("",4),y=s("",4),F=s("",5),o=s("",6),c=s("",3),C=s("",3),B=s("",4),A=s("",3),u=s("",5);function D(m,_,q,b,v,f){const i=n("DemoIframe");return t(),k("div",null,[p,a(i,{url:"/base_flat_data"}),E,a(i,{url:"/base_tree_data"}),e,a(i,{url:"/custom_drag_trigger_flat_data"}),d,a(i,{url:"/customize_placeholder_and_node_box"}),r,a(i,{url:"/open_ids"}),g,a(i,{url:"/checked_ids"}),y,a(i,{url:"/draggable_droppable"}),F,a(i,{url:"/dragopen"}),o,a(i,{url:"/update_data"}),c,a(i,{url:"/update_flat_data_with_immer"}),C,a(i,{url:"/update_tree_data_with_immer"}),B,a(i,{url:"/external_drag"}),A,a(i,{url:"/virtual_list"}),u])}const x=h(l,[["render",D]]);export{I as __pageData,x as default}; diff --git a/hashmap.json b/hashmap.json new file mode 100644 index 0000000..43a1348 --- /dev/null +++ b/hashmap.json @@ -0,0 +1 @@ +{"zh_v1_api.md":"BHPyDvs2","zh_v1_examples.md":"N-IWpcWm","v1_api.md":"8ChaXgfD","zh_index.md":"Ct9xdv7q","index.md":"Dnn-p8GL","v1_examples.md":"DA1MhYZf","v1_guide.md":"DSikYvGc","zh_v1_guide.md":"Cm8pKdlq"} diff --git a/index.html b/index.html new file mode 100644 index 0000000..37bd354 --- /dev/null +++ b/index.html @@ -0,0 +1,26 @@ + + + + + + He Tree React + + + + + + + + + + + + + + + +
Skip to content

He Tree React

React draggable sortable tree component

Features

  • Drag with a customizable placeholder.
  • The height of the node is not fixed.
  • Based on HTML Drag and Drop API.
  • Both flat data and tree-shaped data supported.
  • Drag from external.
  • Open or expand. Open node when drag onto it.
  • Checked, semi-checked.
  • Big data, virtual list.
  • Examples for update data.
  • rtl, display from right to left.
+ + + + \ No newline at end of file diff --git a/v1-demo-windowed/assets/HeTree-B-DJf59j.js b/v1-demo-windowed/assets/HeTree-B-DJf59j.js new file mode 100644 index 0000000..e4e8ea4 --- /dev/null +++ b/v1-demo-windowed/assets/HeTree-B-DJf59j.js @@ -0,0 +1,10 @@ +import{J as Ee,r as p,j as ue}from"./index-BNKuAD6d.js";/*! + * helper-js v3.1.5 + * Author: phphe (https://github.com/phphe) + * Homepage: null + * Released under the MIT License. + */function Re(t,e){return t2&&arguments[2]!==void 0?arguments[2]:{},r=o&&o.withSelf?t:t.parentElement;for(;r;){const a=o.until&&r===o.until;if(a&&!o.withUntil)return;const u=e(r);if(u==="break")return;if(u)return r;if(a)return;r=r.parentElement}}function Le(t,e){let o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};o={start:0,end:t.length-1,maxTimes:1e3,...o};let{start:r,end:a}=o;const{returnNearestIfNoHit:u,maxTimes:h}=o;let s,i;r==null&&(r=0,a=t.length-1);let d=0,I;for(;r>=0&&r<=a;){if(d>=h)throw Error("binarySearch: loop times is over ".concat(h,", you can increase the limit."));s=Math.floor((a-r)/2+r),i=t[s];const w=d+1;if(I=e(i,s,w),I>0)a=s-1;else if(I<0)r=s+1;else return{index:s,value:i,count:w,hit:!0};d++}return u?{index:s,value:i,count:d+1,hit:!1,greater:I>0}:null}/*! + * react-base-virtual-list + * Author: phphe (https://github.com/phphe) + * Released under the MIT License. + */const Ae=Ee.forwardRef,Ke={listSize:1e3,virtual:!0},ke=Ae(function(t,e){var o,r;const[a,u]=p.useState(t.itemSize||100),h=p.useMemo(()=>t.buffer||Math.max(a*5,100),[t.buffer,a]),s=t.items.length,i=p.useRef(null),d=p.useRef(null),I=p.useRef(0),w=p.useRef(),[K,P]=p.useState([]),[C,M]=p.useState(0),[x,R]=p.useState(t.listSize),[v,B]=p.useState([]),q=p.useRef(!1),W=p.useMemo(()=>{var N;const k=a*s;let L=C-h,j=k-C-x-h,J=0,Q=0;L<=0?(L=0,J=0):J=Math.floor(L/a),j<0&&(j=0),k<=x?Q=s:Q=s-Math.floor(j/a),t.virtual||(J=0,Q=s);let Z=Array.from({length:Q-J},(z,S)=>S+J).concat(t.persistentIndices||[]);return(N=t.persistentIndices)!=null&&N.length&&(Z=[...new Set(Z)].sort((z,S)=>z-S)),{visible:Z.map(z=>t.items[z]),visibleIndices:Z,topSpace:L,bottomSpace:j,totalSpace:k}},[t.items,a,s,C,h,x,t.virtual,t.persistentIndices]),{visible:G,visibleIndices:U,topSpace:m,bottomSpace:te,totalSpace:ie}=W,ce={paddingTop:`${m}px`,boxSizing:"border-box"};te{if(i.current&&(R(i.current.clientHeight),t.itemSize==null)){const N=d.current;let k=parseFloat(getComputedStyle(N).rowGap);k=isNaN(k)?0:k;let L=0,j=0;const J=new Set(t.persistentIndices||[]);let Q=-1;for(const Z of N.children){if(Q++,J.has(U[Q]))continue;const z=getComputedStyle(Z);z.display!=="none"&&(z.position!=="static"&&z.position!=="relative"||(j+=Z.offsetHeight+parseFloat(z.marginTop)+parseFloat(z.marginBottom)+k,L++))}u(j/L)}},[t.itemSize,t.items,v]);const fe=function(N){var k;if(t.virtual&&!w.current){if(R(i.current.clientHeight),q.current)q.current=!1;else{const L=i.current.scrollTop;Math.abs(I.current-L)>(t.triggerDistance??a)&&(M(L),I.current=L)}(k=t.onScroll)==null||k.call(this,N)}};return p.useImperativeHandle(e,()=>({scrollToIndex(N,k="start"){w.current={index:N,block:k};const L=N*a;i.current.scrollTop=L,M(L),I.current=L,P([])},getRootElement(){return i.current},forceUpdate(){B([])}}),[a]),p.useLayoutEffect(()=>{if(w.current){const{index:N,block:k}=w.current;w.current=void 0;const L=U.indexOf(N),j=d.current.children[L];j&&(j.scrollIntoView({block:k}),q.current=!0)}},[K]),p.useLayoutEffect(()=>{const{ResizeObserver:N}=window,k=N&&new N(()=>{R(i.current.clientHeight)});return k==null||k.observe(i.current),()=>{k==null||k.disconnect()}},[]),ue.jsxs("div",{ref:i,onScroll:fe,className:t.className,style:{overflow:"auto",...t.style},children:[(o=t.renderHead)==null?void 0:o.call(t),ue.jsx("div",{ref:d,style:{display:"flex",flexDirection:"column",...t.virtual&&ce},children:G.map((N,k)=>t.renderItem(N,U[k]))}),(r=t.renderFoot)==null?void 0:r.call(t)]})});ke.defaultProps=Ke;const de={id:null,x:0,y:0,time:0},Be={idKey:"id",parentIdKey:"parent_id",childrenKey:"children",indent:20,dragOpen:!1,dragOpenDelay:600,placeholderId:"__DRAG_PLACEHOLDER__",dataType:"flat",direction:"ltr",rootId:null,virtual:!1};function Ve(t){const e={...Be,...t},{idKey:o,parentIdKey:r,childrenKey:a,placeholderId:u,isFunctionReactive:h}=e,s={idKey:o,parentIdKey:r};if(!e.renderNode&&!e.renderNodeBox)throw new Error("Either renderNodeBox or renderNode is required.");const i=e.direction==="rtl",d=p.useMemo(()=>e.openIds?[...e.openIds].sort().toString():void 0,[e.openIds]),I=p.useMemo(()=>new Set(e.openIds),[d]),w=p.useMemo(()=>e.checkedIds?[...e.checkedIds].sort().toString():"",[e.checkedIds]),K=p.useMemo(()=>new Set(e.checkedIds),[w]),P=p.useMemo(()=>{var he,pe;const S={},V={},H=[],$=[],Y=[],le=[];function*ge(){if(e.dataType==="flat")for(const n of e.data)yield[n];else for(const n of xe(e.data,a))yield n}let re=0;for(const[n,c]of ge()){const l=n[o]??re;le.push(l);let f=n[r];e.dataType==="tree"&&(f=((he=c.parent)==null?void 0:he[o])??null);let A=V[f]||null;const O=S[f]||null,D=[],g=[],b=[];let y,T,E;O?(y=O.childIds,T=O.children,E=O.childStats):(y=H,T=$,E=Y);const X=y.length,F=(O==null?void 0:O.level)+1||1,_={_isStat:!0,id:l,pid:f,childIds:D,siblingIds:y,node:n,parent:A,parentStat:O,children:g,childStats:b,siblings:T,siblingStats:E,index:X,level:F,open:e.openIds?I.has(l):!0,checked:K.has(l),draggable:!1};S[l]=_,V[l]=n,y.push(l),T.push(n),E.push(_),re++}for(const[n]of xe(Y,"childStats")){let c=((pe=e.canDrag)==null?void 0:pe.call(e,n))??null;c===null&&(c=n.parentStat?n.parentStat.draggable:!0),n.draggable=c}return{rootIds:H,rootNodes:$,rootStats:Y,allIds:le,getStat:n=>{let c;return typeof n=="object"?c=n._isStat?n.id:n[o]:c=n,S[c]}}},[e.data,e.dataType,o,r,I,K,h&&e.canDrag]),{rootIds:C,rootStats:M,getStat:x}=P,R=e.indent,[v,B]=p.useState(),[q,W]=p.useState(),G=p.useRef(null),U=p.useRef(null),[m,te]=p.useState(),ie=!v,ce=p.useMemo(()=>{const S=[],V=[];for(const[n,{skipChildren:c}]of xe(M,"childStats")){const l=H(n);n===v&&(Object.assign(l.style,{position:"fixed",top:0,left:0,pointerEvents:"none",zIndex:"-999999999",visibility:"hidden"}),l["data-dragging"]=!0),V.push(l),S.push(n.id),(!n.open||n===v)&&c()}if(m){const c=((f,A)=>{let O=((f==null?void 0:f.childStats)||M)[A],D;if(O)D=S.indexOf(O.id);else{const g=y=>y.siblingStats[y.siblingStats.indexOf(y)+1];let b;if(f){for(const y of we(f,"parentStat",{withSelf:!0}))if(b=g(y),b)break}b?D=S.indexOf(b.id):D=S.length}return D})(m.parentStat,m.index);S.splice(c,0,u);const l=H({id:u,level:m.level},!0);l["data-drag-placeholder"]=!0,V.splice(c,0,l)}function H(n,c=!1){return{key:n.id,draggable:n.draggable,style:{[`padding${i?"Right":"Left"}`]:(n.level-1)*R+"px"},"data-key":n.id+"","data-level":n.level+"","data-node-box":!0,onDragStart(l){var D;if(c){l.preventDefault();return}let f;const A=Me(l.target,g=>(!f&&g.hasAttribute("draggable")&&(f=g),g.hasAttribute("data-node-box")),{withSelf:!0});if(A.querySelector("[draggable]")&&f===A){l.preventDefault();return}if(l.dataTransfer.setData("text/plain","he-tree he-tree-react"),l.dataTransfer.dropEffect="move",e.customDragImage)e.customDragImage(l,n);else{const g=A.children[0];l.dataTransfer.setDragImage(g,i?g.offsetWidth:0,0)}setTimeout(()=>{var g;B(n),te({...m,parentStat:n.parentStat,level:n.level,index:(((g=n.parentStat)==null?void 0:g.childIds)||C).indexOf(n.id)})},0),(D=e.onDragStart)==null||D.call(e,l,n)},onDragLeave(l){}}}const $=n=>{var A,O,D;if(ie&&!((A=e.onExternalDragOver)!=null&&A.call(e,n)))return;const c=l();if(c){const g=x(c.getAttribute("data-key")),b=!!c.getAttribute("data-drag-placeholder");f(g,b)&&e.onDragOpen(g);let y=Se(g,b);const{closest:T,next:E}=y;let{atTop:X}=y;const F=U.current,_=c;let ye=(()=>{let oe=_.getBoundingClientRect(),ee;return i?ee=Math.ceil((oe.right-n.clientX)/R):ee=Math.ceil((n.clientX-oe.x)/R),Ne(ee,0,((T==null?void 0:T.level)||0)+1)})();if(!X&&!b&&T.id===C[0]){const oe=F.querySelector(`[data-key="${T.id}"]`);if(oe){const ee=oe.getBoundingClientRect();X=ee.y+ee.height/2>n.clientY}}X&&(ye=0);let Ie;if(X)re(null,0)&&(Ie={...m,parentStat:null,level:1,index:0});else{const oe=E?E.level-1:0,ee=[],me=[];let ne=T;const De=()=>ne?ne.level:0;for(;De()>=oe;){const be=he(ne,E);if(re(ne,be)&&(ye>De()?ee:me).unshift({parentStat:ne,index:be}),!ne)break;ne=ne.parentStat}let se=Ce(ee);se||(se=Pe(me)),se&&(Ie={...m,parentStat:se.parentStat,level:(((O=se.parentStat)==null?void 0:O.level)??0)+1,index:se.index})}te(Ie),Ie&&n.preventDefault(),W(b?void 0:g),(D=e.onDragOver)==null||D.call(e,n,g,ie)}else re(null,0)&&(te({...m,parentStat:null,level:1,index:0}),n.preventDefault());function l(){const b=U.current.querySelectorAll("[data-node-box]:not([data-dragging])"),y=Le(b,E=>E.getBoundingClientRect().top-n.clientY,{returnNearestIfNoHit:!0});let T;return y.hit||y.greater&&(T=y.index-1,T<0&&(T=0)),T==null&&(T=y.index),b[T]}function f(g,b){if(!e.dragOpen||b||g.open)return!1;const y=()=>Object.assign(de,{id:g.id,x:n.clientX,y:n.clientY,time:Date.now()});if(de.id!==g.id||ze(n.clientX,n.clientY,de.x,de.y)>10)return y(),!1;if(Date.now()-de.time>=e.dragOpenDelay)return!0}},Y=n=>{var c,l;if(!(ie&&!((c=e.onExternalDragOver)!=null&&c.call(e,n)))&&m&&(n.preventDefault(),ie)){const{index:f}=m;(l=e.onExternalDrop)==null||l.call(e,n,m.parentStat,f),ge()}};function le(n){var f,A;if(!v)return;let c=!m;if(!c){let D=U.current.getBoundingClientRect();c=!(n.clientX>=D.left&&n.clientX<=D.right&&n.clientY>=D.top&&n.clientY<=D.bottom)}if(!(((f=e.onDragEnd)==null?void 0:f.call(e,n,v,c))===!1)&&m){let O=m.index;m.parentStat===v.parentStat&&v.index{if(!E)return D;const X=b(E.parentStat);let F=[...E.children];const _=g.get(E.node)||{...E.node,[a]:F};return g.set(E.node,_),F=_[a],X[E.index]=_,F},y=b(v.parentStat),T=m.parentStat===v.parentStat?y:b(m.parentStat);y.splice(v.index,1),T.splice(O,0,v.node)}e.onChange(D)}ge()}function ge(){W(void 0),B(void 0),te(void 0)}function re(n,c){var f,A;if(!n)return((f=e.canDropToRoot)==null?void 0:f.call(e,c))??!0;if(!n.open)return!1;let l=(A=e.canDrop)==null?void 0:A.call(e,n,c);return l==null&&(l=re(n.parentStat)),l}function Se(n,c){let l=n,f=S.indexOf(c?e.placeholderId:n.id),A=!1;const O=E=>E===u||x(E)===v,D=(E,X)=>{let F=E,_;do F+=X,_=S[F];while(_&&O(_));return{id:_,i:F}},g=(E,X)=>{const F=D(E,X);l=x(F.id),f=F.i},b=1;c&&(g(f,-1),l||(A=!0,g(-1,b)));const T=x(D(f,b).id);return{closest:l,atTop:A,next:T}}function he(n,c){const l=n?n.childStats:M;let f=l.length;return c&&c.siblingStats===l&&(f=l.indexOf(c)),f}function pe(n,c="start"){const l=x(n);if(!l)return!1;let f=S.indexOf(l.id);return f===-1?!1:G.current?(G.current.scrollToIndex(f,c),!0):!1}return{visibleIds:S,attrsList:V,onDragOverRoot:$,onDropToRoot:Y,onDragEndOnRoot:le,scrollToNode:pe}},[P,R,v,m==null?void 0:m.parentStat,m==null?void 0:m.index,R,u,i,e.rootId,...[e.canDrop,e.canDropToRoot,e.customDragImage,e.onDragStart,e.onDragOver,e.onExternalDragOver,e.onExternalDrop,e.onDragEnd,e.onChange,e.onDragOpen].map(S=>h&&S)]),fe=p.useMemo(()=>({getEl:()=>window,onDragOverWindow:S=>{V()||(W(void 0),e.keepPlaceholder||te(void 0));function V(){let H=!1,$=S.target;if($){for(const Y of we($,"parentElement",{withSelf:!0}))if(Y===U.current){H=!0;break}}return H}}}),[e.keepPlaceholder]);He(fe.getEl,"dragover",fe.onDragOverWindow);const{visibleIds:N,attrsList:k,onDragOverRoot:L,onDropToRoot:j,onDragEndOnRoot:J,scrollToNode:Q}=ce,Z=p.useMemo(()=>v?[N.indexOf(v.id)]:[],[v,N]),z=S=>{let V=e.renderNodeBox;if(!V){const H=ue.jsx("div",{className:"he-tree-drag-placeholder",style:{minHeight:"20px",border:"1px dashed blue"}});V=({stat:$,attrs:Y,isPlaceholder:le})=>p.createElement("div",{...Y,key:Y.key},le?H:e.renderNode($))}return ue.jsx("div",{className:`he-tree ${(S==null?void 0:S.className)||""}`,style:S==null?void 0:S.style,ref:U,onDragOver:L,onDrop:j,onDragEnd:J,children:ue.jsx(ke,{ref:G,items:N,virtual:e.virtual,persistentIndices:Z,style:{height:"100%"},renderItem:(H,$)=>V({stat:x(H),attrs:k[$],isPlaceholder:H===u})})})};return{...P,visibleIds:N,attrsList:k,virtualListRef:G,draggingStat:v,dragOverStat:q,placeholder:m,renderTree:z,renderHeTree:z,scrollToNode:Q}}function*xe(t,e="children"){let o=!1,r=!1;const a=()=>{o=!0},u=()=>{r=!0};yield*h(t,null,[]);function*h(s,i,d){let I=0;for(const w of s){if(yield[w,{parent:i,parents:d,siblings:s,index:I,skipChildren:a,exitWalk:u}],r)return;if(I++,o)o=!1;else{const P=w[e];if(P&&(yield*h(P,w,[...d,w]),r))return}}}}function Xe(t,e,o="children"){for(const r of xe(t,o))if(e(...r))return r[0]}function*we(t,e,o={withSelf:!1}){let r=t;for(;r;)(r!==t||o.withSelf)&&(yield r),r=typeof e=="function"?e(r):r[e]}function We(t,e){const o={...ae,...e},{idKey:r,parentIdKey:a}=o,u=new Map;u.set(null,[]);const h=u.get(null);for(const i of t){const d=i[r];u.set(d,[])}for(const i of t){const d=i[a];(u.get(d)||h).push(i)}function*s(i){for(const d of i){yield d;const I=d[r];yield*s(u.get(I))}}return[...s(h)]}const ae={idKey:"id",parentIdKey:"parent_id"};function*ve(t,e){const o={...ae,...e},{idKey:r,parentIdKey:a}=o;let u=!1,h=!1;const s=()=>{u=!0},i=()=>{h=!0},d={},I={},w={},K=[];let P,C=0;for(const M of t){const x=M[r],R=M[a]??null;d[x]=M;const v=d[R]||null;w[x]=[];const B=v?w[R]:K,q=B.length;B.push(x);const W={parent:v,parents:v?[...I[R].parents,v]:[],index:q,id:x,pid:R,treeIndex:C,skipChildren:s,exitWalk:i};I[x]=W;let G=!1;if(u&&P&&(P.has(R)?(P.add(x),G=!0):(u=!1,P=void 0)),!G){if(yield[M,W],h)break;u&&(P=new Set([x]))}C++}}function Te(t,e,o,r){const a={...ae,...r},{idKey:u,parentIdKey:h}=a;let s=!1,i=-1;for(const[d,{treeIndex:I,skipChildren:w,index:K}]of ve(t,a))if(e!=null&&!s)d[u]===e&&(s=!0);else if(e==null||d[h]===e)if(o!=null&&o===K){i=I;break}else w();else{i=I;break}return i===-1&&(i=t.length),i}function $e(t,e,o,r){const a={...ae,...r},{idKey:u,parentIdKey:h}=a,s=e[h]??null,i=Te(t,s,o,a);t.splice(i,0,e)}function Fe(t,e,o){if(e==null)return t.splice(0,t.length);const r={...ae,...o},{idKey:a,parentIdKey:u}=r;let h=-1,s=-1;for(const[i,{treeIndex:d,skipChildren:I}]of ve(t,r))if(h===-1)i[a]===e&&(h=d,I());else{s=d;break}return s===-1&&(s=t.length),h===-1?[]:t.splice(h,s-h)}function Ye(t,e,o,r){const a={...ae,...r},{idKey:u,parentIdKey:h}=a,s=new Set(e),i=Array.isArray(o)?o:[o],d=new Set(i);if(d.size>0)for(const[I,{parents:w}]of ve(t,a)){const K=I[u];if(d.has(K)){for(const P of w)s.add(P[u]);if(d.delete(K),d.size===0)break}}return Array.from(s).sort()}function qe(t,e,o,r,a){const u=new Set(e),h=Array.isArray(o)?o:[o],s=new Map,i=new Set(h),d=new Map,I=[];d.set(null,I);for(const[C,{parents:M,id:x,pid:R}]of ve(t,a))d.get(R).push(x),d.set(x,[]),s.set(x,u.has(x)),(i.has(x)||R&&i.has(R))&&(s.set(x,r),i.add(x));const w=C=>{const M=d.get(C);if(!M||M.length===0)return s.get(C);let x=!1,R=!1,v=!1;for(const q of M){let W=w(q);W===!1?R=!0:W===null?v=!0:x=!0}let B;return v||R&&x?B=null:R?B=!1:B=!0,s.set(C,B),B};for(const C of I)w(C);const K=[],P=[];return s.forEach((C,M)=>{C===!0?K.push(M):C===null&&P.push(M)}),[K.sort(),P.sort()]}function ze(t,e,o,r){return Math.sqrt(Math.pow(o-t,2)+Math.pow(r-e,2))}function He(t,e,o){p.useLayoutEffect(()=>{const r=t();return r==null||r.addEventListener(e,o),()=>{r==null||r.removeEventListener(e,o)}},[t,e,o])}export{qe as a,$e as b,Xe as f,Ye as o,Fe as r,We as s,Ve as u}; diff --git a/v1-demo-windowed/assets/base_flat_data-BHMljvlY.js b/v1-demo-windowed/assets/base_flat_data-BHMljvlY.js new file mode 100644 index 0000000..809aec7 --- /dev/null +++ b/v1-demo-windowed/assets/base_flat_data-BHMljvlY.js @@ -0,0 +1 @@ +import{r as i,j as a}from"./index-BNKuAD6d.js";import{s as o,u as s}from"./HeTree-B-DJf59j.js";function _(){const e={idKey:"id",parentIdKey:"parent_id"},[n,d]=i.useState(()=>o([{id:1,parent_id:null,name:"Root Category"},{id:2,parent_id:1,name:"Technology"},{id:5,parent_id:2,name:"Hardware"},{id:10,parent_id:5,name:"Computer Components"},{id:4,parent_id:2,name:"Programming"},{id:8,parent_id:4,name:"Python"},{id:3,parent_id:1,name:"Science"},{id:7,parent_id:3,name:"Biology"},{id:6,parent_id:3,name:"Physics"}],e)),{renderTree:t}=s({...e,data:n,dataType:"flat",onChange:d,renderNode:({id:p,node:r,open:m,checked:c})=>a.jsx("div",{children:r.name})});return a.jsx("div",{children:t({style:{width:"300px",border:"1px solid #555",padding:"20px"}})})}export{_ as default}; diff --git a/v1-demo-windowed/assets/base_tree_data-ImaopUth.js b/v1-demo-windowed/assets/base_tree_data-ImaopUth.js new file mode 100644 index 0000000..2f3f840 --- /dev/null +++ b/v1-demo-windowed/assets/base_tree_data-ImaopUth.js @@ -0,0 +1 @@ +import{r as a,j as e}from"./index-BNKuAD6d.js";import{u as o}from"./HeTree-B-DJf59j.js";function l(){const[n,d]=a.useState(()=>[{id:1,name:"Root Category",children:[{id:2,name:"Technology",children:[{id:5,name:"Hardware",children:[{id:10,name:"Computer Components",children:[]}]},{id:4,name:"Programming",children:[{id:8,name:"Python",children:[]}]}]},{id:3,name:"Science",children:[{id:7,name:"Biology",children:[]},{id:6,name:"Physics",children:[]}]}]}]),{renderTree:r}=o({data:n,dataType:"tree",childrenKey:"children",onChange:d,renderNode:({id:t,node:i,open:c,checked:s})=>e.jsx("div",{children:i.name})});return e.jsx("div",{children:r({style:{width:"300px",border:"1px solid #555",padding:"20px"}})})}export{l as default}; diff --git a/v1-demo-windowed/assets/checked_ids-CIHCriBZ.js b/v1-demo-windowed/assets/checked_ids-CIHCriBZ.js new file mode 100644 index 0000000..7b43b88 --- /dev/null +++ b/v1-demo-windowed/assets/checked_ids-CIHCriBZ.js @@ -0,0 +1 @@ +import{r,j as a}from"./index-BNKuAD6d.js";import{s as u,u as y,a as x}from"./HeTree-B-DJf59j.js";function f(){const t={idKey:"id",parentIdKey:"parent_id"},[i,c]=r.useState(()=>u([{id:1,parent_id:null,name:"Root Category"},{id:2,parent_id:1,name:"Technology"},{id:5,parent_id:2,name:"Hardware"},{id:10,parent_id:5,name:"Computer Components"},{id:4,parent_id:2,name:"Programming"},{id:8,parent_id:4,name:"Python"},{id:3,parent_id:1,name:"Science"},{id:7,parent_id:3,name:"Biology"},{id:6,parent_id:3,name:"Physics"}],t)),[n,p]=r.useState([]),[m,h]=r.useState([]),l=(e,d)=>{const s=x(i,n,e,d,t);p(s[0]),h(s[1])},{renderTree:g}=y({...t,data:i,dataType:"flat",onChange:c,checkedIds:n,renderNode:({id:e,node:d,open:s,checked:o,draggable:C})=>a.jsxs("div",{children:[a.jsx("input",{type:"checkbox",checked:o||!1,onChange:()=>l(e,!o)}),d.name," - ",e]})});return a.jsxs("div",{children:["Checked: ",JSON.stringify(n)," ",a.jsx("br",{}),"Semi-Checked: ",JSON.stringify(m),g({style:{width:"300px",border:"1px solid #555",padding:"20px"}})]})}export{f as default}; diff --git a/v1-demo-windowed/assets/custom_drag_trigger_flat_data-7wB0GH25.js b/v1-demo-windowed/assets/custom_drag_trigger_flat_data-7wB0GH25.js new file mode 100644 index 0000000..674d0ad --- /dev/null +++ b/v1-demo-windowed/assets/custom_drag_trigger_flat_data-7wB0GH25.js @@ -0,0 +1 @@ +import{r as o,j as e}from"./index-BNKuAD6d.js";import{s,u as p}from"./HeTree-B-DJf59j.js";function y(){const a={idKey:"id",parentIdKey:"parent_id"},[n,t]=o.useState(()=>s([{id:1,parent_id:null,name:"Root Category"},{id:2,parent_id:1,name:"Technology"},{id:5,parent_id:2,name:"Hardware"},{id:10,parent_id:5,name:"Computer Components"},{id:4,parent_id:2,name:"Programming"},{id:8,parent_id:4,name:"Python"},{id:3,parent_id:1,name:"Science"},{id:7,parent_id:3,name:"Biology"},{id:6,parent_id:3,name:"Physics"}],a)),{renderTree:d}=p({...a,data:n,dataType:"flat",onChange:t,renderNode:({id:m,node:r,open:c,checked:l,draggable:i})=>e.jsxs("div",{children:[e.jsx("button",{draggable:i,children:"Drag"}),r.name]})});return e.jsx("div",{children:d({style:{width:"300px",border:"1px solid #555",padding:"20px"}})})}export{y as default}; diff --git a/v1-demo-windowed/assets/custom_style-D_9Sq9cn.js b/v1-demo-windowed/assets/custom_style-D_9Sq9cn.js new file mode 100644 index 0000000..e4fe140 --- /dev/null +++ b/v1-demo-windowed/assets/custom_style-D_9Sq9cn.js @@ -0,0 +1,56 @@ +import{r as d,j as e}from"./index-BNKuAD6d.js";import{s as p,u as g}from"./HeTree-B-DJf59j.js";function h(){const r={idKey:"id",parentIdKey:"parent_id"},[o,i]=d.useState(()=>p([{id:1,parent_id:null,name:"Root Category"},{id:2,parent_id:1,name:"Technology"},{id:5,parent_id:2,name:"Hardware"},{id:10,parent_id:5,name:"Computer Components"},{id:4,parent_id:2,name:"Programming"},{id:8,parent_id:4,name:"Python"},{id:3,parent_id:1,name:"Science"},{id:7,parent_id:3,name:"Biology"},{id:6,parent_id:3,name:"Physics"}],r)),{renderTree:t,placeholder:s}=g({...r,data:o,dataType:"flat",onChange:i,renderNodeBox:({stat:a,attrs:n,isPlaceholder:l})=>d.createElement("div",{...n,key:n.key,className:"my-node-box"},l?e.jsx("div",{className:"my-placeholder",children:"DROP HERE"}):e.jsxs("div",{className:"my-node",children:[e.jsx("span",{className:"drag-handler",draggable:a.draggable,children:c()}),a.node.name]}))});return e.jsxs(e.Fragment,{children:[e.jsx("h3",{style:{margin:"0 0 0 110px",padding:"20px 0 0px"},children:"Draggable Tree"}),e.jsx("div",{children:t({className:`my-tree ${s?"dragging":"no-dragging"}`})}),e.jsx("style",{children:` + .my-tree{ + width: 300px; + border: 1px solid #ccc; + border-radius: 5px; + margin: 20px; + padding: 20px; + } + .my-placeholder{ + height:40px; + border: 1px dashed blue; + border-radius: 3px; + background-color: #f3ffff; + display: flex; + align-items: center; + justify-content: center; + font-size: small; + } + /*.no-dragging .my-node-box:hover{ + background-color: #eee; + }*/ + .my-node-box:not(:last-child){ + margin-bottom: 10px; + } + .my-node{ + padding: 5px 10px; + padding-left: 30px; + border: 1px solid #e2e2e2; + border-radius: 3px; + background-color: #f0f0f0; + display: flex; + align-items: center; + position: relative; + box-shadow: 1px 1px 3px 0px rgb(0 0 0 / 19%); + } + .no-dragging .my-node:hover{ + background-color: #ebfeff; + } + .drag-handler{ + position: absolute; + left: 0; + top: 0; + width: 30px; + height: 100%; + display: flex; + align-items: center; + justify-content: center; + cursor: grab; + } + .drag-handler:hover{ + background-color: #f0f0f0; + } + .my-node svg{ + width:16px; + } + `})]})}function c(){return e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[e.jsx("title",{children:"drag-horizontal-variant"}),e.jsx("path",{d:"M21 11H3V9H21V11M21 13H3V15H21V13Z"})]})}export{h as default}; diff --git a/v1-demo-windowed/assets/customize_placeholder_and_node_box-LD6y-60m.js b/v1-demo-windowed/assets/customize_placeholder_and_node_box-LD6y-60m.js new file mode 100644 index 0000000..7b1635e --- /dev/null +++ b/v1-demo-windowed/assets/customize_placeholder_and_node_box-LD6y-60m.js @@ -0,0 +1,17 @@ +import{r,j as e}from"./index-BNKuAD6d.js";import{s as p,u as m}from"./HeTree-B-DJf59j.js";function x(){const a={idKey:"id",parentIdKey:"parent_id"},[n,t]=r.useState(()=>p([{id:1,parent_id:null,name:"Root Category"},{id:2,parent_id:1,name:"Technology"},{id:5,parent_id:2,name:"Hardware"},{id:10,parent_id:5,name:"Computer Components"},{id:4,parent_id:2,name:"Programming"},{id:8,parent_id:4,name:"Python"},{id:3,parent_id:1,name:"Science"},{id:7,parent_id:3,name:"Biology"},{id:6,parent_id:3,name:"Physics"}],a)),{renderTree:i}=m({...a,data:n,dataType:"flat",onChange:t,renderNodeBox:({stat:o,attrs:d,isPlaceholder:s})=>r.createElement("div",{...d,key:d.key},s?e.jsx("div",{className:"my-drag-placeholder",children:"drop here"}):e.jsx("div",{className:"mynode",children:o.node.name}))});return e.jsxs("div",{children:[i({className:"mytree",style:{width:"300px",border:"1px solid #555",padding:"20px"}}),e.jsx("style",{children:` + .mytree [data-node-box]{ + padding: 5px 0; + } + .mytree [data-node-box]:hover{ + background-color: #eee; + } + .mytree .he-tree-drag-placeholder{ + height: 30px; + line-height: 30px; + text-align: center; + border: 1px dashed red; + } + .mynode{ + padding-left:5px; + } + `})]})}export{x as default}; diff --git a/v1-demo-windowed/assets/draggable_droppable-CC59tBiR.js b/v1-demo-windowed/assets/draggable_droppable-CC59tBiR.js new file mode 100644 index 0000000..de81240 --- /dev/null +++ b/v1-demo-windowed/assets/draggable_droppable-CC59tBiR.js @@ -0,0 +1 @@ +import{r as o,j as n}from"./index-BNKuAD6d.js";import{s,u as p}from"./HeTree-B-DJf59j.js";function x(){const a={idKey:"id",parentIdKey:"parent_id"},[r,t]=o.useState(()=>s([{id:2,parent_id:1,name:"Technology"},{id:5,parent_id:2,name:"Hardware"},{id:10,parent_id:5,name:"Computer Components"},{id:4,parent_id:2,name:"Programming"},{id:8,parent_id:4,name:"Python"},{id:3,parent_id:1,name:"Science"},{id:7,parent_id:3,name:"Biology"},{id:6,parent_id:3,name:"Physics"}],a)),{renderTree:d}=p({...a,data:r,dataType:"flat",onChange:t,renderNode:({id:e,node:i,open:m,checked:c,draggable:l})=>n.jsxs("div",{children:[i.name," - ",e]}),canDrag:({id:e})=>e===2?!0:e===3?!1:void 0,canDrop:({id:e})=>e===3?!0:e===2?!1:void 0,canDropToRoot:e=>!1});return n.jsx("div",{children:d({style:{width:"300px",border:"1px solid #555",padding:"20px"}})})}export{x as default}; diff --git a/v1-demo-windowed/assets/dragopen-WenjLppC.js b/v1-demo-windowed/assets/dragopen-WenjLppC.js new file mode 100644 index 0000000..d3bb216 --- /dev/null +++ b/v1-demo-windowed/assets/dragopen-WenjLppC.js @@ -0,0 +1 @@ +import{r as p,j as d}from"./index-BNKuAD6d.js";import{s as u,u as g}from"./HeTree-B-DJf59j.js";function f(){const r={idKey:"id",parentIdKey:"parent_id"},[l,m]=p.useState(()=>u([{id:1,parent_id:null,name:"Root Category"},{id:2,parent_id:1,name:"Technology"},{id:5,parent_id:2,name:"Hardware"},{id:10,parent_id:5,name:"Computer Components"},{id:4,parent_id:2,name:"Programming"},{id:8,parent_id:4,name:"Python"},{id:3,parent_id:1,name:"Science"},{id:7,parent_id:3,name:"Biology"},{id:6,parent_id:3,name:"Physics"}],r)),[n,i]=p.useState([1,3]),s=(e,t)=>{i(t?[...n||o,e]:(n||o).filter(a=>a!==e))},{renderTree:c,allIds:o}=g({...r,data:l,dataType:"flat",onChange:m,openIds:n,renderNode:({id:e,node:t,open:a,checked:h,draggable:x})=>d.jsxs("div",{children:[d.jsx("button",{onClick:()=>s(e,!a),children:a?"-":"+"}),t.name," - ",e]}),dragOpen:!0,onDragOpen(e){s(e.id,!0)}});return d.jsx("div",{children:c({style:{width:"300px",border:"1px solid #555",padding:"20px"}})})}export{f as default}; diff --git a/v1-demo-windowed/assets/external_drag-fXwcXea6.js b/v1-demo-windowed/assets/external_drag-fXwcXea6.js new file mode 100644 index 0000000..4c0a7a8 --- /dev/null +++ b/v1-demo-windowed/assets/external_drag-fXwcXea6.js @@ -0,0 +1 @@ +import{j as d}from"./index-BNKuAD6d.js";import{u as l,s as p,b as g}from"./HeTree-B-DJf59j.js";import{i as c}from"./use-immer.module-yv4BBfO6.js";function y(){const a={idKey:"id",parentIdKey:"parent_id"},[r,i]=c(()=>p([{id:1,parent_id:null,name:"Root Category"},{id:2,parent_id:1,name:"Technology"},{id:5,parent_id:2,name:"Hardware"},{id:10,parent_id:5,name:"Computer Components"},{id:4,parent_id:2,name:"Programming"},{id:8,parent_id:4,name:"Python"},{id:3,parent_id:1,name:"Science"},{id:7,parent_id:3,name:"Biology"},{id:6,parent_id:3,name:"Physics"}],a)),{renderTree:m,allIds:u}=l({...a,data:r,dataType:"flat",onChange:i,renderNode:({id:n,node:e,open:t,checked:o,draggable:s})=>d.jsxs("div",{children:[e.name," - ",n]}),onExternalDragOver:n=>!0,onExternalDrop:(n,e,t)=>{i(o=>{const s={id:100+r.length,parent_id:(e==null?void 0:e.id)??null,name:"New Node"};g(o,s,t,a)})}});return d.jsxs("div",{children:[d.jsx("button",{draggable:!0,children:"Drag me in to the tree"}),m({style:{width:"300px",border:"1px solid #555",padding:"20px"}})]})}export{y as default}; diff --git a/v1-demo-windowed/assets/index-A_ZwqF_5.js b/v1-demo-windowed/assets/index-A_ZwqF_5.js new file mode 100644 index 0000000..ff1611f --- /dev/null +++ b/v1-demo-windowed/assets/index-A_ZwqF_5.js @@ -0,0 +1 @@ +import{j as e}from"./index-BNKuAD6d.js";function r(){return e.jsx(e.Fragment,{children:e.jsx("div",{className:"fixed w-full h-full left-0 top-0 flex justify-center items-center",children:e.jsxs("div",{className:"text-center",children:[e.jsx("h1",{children:"he-tree-react Demo"}),e.jsx("a",{href:"https://github.com/phphe/he-tree-react",children:"Github"})]})})})}export{r as default}; diff --git a/v1-demo-windowed/assets/index-BNKuAD6d.js b/v1-demo-windowed/assets/index-BNKuAD6d.js new file mode 100644 index 0000000..0d561af --- /dev/null +++ b/v1-demo-windowed/assets/index-BNKuAD6d.js @@ -0,0 +1,91 @@ +function __vite__mapDeps(indexes) { + if (!__vite__mapDeps.viteFileDeps) { + __vite__mapDeps.viteFileDeps = ["assets/base_tree_data-ImaopUth.js","assets/HeTree-B-DJf59j.js","assets/base_flat_data-BHMljvlY.js","assets/custom_drag_trigger_flat_data-7wB0GH25.js","assets/open_ids-BtZwvtxr.js","assets/checked_ids-CIHCriBZ.js","assets/update_data-DuWC4pa0.js","assets/update_flat_data_with_immer-DWMbCgdo.js","assets/use-immer.module-yv4BBfO6.js","assets/update_tree_data_with_immer-DNl8HLwr.js","assets/customize_placeholder_and_node_box-LD6y-60m.js","assets/draggable_droppable-CC59tBiR.js","assets/dragopen-WenjLppC.js","assets/external_drag-fXwcXea6.js","assets/virtual_list-Iugknds9.js","assets/scroll_to_node-CxFLGpCA.js","assets/custom_style-D_9Sq9cn.js"] + } + return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) +} +function rc(e,t){for(var n=0;nr[l]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))r(l);new MutationObserver(l=>{for(const i of l)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(l){const i={};return l.integrity&&(i.integrity=l.integrity),l.referrerPolicy&&(i.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?i.credentials="include":l.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(l){if(l.ep)return;l.ep=!0;const i=n(l);fetch(l.href,i)}})();const qd="modulepreload",bd=function(e){return"/v1-demo-windowed/"+e},Tu={},Le=function(t,n,r){let l=Promise.resolve();if(n&&n.length>0){const i=document.getElementsByTagName("link");l=Promise.all(n.map(o=>{if(o=bd(o),o in Tu)return;Tu[o]=!0;const a=o.endsWith(".css"),u=a?'[rel="stylesheet"]':"";if(!!r)for(let p=i.length-1;p>=0;p--){const m=i[p];if(m.href===o&&(!a||m.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${o}"]${u}`))return;const c=document.createElement("link");if(c.rel=a?"stylesheet":qd,a||(c.as="script",c.crossOrigin=""),c.href=o,document.head.appendChild(c),a)return new Promise((p,m)=>{c.addEventListener("load",p),c.addEventListener("error",()=>m(new Error(`Unable to preload CSS for ${o}`)))})}))}return l.then(()=>t()).catch(i=>{const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=i,window.dispatchEvent(o),!o.defaultPrevented)throw i})};function lc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ic={exports:{}},Si={},oc={exports:{}},W={};/** + * @license React + * react.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var sl=Symbol.for("react.element"),ep=Symbol.for("react.portal"),tp=Symbol.for("react.fragment"),np=Symbol.for("react.strict_mode"),rp=Symbol.for("react.profiler"),lp=Symbol.for("react.provider"),ip=Symbol.for("react.context"),op=Symbol.for("react.forward_ref"),ap=Symbol.for("react.suspense"),up=Symbol.for("react.memo"),sp=Symbol.for("react.lazy"),Nu=Symbol.iterator;function cp(e){return e===null||typeof e!="object"?null:(e=Nu&&e[Nu]||e["@@iterator"],typeof e=="function"?e:null)}var ac={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},uc=Object.assign,sc={};function sr(e,t,n){this.props=e,this.context=t,this.refs=sc,this.updater=n||ac}sr.prototype.isReactComponent={};sr.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};sr.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function cc(){}cc.prototype=sr.prototype;function wa(e,t,n){this.props=e,this.context=t,this.refs=sc,this.updater=n||ac}var Sa=wa.prototype=new cc;Sa.constructor=wa;uc(Sa,sr.prototype);Sa.isPureReactComponent=!0;var Du=Array.isArray,fc=Object.prototype.hasOwnProperty,_a={current:null},dc={key:!0,ref:!0,__self:!0,__source:!0};function pc(e,t,n){var r,l={},i=null,o=null;if(t!=null)for(r in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(i=""+t.key),t)fc.call(t,r)&&!dc.hasOwnProperty(r)&&(l[r]=t[r]);var a=arguments.length-2;if(a===1)l.children=n;else if(1>>1,te=D[X];if(0>>1;Xl(at,B))Oel(Ft,at)?(D[X]=Ft,D[Oe]=B,X=Oe):(D[X]=at,D[ke]=B,X=ke);else if(Oel(Ft,B))D[X]=Ft,D[Oe]=B,X=Oe;else break e}}return U}function l(D,U){var B=D.sortIndex-U.sortIndex;return B!==0?B:D.id-U.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var o=Date,a=o.now();e.unstable_now=function(){return o.now()-a}}var u=[],s=[],c=1,p=null,m=3,k=!1,S=!1,w=!1,C=typeof setTimeout=="function"?setTimeout:null,d=typeof clearTimeout=="function"?clearTimeout:null,f=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function h(D){for(var U=n(s);U!==null;){if(U.callback===null)r(s);else if(U.startTime<=D)r(s),U.sortIndex=U.expirationTime,t(u,U);else break;U=n(s)}}function _(D){if(w=!1,h(D),!S)if(n(u)!==null)S=!0,jt(L);else{var U=n(s);U!==null&&le(_,U.startTime-D)}}function L(D,U){S=!1,w&&(w=!1,d(T),T=-1),k=!0;var B=m;try{for(h(U),p=n(u);p!==null&&(!(p.expirationTime>U)||D&&!K());){var X=p.callback;if(typeof X=="function"){p.callback=null,m=p.priorityLevel;var te=X(p.expirationTime<=U);U=e.unstable_now(),typeof te=="function"?p.callback=te:p===n(u)&&r(u),h(U)}else r(u);p=n(u)}if(p!==null)var vt=!0;else{var ke=n(s);ke!==null&&le(_,ke.startTime-U),vt=!1}return vt}finally{p=null,m=B,k=!1}}var v=!1,P=null,T=-1,O=5,j=-1;function K(){return!(e.unstable_now()-jD||125X?(D.sortIndex=B,t(s,D),n(u)===null&&D===n(s)&&(w?(d(T),T=-1):w=!0,le(_,B-X))):(D.sortIndex=te,t(u,D),S||k||(S=!0,jt(L))),D},e.unstable_shouldYield=K,e.unstable_wrapCallback=function(D){var U=m;return function(){var B=m;m=U;try{return D.apply(this,arguments)}finally{m=B}}}})(gc);yc.exports=gc;var Ep=yc.exports;/** + * @license React + * react-dom.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var wc=E,Je=Ep;function R(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),So=Object.prototype.hasOwnProperty,kp=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,Mu={},Ou={};function xp(e){return So.call(Ou,e)?!0:So.call(Mu,e)?!1:kp.test(e)?Ou[e]=!0:(Mu[e]=!0,!1)}function Cp(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function Pp(e,t,n,r){if(t===null||typeof t>"u"||Cp(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Ue(e,t,n,r,l,i,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=l,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=o}var Re={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Re[e]=new Ue(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Re[t]=new Ue(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Re[e]=new Ue(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Re[e]=new Ue(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Re[e]=new Ue(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Re[e]=new Ue(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Re[e]=new Ue(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Re[e]=new Ue(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Re[e]=new Ue(e,5,!1,e.toLowerCase(),null,!1,!1)});var ka=/[\-:]([a-z])/g;function xa(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(ka,xa);Re[t]=new Ue(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(ka,xa);Re[t]=new Ue(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(ka,xa);Re[t]=new Ue(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Re[e]=new Ue(e,1,!1,e.toLowerCase(),null,!1,!1)});Re.xlinkHref=new Ue("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Re[e]=new Ue(e,1,!1,e.toLowerCase(),null,!0,!0)});function Ca(e,t,n,r){var l=Re.hasOwnProperty(t)?Re[t]:null;(l!==null?l.type!==0:r||!(2a||l[o]!==i[a]){var u=` +`+l[o].replace(" at new "," at ");return e.displayName&&u.includes("")&&(u=u.replace("",e.displayName)),u}while(1<=o&&0<=a);break}}}finally{Qi=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Nr(e):""}function Rp(e){switch(e.tag){case 5:return Nr(e.type);case 16:return Nr("Lazy");case 13:return Nr("Suspense");case 19:return Nr("SuspenseList");case 0:case 2:case 15:return e=Ki(e.type,!1),e;case 11:return e=Ki(e.type.render,!1),e;case 1:return e=Ki(e.type,!0),e;default:return""}}function xo(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Fn:return"Fragment";case jn:return"Portal";case _o:return"Profiler";case Pa:return"StrictMode";case Eo:return"Suspense";case ko:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Ec:return(e.displayName||"Context")+".Consumer";case _c:return(e._context.displayName||"Context")+".Provider";case Ra:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case La:return t=e.displayName||null,t!==null?t:xo(e.type)||"Memo";case Vt:t=e._payload,e=e._init;try{return xo(e(t))}catch{}}return null}function Lp(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return xo(t);case 8:return t===Pa?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function nn(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function xc(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Tp(e){var t=xc(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var l=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return l.call(this)},set:function(o){r=""+o,i.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function El(e){e._valueTracker||(e._valueTracker=Tp(e))}function Cc(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=xc(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Gl(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Co(e,t){var n=t.checked;return ue({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Fu(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=nn(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Pc(e,t){t=t.checked,t!=null&&Ca(e,"checked",t,!1)}function Po(e,t){Pc(e,t);var n=nn(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Ro(e,t.type,n):t.hasOwnProperty("defaultValue")&&Ro(e,t.type,nn(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Iu(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Ro(e,t,n){(t!=="number"||Gl(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Dr=Array.isArray;function Gn(e,t,n,r){if(e=e.options,t){t={};for(var l=0;l"+t.valueOf().toString()+"",t=kl.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Qr(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Or={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Np=["Webkit","ms","Moz","O"];Object.keys(Or).forEach(function(e){Np.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Or[t]=Or[e]})});function Nc(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Or.hasOwnProperty(e)&&Or[e]?(""+t).trim():t+"px"}function Dc(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,l=Nc(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,l):e[n]=l}}var Dp=ue({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function No(e,t){if(t){if(Dp[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(R(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(R(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(R(61))}if(t.style!=null&&typeof t.style!="object")throw Error(R(62))}}function Do(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var zo=null;function Ta(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Mo=null,Jn=null,Zn=null;function Bu(e){if(e=dl(e)){if(typeof Mo!="function")throw Error(R(280));var t=e.stateNode;t&&(t=Ci(t),Mo(e.stateNode,e.type,t))}}function zc(e){Jn?Zn?Zn.push(e):Zn=[e]:Jn=e}function Mc(){if(Jn){var e=Jn,t=Zn;if(Zn=Jn=null,Bu(e),t)for(e=0;e>>=0,e===0?32:31-(Vp(e)/Hp|0)|0}var xl=64,Cl=4194304;function zr(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function bl(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,l=e.suspendedLanes,i=e.pingedLanes,o=n&268435455;if(o!==0){var a=o&~l;a!==0?r=zr(a):(i&=o,i!==0&&(r=zr(i)))}else o=n&~l,o!==0?r=zr(o):i!==0&&(r=zr(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&l)&&(l=r&-r,i=t&-t,l>=i||l===16&&(i&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function cl(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-pt(t),e[t]=n}function Yp(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=Fr),Gu=" ",Ju=!1;function bc(e,t){switch(e){case"keyup":return _h.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ef(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var In=!1;function kh(e,t){switch(e){case"compositionend":return ef(t);case"keypress":return t.which!==32?null:(Ju=!0,Gu);case"textInput":return e=t.data,e===Gu&&Ju?null:e;default:return null}}function xh(e,t){if(In)return e==="compositionend"||!Ia&&bc(e,t)?(e=Zc(),Bl=Oa=Kt=null,In=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=es(n)}}function lf(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?lf(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function of(){for(var e=window,t=Gl();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Gl(e.document)}return t}function Ua(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function Mh(e){var t=of(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&lf(n.ownerDocument.documentElement,n)){if(r!==null&&Ua(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var l=n.textContent.length,i=Math.min(r.start,l);r=r.end===void 0?i:Math.min(r.end,l),!e.extend&&i>r&&(l=r,r=i,i=l),l=ts(n,i);var o=ts(n,r);l&&o&&(e.rangeCount!==1||e.anchorNode!==l.node||e.anchorOffset!==l.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(l.node,l.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,Un=null,Ao=null,Ur=null,Bo=!1;function ns(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Bo||Un==null||Un!==Gl(r)||(r=Un,"selectionStart"in r&&Ua(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Ur&&Zr(Ur,r)||(Ur=r,r=ni(Ao,"onSelect"),0$n||(e.current=Ko[$n],Ko[$n]=null,$n--)}function ee(e,t){$n++,Ko[$n]=e.current,e.current=t}var rn={},Me=on(rn),Ve=on(!1),_n=rn;function nr(e,t){var n=e.type.contextTypes;if(!n)return rn;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var l={},i;for(i in n)l[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=l),l}function He(e){return e=e.childContextTypes,e!=null}function li(){re(Ve),re(Me)}function ss(e,t,n){if(Me.current!==rn)throw Error(R(168));ee(Me,t),ee(Ve,n)}function mf(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var l in r)if(!(l in t))throw Error(R(108,Lp(e)||"Unknown",l));return ue({},n,r)}function ii(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||rn,_n=Me.current,ee(Me,e),ee(Ve,Ve.current),!0}function cs(e,t,n){var r=e.stateNode;if(!r)throw Error(R(169));n?(e=mf(e,t,_n),r.__reactInternalMemoizedMergedChildContext=e,re(Ve),re(Me),ee(Me,e)):re(Ve),ee(Ve,n)}var xt=null,Pi=!1,oo=!1;function vf(e){xt===null?xt=[e]:xt.push(e)}function Qh(e){Pi=!0,vf(e)}function an(){if(!oo&&xt!==null){oo=!0;var e=0,t=J;try{var n=xt;for(J=1;e>=o,l-=o,Ct=1<<32-pt(t)+l|n<T?(O=P,P=null):O=P.sibling;var j=m(d,P,h[T],_);if(j===null){P===null&&(P=O);break}e&&P&&j.alternate===null&&t(d,P),f=i(j,f,T),v===null?L=j:v.sibling=j,v=j,P=O}if(T===h.length)return n(d,P),ie&&dn(d,T),L;if(P===null){for(;TT?(O=P,P=null):O=P.sibling;var K=m(d,P,j.value,_);if(K===null){P===null&&(P=O);break}e&&P&&K.alternate===null&&t(d,P),f=i(K,f,T),v===null?L=K:v.sibling=K,v=K,P=O}if(j.done)return n(d,P),ie&&dn(d,T),L;if(P===null){for(;!j.done;T++,j=h.next())j=p(d,j.value,_),j!==null&&(f=i(j,f,T),v===null?L=j:v.sibling=j,v=j);return ie&&dn(d,T),L}for(P=r(d,P);!j.done;T++,j=h.next())j=k(P,d,T,j.value,_),j!==null&&(e&&j.alternate!==null&&P.delete(j.key===null?T:j.key),f=i(j,f,T),v===null?L=j:v.sibling=j,v=j);return e&&P.forEach(function(ve){return t(d,ve)}),ie&&dn(d,T),L}function C(d,f,h,_){if(typeof h=="object"&&h!==null&&h.type===Fn&&h.key===null&&(h=h.props.children),typeof h=="object"&&h!==null){switch(h.$$typeof){case _l:e:{for(var L=h.key,v=f;v!==null;){if(v.key===L){if(L=h.type,L===Fn){if(v.tag===7){n(d,v.sibling),f=l(v,h.props.children),f.return=d,d=f;break e}}else if(v.elementType===L||typeof L=="object"&&L!==null&&L.$$typeof===Vt&&ys(L)===v.type){n(d,v.sibling),f=l(v,h.props),f.ref=Er(d,v,h),f.return=d,d=f;break e}n(d,v);break}else t(d,v);v=v.sibling}h.type===Fn?(f=Sn(h.props.children,d.mode,_,h.key),f.return=d,d=f):(_=Xl(h.type,h.key,h.props,null,d.mode,_),_.ref=Er(d,f,h),_.return=d,d=_)}return o(d);case jn:e:{for(v=h.key;f!==null;){if(f.key===v)if(f.tag===4&&f.stateNode.containerInfo===h.containerInfo&&f.stateNode.implementation===h.implementation){n(d,f.sibling),f=l(f,h.children||[]),f.return=d,d=f;break e}else{n(d,f);break}else t(d,f);f=f.sibling}f=mo(h,d.mode,_),f.return=d,d=f}return o(d);case Vt:return v=h._init,C(d,f,v(h._payload),_)}if(Dr(h))return S(d,f,h,_);if(yr(h))return w(d,f,h,_);zl(d,h)}return typeof h=="string"&&h!==""||typeof h=="number"?(h=""+h,f!==null&&f.tag===6?(n(d,f.sibling),f=l(f,h),f.return=d,d=f):(n(d,f),f=ho(h,d.mode,_),f.return=d,d=f),o(d)):n(d,f)}return C}var lr=xf(!0),Cf=xf(!1),pl={},_t=on(pl),tl=on(pl),nl=on(pl);function vn(e){if(e===pl)throw Error(R(174));return e}function Ya(e,t){switch(ee(nl,t),ee(tl,e),ee(_t,pl),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:To(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=To(t,e)}re(_t),ee(_t,t)}function ir(){re(_t),re(tl),re(nl)}function Pf(e){vn(nl.current);var t=vn(_t.current),n=To(t,e.type);t!==n&&(ee(tl,e),ee(_t,n))}function Xa(e){tl.current===e&&(re(_t),re(tl))}var oe=on(0);function fi(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var ao=[];function Ga(){for(var e=0;en?n:4,e(!0);var r=uo.transition;uo.transition={};try{e(!1),t()}finally{J=n,uo.transition=r}}function Vf(){return ot().memoizedState}function Gh(e,t,n){var r=en(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Hf(e))Wf(t,n);else if(n=Sf(e,t,n,r),n!==null){var l=Fe();ht(n,e,r,l),Qf(n,t,r)}}function Jh(e,t,n){var r=en(e),l={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Hf(e))Wf(t,l);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var o=t.lastRenderedState,a=i(o,n);if(l.hasEagerState=!0,l.eagerState=a,mt(a,o)){var u=t.interleaved;u===null?(l.next=l,Qa(t)):(l.next=u.next,u.next=l),t.interleaved=l;return}}catch{}finally{}n=Sf(e,t,l,r),n!==null&&(l=Fe(),ht(n,e,r,l),Qf(n,t,r))}}function Hf(e){var t=e.alternate;return e===ae||t!==null&&t===ae}function Wf(e,t){Ar=di=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Qf(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Da(e,n)}}var pi={readContext:it,useCallback:Te,useContext:Te,useEffect:Te,useImperativeHandle:Te,useInsertionEffect:Te,useLayoutEffect:Te,useMemo:Te,useReducer:Te,useRef:Te,useState:Te,useDebugValue:Te,useDeferredValue:Te,useTransition:Te,useMutableSource:Te,useSyncExternalStore:Te,useId:Te,unstable_isNewReconciler:!1},Zh={readContext:it,useCallback:function(e,t){return gt().memoizedState=[e,t===void 0?null:t],e},useContext:it,useEffect:ws,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Wl(4194308,4,If.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Wl(4194308,4,e,t)},useInsertionEffect:function(e,t){return Wl(4,2,e,t)},useMemo:function(e,t){var n=gt();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=gt();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=Gh.bind(null,ae,e),[r.memoizedState,e]},useRef:function(e){var t=gt();return e={current:e},t.memoizedState=e},useState:gs,useDebugValue:eu,useDeferredValue:function(e){return gt().memoizedState=e},useTransition:function(){var e=gs(!1),t=e[0];return e=Xh.bind(null,e[1]),gt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=ae,l=gt();if(ie){if(n===void 0)throw Error(R(407));n=n()}else{if(n=t(),Ee===null)throw Error(R(349));kn&30||Tf(r,t,n)}l.memoizedState=n;var i={value:n,getSnapshot:t};return l.queue=i,ws(Df.bind(null,r,i,e),[e]),r.flags|=2048,il(9,Nf.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=gt(),t=Ee.identifierPrefix;if(ie){var n=Pt,r=Ct;n=(r&~(1<<32-pt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=rl++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=o.createElement(n,{is:r.is}):(e=o.createElement(n),n==="select"&&(o=e,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):e=o.createElementNS(e,n),e[wt]=t,e[el]=r,ed(e,t,!1,!1),t.stateNode=e;e:{switch(o=Do(n,r),n){case"dialog":ne("cancel",e),ne("close",e),l=r;break;case"iframe":case"object":case"embed":ne("load",e),l=r;break;case"video":case"audio":for(l=0;lar&&(t.flags|=128,r=!0,kr(i,!1),t.lanes=4194304)}else{if(!r)if(e=fi(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),kr(i,!0),i.tail===null&&i.tailMode==="hidden"&&!o.alternate&&!ie)return Ne(t),null}else 2*pe()-i.renderingStartTime>ar&&n!==1073741824&&(t.flags|=128,r=!0,kr(i,!1),t.lanes=4194304);i.isBackwards?(o.sibling=t.child,t.child=o):(n=i.last,n!==null?n.sibling=o:t.child=o,i.last=o)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=pe(),t.sibling=null,n=oe.current,ee(oe,r?n&1|2:n&1),t):(Ne(t),null);case 22:case 23:return ou(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Ye&1073741824&&(Ne(t),t.subtreeFlags&6&&(t.flags|=8192)):Ne(t),null;case 24:return null;case 25:return null}throw Error(R(156,t.tag))}function im(e,t){switch(Ba(t),t.tag){case 1:return He(t.type)&&li(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ir(),re(Ve),re(Me),Ga(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Xa(t),null;case 13:if(re(oe),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(R(340));rr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return re(oe),null;case 4:return ir(),null;case 10:return Wa(t.type._context),null;case 22:case 23:return ou(),null;case 24:return null;default:return null}}var Ol=!1,ze=!1,om=typeof WeakSet=="function"?WeakSet:Set,z=null;function Qn(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){ce(e,t,r)}else n.current=null}function la(e,t,n){try{n()}catch(r){ce(e,t,r)}}var Ls=!1;function am(e,t){if($o=ei,e=of(),Ua(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var l=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var o=0,a=-1,u=-1,s=0,c=0,p=e,m=null;t:for(;;){for(var k;p!==n||l!==0&&p.nodeType!==3||(a=o+l),p!==i||r!==0&&p.nodeType!==3||(u=o+r),p.nodeType===3&&(o+=p.nodeValue.length),(k=p.firstChild)!==null;)m=p,p=k;for(;;){if(p===e)break t;if(m===n&&++s===l&&(a=o),m===i&&++c===r&&(u=o),(k=p.nextSibling)!==null)break;p=m,m=p.parentNode}p=k}n=a===-1||u===-1?null:{start:a,end:u}}else n=null}n=n||{start:0,end:0}}else n=null;for(Vo={focusedElem:e,selectionRange:n},ei=!1,z=t;z!==null;)if(t=z,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,z=e;else for(;z!==null;){t=z;try{var S=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(S!==null){var w=S.memoizedProps,C=S.memoizedState,d=t.stateNode,f=d.getSnapshotBeforeUpdate(t.elementType===t.type?w:st(t.type,w),C);d.__reactInternalSnapshotBeforeUpdate=f}break;case 3:var h=t.stateNode.containerInfo;h.nodeType===1?h.textContent="":h.nodeType===9&&h.documentElement&&h.removeChild(h.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(R(163))}}catch(_){ce(t,t.return,_)}if(e=t.sibling,e!==null){e.return=t.return,z=e;break}z=t.return}return S=Ls,Ls=!1,S}function Br(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var l=r=r.next;do{if((l.tag&e)===e){var i=l.destroy;l.destroy=void 0,i!==void 0&&la(t,n,i)}l=l.next}while(l!==r)}}function Ti(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function ia(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function rd(e){var t=e.alternate;t!==null&&(e.alternate=null,rd(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[wt],delete t[el],delete t[Qo],delete t[Hh],delete t[Wh])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function ld(e){return e.tag===5||e.tag===3||e.tag===4}function Ts(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||ld(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function oa(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=ri));else if(r!==4&&(e=e.child,e!==null))for(oa(e,t,n),e=e.sibling;e!==null;)oa(e,t,n),e=e.sibling}function aa(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(aa(e,t,n),e=e.sibling;e!==null;)aa(e,t,n),e=e.sibling}var Ce=null,ct=!1;function Bt(e,t,n){for(n=n.child;n!==null;)id(e,t,n),n=n.sibling}function id(e,t,n){if(St&&typeof St.onCommitFiberUnmount=="function")try{St.onCommitFiberUnmount(_i,n)}catch{}switch(n.tag){case 5:ze||Qn(n,t);case 6:var r=Ce,l=ct;Ce=null,Bt(e,t,n),Ce=r,ct=l,Ce!==null&&(ct?(e=Ce,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Ce.removeChild(n.stateNode));break;case 18:Ce!==null&&(ct?(e=Ce,n=n.stateNode,e.nodeType===8?io(e.parentNode,n):e.nodeType===1&&io(e,n),Gr(e)):io(Ce,n.stateNode));break;case 4:r=Ce,l=ct,Ce=n.stateNode.containerInfo,ct=!0,Bt(e,t,n),Ce=r,ct=l;break;case 0:case 11:case 14:case 15:if(!ze&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){l=r=r.next;do{var i=l,o=i.destroy;i=i.tag,o!==void 0&&(i&2||i&4)&&la(n,t,o),l=l.next}while(l!==r)}Bt(e,t,n);break;case 1:if(!ze&&(Qn(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){ce(n,t,a)}Bt(e,t,n);break;case 21:Bt(e,t,n);break;case 22:n.mode&1?(ze=(r=ze)||n.memoizedState!==null,Bt(e,t,n),ze=r):Bt(e,t,n);break;default:Bt(e,t,n)}}function Ns(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new om),t.forEach(function(r){var l=vm.bind(null,e,r);n.has(r)||(n.add(r),r.then(l,l))})}}function ut(e,t){var n=t.deletions;if(n!==null)for(var r=0;rl&&(l=o),r&=~i}if(r=l,r=pe()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*sm(r/1960))-r,10e?16:e,Yt===null)var r=!1;else{if(e=Yt,Yt=null,vi=0,Y&6)throw Error(R(331));var l=Y;for(Y|=4,z=e.current;z!==null;){var i=z,o=i.child;if(z.flags&16){var a=i.deletions;if(a!==null){for(var u=0;upe()-lu?wn(e,0):ru|=n),We(e,t)}function pd(e,t){t===0&&(e.mode&1?(t=Cl,Cl<<=1,!(Cl&130023424)&&(Cl=4194304)):t=1);var n=Fe();e=Dt(e,t),e!==null&&(cl(e,t,n),We(e,n))}function mm(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),pd(e,n)}function vm(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,l=e.memoizedState;l!==null&&(n=l.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(R(314))}r!==null&&r.delete(t),pd(e,n)}var hd;hd=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Ve.current)$e=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return $e=!1,rm(e,t,n);$e=!!(e.flags&131072)}else $e=!1,ie&&t.flags&1048576&&yf(t,ai,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Ql(e,t),e=t.pendingProps;var l=nr(t,Me.current);bn(t,n),l=Za(null,t,r,e,l,n);var i=qa();return t.flags|=1,typeof l=="object"&&l!==null&&typeof l.render=="function"&&l.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,He(r)?(i=!0,ii(t)):i=!1,t.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,Ka(t),l.updater=Ri,t.stateNode=l,l._reactInternals=t,Zo(t,r,e,n),t=ea(null,t,r,!0,i,n)):(t.tag=0,ie&&i&&Aa(t),je(null,t,l,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Ql(e,t),e=t.pendingProps,l=r._init,r=l(r._payload),t.type=r,l=t.tag=gm(r),e=st(r,e),l){case 0:t=bo(null,t,r,e,n);break e;case 1:t=Cs(null,t,r,e,n);break e;case 11:t=ks(null,t,r,e,n);break e;case 14:t=xs(null,t,r,st(r.type,e),n);break e}throw Error(R(306,r,""))}return t;case 0:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:st(r,l),bo(e,t,r,l,n);case 1:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:st(r,l),Cs(e,t,r,l,n);case 3:e:{if(Zf(t),e===null)throw Error(R(387));r=t.pendingProps,i=t.memoizedState,l=i.element,_f(e,t),ci(t,r,null,n);var o=t.memoizedState;if(r=o.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){l=or(Error(R(423)),t),t=Ps(e,t,r,n,l);break e}else if(r!==l){l=or(Error(R(424)),t),t=Ps(e,t,r,n,l);break e}else for(Xe=Zt(t.stateNode.containerInfo.firstChild),Ge=t,ie=!0,dt=null,n=Cf(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(rr(),r===l){t=zt(e,t,n);break e}je(e,t,r,n)}t=t.child}return t;case 5:return Pf(t),e===null&&Xo(t),r=t.type,l=t.pendingProps,i=e!==null?e.memoizedProps:null,o=l.children,Ho(r,l)?o=null:i!==null&&Ho(r,i)&&(t.flags|=32),Jf(e,t),je(e,t,o,n),t.child;case 6:return e===null&&Xo(t),null;case 13:return qf(e,t,n);case 4:return Ya(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=lr(t,null,r,n):je(e,t,r,n),t.child;case 11:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:st(r,l),ks(e,t,r,l,n);case 7:return je(e,t,t.pendingProps,n),t.child;case 8:return je(e,t,t.pendingProps.children,n),t.child;case 12:return je(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,l=t.pendingProps,i=t.memoizedProps,o=l.value,ee(ui,r._currentValue),r._currentValue=o,i!==null)if(mt(i.value,o)){if(i.children===l.children&&!Ve.current){t=zt(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var a=i.dependencies;if(a!==null){o=i.child;for(var u=a.firstContext;u!==null;){if(u.context===r){if(i.tag===1){u=Rt(-1,n&-n),u.tag=2;var s=i.updateQueue;if(s!==null){s=s.shared;var c=s.pending;c===null?u.next=u:(u.next=c.next,c.next=u),s.pending=u}}i.lanes|=n,u=i.alternate,u!==null&&(u.lanes|=n),Go(i.return,n,t),a.lanes|=n;break}u=u.next}}else if(i.tag===10)o=i.type===t.type?null:i.child;else if(i.tag===18){if(o=i.return,o===null)throw Error(R(341));o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),Go(o,n,t),o=i.sibling}else o=i.child;if(o!==null)o.return=i;else for(o=i;o!==null;){if(o===t){o=null;break}if(i=o.sibling,i!==null){i.return=o.return,o=i;break}o=o.return}i=o}je(e,t,l.children,n),t=t.child}return t;case 9:return l=t.type,r=t.pendingProps.children,bn(t,n),l=it(l),r=r(l),t.flags|=1,je(e,t,r,n),t.child;case 14:return r=t.type,l=st(r,t.pendingProps),l=st(r.type,l),xs(e,t,r,l,n);case 15:return Xf(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:st(r,l),Ql(e,t),t.tag=1,He(r)?(e=!0,ii(t)):e=!1,bn(t,n),kf(t,r,l),Zo(t,r,l,n),ea(null,t,r,!0,e,n);case 19:return bf(e,t,n);case 22:return Gf(e,t,n)}throw Error(R(156,t.tag))};function md(e,t){return Bc(e,t)}function ym(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function rt(e,t,n,r){return new ym(e,t,n,r)}function uu(e){return e=e.prototype,!(!e||!e.isReactComponent)}function gm(e){if(typeof e=="function")return uu(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Ra)return 11;if(e===La)return 14}return 2}function tn(e,t){var n=e.alternate;return n===null?(n=rt(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Xl(e,t,n,r,l,i){var o=2;if(r=e,typeof e=="function")uu(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case Fn:return Sn(n.children,l,i,t);case Pa:o=8,l|=8;break;case _o:return e=rt(12,n,t,l|2),e.elementType=_o,e.lanes=i,e;case Eo:return e=rt(13,n,t,l),e.elementType=Eo,e.lanes=i,e;case ko:return e=rt(19,n,t,l),e.elementType=ko,e.lanes=i,e;case kc:return Di(n,l,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case _c:o=10;break e;case Ec:o=9;break e;case Ra:o=11;break e;case La:o=14;break e;case Vt:o=16,r=null;break e}throw Error(R(130,e==null?e:typeof e,""))}return t=rt(o,n,t,l),t.elementType=e,t.type=r,t.lanes=i,t}function Sn(e,t,n,r){return e=rt(7,e,r,t),e.lanes=n,e}function Di(e,t,n,r){return e=rt(22,e,r,t),e.elementType=kc,e.lanes=n,e.stateNode={isHidden:!1},e}function ho(e,t,n){return e=rt(6,e,null,t),e.lanes=n,e}function mo(e,t,n){return t=rt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function wm(e,t,n,r,l){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Xi(0),this.expirationTimes=Xi(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Xi(0),this.identifierPrefix=r,this.onRecoverableError=l,this.mutableSourceEagerHydrationData=null}function su(e,t,n,r,l,i,o,a,u){return e=new wm(e,t,n,a,u),t===1?(t=1,i===!0&&(t|=8)):t=0,i=rt(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Ka(i),e}function Sm(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(wd)}catch(e){console.error(e)}}wd(),vc.exports=Ze;var pu=vc.exports;const Cm=lc(pu),Pm=rc({__proto__:null,default:Cm},[pu]);var Us=pu;wo.createRoot=Us.createRoot,wo.hydrateRoot=Us.hydrateRoot;/** + * @remix-run/router v1.15.3 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function fe(){return fe=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function Pn(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Lm(){return Math.random().toString(36).substr(2,8)}function Bs(e,t){return{usr:e.state,key:e.key,idx:t}}function al(e,t,n,r){return n===void 0&&(n=null),fe({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Et(t):t,{state:n,key:t&&t.key||r||Lm()})}function Rn(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function Et(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function Tm(e,t,n,r){r===void 0&&(r={});let{window:l=document.defaultView,v5Compat:i=!1}=r,o=l.history,a=de.Pop,u=null,s=c();s==null&&(s=0,o.replaceState(fe({},o.state,{idx:s}),""));function c(){return(o.state||{idx:null}).idx}function p(){a=de.Pop;let C=c(),d=C==null?null:C-s;s=C,u&&u({action:a,location:w.location,delta:d})}function m(C,d){a=de.Push;let f=al(w.location,C,d);n&&n(f,C),s=c()+1;let h=Bs(f,s),_=w.createHref(f);try{o.pushState(h,"",_)}catch(L){if(L instanceof DOMException&&L.name==="DataCloneError")throw L;l.location.assign(_)}i&&u&&u({action:a,location:w.location,delta:1})}function k(C,d){a=de.Replace;let f=al(w.location,C,d);n&&n(f,C),s=c();let h=Bs(f,s),_=w.createHref(f);o.replaceState(h,"",_),i&&u&&u({action:a,location:w.location,delta:0})}function S(C){let d=l.location.origin!=="null"?l.location.origin:l.location.href,f=typeof C=="string"?C:Rn(C);return f=f.replace(/ $/,"%20"),V(d,"No window.location.(origin|href) available to create URL for href: "+f),new URL(f,d)}let w={get action(){return a},get location(){return e(l,o)},listen(C){if(u)throw new Error("A history only accepts one active listener");return l.addEventListener(As,p),u=C,()=>{l.removeEventListener(As,p),u=null}},createHref(C){return t(l,C)},createURL:S,encodeLocation(C){let d=S(C);return{pathname:d.pathname,search:d.search,hash:d.hash}},push:m,replace:k,go(C){return o.go(C)}};return w}var se;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(se||(se={}));const Nm=new Set(["lazy","caseSensitive","path","id","index","children"]);function Dm(e){return e.index===!0}function da(e,t,n,r){return n===void 0&&(n=[]),r===void 0&&(r={}),e.map((l,i)=>{let o=[...n,i],a=typeof l.id=="string"?l.id:o.join("-");if(V(l.index!==!0||!l.children,"Cannot specify children on an index route"),V(!r[a],'Found a route id collision on id "'+a+`". Route id's must be globally unique within Data Router usages`),Dm(l)){let u=fe({},l,t(l),{id:a});return r[a]=u,u}else{let u=fe({},l,t(l),{id:a,children:void 0});return r[a]=u,l.children&&(u.children=da(l.children,t,o,r)),u}})}function Yn(e,t,n){n===void 0&&(n="/");let r=typeof t=="string"?Et(t):t,l=Mt(r.pathname||"/",n);if(l==null)return null;let i=Sd(e);Mm(i);let o=null;for(let a=0;o==null&&a{let u={relativePath:a===void 0?i.path||"":a,caseSensitive:i.caseSensitive===!0,childrenIndex:o,route:i};u.relativePath.startsWith("/")&&(V(u.relativePath.startsWith(r),'Absolute route path "'+u.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),u.relativePath=u.relativePath.slice(r.length));let s=Lt([r,u.relativePath]),c=n.concat(u);i.children&&i.children.length>0&&(V(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+s+'".')),Sd(i.children,t,c,s)),!(i.path==null&&!i.index)&&t.push({path:s,score:Bm(s,i.index),routesMeta:c})};return e.forEach((i,o)=>{var a;if(i.path===""||!((a=i.path)!=null&&a.includes("?")))l(i,o);else for(let u of _d(i.path))l(i,o,u)}),t}function _d(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,l=n.endsWith("?"),i=n.replace(/\?$/,"");if(r.length===0)return l?[i,""]:[i];let o=_d(r.join("/")),a=[];return a.push(...o.map(u=>u===""?i:[i,u].join("/"))),l&&a.push(...o),a.map(u=>e.startsWith("/")&&u===""?"/":u)}function Mm(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:$m(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const Om=/^:[\w-]+$/,jm=3,Fm=2,Im=1,Um=10,Am=-2,$s=e=>e==="*";function Bm(e,t){let n=e.split("/"),r=n.length;return n.some($s)&&(r+=Am),t&&(r+=Fm),n.filter(l=>!$s(l)).reduce((l,i)=>l+(Om.test(i)?jm:i===""?Im:Um),r)}function $m(e,t){return e.length===t.length&&e.slice(0,-1).every((r,l)=>r===t[l])?e[e.length-1]-t[t.length-1]:0}function Vm(e,t){let{routesMeta:n}=e,r={},l="/",i=[];for(let o=0;o{let{paramName:m,isOptional:k}=c;if(m==="*"){let w=a[p]||"";o=i.slice(0,i.length-w.length).replace(/(.)\/+$/,"$1")}const S=a[p];return k&&!S?s[m]=void 0:s[m]=(S||"").replace(/%2F/g,"/"),s},{}),pathname:i,pathnameBase:o,pattern:e}}function Hm(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),Pn(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],l="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,a,u)=>(r.push({paramName:a,isOptional:u!=null}),u?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),l+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?l+="\\/*$":e!==""&&e!=="/"&&(l+="(?:(?=\\/|$))"),[new RegExp(l,t?void 0:"i"),r]}function Wm(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Pn(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function Mt(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function Qm(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:l=""}=typeof e=="string"?Et(e):e;return{pathname:n?n.startsWith("/")?n:Km(n,t):t,search:Xm(r),hash:Gm(l)}}function Km(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(l=>{l===".."?n.length>1&&n.pop():l!=="."&&n.push(l)}),n.length>1?n.join("/"):"/"}function vo(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function Ed(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function hu(e,t){let n=Ed(e);return t?n.map((r,l)=>l===e.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function mu(e,t,n,r){r===void 0&&(r=!1);let l;typeof e=="string"?l=Et(e):(l=fe({},e),V(!l.pathname||!l.pathname.includes("?"),vo("?","pathname","search",l)),V(!l.pathname||!l.pathname.includes("#"),vo("#","pathname","hash",l)),V(!l.search||!l.search.includes("#"),vo("#","search","hash",l)));let i=e===""||l.pathname==="",o=i?"/":l.pathname,a;if(o==null)a=n;else{let p=t.length-1;if(!r&&o.startsWith("..")){let m=o.split("/");for(;m[0]==="..";)m.shift(),p-=1;l.pathname=m.join("/")}a=p>=0?t[p]:"/"}let u=Qm(l,a),s=o&&o!=="/"&&o.endsWith("/"),c=(i||o===".")&&n.endsWith("/");return!u.pathname.endsWith("/")&&(s||c)&&(u.pathname+="/"),u}const Lt=e=>e.join("/").replace(/\/\/+/g,"/"),Ym=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Xm=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Gm=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;class vu{constructor(t,n,r,l){l===void 0&&(l=!1),this.status=t,this.statusText=n||"",this.internal=l,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}}function kd(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const xd=["post","put","patch","delete"],Jm=new Set(xd),Zm=["get",...xd],qm=new Set(Zm),bm=new Set([301,302,303,307,308]),ev=new Set([307,308]),yo={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},tv={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Cr={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},Cd=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,nv=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),Pd="remix-router-transitions";function rv(e){const t=e.window?e.window:typeof window<"u"?window:void 0,n=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u",r=!n;V(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let l;if(e.mapRouteProperties)l=e.mapRouteProperties;else if(e.detectErrorBoundary){let y=e.detectErrorBoundary;l=g=>({hasErrorBoundary:y(g)})}else l=nv;let i={},o=da(e.routes,l,void 0,i),a,u=e.basename||"/",s=fe({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1},e.future),c=null,p=new Set,m=null,k=null,S=null,w=e.hydrationData!=null,C=Yn(o,e.history.location,u),d=null;if(C==null){let y=et(404,{pathname:e.history.location.pathname}),{matches:g,route:x}=Gs(o);C=g,d={[x.id]:y}}let f,h=C.some(y=>y.route.lazy),_=C.some(y=>y.route.loader);if(h)f=!1;else if(!_)f=!0;else if(s.v7_partialHydration){let y=e.hydrationData?e.hydrationData.loaderData:null,g=e.hydrationData?e.hydrationData.errors:null,x=N=>N.route.loader?N.route.loader.hydrate===!0?!1:y&&y[N.route.id]!==void 0||g&&g[N.route.id]!==void 0:!0;if(g){let N=C.findIndex(M=>g[M.route.id]!==void 0);f=C.slice(0,N+1).every(x)}else f=C.every(x)}else f=e.hydrationData!=null;let L,v={historyAction:e.history.action,location:e.history.location,matches:C,initialized:f,navigation:yo,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||d,fetchers:new Map,blockers:new Map},P=de.Pop,T=!1,O,j=!1,K=new Map,ve=null,he=!1,be=!1,Nn=[],jt=[],le=new Map,D=0,U=-1,B=new Map,X=new Set,te=new Map,vt=new Map,ke=new Set,at=new Map,Oe=new Map,Ft=!1;function Id(){if(c=e.history.listen(y=>{let{action:g,location:x,delta:N}=y;if(Ft){Ft=!1;return}Pn(Oe.size===0||N!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let M=Pu({currentLocation:v.location,nextLocation:x,historyAction:g});if(M&&N!=null){Ft=!0,e.history.go(N*-1),yl(M,{state:"blocked",location:x,proceed(){yl(M,{state:"proceeding",proceed:void 0,reset:void 0,location:x}),e.history.go(N)},reset(){let H=new Map(v.blockers);H.set(M,Cr),Qe({blockers:H})}});return}return cn(g,x)}),n){hv(t,K);let y=()=>mv(t,K);t.addEventListener("pagehide",y),ve=()=>t.removeEventListener("pagehide",y)}return v.initialized||cn(de.Pop,v.location,{initialHydration:!0}),L}function Ud(){c&&c(),ve&&ve(),p.clear(),O&&O.abort(),v.fetchers.forEach((y,g)=>vl(g)),v.blockers.forEach((y,g)=>Cu(g))}function Ad(y){return p.add(y),()=>p.delete(y)}function Qe(y,g){g===void 0&&(g={}),v=fe({},v,y);let x=[],N=[];s.v7_fetcherPersist&&v.fetchers.forEach((M,H)=>{M.state==="idle"&&(ke.has(H)?N.push(H):x.push(H))}),[...p].forEach(M=>M(v,{deletedFetchers:N,unstable_viewTransitionOpts:g.viewTransitionOpts,unstable_flushSync:g.flushSync===!0})),s.v7_fetcherPersist&&(x.forEach(M=>v.fetchers.delete(M)),N.forEach(M=>vl(M)))}function pr(y,g,x){var N,M;let{flushSync:H}=x===void 0?{}:x,A=v.actionData!=null&&v.navigation.formMethod!=null&&ft(v.navigation.formMethod)&&v.navigation.state==="loading"&&((N=y.state)==null?void 0:N._isRedirect)!==!0,I;g.actionData?Object.keys(g.actionData).length>0?I=g.actionData:I=null:A?I=v.actionData:I=null;let F=g.loaderData?Xs(v.loaderData,g.loaderData,g.matches||[],g.errors):v.loaderData,Q=v.blockers;Q.size>0&&(Q=new Map(Q),Q.forEach((b,xe)=>Q.set(xe,Cr)));let we=T===!0||v.navigation.formMethod!=null&&ft(v.navigation.formMethod)&&((M=y.state)==null?void 0:M._isRedirect)!==!0;a&&(o=a,a=void 0),he||P===de.Pop||(P===de.Push?e.history.push(y,y.state):P===de.Replace&&e.history.replace(y,y.state));let $;if(P===de.Pop){let b=K.get(v.location.pathname);b&&b.has(y.pathname)?$={currentLocation:v.location,nextLocation:y}:K.has(y.pathname)&&($={currentLocation:y,nextLocation:v.location})}else if(j){let b=K.get(v.location.pathname);b?b.add(y.pathname):(b=new Set([y.pathname]),K.set(v.location.pathname,b)),$={currentLocation:v.location,nextLocation:y}}Qe(fe({},g,{actionData:I,loaderData:F,historyAction:P,location:y,initialized:!0,navigation:yo,revalidation:"idle",restoreScrollPosition:Lu(y,g.matches||v.matches),preventScrollReset:we,blockers:Q}),{viewTransitionOpts:$,flushSync:H===!0}),P=de.Pop,T=!1,j=!1,he=!1,be=!1,Nn=[],jt=[]}async function wu(y,g){if(typeof y=="number"){e.history.go(y);return}let x=ha(v.location,v.matches,u,s.v7_prependBasename,y,s.v7_relativeSplatPath,g==null?void 0:g.fromRouteId,g==null?void 0:g.relative),{path:N,submission:M,error:H}=Vs(s.v7_normalizeFormMethod,!1,x,g),A=v.location,I=al(v.location,N,g&&g.state);I=fe({},I,e.history.encodeLocation(I));let F=g&&g.replace!=null?g.replace:void 0,Q=de.Push;F===!0?Q=de.Replace:F===!1||M!=null&&ft(M.formMethod)&&M.formAction===v.location.pathname+v.location.search&&(Q=de.Replace);let we=g&&"preventScrollReset"in g?g.preventScrollReset===!0:void 0,$=(g&&g.unstable_flushSync)===!0,b=Pu({currentLocation:A,nextLocation:I,historyAction:Q});if(b){yl(b,{state:"blocked",location:I,proceed(){yl(b,{state:"proceeding",proceed:void 0,reset:void 0,location:I}),wu(y,g)},reset(){let xe=new Map(v.blockers);xe.set(b,Cr),Qe({blockers:xe})}});return}return await cn(Q,I,{submission:M,pendingError:H,preventScrollReset:we,replace:g&&g.replace,enableViewTransition:g&&g.unstable_viewTransition,flushSync:$})}function Bd(){if(Ui(),Qe({revalidation:"loading"}),v.navigation.state!=="submitting"){if(v.navigation.state==="idle"){cn(v.historyAction,v.location,{startUninterruptedRevalidation:!0});return}cn(P||v.historyAction,v.navigation.location,{overrideNavigation:v.navigation})}}async function cn(y,g,x){O&&O.abort(),O=null,P=y,he=(x&&x.startUninterruptedRevalidation)===!0,Gd(v.location,v.matches),T=(x&&x.preventScrollReset)===!0,j=(x&&x.enableViewTransition)===!0;let N=a||o,M=x&&x.overrideNavigation,H=Yn(N,g,u),A=(x&&x.flushSync)===!0;if(!H){let xe=et(404,{pathname:g.pathname}),{matches:Ke,route:Se}=Gs(N);Ai(),pr(g,{matches:Ke,loaderData:{},errors:{[Se.id]:xe}},{flushSync:A});return}if(v.initialized&&!be&&uv(v.location,g)&&!(x&&x.submission&&ft(x.submission.formMethod))){pr(g,{matches:H},{flushSync:A});return}O=new AbortController;let I=Rr(e.history,g,O.signal,x&&x.submission),F,Q;if(x&&x.pendingError)Q={[Hr(H).route.id]:x.pendingError};else if(x&&x.submission&&ft(x.submission.formMethod)){let xe=await $d(I,g,x.submission,H,{replace:x.replace,flushSync:A});if(xe.shortCircuited)return;F=xe.pendingActionData,Q=xe.pendingActionError,M=go(g,x.submission),A=!1,I=new Request(I.url,{signal:I.signal})}let{shortCircuited:we,loaderData:$,errors:b}=await Vd(I,g,H,M,x&&x.submission,x&&x.fetcherSubmission,x&&x.replace,x&&x.initialHydration===!0,A,F,Q);we||(O=null,pr(g,fe({matches:H},F?{actionData:F}:{},{loaderData:$,errors:b})))}async function $d(y,g,x,N,M){M===void 0&&(M={}),Ui();let H=dv(g,x);Qe({navigation:H},{flushSync:M.flushSync===!0});let A,I=va(N,g);if(!I.route.action&&!I.route.lazy)A={type:se.error,error:et(405,{method:y.method,pathname:g.pathname,routeId:I.route.id})};else if(A=await Pr("action",y,I,N,i,l,u,s.v7_relativeSplatPath),y.signal.aborted)return{shortCircuited:!0};if(gn(A)){let F;return M&&M.replace!=null?F=M.replace:F=A.location===v.location.pathname+v.location.search,await hr(v,A,{submission:x,replace:F}),{shortCircuited:!0}}if(Xn(A)){let F=Hr(N,I.route.id);return(M&&M.replace)!==!0&&(P=de.Push),{pendingActionData:{},pendingActionError:{[F.route.id]:A.error}}}if(yn(A))throw et(400,{type:"defer-action"});return{pendingActionData:{[I.route.id]:A.data}}}async function Vd(y,g,x,N,M,H,A,I,F,Q,we){let $=N||go(g,M),b=M||H||qs($),xe=a||o,[Ke,Se]=Hs(e.history,v,x,b,g,s.v7_partialHydration&&I===!0,be,Nn,jt,ke,te,X,xe,u,Q,we);if(Ai(G=>!(x&&x.some(Z=>Z.route.id===G))||Ke&&Ke.some(Z=>Z.route.id===G)),U=++D,Ke.length===0&&Se.length===0){let G=ku();return pr(g,fe({matches:x,loaderData:{},errors:we||null},Q?{actionData:Q}:{},G?{fetchers:new Map(v.fetchers)}:{}),{flushSync:F}),{shortCircuited:!0}}if(!he&&(!s.v7_partialHydration||!I)){Se.forEach(Z=>{let Ae=v.fetchers.get(Z.key),wl=Lr(void 0,Ae?Ae.data:void 0);v.fetchers.set(Z.key,wl)});let G=Q||v.actionData;Qe(fe({navigation:$},G?Object.keys(G).length===0?{actionData:null}:{actionData:G}:{},Se.length>0?{fetchers:new Map(v.fetchers)}:{}),{flushSync:F})}Se.forEach(G=>{le.has(G.key)&&Ut(G.key),G.controller&&le.set(G.key,G.controller)});let Dn=()=>Se.forEach(G=>Ut(G.key));O&&O.signal.addEventListener("abort",Dn);let{results:Bi,loaderResults:zn,fetcherResults:At}=await Su(v.matches,x,Ke,Se,y);if(y.signal.aborted)return{shortCircuited:!0};O&&O.signal.removeEventListener("abort",Dn),Se.forEach(G=>le.delete(G.key));let fn=Js(Bi);if(fn){if(fn.idx>=Ke.length){let G=Se[fn.idx-Ke.length].key;X.add(G)}return await hr(v,fn.result,{replace:A}),{shortCircuited:!0}}let{loaderData:$i,errors:vr}=Ys(v,x,Ke,zn,we,Se,At,at);at.forEach((G,Z)=>{G.subscribe(Ae=>{(Ae||G.done)&&at.delete(Z)})}),s.v7_partialHydration&&I&&v.errors&&Object.entries(v.errors).filter(G=>{let[Z]=G;return!Ke.some(Ae=>Ae.route.id===Z)}).forEach(G=>{let[Z,Ae]=G;vr=Object.assign(vr||{},{[Z]:Ae})});let Vi=ku(),Mn=xu(U),gl=Vi||Mn||Se.length>0;return fe({loaderData:$i,errors:vr},gl?{fetchers:new Map(v.fetchers)}:{})}function Hd(y,g,x,N){if(r)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");le.has(y)&&Ut(y);let M=(N&&N.unstable_flushSync)===!0,H=a||o,A=ha(v.location,v.matches,u,s.v7_prependBasename,x,s.v7_relativeSplatPath,g,N==null?void 0:N.relative),I=Yn(H,A,u);if(!I){mr(y,g,et(404,{pathname:A}),{flushSync:M});return}let{path:F,submission:Q,error:we}=Vs(s.v7_normalizeFormMethod,!0,A,N);if(we){mr(y,g,we,{flushSync:M});return}let $=va(I,F);if(T=(N&&N.preventScrollReset)===!0,Q&&ft(Q.formMethod)){Wd(y,g,F,$,I,M,Q);return}te.set(y,{routeId:g,path:F}),Qd(y,g,F,$,I,M,Q)}async function Wd(y,g,x,N,M,H,A){if(Ui(),te.delete(y),!N.route.action&&!N.route.lazy){let Z=et(405,{method:A.formMethod,pathname:x,routeId:g});mr(y,g,Z,{flushSync:H});return}let I=v.fetchers.get(y);It(y,pv(A,I),{flushSync:H});let F=new AbortController,Q=Rr(e.history,x,F.signal,A);le.set(y,F);let we=D,$=await Pr("action",Q,N,M,i,l,u,s.v7_relativeSplatPath);if(Q.signal.aborted){le.get(y)===F&&le.delete(y);return}if(s.v7_fetcherPersist&&ke.has(y)){if(gn($)||Xn($)){It(y,$t(void 0));return}}else{if(gn($))if(le.delete(y),U>we){It(y,$t(void 0));return}else return X.add(y),It(y,Lr(A)),hr(v,$,{fetcherSubmission:A});if(Xn($)){mr(y,g,$.error);return}}if(yn($))throw et(400,{type:"defer-action"});let b=v.navigation.location||v.location,xe=Rr(e.history,b,F.signal),Ke=a||o,Se=v.navigation.state!=="idle"?Yn(Ke,v.navigation.location,u):v.matches;V(Se,"Didn't find any matches after fetcher action");let Dn=++D;B.set(y,Dn);let Bi=Lr(A,$.data);v.fetchers.set(y,Bi);let[zn,At]=Hs(e.history,v,Se,A,b,!1,be,Nn,jt,ke,te,X,Ke,u,{[N.route.id]:$.data},void 0);At.filter(Z=>Z.key!==y).forEach(Z=>{let Ae=Z.key,wl=v.fetchers.get(Ae),Zd=Lr(void 0,wl?wl.data:void 0);v.fetchers.set(Ae,Zd),le.has(Ae)&&Ut(Ae),Z.controller&&le.set(Ae,Z.controller)}),Qe({fetchers:new Map(v.fetchers)});let fn=()=>At.forEach(Z=>Ut(Z.key));F.signal.addEventListener("abort",fn);let{results:$i,loaderResults:vr,fetcherResults:Vi}=await Su(v.matches,Se,zn,At,xe);if(F.signal.aborted)return;F.signal.removeEventListener("abort",fn),B.delete(y),le.delete(y),At.forEach(Z=>le.delete(Z.key));let Mn=Js($i);if(Mn){if(Mn.idx>=zn.length){let Z=At[Mn.idx-zn.length].key;X.add(Z)}return hr(v,Mn.result)}let{loaderData:gl,errors:G}=Ys(v,v.matches,zn,vr,void 0,At,Vi,at);if(v.fetchers.has(y)){let Z=$t($.data);v.fetchers.set(y,Z)}xu(Dn),v.navigation.state==="loading"&&Dn>U?(V(P,"Expected pending action"),O&&O.abort(),pr(v.navigation.location,{matches:Se,loaderData:gl,errors:G,fetchers:new Map(v.fetchers)})):(Qe({errors:G,loaderData:Xs(v.loaderData,gl,Se,G),fetchers:new Map(v.fetchers)}),be=!1)}async function Qd(y,g,x,N,M,H,A){let I=v.fetchers.get(y);It(y,Lr(A,I?I.data:void 0),{flushSync:H});let F=new AbortController,Q=Rr(e.history,x,F.signal);le.set(y,F);let we=D,$=await Pr("loader",Q,N,M,i,l,u,s.v7_relativeSplatPath);if(yn($)&&($=await Td($,Q.signal,!0)||$),le.get(y)===F&&le.delete(y),!Q.signal.aborted){if(ke.has(y)){It(y,$t(void 0));return}if(gn($))if(U>we){It(y,$t(void 0));return}else{X.add(y),await hr(v,$);return}if(Xn($)){mr(y,g,$.error);return}V(!yn($),"Unhandled fetcher deferred data"),It(y,$t($.data))}}async function hr(y,g,x){let{submission:N,fetcherSubmission:M,replace:H}=x===void 0?{}:x;g.revalidate&&(be=!0);let A=al(y.location,g.location,{_isRedirect:!0});if(V(A,"Expected a location on the redirect navigation"),n){let b=!1;if(g.reloadDocument)b=!0;else if(Cd.test(g.location)){const xe=e.history.createURL(g.location);b=xe.origin!==t.location.origin||Mt(xe.pathname,u)==null}if(b){H?t.location.replace(g.location):t.location.assign(g.location);return}}O=null;let I=H===!0?de.Replace:de.Push,{formMethod:F,formAction:Q,formEncType:we}=y.navigation;!N&&!M&&F&&Q&&we&&(N=qs(y.navigation));let $=N||M;if(ev.has(g.status)&&$&&ft($.formMethod))await cn(I,A,{submission:fe({},$,{formAction:g.location}),preventScrollReset:T});else{let b=go(A,N);await cn(I,A,{overrideNavigation:b,fetcherSubmission:M,preventScrollReset:T})}}async function Su(y,g,x,N,M){let H=await Promise.all([...x.map(F=>Pr("loader",M,F,g,i,l,u,s.v7_relativeSplatPath)),...N.map(F=>F.matches&&F.match&&F.controller?Pr("loader",Rr(e.history,F.path,F.controller.signal),F.match,F.matches,i,l,u,s.v7_relativeSplatPath):{type:se.error,error:et(404,{pathname:F.path})})]),A=H.slice(0,x.length),I=H.slice(x.length);return await Promise.all([Zs(y,x,A,A.map(()=>M.signal),!1,v.loaderData),Zs(y,N.map(F=>F.match),I,N.map(F=>F.controller?F.controller.signal:null),!0)]),{results:H,loaderResults:A,fetcherResults:I}}function Ui(){be=!0,Nn.push(...Ai()),te.forEach((y,g)=>{le.has(g)&&(jt.push(g),Ut(g))})}function It(y,g,x){x===void 0&&(x={}),v.fetchers.set(y,g),Qe({fetchers:new Map(v.fetchers)},{flushSync:(x&&x.flushSync)===!0})}function mr(y,g,x,N){N===void 0&&(N={});let M=Hr(v.matches,g);vl(y),Qe({errors:{[M.route.id]:x},fetchers:new Map(v.fetchers)},{flushSync:(N&&N.flushSync)===!0})}function _u(y){return s.v7_fetcherPersist&&(vt.set(y,(vt.get(y)||0)+1),ke.has(y)&&ke.delete(y)),v.fetchers.get(y)||tv}function vl(y){let g=v.fetchers.get(y);le.has(y)&&!(g&&g.state==="loading"&&B.has(y))&&Ut(y),te.delete(y),B.delete(y),X.delete(y),ke.delete(y),v.fetchers.delete(y)}function Kd(y){if(s.v7_fetcherPersist){let g=(vt.get(y)||0)-1;g<=0?(vt.delete(y),ke.add(y)):vt.set(y,g)}else vl(y);Qe({fetchers:new Map(v.fetchers)})}function Ut(y){let g=le.get(y);V(g,"Expected fetch controller: "+y),g.abort(),le.delete(y)}function Eu(y){for(let g of y){let x=_u(g),N=$t(x.data);v.fetchers.set(g,N)}}function ku(){let y=[],g=!1;for(let x of X){let N=v.fetchers.get(x);V(N,"Expected fetcher: "+x),N.state==="loading"&&(X.delete(x),y.push(x),g=!0)}return Eu(y),g}function xu(y){let g=[];for(let[x,N]of B)if(N0}function Yd(y,g){let x=v.blockers.get(y)||Cr;return Oe.get(y)!==g&&Oe.set(y,g),x}function Cu(y){v.blockers.delete(y),Oe.delete(y)}function yl(y,g){let x=v.blockers.get(y)||Cr;V(x.state==="unblocked"&&g.state==="blocked"||x.state==="blocked"&&g.state==="blocked"||x.state==="blocked"&&g.state==="proceeding"||x.state==="blocked"&&g.state==="unblocked"||x.state==="proceeding"&&g.state==="unblocked","Invalid blocker state transition: "+x.state+" -> "+g.state);let N=new Map(v.blockers);N.set(y,g),Qe({blockers:N})}function Pu(y){let{currentLocation:g,nextLocation:x,historyAction:N}=y;if(Oe.size===0)return;Oe.size>1&&Pn(!1,"A router only supports one blocker at a time");let M=Array.from(Oe.entries()),[H,A]=M[M.length-1],I=v.blockers.get(H);if(!(I&&I.state==="proceeding")&&A({currentLocation:g,nextLocation:x,historyAction:N}))return H}function Ai(y){let g=[];return at.forEach((x,N)=>{(!y||y(N))&&(x.cancel(),g.push(N),at.delete(N))}),g}function Xd(y,g,x){if(m=y,S=g,k=x||null,!w&&v.navigation===yo){w=!0;let N=Lu(v.location,v.matches);N!=null&&Qe({restoreScrollPosition:N})}return()=>{m=null,S=null,k=null}}function Ru(y,g){return k&&k(y,g.map(N=>zm(N,v.loaderData)))||y.key}function Gd(y,g){if(m&&S){let x=Ru(y,g);m[x]=S()}}function Lu(y,g){if(m){let x=Ru(y,g),N=m[x];if(typeof N=="number")return N}return null}function Jd(y){i={},a=da(y,l,void 0,i)}return L={get basename(){return u},get future(){return s},get state(){return v},get routes(){return o},get window(){return t},initialize:Id,subscribe:Ad,enableScrollRestoration:Xd,navigate:wu,fetch:Hd,revalidate:Bd,createHref:y=>e.history.createHref(y),encodeLocation:y=>e.history.encodeLocation(y),getFetcher:_u,deleteFetcher:Kd,dispose:Ud,getBlocker:Yd,deleteBlocker:Cu,_internalFetchControllers:le,_internalActiveDeferreds:at,_internalSetRoutes:Jd},L}function lv(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function ha(e,t,n,r,l,i,o,a){let u,s;if(o){u=[];for(let p of t)if(u.push(p),p.route.id===o){s=p;break}}else u=t,s=t[t.length-1];let c=mu(l||".",hu(u,i),Mt(e.pathname,n)||e.pathname,a==="path");return l==null&&(c.search=e.search,c.hash=e.hash),(l==null||l===""||l===".")&&s&&s.route.index&&!yu(c.search)&&(c.search=c.search?c.search.replace(/^\?/,"?index&"):"?index"),r&&n!=="/"&&(c.pathname=c.pathname==="/"?n:Lt([n,c.pathname])),Rn(c)}function Vs(e,t,n,r){if(!r||!lv(r))return{path:n};if(r.formMethod&&!fv(r.formMethod))return{path:n,error:et(405,{method:r.formMethod})};let l=()=>({path:n,error:et(400,{type:"invalid-body"})}),i=r.formMethod||"get",o=e?i.toUpperCase():i.toLowerCase(),a=Ld(n);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!ft(o))return l();let m=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((k,S)=>{let[w,C]=S;return""+k+w+"="+C+` +`},""):String(r.body);return{path:n,submission:{formMethod:o,formAction:a,formEncType:r.formEncType,formData:void 0,json:void 0,text:m}}}else if(r.formEncType==="application/json"){if(!ft(o))return l();try{let m=typeof r.body=="string"?JSON.parse(r.body):r.body;return{path:n,submission:{formMethod:o,formAction:a,formEncType:r.formEncType,formData:void 0,json:m,text:void 0}}}catch{return l()}}}V(typeof FormData=="function","FormData is not available in this environment");let u,s;if(r.formData)u=ma(r.formData),s=r.formData;else if(r.body instanceof FormData)u=ma(r.body),s=r.body;else if(r.body instanceof URLSearchParams)u=r.body,s=Ks(u);else if(r.body==null)u=new URLSearchParams,s=new FormData;else try{u=new URLSearchParams(r.body),s=Ks(u)}catch{return l()}let c={formMethod:o,formAction:a,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:s,json:void 0,text:void 0};if(ft(c.formMethod))return{path:n,submission:c};let p=Et(n);return t&&p.search&&yu(p.search)&&u.append("index",""),p.search="?"+u,{path:Rn(p),submission:c}}function iv(e,t){let n=e;if(t){let r=e.findIndex(l=>l.route.id===t);r>=0&&(n=e.slice(0,r))}return n}function Hs(e,t,n,r,l,i,o,a,u,s,c,p,m,k,S,w){let C=w?Object.values(w)[0]:S?Object.values(S)[0]:void 0,d=e.createURL(t.location),f=e.createURL(l),h=w?Object.keys(w)[0]:void 0,L=iv(n,h).filter((P,T)=>{let{route:O}=P;if(O.lazy)return!0;if(O.loader==null)return!1;if(i)return O.loader.hydrate?!0:t.loaderData[O.id]===void 0&&(!t.errors||t.errors[O.id]===void 0);if(ov(t.loaderData,t.matches[T],P)||a.some(ve=>ve===P.route.id))return!0;let j=t.matches[T],K=P;return Ws(P,fe({currentUrl:d,currentParams:j.params,nextUrl:f,nextParams:K.params},r,{actionResult:C,defaultShouldRevalidate:o||d.pathname+d.search===f.pathname+f.search||d.search!==f.search||Rd(j,K)}))}),v=[];return c.forEach((P,T)=>{if(i||!n.some(he=>he.route.id===P.routeId)||s.has(T))return;let O=Yn(m,P.path,k);if(!O){v.push({key:T,routeId:P.routeId,path:P.path,matches:null,match:null,controller:null});return}let j=t.fetchers.get(T),K=va(O,P.path),ve=!1;p.has(T)?ve=!1:u.includes(T)?ve=!0:j&&j.state!=="idle"&&j.data===void 0?ve=o:ve=Ws(K,fe({currentUrl:d,currentParams:t.matches[t.matches.length-1].params,nextUrl:f,nextParams:n[n.length-1].params},r,{actionResult:C,defaultShouldRevalidate:o})),ve&&v.push({key:T,routeId:P.routeId,path:P.path,matches:O,match:K,controller:new AbortController})}),[L,v]}function ov(e,t,n){let r=!t||n.route.id!==t.route.id,l=e[n.route.id]===void 0;return r||l}function Rd(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function Ws(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}async function Qs(e,t,n){if(!e.lazy)return;let r=await e.lazy();if(!e.lazy)return;let l=n[e.id];V(l,"No route found in manifest");let i={};for(let o in r){let u=l[o]!==void 0&&o!=="hasErrorBoundary";Pn(!u,'Route "'+l.id+'" has a static property "'+o+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+o+'" will be ignored.')),!u&&!Nm.has(o)&&(i[o]=r[o])}Object.assign(l,i),Object.assign(l,fe({},t(l),{lazy:void 0}))}async function Pr(e,t,n,r,l,i,o,a,u){u===void 0&&(u={});let s,c,p,m=w=>{let C,d=new Promise((f,h)=>C=h);return p=()=>C(),t.signal.addEventListener("abort",p),Promise.race([w({request:t,params:n.params,context:u.requestContext}),d])};try{let w=n.route[e];if(n.route.lazy)if(w){let C,d=await Promise.all([m(w).catch(f=>{C=f}),Qs(n.route,i,l)]);if(C)throw C;c=d[0]}else if(await Qs(n.route,i,l),w=n.route[e],w)c=await m(w);else if(e==="action"){let C=new URL(t.url),d=C.pathname+C.search;throw et(405,{method:t.method,pathname:d,routeId:n.route.id})}else return{type:se.data,data:void 0};else if(w)c=await m(w);else{let C=new URL(t.url),d=C.pathname+C.search;throw et(404,{pathname:d})}V(c!==void 0,"You defined "+(e==="action"?"an action":"a loader")+" for route "+('"'+n.route.id+"\" but didn't return anything from your `"+e+"` ")+"function. Please return a value or `null`.")}catch(w){s=se.error,c=w}finally{p&&t.signal.removeEventListener("abort",p)}if(cv(c)){let w=c.status;if(bm.has(w)){let d=c.headers.get("Location");if(V(d,"Redirects returned/thrown from loaders/actions must have a Location header"),!Cd.test(d))d=ha(new URL(t.url),r.slice(0,r.indexOf(n)+1),o,!0,d,a);else if(!u.isStaticRequest){let f=new URL(t.url),h=d.startsWith("//")?new URL(f.protocol+d):new URL(d),_=Mt(h.pathname,o)!=null;h.origin===f.origin&&_&&(d=h.pathname+h.search+h.hash)}if(u.isStaticRequest)throw c.headers.set("Location",d),c;return{type:se.redirect,status:w,location:d,revalidate:c.headers.get("X-Remix-Revalidate")!==null,reloadDocument:c.headers.get("X-Remix-Reload-Document")!==null}}if(u.isRouteRequest)throw{type:s===se.error?se.error:se.data,response:c};let C;try{let d=c.headers.get("Content-Type");d&&/\bapplication\/json\b/.test(d)?c.body==null?C=null:C=await c.json():C=await c.text()}catch(d){return{type:se.error,error:d}}return s===se.error?{type:s,error:new vu(w,c.statusText,C),headers:c.headers}:{type:se.data,data:C,statusCode:c.status,headers:c.headers}}if(s===se.error)return{type:s,error:c};if(sv(c)){var k,S;return{type:se.deferred,deferredData:c,statusCode:(k=c.init)==null?void 0:k.status,headers:((S=c.init)==null?void 0:S.headers)&&new Headers(c.init.headers)}}return{type:se.data,data:c}}function Rr(e,t,n,r){let l=e.createURL(Ld(t)).toString(),i={signal:n};if(r&&ft(r.formMethod)){let{formMethod:o,formEncType:a}=r;i.method=o.toUpperCase(),a==="application/json"?(i.headers=new Headers({"Content-Type":a}),i.body=JSON.stringify(r.json)):a==="text/plain"?i.body=r.text:a==="application/x-www-form-urlencoded"&&r.formData?i.body=ma(r.formData):i.body=r.formData}return new Request(l,i)}function ma(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function Ks(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function av(e,t,n,r,l){let i={},o=null,a,u=!1,s={};return n.forEach((c,p)=>{let m=t[p].route.id;if(V(!gn(c),"Cannot handle redirect results in processLoaderData"),Xn(c)){let k=Hr(e,m),S=c.error;r&&(S=Object.values(r)[0],r=void 0),o=o||{},o[k.route.id]==null&&(o[k.route.id]=S),i[m]=void 0,u||(u=!0,a=kd(c.error)?c.error.status:500),c.headers&&(s[m]=c.headers)}else yn(c)?(l.set(m,c.deferredData),i[m]=c.deferredData.data):i[m]=c.data,c.statusCode!=null&&c.statusCode!==200&&!u&&(a=c.statusCode),c.headers&&(s[m]=c.headers)}),r&&(o=r,i[Object.keys(r)[0]]=void 0),{loaderData:i,errors:o,statusCode:a||200,loaderHeaders:s}}function Ys(e,t,n,r,l,i,o,a){let{loaderData:u,errors:s}=av(t,n,r,l,a);for(let c=0;cr.route.id===t)+1):[...e]).reverse().find(r=>r.route.hasErrorBoundary===!0)||e[0]}function Gs(e){let t=e.length===1?e[0]:e.find(n=>n.index||!n.path||n.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function et(e,t){let{pathname:n,routeId:r,method:l,type:i}=t===void 0?{}:t,o="Unknown Server Error",a="Unknown @remix-run/router error";return e===400?(o="Bad Request",l&&n&&r?a="You made a "+l+' request to "'+n+'" but '+('did not provide a `loader` for route "'+r+'", ')+"so there is no way to handle the request.":i==="defer-action"?a="defer() is not supported in actions":i==="invalid-body"&&(a="Unable to encode submission body")):e===403?(o="Forbidden",a='Route "'+r+'" does not match URL "'+n+'"'):e===404?(o="Not Found",a='No route matches URL "'+n+'"'):e===405&&(o="Method Not Allowed",l&&n&&r?a="You made a "+l.toUpperCase()+' request to "'+n+'" but '+('did not provide an `action` for route "'+r+'", ')+"so there is no way to handle the request.":l&&(a='Invalid request method "'+l.toUpperCase()+'"')),new vu(e||500,o,new Error(a),!0)}function Js(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(gn(n))return{result:n,idx:t}}}function Ld(e){let t=typeof e=="string"?Et(e):e;return Rn(fe({},t,{hash:""}))}function uv(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function yn(e){return e.type===se.deferred}function Xn(e){return e.type===se.error}function gn(e){return(e&&e.type)===se.redirect}function sv(e){let t=e;return t&&typeof t=="object"&&typeof t.data=="object"&&typeof t.subscribe=="function"&&typeof t.cancel=="function"&&typeof t.resolveData=="function"}function cv(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function fv(e){return qm.has(e.toLowerCase())}function ft(e){return Jm.has(e.toLowerCase())}async function Zs(e,t,n,r,l,i){for(let o=0;op.route.id===u.route.id),c=s!=null&&!Rd(s,u)&&(i&&i[u.route.id])!==void 0;if(yn(a)&&(l||c)){let p=r[o];V(p,"Expected an AbortSignal for revalidating fetcher deferred result"),await Td(a,p,l).then(m=>{m&&(n[o]=m||n[o])})}}}async function Td(e,t,n){if(n===void 0&&(n=!1),!await e.deferredData.resolveData(t)){if(n)try{return{type:se.data,data:e.deferredData.unwrappedData}}catch(l){return{type:se.error,error:l}}return{type:se.data,data:e.deferredData.data}}}function yu(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function va(e,t){let n=typeof t=="string"?Et(t).search:t.search;if(e[e.length-1].route.index&&yu(n||""))return e[e.length-1];let r=Ed(e);return r[r.length-1]}function qs(e){let{formMethod:t,formAction:n,formEncType:r,text:l,formData:i,json:o}=e;if(!(!t||!n||!r)){if(l!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:l};if(i!=null)return{formMethod:t,formAction:n,formEncType:r,formData:i,json:void 0,text:void 0};if(o!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:o,text:void 0}}}function go(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function dv(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function Lr(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function pv(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function $t(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function hv(e,t){try{let n=e.sessionStorage.getItem(Pd);if(n){let r=JSON.parse(n);for(let[l,i]of Object.entries(r||{}))i&&Array.isArray(i)&&t.set(l,new Set(i||[]))}}catch{}}function mv(e,t){if(t.size>0){let n={};for(let[r,l]of t)n[r]=[...l];try{e.sessionStorage.setItem(Pd,JSON.stringify(n))}catch(r){Pn(!1,"Failed to save applied view transitions in sessionStorage ("+r+").")}}}/** + * React Router v6.22.3 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function ul(){return ul=Object.assign?Object.assign.bind():function(e){for(var t=1;t{a.current=!0}),E.useCallback(function(s,c){if(c===void 0&&(c={}),!a.current)return;if(typeof s=="number"){r.go(s);return}let p=mu(s,JSON.parse(o),i,c.relative==="path");e==null&&t!=="/"&&(p.pathname=p.pathname==="/"?t:Lt([t,p.pathname])),(c.replace?r.replace:r.push)(p,c.state,c)},[t,r,o,i,e])}const gv=E.createContext(null);function wv(e){let t=E.useContext(sn).outlet;return t&&E.createElement(gv.Provider,{value:e},t)}function Ii(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=E.useContext(un),{matches:l}=E.useContext(sn),{pathname:i}=dr(),o=JSON.stringify(hu(l,r.v7_relativeSplatPath));return E.useMemo(()=>mu(e,JSON.parse(o),i,n==="path"),[e,o,i,n])}function Sv(e,t,n,r){ml()||V(!1);let{navigator:l}=E.useContext(un),{matches:i}=E.useContext(sn),o=i[i.length-1],a=o?o.params:{};o&&o.pathname;let u=o?o.pathnameBase:"/";o&&o.route;let s=dr(),c;if(t){var p;let C=typeof t=="string"?Et(t):t;u==="/"||(p=C.pathname)!=null&&p.startsWith(u)||V(!1),c=C}else c=s;let m=c.pathname||"/",k=m;if(u!=="/"){let C=u.replace(/^\//,"").split("/");k="/"+m.replace(/^\//,"").split("/").slice(C.length).join("/")}let S=Yn(e,{pathname:k}),w=Cv(S&&S.map(C=>Object.assign({},C,{params:Object.assign({},a,C.params),pathname:Lt([u,l.encodeLocation?l.encodeLocation(C.pathname).pathname:C.pathname]),pathnameBase:C.pathnameBase==="/"?u:Lt([u,l.encodeLocation?l.encodeLocation(C.pathnameBase).pathname:C.pathnameBase])})),i,n,r);return t&&w?E.createElement(Fi.Provider,{value:{location:ul({pathname:"/",search:"",hash:"",state:null,key:"default"},c),navigationType:de.Pop}},w):w}function _v(){let e=Tv(),t=kd(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,l={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return E.createElement(E.Fragment,null,E.createElement("h2",null,"Unexpected Application Error!"),E.createElement("h3",{style:{fontStyle:"italic"}},t),n?E.createElement("pre",{style:l},n):null,null)}const Ev=E.createElement(_v,null);class kv extends E.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?E.createElement(sn.Provider,{value:this.props.routeContext},E.createElement(Nd.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function xv(e){let{routeContext:t,match:n,children:r}=e,l=E.useContext(hl);return l&&l.static&&l.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(l.staticContext._deepestRenderedBoundaryId=n.route.id),E.createElement(sn.Provider,{value:t},r)}function Cv(e,t,n,r){var l;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var i;if((i=n)!=null&&i.errors)e=n.matches;else return null}let o=e,a=(l=n)==null?void 0:l.errors;if(a!=null){let c=o.findIndex(p=>p.route.id&&(a==null?void 0:a[p.route.id]));c>=0||V(!1),o=o.slice(0,Math.min(o.length,c+1))}let u=!1,s=-1;if(n&&r&&r.v7_partialHydration)for(let c=0;c=0?o=o.slice(0,s+1):o=[o[0]];break}}}return o.reduceRight((c,p,m)=>{let k,S=!1,w=null,C=null;n&&(k=a&&p.route.id?a[p.route.id]:void 0,w=p.route.errorElement||Ev,u&&(s<0&&m===0?(Dv("route-fallback",!1),S=!0,C=null):s===m&&(S=!0,C=p.route.hydrateFallbackElement||null)));let d=t.concat(o.slice(0,m+1)),f=()=>{let h;return k?h=w:S?h=C:p.route.Component?h=E.createElement(p.route.Component,null):p.route.element?h=p.route.element:h=c,E.createElement(xv,{match:p,routeContext:{outlet:c,matches:d,isDataRoute:n!=null},children:h})};return n&&(p.route.ErrorBoundary||p.route.errorElement||m===0)?E.createElement(kv,{location:n.location,revalidation:n.revalidation,component:w,error:k,children:f(),routeContext:{outlet:null,matches:d,isDataRoute:!0}}):f()},null)}var Md=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(Md||{}),wi=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(wi||{});function Pv(e){let t=E.useContext(hl);return t||V(!1),t}function Rv(e){let t=E.useContext(gu);return t||V(!1),t}function Lv(e){let t=E.useContext(sn);return t||V(!1),t}function Od(e){let t=Lv(),n=t.matches[t.matches.length-1];return n.route.id||V(!1),n.route.id}function Tv(){var e;let t=E.useContext(Nd),n=Rv(wi.UseRouteError),r=Od(wi.UseRouteError);return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function Nv(){let{router:e}=Pv(Md.UseNavigateStable),t=Od(wi.UseNavigateStable),n=E.useRef(!1);return Dd(()=>{n.current=!0}),E.useCallback(function(l,i){i===void 0&&(i={}),n.current&&(typeof l=="number"?e.navigate(l):e.navigate(l,ul({fromRouteId:t},i)))},[e,t])}const bs={};function Dv(e,t,n){!t&&!bs[e]&&(bs[e]=!0)}function zv(e){return wv(e.context)}function Mv(e){let{basename:t="/",children:n=null,location:r,navigationType:l=de.Pop,navigator:i,static:o=!1,future:a}=e;ml()&&V(!1);let u=t.replace(/^\/*/,"/"),s=E.useMemo(()=>({basename:u,navigator:i,static:o,future:ul({v7_relativeSplatPath:!1},a)}),[u,a,i,o]);typeof r=="string"&&(r=Et(r));let{pathname:c="/",search:p="",hash:m="",state:k=null,key:S="default"}=r,w=E.useMemo(()=>{let C=Mt(c,u);return C==null?null:{location:{pathname:C,search:p,hash:m,state:k,key:S},navigationType:l}},[u,c,p,m,k,S,l]);return w==null?null:E.createElement(un.Provider,{value:s},E.createElement(Fi.Provider,{children:n,value:w}))}new Promise(()=>{});function Ov(e){let t={hasErrorBoundary:e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&Object.assign(t,{element:E.createElement(e.Component),Component:void 0}),e.HydrateFallback&&Object.assign(t,{hydrateFallbackElement:E.createElement(e.HydrateFallback),HydrateFallback:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:E.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}/** + * React Router DOM v6.22.3 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function ur(){return ur=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[l]=e[l]);return n}function jv(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Fv(e,t){return e.button===0&&(!t||t==="_self")&&!jv(e)}function ya(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(l=>[n,l]):[[n,r]])},[]))}function Iv(e,t){let n=ya(e);return t&&t.forEach((r,l)=>{n.has(l)||t.getAll(l).forEach(i=>{n.append(l,i)})}),n}const Uv=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],Av=["aria-current","caseSensitive","className","end","style","to","unstable_viewTransition","children"],Bv="6";try{window.__reactRouterVersion=Bv}catch{}function $v(e,t){return rv({basename:t==null?void 0:t.basename,future:ur({},t==null?void 0:t.future,{v7_prependBasename:!0}),history:Rm({window:t==null?void 0:t.window}),hydrationData:(t==null?void 0:t.hydrationData)||Vv(),routes:e,mapRouteProperties:Ov,window:t==null?void 0:t.window}).initialize()}function Vv(){var e;let t=(e=window)==null?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=ur({},t,{errors:Hv(t.errors)})),t}function Hv(e){if(!e)return null;let t=Object.entries(e),n={};for(let[r,l]of t)if(l&&l.__type==="RouteErrorResponse")n[r]=new vu(l.status,l.statusText,l.data,l.internal===!0);else if(l&&l.__type==="Error"){if(l.__subType){let i=window[l.__subType];if(typeof i=="function")try{let o=new i(l.message);o.stack="",n[r]=o}catch{}}if(n[r]==null){let i=new Error(l.message);i.stack="",n[r]=i}}else n[r]=l;return n}const Fd=E.createContext({isTransitioning:!1}),Wv=E.createContext(new Map),Qv="startTransition",ec=mp[Qv],Kv="flushSync",tc=Pm[Kv];function Yv(e){ec?ec(e):e()}function Tr(e){tc?tc(e):e()}class Xv{constructor(){this.status="pending",this.promise=new Promise((t,n)=>{this.resolve=r=>{this.status==="pending"&&(this.status="resolved",t(r))},this.reject=r=>{this.status==="pending"&&(this.status="rejected",n(r))}})}}function Gv(e){let{fallbackElement:t,router:n,future:r}=e,[l,i]=E.useState(n.state),[o,a]=E.useState(),[u,s]=E.useState({isTransitioning:!1}),[c,p]=E.useState(),[m,k]=E.useState(),[S,w]=E.useState(),C=E.useRef(new Map),{v7_startTransition:d}=r||{},f=E.useCallback(P=>{d?Yv(P):P()},[d]),h=E.useCallback((P,T)=>{let{deletedFetchers:O,unstable_flushSync:j,unstable_viewTransitionOpts:K}=T;O.forEach(he=>C.current.delete(he)),P.fetchers.forEach((he,be)=>{he.data!==void 0&&C.current.set(be,he.data)});let ve=n.window==null||typeof n.window.document.startViewTransition!="function";if(!K||ve){j?Tr(()=>i(P)):f(()=>i(P));return}if(j){Tr(()=>{m&&(c&&c.resolve(),m.skipTransition()),s({isTransitioning:!0,flushSync:!0,currentLocation:K.currentLocation,nextLocation:K.nextLocation})});let he=n.window.document.startViewTransition(()=>{Tr(()=>i(P))});he.finished.finally(()=>{Tr(()=>{p(void 0),k(void 0),a(void 0),s({isTransitioning:!1})})}),Tr(()=>k(he));return}m?(c&&c.resolve(),m.skipTransition(),w({state:P,currentLocation:K.currentLocation,nextLocation:K.nextLocation})):(a(P),s({isTransitioning:!0,flushSync:!1,currentLocation:K.currentLocation,nextLocation:K.nextLocation}))},[n.window,m,c,C,f]);E.useLayoutEffect(()=>n.subscribe(h),[n,h]),E.useEffect(()=>{u.isTransitioning&&!u.flushSync&&p(new Xv)},[u]),E.useEffect(()=>{if(c&&o&&n.window){let P=o,T=c.promise,O=n.window.document.startViewTransition(async()=>{f(()=>i(P)),await T});O.finished.finally(()=>{p(void 0),k(void 0),a(void 0),s({isTransitioning:!1})}),k(O)}},[f,o,c,n.window]),E.useEffect(()=>{c&&o&&l.location.key===o.location.key&&c.resolve()},[c,m,l.location,o]),E.useEffect(()=>{!u.isTransitioning&&S&&(a(S.state),s({isTransitioning:!0,flushSync:!1,currentLocation:S.currentLocation,nextLocation:S.nextLocation}),w(void 0))},[u.isTransitioning,S]),E.useEffect(()=>{},[]);let _=E.useMemo(()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:P=>n.navigate(P),push:(P,T,O)=>n.navigate(P,{state:T,preventScrollReset:O==null?void 0:O.preventScrollReset}),replace:(P,T,O)=>n.navigate(P,{replace:!0,state:T,preventScrollReset:O==null?void 0:O.preventScrollReset})}),[n]),L=n.basename||"/",v=E.useMemo(()=>({router:n,navigator:_,static:!1,basename:L}),[n,_,L]);return E.createElement(E.Fragment,null,E.createElement(hl.Provider,{value:v},E.createElement(gu.Provider,{value:l},E.createElement(Wv.Provider,{value:C.current},E.createElement(Fd.Provider,{value:u},E.createElement(Mv,{basename:L,location:l.location,navigationType:l.historyAction,navigator:_,future:{v7_relativeSplatPath:n.future.v7_relativeSplatPath}},l.initialized||n.future.v7_partialHydration?E.createElement(Jv,{routes:n.routes,future:n.future,state:l}):t))))),null)}function Jv(e){let{routes:t,future:n,state:r}=e;return Sv(t,void 0,r,n)}const Zv=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",qv=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,bv=E.forwardRef(function(t,n){let{onClick:r,relative:l,reloadDocument:i,replace:o,state:a,target:u,to:s,preventScrollReset:c,unstable_viewTransition:p}=t,m=jd(t,Uv),{basename:k}=E.useContext(un),S,w=!1;if(typeof s=="string"&&qv.test(s)&&(S=s,Zv))try{let h=new URL(window.location.href),_=s.startsWith("//")?new URL(h.protocol+s):new URL(s),L=Mt(_.pathname,k);_.origin===h.origin&&L!=null?s=L+_.search+_.hash:w=!0}catch{}let C=vv(s,{relative:l}),d=ny(s,{replace:o,state:a,target:u,preventScrollReset:c,relative:l,unstable_viewTransition:p});function f(h){r&&r(h),h.defaultPrevented||d(h)}return E.createElement("a",ur({},m,{href:S||C,onClick:w||i?r:f,ref:n,target:u}))}),ey=E.forwardRef(function(t,n){let{"aria-current":r="page",caseSensitive:l=!1,className:i="",end:o=!1,style:a,to:u,unstable_viewTransition:s,children:c}=t,p=jd(t,Av),m=Ii(u,{relative:p.relative}),k=dr(),S=E.useContext(gu),{navigator:w,basename:C}=E.useContext(un),d=S!=null&&ly(m)&&s===!0,f=w.encodeLocation?w.encodeLocation(m).pathname:m.pathname,h=k.pathname,_=S&&S.navigation&&S.navigation.location?S.navigation.location.pathname:null;l||(h=h.toLowerCase(),_=_?_.toLowerCase():null,f=f.toLowerCase()),_&&C&&(_=Mt(_,C)||_);const L=f!=="/"&&f.endsWith("/")?f.length-1:f.length;let v=h===f||!o&&h.startsWith(f)&&h.charAt(L)==="/",P=_!=null&&(_===f||!o&&_.startsWith(f)&&_.charAt(f.length)==="/"),T={isActive:v,isPending:P,isTransitioning:d},O=v?r:void 0,j;typeof i=="function"?j=i(T):j=[i,v?"active":null,P?"pending":null,d?"transitioning":null].filter(Boolean).join(" ");let K=typeof a=="function"?a(T):a;return E.createElement(bv,ur({},p,{"aria-current":O,className:j,ref:n,style:K,to:u,unstable_viewTransition:s}),typeof c=="function"?c(T):c)});var ga;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(ga||(ga={}));var nc;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(nc||(nc={}));function ty(e){let t=E.useContext(hl);return t||V(!1),t}function ny(e,t){let{target:n,replace:r,state:l,preventScrollReset:i,relative:o,unstable_viewTransition:a}=t===void 0?{}:t,u=zd(),s=dr(),c=Ii(e,{relative:o});return E.useCallback(p=>{if(Fv(p,n)){p.preventDefault();let m=r!==void 0?r:Rn(s)===Rn(c);u(e,{replace:m,state:l,preventScrollReset:i,relative:o,unstable_viewTransition:a})}},[s,u,c,r,l,n,e,i,o,a])}function ry(e){let t=E.useRef(ya(e)),n=E.useRef(!1),r=dr(),l=E.useMemo(()=>Iv(r.search,n.current?null:t.current),[r.search]),i=zd(),o=E.useCallback((a,u)=>{const s=ya(typeof a=="function"?a(l):a);n.current=!0,i("?"+s,u)},[i,l]);return[l,o]}function ly(e,t){t===void 0&&(t={});let n=E.useContext(Fd);n==null&&V(!1);let{basename:r}=ty(ga.useViewTransitionState),l=Ii(e,{relative:t.relative});if(!n.isTransitioning)return!1;let i=Mt(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=Mt(n.nextLocation.pathname,r)||n.nextLocation.pathname;return pa(l.pathname,o)!=null||pa(l.pathname,i)!=null}function iy(e){const[t,n]=ry(),r=E.useRef(),l=E.useMemo(()=>{var s,c;return[t.get("bg")||((s=r.current)==null?void 0:s[0])||"#fff9e6",t.get("color")||((c=r.current)==null?void 0:c[1])||"#000"]},[t]);r.current=l;const[i,o]=E.useState(t.get("iframe_id")),[a,u]=E.useState(()=>[{title:"Base - Flat Data",path:"/base_flat_data"},{title:"Base - Tree Data",path:"/base_tree_data"},{title:"Custom Drag Trigger",path:"/custom_drag_trigger_flat_data"},{title:"Open",path:"/open_ids"},{title:"Checked",path:"/checked_ids"},{title:"Update Data",path:"/update_data"},{title:"Update Flat Data With Immer",path:"/update_flat_data_with_immer"},{title:"Update Tree Data With Immer",path:"/update_tree_data_with_immer"},{title:"Customize Placeholder and Node Box",path:"/customize_placeholder_and_node_box"},{title:"Draggable & Droppable",path:"/draggable_droppable"},{title:"Open Node when Drag over",path:"/dragopen"},{title:"Drag and Drop to External",path:"/external_drag"},{title:"Big Data with Virtual List",path:"/virtual_list"},{title:"Scroll to Node",path:"/scroll_to_node"},{title:"Custom Style",path:"/custom_style"},{title:"Home",path:"/"}]);return E.useLayoutEffect(()=>{const{ResizeObserver:s}=window,c=s&&new s(()=>{window.parent.postMessage({type:"iframeHeight",height:document.body.offsetHeight,id:i},"*")});return c==null||c.observe(document.body),()=>{c==null||c.disconnect()}},[]),q.jsxs("div",{className:"page-layout",children:[q.jsx(zv,{}),q.jsxs("div",{className:"main-menu fixed top-1 right-2 px-4 py-4 bg-gray-100 max-md:hidden",children:[q.jsx("div",{className:"text-xl font-bold mb-5 text-black",children:"Menu"}),a.map((s,c)=>q.jsx("div",{className:"menu-item py-1",children:q.jsx(ey,{to:s.path,children:s.title})},c))]}),q.jsx("style",{children:` + body{ + margin: 0; + background-color: ${l[0]}; + color: ${l[1]}; + } + .main-menu{ + } + .main-menu a{ + text-decoration: none; + } + .main-menu a.active{ + font-weight: bold; + } + .main-menu a:hover{ + text-decoration: underline; + } + `})]})}const De={home:E.lazy(()=>Le(()=>import("./index-A_ZwqF_5.js"),__vite__mapDeps([]))),base_tree_data:E.lazy(()=>Le(()=>import("./base_tree_data-ImaopUth.js"),__vite__mapDeps([0,1]))),base_flat_data:E.lazy(()=>Le(()=>import("./base_flat_data-BHMljvlY.js"),__vite__mapDeps([2,1]))),custom_drag_trigger_flat_data:E.lazy(()=>Le(()=>import("./custom_drag_trigger_flat_data-7wB0GH25.js"),__vite__mapDeps([3,1]))),open_ids:E.lazy(()=>Le(()=>import("./open_ids-BtZwvtxr.js"),__vite__mapDeps([4,1]))),checked_ids:E.lazy(()=>Le(()=>import("./checked_ids-CIHCriBZ.js"),__vite__mapDeps([5,1]))),update_data:E.lazy(()=>Le(()=>import("./update_data-DuWC4pa0.js"),__vite__mapDeps([6,1]))),update_flat_data_with_immer:E.lazy(()=>Le(()=>import("./update_flat_data_with_immer-DWMbCgdo.js"),__vite__mapDeps([7,1,8]))),update_tree_data_with_immer:E.lazy(()=>Le(()=>import("./update_tree_data_with_immer-DNl8HLwr.js"),__vite__mapDeps([9,1,8]))),customize_placeholder_and_node_box:E.lazy(()=>Le(()=>import("./customize_placeholder_and_node_box-LD6y-60m.js"),__vite__mapDeps([10,1]))),draggable_droppable:E.lazy(()=>Le(()=>import("./draggable_droppable-CC59tBiR.js"),__vite__mapDeps([11,1]))),dragopen:E.lazy(()=>Le(()=>import("./dragopen-WenjLppC.js"),__vite__mapDeps([12,1]))),external_drag:E.lazy(()=>Le(()=>import("./external_drag-fXwcXea6.js"),__vite__mapDeps([13,1,8]))),virtual_list:E.lazy(()=>Le(()=>import("./virtual_list-Iugknds9.js"),__vite__mapDeps([14,1]))),scroll_to_node:E.lazy(()=>Le(()=>import("./scroll_to_node-CxFLGpCA.js"),__vite__mapDeps([15,1]))),custom_style:E.lazy(()=>Le(()=>import("./custom_style-D_9Sq9cn.js"),__vite__mapDeps([16,1])))},oy=$v([{path:"/",element:q.jsx(iy,{}),children:[{path:"/",element:q.jsx(De.home,{})},{path:"/base_tree_data",element:q.jsx(De.base_tree_data,{})},{path:"/base_flat_data",element:q.jsx(De.base_flat_data,{})},{path:"/custom_drag_trigger_flat_data",element:q.jsx(De.custom_drag_trigger_flat_data,{})},{path:"/open_ids",element:q.jsx(De.open_ids,{})},{path:"/checked_ids",element:q.jsx(De.checked_ids,{})},{path:"/update_data",element:q.jsx(De.update_data,{})},{path:"/update_flat_data_with_immer",element:q.jsx(De.update_flat_data_with_immer,{})},{path:"/update_tree_data_with_immer",element:q.jsx(De.update_tree_data_with_immer,{})},{path:"/customize_placeholder_and_node_box",element:q.jsx(De.customize_placeholder_and_node_box,{})},{path:"/draggable_droppable",element:q.jsx(De.draggable_droppable,{})},{path:"/dragopen",element:q.jsx(De.dragopen,{})},{path:"/external_drag",element:q.jsx(De.external_drag,{})},{path:"/virtual_list",element:q.jsx(De.virtual_list,{})},{path:"/scroll_to_node",element:q.jsx(De.scroll_to_node,{})},{path:"/custom_style",element:q.jsx(De.custom_style,{})}]}]);wo.createRoot(document.getElementById("root")).render(q.jsx(hc.StrictMode,{children:q.jsx(E.Suspense,{fallback:q.jsx("span",{children:"loading"}),children:q.jsx(Gv,{router:oy})})}));export{hc as J,q as j,E as r}; diff --git a/v1-demo-windowed/assets/index-DyEgS_Py.css b/v1-demo-windowed/assets/index-DyEgS_Py.css new file mode 100644 index 0000000..6147d3e --- /dev/null +++ b/v1-demo-windowed/assets/index-DyEgS_Py.css @@ -0,0 +1 @@ +*,:before,:after{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 rgb(0 0 0 / 0);--un-ring-shadow:0 0 rgb(0 0 0 / 0);--un-shadow-inset: ;--un-shadow:0 0 rgb(0 0 0 / 0);--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgb(147 197 253 / .5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: }::backdrop{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 rgb(0 0 0 / 0);--un-ring-shadow:0 0 rgb(0 0 0 / 0);--un-shadow-inset: ;--un-shadow:0 0 rgb(0 0 0 / 0);--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgb(147 197 253 / .5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: }.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.mb-5{margin-bottom:1.25rem}.me{margin-inline-end:1rem}.block{display:block}.hidden{display:none}.h-full{height:100%}.w-full{width:100%}.flex{display:flex}.items-center{align-items:center}.justify-center{justify-content:center}.border{border-width:1px}.bg-gray-100{--un-bg-opacity:1;background-color:rgb(243 244 246 / var(--un-bg-opacity))}.px,.px-4{padding-left:1rem;padding-right:1rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-4{padding-top:1rem;padding-bottom:1rem}.pl{padding-left:1rem}.text-center{text-align:center}.indent{text-indent:1.5rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-black{--un-text-opacity:1;color:rgb(0 0 0 / var(--un-text-opacity))}.font-bold{font-weight:700}.underline{text-decoration-line:underline}.top-0{top:0}.top-1{top:1px}.right-2{right:2px}.left-0{left:0}@media (max-width: 767.9px){.max-md\:hidden{display:none}} diff --git a/v1-demo-windowed/assets/open_ids-BtZwvtxr.js b/v1-demo-windowed/assets/open_ids-BtZwvtxr.js new file mode 100644 index 0000000..bbda07b --- /dev/null +++ b/v1-demo-windowed/assets/open_ids-BtZwvtxr.js @@ -0,0 +1 @@ +import{r as l,j as e}from"./index-BNKuAD6d.js";import{s as u,u as x,o as p}from"./HeTree-B-DJf59j.js";function j(){const a={idKey:"id",parentIdKey:"parent_id"},[o,c]=l.useState(()=>u([{id:1,parent_id:null,name:"Root Category"},{id:2,parent_id:1,name:"Technology"},{id:5,parent_id:2,name:"Hardware"},{id:10,parent_id:5,name:"Computer Components"},{id:4,parent_id:2,name:"Programming"},{id:8,parent_id:4,name:"Python"},{id:3,parent_id:1,name:"Science"},{id:7,parent_id:3,name:"Biology"},{id:6,parent_id:3,name:"Physics"}],a)),[d,n]=l.useState([]),m=(t,s)=>{n(s?[...d||r,t]:(d||r).filter(i=>i!==t))},{renderTree:h,allIds:r}=x({...a,data:o,dataType:"flat",onChange:c,openIds:d,renderNode:({id:t,node:s,open:i,checked:y,draggable:g})=>e.jsxs("div",{children:[e.jsx("button",{onClick:()=>m(t,!i),children:i?"-":"+"}),s.name," - ",t]})});return e.jsxs("div",{children:[e.jsx("button",{onClick:()=>n(r),children:"Open All"}),e.jsx("button",{onClick:()=>n([]),children:"Close All"}),e.jsx("button",{onClick:()=>n(p(o,d||r,8,a)),children:"Open 'Python'"}),e.jsx("button",{onClick:()=>n(p(o,[],8,a)),children:"Only Open 'Python'"}),h({style:{width:"300px",border:"1px solid #555",padding:"20px"}})]})}export{j as default}; diff --git a/v1-demo-windowed/assets/scroll_to_node-CxFLGpCA.js b/v1-demo-windowed/assets/scroll_to_node-CxFLGpCA.js new file mode 100644 index 0000000..3a43ee7 --- /dev/null +++ b/v1-demo-windowed/assets/scroll_to_node-CxFLGpCA.js @@ -0,0 +1 @@ +import{r as c,j as a}from"./index-BNKuAD6d.js";import{s as x,u as f}from"./HeTree-B-DJf59j.js";function b(){const t={idKey:"id",parentIdKey:"pid"},[e,o]=c.useState(()=>x(g(),t)),[d,r]=c.useState([]),s=(n,p)=>{r(p?[...d||i,n]:(d||i).filter(l=>l!==n))},{renderTree:u,allIds:i,scrollToNode:h}=f({...t,data:e,dataType:"flat",onChange:o,openIds:d,virtual:!0,renderNode:({id:n,node:p,open:l,checked:j,draggable:m})=>a.jsxs("div",{children:[a.jsx("button",{onClick:()=>s(n,!l),children:l?"-":"+"}),n]})});return a.jsxs("div",{children:[a.jsx("button",{onClick:()=>h(910),children:"Scroll to 910"}),u({style:{width:"300px",height:"300px",border:"1px solid #555",padding:"20px"}})]})}function g(){const t=()=>e.length,e=[];for(let o=0;o<1e3;o++){let d=t();e.push({id:d,pid:null});for(let s=0;s<4;s++)e.push({id:t(),pid:d});let r=t();e.push({id:r,pid:null});for(let s=0;s<4;s++)e.push({id:t(),pid:r})}return e}export{b as default}; diff --git a/v1-demo-windowed/assets/update_data-DuWC4pa0.js b/v1-demo-windowed/assets/update_data-DuWC4pa0.js new file mode 100644 index 0000000..f6976c2 --- /dev/null +++ b/v1-demo-windowed/assets/update_data-DuWC4pa0.js @@ -0,0 +1 @@ +import{r as s,j as a}from"./index-BNKuAD6d.js";import{s as m,u,b as x,r as h}from"./HeTree-B-DJf59j.js";function g(){const n={idKey:"id",parentIdKey:"parent_id"},[r,d]=s.useState(()=>m([{id:1,parent_id:null,name:"Root Category"},{id:2,parent_id:1,name:"Technology"},{id:5,parent_id:2,name:"Hardware"},{id:10,parent_id:5,name:"Computer Components"},{id:4,parent_id:2,name:"Programming"},{id:8,parent_id:4,name:"Python"},{id:3,parent_id:1,name:"Science"},{id:7,parent_id:3,name:"Biology"},{id:6,parent_id:3,name:"Physics"}],n)),p=e=>{let t=parseInt(Math.random().toString().substring(2,5)),i=[...r];x(i,{id:t,parent_id:e,name:"New"},0,n),d(i)},c=e=>{let t=[...r];h(t,e,n),d(t)},o=s.useRef();o.current=o.current||r;const{renderTree:l}=u({...n,data:r,dataType:"flat",onChange:d,renderNode:({id:e,node:t,draggable:i})=>a.jsxs("div",{children:[a.jsx("button",{draggable:i,children:"👉"}),t.name," - ",e," -",a.jsx("button",{onClick:()=>p(e),children:"+"}),a.jsx("button",{onClick:()=>c(e),children:"-"})]})});return a.jsxs("div",{children:[a.jsx("button",{onClick:()=>d(o.current),children:"Restore"}),l({style:{width:"300px",border:"1px solid #555",padding:"20px"}})]})}export{g as default}; diff --git a/v1-demo-windowed/assets/update_flat_data_with_immer-DWMbCgdo.js b/v1-demo-windowed/assets/update_flat_data_with_immer-DWMbCgdo.js new file mode 100644 index 0000000..5a1d3ee --- /dev/null +++ b/v1-demo-windowed/assets/update_flat_data_with_immer-DWMbCgdo.js @@ -0,0 +1 @@ +import{r as u,j as t}from"./index-BNKuAD6d.js";import{u as x,s as h,b as y,r as _}from"./HeTree-B-DJf59j.js";import{i as g}from"./use-immer.module-yv4BBfO6.js";function C(){const i={idKey:"id",parentIdKey:"parent_id"},[o,a]=g(()=>h([{id:1,parent_id:null,name:"Root Category"},{id:2,parent_id:1,name:"Technology"},{id:5,parent_id:2,name:"Hardware"},{id:10,parent_id:5,name:"Computer Components"},{id:4,parent_id:2,name:"Programming"},{id:8,parent_id:4,name:"Python"},{id:3,parent_id:1,name:"Science"},{id:7,parent_id:3,name:"Biology"},{id:6,parent_id:3,name:"Physics"}],i)),s=e=>{let n=parseInt(Math.random().toString().substring(2,5));a(r=>{y(r,{id:n,parent_id:e,name:"New"},0,i)})},m=e=>{a(n=>{_(n,e,i)})},p=e=>{let n=prompt("Enter new name");a(r=>{n&&(r.find(l=>l.id===e).name=n)})},d=u.useRef();d.current=d.current||o;const{renderTree:c}=x({...i,data:o,dataType:"flat",onChange:a,renderNode:({id:e,node:n,draggable:r})=>t.jsxs("div",{children:[t.jsx("button",{draggable:r,children:"👉"}),n.name," - ",e," -",t.jsx("button",{onClick:()=>s(e),children:"+"}),t.jsx("button",{onClick:()=>m(e),children:"-"}),t.jsx("button",{onClick:()=>p(e),children:"Edit"})]})});return t.jsxs("div",{children:[t.jsx("button",{onClick:()=>a(d.current),children:"Restore"}),c({style:{width:"300px",border:"1px solid #555",padding:"20px"}})]})}export{C as default}; diff --git a/v1-demo-windowed/assets/update_tree_data_with_immer-DNl8HLwr.js b/v1-demo-windowed/assets/update_tree_data_with_immer-DNl8HLwr.js new file mode 100644 index 0000000..08626c7 --- /dev/null +++ b/v1-demo-windowed/assets/update_tree_data_with_immer-DNl8HLwr.js @@ -0,0 +1 @@ +import{r as f,j as d}from"./index-BNKuAD6d.js";import{u as g,f as s}from"./HeTree-B-DJf59j.js";import{i as y}from"./use-immer.module-yv4BBfO6.js";function k(){const r="children",m={idKey:"id",childrenKey:r},[l,o]=y(()=>[{id:1,name:"Root Category",children:[{id:2,name:"Technology",children:[{id:5,name:"Hardware",children:[{id:10,name:"Computer Components",children:[]}]},{id:4,name:"Programming",children:[{id:8,name:"Python",children:[]}]}]},{id:3,name:"Science",children:[{id:7,name:"Biology",children:[]},{id:6,name:"Physics",children:[]}]}]}]),h=e=>{let n=parseInt(Math.random().toString().substring(2,5));o(t=>{s(t,i=>i.id===e,r)[r].unshift({id:n,name:"New",[r]:[]})})},u=(e,n)=>{o(t=>{const i=s(t,c=>c.id===n,r)[r];i.splice(i.findIndex(c=>c.id===e),1)})},p=e=>{let n=prompt("Enter new name");o(t=>{n&&(s(t,i=>i.id===e,r).name=n)})},a=f.useRef();a.current=a.current||l;const{renderTree:x}=g({...m,data:l,dataType:"tree",onChange:o,renderNode:({id:e,pid:n,node:t,draggable:i})=>d.jsxs("div",{children:[d.jsx("button",{draggable:i,children:"👉"}),t.name," - ",e," -",d.jsx("button",{onClick:()=>h(e),children:"+"}),d.jsx("button",{onClick:()=>u(e,n),children:"-"}),d.jsx("button",{onClick:()=>p(e),children:"Edit"})]})});return d.jsxs("div",{children:[d.jsx("button",{onClick:()=>o(a.current),children:"Restore"}),x({style:{width:"300px",border:"1px solid #555",padding:"20px"}})]})}export{k as default}; diff --git a/v1-demo-windowed/assets/use-immer.module-yv4BBfO6.js b/v1-demo-windowed/assets/use-immer.module-yv4BBfO6.js new file mode 100644 index 0000000..c134862 --- /dev/null +++ b/v1-demo-windowed/assets/use-immer.module-yv4BBfO6.js @@ -0,0 +1 @@ +import{r as T}from"./index-BNKuAD6d.js";var B=Symbol.for("immer-nothing"),I=Symbol.for("immer-draftable"),s=Symbol.for("immer-state");function a(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var h=Object.getPrototypeOf;function p(e){return!!e&&!!e[s]}function y(e){var t;return e?G(e)||Array.isArray(e)||!!e[I]||!!((t=e.constructor)!=null&&t[I])||O(e)||A(e):!1}var Y=Object.prototype.constructor.toString();function G(e){if(!e||typeof e!="object")return!1;const t=h(e);if(t===null)return!0;const r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return r===Object?!0:typeof r=="function"&&Function.toString.call(r)===Y}function m(e,t){F(e)===0?Object.entries(e).forEach(([r,n])=>{t(r,n,e)}):e.forEach((r,n)=>t(n,r,e))}function F(e){const t=e[s];return t?t.type_:Array.isArray(e)?1:O(e)?2:A(e)?3:0}function k(e,t){return F(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function H(e,t,r){const n=F(e);n===2?e.set(t,r):n===3?e.add(r):e[t]=r}function Z(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function O(e){return e instanceof Map}function A(e){return e instanceof Set}function l(e){return e.copy_||e.base_}function v(e,t){if(O(e))return new Map(e);if(A(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);if(!t&&G(e))return h(e)?{...e}:Object.assign(Object.create(null),e);const r=Object.getOwnPropertyDescriptors(e);delete r[s];let n=Reflect.ownKeys(r);for(let i=0;i1&&(e.set=e.add=e.clear=e.delete=L),Object.freeze(e),t&&m(e,(r,n)=>P(n,!0))),e}function L(){a(2)}function D(e){return Object.isFrozen(e)}var V={};function d(e){const t=V[e];return t||a(0,e),t}var w;function X(){return w}function ee(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function j(e,t){t&&(d("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function E(e){M(e),e.drafts_.forEach(te),e.drafts_=null}function M(e){e===w&&(w=e.parent_)}function W(e){return w=ee(w,e)}function te(e){const t=e[s];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function K(e,t){t.unfinalizedDrafts_=t.drafts_.length;const r=t.drafts_[0];return e!==void 0&&e!==r?(r[s].modified_&&(E(t),a(4)),y(e)&&(e=S(t,e),t.parent_||g(t,e)),t.patches_&&d("Patches").generateReplacementPatches_(r[s].base_,e,t.patches_,t.inversePatches_)):e=S(t,r,[]),E(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==B?e:void 0}function S(e,t,r){if(D(t))return t;const n=t[s];if(!n)return m(t,(i,o)=>U(e,n,t,i,o,r)),t;if(n.scope_!==e)return t;if(!n.modified_)return g(e,n.base_,!0),n.base_;if(!n.finalized_){n.finalized_=!0,n.scope_.unfinalizedDrafts_--;const i=n.copy_;let o=i,f=!1;n.type_===3&&(o=new Set(i),i.clear(),f=!0),m(o,(c,_)=>U(e,n,i,c,_,r,f)),g(e,i,!1),r&&e.patches_&&d("Patches").generatePatches_(n,r,e.patches_,e.inversePatches_)}return n.copy_}function U(e,t,r,n,i,o,f){if(p(i)){const c=o&&t&&t.type_!==3&&!k(t.assigned_,n)?o.concat(n):void 0,_=S(e,i,c);if(H(r,n,_),p(_))e.canAutoFreeze_=!1;else return}else f&&r.add(i);if(y(i)&&!D(i)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;S(e,i),(!t||!t.scope_.parent_)&&g(e,i)}}function g(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&P(t,r)}function re(e,t){const r=Array.isArray(e),n={type_:r?1:0,scope_:t?t.scope_:X(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let i=n,o=x;r&&(i=[n],o=z);const{revoke:f,proxy:c}=Proxy.revocable(i,o);return n.draft_=c,n.revoke_=f,c}var x={get(e,t){if(t===s)return e;const r=l(e);if(!k(r,t))return ne(e,r,t);const n=r[t];return e.finalized_||!y(n)?n:n===b(e.base_,t)?(C(e),e.copy_[t]=N(n,e)):n},has(e,t){return t in l(e)},ownKeys(e){return Reflect.ownKeys(l(e))},set(e,t,r){const n=$(l(e),t);if(n!=null&&n.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){const i=b(l(e),t),o=i==null?void 0:i[s];if(o&&o.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(Z(r,i)&&(r!==void 0||k(e.base_,t)))return!0;C(e),R(e)}return e.copy_[t]===r&&(r!==void 0||t in e.copy_)||Number.isNaN(r)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=r,e.assigned_[t]=!0),!0},deleteProperty(e,t){return b(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,C(e),R(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const r=l(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:n.enumerable,value:r[t]}},defineProperty(){a(11)},getPrototypeOf(e){return h(e.base_)},setPrototypeOf(){a(12)}},z={};m(x,(e,t)=>{z[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});z.deleteProperty=function(e,t){return z.set.call(this,e,t,void 0)};z.set=function(e,t,r){return x.set.call(this,e[0],t,r,e[0])};function b(e,t){const r=e[s];return(r?l(r):e)[t]}function ne(e,t,r){var i;const n=$(t,r);return n?"value"in n?n.value:(i=n.get)==null?void 0:i.call(e.draft_):void 0}function $(e,t){if(!(t in e))return;let r=h(e);for(;r;){const n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=h(r)}}function R(e){e.modified_||(e.modified_=!0,e.parent_&&R(e.parent_))}function C(e){e.copy_||(e.copy_=v(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var ie=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,r,n)=>{if(typeof t=="function"&&typeof r!="function"){const o=r;r=t;const f=this;return function(_=o,...J){return f.produce(_,Q=>r.call(this,Q,...J))}}typeof r!="function"&&a(6),n!==void 0&&typeof n!="function"&&a(7);let i;if(y(t)){const o=W(this),f=N(t,void 0);let c=!0;try{i=r(f),c=!1}finally{c?E(o):M(o)}return j(o,n),K(i,o)}else if(!t||typeof t!="object"){if(i=r(t),i===void 0&&(i=t),i===B&&(i=void 0),this.autoFreeze_&&P(i,!0),n){const o=[],f=[];d("Patches").generateReplacementPatches_(t,i,o,f),n(o,f)}return i}else a(1,t)},this.produceWithPatches=(t,r)=>{if(typeof t=="function")return(f,...c)=>this.produceWithPatches(f,_=>t(_,...c));let n,i;return[this.produce(t,r,(f,c)=>{n=f,i=c}),n,i]},typeof(e==null?void 0:e.autoFreeze)=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof(e==null?void 0:e.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){y(e)||a(8),p(e)&&(e=oe(e));const t=W(this),r=N(e,void 0);return r[s].isManual_=!0,M(t),r}finishDraft(e,t){const r=e&&e[s];(!r||!r.isManual_)&&a(9);const{scope_:n}=r;return j(n,t),K(void 0,n)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let r;for(r=t.length-1;r>=0;r--){const i=t[r];if(i.path.length===0&&i.op==="replace"){e=i.value;break}}r>-1&&(t=t.slice(r+1));const n=d("Patches").applyPatches_;return p(e)?n(e,t):this.produce(e,i=>n(i,t))}};function N(e,t){const r=O(e)?d("MapSet").proxyMap_(e,t):A(e)?d("MapSet").proxySet_(e,t):re(e,t);return(t?t.scope_:X()).drafts_.push(r),r}function oe(e){return p(e)||a(10,e),q(e)}function q(e){if(!y(e)||D(e))return e;const t=e[s];let r;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=v(e,t.scope_.immer_.useStrictShallowCopy_)}else r=v(e,!0);return m(r,(n,i)=>{H(r,n,q(i))}),t&&(t.finalized_=!1),r}var u=new ie,fe=u.produce;u.produceWithPatches.bind(u);u.setAutoFreeze.bind(u);u.setUseStrictShallowCopy.bind(u);u.applyPatches.bind(u);u.createDraft.bind(u);u.finishDraft.bind(u);function se(e){var t=T.useState(function(){return P(typeof e=="function"?e():e,!0)}),r=t[1];return[t[0],T.useCallback(function(n){r(typeof n=="function"?fe(n):P(n))},[])]}export{se as i}; diff --git a/v1-demo-windowed/assets/virtual_list-Iugknds9.js b/v1-demo-windowed/assets/virtual_list-Iugknds9.js new file mode 100644 index 0000000..a5e057b --- /dev/null +++ b/v1-demo-windowed/assets/virtual_list-Iugknds9.js @@ -0,0 +1 @@ +import{r as u,j as o}from"./index-BNKuAD6d.js";import{s as h,u as f}from"./HeTree-B-DJf59j.js";function I(){const t={idKey:"id",parentIdKey:"pid"},[e,a]=u.useState(()=>h(x(),t)),[d,r]=u.useState([]),s=(n,p)=>{r(p?[...d||l,n]:(d||l).filter(i=>i!==n))},{renderTree:c,allIds:l}=f({...t,data:e,dataType:"flat",onChange:a,openIds:d,virtual:!0,renderNode:({id:n,node:p,open:i,checked:g,draggable:j})=>o.jsxs("div",{children:[o.jsx("button",{onClick:()=>s(n,!i),children:i?"-":"+"}),n]})});return o.jsx("div",{children:c({style:{width:"300px",height:"300px",border:"1px solid #555",padding:"20px"}})})}function x(){const t=()=>e.length,e=[];for(let a=0;a<1e3;a++){let d=t();e.push({id:d,pid:null});for(let s=0;s<4;s++)e.push({id:t(),pid:d});let r=t();e.push({id:r,pid:null});for(let s=0;s<4;s++)e.push({id:t(),pid:r})}return e}export{I as default}; diff --git a/v1-demo-windowed/index.html b/v1-demo-windowed/index.html new file mode 100644 index 0000000..3196b5e --- /dev/null +++ b/v1-demo-windowed/index.html @@ -0,0 +1,14 @@ + + + + + + + he-tree-react + + + + +
+ + diff --git a/v1/api.html b/v1/api.html new file mode 100644 index 0000000..4083b39 --- /dev/null +++ b/v1/api.html @@ -0,0 +1,135 @@ + + + + + + API | He Tree React + + + + + + + + + + + + + + + +
Skip to content

API

Exported

The exported variables, methods, and Typescript types.

Typescript types:

  • Id: node id, parent id. Type: string | number.
  • Stat: Node information.
  • HeTreeProps: Options for useHeTree.

useHeTree

ts
import { useHeTree } from "he-tree-react";
+const {/* return */} = useHeTree({/* options */}) // prettier-ignore

The main function of this library. React hook. The arguments are as follows:

  • options: Options, type is object. The following are some properties in options:

    NameTypeDefaultDescription
    dataArrayData. Check Data Types.
    dataType'flat', 'tree''flat'Data Types
    idKeystring'id'key of id 名.
    parentIdKeystring'parent_id'key of the parent id. For flat data only.
    childrenKeystring'children'key of children nodes. For tree data only.
    indentnumber20Node indentation, unit is px.
    dragOpenbooleanfalseWhether to enable the function "Open node when dragging over node".
    dragOpenDelaynumber600The waiting time to open the node when dragging over the node. The unit is milliseconds.
    onDragOpenfunction(stat): voidThe callback of "Open node when dragging over node".
    direction'lrt', 'rtl''ltr'Display direction, ltr is displayed from left to right, rtl is the opposite.
    rootIdstring, nullnullThe parent id of a node that has not parent in flat data.
    virtualbooleanfalseWhether to enable virtualization. Used to improve performance when there is a lot of data.
    keepPlaceholderbooleanfalseWhether to retain placeholder when dragging out of the tree. It is recommended to enable this only on one tree page.
    openIdsArrayAll open nodes' id.
    checkedIdsArrayAll checked nodes' id.
    isFunctionReactivebooleanfalseWhether to listen for change of the callback functions. Reference

    The remaining callback functions in options:

    NameTypeDescription
    renderNode(stat)=> ReactNodeNode render.
    renderNodeBox({stat, attrs, isPlaceholder})=> ReactNodenodeBox's render. Reference.
    onChange(newData)=>voidCallback on data change
    canDrag(stat)=>boolean, null, undefined, voidWhether a node draggable. Returning null, undefined, void means inheriting the parent node.
    canDrop(stat, index)=>boolean, null, undefined, voidWhether a node droppable. Returning null, undefined, void means inheriting the parent node. The parameter index may be empty. If it is not empty, it indicates the position.
    customDragImage(event, stat)=> voidCalled event.dataTransfer.setDragImage to custom drag image. Reference.
    onDragStart(event, stat)=> void
    onExternalDragOver(event)=>booleanCalled when drag from external. Must return a Boolean value to indicate whether to handle this drag.
    onDragOver(event, stat, isExternal)=> voidisExternal indicates whether the drag is from outside.
    onDragEnd(event, stat, isOutside)=>voidCalled on dragend and this drag is started in this tree. stat is the stat of the dragged node. isOutside indicates whether it ended outside the tree.
    onExternalDrop(event, parentStat, index)=>voidCalled when the external drag ends on this tree. parentStat is the stat of the target parent node, and when it is empty, it represents the root of the tree. Index is the target position, the index of the node among siblings.

Return of useHeTree

The return of useHeTree is an object, including some states and methods. Note, this object will change every time. Do not rely on this object, but you can rely on the properties of this object. The properties are as follows:

NameTypeDescription
renderTree(options?: { className?: string, style?: React.CSSProperties }): ReactNodeTree render. Options can be passed in className and style to control the style of the root element.
getStat(idOrNodeOrStat)=>statGet stat by id, or node data, or stat object.
allIdsArrayThe ids of all nodes.
rootIdsArrayThe ids of all root nodes
rootNodesArrayAll root nodes. In tree data, it is same with options.data.
rootStatsArrayAll root nodes' stat.
placeholder{parentStat, index, level}Drag placeholder info. Null if it does not exist.
draggingStatstatWhen a drag is initiated from this tree, the stat of the dragged node. Null if it does not exist.
dragOverStatstatDragging over node's stat. May be null.
visibleIdsArrayAll visible nodes' id.
attrsListArrayAll visible nodes' attrs.
virtualListRefrefref of virtual list component, Check virtual list.
scrollToNode(idOrNodeOrStat)=>booleanScroll to node. The argument can be id, node or stat. If node not found or invisible, it return false. Example

walkTreeDataGenerator

The method of traversing tree data through for of. Executing skipChildren() in the loop will skip all child nodes of the node, and executing exitWalk will end the traversal.

ts
for (const [
+  node,
+  { parent, parents, siblings, index, skipChildren, exitWalk },
+] of walkTreeDataGenerator(data, "children")) {
+  // ...
+}

walkTreeData

The method to traverse tree data through the callback method. Executing skipChildren() in the callback method will skip all child nodes of the node, and executing exitWalk will end the traversal.

ts
walkTreeDataGenerator(
+  data,
+  (node, { parent, parents, siblings, index, skipChildren, exitWalk }) => {
+    // ...
+  },
+  "children"
+);

findTreeData

Like Array.prototype.find. Returns the first node found. Executing skipChildren() in the callback method will skip all child nodes of the node, and executing exitWalk will end the traversal.

ts
let foundNode = findTreeData(
+  data,
+  (node, { parent, parents, siblings, index, skipChildren, exitWalk }) => {
+    // return node.id === 1;
+  },
+  "children"
+);

filterTreeData

Like Array.prototype.filter. Returns all nodes found. Executing skipChildren() in the callback method will skip all child nodes of the node, and executing exitWalk will end the traversal.

ts
let nodes = filterTreeData(
+  data,
+  (node, { parent, parents, siblings, index, skipChildren, exitWalk }) => {
+    // return node.id > 1;
+  },
+  "children"
+);

openParentsInTreeData

Open all parent nodes of a single or multiple nodes to make the node visible. Reference.

(
+  treeData,
+  openIds: Id[],
+  idOrIds: Id | Id[],
+  options?: {idKey: string, childrenKey: string}
+): newOpenIds

updateCheckedInTreeData

Update the checked status of a single node or multiple nodes. This will update both their children and parents. Reference.

(
+  treeData,
+  checkedIds: Id[],
+  idOrIds: Id | Id[],
+  checked: boolean,
+  options?: {idKey: string, childrenKey: string}
+): [newCheckedIds, newSemiCheckedIds]

sortFlatData

Sort the flat data according to the order of the nodes in the tree. Return the new sorted array. Your data should use it to ensure order after initialized.

(
+  flatData,
+  options?: {idKey: string, parentIdKey: string}
+): sortedData

walkFlatDataGenerator

The method of traversing flat data through for of. Executing skipChildren() in the loop will skip all the child nodes of the node, and executing exitWalk will end the traversal. Make sure the order of your data is correct before using it.

Compared to walkTreeDataGenerator, it lacks siblings, but has treeIndex, id, pid. treeIndex is the index of the node in the tree.

ts
for (const [
+  node,
+  { parent, parents, index, treeIndex, id, pid, skipChildren, exitWalk },
+] of walkFlatDataGenerator(flatData, {
+  idKey: "id",
+  parentIdKey: "parent_id",
+})) {
+  // ...
+}

walkFlatData

The method of traversing flat data through the callback method. Executing skipChildren() in the callback method will skip all child nodes of the node, and executing exitWalk will end the traversal. Before using, make sure that the order of your data is correct.

ts
walkFlatData(
+  flatData,
+  (
+    node,
+    { parent, parents, index, treeIndex, id, pid, skipChildren, exitWalk }
+  ) => {
+    // ...
+  },
+  {
+    idKey: "id",
+    parentIdKey: "parent_id",
+  }
+);

openParentsInFlatData

Open all parent nodes of a single or multiple nodes to make the node visible. Make sure your data is in the correct order before using it. Reference.

(
+  flatData,
+  openIds: Id[],
+  idOrIds: Id | Id[],
+  options?: {
+    idKey: "id",
+    parentIdKey: "parent_id",
+  }
+): newOpenIds

updateCheckedInFlatData

Update the checked status of a single node or multiple nodes. This will update both their children and parents. Make sure your data is in the correct order before using it. Reference.

(
+  flatData,
+  checkedIds: Id[],
+  idOrIds: Id | Id[],
+  checked: boolean,
+  options?: {
+    idKey: "id",
+    parentIdKey: "parent_id",
+  }
+): [newCheckedIds, newSemiCheckedIds]

convertIndexToTreeIndexInFlatData

Calculate the index of a node in the tree through its parent node id and its index in the sibling nodes.

(
+  flatData,
+  parentId: Id | null,
+  indexInSiblings: Id | null,
+  options?: {
+    idKey: "id",
+    parentIdKey: "parent_id",
+  }
+): treeIndex

addToFlatData

Add a node to the flat data. It will change the original data array. Therefore, it is recommended to pass in a copy of the original data, or use it together with useImmer. Reference

(
+  flatData,
+  newNode,
+  index: Id | null,
+  options?: {
+    idKey: "id",
+    parentIdKey: "parent_id",
+  }
+):void

removeByIdInFlatData

Remove node by id from the flat data. It will change the original data array. Therefore, it is recommended to pass in a copy of the original data, or use it together with useImmer. Reference

(
+  flatData,
+  removeId: Id | null,
+  options?: {
+    idKey: "id",
+    parentIdKey: "parent_id",
+  }
+): removedData

walkParentsGenerator

A method to iterate over another special kind of data. This data is like HTMLElement, which contains keys pointing to the parent node like parentElement.

(
+  node,
+  parentKeyOrGetter: string | ((node) => parent | undefined),
+  options?: {
+    withSelf: boolean;
+  }
+): Generator

parentKeyOrGetter can be a string or a method that returns the parent. options.withSelf indicates whether to include the node self. Returns Generator. Here is an example of traversing HTMLElement:

ts
let el = document.querySelector("div");
+for (const parent of walkParentsGenerator(el, "parentElement", {
+  withSelf: true,
+})) {
+  // ...
+}

Stat

stat contains information related to the node. Read-only. The properties are as follows:

NameTypeDescription
_isStatbooleanIndicates whether it is a stat object
nodeobjectnode data
idIdid
pidId, nullparent id
parentobject, nullparent data
parentStatstat, nullparent stat
childIdsId[]
childrenobject[]
childStatsstat[]stats of children
siblingIdsId[]
siblingsobject[]sibling nodes
siblingStatsstat[]stats of siblings
indexnumbernode's index in siblings
levelnumbernode's depth in tree. Start from 1
openboolean
checkedboolean
draggableboolean
+ + + + \ No newline at end of file diff --git a/v1/examples.html b/v1/examples.html new file mode 100644 index 0000000..468aa98 --- /dev/null +++ b/v1/examples.html @@ -0,0 +1,740 @@ + + + + + + Examples | He Tree React + + + + + + + + + + + + + + + +
Skip to content

Examples

Custom Style

Preview

Source

tsx
import { useHeTree, sortFlatData } from "he-tree-react";
+import { useState } from 'react';
+
+export default function BasePage() {
+  const keys = { idKey: 'id', parentIdKey: 'parent_id' };
+  const [data, setdata] = useState(() => sortFlatData([
+    {
+      id: 1,
+      parent_id: null,
+      name: "Root Category",
+    },
+    {
+      id: 2,
+      parent_id: 1,
+      name: "Technology",
+    },
+    {
+      id: 5,
+      parent_id: 2,
+      name: "Hardware",
+    },
+    {
+      id: 10,
+      parent_id: 5,
+      name: "Computer Components",
+    },
+    {
+      id: 4,
+      parent_id: 2,
+      name: "Programming",
+    },
+    {
+      id: 8,
+      parent_id: 4,
+      name: "Python",
+    },
+    {
+      id: 3,
+      parent_id: 1,
+      name: "Science",
+    },
+    {
+      id: 7,
+      parent_id: 3,
+      name: "Biology",
+    },
+    {
+      id: 6,
+      parent_id: 3,
+      name: "Physics",
+    },
+  ], keys));
+  const { renderTree, placeholder } = useHeTree({
+    ...keys,
+    data,
+    dataType: 'flat',
+    onChange: setdata,
+    renderNodeBox: ({ stat, attrs, isPlaceholder }) => (
+      <div {...attrs} key={attrs.key} className="my-node-box">
+        {isPlaceholder ? <div className="my-placeholder">DROP HERE</div>
+          : <div className="my-node">
+            <span className="drag-handler" draggable={stat.draggable}>{dragIcon()}</span>
+            {stat.node.name}
+          </div>
+        }
+      </div>
+    ),
+  })
+  return <>
+    <h3 style={{ margin: '0 0 0 110px', padding: '20px 0 0px' }}>Draggable Tree</h3>
+    <div>
+      {renderTree({ className: `my-tree ${placeholder ? 'dragging' : 'no-dragging'}` })}
+    </div>
+    <style>{`
+    .my-tree{
+      width: 300px; 
+      border: 1px solid #ccc; 
+      border-radius: 5px;
+      margin: 20px; 
+      padding: 20px;
+    }
+    .my-placeholder{
+      height:40px;
+      border: 1px dashed blue;
+      border-radius: 3px;
+      background-color: #f3ffff;
+      display: flex;
+      align-items: center;
+      justify-content: center;
+      font-size: small;
+    }
+    /*.no-dragging .my-node-box:hover{
+      background-color: #eee;
+    }*/
+    .my-node-box:not(:last-child){
+      margin-bottom: 10px;
+    }
+    .my-node{
+      padding: 5px 10px;
+      padding-left: 30px;
+      border: 1px solid #e2e2e2;
+      border-radius: 3px;
+      background-color: #f0f0f0;
+      display: flex;
+      align-items: center;
+      position: relative;
+      box-shadow: 1px 1px 3px 0px rgb(0 0 0 / 19%);
+    }
+    .no-dragging .my-node:hover{
+      background-color: #ebfeff;
+    }
+    .drag-handler{
+      position: absolute;
+      left: 0;
+      top: 0;
+      width: 30px;
+      height: 100%;
+      display: flex;
+      align-items: center;
+      justify-content: center;
+      cursor: grab;
+    }
+    .drag-handler:hover{
+      background-color: #f0f0f0;
+    }
+    .my-node svg{
+      width:16px;
+    }
+    `}</style>
+  </>
+}
+
+function dragIcon() {
+  return <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>drag-horizontal-variant</title><path d="M21 11H3V9H21V11M21 13H3V15H21V13Z" /></svg>
+}

Flat Data

Preview

Source

tsx
import { useHeTree, sortFlatData } from "he-tree-react";
+import { useState } from 'react';
+
+export default function BasePage() {
+  const keys = { idKey: 'id', parentIdKey: 'parent_id' };
+  const [data, setdata] = useState(() => sortFlatData([
+    {
+      id: 1,
+      parent_id: null,
+      name: "Root Category",
+    },
+    {
+      id: 2,
+      parent_id: 1,
+      name: "Technology",
+    },
+    {
+      id: 5,
+      parent_id: 2,
+      name: "Hardware",
+    },
+    {
+      id: 10,
+      parent_id: 5,
+      name: "Computer Components",
+    },
+    {
+      id: 4,
+      parent_id: 2,
+      name: "Programming",
+    },
+    {
+      id: 8,
+      parent_id: 4,
+      name: "Python",
+    },
+    {
+      id: 3,
+      parent_id: 1,
+      name: "Science",
+    },
+    {
+      id: 7,
+      parent_id: 3,
+      name: "Biology",
+    },
+    {
+      id: 6,
+      parent_id: 3,
+      name: "Physics",
+    },
+  ], keys));
+  const { renderTree } = useHeTree({
+    ...keys,
+    data,
+    dataType: 'flat',
+    onChange: setdata,
+    renderNode: ({ id, node, open, checked }) => <div>
+      {node.name}
+    </div>,
+  })
+  return <div>
+    {renderTree({ style: { width: '300px', border: '1px solid #555', padding: '20px' } })}
+  </div>
+}

Tree-shaped Data

Preview

Source

tsx
import { useHeTree } from "he-tree-react";
+import { useState } from 'react';
+
+export default function BasePage() {
+  const [data, setdata] = useState(() => [
+    {
+      id: 1,
+      name: "Root Category",
+      children: [
+        {
+          id: 2,
+          name: "Technology",
+          children: [
+            {
+              id: 5,
+              name: "Hardware",
+              children: [
+                {
+                  id: 10,
+                  name: "Computer Components",
+                  children: [],
+                },
+              ],
+            },
+            {
+              id: 4,
+              name: "Programming",
+              children: [
+                {
+                  id: 8,
+                  name: "Python",
+                  children: [],
+                },
+              ],
+            },
+          ],
+        },
+        {
+          id: 3,
+          name: "Science",
+          children: [
+            {
+              id: 7,
+              name: "Biology",
+              children: [],
+            },
+            {
+              id: 6,
+              name: "Physics",
+              children: [],
+            },
+          ],
+        },
+      ],
+    },
+  ]);
+  const { renderTree } = useHeTree({
+    data,
+    dataType: 'tree',
+    childrenKey: 'children',
+    onChange: setdata,
+    renderNode: ({ id, node, open, checked }) => <div>
+      {node.name}
+    </div>,
+  })
+  return <div>
+    {renderTree({ style: { width: '300px', border: '1px solid #555', padding: '20px' } })}
+  </div>
+}

Trigger Element

Preview

Source

tsx
import { useHeTree, sortFlatData } from "he-tree-react";
+import { useState } from 'react';
+
+export default function BasePage() {
+  const keys = { idKey: 'id', parentIdKey: 'parent_id' };
+  // prettier-ignore
+  const [data, setdata] = useState(() => sortFlatData([{ id: 1, parent_id: null, name: "Root Category", }, { id: 2, parent_id: 1, name: "Technology", }, { id: 5, parent_id: 2, name: "Hardware", }, { id: 10, parent_id: 5, name: "Computer Components", }, { id: 4, parent_id: 2, name: "Programming", }, { id: 8, parent_id: 4, name: "Python", }, { id: 3, parent_id: 1, name: "Science", }, { id: 7, parent_id: 3, name: "Biology", }, { id: 6, parent_id: 3, name: "Physics", },], keys));
+  const { renderTree } = useHeTree({
+    ...keys,
+    data,
+    dataType: 'flat',
+    onChange: setdata,
+    renderNode: ({ id, node, open, checked, draggable }) => <div>
+      <button draggable={draggable}>Drag</button>
+      {node.name}
+    </div>,
+  })
+  return <div>
+    {renderTree({ style: { width: '300px', border: '1px solid #555', padding: '20px' } })}
+  </div>
+}

Placeholder

Preview

Source

tsx
import { useHeTree, sortFlatData } from "he-tree-react";
+import { useState } from 'react';
+
+export default function BasePage() {
+  const keys = { idKey: 'id', parentIdKey: 'parent_id' };
+  // prettier-ignore
+  const [data, setdata] = useState(() => sortFlatData([{ id: 1, parent_id: null, name: "Root Category", }, { id: 2, parent_id: 1, name: "Technology", }, { id: 5, parent_id: 2, name: "Hardware", }, { id: 10, parent_id: 5, name: "Computer Components", }, { id: 4, parent_id: 2, name: "Programming", }, { id: 8, parent_id: 4, name: "Python", }, { id: 3, parent_id: 1, name: "Science", }, { id: 7, parent_id: 3, name: "Biology", }, { id: 6, parent_id: 3, name: "Physics", },], keys));
+  const { renderTree } = useHeTree({
+    ...keys,
+    data,
+    dataType: 'flat',
+    onChange: setdata,
+    renderNodeBox: ({ stat, attrs, isPlaceholder }) => (
+      <div {...attrs} key={attrs.key}>
+        {isPlaceholder ? <div className="my-drag-placeholder">drop here</div>
+          : <div className="mynode">{stat.node.name}</div>
+        }
+      </div>
+    ),
+  })
+  return <div>
+    {renderTree({ className: 'mytree', style: { width: '300px', border: '1px solid #555', padding: '20px' } })}
+    <style>{`
+    .mytree [data-node-box]{
+      padding: 5px 0;
+    }
+    .mytree [data-node-box]:hover{
+      background-color: #eee;
+    }
+    .mytree .he-tree-drag-placeholder{
+      height: 30px;
+      line-height: 30px;
+      text-align: center;
+      border: 1px dashed red;
+    }
+    .mynode{
+      padding-left:5px;
+    }
+    `}</style>
+  </div>
+}

Open

Preview

Source

tsx
import { useHeTree, sortFlatData, openParentsInFlatData } from "he-tree-react";
+import type { Id } from "he-tree-react";
+import { useState } from 'react';
+
+export default function BasePage() {
+  const keys = { idKey: 'id', parentIdKey: 'parent_id' };
+  // prettier-ignore
+  const [data, setdata] = useState(() => sortFlatData([{ id: 1, parent_id: null, name: "Root Category", }, { id: 2, parent_id: 1, name: "Technology", }, { id: 5, parent_id: 2, name: "Hardware", }, { id: 10, parent_id: 5, name: "Computer Components", }, { id: 4, parent_id: 2, name: "Programming", }, { id: 8, parent_id: 4, name: "Python", }, { id: 3, parent_id: 1, name: "Science", }, { id: 7, parent_id: 3, name: "Biology", }, { id: 6, parent_id: 3, name: "Physics", },], keys));
+  const [openIds, setopenIds] = useState<Id[] | undefined>([]);
+  const handleOpen = (id: Id, open: boolean) => {
+    if (open) {
+      setopenIds([...(openIds || allIds), id]);
+    } else {
+      setopenIds((openIds || allIds).filter((i) => i !== id));
+    }
+  }
+  const { renderTree, allIds } = useHeTree({
+    ...keys,
+    data,
+    dataType: 'flat',
+    onChange: setdata,
+    openIds,
+    renderNode: ({ id, node, open, checked, draggable }) => <div>
+      <button onClick={() => handleOpen(id, !open)}>{open ? '-' : '+'}</button>
+      {node.name} - {id}
+    </div>,
+  })
+  return <div>
+    <button onClick={() => setopenIds(allIds)}>Open All</button>
+    <button onClick={() => setopenIds([])}>Close All</button>
+    <button onClick={() => setopenIds(openParentsInFlatData(data, openIds || allIds, 8, keys))}>Open 'Python'</button>
+    <button onClick={() => setopenIds(openParentsInFlatData(data, [], 8, keys))}>Only Open 'Python'</button>
+    {renderTree({ style: { width: '300px', border: '1px solid #555', padding: '20px' } })}
+  </div>
+}

Checked

Preview

Source

tsx
import { useHeTree, sortFlatData, updateCheckedInFlatData } from "he-tree-react";
+import type { Id } from "he-tree-react";
+import { useState } from 'react';
+
+export default function BasePage() {
+  const keys = { idKey: 'id', parentIdKey: 'parent_id' };
+  // prettier-ignore
+  const [data, setdata] = useState(() => sortFlatData([{ id: 1, parent_id: null, name: "Root Category", }, { id: 2, parent_id: 1, name: "Technology", }, { id: 5, parent_id: 2, name: "Hardware", }, { id: 10, parent_id: 5, name: "Computer Components", }, { id: 4, parent_id: 2, name: "Programming", }, { id: 8, parent_id: 4, name: "Python", }, { id: 3, parent_id: 1, name: "Science", }, { id: 7, parent_id: 3, name: "Biology", }, { id: 6, parent_id: 3, name: "Physics", },], keys));
+  const [checkedIds, setcheckedIds] = useState<Id[]>([]);
+  const [semiCheckedIds, setsemiCheckedIds] = useState<Id[]>([]);
+  const handleChecked = (id: Id, checked: boolean) => {
+    const r = updateCheckedInFlatData(data, checkedIds, id, checked, keys);
+    setcheckedIds(r[0]);
+    setsemiCheckedIds(r[1]);
+  }
+  const { renderTree } = useHeTree({
+    ...keys,
+    data,
+    dataType: 'flat',
+    onChange: setdata,
+    checkedIds,
+    renderNode: ({ id, node, open, checked, draggable }) => <div>
+      <input type="checkbox" checked={checked || false} onChange={() => handleChecked(id, !checked)} />
+      {node.name} - {id}
+    </div>,
+  })
+  return <div>
+    Checked: {JSON.stringify(checkedIds)} <br />
+    Semi-Checked: {JSON.stringify(semiCheckedIds)}
+    {renderTree({ style: { width: '300px', border: '1px solid #555', padding: '20px' } })}
+  </div>
+}

Draggable & Droppable

Preview

Source

tsx
import { useHeTree, sortFlatData } from "he-tree-react";
+import { useState } from 'react';
+
+export default function BasePage() {
+  const keys = { idKey: 'id', parentIdKey: 'parent_id' };
+  // prettier-ignore
+  const [data, setdata] = useState(() => sortFlatData([{ id: 2, parent_id: 1, name: "Technology", }, { id: 5, parent_id: 2, name: "Hardware", }, { id: 10, parent_id: 5, name: "Computer Components", }, { id: 4, parent_id: 2, name: "Programming", }, { id: 8, parent_id: 4, name: "Python", }, { id: 3, parent_id: 1, name: "Science", }, { id: 7, parent_id: 3, name: "Biology", }, { id: 6, parent_id: 3, name: "Physics", },], keys));
+  const { renderTree } = useHeTree({
+    ...keys,
+    data,
+    dataType: 'flat',
+    onChange: setdata,
+    renderNode: ({ id, node, open, checked, draggable }) => <div>
+      {node.name} - {id}
+    </div>,
+    canDrag: ({ id }) => id === 2 ? true : (id === 3 ? false : undefined),
+    canDrop: ({ id }) => id === 3 ? true : (id === 2 ? false : undefined),
+    canDropToRoot: (index) => false,
+  })
+  return <div>
+    {renderTree({ style: { width: '300px', border: '1px solid #555', padding: '20px' } })}
+  </div>
+}

Open when drag onto

Preview

Source

tsx
import { useHeTree, sortFlatData } from "he-tree-react";
+import type { Id } from "he-tree-react";
+import { useState } from 'react';
+
+export default function BasePage() {
+  const keys = { idKey: 'id', parentIdKey: 'parent_id' };
+  // prettier-ignore
+  const [data, setdata] = useState(() => sortFlatData([{ id: 1, parent_id: null, name: "Root Category", }, { id: 2, parent_id: 1, name: "Technology", }, { id: 5, parent_id: 2, name: "Hardware", }, { id: 10, parent_id: 5, name: "Computer Components", }, { id: 4, parent_id: 2, name: "Programming", }, { id: 8, parent_id: 4, name: "Python", }, { id: 3, parent_id: 1, name: "Science", }, { id: 7, parent_id: 3, name: "Biology", }, { id: 6, parent_id: 3, name: "Physics", },], keys));
+  const [openIds, setopenIds] = useState<Id[] | undefined>([1, 3]);
+  const handleOpen = (id: Id, open: boolean) => {
+    if (open) {
+      setopenIds([...(openIds || allIds), id]);
+    } else {
+      setopenIds((openIds || allIds).filter((i) => i !== id));
+    }
+  }
+  const { renderTree, allIds } = useHeTree({
+    ...keys,
+    data,
+    dataType: 'flat',
+    onChange: setdata,
+    openIds,
+    renderNode: ({ id, node, open, checked, draggable }) => <div>
+      <button onClick={() => handleOpen(id, !open)}>{open ? '-' : '+'}</button>
+      {node.name} - {id}
+    </div>,
+    dragOpen: true,
+    onDragOpen(stat) {
+      handleOpen(stat.id, true)
+    },
+  })
+  return <div>
+    {renderTree({ style: { width: '300px', border: '1px solid #555', padding: '20px' } })}
+  </div>
+}

Update Flat Data

Preview

Source

tsx
import {
+  useHeTree, sortFlatData,
+  addToFlatData, removeByIdInFlatData
+} from "he-tree-react";
+import type { Id } from "he-tree-react";
+import { useRef, useState } from 'react';
+
+export default function BasePage() {
+  const keys = { idKey: 'id', parentIdKey: 'parent_id' };
+  // prettier-ignore
+  const [data, setdata] = useState(() => sortFlatData([{ id: 1, parent_id: null, name: "Root Category", }, { id: 2, parent_id: 1, name: "Technology", }, { id: 5, parent_id: 2, name: "Hardware", }, { id: 10, parent_id: 5, name: "Computer Components", }, { id: 4, parent_id: 2, name: "Programming", }, { id: 8, parent_id: 4, name: "Python", }, { id: 3, parent_id: 1, name: "Science", }, { id: 7, parent_id: 3, name: "Biology", }, { id: 6, parent_id: 3, name: "Physics", },], keys));
+  const add = (pid: Id) => {
+    let id = parseInt(Math.random().toString().substring(2, 5));
+    let newData = [...data];
+    addToFlatData(newData, { id, parent_id: pid as number, name: "New" }, 0, keys)
+    setdata(newData);
+  }
+  const remove = (id: Id) => {
+    let newData = [...data];
+    removeByIdInFlatData(newData, id as number, keys)
+    setdata(newData);
+  }
+  const initialData = useRef<typeof data>();
+  initialData.current = initialData.current || data;
+  const { renderTree } = useHeTree({
+    ...keys,
+    data,
+    dataType: 'flat',
+    onChange: setdata,
+    renderNode: ({ id, node, draggable }) => <div>
+      <button draggable={draggable}>👉</button>
+      {node.name} - {id} -
+      <button onClick={() => add(id)}>+</button>
+      <button onClick={() => remove(id)}>-</button>
+    </div>,
+  })
+  return <div>
+    <button onClick={() => setdata(initialData.current!)}>Restore</button>
+    {renderTree({ style: { width: '300px', border: '1px solid #555', padding: '20px' } })}
+  </div>
+}

Update Flat Data with immer

Preview

Source

tsx
import {
+  useHeTree, sortFlatData,
+  addToFlatData, removeByIdInFlatData
+} from "he-tree-react";
+import type { Id } from "he-tree-react";
+import { useRef } from 'react';
+import { useImmer } from "use-immer";
+
+export default function BasePage() {
+  const keys = { idKey: 'id', parentIdKey: 'parent_id' };
+  // prettier-ignore
+  const [data, setdata] = useImmer(() => sortFlatData([{ id: 1, parent_id: null, name: "Root Category", }, { id: 2, parent_id: 1, name: "Technology", }, { id: 5, parent_id: 2, name: "Hardware", }, { id: 10, parent_id: 5, name: "Computer Components", }, { id: 4, parent_id: 2, name: "Programming", }, { id: 8, parent_id: 4, name: "Python", }, { id: 3, parent_id: 1, name: "Science", }, { id: 7, parent_id: 3, name: "Biology", }, { id: 6, parent_id: 3, name: "Physics", },], keys));
+  const add = (pid: Id) => {
+    let id = parseInt(Math.random().toString().substring(2, 5));
+    setdata(draft => {
+      addToFlatData(draft, { id, parent_id: pid as number, name: "New" }, 0, keys)
+    });
+  }
+  const remove = (id: Id) => {
+    setdata(draft => {
+      removeByIdInFlatData(draft, id as number, keys)
+    })
+  }
+  const edit = (id: Id) => {
+    let newName = prompt("Enter new name")
+    setdata(draft => {
+      if (newName) {
+        draft.find(node => node.id === id)!.name = newName
+      }
+    })
+  }
+  const initialData = useRef<typeof data>();
+  initialData.current = initialData.current || data;
+  const { renderTree } = useHeTree({
+    ...keys,
+    data,
+    dataType: 'flat',
+    onChange: setdata,
+    renderNode: ({ id, node, draggable }) => <div>
+      <button draggable={draggable}>👉</button>
+      {node.name} - {id} -
+      <button onClick={() => add(id)}>+</button>
+      <button onClick={() => remove(id)}>-</button>
+      <button onClick={() => edit(id)}>Edit</button>
+    </div>,
+  })
+  return <div>
+    <button onClick={() => setdata(initialData.current!)}>Restore</button>
+    {renderTree({ style: { width: '300px', border: '1px solid #555', padding: '20px' } })}
+  </div>
+}

Update Tree Data with immer

Preview

Source

tsx
import { useHeTree, findTreeData } from "he-tree-react";
+import type { Id } from "he-tree-react";
+import { useRef } from 'react';
+import { useImmer } from "use-immer";
+
+export default function BasePage() {
+  const CHILDREN = 'children'
+  const keys = { idKey: 'id', childrenKey: CHILDREN };
+  // prettier-ignore
+  const [data, setdata] = useImmer(() => [{ id: 1, name: "Root Category", children: [{ id: 2, name: "Technology", children: [{ id: 5, name: "Hardware", children: [{ id: 10, name: "Computer Components", children: [], },], }, { id: 4, name: "Programming", children: [{ id: 8, name: "Python", children: [], },], },], }, { id: 3, name: "Science", children: [{ id: 7, name: "Biology", children: [], }, { id: 6, name: "Physics", children: [], },], },], },]);
+  const add = (pid: Id) => {
+    let id = parseInt(Math.random().toString().substring(2, 5));
+    setdata(draft => {
+      findTreeData(draft, (node) => node.id === pid, CHILDREN)![CHILDREN].unshift({ id, name: "New", [CHILDREN]: [], })
+    })
+  }
+  const remove = (id: Id, pid: Id | null) => {
+    setdata(draft => {
+      const children = findTreeData(draft, (node,) => node.id === pid, CHILDREN)![CHILDREN]
+      children.splice(children.findIndex(t => t.id === id), 1)
+    })
+  }
+  const edit = (id: Id) => {
+    let newName = prompt("Enter new name")
+    setdata(draft => {
+      if (newName) {
+        findTreeData(draft, (node) => node.id === id, CHILDREN)!.name = newName
+      }
+    })
+  }
+  const initialData = useRef<typeof data>();
+  initialData.current = initialData.current || data;
+  const { renderTree } = useHeTree({
+    ...keys,
+    data,
+    dataType: 'tree',
+    onChange: setdata,
+    renderNode: ({ id, pid, node, draggable }) => <div>
+      <button draggable={draggable}>👉</button>
+      {node.name} - {id} -
+      <button onClick={() => add(id)}>+</button>
+      <button onClick={() => remove(id, pid)}>-</button>
+      <button onClick={() => edit(id)}>Edit</button>
+    </div>,
+  })
+  return <div>
+    <button onClick={() => setdata(initialData.current!)}>Restore</button>
+    {renderTree({ style: { width: '300px', border: '1px solid #555', padding: '20px' } })}
+  </div>
+}

Drag from External

Preview

Source

tsx
import { useHeTree, sortFlatData, addToFlatData } from "he-tree-react";
+import { useImmer } from "use-immer";
+
+export default function BasePage() {
+  const keys = { idKey: 'id', parentIdKey: 'parent_id' };
+  // prettier-ignore
+  const [data, setdata] = useImmer(() => sortFlatData([{ id: 1, parent_id: null, name: "Root Category", }, { id: 2, parent_id: 1, name: "Technology", }, { id: 5, parent_id: 2, name: "Hardware", }, { id: 10, parent_id: 5, name: "Computer Components", }, { id: 4, parent_id: 2, name: "Programming", }, { id: 8, parent_id: 4, name: "Python", }, { id: 3, parent_id: 1, name: "Science", }, { id: 7, parent_id: 3, name: "Biology", }, { id: 6, parent_id: 3, name: "Physics", },], keys));
+  const { renderTree, allIds } = useHeTree({
+    ...keys,
+    data,
+    dataType: 'flat',
+    onChange: setdata,
+    renderNode: ({ id, node, open, checked, draggable }) => <div>
+      {node.name} - {id}
+    </div>,
+    onExternalDragOver: (e) => true,
+    onExternalDrop: (e, parentStat, index) => {
+      setdata(draft => {
+        const newNode = { id: 100 + data.length, parent_id: parentStat?.id ?? null, name: "New Node" }
+        addToFlatData(draft, newNode, index, keys)
+      })
+    },
+  })
+  return <div>
+    <button draggable={true}>Drag me in to the tree</button>
+    {renderTree({ style: { width: '300px', border: '1px solid #555', padding: '20px' } })}
+  </div>
+}

Big Data

Preview

Source

tsx
import { useHeTree, sortFlatData } from "he-tree-react";
+import type { Id } from "he-tree-react";
+import { useState } from 'react';
+
+export default function BasePage() {
+  const keys = { idKey: 'id', parentIdKey: 'pid' };
+  // prettier-ignore
+  const [data, setdata] = useState(() => sortFlatData(createData(), keys));
+  const [openIds, setopenIds] = useState<Id[] | undefined>([]);
+  const handleOpen = (id: Id, open: boolean) => {
+    if (open) {
+      setopenIds([...(openIds || allIds), id]);
+    } else {
+      setopenIds((openIds || allIds).filter((i) => i !== id));
+    }
+  }
+  const { renderTree, allIds } = useHeTree({
+    ...keys,
+    data,
+    dataType: 'flat',
+    onChange: setdata,
+    openIds,
+    virtual: true,
+    renderNode: ({ id, node, open, checked, draggable }) => <div>
+      <button onClick={() => handleOpen(id, !open)}>{open ? '-' : '+'}</button>
+      {id}
+    </div>,
+  })
+  return <div>
+    {renderTree({ style: { width: '300px', height: '300px', border: '1px solid #555', padding: '20px' } })}
+  </div>
+}
+
+// generate 10000 nodes
+function createData() {
+  const genId = () => result.length
+  const result: { id: number, pid: number | null }[] = [];
+  for (let i = 0; i < 1000; i++) {
+    let id1 = genId()
+    result.push({ id: id1, pid: null })
+    for (let j = 0; j < 4; j++) {
+      result.push({ id: genId(), pid: id1 })
+    }
+    let id2 = genId()
+    result.push({ id: id2, pid: null })
+    for (let j = 0; j < 4; j++) {
+      result.push({ id: genId(), pid: id2 })
+    }
+  }
+  return result;
+}

Scroll to Node

Preview

Source

tsx
import { useHeTree, sortFlatData } from "he-tree-react";
+import type { Id } from "he-tree-react";
+import { useState } from 'react';
+
+export default function BasePage() {
+  const keys = { idKey: 'id', parentIdKey: 'pid' };
+  // prettier-ignore
+  const [data, setdata] = useState(() => sortFlatData(createData(), keys));
+  const [openIds, setopenIds] = useState<Id[] | undefined>([]);
+  const handleOpen = (id: Id, open: boolean) => {
+    if (open) {
+      setopenIds([...(openIds || allIds), id]);
+    } else {
+      setopenIds((openIds || allIds).filter((i) => i !== id));
+    }
+  }
+  const { renderTree, allIds, scrollToNode } = useHeTree({
+    ...keys,
+    data,
+    dataType: 'flat',
+    onChange: setdata,
+    openIds,
+    virtual: true,
+    renderNode: ({ id, node, open, checked, draggable }) => <div>
+      <button onClick={() => handleOpen(id, !open)}>{open ? '-' : '+'}</button>
+      {id}
+    </div>,
+  })
+  return <div>
+    <button onClick={() => scrollToNode(910)}>Scroll to 910</button>
+    {renderTree({ style: { width: '300px', height: '300px', border: '1px solid #555', padding: '20px' } })}
+  </div>
+}
+
+// generate 10000 nodes
+function createData() {
+  const genId = () => result.length
+  const result: { id: number, pid: number | null }[] = [];
+  for (let i = 0; i < 1000; i++) {
+    let id1 = genId()
+    result.push({ id: id1, pid: null })
+    for (let j = 0; j < 4; j++) {
+      result.push({ id: genId(), pid: id1 })
+    }
+    let id2 = genId()
+    result.push({ id: id2, pid: null })
+    for (let j = 0; j < 4; j++) {
+      result.push({ id: genId(), pid: id2 })
+    }
+  }
+  return result;
+}
+ + + + \ No newline at end of file diff --git a/v1/guide.html b/v1/guide.html new file mode 100644 index 0000000..299361e --- /dev/null +++ b/v1/guide.html @@ -0,0 +1,595 @@ + + + + + + Guide | He Tree React + + + + + + + + + + + + + + + +
Skip to content

Guide

Installation

sh
npm install he-tree-react
sh
pnpm add he-tree-react
sh
yarn add he-tree-react

Data Types

This library supports two types of data structures:

  • Flat data, which is a one-dimensional array. Similar to data stored in a database. Each item requires an id, a parent id, null means there is no parent. The order of flat data must be the same as the tree, you can use the sortFlatData method to sort the data when initializing the data.
    js
    [
    +  { id: 1, pid: null },
    +  { id: 2, pid: 1 },
    +  { id: 3, pid: 2 },
    +];
  • Tree data. Each node contain child nodes in an array. If id is not specified, this library will use the node's index in the tree as the id. When using tree data, you need to set dataType: 'tree'.
    js
    [
    +  {
    +    id: 1,
    +    children: [
    +      {
    +        id: 2,
    +        children: [{ id: 3 }],
    +      },
    +    ],
    +  },
    +];

The id, pid, children in the data are not fixed. In the options, use idKey, parentIdKey, childrenKey to indicate the corresponding key names in your data.

No Components

This library does not export components, but exports a hook useHeTree. Use the returned renderTree to render the tree. The advantage of this is that in addition to renderTree, useHeTree will also return some internal states and methods, which can be easily obtained.

js
import { useHeTree } from "he-tree-react";
+
+export default function App() {
+  const { renderTree } = useHeTree({...})
+  return <div>
+    {renderTree()}
+  </div>
+}

Options

useHeTree is the primary function used, its first parameter is an options object. The required options are data, and at least one of renderNode, renderNodeBox must be present. Other important options include:

  • dataType, indicating data type. Available values:
    • flat, default. Flat data.
    • tree, tree-shaped data.
  • idKey, parentIdKey, the default values are id and parent_id. Needed when using flat data. Although there are default values, it is better to explicitly state them.
  • childrenKey, the default is children. Needed when using tree-shaped data. Although there are default values, it is better to explicitly state them.
  • onChange, a function called when data changes, the parameter is new data. If your tree will not change then this is not required.
  • isFunctionReactive, boolean. Default false. useHeTree options include many callback functions, such as onChange, canDrop. isFunctionReactive can be used to control whether to listen for changes to these callback functions. If your callback functions and data change synchronously, you do not need to enable this. Otherwise, you need to enable this and use React's useCallback or useMemo to cache all your callback functions to avoid performance issues.

See the useHeTree API documentation for more information.

Tips

  • stat, information related to a single node. Most of the parameters in callback functions have stat. Refer to Stat API.
  • node, the data of the node. You can get node data through stat.node.
  • getStat, through this function you can get stat, the only parameter can be id, node, stat. This function is in the return object of useHeTree: const {getStat} = useHeTree({...}).
  • The code examples below have preview. These examples can be directly copied for use. Pay attention to the the highlighted lines in code.
  • The code examples below use the tsx format, if you need the js format, you can use any ts js online converter.

Use Flat Data

tsx
import { useHeTree, sortFlatData } from "he-tree-react";
+import { useState } from 'react';
+
+export default function BasePage() {
+  const keys = { idKey: 'id', parentIdKey: 'parent_id' };
+  const [data, setdata] = useState(() => sortFlatData([
+    {
+      id: 1,
+      parent_id: null,
+      name: "Root Category",
+    },
+    {
+      id: 2,
+      parent_id: 1,
+      name: "Technology",
+    },
+    {
+      id: 5,
+      parent_id: 2,
+      name: "Hardware",
+    },
+    {
+      id: 10,
+      parent_id: 5,
+      name: "Computer Components",
+    },
+    {
+      id: 4,
+      parent_id: 2,
+      name: "Programming",
+    },
+    {
+      id: 8,
+      parent_id: 4,
+      name: "Python",
+    },
+    {
+      id: 3,
+      parent_id: 1,
+      name: "Science",
+    },
+    {
+      id: 7,
+      parent_id: 3,
+      name: "Biology",
+    },
+    {
+      id: 6,
+      parent_id: 3,
+      name: "Physics",
+    },
+  ], keys));
+  const { renderTree } = useHeTree({
+    ...keys,
+    data,
+    dataType: 'flat',
+    onChange: setdata,
+    renderNode: ({ id, node, open, checked }) => <div>
+      {node.name}
+    </div>,
+  })
+  return <div>
+    {renderTree({ style: { width: '300px', border: '1px solid #555', padding: '20px' } })}
+  </div>
+}
Preview

Use Tree-shaped Data

tsx
import { useHeTree } from "he-tree-react";
+import { useState } from 'react';
+
+export default function BasePage() {
+  const [data, setdata] = useState(() => [
+    {
+      id: 1,
+      name: "Root Category",
+      children: [
+        {
+          id: 2,
+          name: "Technology",
+          children: [
+            {
+              id: 5,
+              name: "Hardware",
+              children: [
+                {
+                  id: 10,
+                  name: "Computer Components",
+                  children: [],
+                },
+              ],
+            },
+            {
+              id: 4,
+              name: "Programming",
+              children: [
+                {
+                  id: 8,
+                  name: "Python",
+                  children: [],
+                },
+              ],
+            },
+          ],
+        },
+        {
+          id: 3,
+          name: "Science",
+          children: [
+            {
+              id: 7,
+              name: "Biology",
+              children: [],
+            },
+            {
+              id: 6,
+              name: "Physics",
+              children: [],
+            },
+          ],
+        },
+      ],
+    },
+  ]);
+  const { renderTree } = useHeTree({
+    data,
+    dataType: 'tree',
+    childrenKey: 'children',
+    onChange: setdata,
+    renderNode: ({ id, node, open, checked }) => <div>
+      {node.name}
+    </div>,
+  })
+  return <div>
+    {renderTree({ style: { width: '300px', border: '1px solid #555', padding: '20px' } })}
+  </div>
+}
Preview

Custom Drag Trigger Element

You can add the draggable attribute to any child element of the node.

tsx
import { useHeTree, sortFlatData } from "he-tree-react";
+import { useState } from 'react';
+
+export default function BasePage() {
+  const keys = { idKey: 'id', parentIdKey: 'parent_id' };
+  // prettier-ignore
+  const [data, setdata] = useState(() => sortFlatData([{ id: 1, parent_id: null, name: "Root Category", }, { id: 2, parent_id: 1, name: "Technology", }, { id: 5, parent_id: 2, name: "Hardware", }, { id: 10, parent_id: 5, name: "Computer Components", }, { id: 4, parent_id: 2, name: "Programming", }, { id: 8, parent_id: 4, name: "Python", }, { id: 3, parent_id: 1, name: "Science", }, { id: 7, parent_id: 3, name: "Biology", }, { id: 6, parent_id: 3, name: "Physics", },], keys));
+  const { renderTree } = useHeTree({
+    ...keys,
+    data,
+    dataType: 'flat',
+    onChange: setdata,
+    renderNode: ({ id, node, open, checked, draggable }) => <div>
+      <button draggable={draggable}>Drag</button>
+      {node.name}
+    </div>,
+  })
+  return <div>
+    {renderTree({ style: { width: '300px', border: '1px solid #555', padding: '20px' } })}
+  </div>
+}
Preview

HTML and Style of Node

Node HTML:

html
<div
+  draggable="true"
+  data-key="1"
+  data-level="1"
+  data-node-box="true"
+  style="padding-left: 0px;"
+>
+  <div>Node</div>
+</div>

There are two div above. Use the renderNode option to control the rendering of the inner div. For example: renderNode: ({node}) => <div>{node.name}</div>.

The outer div is called nodeBox, don't modify its padding-left, padding-right. Use the indent option to control the indentation of the node. If you want to control the rendering of nodeBox or the drag placeholder, you can use the renderNodeBox option, which will override renderNode. The standard renderNodeBox is as follows:

tsx
renderNodeBox: ({ stat, attrs, isPlaceholder }) => (
+  <div {...attrs} key={attrs.key}>
+    {isPlaceholder ? (
+      <div
+        className="he-tree-drag-placeholder"
+        style={{ minHeight: "20px", border: "1px dashed blue" }}
+      />
+    ) : (
+      <div>{/* node area */}</div>
+    )}
+  </div>
+);

Lines 4 to 7 are drag-and-drop placeholder. Line 9 is node.

Custom Drag Placeholder and Node Box

tsx
import { useHeTree, sortFlatData } from "he-tree-react";
+import { useState } from 'react';
+
+export default function BasePage() {
+  const keys = { idKey: 'id', parentIdKey: 'parent_id' };
+  // prettier-ignore
+  const [data, setdata] = useState(() => sortFlatData([{ id: 1, parent_id: null, name: "Root Category", }, { id: 2, parent_id: 1, name: "Technology", }, { id: 5, parent_id: 2, name: "Hardware", }, { id: 10, parent_id: 5, name: "Computer Components", }, { id: 4, parent_id: 2, name: "Programming", }, { id: 8, parent_id: 4, name: "Python", }, { id: 3, parent_id: 1, name: "Science", }, { id: 7, parent_id: 3, name: "Biology", }, { id: 6, parent_id: 3, name: "Physics", },], keys));
+  const { renderTree } = useHeTree({
+    ...keys,
+    data,
+    dataType: 'flat',
+    onChange: setdata,
+    renderNodeBox: ({ stat, attrs, isPlaceholder }) => (
+      <div {...attrs} key={attrs.key}>
+        {isPlaceholder ? <div className="my-drag-placeholder">drop here</div>
+          : <div className="mynode">{stat.node.name}</div>
+        }
+      </div>
+    ),
+  })
+  return <div>
+    {renderTree({ className: 'mytree', style: { width: '300px', border: '1px solid #555', padding: '20px' } })}
+    <style>{`
+    .mytree [data-node-box]{
+      padding: 5px 0;
+    }
+    .mytree [data-node-box]:hover{
+      background-color: #eee;
+    }
+    .mytree .he-tree-drag-placeholder{
+      height: 30px;
+      line-height: 30px;
+      text-align: center;
+      border: 1px dashed red;
+    }
+    .mynode{
+      padding-left:5px;
+    }
+    `}</style>
+  </div>
+}
Preview

Open & Close

  • Use the openIds option to indicate the open nodes.
  • The open status of the node can be obtained through stat.open.
  • The allIds returned by useHeTree contains the ids of all nodes.
  • This library exports methods that can expand all parents of one or multiple nodes. For flat data: openParentsInFlatData. For tree data: openParentsInTreeData.
tsx
import { useHeTree, sortFlatData, openParentsInFlatData } from "he-tree-react";
+import type { Id } from "he-tree-react";
+import { useState } from 'react';
+
+export default function BasePage() {
+  const keys = { idKey: 'id', parentIdKey: 'parent_id' };
+  // prettier-ignore
+  const [data, setdata] = useState(() => sortFlatData([{ id: 1, parent_id: null, name: "Root Category", }, { id: 2, parent_id: 1, name: "Technology", }, { id: 5, parent_id: 2, name: "Hardware", }, { id: 10, parent_id: 5, name: "Computer Components", }, { id: 4, parent_id: 2, name: "Programming", }, { id: 8, parent_id: 4, name: "Python", }, { id: 3, parent_id: 1, name: "Science", }, { id: 7, parent_id: 3, name: "Biology", }, { id: 6, parent_id: 3, name: "Physics", },], keys));
+  const [openIds, setopenIds] = useState<Id[] | undefined>([]);
+  const handleOpen = (id: Id, open: boolean) => {
+    if (open) {
+      setopenIds([...(openIds || allIds), id]);
+    } else {
+      setopenIds((openIds || allIds).filter((i) => i !== id));
+    }
+  }
+  const { renderTree, allIds } = useHeTree({
+    ...keys,
+    data,
+    dataType: 'flat',
+    onChange: setdata,
+    openIds,
+    renderNode: ({ id, node, open, checked, draggable }) => <div>
+      <button onClick={() => handleOpen(id, !open)}>{open ? '-' : '+'}</button>
+      {node.name} - {id}
+    </div>,
+  })
+  return <div>
+    <button onClick={() => setopenIds(allIds)}>Open All</button>
+    <button onClick={() => setopenIds([])}>Close All</button>
+    <button onClick={() => setopenIds(openParentsInFlatData(data, openIds || allIds, 8, keys))}>Open 'Python'</button>
+    <button onClick={() => setopenIds(openParentsInFlatData(data, [], 8, keys))}>Only Open 'Python'</button>
+    {renderTree({ style: { width: '300px', border: '1px solid #555', padding: '20px' } })}
+  </div>
+}
Preview

Checked

  • Use the option checkedIds to indicate the checked nodes.
  • The checked status of this node can be obtained through stat.checked.
  • This library exports methods that can get checkedIds for one or more nodes after the checked status changes. Flat data: updateCheckedInFlatData. Tree data: `updateCheckedInTreeData.
    • The update of this method to the node's checked is cascading. If you don't want to cascade updates, replace it with your own logic.
    • This method returns an array of length 2. The first item is all checked ids, and the second item is all semi-checked ids. If you don't need semi-checked, ignore the second item.
    • Semi-checked, that is, there are child nodes that are checked or semi-checked, and there are child nodes that are not checked.
tsx
import { useHeTree, sortFlatData, updateCheckedInFlatData } from "he-tree-react";
+import type { Id } from "he-tree-react";
+import { useState } from 'react';
+
+export default function BasePage() {
+  const keys = { idKey: 'id', parentIdKey: 'parent_id' };
+  // prettier-ignore
+  const [data, setdata] = useState(() => sortFlatData([{ id: 1, parent_id: null, name: "Root Category", }, { id: 2, parent_id: 1, name: "Technology", }, { id: 5, parent_id: 2, name: "Hardware", }, { id: 10, parent_id: 5, name: "Computer Components", }, { id: 4, parent_id: 2, name: "Programming", }, { id: 8, parent_id: 4, name: "Python", }, { id: 3, parent_id: 1, name: "Science", }, { id: 7, parent_id: 3, name: "Biology", }, { id: 6, parent_id: 3, name: "Physics", },], keys));
+  const [checkedIds, setcheckedIds] = useState<Id[]>([]);
+  const [semiCheckedIds, setsemiCheckedIds] = useState<Id[]>([]);
+  const handleChecked = (id: Id, checked: boolean) => {
+    const r = updateCheckedInFlatData(data, checkedIds, id, checked, keys);
+    setcheckedIds(r[0]);
+    setsemiCheckedIds(r[1]);
+  }
+  const { renderTree } = useHeTree({
+    ...keys,
+    data,
+    dataType: 'flat',
+    onChange: setdata,
+    checkedIds,
+    renderNode: ({ id, node, open, checked, draggable }) => <div>
+      <input type="checkbox" checked={checked || false} onChange={() => handleChecked(id, !checked)} />
+      {node.name} - {id}
+    </div>,
+  })
+  return <div>
+    Checked: {JSON.stringify(checkedIds)} <br />
+    Semi-Checked: {JSON.stringify(semiCheckedIds)}
+    {renderTree({ style: { width: '300px', border: '1px solid #555', padding: '20px' } })}
+  </div>
+}
Preview

draggable & droppable

Use the following options to control:

tsx
import { useHeTree, sortFlatData } from "he-tree-react";
+import { useState } from 'react';
+
+export default function BasePage() {
+  const keys = { idKey: 'id', parentIdKey: 'parent_id' };
+  // prettier-ignore
+  const [data, setdata] = useState(() => sortFlatData([{ id: 2, parent_id: 1, name: "Technology", }, { id: 5, parent_id: 2, name: "Hardware", }, { id: 10, parent_id: 5, name: "Computer Components", }, { id: 4, parent_id: 2, name: "Programming", }, { id: 8, parent_id: 4, name: "Python", }, { id: 3, parent_id: 1, name: "Science", }, { id: 7, parent_id: 3, name: "Biology", }, { id: 6, parent_id: 3, name: "Physics", },], keys));
+  const { renderTree } = useHeTree({
+    ...keys,
+    data,
+    dataType: 'flat',
+    onChange: setdata,
+    renderNode: ({ id, node, open, checked, draggable }) => <div>
+      {node.name} - {id}
+    </div>,
+    canDrag: ({ id }) => id === 2 ? true : (id === 3 ? false : undefined),
+    canDrop: ({ id }) => id === 3 ? true : (id === 2 ? false : undefined),
+    canDropToRoot: (index) => false,
+  })
+  return <div>
+    {renderTree({ style: { width: '300px', border: '1px solid #555', padding: '20px' } })}
+  </div>
+}
Preview
  • The root node cannot be dropped.
  • Technology and its sub-nodes can be dragged. Science and its sub-nodes cannot be dragged.
  • Science and its sub-nodes can be dropped. Technology and its sub-nodes cannot be dropped.

Open when dragging over

Use the following options to control:

tsx
import { useHeTree, sortFlatData } from "he-tree-react";
+import type { Id } from "he-tree-react";
+import { useState } from 'react';
+
+export default function BasePage() {
+  const keys = { idKey: 'id', parentIdKey: 'parent_id' };
+  // prettier-ignore
+  const [data, setdata] = useState(() => sortFlatData([{ id: 1, parent_id: null, name: "Root Category", }, { id: 2, parent_id: 1, name: "Technology", }, { id: 5, parent_id: 2, name: "Hardware", }, { id: 10, parent_id: 5, name: "Computer Components", }, { id: 4, parent_id: 2, name: "Programming", }, { id: 8, parent_id: 4, name: "Python", }, { id: 3, parent_id: 1, name: "Science", }, { id: 7, parent_id: 3, name: "Biology", }, { id: 6, parent_id: 3, name: "Physics", },], keys));
+  const [openIds, setopenIds] = useState<Id[] | undefined>([1, 3]);
+  const handleOpen = (id: Id, open: boolean) => {
+    if (open) {
+      setopenIds([...(openIds || allIds), id]);
+    } else {
+      setopenIds((openIds || allIds).filter((i) => i !== id));
+    }
+  }
+  const { renderTree, allIds } = useHeTree({
+    ...keys,
+    data,
+    dataType: 'flat',
+    onChange: setdata,
+    openIds,
+    renderNode: ({ id, node, open, checked, draggable }) => <div>
+      <button onClick={() => handleOpen(id, !open)}>{open ? '-' : '+'}</button>
+      {node.name} - {id}
+    </div>,
+    dragOpen: true,
+    onDragOpen(stat) {
+      handleOpen(stat.id, true)
+    },
+  })
+  return <div>
+    {renderTree({ style: { width: '300px', border: '1px solid #555', padding: '20px' } })}
+  </div>
+}
Preview

Update Data

Due to the immutable nature of React, it is difficult to update flat data and tree data. For flat data, this library provides two methods to add nodes or delete nodes. If you want to perform more complex operations, or update tree data, it is recommended that you use immer.

sh
npm install immer use-immer
sh
pnpm add immer use-immer
sh
yarn add immer use-immer

Update Flat Data

addToFlatData. removeByIdInFlatData. These 2 methods will modify original data, so pass copy to it, or use immer.

tsx
import {
+  useHeTree, sortFlatData,
+  addToFlatData, removeByIdInFlatData
+} from "he-tree-react";
+import type { Id } from "he-tree-react";
+import { useRef, useState } from 'react';
+
+export default function BasePage() {
+  const keys = { idKey: 'id', parentIdKey: 'parent_id' };
+  // prettier-ignore
+  const [data, setdata] = useState(() => sortFlatData([{ id: 1, parent_id: null, name: "Root Category", }, { id: 2, parent_id: 1, name: "Technology", }, { id: 5, parent_id: 2, name: "Hardware", }, { id: 10, parent_id: 5, name: "Computer Components", }, { id: 4, parent_id: 2, name: "Programming", }, { id: 8, parent_id: 4, name: "Python", }, { id: 3, parent_id: 1, name: "Science", }, { id: 7, parent_id: 3, name: "Biology", }, { id: 6, parent_id: 3, name: "Physics", },], keys));
+  const add = (pid: Id) => {
+    let id = parseInt(Math.random().toString().substring(2, 5));
+    let newData = [...data];
+    addToFlatData(newData, { id, parent_id: pid as number, name: "New" }, 0, keys)
+    setdata(newData);
+  }
+  const remove = (id: Id) => {
+    let newData = [...data];
+    removeByIdInFlatData(newData, id as number, keys)
+    setdata(newData);
+  }
+  const initialData = useRef<typeof data>();
+  initialData.current = initialData.current || data;
+  const { renderTree } = useHeTree({
+    ...keys,
+    data,
+    dataType: 'flat',
+    onChange: setdata,
+    renderNode: ({ id, node, draggable }) => <div>
+      <button draggable={draggable}>👉</button>
+      {node.name} - {id} -
+      <button onClick={() => add(id)}>+</button>
+      <button onClick={() => remove(id)}>-</button>
+    </div>,
+  })
+  return <div>
+    <button onClick={() => setdata(initialData.current!)}>Restore</button>
+    {renderTree({ style: { width: '300px', border: '1px solid #555', padding: '20px' } })}
+  </div>
+}
Preview

Update Flat Data with immer

Note, here we use useImmer instead of React's useState.

tsx
import {
+  useHeTree, sortFlatData,
+  addToFlatData, removeByIdInFlatData
+} from "he-tree-react";
+import type { Id } from "he-tree-react";
+import { useRef } from 'react';
+import { useImmer } from "use-immer";
+
+export default function BasePage() {
+  const keys = { idKey: 'id', parentIdKey: 'parent_id' };
+  // prettier-ignore
+  const [data, setdata] = useImmer(() => sortFlatData([{ id: 1, parent_id: null, name: "Root Category", }, { id: 2, parent_id: 1, name: "Technology", }, { id: 5, parent_id: 2, name: "Hardware", }, { id: 10, parent_id: 5, name: "Computer Components", }, { id: 4, parent_id: 2, name: "Programming", }, { id: 8, parent_id: 4, name: "Python", }, { id: 3, parent_id: 1, name: "Science", }, { id: 7, parent_id: 3, name: "Biology", }, { id: 6, parent_id: 3, name: "Physics", },], keys));
+  const add = (pid: Id) => {
+    let id = parseInt(Math.random().toString().substring(2, 5));
+    setdata(draft => {
+      addToFlatData(draft, { id, parent_id: pid as number, name: "New" }, 0, keys)
+    });
+  }
+  const remove = (id: Id) => {
+    setdata(draft => {
+      removeByIdInFlatData(draft, id as number, keys)
+    })
+  }
+  const edit = (id: Id) => {
+    let newName = prompt("Enter new name")
+    setdata(draft => {
+      if (newName) {
+        draft.find(node => node.id === id)!.name = newName
+      }
+    })
+  }
+  const initialData = useRef<typeof data>();
+  initialData.current = initialData.current || data;
+  const { renderTree } = useHeTree({
+    ...keys,
+    data,
+    dataType: 'flat',
+    onChange: setdata,
+    renderNode: ({ id, node, draggable }) => <div>
+      <button draggable={draggable}>👉</button>
+      {node.name} - {id} -
+      <button onClick={() => add(id)}>+</button>
+      <button onClick={() => remove(id)}>-</button>
+      <button onClick={() => edit(id)}>Edit</button>
+    </div>,
+  })
+  return <div>
+    <button onClick={() => setdata(initialData.current!)}>Restore</button>
+    {renderTree({ style: { width: '300px', border: '1px solid #555', padding: '20px' } })}
+  </div>
+}
Preview

Update Tree Data with immer

Note, here we use useImmer instead of React's useState. findTreeData is like Array.prototype.find.

tsx
import { useHeTree, findTreeData } from "he-tree-react";
+import type { Id } from "he-tree-react";
+import { useRef } from 'react';
+import { useImmer } from "use-immer";
+
+export default function BasePage() {
+  const CHILDREN = 'children'
+  const keys = { idKey: 'id', childrenKey: CHILDREN };
+  // prettier-ignore
+  const [data, setdata] = useImmer(() => [{ id: 1, name: "Root Category", children: [{ id: 2, name: "Technology", children: [{ id: 5, name: "Hardware", children: [{ id: 10, name: "Computer Components", children: [], },], }, { id: 4, name: "Programming", children: [{ id: 8, name: "Python", children: [], },], },], }, { id: 3, name: "Science", children: [{ id: 7, name: "Biology", children: [], }, { id: 6, name: "Physics", children: [], },], },], },]);
+  const add = (pid: Id) => {
+    let id = parseInt(Math.random().toString().substring(2, 5));
+    setdata(draft => {
+      findTreeData(draft, (node) => node.id === pid, CHILDREN)![CHILDREN].unshift({ id, name: "New", [CHILDREN]: [], })
+    })
+  }
+  const remove = (id: Id, pid: Id | null) => {
+    setdata(draft => {
+      const children = findTreeData(draft, (node,) => node.id === pid, CHILDREN)![CHILDREN]
+      children.splice(children.findIndex(t => t.id === id), 1)
+    })
+  }
+  const edit = (id: Id) => {
+    let newName = prompt("Enter new name")
+    setdata(draft => {
+      if (newName) {
+        findTreeData(draft, (node) => node.id === id, CHILDREN)!.name = newName
+      }
+    })
+  }
+  const initialData = useRef<typeof data>();
+  initialData.current = initialData.current || data;
+  const { renderTree } = useHeTree({
+    ...keys,
+    data,
+    dataType: 'tree',
+    onChange: setdata,
+    renderNode: ({ id, pid, node, draggable }) => <div>
+      <button draggable={draggable}>👉</button>
+      {node.name} - {id} -
+      <button onClick={() => add(id)}>+</button>
+      <button onClick={() => remove(id, pid)}>-</button>
+      <button onClick={() => edit(id)}>Edit</button>
+    </div>,
+  })
+  return <div>
+    <button onClick={() => setdata(initialData.current!)}>Restore</button>
+    {renderTree({ style: { width: '300px', border: '1px solid #555', padding: '20px' } })}
+  </div>
+}
Preview

Drag from External

Related options:

tsx
import { useHeTree, sortFlatData, addToFlatData } from "he-tree-react";
+import { useImmer } from "use-immer";
+
+export default function BasePage() {
+  const keys = { idKey: 'id', parentIdKey: 'parent_id' };
+  // prettier-ignore
+  const [data, setdata] = useImmer(() => sortFlatData([{ id: 1, parent_id: null, name: "Root Category", }, { id: 2, parent_id: 1, name: "Technology", }, { id: 5, parent_id: 2, name: "Hardware", }, { id: 10, parent_id: 5, name: "Computer Components", }, { id: 4, parent_id: 2, name: "Programming", }, { id: 8, parent_id: 4, name: "Python", }, { id: 3, parent_id: 1, name: "Science", }, { id: 7, parent_id: 3, name: "Biology", }, { id: 6, parent_id: 3, name: "Physics", },], keys));
+  const { renderTree, allIds } = useHeTree({
+    ...keys,
+    data,
+    dataType: 'flat',
+    onChange: setdata,
+    renderNode: ({ id, node, open, checked, draggable }) => <div>
+      {node.name} - {id}
+    </div>,
+    onExternalDragOver: (e) => true,
+    onExternalDrop: (e, parentStat, index) => {
+      setdata(draft => {
+        const newNode = { id: 100 + data.length, parent_id: parentStat?.id ?? null, name: "New Node" }
+        addToFlatData(draft, newNode, index, keys)
+      })
+    },
+  })
+  return <div>
+    <button draggable={true}>Drag me in to the tree</button>
+    {renderTree({ style: { width: '300px', border: '1px solid #555', padding: '20px' } })}
+  </div>
+}
Preview

Big Data

Use option virtual to enable virtual list. Remember to set height for tree.

tsx
import { useHeTree, sortFlatData } from "he-tree-react";
+import type { Id } from "he-tree-react";
+import { useState } from 'react';
+
+export default function BasePage() {
+  const keys = { idKey: 'id', parentIdKey: 'pid' };
+  // prettier-ignore
+  const [data, setdata] = useState(() => sortFlatData(createData(), keys));
+  const [openIds, setopenIds] = useState<Id[] | undefined>([]);
+  const handleOpen = (id: Id, open: boolean) => {
+    if (open) {
+      setopenIds([...(openIds || allIds), id]);
+    } else {
+      setopenIds((openIds || allIds).filter((i) => i !== id));
+    }
+  }
+  const { renderTree, allIds } = useHeTree({
+    ...keys,
+    data,
+    dataType: 'flat',
+    onChange: setdata,
+    openIds,
+    virtual: true,
+    renderNode: ({ id, node, open, checked, draggable }) => <div>
+      <button onClick={() => handleOpen(id, !open)}>{open ? '-' : '+'}</button>
+      {id}
+    </div>,
+  })
+  return <div>
+    {renderTree({ style: { width: '300px', height: '300px', border: '1px solid #555', padding: '20px' } })}
+  </div>
+}
+
+// generate 10000 nodes
+function createData() {
+  const genId = () => result.length
+  const result: { id: number, pid: number | null }[] = [];
+  for (let i = 0; i < 1000; i++) {
+    let id1 = genId()
+    result.push({ id: id1, pid: null })
+    for (let j = 0; j < 4; j++) {
+      result.push({ id: genId(), pid: id1 })
+    }
+    let id2 = genId()
+    result.push({ id: id2, pid: null })
+    for (let j = 0; j < 4; j++) {
+      result.push({ id: genId(), pid: id2 })
+    }
+  }
+  return result;
+}
Preview

Touch & Mobile Device

It is based on HTML5 Drag and Drop API. So it works in any device that supports Drag and Drop API. For others, you can try Drag and Drop API polyfill.

Notice

In mobile, user need touch and hold to trigger drag.

Others

  • Option direction: from right to left.
  • Option customDragImage: custom drag image.
  • Option rootId: the parent id of root nodes in flat data.
  • Option keepPlaceholder: whether to retain the drag placeholder node when dragging outside the tree. Default is false.
  • Function scrollToNode: Scroll to a node.
+ + + + \ No newline at end of file diff --git a/zh/index.html b/zh/index.html new file mode 100644 index 0000000..9d2c0a0 --- /dev/null +++ b/zh/index.html @@ -0,0 +1,26 @@ + + + + + + He Tree React + + + + + + + + + + + + + + + +
Skip to content

He Tree React

React 可拖拽树组件

功能

  • 拖拽时显示一个占位元素指示位置.
  • 节点高度不固定.
  • 基于 HTML Drag and Drop API.
  • 同时支持扁平数据和树形数据.
  • 支持外部拖拽.
  • 展开与折叠, 拖拽到节点上时展开它.
  • 勾选, 半选.
  • 大数据, 虚拟列表.
  • 更新数据的多个示例.
  • rtl, 从右往左显示.
+ + + + \ No newline at end of file diff --git a/zh/v1/api.html b/zh/v1/api.html new file mode 100644 index 0000000..f67ae87 --- /dev/null +++ b/zh/v1/api.html @@ -0,0 +1,135 @@ + + + + + + API | He Tree React + + + + + + + + + + + + + + + +
Skip to content

API

导出

此库导出的变量, 方法, Typescript 类型.

以下为 Typescript 的类型:

  • Id: 节点 id, 父级 id. 类型: string | number.
  • Stat: 节点的相关信息.
  • HeTreeProps: useHeTree的选项.

useHeTree

ts
import { useHeTree } from "he-tree-react";
+const {/* return */} = useHeTree({/* options */}) // prettier-ignore

本库的主要功能. React hook. 参数如下:

  • options: 选项, 类型是对象. 以下是 options 中的部分属性:

    名称类型默认值描述
    dataArray数据. 参考数据类型.
    dataType'flat', 'tree''flat'数据类型
    idKeystring'id'你的数据中 id 的键名.
    parentIdKeystring'parent_id'你的数据中父级 id 的键名. 仅用于扁平数据.
    childrenKeystring'children'你的数据中子级的键名. 仅用于树形数据.
    indentnumber20节点缩进, 单位是 px.
    dragOpenbooleanfalse是否启用功能"拖拽到节点上时打开节点".
    dragOpenDelaynumber600拖拽到节点上时打开节点的等待时间. 单位是毫秒.
    onDragOpenfunction(stat): void拖拽到节点上时打开节点的回调.
    direction'lrt', 'rtl''ltr'显示方向, ltr 是从左往右显示, rtl 与之相反.
    rootIdstring, nullnull使用扁平数据时, 没有父级的节点的父级 id.
    virtualbooleanfalse是否启用虚拟化. 当数据非常多时用来提高性能.
    keepPlaceholderbooleanfalse当拖拽离开树的范围, 是否要保留占位元素. 建议只在一个树的页面开启此项.
    openIdsArray所有打开节点的 id.
    checkedIdsArray所有勾选的节点的 id.
    isFunctionReactivebooleanfalse是否监听回调函数的改变. 参考

    以下是 options 中的剩余回调方法:

    名称类型描述
    renderNode(stat)=> ReactNode节点的渲染函数.
    renderNodeBox({stat, attrs, isPlaceholder})=> ReactNodenodeBox 的渲染函数. 参考.
    onChange(newData)=>void数据发生改变时调用.
    canDrag(stat)=>boolean, null, undefined, void节点是否可拖拽. 返回null, undefined, void表示继承父节点.
    canDrop(stat, index)=>boolean, null, undefined, void节点是否可放入. 返回null, undefined, void表示继承父节点. 参数index可能为空, 不为空时表示将要放入节点的子级的位置.
    customDragImage(event, stat)=> void调用event.dataTransfer.setDragImage自定义 drag image. 参考.
    onDragStart(event, stat)=> void当拖拽开始时
    onExternalDragOver(event)=>boolean当拖拽来自外部时调用. 你必选返回布尔值表示是否处理此拖拽.
    onDragOver(event, stat, isExternal)=> void当拖拽到树上方时, isExternal表示此次拖拽是否来自外部.
    onDragEnd(event, stat, isOutside)=>void当此树发起的拖拽结束时调用. stat 是此次拖拽的节点的 stat.isOutside 表示是否在树外部结束.
    onExternalDrop(event, parentStat, index)=>void当外部拖拽在此树结束时调用. parentStat 是目标父节点的 stat, 为空时代表树的根级. index 是目标位置, 即节点在兄弟节点中的索引.

useHeTree的返回

useHeTree的返回是对象, 包含了一些 states 和方法. 注意, 这个对象每次更新都会改变, 不要依赖这个对象, 可以依赖这个对象的属性. 属性如下:

名称类型描述
renderTree(options?: { className?: string, style?: React.CSSProperties }): ReactNode渲染树. 参数可以传入classNamestyle控制根元素的样式.
getStat(idOrNodeOrStat)=>stat根据 id, 节点数据或 stat, 获得对应的 stat.
allIds数组所有节点的 id.
rootIds数组树根级的所有节点的 id.
rootNodes数组树根级的所有节点的数据. 如果是树形数据, 它就是选项中的data.
rootStats数组树根级的所有节点的 stat.
placeholder{parentStat, index, level}拖拽时占位节点的信息. 占位节点不存在时为空.
draggingStatstat由此树发起拖拽时, 被拖拽的节点的 stat. 不存在时为空.
dragOverStatstat拖拽到其上面的节点. 可能为空.
visibleIds数组显示的所有节点的 id.
attrsList数组显示的所有节点的 attrs.
virtualListRefref虚拟列表组件的 ref, 参考虚拟列表.
scrollToNode(idOrNodeOrStat)=>boolean滚动到节点. 参数可以是 id, 节点数据或 stat. 如果节点未找到或未显示, 返回false. 例子

walkTreeDataGenerator

通过for of遍历树形数据的方法. 循环中执行skipChildren()将跳过该节点的所有子节点, 执行exitWalk将结束遍历.

ts
for (const [
+  node,
+  { parent, parents, siblings, index, skipChildren, exitWalk },
+] of walkTreeDataGenerator(data, "children")) {
+  // ...
+}

walkTreeData

通过回调方法遍历树形数据的方法. 回调方法中执行skipChildren()将跳过该节点的所有子节点, 执行exitWalk将结束遍历.

ts
walkTreeDataGenerator(
+  data,
+  (node, { parent, parents, siblings, index, skipChildren, exitWalk }) => {
+    // ...
+  },
+  "children"
+);

findTreeData

类似 Array.prototype.find. 返回找到的第一个节点. 回调方法中执行skipChildren()将跳过该节点的所有子节点, 执行exitWalk将结束遍历.

ts
let foundNode = findTreeData(
+  data,
+  (node, { parent, parents, siblings, index, skipChildren, exitWalk }) => {
+    // return node.id === 1;
+  },
+  "children"
+);

filterTreeData

类似 Array.prototype.filter. 返回找到的所有节点. 回调方法中执行skipChildren()将跳过该节点的所有子节点, 执行exitWalk将结束遍历.

ts
let nodes = filterTreeData(
+  data,
+  (node, { parent, parents, siblings, index, skipChildren, exitWalk }) => {
+    // return node.id > 1;
+  },
+  "children"
+);

openParentsInTreeData

打开单个或多个节点的所有父节点, 这样才能确保该节点可见. 参考.

(
+  treeData,
+  openIds: Id[],
+  idOrIds: Id | Id[],
+  options?: {idKey: string, childrenKey: string}
+): newOpenIds

updateCheckedInTreeData

更新单个节点或多个节点的checked状态. 这将同时更新它们的子节点和父节点. 参考.

(
+  treeData,
+  checkedIds: Id[],
+  idOrIds: Id | Id[],
+  checked: boolean,
+  options?: {idKey: string, childrenKey: string}
+): [newCheckedIds, newSemiCheckedIds]

sortFlatData

把扁平数据按照节点在树里的顺序排序. 返回排序后的新数组. 你的数据在初始化时应该使用它以保证顺序.

(
+  flatData,
+  options?: {idKey: string, parentIdKey: string}
+): sortedData

walkFlatDataGenerator

通过for of遍历扁平数据的方法. 循环中执行skipChildren()将跳过该节点的所有子节点, 执行exitWalk将结束遍历. 使用前需确保你的数据的顺序是正确的.

相比于walkTreeDataGenerator, 少了siblings, 多了 treeIndex, id, pid. treeIndex是节点在整个树中的索引.

ts
for (const [
+  node,
+  { parent, parents, index, treeIndex, id, pid, skipChildren, exitWalk },
+] of walkFlatDataGenerator(flatData, {
+  idKey: "id",
+  parentIdKey: "parent_id",
+})) {
+  // ...
+}

walkFlatData

通过回调方法遍历扁平数据的方法. 回调方法中执行skipChildren()将跳过该节点的所有子节点, 执行exitWalk将结束遍历. 使用前需确保你的数据的顺序是正确的.

ts
walkFlatData(
+  flatData,
+  (
+    node,
+    { parent, parents, index, treeIndex, id, pid, skipChildren, exitWalk }
+  ) => {
+    // ...
+  },
+  {
+    idKey: "id",
+    parentIdKey: "parent_id",
+  }
+);

openParentsInFlatData

打开单个或多个节点的所有父节点, 这样才能确保该节点可见. 用前需确保你的数据的顺序是正确的. 参考.

(
+  flatData,
+  openIds: Id[],
+  idOrIds: Id | Id[],
+  options?: {
+    idKey: "id",
+    parentIdKey: "parent_id",
+  }
+): newOpenIds

updateCheckedInFlatData

更新单个节点或多个节点的checked状态. 这将同时更新它们的子节点和父节点. 用前需确保你的数据的顺序是正确的. 参考.

(
+  flatData,
+  checkedIds: Id[],
+  idOrIds: Id | Id[],
+  checked: boolean,
+  options?: {
+    idKey: "id",
+    parentIdKey: "parent_id",
+  }
+): [newCheckedIds, newSemiCheckedIds]

convertIndexToTreeIndexInFlatData

通过某节点的父节点 id 和它在兄弟节点中的索引, 计算出它在整棵树中的索引.

(
+  flatData,
+  parentId: Id | null,
+  indexInSiblings: Id | null,
+  options?: {
+    idKey: "id",
+    parentIdKey: "parent_id",
+  }
+): treeIndex

addToFlatData

向扁平数据添加一个节点. 它会改变原数据数组. 所以推荐传入原始数据的拷贝, 或者与useImmer一起使用. 参考

(
+  flatData,
+  newNode,
+  index: Id | null,
+  options?: {
+    idKey: "id",
+    parentIdKey: "parent_id",
+  }
+):void

removeByIdInFlatData

从扁平数据删除一个节点. 返回被删除的数据. 它会改变原数据数组. 所以推荐传入原始数据的拷贝, 或者与useImmer一起使用. 参考

(
+  flatData,
+  removeId: Id | null,
+  options?: {
+    idKey: "id",
+    parentIdKey: "parent_id",
+  }
+): removedData

walkParentsGenerator

遍历另一种特殊数据的方法. 这种数据类似HTMLElement, 其中包含类似于parentElement的指向父节点的键.

(
+  node,
+  parentKeyOrGetter: string | ((node) => parent | undefined),
+  options?: {
+    withSelf: boolean;
+  }
+): Generator

parentKeyOrGetter可以是字符串或者返回父级的方法. options.withSelf表示是否包括传入的节点. 返回 Generator. 下面是遍历 HTMLElement 的例子:

ts
let el = document.querySelector("div");
+for (const parent of walkParentsGenerator(el, "parentElement", {
+  withSelf: true,
+})) {
+  // ...
+}

Stat

stat包括和节点有关的信息. 只读. 属性如下:

名称类型描述
_isStatboolean表明是否是 stat 对象
nodeobject节点的数据
idIdid
pidId, null节点的父级 id
parentobject, null父节点的数据
parentStatstat, null父节点的 stat
childIdsId[]子节点的 id 数组
childrenobject[]子节点数组
childStatsstat[]子节点的 stat 数组
siblingIdsId[]兄弟节点的 id 数组
siblingsobject[]兄弟节点数组
siblingStatsstat[]兄弟节点的 stat 数组
indexnumber节点在兄弟节点中的索引
levelnumber节点在树中的深度. 从 1 开始
openboolean是否展开
checkedboolean是否勾选
draggableboolean是否可拖动
+ + + + \ No newline at end of file diff --git a/zh/v1/examples.html b/zh/v1/examples.html new file mode 100644 index 0000000..51d1fc4 --- /dev/null +++ b/zh/v1/examples.html @@ -0,0 +1,740 @@ + + + + + + 示例 | He Tree React + + + + + + + + + + + + + + + +
Skip to content

示例

自定义样式

请看效果

源代码

tsx
import { useHeTree, sortFlatData } from "he-tree-react";
+import { useState } from 'react';
+
+export default function BasePage() {
+  const keys = { idKey: 'id', parentIdKey: 'parent_id' };
+  const [data, setdata] = useState(() => sortFlatData([
+    {
+      id: 1,
+      parent_id: null,
+      name: "Root Category",
+    },
+    {
+      id: 2,
+      parent_id: 1,
+      name: "Technology",
+    },
+    {
+      id: 5,
+      parent_id: 2,
+      name: "Hardware",
+    },
+    {
+      id: 10,
+      parent_id: 5,
+      name: "Computer Components",
+    },
+    {
+      id: 4,
+      parent_id: 2,
+      name: "Programming",
+    },
+    {
+      id: 8,
+      parent_id: 4,
+      name: "Python",
+    },
+    {
+      id: 3,
+      parent_id: 1,
+      name: "Science",
+    },
+    {
+      id: 7,
+      parent_id: 3,
+      name: "Biology",
+    },
+    {
+      id: 6,
+      parent_id: 3,
+      name: "Physics",
+    },
+  ], keys));
+  const { renderTree, placeholder } = useHeTree({
+    ...keys,
+    data,
+    dataType: 'flat',
+    onChange: setdata,
+    renderNodeBox: ({ stat, attrs, isPlaceholder }) => (
+      <div {...attrs} key={attrs.key} className="my-node-box">
+        {isPlaceholder ? <div className="my-placeholder">DROP HERE</div>
+          : <div className="my-node">
+            <span className="drag-handler" draggable={stat.draggable}>{dragIcon()}</span>
+            {stat.node.name}
+          </div>
+        }
+      </div>
+    ),
+  })
+  return <>
+    <h3 style={{ margin: '0 0 0 110px', padding: '20px 0 0px' }}>Draggable Tree</h3>
+    <div>
+      {renderTree({ className: `my-tree ${placeholder ? 'dragging' : 'no-dragging'}` })}
+    </div>
+    <style>{`
+    .my-tree{
+      width: 300px; 
+      border: 1px solid #ccc; 
+      border-radius: 5px;
+      margin: 20px; 
+      padding: 20px;
+    }
+    .my-placeholder{
+      height:40px;
+      border: 1px dashed blue;
+      border-radius: 3px;
+      background-color: #f3ffff;
+      display: flex;
+      align-items: center;
+      justify-content: center;
+      font-size: small;
+    }
+    /*.no-dragging .my-node-box:hover{
+      background-color: #eee;
+    }*/
+    .my-node-box:not(:last-child){
+      margin-bottom: 10px;
+    }
+    .my-node{
+      padding: 5px 10px;
+      padding-left: 30px;
+      border: 1px solid #e2e2e2;
+      border-radius: 3px;
+      background-color: #f0f0f0;
+      display: flex;
+      align-items: center;
+      position: relative;
+      box-shadow: 1px 1px 3px 0px rgb(0 0 0 / 19%);
+    }
+    .no-dragging .my-node:hover{
+      background-color: #ebfeff;
+    }
+    .drag-handler{
+      position: absolute;
+      left: 0;
+      top: 0;
+      width: 30px;
+      height: 100%;
+      display: flex;
+      align-items: center;
+      justify-content: center;
+      cursor: grab;
+    }
+    .drag-handler:hover{
+      background-color: #f0f0f0;
+    }
+    .my-node svg{
+      width:16px;
+    }
+    `}</style>
+  </>
+}
+
+function dragIcon() {
+  return <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>drag-horizontal-variant</title><path d="M21 11H3V9H21V11M21 13H3V15H21V13Z" /></svg>
+}

扁平数据

请看效果

源代码

tsx
import { useHeTree, sortFlatData } from "he-tree-react";
+import { useState } from 'react';
+
+export default function BasePage() {
+  const keys = { idKey: 'id', parentIdKey: 'parent_id' };
+  const [data, setdata] = useState(() => sortFlatData([
+    {
+      id: 1,
+      parent_id: null,
+      name: "Root Category",
+    },
+    {
+      id: 2,
+      parent_id: 1,
+      name: "Technology",
+    },
+    {
+      id: 5,
+      parent_id: 2,
+      name: "Hardware",
+    },
+    {
+      id: 10,
+      parent_id: 5,
+      name: "Computer Components",
+    },
+    {
+      id: 4,
+      parent_id: 2,
+      name: "Programming",
+    },
+    {
+      id: 8,
+      parent_id: 4,
+      name: "Python",
+    },
+    {
+      id: 3,
+      parent_id: 1,
+      name: "Science",
+    },
+    {
+      id: 7,
+      parent_id: 3,
+      name: "Biology",
+    },
+    {
+      id: 6,
+      parent_id: 3,
+      name: "Physics",
+    },
+  ], keys));
+  const { renderTree } = useHeTree({
+    ...keys,
+    data,
+    dataType: 'flat',
+    onChange: setdata,
+    renderNode: ({ id, node, open, checked }) => <div>
+      {node.name}
+    </div>,
+  })
+  return <div>
+    {renderTree({ style: { width: '300px', border: '1px solid #555', padding: '20px' } })}
+  </div>
+}

树形数据

请看效果

源代码

tsx
import { useHeTree } from "he-tree-react";
+import { useState } from 'react';
+
+export default function BasePage() {
+  const [data, setdata] = useState(() => [
+    {
+      id: 1,
+      name: "Root Category",
+      children: [
+        {
+          id: 2,
+          name: "Technology",
+          children: [
+            {
+              id: 5,
+              name: "Hardware",
+              children: [
+                {
+                  id: 10,
+                  name: "Computer Components",
+                  children: [],
+                },
+              ],
+            },
+            {
+              id: 4,
+              name: "Programming",
+              children: [
+                {
+                  id: 8,
+                  name: "Python",
+                  children: [],
+                },
+              ],
+            },
+          ],
+        },
+        {
+          id: 3,
+          name: "Science",
+          children: [
+            {
+              id: 7,
+              name: "Biology",
+              children: [],
+            },
+            {
+              id: 6,
+              name: "Physics",
+              children: [],
+            },
+          ],
+        },
+      ],
+    },
+  ]);
+  const { renderTree } = useHeTree({
+    data,
+    dataType: 'tree',
+    childrenKey: 'children',
+    onChange: setdata,
+    renderNode: ({ id, node, open, checked }) => <div>
+      {node.name}
+    </div>,
+  })
+  return <div>
+    {renderTree({ style: { width: '300px', border: '1px solid #555', padding: '20px' } })}
+  </div>
+}

触发元素

请看效果

源代码

tsx
import { useHeTree, sortFlatData } from "he-tree-react";
+import { useState } from 'react';
+
+export default function BasePage() {
+  const keys = { idKey: 'id', parentIdKey: 'parent_id' };
+  // prettier-ignore
+  const [data, setdata] = useState(() => sortFlatData([{ id: 1, parent_id: null, name: "Root Category", }, { id: 2, parent_id: 1, name: "Technology", }, { id: 5, parent_id: 2, name: "Hardware", }, { id: 10, parent_id: 5, name: "Computer Components", }, { id: 4, parent_id: 2, name: "Programming", }, { id: 8, parent_id: 4, name: "Python", }, { id: 3, parent_id: 1, name: "Science", }, { id: 7, parent_id: 3, name: "Biology", }, { id: 6, parent_id: 3, name: "Physics", },], keys));
+  const { renderTree } = useHeTree({
+    ...keys,
+    data,
+    dataType: 'flat',
+    onChange: setdata,
+    renderNode: ({ id, node, open, checked, draggable }) => <div>
+      <button draggable={draggable}>Drag</button>
+      {node.name}
+    </div>,
+  })
+  return <div>
+    {renderTree({ style: { width: '300px', border: '1px solid #555', padding: '20px' } })}
+  </div>
+}

占位元素

请看效果

源代码

tsx
import { useHeTree, sortFlatData } from "he-tree-react";
+import { useState } from 'react';
+
+export default function BasePage() {
+  const keys = { idKey: 'id', parentIdKey: 'parent_id' };
+  // prettier-ignore
+  const [data, setdata] = useState(() => sortFlatData([{ id: 1, parent_id: null, name: "Root Category", }, { id: 2, parent_id: 1, name: "Technology", }, { id: 5, parent_id: 2, name: "Hardware", }, { id: 10, parent_id: 5, name: "Computer Components", }, { id: 4, parent_id: 2, name: "Programming", }, { id: 8, parent_id: 4, name: "Python", }, { id: 3, parent_id: 1, name: "Science", }, { id: 7, parent_id: 3, name: "Biology", }, { id: 6, parent_id: 3, name: "Physics", },], keys));
+  const { renderTree } = useHeTree({
+    ...keys,
+    data,
+    dataType: 'flat',
+    onChange: setdata,
+    renderNodeBox: ({ stat, attrs, isPlaceholder }) => (
+      <div {...attrs} key={attrs.key}>
+        {isPlaceholder ? <div className="my-drag-placeholder">drop here</div>
+          : <div className="mynode">{stat.node.name}</div>
+        }
+      </div>
+    ),
+  })
+  return <div>
+    {renderTree({ className: 'mytree', style: { width: '300px', border: '1px solid #555', padding: '20px' } })}
+    <style>{`
+    .mytree [data-node-box]{
+      padding: 5px 0;
+    }
+    .mytree [data-node-box]:hover{
+      background-color: #eee;
+    }
+    .mytree .he-tree-drag-placeholder{
+      height: 30px;
+      line-height: 30px;
+      text-align: center;
+      border: 1px dashed red;
+    }
+    .mynode{
+      padding-left:5px;
+    }
+    `}</style>
+  </div>
+}

展开

请看效果

源代码

tsx
import { useHeTree, sortFlatData, openParentsInFlatData } from "he-tree-react";
+import type { Id } from "he-tree-react";
+import { useState } from 'react';
+
+export default function BasePage() {
+  const keys = { idKey: 'id', parentIdKey: 'parent_id' };
+  // prettier-ignore
+  const [data, setdata] = useState(() => sortFlatData([{ id: 1, parent_id: null, name: "Root Category", }, { id: 2, parent_id: 1, name: "Technology", }, { id: 5, parent_id: 2, name: "Hardware", }, { id: 10, parent_id: 5, name: "Computer Components", }, { id: 4, parent_id: 2, name: "Programming", }, { id: 8, parent_id: 4, name: "Python", }, { id: 3, parent_id: 1, name: "Science", }, { id: 7, parent_id: 3, name: "Biology", }, { id: 6, parent_id: 3, name: "Physics", },], keys));
+  const [openIds, setopenIds] = useState<Id[] | undefined>([]);
+  const handleOpen = (id: Id, open: boolean) => {
+    if (open) {
+      setopenIds([...(openIds || allIds), id]);
+    } else {
+      setopenIds((openIds || allIds).filter((i) => i !== id));
+    }
+  }
+  const { renderTree, allIds } = useHeTree({
+    ...keys,
+    data,
+    dataType: 'flat',
+    onChange: setdata,
+    openIds,
+    renderNode: ({ id, node, open, checked, draggable }) => <div>
+      <button onClick={() => handleOpen(id, !open)}>{open ? '-' : '+'}</button>
+      {node.name} - {id}
+    </div>,
+  })
+  return <div>
+    <button onClick={() => setopenIds(allIds)}>Open All</button>
+    <button onClick={() => setopenIds([])}>Close All</button>
+    <button onClick={() => setopenIds(openParentsInFlatData(data, openIds || allIds, 8, keys))}>Open 'Python'</button>
+    <button onClick={() => setopenIds(openParentsInFlatData(data, [], 8, keys))}>Only Open 'Python'</button>
+    {renderTree({ style: { width: '300px', border: '1px solid #555', padding: '20px' } })}
+  </div>
+}

勾选

请看效果

源代码

tsx
import { useHeTree, sortFlatData, updateCheckedInFlatData } from "he-tree-react";
+import type { Id } from "he-tree-react";
+import { useState } from 'react';
+
+export default function BasePage() {
+  const keys = { idKey: 'id', parentIdKey: 'parent_id' };
+  // prettier-ignore
+  const [data, setdata] = useState(() => sortFlatData([{ id: 1, parent_id: null, name: "Root Category", }, { id: 2, parent_id: 1, name: "Technology", }, { id: 5, parent_id: 2, name: "Hardware", }, { id: 10, parent_id: 5, name: "Computer Components", }, { id: 4, parent_id: 2, name: "Programming", }, { id: 8, parent_id: 4, name: "Python", }, { id: 3, parent_id: 1, name: "Science", }, { id: 7, parent_id: 3, name: "Biology", }, { id: 6, parent_id: 3, name: "Physics", },], keys));
+  const [checkedIds, setcheckedIds] = useState<Id[]>([]);
+  const [semiCheckedIds, setsemiCheckedIds] = useState<Id[]>([]);
+  const handleChecked = (id: Id, checked: boolean) => {
+    const r = updateCheckedInFlatData(data, checkedIds, id, checked, keys);
+    setcheckedIds(r[0]);
+    setsemiCheckedIds(r[1]);
+  }
+  const { renderTree } = useHeTree({
+    ...keys,
+    data,
+    dataType: 'flat',
+    onChange: setdata,
+    checkedIds,
+    renderNode: ({ id, node, open, checked, draggable }) => <div>
+      <input type="checkbox" checked={checked || false} onChange={() => handleChecked(id, !checked)} />
+      {node.name} - {id}
+    </div>,
+  })
+  return <div>
+    Checked: {JSON.stringify(checkedIds)} <br />
+    Semi-Checked: {JSON.stringify(semiCheckedIds)}
+    {renderTree({ style: { width: '300px', border: '1px solid #555', padding: '20px' } })}
+  </div>
+}

拖拽控制

请看效果

源代码

tsx
import { useHeTree, sortFlatData } from "he-tree-react";
+import { useState } from 'react';
+
+export default function BasePage() {
+  const keys = { idKey: 'id', parentIdKey: 'parent_id' };
+  // prettier-ignore
+  const [data, setdata] = useState(() => sortFlatData([{ id: 2, parent_id: 1, name: "Technology", }, { id: 5, parent_id: 2, name: "Hardware", }, { id: 10, parent_id: 5, name: "Computer Components", }, { id: 4, parent_id: 2, name: "Programming", }, { id: 8, parent_id: 4, name: "Python", }, { id: 3, parent_id: 1, name: "Science", }, { id: 7, parent_id: 3, name: "Biology", }, { id: 6, parent_id: 3, name: "Physics", },], keys));
+  const { renderTree } = useHeTree({
+    ...keys,
+    data,
+    dataType: 'flat',
+    onChange: setdata,
+    renderNode: ({ id, node, open, checked, draggable }) => <div>
+      {node.name} - {id}
+    </div>,
+    canDrag: ({ id }) => id === 2 ? true : (id === 3 ? false : undefined),
+    canDrop: ({ id }) => id === 3 ? true : (id === 2 ? false : undefined),
+    canDropToRoot: (index) => false,
+  })
+  return <div>
+    {renderTree({ style: { width: '300px', border: '1px solid #555', padding: '20px' } })}
+  </div>
+}

拖拽时打开

请看效果

源代码

tsx
import { useHeTree, sortFlatData } from "he-tree-react";
+import type { Id } from "he-tree-react";
+import { useState } from 'react';
+
+export default function BasePage() {
+  const keys = { idKey: 'id', parentIdKey: 'parent_id' };
+  // prettier-ignore
+  const [data, setdata] = useState(() => sortFlatData([{ id: 1, parent_id: null, name: "Root Category", }, { id: 2, parent_id: 1, name: "Technology", }, { id: 5, parent_id: 2, name: "Hardware", }, { id: 10, parent_id: 5, name: "Computer Components", }, { id: 4, parent_id: 2, name: "Programming", }, { id: 8, parent_id: 4, name: "Python", }, { id: 3, parent_id: 1, name: "Science", }, { id: 7, parent_id: 3, name: "Biology", }, { id: 6, parent_id: 3, name: "Physics", },], keys));
+  const [openIds, setopenIds] = useState<Id[] | undefined>([1, 3]);
+  const handleOpen = (id: Id, open: boolean) => {
+    if (open) {
+      setopenIds([...(openIds || allIds), id]);
+    } else {
+      setopenIds((openIds || allIds).filter((i) => i !== id));
+    }
+  }
+  const { renderTree, allIds } = useHeTree({
+    ...keys,
+    data,
+    dataType: 'flat',
+    onChange: setdata,
+    openIds,
+    renderNode: ({ id, node, open, checked, draggable }) => <div>
+      <button onClick={() => handleOpen(id, !open)}>{open ? '-' : '+'}</button>
+      {node.name} - {id}
+    </div>,
+    dragOpen: true,
+    onDragOpen(stat) {
+      handleOpen(stat.id, true)
+    },
+  })
+  return <div>
+    {renderTree({ style: { width: '300px', border: '1px solid #555', padding: '20px' } })}
+  </div>
+}

更新扁平数据

请看效果

源代码

tsx
import {
+  useHeTree, sortFlatData,
+  addToFlatData, removeByIdInFlatData
+} from "he-tree-react";
+import type { Id } from "he-tree-react";
+import { useRef, useState } from 'react';
+
+export default function BasePage() {
+  const keys = { idKey: 'id', parentIdKey: 'parent_id' };
+  // prettier-ignore
+  const [data, setdata] = useState(() => sortFlatData([{ id: 1, parent_id: null, name: "Root Category", }, { id: 2, parent_id: 1, name: "Technology", }, { id: 5, parent_id: 2, name: "Hardware", }, { id: 10, parent_id: 5, name: "Computer Components", }, { id: 4, parent_id: 2, name: "Programming", }, { id: 8, parent_id: 4, name: "Python", }, { id: 3, parent_id: 1, name: "Science", }, { id: 7, parent_id: 3, name: "Biology", }, { id: 6, parent_id: 3, name: "Physics", },], keys));
+  const add = (pid: Id) => {
+    let id = parseInt(Math.random().toString().substring(2, 5));
+    let newData = [...data];
+    addToFlatData(newData, { id, parent_id: pid as number, name: "New" }, 0, keys)
+    setdata(newData);
+  }
+  const remove = (id: Id) => {
+    let newData = [...data];
+    removeByIdInFlatData(newData, id as number, keys)
+    setdata(newData);
+  }
+  const initialData = useRef<typeof data>();
+  initialData.current = initialData.current || data;
+  const { renderTree } = useHeTree({
+    ...keys,
+    data,
+    dataType: 'flat',
+    onChange: setdata,
+    renderNode: ({ id, node, draggable }) => <div>
+      <button draggable={draggable}>👉</button>
+      {node.name} - {id} -
+      <button onClick={() => add(id)}>+</button>
+      <button onClick={() => remove(id)}>-</button>
+    </div>,
+  })
+  return <div>
+    <button onClick={() => setdata(initialData.current!)}>Restore</button>
+    {renderTree({ style: { width: '300px', border: '1px solid #555', padding: '20px' } })}
+  </div>
+}

更新扁平数据使用 immer

请看效果

源代码

tsx
import {
+  useHeTree, sortFlatData,
+  addToFlatData, removeByIdInFlatData
+} from "he-tree-react";
+import type { Id } from "he-tree-react";
+import { useRef } from 'react';
+import { useImmer } from "use-immer";
+
+export default function BasePage() {
+  const keys = { idKey: 'id', parentIdKey: 'parent_id' };
+  // prettier-ignore
+  const [data, setdata] = useImmer(() => sortFlatData([{ id: 1, parent_id: null, name: "Root Category", }, { id: 2, parent_id: 1, name: "Technology", }, { id: 5, parent_id: 2, name: "Hardware", }, { id: 10, parent_id: 5, name: "Computer Components", }, { id: 4, parent_id: 2, name: "Programming", }, { id: 8, parent_id: 4, name: "Python", }, { id: 3, parent_id: 1, name: "Science", }, { id: 7, parent_id: 3, name: "Biology", }, { id: 6, parent_id: 3, name: "Physics", },], keys));
+  const add = (pid: Id) => {
+    let id = parseInt(Math.random().toString().substring(2, 5));
+    setdata(draft => {
+      addToFlatData(draft, { id, parent_id: pid as number, name: "New" }, 0, keys)
+    });
+  }
+  const remove = (id: Id) => {
+    setdata(draft => {
+      removeByIdInFlatData(draft, id as number, keys)
+    })
+  }
+  const edit = (id: Id) => {
+    let newName = prompt("Enter new name")
+    setdata(draft => {
+      if (newName) {
+        draft.find(node => node.id === id)!.name = newName
+      }
+    })
+  }
+  const initialData = useRef<typeof data>();
+  initialData.current = initialData.current || data;
+  const { renderTree } = useHeTree({
+    ...keys,
+    data,
+    dataType: 'flat',
+    onChange: setdata,
+    renderNode: ({ id, node, draggable }) => <div>
+      <button draggable={draggable}>👉</button>
+      {node.name} - {id} -
+      <button onClick={() => add(id)}>+</button>
+      <button onClick={() => remove(id)}>-</button>
+      <button onClick={() => edit(id)}>Edit</button>
+    </div>,
+  })
+  return <div>
+    <button onClick={() => setdata(initialData.current!)}>Restore</button>
+    {renderTree({ style: { width: '300px', border: '1px solid #555', padding: '20px' } })}
+  </div>
+}

更新树形数据使用 immer

请看效果

源代码

tsx
import { useHeTree, findTreeData } from "he-tree-react";
+import type { Id } from "he-tree-react";
+import { useRef } from 'react';
+import { useImmer } from "use-immer";
+
+export default function BasePage() {
+  const CHILDREN = 'children'
+  const keys = { idKey: 'id', childrenKey: CHILDREN };
+  // prettier-ignore
+  const [data, setdata] = useImmer(() => [{ id: 1, name: "Root Category", children: [{ id: 2, name: "Technology", children: [{ id: 5, name: "Hardware", children: [{ id: 10, name: "Computer Components", children: [], },], }, { id: 4, name: "Programming", children: [{ id: 8, name: "Python", children: [], },], },], }, { id: 3, name: "Science", children: [{ id: 7, name: "Biology", children: [], }, { id: 6, name: "Physics", children: [], },], },], },]);
+  const add = (pid: Id) => {
+    let id = parseInt(Math.random().toString().substring(2, 5));
+    setdata(draft => {
+      findTreeData(draft, (node) => node.id === pid, CHILDREN)![CHILDREN].unshift({ id, name: "New", [CHILDREN]: [], })
+    })
+  }
+  const remove = (id: Id, pid: Id | null) => {
+    setdata(draft => {
+      const children = findTreeData(draft, (node,) => node.id === pid, CHILDREN)![CHILDREN]
+      children.splice(children.findIndex(t => t.id === id), 1)
+    })
+  }
+  const edit = (id: Id) => {
+    let newName = prompt("Enter new name")
+    setdata(draft => {
+      if (newName) {
+        findTreeData(draft, (node) => node.id === id, CHILDREN)!.name = newName
+      }
+    })
+  }
+  const initialData = useRef<typeof data>();
+  initialData.current = initialData.current || data;
+  const { renderTree } = useHeTree({
+    ...keys,
+    data,
+    dataType: 'tree',
+    onChange: setdata,
+    renderNode: ({ id, pid, node, draggable }) => <div>
+      <button draggable={draggable}>👉</button>
+      {node.name} - {id} -
+      <button onClick={() => add(id)}>+</button>
+      <button onClick={() => remove(id, pid)}>-</button>
+      <button onClick={() => edit(id)}>Edit</button>
+    </div>,
+  })
+  return <div>
+    <button onClick={() => setdata(initialData.current!)}>Restore</button>
+    {renderTree({ style: { width: '300px', border: '1px solid #555', padding: '20px' } })}
+  </div>
+}

外部拖拽交互

请看效果

源代码

tsx
import { useHeTree, sortFlatData, addToFlatData } from "he-tree-react";
+import { useImmer } from "use-immer";
+
+export default function BasePage() {
+  const keys = { idKey: 'id', parentIdKey: 'parent_id' };
+  // prettier-ignore
+  const [data, setdata] = useImmer(() => sortFlatData([{ id: 1, parent_id: null, name: "Root Category", }, { id: 2, parent_id: 1, name: "Technology", }, { id: 5, parent_id: 2, name: "Hardware", }, { id: 10, parent_id: 5, name: "Computer Components", }, { id: 4, parent_id: 2, name: "Programming", }, { id: 8, parent_id: 4, name: "Python", }, { id: 3, parent_id: 1, name: "Science", }, { id: 7, parent_id: 3, name: "Biology", }, { id: 6, parent_id: 3, name: "Physics", },], keys));
+  const { renderTree, allIds } = useHeTree({
+    ...keys,
+    data,
+    dataType: 'flat',
+    onChange: setdata,
+    renderNode: ({ id, node, open, checked, draggable }) => <div>
+      {node.name} - {id}
+    </div>,
+    onExternalDragOver: (e) => true,
+    onExternalDrop: (e, parentStat, index) => {
+      setdata(draft => {
+        const newNode = { id: 100 + data.length, parent_id: parentStat?.id ?? null, name: "New Node" }
+        addToFlatData(draft, newNode, index, keys)
+      })
+    },
+  })
+  return <div>
+    <button draggable={true}>Drag me in to the tree</button>
+    {renderTree({ style: { width: '300px', border: '1px solid #555', padding: '20px' } })}
+  </div>
+}

大数据, 虚拟列表

请看效果

源代码

tsx
import { useHeTree, sortFlatData } from "he-tree-react";
+import type { Id } from "he-tree-react";
+import { useState } from 'react';
+
+export default function BasePage() {
+  const keys = { idKey: 'id', parentIdKey: 'pid' };
+  // prettier-ignore
+  const [data, setdata] = useState(() => sortFlatData(createData(), keys));
+  const [openIds, setopenIds] = useState<Id[] | undefined>([]);
+  const handleOpen = (id: Id, open: boolean) => {
+    if (open) {
+      setopenIds([...(openIds || allIds), id]);
+    } else {
+      setopenIds((openIds || allIds).filter((i) => i !== id));
+    }
+  }
+  const { renderTree, allIds } = useHeTree({
+    ...keys,
+    data,
+    dataType: 'flat',
+    onChange: setdata,
+    openIds,
+    virtual: true,
+    renderNode: ({ id, node, open, checked, draggable }) => <div>
+      <button onClick={() => handleOpen(id, !open)}>{open ? '-' : '+'}</button>
+      {id}
+    </div>,
+  })
+  return <div>
+    {renderTree({ style: { width: '300px', height: '300px', border: '1px solid #555', padding: '20px' } })}
+  </div>
+}
+
+// generate 10000 nodes
+function createData() {
+  const genId = () => result.length
+  const result: { id: number, pid: number | null }[] = [];
+  for (let i = 0; i < 1000; i++) {
+    let id1 = genId()
+    result.push({ id: id1, pid: null })
+    for (let j = 0; j < 4; j++) {
+      result.push({ id: genId(), pid: id1 })
+    }
+    let id2 = genId()
+    result.push({ id: id2, pid: null })
+    for (let j = 0; j < 4; j++) {
+      result.push({ id: genId(), pid: id2 })
+    }
+  }
+  return result;
+}

滚动到节点

请看效果

源代码

tsx
import { useHeTree, sortFlatData } from "he-tree-react";
+import type { Id } from "he-tree-react";
+import { useState } from 'react';
+
+export default function BasePage() {
+  const keys = { idKey: 'id', parentIdKey: 'pid' };
+  // prettier-ignore
+  const [data, setdata] = useState(() => sortFlatData(createData(), keys));
+  const [openIds, setopenIds] = useState<Id[] | undefined>([]);
+  const handleOpen = (id: Id, open: boolean) => {
+    if (open) {
+      setopenIds([...(openIds || allIds), id]);
+    } else {
+      setopenIds((openIds || allIds).filter((i) => i !== id));
+    }
+  }
+  const { renderTree, allIds, scrollToNode } = useHeTree({
+    ...keys,
+    data,
+    dataType: 'flat',
+    onChange: setdata,
+    openIds,
+    virtual: true,
+    renderNode: ({ id, node, open, checked, draggable }) => <div>
+      <button onClick={() => handleOpen(id, !open)}>{open ? '-' : '+'}</button>
+      {id}
+    </div>,
+  })
+  return <div>
+    <button onClick={() => scrollToNode(910)}>Scroll to 910</button>
+    {renderTree({ style: { width: '300px', height: '300px', border: '1px solid #555', padding: '20px' } })}
+  </div>
+}
+
+// generate 10000 nodes
+function createData() {
+  const genId = () => result.length
+  const result: { id: number, pid: number | null }[] = [];
+  for (let i = 0; i < 1000; i++) {
+    let id1 = genId()
+    result.push({ id: id1, pid: null })
+    for (let j = 0; j < 4; j++) {
+      result.push({ id: genId(), pid: id1 })
+    }
+    let id2 = genId()
+    result.push({ id: id2, pid: null })
+    for (let j = 0; j < 4; j++) {
+      result.push({ id: genId(), pid: id2 })
+    }
+  }
+  return result;
+}
+ + + + \ No newline at end of file diff --git a/zh/v1/guide.html b/zh/v1/guide.html new file mode 100644 index 0000000..a6cf1ed --- /dev/null +++ b/zh/v1/guide.html @@ -0,0 +1,595 @@ + + + + + + 使用指南 | He Tree React + + + + + + + + + + + + + + + +
Skip to content

使用指南

安装

sh
npm install he-tree-react
sh
pnpm add he-tree-react
sh
yarn add he-tree-react

数据类型

此库支持两种结构的数据:

  • 扁平数据, 即一个一维数组. 类似与存储在数据库中的数据. 每项需要id, 父级 id, null代表没有父级. 扁平数据的顺序必须跟树一样, 你可以在初始化数据时使用sortFlatData方法给数据排序.
    js
    [
    +  { id: 1, pid: null },
    +  { id: 2, pid: 1 },
    +  { id: 3, pid: 2 },
    +];
  • 树形数据. 使用children数组包含子节点. 如果未指定id, 此库将使用节点在树中的索引作为id. 使用树形数据时需设置dataType: 'tree'.
js
[
+  {
+    id: 1,
+    children: [
+      {
+        id: 2,
+        children: [{ id: 3 }],
+      },
+    ],
+  },
+];

数据中的id, pid, children不是固定的. 在设置中, 使用idKey, parentIdKey, childrenKey表明你的数据中的对应键名.

没有组件

此库没有导出组件,而是导出一个 hook useHeTree. 使用它返回的renderTree渲染树. 这样做的好处是除了renderTree, useHeTree还会返回一些内部状态和方法, 可以轻松的被获取.

js
import { useHeTree } from "he-tree-react";
+
+export default function App() {
+  const { renderTree } = useHeTree({...})
+  return <div>
+    {renderTree()}
+  </div>
+}

选项

useHeTree是主要使用的函数, 它的第一个参数是选项对象. 必须的选项有data, 必须两者中有一个的是renderNode, renderNodeBox. 其他重要选项是:

  • dataType, 表明数据类型. 可用值:
    • flat, 默认. 扁平数据.
    • tree, 树形数据.
  • idKey, parentIdKey, 默认值是idparent_id. 使用扁平数据时需要. 虽然有默认值, 但还是建议写明更好.
  • childrenKey, 默认是children. 使用树形数据时需要. 虽然有默认值, 但还是建议写明更好.
  • onChange, 数据改变时调用的函数, 参数是新数据. 如果你的树不会改变则不需要.
  • isFunctionReactive, 布尔. 默认false. useHeTree选项中包含许多回调函数, 如onChange, canDrop. isFunctionReactive可用来控制是否监听这些回调函数的改变. 如果你的回调函数和data是同步改变的, 则不用启用此项. 否则你需要启用此项, 并且用 React 的useCallbackuseMemo缓存你的所有回调函数以避免性能问题.

查看useHeTree的 API 文档以了解更多.

提示

  • stat, 单个节点的相关信息. 大部分回调函数的参数里有stat. 参考Stat API.
  • node, 节点的数据. 通过stat.node可以获取节点数据.
  • getStat, 通过此函数可以获取stat, 唯一参数可以是id, node, stat. 此函数在useHeTree的返回对象中: const {getStat} = useHeTree({...}).
  • 下面的代码例子附带有运行效果. 这些例子可以直接复制使用. 注意其中的高亮行的代码.
  • 下面的代码例子使用tsx格式, 如果你需要js格式, 可以使用任意 ts js 在线转换器.

基础使用-扁平数据

tsx
import { useHeTree, sortFlatData } from "he-tree-react";
+import { useState } from 'react';
+
+export default function BasePage() {
+  const keys = { idKey: 'id', parentIdKey: 'parent_id' };
+  const [data, setdata] = useState(() => sortFlatData([
+    {
+      id: 1,
+      parent_id: null,
+      name: "Root Category",
+    },
+    {
+      id: 2,
+      parent_id: 1,
+      name: "Technology",
+    },
+    {
+      id: 5,
+      parent_id: 2,
+      name: "Hardware",
+    },
+    {
+      id: 10,
+      parent_id: 5,
+      name: "Computer Components",
+    },
+    {
+      id: 4,
+      parent_id: 2,
+      name: "Programming",
+    },
+    {
+      id: 8,
+      parent_id: 4,
+      name: "Python",
+    },
+    {
+      id: 3,
+      parent_id: 1,
+      name: "Science",
+    },
+    {
+      id: 7,
+      parent_id: 3,
+      name: "Biology",
+    },
+    {
+      id: 6,
+      parent_id: 3,
+      name: "Physics",
+    },
+  ], keys));
+  const { renderTree } = useHeTree({
+    ...keys,
+    data,
+    dataType: 'flat',
+    onChange: setdata,
+    renderNode: ({ id, node, open, checked }) => <div>
+      {node.name}
+    </div>,
+  })
+  return <div>
+    {renderTree({ style: { width: '300px', border: '1px solid #555', padding: '20px' } })}
+  </div>
+}
请看效果

基础使用-树形数据

tsx
import { useHeTree } from "he-tree-react";
+import { useState } from 'react';
+
+export default function BasePage() {
+  const [data, setdata] = useState(() => [
+    {
+      id: 1,
+      name: "Root Category",
+      children: [
+        {
+          id: 2,
+          name: "Technology",
+          children: [
+            {
+              id: 5,
+              name: "Hardware",
+              children: [
+                {
+                  id: 10,
+                  name: "Computer Components",
+                  children: [],
+                },
+              ],
+            },
+            {
+              id: 4,
+              name: "Programming",
+              children: [
+                {
+                  id: 8,
+                  name: "Python",
+                  children: [],
+                },
+              ],
+            },
+          ],
+        },
+        {
+          id: 3,
+          name: "Science",
+          children: [
+            {
+              id: 7,
+              name: "Biology",
+              children: [],
+            },
+            {
+              id: 6,
+              name: "Physics",
+              children: [],
+            },
+          ],
+        },
+      ],
+    },
+  ]);
+  const { renderTree } = useHeTree({
+    data,
+    dataType: 'tree',
+    childrenKey: 'children',
+    onChange: setdata,
+    renderNode: ({ id, node, open, checked }) => <div>
+      {node.name}
+    </div>,
+  })
+  return <div>
+    {renderTree({ style: { width: '300px', border: '1px solid #555', padding: '20px' } })}
+  </div>
+}
请看效果

自定义拖拽触发元素

给节点任意子元素添加draggable属性即可.

tsx
import { useHeTree, sortFlatData } from "he-tree-react";
+import { useState } from 'react';
+
+export default function BasePage() {
+  const keys = { idKey: 'id', parentIdKey: 'parent_id' };
+  // prettier-ignore
+  const [data, setdata] = useState(() => sortFlatData([{ id: 1, parent_id: null, name: "Root Category", }, { id: 2, parent_id: 1, name: "Technology", }, { id: 5, parent_id: 2, name: "Hardware", }, { id: 10, parent_id: 5, name: "Computer Components", }, { id: 4, parent_id: 2, name: "Programming", }, { id: 8, parent_id: 4, name: "Python", }, { id: 3, parent_id: 1, name: "Science", }, { id: 7, parent_id: 3, name: "Biology", }, { id: 6, parent_id: 3, name: "Physics", },], keys));
+  const { renderTree } = useHeTree({
+    ...keys,
+    data,
+    dataType: 'flat',
+    onChange: setdata,
+    renderNode: ({ id, node, open, checked, draggable }) => <div>
+      <button draggable={draggable}>Drag</button>
+      {node.name}
+    </div>,
+  })
+  return <div>
+    {renderTree({ style: { width: '300px', border: '1px solid #555', padding: '20px' } })}
+  </div>
+}
请看效果

节点 HTML 结构和样式

节点 HTML 如下:

html
<div
+  draggable="true"
+  data-key="1"
+  data-level="1"
+  data-node-box="true"
+  style="padding-left: 0px;"
+>
+  <div>Node</div>
+</div>

上面有两个 div. 使用renderNode选项控制内层 div 的渲染. 如: renderNode: ({node}) => <div>{node.name}</div>.

外层节点被称为nodeBox, 不要修改它的padding-left, padding-right. 使用选项indent控制节点的缩进. 如果你想控制nodeBox或拖拽占位节点的渲染, 可以使用renderNodeBox选项, 这将覆盖renderNode. 标准的renderNodeBox如下:

tsx
renderNodeBox: ({ stat, attrs, isPlaceholder }) => (
+  <div {...attrs} key={attrs.key}>
+    {isPlaceholder ? (
+      <div
+        className="he-tree-drag-placeholder"
+        style={{ minHeight: "20px", border: "1px dashed blue" }}
+      />
+    ) : (
+      <div>{/* node area */}</div>
+    )}
+  </div>
+);

第 4 到第 7 行是拖拽占位节点. 第 9 行是节点元素.

自定义拖拽占位节点和 node box

tsx
import { useHeTree, sortFlatData } from "he-tree-react";
+import { useState } from 'react';
+
+export default function BasePage() {
+  const keys = { idKey: 'id', parentIdKey: 'parent_id' };
+  // prettier-ignore
+  const [data, setdata] = useState(() => sortFlatData([{ id: 1, parent_id: null, name: "Root Category", }, { id: 2, parent_id: 1, name: "Technology", }, { id: 5, parent_id: 2, name: "Hardware", }, { id: 10, parent_id: 5, name: "Computer Components", }, { id: 4, parent_id: 2, name: "Programming", }, { id: 8, parent_id: 4, name: "Python", }, { id: 3, parent_id: 1, name: "Science", }, { id: 7, parent_id: 3, name: "Biology", }, { id: 6, parent_id: 3, name: "Physics", },], keys));
+  const { renderTree } = useHeTree({
+    ...keys,
+    data,
+    dataType: 'flat',
+    onChange: setdata,
+    renderNodeBox: ({ stat, attrs, isPlaceholder }) => (
+      <div {...attrs} key={attrs.key}>
+        {isPlaceholder ? <div className="my-drag-placeholder">drop here</div>
+          : <div className="mynode">{stat.node.name}</div>
+        }
+      </div>
+    ),
+  })
+  return <div>
+    {renderTree({ className: 'mytree', style: { width: '300px', border: '1px solid #555', padding: '20px' } })}
+    <style>{`
+    .mytree [data-node-box]{
+      padding: 5px 0;
+    }
+    .mytree [data-node-box]:hover{
+      background-color: #eee;
+    }
+    .mytree .he-tree-drag-placeholder{
+      height: 30px;
+      line-height: 30px;
+      text-align: center;
+      border: 1px dashed red;
+    }
+    .mynode{
+      padding-left:5px;
+    }
+    `}</style>
+  </div>
+}
请看效果

节点的展开与折叠

  • 使用选项openIds表明展开的节点.
  • 可通过stat.open获取该节点的open状态.
  • useHeTree返回的allIds包含所有节点的 id.
  • 此库导出了方法可以展开单个或多个节点的所有父级. 扁平数据: openParentsInFlatData. 树形数据: openParentsInTreeData.
tsx
import { useHeTree, sortFlatData, openParentsInFlatData } from "he-tree-react";
+import type { Id } from "he-tree-react";
+import { useState } from 'react';
+
+export default function BasePage() {
+  const keys = { idKey: 'id', parentIdKey: 'parent_id' };
+  // prettier-ignore
+  const [data, setdata] = useState(() => sortFlatData([{ id: 1, parent_id: null, name: "Root Category", }, { id: 2, parent_id: 1, name: "Technology", }, { id: 5, parent_id: 2, name: "Hardware", }, { id: 10, parent_id: 5, name: "Computer Components", }, { id: 4, parent_id: 2, name: "Programming", }, { id: 8, parent_id: 4, name: "Python", }, { id: 3, parent_id: 1, name: "Science", }, { id: 7, parent_id: 3, name: "Biology", }, { id: 6, parent_id: 3, name: "Physics", },], keys));
+  const [openIds, setopenIds] = useState<Id[] | undefined>([]);
+  const handleOpen = (id: Id, open: boolean) => {
+    if (open) {
+      setopenIds([...(openIds || allIds), id]);
+    } else {
+      setopenIds((openIds || allIds).filter((i) => i !== id));
+    }
+  }
+  const { renderTree, allIds } = useHeTree({
+    ...keys,
+    data,
+    dataType: 'flat',
+    onChange: setdata,
+    openIds,
+    renderNode: ({ id, node, open, checked, draggable }) => <div>
+      <button onClick={() => handleOpen(id, !open)}>{open ? '-' : '+'}</button>
+      {node.name} - {id}
+    </div>,
+  })
+  return <div>
+    <button onClick={() => setopenIds(allIds)}>Open All</button>
+    <button onClick={() => setopenIds([])}>Close All</button>
+    <button onClick={() => setopenIds(openParentsInFlatData(data, openIds || allIds, 8, keys))}>Open 'Python'</button>
+    <button onClick={() => setopenIds(openParentsInFlatData(data, [], 8, keys))}>Only Open 'Python'</button>
+    {renderTree({ style: { width: '300px', border: '1px solid #555', padding: '20px' } })}
+  </div>
+}
请看效果

此例子顶部 4 个按钮分别是: 展开全部, 折叠全部, 展开'Python'节点的所有父节点, 仅展开'Python'节点的所有父节点.

节点的勾选

  • 使用选项checkedIds表明勾选的节点.
  • 可通过stat.checked获取该节点的checked状态.
  • 此库导出了方法可以获取单个或多个节点checked变动后的checkedIds. 扁平数据: updateCheckedInFlatData. 树形数据: `updateCheckedInTreeData.
    • 此方法对节点的checked的更新是级联的. 如果你不想级联更新, 使用你自己的逻辑替代.
    • 此方法返回一个长度 2 的数组. 第一项是所有勾选的 id, 第二项是所有半选的 id. 如果不需要半选, 忽略第二项.
    • 半选, 即同时有子节点被勾选或半选, 也有子节点未被勾选.
tsx
import { useHeTree, sortFlatData, updateCheckedInFlatData } from "he-tree-react";
+import type { Id } from "he-tree-react";
+import { useState } from 'react';
+
+export default function BasePage() {
+  const keys = { idKey: 'id', parentIdKey: 'parent_id' };
+  // prettier-ignore
+  const [data, setdata] = useState(() => sortFlatData([{ id: 1, parent_id: null, name: "Root Category", }, { id: 2, parent_id: 1, name: "Technology", }, { id: 5, parent_id: 2, name: "Hardware", }, { id: 10, parent_id: 5, name: "Computer Components", }, { id: 4, parent_id: 2, name: "Programming", }, { id: 8, parent_id: 4, name: "Python", }, { id: 3, parent_id: 1, name: "Science", }, { id: 7, parent_id: 3, name: "Biology", }, { id: 6, parent_id: 3, name: "Physics", },], keys));
+  const [checkedIds, setcheckedIds] = useState<Id[]>([]);
+  const [semiCheckedIds, setsemiCheckedIds] = useState<Id[]>([]);
+  const handleChecked = (id: Id, checked: boolean) => {
+    const r = updateCheckedInFlatData(data, checkedIds, id, checked, keys);
+    setcheckedIds(r[0]);
+    setsemiCheckedIds(r[1]);
+  }
+  const { renderTree } = useHeTree({
+    ...keys,
+    data,
+    dataType: 'flat',
+    onChange: setdata,
+    checkedIds,
+    renderNode: ({ id, node, open, checked, draggable }) => <div>
+      <input type="checkbox" checked={checked || false} onChange={() => handleChecked(id, !checked)} />
+      {node.name} - {id}
+    </div>,
+  })
+  return <div>
+    Checked: {JSON.stringify(checkedIds)} <br />
+    Semi-Checked: {JSON.stringify(semiCheckedIds)}
+    {renderTree({ style: { width: '300px', border: '1px solid #555', padding: '20px' } })}
+  </div>
+}
请看效果

控制是否可拖拽, 可放入

使用以下选项控制:

tsx
import { useHeTree, sortFlatData } from "he-tree-react";
+import { useState } from 'react';
+
+export default function BasePage() {
+  const keys = { idKey: 'id', parentIdKey: 'parent_id' };
+  // prettier-ignore
+  const [data, setdata] = useState(() => sortFlatData([{ id: 2, parent_id: 1, name: "Technology", }, { id: 5, parent_id: 2, name: "Hardware", }, { id: 10, parent_id: 5, name: "Computer Components", }, { id: 4, parent_id: 2, name: "Programming", }, { id: 8, parent_id: 4, name: "Python", }, { id: 3, parent_id: 1, name: "Science", }, { id: 7, parent_id: 3, name: "Biology", }, { id: 6, parent_id: 3, name: "Physics", },], keys));
+  const { renderTree } = useHeTree({
+    ...keys,
+    data,
+    dataType: 'flat',
+    onChange: setdata,
+    renderNode: ({ id, node, open, checked, draggable }) => <div>
+      {node.name} - {id}
+    </div>,
+    canDrag: ({ id }) => id === 2 ? true : (id === 3 ? false : undefined),
+    canDrop: ({ id }) => id === 3 ? true : (id === 2 ? false : undefined),
+    canDropToRoot: (index) => false,
+  })
+  return <div>
+    {renderTree({ style: { width: '300px', border: '1px solid #555', padding: '20px' } })}
+  </div>
+}
请看效果
  • 根节点不可放入.
  • Technology及子节点可以拖拽. Science及子节点不可以拖拽.
  • Science及子节点可以放入. Technology及子节点不可以放入.

拖拽到节点上时打开节点

使用以下选项控制:

tsx
import { useHeTree, sortFlatData } from "he-tree-react";
+import type { Id } from "he-tree-react";
+import { useState } from 'react';
+
+export default function BasePage() {
+  const keys = { idKey: 'id', parentIdKey: 'parent_id' };
+  // prettier-ignore
+  const [data, setdata] = useState(() => sortFlatData([{ id: 1, parent_id: null, name: "Root Category", }, { id: 2, parent_id: 1, name: "Technology", }, { id: 5, parent_id: 2, name: "Hardware", }, { id: 10, parent_id: 5, name: "Computer Components", }, { id: 4, parent_id: 2, name: "Programming", }, { id: 8, parent_id: 4, name: "Python", }, { id: 3, parent_id: 1, name: "Science", }, { id: 7, parent_id: 3, name: "Biology", }, { id: 6, parent_id: 3, name: "Physics", },], keys));
+  const [openIds, setopenIds] = useState<Id[] | undefined>([1, 3]);
+  const handleOpen = (id: Id, open: boolean) => {
+    if (open) {
+      setopenIds([...(openIds || allIds), id]);
+    } else {
+      setopenIds((openIds || allIds).filter((i) => i !== id));
+    }
+  }
+  const { renderTree, allIds } = useHeTree({
+    ...keys,
+    data,
+    dataType: 'flat',
+    onChange: setdata,
+    openIds,
+    renderNode: ({ id, node, open, checked, draggable }) => <div>
+      <button onClick={() => handleOpen(id, !open)}>{open ? '-' : '+'}</button>
+      {node.name} - {id}
+    </div>,
+    dragOpen: true,
+    onDragOpen(stat) {
+      handleOpen(stat.id, true)
+    },
+  })
+  return <div>
+    {renderTree({ style: { width: '300px', border: '1px solid #555', padding: '20px' } })}
+  </div>
+}
请看效果

更新数据

由于 React 的不可变特性, 扁平数据和树形数据更新都很困难. 针对扁平数据, 此库提供了两个方法, 用以增加节点或删除节点. 如果你要进行更复杂的操作, 或者更新树形数据, 推荐你使用immer.

sh
npm install immer use-immer
sh
pnpm add immer use-immer
sh
yarn add immer use-immer

使用内置方法更新扁平数据

addToFlatData: 增加节点. removeByIdInFlatData: 删除节点. 这两个方法都会改变原数据, 所以把原数据的复制传给它, 或者与immer一起使用.

tsx
import {
+  useHeTree, sortFlatData,
+  addToFlatData, removeByIdInFlatData
+} from "he-tree-react";
+import type { Id } from "he-tree-react";
+import { useRef, useState } from 'react';
+
+export default function BasePage() {
+  const keys = { idKey: 'id', parentIdKey: 'parent_id' };
+  // prettier-ignore
+  const [data, setdata] = useState(() => sortFlatData([{ id: 1, parent_id: null, name: "Root Category", }, { id: 2, parent_id: 1, name: "Technology", }, { id: 5, parent_id: 2, name: "Hardware", }, { id: 10, parent_id: 5, name: "Computer Components", }, { id: 4, parent_id: 2, name: "Programming", }, { id: 8, parent_id: 4, name: "Python", }, { id: 3, parent_id: 1, name: "Science", }, { id: 7, parent_id: 3, name: "Biology", }, { id: 6, parent_id: 3, name: "Physics", },], keys));
+  const add = (pid: Id) => {
+    let id = parseInt(Math.random().toString().substring(2, 5));
+    let newData = [...data];
+    addToFlatData(newData, { id, parent_id: pid as number, name: "New" }, 0, keys)
+    setdata(newData);
+  }
+  const remove = (id: Id) => {
+    let newData = [...data];
+    removeByIdInFlatData(newData, id as number, keys)
+    setdata(newData);
+  }
+  const initialData = useRef<typeof data>();
+  initialData.current = initialData.current || data;
+  const { renderTree } = useHeTree({
+    ...keys,
+    data,
+    dataType: 'flat',
+    onChange: setdata,
+    renderNode: ({ id, node, draggable }) => <div>
+      <button draggable={draggable}>👉</button>
+      {node.name} - {id} -
+      <button onClick={() => add(id)}>+</button>
+      <button onClick={() => remove(id)}>-</button>
+    </div>,
+  })
+  return <div>
+    <button onClick={() => setdata(initialData.current!)}>Restore</button>
+    {renderTree({ style: { width: '300px', border: '1px solid #555', padding: '20px' } })}
+  </div>
+}
请看效果

使用 immer 更新扁平数据

注意, 这里使用了useImmer替代 React 的useState.

tsx
import {
+  useHeTree, sortFlatData,
+  addToFlatData, removeByIdInFlatData
+} from "he-tree-react";
+import type { Id } from "he-tree-react";
+import { useRef } from 'react';
+import { useImmer } from "use-immer";
+
+export default function BasePage() {
+  const keys = { idKey: 'id', parentIdKey: 'parent_id' };
+  // prettier-ignore
+  const [data, setdata] = useImmer(() => sortFlatData([{ id: 1, parent_id: null, name: "Root Category", }, { id: 2, parent_id: 1, name: "Technology", }, { id: 5, parent_id: 2, name: "Hardware", }, { id: 10, parent_id: 5, name: "Computer Components", }, { id: 4, parent_id: 2, name: "Programming", }, { id: 8, parent_id: 4, name: "Python", }, { id: 3, parent_id: 1, name: "Science", }, { id: 7, parent_id: 3, name: "Biology", }, { id: 6, parent_id: 3, name: "Physics", },], keys));
+  const add = (pid: Id) => {
+    let id = parseInt(Math.random().toString().substring(2, 5));
+    setdata(draft => {
+      addToFlatData(draft, { id, parent_id: pid as number, name: "New" }, 0, keys)
+    });
+  }
+  const remove = (id: Id) => {
+    setdata(draft => {
+      removeByIdInFlatData(draft, id as number, keys)
+    })
+  }
+  const edit = (id: Id) => {
+    let newName = prompt("Enter new name")
+    setdata(draft => {
+      if (newName) {
+        draft.find(node => node.id === id)!.name = newName
+      }
+    })
+  }
+  const initialData = useRef<typeof data>();
+  initialData.current = initialData.current || data;
+  const { renderTree } = useHeTree({
+    ...keys,
+    data,
+    dataType: 'flat',
+    onChange: setdata,
+    renderNode: ({ id, node, draggable }) => <div>
+      <button draggable={draggable}>👉</button>
+      {node.name} - {id} -
+      <button onClick={() => add(id)}>+</button>
+      <button onClick={() => remove(id)}>-</button>
+      <button onClick={() => edit(id)}>Edit</button>
+    </div>,
+  })
+  return <div>
+    <button onClick={() => setdata(initialData.current!)}>Restore</button>
+    {renderTree({ style: { width: '300px', border: '1px solid #555', padding: '20px' } })}
+  </div>
+}
请看效果

使用 immer 更新树形数据

注意, 这里使用了useImmer替代 React 的useState. findTreeData方法类似数组的find方法.

tsx
import { useHeTree, findTreeData } from "he-tree-react";
+import type { Id } from "he-tree-react";
+import { useRef } from 'react';
+import { useImmer } from "use-immer";
+
+export default function BasePage() {
+  const CHILDREN = 'children'
+  const keys = { idKey: 'id', childrenKey: CHILDREN };
+  // prettier-ignore
+  const [data, setdata] = useImmer(() => [{ id: 1, name: "Root Category", children: [{ id: 2, name: "Technology", children: [{ id: 5, name: "Hardware", children: [{ id: 10, name: "Computer Components", children: [], },], }, { id: 4, name: "Programming", children: [{ id: 8, name: "Python", children: [], },], },], }, { id: 3, name: "Science", children: [{ id: 7, name: "Biology", children: [], }, { id: 6, name: "Physics", children: [], },], },], },]);
+  const add = (pid: Id) => {
+    let id = parseInt(Math.random().toString().substring(2, 5));
+    setdata(draft => {
+      findTreeData(draft, (node) => node.id === pid, CHILDREN)![CHILDREN].unshift({ id, name: "New", [CHILDREN]: [], })
+    })
+  }
+  const remove = (id: Id, pid: Id | null) => {
+    setdata(draft => {
+      const children = findTreeData(draft, (node,) => node.id === pid, CHILDREN)![CHILDREN]
+      children.splice(children.findIndex(t => t.id === id), 1)
+    })
+  }
+  const edit = (id: Id) => {
+    let newName = prompt("Enter new name")
+    setdata(draft => {
+      if (newName) {
+        findTreeData(draft, (node) => node.id === id, CHILDREN)!.name = newName
+      }
+    })
+  }
+  const initialData = useRef<typeof data>();
+  initialData.current = initialData.current || data;
+  const { renderTree } = useHeTree({
+    ...keys,
+    data,
+    dataType: 'tree',
+    onChange: setdata,
+    renderNode: ({ id, pid, node, draggable }) => <div>
+      <button draggable={draggable}>👉</button>
+      {node.name} - {id} -
+      <button onClick={() => add(id)}>+</button>
+      <button onClick={() => remove(id, pid)}>-</button>
+      <button onClick={() => edit(id)}>Edit</button>
+    </div>,
+  })
+  return <div>
+    <button onClick={() => setdata(initialData.current!)}>Restore</button>
+    {renderTree({ style: { width: '300px', border: '1px solid #555', padding: '20px' } })}
+  </div>
+}
请看效果

从外部发起的拖拽

相关选项:

tsx
import { useHeTree, sortFlatData, addToFlatData } from "he-tree-react";
+import { useImmer } from "use-immer";
+
+export default function BasePage() {
+  const keys = { idKey: 'id', parentIdKey: 'parent_id' };
+  // prettier-ignore
+  const [data, setdata] = useImmer(() => sortFlatData([{ id: 1, parent_id: null, name: "Root Category", }, { id: 2, parent_id: 1, name: "Technology", }, { id: 5, parent_id: 2, name: "Hardware", }, { id: 10, parent_id: 5, name: "Computer Components", }, { id: 4, parent_id: 2, name: "Programming", }, { id: 8, parent_id: 4, name: "Python", }, { id: 3, parent_id: 1, name: "Science", }, { id: 7, parent_id: 3, name: "Biology", }, { id: 6, parent_id: 3, name: "Physics", },], keys));
+  const { renderTree, allIds } = useHeTree({
+    ...keys,
+    data,
+    dataType: 'flat',
+    onChange: setdata,
+    renderNode: ({ id, node, open, checked, draggable }) => <div>
+      {node.name} - {id}
+    </div>,
+    onExternalDragOver: (e) => true,
+    onExternalDrop: (e, parentStat, index) => {
+      setdata(draft => {
+        const newNode = { id: 100 + data.length, parent_id: parentStat?.id ?? null, name: "New Node" }
+        addToFlatData(draft, newNode, index, keys)
+      })
+    },
+  })
+  return <div>
+    <button draggable={true}>Drag me in to the tree</button>
+    {renderTree({ style: { width: '300px', border: '1px solid #555', padding: '20px' } })}
+  </div>
+}
请看效果

超大数据

使用选项virtual启用虚拟列表功能. 记得给树设置可见区域高度.

tsx
import { useHeTree, sortFlatData } from "he-tree-react";
+import type { Id } from "he-tree-react";
+import { useState } from 'react';
+
+export default function BasePage() {
+  const keys = { idKey: 'id', parentIdKey: 'pid' };
+  // prettier-ignore
+  const [data, setdata] = useState(() => sortFlatData(createData(), keys));
+  const [openIds, setopenIds] = useState<Id[] | undefined>([]);
+  const handleOpen = (id: Id, open: boolean) => {
+    if (open) {
+      setopenIds([...(openIds || allIds), id]);
+    } else {
+      setopenIds((openIds || allIds).filter((i) => i !== id));
+    }
+  }
+  const { renderTree, allIds } = useHeTree({
+    ...keys,
+    data,
+    dataType: 'flat',
+    onChange: setdata,
+    openIds,
+    virtual: true,
+    renderNode: ({ id, node, open, checked, draggable }) => <div>
+      <button onClick={() => handleOpen(id, !open)}>{open ? '-' : '+'}</button>
+      {id}
+    </div>,
+  })
+  return <div>
+    {renderTree({ style: { width: '300px', height: '300px', border: '1px solid #555', padding: '20px' } })}
+  </div>
+}
+
+// generate 10000 nodes
+function createData() {
+  const genId = () => result.length
+  const result: { id: number, pid: number | null }[] = [];
+  for (let i = 0; i < 1000; i++) {
+    let id1 = genId()
+    result.push({ id: id1, pid: null })
+    for (let j = 0; j < 4; j++) {
+      result.push({ id: genId(), pid: id1 })
+    }
+    let id2 = genId()
+    result.push({ id: id2, pid: null })
+    for (let j = 0; j < 4; j++) {
+      result.push({ id: genId(), pid: id2 })
+    }
+  }
+  return result;
+}
请看效果

触摸 & 移动设备

此库基于 HTML5 Drag and Drop API, 所以在支持 Drag and Drop API 的移动设备上能工作. 如果不支持, 可以尝试添加兼容 Drag and Drop API 的库.

注意

触摸时, 用户需要触摸并等一会儿才能触发拖拽。

其他

+ + + + \ No newline at end of file