UNPKG

@selfcommunity/react-templates

Version:

React Templates Components to integrate a Community created with SelfCommunity.

2 lines • 3.06 MB
/*! For license information please see 519.js.LICENSE.txt */ (self.webpackChunkSelfCommunityReactTemplates=self.webpackChunkSelfCommunityReactTemplates||[]).push([[519],{87456:(e,t,n)=>{"use strict";n.r(t),n.d(t,{DragDropContext:()=>lr,Draggable:()=>Er,Droppable:()=>Wr,useKeyboardSensor:()=>Vn,useMouseSensor:()=>zn,useTouchSensor:()=>Kn});var r=n(8156),i=n.n(r),o=n(47111),a=n.n(o);function s(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var l=(()=>"function"==typeof Symbol&&Symbol.observable||"@@observable")(),c=()=>Math.random().toString(36).substring(7).split("").join("."),u={INIT:`@@redux/INIT${c()}`,REPLACE:`@@redux/REPLACE${c()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${c()}`};function d(e){if("object"!=typeof e||null===e)return!1;let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||null===Object.getPrototypeOf(e)}function f(e,t,n){if("function"!=typeof e)throw new Error(s(2));if("function"==typeof t&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw new Error(s(0));if("function"==typeof t&&void 0===n&&(n=t,t=void 0),void 0!==n){if("function"!=typeof n)throw new Error(s(1));return n(f)(e,t)}let r=e,i=t,o=new Map,a=o,c=0,h=!1;function p(){a===o&&(a=new Map,o.forEach(((e,t)=>{a.set(t,e)})))}function m(){if(h)throw new Error(s(3));return i}function g(e){if("function"!=typeof e)throw new Error(s(4));if(h)throw new Error(s(5));let t=!0;p();const n=c++;return a.set(n,e),function(){if(t){if(h)throw new Error(s(6));t=!1,p(),a.delete(n),o=null}}}function v(e){if(!d(e))throw new Error(s(7));if(void 0===e.type)throw new Error(s(8));if("string"!=typeof e.type)throw new Error(s(17));if(h)throw new Error(s(9));try{h=!0,i=r(i,e)}finally{h=!1}return(o=a).forEach((e=>{e()})),e}function y(e){if("function"!=typeof e)throw new Error(s(10));r=e,v({type:u.REPLACE})}function b(){const e=g;return{subscribe(t){if("object"!=typeof t||null===t)throw new Error(s(11));function n(){const e=t;e.next&&e.next(m())}return n(),{unsubscribe:e(n)}},[l](){return this}}}v({type:u.INIT});const w={dispatch:v,subscribe:g,getState:m,replaceReducer:y,[l]:b};return w}function h(e,t){return function(...n){return t(e.apply(this,n))}}function p(e,t){if("function"==typeof e)return h(e,t);if("object"!=typeof e||null===e)throw new Error(s(16));const n={};for(const r in e){const i=e[r];"function"==typeof i&&(n[r]=h(i,t))}return n}function m(...e){return 0===e.length?e=>e:1===e.length?e[0]:e.reduce(((e,t)=>(...n)=>e(t(...n))))}var g=n(34756);function v(e,t){var n=(0,r.useState)((function(){return{inputs:t,result:e()}}))[0],i=(0,r.useRef)(!0),o=(0,r.useRef)(n),a=i.current||Boolean(t&&o.current.inputs&&function(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}(t,o.current.inputs))?o.current:{inputs:t,result:e()};return(0,r.useEffect)((function(){i.current=!1,o.current=a}),[a]),a.result}var y=v,b=function(e,t){return v((function(){return e}),t)},w=function(e){var t=e.top,n=e.right,r=e.bottom,i=e.left;return{top:t,right:n,bottom:r,left:i,width:n-i,height:r-t,x:i,y:t,center:{x:(n+i)/2,y:(r+t)/2}}},S=function(e,t){return{top:e.top-t.top,left:e.left-t.left,bottom:e.bottom+t.bottom,right:e.right+t.right}},E=function(e,t){return{top:e.top+t.top,left:e.left+t.left,bottom:e.bottom-t.bottom,right:e.right-t.right}},C={top:0,right:0,bottom:0,left:0},k=function(e){var t=e.borderBox,n=e.margin,r=void 0===n?C:n,i=e.border,o=void 0===i?C:i,a=e.padding,s=void 0===a?C:a,l=w(S(t,r)),c=w(E(t,o)),u=w(E(c,s));return{marginBox:l,borderBox:w(t),paddingBox:c,contentBox:u,margin:r,border:o,padding:s}},_=function(e){var t=e.slice(0,-2);if("px"!==e.slice(-2))return 0;var n=Number(t);return isNaN(n)&&function(e,t){throw new Error("Invariant failed")}(),n},x=function(e,t){var n,r,i=e.borderBox,o=e.border,a=e.margin,s=e.padding,l=(r=t,{top:(n=i).top+r.y,left:n.left+r.x,bottom:n.bottom+r.y,right:n.right+r.x});return k({borderBox:l,border:o,margin:a,padding:s})},T=function(e,t){return void 0===t&&(t={x:window.pageXOffset,y:window.pageYOffset}),x(e,t)},P=function(e,t){var n={top:_(t.marginTop),right:_(t.marginRight),bottom:_(t.marginBottom),left:_(t.marginLeft)},r={top:_(t.paddingTop),right:_(t.paddingRight),bottom:_(t.paddingBottom),left:_(t.paddingLeft)},i={top:_(t.borderTopWidth),right:_(t.borderRightWidth),bottom:_(t.borderBottomWidth),left:_(t.borderLeftWidth)};return k({borderBox:e,margin:n,padding:r,border:i})},A=function(e){var t=e.getBoundingClientRect(),n=window.getComputedStyle(e);return P(t,n)},M=Number.isNaN||function(e){return"number"==typeof e&&e!=e};function O(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!((r=e[n])===(i=t[n])||M(r)&&M(i)))return!1;var r,i;return!0}function I(e,t){void 0===t&&(t=O);var n=null;function r(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];if(n&&n.lastThis===this&&t(r,n.lastArgs))return n.lastResult;var o=e.apply(this,r);return n={lastResult:o,lastArgs:r,lastThis:this},o}return r.clear=function(){n=null},r}const R=function(e){var t=[],n=null,r=function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];t=i,n||(n=requestAnimationFrame((function(){n=null,e.apply(void 0,t)})))};return r.cancel=function(){n&&(cancelAnimationFrame(n),n=null)},r};function D(){return D=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},D.apply(null,arguments)}function L(e,t){}function N(){}function F(e,t,n){const r=t.map((t=>{const r=(i=n,o=t.options,{...i,...o});var i,o;return e.addEventListener(t.eventName,t.fn,r),function(){e.removeEventListener(t.eventName,t.fn,r)}}));return function(){r.forEach((e=>{e()}))}}L.bind(null,"warn"),L.bind(null,"error");class $ extends Error{}function j(e,t){throw new $("Invariant failed")}$.prototype.toString=function(){return this.message};class B extends i().Component{constructor(...e){super(...e),this.callbacks=null,this.unbind=N,this.onWindowError=e=>{const t=this.getCallbacks();t.isDragging()&&t.tryAbort(),e.error instanceof $&&e.preventDefault()},this.getCallbacks=()=>{if(!this.callbacks)throw new Error("Unable to find AppCallbacks in <ErrorBoundary/>");return this.callbacks},this.setCallbacks=e=>{this.callbacks=e}}componentDidMount(){this.unbind=F(window,[{eventName:"error",fn:this.onWindowError}])}componentDidCatch(e){if(!(e instanceof $))throw e;this.setState({})}componentWillUnmount(){this.unbind()}render(){return this.props.children(this.setCallbacks)}}const U=e=>e+1,z=(e,t)=>{const n=e.droppableId===t.droppableId,r=U(e.index),i=U(t.index);return n?`\n You have moved the item from position ${r}\n to position ${i}\n `:`\n You have moved the item from position ${r}\n in list ${e.droppableId}\n to list ${t.droppableId}\n in position ${i}\n `},H=(e,t,n)=>t.droppableId===n.droppableId?`\n The item ${e}\n has been combined with ${n.draggableId}`:`\n The item ${e}\n in list ${t.droppableId}\n has been combined with ${n.draggableId}\n in list ${n.droppableId}\n `,W=e=>`\n The item has returned to its starting position\n of ${U(e.index)}\n`,V="\n Press space bar to start a drag.\n When dragging you can use the arrow keys to move the item around and escape to cancel.\n Some screen readers may require you to be in focus mode or to use your pass through key\n",G=e=>`\n You have lifted an item in position ${U(e.source.index)}\n`,K=e=>{const t=e.destination;if(t)return z(e.source,t);const n=e.combine;return n?H(e.draggableId,e.source,n):"You are over an area that cannot be dropped on"},q=e=>{if("CANCEL"===e.reason)return`\n Movement cancelled.\n ${W(e.source)}\n `;const t=e.destination,n=e.combine;return t?`\n You have dropped the item.\n ${z(e.source,t)}\n `:n?`\n You have dropped the item.\n ${H(e.draggableId,e.source,n)}\n `:`\n The item has been dropped while not over a drop area.\n ${W(e.source)}\n `},Z={x:0,y:0},Y=(e,t)=>({x:e.x+t.x,y:e.y+t.y}),J=(e,t)=>({x:e.x-t.x,y:e.y-t.y}),X=(e,t)=>e.x===t.x&&e.y===t.y,Q=e=>({x:0!==e.x?-e.x:0,y:0!==e.y?-e.y:0}),ee=(e,t,n=0)=>"x"===e?{x:t,y:n}:{x:n,y:t},te=(e,t)=>Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2),ne=(e,t)=>Math.min(...t.map((t=>te(e,t)))),re=e=>t=>({x:e(t.x),y:e(t.y)}),ie=(e,t)=>({top:e.top+t.y,left:e.left+t.x,bottom:e.bottom+t.y,right:e.right+t.x}),oe=e=>[{x:e.left,y:e.top},{x:e.right,y:e.top},{x:e.left,y:e.bottom},{x:e.right,y:e.bottom}],ae=(e,t)=>t&&t.shouldClipSubject?((e,t)=>{const n=w({top:Math.max(t.top,e.top),right:Math.min(t.right,e.right),bottom:Math.min(t.bottom,e.bottom),left:Math.max(t.left,e.left)});return n.width<=0||n.height<=0?null:n})(t.pageMarginBox,e):w(e);var se=({page:e,withPlaceholder:t,axis:n,frame:r})=>{const i=((e,t)=>t?ie(e,t.scroll.diff.displacement):e)(e.marginBox,r),o=((e,t,n)=>n&&n.increasedBy?{...e,[t.end]:e[t.end]+n.increasedBy[t.line]}:e)(i,n,t);return{page:e,withPlaceholder:t,active:ae(o,r)}},le=(e,t)=>{e.frame||j();const n=e.frame,r=J(t,n.scroll.initial),i=Q(r),o={...n,scroll:{initial:n.scroll.initial,current:t,diff:{value:r,displacement:i},max:n.scroll.max}},a=se({page:e.subject.page,withPlaceholder:e.subject.withPlaceholder,axis:e.axis,frame:o});return{...e,frame:o,subject:a}};const ce=I((e=>e.reduce(((e,t)=>(e[t.descriptor.id]=t,e)),{}))),ue=I((e=>e.reduce(((e,t)=>(e[t.descriptor.id]=t,e)),{}))),de=I((e=>Object.values(e))),fe=I((e=>Object.values(e)));var he=I(((e,t)=>{const n=fe(t).filter((t=>e===t.descriptor.droppableId)).sort(((e,t)=>e.descriptor.index-t.descriptor.index));return n}));function pe(e){return e.at&&"REORDER"===e.at.type?e.at.destination:null}function me(e){return e.at&&"COMBINE"===e.at.type?e.at.combine:null}var ge=I(((e,t)=>t.filter((t=>t.descriptor.id!==e.descriptor.id)))),ve=(e,t)=>e.descriptor.droppableId===t.descriptor.id;const ye={point:Z,value:0},be={invisible:{},visible:{},all:[]},we={displaced:be,displacedBy:ye,at:null};var Se=(e,t)=>n=>e<=n&&n<=t,Ee=e=>{const t=Se(e.top,e.bottom),n=Se(e.left,e.right);return r=>{if(t(r.top)&&t(r.bottom)&&n(r.left)&&n(r.right))return!0;const i=t(r.top)||t(r.bottom),o=n(r.left)||n(r.right);if(i&&o)return!0;const a=r.top<e.top&&r.bottom>e.bottom,s=r.left<e.left&&r.right>e.right;return!(!a||!s)||(a&&o||s&&i)}},Ce=e=>{const t=Se(e.top,e.bottom),n=Se(e.left,e.right);return e=>t(e.top)&&t(e.bottom)&&n(e.left)&&n(e.right)};const ke={direction:"vertical",line:"y",crossAxisLine:"x",start:"top",end:"bottom",size:"height",crossAxisStart:"left",crossAxisEnd:"right",crossAxisSize:"width"},_e={direction:"horizontal",line:"x",crossAxisLine:"y",start:"left",end:"right",size:"width",crossAxisStart:"top",crossAxisEnd:"bottom",crossAxisSize:"height"},xe=({target:e,destination:t,viewport:n,withDroppableDisplacement:r,isVisibleThroughFrameFn:i})=>{const o=r?((e,t)=>{const n=t.frame?t.frame.scroll.diff.displacement:Z;return ie(e,n)})(e,t):e;return((e,t,n)=>!!t.subject.active&&n(t.subject.active)(e))(o,t,i)&&((e,t,n)=>n(t)(e))(o,n,i)},Te=e=>xe({...e,isVisibleThroughFrameFn:Ce});function Pe({afterDragging:e,destination:t,displacedBy:n,viewport:r,forceShouldAnimate:i,last:o}){return e.reduce((function(e,a){const s=function(e,t){const n=e.page.marginBox,r={top:t.point.y,right:0,bottom:0,left:t.point.x};return w(S(n,r))}(a,n),l=a.descriptor.id;var c;if(e.all.push(l),c={target:s,destination:t,viewport:r,withDroppableDisplacement:!0},!xe({...c,isVisibleThroughFrameFn:Ee}))return e.invisible[a.descriptor.id]=!0,e;const u=((e,t,n)=>{if("boolean"==typeof n)return n;if(!t)return!0;const{invisible:r,visible:i}=t;if(r[e])return!1;const o=i[e];return!o||o.shouldAnimate})(l,o,i),d={draggableId:l,shouldAnimate:u};return e.visible[l]=d,e}),{all:[],visible:{},invisible:{}})}function Ae({insideDestination:e,inHomeList:t,displacedBy:n,destination:r}){const i=function(e,t){if(!e.length)return 0;const n=e[e.length-1].descriptor.index;return t.inHomeList?n:n+1}(e,{inHomeList:t});return{displaced:be,displacedBy:n,at:{type:"REORDER",destination:{droppableId:r.descriptor.id,index:i}}}}function Me({draggable:e,insideDestination:t,destination:n,viewport:r,displacedBy:i,last:o,index:a,forceShouldAnimate:s}){const l=ve(e,n);if(null==a)return Ae({insideDestination:t,inHomeList:l,displacedBy:i,destination:n});const c=t.find((e=>e.descriptor.index===a));if(!c)return Ae({insideDestination:t,inHomeList:l,displacedBy:i,destination:n});const u=ge(e,t),d=t.indexOf(c);return{displaced:Pe({afterDragging:u.slice(d),destination:n,displacedBy:i,last:o,viewport:r.frame,forceShouldAnimate:s}),displacedBy:i,at:{type:"REORDER",destination:{droppableId:n.descriptor.id,index:a}}}}function Oe(e,t){return Boolean(t.effected[e])}const Ie=(e,t)=>t.margin[e.start]+t.borderBox[e.size]/2,Re=(e,t,n)=>t[e.crossAxisStart]+n.margin[e.crossAxisStart]+n.borderBox[e.crossAxisSize]/2,De=({axis:e,moveRelativeTo:t,isMoving:n})=>ee(e.line,t.marginBox[e.end]+Ie(e,n),Re(e,t.marginBox,n)),Le=({axis:e,moveRelativeTo:t,isMoving:n})=>ee(e.line,t.marginBox[e.start]-((e,t)=>t.margin[e.end]+t.borderBox[e.size]/2)(e,n),Re(e,t.marginBox,n));var Ne=(e,t)=>{const n=e.frame;return n?Y(t,n.scroll.diff.displacement):t},Fe=e=>{const t=(({impact:e,draggable:t,droppable:n,draggables:r,afterCritical:i})=>{const o=t.page.borderBox.center,a=e.at;return n&&a?"REORDER"===a.type?(({impact:e,draggable:t,draggables:n,droppable:r,afterCritical:i})=>{const o=he(r.descriptor.id,n),a=t.page,s=r.axis;if(!o.length)return(({axis:e,moveInto:t,isMoving:n})=>ee(e.line,t.contentBox[e.start]+Ie(e,n),Re(e,t.contentBox,n)))({axis:s,moveInto:r.page,isMoving:a});const{displaced:l,displacedBy:c}=e,u=l.all[0];if(u){const e=n[u];if(Oe(u,i))return Le({axis:s,moveRelativeTo:e.page,isMoving:a});const t=x(e.page,c.point);return Le({axis:s,moveRelativeTo:t,isMoving:a})}const d=o[o.length-1];if(d.descriptor.id===t.descriptor.id)return a.borderBox.center;if(Oe(d.descriptor.id,i)){const e=x(d.page,Q(i.displacedBy.point));return De({axis:s,moveRelativeTo:e,isMoving:a})}return De({axis:s,moveRelativeTo:d.page,isMoving:a})})({impact:e,draggable:t,draggables:r,droppable:n,afterCritical:i}):(({afterCritical:e,impact:t,draggables:n})=>{const r=me(t);r||j();const i=r.draggableId,o=n[i].page.borderBox.center,a=(({displaced:e,afterCritical:t,combineWith:n,displacedBy:r})=>{const i=Boolean(e.visible[n]||e.invisible[n]);return Oe(n,t)?i?Z:Q(r.point):i?r.point:Z})({displaced:t.displaced,afterCritical:e,combineWith:i,displacedBy:t.displacedBy});return Y(o,a)})({impact:e,draggables:r,afterCritical:i}):o})(e),n=e.droppable;return n?Ne(n,t):t},$e=(e,t)=>{const n=J(t,e.scroll.initial),r=Q(n);return{frame:w({top:t.y,bottom:t.y+e.frame.height,left:t.x,right:t.x+e.frame.width}),scroll:{initial:e.scroll.initial,max:e.scroll.max,current:t,diff:{value:n,displacement:r}}}};function je(e,t){return e.map((e=>t[e]))}var Be=({pageBorderBoxCenter:e,draggable:t,viewport:n})=>{const r=((e,t)=>Y(e.scroll.diff.displacement,t))(n,e),i=J(r,t.page.borderBox.center);return Y(t.client.borderBox.center,i)},Ue=({draggable:e,destination:t,newPageBorderBoxCenter:n,viewport:r,withDroppableDisplacement:i,onlyOnMainAxis:o=!1})=>{const a=J(n,e.page.borderBox.center),s={target:ie(e.page.borderBox,a),destination:t,withDroppableDisplacement:i,viewport:r};return o?(e=>{return xe({...e,isVisibleThroughFrameFn:(t=e.destination.axis,e=>{const n=Se(e.top,e.bottom),r=Se(e.left,e.right);return e=>t===ke?n(e.top)&&n(e.bottom):r(e.left)&&r(e.right)})});var t})(s):Te(s)},ze=({isMovingForward:e,draggable:t,destination:n,draggables:r,previousImpact:i,viewport:o,previousPageBorderBoxCenter:a,previousClientSelection:s,afterCritical:l})=>{if(!n.isEnabled)return null;const c=he(n.descriptor.id,r),u=ve(t,n),d=(({isMovingForward:e,draggable:t,destination:n,insideDestination:r,previousImpact:i})=>{if(!n.isCombineEnabled)return null;if(!pe(i))return null;function o(e){const t={type:"COMBINE",combine:{draggableId:e,droppableId:n.descriptor.id}};return{...i,at:t}}const a=i.displaced.all,s=a.length?a[0]:null;if(e)return s?o(s):null;const l=ge(t,r);if(!s)return l.length?o(l[l.length-1].descriptor.id):null;const c=l.findIndex((e=>e.descriptor.id===s));-1===c&&j();const u=c-1;return u<0?null:o(l[u].descriptor.id)})({isMovingForward:e,draggable:t,destination:n,insideDestination:c,previousImpact:i})||(({isMovingForward:e,isInHomeList:t,draggable:n,draggables:r,destination:i,insideDestination:o,previousImpact:a,viewport:s,afterCritical:l})=>{const c=a.at;if(c||j(),"REORDER"===c.type){const r=(({isMovingForward:e,isInHomeList:t,insideDestination:n,location:r})=>{if(!n.length)return null;const i=r.index,o=e?i+1:i-1,a=n[0].descriptor.index,s=n[n.length-1].descriptor.index;return o<a||o>(t?s:s+1)?null:o})({isMovingForward:e,isInHomeList:t,location:c.destination,insideDestination:o});return null==r?null:Me({draggable:n,insideDestination:o,destination:i,viewport:s,last:a.displaced,displacedBy:a.displacedBy,index:r})}const u=(({isMovingForward:e,destination:t,draggables:n,combine:r,afterCritical:i})=>{if(!t.isCombineEnabled)return null;const o=r.draggableId,a=n[o].descriptor.index;return Oe(o,i)?e?a:a-1:e?a+1:a})({isMovingForward:e,destination:i,displaced:a.displaced,draggables:r,combine:c.combine,afterCritical:l});return null==u?null:Me({draggable:n,insideDestination:o,destination:i,viewport:s,last:a.displaced,displacedBy:a.displacedBy,index:u})})({isMovingForward:e,isInHomeList:u,draggable:t,draggables:r,destination:n,insideDestination:c,previousImpact:i,viewport:o,afterCritical:l});if(!d)return null;const f=Fe({impact:d,draggable:t,droppable:n,draggables:r,afterCritical:l});if(Ue({draggable:t,destination:n,newPageBorderBoxCenter:f,viewport:o.frame,withDroppableDisplacement:!1,onlyOnMainAxis:!0}))return{clientSelection:Be({pageBorderBoxCenter:f,draggable:t,viewport:o}),impact:d,scrollJumpRequest:null};const h=J(f,a),p=(({impact:e,viewport:t,destination:n,draggables:r,maxScrollChange:i})=>{const o=$e(t,Y(t.scroll.current,i)),a=n.frame?le(n,Y(n.frame.scroll.current,i)):n,s=e.displaced,l=Pe({afterDragging:je(s.all,r),destination:n,displacedBy:e.displacedBy,viewport:o.frame,last:s,forceShouldAnimate:!1}),c=Pe({afterDragging:je(s.all,r),destination:a,displacedBy:e.displacedBy,viewport:t.frame,last:s,forceShouldAnimate:!1}),u={},d={},f=[s,l,c];return s.all.forEach((e=>{const t=function(e,t){for(let n=0;n<t.length;n++){const r=t[n].visible[e];if(r)return r}return null}(e,f);t?d[e]=t:u[e]=!0})),{...e,displaced:{all:s.all,invisible:u,visible:d}}})({impact:d,viewport:o,destination:n,draggables:r,maxScrollChange:h});return{clientSelection:s,impact:p,scrollJumpRequest:h}};const He=e=>{const t=e.subject.active;return t||j(),t},We=(e,t)=>{const n=e.page.borderBox.center;return Oe(e.descriptor.id,t)?J(n,t.displacedBy.point):n},Ve=(e,t)=>{const n=e.page.borderBox;return Oe(e.descriptor.id,t)?ie(n,Q(t.displacedBy.point)):n};var Ge=I((function(e,t){const n=t[e.line];return{value:n,point:ee(e.line,n)}}));const Ke=(e,t)=>({...e,scroll:{...e.scroll,max:t}}),qe=(e,t,n)=>{const r=e.frame;ve(t,e)&&j(),e.subject.withPlaceholder&&j();const i=Ge(e.axis,t.displaceBy).point,o=((e,t,n)=>{const r=e.axis;if("virtual"===e.descriptor.mode)return ee(r.line,t[r.line]);const i=e.subject.page.contentBox[r.size],o=he(e.descriptor.id,n).reduce(((e,t)=>e+t.client.marginBox[r.size]),0)+t[r.line]-i;return o<=0?null:ee(r.line,o)})(e,i,n),a={placeholderSize:i,increasedBy:o,oldFrameMaxScroll:e.frame?e.frame.scroll.max:null};if(!r){const t=se({page:e.subject.page,withPlaceholder:a,axis:e.axis,frame:e.frame});return{...e,subject:t}}const s=o?Y(r.scroll.max,o):r.scroll.max,l=Ke(r,s),c=se({page:e.subject.page,withPlaceholder:a,axis:e.axis,frame:l});return{...e,subject:c,frame:l}};var Ze=e=>{const t=e.at;return t?"REORDER"===t.type?t.destination.droppableId:t.combine.droppableId:null},Ye=({state:e,type:t})=>{const n=((e,t)=>{const n=Ze(e);return n?t[n]:null})(e.impact,e.dimensions.droppables),r=Boolean(n),i=e.dimensions.droppables[e.critical.droppable.id],o=n||i,a=o.axis.direction,s="vertical"===a&&("MOVE_UP"===t||"MOVE_DOWN"===t)||"horizontal"===a&&("MOVE_LEFT"===t||"MOVE_RIGHT"===t);if(s&&!r)return null;const l="MOVE_DOWN"===t||"MOVE_RIGHT"===t,c=e.dimensions.draggables[e.critical.draggable.id],u=e.current.page.borderBoxCenter,{draggables:d,droppables:f}=e.dimensions;return s?ze({isMovingForward:l,previousPageBorderBoxCenter:u,draggable:c,destination:o,draggables:d,viewport:e.viewport,previousClientSelection:e.current.client.selection,previousImpact:e.impact,afterCritical:e.afterCritical}):(({isMovingForward:e,previousPageBorderBoxCenter:t,draggable:n,isOver:r,draggables:i,droppables:o,viewport:a,afterCritical:s})=>{const l=(({isMovingForward:e,pageBorderBoxCenter:t,source:n,droppables:r,viewport:i})=>{const o=n.subject.active;if(!o)return null;const a=n.axis,s=Se(o[a.start],o[a.end]),l=de(r).filter((e=>e!==n)).filter((e=>e.isEnabled)).filter((e=>Boolean(e.subject.active))).filter((e=>Ee(i.frame)(He(e)))).filter((t=>{const n=He(t);return e?o[a.crossAxisEnd]<n[a.crossAxisEnd]:n[a.crossAxisStart]<o[a.crossAxisStart]})).filter((e=>{const t=He(e),n=Se(t[a.start],t[a.end]);return s(t[a.start])||s(t[a.end])||n(o[a.start])||n(o[a.end])})).sort(((t,n)=>{const r=He(t)[a.crossAxisStart],i=He(n)[a.crossAxisStart];return e?r-i:i-r})).filter(((e,t,n)=>He(e)[a.crossAxisStart]===He(n[0])[a.crossAxisStart]));if(!l.length)return null;if(1===l.length)return l[0];const c=l.filter((e=>Se(He(e)[a.start],He(e)[a.end])(t[a.line])));return 1===c.length?c[0]:c.length>1?c.sort(((e,t)=>He(e)[a.start]-He(t)[a.start]))[0]:l.sort(((e,n)=>{const r=ne(t,oe(He(e))),i=ne(t,oe(He(n)));return r!==i?r-i:He(e)[a.start]-He(n)[a.start]}))[0]})({isMovingForward:e,pageBorderBoxCenter:t,source:r,droppables:o,viewport:a});if(!l)return null;const c=he(l.descriptor.id,i),u=(({pageBorderBoxCenter:e,viewport:t,destination:n,insideDestination:r,afterCritical:i})=>{const o=r.filter((e=>Te({target:Ve(e,i),destination:n,viewport:t.frame,withDroppableDisplacement:!0}))).sort(((t,r)=>{const o=te(e,Ne(n,We(t,i))),a=te(e,Ne(n,We(r,i)));return o<a?-1:a<o?1:t.descriptor.index-r.descriptor.index}));return o[0]||null})({pageBorderBoxCenter:t,viewport:a,destination:l,insideDestination:c,afterCritical:s}),d=(({previousPageBorderBoxCenter:e,moveRelativeTo:t,insideDestination:n,draggable:r,draggables:i,destination:o,viewport:a,afterCritical:s})=>{if(!t){if(n.length)return null;const e={displaced:be,displacedBy:ye,at:{type:"REORDER",destination:{droppableId:o.descriptor.id,index:0}}},t=Fe({impact:e,draggable:r,droppable:o,draggables:i,afterCritical:s}),l=ve(r,o)?o:qe(o,r,i);return Ue({draggable:r,destination:l,newPageBorderBoxCenter:t,viewport:a.frame,withDroppableDisplacement:!1,onlyOnMainAxis:!0})?e:null}const l=Boolean(e[o.axis.line]<=t.page.borderBox.center[o.axis.line]),c=(()=>{const e=t.descriptor.index;return t.descriptor.id===r.descriptor.id||l?e:e+1})(),u=Ge(o.axis,r.displaceBy);return Me({draggable:r,insideDestination:n,destination:o,viewport:a,displacedBy:u,last:be,index:c})})({previousPageBorderBoxCenter:t,destination:l,draggable:n,draggables:i,moveRelativeTo:u,insideDestination:c,viewport:a,afterCritical:s});if(!d)return null;const f=Fe({impact:d,draggable:n,droppable:l,draggables:i,afterCritical:s});return{clientSelection:Be({pageBorderBoxCenter:f,draggable:n,viewport:a}),impact:d,scrollJumpRequest:null}})({isMovingForward:l,previousPageBorderBoxCenter:u,draggable:c,isOver:o,draggables:d,droppables:f,viewport:e.viewport,afterCritical:e.afterCritical})};function Je(e){return"DRAGGING"===e.phase||"COLLECTING"===e.phase}function Xe(e){const t=Se(e.top,e.bottom),n=Se(e.left,e.right);return function(e){return t(e.y)&&n(e.x)}}const Qe=(e,t)=>w(ie(e,t));function et({displaced:e,id:t}){return Boolean(e.visible[t]||e.invisible[t])}var tt=({pageOffset:e,draggable:t,draggables:n,droppables:r,previousImpact:i,viewport:o,afterCritical:a})=>{const s=Qe(t.page.borderBox,e),l=function({pageBorderBox:e,draggable:t,droppables:n}){const r=de(n).filter((t=>{if(!t.isEnabled)return!1;const n=t.subject.active;if(!n)return!1;if(i=n,!((r=e).left<i.right&&r.right>i.left&&r.top<i.bottom&&r.bottom>i.top))return!1;var r,i;if(Xe(n)(e.center))return!0;const o=t.axis,a=n.center[o.crossAxisLine],s=e[o.crossAxisStart],l=e[o.crossAxisEnd],c=Se(n[o.crossAxisStart],n[o.crossAxisEnd]),u=c(s),d=c(l);return!u&&!d||(u?s<a:l>a)}));return r.length?1===r.length?r[0].descriptor.id:function({pageBorderBox:e,draggable:t,candidates:n}){const r=t.page.borderBox.center,i=n.map((t=>{const n=t.axis,i=ee(t.axis.line,e.center[n.line],t.page.borderBox.center[n.crossAxisLine]);return{id:t.descriptor.id,distance:te(r,i)}})).sort(((e,t)=>t.distance-e.distance));return i[0]?i[0].id:null}({pageBorderBox:e,draggable:t,candidates:r}):null}({pageBorderBox:s,draggable:t,droppables:r});if(!l)return we;const c=r[l],u=he(c.descriptor.id,n),d=((e,t)=>{const n=e.frame;return n?Qe(t,n.scroll.diff.value):t})(c,s);return(({draggable:e,pageBorderBoxWithDroppableScroll:t,previousImpact:n,destination:r,insideDestination:i,afterCritical:o})=>{if(!r.isCombineEnabled)return null;const a=r.axis,s=Ge(r.axis,e.displaceBy),l=s.value,c=t[a.start],u=t[a.end],d=ge(e,i).find((e=>{const t=e.descriptor.id,r=e.page.borderBox,i=r[a.size]/4,s=Oe(t,o),d=et({displaced:n.displaced,id:t});return s?d?u>r[a.start]+i&&u<r[a.end]-i:c>r[a.start]-l+i&&c<r[a.end]-l-i:d?u>r[a.start]+l+i&&u<r[a.end]+l-i:c>r[a.start]+i&&c<r[a.end]-i}));return d?{displacedBy:s,displaced:n.displaced,at:{type:"COMBINE",combine:{draggableId:d.descriptor.id,droppableId:r.descriptor.id}}}:null})({pageBorderBoxWithDroppableScroll:d,draggable:t,previousImpact:i,destination:c,insideDestination:u,afterCritical:a})||(({pageBorderBoxWithDroppableScroll:e,draggable:t,destination:n,insideDestination:r,last:i,viewport:o,afterCritical:a})=>{const s=n.axis,l=Ge(n.axis,t.displaceBy),c=l.value,u=e[s.start],d=e[s.end],f=function({draggable:e,closest:t,inHomeList:n}){return t?n&&t.descriptor.index>e.descriptor.index?t.descriptor.index-1:t.descriptor.index:null}({draggable:t,closest:ge(t,r).find((e=>{const t=e.descriptor.id,n=e.page.borderBox.center[s.line],r=Oe(t,a),o=et({displaced:i,id:t});return r?o?d<=n:u<n-c:o?d<=n+c:u<n}))||null,inHomeList:ve(t,n)});return Me({draggable:t,insideDestination:r,destination:n,viewport:o,last:i,displacedBy:l,index:f})})({pageBorderBoxWithDroppableScroll:d,draggable:t,destination:c,insideDestination:u,last:i.displaced,viewport:o,afterCritical:a})},nt=(e,t)=>({...e,[t.descriptor.id]:t});var rt=({state:e,clientSelection:t,dimensions:n,viewport:r,impact:i,scrollJumpRequest:o})=>{const a=r||e.viewport,s=n||e.dimensions,l=t||e.current.client.selection,c=J(l,e.initial.client.selection),u={offset:c,selection:l,borderBoxCenter:Y(e.initial.client.borderBoxCenter,c)},d={selection:Y(u.selection,a.scroll.current),borderBoxCenter:Y(u.borderBoxCenter,a.scroll.current),offset:Y(u.offset,a.scroll.diff.value)},f={client:u,page:d};if("COLLECTING"===e.phase)return{...e,dimensions:s,viewport:a,current:f};const h=s.draggables[e.critical.draggable.id],p=i||tt({pageOffset:d.offset,draggable:h,draggables:s.draggables,droppables:s.droppables,previousImpact:e.impact,viewport:a,afterCritical:e.afterCritical}),m=(({draggable:e,draggables:t,droppables:n,previousImpact:r,impact:i})=>{const o=(({previousImpact:e,impact:t,droppables:n})=>{const r=Ze(e),i=Ze(t);if(!r)return n;if(r===i)return n;const o=n[r];if(!o.subject.withPlaceholder)return n;const a=(e=>{const t=e.subject.withPlaceholder;t||j();const n=e.frame;if(!n){const t=se({page:e.subject.page,axis:e.axis,frame:null,withPlaceholder:null});return{...e,subject:t}}const r=t.oldFrameMaxScroll;r||j();const i=Ke(n,r),o=se({page:e.subject.page,axis:e.axis,frame:i,withPlaceholder:null});return{...e,subject:o,frame:i}})(o);return nt(n,a)})({previousImpact:r,impact:i,droppables:n}),a=Ze(i);if(!a)return o;const s=n[a];if(ve(e,s))return o;if(s.subject.withPlaceholder)return o;const l=qe(s,e,t);return nt(o,l)})({draggable:h,impact:p,previousImpact:e.impact,draggables:s.draggables,droppables:s.droppables});return{...e,current:f,dimensions:{draggables:s.draggables,droppables:m},impact:p,viewport:a,scrollJumpRequest:o||null,forceShouldAnimate:!o&&null}},it=({impact:e,viewport:t,draggables:n,destination:r,forceShouldAnimate:i})=>{const o=e.displaced,a=function(e,t){return e.map((e=>t[e]))}(o.all,n),s=Pe({afterDragging:a,destination:r,displacedBy:e.displacedBy,viewport:t.frame,forceShouldAnimate:i,last:o});return{...e,displaced:s}},ot=({impact:e,draggable:t,droppable:n,draggables:r,viewport:i,afterCritical:o})=>{const a=Fe({impact:e,draggable:t,draggables:r,droppable:n,afterCritical:o});return Be({pageBorderBoxCenter:a,draggable:t,viewport:i})},at=({state:e,dimensions:t,viewport:n})=>{"SNAP"!==e.movementMode&&j();const r=e.impact,i=n||e.viewport,o=t||e.dimensions,{draggables:a,droppables:s}=o,l=a[e.critical.draggable.id],c=Ze(r);c||j();const u=s[c],d=it({impact:r,viewport:i,destination:u,draggables:a}),f=ot({impact:d,draggable:l,droppable:u,draggables:a,viewport:i,afterCritical:e.afterCritical});return rt({impact:d,clientSelection:f,state:e,dimensions:o,viewport:i})},st=({draggable:e,home:t,draggables:n,viewport:r})=>{const i=Ge(t.axis,e.displaceBy),o=he(t.descriptor.id,n),a=o.indexOf(e);-1===a&&j();const s=o.slice(a+1),l=s.reduce(((e,t)=>(e[t.descriptor.id]=!0,e)),{}),c={inVirtualList:"virtual"===t.descriptor.mode,displacedBy:i,effected:l};var u;return{impact:{displaced:Pe({afterDragging:s,destination:t,displacedBy:i,last:null,viewport:r.frame,forceShouldAnimate:!1}),displacedBy:i,at:{type:"REORDER",destination:(u=e.descriptor,{index:u.index,droppableId:u.droppableId})}},afterCritical:c}};const lt=e=>"SNAP"===e.movementMode,ct=(e,t,n)=>{const r=((e,t)=>({draggables:e.draggables,droppables:nt(e.droppables,t)}))(e.dimensions,t);return!lt(e)||n?rt({state:e,dimensions:r}):at({state:e,dimensions:r})};function ut(e){return e.isDragging&&"SNAP"===e.movementMode?{...e,scrollJumpRequest:null}:e}const dt={phase:"IDLE",completed:null,shouldFlush:!1};var ft=(e=dt,t)=>{if("FLUSH"===t.type)return{...dt,shouldFlush:!0};if("INITIAL_PUBLISH"===t.type){"IDLE"!==e.phase&&j();const{critical:n,clientSelection:r,viewport:i,dimensions:o,movementMode:a}=t.payload,s=o.draggables[n.draggable.id],l=o.droppables[n.droppable.id],c={selection:r,borderBoxCenter:s.client.borderBox.center,offset:Z},u={client:c,page:{selection:Y(c.selection,i.scroll.initial),borderBoxCenter:Y(c.selection,i.scroll.initial),offset:Y(c.selection,i.scroll.diff.value)}},d=de(o.droppables).every((e=>!e.isFixedOnPage)),{impact:f,afterCritical:h}=st({draggable:s,home:l,draggables:o.draggables,viewport:i});return{phase:"DRAGGING",isDragging:!0,critical:n,movementMode:a,dimensions:o,initial:u,current:u,isWindowScrollAllowed:d,impact:f,afterCritical:h,onLiftImpact:f,viewport:i,scrollJumpRequest:null,forceShouldAnimate:null}}if("COLLECTION_STARTING"===t.type)return"COLLECTING"===e.phase||"DROP_PENDING"===e.phase?e:("DRAGGING"!==e.phase&&j(),{...e,phase:"COLLECTING"});if("PUBLISH_WHILE_DRAGGING"===t.type)return"COLLECTING"!==e.phase&&"DROP_PENDING"!==e.phase&&j(),(({state:e,published:t})=>{const n=t.modified.map((t=>{const n=e.dimensions.droppables[t.droppableId];return le(n,t.scroll)})),r={...e.dimensions.droppables,...ce(n)},i=ue((({additions:e,updatedDroppables:t,viewport:n})=>{const r=n.scroll.diff.value;return e.map((e=>{const i=e.descriptor.droppableId,o=(e=>{const t=e.frame;return t||j(),t})(t[i]),a=o.scroll.diff.value,s=(({draggable:e,offset:t,initialWindowScroll:n})=>{const r=x(e.client,t),i=T(r,n);return{...e,placeholder:{...e.placeholder,client:r},client:r,page:i}})({draggable:e,offset:Y(r,a),initialWindowScroll:n.scroll.initial});return s}))})({additions:t.additions,updatedDroppables:r,viewport:e.viewport})),o={...e.dimensions.draggables,...i};t.removals.forEach((e=>{delete o[e]}));const a={droppables:r,draggables:o},s=Ze(e.impact),l=s?a.droppables[s]:null,c=a.draggables[e.critical.draggable.id],u=a.droppables[e.critical.droppable.id],{impact:d,afterCritical:f}=st({draggable:c,home:u,draggables:o,viewport:e.viewport}),h=l&&l.isCombineEnabled?e.impact:d,p=tt({pageOffset:e.current.page.offset,draggable:a.draggables[e.critical.draggable.id],draggables:a.draggables,droppables:a.droppables,previousImpact:h,viewport:e.viewport,afterCritical:f}),m={...e,phase:"DRAGGING",impact:p,onLiftImpact:d,dimensions:a,afterCritical:f,forceShouldAnimate:!1};return"COLLECTING"===e.phase?m:{...m,phase:"DROP_PENDING",reason:e.reason,isWaiting:!1}})({state:e,published:t.payload});if("MOVE"===t.type){if("DROP_PENDING"===e.phase)return e;Je(e)||j();const{client:n}=t.payload;return X(n,e.current.client.selection)?e:rt({state:e,clientSelection:n,impact:lt(e)?e.impact:null})}if("UPDATE_DROPPABLE_SCROLL"===t.type){if("DROP_PENDING"===e.phase)return ut(e);if("COLLECTING"===e.phase)return ut(e);Je(e)||j();const{id:n,newScroll:r}=t.payload,i=e.dimensions.droppables[n];if(!i)return e;const o=le(i,r);return ct(e,o,!1)}if("UPDATE_DROPPABLE_IS_ENABLED"===t.type){if("DROP_PENDING"===e.phase)return e;Je(e)||j();const{id:n,isEnabled:r}=t.payload,i=e.dimensions.droppables[n];i||j(),i.isEnabled===r&&j();const o={...i,isEnabled:r};return ct(e,o,!0)}if("UPDATE_DROPPABLE_IS_COMBINE_ENABLED"===t.type){if("DROP_PENDING"===e.phase)return e;Je(e)||j();const{id:n,isCombineEnabled:r}=t.payload,i=e.dimensions.droppables[n];i||j(),i.isCombineEnabled===r&&j();const o={...i,isCombineEnabled:r};return ct(e,o,!0)}if("MOVE_BY_WINDOW_SCROLL"===t.type){if("DROP_PENDING"===e.phase||"DROP_ANIMATING"===e.phase)return e;Je(e)||j(),e.isWindowScrollAllowed||j();const n=t.payload.newScroll;if(X(e.viewport.scroll.current,n))return ut(e);const r=$e(e.viewport,n);return lt(e)?at({state:e,viewport:r}):rt({state:e,viewport:r})}if("UPDATE_VIEWPORT_MAX_SCROLL"===t.type){if(!Je(e))return e;const n=t.payload.maxScroll;if(X(n,e.viewport.scroll.max))return e;const r={...e.viewport,scroll:{...e.viewport.scroll,max:n}};return{...e,viewport:r}}if("MOVE_UP"===t.type||"MOVE_DOWN"===t.type||"MOVE_LEFT"===t.type||"MOVE_RIGHT"===t.type){if("COLLECTING"===e.phase||"DROP_PENDING"===e.phase)return e;"DRAGGING"!==e.phase&&j();const n=Ye({state:e,type:t.type});return n?rt({state:e,impact:n.impact,clientSelection:n.clientSelection,scrollJumpRequest:n.scrollJumpRequest}):e}if("DROP_PENDING"===t.type){const n=t.payload.reason;return"COLLECTING"!==e.phase&&j(),{...e,phase:"DROP_PENDING",isWaiting:!0,reason:n}}if("DROP_ANIMATE"===t.type){const{completed:n,dropDuration:r,newHomeClientOffset:i}=t.payload;return"DRAGGING"!==e.phase&&"DROP_PENDING"!==e.phase&&j(),{phase:"DROP_ANIMATING",completed:n,dropDuration:r,newHomeClientOffset:i,dimensions:e.dimensions}}if("DROP_COMPLETE"===t.type){const{completed:e}=t.payload;return{phase:"IDLE",completed:e,shouldFlush:!1}}return e};function ht(e,t){return e instanceof Object&&"type"in e&&e.type===t}const pt=e=>({type:"PUBLISH_WHILE_DRAGGING",payload:e}),mt=()=>({type:"COLLECTION_STARTING",payload:null}),gt=e=>({type:"UPDATE_DROPPABLE_SCROLL",payload:e}),vt=e=>({type:"UPDATE_DROPPABLE_IS_ENABLED",payload:e}),yt=e=>({type:"UPDATE_DROPPABLE_IS_COMBINE_ENABLED",payload:e}),bt=e=>({type:"MOVE",payload:e}),wt=()=>({type:"MOVE_UP",payload:null}),St=()=>({type:"MOVE_DOWN",payload:null}),Et=()=>({type:"MOVE_RIGHT",payload:null}),Ct=()=>({type:"MOVE_LEFT",payload:null}),kt=e=>({type:"DROP_COMPLETE",payload:e}),_t=e=>({type:"DROP",payload:e}),xt="cubic-bezier(.2,1,.1,1)",Tt=0,Pt=.7,At=.75,Mt={outOfTheWay:.2,minDropTime:.33,maxDropTime:.55},Ot=`${Mt.outOfTheWay}s cubic-bezier(0.2, 0, 0, 1)`,It={fluid:`opacity ${Ot}`,snap:`transform ${Ot}, opacity ${Ot}`,drop:e=>{const t=`${e}s ${xt}`;return`transform ${t}, opacity ${t}`},outOfTheWay:`transform ${Ot}`,placeholder:`height ${Ot}, width ${Ot}, margin ${Ot}`},Rt=e=>X(e,Z)?void 0:`translate(${e.x}px, ${e.y}px)`,Dt=Rt,{minDropTime:Lt,maxDropTime:Nt}=Mt,Ft=Nt-Lt,$t=({getState:e,dispatch:t})=>n=>r=>{if(!ht(r,"DROP"))return void n(r);const i=e(),o=r.payload.reason;if("COLLECTING"===i.phase)return void t((a={reason:o},{type:"DROP_PENDING",payload:a}));var a;if("IDLE"===i.phase)return;"DROP_PENDING"===i.phase&&i.isWaiting&&j(),"DRAGGING"!==i.phase&&"DROP_PENDING"!==i.phase&&j();const s=i.critical,l=i.dimensions,c=l.draggables[i.critical.draggable.id],{impact:u,didDropInsideDroppable:d}=(({draggables:e,reason:t,lastImpact:n,home:r,viewport:i,onLiftImpact:o})=>n.at&&"DROP"===t?"REORDER"===n.at.type?{impact:n,didDropInsideDroppable:!0}:{impact:{...n,displaced:be},didDropInsideDroppable:!0}:{impact:it({draggables:e,impact:o,destination:r,viewport:i,forceShouldAnimate:!0}),didDropInsideDroppable:!1})({reason:o,lastImpact:i.impact,afterCritical:i.afterCritical,onLiftImpact:i.onLiftImpact,home:i.dimensions.droppables[i.critical.droppable.id],viewport:i.viewport,draggables:i.dimensions.draggables}),f=d?pe(u):null,h=d?me(u):null,p={index:s.draggable.index,droppableId:s.droppable.id},m={draggableId:c.descriptor.id,type:c.descriptor.type,source:p,reason:o,mode:i.movementMode,destination:f,combine:h},g=(({impact:e,draggable:t,dimensions:n,viewport:r,afterCritical:i})=>{const{draggables:o,droppables:a}=n,s=Ze(e),l=s?a[s]:null,c=a[t.descriptor.droppableId],u=ot({impact:e,draggable:t,draggables:o,afterCritical:i,droppable:l||c,viewport:r});return J(u,t.client.borderBox.center)})({impact:u,draggable:c,dimensions:l,viewport:i.viewport,afterCritical:i.afterCritical}),v={critical:i.critical,afterCritical:i.afterCritical,result:m,impact:u};if(X(i.current.client.offset,g)&&!Boolean(m.combine))return void t(kt({completed:v}));const y=(({current:e,destination:t,reason:n})=>{const r=te(e,t);if(r<=0)return Lt;if(r>=1500)return Nt;const i=Lt+Ft*(r/1500);return Number(("CANCEL"===n?.6*i:i).toFixed(2))})({current:i.current.client.offset,destination:g,reason:o});t((e=>({type:"DROP_ANIMATE",payload:e}))({newHomeClientOffset:g,dropDuration:y,completed:v}))};var jt=()=>({x:window.pageXOffset,y:window.pageYOffset});const Bt=e=>{const t=function({onWindowScroll:e}){const t=R((function(){e(jt())})),n=function(e){return{eventName:"scroll",options:{passive:!0,capture:!1},fn:t=>{t.target!==window&&t.target!==window.document||e()}}}(t);let r=N;function i(){return r!==N}return{start:function(){i()&&j(),r=F(window,[n])},stop:function(){i()||j(),t.cancel(),r(),r=N},isActive:i}}({onWindowScroll:t=>{e.dispatch({type:"MOVE_BY_WINDOW_SCROLL",payload:{newScroll:t}})}});return e=>n=>{!t.isActive()&&ht(n,"INITIAL_PUBLISH")&&t.start(),t.isActive()&&(e=>ht(e,"DROP_COMPLETE")||ht(e,"DROP_ANIMATE")||ht(e,"FLUSH"))(n)&&t.stop(),e(n)}};const Ut=(e,t)=>{t()},zt=(e,t)=>({draggableId:e.draggable.id,type:e.droppable.type,source:{droppableId:e.droppable.id,index:e.draggable.index},mode:t});function Ht(e,t,n,r){if(!e)return void n(r(t));const i=(e=>{let t=!1,n=!1;const r=setTimeout((()=>{n=!0})),i=i=>{t||n||(t=!0,e(i),clearTimeout(r))};return i.wasCalled=()=>t,i})(n);e(t,{announce:i}),i.wasCalled()||n(r(t))}var Wt=(e,t)=>{const n=((e,t)=>{const n=(()=>{const e=[];return{add:t=>{const n=setTimeout((()=>(t=>{const n=e.findIndex((e=>e.timerId===t));-1===n&&j();const[r]=e.splice(n,1);r.callback()})(n))),r={timerId:n,callback:t};e.push(r)},flush:()=>{if(!e.length)return;const t=[...e];e.length=0,t.forEach((e=>{clearTimeout(e.timerId),e.callback()}))}}})();let r=null;const i=n=>{r||j(),r=null,Ut(0,(()=>Ht(e().onDragEnd,n,t,q)))};return{beforeCapture:(t,n)=>{r&&j(),Ut(0,(()=>{const r=e().onBeforeCapture;r&&r({draggableId:t,mode:n})}))},beforeStart:(t,n)=>{r&&j(),Ut(0,(()=>{const r=e().onBeforeDragStart;r&&r(zt(t,n))}))},start:(i,o)=>{r&&j();const a=zt(i,o);r={mode:o,lastCritical:i,lastLocation:a.source,lastCombine:null},n.add((()=>{Ut(0,(()=>Ht(e().onDragStart,a,t,G)))}))},update:(i,o)=>{const a=pe(o),s=me(o);r||j();const l=!((e,t)=>{if(e===t)return!0;const n=e.draggable.id===t.draggable.id&&e.draggable.droppableId===t.draggable.droppableId&&e.draggable.type===t.draggable.type&&e.draggable.index===t.draggable.index,r=e.droppable.id===t.droppable.id&&e.droppable.type===t.droppable.type;return n&&r})(i,r.lastCritical);l&&(r.lastCritical=i);const c=(d=a,!(null==(u=r.lastLocation)&&null==d||null!=u&&null!=d&&u.droppableId===d.droppableId&&u.index===d.index));var u,d;c&&(r.lastLocation=a);const f=!((e,t)=>null==e&&null==t||null!=e&&null!=t&&e.draggableId===t.draggableId&&e.droppableId===t.droppableId)(r.lastCombine,s);if(f&&(r.lastCombine=s),!l&&!c&&!f)return;const h={...zt(i,r.mode),combine:s,destination:a};n.add((()=>{Ut(0,(()=>Ht(e().onDragUpdate,h,t,K)))}))},flush:()=>{r||j(),n.flush()},drop:i,abort:()=>{if(!r)return;const e={...zt(r.lastCritical,r.mode),combine:null,destination:null,reason:"CANCEL"};i(e)}}})(e,t);return e=>t=>r=>{if(ht(r,"BEFORE_INITIAL_CAPTURE"))return void n.beforeCapture(r.payload.draggableId,r.payload.movementMode);if(ht(r,"INITIAL_PUBLISH")){const e=r.payload.critical;return n.beforeStart(e,r.payload.movementMode),t(r),void n.start(e,r.payload.movementMode)}if(ht(r,"DROP_COMPLETE")){const e=r.payload.completed.result;return n.flush(),t(r),void n.drop(e)}if(t(r),ht(r,"FLUSH"))return void n.abort();const i=e.getState();"DRAGGING"===i.phase&&n.update(i.critical,i.impact)}};const Vt=e=>t=>n=>{if(!ht(n,"DROP_ANIMATION_FINISHED"))return void t(n);const r=e.getState();"DROP_ANIMATING"!==r.phase&&j(),e.dispatch(kt({completed:r.completed}))},Gt=e=>{let t=null,n=null;return r=>i=>{if((ht(i,"FLUSH")||ht(i,"DROP_COMPLETE")||ht(i,"DROP_ANIMATION_FINISHED"))&&(n&&(cancelAnimationFrame(n),n=null),t&&(t(),t=null)),r(i),!ht(i,"DROP_ANIMATE"))return;const o={eventName:"scroll",options:{capture:!0,passive:!1,once:!0},fn:function(){"DROP_ANIMATING"===e.getState().phase&&e.dispatch({type:"DROP_ANIMATION_FINISHED",payload:null})}};n=requestAnimationFrame((()=>{n=null,t=F(window,[o])}))}};const Kt=e=>t=>n=>{if(t(n),!ht(n,"PUBLISH_WHILE_DRAGGING"))return;const r=e.getState();"DROP_PENDING"===r.phase&&(r.isWaiting||e.dispatch(_t({reason:r.reason})))},qt=m;var Zt=({dimensionMarshal:e,focusMarshal:t,styleMarshal:n,getResponders:r,announce:i,autoScroller:o})=>{return f(ft,qt(function(...e){return t=>(n,r)=>{const i=t(n,r);let o=()=>{throw new Error(s(15))};const a={getState:i.getState,dispatch:(e,...t)=>o(e,...t)},l=e.map((e=>e(a)));return o=m(...l)(i.dispatch),{...i,dispatch:o}}}((a=n,()=>e=>t=>{ht(t,"INITIAL_PUBLISH")&&a.dragging(),ht(t,"DROP_ANIMATE")&&a.dropping(t.payload.completed.result.reason),(ht(t,"FLUSH")||ht(t,"DROP_COMPLETE"))&&a.resting(),e(t)}),(e=>()=>t=>n=>{(ht(n,"DROP_COMPLETE")||ht(n,"FLUSH")||ht(n,"DROP_ANIMATE"))&&e.stopPublishing(),t(n)})(e),(e=>({getState:t,dispatch:n})=>r=>i=>{if(!ht(i,"LIFT"))return void r(i);const{id:o,clientSelection:a,movementMode:s}=i.payload,l=t();"DROP_ANIMATING"===l.phase&&n(kt({completed:l.completed})),"IDLE"!==t().phase&&j(),n({type:"FLUSH",payload:null}),n({type:"BEFORE_INITIAL_CAPTURE",payload:{draggableId:o,movementMode:s}});const c={draggableId:o,scrollOptions:{shouldPublishImmediately:"SNAP"===s}},{critical:u,dimensions:d,viewport:f}=e.startPublishing(c);n({type:"INITIAL_PUBLISH",payload:{critical:u,dimensions:d,clientSelection:a,movementMode:s,viewport:f}})})(e),$t,Vt,Gt,Kt,(e=>t=>n=>r=>{if((e=>ht(e,"DROP_COMPLETE")||ht(e,"DROP_ANIMATE")||ht(e,"FLUSH"))(r))return e.stop(),void n(r);if(ht(r,"INITIAL_PUBLISH")){n(r);const i=t.getState();return"DRAGGING"!==i.phase&&j(),void e.start(i)}n(r),e.scroll(t.getState())})(o),Bt,(e=>{let t=!1;return()=>n=>r=>{if(ht(r,"INITIAL_PUBLISH"))return t=!0,e.tryRecordFocus(r.payload.critical.draggable.id),n(r),void e.tryRestoreFocusRecorded();if(n(r),t){if(ht(r,"FLUSH"))return t=!1,void e.tryRestoreFocusRecorded();if(ht(r,"DROP_COMPLETE")){t=!1;const n=r.payload.completed.result;n.combine&&e.tryShiftRecord(n.draggableId,n.combine.draggableId),e.tryRestoreFocusRecorded()}}}})(t),Wt(r,i))));var a},Yt=({scrollHeight:e,scrollWidth:t,height:n,width:r})=>{const i=J({x:t,y:e},{x:r,y:n});return{x:Math.max(0,i.x),y:Math.max(0,i.y)}},Jt=()=>{const e=document.documentElement;return e||j(),e},Xt=()=>{const e=Jt();return Yt({scrollHeight:e.scrollHeight,scrollWidth:e.scrollWidth,width:e.clientWidth,height:e.clientHeight})};function Qt(e,t,n){return n.descriptor.id!==t.id&&(n.descriptor.type===t.type&&"virtual"===e.droppable.getById(n.descriptor.droppableId).descriptor.mode)}var en=(e,t)=>{let n=null;const r=function({registry:e,callbacks:t}){let n={additions:{},removals:{},modified:{}},r=null;const i=()=>{r||(t.collectionStarting(),r=requestAnimationFrame((()=>{r=null;const{additions:i,removals:o,modified:a}=n,s=Object.keys(i).map((t=>e.draggable.getById(t).getDimension(Z))).sort(((e,t)=>e.descriptor.index-t.descriptor.index)),l=Object.keys(a).map((t=>({droppableId:t,scroll:e.droppable.getById(t).callbacks.getScrollWhileDragging()}))),c={additions:s,removals:Object.keys(o),modified:l};n={additions:{},removals:{},modified:{}},t.publish(c)})))};return{add:e=>{const t=e.descriptor.id;n.additions[t]=e,n.modified[e.descriptor.droppableId]=!0,n.removals[t]&&delete n.removals[t],i()},remove:e=>{const t=e.descriptor;n.removals[t.id]=!0,n.modified[t.droppableId]=!0,n.additions[t.id]&&delete n.additions[t.id],i()},stop:()=>{r&&(cancelAnimationFrame(r),r=null,n={additions:{},removals:{},modified:{}})}}}({callbacks:{publish:t.publishWhileDragging,collectionStarting:t.collectionStarting},registry:e}),i=t=>{n||j();const i=n.critical.draggable;"ADDITION"===t.type&&Qt(e,i,t.value)&&r.add(t.value),"REMOVAL"===t.type&&Qt(e,i,t.value)&&r.remove(t.value)};return{updateDroppableIsEnabled:(r,i)=>{e.droppable.exists(r)||j(),n&&t.updateDroppableIsEnabled({id:r,isEnabled:i})},updateDroppableIsCombineEnabled:(r,i)=>{n&&(e.droppable.exists(r)||j(),t.updateDroppableIsCombineEnabled({id:r,isCombineEnabled:i}))},scrollDroppable:(t,r)=>{n&&e.droppable.getById(t).callbacks.scroll(r)},updateDroppableScroll:(r,i)=>{n&&(e.droppable.exists(r)||j(),t.updateDroppableScroll({id:r,newScroll:i}))},startPublishing:t=>{n&&j();const r=e.draggable.getById(t.draggableId),o=e.droppable.getById(r.descriptor.droppableId),a={draggable:r.descriptor,droppable:o.descriptor},s=e.subscribe(i);return n={critical:a,unsubscribe:s},(({critical:e,scrollOptions:t,registry:n})=>{const r=(()=>{const e=jt(),t=Xt(),n=e.y,r=e.x,i=Jt(),o=i.clientWidth,a=i.clientHeight;return{frame:w({top:n,left:r,right:r+o,bottom:n+a}),scroll:{initial:e,current:e,max:t,diff:{value:Z,displacement:Z}}}})(),i=r.scroll.current,o=e.droppable,a=n.droppable.getAllByType(o.type).map((e=>e.callbacks.getDimensionAndWatchScroll(i,t))),s=n.draggable.getAllByType(e.draggable.type).map((e=>e.getDimension(i)));return{dimensions:{draggables:ue(s),droppables:ce(a)},critical:e,viewport:r}})({critical:a,registry:e,scrollOptions:t.scrollOptions})},stopPublishing:()=>{if(!n)return;r.stop();const t=n.critical.droppable;e.droppable.getAllByType(t.type).forEach((e=>e.callbacks.dragStopped())),n.unsubscribe(),n=null}}},tn=(e,t)=>"IDLE"===e.phase||"DROP_ANIMATING"===e.phase&&e.completed.result.draggableId!==t&&"DROP"===e.completed.result.reason,nn=e=>{window.scrollBy(e.x,e.y)};const rn=I((e=>de(e).filter((e=>!!e.isEnabled&&!!e.frame))));const on={startFromPercentage:.25,maxScrollAtPercentage:.05,maxPixelScroll:28,ease:e=>e**2,durationDampening:{stopDampeningAt:1200,accelerateAt:360},disabled:!1};var an=({startOfRange:e,endOfRange:t,current:n})=>{const r=t-e;return 0===r?0:(n-e)/r},sn=({distanceToEdge:e,thresholds:t,dragStartTime:n,shouldUseTimeDampening:r,getAutoScrollerOptions:i})=>{const o=((e,t,n=(()=>on))=>{const r=n();if(e>t.startScrollingFrom)return 0;if(e<=t.maxScrollValueAt)return r.maxPixelScroll;if(e===t.startScrollingFrom)return 1;const i=1-an({startOfRange:t.maxScrollValueAt,endOfRange:t.startScrollingFrom,current:e}),o=r.maxPixelScroll*r.ease(i);return Math.ceil(o)})(e,t,i);return 0===o?0:r?Math.max(((e,t,n)=>{const r=n(),i=r.durationDampening.accelerateAt,o=r.durationDampening.stopDampeningAt,a=t,s=o,l=Date.now()-a;if(l>=o)return e;if(l<i)return 1;const c=an({startOfRange:i,endOfRange:s,current:l}),u=e*r.ease(c);return Math.ceil(u)})(o,n,i),1):o},ln=({container:e,distanceToEdges:t,dragStartTime:n,axis:r,shouldUseTimeDampening:i,getAutoScrollerOptions:o})=>{const a=((e,t,n=(()=>on))=>{const r=n();return{startScrollingFrom:e[t.size]*r.startFromPercentage,maxScrollValueAt:e[t.size]*r.maxScrollAtPercentage}})(e,r,o);return t[r.end]<t[r.start]?sn({distanceToEdge:t[r.end],thresholds:a,dragStartTime:n,shouldUseTimeDampening:i,getAutoScrollerOptions:o}):-1*sn({distanceToEdge:t[r.start],thresholds:a,dragStartTime:n,shouldUseTimeDampening:i,getAutoScrollerOptions:o})};const cn=re((e=>0===e?0:e));var un=({dragStartTime:e,container:t,subject:n,center:r,shouldUseTimeDampening:i,getAutoScrollerOptions:o})=>{const a={top:r.y-t.top,right:t.right-r.x,bottom:t.bottom-r.y,left:r.x-t.left},s=ln({container:t,distanceToEdges:a,dragStartTime:e,axis:ke,shouldUseTimeDampening:i,getAutoScrollerOptions:o}),l=ln({container:t,distanceToEdges:a,dragStartTime:e,axis:_e,shouldUseTimeDampening:i,getAutoScrollerOptions:o}),c=cn({x:l,y:s});if(X(c,Z))return null;const u=(({container:e,subject:t,proposedScroll:n})=>{const r=t.height>e.height,i=t.width>e.width;return i||r?i&&r?null:{x:i?0:n.x,y:r?0:n.y}:n})({container:t,subject:n,proposedScroll:c});return u?X(u,Z)?null:u:null};const dn=re((e=>0===e?0:e>0?1:-1)),fn=(()=>{const e=(e,t)=>e<0?e:e>t?e-t:0;return({current:t,max:n,change:r})=>{const i=Y(t,r),o={x:e(i.x,n.x),y:e(i.y,n.y)};return X(o,Z)?null:o}})(),hn=({max:e,current:t,change:n})=>{const r={x:Math.max(t.x,e.x),y:Math.max(t.y,e.y)},i=dn(n),o=fn({max:r,current:t,change:i});return!o||0!==i.x&&0===o.x||0!==i.y&&0===o.y},pn=(e,t)=>hn({current:e.scroll.current,max:e.scroll.max,change:t}),mn=(e,t)=>{const n=e.frame;return!!n&&hn({current:n.scroll.current,max:n.scroll.max,change:t})};var gn=({state:e,dragStartTime:t,shouldUseTimeDampening:n,scrollWindow:r,scrollDroppable:i,getAutoScrollerOptions:o})=>{const