. Read more: https://reactjs.org/docs/refs-and-the-dom.html#callback-refs"),w?(0,R.cloneElement)(v,{ref:function(T){L(w,T),L(j,T)}}):(0,R.cloneElement)(v,{ref:j})}},36963:function(W,Y,f){"use strict";f.d(Y,{PD:function(){return C}});var E={};f.r(E),f.d(E,{FILE:function(){return k},HTML:function(){return w},TEXT:function(){return j},URL:function(){return v}});function R(a){let i=null;return()=>(i==null&&(i=a()),i)}function P(a,i){return a.filter(p=>p!==i)}function D(a,i){const p=new Set,$=F=>p.add(F);a.forEach($),i.forEach($);const _=[];return p.forEach(F=>_.push(F)),_}class N{enter(i){const p=this.entered.length,$=_=>this.isNodeInDocument(_)&&(!_.contains||_.contains(i));return this.entered=D(this.entered.filter($),[i]),p===0&&this.entered.length>0}leave(i){const p=this.entered.length;return this.entered=P(this.entered.filter(this.isNodeInDocument),i),p>0&&this.entered.length===0}reset(){this.entered=[]}constructor(i){this.entered=[],this.isNodeInDocument=i}}class L{initializeExposedProperties(){Object.keys(this.config.exposeProperties).forEach(i=>{Object.defineProperty(this.item,i,{configurable:!0,enumerable:!0,get(){return console.warn(`Browser doesn't allow reading "${i}" until the drop event.`),null}})})}loadDataTransfer(i){if(i){const p={};Object.keys(this.config.exposeProperties).forEach($=>{const _=this.config.exposeProperties[$];_!=null&&(p[$]={value:_(i,this.config.matchesTypes),configurable:!0,enumerable:!0})}),Object.defineProperties(this.item,p)}}canDrag(){return!0}beginDrag(){return this.item}isDragging(i,p){return p===i.getSourceId()}endDrag(){}constructor(i){this.config=i,this.item={},this.initializeExposedProperties()}}const k="__NATIVE_FILE__",v="__NATIVE_URL__",j="__NATIVE_TEXT__",w="__NATIVE_HTML__";function M(a,i,p){const $=i.reduce((_,F)=>_||a.getData(F),"");return $??p}const T={[k]:{exposeProperties:{files:a=>Array.prototype.slice.call(a.files),items:a=>a.items,dataTransfer:a=>a},matchesTypes:["Files"]},[w]:{exposeProperties:{html:(a,i)=>M(a,i,""),dataTransfer:a=>a},matchesTypes:["Html","text/html"]},[v]:{exposeProperties:{urls:(a,i)=>M(a,i,"").split(`
`),dataTransfer:a=>a},matchesTypes:["Url","text/uri-list"]},[j]:{exposeProperties:{text:(a,i)=>M(a,i,""),dataTransfer:a=>a},matchesTypes:["Text","text/plain"]}};function Z(a,i){const p=T[a];if(!p)throw new Error(`native type ${a} has no configuration`);const $=new L(p);return $.loadDataTransfer(i),$}function ne(a){if(!a)return null;const i=Array.prototype.slice.call(a.types||[]);return Object.keys(T).filter(p=>{const $=T[p];return $!=null&&$.matchesTypes?$.matchesTypes.some(_=>i.indexOf(_)>-1):!1})[0]||null}const fe=R(()=>/firefox/i.test(navigator.userAgent)),le=R(()=>Boolean(window.safari));class Me{interpolate(i){const{xs:p,ys:$,c1s:_,c2s:F,c3s:he}=this;let oe=p.length-1;if(i===p[oe])return $[oe];let me=0,ae=he.length-1,Ce;for(;me<=ae;){Ce=Math.floor(.5*(me+ae));const et=p[Ce];if(et
i)ae=Ce-1;else return $[Ce]}oe=Math.max(0,ae);const Fe=i-p[oe],Ie=Fe*Fe;return $[oe]+_[oe]*Fe+F[oe]*Ie+he[oe]*Fe*Ie}constructor(i,p){const{length:$}=i,_=[];for(let De=0;De<$;De++)_.push(De);_.sort((De,Ze)=>i[De]{let Xe=new Me([0,.5,1],[me.y,me.y/Ce*De,me.y+De-Ce]).interpolate(Ie);return le()&&F&&(Xe+=(window.devicePixelRatio-1)*De),Xe},Be=()=>new Me([0,.5,1],[me.x,me.x/ae*et,me.x+et-ae]).interpolate(Fe),{offsetX:Ve,offsetY:it}=_,ft=Ve===0||Ve,pt=it===0||it;return{x:ft?Ve:Be(),y:pt?it:Ze()}}class d{get window(){if(this.globalContext)return this.globalContext;if(typeof window<"u")return window}get document(){var i;return!((i=this.globalContext)===null||i===void 0)&&i.document?this.globalContext.document:this.window?this.window.document:void 0}get rootElement(){var i;return((i=this.optionsArgs)===null||i===void 0?void 0:i.rootElement)||this.window}constructor(i,p){this.ownerDocument=null,this.globalContext=i,this.optionsArgs=p}}function h(a,i,p){return i in a?Object.defineProperty(a,i,{value:p,enumerable:!0,configurable:!0,writable:!0}):a[i]=p,a}function y(a){for(var i=1;i{this.sourcePreviewNodes.delete(i),this.sourcePreviewNodeOptions.delete(i)}}connectDragSource(i,p,$){this.sourceNodes.set(i,p),this.sourceNodeOptions.set(i,$);const _=he=>this.handleDragStart(he,i),F=he=>this.handleSelectStart(he);return p.setAttribute("draggable","true"),p.addEventListener("dragstart",_),p.addEventListener("selectstart",F),()=>{this.sourceNodes.delete(i),this.sourceNodeOptions.delete(i),p.removeEventListener("dragstart",_),p.removeEventListener("selectstart",F),p.setAttribute("draggable","false")}}connectDropTarget(i,p){const $=he=>this.handleDragEnter(he,i),_=he=>this.handleDragOver(he,i),F=he=>this.handleDrop(he,i);return p.addEventListener("dragenter",$),p.addEventListener("dragover",_),p.addEventListener("drop",F),()=>{p.removeEventListener("dragenter",$),p.removeEventListener("dragover",_),p.removeEventListener("drop",F)}}addEventListeners(i){!i.addEventListener||(i.addEventListener("dragstart",this.handleTopDragStart),i.addEventListener("dragstart",this.handleTopDragStartCapture,!0),i.addEventListener("dragend",this.handleTopDragEndCapture,!0),i.addEventListener("dragenter",this.handleTopDragEnter),i.addEventListener("dragenter",this.handleTopDragEnterCapture,!0),i.addEventListener("dragleave",this.handleTopDragLeaveCapture,!0),i.addEventListener("dragover",this.handleTopDragOver),i.addEventListener("dragover",this.handleTopDragOverCapture,!0),i.addEventListener("drop",this.handleTopDrop),i.addEventListener("drop",this.handleTopDropCapture,!0))}removeEventListeners(i){!i.removeEventListener||(i.removeEventListener("dragstart",this.handleTopDragStart),i.removeEventListener("dragstart",this.handleTopDragStartCapture,!0),i.removeEventListener("dragend",this.handleTopDragEndCapture,!0),i.removeEventListener("dragenter",this.handleTopDragEnter),i.removeEventListener("dragenter",this.handleTopDragEnterCapture,!0),i.removeEventListener("dragleave",this.handleTopDragLeaveCapture,!0),i.removeEventListener("dragover",this.handleTopDragOver),i.removeEventListener("dragover",this.handleTopDragOverCapture,!0),i.removeEventListener("drop",this.handleTopDrop),i.removeEventListener("drop",this.handleTopDropCapture,!0))}getCurrentSourceNodeOptions(){const i=this.monitor.getSourceId(),p=this.sourceNodeOptions.get(i);return y({dropEffect:this.altKeyPressed?"copy":"move"},p||{})}getCurrentDropEffect(){return this.isDraggingNativeItem()?"copy":this.getCurrentSourceNodeOptions().dropEffect}getCurrentSourcePreviewNodeOptions(){const i=this.monitor.getSourceId(),p=this.sourcePreviewNodeOptions.get(i);return y({anchorX:.5,anchorY:.5,captureDraggingState:!1},p||{})}isDraggingNativeItem(){const i=this.monitor.getItemType();return Object.keys(E).some(p=>E[p]===i)}beginDragNativeItem(i,p){this.clearCurrentDragSourceNode(),this.currentNativeSource=Z(i,p),this.currentNativeHandle=this.registry.addSource(i,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle])}setCurrentDragSourceNode(i){this.clearCurrentDragSourceNode(),this.currentDragSourceNode=i;const p=1e3;this.mouseMoveTimeoutTimer=setTimeout(()=>{var $;return($=this.rootElement)===null||$===void 0?void 0:$.addEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)},p)}clearCurrentDragSourceNode(){if(this.currentDragSourceNode){if(this.currentDragSourceNode=null,this.rootElement){var i;(i=this.window)===null||i===void 0||i.clearTimeout(this.mouseMoveTimeoutTimer||void 0),this.rootElement.removeEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)}return this.mouseMoveTimeoutTimer=null,!0}return!1}handleDragStart(i,p){i.defaultPrevented||(this.dragStartSourceIds||(this.dragStartSourceIds=[]),this.dragStartSourceIds.unshift(p))}handleDragEnter(i,p){this.dragEnterTargetIds.unshift(p)}handleDragOver(i,p){this.dragOverTargetIds===null&&(this.dragOverTargetIds=[]),this.dragOverTargetIds.unshift(p)}handleDrop(i,p){this.dropTargetIds.unshift(p)}constructor(i,p,$){this.sourcePreviewNodes=new Map,this.sourcePreviewNodeOptions=new Map,this.sourceNodes=new Map,this.sourceNodeOptions=new Map,this.dragStartSourceIds=null,this.dropTargetIds=[],this.dragEnterTargetIds=[],this.currentNativeSource=null,this.currentNativeHandle=null,this.currentDragSourceNode=null,this.altKeyPressed=!1,this.mouseMoveTimeoutTimer=null,this.asyncEndDragFrameId=null,this.dragOverTargetIds=null,this.lastClientOffset=null,this.hoverRafId=null,this.getSourceClientOffset=_=>{const F=this.sourceNodes.get(_);return F&&Ae(F)||null},this.endDragNativeItem=()=>{!this.isDraggingNativeItem()||(this.actions.endDrag(),this.currentNativeHandle&&this.registry.removeSource(this.currentNativeHandle),this.currentNativeHandle=null,this.currentNativeSource=null)},this.isNodeInDocument=_=>Boolean(_&&this.document&&this.document.body&&this.document.body.contains(_)),this.endDragIfSourceWasRemovedFromDOM=()=>{const _=this.currentDragSourceNode;_==null||this.isNodeInDocument(_)||(this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover())},this.scheduleHover=_=>{this.hoverRafId===null&&typeof requestAnimationFrame<"u"&&(this.hoverRafId=requestAnimationFrame(()=>{this.monitor.isDragging()&&this.actions.hover(_||[],{clientOffset:this.lastClientOffset}),this.hoverRafId=null}))},this.cancelHover=()=>{this.hoverRafId!==null&&typeof cancelAnimationFrame<"u"&&(cancelAnimationFrame(this.hoverRafId),this.hoverRafId=null)},this.handleTopDragStartCapture=()=>{this.clearCurrentDragSourceNode(),this.dragStartSourceIds=[]},this.handleTopDragStart=_=>{if(_.defaultPrevented)return;const{dragStartSourceIds:F}=this;this.dragStartSourceIds=null;const he=Te(_);this.monitor.isDragging()&&(this.actions.endDrag(),this.cancelHover()),this.actions.beginDrag(F||[],{publishSource:!1,getSourceClientOffset:this.getSourceClientOffset,clientOffset:he});const{dataTransfer:oe}=_,me=ne(oe);if(this.monitor.isDragging()){if(oe&&typeof oe.setDragImage=="function"){const Ce=this.monitor.getSourceId(),Fe=this.sourceNodes.get(Ce),Ie=this.sourcePreviewNodes.get(Ce)||Fe;if(Ie){const{anchorX:et,anchorY:De,offsetX:Ze,offsetY:Be}=this.getCurrentSourcePreviewNodeOptions(),ft=g(Fe,Ie,he,{anchorX:et,anchorY:De},{offsetX:Ze,offsetY:Be});oe.setDragImage(Ie,ft.x,ft.y)}}try{oe==null||oe.setData("application/json",{})}catch{}this.setCurrentDragSourceNode(_.target);const{captureDraggingState:ae}=this.getCurrentSourcePreviewNodeOptions();ae?this.actions.publishDragSource():setTimeout(()=>this.actions.publishDragSource(),0)}else if(me)this.beginDragNativeItem(me);else{if(oe&&!oe.types&&(_.target&&!_.target.hasAttribute||!_.target.hasAttribute("draggable")))return;_.preventDefault()}},this.handleTopDragEndCapture=()=>{this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleTopDragEnterCapture=_=>{if(this.dragEnterTargetIds=[],this.isDraggingNativeItem()){var F;(F=this.currentNativeSource)===null||F===void 0||F.loadDataTransfer(_.dataTransfer)}if(!this.enterLeaveCounter.enter(_.target)||this.monitor.isDragging())return;const{dataTransfer:oe}=_,me=ne(oe);me&&this.beginDragNativeItem(me,oe)},this.handleTopDragEnter=_=>{const{dragEnterTargetIds:F}=this;if(this.dragEnterTargetIds=[],!this.monitor.isDragging())return;this.altKeyPressed=_.altKey,F.length>0&&this.actions.hover(F,{clientOffset:Te(_)}),F.some(oe=>this.monitor.canDropOnTarget(oe))&&(_.preventDefault(),_.dataTransfer&&(_.dataTransfer.dropEffect=this.getCurrentDropEffect()))},this.handleTopDragOverCapture=_=>{if(this.dragOverTargetIds=[],this.isDraggingNativeItem()){var F;(F=this.currentNativeSource)===null||F===void 0||F.loadDataTransfer(_.dataTransfer)}},this.handleTopDragOver=_=>{const{dragOverTargetIds:F}=this;if(this.dragOverTargetIds=[],!this.monitor.isDragging()){_.preventDefault(),_.dataTransfer&&(_.dataTransfer.dropEffect="none");return}this.altKeyPressed=_.altKey,this.lastClientOffset=Te(_),this.scheduleHover(F),(F||[]).some(oe=>this.monitor.canDropOnTarget(oe))?(_.preventDefault(),_.dataTransfer&&(_.dataTransfer.dropEffect=this.getCurrentDropEffect())):this.isDraggingNativeItem()?_.preventDefault():(_.preventDefault(),_.dataTransfer&&(_.dataTransfer.dropEffect="none"))},this.handleTopDragLeaveCapture=_=>{this.isDraggingNativeItem()&&_.preventDefault(),this.enterLeaveCounter.leave(_.target)&&(this.isDraggingNativeItem()&&setTimeout(()=>this.endDragNativeItem(),0),this.cancelHover())},this.handleTopDropCapture=_=>{if(this.dropTargetIds=[],this.isDraggingNativeItem()){var F;_.preventDefault(),(F=this.currentNativeSource)===null||F===void 0||F.loadDataTransfer(_.dataTransfer)}else ne(_.dataTransfer)&&_.preventDefault();this.enterLeaveCounter.reset()},this.handleTopDrop=_=>{const{dropTargetIds:F}=this;this.dropTargetIds=[],this.actions.hover(F,{clientOffset:Te(_)}),this.actions.drop({dropEffect:this.getCurrentDropEffect()}),this.isDraggingNativeItem()?this.endDragNativeItem():this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleSelectStart=_=>{const F=_.target;typeof F.dragDrop=="function"&&(F.tagName==="INPUT"||F.tagName==="SELECT"||F.tagName==="TEXTAREA"||F.isContentEditable||(_.preventDefault(),F.dragDrop()))},this.options=new d(p,$),this.actions=i.getActions(),this.monitor=i.getMonitor(),this.registry=i.getRegistry(),this.enterLeaveCounter=new N(this.isNodeInDocument)}}const C=function(i,p,$){return new A(i,p,$)}}}]);