You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 line
28 KiB
1 line
28 KiB
(self.webpackChunk=self.webpackChunk||[]).push([[89500],{680:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var i=n(19973),o=n(59301),r={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M464 688a48 48 0 1096 0 48 48 0 10-96 0zm24-112h48c4.4 0 8-3.6 8-8V296c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8z"}}]},name:"exclamation-circle",theme:"outlined"},a=n(22589),s=function(e,t){return o.createElement(a.Z,(0,i.Z)({},e,{ref:t,icon:r}))};var l=o.forwardRef(s)},45532:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var i=n(19973),o=n(59301),r={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M696 480H544V328c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v152H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h152v152c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V544h152c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8z"}},{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}}]},name:"plus-circle",theme:"outlined"},a=n(22589),s=function(e,t){return o.createElement(a.Z,(0,i.Z)({},e,{ref:t,icon:r}))};var l=o.forwardRef(s)},24334:function(e,t,n){var i,o;o="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==n.g?n.g:this,e.exports=function(n){"use strict";var o,r=(n=n||{}).Base64,a="2.6.4",s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",l=function(e){for(var t={},n=0,i=e.length;n<i;n++)t[e.charAt(n)]=n;return t}(s),c=String.fromCharCode,d=function(e){if(e.length<2)return(t=e.charCodeAt(0))<128?e:t<2048?c(192|t>>>6)+c(128|63&t):c(224|t>>>12&15)+c(128|t>>>6&63)+c(128|63&t);var t=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320);return c(240|t>>>18&7)+c(128|t>>>12&63)+c(128|t>>>6&63)+c(128|63&t)},h=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,u=function(e){return e.replace(h,d)},f=function(e){var t=[0,2,1][e.length%3],n=e.charCodeAt(0)<<16|(e.length>1?e.charCodeAt(1):0)<<8|(e.length>2?e.charCodeAt(2):0);return[s.charAt(n>>>18),s.charAt(n>>>12&63),t>=2?"=":s.charAt(n>>>6&63),t>=1?"=":s.charAt(63&n)].join("")},p=n.btoa&&"function"==typeof n.btoa?function(e){return n.btoa(e)}:function(e){if(e.match(/[^\x00-\xFF]/))throw new RangeError("The string contains invalid characters.");return e.replace(/[\s\S]{1,3}/g,f)},g=function(e){return p(u(String(e)))},x=function(e){return e.replace(/[+\/]/g,(function(e){return"+"==e?"-":"_"})).replace(/=/g,"")},y=function(e,t){return t?x(g(e)):g(e)},v=function(e){return y(e,!0)};n.Uint8Array&&(o=function(e,t){for(var n="",i=0,o=e.length;i<o;i+=3){var r=e[i],a=e[i+1],l=e[i+2],c=r<<16|a<<8|l;n+=s.charAt(c>>>18)+s.charAt(c>>>12&63)+(void 0!==a?s.charAt(c>>>6&63):"=")+(void 0!==l?s.charAt(63&c):"=")}return t?x(n):n});var m,w=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,b=function(e){switch(e.length){case 4:var t=((7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3))-65536;return c(55296+(t>>>10))+c(56320+(1023&t));case 3:return c((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return c((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},S=function(e){return e.replace(w,b)},C=function(e){var t=e.length,n=t%4,i=(t>0?l[e.charAt(0)]<<18:0)|(t>1?l[e.charAt(1)]<<12:0)|(t>2?l[e.charAt(2)]<<6:0)|(t>3?l[e.charAt(3)]:0),o=[c(i>>>16),c(i>>>8&255),c(255&i)];return o.length-=[0,0,2,1][n],o.join("")},Z=n.atob&&"function"==typeof n.atob?function(e){return n.atob(e)}:function(e){return e.replace(/\S{1,4}/g,C)},T=function(e){return Z(String(e).replace(/[^A-Za-z0-9\+\/]/g,""))},O=function(e){return S(Z(e))},k=function(e){return String(e).replace(/[-_]/g,(function(e){return"-"==e?"+":"/"})).replace(/[^A-Za-z0-9\+\/]/g,"")},I=function(e){return O(k(e))};n.Uint8Array&&(m=function(e){return Uint8Array.from(T(k(e)),(function(e){return e.charCodeAt(0)}))});var E=function(){var e=n.Base64;return n.Base64=r,e};if(n.Base64={VERSION:a,atob:T,btoa:p,fromBase64:I,toBase64:y,utob:u,encode:y,encodeURI:v,btou:S,decode:I,noConflict:E,fromUint8Array:o,toUint8Array:m},"function"==typeof Object.defineProperty){var A=function(e){return{value:e,enumerable:!1,writable:!0,configurable:!0}};n.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",A((function(){return I(this)}))),Object.defineProperty(String.prototype,"toBase64",A((function(e){return y(this,e)}))),Object.defineProperty(String.prototype,"toBase64URI",A((function(){return y(this,!0)})))}}return n.Meteor&&(Base64=n.Base64),e.exports?e.exports.Base64=n.Base64:void 0===(i=function(){return n.Base64}.apply(t,[]))||(e.exports=i),{Base64:n.Base64}}(o)},44589:function(e,t,n){"use strict";n.d(t,{JN:function(){return he},Rp:function(){return S},W8:function(){return pe}});var i=n(19973),o=n(8295),r=n(24079),a=n(93669),s=n(59362),l=n(16047),c=n(63811),d=n(97015),h=n(64957),u=n(51060),f=n(59301),p=n(12708),g=n.n(p),x=n(4676),y=n(44520),v=n.n(y),m=n(40447),w=function(){function e(){(0,a.Z)(this,e),(0,u.Z)(this,"refs",{})}return(0,s.Z)(e,[{key:"add",value:function(e,t){this.refs[e]||(this.refs[e]=[]),this.refs[e].push(t)}},{key:"remove",value:function(e,t){var n=this.getIndex(e,t);-1!==n&&this.refs[e].splice(n,1)}},{key:"isActive",value:function(){return this.active}},{key:"getActive",value:function(){var e=this;return this.refs[this.active.collection].find((function(t){return t.node.sortableInfo.index==e.active.index}))}},{key:"getIndex",value:function(e,t){return this.refs[e].indexOf(t)}},{key:"getOrderedRefs",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.active.collection;return this.refs[e].sort(b)}}]),e}();function b(e,t){return e.node.sortableInfo.index-t.node.sortableInfo.index}function S(e,t,n){return(e=e.slice()).splice(n<0?e.length+n:n,0,e.splice(t,1)[0]),e}function C(e,t){return Object.keys(e).reduce((function(n,i){return-1===t.indexOf(i)&&(n[i]=e[i]),n}),{})}var Z={end:["touchend","touchcancel","mouseup"],move:["touchmove","mousemove"],start:["touchstart","mousedown"]},T=function(){if("undefined"==typeof window||"undefined"==typeof document)return"";var e=window.getComputedStyle(document.documentElement,"")||["-moz-hidden-iframe"],t=(Array.prototype.slice.call(e).join("").match(/-(moz|webkit|ms)-/)||""===e.OLink&&["","o"])[1];return"ms"===t?"ms":t&&t.length?t[0].toUpperCase()+t.substr(1):""}();function O(e,t){Object.keys(t).forEach((function(n){e.style[n]=t[n]}))}function k(e,t){e.style["".concat(T,"Transform")]=null==t?"":"translate3d(".concat(t.x,"px,").concat(t.y,"px,0)")}function I(e,t){e.style["".concat(T,"TransitionDuration")]=null==t?"":"".concat(t,"ms")}function E(e,t){for(;e;){if(t(e))return e;e=e.parentNode}return null}function A(e,t,n){return Math.max(e,Math.min(n,t))}function R(e){return"px"===e.substr(-2)?parseFloat(e):0}function D(e){var t=window.getComputedStyle(e);return{bottom:R(t.marginBottom),left:R(t.marginLeft),right:R(t.marginRight),top:R(t.marginTop)}}function N(e,t){var n=t.displayName||t.name;return n?"".concat(e,"(").concat(n,")"):e}function B(e,t){var n=e.getBoundingClientRect();return{top:n.top+t.top,left:n.left+t.left}}function M(e){return e.touches&&e.touches.length?{x:e.touches[0].pageX,y:e.touches[0].pageY}:e.changedTouches&&e.changedTouches.length?{x:e.changedTouches[0].pageX,y:e.changedTouches[0].pageY}:{x:e.pageX,y:e.pageY}}function W(e){return e.touches&&e.touches.length||e.changedTouches&&e.changedTouches.length}function L(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{left:0,top:0};if(e){var i={left:n.left+e.offsetLeft,top:n.top+e.offsetTop};return e.parentNode===t?i:L(e.parentNode,t,i)}}function F(e,t,n){return e<n&&e>t?e-1:e>n&&e<t?e+1:e}function K(e){var t=e.lockOffset,n=e.width,i=e.height,o=t,r=t,a="px";if("string"==typeof t){var s=/^[+-]?\d*(?:\.\d*)?(px|%)$/.exec(t);v()(null!==s,'lockOffset value should be a number or a string of a number followed by "px" or "%". Given %s',t),o=parseFloat(t),r=parseFloat(t),a=s[1]}return v()(isFinite(o)&&isFinite(r),"lockOffset value should be a finite. Given %s",t),"%"===a&&(o=o*n/100,r=r*i/100),{x:o,y:r}}function H(e){var t=e.height,n=e.width,i=e.lockOffset,r=Array.isArray(i)?i:[i,i];v()(2===r.length,"lockOffset prop of SortableContainer should be a single value or an array of exactly two values. Given %s",i);var a=(0,o.Z)(r,2),s=a[0],l=a[1];return[K({height:t,lockOffset:s,width:n}),K({height:t,lockOffset:l,width:n})]}function P(e){return e instanceof HTMLElement?function(e){var t=window.getComputedStyle(e),n=/(auto|scroll)/;return["overflow","overflowX","overflowY"].find((function(e){return n.test(t[e])}))}(e)?e:P(e.parentNode):null}function G(e){var t=window.getComputedStyle(e);return"grid"===t.display?{x:R(t.gridColumnGap),y:R(t.gridRowGap)}:{x:0,y:0}}var j=27,U=32,z=37,X=38,Y=39,V=40,_="A",q="BUTTON",J="CANVAS",Q="INPUT",$="OPTION",ee="TEXTAREA",te="SELECT";function ne(e){var t="input, textarea, select, canvas, [contenteditable]",n=e.querySelectorAll(t),i=e.cloneNode(!0);return(0,m.Z)(i.querySelectorAll(t)).forEach((function(e,t){("file"!==e.type&&(e.value=n[t].value),"radio"===e.type&&e.name&&(e.name="__sortableClone__".concat(e.name)),e.tagName===J&&n[t].width>0&&n[t].height>0)&&e.getContext("2d").drawImage(n[t],0,0)})),i}function ie(e){return null!=e.sortableHandle}var oe=function(){function e(t,n){(0,a.Z)(this,e),this.container=t,this.onScrollCallback=n}return(0,s.Z)(e,[{key:"clear",value:function(){null!=this.interval&&(clearInterval(this.interval),this.interval=null)}},{key:"update",value:function(e){var t=this,n=e.translate,i=e.minTranslate,o=e.maxTranslate,r=e.width,a=e.height,s={x:0,y:0},l={x:1,y:1},c=10,d=10,h=this.container,u=h.scrollTop,f=h.scrollLeft,p=h.scrollHeight,g=h.scrollWidth,x=0===u,y=p-u-h.clientHeight==0,v=0===f,m=g-f-h.clientWidth==0;n.y>=o.y-a/2&&!y?(s.y=1,l.y=d*Math.abs((o.y-a/2-n.y)/a)):n.x>=o.x-r/2&&!m?(s.x=1,l.x=c*Math.abs((o.x-r/2-n.x)/r)):n.y<=i.y+a/2&&!x?(s.y=-1,l.y=d*Math.abs((n.y-a/2-i.y)/a)):n.x<=i.x+r/2&&!v&&(s.x=-1,l.x=c*Math.abs((n.x-r/2-i.x)/r)),this.interval&&(this.clear(),this.isAutoScrolling=!1),0===s.x&&0===s.y||(this.interval=setInterval((function(){t.isAutoScrolling=!0;var e={left:l.x*s.x,top:l.y*s.y};t.container.scrollTop+=e.top,t.container.scrollLeft+=e.left,t.onScrollCallback(e)}),5))}}]),e}();var re={axis:g().oneOf(["x","y","xy"]),contentWindow:g().any,disableAutoscroll:g().bool,distance:g().number,getContainer:g().func,getHelperDimensions:g().func,helperClass:g().string,helperContainer:g().oneOfType([g().func,"undefined"==typeof HTMLElement?g().any:g().instanceOf(HTMLElement)]),hideSortableGhost:g().bool,keyboardSortingTransitionDuration:g().number,lockAxis:g().string,lockOffset:g().oneOfType([g().number,g().string,g().arrayOf(g().oneOfType([g().number,g().string]))]),lockToContainerEdges:g().bool,onSortEnd:g().func,onSortMove:g().func,onSortOver:g().func,onSortStart:g().func,pressDelay:g().number,pressThreshold:g().number,keyCodes:g().shape({lift:g().arrayOf(g().number),drop:g().arrayOf(g().number),cancel:g().arrayOf(g().number),up:g().arrayOf(g().number),down:g().arrayOf(g().number)}),shouldCancelStart:g().func,transitionDuration:g().number,updateBeforeSortStart:g().func,useDragHandle:g().bool,useWindowAsScrollContainer:g().bool},ae={lift:[U],drop:[U],cancel:[j],up:[X,z],down:[V,Y]},se={axis:"y",disableAutoscroll:!1,distance:0,getHelperDimensions:function(e){var t=e.node;return{height:t.offsetHeight,width:t.offsetWidth}},hideSortableGhost:!0,lockOffset:"50%",lockToContainerEdges:!1,pressDelay:0,pressThreshold:5,keyCodes:ae,shouldCancelStart:function(e){return-1!==[Q,ee,te,$,q].indexOf(e.target.tagName)||!!E(e.target,(function(e){return"true"===e.contentEditable}))},transitionDuration:300,useWindowAsScrollContainer:!1},le=Object.keys(re);function ce(e){v()(!(e.distance&&e.pressDelay),"Attempted to set both `pressDelay` and `distance` on SortableContainer, you may only use one or the other, not both at the same time.")}function de(e,t){try{var n=e()}catch(e){return t(!0,e)}return n&&n.then?n.then(t.bind(null,!1),t.bind(null,!0)):t(!1,value)}function he(e){var t,n,p=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{withRef:!1};return n=t=function(t){function n(e){var t;return(0,a.Z)(this,n),t=(0,l.Z)(this,(0,c.Z)(n).call(this,e)),(0,u.Z)((0,h.Z)((0,h.Z)(t)),"state",{}),(0,u.Z)((0,h.Z)((0,h.Z)(t)),"handleStart",(function(e){var n=t.props,i=n.distance,o=n.shouldCancelStart;if(2!==e.button&&!o(e)){t.touched=!0,t.position=M(e);var r=E(e.target,(function(e){return null!=e.sortableInfo}));if(r&&r.sortableInfo&&t.nodeIsChild(r)&&!t.state.sorting){var a=t.props.useDragHandle,s=r.sortableInfo,l=s.index,c=s.collection;if(s.disabled)return;if(a&&!E(e.target,ie))return;t.manager.active={collection:c,index:l},W(e)||e.target.tagName!==_||e.preventDefault(),i||(0===t.props.pressDelay?t.handlePress(e):t.pressTimer=setTimeout((function(){return t.handlePress(e)}),t.props.pressDelay))}}})),(0,u.Z)((0,h.Z)((0,h.Z)(t)),"nodeIsChild",(function(e){return e.sortableInfo.manager===t.manager})),(0,u.Z)((0,h.Z)((0,h.Z)(t)),"handleMove",(function(e){var n=t.props,i=n.distance,o=n.pressThreshold;if(!t.state.sorting&&t.touched&&!t._awaitingUpdateBeforeSortStart){var r=M(e),a={x:t.position.x-r.x,y:t.position.y-r.y},s=Math.abs(a.x)+Math.abs(a.y);t.delta=a,i||o&&!(s>=o)?i&&s>=i&&t.manager.isActive()&&t.handlePress(e):(clearTimeout(t.cancelTimer),t.cancelTimer=setTimeout(t.cancel,0))}})),(0,u.Z)((0,h.Z)((0,h.Z)(t)),"handleEnd",(function(){t.touched=!1,t.cancel()})),(0,u.Z)((0,h.Z)((0,h.Z)(t)),"cancel",(function(){var e=t.props.distance;t.state.sorting||(e||clearTimeout(t.pressTimer),t.manager.active=null)})),(0,u.Z)((0,h.Z)((0,h.Z)(t)),"handlePress",(function(e){try{var n=t.manager.getActive(),i=function(){if(n){var i=function(){var n=f.sortableInfo.index,i=D(f),o=G(t.container),d=t.scrollContainer.getBoundingClientRect(),x=s({index:n,node:f,collection:p});if(t.node=f,t.margin=i,t.gridGap=o,t.width=x.width,t.height=x.height,t.marginOffset={x:t.margin.left+t.margin.right+t.gridGap.x,y:Math.max(t.margin.top,t.margin.bottom,t.gridGap.y)},t.boundingClientRect=f.getBoundingClientRect(),t.containerBoundingRect=d,t.index=n,t.newIndex=n,t.axis={x:a.indexOf("x")>=0,y:a.indexOf("y")>=0},t.offsetEdge=L(f,t.container),t.initialOffset=M(g?(0,r.Z)({},e,{pageX:t.boundingClientRect.left,pageY:t.boundingClientRect.top}):e),t.initialScroll={left:t.scrollContainer.scrollLeft,top:t.scrollContainer.scrollTop},t.initialWindowScroll={left:window.pageXOffset,top:window.pageYOffset},t.helper=t.helperContainer.appendChild(ne(f)),O(t.helper,{boxSizing:"border-box",height:"".concat(t.height,"px"),left:"".concat(t.boundingClientRect.left-i.left,"px"),pointerEvents:"none",position:"fixed",top:"".concat(t.boundingClientRect.top-i.top,"px"),width:"".concat(t.width,"px")}),g&&t.helper.focus(),c&&(t.sortableGhost=f,O(f,{opacity:0,visibility:"hidden"})),t.minTranslate={},t.maxTranslate={},g){var y=u?{top:0,left:0,width:t.contentWindow.innerWidth,height:t.contentWindow.innerHeight}:t.containerBoundingRect,v=y.top,m=y.left,w=y.width,b=v+y.height,S=m+w;t.axis.x&&(t.minTranslate.x=m-t.boundingClientRect.left,t.maxTranslate.x=S-(t.boundingClientRect.left+t.width)),t.axis.y&&(t.minTranslate.y=v-t.boundingClientRect.top,t.maxTranslate.y=b-(t.boundingClientRect.top+t.height))}else t.axis.x&&(t.minTranslate.x=(u?0:d.left)-t.boundingClientRect.left-t.width/2,t.maxTranslate.x=(u?t.contentWindow.innerWidth:d.left+d.width)-t.boundingClientRect.left-t.width/2),t.axis.y&&(t.minTranslate.y=(u?0:d.top)-t.boundingClientRect.top-t.height/2,t.maxTranslate.y=(u?t.contentWindow.innerHeight:d.top+d.height)-t.boundingClientRect.top-t.height/2);l&&l.split(" ").forEach((function(e){return t.helper.classList.add(e)})),t.listenerNode=e.touches?f:t.contentWindow,g?(t.listenerNode.addEventListener("wheel",t.handleKeyEnd,!0),t.listenerNode.addEventListener("mousedown",t.handleKeyEnd,!0),t.listenerNode.addEventListener("keydown",t.handleKeyDown)):(Z.move.forEach((function(e){return t.listenerNode.addEventListener(e,t.handleSortMove,!1)})),Z.end.forEach((function(e){return t.listenerNode.addEventListener(e,t.handleSortEnd,!1)}))),t.setState({sorting:!0,sortingIndex:n}),h&&h({node:f,index:n,collection:p,isKeySorting:g,nodes:t.manager.getOrderedRefs(),helper:t.helper},e),g&&t.keyMove(0)},o=t.props,a=o.axis,s=o.getHelperDimensions,l=o.helperClass,c=o.hideSortableGhost,d=o.updateBeforeSortStart,h=o.onSortStart,u=o.useWindowAsScrollContainer,f=n.node,p=n.collection,g=t.manager.isKeySorting,x=function(){if("function"==typeof d){t._awaitingUpdateBeforeSortStart=!0;var n=de((function(){var t=f.sortableInfo.index;return Promise.resolve(d({collection:p,index:t,node:f,isKeySorting:g},e)).then((function(){}))}),(function(e,n){if(t._awaitingUpdateBeforeSortStart=!1,e)throw n;return n}));if(n&&n.then)return n.then((function(){}))}}();return x&&x.then?x.then(i):i()}}();return Promise.resolve(i&&i.then?i.then((function(){})):void 0)}catch(e){return Promise.reject(e)}})),(0,u.Z)((0,h.Z)((0,h.Z)(t)),"handleSortMove",(function(e){var n=t.props.onSortMove;"function"==typeof e.preventDefault&&e.preventDefault(),t.updateHelperPosition(e),t.animateNodes(),t.autoscroll(),n&&n(e)})),(0,u.Z)((0,h.Z)((0,h.Z)(t)),"handleSortEnd",(function(e){var n=t.props,i=n.hideSortableGhost,o=n.onSortEnd,r=t.manager,a=r.active.collection,s=r.isKeySorting,l=t.manager.getOrderedRefs();t.listenerNode&&(s?(t.listenerNode.removeEventListener("wheel",t.handleKeyEnd,!0),t.listenerNode.removeEventListener("mousedown",t.handleKeyEnd,!0),t.listenerNode.removeEventListener("keydown",t.handleKeyDown)):(Z.move.forEach((function(e){return t.listenerNode.removeEventListener(e,t.handleSortMove)})),Z.end.forEach((function(e){return t.listenerNode.removeEventListener(e,t.handleSortEnd)})))),t.helper.parentNode.removeChild(t.helper),i&&t.sortableGhost&&O(t.sortableGhost,{opacity:"",visibility:""});for(var c=0,d=l.length;c<d;c++){var h=l[c],u=h.node;h.edgeOffset=null,h.boundingClientRect=null,k(u,null),I(u,null),h.translate=null}t.autoScroller.clear(),t.manager.active=null,t.manager.isKeySorting=!1,t.setState({sorting:!1,sortingIndex:null}),"function"==typeof o&&o({collection:a,newIndex:t.newIndex,oldIndex:t.index,isKeySorting:s,nodes:l},e),t.touched=!1})),(0,u.Z)((0,h.Z)((0,h.Z)(t)),"autoscroll",(function(){var e=t.props.disableAutoscroll,n=t.manager.isKeySorting;if(e)t.autoScroller.clear();else{if(n){var i=(0,r.Z)({},t.translate),o=0,a=0;return t.axis.x&&(i.x=Math.min(t.maxTranslate.x,Math.max(t.minTranslate.x,t.translate.x)),o=t.translate.x-i.x),t.axis.y&&(i.y=Math.min(t.maxTranslate.y,Math.max(t.minTranslate.y,t.translate.y)),a=t.translate.y-i.y),t.translate=i,k(t.helper,t.translate),t.scrollContainer.scrollLeft+=o,void(t.scrollContainer.scrollTop+=a)}t.autoScroller.update({height:t.height,maxTranslate:t.maxTranslate,minTranslate:t.minTranslate,translate:t.translate,width:t.width})}})),(0,u.Z)((0,h.Z)((0,h.Z)(t)),"onAutoScroll",(function(e){t.translate.x+=e.left,t.translate.y+=e.top,t.animateNodes()})),(0,u.Z)((0,h.Z)((0,h.Z)(t)),"handleKeyDown",(function(e){var n=e.keyCode,i=t.props,o=i.shouldCancelStart,a=i.keyCodes,s=void 0===a?{}:a,l=(0,r.Z)({},ae,s);t.manager.active&&!t.manager.isKeySorting||!(t.manager.active||l.lift.includes(n)&&!o(e)&&t.isValidSortingTarget(e))||(e.stopPropagation(),e.preventDefault(),l.lift.includes(n)&&!t.manager.active?t.keyLift(e):l.drop.includes(n)&&t.manager.active?t.keyDrop(e):l.cancel.includes(n)?(t.newIndex=t.manager.active.index,t.keyDrop(e)):l.up.includes(n)?t.keyMove(-1):l.down.includes(n)&&t.keyMove(1))})),(0,u.Z)((0,h.Z)((0,h.Z)(t)),"keyLift",(function(e){var n=e.target,i=E(n,(function(e){return null!=e.sortableInfo})).sortableInfo,o=i.index,r=i.collection;t.initialFocusedNode=n,t.manager.isKeySorting=!0,t.manager.active={index:o,collection:r},t.handlePress(e)})),(0,u.Z)((0,h.Z)((0,h.Z)(t)),"keyMove",(function(e){var n=t.manager.getOrderedRefs(),i=n[n.length-1].node.sortableInfo.index,o=t.newIndex+e,r=t.newIndex;if(!(o<0||o>i)){t.prevIndex=r,t.newIndex=o;var a=F(t.newIndex,t.prevIndex,t.index),s=n.find((function(e){return e.node.sortableInfo.index===a})),l=s.node,c=t.containerScrollDelta,d=s.boundingClientRect||B(l,c),h=s.translate||{x:0,y:0},u=d.top+h.y-c.top,f=d.left+h.x-c.left,p=r<o,g=p&&t.axis.x?l.offsetWidth-t.width:0,x=p&&t.axis.y?l.offsetHeight-t.height:0;t.handleSortMove({pageX:f+g,pageY:u+x,ignoreTransition:0===e})}})),(0,u.Z)((0,h.Z)((0,h.Z)(t)),"keyDrop",(function(e){t.handleSortEnd(e),t.initialFocusedNode&&t.initialFocusedNode.focus()})),(0,u.Z)((0,h.Z)((0,h.Z)(t)),"handleKeyEnd",(function(e){t.manager.active&&t.keyDrop(e)})),(0,u.Z)((0,h.Z)((0,h.Z)(t)),"isValidSortingTarget",(function(e){var n=t.props.useDragHandle,i=e.target,o=E(i,(function(e){return null!=e.sortableInfo}));return o&&o.sortableInfo&&!o.sortableInfo.disabled&&(n?ie(i):i.sortableInfo)})),ce(e),t.manager=new w,t.events={end:t.handleEnd,move:t.handleMove,start:t.handleStart},t}return(0,d.Z)(n,t),(0,s.Z)(n,[{key:"getChildContext",value:function(){return{manager:this.manager}}},{key:"componentDidMount",value:function(){var e=this,t=this.props.useWindowAsScrollContainer,n=this.getContainer();Promise.resolve(n).then((function(n){e.container=n,e.document=e.container.ownerDocument||document;var i=e.props.contentWindow||e.document.defaultView||window;e.contentWindow="function"==typeof i?i():i,e.scrollContainer=t?e.document.scrollingElement||e.document.documentElement:P(e.container)||e.container,e.autoScroller=new oe(e.scrollContainer,e.onAutoScroll),Object.keys(e.events).forEach((function(t){return Z[t].forEach((function(n){return e.container.addEventListener(n,e.events[t],!1)}))})),e.container.addEventListener("keydown",e.handleKeyDown)}))}},{key:"componentWillUnmount",value:function(){var e=this;this.helper&&this.helper.parentNode&&this.helper.parentNode.removeChild(this.helper),this.container&&(Object.keys(this.events).forEach((function(t){return Z[t].forEach((function(n){return e.container.removeEventListener(n,e.events[t])}))})),this.container.removeEventListener("keydown",this.handleKeyDown))}},{key:"updateHelperPosition",value:function(e){var t=this.props,n=t.lockAxis,i=t.lockOffset,r=t.lockToContainerEdges,a=t.transitionDuration,s=t.keyboardSortingTransitionDuration,l=void 0===s?a:s,c=this.manager.isKeySorting,d=e.ignoreTransition,h=M(e),u={x:h.x-this.initialOffset.x,y:h.y-this.initialOffset.y};if(u.y-=window.pageYOffset-this.initialWindowScroll.top,u.x-=window.pageXOffset-this.initialWindowScroll.left,this.translate=u,r){var f=H({height:this.height,lockOffset:i,width:this.width}),p=(0,o.Z)(f,2),g=p[0],x=p[1],y={x:this.width/2-g.x,y:this.height/2-g.y},v={x:this.width/2-x.x,y:this.height/2-x.y};u.x=A(this.minTranslate.x+y.x,this.maxTranslate.x-v.x,u.x),u.y=A(this.minTranslate.y+y.y,this.maxTranslate.y-v.y,u.y)}"x"===n?u.y=0:"y"===n&&(u.x=0),c&&l&&!d&&I(this.helper,l),k(this.helper,u)}},{key:"animateNodes",value:function(){var e=this.props,t=e.transitionDuration,n=e.hideSortableGhost,i=e.onSortOver,o=this.containerScrollDelta,r=this.windowScrollDelta,a=this.manager.getOrderedRefs(),s=this.offsetEdge.left+this.translate.x+o.left,l=this.offsetEdge.top+this.translate.y+o.top,c=this.manager.isKeySorting,d=this.newIndex;this.newIndex=null;for(var h=0,u=a.length;h<u;h++){var f=a[h].node,p=f.sortableInfo.index,g=f.offsetWidth,x=f.offsetHeight,y={height:this.height>x?x/2:this.height/2,width:this.width>g?g/2:this.width/2},v=c&&p>this.index&&p<=d,m=c&&p<this.index&&p>=d,w={x:0,y:0},b=a[h].edgeOffset;b||(b=L(f,this.container),a[h].edgeOffset=b,c&&(a[h].boundingClientRect=B(f,o)));var S=h<a.length-1&&a[h+1],C=h>0&&a[h-1];S&&!S.edgeOffset&&(S.edgeOffset=L(S.node,this.container),c&&(S.boundingClientRect=B(S.node,o))),p!==this.index?(t&&I(f,t),this.axis.x?this.axis.y?m||p<this.index&&(s+r.left-y.width<=b.left&&l+r.top<=b.top+y.height||l+r.top+y.height<=b.top)?(w.x=this.width+this.marginOffset.x,b.left+w.x>this.containerBoundingRect.width-y.width&&S&&(w.x=S.edgeOffset.left-b.left,w.y=S.edgeOffset.top-b.top),null===this.newIndex&&(this.newIndex=p)):(v||p>this.index&&(s+r.left+y.width>=b.left&&l+r.top+y.height>=b.top||l+r.top+y.height>=b.top+x))&&(w.x=-(this.width+this.marginOffset.x),b.left+w.x<this.containerBoundingRect.left+y.width&&C&&(w.x=C.edgeOffset.left-b.left,w.y=C.edgeOffset.top-b.top),this.newIndex=p):v||p>this.index&&s+r.left+y.width>=b.left?(w.x=-(this.width+this.marginOffset.x),this.newIndex=p):(m||p<this.index&&s+r.left<=b.left+y.width)&&(w.x=this.width+this.marginOffset.x,null==this.newIndex&&(this.newIndex=p)):this.axis.y&&(v||p>this.index&&l+r.top+y.height>=b.top?(w.y=-(this.height+this.marginOffset.y),this.newIndex=p):(m||p<this.index&&l+r.top<=b.top+y.height)&&(w.y=this.height+this.marginOffset.y,null==this.newIndex&&(this.newIndex=p))),k(f,w),a[h].translate=w):n&&(this.sortableGhost=f,O(f,{opacity:0,visibility:"hidden"}))}null==this.newIndex&&(this.newIndex=this.index),c&&(this.newIndex=d);var Z=c?this.prevIndex:d;i&&this.newIndex!==Z&&i({collection:this.manager.active.collection,index:this.index,newIndex:this.newIndex,oldIndex:Z,isKeySorting:c,nodes:a,helper:this.helper})}},{key:"getWrappedInstance",value:function(){return v()(p.withRef,"To access the wrapped instance, you need to pass in {withRef: true} as the second argument of the SortableContainer() call"),this.refs.wrappedInstance}},{key:"getContainer",value:function(){var e=this.props.getContainer;return"function"!=typeof e?(0,x.findDOMNode)(this):e(p.withRef?this.getWrappedInstance():void 0)}},{key:"render",value:function(){var t=p.withRef?"wrappedInstance":null;return(0,f.createElement)(e,(0,i.Z)({ref:t},C(this.props,le)))}},{key:"helperContainer",get:function(){var e=this.props.helperContainer;return"function"==typeof e?e():this.props.helperContainer||this.document.body}},{key:"containerScrollDelta",get:function(){return this.props.useWindowAsScrollContainer?{left:0,top:0}:{left:this.scrollContainer.scrollLeft-this.initialScroll.left,top:this.scrollContainer.scrollTop-this.initialScroll.top}}},{key:"windowScrollDelta",get:function(){return{left:this.contentWindow.pageXOffset-this.initialWindowScroll.left,top:this.contentWindow.pageYOffset-this.initialWindowScroll.top}}}]),n}(f.Component),(0,u.Z)(t,"displayName",N("sortableList",e)),(0,u.Z)(t,"defaultProps",se),(0,u.Z)(t,"propTypes",re),(0,u.Z)(t,"childContextTypes",{manager:g().object.isRequired}),n}var ue={index:g().number.isRequired,collection:g().oneOfType([g().number,g().string]),disabled:g().bool},fe=Object.keys(ue);function pe(e){var t,n,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{withRef:!1};return n=t=function(t){function n(){return(0,a.Z)(this,n),(0,l.Z)(this,(0,c.Z)(n).apply(this,arguments))}return(0,d.Z)(n,t),(0,s.Z)(n,[{key:"componentDidMount",value:function(){this.register()}},{key:"componentDidUpdate",value:function(e){this.node&&(e.index!==this.props.index&&(this.node.sortableInfo.index=this.props.index),e.disabled!==this.props.disabled&&(this.node.sortableInfo.disabled=this.props.disabled)),e.collection!==this.props.collection&&(this.unregister(e.collection),this.register())}},{key:"componentWillUnmount",value:function(){this.unregister()}},{key:"register",value:function(){var e=this.props,t=e.collection,n=e.disabled,i=e.index,o=(0,x.findDOMNode)(this);o.sortableInfo={collection:t,disabled:n,index:i,manager:this.context.manager},this.node=o,this.ref={node:o},this.context.manager.add(t,this.ref)}},{key:"unregister",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props.collection;this.context.manager.remove(e,this.ref)}},{key:"getWrappedInstance",value:function(){return v()(o.withRef,"To access the wrapped instance, you need to pass in {withRef: true} as the second argument of the SortableElement() call"),this.refs.wrappedInstance}},{key:"render",value:function(){var t=o.withRef?"wrappedInstance":null;return(0,f.createElement)(e,(0,i.Z)({ref:t},C(this.props,fe)))}}]),n}(f.Component),(0,u.Z)(t,"displayName",N("sortableElement",e)),(0,u.Z)(t,"contextTypes",{manager:g().object.isRequired}),(0,u.Z)(t,"propTypes",ue),(0,u.Z)(t,"defaultProps",{collection:0}),n}}}]); |