@hachej/boring-ui-cli 0.1.9 → 0.1.12
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/package.json +3 -3
- package/public/assets/{CodeEditor-DQqOn4xz-C7wnUYp6.js → CodeEditor-DQqOn4xz-DuFpBvbb.js} +1 -1
- package/public/assets/{FileTree-CKG6iiCM-CqYdcCtF.js → FileTree-BVfqs3rR-Czof9U4p.js} +10 -10
- package/public/assets/{MarkdownEditor-C77O0ZVD-BvAOSBmJ.js → MarkdownEditor-CcCDF65H-D2GfBGsV.js} +1 -1
- package/public/assets/{_baseUniq-BeSGrvUi.js → _baseUniq-CsAl84mt.js} +1 -1
- package/public/assets/{arc-AWm7L_-j.js → arc-PTZanISu.js} +1 -1
- package/public/assets/{architectureDiagram-Q4EWVU46-Dl89DOTm.js → architectureDiagram-Q4EWVU46-CVcjgRnu.js} +1 -1
- package/public/assets/{blockDiagram-DXYQGD6D-CDTFhuYH.js → blockDiagram-DXYQGD6D-Bru_ZwpZ.js} +1 -1
- package/public/assets/{c4Diagram-AHTNJAMY-D8ppmyf3.js → c4Diagram-AHTNJAMY-BW3IBSCV.js} +1 -1
- package/public/assets/channel-CFDWsi74.js +1 -0
- package/public/assets/{chunk-4BX2VUAB-COAYL9u0.js → chunk-4BX2VUAB-YcjheD0W.js} +1 -1
- package/public/assets/{chunk-4TB4RGXK-CfdsUq8e.js → chunk-4TB4RGXK-D56FxuL5.js} +1 -1
- package/public/assets/{chunk-55IACEB6-DvZg1n9t.js → chunk-55IACEB6-B6MbtPYM.js} +1 -1
- package/public/assets/{chunk-EDXVE4YY-aWJl5-TN.js → chunk-EDXVE4YY-DzJUuRqn.js} +1 -1
- package/public/assets/{chunk-FMBD7UC4-CUNwtzKS.js → chunk-FMBD7UC4-CHrv3vIp.js} +1 -1
- package/public/assets/{chunk-OYMX7WX6-BDnR5DwE.js → chunk-OYMX7WX6-BT4nDcXl.js} +1 -1
- package/public/assets/{chunk-QZHKN3VN-BwGfrA1T.js → chunk-QZHKN3VN-ZltyYxH5.js} +1 -1
- package/public/assets/{chunk-YZCP3GAM-BzcWPUDL.js → chunk-YZCP3GAM-BaUQKTaA.js} +1 -1
- package/public/assets/classDiagram-6PBFFD2Q-DIdIurqI.js +1 -0
- package/public/assets/classDiagram-v2-HSJHXN6E-DIdIurqI.js +1 -0
- package/public/assets/clone-4dCRxMF-.js +1 -0
- package/public/assets/{cose-bilkent-S5V4N54A-1WftG61M.js → cose-bilkent-S5V4N54A-D_3_vdXE.js} +1 -1
- package/public/assets/{dagre-KV5264BT-7yZXb_Fh.js → dagre-KV5264BT-BG41F0c2.js} +1 -1
- package/public/assets/{diagram-5BDNPKRD-l0aQJ1nn.js → diagram-5BDNPKRD-DIvJKX1t.js} +1 -1
- package/public/assets/{diagram-G4DWMVQ6-lb3KP5WX.js → diagram-G4DWMVQ6-BAvBh9MI.js} +1 -1
- package/public/assets/{diagram-MMDJMWI5-CqkVYJFE.js → diagram-MMDJMWI5-7Ck3ersx.js} +1 -1
- package/public/assets/{diagram-TYMM5635-ZpD1DvQ2.js → diagram-TYMM5635-CfYIGnZO.js} +1 -1
- package/public/assets/{erDiagram-SMLLAGMA-DfRf1Zcj.js → erDiagram-SMLLAGMA-J8_GEWbc.js} +1 -1
- package/public/assets/{flowDiagram-DWJPFMVM-CY4BYZFM.js → flowDiagram-DWJPFMVM-DSNWoowL.js} +1 -1
- package/public/assets/{ganttDiagram-T4ZO3ILL-BV8h078u.js → ganttDiagram-T4ZO3ILL-CqeSgxFm.js} +1 -1
- package/public/assets/{gitGraphDiagram-UUTBAWPF-DXqYlYIx.js → gitGraphDiagram-UUTBAWPF-WTqcsRvO.js} +1 -1
- package/public/assets/{graph-U_Iy18Pb.js → graph-DV--OlCM.js} +1 -1
- package/public/assets/{highlighted-body-OFNGDK62-BWnVfRUz.js → highlighted-body-OFNGDK62-5nFXisM5.js} +1 -1
- package/public/assets/{index-4KBIMz9K.js → index-BCTkptLY.js} +1 -1
- package/public/assets/index-C6eyf77n.css +1 -0
- package/public/assets/{index-D4E7C9QZ.js → index-XsaRyZHq.js} +286 -285
- package/public/assets/{infoDiagram-42DDH7IO-DTQHApsb.js → infoDiagram-42DDH7IO-21ZE2SqE.js} +1 -1
- package/public/assets/{ishikawaDiagram-UXIWVN3A-DRjODyBm.js → ishikawaDiagram-UXIWVN3A-BZHBECQ2.js} +1 -1
- package/public/assets/{journeyDiagram-VCZTEJTY-zFzZPTP9.js → journeyDiagram-VCZTEJTY-r3HLhR12.js} +1 -1
- package/public/assets/{kanban-definition-6JOO6SKY-Bl7pqki3.js → kanban-definition-6JOO6SKY-CPVAOYpU.js} +1 -1
- package/public/assets/{layout-Db8dXgqy.js → layout-DVgbi3D8.js} +1 -1
- package/public/assets/{linear-CvZ-G-pz.js → linear-BhYOZzNM.js} +1 -1
- package/public/assets/{min-URgFsKsc.js → min-DfE81L3F.js} +1 -1
- package/public/assets/{mindmap-definition-QFDTVHPH-Cmu1lOgb.js → mindmap-definition-QFDTVHPH-CA2yvXBH.js} +1 -1
- package/public/assets/{pieDiagram-DEJITSTG-DeHsfgO3.js → pieDiagram-DEJITSTG-L_mmH_pC.js} +1 -1
- package/public/assets/{quadrantDiagram-34T5L4WZ-DmH5M6a0.js → quadrantDiagram-34T5L4WZ-CnQ66FVE.js} +1 -1
- package/public/assets/{requirementDiagram-MS252O5E-CwBM-OUX.js → requirementDiagram-MS252O5E-DDS8MLl5.js} +1 -1
- package/public/assets/{sankeyDiagram-XADWPNL6-DXH4_CtS.js → sankeyDiagram-XADWPNL6-dVHOsqxu.js} +1 -1
- package/public/assets/{sequenceDiagram-FGHM5R23-D9ZLogeN.js → sequenceDiagram-FGHM5R23-ChrdcmX-.js} +1 -1
- package/public/assets/{stateDiagram-FHFEXIEX-MFQbhtdP.js → stateDiagram-FHFEXIEX-BPKTx0lB.js} +1 -1
- package/public/assets/stateDiagram-v2-QKLJ7IA2-DJmb7lXU.js +1 -0
- package/public/assets/{timeline-definition-GMOUNBTQ-Do0uZEwz.js → timeline-definition-GMOUNBTQ-CcLsYfJW.js} +1 -1
- package/public/assets/{vennDiagram-DHZGUBPP-BQZCgv69.js → vennDiagram-DHZGUBPP-Be3AUip7.js} +1 -1
- package/public/assets/{wardley-RL74JXVD-BTA8f0A8.js → wardley-RL74JXVD-1V2kQ4MI.js} +1 -1
- package/public/assets/{wardleyDiagram-NUSXRM2D-C8-FAjFI.js → wardleyDiagram-NUSXRM2D-DpRPkIlo.js} +1 -1
- package/public/assets/{xychartDiagram-5P7HB3ND-BFwSzusM.js → xychartDiagram-5P7HB3ND-Cvj_r6ra.js} +1 -1
- package/public/index.html +2 -2
- package/public/assets/channel-BQ7eQDsr.js +0 -1
- package/public/assets/classDiagram-6PBFFD2Q-ySYJlBV9.js +0 -1
- package/public/assets/classDiagram-v2-HSJHXN6E-ySYJlBV9.js +0 -1
- package/public/assets/clone-wUMeKOQp.js +0 -1
- package/public/assets/index-mij1Excv.css +0 -1
- package/public/assets/stateDiagram-v2-QKLJ7IA2-Bq7rBFcq.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{bM as rr,r as h,bN as nr,j as y,aP as on,bl as Q,bZ as an,b_ as sn,b$ as un,bW as ln}from"./index-
|
|
1
|
+
import{bM as rr,r as h,bN as nr,j as y,aP as on,bl as Q,bZ as an,b_ as sn,b$ as un,bW as ln}from"./index-XsaRyZHq.js";import{s as cn}from"./index-BCTkptLY.js";/**
|
|
2
2
|
* @license lucide-react v1.8.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -8,14 +8,14 @@ import{bM as rr,r as h,bN as nr,j as y,aP as on,bl as Q,bZ as an,b_ as sn,b$ as
|
|
|
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"},Dn={width:"4px",height:"4px",boxShadow:"0 0 0 3px #4B91E2",borderRadius:"50%"},In=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({},Dn)}),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 Dr({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(D){var l;return l=p.call(this,D)||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",D=m?O:u,l=Math.max(0,c*d-D),f=Math.min(l,r*d),g=Math.max(0,r*d-D+d+a);switch(n==="smart"&&(i>=g-D&&i<=f+D?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(D/2)?0:v>l+Math.floor(D/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 Ir=h.createContext({dragDropManager:void 0}),j;(function(t){t.SOURCE="SOURCE",t.TARGET="TARGET"})(j||(j={}));function I(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",De="dnd-core/DROP",Ie="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 D=c.getSourceType(d);return{type:Oe,payload:{itemType:D,item:m,sourceId:d,clientOffset:a||null,sourceClientOffset:p||null,isSourcePublic:!!o}}}}}function li(t,e,r){I(!e.isDragging(),"Cannot call beginDrag while dragging."),t.forEach(function(n){I(r.getSource(n),"Expected sourceIds to be registered.")})}function ci(t){I(typeof t=="function","When clientOffset is provided, getSourceClientOffset must be a function.")}function di(t){I(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){I(Array.isArray(t),"Expected targetIds to be an array.")}function vi(t,e,r){I(e.isDragging(),"Cannot call hover while not dragging."),I(!e.didDrop(),"Cannot call hover after drop.");for(var n=0;n<t.length;n++){var i=t[n];I(t.lastIndexOf(i)===n,"Expected targetIds to be unique in the passed array.");var o=r.getTarget(i);I(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=Di(a,s,i,n),c={type:De,payload:{dropResult:mt(mt({},r),u)}};t.dispatch(c)})}}function Si(t){I(t.isDragging(),"Cannot call drop while not dragging."),I(!t.didDrop(),"Cannot call drop twice during one drag operation.")}function Di(t,e,r,n){var i=r.getTarget(t),o=i?i.drop(n,t):void 0;return Ii(o),typeof o>"u"&&(o=e===0?{}:n.getDropResult()),o}function Ii(t){I(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:Ie}}}function Ci(t){I(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 D(){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]=D,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 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 It(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){ji(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 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:It(It({},t),{},{clientOffset:r.clientOffset});case Ie:case De: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 De:return M(M({},t),{},{dropResult:r.dropResult,didDrop:!0,targetIds:[]});case Ie: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 Ie:case De: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;I(typeof r=="function","listener must be a function."),I(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;I(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 I(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(I(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(I(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){I(typeof t.canDrag=="function","Expected canDrag to be a function."),I(typeof t.beginDrag=="function","Expected beginDrag to be a function."),I(typeof t.endDrag=="function","Expected endDrag to be a function.")}function so(t){I(typeof t.canDrop=="function","Expected canDrop to be a function."),I(typeof t.hover=="function","Expected hover to be a function."),I(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}I(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 Io(t)||Do(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 So(t,e){if(t){if(typeof t=="string")return Nt(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 Nt(t,e)}}function Nt(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 Do(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 Io(t){if(Array.isArray(t))return t}function To(t){var e=oo().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 Pt(t){switch(t[0]){case"S":return j.SOURCE;case"T":return j.TARGET;default:I(!1,"Cannot parse handler ID: ".concat(t))}}function Rt(t,e){var r=t.entries(),n=!1;do{var i=r.next(),o=i.done,a=bo(i.value,2),s=a[1];if(s===e)return!0;n=!!o}while(!n);return!1}var wo=(function(){function t(e){vo(this,t),
|
|
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(Ir.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(){I(!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;I(!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;I(!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 I(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(Ir),e=t.dragDropManager;return I(e!=null,"Expected drag drop context"),e}function da(t){return h.useMemo(function(){var e=t.type;return I(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.
|
|
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"},Dn={width:"4px",height:"4px",boxShadow:"0 0 0 3px #4B91E2",borderRadius:"50%"},In=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({},Dn)}),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 Dr({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 K=null;function pt(t){if(t===void 0&&(t=!1),K===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?K="positive-descending":(e.scrollLeft=1,e.scrollLeft===0?K="negative":K="positive-ascending"),document.body.removeChild(e),K}return K}var Vn=150,Kn=function(e,r){return e};function Gn(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(D){var l;return l=p.call(this,D)||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?Kn: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=Gn({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",D=m?O:u,l=Math.max(0,c*d-D),f=Math.min(l,r*d),g=Math.max(0,r*d-D+d+a);switch(n==="smart"&&(i>=g-D&&i<=f+D?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(D/2)?0:v>l+Math.floor(D/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 Ir=h.createContext({dragDropManager:void 0}),j;(function(t){t.SOURCE="SOURCE",t.TARGET="TARGET"})(j||(j={}));function I(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",De="dnd-core/DROP",Ie="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 D=c.getSourceType(d);return{type:Oe,payload:{itemType:D,item:m,sourceId:d,clientOffset:a||null,sourceClientOffset:p||null,isSourcePublic:!!o}}}}}function li(t,e,r){I(!e.isDragging(),"Cannot call beginDrag while dragging."),t.forEach(function(n){I(r.getSource(n),"Expected sourceIds to be registered.")})}function ci(t){I(typeof t=="function","When clientOffset is provided, getSourceClientOffset must be a function.")}function di(t){I(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){I(Array.isArray(t),"Expected targetIds to be an array.")}function vi(t,e,r){I(e.isDragging(),"Cannot call hover while not dragging."),I(!e.didDrop(),"Cannot call hover after drop.");for(var n=0;n<t.length;n++){var i=t[n];I(t.lastIndexOf(i)===n,"Expected targetIds to be unique in the passed array.");var o=r.getTarget(i);I(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=Di(a,s,i,n),c={type:De,payload:{dropResult:mt(mt({},r),u)}};t.dispatch(c)})}}function Si(t){I(t.isDragging(),"Cannot call drop while not dragging."),I(!t.didDrop(),"Cannot call drop twice during one drag operation.")}function Di(t,e,r,n){var i=r.getTarget(t),o=i?i.drop(n,t):void 0;return Ii(o),typeof o>"u"&&(o=e===0?{}:n.getDropResult()),o}function Ii(t){I(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:Ie}}}function Ci(t){I(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 D(){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]=D,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 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 It(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){ji(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 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:It(It({},t),{},{clientOffset:r.clientOffset});case Ie:case De: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 De:return M(M({},t),{},{dropResult:r.dropResult,didDrop:!0,targetIds:[]});case Ie: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 Ki(){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 Ie:case De: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 Gi(){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:Ki(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:Gi(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;I(typeof r=="function","listener must be a function."),I(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;I(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 I(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(I(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(I(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){I(typeof t.canDrag=="function","Expected canDrag to be a function."),I(typeof t.beginDrag=="function","Expected beginDrag to be a function."),I(typeof t.endDrag=="function","Expected endDrag to be a function.")}function so(t){I(typeof t.canDrop=="function","Expected canDrop to be a function."),I(typeof t.hover=="function","Expected hover to be a function."),I(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}I(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 G(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 Io(t)||Do(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 So(t,e){if(t){if(typeof t=="string")return Nt(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 Nt(t,e)}}function Nt(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 Do(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 Io(t){if(Array.isArray(t))return t}function To(t){var e=oo().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 Pt(t){switch(t[0]){case"S":return j.SOURCE;case"T":return j.TARGET;default:I(!1,"Cannot parse handler ID: ".concat(t))}}function Rt(t,e){var r=t.entries(),n=!1;do{var i=r.next(),o=i.done,a=bo(i.value,2),s=a[1];if(s===e)return!0;n=!!o}while(!n);return!1}var wo=(function(){function t(e){vo(this,t),G(this,"types",new Map),G(this,"dragSources",new Map),G(this,"dropTargets",new Map),G(this,"pinnedSourceId",null),G(this,"pinnedSource",null),G(this,"store",void 0),this.store=e}return mo(t,[{key:"addSource",value:function(r,n){qe(r),ao(n);var i=this.addHandler(j.SOURCE,r,n);return this.store.dispatch($i(i)),i}},{key:"addTarget",value:function(r,n){qe(r,!0),so(n);var i=this.addHandler(j.TARGET,r,n);return this.store.dispatch(Fi(i)),i}},{key:"containsHandler",value:function(r){return Rt(this.dragSources,r)||Rt(this.dropTargets,r)}},{key:"getSource",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;I(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 I(this.isTargetId(r),"Expected a valid target ID."),this.dropTargets.get(r)}},{key:"getSourceType",value:function(r){return I(this.isSourceId(r),"Expected a valid source ID."),this.types.get(r)}},{key:"getTargetType",value:function(r){return I(this.isTargetId(r),"Expected a valid target ID."),this.types.get(r)}},{key:"isSourceId",value:function(r){var n=Pt(r);return n===j.SOURCE}},{key:"isTargetId",value:function(r){var n=Pt(r);return n===j.TARGET}},{key:"removeSource",value:function(r){var n=this;I(this.getSource(r),"Expected an existing source."),this.store.dispatch(Hi(r)),po(function(){n.dragSources.delete(r),n.types.delete(r)})}},{key:"removeTarget",value:function(r){I(this.getTarget(r),"Expected an existing target."),this.store.dispatch(Ui(r)),this.dropTargets.delete(r),this.types.delete(r)}},{key:"pinSource",value:function(r){var n=this.getSource(r);I(n,"Expected an existing source."),this.pinnedSourceId=r,this.pinnedSource=n}},{key:"unpinSource",value:function(){I(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}},{key:"addHandler",value:function(r,n,i){var o=To(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 Co(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=Eo(n),o=new no(i,new wo(i)),a=new Pi(i,o),s=t(a,e,r);return a.receiveBackend(s),a}function Eo(t){var e=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__;return wr(Xi,t&&e&&e({name:"dnd-core",instanceId:"dnd-core"}))}var _o=["children"];function xo(t,e){return ko(t)||Ro(t,e)||Po(t,e)||No()}function No(){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 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(Ir.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(){I(!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;I(!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;I(!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 Ko(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 Go(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;Ko(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=Go(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 I(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 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 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!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 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!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 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(Ir),e=t.dragDropManager;return I(e!=null,"Expected drag drop context"),e}function da(t){return h.useMemo(function(){var e=t.type;return I(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
14
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ga(t,e){if(t){if(typeof t=="string")return $t(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 $t(t,e)}}function $t(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 pa(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 va(t){if(Array.isArray(t))return t}function ya(t,e,r){var n=W(),i=ca(t,e,r),o=da(t);B(function(){if(o!=null){var s=oa(o,i,n),u=fa(s,2),c=u[0],d=u[1];return e.receiveHandlerId(c),r.receiveHandlerId(c),d}},[n,e,r,i,o])}function ma(t){return Da(t)||Sa(t)||Oa(t)||ba()}function ba(){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 Oa(t,e){if(t){if(typeof t=="string")return
|
|
15
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Oa(t,e){if(t){if(typeof t=="string")return Ge(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 Ge(t,e)}}function Sa(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function Da(t){if(Array.isArray(t))return Ge(t)}function Ge(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 Rr(t,e){var r=ma(e||[]);return e==null&&typeof t!="function"&&r.push(t),h.useMemo(function(){return typeof t=="function"?t():t},r)}function Ia(){var t=W();return h.useMemo(function(){return new zo(t)},[t])}function Ta(t,e){var r=W(),n=h.useMemo(function(){return new Zo(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 wa(){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 Ca=wa();const Ea=on(Ca);function _a(t,e){return Ra(t)||Pa(t,e)||Na(t,e)||xa()}function xa(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
16
16
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Na(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 Pa(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 Ra(t){if(Array.isArray(t))return t}function kr(t,e,r){var n=h.useState(function(){return e(t)}),i=_a(n,2),o=i[0],a=i[1],s=h.useCallback(function(){var u=e(t);Ea(o,u)||(a(u),r&&r())},[o,t,r]);return B(s),[o,s]}function ka(t,e){return La(t)||ja(t,e)||Ma(t,e)||Aa()}function Aa(){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 Ma(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 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 La(t){if(Array.isArray(t))return t}function $a(t,e,r){var n=kr(t,e,r),i=ka(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 Ar(t,e,r){return $a(e,t||function(){return{}},function(){return r.reconnect()})}function Fa(t){return h.useMemo(function(){return t.hooks.dragSource()},[t])}function Ha(t){return h.useMemo(function(){return t.hooks.dragPreview()},[t])}function Ua(t,e){var r=Rr(t,e);I(!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=Ia(),i=Ta(r.options,r.previewOptions);return ya(r,n,i),[Ar(r.collect,n,i),Fa(i),Ha(i)]}function za(t){var e=t.accept;return h.useMemo(function(){return I(t.accept!=null,"accept must be defined"),Array.isArray(e)?e:[e]},[e])}function Ba(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Wa(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 qa(t,e,r){return e&&Wa(t.prototype,e),t}function zt(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Va=(function(){function t(e,r){Ba(this,t),zt(this,"spec",void 0),zt(this,"monitor",void 0),this.spec=e,this.monitor=r}return qa(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
|
|
18
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Xa(t,e){if(t){if(typeof t=="string")return Bt(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 Bt(t,e)}}function Bt(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 Qa(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 Ja(t){if(Array.isArray(t))return t}function Za(t,e,r){var n=W(),i=
|
|
19
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function os(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 as(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 ss(t){if(Array.isArray(t))return t}function us(t){var e=W(),r=e.getMonitor(),n=kr(r,t),i=ns(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 jr(t){var e=null,r=function(){return e==null&&(e=t()),e};return r}function ls(t,e){return t.filter(function(r){return r!==e})}function cs(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 ds(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function fs(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 hs(t,e,r){return e&&fs(t.prototype,e),t}function qt(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var gs=(function(){function t(e){ds(this,t),qt(this,"entered",[]),qt(this,"isNodeInDocument",void 0),this.isNodeInDocument=e}return hs(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=cs(this.entered.filter(o),[r]),i===0&&this.entered.length>0}},{key:"leave",value:function(r){var n=this.entered.length;return this.entered=ls(this.entered.filter(this.isNodeInDocument),r),n>0&&this.entered.length===0}},{key:"reset",value:function(){this.entered=[]}}]),t})(),ps=jr(function(){return/firefox/i.test(navigator.userAgent)}),Lr=jr(function(){return!!window.safari});function vs(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ys(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 ms(t,e,r){return e&&ys(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 Vt=(function(){function t(e,r){vs(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],D=s[O+1];if(m*D<=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)/D))}}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 ms(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],D=m*m;return i[u]+o[u]*m+a[u]*D+s[u]*m*D}}]),t})(),bs=1;function $r(t){var e=t.nodeType===bs?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 Os(t){var e;return t.nodeName==="IMG"&&(ps()||!((e=document.documentElement)!==null&&e!==void 0&&e.contains(t)))}function Ss(t,e,r,n){var i=t?e.width:r,o=t?e.height:n;return Lr()&&t&&(o/=window.devicePixelRatio,i/=window.devicePixelRatio),{dragPreviewWidth:i,dragPreviewHeight:o}}function Ds(t,e,r,n,i){var o=Os(e),a=o?t:e,s=$r(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=Ss(o,e,c,d),D=m.dragPreviewWidth,l=m.dragPreviewHeight,f=function(){var b=new Vt([0,.5,1],[u.y,u.y/d*l,u.y+l-d]),_=b.interpolate(O);return Lr()&&o&&(_+=(window.devicePixelRatio-1)*l),_},g=function(){var b=new Vt([0,.5,1],[u.x,u.x/c*D,u.x+D-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 Fr="__NATIVE_FILE__",Hr="__NATIVE_URL__",Ur="__NATIVE_TEXT__",zr="__NATIVE_HTML__";const
|
|
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 Is(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){Is(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(),D=m.anchorX,l=m.anchorY,f=m.offsetX,g=m.offsetY,v={anchorX:D,anchorY:l},S={offsetX:f,offsetY:g},w=Ds(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,D=n.renderRow;return y.jsx(D,{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||Dr}get renderCursor(){return this.props.renderCursor||In}}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 D(){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]:D}}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],D=O(m,s);if(typeof D>"u")throw s&&s.type,new Error(R(14));c[p]=D,u=u||D!==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||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 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]=uu(t.initialData);return Object.assign(Object.assign(Object.assign({},t),r),{data:e})}else return t}function cu(t,e){const r=lu(t);return y.jsxs(eu,{treeProps:r,imperativeHandle:e,children:[y.jsx(ru,{children:y.jsx(nu,{})}),y.jsx(iu,{})]})}const du=h.forwardRef(cu),
|
|
17
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ma(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 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 La(t){if(Array.isArray(t))return t}function $a(t,e,r){var n=kr(t,e,r),i=ka(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 Ar(t,e,r){return $a(e,t||function(){return{}},function(){return r.reconnect()})}function Fa(t){return h.useMemo(function(){return t.hooks.dragSource()},[t])}function Ha(t){return h.useMemo(function(){return t.hooks.dragPreview()},[t])}function Ua(t,e){var r=Rr(t,e);I(!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=Ia(),i=Ta(r.options,r.previewOptions);return ya(r,n,i),[Ar(r.collect,n,i),Fa(i),Ha(i)]}function za(t){var e=t.accept;return h.useMemo(function(){return I(t.accept!=null,"accept must be defined"),Array.isArray(e)?e:[e]},[e])}function Ba(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Wa(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 qa(t,e,r){return e&&Wa(t.prototype,e),t}function zt(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Va=(function(){function t(e,r){Ba(this,t),zt(this,"spec",void 0),zt(this,"monitor",void 0),this.spec=e,this.monitor=r}return qa(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 Ka(t,e){var r=h.useMemo(function(){return new Va(t,e)},[e]);return h.useEffect(function(){r.spec=t},[t]),r}function Ga(t,e){return Ja(t)||Qa(t,e)||Xa(t,e)||Ya()}function Ya(){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 Xa(t,e){if(t){if(typeof t=="string")return Bt(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 Bt(t,e)}}function Bt(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 Qa(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 Ja(t){if(Array.isArray(t))return t}function Za(t,e,r){var n=W(),i=Ka(t,e),o=za(t);B(function(){var s=ia(o,i,n),u=Ga(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 es(){var t=W();return h.useMemo(function(){return new Vo(t)},[t])}function ts(t){var e=W(),r=h.useMemo(function(){return new na(e.getBackend())},[e]);return B(function(){return r.dropTargetOptions=t||null,r.reconnect(),function(){return r.disconnectDropTarget()}},[t]),r}function rs(t){return h.useMemo(function(){return t.hooks.dropTarget()},[t])}function Mr(t,e){var r=Rr(t,e),n=es(),i=ts(r.options);return Za(r,n,i),[Ar(r.collect,n,i),rs(i)]}function ns(t,e){return ss(t)||as(t,e)||os(t,e)||is()}function is(){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 os(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 as(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 ss(t){if(Array.isArray(t))return t}function us(t){var e=W(),r=e.getMonitor(),n=kr(r,t),i=ns(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 jr(t){var e=null,r=function(){return e==null&&(e=t()),e};return r}function ls(t,e){return t.filter(function(r){return r!==e})}function cs(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 ds(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function fs(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 hs(t,e,r){return e&&fs(t.prototype,e),t}function qt(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var gs=(function(){function t(e){ds(this,t),qt(this,"entered",[]),qt(this,"isNodeInDocument",void 0),this.isNodeInDocument=e}return hs(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=cs(this.entered.filter(o),[r]),i===0&&this.entered.length>0}},{key:"leave",value:function(r){var n=this.entered.length;return this.entered=ls(this.entered.filter(this.isNodeInDocument),r),n>0&&this.entered.length===0}},{key:"reset",value:function(){this.entered=[]}}]),t})(),ps=jr(function(){return/firefox/i.test(navigator.userAgent)}),Lr=jr(function(){return!!window.safari});function vs(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ys(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 ms(t,e,r){return e&&ys(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 Vt=(function(){function t(e,r){vs(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],D=s[O+1];if(m*D<=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)/D))}}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 ms(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],D=m*m;return i[u]+o[u]*m+a[u]*D+s[u]*m*D}}]),t})(),bs=1;function $r(t){var e=t.nodeType===bs?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 Os(t){var e;return t.nodeName==="IMG"&&(ps()||!((e=document.documentElement)!==null&&e!==void 0&&e.contains(t)))}function Ss(t,e,r,n){var i=t?e.width:r,o=t?e.height:n;return Lr()&&t&&(o/=window.devicePixelRatio,i/=window.devicePixelRatio),{dragPreviewWidth:i,dragPreviewHeight:o}}function Ds(t,e,r,n,i){var o=Os(e),a=o?t:e,s=$r(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=Ss(o,e,c,d),D=m.dragPreviewWidth,l=m.dragPreviewHeight,f=function(){var b=new Vt([0,.5,1],[u.y,u.y/d*l,u.y+l-d]),_=b.interpolate(O);return Lr()&&o&&(_+=(window.devicePixelRatio-1)*l),_},g=function(){var b=new Vt([0,.5,1],[u.x,u.x/c*D,u.x+D-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 Fr="__NATIVE_FILE__",Hr="__NATIVE_URL__",Ur="__NATIVE_TEXT__",zr="__NATIVE_HTML__";const Kt=Object.freeze(Object.defineProperty({__proto__:null,FILE:Fr,HTML:zr,TEXT:Ur,URL:Hr},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 Ye=(Y={},se(Y,Fr,{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,zr,{exposeProperties:{html:function(e,r){return Ae(e,r,"")},dataTransfer:function(e){return e}},matchesTypes:["Html","text/html"]}),se(Y,Hr,{exposeProperties:{urls:function(e,r){return Ae(e,r,"").split(`
|
|
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 Is(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 Gt(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){Is(this,t),Gt(this,"item",void 0),Gt(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(),D=m.anchorX,l=m.anchorY,f=m.offsetX,g=m.offsetY,v={anchorX:D,anchorY:l},S={offsetX:f,offsetY:g},w=Ds(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(Kt).some(function(n){return Kt[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,D=n.renderRow;return y.jsx(D,{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||Dr}get renderCursor(){return this.props.renderCursor||In}}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",er=Ks,He=()=>Math.random().toString(36).substring(7).split("").join("."),Gs={INIT:`@@redux/INIT${He()}`,REPLACE:`@@redux/REPLACE${He()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${He()}`},be=Gs;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 D(){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]:D}}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],D=O(m,s);if(typeof D>"u")throw s&&s.type,new Error(R(14));c[p]=D,u=u||D!==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||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 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 Kr({id:"ROOT"},null);return e.children=t.map(r=>nt(r,e)),e}function nt(t,e){const r=new Kr(t,e);return t.children&&(r.children=t.children.map(n=>nt(n,r))),r}class Kr{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]=uu(t.initialData);return Object.assign(Object.assign(Object.assign({},t),r),{data:e})}else return t}function cu(t,e){const r=lu(t);return y.jsxs(eu,{treeProps:r,imperativeHandle:e,children:[y.jsx(ru,{children:y.jsx(nu,{})}),y.jsx(iu,{})]})}const du=h.forwardRef(cu),Gr=new Set,Yr=h.createContext({onContextMenu:void 0,editing:null,pendingPaths:Gr,onSubmitEdit:void 0,onCancelEdit:void 0});function fu({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(ln,{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 hu({node:t,style:e,dragHandle:r}){const{onContextMenu:n,editing:i,pendingPaths:o,onSubmitEdit:a,onCancelEdit:s}=h.useContext(Yr),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?fn:gn:an(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(sn,{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(fu,{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(un,{"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 vu({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:D}){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??Gr,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",D),children:"No files"}):y.jsx(Yr.Provider,{value:E,children:y.jsx("div",{"data-boring-workspace-part":"file-tree",className:Q("file-tree",D),children:y.jsx(du,{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,children:hu})})})}export{vu as FileTree};
|