!function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=8)}([function(e,t){e.exports=window.React},function(e,t,n){var o=["list","setList","children","tag","style","className","clone","onAdd","onChange","onChoose","onClone","onEnd","onFilter","onRemove","onSort","onStart","onUnchoose","onUpdate","onMove","onSpill","onSelect","onDeselect"];function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,o=Array(t);n0?"multidrag":e.swapItem?"swap":"normal"}y(e.exports,"Sortable",(function(){return $882b6d93070905b3$re_export$Sortable})),y(e.exports,"Direction",(function(){return $882b6d93070905b3$re_export$Direction})),y(e.exports,"DOMRect",(function(){return $882b6d93070905b3$re_export$DOMRect})),y(e.exports,"GroupOptions",(function(){return $882b6d93070905b3$re_export$GroupOptions})),y(e.exports,"MoveEvent",(function(){return $882b6d93070905b3$re_export$MoveEvent})),y(e.exports,"Options",(function(){return $882b6d93070905b3$re_export$Options})),y(e.exports,"PullResult",(function(){return $882b6d93070905b3$re_export$PullResult})),y(e.exports,"PutResult",(function(){return $882b6d93070905b3$re_export$PutResult})),y(e.exports,"SortableEvent",(function(){return $882b6d93070905b3$re_export$SortableEvent})),y(e.exports,"SortableOptions",(function(){return $882b6d93070905b3$re_export$SortableOptions})),y(e.exports,"Utils",(function(){return $882b6d93070905b3$re_export$Utils})),y(e.exports,"ReactSortable",(function(){return T}));var x,P,I={dragging:null},T=function(e){function t(e){var n;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=function(e,t,n){return t=i(t),function(e,t){if(t&&("object"==r(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,function(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return!!e}()?Reflect.construct(t,n||[],i(e).constructor):t.apply(e,n))}(this,t,[e])).ref=(0,m.createRef)();var o=s(e.list).map((function(e){return Object.assign(e,{chosen:!1,selected:!1})}));return e.setList(o,n.sortable,I),b(g)(!e.plugins,'\nPlugins prop is no longer supported.\nInstead, mount it with "Sortable.mount(new MultiDrag())"\nPlease read the updated README.md at https://github.com/SortableJS/react-sortablejs.\n '),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&l(e,t)}(t,e),n=t,(c=[{key:"componentDidMount",value:function(){if(null!==this.ref.current){var e=this.makeOptions();b(h).create(this.ref.current,e)}}},{key:"componentDidUpdate",value:function(e){e.disabled!==this.props.disabled&&this.sortable&&this.sortable.option("disabled",this.props.disabled)}},{key:"render",value:function(){var e=this.props,t=e.tag,n={style:e.style,className:e.className,id:e.id},o=t&&null!==t?t:"div";return(0,m.createElement)(o,d({ref:this.ref},n),this.getChildren())}},{key:"getChildren",value:function(){var e=this.props,t=e.children,n=e.dataIdAttr,o=e.selectedClass,r=void 0===o?"sortable-selected":o,a=e.chosenClass,i=void 0===a?"sortable-chosen":a,l=(e.dragClass,e.fallbackClass,e.ghostClass,e.swapClass,e.filter),s=void 0===l?"sortable-filter":l,c=e.list;if(!t||null==t)return null;var u=n||"data-id";return m.Children.map(t,(function(e,t){if(void 0!==e){var n=c[t]||{},o=e.props.className,a="string"==typeof s&&f({},s.replace(".",""),!!n.filtered),l=b(v)(o,d(f(f({},r,n.selected),i,n.chosen),a));return(0,m.cloneElement)(e,f(f({},u,e.key),"className",l))}}))}},{key:"sortable",get:function(){var e=this.ref.current;if(null===e)return null;var t=Object.keys(e).find((function(e){return e.includes("Sortable")}));return t?e[t]:null}},{key:"makeOptions",value:function(){var e,t=this,n=((e=this.props).list,e.setList,e.children,e.tag,e.style,e.className,e.clone,e.onAdd,e.onChange,e.onChoose,e.onClone,e.onEnd,e.onFilter,e.onRemove,e.onSort,e.onStart,e.onUnchoose,e.onUpdate,e.onMove,e.onSpill,e.onSelect,e.onDeselect,function(e,t){if(null==e)return{};var n,o,r=function(e,t){if(null==e)return{};var n={};for(var o in e)if({}.hasOwnProperty.call(e,o)){if(t.includes(o))continue;n[o]=e[o]}return n}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o when using the "').concat(a,'" plugin'))}E(c),i.forEach((function(n){var o=n.oldIndex,r=t.props.clone(n.item,e);l.splice(o,1,r)}))}r(l=l.map((function(e){return Object.assign(e,{selected:!1})})),this.sortable,I)}},{key:"onUpdate",value:function(e){var t=this.props,n=t.list,o=t.setList,r=O(e,n);return E(r),S(r),o(function(e,t){return _(e,D(e,t))}(r,n),this.sortable,I)}},{key:"onStart",value:function(){I.dragging=this}},{key:"onEnd",value:function(){I.dragging=null}},{key:"onChoose",value:function(e){var t=this.props,n=t.list;(0,t.setList)(n.map((function(t,n){var o=t;return n===e.oldIndex&&(o=Object.assign(t,{chosen:!0})),o})),this.sortable,I)}},{key:"onUnchoose",value:function(e){var t=this.props,n=t.list;(0,t.setList)(n.map((function(t,n){var o=t;return n===e.oldIndex&&(o=Object.assign(o,{chosen:!1})),o})),this.sortable,I)}},{key:"onSpill",value:function(e){var t=this.props,n=t.removeOnSpill,o=t.revertOnSpill;n&&!o&&w(e.item)}},{key:"onSelect",value:function(e){var t=this.props,n=t.list,o=t.setList,r=n.map((function(e){return Object.assign(e,{selected:!1})}));e.newIndicies.forEach((function(t){var n=t.index;if(-1===n)return console.log('"'.concat(e.type,'" had indice of "').concat(t.index,"\", which is probably -1 and doesn't usually happen here.")),void console.log(e);r[n].selected=!0})),o(r,this.sortable,I)}},{key:"onDeselect",value:function(e){var t=this.props,n=t.list,o=t.setList,r=n.map((function(e){return Object.assign(e,{selected:!1})}));e.newIndicies.forEach((function(e){var t=e.index;-1!==t&&(r[t].selected=!0)})),o(r,this.sortable,I)}}])&&a(n.prototype,c),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,c}(m.Component);f(T,"defaultProps",{clone:function(e){return e}}),x=e.exports,P={},Object.keys(P).forEach((function(e){"default"===e||"__esModule"===e||x.hasOwnProperty(e)||Object.defineProperty(x,e,{enumerable:!0,get:function(){return P[e]}})}))},function(e,t,n){e.exports=n(6)()},function(e,t,n){"use strict";function o(){return(o=Object.assign||function(e){for(var t=1;t"===t[0]&&(t=t.substring(1)),e)try{if(e.matches)return e.matches(t);if(e.msMatchesSelector)return e.msMatchesSelector(t);if(e.webkitMatchesSelector)return e.webkitMatchesSelector(t)}catch(e){return!1}return!1}}function v(e){return e.host&&e!==document&&e.host.nodeType?e.host:e.parentNode}function m(e,t,n,o){if(e){n=n||document;do{if(null!=t&&(">"===t[0]?e.parentNode===n&&h(e,t):h(e,t))||o&&e===n)return e;if(e===n)break}while(e=v(e))}return null}var g,b=/\s+/g;function y(e,t,n){if(e&&t)if(e.classList)e.classList[n?"add":"remove"](t);else{var o=(" "+e.className+" ").replace(b," ").replace(" "+t+" "," ");e.className=(o+(n?" "+t:"")).replace(b," ")}}function w(e,t,n){var o=e&&e.style;if(o){if(void 0===n)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(e,""):e.currentStyle&&(n=e.currentStyle),void 0===t?n:n[t];t in o||-1!==t.indexOf("webkit")||(t="-webkit-"+t),o[t]=n+("string"==typeof n?"":"px")}}function E(e,t){var n="";if("string"==typeof e)n=e;else do{var o=w(e,"transform");o&&"none"!==o&&(n=o+" "+n)}while(!t&&(e=e.parentNode));var r=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return r&&new r(n)}function S(e,t,n){if(e){var o=e.getElementsByTagName(t),r=0,a=o.length;if(n)for(;r=a:r<=a))return o;if(o===O())break;o=T(o,!1)}return!1}function C(e,t,n){for(var o=0,r=0,a=e.children;r=0||(r[n]=e[n]);return r}(r,["evt"]);$.pluginEvent.bind(Ne)(e,t,o({dragEl:F,parentEl:z,ghostEl:W,rootEl:K,nextEl:G,lastDownEl:q,cloneEl:V,cloneHidden:Z,dragStarted:ue,putSortable:oe,activeSortable:Ne.active,originalEvent:a,oldIndex:J,oldDraggableIndex:ee,newIndex:Q,newDraggableIndex:te,hideGhostForTarget:Te,unhideGhostForTarget:Me,cloneNowHidden:function(){Z=!0},cloneNowShown:function(){Z=!1},dispatchSortableEvent:function(e){U({sortable:t,name:e,originalEvent:a})}},i))};function U(e){Y(o({putSortable:oe,cloneEl:V,targetEl:F,rootEl:K,oldIndex:J,oldDraggableIndex:ee,newIndex:Q,newDraggableIndex:te},e))}var F,z,W,K,G,q,V,Z,J,Q,ee,te,ne,oe,re,ae,ie,le,se,ce,ue,de,fe,pe,he,ve=!1,me=!1,ge=[],be=!1,ye=!1,we=[],Ee=!1,Se=[],Oe="undefined"!=typeof document,De=c,_e=i||a?"cssFloat":"float",Ce=Oe&&!u&&!c&&"draggable"in document.createElement("div"),xe=function(){if(Oe){if(a)return!1;var e=document.createElement("x");return e.style.cssText="pointer-events:auto","auto"===e.style.pointerEvents}}(),Pe=function(e,t){var n=w(e),o=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),r=C(e,0,t),a=C(e,1,t),i=r&&w(r),l=a&&w(a),s=i&&parseInt(i.marginLeft)+parseInt(i.marginRight)+D(r).width,c=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+D(a).width;return"flex"===n.display?"column"===n.flexDirection||"column-reverse"===n.flexDirection?"vertical":"horizontal":"grid"===n.display?n.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal":r&&i.float&&"none"!==i.float?!a||"both"!==l.clear&&l.clear!==("left"===i.float?"left":"right")?"horizontal":"vertical":r&&("block"===i.display||"flex"===i.display||"table"===i.display||"grid"===i.display||s>=o&&"none"===n[_e]||a&&"none"===n[_e]&&s+c>o)?"vertical":"horizontal"},Ie=function(e){function t(e,n){return function(o,r,a,i){if(null==e&&(n||o.options.group.name&&r.options.group.name&&o.options.group.name===r.options.group.name))return!0;if(null==e||!1===e)return!1;if(n&&"clone"===e)return e;if("function"==typeof e)return t(e(o,r,a,i),n)(o,r,a,i);var l=(n?o:r).options.group.name;return!0===e||"string"==typeof e&&e===l||e.join&&e.indexOf(l)>-1}}var n={},o=e.group;o&&"object"==typeof o||(o={name:o}),n.name=o.name,n.checkPull=t(o.pull,!0),n.checkPut=t(o.put),n.revertClone=o.revertClone,e.group=n},Te=function(){!xe&&W&&w(W,"display","none")},Me=function(){!xe&&W&&w(W,"display","")};Oe&&document.addEventListener("click",(function(e){if(me)return e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),me=!1,!1}),!0);var je,Ae=function(e){if(F){var t=(r=(e=e.touches?e.touches[0]:e).clientX,a=e.clientY,ge.some((function(e){if(!x(e)){var t=D(e),n=e[L].options.emptyInsertThreshold;return n&&r>=t.left-n&&r<=t.right+n&&a>=t.top-n&&a<=t.bottom+n?i=e:void 0}})),i);if(t){var n={};for(var o in e)e.hasOwnProperty(o)&&(n[o]=e[o]);n.target=n.rootEl=t,n.preventDefault=void 0,n.stopPropagation=void 0,t[L]._onDragOver(n)}}var r,a,i},ke=function(e){F&&F.parentNode[L]._isOutsideThisEl(e.target)};function Ne(e,t){if(!e||!e.nodeType||1!==e.nodeType)throw"Sortable: `el` must be an HTMLElement, not "+{}.toString.call(e);this.el=e,this.options=t=Object.assign({},t),e[L]=this;var n,r,a={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(e.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return Pe(e,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(e,t){e.setData("Text",t.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:!1!==Ne.supportPointer&&"PointerEvent"in window,emptyInsertThreshold:5};for(var i in $.initializePlugins(this,e,a),a)!(i in t)&&(t[i]=a[i]);for(var l in Ie(t),this)"_"===l.charAt(0)&&"function"==typeof this[l]&&(this[l]=this[l].bind(this));this.nativeDraggable=!t.forceFallback&&Ce,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?f(e,"pointerdown",this._onTapStart):(f(e,"mousedown",this._onTapStart),f(e,"touchstart",this._onTapStart)),this.nativeDraggable&&(f(e,"dragover",this),f(e,"dragenter",this)),ge.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),Object.assign(this,(r=[],{captureAnimationState:function(){r=[],this.options.animation&&[].slice.call(this.el.children).forEach((function(e){if("none"!==w(e,"display")&&void 0!==e){r.push({target:e,rect:D(e)});var t=o({},r[r.length-1].rect);if(e.thisAnimationDuration){var n=E(e,!0);n&&(t.top-=n.f,t.left-=n.e)}e.fromRect=t}}))},addAnimationState:function(e){r.push(e)},removeAnimationState:function(e){r.splice(function(e,t){for(var n in e)if(e.hasOwnProperty(n))for(var o in t)if(t.hasOwnProperty(o)&&t[o]===e[n][o])return Number(n);return-1}(r,{target:e}),1)},animateAll:function(e){var t=this;if(!this.options.animation)return clearTimeout(n),void("function"==typeof e&&e());var o=!1,a=0;r.forEach((function(e){var n=0,r=e.target,i=r.fromRect,l=D(r),s=r.prevFromRect,c=r.prevToRect,u=e.rect,d=E(r,!0);d&&(l.top-=d.f,l.left-=d.e),r.toRect=l,r.thisAnimationDuration&&M(s,l)&&!M(i,l)&&(u.top-l.top)/(u.left-l.left)==(i.top-l.top)/(i.left-l.left)&&(n=function(e,t,n,o){return Math.sqrt(Math.pow(t.top-e.top,2)+Math.pow(t.left-e.left,2))/Math.sqrt(Math.pow(t.top-n.top,2)+Math.pow(t.left-n.left,2))*o.animation}(u,s,c,t.options)),M(l,i)||(r.prevFromRect=i,r.prevToRect=l,n||(n=t.options.animation),t.animate(r,u,l,n)),n&&(o=!0,a=Math.max(a,n),clearTimeout(r.animationResetTimer),r.animationResetTimer=setTimeout((function(){r.animationTime=0,r.prevFromRect=null,r.fromRect=null,r.prevToRect=null,r.thisAnimationDuration=null}),n),r.thisAnimationDuration=n)})),clearTimeout(n),o?n=setTimeout((function(){"function"==typeof e&&e()}),a):"function"==typeof e&&e(),r=[]},animate:function(e,t,n,o){if(o){w(e,"transition",""),w(e,"transform","");var r=E(this.el),a=(t.left-n.left)/(r&&r.a||1),i=(t.top-n.top)/(r&&r.d||1);e.animatingX=!!a,e.animatingY=!!i,w(e,"transform","translate3d("+a+"px,"+i+"px,0)"),this.forRepaintDummy=function(e){return e.offsetWidth}(e),w(e,"transition","transform "+o+"ms"+(this.options.easing?" "+this.options.easing:"")),w(e,"transform","translate3d(0,0,0)"),"number"==typeof e.animated&&clearTimeout(e.animated),e.animated=setTimeout((function(){w(e,"transition",""),w(e,"transform",""),e.animated=!1,e.animatingX=!1,e.animatingY=!1}),o)}}}))}function Re(e,t,n,o,r,l,s,c){var u,d,f=e[L],p=f.options.onMove;return!window.CustomEvent||a||i?(u=document.createEvent("Event")).initEvent("move",!0,!0):u=new CustomEvent("move",{bubbles:!0,cancelable:!0}),u.to=t,u.from=e,u.dragged=n,u.draggedRect=o,u.related=r||t,u.relatedRect=l||D(t),u.willInsertAfter=c,u.originalEvent=s,e.dispatchEvent(u),p&&(d=p.call(f,u,s)),d}function Le(e){e.draggable=!1}function Be(){Ee=!1}function Xe(e){for(var t=e.tagName+e.className+e.src+e.href+e.textContent,n=t.length,o=0;n--;)o+=t.charCodeAt(n);return o.toString(36)}function $e(e){return setTimeout(e,0)}function Ye(e){return clearTimeout(e)}Ne.prototype={constructor:Ne,_isOutsideThisEl:function(e){this.el.contains(e)||e===this.el||(de=null)},_getDirection:function(e,t){return"function"==typeof this.options.direction?this.options.direction.call(this,e,t,F):this.options.direction},_onTapStart:function(e){if(e.cancelable){var t=this,n=this.el,o=this.options,r=o.preventOnFilter,a=e.type,i=e.touches&&e.touches[0]||e.pointerType&&"touch"===e.pointerType&&e,l=(i||e).target,c=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||l,u=o.filter;if(function(e){Se.length=0;for(var t=e.getElementsByTagName("input"),n=t.length;n--;){var o=t[n];o.checked&&Se.push(o)}}(n),!F&&!(/mousedown|pointerdown/.test(a)&&0!==e.button||o.disabled)&&!c.isContentEditable&&(this.nativeDraggable||!s||!l||"SELECT"!==l.tagName.toUpperCase())&&!((l=m(l,o.draggable,n,!1))&&l.animated||q===l)){if(J=P(l),ee=P(l,o.draggable),"function"==typeof u){if(u.call(this,e,l,this))return U({sortable:t,rootEl:c,name:"filter",targetEl:l,toEl:n,fromEl:n}),H("filter",t,{evt:e}),void(r&&e.cancelable&&e.preventDefault())}else if(u&&(u=u.split(",").some((function(o){if(o=m(c,o.trim(),n,!1))return U({sortable:t,rootEl:o,name:"filter",targetEl:l,fromEl:n,toEl:n}),H("filter",t,{evt:e}),!0}))))return void(r&&e.cancelable&&e.preventDefault());o.handle&&!m(c,o.handle,n,!1)||this._prepareDragStart(e,i,l)}}},_prepareDragStart:function(e,t,n){var o,r=this,s=r.el,c=r.options,u=s.ownerDocument;if(n&&!F&&n.parentNode===s){var d=D(n);if(K=s,z=(F=n).parentNode,G=F.nextSibling,q=n,ne=c.group,Ne.dragged=F,se=(re={target:F,clientX:(t||e).clientX,clientY:(t||e).clientY}).clientX-d.left,ce=re.clientY-d.top,this._lastX=(t||e).clientX,this._lastY=(t||e).clientY,F.style["will-change"]="all",o=function(){H("delayEnded",r,{evt:e}),Ne.eventCanceled?r._onDrop():(r._disableDelayedDragEvents(),!l&&r.nativeDraggable&&(F.draggable=!0),r._triggerDragStart(e,t),U({sortable:r,name:"choose",originalEvent:e}),y(F,c.chosenClass,!0))},c.ignore.split(",").forEach((function(e){S(F,e.trim(),Le)})),f(u,"dragover",Ae),f(u,"mousemove",Ae),f(u,"touchmove",Ae),f(u,"mouseup",r._onDrop),f(u,"touchend",r._onDrop),f(u,"touchcancel",r._onDrop),l&&this.nativeDraggable&&(this.options.touchStartThreshold=4,F.draggable=!0),H("delayStart",this,{evt:e}),!c.delay||c.delayOnTouchOnly&&!t||this.nativeDraggable&&(i||a))o();else{if(Ne.eventCanceled)return void this._onDrop();f(u,"mouseup",r._disableDelayedDrag),f(u,"touchend",r._disableDelayedDrag),f(u,"touchcancel",r._disableDelayedDrag),f(u,"mousemove",r._delayedDragTouchMoveHandler),f(u,"touchmove",r._delayedDragTouchMoveHandler),c.supportPointer&&f(u,"pointermove",r._delayedDragTouchMoveHandler),r._dragStartTimer=setTimeout(o,c.delay)}}},_delayedDragTouchMoveHandler:function(e){var t=e.touches?e.touches[0]:e;Math.max(Math.abs(t.clientX-this._lastX),Math.abs(t.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){F&&Le(F),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var e=this.el.ownerDocument;p(e,"mouseup",this._disableDelayedDrag),p(e,"touchend",this._disableDelayedDrag),p(e,"touchcancel",this._disableDelayedDrag),p(e,"mousemove",this._delayedDragTouchMoveHandler),p(e,"touchmove",this._delayedDragTouchMoveHandler),p(e,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(e,t){t=t||"touch"==e.pointerType&&e,!this.nativeDraggable||t?f(document,this.options.supportPointer?"pointermove":t?"touchmove":"mousemove",this._onTouchMove):(f(F,"dragend",this),f(K,"dragstart",this._onDragStart));try{document.selection?$e((function(){document.selection.empty()})):window.getSelection().removeAllRanges()}catch(e){}},_dragStarted:function(e,t){if(ve=!1,K&&F){H("dragStarted",this,{evt:t}),this.nativeDraggable&&f(document,"dragover",ke);var n=this.options;!e&&y(F,n.dragClass,!1),y(F,n.ghostClass,!0),Ne.active=this,e&&this._appendGhost(),U({sortable:this,name:"start",originalEvent:t})}else this._nulling()},_emulateDragOver:function(){if(ae){this._lastX=ae.clientX,this._lastY=ae.clientY,Te();for(var e=document.elementFromPoint(ae.clientX,ae.clientY),t=e;e&&e.shadowRoot&&(e=e.shadowRoot.elementFromPoint(ae.clientX,ae.clientY))!==t;)t=e;if(F.parentNode[L]._isOutsideThisEl(e),t)do{if(t[L]&&t[L]._onDragOver({clientX:ae.clientX,clientY:ae.clientY,target:e,rootEl:t})&&!this.options.dragoverBubble)break;e=t}while(t=t.parentNode);Me()}},_onTouchMove:function(e){if(re){var t=this.options,n=t.fallbackTolerance,o=t.fallbackOffset,r=e.touches?e.touches[0]:e,a=W&&E(W,!0),i=W&&a&&a.a,l=W&&a&&a.d,s=De&&he&&I(he),c=(r.clientX-re.clientX+o.x)/(i||1)+(s?s[0]-we[0]:0)/(i||1),u=(r.clientY-re.clientY+o.y)/(l||1)+(s?s[1]-we[1]:0)/(l||1);if(!Ne.active&&!ve){if(n&&Math.max(Math.abs(r.clientX-this._lastX),Math.abs(r.clientY-this._lastY))o.right+10||e.clientX<=o.right&&e.clientY>o.bottom&&e.clientX>=o.left:e.clientX>o.right&&e.clientY>o.top||e.clientX<=o.right&&e.clientY>o.bottom+10}(e,a,this)&&!g.animated){if(g===F)return $(!1);if(g&&i===e.target&&(l=g),l&&(n=D(l)),!1!==Re(K,i,F,t,l,n,e,!!l))return X(),i.appendChild(F),z=i,Y(),$(!0)}else if(l.parentNode===i){n=D(l);var b,E,S,O=F.parentNode!==i,C=!function(e,t,n){var o=n?e.left:e.top,r=n?t.left:t.top;return o===r||(n?e.right:e.bottom)===(n?t.right:t.bottom)||o+(n?e.width:e.height)/2===r+(n?t.width:t.height)/2}(F.animated&&F.toRect||t,l.animated&&l.toRect||n,a),I=a?"top":"left",T=_(l,"top","top")||_(F,"top","top"),M=T?T.scrollTop:void 0;if(de!==l&&(E=n[I],be=!1,ye=!C&&s.invertSwap||O),0!==(b=function(e,t,n,o,r,a,i,l){var s=o?e.clientY:e.clientX,c=o?n.height:n.width,u=o?n.top:n.left,d=o?n.bottom:n.right,f=!1;if(!i)if(l&&peu+c*a/2:sd-pe)return-fe}else if(s>u+c*(1-r)/2&&sd-c*a/2)?s>u+c/2?1:-1:0}(e,l,n,a,C?1:s.swapThreshold,null==s.invertedSwapThreshold?s.swapThreshold:s.invertedSwapThreshold,ye,de===l))){var j=P(F);do{S=z.children[j-=b]}while(S&&("none"===w(S,"display")||S===W))}if(0===b||S===l)return $(!1);de=l,fe=b;var k=l.nextElementSibling,N=!1,R=Re(K,i,F,t,l,n,e,N=1===b);if(!1!==R)return 1!==R&&-1!==R||(N=1===R),Ee=!0,setTimeout(Be,30),X(),N&&!k?i.appendChild(F):l.parentNode.insertBefore(F,N?k:l),T&&A(T,0,M-T.scrollTop),z=F.parentNode,void 0===E||ye||(pe=Math.abs(E-D(l)[I])),Y(),$(!0)}if(i.contains(F))return $(!1)}return!1}function B(s,c){H(s,h,o({evt:e,isOwner:d,axis:a?"vertical":"horizontal",revert:r,dragRect:t,targetRect:n,canSort:f,fromSortable:p,target:l,completed:$,onMove:function(n,o){return Re(K,i,F,t,n,D(n),e,o)},changed:Y},c))}function X(){B("dragOverAnimationCapture"),h.captureAnimationState(),h!==p&&p.captureAnimationState()}function $(t){return B("dragOverCompleted",{insertion:t}),t&&(d?u._hideClone():u._showClone(h),h!==p&&(y(F,oe?oe.options.ghostClass:u.options.ghostClass,!1),y(F,s.ghostClass,!0)),oe!==h&&h!==Ne.active?oe=h:h===Ne.active&&oe&&(oe=null),p===h&&(h._ignoreWhileAnimating=l),h.animateAll((function(){B("dragOverAnimationComplete"),h._ignoreWhileAnimating=null})),h!==p&&(p.animateAll(),p._ignoreWhileAnimating=null)),(l===F&&!F.animated||l===i&&!l.animated)&&(de=null),s.dragoverBubble||e.rootEl||l===document||(F.parentNode[L]._isOutsideThisEl(e.target),!t&&Ae(e)),!s.dragoverBubble&&e.stopPropagation&&e.stopPropagation(),v=!0}function Y(){Q=P(F),te=P(F,s.draggable),U({sortable:h,name:"change",toEl:i,newIndex:Q,newDraggableIndex:te,originalEvent:e})}},_ignoreWhileAnimating:null,_offMoveEvents:function(){p(document,"mousemove",this._onTouchMove),p(document,"touchmove",this._onTouchMove),p(document,"pointermove",this._onTouchMove),p(document,"dragover",Ae),p(document,"mousemove",Ae),p(document,"touchmove",Ae)},_offUpEvents:function(){var e=this.el.ownerDocument;p(e,"mouseup",this._onDrop),p(e,"touchend",this._onDrop),p(e,"pointerup",this._onDrop),p(e,"touchcancel",this._onDrop),p(document,"selectstart",this)},_onDrop:function(e){var t=this.el,n=this.options;Q=P(F),te=P(F,n.draggable),H("drop",this,{evt:e}),z=F&&F.parentNode,Q=P(F),te=P(F,n.draggable),Ne.eventCanceled||(ve=!1,ye=!1,be=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),Ye(this.cloneId),Ye(this._dragStartId),this.nativeDraggable&&(p(document,"drop",this),p(t,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),s&&w(document.body,"user-select",""),w(F,"transform",""),e&&(ue&&(e.cancelable&&e.preventDefault(),!n.dropBubble&&e.stopPropagation()),W&&W.parentNode&&W.parentNode.removeChild(W),(K===z||oe&&"clone"!==oe.lastPutMode)&&V&&V.parentNode&&V.parentNode.removeChild(V),F&&(this.nativeDraggable&&p(F,"dragend",this),Le(F),F.style["will-change"]="",ue&&!ve&&y(F,oe?oe.options.ghostClass:this.options.ghostClass,!1),y(F,this.options.chosenClass,!1),U({sortable:this,name:"unchoose",toEl:z,newIndex:null,newDraggableIndex:null,originalEvent:e}),K!==z?(Q>=0&&(U({rootEl:z,name:"add",toEl:z,fromEl:K,originalEvent:e}),U({sortable:this,name:"remove",toEl:z,originalEvent:e}),U({rootEl:z,name:"sort",toEl:z,fromEl:K,originalEvent:e}),U({sortable:this,name:"sort",toEl:z,originalEvent:e})),oe&&oe.save()):Q!==J&&Q>=0&&(U({sortable:this,name:"update",toEl:z,originalEvent:e}),U({sortable:this,name:"sort",toEl:z,originalEvent:e})),Ne.active&&(null!=Q&&-1!==Q||(Q=J,te=ee),U({sortable:this,name:"end",toEl:z,originalEvent:e}),this.save())))),this._nulling()},_nulling:function(){H("nulling",this),K=F=z=W=G=V=q=Z=re=ae=ue=Q=te=J=ee=de=fe=oe=ne=Ne.dragged=Ne.ghost=Ne.clone=Ne.active=null,Se.forEach((function(e){e.checked=!0})),Se.length=ie=le=0},handleEvent:function(e){switch(e.type){case"drop":case"dragend":this._onDrop(e);break;case"dragenter":case"dragover":F&&(this._onDragOver(e),function(e){e.dataTransfer&&(e.dataTransfer.dropEffect="move"),e.cancelable&&e.preventDefault()}(e));break;case"selectstart":e.preventDefault()}},toArray:function(){for(var e,t=[],n=this.el.children,o=0,r=n.length,a=this.options;o1&&(Ke.forEach((function(e){o.addAnimationState({target:e,rect:Ve?D(e):r}),R(e),e.fromRect=r,t.removeAnimationState(e)})),Ve=!1,function(e,t){Ke.forEach((function(n,o){var r=t.children[n.sortableIndex+(e?Number(o):0)];r?t.insertBefore(n,r):t.appendChild(n)}))}(!this.options.removeCloneOnHide,n))},dragOverCompleted:function(e){var t=e.sortable,n=e.isOwner,o=e.activeSortable,r=e.parentEl,a=e.putSortable,i=this.options;if(e.insertion){if(n&&o._hideClone(),qe=!1,i.animation&&Ke.length>1&&(Ve||!n&&!o.options.sort&&!a)){var l=D(Fe,!1,!0,!0);Ke.forEach((function(e){e!==Fe&&(N(e,l),r.appendChild(e))})),Ve=!0}if(!n)if(Ve||Qe(),Ke.length>1){var s=We;o._showClone(t),o.options.animation&&!We&&s&&Ge.forEach((function(e){o.addAnimationState({target:e,rect:ze}),e.fromRect=ze,e.thisAnimationDuration=null}))}else o._showClone(t)}},dragOverAnimationCapture:function(e){var t=e.dragRect,n=e.isOwner,o=e.activeSortable;if(Ke.forEach((function(e){e.thisAnimationDuration=null})),o.options.animation&&!n&&o.multiDrag.isMultiDrag){ze=Object.assign({},t);var r=E(Fe,!0);ze.top-=r.f,ze.left-=r.e}},dragOverAnimationComplete:function(){Ve&&(Ve=!1,Qe())},drop:function(e){var t=e.originalEvent,n=e.rootEl,o=e.parentEl,r=e.sortable,a=e.dispatchSortableEvent,i=e.oldIndex,l=e.putSortable,s=l||this.sortable;if(t){var c=this.options,u=o.children;if(!Ze)if(c.multiDragKey&&!this.multiDragKeyDown&&this._deselectMultiDrag(),y(Fe,c.selectedClass,!~Ke.indexOf(Fe)),~Ke.indexOf(Fe))Ke.splice(Ke.indexOf(Fe),1),He=null,Y({sortable:r,rootEl:n,name:"deselect",targetEl:Fe,originalEvt:t});else{if(Ke.push(Fe),Y({sortable:r,rootEl:n,name:"select",targetEl:Fe,originalEvt:t}),t.shiftKey&&He&&r.el.contains(He)){var d,f,p=P(He),h=P(Fe);if(~p&&~h&&p!==h)for(h>p?(f=p,d=h):(f=h,d=p+1);f1){var v=D(Fe),m=P(Fe,":not(."+this.options.selectedClass+")");if(!qe&&c.animation&&(Fe.thisAnimationDuration=null),s.captureAnimationState(),!qe&&(c.animation&&(Fe.fromRect=v,Ke.forEach((function(e){if(e.thisAnimationDuration=null,e!==Fe){var t=Ve?D(e):v;e.fromRect=t,s.addAnimationState({target:e,rect:t})}}))),Qe(),Ke.forEach((function(e){u[m]?o.insertBefore(e,u[m]):o.appendChild(e),m++})),i===P(Fe))){var g=!1;Ke.forEach((function(e){e.sortableIndex===P(e)||(g=!0)})),g&&a("update")}Ke.forEach((function(e){R(e)})),s.animateAll()}Ue=s}(n===o||l&&"clone"!==l.lastPutMode)&&Ge.forEach((function(e){e.parentNode&&e.parentNode.removeChild(e)}))}},nullingGlobal:function(){this.isMultiDrag=Ze=!1,Ge.length=0},destroyGlobal:function(){this._deselectMultiDrag(),p(document,"pointerup",this._deselectMultiDrag),p(document,"mouseup",this._deselectMultiDrag),p(document,"touchend",this._deselectMultiDrag),p(document,"keydown",this._checkKeyDown),p(document,"keyup",this._checkKeyUp)},_deselectMultiDrag:function(e){if(!(void 0!==Ze&&Ze||Ue!==this.sortable||e&&m(e.target,this.options.draggable,this.sortable.el,!1)||e&&0!==e.button))for(;Ke.length;){var t=Ke[0];y(t,this.options.selectedClass,!1),Ke.shift(),Y({sortable:this.sortable,rootEl:this.sortable.el,name:"deselect",targetEl:t,originalEvt:e})}},_checkKeyDown:function(e){e.key===this.options.multiDragKey&&(this.multiDragKeyDown=!0)},_checkKeyUp:function(e){e.key===this.options.multiDragKey&&(this.multiDragKeyDown=!1)}},Object.assign(e,{pluginName:"multiDrag",utils:{select:function(e){var t=e.parentNode[L];t&&t.options.multiDrag&&!~Ke.indexOf(e)&&(Ue&&Ue!==t&&(Ue.multiDrag._deselectMultiDrag(),Ue=t),y(e,t.options.selectedClass,!0),Ke.push(e))},deselect:function(e){var t=e.parentNode[L],n=Ke.indexOf(e);t&&t.options.multiDrag&&~n&&(y(e,t.options.selectedClass,!1),Ke.splice(n,1))}},eventProperties:function(){var e=this,t=[],n=[];return Ke.forEach((function(o){var r;t.push({multiDragElement:o,index:o.sortableIndex}),r=Ve&&o!==Fe?-1:Ve?P(o,":not(."+e.options.selectedClass+")"):P(o),n.push({multiDragElement:o,index:r})})),{items:[].concat(Ke),clones:[].concat(Ge),oldIndicies:t,newIndicies:n}},optionListeners:{multiDragKey:function(e){return"ctrl"===(e=e.toLowerCase())?e="Control":e.length>1&&(e=e.charAt(0).toUpperCase()+e.substr(1)),e}}})}),t.default=Ne},function(e,t,n){var o;!function(){"use strict";var n={}.hasOwnProperty;function r(){for(var e=[],t=0;te.length)&&(t=e.length);for(var n=0,o=Array(t);ne.length)&&(t=e.length);for(var n=0,o=Array(t);nt.label?1:0}))};r.options.push({label:O("Other","astra-addon"),value:"zz-other"});var l=e.control.params.input_attrs?E(E({},r),e.control.params.input_attrs):r,s=[];l.options.forEach((function(e){t.items.some((function(t){return t.id===e.value}))||s.push(e)}));var c,u,d=(c=Object(i.useState)({value:t,isVisible:!1,control:void 0!==s[0]&&void 0!==s[0].value?s[0].value:""}),u=2,function(e){if(Array.isArray(e))return e}(c)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,r,a,i,l=[],s=!0,c=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(o=a.call(n)).done)&&(l.push(o.value),l.length!==t);s=!0);}catch(e){c=!0,r=e}finally{try{if(!s&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw r}}return l}}(c,u)||function(e,t){if(e){if("string"==typeof e)return y(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?y(e,t):void 0}}(c,u)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),f=d[0],p=d[1];Object(i.useEffect)((function(){p((function(t){return E(E({},t),{},{value:e.control.setting.get()})}))}),[e]);var h=function(t){e.control.setting.set(E(E(E({},e.control.setting.get()),t),{},{flag:!e.control.setting.get().flag}))},v=function(){var e,t=document.querySelectorAll(".ahfb-builder-area");for(e=0;e0?f.value.items:[],w=[];return b.length>0&&b.forEach((function(e){w.push({id:e.id})})),React.createElement("div",{className:"ahfb-control-field ahfb-sorter-items"},React.createElement("div",{className:"ahfb-sorter-row"},React.createElement(a.ReactSortable,{animation:100,onStart:function(){return v()},onEnd:function(){return v()},group:l.group,className:"ahfb-sorter-drop ahfb-sorter-sortable-panel ahfb-sorter-drop-".concat(l.group),handle:".ahfb-sorter-item-panel-header",list:w,setList:function(e){return t=e,n=f.value,o=n.items,r=[],t.length>0&&t.forEach((function(e){var t=o.find((function(t){return t.id===e.id}));t&&r.push(t)})),void(function(e,t){if(e===t)return!0;if(null==e||null==t)return!1;if(e.length!=t.length)return!1;for(var n=0;n0&&b.map((function(e,t){return React.createElement(g,{removeItem:function(e){return t=e,o=(n=f.value).items,r=[],o.length>0&&o.forEach((function(e,n){t!==n&&r.push(e)})),n.items=r,p((function(e){return E(E({},e),{},{value:n})})),void h(n);var t,n,o,r},toggleEnabled:function(e,t){return function(e,t){m({enabled:e},t)}(e,t)},onChangeLabel:function(e,t){return function(e,t){m({label:e},t)}(e,t)},onChangeURL:function(e,t){return function(e,t){m({url:e},t)}(e,t)},key:e.id,index:t,item:e,controlParams:l})})))),void 0!==s[0]&&void 0!==s[0].value&&React.createElement("div",{className:"ahfb-language-selector-add-area"},React.createElement(C,{value:f.control,options:s,onChange:function(e){p((function(t){return E(E({},t),{},{control:e})}))}}),React.createElement(_,{className:"ahfb-sorter-add-item",isPrimary:!0,onClick:function(){!function(){var e=f.control;if(p((function(e){return E(E({},e),{},{isVisible:!1})})),e){var t=f.value,n=t.items,o=l.options.filter((function(t){return t.value===e})),r={id:e,enabled:!0,url:"",label:o[0].label};n.push(r),t.items=n;var a=[];l.options.forEach((function(e){n.some((function(t){return t.id===e.value}))||a.push(e)})),p((function(e){return E(E({},e),{},{control:void 0!==a[0]&&void 0!==a[0].value?a[0].value:""})})),p((function(e){return E(E({},e),{},{value:t})})),h(t)}}()}},O("Add Language","astra-addon"))))};x.propTypes={control:r.a.object.isRequired};var P=x,I=wp.customize.Control.extend({renderContent:function(){ReactDOM.render(React.createElement(P,{control:this}),this.container[0])}});wp.customize.controlConstructor["ast-language-selector"]=I}]);