@hachej/boring-ui-cli 0.1.18 → 0.1.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/server/cli.js +51 -1
- package/package.json +4 -4
- package/public/assets/{CodeEditor-DQqOn4xz-BpvvkFT7.js → CodeEditor-DQqOn4xz-BAFzWEWd.js} +1 -1
- package/public/assets/{FileTree-DHVB9rpk-FMcsf2w-.js → FileTree-nBvBA8m7-CLG_gDQq.js} +13 -13
- package/public/assets/{MarkdownEditor-L1KDH0bM-D-LbfGkW.js → MarkdownEditor-CeigBQee-D92npGfE.js} +1 -1
- package/public/assets/{_baseUniq-CMA9Ia5A.js → _baseUniq-D3Is_hCV.js} +1 -1
- package/public/assets/{arc-tnXyejqK.js → arc-CCZsH7Lz.js} +1 -1
- package/public/assets/{architectureDiagram-Q4EWVU46-BSOUkwG2.js → architectureDiagram-Q4EWVU46-BIZiY28F.js} +1 -1
- package/public/assets/{blockDiagram-DXYQGD6D-beerpyJi.js → blockDiagram-DXYQGD6D-DsSrNrKb.js} +1 -1
- package/public/assets/{c4Diagram-AHTNJAMY-uB419B41.js → c4Diagram-AHTNJAMY-w9XEk7x6.js} +1 -1
- package/public/assets/channel-C00lOhCb.js +1 -0
- package/public/assets/{chunk-4BX2VUAB-CpStyzoR.js → chunk-4BX2VUAB-CGh01pe9.js} +1 -1
- package/public/assets/{chunk-4TB4RGXK-BL531Lcw.js → chunk-4TB4RGXK-W_MZ5xV2.js} +1 -1
- package/public/assets/{chunk-55IACEB6-CRDe66a9.js → chunk-55IACEB6-CtcT34iA.js} +1 -1
- package/public/assets/{chunk-EDXVE4YY-NaBO_txy.js → chunk-EDXVE4YY-7hMY0-Ht.js} +1 -1
- package/public/assets/{chunk-FMBD7UC4-Dn2Fmb5W.js → chunk-FMBD7UC4-D8hpnWzX.js} +1 -1
- package/public/assets/{chunk-OYMX7WX6-iffOaivX.js → chunk-OYMX7WX6-BytBZ81A.js} +1 -1
- package/public/assets/{chunk-QZHKN3VN-BKRi-Sxw.js → chunk-QZHKN3VN-C109EFXp.js} +1 -1
- package/public/assets/{chunk-YZCP3GAM-CFQPe6Lu.js → chunk-YZCP3GAM-DKynzb8E.js} +1 -1
- package/public/assets/classDiagram-6PBFFD2Q-Dp5BfGWv.js +1 -0
- package/public/assets/classDiagram-v2-HSJHXN6E-Dp5BfGWv.js +1 -0
- package/public/assets/clone-fQpTYsFB.js +1 -0
- package/public/assets/{cose-bilkent-S5V4N54A-BFfdAG94.js → cose-bilkent-S5V4N54A-Dz0sKcyp.js} +1 -1
- package/public/assets/{dagre-KV5264BT-BvfHllE1.js → dagre-KV5264BT-3siOg78t.js} +1 -1
- package/public/assets/{diagram-5BDNPKRD-DML8a0lh.js → diagram-5BDNPKRD-vvFeo_Sf.js} +1 -1
- package/public/assets/{diagram-G4DWMVQ6-DL30StUK.js → diagram-G4DWMVQ6-WqsmRezl.js} +1 -1
- package/public/assets/{diagram-MMDJMWI5-D3-Kryyd.js → diagram-MMDJMWI5-CPqMu_Sf.js} +1 -1
- package/public/assets/{diagram-TYMM5635-HDTViX5R.js → diagram-TYMM5635-TzWfNsah.js} +1 -1
- package/public/assets/{erDiagram-SMLLAGMA-DV46TbuX.js → erDiagram-SMLLAGMA-BDSJWZqk.js} +1 -1
- package/public/assets/{flowDiagram-DWJPFMVM-BXqQu2_i.js → flowDiagram-DWJPFMVM-C1S-4_Cg.js} +1 -1
- package/public/assets/{ganttDiagram-T4ZO3ILL-CnPz0E5a.js → ganttDiagram-T4ZO3ILL-B98BD5z3.js} +1 -1
- package/public/assets/{gitGraphDiagram-UUTBAWPF-C25lUVfz.js → gitGraphDiagram-UUTBAWPF-Cmvjysk0.js} +1 -1
- package/public/assets/{graph-CSby6HJp.js → graph-sYf6TqIc.js} +1 -1
- package/public/assets/{highlighted-body-OFNGDK62-D5Bucj_m.js → highlighted-body-OFNGDK62-CXdxKP3Q.js} +1 -1
- package/public/assets/{index-DLyovEn7.js → index-AFhevE3Z.js} +1 -1
- package/public/assets/{index-CrQ5eYxl.js → index-DYdcFGsN.js} +5 -5
- package/public/assets/{infoDiagram-42DDH7IO-D1tkIwny.js → infoDiagram-42DDH7IO-vJM5h_tq.js} +1 -1
- package/public/assets/{ishikawaDiagram-UXIWVN3A-D6zbyxWx.js → ishikawaDiagram-UXIWVN3A-D6WPjTgW.js} +1 -1
- package/public/assets/{journeyDiagram-VCZTEJTY-ExQUgQxi.js → journeyDiagram-VCZTEJTY-C4Ro62cH.js} +1 -1
- package/public/assets/{kanban-definition-6JOO6SKY-E3gNRZLm.js → kanban-definition-6JOO6SKY-CoVkUUW1.js} +1 -1
- package/public/assets/{layout-BF96CGik.js → layout-C8UtS8AS.js} +1 -1
- package/public/assets/{linear-6x4QueCv.js → linear-Kt3yJaBD.js} +1 -1
- package/public/assets/{min-Cyn_UaFw.js → min-0DSG7c0k.js} +1 -1
- package/public/assets/{mindmap-definition-QFDTVHPH-CcpKJ1lB.js → mindmap-definition-QFDTVHPH-DtXsaCz-.js} +1 -1
- package/public/assets/{pieDiagram-DEJITSTG-PVIVMgVu.js → pieDiagram-DEJITSTG-DsKSgqOW.js} +1 -1
- package/public/assets/{quadrantDiagram-34T5L4WZ-BTyRfzd6.js → quadrantDiagram-34T5L4WZ-CdbiE7rD.js} +1 -1
- package/public/assets/{requirementDiagram-MS252O5E-CU9X0jFW.js → requirementDiagram-MS252O5E-XxABUJ_X.js} +1 -1
- package/public/assets/{sankeyDiagram-XADWPNL6-DyZdSLSv.js → sankeyDiagram-XADWPNL6-D7NR5Nhs.js} +1 -1
- package/public/assets/{sequenceDiagram-FGHM5R23-CuJRqb6t.js → sequenceDiagram-FGHM5R23-BG0WuOq2.js} +1 -1
- package/public/assets/{stateDiagram-FHFEXIEX-5mIpjfjp.js → stateDiagram-FHFEXIEX-DmZh8osG.js} +1 -1
- package/public/assets/stateDiagram-v2-QKLJ7IA2-C4VIL9Mn.js +1 -0
- package/public/assets/{timeline-definition-GMOUNBTQ-DCSOAQyL.js → timeline-definition-GMOUNBTQ-DHS6HebU.js} +1 -1
- package/public/assets/{vennDiagram-DHZGUBPP-BXxgH4Ub.js → vennDiagram-DHZGUBPP-nuvPO_YM.js} +1 -1
- package/public/assets/{wardley-RL74JXVD-BWSOnFou.js → wardley-RL74JXVD-KVF7hJgM.js} +1 -1
- package/public/assets/{wardleyDiagram-NUSXRM2D-BrsRzGry.js → wardleyDiagram-NUSXRM2D-CDn9qPsu.js} +1 -1
- package/public/assets/{xychartDiagram-5P7HB3ND-CLF12YPc.js → xychartDiagram-5P7HB3ND-DF0ubL81.js} +1 -1
- package/public/index.html +1 -1
- package/public/assets/channel-C2_9gQqR.js +0 -1
- package/public/assets/classDiagram-6PBFFD2Q-BX66CTk2.js +0 -1
- package/public/assets/classDiagram-v2-HSJHXN6E-BX66CTk2.js +0 -1
- package/public/assets/clone-BUVN29h2.js +0 -1
- package/public/assets/stateDiagram-v2-QKLJ7IA2-yZsODTx6.js +0 -1
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import{bM as
|
|
1
|
+
import{bM as nr,r as h,bN as ir,j as y,aP as un,bl as Q,b_ as ln,b$ as cn,bX as dn,bW as fn}from"./index-DYdcFGsN.js";import{s as hn}from"./index-AFhevE3Z.js";/**
|
|
2
2
|
* @license lucide-react v1.8.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
5
5
|
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/const
|
|
6
|
+
*/const gn=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],pn=nr("folder-open",gn);/**
|
|
7
7
|
* @license lucide-react v1.8.0 - ISC
|
|
8
8
|
*
|
|
9
9
|
* This source code is licensed under the ISC license.
|
|
10
10
|
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
-
*/const hn=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],gn=rr("folder",hn),ir=h.createContext(null);function k(){const t=h.useContext(ir);if(t===null)throw new Error("No Tree Api Provided");return t}const or=h.createContext(null);function pn(){const t=h.useContext(or);if(t===null)throw new Error("Provide a NodesContext");return t}const ar=h.createContext(null);function vn(){const t=h.useContext(ar);if(t===null)throw new Error("Provide a DnDContext");return t}const sr=h.createContext(0);function ur(){h.useContext(sr)}function ce(t,e,r){return Math.max(Math.min(t,r),e)}function lr(t){return t&&t.isLeaf}function cr(t){return t&&t.isInternal&&!t.isOpen}function dr(t){var e;return t&&t.isOpen&&!(!((e=t.children)===null||e===void 0)&&e.length)}const fr=(t,e)=>{let r=t;for(;r;){if(r.id===e.id)return!0;r=r.parent}return!1},hr=t=>{if(!t.parent)throw Error("Node does not have a parent");return t.parent.children.findIndex(e=>e.id===t.id)};function Xe(t,e){if(!t)return null;if(t.id===e)return t;if(t.children)for(let r of t.children){const n=Xe(r,e);if(n)return n}return null}function ve(t,e){if(e(t),t.children)for(let r of t.children)ve(r,e)}function gr(t){const e=vr(t);let r;for(let n=0;n<e.length;++n)if(e[n]===t){r=yn(e,n);break}r==null||r.focus()}function pr(t){const e=vr(t);let r;for(let n=0;n<e.length;++n)if(e[n]===t){r=mn(e,n);break}r==null||r.focus()}function yn(t,e){return e+1<t.length?t[e+1]:t[0]}function mn(t,e){return e-1>=0?t[e-1]:t[t.length-1]}function vr(t){return Array.from(document.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"]):not([disabled]), details:not([disabled]), summary:not(:disabled)')).filter(e=>e===t||!t.contains(e))}function ne(t,e){return typeof e=="boolean"?e:typeof e=="string"?t[e]:e(t)}function yr(t){return t===null?null:z(t)}function z(t){return typeof t=="string"?t:t.id}function mr(t,...e){if(t)return t(...e)}function br(t){return new Promise((e,r)=>{let n=0;function i(){n+=1,n===100&&r(),t()?e():setTimeout(i,10)}i()})}function Or(t){var e,r;const n=t.focusedNode;return n?n.isOpen?0:n.parent?n.childIndex+1:0:(r=(e=t.root.children)===null||e===void 0?void 0:e.length)!==null&&r!==void 0?r:0}function Sr(t){const e=t.focusedNode;return e?e.isOpen?e.id:e.parent&&!e.parent.isRoot?e.parent.id:null:null}const bn=Object.freeze(Object.defineProperty({__proto__:null,access:ne,bound:ce,dfs:Xe,focusNextElement:gr,focusPrevElement:pr,getInsertIndex:Or,getInsertParentId:Sr,identify:z,identifyNull:yr,indexOf:hr,isClosed:cr,isDescendant:fr,isItem:lr,isOpenWithEmptyChildren:dr,safeRun:mr,waitFor:br,walk:ve},Symbol.toStringTag,{value:"Module"})),On={display:"flex",alignItems:"center",zIndex:1},Sn={flex:1,height:"2px",background:"#4B91E2",borderRadius:"1px"},In={width:"4px",height:"4px",boxShadow:"0 0 0 3px #4B91E2",borderRadius:"50%"},Dn=nr.memo(function({top:e,left:r,indent:n}){const i={position:"absolute",pointerEvents:"none",top:e-2+"px",left:r+"px",right:n+"px"};return y.jsxs("div",{style:Object.assign(Object.assign({},On),i),children:[y.jsx("div",{style:Object.assign({},In)}),y.jsx("div",{style:Object.assign({},Sn)})]})});function Tn({node:t,attrs:e,innerRef:r,children:n}){return y.jsx("div",Object.assign({},e,{ref:r,onFocus:i=>i.stopPropagation(),onClick:t.handleClick,children:n}))}function wn(t){return y.jsxs("div",{ref:t.dragHandle,style:t.style,children:[y.jsx("span",{onClick:e=>{e.stopPropagation(),t.node.toggle()},children:t.node.isLeaf?"🌳":t.node.isOpen?"🗁":"🗀"})," ",t.node.isEditing?y.jsx(En,Object.assign({},t)):y.jsx(Cn,Object.assign({},t))]})}function Cn(t){return y.jsx(y.Fragment,{children:y.jsx("span",{children:t.node.data.name})})}function En({node:t}){const e=h.useRef();return h.useEffect(()=>{var r,n;(r=e.current)===null||r===void 0||r.focus(),(n=e.current)===null||n===void 0||n.select()},[]),y.jsx("input",{ref:e,defaultValue:t.data.name,onBlur:()=>t.reset(),onKeyDown:r=>{var n;r.key==="Escape"&&t.reset(),r.key==="Enter"&&t.submit(((n=e.current)===null||n===void 0?void 0:n.value)||"")}})}function Ce(t){return{type:"EDIT",id:t}}function _n(t={id:null},e){return e.type==="EDIT"?Object.assign(Object.assign({},t),{id:e.id}):t}function V(t){return{type:"FOCUS",id:t}}function xn(){return{type:"TREE_BLUR"}}function Nn(t={id:null,treeFocused:!1},e){return e.type==="FOCUS"?Object.assign(Object.assign({},t),{id:e.id,treeFocused:!0}):e.type==="TREE_BLUR"?Object.assign(Object.assign({},t),{treeFocused:!1}):t}class ye{constructor(e){this.handleClick=r=>{r.metaKey&&!this.tree.props.disableMultiSelection?this.isSelected?this.deselect():this.selectMulti():r.shiftKey&&!this.tree.props.disableMultiSelection?this.selectContiguous():(this.select(),this.activate())},this.tree=e.tree,this.id=e.id,this.data=e.data,this.level=e.level,this.children=e.children,this.parent=e.parent,this.isDraggable=e.isDraggable,this.rowIndex=e.rowIndex}get isRoot(){return this.id===oe}get isLeaf(){return!Array.isArray(this.children)}get isInternal(){return!this.isLeaf}get isOpen(){return this.isLeaf?!1:this.tree.isOpen(this.id)}get isClosed(){return this.isLeaf?!1:!this.tree.isOpen(this.id)}get isEditable(){return this.tree.isEditable(this.data)}get isEditing(){return this.tree.editingId===this.id}get isSelected(){return this.tree.isSelected(this.id)}get isOnlySelection(){return this.isSelected&&this.tree.hasOneSelection}get isSelectedStart(){var e;return this.isSelected&&!(!((e=this.prev)===null||e===void 0)&&e.isSelected)}get isSelectedEnd(){var e;return this.isSelected&&!(!((e=this.next)===null||e===void 0)&&e.isSelected)}get isFocused(){return this.tree.isFocused(this.id)}get isDragging(){return this.tree.isDragging(this.id)}get willReceiveDrop(){return this.tree.willReceiveDrop(this.id)}get state(){return{isClosed:this.isClosed,isDragging:this.isDragging,isEditing:this.isEditing,isFocused:this.isFocused,isInternal:this.isInternal,isLeaf:this.isLeaf,isOpen:this.isOpen,isSelected:this.isSelected,isSelectedEnd:this.isSelectedEnd,isSelectedStart:this.isSelectedStart,willReceiveDrop:this.willReceiveDrop}}get childIndex(){return this.parent&&this.parent.children?this.parent.children.findIndex(e=>e.id===this.id):-1}get next(){return this.rowIndex===null?null:this.tree.at(this.rowIndex+1)}get prev(){return this.rowIndex===null?null:this.tree.at(this.rowIndex-1)}get nextSibling(){var e,r;const n=this.childIndex;return(r=(e=this.parent)===null||e===void 0?void 0:e.children[n+1])!==null&&r!==void 0?r:null}isAncestorOf(e){if(!e)return!1;let r=e;for(;r;){if(r.id===this.id)return!0;r=r.parent}return!1}select(){this.tree.select(this)}deselect(){this.tree.deselect(this)}selectMulti(){this.tree.selectMulti(this)}selectContiguous(){this.tree.selectContiguous(this)}activate(){this.tree.activate(this)}focus(){this.tree.focus(this)}toggle(){this.tree.toggle(this)}open(){this.tree.open(this)}openParents(){this.tree.openParents(this)}close(){this.tree.close(this)}submit(e){this.tree.submit(this,e)}reset(){this.tree.reset()}clone(){return new ye(Object.assign({},this))}edit(){return this.tree.edit(this)}}const oe="__REACT_ARBORIST_INTERNAL_ROOT__";function ut(t){var e;function r(o,a,s){const u=t.accessId(o),c=new ye({tree:t,data:o,level:a,parent:s,id:u,children:null,isDraggable:t.isDraggable(o),rowIndex:null}),d=t.accessChildren(o);return d&&(c.children=d.map(p=>r(p,a+1,c))),c}const n=new ye({tree:t,id:oe,data:{id:oe},level:-1,parent:null,children:null,isDraggable:!0,rowIndex:null}),i=(e=t.props.data)!==null&&e!==void 0?e:[];return n.children=i.map(o=>r(o,0,n)),n}const Ue={open(t,e){return{type:"VISIBILITY_OPEN",id:t,filtered:e}},close(t,e){return{type:"VISIBILITY_CLOSE",id:t,filtered:e}},toggle(t,e){return{type:"VISIBILITY_TOGGLE",id:t,filtered:e}},clear(t){return{type:"VISIBILITY_CLEAR",filtered:t}}};function lt(t={},e){if(e.type==="VISIBILITY_OPEN")return Object.assign(Object.assign({},t),{[e.id]:!0});if(e.type==="VISIBILITY_CLOSE")return Object.assign(Object.assign({},t),{[e.id]:!1});if(e.type==="VISIBILITY_TOGGLE"){const r=t[e.id];return Object.assign(Object.assign({},t),{[e.id]:!r})}else return e.type==="VISIBILITY_CLEAR"?{}:t}function Pn(t={filtered:{},unfiltered:{}},e){return e.type.startsWith("VISIBILITY")?e.filtered?Object.assign(Object.assign({},t),{filtered:lt(t.filtered,e)}):Object.assign(Object.assign({},t),{unfiltered:lt(t.unfiltered,e)}):t}const J=t=>{var e;return{nodes:{open:{filtered:{},unfiltered:(e=t==null?void 0:t.initialOpenState)!==null&&e!==void 0?e:{}},focus:{id:null,treeFocused:!1},edit:{id:null},drag:{id:null,selectedIds:[],destinationParentId:null,destinationIndex:null},selection:{ids:new Set,anchor:null,mostRecent:null}},dnd:{cursor:{type:"none"},dragId:null,dragIds:[],parentId:null,index:-1}}},L={clear:()=>({type:"SELECTION_CLEAR"}),only:t=>({type:"SELECTION_ONLY",id:z(t)}),add:t=>({type:"SELECTION_ADD",ids:(Array.isArray(t)?t:[t]).map(z)}),remove:t=>({type:"SELECTION_REMOVE",ids:(Array.isArray(t)?t:[t]).map(z)}),set:t=>Object.assign({type:"SELECTION_SET"},t),mostRecent:t=>({type:"SELECTION_MOST_RECENT",id:t===null?null:z(t)}),anchor:t=>({type:"SELECTION_ANCHOR",id:t===null?null:z(t)})};function Rn(t=J().nodes.selection,e){const r=t.ids;switch(e.type){case"SELECTION_CLEAR":return Object.assign(Object.assign({},t),{ids:new Set});case"SELECTION_ONLY":return Object.assign(Object.assign({},t),{ids:new Set([e.id])});case"SELECTION_ADD":return e.ids.length===0?t:(e.ids.forEach(n=>r.add(n)),Object.assign(Object.assign({},t),{ids:new Set(r)}));case"SELECTION_REMOVE":return e.ids.length===0?t:(e.ids.forEach(n=>r.delete(n)),Object.assign(Object.assign({},t),{ids:new Set(r)}));case"SELECTION_SET":return Object.assign(Object.assign({},t),{ids:e.ids,mostRecent:e.mostRecent,anchor:e.anchor});case"SELECTION_MOST_RECENT":return Object.assign(Object.assign({},t),{mostRecent:e.id});case"SELECTION_ANCHOR":return Object.assign(Object.assign({},t),{anchor:e.id});default:return t}}const Z={cursor(t){return{type:"DND_CURSOR",cursor:t}},dragStart(t,e){return{type:"DND_DRAG_START",id:t,dragIds:e}},dragEnd(){return{type:"DND_DRAG_END"}},hovering(t,e){return{type:"DND_HOVERING",parentId:t,index:e}}};function kn(t=J().dnd,e){switch(e.type){case"DND_CURSOR":return Object.assign(Object.assign({},t),{cursor:e.cursor});case"DND_DRAG_START":return Object.assign(Object.assign({},t),{dragId:e.id,dragIds:e.dragIds});case"DND_DRAG_END":return J().dnd;case"DND_HOVERING":return Object.assign(Object.assign({},t),{parentId:e.parentId,index:e.index});default:return t}}const An={position:"fixed",pointerEvents:"none",zIndex:100,left:0,top:0,width:"100%",height:"100%"},Mn=t=>{if(!t)return{display:"none"};const{x:e,y:r}=t;return{transform:`translate(${e}px, ${r}px)`}},jn=t=>{if(!t)return{display:"none"};const{x:e,y:r}=t;return{transform:`translate(${e+10}px, ${r+10}px)`}};function Ir({offset:t,mouse:e,id:r,dragIds:n,isDragging:i}){return y.jsxs(Ln,{isDragging:i,children:[y.jsx($n,{offset:t,children:y.jsx(Hn,{id:r,dragIds:n})}),y.jsx(Fn,{mouse:e,count:n.length})]})}const Ln=h.memo(function(e){return e.isDragging?y.jsx("div",{style:An,children:e.children}):null});function $n(t){return y.jsx("div",{className:"row preview",style:Mn(t.offset),children:t.children})}function Fn(t){const{count:e,mouse:r}=t;return e>1?y.jsx("div",{className:"selected-count",style:jn(r),children:e}):null}const Hn=h.memo(function(e){const r=k(),n=r.get(e.id);return n?y.jsx(r.renderNode,{preview:!0,node:n,style:{paddingLeft:n.level*r.indent,opacity:.2,background:"transparent"},tree:r}):null});function ze(){return ze=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)({}).hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},ze.apply(null,arguments)}function ct(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Be(t,e){return Be=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},Be(t,e)}function Un(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,Be(t,e)}var dt=Number.isNaN||function(e){return typeof e=="number"&&e!==e};function zn(t,e){return!!(t===e||dt(t)&&dt(e))}function Bn(t,e){if(t.length!==e.length)return!1;for(var r=0;r<t.length;r++)if(!zn(t[r],e[r]))return!1;return!0}function Ee(t,e){e===void 0&&(e=Bn);var r,n=[],i,o=!1;function a(){for(var s=[],u=0;u<arguments.length;u++)s[u]=arguments[u];return o&&r===this&&e(s,n)||(i=t.apply(this,s),o=!0,r=this,n=s),i}return a}var Wn=typeof performance=="object"&&typeof performance.now=="function",ft=Wn?function(){return performance.now()}:function(){return Date.now()};function ht(t){cancelAnimationFrame(t.id)}function qn(t,e){var r=ft();function n(){ft()-r>=e?t.call(null):i.id=requestAnimationFrame(n)}var i={id:requestAnimationFrame(n)};return i}var _e=-1;function gt(t){if(t===void 0&&(t=!1),_e===-1||t){var e=document.createElement("div"),r=e.style;r.width="50px",r.height="50px",r.overflow="scroll",document.body.appendChild(e),_e=e.offsetWidth-e.clientWidth,document.body.removeChild(e)}return _e}var G=null;function pt(t){if(t===void 0&&(t=!1),G===null||t){var e=document.createElement("div"),r=e.style;r.width="50px",r.height="50px",r.overflow="scroll",r.direction="rtl";var n=document.createElement("div"),i=n.style;return i.width="100px",i.height="100px",e.appendChild(n),document.body.appendChild(e),e.scrollLeft>0?G="positive-descending":(e.scrollLeft=1,e.scrollLeft===0?G="negative":G="positive-ascending"),document.body.removeChild(e),G}return G}var Vn=150,Gn=function(e,r){return e};function Kn(t){var e,r=t.getItemOffset,n=t.getEstimatedTotalSize,i=t.getItemSize,o=t.getOffsetForIndexAndAlignment,a=t.getStartIndexForOffset,s=t.getStopIndexForStartIndex,u=t.initInstanceProps,c=t.shouldResetStyleCacheOnItemSizeChange,d=t.validateProps;return e=(function(p){Un(O,p);function O(I){var l;return l=p.call(this,I)||this,l._instanceProps=u(l.props,ct(l)),l._outerRef=void 0,l._resetIsScrollingTimeoutId=null,l.state={instance:ct(l),isScrolling:!1,scrollDirection:"forward",scrollOffset:typeof l.props.initialScrollOffset=="number"?l.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},l._callOnItemsRendered=void 0,l._callOnItemsRendered=Ee(function(f,g,v,S){return l.props.onItemsRendered({overscanStartIndex:f,overscanStopIndex:g,visibleStartIndex:v,visibleStopIndex:S})}),l._callOnScroll=void 0,l._callOnScroll=Ee(function(f,g,v){return l.props.onScroll({scrollDirection:f,scrollOffset:g,scrollUpdateWasRequested:v})}),l._getItemStyle=void 0,l._getItemStyle=function(f){var g=l.props,v=g.direction,S=g.itemSize,w=g.layout,T=l._getItemStyleCache(c&&S,c&&w,c&&v),E;if(T.hasOwnProperty(f))E=T[f];else{var b=r(l.props,f,l._instanceProps),_=i(l.props,f,l._instanceProps),x=v==="horizontal"||w==="horizontal",q=v==="rtl",U=x?b:0;T[f]=E={position:"absolute",left:q?void 0:U,right:q?U:void 0,top:x?0:b,height:x?"100%":_,width:x?_:"100%"}}return E},l._getItemStyleCache=void 0,l._getItemStyleCache=Ee(function(f,g,v){return{}}),l._onScrollHorizontal=function(f){var g=f.currentTarget,v=g.clientWidth,S=g.scrollLeft,w=g.scrollWidth;l.setState(function(T){if(T.scrollOffset===S)return null;var E=l.props.direction,b=S;if(E==="rtl")switch(pt()){case"negative":b=-S;break;case"positive-descending":b=w-v-S;break}return b=Math.max(0,Math.min(b,w-v)),{isScrolling:!0,scrollDirection:T.scrollOffset<b?"forward":"backward",scrollOffset:b,scrollUpdateWasRequested:!1}},l._resetIsScrollingDebounced)},l._onScrollVertical=function(f){var g=f.currentTarget,v=g.clientHeight,S=g.scrollHeight,w=g.scrollTop;l.setState(function(T){if(T.scrollOffset===w)return null;var E=Math.max(0,Math.min(w,S-v));return{isScrolling:!0,scrollDirection:T.scrollOffset<E?"forward":"backward",scrollOffset:E,scrollUpdateWasRequested:!1}},l._resetIsScrollingDebounced)},l._outerRefSetter=function(f){var g=l.props.outerRef;l._outerRef=f,typeof g=="function"?g(f):g!=null&&typeof g=="object"&&g.hasOwnProperty("current")&&(g.current=f)},l._resetIsScrollingDebounced=function(){l._resetIsScrollingTimeoutId!==null&&ht(l._resetIsScrollingTimeoutId),l._resetIsScrollingTimeoutId=qn(l._resetIsScrolling,Vn)},l._resetIsScrolling=function(){l._resetIsScrollingTimeoutId=null,l.setState({isScrolling:!1},function(){l._getItemStyleCache(-1,null)})},l}O.getDerivedStateFromProps=function(l,f){return Yn(l,f),d(l),null};var m=O.prototype;return m.scrollTo=function(l){l=Math.max(0,l),this.setState(function(f){return f.scrollOffset===l?null:{scrollDirection:f.scrollOffset<l?"forward":"backward",scrollOffset:l,scrollUpdateWasRequested:!0}},this._resetIsScrollingDebounced)},m.scrollToItem=function(l,f){f===void 0&&(f="auto");var g=this.props,v=g.itemCount,S=g.layout,w=this.state.scrollOffset;l=Math.max(0,Math.min(l,v-1));var T=0;if(this._outerRef){var E=this._outerRef;S==="vertical"?T=E.scrollWidth>E.clientWidth?gt():0:T=E.scrollHeight>E.clientHeight?gt():0}this.scrollTo(o(this.props,l,f,w,this._instanceProps,T))},m.componentDidMount=function(){var l=this.props,f=l.direction,g=l.initialScrollOffset,v=l.layout;if(typeof g=="number"&&this._outerRef!=null){var S=this._outerRef;f==="horizontal"||v==="horizontal"?S.scrollLeft=g:S.scrollTop=g}this._callPropsCallbacks()},m.componentDidUpdate=function(){var l=this.props,f=l.direction,g=l.layout,v=this.state,S=v.scrollOffset,w=v.scrollUpdateWasRequested;if(w&&this._outerRef!=null){var T=this._outerRef;if(f==="horizontal"||g==="horizontal")if(f==="rtl")switch(pt()){case"negative":T.scrollLeft=-S;break;case"positive-ascending":T.scrollLeft=S;break;default:var E=T.clientWidth,b=T.scrollWidth;T.scrollLeft=b-E-S;break}else T.scrollLeft=S;else T.scrollTop=S}this._callPropsCallbacks()},m.componentWillUnmount=function(){this._resetIsScrollingTimeoutId!==null&&ht(this._resetIsScrollingTimeoutId)},m.render=function(){var l=this.props,f=l.children,g=l.className,v=l.direction,S=l.height,w=l.innerRef,T=l.innerElementType,E=l.innerTagName,b=l.itemCount,_=l.itemData,x=l.itemKey,q=x===void 0?Gn:x,U=l.layout,Xr=l.outerElementType,Qr=l.outerTagName,Jr=l.style,Zr=l.useIsScrolling,en=l.width,it=this.state.isScrolling,we=v==="horizontal"||U==="horizontal",tn=we?this._onScrollHorizontal:this._onScrollVertical,ot=this._getRangeToRender(),rn=ot[0],nn=ot[1],at=[];if(b>0)for(var ee=rn;ee<=nn;ee++)at.push(h.createElement(f,{data:_,key:q(ee,_),index:ee,isScrolling:Zr?it:void 0,style:this._getItemStyle(ee)}));var st=n(this.props,this._instanceProps);return h.createElement(Xr||Qr||"div",{className:g,onScroll:tn,ref:this._outerRefSetter,style:ze({position:"relative",height:S,width:en,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:v},Jr)},h.createElement(T||E||"div",{children:at,ref:w,style:{height:we?"100%":st,pointerEvents:it?"none":void 0,width:we?st:"100%"}}))},m._callPropsCallbacks=function(){if(typeof this.props.onItemsRendered=="function"){var l=this.props.itemCount;if(l>0){var f=this._getRangeToRender(),g=f[0],v=f[1],S=f[2],w=f[3];this._callOnItemsRendered(g,v,S,w)}}if(typeof this.props.onScroll=="function"){var T=this.state,E=T.scrollDirection,b=T.scrollOffset,_=T.scrollUpdateWasRequested;this._callOnScroll(E,b,_)}},m._getRangeToRender=function(){var l=this.props,f=l.itemCount,g=l.overscanCount,v=this.state,S=v.isScrolling,w=v.scrollDirection,T=v.scrollOffset;if(f===0)return[0,0,0,0];var E=a(this.props,T,this._instanceProps),b=s(this.props,E,T,this._instanceProps),_=!S||w==="backward"?Math.max(1,g):1,x=!S||w==="forward"?Math.max(1,g):1;return[Math.max(0,E-_),Math.max(0,Math.min(f-1,b+x)),E,b]},O})(h.PureComponent),e.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},e}var Yn=function(e,r){e.children,e.direction,e.height,e.layout,e.innerTagName,e.outerTagName,e.width,r.instance},Xn=Kn({getItemOffset:function(e,r){var n=e.itemSize;return r*n},getItemSize:function(e,r){var n=e.itemSize;return n},getEstimatedTotalSize:function(e){var r=e.itemCount,n=e.itemSize;return n*r},getOffsetForIndexAndAlignment:function(e,r,n,i,o,a){var s=e.direction,u=e.height,c=e.itemCount,d=e.itemSize,p=e.layout,O=e.width,m=s==="horizontal"||p==="horizontal",I=m?O:u,l=Math.max(0,c*d-I),f=Math.min(l,r*d),g=Math.max(0,r*d-I+d+a);switch(n==="smart"&&(i>=g-I&&i<=f+I?n="auto":n="center"),n){case"start":return f;case"end":return g;case"center":{var v=Math.round(g+(f-g)/2);return v<Math.ceil(I/2)?0:v>l+Math.floor(I/2)?l:v}case"auto":default:return i>=g&&i<=f?i:i<g?g:f}},getStartIndexForOffset:function(e,r){var n=e.itemCount,i=e.itemSize;return Math.max(0,Math.min(n-1,Math.floor(r/i)))},getStopIndexForStartIndex:function(e,r,n){var i=e.direction,o=e.height,a=e.itemCount,s=e.itemSize,u=e.layout,c=e.width,d=i==="horizontal"||u==="horizontal",p=r*s,O=d?c:o,m=Math.ceil((O+n-p)/s);return Math.max(0,Math.min(a-1,r+m-1))},initInstanceProps:function(e){},shouldResetStyleCacheOnItemSizeChange:!0,validateProps:function(e){e.itemSize}});function Qn(){var t,e;const r=k(),i=vn().cursor;if(!i||i.type!=="line")return null;const o=r.indent,a=r.rowHeight*i.index+((e=(t=r.props.padding)!==null&&t!==void 0?t:r.props.paddingTop)!==null&&e!==void 0?e:0),s=o*i.level,u=r.renderCursor;return y.jsx(u,{top:a,left:s,indent:o})}var Jn=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r};const Zn=h.forwardRef(function(e,r){const{children:n}=e,i=Jn(e,["children"]),o=k();return y.jsxs("div",Object.assign({ref:r},i,{onClick:a=>{a.currentTarget===a.target&&o.deselectAll()},children:[y.jsx(ei,{}),n]}))}),ei=()=>{const t=k();return y.jsx("div",{style:{height:t.visibleNodes.length*t.rowHeight,width:"100%",position:"absolute",left:"0",right:"0"},children:y.jsx(Qn,{})})};var ti=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r};const ri=h.forwardRef(function(e,r){var n,i,o,a,{style:s}=e,u=ti(e,["style"]);const c=k(),d=(i=(n=c.props.padding)!==null&&n!==void 0?n:c.props.paddingTop)!==null&&i!==void 0?i:0,p=(a=(o=c.props.padding)!==null&&o!==void 0?o:c.props.paddingBottom)!==null&&a!==void 0?a:0;return y.jsx("div",Object.assign({ref:r,style:Object.assign(Object.assign({},s),{height:`${parseFloat(s.height)+d+p}px`})},u))});var Dr=h.createContext({dragDropManager:void 0}),j;(function(t){t.SOURCE="SOURCE",t.TARGET="TARGET"})(j||(j={}));function D(t,e){for(var r=arguments.length,n=new Array(r>2?r-2:0),i=2;i<r;i++)n[i-2]=arguments[i];if(!t){var o;if(e===void 0)o=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var a=0;o=new Error(e.replace(/%s/g,function(){return n[a++]})),o.name="Invariant Violation"}throw o.framesToPop=1,o}}var Qe="dnd-core/INIT_COORDS",Oe="dnd-core/BEGIN_DRAG",Je="dnd-core/PUBLISH_DRAG_SOURCE",Se="dnd-core/HOVER",Ie="dnd-core/DROP",De="dnd-core/END_DRAG";function vt(t,e){return{type:Qe,payload:{sourceClientOffset:e||null,clientOffset:t||null}}}function de(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?de=function(r){return typeof r}:de=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},de(t)}function ni(t,e,r){return e.split(".").reduce(function(n,i){return n&&n[i]?n[i]:r||null},t)}function ii(t,e){return t.filter(function(r){return r!==e})}function Tr(t){return de(t)==="object"}function oi(t,e){var r=new Map,n=function(a){r.set(a,r.has(a)?r.get(a)+1:1)};t.forEach(n),e.forEach(n);var i=[];return r.forEach(function(o,a){o===1&&i.push(a)}),i}function ai(t,e){return t.filter(function(r){return e.indexOf(r)>-1})}var si={type:Qe,payload:{clientOffset:null,sourceClientOffset:null}};function ui(t){return function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{publishSource:!0},i=n.publishSource,o=i===void 0?!0:i,a=n.clientOffset,s=n.getSourceClientOffset,u=t.getMonitor(),c=t.getRegistry();t.dispatch(vt(a)),li(r,u,c);var d=fi(r,u);if(d===null){t.dispatch(si);return}var p=null;if(a){if(!s)throw new Error("getSourceClientOffset must be defined");ci(s),p=s(d)}t.dispatch(vt(a,p));var O=c.getSource(d),m=O.beginDrag(u,d);if(m!=null){di(m),c.pinSource(d);var I=c.getSourceType(d);return{type:Oe,payload:{itemType:I,item:m,sourceId:d,clientOffset:a||null,sourceClientOffset:p||null,isSourcePublic:!!o}}}}}function li(t,e,r){D(!e.isDragging(),"Cannot call beginDrag while dragging."),t.forEach(function(n){D(r.getSource(n),"Expected sourceIds to be registered.")})}function ci(t){D(typeof t=="function","When clientOffset is provided, getSourceClientOffset must be a function.")}function di(t){D(Tr(t),"Item must be an object.")}function fi(t,e){for(var r=null,n=t.length-1;n>=0;n--)if(e.canDragSource(t[n])){r=t[n];break}return r}function hi(t){return function(){var r=t.getMonitor();if(r.isDragging())return{type:Je}}}function We(t,e){return e===null?t===null:Array.isArray(t)?t.some(function(r){return r===e}):t===e}function gi(t){return function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=n.clientOffset;pi(r);var o=r.slice(0),a=t.getMonitor(),s=t.getRegistry();vi(o,a,s);var u=a.getItemType();return yi(o,s,u),mi(o,a,s),{type:Se,payload:{targetIds:o,clientOffset:i||null}}}}function pi(t){D(Array.isArray(t),"Expected targetIds to be an array.")}function vi(t,e,r){D(e.isDragging(),"Cannot call hover while not dragging."),D(!e.didDrop(),"Cannot call hover after drop.");for(var n=0;n<t.length;n++){var i=t[n];D(t.lastIndexOf(i)===n,"Expected targetIds to be unique in the passed array.");var o=r.getTarget(i);D(o,"Expected targetIds to be registered.")}}function yi(t,e,r){for(var n=t.length-1;n>=0;n--){var i=t[n],o=e.getTargetType(i);We(o,r)||t.splice(n,1)}}function mi(t,e,r){t.forEach(function(n){var i=r.getTarget(n);i.hover(e,n)})}function yt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function mt(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?yt(Object(r),!0).forEach(function(n){bi(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):yt(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function bi(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Oi(t){return function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=t.getMonitor(),i=t.getRegistry();Si(n);var o=Ti(n);o.forEach(function(a,s){var u=Ii(a,s,i,n),c={type:Ie,payload:{dropResult:mt(mt({},r),u)}};t.dispatch(c)})}}function Si(t){D(t.isDragging(),"Cannot call drop while not dragging."),D(!t.didDrop(),"Cannot call drop twice during one drag operation.")}function Ii(t,e,r,n){var i=r.getTarget(t),o=i?i.drop(n,t):void 0;return Di(o),typeof o>"u"&&(o=e===0?{}:n.getDropResult()),o}function Di(t){D(typeof t>"u"||Tr(t),"Drop result must either be an object or undefined.")}function Ti(t){var e=t.getTargetIds().filter(t.canDropOnTarget,t);return e.reverse(),e}function wi(t){return function(){var r=t.getMonitor(),n=t.getRegistry();Ci(r);var i=r.getSourceId();if(i!=null){var o=n.getSource(i,!0);o.endDrag(r,i),n.unpinSource()}return{type:De}}}function Ci(t){D(t.isDragging(),"Cannot call endDrag while not dragging.")}function Ei(t){return{beginDrag:ui(t),publishDragSource:hi(t),hover:gi(t),drop:Oi(t),endDrag:wi(t)}}function _i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function xi(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Ni(t,e,r){return e&&xi(t.prototype,e),t}function te(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Pi=(function(){function t(e,r){var n=this;_i(this,t),te(this,"store",void 0),te(this,"monitor",void 0),te(this,"backend",void 0),te(this,"isSetUp",!1),te(this,"handleRefCountChange",function(){var i=n.store.getState().refCount>0;n.backend&&(i&&!n.isSetUp?(n.backend.setup(),n.isSetUp=!0):!i&&n.isSetUp&&(n.backend.teardown(),n.isSetUp=!1))}),this.store=e,this.monitor=r,e.subscribe(this.handleRefCountChange)}return Ni(t,[{key:"receiveBackend",value:function(r){this.backend=r}},{key:"getMonitor",value:function(){return this.monitor}},{key:"getBackend",value:function(){return this.backend}},{key:"getRegistry",value:function(){return this.monitor.registry}},{key:"getActions",value:function(){var r=this,n=this.store.dispatch;function i(a){return function(){for(var s=arguments.length,u=new Array(s),c=0;c<s;c++)u[c]=arguments[c];var d=a.apply(r,u);typeof d<"u"&&n(d)}}var o=Ei(this);return Object.keys(o).reduce(function(a,s){var u=o[s];return a[s]=i(u),a},{})}},{key:"dispatch",value:function(r){this.store.dispatch(r)}}]),t})();function A(t){return"Minified Redux error #"+t+"; visit https://redux.js.org/Errors?code="+t+" for the full message or use the non-minified dev environment for full errors. "}var bt=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})(),Ot=function(){return Math.random().toString(36).substring(7).split("").join(".")},St={INIT:"@@redux/INIT"+Ot(),REPLACE:"@@redux/REPLACE"+Ot()};function Ri(t){if(typeof t!="object"||t===null)return!1;for(var e=t;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function wr(t,e,r){var n;if(typeof e=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(A(0));if(typeof e=="function"&&typeof r>"u"&&(r=e,e=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(A(1));return r(wr)(t,e)}if(typeof t!="function")throw new Error(A(2));var i=t,o=e,a=[],s=a,u=!1;function c(){s===a&&(s=a.slice())}function d(){if(u)throw new Error(A(3));return o}function p(l){if(typeof l!="function")throw new Error(A(4));if(u)throw new Error(A(5));var f=!0;return c(),s.push(l),function(){if(f){if(u)throw new Error(A(6));f=!1,c();var v=s.indexOf(l);s.splice(v,1),a=null}}}function O(l){if(!Ri(l))throw new Error(A(7));if(typeof l.type>"u")throw new Error(A(8));if(u)throw new Error(A(9));try{u=!0,o=i(o,l)}finally{u=!1}for(var f=a=s,g=0;g<f.length;g++){var v=f[g];v()}return l}function m(l){if(typeof l!="function")throw new Error(A(10));i=l,O({type:St.REPLACE})}function I(){var l,f=p;return l={subscribe:function(v){if(typeof v!="object"||v===null)throw new Error(A(11));function S(){v.next&&v.next(d())}S();var w=f(S);return{unsubscribe:w}}},l[bt]=function(){return this},l}return O({type:St.INIT}),n={dispatch:O,subscribe:p,getState:d,replaceReducer:m},n[bt]=I,n}var ki=function(e,r){return e===r};function Ai(t,e){return!t&&!e?!0:!t||!e?!1:t.x===e.x&&t.y===e.y}function Mi(t,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ki;if(t.length!==e.length)return!1;for(var n=0;n<t.length;++n)if(!r(t[n],e[n]))return!1;return!0}function It(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Dt(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?It(Object(r),!0).forEach(function(n){ji(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):It(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function ji(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Tt={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};function Li(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Tt,e=arguments.length>1?arguments[1]:void 0,r=e.payload;switch(e.type){case Qe:case Oe:return{initialSourceClientOffset:r.sourceClientOffset,initialClientOffset:r.clientOffset,clientOffset:r.clientOffset};case Se:return Ai(t.clientOffset,r.clientOffset)?t:Dt(Dt({},t),{},{clientOffset:r.clientOffset});case De:case Ie:return Tt;default:return t}}var Ze="dnd-core/ADD_SOURCE",et="dnd-core/ADD_TARGET",tt="dnd-core/REMOVE_SOURCE",Te="dnd-core/REMOVE_TARGET";function $i(t){return{type:Ze,payload:{sourceId:t}}}function Fi(t){return{type:et,payload:{targetId:t}}}function Hi(t){return{type:tt,payload:{sourceId:t}}}function Ui(t){return{type:Te,payload:{targetId:t}}}function wt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function M(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?wt(Object(r),!0).forEach(function(n){zi(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):wt(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function zi(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Bi={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};function Wi(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Bi,e=arguments.length>1?arguments[1]:void 0,r=e.payload;switch(e.type){case Oe:return M(M({},t),{},{itemType:r.itemType,item:r.item,sourceId:r.sourceId,isSourcePublic:r.isSourcePublic,dropResult:null,didDrop:!1});case Je:return M(M({},t),{},{isSourcePublic:!0});case Se:return M(M({},t),{},{targetIds:r.targetIds});case Te:return t.targetIds.indexOf(r.targetId)===-1?t:M(M({},t),{},{targetIds:ii(t.targetIds,r.targetId)});case Ie:return M(M({},t),{},{dropResult:r.dropResult,didDrop:!0,targetIds:[]});case De:return M(M({},t),{},{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return t}}function qi(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,e=arguments.length>1?arguments[1]:void 0;switch(e.type){case Ze:case et:return t+1;case tt:case Te:return t-1;default:return t}}var me=[],rt=[];me.__IS_NONE__=!0;rt.__IS_ALL__=!0;function Vi(t,e){if(t===me)return!1;if(t===rt||typeof e>"u")return!0;var r=ai(e,t);return r.length>0}function Gi(){var t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Se:break;case Ze:case et:case Te:case tt:return me;case Oe:case Je:case De:case Ie:default:return rt}var e=t.payload,r=e.targetIds,n=r===void 0?[]:r,i=e.prevTargetIds,o=i===void 0?[]:i,a=oi(n,o),s=a.length>0||!Mi(n,o);if(!s)return me;var u=o[o.length-1],c=n[n.length-1];return u!==c&&(u&&a.push(u),c&&a.push(c)),a}function Ki(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return t+1}function Ct(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Et(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Ct(Object(r),!0).forEach(function(n){Yi(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Ct(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Yi(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Xi(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0;return{dirtyHandlerIds:Gi(t.dirtyHandlerIds,{type:e.type,payload:Et(Et({},e.payload),{},{prevTargetIds:ni(t,"dragOperation.targetIds",[])})}),dragOffset:Li(t.dragOffset,e),refCount:qi(t.refCount,e),dragOperation:Wi(t.dragOperation,e),stateId:Ki(t.stateId)}}function Qi(t,e){return{x:t.x+e.x,y:t.y+e.y}}function Cr(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Ji(t){var e=t.clientOffset,r=t.initialClientOffset,n=t.initialSourceClientOffset;return!e||!r||!n?null:Cr(Qi(e,n),r)}function Zi(t){var e=t.clientOffset,r=t.initialClientOffset;return!e||!r?null:Cr(e,r)}function eo(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function to(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function ro(t,e,r){return e&&to(t.prototype,e),t}function _t(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var no=(function(){function t(e,r){eo(this,t),_t(this,"store",void 0),_t(this,"registry",void 0),this.store=e,this.registry=r}return ro(t,[{key:"subscribeToStateChange",value:function(r){var n=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{handlerIds:void 0},o=i.handlerIds;D(typeof r=="function","listener must be a function."),D(typeof o>"u"||Array.isArray(o),"handlerIds, when specified, must be an array of strings.");var a=this.store.getState().stateId,s=function(){var c=n.store.getState(),d=c.stateId;try{var p=d===a||d===a+1&&!Vi(c.dirtyHandlerIds,o);p||r()}finally{a=d}};return this.store.subscribe(s)}},{key:"subscribeToOffsetChange",value:function(r){var n=this;D(typeof r=="function","listener must be a function.");var i=this.store.getState().dragOffset,o=function(){var s=n.store.getState().dragOffset;s!==i&&(i=s,r())};return this.store.subscribe(o)}},{key:"canDragSource",value:function(r){if(!r)return!1;var n=this.registry.getSource(r);return D(n,"Expected to find a valid source. sourceId=".concat(r)),this.isDragging()?!1:n.canDrag(this,r)}},{key:"canDropOnTarget",value:function(r){if(!r)return!1;var n=this.registry.getTarget(r);if(D(n,"Expected to find a valid target. targetId=".concat(r)),!this.isDragging()||this.didDrop())return!1;var i=this.registry.getTargetType(r),o=this.getItemType();return We(i,o)&&n.canDrop(this,r)}},{key:"isDragging",value:function(){return!!this.getItemType()}},{key:"isDraggingSource",value:function(r){if(!r)return!1;var n=this.registry.getSource(r,!0);if(D(n,"Expected to find a valid source. sourceId=".concat(r)),!this.isDragging()||!this.isSourcePublic())return!1;var i=this.registry.getSourceType(r),o=this.getItemType();return i!==o?!1:n.isDragging(this,r)}},{key:"isOverTarget",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{shallow:!1};if(!r)return!1;var i=n.shallow;if(!this.isDragging())return!1;var o=this.registry.getTargetType(r),a=this.getItemType();if(a&&!We(o,a))return!1;var s=this.getTargetIds();if(!s.length)return!1;var u=s.indexOf(r);return i?u===s.length-1:u>-1}},{key:"getItemType",value:function(){return this.store.getState().dragOperation.itemType}},{key:"getItem",value:function(){return this.store.getState().dragOperation.item}},{key:"getSourceId",value:function(){return this.store.getState().dragOperation.sourceId}},{key:"getTargetIds",value:function(){return this.store.getState().dragOperation.targetIds}},{key:"getDropResult",value:function(){return this.store.getState().dragOperation.dropResult}},{key:"didDrop",value:function(){return this.store.getState().dragOperation.didDrop}},{key:"isSourcePublic",value:function(){return!!this.store.getState().dragOperation.isSourcePublic}},{key:"getInitialClientOffset",value:function(){return this.store.getState().dragOffset.initialClientOffset}},{key:"getInitialSourceClientOffset",value:function(){return this.store.getState().dragOffset.initialSourceClientOffset}},{key:"getClientOffset",value:function(){return this.store.getState().dragOffset.clientOffset}},{key:"getSourceClientOffset",value:function(){return Ji(this.store.getState().dragOffset)}},{key:"getDifferenceFromInitialOffset",value:function(){return Zi(this.store.getState().dragOffset)}}]),t})(),io=0;function oo(){return io++}function fe(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?fe=function(r){return typeof r}:fe=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},fe(t)}function ao(t){D(typeof t.canDrag=="function","Expected canDrag to be a function."),D(typeof t.beginDrag=="function","Expected beginDrag to be a function."),D(typeof t.endDrag=="function","Expected endDrag to be a function.")}function so(t){D(typeof t.canDrop=="function","Expected canDrop to be a function."),D(typeof t.hover=="function","Expected hover to be a function."),D(typeof t.drop=="function","Expected beginDrag to be a function.")}function qe(t,e){if(e&&Array.isArray(t)){t.forEach(function(r){return qe(r,!1)});return}D(typeof t=="string"||fe(t)==="symbol",e?"Type can only be a string, a symbol, or an array of either.":"Type can only be a string or a symbol.")}const xt=typeof global<"u"?global:self,Er=xt.MutationObserver||xt.WebKitMutationObserver;function _r(t){return function(){const r=setTimeout(i,0),n=setInterval(i,50);function i(){clearTimeout(r),clearInterval(n),t()}}}function uo(t){let e=1;const r=new Er(t),n=document.createTextNode("");return r.observe(n,{characterData:!0}),function(){e=-e,n.data=e}}const lo=typeof Er=="function"?uo:_r;class co{enqueueTask(e){const{queue:r,requestFlush:n}=this;r.length||(n(),this.flushing=!0),r[r.length]=e}constructor(){this.queue=[],this.pendingErrors=[],this.flushing=!1,this.index=0,this.capacity=1024,this.flush=()=>{const{queue:e}=this;for(;this.index<e.length;){const r=this.index;if(this.index++,e[r].call(),this.index>this.capacity){for(let n=0,i=e.length-this.index;n<i;n++)e[n]=e[n+this.index];e.length-=this.index,this.index=0}}e.length=0,this.index=0,this.flushing=!1},this.registerPendingError=e=>{this.pendingErrors.push(e),this.requestErrorThrow()},this.requestFlush=lo(this.flush),this.requestErrorThrow=_r(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}}class fo{call(){try{this.task&&this.task()}catch(e){this.onError(e)}finally{this.task=null,this.release(this)}}constructor(e,r){this.onError=e,this.release=r,this.task=null}}class ho{create(e){const r=this.freeTasks,n=r.length?r.pop():new fo(this.onError,i=>r[r.length]=i);return n.task=e,n}constructor(e){this.onError=e,this.freeTasks=[]}}const xr=new co,go=new ho(xr.registerPendingError);function po(t){xr.enqueueTask(go.create(t))}function vo(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function yo(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function mo(t,e,r){return e&&yo(t.prototype,e),t}function K(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function bo(t,e){return Do(t)||Io(t,e)||So(t,e)||Oo()}function Oo(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
12
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function
|
|
13
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Po(t,e){if(t){if(typeof t=="string")return kt(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return kt(t,e)}}function kt(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Ro(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n=[],i=!0,o=!1,a,s;try{for(r=r.call(t);!(i=(a=r.next()).done)&&(n.push(a.value),!(e&&n.length===e));i=!0);}catch(u){o=!0,s=u}finally{try{!i&&r.return!=null&&r.return()}finally{if(o)throw s}}return n}}function ko(t){if(Array.isArray(t))return t}function Ao(t,e){if(t==null)return{};var r=Mo(t,e),n,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i<o.length;i++)n=o[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function Mo(t,e){if(t==null)return{};var r={},n=Object.keys(t),i,o;for(o=0;o<n.length;o++)i=n[o],!(e.indexOf(i)>=0)&&(r[i]=t[i]);return r}var At=0,he=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__"),jo=h.memo(function(e){var r=e.children,n=Ao(e,_o),i=Lo(n),o=xo(i,2),a=o[0],s=o[1];return h.useEffect(function(){if(s){var u=Nr();return++At,function(){--At===0&&(u[he]=null)}}},[]),y.jsx(Dr.Provider,Object.assign({value:a},{children:r}),void 0)});function Lo(t){if("manager"in t){var e={dragDropManager:t.manager};return[e,!1]}var r=$o(t.backend,t.context,t.options,t.debugMode),n=!t.context;return[r,n]}function $o(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Nr(),r=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0,i=e;return i[he]||(i[he]={dragDropManager:Co(t,e,r,n)}),i[he]}function Nr(){return typeof global<"u"?global:window}function Fo(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ho(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Uo(t,e,r){return e&&Ho(t.prototype,e),t}function Mt(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var xe=!1,Ne=!1,zo=(function(){function t(e){Fo(this,t),Mt(this,"internalMonitor",void 0),Mt(this,"sourceId",null),this.internalMonitor=e.getMonitor()}return Uo(t,[{key:"receiveHandlerId",value:function(r){this.sourceId=r}},{key:"getHandlerId",value:function(){return this.sourceId}},{key:"canDrag",value:function(){D(!xe,"You may not call monitor.canDrag() inside your canDrag() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return xe=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{xe=!1}}},{key:"isDragging",value:function(){if(!this.sourceId)return!1;D(!Ne,"You may not call monitor.isDragging() inside your isDragging() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return Ne=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{Ne=!1}}},{key:"subscribeToStateChange",value:function(r,n){return this.internalMonitor.subscribeToStateChange(r,n)}},{key:"isDraggingSource",value:function(r){return this.internalMonitor.isDraggingSource(r)}},{key:"isOverTarget",value:function(r,n){return this.internalMonitor.isOverTarget(r,n)}},{key:"getTargetIds",value:function(){return this.internalMonitor.getTargetIds()}},{key:"isSourcePublic",value:function(){return this.internalMonitor.isSourcePublic()}},{key:"getSourceId",value:function(){return this.internalMonitor.getSourceId()}},{key:"subscribeToOffsetChange",value:function(r){return this.internalMonitor.subscribeToOffsetChange(r)}},{key:"canDragSource",value:function(r){return this.internalMonitor.canDragSource(r)}},{key:"canDropOnTarget",value:function(r){return this.internalMonitor.canDropOnTarget(r)}},{key:"getItemType",value:function(){return this.internalMonitor.getItemType()}},{key:"getItem",value:function(){return this.internalMonitor.getItem()}},{key:"getDropResult",value:function(){return this.internalMonitor.getDropResult()}},{key:"didDrop",value:function(){return this.internalMonitor.didDrop()}},{key:"getInitialClientOffset",value:function(){return this.internalMonitor.getInitialClientOffset()}},{key:"getInitialSourceClientOffset",value:function(){return this.internalMonitor.getInitialSourceClientOffset()}},{key:"getSourceClientOffset",value:function(){return this.internalMonitor.getSourceClientOffset()}},{key:"getClientOffset",value:function(){return this.internalMonitor.getClientOffset()}},{key:"getDifferenceFromInitialOffset",value:function(){return this.internalMonitor.getDifferenceFromInitialOffset()}}]),t})();function Bo(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Wo(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function qo(t,e,r){return e&&Wo(t.prototype,e),t}function jt(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Pe=!1,Vo=(function(){function t(e){Bo(this,t),jt(this,"internalMonitor",void 0),jt(this,"targetId",null),this.internalMonitor=e.getMonitor()}return qo(t,[{key:"receiveHandlerId",value:function(r){this.targetId=r}},{key:"getHandlerId",value:function(){return this.targetId}},{key:"subscribeToStateChange",value:function(r,n){return this.internalMonitor.subscribeToStateChange(r,n)}},{key:"canDrop",value:function(){if(!this.targetId)return!1;D(!Pe,"You may not call monitor.canDrop() inside your canDrop() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target-monitor");try{return Pe=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{Pe=!1}}},{key:"isOver",value:function(r){return this.targetId?this.internalMonitor.isOverTarget(this.targetId,r):!1}},{key:"getItemType",value:function(){return this.internalMonitor.getItemType()}},{key:"getItem",value:function(){return this.internalMonitor.getItem()}},{key:"getDropResult",value:function(){return this.internalMonitor.getDropResult()}},{key:"didDrop",value:function(){return this.internalMonitor.didDrop()}},{key:"getInitialClientOffset",value:function(){return this.internalMonitor.getInitialClientOffset()}},{key:"getInitialSourceClientOffset",value:function(){return this.internalMonitor.getInitialSourceClientOffset()}},{key:"getSourceClientOffset",value:function(){return this.internalMonitor.getSourceClientOffset()}},{key:"getClientOffset",value:function(){return this.internalMonitor.getClientOffset()}},{key:"getDifferenceFromInitialOffset",value:function(){return this.internalMonitor.getDifferenceFromInitialOffset()}}]),t})();function Go(t){if(typeof t.type!="string"){var e=t.type.displayName||t.type.name||"the component";throw new Error("Only native element nodes can now be passed to React DnD connectors."+"You can either wrap ".concat(e," into a <div>, or turn it into a ")+"drag source or a drop target itself.")}}function Ko(t){return function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(!h.isValidElement(e)){var n=e;return t(n,r),n}var i=e;Go(i);var o=r?function(a){return t(a,r)}:t;return Yo(i,o)}}function Pr(t){var e={};return Object.keys(t).forEach(function(r){var n=t[r];if(r.endsWith("Ref"))e[r]=t[r];else{var i=Ko(n);e[r]=function(){return i}}}),e}function Lt(t,e){typeof t=="function"?t(e):t.current=e}function Yo(t,e){var r=t.ref;return D(typeof r!="string","Cannot connect React DnD to an element with an existing string ref. Please convert it to use a callback ref instead, or wrap it into a <span> or <div>. Read more: https://reactjs.org/docs/refs-and-the-dom.html#callback-refs"),r?h.cloneElement(t,{ref:function(i){Lt(r,i),Lt(e,i)}}):h.cloneElement(t,{ref:e})}function ge(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?ge=function(r){return typeof r}:ge=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},ge(t)}function Ve(t){return t!==null&&ge(t)==="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function Ge(t,e,r,n){var i=void 0;if(i!==void 0)return!!i;if(t===e)return!0;if(typeof t!="object"||!t||typeof e!="object"||!e)return!1;var o=Object.keys(t),a=Object.keys(e);if(o.length!==a.length)return!1;for(var s=Object.prototype.hasOwnProperty.bind(e),u=0;u<o.length;u++){var c=o[u];if(!s(c))return!1;var d=t[c],p=e[c];if(i=void 0,i===!1||i===void 0&&d!==p)return!1}return!0}function Xo(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Qo(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Jo(t,e,r){return e&&Qo(t.prototype,e),t}function P(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Zo=(function(){function t(e){var r=this;Xo(this,t),P(this,"hooks",Pr({dragSource:function(i,o){r.clearDragSource(),r.dragSourceOptions=o||null,Ve(i)?r.dragSourceRef=i:r.dragSourceNode=i,r.reconnectDragSource()},dragPreview:function(i,o){r.clearDragPreview(),r.dragPreviewOptions=o||null,Ve(i)?r.dragPreviewRef=i:r.dragPreviewNode=i,r.reconnectDragPreview()}})),P(this,"handlerId",null),P(this,"dragSourceRef",null),P(this,"dragSourceNode",void 0),P(this,"dragSourceOptionsInternal",null),P(this,"dragSourceUnsubscribe",void 0),P(this,"dragPreviewRef",null),P(this,"dragPreviewNode",void 0),P(this,"dragPreviewOptionsInternal",null),P(this,"dragPreviewUnsubscribe",void 0),P(this,"lastConnectedHandlerId",null),P(this,"lastConnectedDragSource",null),P(this,"lastConnectedDragSourceOptions",null),P(this,"lastConnectedDragPreview",null),P(this,"lastConnectedDragPreviewOptions",null),P(this,"backend",void 0),this.backend=e}return Jo(t,[{key:"receiveHandlerId",value:function(r){this.handlerId!==r&&(this.handlerId=r,this.reconnect())}},{key:"connectTarget",get:function(){return this.dragSource}},{key:"dragSourceOptions",get:function(){return this.dragSourceOptionsInternal},set:function(r){this.dragSourceOptionsInternal=r}},{key:"dragPreviewOptions",get:function(){return this.dragPreviewOptionsInternal},set:function(r){this.dragPreviewOptionsInternal=r}},{key:"reconnect",value:function(){this.reconnectDragSource(),this.reconnectDragPreview()}},{key:"reconnectDragSource",value:function(){var r=this.dragSource,n=this.didHandlerIdChange()||this.didConnectedDragSourceChange()||this.didDragSourceOptionsChange();if(n&&this.disconnectDragSource(),!!this.handlerId){if(!r){this.lastConnectedDragSource=r;return}n&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragSource=r,this.lastConnectedDragSourceOptions=this.dragSourceOptions,this.dragSourceUnsubscribe=this.backend.connectDragSource(this.handlerId,r,this.dragSourceOptions))}}},{key:"reconnectDragPreview",value:function(){var r=this.dragPreview,n=this.didHandlerIdChange()||this.didConnectedDragPreviewChange()||this.didDragPreviewOptionsChange();if(n&&this.disconnectDragPreview(),!!this.handlerId){if(!r){this.lastConnectedDragPreview=r;return}n&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragPreview=r,this.lastConnectedDragPreviewOptions=this.dragPreviewOptions,this.dragPreviewUnsubscribe=this.backend.connectDragPreview(this.handlerId,r,this.dragPreviewOptions))}}},{key:"didHandlerIdChange",value:function(){return this.lastConnectedHandlerId!==this.handlerId}},{key:"didConnectedDragSourceChange",value:function(){return this.lastConnectedDragSource!==this.dragSource}},{key:"didConnectedDragPreviewChange",value:function(){return this.lastConnectedDragPreview!==this.dragPreview}},{key:"didDragSourceOptionsChange",value:function(){return!Ge(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}},{key:"didDragPreviewOptionsChange",value:function(){return!Ge(this.lastConnectedDragPreviewOptions,this.dragPreviewOptions)}},{key:"disconnectDragSource",value:function(){this.dragSourceUnsubscribe&&(this.dragSourceUnsubscribe(),this.dragSourceUnsubscribe=void 0)}},{key:"disconnectDragPreview",value:function(){this.dragPreviewUnsubscribe&&(this.dragPreviewUnsubscribe(),this.dragPreviewUnsubscribe=void 0,this.dragPreviewNode=null,this.dragPreviewRef=null)}},{key:"dragSource",get:function(){return this.dragSourceNode||this.dragSourceRef&&this.dragSourceRef.current}},{key:"dragPreview",get:function(){return this.dragPreviewNode||this.dragPreviewRef&&this.dragPreviewRef.current}},{key:"clearDragSource",value:function(){this.dragSourceNode=null,this.dragSourceRef=null}},{key:"clearDragPreview",value:function(){this.dragPreviewNode=null,this.dragPreviewRef=null}}]),t})();function ea(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ta(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function ra(t,e,r){return e&&ta(t.prototype,e),t}function F(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var na=(function(){function t(e){var r=this;ea(this,t),F(this,"hooks",Pr({dropTarget:function(i,o){r.clearDropTarget(),r.dropTargetOptions=o,Ve(i)?r.dropTargetRef=i:r.dropTargetNode=i,r.reconnect()}})),F(this,"handlerId",null),F(this,"dropTargetRef",null),F(this,"dropTargetNode",void 0),F(this,"dropTargetOptionsInternal",null),F(this,"unsubscribeDropTarget",void 0),F(this,"lastConnectedHandlerId",null),F(this,"lastConnectedDropTarget",null),F(this,"lastConnectedDropTargetOptions",null),F(this,"backend",void 0),this.backend=e}return ra(t,[{key:"connectTarget",get:function(){return this.dropTarget}},{key:"reconnect",value:function(){var r=this.didHandlerIdChange()||this.didDropTargetChange()||this.didOptionsChange();r&&this.disconnectDropTarget();var n=this.dropTarget;if(this.handlerId){if(!n){this.lastConnectedDropTarget=n;return}r&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDropTarget=n,this.lastConnectedDropTargetOptions=this.dropTargetOptions,this.unsubscribeDropTarget=this.backend.connectDropTarget(this.handlerId,n,this.dropTargetOptions))}}},{key:"receiveHandlerId",value:function(r){r!==this.handlerId&&(this.handlerId=r,this.reconnect())}},{key:"dropTargetOptions",get:function(){return this.dropTargetOptionsInternal},set:function(r){this.dropTargetOptionsInternal=r}},{key:"didHandlerIdChange",value:function(){return this.lastConnectedHandlerId!==this.handlerId}},{key:"didDropTargetChange",value:function(){return this.lastConnectedDropTarget!==this.dropTarget}},{key:"didOptionsChange",value:function(){return!Ge(this.lastConnectedDropTargetOptions,this.dropTargetOptions)}},{key:"disconnectDropTarget",value:function(){this.unsubscribeDropTarget&&(this.unsubscribeDropTarget(),this.unsubscribeDropTarget=void 0)}},{key:"dropTarget",get:function(){return this.dropTargetNode||this.dropTargetRef&&this.dropTargetRef.current}},{key:"clearDropTarget",value:function(){this.dropTargetRef=null,this.dropTargetNode=null}}]),t})();function ia(t,e,r){var n=r.getRegistry(),i=n.addTarget(t,e);return[i,function(){return n.removeTarget(i)}]}function oa(t,e,r){var n=r.getRegistry(),i=n.addSource(t,e);return[i,function(){return n.removeSource(i)}]}var B=typeof window<"u"?h.useLayoutEffect:h.useEffect;function pe(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?pe=function(r){return typeof r}:pe=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},pe(t)}function aa(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function sa(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function ua(t,e,r){return e&&sa(t.prototype,e),t}function Re(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var la=(function(){function t(e,r,n){aa(this,t),Re(this,"spec",void 0),Re(this,"monitor",void 0),Re(this,"connector",void 0),this.spec=e,this.monitor=r,this.connector=n}return ua(t,[{key:"beginDrag",value:function(){var r,n=this.spec,i=this.monitor,o=null;return pe(n.item)==="object"?o=n.item:typeof n.item=="function"?o=n.item(i):o={},(r=o)!==null&&r!==void 0?r:null}},{key:"canDrag",value:function(){var r=this.spec,n=this.monitor;return typeof r.canDrag=="boolean"?r.canDrag:typeof r.canDrag=="function"?r.canDrag(n):!0}},{key:"isDragging",value:function(r,n){var i=this.spec,o=this.monitor,a=i.isDragging;return a?a(o):n===r.getSourceId()}},{key:"endDrag",value:function(){var r=this.spec,n=this.monitor,i=this.connector,o=r.end;o&&o(n.getItem(),n),i.reconnect()}}]),t})();function ca(t,e,r){var n=h.useMemo(function(){return new la(t,e,r)},[e,r]);return h.useEffect(function(){n.spec=t},[t]),n}function W(){var t=h.useContext(Dr),e=t.dragDropManager;return D(e!=null,"Expected drag drop context"),e}function da(t){return h.useMemo(function(){var e=t.type;return D(e!=null,"spec.type must be defined"),e},[t])}function fa(t,e){return va(t)||pa(t,e)||ga(t,e)||ha()}function ha(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
14
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function
|
|
15
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function
|
|
16
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function
|
|
17
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function
|
|
18
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function
|
|
19
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function
|
|
20
|
-
`)},dataTransfer:function(e){return e}},matchesTypes:["Url","text/uri-list"]}),se(Y,Ur,{exposeProperties:{text:function(e,r){return Ae(e,r,"")},dataTransfer:function(e){return e}},matchesTypes:["Text","text/plain"]}),Y);function Ds(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ts(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function ws(t,e,r){return e&&Ts(t.prototype,e),t}function Kt(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Cs=(function(){function t(e){Ds(this,t),Kt(this,"item",void 0),Kt(this,"config",void 0),this.config=e,this.item={},this.initializeExposedProperties()}return ws(t,[{key:"initializeExposedProperties",value:function(){var r=this;Object.keys(this.config.exposeProperties).forEach(function(n){Object.defineProperty(r.item,n,{configurable:!0,enumerable:!0,get:function(){return console.warn(`Browser doesn't allow reading "`.concat(n,'" until the drop event.')),null}})})}},{key:"loadDataTransfer",value:function(r){var n=this;if(r){var i={};Object.keys(this.config.exposeProperties).forEach(function(o){i[o]={value:n.config.exposeProperties[o](r,n.config.matchesTypes),configurable:!0,enumerable:!0}}),Object.defineProperties(this.item,i)}}},{key:"canDrag",value:function(){return!0}},{key:"beginDrag",value:function(){return this.item}},{key:"isDragging",value:function(r,n){return n===r.getSourceId()}},{key:"endDrag",value:function(){}}]),t})();function Es(t,e){var r=new Cs(Ye[t]);return r.loadDataTransfer(e),r}function Me(t){if(!t)return null;var e=Array.prototype.slice.call(t.types||[]);return Object.keys(Ye).filter(function(r){var n=Ye[r].matchesTypes;return n.some(function(i){return e.indexOf(i)>-1})})[0]||null}function _s(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function xs(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Ns(t,e,r){return e&&xs(t.prototype,e),t}function je(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Ps=(function(){function t(e,r){_s(this,t),je(this,"ownerDocument",null),je(this,"globalContext",void 0),je(this,"optionsArgs",void 0),this.globalContext=e,this.optionsArgs=r}return Ns(t,[{key:"window",get:function(){if(this.globalContext)return this.globalContext;if(typeof window<"u")return window}},{key:"document",get:function(){var r;return(r=this.globalContext)!==null&&r!==void 0&&r.document?this.globalContext.document:this.window?this.window.document:void 0}},{key:"rootElement",get:function(){var r;return((r=this.optionsArgs)===null||r===void 0?void 0:r.rootElement)||this.window}}]),t})();function Yt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Xt(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Yt(Object(r),!0).forEach(function(n){C(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Yt(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Rs(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ks(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function As(t,e,r){return e&&ks(t.prototype,e),t}function C(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Ms=(function(){function t(e,r,n){var i=this;Rs(this,t),C(this,"options",void 0),C(this,"actions",void 0),C(this,"monitor",void 0),C(this,"registry",void 0),C(this,"enterLeaveCounter",void 0),C(this,"sourcePreviewNodes",new Map),C(this,"sourcePreviewNodeOptions",new Map),C(this,"sourceNodes",new Map),C(this,"sourceNodeOptions",new Map),C(this,"dragStartSourceIds",null),C(this,"dropTargetIds",[]),C(this,"dragEnterTargetIds",[]),C(this,"currentNativeSource",null),C(this,"currentNativeHandle",null),C(this,"currentDragSourceNode",null),C(this,"altKeyPressed",!1),C(this,"mouseMoveTimeoutTimer",null),C(this,"asyncEndDragFrameId",null),C(this,"dragOverTargetIds",null),C(this,"lastClientOffset",null),C(this,"hoverRafId",null),C(this,"getSourceClientOffset",function(o){var a=i.sourceNodes.get(o);return a&&$r(a)||null}),C(this,"endDragNativeItem",function(){i.isDraggingNativeItem()&&(i.actions.endDrag(),i.currentNativeHandle&&i.registry.removeSource(i.currentNativeHandle),i.currentNativeHandle=null,i.currentNativeSource=null)}),C(this,"isNodeInDocument",function(o){return!!(o&&i.document&&i.document.body&&i.document.body.contains(o))}),C(this,"endDragIfSourceWasRemovedFromDOM",function(){var o=i.currentDragSourceNode;o==null||i.isNodeInDocument(o)||i.clearCurrentDragSourceNode()&&i.monitor.isDragging()&&i.actions.endDrag()}),C(this,"handleTopDragStartCapture",function(){i.clearCurrentDragSourceNode(),i.dragStartSourceIds=[]}),C(this,"handleTopDragStart",function(o){if(!o.defaultPrevented){var a=i.dragStartSourceIds;i.dragStartSourceIds=null;var s=ae(o);i.monitor.isDragging()&&i.actions.endDrag(),i.actions.beginDrag(a||[],{publishSource:!1,getSourceClientOffset:i.getSourceClientOffset,clientOffset:s});var u=o.dataTransfer,c=Me(u);if(i.monitor.isDragging()){if(u&&typeof u.setDragImage=="function"){var d=i.monitor.getSourceId(),p=i.sourceNodes.get(d),O=i.sourcePreviewNodes.get(d)||p;if(O){var m=i.getCurrentSourcePreviewNodeOptions(),I=m.anchorX,l=m.anchorY,f=m.offsetX,g=m.offsetY,v={anchorX:I,anchorY:l},S={offsetX:f,offsetY:g},w=Is(p,O,s,v,S);u.setDragImage(O,w.x,w.y)}}try{u==null||u.setData("application/json",{})}catch{}i.setCurrentDragSourceNode(o.target);var T=i.getCurrentSourcePreviewNodeOptions(),E=T.captureDraggingState;E?i.actions.publishDragSource():setTimeout(function(){return i.actions.publishDragSource()},0)}else if(c)i.beginDragNativeItem(c);else{if(u&&!u.types&&(o.target&&!o.target.hasAttribute||!o.target.hasAttribute("draggable")))return;o.preventDefault()}}}),C(this,"handleTopDragEndCapture",function(){i.clearCurrentDragSourceNode()&&i.monitor.isDragging()&&i.actions.endDrag()}),C(this,"handleTopDragEnterCapture",function(o){i.dragEnterTargetIds=[];var a=i.enterLeaveCounter.enter(o.target);if(!(!a||i.monitor.isDragging())){var s=o.dataTransfer,u=Me(s);u&&i.beginDragNativeItem(u,s)}}),C(this,"handleTopDragEnter",function(o){var a=i.dragEnterTargetIds;if(i.dragEnterTargetIds=[],!!i.monitor.isDragging()){i.altKeyPressed=o.altKey,a.length>0&&i.actions.hover(a,{clientOffset:ae(o)});var s=a.some(function(u){return i.monitor.canDropOnTarget(u)});s&&(o.preventDefault(),o.dataTransfer&&(o.dataTransfer.dropEffect=i.getCurrentDropEffect()))}}),C(this,"handleTopDragOverCapture",function(){i.dragOverTargetIds=[]}),C(this,"handleTopDragOver",function(o){var a=i.dragOverTargetIds;if(i.dragOverTargetIds=[],!i.monitor.isDragging()){o.preventDefault(),o.dataTransfer&&(o.dataTransfer.dropEffect="none");return}i.altKeyPressed=o.altKey,i.lastClientOffset=ae(o),i.hoverRafId===null&&typeof requestAnimationFrame<"u"&&(i.hoverRafId=requestAnimationFrame(function(){i.monitor.isDragging()&&i.actions.hover(a||[],{clientOffset:i.lastClientOffset}),i.hoverRafId=null}));var s=(a||[]).some(function(u){return i.monitor.canDropOnTarget(u)});s?(o.preventDefault(),o.dataTransfer&&(o.dataTransfer.dropEffect=i.getCurrentDropEffect())):i.isDraggingNativeItem()?o.preventDefault():(o.preventDefault(),o.dataTransfer&&(o.dataTransfer.dropEffect="none"))}),C(this,"handleTopDragLeaveCapture",function(o){i.isDraggingNativeItem()&&o.preventDefault();var a=i.enterLeaveCounter.leave(o.target);a&&i.isDraggingNativeItem()&&setTimeout(function(){return i.endDragNativeItem()},0)}),C(this,"handleTopDropCapture",function(o){if(i.dropTargetIds=[],i.isDraggingNativeItem()){var a;o.preventDefault(),(a=i.currentNativeSource)===null||a===void 0||a.loadDataTransfer(o.dataTransfer)}else Me(o.dataTransfer)&&o.preventDefault();i.enterLeaveCounter.reset()}),C(this,"handleTopDrop",function(o){var a=i.dropTargetIds;i.dropTargetIds=[],i.actions.hover(a,{clientOffset:ae(o)}),i.actions.drop({dropEffect:i.getCurrentDropEffect()}),i.isDraggingNativeItem()?i.endDragNativeItem():i.monitor.isDragging()&&i.actions.endDrag()}),C(this,"handleSelectStart",function(o){var a=o.target;typeof a.dragDrop=="function"&&(a.tagName==="INPUT"||a.tagName==="SELECT"||a.tagName==="TEXTAREA"||a.isContentEditable||(o.preventDefault(),a.dragDrop()))}),this.options=new Ps(r,n),this.actions=e.getActions(),this.monitor=e.getMonitor(),this.registry=e.getRegistry(),this.enterLeaveCounter=new gs(this.isNodeInDocument)}return As(t,[{key:"profile",value:function(){var r,n;return{sourcePreviewNodes:this.sourcePreviewNodes.size,sourcePreviewNodeOptions:this.sourcePreviewNodeOptions.size,sourceNodeOptions:this.sourceNodeOptions.size,sourceNodes:this.sourceNodes.size,dragStartSourceIds:((r=this.dragStartSourceIds)===null||r===void 0?void 0:r.length)||0,dropTargetIds:this.dropTargetIds.length,dragEnterTargetIds:this.dragEnterTargetIds.length,dragOverTargetIds:((n=this.dragOverTargetIds)===null||n===void 0?void 0:n.length)||0}}},{key:"window",get:function(){return this.options.window}},{key:"document",get:function(){return this.options.document}},{key:"rootElement",get:function(){return this.options.rootElement}},{key:"setup",value:function(){var r=this.rootElement;if(r!==void 0){if(r.__isReactDndBackendSetUp)throw new Error("Cannot have two HTML5 backends at the same time.");r.__isReactDndBackendSetUp=!0,this.addEventListeners(r)}}},{key:"teardown",value:function(){var r=this.rootElement;if(r!==void 0&&(r.__isReactDndBackendSetUp=!1,this.removeEventListeners(this.rootElement),this.clearCurrentDragSourceNode(),this.asyncEndDragFrameId)){var n;(n=this.window)===null||n===void 0||n.cancelAnimationFrame(this.asyncEndDragFrameId)}}},{key:"connectDragPreview",value:function(r,n,i){var o=this;return this.sourcePreviewNodeOptions.set(r,i),this.sourcePreviewNodes.set(r,n),function(){o.sourcePreviewNodes.delete(r),o.sourcePreviewNodeOptions.delete(r)}}},{key:"connectDragSource",value:function(r,n,i){var o=this;this.sourceNodes.set(r,n),this.sourceNodeOptions.set(r,i);var a=function(c){return o.handleDragStart(c,r)},s=function(c){return o.handleSelectStart(c)};return n.setAttribute("draggable","true"),n.addEventListener("dragstart",a),n.addEventListener("selectstart",s),function(){o.sourceNodes.delete(r),o.sourceNodeOptions.delete(r),n.removeEventListener("dragstart",a),n.removeEventListener("selectstart",s),n.setAttribute("draggable","false")}}},{key:"connectDropTarget",value:function(r,n){var i=this,o=function(c){return i.handleDragEnter(c,r)},a=function(c){return i.handleDragOver(c,r)},s=function(c){return i.handleDrop(c,r)};return n.addEventListener("dragenter",o),n.addEventListener("dragover",a),n.addEventListener("drop",s),function(){n.removeEventListener("dragenter",o),n.removeEventListener("dragover",a),n.removeEventListener("drop",s)}}},{key:"addEventListeners",value:function(r){r.addEventListener&&(r.addEventListener("dragstart",this.handleTopDragStart),r.addEventListener("dragstart",this.handleTopDragStartCapture,!0),r.addEventListener("dragend",this.handleTopDragEndCapture,!0),r.addEventListener("dragenter",this.handleTopDragEnter),r.addEventListener("dragenter",this.handleTopDragEnterCapture,!0),r.addEventListener("dragleave",this.handleTopDragLeaveCapture,!0),r.addEventListener("dragover",this.handleTopDragOver),r.addEventListener("dragover",this.handleTopDragOverCapture,!0),r.addEventListener("drop",this.handleTopDrop),r.addEventListener("drop",this.handleTopDropCapture,!0))}},{key:"removeEventListeners",value:function(r){r.removeEventListener&&(r.removeEventListener("dragstart",this.handleTopDragStart),r.removeEventListener("dragstart",this.handleTopDragStartCapture,!0),r.removeEventListener("dragend",this.handleTopDragEndCapture,!0),r.removeEventListener("dragenter",this.handleTopDragEnter),r.removeEventListener("dragenter",this.handleTopDragEnterCapture,!0),r.removeEventListener("dragleave",this.handleTopDragLeaveCapture,!0),r.removeEventListener("dragover",this.handleTopDragOver),r.removeEventListener("dragover",this.handleTopDragOverCapture,!0),r.removeEventListener("drop",this.handleTopDrop),r.removeEventListener("drop",this.handleTopDropCapture,!0))}},{key:"getCurrentSourceNodeOptions",value:function(){var r=this.monitor.getSourceId(),n=this.sourceNodeOptions.get(r);return Xt({dropEffect:this.altKeyPressed?"copy":"move"},n||{})}},{key:"getCurrentDropEffect",value:function(){return this.isDraggingNativeItem()?"copy":this.getCurrentSourceNodeOptions().dropEffect}},{key:"getCurrentSourcePreviewNodeOptions",value:function(){var r=this.monitor.getSourceId(),n=this.sourcePreviewNodeOptions.get(r);return Xt({anchorX:.5,anchorY:.5,captureDraggingState:!1},n||{})}},{key:"isDraggingNativeItem",value:function(){var r=this.monitor.getItemType();return Object.keys(Gt).some(function(n){return Gt[n]===r})}},{key:"beginDragNativeItem",value:function(r,n){this.clearCurrentDragSourceNode(),this.currentNativeSource=Es(r,n),this.currentNativeHandle=this.registry.addSource(r,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle])}},{key:"setCurrentDragSourceNode",value:function(r){var n=this;this.clearCurrentDragSourceNode(),this.currentDragSourceNode=r;var i=1e3;this.mouseMoveTimeoutTimer=setTimeout(function(){var o;return(o=n.rootElement)===null||o===void 0?void 0:o.addEventListener("mousemove",n.endDragIfSourceWasRemovedFromDOM,!0)},i)}},{key:"clearCurrentDragSourceNode",value:function(){if(this.currentDragSourceNode){if(this.currentDragSourceNode=null,this.rootElement){var r;(r=this.window)===null||r===void 0||r.clearTimeout(this.mouseMoveTimeoutTimer||void 0),this.rootElement.removeEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)}return this.mouseMoveTimeoutTimer=null,!0}return!1}},{key:"handleDragStart",value:function(r,n){r.defaultPrevented||(this.dragStartSourceIds||(this.dragStartSourceIds=[]),this.dragStartSourceIds.unshift(n))}},{key:"handleDragEnter",value:function(r,n){this.dragEnterTargetIds.unshift(n)}},{key:"handleDragOver",value:function(r,n){this.dragOverTargetIds===null&&(this.dragOverTargetIds=[]),this.dragOverTargetIds.unshift(n)}},{key:"handleDrop",value:function(r,n){this.dropTargetIds.unshift(n)}}]),t})(),ue;function js(){return ue||(ue=new Image,ue.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="),ue}var Ls=function(e,r,n){return new Ms(e,r,n)};function $s(t){const e=k(),r=e.selectedIds,[n,i,o]=Ua(()=>({canDrag:()=>t.isDraggable,type:"NODE",item:()=>{const a=e.isSelected(t.id)?Array.from(r):[t.id];return e.dispatch(Z.dragStart(t.id,a)),{id:t.id,dragIds:a}},end:()=>{e.hideCursor(),e.dispatch(Z.dragEnd())}}),[r,t]);return h.useEffect(()=>{o(js())},[o]),i}function Fs(t,e){const r=t.getBoundingClientRect(),n=e.x-Math.round(r.x),i=e.y-Math.round(r.y),o=r.height,a=i<o/2,s=!a,u=o/4,c=i>u&&i<o-u;return{x:n,inTopHalf:a,inBottomHalf:s,inMiddle:c,atTop:!c&&a,atBottom:!c&&s}}function Hs(t,e,r,n){return t?t.isInternal?n.atTop?[e,t]:n.inMiddle?[t,t]:[t,r]:n.inTopHalf?[e,t]:[t,r]:[e,null]}function le(t,e){return{parentId:t||null,index:e}}function X(t,e){return{type:"line",index:t,level:e}}function Us(t){return{type:"highlight",id:t}}function Le(t,e){var r;let n=t;for(;n.parent&&n.level>e;)n=n.parent;const i=((r=n.parent)===null||r===void 0?void 0:r.id)||null,o=hr(n)+1;return{parentId:i,index:o}}function Br(t){var e;const r=Fs(t.element,t.offset),n=t.indent,i=Math.round(Math.max(0,r.x-n)/n),{node:o,nextNode:a,prevNode:s}=t,[u,c]=Hs(o,s,a,r);if(o&&o.isInternal&&r.inMiddle)return{drop:le(o.id,null),cursor:Us(o.id)};if(!u)return{drop:le((e=c==null?void 0:c.parent)===null||e===void 0?void 0:e.id,0),cursor:X(0,0)};if(lr(u)){const d=ce(i,(c==null?void 0:c.level)||0,u.level);return{drop:Le(u,d),cursor:X(u.rowIndex+1,d)}}if(cr(u)){const d=ce(i,(c==null?void 0:c.level)||0,u.level);return{drop:Le(u,d),cursor:X(u.rowIndex+1,d)}}if(dr(u)){const d=ce(i,0,u.level+1);return d>u.level?{drop:le(u.id,0),cursor:X(u.rowIndex+1,d)}:{drop:Le(u,d),cursor:X(u.rowIndex+1,d)}}return{drop:le(u==null?void 0:u.id,0),cursor:X(u.rowIndex+1,u.level+1)}}function zs(t,e){const r=k(),[n,i]=Mr(()=>({accept:"NODE",canDrop:()=>r.canDrop(),hover:(o,a)=>{const s=a.getClientOffset();if(!t.current||!s)return;const{cursor:u,drop:c}=Br({element:t.current,offset:s,indent:r.indent,node:e,prevNode:e.prev,nextNode:e.next});c&&r.dispatch(Z.hovering(c.parentId,c.index)),a.canDrop()?u&&r.showCursor(u):r.hideCursor()},drop:(o,a)=>{if(!a.canDrop())return null;let{parentId:s,index:u,dragIds:c}=r.state.dnd;mr(r.props.onMove,{dragIds:c,parentId:s===oe?null:s,index:u===null?0:u,dragNodes:r.dragNodes,parentNode:r.get(s)}),r.open(s)}}),[e,t.current,r.props]);return i}function Bs(t){const e=k(),r=e.at(t);if(!r)throw new Error(`Could not find node for index: ${t}`);return h.useMemo(()=>{const n=r.clone();return e.visibleNodes[t]=n,n},[...Object.values(r.state),r])}const Ws=nr.memo(function({index:e,style:r}){ur(),pn();const n=k(),i=Bs(e),o=h.useRef(null),a=$s(i),s=zs(o,i),u=h.useCallback(l=>{o.current=l,s(l)},[s]),c=n.indent*i.level,d=h.useMemo(()=>({paddingLeft:c}),[c]),p=h.useMemo(()=>{var l,f;return Object.assign(Object.assign({},r),{top:parseFloat(r.top)+((f=(l=n.props.padding)!==null&&l!==void 0?l:n.props.paddingTop)!==null&&f!==void 0?f:0)})},[r,n.props.padding,n.props.paddingTop]),O={role:"treeitem","aria-level":i.level+1,"aria-selected":i.isSelected,"aria-expanded":i.isOpen,style:p,tabIndex:-1,className:n.props.rowClassName};h.useEffect(()=>{var l;!i.isEditing&&i.isFocused&&((l=o.current)===null||l===void 0||l.focus({preventScroll:!0}))},[i.isEditing,i.isFocused,o.current]);const m=n.renderNode,I=n.renderRow;return y.jsx(I,{node:i,innerRef:u,attrs:O,children:y.jsx(m,{node:i,tree:n,style:d,dragHandle:a})})});let $e="",Qt=null;function Wr(){ur();const t=k();return y.jsx("div",{role:"tree",style:{height:t.height,width:t.width,minHeight:0,minWidth:0},onContextMenu:t.props.onContextMenu,onClick:t.props.onClick,tabIndex:0,onFocus:e=>{e.currentTarget.contains(e.relatedTarget)||t.onFocus()},onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||t.onBlur()},onKeyDown:e=>{var r;if(t.isEditing)return;if(e.key==="Backspace"){if(!t.props.onDelete)return;const i=Array.from(t.selectedIds);if(i.length>1){let o=t.mostRecentNode;for(;o&&o.isSelected;)o=o.nextSibling;o||(o=t.lastNode),t.focus(o,{scroll:!1}),t.delete(Array.from(i))}else{const o=t.focusedNode;if(o){const a=o.nextSibling,s=o.parent;t.focus(a||s,{scroll:!1}),t.delete(o)}}return}if(e.key==="Tab"&&!e.shiftKey){e.preventDefault(),gr(e.currentTarget);return}if(e.key==="Tab"&&e.shiftKey){e.preventDefault(),pr(e.currentTarget);return}if(e.key==="ArrowDown"){e.preventDefault();const i=t.nextNode;if(e.metaKey){t.select(t.focusedNode),t.activate(t.focusedNode);return}else if(!e.shiftKey||t.props.disableMultiSelection){t.focus(i);return}else{if(!i)return;const o=t.focusedNode;o?o.isSelected?t.selectContiguous(i):t.selectMulti(i):t.focus(t.firstNode);return}}if(e.key==="ArrowUp"){e.preventDefault();const i=t.prevNode;if(!e.shiftKey||t.props.disableMultiSelection){t.focus(i);return}else{if(!i)return;const o=t.focusedNode;o?o.isSelected?t.selectContiguous(i):t.selectMulti(i):t.focus(t.lastNode);return}}if(e.key==="ArrowRight"){const i=t.focusedNode;if(!i)return;i.isInternal&&i.isOpen?t.focus(t.nextNode):i.isInternal&&t.open(i.id);return}if(e.key==="ArrowLeft"){const i=t.focusedNode;if(!i||i.isRoot)return;i.isInternal&&i.isOpen?t.close(i.id):!((r=i.parent)===null||r===void 0)&&r.isRoot||t.focus(i.parent);return}if(e.key==="a"&&e.metaKey&&!t.props.disableMultiSelection){e.preventDefault(),t.selectAll();return}if(e.key==="a"&&!e.metaKey&&t.props.onCreate){t.createLeaf();return}if(e.key==="A"&&!e.metaKey){if(!t.props.onCreate)return;t.createInternal();return}if(e.key==="Home"){e.preventDefault(),t.focus(t.firstNode);return}if(e.key==="End"){e.preventDefault(),t.focus(t.lastNode);return}if(e.key==="Enter"){const i=t.focusedNode;if(!i||!i.isEditable||!t.props.onRename)return;setTimeout(()=>{i&&t.edit(i)});return}if(e.key===" "){e.preventDefault();const i=t.focusedNode;if(!i)return;i.isLeaf?(i.select(),i.activate()):i.toggle();return}if(e.key==="*"){const i=t.focusedNode;if(!i)return;t.openSiblings(i);return}if(e.key==="PageUp"){e.preventDefault(),t.pageUp();return}e.key==="PageDown"&&(e.preventDefault(),t.pageDown()),clearTimeout(Qt),$e+=e.key,Qt=setTimeout(()=>{$e=""},600);const n=t.visibleNodes.find(i=>{const o=i.data.name;return typeof o=="string"?o.toLowerCase().startsWith($e):!1});n&&t.focus(n.id)},children:y.jsx(Xn,{className:t.props.className,outerRef:t.listEl,itemCount:t.visibleNodes.length,height:t.height,width:t.width,itemSize:t.rowHeight,overscanCount:t.overscanCount,itemKey:e=>{var r;return((r=t.visibleNodes[e])===null||r===void 0?void 0:r.id)||e},outerElementType:Zn,innerElementType:ri,onScroll:t.props.onScroll,onItemsRendered:t.onItemsRendered.bind(t),ref:t.list,children:Ws})})}function Jt(t){return t.isFiltered?Vs(t.root,t.isMatch.bind(t)):qs(t.root)}function qs(t){const e=[];function r(n){var i;n.level>=0&&e.push(n),n.isOpen&&((i=n.children)===null||i===void 0||i.forEach(r))}return r(t),e.forEach(qr),e}function Vs(t,e){const r={},n=[];function i(a){if(!a.isRoot&&e(a)){r[a.id]=!0;let u=a.parent;for(;u;)r[u.id]=!0,u=u.parent}if(a.children)for(let u of a.children)i(u)}function o(a){var s;a.level>=0&&r[a.id]&&n.push(a),a.isOpen&&((s=a.children)===null||s===void 0||s.forEach(o))}return i(t),o(t),n.forEach(qr),n}function qr(t,e){t.rowIndex=e}const Zt=t=>t.reduce((e,r,n)=>(e[r.id]=n,e),{});var Fe=function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(a){a(o)})}return new(r||(r=Promise))(function(o,a){function s(d){try{c(n.next(d))}catch(p){a(p)}}function u(d){try{c(n.throw(d))}catch(p){a(p)}}function c(d){d.done?o(d.value):i(d.value).then(s,u)}c((n=n.apply(t,e||[])).next())})};const{safeRun:N,identify:H,identifyNull:$}=bn;class ie{constructor(e,r,n,i){this.store=e,this.props=r,this.list=n,this.listEl=i,this.visibleStartIndex=0,this.visibleStopIndex=0,this.root=ut(this),this.visibleNodes=Jt(this),this.idToIndex=Zt(this.visibleNodes)}update(e){this.props=e,this.root=ut(this),this.visibleNodes=Jt(this),this.idToIndex=Zt(this.visibleNodes)}dispatch(e){return this.store.dispatch(e)}get state(){return this.store.getState()}get openState(){return this.state.nodes.open.unfiltered}get width(){var e;return(e=this.props.width)!==null&&e!==void 0?e:300}get height(){var e;return(e=this.props.height)!==null&&e!==void 0?e:500}get indent(){var e;return(e=this.props.indent)!==null&&e!==void 0?e:24}get rowHeight(){var e;return(e=this.props.rowHeight)!==null&&e!==void 0?e:24}get overscanCount(){var e;return(e=this.props.overscanCount)!==null&&e!==void 0?e:1}get searchTerm(){return(this.props.searchTerm||"").trim()}get matchFn(){var e;const r=(e=this.props.searchMatch)!==null&&e!==void 0?e:((n,i)=>JSON.stringify(Object.values(n.data)).toLocaleLowerCase().includes(i.toLocaleLowerCase()));return n=>r(n,this.searchTerm)}accessChildren(e){var r;const n=this.props.childrenAccessor||"children";return(r=ne(e,n))!==null&&r!==void 0?r:null}accessId(e){const r=this.props.idAccessor||"id",n=ne(e,r);if(!n)throw new Error("Data must contain an 'id' property or props.idAccessor must return a string");return n}get firstNode(){var e;return(e=this.visibleNodes[0])!==null&&e!==void 0?e:null}get lastNode(){var e;return(e=this.visibleNodes[this.visibleNodes.length-1])!==null&&e!==void 0?e:null}get focusedNode(){var e;return(e=this.get(this.state.nodes.focus.id))!==null&&e!==void 0?e:null}get mostRecentNode(){var e;return(e=this.get(this.state.nodes.selection.mostRecent))!==null&&e!==void 0?e:null}get nextNode(){const e=this.indexOf(this.focusedNode);return e===null?null:this.at(e+1)}get prevNode(){const e=this.indexOf(this.focusedNode);return e===null?null:this.at(e-1)}get(e){return e&&e in this.idToIndex&&this.visibleNodes[this.idToIndex[e]]||null}at(e){return this.visibleNodes[e]||null}nodesBetween(e,r){var n;if(e===null||r===null)return[];const i=(n=this.indexOf(e))!==null&&n!==void 0?n:0,o=this.indexOf(r);if(o===null)return[];const a=Math.min(i,o),s=Math.max(i,o);return this.visibleNodes.slice(a,s+1)}indexOf(e){const r=yr(e);return r?this.idToIndex[r]:null}get editingId(){return this.state.nodes.edit.id}createInternal(){return this.create({type:"internal"})}createLeaf(){return this.create({type:"leaf"})}create(){return Fe(this,arguments,void 0,function*(e={}){var r,n;const i=e.parentId===void 0?Sr(this):e.parentId,o=(r=e.index)!==null&&r!==void 0?r:Or(this),a=(n=e.type)!==null&&n!==void 0?n:"leaf",s=yield N(this.props.onCreate,{type:a,parentId:i,index:o,parentNode:this.get(i)});s&&(this.focus(s),setTimeout(()=>{this.edit(s).then(()=>{this.select(s),this.activate(s)})}))})}delete(e){return Fe(this,void 0,void 0,function*(){if(!e)return;const n=(Array.isArray(e)?e:[e]).map(H),i=n.map(o=>this.get(o)).filter(o=>!!o);yield N(this.props.onDelete,{nodes:i,ids:n})})}edit(e){const r=H(e);return this.resolveEdit({cancelled:!0}),this.scrollTo(r),this.dispatch(Ce(r)),new Promise(n=>{ie.editPromise=n})}submit(e,r){return Fe(this,void 0,void 0,function*(){if(!e)return;const n=H(e);yield N(this.props.onRename,{id:n,name:r,node:this.get(n)}),this.dispatch(Ce(null)),this.resolveEdit({cancelled:!1,value:r}),setTimeout(()=>this.onFocus())})}reset(){this.dispatch(Ce(null)),this.resolveEdit({cancelled:!0}),setTimeout(()=>this.onFocus())}activate(e){const r=this.get($(e));r&&N(this.props.onActivate,r)}resolveEdit(e){const r=ie.editPromise;r&&r(e),ie.editPromise=null}get selectedIds(){return this.state.nodes.selection.ids}get selectedNodes(){let e=[];for(let r of Array.from(this.selectedIds)){const n=this.get(r);n&&e.push(n)}return e}focus(e,r={}){e&&(this.props.selectionFollowsFocus?this.select(e):(this.dispatch(V(H(e))),r.scroll!==!1&&this.scrollTo(e),this.focusedNode&&N(this.props.onFocus,this.focusedNode)))}pageUp(){var e,r;const n=this.visibleStartIndex,o=this.visibleStopIndex-n;let a=(r=(e=this.focusedNode)===null||e===void 0?void 0:e.rowIndex)!==null&&r!==void 0?r:0;a>n?a=n:a=Math.max(n-o,0),this.focus(this.at(a))}pageDown(){var e,r;const n=this.visibleStartIndex,i=this.visibleStopIndex,o=i-n;let a=(r=(e=this.focusedNode)===null||e===void 0?void 0:e.rowIndex)!==null&&r!==void 0?r:0;a<i?a=i:a=Math.min(a+o,this.visibleNodes.length-1),this.focus(this.at(a))}select(e,r={}){if(!e)return;const n=r.focus!==!1,i=H(e);n&&this.dispatch(V(i)),this.dispatch(L.only(i)),this.dispatch(L.anchor(i)),this.dispatch(L.mostRecent(i)),this.scrollTo(i,r.align),this.focusedNode&&n&&N(this.props.onFocus,this.focusedNode),N(this.props.onSelect,this.selectedNodes)}deselect(e){if(!e)return;const r=H(e);this.dispatch(L.remove(r)),N(this.props.onSelect,this.selectedNodes)}selectMulti(e,r={}){const n=this.get($(e));if(!n)return;const i=r.focus!==!1;i&&this.dispatch(V(n.id)),this.dispatch(L.add(n.id)),this.dispatch(L.anchor(n.id)),this.dispatch(L.mostRecent(n.id)),this.scrollTo(n,r.align),this.focusedNode&&i&&N(this.props.onFocus,this.focusedNode),N(this.props.onSelect,this.selectedNodes)}selectContiguous(e){if(!e)return;const r=H(e),{anchor:n,mostRecent:i}=this.state.nodes.selection;this.dispatch(V(r)),this.dispatch(L.remove(this.nodesBetween(n,i))),this.dispatch(L.add(this.nodesBetween(n,$(r)))),this.dispatch(L.mostRecent(r)),this.scrollTo(r),this.focusedNode&&N(this.props.onFocus,this.focusedNode),N(this.props.onSelect,this.selectedNodes)}deselectAll(){this.setSelection({ids:[],anchor:null,mostRecent:null}),N(this.props.onSelect,this.selectedNodes)}selectAll(){var e;this.setSelection({ids:Object.keys(this.idToIndex),anchor:this.firstNode,mostRecent:this.lastNode}),this.dispatch(V((e=this.lastNode)===null||e===void 0?void 0:e.id)),this.focusedNode&&N(this.props.onFocus,this.focusedNode),N(this.props.onSelect,this.selectedNodes)}setSelection(e){var r;const n=new Set((r=e.ids)===null||r===void 0?void 0:r.map(H)),i=$(e.anchor),o=$(e.mostRecent);this.dispatch(L.set({ids:n,anchor:i,mostRecent:o})),N(this.props.onSelect,this.selectedNodes)}get cursorParentId(){const{cursor:e}=this.state.dnd;switch(e.type){case"highlight":return e.id;default:return null}}get cursorOverFolder(){return this.state.dnd.cursor.type==="highlight"}get dragNodes(){return this.state.dnd.dragIds.map(e=>this.get(e)).filter(e=>!!e)}get dragNode(){return this.get(this.state.nodes.drag.id)}get dragDestinationParent(){return this.get(this.state.nodes.drag.destinationParentId)}get dragDestinationIndex(){return this.state.nodes.drag.destinationIndex}canDrop(){var e;if(this.isFiltered)return!1;const r=(e=this.get(this.state.dnd.parentId))!==null&&e!==void 0?e:this.root,n=this.dragNodes,i=this.props.disableDrop;for(const o of n)if(!o||!r||o.isInternal&&fr(r,o))return!1;return typeof i=="function"?!i({parentNode:r,dragNodes:this.dragNodes,index:this.state.dnd.index||0}):typeof i=="string"?!r.data[i]:typeof i=="boolean"?!i:!0}hideCursor(){this.dispatch(Z.cursor({type:"none"}))}showCursor(e){this.dispatch(Z.cursor(e))}open(e){const r=$(e);r&&(this.isOpen(r)||(this.dispatch(Ue.open(r,this.isFiltered)),N(this.props.onToggle,r)))}close(e){const r=$(e);r&&this.isOpen(r)&&(this.dispatch(Ue.close(r,this.isFiltered)),N(this.props.onToggle,r))}toggle(e){const r=$(e);if(r)return this.isOpen(r)?this.close(r):this.open(r)}openParents(e){const r=$(e);if(!r)return;const n=Xe(this.root,r);let i=n==null?void 0:n.parent;for(;i;)this.open(i.id),i=i.parent}openSiblings(e){const r=e.parent;if(!r)this.toggle(e.id);else if(r.children){const n=e.isOpen;for(let i of r.children)i.isInternal&&(n?this.close(i.id):this.open(i.id));this.scrollTo(this.focusedNode)}}openAll(){ve(this.root,e=>{e.isInternal&&e.open()})}closeAll(){ve(this.root,e=>{e.isInternal&&e.close()})}scrollTo(e,r="smart"){if(!e)return;const n=H(e);return this.openParents(n),br(()=>n in this.idToIndex).then(()=>{var i;const o=this.idToIndex[n];o!==void 0&&((i=this.list.current)===null||i===void 0||i.scrollToItem(o,r))}).catch(()=>{})}get isEditing(){return this.state.nodes.edit.id!==null}get isFiltered(){var e;return!!(!((e=this.props.searchTerm)===null||e===void 0)&&e.trim())}get hasFocus(){return this.state.nodes.focus.treeFocused}get hasNoSelection(){return this.state.nodes.selection.ids.size===0}get hasOneSelection(){return this.state.nodes.selection.ids.size===1}get hasMultipleSelections(){return this.state.nodes.selection.ids.size>1}isSelected(e){return e?this.state.nodes.selection.ids.has(e):!1}isOpen(e){var r,n,i;if(!e)return!1;if(e===oe)return!0;const o=(r=this.props.openByDefault)!==null&&r!==void 0?r:!0;return this.isFiltered?(n=this.state.nodes.open.filtered[e])!==null&&n!==void 0?n:!0:(i=this.state.nodes.open.unfiltered[e])!==null&&i!==void 0?i:o}isEditable(e){const r=this.props.disableEdit||(()=>!1);return!ne(e,r)}isDraggable(e){const r=this.props.disableDrag||(()=>!1);return!ne(e,r)}isDragging(e){const r=$(e);return r?this.state.nodes.drag.id===r:!1}isFocused(e){return this.hasFocus&&this.state.nodes.focus.id===e}isMatch(e){return this.matchFn(e)}willReceiveDrop(e){const r=$(e);if(!r)return!1;const{destinationParentId:n,destinationIndex:i}=this.state.nodes.drag;return r===n&&i===null}onFocus(){const e=this.focusedNode||this.firstNode;e&&this.dispatch(V(e.id))}onBlur(){this.dispatch(xn())}onItemsRendered(e){this.visibleStartIndex=e.visibleStartIndex,this.visibleStopIndex=e.visibleStopIndex}get renderContainer(){return this.props.renderContainer||Wr}get renderRow(){return this.props.renderRow||Tn}get renderNode(){return this.props.children||wn}get renderDragPreview(){return this.props.renderDragPreview||Ir}get renderCursor(){return this.props.renderCursor||Dn}}function R(t){return`Minified Redux error #${t}; visit https://redux.js.org/Errors?code=${t} for the full message or use the non-minified dev environment for full errors. `}var Gs=typeof Symbol=="function"&&Symbol.observable||"@@observable",er=Gs,He=()=>Math.random().toString(36).substring(7).split("").join("."),Ks={INIT:`@@redux/INIT${He()}`,REPLACE:`@@redux/REPLACE${He()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${He()}`},be=Ks;function Ys(t){if(typeof t!="object"||t===null)return!1;let e=t;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e||Object.getPrototypeOf(t)===null}function Vr(t,e,r){if(typeof t!="function")throw new Error(R(2));if(typeof e=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(R(0));if(typeof e=="function"&&typeof r>"u"&&(r=e,e=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(R(1));return r(Vr)(t,e)}let n=t,i=e,o=new Map,a=o,s=0,u=!1;function c(){a===o&&(a=new Map,o.forEach((f,g)=>{a.set(g,f)}))}function d(){if(u)throw new Error(R(3));return i}function p(f){if(typeof f!="function")throw new Error(R(4));if(u)throw new Error(R(5));let g=!0;c();const v=s++;return a.set(v,f),function(){if(g){if(u)throw new Error(R(6));g=!1,c(),a.delete(v),o=null}}}function O(f){if(!Ys(f))throw new Error(R(7));if(typeof f.type>"u")throw new Error(R(8));if(typeof f.type!="string")throw new Error(R(17));if(u)throw new Error(R(9));try{u=!0,i=n(i,f)}finally{u=!1}return(o=a).forEach(v=>{v()}),f}function m(f){if(typeof f!="function")throw new Error(R(10));n=f,O({type:be.REPLACE})}function I(){const f=p;return{subscribe(g){if(typeof g!="object"||g===null)throw new Error(R(11));function v(){const w=g;w.next&&w.next(d())}return v(),{unsubscribe:f(v)}},[er](){return this}}}return O({type:be.INIT}),{dispatch:O,subscribe:p,getState:d,replaceReducer:m,[er]:I}}function Xs(t){Object.keys(t).forEach(e=>{const r=t[e];if(typeof r(void 0,{type:be.INIT})>"u")throw new Error(R(12));if(typeof r(void 0,{type:be.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(R(13))})}function tr(t){const e=Object.keys(t),r={};for(let o=0;o<e.length;o++){const a=e[o];typeof t[a]=="function"&&(r[a]=t[a])}const n=Object.keys(r);let i;try{Xs(r)}catch(o){i=o}return function(a={},s){if(i)throw i;let u=!1;const c={};for(let d=0;d<n.length;d++){const p=n[d],O=r[p],m=a[p],I=O(m,s);if(typeof I>"u")throw s&&s.type,new Error(R(14));c[p]=I,u=u||I!==m}return u=u||n.length!==Object.keys(a).length,u?c:a}}function Qs(t=J().nodes.drag,e){switch(e.type){case"DND_DRAG_START":return Object.assign(Object.assign({},t),{id:e.id,selectedIds:e.dragIds});case"DND_DRAG_END":return Object.assign(Object.assign({},t),{id:null,destinationParentId:null,destinationIndex:null,selectedIds:[]});case"DND_HOVERING":return e.parentId!==t.destinationParentId||e.index!=t.destinationIndex?Object.assign(Object.assign({},t),{destinationParentId:e.parentId,destinationIndex:e.index}):t;default:return t}}const Js=tr({nodes:tr({focus:Nn,edit:_n,open:Pn,selection:Rn,drag:Qs}),dnd:kn}),Zs=J();function eu({treeProps:t,imperativeHandle:e,children:r}){const n=h.useRef(null),i=h.useRef(null),o=h.useRef(Vr(Js,J(t))),a=cn.useSyncExternalStore(o.current.subscribe,o.current.getState,()=>Zs),s=h.useMemo(()=>new ie(o.current,t,n,i),[]),u=h.useRef(0);return h.useMemo(()=>{u.current+=1,s.update(t)},[...Object.values(t),a.nodes.open]),h.useImperativeHandle(e,()=>s),h.useEffect(()=>{s.props.selection?s.select(s.props.selection,{focus:!1}):s.deselectAll()},[s.props.selection]),h.useEffect(()=>{s.props.searchTerm||o.current.dispatch(Ue.clear(!0))},[s.props.searchTerm]),y.jsx(ir.Provider,{value:s,children:y.jsx(sr.Provider,{value:u.current,children:y.jsx(or.Provider,{value:a.nodes,children:y.jsx(ar.Provider,{value:a.dnd,children:y.jsx(jo,Object.assign({},t.dndManager?{manager:t.dndManager}:{backend:t.dndBackend||Ls,options:{rootElement:s.props.dndRootElement||void 0}},{children:r}))})})})})}function tu(){const t=k(),[,e]=Mr(()=>({accept:"NODE",canDrop:(r,n)=>n.isOver({shallow:!0})?t.canDrop():!1,hover:(r,n)=>{if(!n.isOver({shallow:!0}))return;const i=n.getClientOffset();if(!t.listEl.current||!i)return;const{cursor:o,drop:a}=Br({element:t.listEl.current,offset:i,indent:t.indent,node:null,prevNode:t.visibleNodes[t.visibleNodes.length-1],nextNode:null});a&&t.dispatch(Z.hovering(a.parentId,a.index)),n.canDrop()?o&&t.showCursor(o):t.hideCursor()}}),[t]);e(t.listEl)}function ru(t){return tu(),t.children}function nu(){const e=k().props.renderContainer||Wr;return y.jsx(y.Fragment,{children:y.jsx(e,{})})}function iu(){const t=k(),{offset:e,mouse:r,item:n,isDragging:i}=us(a=>({offset:a.getSourceClientOffset(),mouse:a.getClientOffset(),item:a.getItem(),isDragging:a.isDragging()})),o=t.props.renderDragPreview||Ir;return y.jsx(o,{offset:e,mouse:r,id:(n==null?void 0:n.id)||null,dragIds:(n==null?void 0:n.dragIds)||[],isDragging:i})}class ou{constructor(e){this.root=au(e)}get data(){var e,r;return(r=(e=this.root.children)===null||e===void 0?void 0:e.map(n=>n.data))!==null&&r!==void 0?r:[]}create(e){const r=e.parentId?this.find(e.parentId):this.root;if(!r)return null;r.addChild(e.data,e.index)}move(e){const r=this.find(e.id),n=e.parentId?this.find(e.parentId):this.root;!r||!n||(n.addChild(r.data,e.index),r.drop())}update(e){const r=this.find(e.id);r&&r.update(e.changes)}drop(e){const r=this.find(e.id);r&&r.drop()}find(e,r=this.root){if(!r)return null;if(r.id===e)return r;if(r.children){for(let n of r.children){const i=this.find(e,n);if(i)return i}return null}return null}}function au(t){const e=new Gr({id:"ROOT"},null);return e.children=t.map(r=>nt(r,e)),e}function nt(t,e){const r=new Gr(t,e);return t.children&&(r.children=t.children.map(n=>nt(n,r))),r}class Gr{constructor(e,r){this.data=e,this.parent=r,this.id=e.id}hasParent(){return!!this.parent}get childIndex(){return this.hasParent()?this.parent.children.indexOf(this):-1}addChild(e,r){var n,i;const o=nt(e,this);this.children=(n=this.children)!==null&&n!==void 0?n:[],this.children.splice(r,0,o),this.data.children=(i=this.data.children)!==null&&i!==void 0?i:[],this.data.children.splice(r,0,e)}removeChild(e){var r,n;(r=this.children)===null||r===void 0||r.splice(e,1),(n=this.data.children)===null||n===void 0||n.splice(e,1)}update(e){if(this.hasParent()){const r=this.childIndex;this.parent.addChild(Object.assign(Object.assign({},this.data),e),r),this.drop()}}drop(){this.hasParent()&&this.parent.removeChild(this.childIndex)}}let su=0;function uu(t){const[e,r]=h.useState(t),n=h.useMemo(()=>new ou(e),[e]);return[e,{onMove:c=>{for(const d of c.dragIds)n.move({id:d,parentId:c.parentId,index:c.index});r(n.data)},onRename:({name:c,id:d})=>{n.update({id:d,changes:{name:c}}),r(n.data)},onCreate:({parentId:c,index:d,type:p})=>{const O={id:`simple-tree-id-${su++}`,name:""};return p==="internal"&&(O.children=[]),n.create({parentId:c,index:d,data:O}),r(n.data),O},onDelete:c=>{c.ids.forEach(d=>n.drop({id:d})),r(n.data)}}]}function lu(t){if(t.initialData&&t.data)throw new Error("React Arborist Tree => Provide either a data or initialData prop, but not both.");if(t.initialData&&(t.onCreate||t.onDelete||t.onMove||t.onRename))throw new Error(`React Arborist Tree => You passed the initialData prop along with a data handler.
|
|
21
|
-
Use the data prop if you want to provide your own handlers.`);if(t.initialData){const[e,r]=
|
|
11
|
+
*/const vn=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],yn=nr("folder",vn),or=h.createContext(null);function k(){const t=h.useContext(or);if(t===null)throw new Error("No Tree Api Provided");return t}const ar=h.createContext(null);function mn(){const t=h.useContext(ar);if(t===null)throw new Error("Provide a NodesContext");return t}const sr=h.createContext(null);function bn(){const t=h.useContext(sr);if(t===null)throw new Error("Provide a DnDContext");return t}const ur=h.createContext(0);function lr(){h.useContext(ur)}function ce(t,e,r){return Math.max(Math.min(t,r),e)}function cr(t){return t&&t.isLeaf}function dr(t){return t&&t.isInternal&&!t.isOpen}function fr(t){var e;return t&&t.isOpen&&!(!((e=t.children)===null||e===void 0)&&e.length)}const hr=(t,e)=>{let r=t;for(;r;){if(r.id===e.id)return!0;r=r.parent}return!1},gr=t=>{if(!t.parent)throw Error("Node does not have a parent");return t.parent.children.findIndex(e=>e.id===t.id)};function Qe(t,e){if(!t)return null;if(t.id===e)return t;if(t.children)for(let r of t.children){const n=Qe(r,e);if(n)return n}return null}function ve(t,e){if(e(t),t.children)for(let r of t.children)ve(r,e)}function pr(t){const e=yr(t);let r;for(let n=0;n<e.length;++n)if(e[n]===t){r=On(e,n);break}r==null||r.focus()}function vr(t){const e=yr(t);let r;for(let n=0;n<e.length;++n)if(e[n]===t){r=Sn(e,n);break}r==null||r.focus()}function On(t,e){return e+1<t.length?t[e+1]:t[0]}function Sn(t,e){return e-1>=0?t[e-1]:t[t.length-1]}function yr(t){return Array.from(document.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"]):not([disabled]), details:not([disabled]), summary:not(:disabled)')).filter(e=>e===t||!t.contains(e))}function ne(t,e){return typeof e=="boolean"?e:typeof e=="string"?t[e]:e(t)}function mr(t){return t===null?null:z(t)}function z(t){return typeof t=="string"?t:t.id}function br(t,...e){if(t)return t(...e)}function Or(t){return new Promise((e,r)=>{let n=0;function i(){n+=1,n===100&&r(),t()?e():setTimeout(i,10)}i()})}function Sr(t){var e,r;const n=t.focusedNode;return n?n.isOpen?0:n.parent?n.childIndex+1:0:(r=(e=t.root.children)===null||e===void 0?void 0:e.length)!==null&&r!==void 0?r:0}function Ir(t){const e=t.focusedNode;return e?e.isOpen?e.id:e.parent&&!e.parent.isRoot?e.parent.id:null:null}const In=Object.freeze(Object.defineProperty({__proto__:null,access:ne,bound:ce,dfs:Qe,focusNextElement:pr,focusPrevElement:vr,getInsertIndex:Sr,getInsertParentId:Ir,identify:z,identifyNull:mr,indexOf:gr,isClosed:dr,isDescendant:hr,isItem:cr,isOpenWithEmptyChildren:fr,safeRun:br,waitFor:Or,walk:ve},Symbol.toStringTag,{value:"Module"})),Dn={display:"flex",alignItems:"center",zIndex:1},Tn={flex:1,height:"2px",background:"#4B91E2",borderRadius:"1px"},wn={width:"4px",height:"4px",boxShadow:"0 0 0 3px #4B91E2",borderRadius:"50%"},Cn=ir.memo(function({top:e,left:r,indent:n}){const i={position:"absolute",pointerEvents:"none",top:e-2+"px",left:r+"px",right:n+"px"};return y.jsxs("div",{style:Object.assign(Object.assign({},Dn),i),children:[y.jsx("div",{style:Object.assign({},wn)}),y.jsx("div",{style:Object.assign({},Tn)})]})});function En({node:t,attrs:e,innerRef:r,children:n}){return y.jsx("div",Object.assign({},e,{ref:r,onFocus:i=>i.stopPropagation(),onClick:t.handleClick,children:n}))}function _n(t){return y.jsxs("div",{ref:t.dragHandle,style:t.style,children:[y.jsx("span",{onClick:e=>{e.stopPropagation(),t.node.toggle()},children:t.node.isLeaf?"🌳":t.node.isOpen?"🗁":"🗀"})," ",t.node.isEditing?y.jsx(Nn,Object.assign({},t)):y.jsx(xn,Object.assign({},t))]})}function xn(t){return y.jsx(y.Fragment,{children:y.jsx("span",{children:t.node.data.name})})}function Nn({node:t}){const e=h.useRef();return h.useEffect(()=>{var r,n;(r=e.current)===null||r===void 0||r.focus(),(n=e.current)===null||n===void 0||n.select()},[]),y.jsx("input",{ref:e,defaultValue:t.data.name,onBlur:()=>t.reset(),onKeyDown:r=>{var n;r.key==="Escape"&&t.reset(),r.key==="Enter"&&t.submit(((n=e.current)===null||n===void 0?void 0:n.value)||"")}})}function Ce(t){return{type:"EDIT",id:t}}function Pn(t={id:null},e){return e.type==="EDIT"?Object.assign(Object.assign({},t),{id:e.id}):t}function V(t){return{type:"FOCUS",id:t}}function Rn(){return{type:"TREE_BLUR"}}function kn(t={id:null,treeFocused:!1},e){return e.type==="FOCUS"?Object.assign(Object.assign({},t),{id:e.id,treeFocused:!0}):e.type==="TREE_BLUR"?Object.assign(Object.assign({},t),{treeFocused:!1}):t}class ye{constructor(e){this.handleClick=r=>{r.metaKey&&!this.tree.props.disableMultiSelection?this.isSelected?this.deselect():this.selectMulti():r.shiftKey&&!this.tree.props.disableMultiSelection?this.selectContiguous():(this.select(),this.activate())},this.tree=e.tree,this.id=e.id,this.data=e.data,this.level=e.level,this.children=e.children,this.parent=e.parent,this.isDraggable=e.isDraggable,this.rowIndex=e.rowIndex}get isRoot(){return this.id===oe}get isLeaf(){return!Array.isArray(this.children)}get isInternal(){return!this.isLeaf}get isOpen(){return this.isLeaf?!1:this.tree.isOpen(this.id)}get isClosed(){return this.isLeaf?!1:!this.tree.isOpen(this.id)}get isEditable(){return this.tree.isEditable(this.data)}get isEditing(){return this.tree.editingId===this.id}get isSelected(){return this.tree.isSelected(this.id)}get isOnlySelection(){return this.isSelected&&this.tree.hasOneSelection}get isSelectedStart(){var e;return this.isSelected&&!(!((e=this.prev)===null||e===void 0)&&e.isSelected)}get isSelectedEnd(){var e;return this.isSelected&&!(!((e=this.next)===null||e===void 0)&&e.isSelected)}get isFocused(){return this.tree.isFocused(this.id)}get isDragging(){return this.tree.isDragging(this.id)}get willReceiveDrop(){return this.tree.willReceiveDrop(this.id)}get state(){return{isClosed:this.isClosed,isDragging:this.isDragging,isEditing:this.isEditing,isFocused:this.isFocused,isInternal:this.isInternal,isLeaf:this.isLeaf,isOpen:this.isOpen,isSelected:this.isSelected,isSelectedEnd:this.isSelectedEnd,isSelectedStart:this.isSelectedStart,willReceiveDrop:this.willReceiveDrop}}get childIndex(){return this.parent&&this.parent.children?this.parent.children.findIndex(e=>e.id===this.id):-1}get next(){return this.rowIndex===null?null:this.tree.at(this.rowIndex+1)}get prev(){return this.rowIndex===null?null:this.tree.at(this.rowIndex-1)}get nextSibling(){var e,r;const n=this.childIndex;return(r=(e=this.parent)===null||e===void 0?void 0:e.children[n+1])!==null&&r!==void 0?r:null}isAncestorOf(e){if(!e)return!1;let r=e;for(;r;){if(r.id===this.id)return!0;r=r.parent}return!1}select(){this.tree.select(this)}deselect(){this.tree.deselect(this)}selectMulti(){this.tree.selectMulti(this)}selectContiguous(){this.tree.selectContiguous(this)}activate(){this.tree.activate(this)}focus(){this.tree.focus(this)}toggle(){this.tree.toggle(this)}open(){this.tree.open(this)}openParents(){this.tree.openParents(this)}close(){this.tree.close(this)}submit(e){this.tree.submit(this,e)}reset(){this.tree.reset()}clone(){return new ye(Object.assign({},this))}edit(){return this.tree.edit(this)}}const oe="__REACT_ARBORIST_INTERNAL_ROOT__";function lt(t){var e;function r(o,a,s){const u=t.accessId(o),c=new ye({tree:t,data:o,level:a,parent:s,id:u,children:null,isDraggable:t.isDraggable(o),rowIndex:null}),d=t.accessChildren(o);return d&&(c.children=d.map(p=>r(p,a+1,c))),c}const n=new ye({tree:t,id:oe,data:{id:oe},level:-1,parent:null,children:null,isDraggable:!0,rowIndex:null}),i=(e=t.props.data)!==null&&e!==void 0?e:[];return n.children=i.map(o=>r(o,0,n)),n}const ze={open(t,e){return{type:"VISIBILITY_OPEN",id:t,filtered:e}},close(t,e){return{type:"VISIBILITY_CLOSE",id:t,filtered:e}},toggle(t,e){return{type:"VISIBILITY_TOGGLE",id:t,filtered:e}},clear(t){return{type:"VISIBILITY_CLEAR",filtered:t}}};function ct(t={},e){if(e.type==="VISIBILITY_OPEN")return Object.assign(Object.assign({},t),{[e.id]:!0});if(e.type==="VISIBILITY_CLOSE")return Object.assign(Object.assign({},t),{[e.id]:!1});if(e.type==="VISIBILITY_TOGGLE"){const r=t[e.id];return Object.assign(Object.assign({},t),{[e.id]:!r})}else return e.type==="VISIBILITY_CLEAR"?{}:t}function An(t={filtered:{},unfiltered:{}},e){return e.type.startsWith("VISIBILITY")?e.filtered?Object.assign(Object.assign({},t),{filtered:ct(t.filtered,e)}):Object.assign(Object.assign({},t),{unfiltered:ct(t.unfiltered,e)}):t}const Z=t=>{var e;return{nodes:{open:{filtered:{},unfiltered:(e=t==null?void 0:t.initialOpenState)!==null&&e!==void 0?e:{}},focus:{id:null,treeFocused:!1},edit:{id:null},drag:{id:null,selectedIds:[],destinationParentId:null,destinationIndex:null},selection:{ids:new Set,anchor:null,mostRecent:null}},dnd:{cursor:{type:"none"},dragId:null,dragIds:[],parentId:null,index:-1}}},L={clear:()=>({type:"SELECTION_CLEAR"}),only:t=>({type:"SELECTION_ONLY",id:z(t)}),add:t=>({type:"SELECTION_ADD",ids:(Array.isArray(t)?t:[t]).map(z)}),remove:t=>({type:"SELECTION_REMOVE",ids:(Array.isArray(t)?t:[t]).map(z)}),set:t=>Object.assign({type:"SELECTION_SET"},t),mostRecent:t=>({type:"SELECTION_MOST_RECENT",id:t===null?null:z(t)}),anchor:t=>({type:"SELECTION_ANCHOR",id:t===null?null:z(t)})};function Mn(t=Z().nodes.selection,e){const r=t.ids;switch(e.type){case"SELECTION_CLEAR":return Object.assign(Object.assign({},t),{ids:new Set});case"SELECTION_ONLY":return Object.assign(Object.assign({},t),{ids:new Set([e.id])});case"SELECTION_ADD":return e.ids.length===0?t:(e.ids.forEach(n=>r.add(n)),Object.assign(Object.assign({},t),{ids:new Set(r)}));case"SELECTION_REMOVE":return e.ids.length===0?t:(e.ids.forEach(n=>r.delete(n)),Object.assign(Object.assign({},t),{ids:new Set(r)}));case"SELECTION_SET":return Object.assign(Object.assign({},t),{ids:e.ids,mostRecent:e.mostRecent,anchor:e.anchor});case"SELECTION_MOST_RECENT":return Object.assign(Object.assign({},t),{mostRecent:e.id});case"SELECTION_ANCHOR":return Object.assign(Object.assign({},t),{anchor:e.id});default:return t}}const J={cursor(t){return{type:"DND_CURSOR",cursor:t}},dragStart(t,e){return{type:"DND_DRAG_START",id:t,dragIds:e}},dragEnd(){return{type:"DND_DRAG_END"}},hovering(t,e){return{type:"DND_HOVERING",parentId:t,index:e}}};function jn(t=Z().dnd,e){switch(e.type){case"DND_CURSOR":return Object.assign(Object.assign({},t),{cursor:e.cursor});case"DND_DRAG_START":return Object.assign(Object.assign({},t),{dragId:e.id,dragIds:e.dragIds});case"DND_DRAG_END":return Z().dnd;case"DND_HOVERING":return Object.assign(Object.assign({},t),{parentId:e.parentId,index:e.index});default:return t}}const Ln={position:"fixed",pointerEvents:"none",zIndex:100,left:0,top:0,width:"100%",height:"100%"},$n=t=>{if(!t)return{display:"none"};const{x:e,y:r}=t;return{transform:`translate(${e}px, ${r}px)`}},Hn=t=>{if(!t)return{display:"none"};const{x:e,y:r}=t;return{transform:`translate(${e+10}px, ${r+10}px)`}};function Dr({offset:t,mouse:e,id:r,dragIds:n,isDragging:i}){return y.jsxs(Fn,{isDragging:i,children:[y.jsx(Un,{offset:t,children:y.jsx(Bn,{id:r,dragIds:n})}),y.jsx(zn,{mouse:e,count:n.length})]})}const Fn=h.memo(function(e){return e.isDragging?y.jsx("div",{style:Ln,children:e.children}):null});function Un(t){return y.jsx("div",{className:"row preview",style:$n(t.offset),children:t.children})}function zn(t){const{count:e,mouse:r}=t;return e>1?y.jsx("div",{className:"selected-count",style:Hn(r),children:e}):null}const Bn=h.memo(function(e){const r=k(),n=r.get(e.id);return n?y.jsx(r.renderNode,{preview:!0,node:n,style:{paddingLeft:n.level*r.indent,opacity:.2,background:"transparent"},tree:r}):null});function Be(){return Be=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)({}).hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},Be.apply(null,arguments)}function dt(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function We(t,e){return We=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},We(t,e)}function Wn(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,We(t,e)}var ft=Number.isNaN||function(e){return typeof e=="number"&&e!==e};function qn(t,e){return!!(t===e||ft(t)&&ft(e))}function Vn(t,e){if(t.length!==e.length)return!1;for(var r=0;r<t.length;r++)if(!qn(t[r],e[r]))return!1;return!0}function Ee(t,e){e===void 0&&(e=Vn);var r,n=[],i,o=!1;function a(){for(var s=[],u=0;u<arguments.length;u++)s[u]=arguments[u];return o&&r===this&&e(s,n)||(i=t.apply(this,s),o=!0,r=this,n=s),i}return a}var Gn=typeof performance=="object"&&typeof performance.now=="function",ht=Gn?function(){return performance.now()}:function(){return Date.now()};function gt(t){cancelAnimationFrame(t.id)}function Kn(t,e){var r=ht();function n(){ht()-r>=e?t.call(null):i.id=requestAnimationFrame(n)}var i={id:requestAnimationFrame(n)};return i}var _e=-1;function pt(t){if(t===void 0&&(t=!1),_e===-1||t){var e=document.createElement("div"),r=e.style;r.width="50px",r.height="50px",r.overflow="scroll",document.body.appendChild(e),_e=e.offsetWidth-e.clientWidth,document.body.removeChild(e)}return _e}var G=null;function vt(t){if(t===void 0&&(t=!1),G===null||t){var e=document.createElement("div"),r=e.style;r.width="50px",r.height="50px",r.overflow="scroll",r.direction="rtl";var n=document.createElement("div"),i=n.style;return i.width="100px",i.height="100px",e.appendChild(n),document.body.appendChild(e),e.scrollLeft>0?G="positive-descending":(e.scrollLeft=1,e.scrollLeft===0?G="negative":G="positive-ascending"),document.body.removeChild(e),G}return G}var Yn=150,Xn=function(e,r){return e};function Qn(t){var e,r=t.getItemOffset,n=t.getEstimatedTotalSize,i=t.getItemSize,o=t.getOffsetForIndexAndAlignment,a=t.getStartIndexForOffset,s=t.getStopIndexForStartIndex,u=t.initInstanceProps,c=t.shouldResetStyleCacheOnItemSizeChange,d=t.validateProps;return e=(function(p){Wn(O,p);function O(I){var l;return l=p.call(this,I)||this,l._instanceProps=u(l.props,dt(l)),l._outerRef=void 0,l._resetIsScrollingTimeoutId=null,l.state={instance:dt(l),isScrolling:!1,scrollDirection:"forward",scrollOffset:typeof l.props.initialScrollOffset=="number"?l.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},l._callOnItemsRendered=void 0,l._callOnItemsRendered=Ee(function(f,g,v,S){return l.props.onItemsRendered({overscanStartIndex:f,overscanStopIndex:g,visibleStartIndex:v,visibleStopIndex:S})}),l._callOnScroll=void 0,l._callOnScroll=Ee(function(f,g,v){return l.props.onScroll({scrollDirection:f,scrollOffset:g,scrollUpdateWasRequested:v})}),l._getItemStyle=void 0,l._getItemStyle=function(f){var g=l.props,v=g.direction,S=g.itemSize,w=g.layout,T=l._getItemStyleCache(c&&S,c&&w,c&&v),E;if(T.hasOwnProperty(f))E=T[f];else{var b=r(l.props,f,l._instanceProps),_=i(l.props,f,l._instanceProps),x=v==="horizontal"||w==="horizontal",q=v==="rtl",U=x?b:0;T[f]=E={position:"absolute",left:q?void 0:U,right:q?U:void 0,top:x?0:b,height:x?"100%":_,width:x?_:"100%"}}return E},l._getItemStyleCache=void 0,l._getItemStyleCache=Ee(function(f,g,v){return{}}),l._onScrollHorizontal=function(f){var g=f.currentTarget,v=g.clientWidth,S=g.scrollLeft,w=g.scrollWidth;l.setState(function(T){if(T.scrollOffset===S)return null;var E=l.props.direction,b=S;if(E==="rtl")switch(vt()){case"negative":b=-S;break;case"positive-descending":b=w-v-S;break}return b=Math.max(0,Math.min(b,w-v)),{isScrolling:!0,scrollDirection:T.scrollOffset<b?"forward":"backward",scrollOffset:b,scrollUpdateWasRequested:!1}},l._resetIsScrollingDebounced)},l._onScrollVertical=function(f){var g=f.currentTarget,v=g.clientHeight,S=g.scrollHeight,w=g.scrollTop;l.setState(function(T){if(T.scrollOffset===w)return null;var E=Math.max(0,Math.min(w,S-v));return{isScrolling:!0,scrollDirection:T.scrollOffset<E?"forward":"backward",scrollOffset:E,scrollUpdateWasRequested:!1}},l._resetIsScrollingDebounced)},l._outerRefSetter=function(f){var g=l.props.outerRef;l._outerRef=f,typeof g=="function"?g(f):g!=null&&typeof g=="object"&&g.hasOwnProperty("current")&&(g.current=f)},l._resetIsScrollingDebounced=function(){l._resetIsScrollingTimeoutId!==null&>(l._resetIsScrollingTimeoutId),l._resetIsScrollingTimeoutId=Kn(l._resetIsScrolling,Yn)},l._resetIsScrolling=function(){l._resetIsScrollingTimeoutId=null,l.setState({isScrolling:!1},function(){l._getItemStyleCache(-1,null)})},l}O.getDerivedStateFromProps=function(l,f){return Zn(l,f),d(l),null};var m=O.prototype;return m.scrollTo=function(l){l=Math.max(0,l),this.setState(function(f){return f.scrollOffset===l?null:{scrollDirection:f.scrollOffset<l?"forward":"backward",scrollOffset:l,scrollUpdateWasRequested:!0}},this._resetIsScrollingDebounced)},m.scrollToItem=function(l,f){f===void 0&&(f="auto");var g=this.props,v=g.itemCount,S=g.layout,w=this.state.scrollOffset;l=Math.max(0,Math.min(l,v-1));var T=0;if(this._outerRef){var E=this._outerRef;S==="vertical"?T=E.scrollWidth>E.clientWidth?pt():0:T=E.scrollHeight>E.clientHeight?pt():0}this.scrollTo(o(this.props,l,f,w,this._instanceProps,T))},m.componentDidMount=function(){var l=this.props,f=l.direction,g=l.initialScrollOffset,v=l.layout;if(typeof g=="number"&&this._outerRef!=null){var S=this._outerRef;f==="horizontal"||v==="horizontal"?S.scrollLeft=g:S.scrollTop=g}this._callPropsCallbacks()},m.componentDidUpdate=function(){var l=this.props,f=l.direction,g=l.layout,v=this.state,S=v.scrollOffset,w=v.scrollUpdateWasRequested;if(w&&this._outerRef!=null){var T=this._outerRef;if(f==="horizontal"||g==="horizontal")if(f==="rtl")switch(vt()){case"negative":T.scrollLeft=-S;break;case"positive-ascending":T.scrollLeft=S;break;default:var E=T.clientWidth,b=T.scrollWidth;T.scrollLeft=b-E-S;break}else T.scrollLeft=S;else T.scrollTop=S}this._callPropsCallbacks()},m.componentWillUnmount=function(){this._resetIsScrollingTimeoutId!==null&>(this._resetIsScrollingTimeoutId)},m.render=function(){var l=this.props,f=l.children,g=l.className,v=l.direction,S=l.height,w=l.innerRef,T=l.innerElementType,E=l.innerTagName,b=l.itemCount,_=l.itemData,x=l.itemKey,q=x===void 0?Xn:x,U=l.layout,Jr=l.outerElementType,en=l.outerTagName,tn=l.style,rn=l.useIsScrolling,nn=l.width,ot=this.state.isScrolling,we=v==="horizontal"||U==="horizontal",on=we?this._onScrollHorizontal:this._onScrollVertical,at=this._getRangeToRender(),an=at[0],sn=at[1],st=[];if(b>0)for(var ee=an;ee<=sn;ee++)st.push(h.createElement(f,{data:_,key:q(ee,_),index:ee,isScrolling:rn?ot:void 0,style:this._getItemStyle(ee)}));var ut=n(this.props,this._instanceProps);return h.createElement(Jr||en||"div",{className:g,onScroll:on,ref:this._outerRefSetter,style:Be({position:"relative",height:S,width:nn,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:v},tn)},h.createElement(T||E||"div",{children:st,ref:w,style:{height:we?"100%":ut,pointerEvents:ot?"none":void 0,width:we?ut:"100%"}}))},m._callPropsCallbacks=function(){if(typeof this.props.onItemsRendered=="function"){var l=this.props.itemCount;if(l>0){var f=this._getRangeToRender(),g=f[0],v=f[1],S=f[2],w=f[3];this._callOnItemsRendered(g,v,S,w)}}if(typeof this.props.onScroll=="function"){var T=this.state,E=T.scrollDirection,b=T.scrollOffset,_=T.scrollUpdateWasRequested;this._callOnScroll(E,b,_)}},m._getRangeToRender=function(){var l=this.props,f=l.itemCount,g=l.overscanCount,v=this.state,S=v.isScrolling,w=v.scrollDirection,T=v.scrollOffset;if(f===0)return[0,0,0,0];var E=a(this.props,T,this._instanceProps),b=s(this.props,E,T,this._instanceProps),_=!S||w==="backward"?Math.max(1,g):1,x=!S||w==="forward"?Math.max(1,g):1;return[Math.max(0,E-_),Math.max(0,Math.min(f-1,b+x)),E,b]},O})(h.PureComponent),e.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},e}var Zn=function(e,r){e.children,e.direction,e.height,e.layout,e.innerTagName,e.outerTagName,e.width,r.instance},Jn=Qn({getItemOffset:function(e,r){var n=e.itemSize;return r*n},getItemSize:function(e,r){var n=e.itemSize;return n},getEstimatedTotalSize:function(e){var r=e.itemCount,n=e.itemSize;return n*r},getOffsetForIndexAndAlignment:function(e,r,n,i,o,a){var s=e.direction,u=e.height,c=e.itemCount,d=e.itemSize,p=e.layout,O=e.width,m=s==="horizontal"||p==="horizontal",I=m?O:u,l=Math.max(0,c*d-I),f=Math.min(l,r*d),g=Math.max(0,r*d-I+d+a);switch(n==="smart"&&(i>=g-I&&i<=f+I?n="auto":n="center"),n){case"start":return f;case"end":return g;case"center":{var v=Math.round(g+(f-g)/2);return v<Math.ceil(I/2)?0:v>l+Math.floor(I/2)?l:v}case"auto":default:return i>=g&&i<=f?i:i<g?g:f}},getStartIndexForOffset:function(e,r){var n=e.itemCount,i=e.itemSize;return Math.max(0,Math.min(n-1,Math.floor(r/i)))},getStopIndexForStartIndex:function(e,r,n){var i=e.direction,o=e.height,a=e.itemCount,s=e.itemSize,u=e.layout,c=e.width,d=i==="horizontal"||u==="horizontal",p=r*s,O=d?c:o,m=Math.ceil((O+n-p)/s);return Math.max(0,Math.min(a-1,r+m-1))},initInstanceProps:function(e){},shouldResetStyleCacheOnItemSizeChange:!0,validateProps:function(e){e.itemSize}});function ei(){var t,e;const r=k(),i=bn().cursor;if(!i||i.type!=="line")return null;const o=r.indent,a=r.rowHeight*i.index+((e=(t=r.props.padding)!==null&&t!==void 0?t:r.props.paddingTop)!==null&&e!==void 0?e:0),s=o*i.level,u=r.renderCursor;return y.jsx(u,{top:a,left:s,indent:o})}var ti=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r};const ri=h.forwardRef(function(e,r){const{children:n}=e,i=ti(e,["children"]),o=k();return y.jsxs("div",Object.assign({ref:r},i,{onClick:a=>{a.currentTarget===a.target&&o.deselectAll()},children:[y.jsx(ni,{}),n]}))}),ni=()=>{const t=k();return y.jsx("div",{style:{height:t.visibleNodes.length*t.rowHeight,width:"100%",position:"absolute",left:"0",right:"0"},children:y.jsx(ei,{})})};var ii=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r};const oi=h.forwardRef(function(e,r){var n,i,o,a,{style:s}=e,u=ii(e,["style"]);const c=k(),d=(i=(n=c.props.padding)!==null&&n!==void 0?n:c.props.paddingTop)!==null&&i!==void 0?i:0,p=(a=(o=c.props.padding)!==null&&o!==void 0?o:c.props.paddingBottom)!==null&&a!==void 0?a:0;return y.jsx("div",Object.assign({ref:r,style:Object.assign(Object.assign({},s),{height:`${parseFloat(s.height)+d+p}px`})},u))});var Tr=h.createContext({dragDropManager:void 0}),j;(function(t){t.SOURCE="SOURCE",t.TARGET="TARGET"})(j||(j={}));function D(t,e){for(var r=arguments.length,n=new Array(r>2?r-2:0),i=2;i<r;i++)n[i-2]=arguments[i];if(!t){var o;if(e===void 0)o=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var a=0;o=new Error(e.replace(/%s/g,function(){return n[a++]})),o.name="Invariant Violation"}throw o.framesToPop=1,o}}var Ze="dnd-core/INIT_COORDS",Oe="dnd-core/BEGIN_DRAG",Je="dnd-core/PUBLISH_DRAG_SOURCE",Se="dnd-core/HOVER",Ie="dnd-core/DROP",De="dnd-core/END_DRAG";function yt(t,e){return{type:Ze,payload:{sourceClientOffset:e||null,clientOffset:t||null}}}function de(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?de=function(r){return typeof r}:de=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},de(t)}function ai(t,e,r){return e.split(".").reduce(function(n,i){return n&&n[i]?n[i]:r||null},t)}function si(t,e){return t.filter(function(r){return r!==e})}function wr(t){return de(t)==="object"}function ui(t,e){var r=new Map,n=function(a){r.set(a,r.has(a)?r.get(a)+1:1)};t.forEach(n),e.forEach(n);var i=[];return r.forEach(function(o,a){o===1&&i.push(a)}),i}function li(t,e){return t.filter(function(r){return e.indexOf(r)>-1})}var ci={type:Ze,payload:{clientOffset:null,sourceClientOffset:null}};function di(t){return function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{publishSource:!0},i=n.publishSource,o=i===void 0?!0:i,a=n.clientOffset,s=n.getSourceClientOffset,u=t.getMonitor(),c=t.getRegistry();t.dispatch(yt(a)),fi(r,u,c);var d=pi(r,u);if(d===null){t.dispatch(ci);return}var p=null;if(a){if(!s)throw new Error("getSourceClientOffset must be defined");hi(s),p=s(d)}t.dispatch(yt(a,p));var O=c.getSource(d),m=O.beginDrag(u,d);if(m!=null){gi(m),c.pinSource(d);var I=c.getSourceType(d);return{type:Oe,payload:{itemType:I,item:m,sourceId:d,clientOffset:a||null,sourceClientOffset:p||null,isSourcePublic:!!o}}}}}function fi(t,e,r){D(!e.isDragging(),"Cannot call beginDrag while dragging."),t.forEach(function(n){D(r.getSource(n),"Expected sourceIds to be registered.")})}function hi(t){D(typeof t=="function","When clientOffset is provided, getSourceClientOffset must be a function.")}function gi(t){D(wr(t),"Item must be an object.")}function pi(t,e){for(var r=null,n=t.length-1;n>=0;n--)if(e.canDragSource(t[n])){r=t[n];break}return r}function vi(t){return function(){var r=t.getMonitor();if(r.isDragging())return{type:Je}}}function qe(t,e){return e===null?t===null:Array.isArray(t)?t.some(function(r){return r===e}):t===e}function yi(t){return function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=n.clientOffset;mi(r);var o=r.slice(0),a=t.getMonitor(),s=t.getRegistry();bi(o,a,s);var u=a.getItemType();return Oi(o,s,u),Si(o,a,s),{type:Se,payload:{targetIds:o,clientOffset:i||null}}}}function mi(t){D(Array.isArray(t),"Expected targetIds to be an array.")}function bi(t,e,r){D(e.isDragging(),"Cannot call hover while not dragging."),D(!e.didDrop(),"Cannot call hover after drop.");for(var n=0;n<t.length;n++){var i=t[n];D(t.lastIndexOf(i)===n,"Expected targetIds to be unique in the passed array.");var o=r.getTarget(i);D(o,"Expected targetIds to be registered.")}}function Oi(t,e,r){for(var n=t.length-1;n>=0;n--){var i=t[n],o=e.getTargetType(i);qe(o,r)||t.splice(n,1)}}function Si(t,e,r){t.forEach(function(n){var i=r.getTarget(n);i.hover(e,n)})}function mt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function bt(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?mt(Object(r),!0).forEach(function(n){Ii(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):mt(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Ii(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Di(t){return function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=t.getMonitor(),i=t.getRegistry();Ti(n);var o=Ei(n);o.forEach(function(a,s){var u=wi(a,s,i,n),c={type:Ie,payload:{dropResult:bt(bt({},r),u)}};t.dispatch(c)})}}function Ti(t){D(t.isDragging(),"Cannot call drop while not dragging."),D(!t.didDrop(),"Cannot call drop twice during one drag operation.")}function wi(t,e,r,n){var i=r.getTarget(t),o=i?i.drop(n,t):void 0;return Ci(o),typeof o>"u"&&(o=e===0?{}:n.getDropResult()),o}function Ci(t){D(typeof t>"u"||wr(t),"Drop result must either be an object or undefined.")}function Ei(t){var e=t.getTargetIds().filter(t.canDropOnTarget,t);return e.reverse(),e}function _i(t){return function(){var r=t.getMonitor(),n=t.getRegistry();xi(r);var i=r.getSourceId();if(i!=null){var o=n.getSource(i,!0);o.endDrag(r,i),n.unpinSource()}return{type:De}}}function xi(t){D(t.isDragging(),"Cannot call endDrag while not dragging.")}function Ni(t){return{beginDrag:di(t),publishDragSource:vi(t),hover:yi(t),drop:Di(t),endDrag:_i(t)}}function Pi(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ri(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function ki(t,e,r){return e&&Ri(t.prototype,e),t}function te(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Ai=(function(){function t(e,r){var n=this;Pi(this,t),te(this,"store",void 0),te(this,"monitor",void 0),te(this,"backend",void 0),te(this,"isSetUp",!1),te(this,"handleRefCountChange",function(){var i=n.store.getState().refCount>0;n.backend&&(i&&!n.isSetUp?(n.backend.setup(),n.isSetUp=!0):!i&&n.isSetUp&&(n.backend.teardown(),n.isSetUp=!1))}),this.store=e,this.monitor=r,e.subscribe(this.handleRefCountChange)}return ki(t,[{key:"receiveBackend",value:function(r){this.backend=r}},{key:"getMonitor",value:function(){return this.monitor}},{key:"getBackend",value:function(){return this.backend}},{key:"getRegistry",value:function(){return this.monitor.registry}},{key:"getActions",value:function(){var r=this,n=this.store.dispatch;function i(a){return function(){for(var s=arguments.length,u=new Array(s),c=0;c<s;c++)u[c]=arguments[c];var d=a.apply(r,u);typeof d<"u"&&n(d)}}var o=Ni(this);return Object.keys(o).reduce(function(a,s){var u=o[s];return a[s]=i(u),a},{})}},{key:"dispatch",value:function(r){this.store.dispatch(r)}}]),t})();function A(t){return"Minified Redux error #"+t+"; visit https://redux.js.org/Errors?code="+t+" for the full message or use the non-minified dev environment for full errors. "}var Ot=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})(),St=function(){return Math.random().toString(36).substring(7).split("").join(".")},It={INIT:"@@redux/INIT"+St(),REPLACE:"@@redux/REPLACE"+St()};function Mi(t){if(typeof t!="object"||t===null)return!1;for(var e=t;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function Cr(t,e,r){var n;if(typeof e=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(A(0));if(typeof e=="function"&&typeof r>"u"&&(r=e,e=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(A(1));return r(Cr)(t,e)}if(typeof t!="function")throw new Error(A(2));var i=t,o=e,a=[],s=a,u=!1;function c(){s===a&&(s=a.slice())}function d(){if(u)throw new Error(A(3));return o}function p(l){if(typeof l!="function")throw new Error(A(4));if(u)throw new Error(A(5));var f=!0;return c(),s.push(l),function(){if(f){if(u)throw new Error(A(6));f=!1,c();var v=s.indexOf(l);s.splice(v,1),a=null}}}function O(l){if(!Mi(l))throw new Error(A(7));if(typeof l.type>"u")throw new Error(A(8));if(u)throw new Error(A(9));try{u=!0,o=i(o,l)}finally{u=!1}for(var f=a=s,g=0;g<f.length;g++){var v=f[g];v()}return l}function m(l){if(typeof l!="function")throw new Error(A(10));i=l,O({type:It.REPLACE})}function I(){var l,f=p;return l={subscribe:function(v){if(typeof v!="object"||v===null)throw new Error(A(11));function S(){v.next&&v.next(d())}S();var w=f(S);return{unsubscribe:w}}},l[Ot]=function(){return this},l}return O({type:It.INIT}),n={dispatch:O,subscribe:p,getState:d,replaceReducer:m},n[Ot]=I,n}var ji=function(e,r){return e===r};function Li(t,e){return!t&&!e?!0:!t||!e?!1:t.x===e.x&&t.y===e.y}function $i(t,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ji;if(t.length!==e.length)return!1;for(var n=0;n<t.length;++n)if(!r(t[n],e[n]))return!1;return!0}function Dt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Tt(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Dt(Object(r),!0).forEach(function(n){Hi(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Dt(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Hi(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var wt={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};function Fi(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:wt,e=arguments.length>1?arguments[1]:void 0,r=e.payload;switch(e.type){case Ze:case Oe:return{initialSourceClientOffset:r.sourceClientOffset,initialClientOffset:r.clientOffset,clientOffset:r.clientOffset};case Se:return Li(t.clientOffset,r.clientOffset)?t:Tt(Tt({},t),{},{clientOffset:r.clientOffset});case De:case Ie:return wt;default:return t}}var et="dnd-core/ADD_SOURCE",tt="dnd-core/ADD_TARGET",rt="dnd-core/REMOVE_SOURCE",Te="dnd-core/REMOVE_TARGET";function Ui(t){return{type:et,payload:{sourceId:t}}}function zi(t){return{type:tt,payload:{targetId:t}}}function Bi(t){return{type:rt,payload:{sourceId:t}}}function Wi(t){return{type:Te,payload:{targetId:t}}}function Ct(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function M(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Ct(Object(r),!0).forEach(function(n){qi(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Ct(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function qi(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Vi={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};function Gi(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Vi,e=arguments.length>1?arguments[1]:void 0,r=e.payload;switch(e.type){case Oe:return M(M({},t),{},{itemType:r.itemType,item:r.item,sourceId:r.sourceId,isSourcePublic:r.isSourcePublic,dropResult:null,didDrop:!1});case Je:return M(M({},t),{},{isSourcePublic:!0});case Se:return M(M({},t),{},{targetIds:r.targetIds});case Te:return t.targetIds.indexOf(r.targetId)===-1?t:M(M({},t),{},{targetIds:si(t.targetIds,r.targetId)});case Ie:return M(M({},t),{},{dropResult:r.dropResult,didDrop:!0,targetIds:[]});case De:return M(M({},t),{},{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return t}}function Ki(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,e=arguments.length>1?arguments[1]:void 0;switch(e.type){case et:case tt:return t+1;case rt:case Te:return t-1;default:return t}}var me=[],nt=[];me.__IS_NONE__=!0;nt.__IS_ALL__=!0;function Yi(t,e){if(t===me)return!1;if(t===nt||typeof e>"u")return!0;var r=li(e,t);return r.length>0}function Xi(){var t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Se:break;case et:case tt:case Te:case rt:return me;case Oe:case Je:case De:case Ie:default:return nt}var e=t.payload,r=e.targetIds,n=r===void 0?[]:r,i=e.prevTargetIds,o=i===void 0?[]:i,a=ui(n,o),s=a.length>0||!$i(n,o);if(!s)return me;var u=o[o.length-1],c=n[n.length-1];return u!==c&&(u&&a.push(u),c&&a.push(c)),a}function Qi(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return t+1}function Et(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function _t(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Et(Object(r),!0).forEach(function(n){Zi(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Et(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Zi(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Ji(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0;return{dirtyHandlerIds:Xi(t.dirtyHandlerIds,{type:e.type,payload:_t(_t({},e.payload),{},{prevTargetIds:ai(t,"dragOperation.targetIds",[])})}),dragOffset:Fi(t.dragOffset,e),refCount:Ki(t.refCount,e),dragOperation:Gi(t.dragOperation,e),stateId:Qi(t.stateId)}}function eo(t,e){return{x:t.x+e.x,y:t.y+e.y}}function Er(t,e){return{x:t.x-e.x,y:t.y-e.y}}function to(t){var e=t.clientOffset,r=t.initialClientOffset,n=t.initialSourceClientOffset;return!e||!r||!n?null:Er(eo(e,n),r)}function ro(t){var e=t.clientOffset,r=t.initialClientOffset;return!e||!r?null:Er(e,r)}function no(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function io(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function oo(t,e,r){return e&&io(t.prototype,e),t}function xt(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var ao=(function(){function t(e,r){no(this,t),xt(this,"store",void 0),xt(this,"registry",void 0),this.store=e,this.registry=r}return oo(t,[{key:"subscribeToStateChange",value:function(r){var n=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{handlerIds:void 0},o=i.handlerIds;D(typeof r=="function","listener must be a function."),D(typeof o>"u"||Array.isArray(o),"handlerIds, when specified, must be an array of strings.");var a=this.store.getState().stateId,s=function(){var c=n.store.getState(),d=c.stateId;try{var p=d===a||d===a+1&&!Yi(c.dirtyHandlerIds,o);p||r()}finally{a=d}};return this.store.subscribe(s)}},{key:"subscribeToOffsetChange",value:function(r){var n=this;D(typeof r=="function","listener must be a function.");var i=this.store.getState().dragOffset,o=function(){var s=n.store.getState().dragOffset;s!==i&&(i=s,r())};return this.store.subscribe(o)}},{key:"canDragSource",value:function(r){if(!r)return!1;var n=this.registry.getSource(r);return D(n,"Expected to find a valid source. sourceId=".concat(r)),this.isDragging()?!1:n.canDrag(this,r)}},{key:"canDropOnTarget",value:function(r){if(!r)return!1;var n=this.registry.getTarget(r);if(D(n,"Expected to find a valid target. targetId=".concat(r)),!this.isDragging()||this.didDrop())return!1;var i=this.registry.getTargetType(r),o=this.getItemType();return qe(i,o)&&n.canDrop(this,r)}},{key:"isDragging",value:function(){return!!this.getItemType()}},{key:"isDraggingSource",value:function(r){if(!r)return!1;var n=this.registry.getSource(r,!0);if(D(n,"Expected to find a valid source. sourceId=".concat(r)),!this.isDragging()||!this.isSourcePublic())return!1;var i=this.registry.getSourceType(r),o=this.getItemType();return i!==o?!1:n.isDragging(this,r)}},{key:"isOverTarget",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{shallow:!1};if(!r)return!1;var i=n.shallow;if(!this.isDragging())return!1;var o=this.registry.getTargetType(r),a=this.getItemType();if(a&&!qe(o,a))return!1;var s=this.getTargetIds();if(!s.length)return!1;var u=s.indexOf(r);return i?u===s.length-1:u>-1}},{key:"getItemType",value:function(){return this.store.getState().dragOperation.itemType}},{key:"getItem",value:function(){return this.store.getState().dragOperation.item}},{key:"getSourceId",value:function(){return this.store.getState().dragOperation.sourceId}},{key:"getTargetIds",value:function(){return this.store.getState().dragOperation.targetIds}},{key:"getDropResult",value:function(){return this.store.getState().dragOperation.dropResult}},{key:"didDrop",value:function(){return this.store.getState().dragOperation.didDrop}},{key:"isSourcePublic",value:function(){return!!this.store.getState().dragOperation.isSourcePublic}},{key:"getInitialClientOffset",value:function(){return this.store.getState().dragOffset.initialClientOffset}},{key:"getInitialSourceClientOffset",value:function(){return this.store.getState().dragOffset.initialSourceClientOffset}},{key:"getClientOffset",value:function(){return this.store.getState().dragOffset.clientOffset}},{key:"getSourceClientOffset",value:function(){return to(this.store.getState().dragOffset)}},{key:"getDifferenceFromInitialOffset",value:function(){return ro(this.store.getState().dragOffset)}}]),t})(),so=0;function uo(){return so++}function fe(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?fe=function(r){return typeof r}:fe=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},fe(t)}function lo(t){D(typeof t.canDrag=="function","Expected canDrag to be a function."),D(typeof t.beginDrag=="function","Expected beginDrag to be a function."),D(typeof t.endDrag=="function","Expected endDrag to be a function.")}function co(t){D(typeof t.canDrop=="function","Expected canDrop to be a function."),D(typeof t.hover=="function","Expected hover to be a function."),D(typeof t.drop=="function","Expected beginDrag to be a function.")}function Ve(t,e){if(e&&Array.isArray(t)){t.forEach(function(r){return Ve(r,!1)});return}D(typeof t=="string"||fe(t)==="symbol",e?"Type can only be a string, a symbol, or an array of either.":"Type can only be a string or a symbol.")}const Nt=typeof global<"u"?global:self,_r=Nt.MutationObserver||Nt.WebKitMutationObserver;function xr(t){return function(){const r=setTimeout(i,0),n=setInterval(i,50);function i(){clearTimeout(r),clearInterval(n),t()}}}function fo(t){let e=1;const r=new _r(t),n=document.createTextNode("");return r.observe(n,{characterData:!0}),function(){e=-e,n.data=e}}const ho=typeof _r=="function"?fo:xr;class go{enqueueTask(e){const{queue:r,requestFlush:n}=this;r.length||(n(),this.flushing=!0),r[r.length]=e}constructor(){this.queue=[],this.pendingErrors=[],this.flushing=!1,this.index=0,this.capacity=1024,this.flush=()=>{const{queue:e}=this;for(;this.index<e.length;){const r=this.index;if(this.index++,e[r].call(),this.index>this.capacity){for(let n=0,i=e.length-this.index;n<i;n++)e[n]=e[n+this.index];e.length-=this.index,this.index=0}}e.length=0,this.index=0,this.flushing=!1},this.registerPendingError=e=>{this.pendingErrors.push(e),this.requestErrorThrow()},this.requestFlush=ho(this.flush),this.requestErrorThrow=xr(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}}class po{call(){try{this.task&&this.task()}catch(e){this.onError(e)}finally{this.task=null,this.release(this)}}constructor(e,r){this.onError=e,this.release=r,this.task=null}}class vo{create(e){const r=this.freeTasks,n=r.length?r.pop():new po(this.onError,i=>r[r.length]=i);return n.task=e,n}constructor(e){this.onError=e,this.freeTasks=[]}}const Nr=new go,yo=new vo(Nr.registerPendingError);function mo(t){Nr.enqueueTask(yo.create(t))}function bo(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Oo(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function So(t,e,r){return e&&Oo(t.prototype,e),t}function K(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Io(t,e){return Co(t)||wo(t,e)||To(t,e)||Do()}function Do(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
12
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function To(t,e){if(t){if(typeof t=="string")return Pt(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Pt(t,e)}}function Pt(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function wo(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n=[],i=!0,o=!1,a,s;try{for(r=r.call(t);!(i=(a=r.next()).done)&&(n.push(a.value),!(e&&n.length===e));i=!0);}catch(u){o=!0,s=u}finally{try{!i&&r.return!=null&&r.return()}finally{if(o)throw s}}return n}}function Co(t){if(Array.isArray(t))return t}function Eo(t){var e=uo().toString();switch(t){case j.SOURCE:return"S".concat(e);case j.TARGET:return"T".concat(e);default:throw new Error("Unknown Handler Role: ".concat(t))}}function Rt(t){switch(t[0]){case"S":return j.SOURCE;case"T":return j.TARGET;default:D(!1,"Cannot parse handler ID: ".concat(t))}}function kt(t,e){var r=t.entries(),n=!1;do{var i=r.next(),o=i.done,a=Io(i.value,2),s=a[1];if(s===e)return!0;n=!!o}while(!n);return!1}var _o=(function(){function t(e){bo(this,t),K(this,"types",new Map),K(this,"dragSources",new Map),K(this,"dropTargets",new Map),K(this,"pinnedSourceId",null),K(this,"pinnedSource",null),K(this,"store",void 0),this.store=e}return So(t,[{key:"addSource",value:function(r,n){Ve(r),lo(n);var i=this.addHandler(j.SOURCE,r,n);return this.store.dispatch(Ui(i)),i}},{key:"addTarget",value:function(r,n){Ve(r,!0),co(n);var i=this.addHandler(j.TARGET,r,n);return this.store.dispatch(zi(i)),i}},{key:"containsHandler",value:function(r){return kt(this.dragSources,r)||kt(this.dropTargets,r)}},{key:"getSource",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;D(this.isSourceId(r),"Expected a valid source ID.");var i=n&&r===this.pinnedSourceId,o=i?this.pinnedSource:this.dragSources.get(r);return o}},{key:"getTarget",value:function(r){return D(this.isTargetId(r),"Expected a valid target ID."),this.dropTargets.get(r)}},{key:"getSourceType",value:function(r){return D(this.isSourceId(r),"Expected a valid source ID."),this.types.get(r)}},{key:"getTargetType",value:function(r){return D(this.isTargetId(r),"Expected a valid target ID."),this.types.get(r)}},{key:"isSourceId",value:function(r){var n=Rt(r);return n===j.SOURCE}},{key:"isTargetId",value:function(r){var n=Rt(r);return n===j.TARGET}},{key:"removeSource",value:function(r){var n=this;D(this.getSource(r),"Expected an existing source."),this.store.dispatch(Bi(r)),mo(function(){n.dragSources.delete(r),n.types.delete(r)})}},{key:"removeTarget",value:function(r){D(this.getTarget(r),"Expected an existing target."),this.store.dispatch(Wi(r)),this.dropTargets.delete(r),this.types.delete(r)}},{key:"pinSource",value:function(r){var n=this.getSource(r);D(n,"Expected an existing source."),this.pinnedSourceId=r,this.pinnedSource=n}},{key:"unpinSource",value:function(){D(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}},{key:"addHandler",value:function(r,n,i){var o=Eo(r);return this.types.set(o,n),r===j.SOURCE?this.dragSources.set(o,i):r===j.TARGET&&this.dropTargets.set(o,i),o}}]),t})();function Pr(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,i=xo(n),o=new ao(i,new _o(i)),a=new Ai(i,o),s=t(a,e,r);return a.receiveBackend(s),a}function xo(t){var e=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__;return Cr(Ji,t&&e&&e({name:"dnd-core",instanceId:"dnd-core"}))}var No=["children"];function Po(t,e){return Mo(t)||Ao(t,e)||ko(t,e)||Ro()}function Ro(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
13
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ko(t,e){if(t){if(typeof t=="string")return At(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return At(t,e)}}function At(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Ao(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n=[],i=!0,o=!1,a,s;try{for(r=r.call(t);!(i=(a=r.next()).done)&&(n.push(a.value),!(e&&n.length===e));i=!0);}catch(u){o=!0,s=u}finally{try{!i&&r.return!=null&&r.return()}finally{if(o)throw s}}return n}}function Mo(t){if(Array.isArray(t))return t}function jo(t,e){if(t==null)return{};var r=Lo(t,e),n,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i<o.length;i++)n=o[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function Lo(t,e){if(t==null)return{};var r={},n=Object.keys(t),i,o;for(o=0;o<n.length;o++)i=n[o],!(e.indexOf(i)>=0)&&(r[i]=t[i]);return r}var Mt=0,he=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__"),$o=h.memo(function(e){var r=e.children,n=jo(e,No),i=Ho(n),o=Po(i,2),a=o[0],s=o[1];return h.useEffect(function(){if(s){var u=Rr();return++Mt,function(){--Mt===0&&(u[he]=null)}}},[]),y.jsx(Tr.Provider,Object.assign({value:a},{children:r}),void 0)});function Ho(t){if("manager"in t){var e={dragDropManager:t.manager};return[e,!1]}var r=Fo(t.backend,t.context,t.options,t.debugMode),n=!t.context;return[r,n]}function Fo(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Rr(),r=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0,i=e;return i[he]||(i[he]={dragDropManager:Pr(t,e,r,n)}),i[he]}function Rr(){return typeof global<"u"?global:window}function Uo(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function zo(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Bo(t,e,r){return e&&zo(t.prototype,e),t}function jt(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var xe=!1,Ne=!1,Wo=(function(){function t(e){Uo(this,t),jt(this,"internalMonitor",void 0),jt(this,"sourceId",null),this.internalMonitor=e.getMonitor()}return Bo(t,[{key:"receiveHandlerId",value:function(r){this.sourceId=r}},{key:"getHandlerId",value:function(){return this.sourceId}},{key:"canDrag",value:function(){D(!xe,"You may not call monitor.canDrag() inside your canDrag() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return xe=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{xe=!1}}},{key:"isDragging",value:function(){if(!this.sourceId)return!1;D(!Ne,"You may not call monitor.isDragging() inside your isDragging() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return Ne=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{Ne=!1}}},{key:"subscribeToStateChange",value:function(r,n){return this.internalMonitor.subscribeToStateChange(r,n)}},{key:"isDraggingSource",value:function(r){return this.internalMonitor.isDraggingSource(r)}},{key:"isOverTarget",value:function(r,n){return this.internalMonitor.isOverTarget(r,n)}},{key:"getTargetIds",value:function(){return this.internalMonitor.getTargetIds()}},{key:"isSourcePublic",value:function(){return this.internalMonitor.isSourcePublic()}},{key:"getSourceId",value:function(){return this.internalMonitor.getSourceId()}},{key:"subscribeToOffsetChange",value:function(r){return this.internalMonitor.subscribeToOffsetChange(r)}},{key:"canDragSource",value:function(r){return this.internalMonitor.canDragSource(r)}},{key:"canDropOnTarget",value:function(r){return this.internalMonitor.canDropOnTarget(r)}},{key:"getItemType",value:function(){return this.internalMonitor.getItemType()}},{key:"getItem",value:function(){return this.internalMonitor.getItem()}},{key:"getDropResult",value:function(){return this.internalMonitor.getDropResult()}},{key:"didDrop",value:function(){return this.internalMonitor.didDrop()}},{key:"getInitialClientOffset",value:function(){return this.internalMonitor.getInitialClientOffset()}},{key:"getInitialSourceClientOffset",value:function(){return this.internalMonitor.getInitialSourceClientOffset()}},{key:"getSourceClientOffset",value:function(){return this.internalMonitor.getSourceClientOffset()}},{key:"getClientOffset",value:function(){return this.internalMonitor.getClientOffset()}},{key:"getDifferenceFromInitialOffset",value:function(){return this.internalMonitor.getDifferenceFromInitialOffset()}}]),t})();function qo(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Vo(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Go(t,e,r){return e&&Vo(t.prototype,e),t}function Lt(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Pe=!1,Ko=(function(){function t(e){qo(this,t),Lt(this,"internalMonitor",void 0),Lt(this,"targetId",null),this.internalMonitor=e.getMonitor()}return Go(t,[{key:"receiveHandlerId",value:function(r){this.targetId=r}},{key:"getHandlerId",value:function(){return this.targetId}},{key:"subscribeToStateChange",value:function(r,n){return this.internalMonitor.subscribeToStateChange(r,n)}},{key:"canDrop",value:function(){if(!this.targetId)return!1;D(!Pe,"You may not call monitor.canDrop() inside your canDrop() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target-monitor");try{return Pe=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{Pe=!1}}},{key:"isOver",value:function(r){return this.targetId?this.internalMonitor.isOverTarget(this.targetId,r):!1}},{key:"getItemType",value:function(){return this.internalMonitor.getItemType()}},{key:"getItem",value:function(){return this.internalMonitor.getItem()}},{key:"getDropResult",value:function(){return this.internalMonitor.getDropResult()}},{key:"didDrop",value:function(){return this.internalMonitor.didDrop()}},{key:"getInitialClientOffset",value:function(){return this.internalMonitor.getInitialClientOffset()}},{key:"getInitialSourceClientOffset",value:function(){return this.internalMonitor.getInitialSourceClientOffset()}},{key:"getSourceClientOffset",value:function(){return this.internalMonitor.getSourceClientOffset()}},{key:"getClientOffset",value:function(){return this.internalMonitor.getClientOffset()}},{key:"getDifferenceFromInitialOffset",value:function(){return this.internalMonitor.getDifferenceFromInitialOffset()}}]),t})();function Yo(t){if(typeof t.type!="string"){var e=t.type.displayName||t.type.name||"the component";throw new Error("Only native element nodes can now be passed to React DnD connectors."+"You can either wrap ".concat(e," into a <div>, or turn it into a ")+"drag source or a drop target itself.")}}function Xo(t){return function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(!h.isValidElement(e)){var n=e;return t(n,r),n}var i=e;Yo(i);var o=r?function(a){return t(a,r)}:t;return Qo(i,o)}}function kr(t){var e={};return Object.keys(t).forEach(function(r){var n=t[r];if(r.endsWith("Ref"))e[r]=t[r];else{var i=Xo(n);e[r]=function(){return i}}}),e}function $t(t,e){typeof t=="function"?t(e):t.current=e}function Qo(t,e){var r=t.ref;return D(typeof r!="string","Cannot connect React DnD to an element with an existing string ref. Please convert it to use a callback ref instead, or wrap it into a <span> or <div>. Read more: https://reactjs.org/docs/refs-and-the-dom.html#callback-refs"),r?h.cloneElement(t,{ref:function(i){$t(r,i),$t(e,i)}}):h.cloneElement(t,{ref:e})}function ge(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?ge=function(r){return typeof r}:ge=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},ge(t)}function Ge(t){return t!==null&&ge(t)==="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function Ke(t,e,r,n){var i=void 0;if(i!==void 0)return!!i;if(t===e)return!0;if(typeof t!="object"||!t||typeof e!="object"||!e)return!1;var o=Object.keys(t),a=Object.keys(e);if(o.length!==a.length)return!1;for(var s=Object.prototype.hasOwnProperty.bind(e),u=0;u<o.length;u++){var c=o[u];if(!s(c))return!1;var d=t[c],p=e[c];if(i=void 0,i===!1||i===void 0&&d!==p)return!1}return!0}function Zo(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Jo(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function ea(t,e,r){return e&&Jo(t.prototype,e),t}function P(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var ta=(function(){function t(e){var r=this;Zo(this,t),P(this,"hooks",kr({dragSource:function(i,o){r.clearDragSource(),r.dragSourceOptions=o||null,Ge(i)?r.dragSourceRef=i:r.dragSourceNode=i,r.reconnectDragSource()},dragPreview:function(i,o){r.clearDragPreview(),r.dragPreviewOptions=o||null,Ge(i)?r.dragPreviewRef=i:r.dragPreviewNode=i,r.reconnectDragPreview()}})),P(this,"handlerId",null),P(this,"dragSourceRef",null),P(this,"dragSourceNode",void 0),P(this,"dragSourceOptionsInternal",null),P(this,"dragSourceUnsubscribe",void 0),P(this,"dragPreviewRef",null),P(this,"dragPreviewNode",void 0),P(this,"dragPreviewOptionsInternal",null),P(this,"dragPreviewUnsubscribe",void 0),P(this,"lastConnectedHandlerId",null),P(this,"lastConnectedDragSource",null),P(this,"lastConnectedDragSourceOptions",null),P(this,"lastConnectedDragPreview",null),P(this,"lastConnectedDragPreviewOptions",null),P(this,"backend",void 0),this.backend=e}return ea(t,[{key:"receiveHandlerId",value:function(r){this.handlerId!==r&&(this.handlerId=r,this.reconnect())}},{key:"connectTarget",get:function(){return this.dragSource}},{key:"dragSourceOptions",get:function(){return this.dragSourceOptionsInternal},set:function(r){this.dragSourceOptionsInternal=r}},{key:"dragPreviewOptions",get:function(){return this.dragPreviewOptionsInternal},set:function(r){this.dragPreviewOptionsInternal=r}},{key:"reconnect",value:function(){this.reconnectDragSource(),this.reconnectDragPreview()}},{key:"reconnectDragSource",value:function(){var r=this.dragSource,n=this.didHandlerIdChange()||this.didConnectedDragSourceChange()||this.didDragSourceOptionsChange();if(n&&this.disconnectDragSource(),!!this.handlerId){if(!r){this.lastConnectedDragSource=r;return}n&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragSource=r,this.lastConnectedDragSourceOptions=this.dragSourceOptions,this.dragSourceUnsubscribe=this.backend.connectDragSource(this.handlerId,r,this.dragSourceOptions))}}},{key:"reconnectDragPreview",value:function(){var r=this.dragPreview,n=this.didHandlerIdChange()||this.didConnectedDragPreviewChange()||this.didDragPreviewOptionsChange();if(n&&this.disconnectDragPreview(),!!this.handlerId){if(!r){this.lastConnectedDragPreview=r;return}n&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragPreview=r,this.lastConnectedDragPreviewOptions=this.dragPreviewOptions,this.dragPreviewUnsubscribe=this.backend.connectDragPreview(this.handlerId,r,this.dragPreviewOptions))}}},{key:"didHandlerIdChange",value:function(){return this.lastConnectedHandlerId!==this.handlerId}},{key:"didConnectedDragSourceChange",value:function(){return this.lastConnectedDragSource!==this.dragSource}},{key:"didConnectedDragPreviewChange",value:function(){return this.lastConnectedDragPreview!==this.dragPreview}},{key:"didDragSourceOptionsChange",value:function(){return!Ke(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}},{key:"didDragPreviewOptionsChange",value:function(){return!Ke(this.lastConnectedDragPreviewOptions,this.dragPreviewOptions)}},{key:"disconnectDragSource",value:function(){this.dragSourceUnsubscribe&&(this.dragSourceUnsubscribe(),this.dragSourceUnsubscribe=void 0)}},{key:"disconnectDragPreview",value:function(){this.dragPreviewUnsubscribe&&(this.dragPreviewUnsubscribe(),this.dragPreviewUnsubscribe=void 0,this.dragPreviewNode=null,this.dragPreviewRef=null)}},{key:"dragSource",get:function(){return this.dragSourceNode||this.dragSourceRef&&this.dragSourceRef.current}},{key:"dragPreview",get:function(){return this.dragPreviewNode||this.dragPreviewRef&&this.dragPreviewRef.current}},{key:"clearDragSource",value:function(){this.dragSourceNode=null,this.dragSourceRef=null}},{key:"clearDragPreview",value:function(){this.dragPreviewNode=null,this.dragPreviewRef=null}}]),t})();function ra(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function na(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function ia(t,e,r){return e&&na(t.prototype,e),t}function H(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var oa=(function(){function t(e){var r=this;ra(this,t),H(this,"hooks",kr({dropTarget:function(i,o){r.clearDropTarget(),r.dropTargetOptions=o,Ge(i)?r.dropTargetRef=i:r.dropTargetNode=i,r.reconnect()}})),H(this,"handlerId",null),H(this,"dropTargetRef",null),H(this,"dropTargetNode",void 0),H(this,"dropTargetOptionsInternal",null),H(this,"unsubscribeDropTarget",void 0),H(this,"lastConnectedHandlerId",null),H(this,"lastConnectedDropTarget",null),H(this,"lastConnectedDropTargetOptions",null),H(this,"backend",void 0),this.backend=e}return ia(t,[{key:"connectTarget",get:function(){return this.dropTarget}},{key:"reconnect",value:function(){var r=this.didHandlerIdChange()||this.didDropTargetChange()||this.didOptionsChange();r&&this.disconnectDropTarget();var n=this.dropTarget;if(this.handlerId){if(!n){this.lastConnectedDropTarget=n;return}r&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDropTarget=n,this.lastConnectedDropTargetOptions=this.dropTargetOptions,this.unsubscribeDropTarget=this.backend.connectDropTarget(this.handlerId,n,this.dropTargetOptions))}}},{key:"receiveHandlerId",value:function(r){r!==this.handlerId&&(this.handlerId=r,this.reconnect())}},{key:"dropTargetOptions",get:function(){return this.dropTargetOptionsInternal},set:function(r){this.dropTargetOptionsInternal=r}},{key:"didHandlerIdChange",value:function(){return this.lastConnectedHandlerId!==this.handlerId}},{key:"didDropTargetChange",value:function(){return this.lastConnectedDropTarget!==this.dropTarget}},{key:"didOptionsChange",value:function(){return!Ke(this.lastConnectedDropTargetOptions,this.dropTargetOptions)}},{key:"disconnectDropTarget",value:function(){this.unsubscribeDropTarget&&(this.unsubscribeDropTarget(),this.unsubscribeDropTarget=void 0)}},{key:"dropTarget",get:function(){return this.dropTargetNode||this.dropTargetRef&&this.dropTargetRef.current}},{key:"clearDropTarget",value:function(){this.dropTargetRef=null,this.dropTargetNode=null}}]),t})();function aa(t,e,r){var n=r.getRegistry(),i=n.addTarget(t,e);return[i,function(){return n.removeTarget(i)}]}function sa(t,e,r){var n=r.getRegistry(),i=n.addSource(t,e);return[i,function(){return n.removeSource(i)}]}var B=typeof window<"u"?h.useLayoutEffect:h.useEffect;function pe(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?pe=function(r){return typeof r}:pe=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},pe(t)}function ua(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function la(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function ca(t,e,r){return e&&la(t.prototype,e),t}function Re(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var da=(function(){function t(e,r,n){ua(this,t),Re(this,"spec",void 0),Re(this,"monitor",void 0),Re(this,"connector",void 0),this.spec=e,this.monitor=r,this.connector=n}return ca(t,[{key:"beginDrag",value:function(){var r,n=this.spec,i=this.monitor,o=null;return pe(n.item)==="object"?o=n.item:typeof n.item=="function"?o=n.item(i):o={},(r=o)!==null&&r!==void 0?r:null}},{key:"canDrag",value:function(){var r=this.spec,n=this.monitor;return typeof r.canDrag=="boolean"?r.canDrag:typeof r.canDrag=="function"?r.canDrag(n):!0}},{key:"isDragging",value:function(r,n){var i=this.spec,o=this.monitor,a=i.isDragging;return a?a(o):n===r.getSourceId()}},{key:"endDrag",value:function(){var r=this.spec,n=this.monitor,i=this.connector,o=r.end;o&&o(n.getItem(),n),i.reconnect()}}]),t})();function fa(t,e,r){var n=h.useMemo(function(){return new da(t,e,r)},[e,r]);return h.useEffect(function(){n.spec=t},[t]),n}function W(){var t=h.useContext(Tr),e=t.dragDropManager;return D(e!=null,"Expected drag drop context"),e}function ha(t){return h.useMemo(function(){var e=t.type;return D(e!=null,"spec.type must be defined"),e},[t])}function ga(t,e){return ma(t)||ya(t,e)||va(t,e)||pa()}function pa(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
14
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function va(t,e){if(t){if(typeof t=="string")return Ht(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ht(t,e)}}function Ht(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function ya(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n=[],i=!0,o=!1,a,s;try{for(r=r.call(t);!(i=(a=r.next()).done)&&(n.push(a.value),!(e&&n.length===e));i=!0);}catch(u){o=!0,s=u}finally{try{!i&&r.return!=null&&r.return()}finally{if(o)throw s}}return n}}function ma(t){if(Array.isArray(t))return t}function ba(t,e,r){var n=W(),i=fa(t,e,r),o=ha(t);B(function(){if(o!=null){var s=sa(o,i,n),u=ga(s,2),c=u[0],d=u[1];return e.receiveHandlerId(c),r.receiveHandlerId(c),d}},[n,e,r,i,o])}function Oa(t){return Ta(t)||Da(t)||Ia(t)||Sa()}function Sa(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
15
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ia(t,e){if(t){if(typeof t=="string")return Ye(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ye(t,e)}}function Da(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function Ta(t){if(Array.isArray(t))return Ye(t)}function Ye(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Ar(t,e){var r=Oa(e||[]);return e==null&&typeof t!="function"&&r.push(t),h.useMemo(function(){return typeof t=="function"?t():t},r)}function wa(){var t=W();return h.useMemo(function(){return new Wo(t)},[t])}function Ca(t,e){var r=W(),n=h.useMemo(function(){return new ta(r.getBackend())},[r]);return B(function(){return n.dragSourceOptions=t||null,n.reconnect(),function(){return n.disconnectDragSource()}},[n,t]),B(function(){return n.dragPreviewOptions=e||null,n.reconnect(),function(){return n.disconnectDragPreview()}},[n,e]),n}var ke,Ft;function Ea(){return Ft||(Ft=1,ke=function t(e,r){if(e===r)return!0;if(e&&r&&typeof e=="object"&&typeof r=="object"){if(e.constructor!==r.constructor)return!1;var n,i,o;if(Array.isArray(e)){if(n=e.length,n!=r.length)return!1;for(i=n;i--!==0;)if(!t(e[i],r[i]))return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();if(o=Object.keys(e),n=o.length,n!==Object.keys(r).length)return!1;for(i=n;i--!==0;)if(!Object.prototype.hasOwnProperty.call(r,o[i]))return!1;for(i=n;i--!==0;){var a=o[i];if(!t(e[a],r[a]))return!1}return!0}return e!==e&&r!==r}),ke}var _a=Ea();const xa=un(_a);function Na(t,e){return Aa(t)||ka(t,e)||Ra(t,e)||Pa()}function Pa(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
16
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ra(t,e){if(t){if(typeof t=="string")return Ut(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ut(t,e)}}function Ut(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function ka(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n=[],i=!0,o=!1,a,s;try{for(r=r.call(t);!(i=(a=r.next()).done)&&(n.push(a.value),!(e&&n.length===e));i=!0);}catch(u){o=!0,s=u}finally{try{!i&&r.return!=null&&r.return()}finally{if(o)throw s}}return n}}function Aa(t){if(Array.isArray(t))return t}function Mr(t,e,r){var n=h.useState(function(){return e(t)}),i=Na(n,2),o=i[0],a=i[1],s=h.useCallback(function(){var u=e(t);xa(o,u)||(a(u),r&&r())},[o,t,r]);return B(s),[o,s]}function Ma(t,e){return Ha(t)||$a(t,e)||La(t,e)||ja()}function ja(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
17
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function La(t,e){if(t){if(typeof t=="string")return zt(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return zt(t,e)}}function zt(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function $a(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n=[],i=!0,o=!1,a,s;try{for(r=r.call(t);!(i=(a=r.next()).done)&&(n.push(a.value),!(e&&n.length===e));i=!0);}catch(u){o=!0,s=u}finally{try{!i&&r.return!=null&&r.return()}finally{if(o)throw s}}return n}}function Ha(t){if(Array.isArray(t))return t}function Fa(t,e,r){var n=Mr(t,e,r),i=Ma(n,2),o=i[0],a=i[1];return B(function(){var u=t.getHandlerId();if(u!=null)return t.subscribeToStateChange(a,{handlerIds:[u]})},[t,a]),o}function jr(t,e,r){return Fa(e,t||function(){return{}},function(){return r.reconnect()})}function Ua(t){return h.useMemo(function(){return t.hooks.dragSource()},[t])}function za(t){return h.useMemo(function(){return t.hooks.dragPreview()},[t])}function Ba(t,e){var r=Ar(t,e);D(!r.begin,"useDrag::spec.begin was deprecated in v14. Replace spec.begin() with spec.item(). (see more here - https://react-dnd.github.io/react-dnd/docs/api/use-drag)");var n=wa(),i=Ca(r.options,r.previewOptions);return ba(r,n,i),[jr(r.collect,n,i),Ua(i),za(i)]}function Wa(t){var e=t.accept;return h.useMemo(function(){return D(t.accept!=null,"accept must be defined"),Array.isArray(e)?e:[e]},[e])}function qa(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Va(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Ga(t,e,r){return e&&Va(t.prototype,e),t}function Bt(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Ka=(function(){function t(e,r){qa(this,t),Bt(this,"spec",void 0),Bt(this,"monitor",void 0),this.spec=e,this.monitor=r}return Ga(t,[{key:"canDrop",value:function(){var r=this.spec,n=this.monitor;return r.canDrop?r.canDrop(n.getItem(),n):!0}},{key:"hover",value:function(){var r=this.spec,n=this.monitor;r.hover&&r.hover(n.getItem(),n)}},{key:"drop",value:function(){var r=this.spec,n=this.monitor;if(r.drop)return r.drop(n.getItem(),n)}}]),t})();function Ya(t,e){var r=h.useMemo(function(){return new Ka(t,e)},[e]);return h.useEffect(function(){r.spec=t},[t]),r}function Xa(t,e){return es(t)||Ja(t,e)||Za(t,e)||Qa()}function Qa(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
18
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Za(t,e){if(t){if(typeof t=="string")return Wt(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Wt(t,e)}}function Wt(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Ja(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n=[],i=!0,o=!1,a,s;try{for(r=r.call(t);!(i=(a=r.next()).done)&&(n.push(a.value),!(e&&n.length===e));i=!0);}catch(u){o=!0,s=u}finally{try{!i&&r.return!=null&&r.return()}finally{if(o)throw s}}return n}}function es(t){if(Array.isArray(t))return t}function ts(t,e,r){var n=W(),i=Ya(t,e),o=Wa(t);B(function(){var s=aa(o,i,n),u=Xa(s,2),c=u[0],d=u[1];return e.receiveHandlerId(c),r.receiveHandlerId(c),d},[n,e,i,r,o.map(function(a){return a.toString()}).join("|")])}function rs(){var t=W();return h.useMemo(function(){return new Ko(t)},[t])}function ns(t){var e=W(),r=h.useMemo(function(){return new oa(e.getBackend())},[e]);return B(function(){return r.dropTargetOptions=t||null,r.reconnect(),function(){return r.disconnectDropTarget()}},[t]),r}function is(t){return h.useMemo(function(){return t.hooks.dropTarget()},[t])}function Lr(t,e){var r=Ar(t,e),n=rs(),i=ns(r.options);return ts(r,n,i),[jr(r.collect,n,i),is(i)]}function os(t,e){return ls(t)||us(t,e)||ss(t,e)||as()}function as(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
19
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ss(t,e){if(t){if(typeof t=="string")return qt(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return qt(t,e)}}function qt(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function us(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n=[],i=!0,o=!1,a,s;try{for(r=r.call(t);!(i=(a=r.next()).done)&&(n.push(a.value),!(e&&n.length===e));i=!0);}catch(u){o=!0,s=u}finally{try{!i&&r.return!=null&&r.return()}finally{if(o)throw s}}return n}}function ls(t){if(Array.isArray(t))return t}function cs(t){var e=W(),r=e.getMonitor(),n=Mr(r,t),i=os(n,2),o=i[0],a=i[1];return h.useEffect(function(){return r.subscribeToOffsetChange(a)}),h.useEffect(function(){return r.subscribeToStateChange(a)}),o}function $r(t){var e=null,r=function(){return e==null&&(e=t()),e};return r}function ds(t,e){return t.filter(function(r){return r!==e})}function fs(t,e){var r=new Set,n=function(a){return r.add(a)};t.forEach(n),e.forEach(n);var i=[];return r.forEach(function(o){return i.push(o)}),i}function hs(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function gs(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function ps(t,e,r){return e&&gs(t.prototype,e),t}function Vt(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var vs=(function(){function t(e){hs(this,t),Vt(this,"entered",[]),Vt(this,"isNodeInDocument",void 0),this.isNodeInDocument=e}return ps(t,[{key:"enter",value:function(r){var n=this,i=this.entered.length,o=function(s){return n.isNodeInDocument(s)&&(!s.contains||s.contains(r))};return this.entered=fs(this.entered.filter(o),[r]),i===0&&this.entered.length>0}},{key:"leave",value:function(r){var n=this.entered.length;return this.entered=ds(this.entered.filter(this.isNodeInDocument),r),n>0&&this.entered.length===0}},{key:"reset",value:function(){this.entered=[]}}]),t})(),ys=$r(function(){return/firefox/i.test(navigator.userAgent)}),Hr=$r(function(){return!!window.safari});function ms(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function bs(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Os(t,e,r){return e&&bs(t.prototype,e),t}function re(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Gt=(function(){function t(e,r){ms(this,t),re(this,"xs",void 0),re(this,"ys",void 0),re(this,"c1s",void 0),re(this,"c2s",void 0),re(this,"c3s",void 0);for(var n=e.length,i=[],o=0;o<n;o++)i.push(o);i.sort(function(_,x){return e[_]<e[x]?-1:1});for(var a=[],s=[],u,c,d=0;d<n-1;d++)u=e[d+1]-e[d],c=r[d+1]-r[d],a.push(u),s.push(c/u);for(var p=[s[0]],O=0;O<a.length-1;O++){var m=s[O],I=s[O+1];if(m*I<=0)p.push(0);else{u=a[O];var l=a[O+1],f=u+l;p.push(3*f/((f+l)/m+(f+u)/I))}}p.push(s[s.length-1]);for(var g=[],v=[],S,w=0;w<p.length-1;w++){S=s[w];var T=p[w],E=1/a[w],b=T+p[w+1]-S-S;g.push((S-T-b)*E),v.push(b*E*E)}this.xs=e,this.ys=r,this.c1s=p,this.c2s=g,this.c3s=v}return Os(t,[{key:"interpolate",value:function(r){var n=this.xs,i=this.ys,o=this.c1s,a=this.c2s,s=this.c3s,u=n.length-1;if(r===n[u])return i[u];for(var c=0,d=s.length-1,p;c<=d;){p=Math.floor(.5*(c+d));var O=n[p];if(O<r)c=p+1;else if(O>r)d=p-1;else return i[p]}u=Math.max(0,d);var m=r-n[u],I=m*m;return i[u]+o[u]*m+a[u]*I+s[u]*m*I}}]),t})(),Ss=1;function Fr(t){var e=t.nodeType===Ss?t:t.parentElement;if(!e)return null;var r=e.getBoundingClientRect(),n=r.top,i=r.left;return{x:i,y:n}}function ae(t){return{x:t.clientX,y:t.clientY}}function Is(t){var e;return t.nodeName==="IMG"&&(ys()||!((e=document.documentElement)!==null&&e!==void 0&&e.contains(t)))}function Ds(t,e,r,n){var i=t?e.width:r,o=t?e.height:n;return Hr()&&t&&(o/=window.devicePixelRatio,i/=window.devicePixelRatio),{dragPreviewWidth:i,dragPreviewHeight:o}}function Ts(t,e,r,n,i){var o=Is(e),a=o?t:e,s=Fr(a),u={x:r.x-s.x,y:r.y-s.y},c=t.offsetWidth,d=t.offsetHeight,p=n.anchorX,O=n.anchorY,m=Ds(o,e,c,d),I=m.dragPreviewWidth,l=m.dragPreviewHeight,f=function(){var b=new Gt([0,.5,1],[u.y,u.y/d*l,u.y+l-d]),_=b.interpolate(O);return Hr()&&o&&(_+=(window.devicePixelRatio-1)*l),_},g=function(){var b=new Gt([0,.5,1],[u.x,u.x/c*I,u.x+I-c]);return b.interpolate(p)},v=i.offsetX,S=i.offsetY,w=v===0||v,T=S===0||S;return{x:w?v:g(),y:T?S:f()}}var Ur="__NATIVE_FILE__",zr="__NATIVE_URL__",Br="__NATIVE_TEXT__",Wr="__NATIVE_HTML__";const Kt=Object.freeze(Object.defineProperty({__proto__:null,FILE:Ur,HTML:Wr,TEXT:Br,URL:zr},Symbol.toStringTag,{value:"Module"}));function Ae(t,e,r){var n=e.reduce(function(i,o){return i||t.getData(o)},"");return n??r}var Y;function se(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Xe=(Y={},se(Y,Ur,{exposeProperties:{files:function(e){return Array.prototype.slice.call(e.files)},items:function(e){return e.items},dataTransfer:function(e){return e}},matchesTypes:["Files"]}),se(Y,Wr,{exposeProperties:{html:function(e,r){return Ae(e,r,"")},dataTransfer:function(e){return e}},matchesTypes:["Html","text/html"]}),se(Y,zr,{exposeProperties:{urls:function(e,r){return Ae(e,r,"").split(`
|
|
20
|
+
`)},dataTransfer:function(e){return e}},matchesTypes:["Url","text/uri-list"]}),se(Y,Br,{exposeProperties:{text:function(e,r){return Ae(e,r,"")},dataTransfer:function(e){return e}},matchesTypes:["Text","text/plain"]}),Y);function ws(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Cs(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Es(t,e,r){return e&&Cs(t.prototype,e),t}function Yt(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var _s=(function(){function t(e){ws(this,t),Yt(this,"item",void 0),Yt(this,"config",void 0),this.config=e,this.item={},this.initializeExposedProperties()}return Es(t,[{key:"initializeExposedProperties",value:function(){var r=this;Object.keys(this.config.exposeProperties).forEach(function(n){Object.defineProperty(r.item,n,{configurable:!0,enumerable:!0,get:function(){return console.warn(`Browser doesn't allow reading "`.concat(n,'" until the drop event.')),null}})})}},{key:"loadDataTransfer",value:function(r){var n=this;if(r){var i={};Object.keys(this.config.exposeProperties).forEach(function(o){i[o]={value:n.config.exposeProperties[o](r,n.config.matchesTypes),configurable:!0,enumerable:!0}}),Object.defineProperties(this.item,i)}}},{key:"canDrag",value:function(){return!0}},{key:"beginDrag",value:function(){return this.item}},{key:"isDragging",value:function(r,n){return n===r.getSourceId()}},{key:"endDrag",value:function(){}}]),t})();function xs(t,e){var r=new _s(Xe[t]);return r.loadDataTransfer(e),r}function Me(t){if(!t)return null;var e=Array.prototype.slice.call(t.types||[]);return Object.keys(Xe).filter(function(r){var n=Xe[r].matchesTypes;return n.some(function(i){return e.indexOf(i)>-1})})[0]||null}function Ns(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ps(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Rs(t,e,r){return e&&Ps(t.prototype,e),t}function je(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var ks=(function(){function t(e,r){Ns(this,t),je(this,"ownerDocument",null),je(this,"globalContext",void 0),je(this,"optionsArgs",void 0),this.globalContext=e,this.optionsArgs=r}return Rs(t,[{key:"window",get:function(){if(this.globalContext)return this.globalContext;if(typeof window<"u")return window}},{key:"document",get:function(){var r;return(r=this.globalContext)!==null&&r!==void 0&&r.document?this.globalContext.document:this.window?this.window.document:void 0}},{key:"rootElement",get:function(){var r;return((r=this.optionsArgs)===null||r===void 0?void 0:r.rootElement)||this.window}}]),t})();function Xt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Qt(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Xt(Object(r),!0).forEach(function(n){C(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Xt(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function As(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ms(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function js(t,e,r){return e&&Ms(t.prototype,e),t}function C(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Ls=(function(){function t(e,r,n){var i=this;As(this,t),C(this,"options",void 0),C(this,"actions",void 0),C(this,"monitor",void 0),C(this,"registry",void 0),C(this,"enterLeaveCounter",void 0),C(this,"sourcePreviewNodes",new Map),C(this,"sourcePreviewNodeOptions",new Map),C(this,"sourceNodes",new Map),C(this,"sourceNodeOptions",new Map),C(this,"dragStartSourceIds",null),C(this,"dropTargetIds",[]),C(this,"dragEnterTargetIds",[]),C(this,"currentNativeSource",null),C(this,"currentNativeHandle",null),C(this,"currentDragSourceNode",null),C(this,"altKeyPressed",!1),C(this,"mouseMoveTimeoutTimer",null),C(this,"asyncEndDragFrameId",null),C(this,"dragOverTargetIds",null),C(this,"lastClientOffset",null),C(this,"hoverRafId",null),C(this,"getSourceClientOffset",function(o){var a=i.sourceNodes.get(o);return a&&Fr(a)||null}),C(this,"endDragNativeItem",function(){i.isDraggingNativeItem()&&(i.actions.endDrag(),i.currentNativeHandle&&i.registry.removeSource(i.currentNativeHandle),i.currentNativeHandle=null,i.currentNativeSource=null)}),C(this,"isNodeInDocument",function(o){return!!(o&&i.document&&i.document.body&&i.document.body.contains(o))}),C(this,"endDragIfSourceWasRemovedFromDOM",function(){var o=i.currentDragSourceNode;o==null||i.isNodeInDocument(o)||i.clearCurrentDragSourceNode()&&i.monitor.isDragging()&&i.actions.endDrag()}),C(this,"handleTopDragStartCapture",function(){i.clearCurrentDragSourceNode(),i.dragStartSourceIds=[]}),C(this,"handleTopDragStart",function(o){if(!o.defaultPrevented){var a=i.dragStartSourceIds;i.dragStartSourceIds=null;var s=ae(o);i.monitor.isDragging()&&i.actions.endDrag(),i.actions.beginDrag(a||[],{publishSource:!1,getSourceClientOffset:i.getSourceClientOffset,clientOffset:s});var u=o.dataTransfer,c=Me(u);if(i.monitor.isDragging()){if(u&&typeof u.setDragImage=="function"){var d=i.monitor.getSourceId(),p=i.sourceNodes.get(d),O=i.sourcePreviewNodes.get(d)||p;if(O){var m=i.getCurrentSourcePreviewNodeOptions(),I=m.anchorX,l=m.anchorY,f=m.offsetX,g=m.offsetY,v={anchorX:I,anchorY:l},S={offsetX:f,offsetY:g},w=Ts(p,O,s,v,S);u.setDragImage(O,w.x,w.y)}}try{u==null||u.setData("application/json",{})}catch{}i.setCurrentDragSourceNode(o.target);var T=i.getCurrentSourcePreviewNodeOptions(),E=T.captureDraggingState;E?i.actions.publishDragSource():setTimeout(function(){return i.actions.publishDragSource()},0)}else if(c)i.beginDragNativeItem(c);else{if(u&&!u.types&&(o.target&&!o.target.hasAttribute||!o.target.hasAttribute("draggable")))return;o.preventDefault()}}}),C(this,"handleTopDragEndCapture",function(){i.clearCurrentDragSourceNode()&&i.monitor.isDragging()&&i.actions.endDrag()}),C(this,"handleTopDragEnterCapture",function(o){i.dragEnterTargetIds=[];var a=i.enterLeaveCounter.enter(o.target);if(!(!a||i.monitor.isDragging())){var s=o.dataTransfer,u=Me(s);u&&i.beginDragNativeItem(u,s)}}),C(this,"handleTopDragEnter",function(o){var a=i.dragEnterTargetIds;if(i.dragEnterTargetIds=[],!!i.monitor.isDragging()){i.altKeyPressed=o.altKey,a.length>0&&i.actions.hover(a,{clientOffset:ae(o)});var s=a.some(function(u){return i.monitor.canDropOnTarget(u)});s&&(o.preventDefault(),o.dataTransfer&&(o.dataTransfer.dropEffect=i.getCurrentDropEffect()))}}),C(this,"handleTopDragOverCapture",function(){i.dragOverTargetIds=[]}),C(this,"handleTopDragOver",function(o){var a=i.dragOverTargetIds;if(i.dragOverTargetIds=[],!i.monitor.isDragging()){o.preventDefault(),o.dataTransfer&&(o.dataTransfer.dropEffect="none");return}i.altKeyPressed=o.altKey,i.lastClientOffset=ae(o),i.hoverRafId===null&&typeof requestAnimationFrame<"u"&&(i.hoverRafId=requestAnimationFrame(function(){i.monitor.isDragging()&&i.actions.hover(a||[],{clientOffset:i.lastClientOffset}),i.hoverRafId=null}));var s=(a||[]).some(function(u){return i.monitor.canDropOnTarget(u)});s?(o.preventDefault(),o.dataTransfer&&(o.dataTransfer.dropEffect=i.getCurrentDropEffect())):i.isDraggingNativeItem()?o.preventDefault():(o.preventDefault(),o.dataTransfer&&(o.dataTransfer.dropEffect="none"))}),C(this,"handleTopDragLeaveCapture",function(o){i.isDraggingNativeItem()&&o.preventDefault();var a=i.enterLeaveCounter.leave(o.target);a&&i.isDraggingNativeItem()&&setTimeout(function(){return i.endDragNativeItem()},0)}),C(this,"handleTopDropCapture",function(o){if(i.dropTargetIds=[],i.isDraggingNativeItem()){var a;o.preventDefault(),(a=i.currentNativeSource)===null||a===void 0||a.loadDataTransfer(o.dataTransfer)}else Me(o.dataTransfer)&&o.preventDefault();i.enterLeaveCounter.reset()}),C(this,"handleTopDrop",function(o){var a=i.dropTargetIds;i.dropTargetIds=[],i.actions.hover(a,{clientOffset:ae(o)}),i.actions.drop({dropEffect:i.getCurrentDropEffect()}),i.isDraggingNativeItem()?i.endDragNativeItem():i.monitor.isDragging()&&i.actions.endDrag()}),C(this,"handleSelectStart",function(o){var a=o.target;typeof a.dragDrop=="function"&&(a.tagName==="INPUT"||a.tagName==="SELECT"||a.tagName==="TEXTAREA"||a.isContentEditable||(o.preventDefault(),a.dragDrop()))}),this.options=new ks(r,n),this.actions=e.getActions(),this.monitor=e.getMonitor(),this.registry=e.getRegistry(),this.enterLeaveCounter=new vs(this.isNodeInDocument)}return js(t,[{key:"profile",value:function(){var r,n;return{sourcePreviewNodes:this.sourcePreviewNodes.size,sourcePreviewNodeOptions:this.sourcePreviewNodeOptions.size,sourceNodeOptions:this.sourceNodeOptions.size,sourceNodes:this.sourceNodes.size,dragStartSourceIds:((r=this.dragStartSourceIds)===null||r===void 0?void 0:r.length)||0,dropTargetIds:this.dropTargetIds.length,dragEnterTargetIds:this.dragEnterTargetIds.length,dragOverTargetIds:((n=this.dragOverTargetIds)===null||n===void 0?void 0:n.length)||0}}},{key:"window",get:function(){return this.options.window}},{key:"document",get:function(){return this.options.document}},{key:"rootElement",get:function(){return this.options.rootElement}},{key:"setup",value:function(){var r=this.rootElement;if(r!==void 0){if(r.__isReactDndBackendSetUp)throw new Error("Cannot have two HTML5 backends at the same time.");r.__isReactDndBackendSetUp=!0,this.addEventListeners(r)}}},{key:"teardown",value:function(){var r=this.rootElement;if(r!==void 0&&(r.__isReactDndBackendSetUp=!1,this.removeEventListeners(this.rootElement),this.clearCurrentDragSourceNode(),this.asyncEndDragFrameId)){var n;(n=this.window)===null||n===void 0||n.cancelAnimationFrame(this.asyncEndDragFrameId)}}},{key:"connectDragPreview",value:function(r,n,i){var o=this;return this.sourcePreviewNodeOptions.set(r,i),this.sourcePreviewNodes.set(r,n),function(){o.sourcePreviewNodes.delete(r),o.sourcePreviewNodeOptions.delete(r)}}},{key:"connectDragSource",value:function(r,n,i){var o=this;this.sourceNodes.set(r,n),this.sourceNodeOptions.set(r,i);var a=function(c){return o.handleDragStart(c,r)},s=function(c){return o.handleSelectStart(c)};return n.setAttribute("draggable","true"),n.addEventListener("dragstart",a),n.addEventListener("selectstart",s),function(){o.sourceNodes.delete(r),o.sourceNodeOptions.delete(r),n.removeEventListener("dragstart",a),n.removeEventListener("selectstart",s),n.setAttribute("draggable","false")}}},{key:"connectDropTarget",value:function(r,n){var i=this,o=function(c){return i.handleDragEnter(c,r)},a=function(c){return i.handleDragOver(c,r)},s=function(c){return i.handleDrop(c,r)};return n.addEventListener("dragenter",o),n.addEventListener("dragover",a),n.addEventListener("drop",s),function(){n.removeEventListener("dragenter",o),n.removeEventListener("dragover",a),n.removeEventListener("drop",s)}}},{key:"addEventListeners",value:function(r){r.addEventListener&&(r.addEventListener("dragstart",this.handleTopDragStart),r.addEventListener("dragstart",this.handleTopDragStartCapture,!0),r.addEventListener("dragend",this.handleTopDragEndCapture,!0),r.addEventListener("dragenter",this.handleTopDragEnter),r.addEventListener("dragenter",this.handleTopDragEnterCapture,!0),r.addEventListener("dragleave",this.handleTopDragLeaveCapture,!0),r.addEventListener("dragover",this.handleTopDragOver),r.addEventListener("dragover",this.handleTopDragOverCapture,!0),r.addEventListener("drop",this.handleTopDrop),r.addEventListener("drop",this.handleTopDropCapture,!0))}},{key:"removeEventListeners",value:function(r){r.removeEventListener&&(r.removeEventListener("dragstart",this.handleTopDragStart),r.removeEventListener("dragstart",this.handleTopDragStartCapture,!0),r.removeEventListener("dragend",this.handleTopDragEndCapture,!0),r.removeEventListener("dragenter",this.handleTopDragEnter),r.removeEventListener("dragenter",this.handleTopDragEnterCapture,!0),r.removeEventListener("dragleave",this.handleTopDragLeaveCapture,!0),r.removeEventListener("dragover",this.handleTopDragOver),r.removeEventListener("dragover",this.handleTopDragOverCapture,!0),r.removeEventListener("drop",this.handleTopDrop),r.removeEventListener("drop",this.handleTopDropCapture,!0))}},{key:"getCurrentSourceNodeOptions",value:function(){var r=this.monitor.getSourceId(),n=this.sourceNodeOptions.get(r);return Qt({dropEffect:this.altKeyPressed?"copy":"move"},n||{})}},{key:"getCurrentDropEffect",value:function(){return this.isDraggingNativeItem()?"copy":this.getCurrentSourceNodeOptions().dropEffect}},{key:"getCurrentSourcePreviewNodeOptions",value:function(){var r=this.monitor.getSourceId(),n=this.sourcePreviewNodeOptions.get(r);return Qt({anchorX:.5,anchorY:.5,captureDraggingState:!1},n||{})}},{key:"isDraggingNativeItem",value:function(){var r=this.monitor.getItemType();return Object.keys(Kt).some(function(n){return Kt[n]===r})}},{key:"beginDragNativeItem",value:function(r,n){this.clearCurrentDragSourceNode(),this.currentNativeSource=xs(r,n),this.currentNativeHandle=this.registry.addSource(r,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle])}},{key:"setCurrentDragSourceNode",value:function(r){var n=this;this.clearCurrentDragSourceNode(),this.currentDragSourceNode=r;var i=1e3;this.mouseMoveTimeoutTimer=setTimeout(function(){var o;return(o=n.rootElement)===null||o===void 0?void 0:o.addEventListener("mousemove",n.endDragIfSourceWasRemovedFromDOM,!0)},i)}},{key:"clearCurrentDragSourceNode",value:function(){if(this.currentDragSourceNode){if(this.currentDragSourceNode=null,this.rootElement){var r;(r=this.window)===null||r===void 0||r.clearTimeout(this.mouseMoveTimeoutTimer||void 0),this.rootElement.removeEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)}return this.mouseMoveTimeoutTimer=null,!0}return!1}},{key:"handleDragStart",value:function(r,n){r.defaultPrevented||(this.dragStartSourceIds||(this.dragStartSourceIds=[]),this.dragStartSourceIds.unshift(n))}},{key:"handleDragEnter",value:function(r,n){this.dragEnterTargetIds.unshift(n)}},{key:"handleDragOver",value:function(r,n){this.dragOverTargetIds===null&&(this.dragOverTargetIds=[]),this.dragOverTargetIds.unshift(n)}},{key:"handleDrop",value:function(r,n){this.dropTargetIds.unshift(n)}}]),t})(),ue;function $s(){return ue||(ue=new Image,ue.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="),ue}var qr=function(e,r,n){return new Ls(e,r,n)};function Hs(t){const e=k(),r=e.selectedIds,[n,i,o]=Ba(()=>({canDrag:()=>t.isDraggable,type:"NODE",item:()=>{const a=e.isSelected(t.id)?Array.from(r):[t.id];return e.dispatch(J.dragStart(t.id,a)),{id:t.id,dragIds:a}},end:()=>{e.hideCursor(),e.dispatch(J.dragEnd())}}),[r,t]);return h.useEffect(()=>{o($s())},[o]),i}function Fs(t,e){const r=t.getBoundingClientRect(),n=e.x-Math.round(r.x),i=e.y-Math.round(r.y),o=r.height,a=i<o/2,s=!a,u=o/4,c=i>u&&i<o-u;return{x:n,inTopHalf:a,inBottomHalf:s,inMiddle:c,atTop:!c&&a,atBottom:!c&&s}}function Us(t,e,r,n){return t?t.isInternal?n.atTop?[e,t]:n.inMiddle?[t,t]:[t,r]:n.inTopHalf?[e,t]:[t,r]:[e,null]}function le(t,e){return{parentId:t||null,index:e}}function X(t,e){return{type:"line",index:t,level:e}}function zs(t){return{type:"highlight",id:t}}function Le(t,e){var r;let n=t;for(;n.parent&&n.level>e;)n=n.parent;const i=((r=n.parent)===null||r===void 0?void 0:r.id)||null,o=gr(n)+1;return{parentId:i,index:o}}function Vr(t){var e;const r=Fs(t.element,t.offset),n=t.indent,i=Math.round(Math.max(0,r.x-n)/n),{node:o,nextNode:a,prevNode:s}=t,[u,c]=Us(o,s,a,r);if(o&&o.isInternal&&r.inMiddle)return{drop:le(o.id,null),cursor:zs(o.id)};if(!u)return{drop:le((e=c==null?void 0:c.parent)===null||e===void 0?void 0:e.id,0),cursor:X(0,0)};if(cr(u)){const d=ce(i,(c==null?void 0:c.level)||0,u.level);return{drop:Le(u,d),cursor:X(u.rowIndex+1,d)}}if(dr(u)){const d=ce(i,(c==null?void 0:c.level)||0,u.level);return{drop:Le(u,d),cursor:X(u.rowIndex+1,d)}}if(fr(u)){const d=ce(i,0,u.level+1);return d>u.level?{drop:le(u.id,0),cursor:X(u.rowIndex+1,d)}:{drop:Le(u,d),cursor:X(u.rowIndex+1,d)}}return{drop:le(u==null?void 0:u.id,0),cursor:X(u.rowIndex+1,u.level+1)}}function Bs(t,e){const r=k(),[n,i]=Lr(()=>({accept:"NODE",canDrop:()=>r.canDrop(),hover:(o,a)=>{const s=a.getClientOffset();if(!t.current||!s)return;const{cursor:u,drop:c}=Vr({element:t.current,offset:s,indent:r.indent,node:e,prevNode:e.prev,nextNode:e.next});c&&r.dispatch(J.hovering(c.parentId,c.index)),a.canDrop()?u&&r.showCursor(u):r.hideCursor()},drop:(o,a)=>{if(!a.canDrop())return null;let{parentId:s,index:u,dragIds:c}=r.state.dnd;br(r.props.onMove,{dragIds:c,parentId:s===oe?null:s,index:u===null?0:u,dragNodes:r.dragNodes,parentNode:r.get(s)}),r.open(s)}}),[e,t.current,r.props]);return i}function Ws(t){const e=k(),r=e.at(t);if(!r)throw new Error(`Could not find node for index: ${t}`);return h.useMemo(()=>{const n=r.clone();return e.visibleNodes[t]=n,n},[...Object.values(r.state),r])}const qs=ir.memo(function({index:e,style:r}){lr(),mn();const n=k(),i=Ws(e),o=h.useRef(null),a=Hs(i),s=Bs(o,i),u=h.useCallback(l=>{o.current=l,s(l)},[s]),c=n.indent*i.level,d=h.useMemo(()=>({paddingLeft:c}),[c]),p=h.useMemo(()=>{var l,f;return Object.assign(Object.assign({},r),{top:parseFloat(r.top)+((f=(l=n.props.padding)!==null&&l!==void 0?l:n.props.paddingTop)!==null&&f!==void 0?f:0)})},[r,n.props.padding,n.props.paddingTop]),O={role:"treeitem","aria-level":i.level+1,"aria-selected":i.isSelected,"aria-expanded":i.isOpen,style:p,tabIndex:-1,className:n.props.rowClassName};h.useEffect(()=>{var l;!i.isEditing&&i.isFocused&&((l=o.current)===null||l===void 0||l.focus({preventScroll:!0}))},[i.isEditing,i.isFocused,o.current]);const m=n.renderNode,I=n.renderRow;return y.jsx(I,{node:i,innerRef:u,attrs:O,children:y.jsx(m,{node:i,tree:n,style:d,dragHandle:a})})});let $e="",Zt=null;function Gr(){lr();const t=k();return y.jsx("div",{role:"tree",style:{height:t.height,width:t.width,minHeight:0,minWidth:0},onContextMenu:t.props.onContextMenu,onClick:t.props.onClick,tabIndex:0,onFocus:e=>{e.currentTarget.contains(e.relatedTarget)||t.onFocus()},onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||t.onBlur()},onKeyDown:e=>{var r;if(t.isEditing)return;if(e.key==="Backspace"){if(!t.props.onDelete)return;const i=Array.from(t.selectedIds);if(i.length>1){let o=t.mostRecentNode;for(;o&&o.isSelected;)o=o.nextSibling;o||(o=t.lastNode),t.focus(o,{scroll:!1}),t.delete(Array.from(i))}else{const o=t.focusedNode;if(o){const a=o.nextSibling,s=o.parent;t.focus(a||s,{scroll:!1}),t.delete(o)}}return}if(e.key==="Tab"&&!e.shiftKey){e.preventDefault(),pr(e.currentTarget);return}if(e.key==="Tab"&&e.shiftKey){e.preventDefault(),vr(e.currentTarget);return}if(e.key==="ArrowDown"){e.preventDefault();const i=t.nextNode;if(e.metaKey){t.select(t.focusedNode),t.activate(t.focusedNode);return}else if(!e.shiftKey||t.props.disableMultiSelection){t.focus(i);return}else{if(!i)return;const o=t.focusedNode;o?o.isSelected?t.selectContiguous(i):t.selectMulti(i):t.focus(t.firstNode);return}}if(e.key==="ArrowUp"){e.preventDefault();const i=t.prevNode;if(!e.shiftKey||t.props.disableMultiSelection){t.focus(i);return}else{if(!i)return;const o=t.focusedNode;o?o.isSelected?t.selectContiguous(i):t.selectMulti(i):t.focus(t.lastNode);return}}if(e.key==="ArrowRight"){const i=t.focusedNode;if(!i)return;i.isInternal&&i.isOpen?t.focus(t.nextNode):i.isInternal&&t.open(i.id);return}if(e.key==="ArrowLeft"){const i=t.focusedNode;if(!i||i.isRoot)return;i.isInternal&&i.isOpen?t.close(i.id):!((r=i.parent)===null||r===void 0)&&r.isRoot||t.focus(i.parent);return}if(e.key==="a"&&e.metaKey&&!t.props.disableMultiSelection){e.preventDefault(),t.selectAll();return}if(e.key==="a"&&!e.metaKey&&t.props.onCreate){t.createLeaf();return}if(e.key==="A"&&!e.metaKey){if(!t.props.onCreate)return;t.createInternal();return}if(e.key==="Home"){e.preventDefault(),t.focus(t.firstNode);return}if(e.key==="End"){e.preventDefault(),t.focus(t.lastNode);return}if(e.key==="Enter"){const i=t.focusedNode;if(!i||!i.isEditable||!t.props.onRename)return;setTimeout(()=>{i&&t.edit(i)});return}if(e.key===" "){e.preventDefault();const i=t.focusedNode;if(!i)return;i.isLeaf?(i.select(),i.activate()):i.toggle();return}if(e.key==="*"){const i=t.focusedNode;if(!i)return;t.openSiblings(i);return}if(e.key==="PageUp"){e.preventDefault(),t.pageUp();return}e.key==="PageDown"&&(e.preventDefault(),t.pageDown()),clearTimeout(Zt),$e+=e.key,Zt=setTimeout(()=>{$e=""},600);const n=t.visibleNodes.find(i=>{const o=i.data.name;return typeof o=="string"?o.toLowerCase().startsWith($e):!1});n&&t.focus(n.id)},children:y.jsx(Jn,{className:t.props.className,outerRef:t.listEl,itemCount:t.visibleNodes.length,height:t.height,width:t.width,itemSize:t.rowHeight,overscanCount:t.overscanCount,itemKey:e=>{var r;return((r=t.visibleNodes[e])===null||r===void 0?void 0:r.id)||e},outerElementType:ri,innerElementType:oi,onScroll:t.props.onScroll,onItemsRendered:t.onItemsRendered.bind(t),ref:t.list,children:qs})})}function Jt(t){return t.isFiltered?Gs(t.root,t.isMatch.bind(t)):Vs(t.root)}function Vs(t){const e=[];function r(n){var i;n.level>=0&&e.push(n),n.isOpen&&((i=n.children)===null||i===void 0||i.forEach(r))}return r(t),e.forEach(Kr),e}function Gs(t,e){const r={},n=[];function i(a){if(!a.isRoot&&e(a)){r[a.id]=!0;let u=a.parent;for(;u;)r[u.id]=!0,u=u.parent}if(a.children)for(let u of a.children)i(u)}function o(a){var s;a.level>=0&&r[a.id]&&n.push(a),a.isOpen&&((s=a.children)===null||s===void 0||s.forEach(o))}return i(t),o(t),n.forEach(Kr),n}function Kr(t,e){t.rowIndex=e}const er=t=>t.reduce((e,r,n)=>(e[r.id]=n,e),{});var He=function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(a){a(o)})}return new(r||(r=Promise))(function(o,a){function s(d){try{c(n.next(d))}catch(p){a(p)}}function u(d){try{c(n.throw(d))}catch(p){a(p)}}function c(d){d.done?o(d.value):i(d.value).then(s,u)}c((n=n.apply(t,e||[])).next())})};const{safeRun:N,identify:F,identifyNull:$}=In;class ie{constructor(e,r,n,i){this.store=e,this.props=r,this.list=n,this.listEl=i,this.visibleStartIndex=0,this.visibleStopIndex=0,this.root=lt(this),this.visibleNodes=Jt(this),this.idToIndex=er(this.visibleNodes)}update(e){this.props=e,this.root=lt(this),this.visibleNodes=Jt(this),this.idToIndex=er(this.visibleNodes)}dispatch(e){return this.store.dispatch(e)}get state(){return this.store.getState()}get openState(){return this.state.nodes.open.unfiltered}get width(){var e;return(e=this.props.width)!==null&&e!==void 0?e:300}get height(){var e;return(e=this.props.height)!==null&&e!==void 0?e:500}get indent(){var e;return(e=this.props.indent)!==null&&e!==void 0?e:24}get rowHeight(){var e;return(e=this.props.rowHeight)!==null&&e!==void 0?e:24}get overscanCount(){var e;return(e=this.props.overscanCount)!==null&&e!==void 0?e:1}get searchTerm(){return(this.props.searchTerm||"").trim()}get matchFn(){var e;const r=(e=this.props.searchMatch)!==null&&e!==void 0?e:((n,i)=>JSON.stringify(Object.values(n.data)).toLocaleLowerCase().includes(i.toLocaleLowerCase()));return n=>r(n,this.searchTerm)}accessChildren(e){var r;const n=this.props.childrenAccessor||"children";return(r=ne(e,n))!==null&&r!==void 0?r:null}accessId(e){const r=this.props.idAccessor||"id",n=ne(e,r);if(!n)throw new Error("Data must contain an 'id' property or props.idAccessor must return a string");return n}get firstNode(){var e;return(e=this.visibleNodes[0])!==null&&e!==void 0?e:null}get lastNode(){var e;return(e=this.visibleNodes[this.visibleNodes.length-1])!==null&&e!==void 0?e:null}get focusedNode(){var e;return(e=this.get(this.state.nodes.focus.id))!==null&&e!==void 0?e:null}get mostRecentNode(){var e;return(e=this.get(this.state.nodes.selection.mostRecent))!==null&&e!==void 0?e:null}get nextNode(){const e=this.indexOf(this.focusedNode);return e===null?null:this.at(e+1)}get prevNode(){const e=this.indexOf(this.focusedNode);return e===null?null:this.at(e-1)}get(e){return e&&e in this.idToIndex&&this.visibleNodes[this.idToIndex[e]]||null}at(e){return this.visibleNodes[e]||null}nodesBetween(e,r){var n;if(e===null||r===null)return[];const i=(n=this.indexOf(e))!==null&&n!==void 0?n:0,o=this.indexOf(r);if(o===null)return[];const a=Math.min(i,o),s=Math.max(i,o);return this.visibleNodes.slice(a,s+1)}indexOf(e){const r=mr(e);return r?this.idToIndex[r]:null}get editingId(){return this.state.nodes.edit.id}createInternal(){return this.create({type:"internal"})}createLeaf(){return this.create({type:"leaf"})}create(){return He(this,arguments,void 0,function*(e={}){var r,n;const i=e.parentId===void 0?Ir(this):e.parentId,o=(r=e.index)!==null&&r!==void 0?r:Sr(this),a=(n=e.type)!==null&&n!==void 0?n:"leaf",s=yield N(this.props.onCreate,{type:a,parentId:i,index:o,parentNode:this.get(i)});s&&(this.focus(s),setTimeout(()=>{this.edit(s).then(()=>{this.select(s),this.activate(s)})}))})}delete(e){return He(this,void 0,void 0,function*(){if(!e)return;const n=(Array.isArray(e)?e:[e]).map(F),i=n.map(o=>this.get(o)).filter(o=>!!o);yield N(this.props.onDelete,{nodes:i,ids:n})})}edit(e){const r=F(e);return this.resolveEdit({cancelled:!0}),this.scrollTo(r),this.dispatch(Ce(r)),new Promise(n=>{ie.editPromise=n})}submit(e,r){return He(this,void 0,void 0,function*(){if(!e)return;const n=F(e);yield N(this.props.onRename,{id:n,name:r,node:this.get(n)}),this.dispatch(Ce(null)),this.resolveEdit({cancelled:!1,value:r}),setTimeout(()=>this.onFocus())})}reset(){this.dispatch(Ce(null)),this.resolveEdit({cancelled:!0}),setTimeout(()=>this.onFocus())}activate(e){const r=this.get($(e));r&&N(this.props.onActivate,r)}resolveEdit(e){const r=ie.editPromise;r&&r(e),ie.editPromise=null}get selectedIds(){return this.state.nodes.selection.ids}get selectedNodes(){let e=[];for(let r of Array.from(this.selectedIds)){const n=this.get(r);n&&e.push(n)}return e}focus(e,r={}){e&&(this.props.selectionFollowsFocus?this.select(e):(this.dispatch(V(F(e))),r.scroll!==!1&&this.scrollTo(e),this.focusedNode&&N(this.props.onFocus,this.focusedNode)))}pageUp(){var e,r;const n=this.visibleStartIndex,o=this.visibleStopIndex-n;let a=(r=(e=this.focusedNode)===null||e===void 0?void 0:e.rowIndex)!==null&&r!==void 0?r:0;a>n?a=n:a=Math.max(n-o,0),this.focus(this.at(a))}pageDown(){var e,r;const n=this.visibleStartIndex,i=this.visibleStopIndex,o=i-n;let a=(r=(e=this.focusedNode)===null||e===void 0?void 0:e.rowIndex)!==null&&r!==void 0?r:0;a<i?a=i:a=Math.min(a+o,this.visibleNodes.length-1),this.focus(this.at(a))}select(e,r={}){if(!e)return;const n=r.focus!==!1,i=F(e);n&&this.dispatch(V(i)),this.dispatch(L.only(i)),this.dispatch(L.anchor(i)),this.dispatch(L.mostRecent(i)),this.scrollTo(i,r.align),this.focusedNode&&n&&N(this.props.onFocus,this.focusedNode),N(this.props.onSelect,this.selectedNodes)}deselect(e){if(!e)return;const r=F(e);this.dispatch(L.remove(r)),N(this.props.onSelect,this.selectedNodes)}selectMulti(e,r={}){const n=this.get($(e));if(!n)return;const i=r.focus!==!1;i&&this.dispatch(V(n.id)),this.dispatch(L.add(n.id)),this.dispatch(L.anchor(n.id)),this.dispatch(L.mostRecent(n.id)),this.scrollTo(n,r.align),this.focusedNode&&i&&N(this.props.onFocus,this.focusedNode),N(this.props.onSelect,this.selectedNodes)}selectContiguous(e){if(!e)return;const r=F(e),{anchor:n,mostRecent:i}=this.state.nodes.selection;this.dispatch(V(r)),this.dispatch(L.remove(this.nodesBetween(n,i))),this.dispatch(L.add(this.nodesBetween(n,$(r)))),this.dispatch(L.mostRecent(r)),this.scrollTo(r),this.focusedNode&&N(this.props.onFocus,this.focusedNode),N(this.props.onSelect,this.selectedNodes)}deselectAll(){this.setSelection({ids:[],anchor:null,mostRecent:null}),N(this.props.onSelect,this.selectedNodes)}selectAll(){var e;this.setSelection({ids:Object.keys(this.idToIndex),anchor:this.firstNode,mostRecent:this.lastNode}),this.dispatch(V((e=this.lastNode)===null||e===void 0?void 0:e.id)),this.focusedNode&&N(this.props.onFocus,this.focusedNode),N(this.props.onSelect,this.selectedNodes)}setSelection(e){var r;const n=new Set((r=e.ids)===null||r===void 0?void 0:r.map(F)),i=$(e.anchor),o=$(e.mostRecent);this.dispatch(L.set({ids:n,anchor:i,mostRecent:o})),N(this.props.onSelect,this.selectedNodes)}get cursorParentId(){const{cursor:e}=this.state.dnd;switch(e.type){case"highlight":return e.id;default:return null}}get cursorOverFolder(){return this.state.dnd.cursor.type==="highlight"}get dragNodes(){return this.state.dnd.dragIds.map(e=>this.get(e)).filter(e=>!!e)}get dragNode(){return this.get(this.state.nodes.drag.id)}get dragDestinationParent(){return this.get(this.state.nodes.drag.destinationParentId)}get dragDestinationIndex(){return this.state.nodes.drag.destinationIndex}canDrop(){var e;if(this.isFiltered)return!1;const r=(e=this.get(this.state.dnd.parentId))!==null&&e!==void 0?e:this.root,n=this.dragNodes,i=this.props.disableDrop;for(const o of n)if(!o||!r||o.isInternal&&hr(r,o))return!1;return typeof i=="function"?!i({parentNode:r,dragNodes:this.dragNodes,index:this.state.dnd.index||0}):typeof i=="string"?!r.data[i]:typeof i=="boolean"?!i:!0}hideCursor(){this.dispatch(J.cursor({type:"none"}))}showCursor(e){this.dispatch(J.cursor(e))}open(e){const r=$(e);r&&(this.isOpen(r)||(this.dispatch(ze.open(r,this.isFiltered)),N(this.props.onToggle,r)))}close(e){const r=$(e);r&&this.isOpen(r)&&(this.dispatch(ze.close(r,this.isFiltered)),N(this.props.onToggle,r))}toggle(e){const r=$(e);if(r)return this.isOpen(r)?this.close(r):this.open(r)}openParents(e){const r=$(e);if(!r)return;const n=Qe(this.root,r);let i=n==null?void 0:n.parent;for(;i;)this.open(i.id),i=i.parent}openSiblings(e){const r=e.parent;if(!r)this.toggle(e.id);else if(r.children){const n=e.isOpen;for(let i of r.children)i.isInternal&&(n?this.close(i.id):this.open(i.id));this.scrollTo(this.focusedNode)}}openAll(){ve(this.root,e=>{e.isInternal&&e.open()})}closeAll(){ve(this.root,e=>{e.isInternal&&e.close()})}scrollTo(e,r="smart"){if(!e)return;const n=F(e);return this.openParents(n),Or(()=>n in this.idToIndex).then(()=>{var i;const o=this.idToIndex[n];o!==void 0&&((i=this.list.current)===null||i===void 0||i.scrollToItem(o,r))}).catch(()=>{})}get isEditing(){return this.state.nodes.edit.id!==null}get isFiltered(){var e;return!!(!((e=this.props.searchTerm)===null||e===void 0)&&e.trim())}get hasFocus(){return this.state.nodes.focus.treeFocused}get hasNoSelection(){return this.state.nodes.selection.ids.size===0}get hasOneSelection(){return this.state.nodes.selection.ids.size===1}get hasMultipleSelections(){return this.state.nodes.selection.ids.size>1}isSelected(e){return e?this.state.nodes.selection.ids.has(e):!1}isOpen(e){var r,n,i;if(!e)return!1;if(e===oe)return!0;const o=(r=this.props.openByDefault)!==null&&r!==void 0?r:!0;return this.isFiltered?(n=this.state.nodes.open.filtered[e])!==null&&n!==void 0?n:!0:(i=this.state.nodes.open.unfiltered[e])!==null&&i!==void 0?i:o}isEditable(e){const r=this.props.disableEdit||(()=>!1);return!ne(e,r)}isDraggable(e){const r=this.props.disableDrag||(()=>!1);return!ne(e,r)}isDragging(e){const r=$(e);return r?this.state.nodes.drag.id===r:!1}isFocused(e){return this.hasFocus&&this.state.nodes.focus.id===e}isMatch(e){return this.matchFn(e)}willReceiveDrop(e){const r=$(e);if(!r)return!1;const{destinationParentId:n,destinationIndex:i}=this.state.nodes.drag;return r===n&&i===null}onFocus(){const e=this.focusedNode||this.firstNode;e&&this.dispatch(V(e.id))}onBlur(){this.dispatch(Rn())}onItemsRendered(e){this.visibleStartIndex=e.visibleStartIndex,this.visibleStopIndex=e.visibleStopIndex}get renderContainer(){return this.props.renderContainer||Gr}get renderRow(){return this.props.renderRow||En}get renderNode(){return this.props.children||_n}get renderDragPreview(){return this.props.renderDragPreview||Dr}get renderCursor(){return this.props.renderCursor||Cn}}function R(t){return`Minified Redux error #${t}; visit https://redux.js.org/Errors?code=${t} for the full message or use the non-minified dev environment for full errors. `}var Ks=typeof Symbol=="function"&&Symbol.observable||"@@observable",tr=Ks,Fe=()=>Math.random().toString(36).substring(7).split("").join("."),Ys={INIT:`@@redux/INIT${Fe()}`,REPLACE:`@@redux/REPLACE${Fe()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Fe()}`},be=Ys;function Xs(t){if(typeof t!="object"||t===null)return!1;let e=t;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e||Object.getPrototypeOf(t)===null}function Yr(t,e,r){if(typeof t!="function")throw new Error(R(2));if(typeof e=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(R(0));if(typeof e=="function"&&typeof r>"u"&&(r=e,e=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(R(1));return r(Yr)(t,e)}let n=t,i=e,o=new Map,a=o,s=0,u=!1;function c(){a===o&&(a=new Map,o.forEach((f,g)=>{a.set(g,f)}))}function d(){if(u)throw new Error(R(3));return i}function p(f){if(typeof f!="function")throw new Error(R(4));if(u)throw new Error(R(5));let g=!0;c();const v=s++;return a.set(v,f),function(){if(g){if(u)throw new Error(R(6));g=!1,c(),a.delete(v),o=null}}}function O(f){if(!Xs(f))throw new Error(R(7));if(typeof f.type>"u")throw new Error(R(8));if(typeof f.type!="string")throw new Error(R(17));if(u)throw new Error(R(9));try{u=!0,i=n(i,f)}finally{u=!1}return(o=a).forEach(v=>{v()}),f}function m(f){if(typeof f!="function")throw new Error(R(10));n=f,O({type:be.REPLACE})}function I(){const f=p;return{subscribe(g){if(typeof g!="object"||g===null)throw new Error(R(11));function v(){const w=g;w.next&&w.next(d())}return v(),{unsubscribe:f(v)}},[tr](){return this}}}return O({type:be.INIT}),{dispatch:O,subscribe:p,getState:d,replaceReducer:m,[tr]:I}}function Qs(t){Object.keys(t).forEach(e=>{const r=t[e];if(typeof r(void 0,{type:be.INIT})>"u")throw new Error(R(12));if(typeof r(void 0,{type:be.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(R(13))})}function rr(t){const e=Object.keys(t),r={};for(let o=0;o<e.length;o++){const a=e[o];typeof t[a]=="function"&&(r[a]=t[a])}const n=Object.keys(r);let i;try{Qs(r)}catch(o){i=o}return function(a={},s){if(i)throw i;let u=!1;const c={};for(let d=0;d<n.length;d++){const p=n[d],O=r[p],m=a[p],I=O(m,s);if(typeof I>"u")throw s&&s.type,new Error(R(14));c[p]=I,u=u||I!==m}return u=u||n.length!==Object.keys(a).length,u?c:a}}function Zs(t=Z().nodes.drag,e){switch(e.type){case"DND_DRAG_START":return Object.assign(Object.assign({},t),{id:e.id,selectedIds:e.dragIds});case"DND_DRAG_END":return Object.assign(Object.assign({},t),{id:null,destinationParentId:null,destinationIndex:null,selectedIds:[]});case"DND_HOVERING":return e.parentId!==t.destinationParentId||e.index!=t.destinationIndex?Object.assign(Object.assign({},t),{destinationParentId:e.parentId,destinationIndex:e.index}):t;default:return t}}const Js=rr({nodes:rr({focus:kn,edit:Pn,open:An,selection:Mn,drag:Zs}),dnd:jn}),eu=Z();function tu({treeProps:t,imperativeHandle:e,children:r}){const n=h.useRef(null),i=h.useRef(null),o=h.useRef(Yr(Js,Z(t))),a=hn.useSyncExternalStore(o.current.subscribe,o.current.getState,()=>eu),s=h.useMemo(()=>new ie(o.current,t,n,i),[]),u=h.useRef(0);return h.useMemo(()=>{u.current+=1,s.update(t)},[...Object.values(t),a.nodes.open]),h.useImperativeHandle(e,()=>s),h.useEffect(()=>{s.props.selection?s.select(s.props.selection,{focus:!1}):s.deselectAll()},[s.props.selection]),h.useEffect(()=>{s.props.searchTerm||o.current.dispatch(ze.clear(!0))},[s.props.searchTerm]),y.jsx(or.Provider,{value:s,children:y.jsx(ur.Provider,{value:u.current,children:y.jsx(ar.Provider,{value:a.nodes,children:y.jsx(sr.Provider,{value:a.dnd,children:y.jsx($o,Object.assign({},t.dndManager?{manager:t.dndManager}:{backend:t.dndBackend||qr,options:{rootElement:s.props.dndRootElement||void 0}},{children:r}))})})})})}function ru(){const t=k(),[,e]=Lr(()=>({accept:"NODE",canDrop:(r,n)=>n.isOver({shallow:!0})?t.canDrop():!1,hover:(r,n)=>{if(!n.isOver({shallow:!0}))return;const i=n.getClientOffset();if(!t.listEl.current||!i)return;const{cursor:o,drop:a}=Vr({element:t.listEl.current,offset:i,indent:t.indent,node:null,prevNode:t.visibleNodes[t.visibleNodes.length-1],nextNode:null});a&&t.dispatch(J.hovering(a.parentId,a.index)),n.canDrop()?o&&t.showCursor(o):t.hideCursor()}}),[t]);e(t.listEl)}function nu(t){return ru(),t.children}function iu(){const e=k().props.renderContainer||Gr;return y.jsx(y.Fragment,{children:y.jsx(e,{})})}function ou(){const t=k(),{offset:e,mouse:r,item:n,isDragging:i}=cs(a=>({offset:a.getSourceClientOffset(),mouse:a.getClientOffset(),item:a.getItem(),isDragging:a.isDragging()})),o=t.props.renderDragPreview||Dr;return y.jsx(o,{offset:e,mouse:r,id:(n==null?void 0:n.id)||null,dragIds:(n==null?void 0:n.dragIds)||[],isDragging:i})}class au{constructor(e){this.root=su(e)}get data(){var e,r;return(r=(e=this.root.children)===null||e===void 0?void 0:e.map(n=>n.data))!==null&&r!==void 0?r:[]}create(e){const r=e.parentId?this.find(e.parentId):this.root;if(!r)return null;r.addChild(e.data,e.index)}move(e){const r=this.find(e.id),n=e.parentId?this.find(e.parentId):this.root;!r||!n||(n.addChild(r.data,e.index),r.drop())}update(e){const r=this.find(e.id);r&&r.update(e.changes)}drop(e){const r=this.find(e.id);r&&r.drop()}find(e,r=this.root){if(!r)return null;if(r.id===e)return r;if(r.children){for(let n of r.children){const i=this.find(e,n);if(i)return i}return null}return null}}function su(t){const e=new Xr({id:"ROOT"},null);return e.children=t.map(r=>it(r,e)),e}function it(t,e){const r=new Xr(t,e);return t.children&&(r.children=t.children.map(n=>it(n,r))),r}class Xr{constructor(e,r){this.data=e,this.parent=r,this.id=e.id}hasParent(){return!!this.parent}get childIndex(){return this.hasParent()?this.parent.children.indexOf(this):-1}addChild(e,r){var n,i;const o=it(e,this);this.children=(n=this.children)!==null&&n!==void 0?n:[],this.children.splice(r,0,o),this.data.children=(i=this.data.children)!==null&&i!==void 0?i:[],this.data.children.splice(r,0,e)}removeChild(e){var r,n;(r=this.children)===null||r===void 0||r.splice(e,1),(n=this.data.children)===null||n===void 0||n.splice(e,1)}update(e){if(this.hasParent()){const r=this.childIndex;this.parent.addChild(Object.assign(Object.assign({},this.data),e),r),this.drop()}}drop(){this.hasParent()&&this.parent.removeChild(this.childIndex)}}let uu=0;function lu(t){const[e,r]=h.useState(t),n=h.useMemo(()=>new au(e),[e]);return[e,{onMove:c=>{for(const d of c.dragIds)n.move({id:d,parentId:c.parentId,index:c.index});r(n.data)},onRename:({name:c,id:d})=>{n.update({id:d,changes:{name:c}}),r(n.data)},onCreate:({parentId:c,index:d,type:p})=>{const O={id:`simple-tree-id-${uu++}`,name:""};return p==="internal"&&(O.children=[]),n.create({parentId:c,index:d,data:O}),r(n.data),O},onDelete:c=>{c.ids.forEach(d=>n.drop({id:d})),r(n.data)}}]}function cu(t){if(t.initialData&&t.data)throw new Error("React Arborist Tree => Provide either a data or initialData prop, but not both.");if(t.initialData&&(t.onCreate||t.onDelete||t.onMove||t.onRename))throw new Error(`React Arborist Tree => You passed the initialData prop along with a data handler.
|
|
21
|
+
Use the data prop if you want to provide your own handlers.`);if(t.initialData){const[e,r]=lu(t.initialData);return Object.assign(Object.assign(Object.assign({},t),r),{data:e})}else return t}function du(t,e){const r=cu(t);return y.jsxs(tu,{treeProps:r,imperativeHandle:e,children:[y.jsx(nu,{children:y.jsx(iu,{})}),y.jsx(ou,{})]})}const fu=h.forwardRef(du),Ue=Symbol.for("@hachej/boring-workspace/file-tree-dnd-manager");function hu(){const t=globalThis;return t[Ue]??(t[Ue]=Pr(qr,typeof window>"u"?void 0:window)),t[Ue]}const Qr=new Set,Zr=h.createContext({onContextMenu:void 0,editing:null,pendingPaths:Qr,onSubmitEdit:void 0,onCancelEdit:void 0});function gu({initialValue:t,onSubmit:e,onCancel:r,isDraft:n}){const i=h.useRef(null),o=h.useRef(!1);h.useEffect(()=>{const s=i.current;if(s)if(s.focus(),!n&&t.includes(".")){const u=t.lastIndexOf(".");s.setSelectionRange(0,u)}else s.select()},[t,n]);const a=()=>{var s;if(o.current)return;o.current=!0;const u=((s=i.current)==null?void 0:s.value.trim())??"";!u||u===t?r():e(u)};return y.jsx(fn,{ref:i,type:"text",defaultValue:t,"data-testid":"file-tree-edit-input","aria-label":n?"Name":"Rename",onPointerDown:s=>s.stopPropagation(),onClick:s=>s.stopPropagation(),onKeyDown:s=>{s.stopPropagation(),s.key==="Enter"?(s.preventDefault(),a()):s.key==="Escape"&&(s.preventDefault(),o.current=!0,r())},onBlur:a,className:"h-5 min-w-0 flex-1 rounded-sm border-[color:var(--accent)]/60 px-1 text-[13px] leading-[1.2] focus-visible:ring-[color:var(--accent)]"})}function pu({node:t,style:e,dragHandle:r}){const{onContextMenu:n,editing:i,pendingPaths:o,onSubmitEdit:a,onCancelEdit:s}=h.useContext(Zr),u=t.data,c=u.kind==="dir",d=(i==null?void 0:i.path)===u.path,p=o.has(u.path),O=c?t.isOpen?pn:yn:ln(u.name||"untitled");return y.jsxs("div",{ref:r,style:e,className:Q("group relative mx-1 flex items-center gap-1.5 rounded-md px-2 py-0.5 text-[13px] leading-[1.4] cursor-pointer select-none text-foreground","transition-colors duration-150 ease-[cubic-bezier(0.22,1,0.36,1)]",!d&&"hover:bg-foreground/[0.04]",t.isSelected&&!d&&"bg-[oklch(from_var(--accent)_l_c_h/0.10)] text-foreground font-medium",t.willReceiveDrop&&"bg-foreground/5 outline outline-1 outline-border"),onClick:m=>{d||(m.stopPropagation(),c?t.toggle():(t.select(),t.activate()))},onContextMenu:m=>{d||u.isDraft||(m.preventDefault(),m.stopPropagation(),n==null||n(m,u))},children:[c?y.jsx(cn,{className:Q("h-3 w-3 shrink-0 text-muted-foreground/70 transition-transform duration-150 ease-[cubic-bezier(0.22,1,0.36,1)]",t.isOpen&&"rotate-90"),strokeWidth:2}):y.jsx("span",{className:"w-3 shrink-0"}),y.jsx(O,{className:Q("h-4 w-4 shrink-0",t.isSelected?"text-[color:var(--accent)]":"text-muted-foreground/80"),strokeWidth:1.5}),d?y.jsx(gu,{initialValue:(i==null?void 0:i.initialValue)??u.name??"",isDraft:!!(i!=null&&i.isDraft),onSubmit:m=>a==null?void 0:a(u.path,m),onCancel:()=>s==null?void 0:s()}):y.jsx("span",{className:Q("truncate",p&&"text-muted-foreground italic"),children:u.name}),p&&!d&&y.jsx(dn,{"data-testid":"file-tree-pending-spinner","aria-label":"Pending",className:"ml-auto h-3 w-3 shrink-0 animate-spin text-muted-foreground/70",strokeWidth:2})]})}function mu({files:t,selectedPath:e,searchQuery:r,height:n=400,editing:i,revealPath:o,pendingPaths:a,onSelect:s,onExpand:u,onCollapse:c,onContextMenu:d,onSubmitEdit:p,onCancelEdit:O,onDragDrop:m,className:I}){const l=h.useRef(null);h.useEffect(()=>{if(!(i!=null&&i.isDraft))return;const b=requestAnimationFrame(()=>{var _;(_=l.current)==null||_.scrollTo(i.path)});return()=>cancelAnimationFrame(b)},[i==null?void 0:i.isDraft,i==null?void 0:i.path]),h.useEffect(()=>{if(!o)return;const b=requestAnimationFrame(()=>{var _;(_=l.current)==null||_.scrollTo(o)});return()=>cancelAnimationFrame(b)},[t,o]);const f=h.useMemo(()=>e||void 0,[e]),g=h.useCallback(b=>{b.data.kind==="file"&&(s==null||s(b.data.path))},[s]),v=h.useCallback(b=>{var _;const x=(_=l.current)==null?void 0:_.get(b);x&&(x.isOpen?u==null||u(x.data.path):c==null||c(x.data.path))},[u,c]),S=h.useCallback(b=>{if(!m)return;const _=!b.parentNode||b.parentNode.isRoot,x=_?".":b.parentNode.data.path;if(!(!_&&b.parentNode.data.kind!=="dir"))for(const q of b.dragNodes){const U=q.data.path;if(x===U||x!=="."&&x.startsWith(U+"/"))return;m(U,x)}},[m]),w=h.useCallback(b=>{if(!b.parentNode||b.parentNode.isRoot)return!1;if(b.parentNode.data.kind!=="dir")return!0;for(const _ of b.dragNodes)if(b.parentNode.data.path===_.data.path||b.parentNode.data.path.startsWith(_.data.path+"/"))return!0;return!1},[]),T=h.useCallback((b,_)=>b.data.name.toLowerCase().includes(_.toLowerCase()),[]),E=h.useMemo(()=>({onContextMenu:d,editing:i??null,pendingPaths:a??Qr,onSubmitEdit:p,onCancelEdit:O}),[d,i,a,p,O]);return t.length===0?y.jsx("div",{className:Q("flex h-full items-center justify-center text-sm text-muted-foreground",I),children:"No files"}):y.jsx(Zr.Provider,{value:E,children:y.jsx("div",{"data-boring-workspace-part":"file-tree",className:Q("file-tree",I),children:y.jsx(fu,{ref:l,data:t,idAccessor:"path",childrenAccessor:"children",openByDefault:!1,width:"100%",height:n,rowHeight:26,indent:14,selection:f,searchTerm:r??"",searchMatch:T,onActivate:g,onToggle:v,onMove:S,disableDrop:w,disableEdit:!0,dndManager:hu(),children:pu})})})}export{mu as FileTree};
|