diff --git a/build/control-repeater.asset.php b/build/control-repeater.asset.php index 67b762b0..cfddd97a 100644 --- a/build/control-repeater.asset.php +++ b/build/control-repeater.asset.php @@ -1 +1 @@ - array('lodash', 'react', 'react-dom', 'wp-components', 'wp-compose', 'wp-data', 'wp-element', 'wp-hooks', 'wp-i18n'), 'version' => 'e3912133ff2892e30212'); + array('lodash', 'react', 'react-dom', 'wp-components', 'wp-compose', 'wp-data', 'wp-element', 'wp-hooks', 'wp-i18n'), 'version' => 'e7d20778505bf1c476d4'); diff --git a/build/control-repeater.js b/build/control-repeater.js index 51b9346d..2e7b990e 100644 --- a/build/control-repeater.js +++ b/build/control-repeater.js @@ -1,4 +1,4 @@ -(()=>{var e={8655:(e,t)=>{var n;!function(){"use strict";var r=function(){function e(){}function t(e,t){for(var n=t.length,r=0;r{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";const e=window.lodash;function t(e,t,n){return function(e,t,n){const r=t<0?e.length+t:t;if(r>=0&&r{t.current=e})),(0,y.useCallback)((function(){for(var e=arguments.length,n=new Array(e),r=0;r{n.current!==e&&(n.current=e)}),t),n}function _(e,t){const n=(0,y.useRef)();return(0,y.useMemo)((()=>{const t=e(n.current);return n.current=t,t}),[...t])}function T(e){const t=z(e),n=(0,y.useRef)(null),r=(0,y.useCallback)((e=>{e!==n.current&&(null==t||t(e,n.current)),n.current=e}),[]);return[n,r]}function A(e){const t=(0,y.useRef)();return(0,y.useEffect)((()=>{t.current=e}),[e]),t.current}let j={};function P(e,t){return(0,y.useMemo)((()=>{if(t)return t;const n=null==j[e]?0:j[e]+1;return j[e]=n,e+"-"+n}),[e,t])}function L(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o{const r=Object.entries(n);for(const[n,o]of r){const r=t[n];null!=r&&(t[n]=r+e*o)}return t}),{...t})}}const B=L(1),F=L(-1);function U(e){if(!e)return!1;const{KeyboardEvent:t}=R(e.target);return t&&e instanceof t}function V(e){if(function(e){if(!e)return!1;const{TouchEvent:t}=R(e.target);return t&&e instanceof t}(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return function(e){return"clientX"in e&&"clientY"in e}(e)?{x:e.clientX,y:e.clientY}:null}const Y=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[Y.Translate.toString(e),Y.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),W="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function X(e){return e.matches(W)?e:e.querySelector(W)}const K={display:"none"};function H(e){let{id:t,value:n}=e;return w().createElement("div",{id:t,style:K},n)}function q(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;return w().createElement("div",{id:t,style:{position:"fixed",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"},role:"status","aria-live":r,"aria-atomic":!0},n)}const J=(0,y.createContext)(null),G={draggable:"\n To pick up a draggable item, press the space bar.\n While dragging, use the arrow keys to move the item.\n Press space again to drop the item in its new position, or press escape to cancel.\n "},$={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function Q(e){let{announcements:t=$,container:n,hiddenTextDescribedById:r,screenReaderInstructions:o=G}=e;const{announce:i,announcement:a}=function(){const[e,t]=(0,y.useState)("");return{announce:(0,y.useCallback)((e=>{null!=e&&t(e)}),[]),announcement:e}}(),l=P("DndLiveRegion"),[c,s]=(0,y.useState)(!1);if((0,y.useEffect)((()=>{s(!0)}),[]),function(e){const t=(0,y.useContext)(J);(0,y.useEffect)((()=>{if(!t)throw new Error("useDndMonitor must be used within a children of ");return t(e)}),[e,t])}((0,y.useMemo)((()=>({onDragStart(e){let{active:n}=e;i(t.onDragStart({active:n}))},onDragMove(e){let{active:n,over:r}=e;t.onDragMove&&i(t.onDragMove({active:n,over:r}))},onDragOver(e){let{active:n,over:r}=e;i(t.onDragOver({active:n,over:r}))},onDragEnd(e){let{active:n,over:r}=e;i(t.onDragEnd({active:n,over:r}))},onDragCancel(e){let{active:n,over:r}=e;i(t.onDragCancel({active:n,over:r}))}})),[i,t])),!c)return null;const u=w().createElement(w().Fragment,null,w().createElement(H,{id:r,value:o.draggable}),w().createElement(q,{id:l,announcement:a}));return n?(0,x.createPortal)(u,n):u}var Z;function ee(){}!function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"}(Z||(Z={}));const te=Object.freeze({x:0,y:0});function ne(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function re(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function oe(e,t,n){return void 0===t&&(t=e.left),void 0===n&&(n=e.top),{x:t+.5*e.width,y:n+.5*e.height}}const ie=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=oe(t,t.left,t.top),i=[];for(const e of r){const{id:t}=e,r=n.get(t);if(r){const n=(a=oe(r),l=o,Math.sqrt(Math.pow(a.x-l.x,2)+Math.pow(a.y-l.y,2)));i.push({id:t,data:{droppableContainer:e,value:n}})}}var a,l;return i.sort(ne)};function ae(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),i=Math.min(t.top+t.height,e.top+e.height),a=o-r,l=i-n;if(r{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=[];for(const e of r){const{id:r}=e,i=n.get(r);if(i){const n=ae(i,t);n>0&&o.push({id:r,data:{droppableContainer:e,value:n}})}}return o.sort(re)};function ce(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:te}function se(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o({...t,top:t.top+e*n.y,bottom:t.bottom+e*n.y,left:t.left+e*n.x,right:t.right+e*n.x})),{...t})}}const ue=se(1);const de={ignoreTransform:!1};function fe(e,t){void 0===t&&(t=de);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:t,transformOrigin:r}=R(e).getComputedStyle(e);t&&(n=function(e,t,n){const r=function(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}(t);if(!r)return e;const{scaleX:o,scaleY:i,x:a,y:l}=r,c=e.left-a-(1-o)*parseFloat(n),s=e.top-l-(1-i)*parseFloat(n.slice(n.indexOf(" ")+1)),u=o?e.width/o:e.width,d=i?e.height/i:e.height;return{width:u,height:d,top:s,right:c+u,bottom:s+d,left:c}}(n,t,r))}const{top:r,left:o,width:i,height:a,bottom:l,right:c}=n;return{top:r,left:o,width:i,height:a,bottom:l,right:c}}function pe(e){return fe(e,{ignoreTransform:!0})}function ve(e,t){const n=[];return e?function r(o){if(null!=t&&n.length>=t)return n;if(!o)return n;if(S(o)&&null!=o.scrollingElement&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!O(o)||k(o))return n;if(n.includes(o))return n;const i=R(e).getComputedStyle(o);return o!==e&&function(e,t){void 0===t&&(t=R(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some((e=>{const r=t[e];return"string"==typeof r&&n.test(r)}))}(o,i)&&n.push(o),function(e,t){return void 0===t&&(t=R(e).getComputedStyle(e)),"fixed"===t.position}(o,i)?n:r(o.parentNode)}(e):n}function he(e){const[t]=ve(e,1);return null!=t?t:null}function ge(e){return E&&e?C(e)?e:D(e)?S(e)||e===M(e).scrollingElement?window:O(e)?e:null:null:null}function me(e){return C(e)?e.scrollX:e.scrollLeft}function be(e){return C(e)?e.scrollY:e.scrollTop}function ye(e){return{x:me(e),y:be(e)}}var we;function xe(e){return!(!E||!e)&&e===document.scrollingElement}function Ee(e){const t={x:0,y:0},n=xe(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=r.y,isRight:e.scrollLeft>=r.x,maxScroll:r,minScroll:t}}!function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"}(we||(we={}));const Ce={x:.2,y:.2};function De(e,t,n,r,o){let{top:i,left:a,right:l,bottom:c}=n;void 0===r&&(r=10),void 0===o&&(o=Ce);const{isTop:s,isBottom:u,isLeft:d,isRight:f}=Ee(e),p={x:0,y:0},v={x:0,y:0},h=t.height*o.y,g=t.width*o.x;return!s&&i<=t.top+h?(p.y=we.Backward,v.y=r*Math.abs((t.top+h-i)/h)):!u&&c>=t.bottom-h&&(p.y=we.Forward,v.y=r*Math.abs((t.bottom-h-c)/h)),!f&&l>=t.right-g?(p.x=we.Forward,v.x=r*Math.abs((t.right-g-l)/g)):!d&&a<=t.left+g&&(p.x=we.Backward,v.x=r*Math.abs((t.left+g-a)/g)),{direction:p,speed:v}}function Re(e){if(e===document.scrollingElement){const{innerWidth:e,innerHeight:t}=window;return{top:0,left:0,right:e,bottom:t,width:e,height:t}}const{top:t,left:n,right:r,bottom:o}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:o,width:e.clientWidth,height:e.clientHeight}}function Se(e){return e.reduce(((e,t)=>B(e,ye(t))),te)}const Oe=[["x",["left","right"],function(e){return e.reduce(((e,t)=>e+me(t)),0)}],["y",["top","bottom"],function(e){return e.reduce(((e,t)=>e+be(t)),0)}]];class ke{constructor(e,t){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const n=ve(t),r=Se(n);this.rect={...e},this.width=e.width,this.height=e.height;for(const[e,t,o]of Oe)for(const i of t)Object.defineProperty(this,i,{get:()=>{const t=o(n),a=r[e]-t;return this.rect[i]+a},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Me{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach((e=>{var t;return null==(t=this.target)?void 0:t.removeEventListener(...e)}))},this.target=e}add(e,t,n){var r;null==(r=this.target)||r.addEventListener(e,t,n),this.listeners.push([e,t,n])}}function Ie(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return"number"==typeof t?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t&&r>t.y}var ze,Ne,_e;function Te(e){e.preventDefault()}function Ae(e){e.stopPropagation()}!function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"}(ze||(ze={})),(_e=Ne||(Ne={})).Space="Space",_e.Down="ArrowDown",_e.Right="ArrowRight",_e.Left="ArrowLeft",_e.Up="ArrowUp",_e.Esc="Escape",_e.Enter="Enter";const je={start:[Ne.Space,Ne.Enter],cancel:[Ne.Esc],end:[Ne.Space,Ne.Enter]},Pe=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case Ne.Right:return{...n,x:n.x+25};case Ne.Left:return{...n,x:n.x-25};case Ne.Down:return{...n,y:n.y+25};case Ne.Up:return{...n,y:n.y-25}}};class Le{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;const{event:{target:t}}=e;this.props=e,this.listeners=new Me(M(t)),this.windowListeners=new Me(R(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(ze.Resize,this.handleCancel),this.windowListeners.add(ze.VisibilityChange,this.handleCancel),setTimeout((()=>this.listeners.add(ze.Keydown,this.handleKeyDown)))}handleStart(){const{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&function(e,t){if(void 0===t&&(t=fe),!e)return;const{top:n,left:r,bottom:o,right:i}=t(e);he(e)&&(o<=0||i<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}(n),t(te)}handleKeyDown(e){if(U(e)){const{active:t,context:n,options:r}=this.props,{keyboardCodes:o=je,coordinateGetter:i=Pe,scrollBehavior:a="smooth"}=r,{code:l}=e;if(o.end.includes(l))return void this.handleEnd(e);if(o.cancel.includes(l))return void this.handleCancel(e);const{collisionRect:c}=n.current,s=c?{x:c.left,y:c.top}:te;this.referenceCoordinates||(this.referenceCoordinates=s);const u=i(e,{active:t,context:n.current,currentCoordinates:s});if(u){const t=F(u,s),r={x:0,y:0},{scrollableAncestors:o}=n.current;for(const n of o){const o=e.code,{isTop:i,isRight:l,isLeft:c,isBottom:s,maxScroll:d,minScroll:f}=Ee(n),p=Re(n),v={x:Math.min(o===Ne.Right?p.right-p.width/2:p.right,Math.max(o===Ne.Right?p.left:p.left+p.width/2,u.x)),y:Math.min(o===Ne.Down?p.bottom-p.height/2:p.bottom,Math.max(o===Ne.Down?p.top:p.top+p.height/2,u.y))},h=o===Ne.Right&&!l||o===Ne.Left&&!c,g=o===Ne.Down&&!s||o===Ne.Up&&!i;if(h&&v.x!==u.x){const e=n.scrollLeft+t.x,i=o===Ne.Right&&e<=d.x||o===Ne.Left&&e>=f.x;if(i&&!t.y)return void n.scrollTo({left:e,behavior:a});r.x=i?n.scrollLeft-e:o===Ne.Right?n.scrollLeft-d.x:n.scrollLeft-f.x,r.x&&n.scrollBy({left:-r.x,behavior:a});break}if(g&&v.y!==u.y){const e=n.scrollTop+t.y,i=o===Ne.Down&&e<=d.y||o===Ne.Up&&e>=f.y;if(i&&!t.x)return void n.scrollTo({top:e,behavior:a});r.y=i?n.scrollTop-e:o===Ne.Down?n.scrollTop-d.y:n.scrollTop-f.y,r.y&&n.scrollBy({top:-r.y,behavior:a});break}}this.handleMove(e,B(F(u,this.referenceCoordinates),r))}}}handleMove(e,t){const{onMove:n}=this.props;e.preventDefault(),n(t)}handleEnd(e){const{onEnd:t}=this.props;e.preventDefault(),this.detach(),t()}handleCancel(e){const{onCancel:t}=this.props;e.preventDefault(),this.detach(),t()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}function Be(e){return Boolean(e&&"distance"in e)}function Fe(e){return Boolean(e&&"delay"in e)}Le.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=je,onActivation:o}=t,{active:i}=n;const{code:a}=e.nativeEvent;if(r.start.includes(a)){const t=i.activatorNode.current;return!(t&&e.target!==t||(e.preventDefault(),null==o||o({event:e.nativeEvent}),0))}return!1}}];class Ue{constructor(e,t,n){var r;void 0===n&&(n=function(e){const{EventTarget:t}=R(e);return e instanceof t?e:M(e)}(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=t;const{event:o}=e,{target:i}=o;this.props=e,this.events=t,this.document=M(i),this.documentListeners=new Me(this.document),this.listeners=new Me(n),this.windowListeners=new Me(R(i)),this.initialCoordinates=null!=(r=V(o))?r:te,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:e,props:{options:{activationConstraint:t,bypassActivationConstraint:n}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),this.windowListeners.add(ze.Resize,this.handleCancel),this.windowListeners.add(ze.DragStart,Te),this.windowListeners.add(ze.VisibilityChange,this.handleCancel),this.windowListeners.add(ze.ContextMenu,Te),this.documentListeners.add(ze.Keydown,this.handleKeydown),t){if(null!=n&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Fe(t))return void(this.timeoutId=setTimeout(this.handleStart,t.delay));if(Be(t))return}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),null!==this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handleStart(){const{initialCoordinates:e}=this,{onStart:t}=this.props;e&&(this.activated=!0,this.documentListeners.add(ze.Click,Ae,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(ze.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){var t;const{activated:n,initialCoordinates:r,props:o}=this,{onMove:i,options:{activationConstraint:a}}=o;if(!r)return;const l=null!=(t=V(e))?t:te,c=F(r,l);if(!n&&a){if(Be(a)){if(null!=a.tolerance&&Ie(c,a.tolerance))return this.handleCancel();if(Ie(c,a.distance))return this.handleStart()}return Fe(a)&&Ie(c,a.tolerance)?this.handleCancel():void 0}e.cancelable&&e.preventDefault(),i(l)}handleEnd(){const{onEnd:e}=this.props;this.detach(),e()}handleCancel(){const{onCancel:e}=this.props;this.detach(),e()}handleKeydown(e){e.code===Ne.Esc&&this.handleCancel()}removeTextSelection(){var e;null==(e=this.document.getSelection())||e.removeAllRanges()}}const Ve={move:{name:"pointermove"},end:{name:"pointerup"}};class Ye extends Ue{constructor(e){const{event:t}=e,n=M(t.target);super(e,Ve,n)}}Ye.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!(!n.isPrimary||0!==n.button||(null==r||r({event:n}),0))}}];const We={move:{name:"mousemove"},end:{name:"mouseup"}};var Xe;!function(e){e[e.RightClick=2]="RightClick"}(Xe||(Xe={})),class extends Ue{constructor(e){super(e,We,M(e.event.target))}}.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button!==Xe.RightClick&&(null==r||r({event:n}),!0)}}];const Ke={move:{name:"touchmove"},end:{name:"touchend"}};var He,qe;(class extends Ue{constructor(e){super(e,Ke)}static setup(){return window.addEventListener(Ke.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(Ke.move.name,e)};function e(){}}}).activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:o}=n;return!(o.length>1||(null==r||r({event:n}),0))}}],function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"}(He||(He={})),function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"}(qe||(qe={}));const Je={x:{[we.Backward]:!1,[we.Forward]:!1},y:{[we.Backward]:!1,[we.Forward]:!1}};var Ge,$e;!function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"}(Ge||(Ge={})),function(e){e.Optimized="optimized"}($e||($e={}));const Qe=new Map;function Ze(e,t){return _((n=>e?n||("function"==typeof t?t(e):e):null),[t,e])}function et(e){let{callback:t,disabled:n}=e;const r=z(t),o=(0,y.useMemo)((()=>{if(n||"undefined"==typeof window||void 0===window.ResizeObserver)return;const{ResizeObserver:e}=window;return new e(r)}),[n]);return(0,y.useEffect)((()=>()=>null==o?void 0:o.disconnect()),[o]),o}function tt(e){return new ke(fe(e),e)}function nt(e,t,n){void 0===t&&(t=tt);const[r,o]=(0,y.useReducer)((function(r){if(!e)return null;var o;if(!1===e.isConnected)return null!=(o=null!=r?r:n)?o:null;const i=t(e);return JSON.stringify(r)===JSON.stringify(i)?r:i}),null),i=function(e){let{callback:t,disabled:n}=e;const r=z(t),o=(0,y.useMemo)((()=>{if(n||"undefined"==typeof window||void 0===window.MutationObserver)return;const{MutationObserver:e}=window;return new e(r)}),[r,n]);return(0,y.useEffect)((()=>()=>null==o?void 0:o.disconnect()),[o]),o}({callback(t){if(e)for(const n of t){const{type:t,target:r}=n;if("childList"===t&&r instanceof HTMLElement&&r.contains(e)){o();break}}}}),a=et({callback:o});return I((()=>{o(),e?(null==a||a.observe(e),null==i||i.observe(document.body,{childList:!0,subtree:!0})):(null==a||a.disconnect(),null==i||i.disconnect())}),[e]),r}const rt=[];function ot(e,t){void 0===t&&(t=[]);const n=(0,y.useRef)(null);return(0,y.useEffect)((()=>{n.current=null}),t),(0,y.useEffect)((()=>{const t=e!==te;t&&!n.current&&(n.current=e),!t&&n.current&&(n.current=null)}),[e]),n.current?F(e,n.current):te}function it(e){return(0,y.useMemo)((()=>e?function(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}(e):null),[e])}const at=[];const lt=[{sensor:Ye,options:{}},{sensor:Le,options:{}}],ct={current:{}},st={draggable:{measure:pe},droppable:{measure:pe,strategy:Ge.WhileDragging,frequency:$e.Optimized},dragOverlay:{measure:fe}};class ut extends Map{get(e){var t;return null!=e&&null!=(t=super.get(e))?t:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter((e=>{let{disabled:t}=e;return!t}))}getNodeFor(e){var t,n;return null!=(t=null==(n=this.get(e))?void 0:n.node.current)?t:void 0}}const dt={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new ut,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:ee},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:st,measureDroppableContainers:ee,windowRect:null,measuringScheduled:!1},ft={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:ee,draggableNodes:new Map,over:null,measureDroppableContainers:ee},pt=(0,y.createContext)(ft),vt=(0,y.createContext)(dt);function ht(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new ut}}}function gt(e,t){switch(t.type){case Z.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case Z.DragMove:return e.draggable.active?{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}}:e;case Z.DragEnd:case Z.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Z.RegisterDroppable:{const{element:n}=t,{id:r}=n,o=new ut(e.droppable.containers);return o.set(r,n),{...e,droppable:{...e.droppable,containers:o}}}case Z.SetDroppableDisabled:{const{id:n,key:r,disabled:o}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;const a=new ut(e.droppable.containers);return a.set(n,{...i,disabled:o}),{...e,droppable:{...e.droppable,containers:a}}}case Z.UnregisterDroppable:{const{id:n,key:r}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const i=new ut(e.droppable.containers);return i.delete(n),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function mt(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:o}=(0,y.useContext)(pt),i=A(r),a=A(null==n?void 0:n.id);return(0,y.useEffect)((()=>{if(!t&&!r&&i&&null!=a){if(!U(i))return;if(document.activeElement===i.target)return;const e=o.get(a);if(!e)return;const{activatorNode:t,node:n}=e;if(!t.current&&!n.current)return;requestAnimationFrame((()=>{for(const e of[t.current,n.current]){if(!e)continue;const t=X(e);if(t){t.focus();break}}}))}}),[r,t,o,a,i]),null}const bt=(0,y.createContext)({...te,scaleX:1,scaleY:1});var yt;!function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"}(yt||(yt={}));const wt=(0,y.memo)((function(e){var t,n,r,o;let{id:i,accessibility:a,autoScroll:l=!0,children:c,sensors:s=lt,collisionDetection:u=le,measuring:d,modifiers:f,...p}=e;const v=(0,y.useReducer)(gt,void 0,ht),[h,g]=v,[m,b]=function(){const[e]=(0,y.useState)((()=>new Set)),t=(0,y.useCallback)((t=>(e.add(t),()=>e.delete(t))),[e]),n=(0,y.useCallback)((t=>{let{type:n,event:r}=t;e.forEach((e=>{var t;return null==(t=e[n])?void 0:t.call(e,r)}))}),[e]);return[n,t]}(),[C,D]=(0,y.useState)(yt.Uninitialized),S=C===yt.Initialized,{draggable:{active:k,nodes:M,translate:z},droppable:{containers:j}}=h,L=k?M.get(k):null,F=(0,y.useRef)({initial:null,translated:null}),U=(0,y.useMemo)((()=>{var e;return null!=k?{id:k,data:null!=(e=null==L?void 0:L.data)?e:ct,rect:F}:null}),[k,L]),Y=(0,y.useRef)(null),[W,X]=(0,y.useState)(null),[K,H]=(0,y.useState)(null),q=N(p,Object.values(p)),G=P("DndDescribedBy",i),$=(0,y.useMemo)((()=>j.getEnabled()),[j]),ee=(ne=d,(0,y.useMemo)((()=>({draggable:{...st.draggable,...null==ne?void 0:ne.draggable},droppable:{...st.droppable,...null==ne?void 0:ne.droppable},dragOverlay:{...st.dragOverlay,...null==ne?void 0:ne.dragOverlay}})),[null==ne?void 0:ne.draggable,null==ne?void 0:ne.droppable,null==ne?void 0:ne.dragOverlay]));var ne;const{droppableRects:re,measureDroppableContainers:oe,measuringScheduled:ie}=function(e,t){let{dragging:n,dependencies:r,config:o}=t;const[i,a]=(0,y.useState)(null),{frequency:l,measure:c,strategy:s}=o,u=(0,y.useRef)(e),d=function(){switch(s){case Ge.Always:return!1;case Ge.BeforeDragging:return n;default:return!n}}(),f=N(d),p=(0,y.useCallback)((function(e){void 0===e&&(e=[]),f.current||a((t=>null===t?e:t.concat(e.filter((e=>!t.includes(e))))))}),[f]),v=(0,y.useRef)(null),h=_((t=>{if(d&&!n)return Qe;if(!t||t===Qe||u.current!==e||null!=i){const t=new Map;for(let n of e){if(!n)continue;if(i&&i.length>0&&!i.includes(n.id)&&n.rect.current){t.set(n.id,n.rect.current);continue}const e=n.node.current,r=e?new ke(c(e),e):null;n.rect.current=r,r&&t.set(n.id,r)}return t}return t}),[e,i,n,d,c]);return(0,y.useEffect)((()=>{u.current=e}),[e]),(0,y.useEffect)((()=>{d||p()}),[n,d]),(0,y.useEffect)((()=>{i&&i.length>0&&a(null)}),[JSON.stringify(i)]),(0,y.useEffect)((()=>{d||"number"!=typeof l||null!==v.current||(v.current=setTimeout((()=>{p(),v.current=null}),l))}),[l,d,p,...r]),{droppableRects:h,measureDroppableContainers:p,measuringScheduled:null!=i}}($,{dragging:S,dependencies:[z.x,z.y],config:ee.droppable}),ae=function(e,t){const n=null!==t?e.get(t):void 0,r=n?n.node.current:null;return _((e=>{var n;return null===t?null:null!=(n=null!=r?r:e)?n:null}),[r,t])}(M,k),se=(0,y.useMemo)((()=>K?V(K):null),[K]),de=function(){const e=!1===(null==W?void 0:W.autoScrollEnabled),t="object"==typeof l?!1===l.enabled:!1===l,n=S&&!e&&!t;return"object"==typeof l?{...l,enabled:n}:{enabled:n}}(),pe=function(e,t){return Ze(e,t)}(ae,ee.draggable.measure);!function(e){let{activeNode:t,measure:n,initialRect:r,config:o=!0}=e;const i=(0,y.useRef)(!1),{x:a,y:l}="boolean"==typeof o?{x:o,y:o}:o;I((()=>{if(!a&&!l||!t)return void(i.current=!1);if(i.current||!r)return;const e=null==t?void 0:t.node.current;if(!e||!1===e.isConnected)return;const o=ce(n(e),r);if(a||(o.x=0),l||(o.y=0),i.current=!0,Math.abs(o.x)>0||Math.abs(o.y)>0){const t=he(e);t&&t.scrollBy({top:o.y,left:o.x})}}),[t,a,l,r,n])}({activeNode:k?M.get(k):null,config:de.layoutShiftCompensation,initialRect:pe,measure:ee.draggable.measure});const me=nt(ae,ee.draggable.measure,pe),be=nt(ae?ae.parentElement:null),Ee=(0,y.useRef)({activatorEvent:null,active:null,activeNode:ae,collisionRect:null,collisions:null,droppableRects:re,draggableNodes:M,draggingNode:null,draggingNodeRect:null,droppableContainers:j,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Ce=j.getNodeFor(null==(t=Ee.current.over)?void 0:t.id),Re=function(e){let{measure:t}=e;const[n,r]=(0,y.useState)(null),o=et({callback:(0,y.useCallback)((e=>{for(const{target:n}of e)if(O(n)){r((e=>{const r=t(n);return e?{...e,width:r.width,height:r.height}:r}));break}}),[t])}),i=(0,y.useCallback)((e=>{const n=function(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return O(t)?t:e}(e);null==o||o.disconnect(),n&&(null==o||o.observe(n)),r(n?t(n):null)}),[t,o]),[a,l]=T(i);return(0,y.useMemo)((()=>({nodeRef:a,rect:n,setRef:l})),[n,a,l])}({measure:ee.dragOverlay.measure}),Oe=null!=(n=Re.nodeRef.current)?n:ae,Me=S?null!=(r=Re.rect)?r:me:null,Ie=Boolean(Re.nodeRef.current&&Re.rect),ze=ce(Ne=Ie?null:me,Ze(Ne));var Ne;const _e=it(Oe?R(Oe):null),Te=function(e){const t=(0,y.useRef)(e),n=_((n=>e?n&&n!==rt&&e&&t.current&&e.parentNode===t.current.parentNode?n:ve(e):rt),[e]);return(0,y.useEffect)((()=>{t.current=e}),[e]),n}(S?null!=Ce?Ce:ae:null),Ae=function(e,t){void 0===t&&(t=fe);const[n]=e,r=it(n?R(n):null),[o,i]=(0,y.useReducer)((function(){return e.length?e.map((e=>xe(e)?r:new ke(t(e),e))):at}),at),a=et({callback:i});return e.length>0&&o===at&&i(),I((()=>{e.length?e.forEach((e=>null==a?void 0:a.observe(e))):(null==a||a.disconnect(),i())}),[e]),o}(Te),je=function(e,t){let{transform:n,...r}=t;return null!=e&&e.length?e.reduce(((e,t)=>t({transform:e,...r})),n):n}(f,{transform:{x:z.x-ze.x,y:z.y-ze.y,scaleX:1,scaleY:1},activatorEvent:K,active:U,activeNodeRect:me,containerNodeRect:be,draggingNodeRect:Me,over:Ee.current.over,overlayNodeRect:Re.rect,scrollableAncestors:Te,scrollableAncestorRects:Ae,windowRect:_e}),Pe=se?B(se,z):null,Le=function(e){const[t,n]=(0,y.useState)(null),r=(0,y.useRef)(e),o=(0,y.useCallback)((e=>{const t=ge(e.target);t&&n((e=>e?(e.set(t,ye(t)),new Map(e)):null))}),[]);return(0,y.useEffect)((()=>{const t=r.current;if(e!==t){i(t);const a=e.map((e=>{const t=ge(e);return t?(t.addEventListener("scroll",o,{passive:!0}),[t,ye(t)]):null})).filter((e=>null!=e));n(a.length?new Map(a):null),r.current=e}return()=>{i(e),i(t)};function i(e){e.forEach((e=>{const t=ge(e);null==t||t.removeEventListener("scroll",o)}))}}),[o,e]),(0,y.useMemo)((()=>e.length?t?Array.from(t.values()).reduce(((e,t)=>B(e,t)),te):Se(e):te),[e,t])}(Te),Be=ot(Le),Fe=ot(Le,[me]),Ue=B(je,Be),Ve=Me?ue(Me,je):null,Ye=U&&Ve?u({active:U,collisionRect:Ve,droppableRects:re,droppableContainers:$,pointerCoordinates:Pe}):null,We=function(e){if(!e||0===e.length)return null;const[t]=e;return t.id}(Ye),[Xe,Ke]=(0,y.useState)(null),$e=function(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}(Ie?je:B(je,Fe),null!=(o=null==Xe?void 0:Xe.rect)?o:null,me),tt=(0,y.useCallback)(((e,t)=>{let{sensor:n,options:r}=t;if(null==Y.current)return;const o=M.get(Y.current);if(!o)return;const i=e.nativeEvent,a=new n({active:Y.current,activeNode:o,event:i,options:r,context:Ee,onStart(e){const t=Y.current;if(null==t)return;const n=M.get(t);if(!n)return;const{onDragStart:r}=q.current,o={active:{id:t,data:n.data,rect:F}};(0,x.unstable_batchedUpdates)((()=>{null==r||r(o),D(yt.Initializing),g({type:Z.DragStart,initialCoordinates:e,active:t}),m({type:"onDragStart",event:o})}))},onMove(e){g({type:Z.DragMove,coordinates:e})},onEnd:l(Z.DragEnd),onCancel:l(Z.DragCancel)});function l(e){return async function(){const{active:t,collisions:n,over:r,scrollAdjustedTranslate:o}=Ee.current;let a=null;if(t&&o){const{cancelDrop:l}=q.current;a={activatorEvent:i,active:t,collisions:n,delta:o,over:r},e===Z.DragEnd&&"function"==typeof l&&await Promise.resolve(l(a))&&(e=Z.DragCancel)}Y.current=null,(0,x.unstable_batchedUpdates)((()=>{g({type:e}),D(yt.Uninitialized),Ke(null),X(null),H(null);const t=e===Z.DragEnd?"onDragEnd":"onDragCancel";if(a){const e=q.current[t];null==e||e(a),m({type:t,event:a})}}))}}(0,x.unstable_batchedUpdates)((()=>{X(a),H(e.nativeEvent)}))}),[M]),ut=(0,y.useCallback)(((e,t)=>(n,r)=>{const o=n.nativeEvent,i=M.get(r);if(null!==Y.current||!i||o.dndKit||o.defaultPrevented)return;const a={active:i};!0===e(n,t.options,a)&&(o.dndKit={capturedBy:t.sensor},Y.current=r,tt(n,t))}),[M,tt]),dt=function(e,t){return(0,y.useMemo)((()=>e.reduce(((e,n)=>{const{sensor:r}=n;return[...e,...r.activators.map((e=>({eventName:e.eventName,handler:t(e.handler,n)})))]}),[])),[e,t])}(s,ut);!function(e){(0,y.useEffect)((()=>{if(!E)return;const t=e.map((e=>{let{sensor:t}=e;return null==t.setup?void 0:t.setup()}));return()=>{for(const e of t)null==e||e()}}),e.map((e=>{let{sensor:t}=e;return t})))}(s),I((()=>{me&&C===yt.Initializing&&D(yt.Initialized)}),[me,C]),(0,y.useEffect)((()=>{const{onDragMove:e}=q.current,{active:t,activatorEvent:n,collisions:r,over:o}=Ee.current;if(!t||!n)return;const i={active:t,activatorEvent:n,collisions:r,delta:{x:Ue.x,y:Ue.y},over:o};(0,x.unstable_batchedUpdates)((()=>{null==e||e(i),m({type:"onDragMove",event:i})}))}),[Ue.x,Ue.y]),(0,y.useEffect)((()=>{const{active:e,activatorEvent:t,collisions:n,droppableContainers:r,scrollAdjustedTranslate:o}=Ee.current;if(!e||null==Y.current||!t||!o)return;const{onDragOver:i}=q.current,a=r.get(We),l=a&&a.rect.current?{id:a.id,rect:a.rect.current,data:a.data,disabled:a.disabled}:null,c={active:e,activatorEvent:t,collisions:n,delta:{x:o.x,y:o.y},over:l};(0,x.unstable_batchedUpdates)((()=>{Ke(l),null==i||i(c),m({type:"onDragOver",event:c})}))}),[We]),I((()=>{Ee.current={activatorEvent:K,active:U,activeNode:ae,collisionRect:Ve,collisions:Ye,droppableRects:re,draggableNodes:M,draggingNode:Oe,draggingNodeRect:Me,droppableContainers:j,over:Xe,scrollableAncestors:Te,scrollAdjustedTranslate:Ue},F.current={initial:Me,translated:Ve}}),[U,ae,Ye,Ve,M,Oe,Me,re,j,Xe,Te,Ue]),function(e){let{acceleration:t,activator:n=He.Pointer,canScroll:r,draggingRect:o,enabled:i,interval:a=5,order:l=qe.TreeOrder,pointerCoordinates:c,scrollableAncestors:s,scrollableAncestorRects:u,delta:d,threshold:f}=e;const p=function(e){let{delta:t,disabled:n}=e;const r=A(t);return _((e=>{if(n||!r||!e)return Je;const o=Math.sign(t.x-r.x),i=Math.sign(t.y-r.y);return{x:{[we.Backward]:e.x[we.Backward]||-1===o,[we.Forward]:e.x[we.Forward]||1===o},y:{[we.Backward]:e.y[we.Backward]||-1===i,[we.Forward]:e.y[we.Forward]||1===i}}}),[n,t,r])}({delta:d,disabled:!i}),[v,h]=function(){const e=(0,y.useRef)(null);return[(0,y.useCallback)(((t,n)=>{e.current=setInterval(t,n)}),[]),(0,y.useCallback)((()=>{null!==e.current&&(clearInterval(e.current),e.current=null)}),[])]}(),g=(0,y.useRef)({x:0,y:0}),m=(0,y.useRef)({x:0,y:0}),b=(0,y.useMemo)((()=>{switch(n){case He.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case He.DraggableRect:return o}}),[n,o,c]),w=(0,y.useRef)(null),x=(0,y.useCallback)((()=>{const e=w.current;if(!e)return;const t=g.current.x*m.current.x,n=g.current.y*m.current.y;e.scrollBy(t,n)}),[]),E=(0,y.useMemo)((()=>l===qe.TreeOrder?[...s].reverse():s),[l,s]);(0,y.useEffect)((()=>{if(i&&s.length&&b){for(const e of E){if(!1===(null==r?void 0:r(e)))continue;const n=s.indexOf(e),o=u[n];if(!o)continue;const{direction:i,speed:l}=De(e,o,b,t,f);for(const e of["x","y"])p[e][i[e]]||(l[e]=0,i[e]=0);if(l.x>0||l.y>0)return h(),w.current=e,v(x,a),g.current=l,void(m.current=i)}g.current={x:0,y:0},m.current={x:0,y:0},h()}else h()}),[t,x,r,h,i,a,JSON.stringify(b),JSON.stringify(p),v,s,E,u,JSON.stringify(f)])}({...de,delta:z,draggingRect:Ve,pointerCoordinates:Pe,scrollableAncestors:Te,scrollableAncestorRects:Ae});const ft=(0,y.useMemo)((()=>({active:U,activeNode:ae,activeNodeRect:me,activatorEvent:K,collisions:Ye,containerNodeRect:be,dragOverlay:Re,draggableNodes:M,droppableContainers:j,droppableRects:re,over:Xe,measureDroppableContainers:oe,scrollableAncestors:Te,scrollableAncestorRects:Ae,measuringConfiguration:ee,measuringScheduled:ie,windowRect:_e})),[U,ae,me,K,Ye,be,Re,M,j,re,Xe,oe,Te,Ae,ee,ie,_e]),wt=(0,y.useMemo)((()=>({activatorEvent:K,activators:dt,active:U,activeNodeRect:me,ariaDescribedById:{draggable:G},dispatch:g,draggableNodes:M,over:Xe,measureDroppableContainers:oe})),[K,dt,U,me,g,G,M,Xe,oe]);return w().createElement(J.Provider,{value:b},w().createElement(pt.Provider,{value:wt},w().createElement(vt.Provider,{value:ft},w().createElement(bt.Provider,{value:$e},c)),w().createElement(mt,{disabled:!1===(null==a?void 0:a.restoreFocus)})),w().createElement(Q,{...a,hiddenTextDescribedById:G}))})),xt=(0,y.createContext)(null),Et="button";const Ct={timeout:25};function Dt(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function Rt(e,t){return e.reduce(((e,n,r)=>{const o=t.get(n);return o&&(e[r]=o),e}),Array(e.length))}function St(e){return null!==e&&e>=0}const Ot=e=>{let{rects:t,activeIndex:n,overIndex:r,index:o}=e;const i=Dt(t,r,n),a=t[o],l=i[o];return l&&a?{x:l.left-a.left,y:l.top-a.top,scaleX:l.width/a.width,scaleY:l.height/a.height}:null},kt={scaleX:1,scaleY:1},Mt=e=>{var t;let{activeIndex:n,activeNodeRect:r,index:o,rects:i,overIndex:a}=e;const l=null!=(t=i[n])?t:r;if(!l)return null;if(o===n){const e=i[a];return e?{x:0,y:nn&&o<=a?{x:0,y:-l.height-c,...kt}:o=a?{x:0,y:l.height+c,...kt}:{x:0,y:0,...kt}},It="Sortable",zt=w().createContext({activeIndex:-1,containerId:It,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Ot,disabled:{draggable:!1,droppable:!1}});function Nt(e){let{children:t,id:n,items:r,strategy:o=Ot,disabled:i=!1}=e;const{active:a,dragOverlay:l,droppableRects:c,over:s,measureDroppableContainers:u}=(0,y.useContext)(vt),d=P(It,n),f=Boolean(null!==l.rect),p=(0,y.useMemo)((()=>r.map((e=>"object"==typeof e&&"id"in e?e.id:e))),[r]),v=null!=a,h=a?p.indexOf(a.id):-1,g=s?p.indexOf(s.id):-1,m=(0,y.useRef)(p),b=!function(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n{b&&v&&u(p)}),[b,p,v,u]),(0,y.useEffect)((()=>{m.current=p}),[p]);const C=(0,y.useMemo)((()=>({activeIndex:h,containerId:d,disabled:E,disableTransforms:x,items:p,overIndex:g,useDragOverlay:f,sortedRects:Rt(p,c),strategy:o})),[h,d,E.draggable,E.droppable,x,p,g,c,f,o]);return w().createElement(zt.Provider,{value:C},t)}const _t=e=>{let{id:t,items:n,activeIndex:r,overIndex:o}=e;return Dt(n,r,o).indexOf(t)},Tt=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:o,items:i,newIndex:a,previousItems:l,previousContainerId:c,transition:s}=e;return!(!s||!r||l!==i&&o===a||!n&&(a===o||t!==c))},At={duration:200,easing:"ease"},jt="transform",Pt=Y.Transition.toString({property:jt,duration:0,easing:"linear"}),Lt={roleDescription:"sortable"};function Bt(e){let{animateLayoutChanges:t=Tt,attributes:n,disabled:r,data:o,getNewIndex:i=_t,id:a,strategy:l,resizeObserverConfig:c,transition:s=At}=e;const{items:u,containerId:d,activeIndex:f,disabled:p,disableTransforms:v,sortedRects:h,overIndex:g,useDragOverlay:m,strategy:b}=(0,y.useContext)(zt),w=function(e,t){var n,r;return"boolean"==typeof e?{draggable:e,droppable:!1}:{draggable:null!=(n=null==e?void 0:e.draggable)?n:t.draggable,droppable:null!=(r=null==e?void 0:e.droppable)?r:t.droppable}}(r,p),x=u.indexOf(a),E=(0,y.useMemo)((()=>({sortable:{containerId:d,index:x,items:u},...o})),[d,o,x,u]),C=(0,y.useMemo)((()=>u.slice(u.indexOf(a))),[u,a]),{rect:D,node:R,isOver:S,setNodeRef:O}=function(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:o}=e;const i=P("Droppable"),{active:a,dispatch:l,over:c,measureDroppableContainers:s}=(0,y.useContext)(pt),u=(0,y.useRef)({disabled:n}),d=(0,y.useRef)(!1),f=(0,y.useRef)(null),p=(0,y.useRef)(null),{disabled:v,updateMeasurementsFor:h,timeout:g}={...Ct,...o},m=N(null!=h?h:r),b=et({callback:(0,y.useCallback)((()=>{d.current?(null!=p.current&&clearTimeout(p.current),p.current=setTimeout((()=>{s(Array.isArray(m.current)?m.current:[m.current]),p.current=null}),g)):d.current=!0}),[g]),disabled:v||!a}),w=(0,y.useCallback)(((e,t)=>{b&&(t&&(b.unobserve(t),d.current=!1),e&&b.observe(e))}),[b]),[x,E]=T(w),C=N(t);return(0,y.useEffect)((()=>{b&&x.current&&(b.disconnect(),d.current=!1,b.observe(x.current))}),[x,b]),I((()=>(l({type:Z.RegisterDroppable,element:{id:r,key:i,disabled:n,node:x,rect:f,data:C}}),()=>l({type:Z.UnregisterDroppable,key:i,id:r}))),[r]),(0,y.useEffect)((()=>{n!==u.current.disabled&&(l({type:Z.SetDroppableDisabled,id:r,key:i,disabled:n}),u.current.disabled=n)}),[r,i,n,l]),{active:a,rect:f,isOver:(null==c?void 0:c.id)===r,node:x,over:c,setNodeRef:E}}({id:a,data:E,disabled:w.droppable,resizeObserverConfig:{updateMeasurementsFor:C,...c}}),{active:k,activatorEvent:M,activeNodeRect:z,attributes:_,setNodeRef:A,listeners:j,isDragging:L,over:B,setActivatorNodeRef:F,transform:V}=function(e){let{id:t,data:n,disabled:r=!1,attributes:o}=e;const i=P("Droppable"),{activators:a,activatorEvent:l,active:c,activeNodeRect:s,ariaDescribedById:u,draggableNodes:d,over:f}=(0,y.useContext)(pt),{role:p=Et,roleDescription:v="draggable",tabIndex:h=0}=null!=o?o:{},g=(null==c?void 0:c.id)===t,m=(0,y.useContext)(g?bt:xt),[b,w]=T(),[x,E]=T(),C=function(e,t){return(0,y.useMemo)((()=>e.reduce(((e,n)=>{let{eventName:r,handler:o}=n;return e[r]=e=>{o(e,t)},e}),{})),[e,t])}(a,t),D=N(n);return I((()=>(d.set(t,{id:t,key:i,node:b,activatorNode:x,data:D}),()=>{const e=d.get(t);e&&e.key===i&&d.delete(t)})),[d,t]),{active:c,activatorEvent:l,activeNodeRect:s,attributes:(0,y.useMemo)((()=>({role:p,tabIndex:h,"aria-disabled":r,"aria-pressed":!(!g||p!==Et)||void 0,"aria-roledescription":v,"aria-describedby":u.draggable})),[r,p,h,g,v,u.draggable]),isDragging:g,listeners:r?void 0:C,node:b,over:f,setNodeRef:w,setActivatorNodeRef:E,transform:m}}({id:a,data:E,attributes:{...Lt,...n},disabled:w.draggable}),W=function(){for(var e=arguments.length,t=new Array(e),n=0;ne=>{t.forEach((t=>t(e)))}),t)}(O,A),X=Boolean(k),K=X&&!v&&St(f)&&St(g),H=!m&&L,q=H&&K?V:null,J=K?null!=q?q:(null!=l?l:b)({rects:h,activeNodeRect:z,activeIndex:f,overIndex:g,index:x}):null,G=St(f)&&St(g)?i({id:a,items:u,activeIndex:f,overIndex:g}):x,$=null==k?void 0:k.id,Q=(0,y.useRef)({activeId:$,items:u,newIndex:G,containerId:d}),ee=u!==Q.current.items,te=t({active:k,containerId:d,isDragging:L,isSorting:X,id:a,index:x,items:u,newIndex:Q.current.newIndex,previousItems:Q.current.items,previousContainerId:Q.current.containerId,transition:s,wasDragging:null!=Q.current.activeId}),ne=function(e){let{disabled:t,index:n,node:r,rect:o}=e;const[i,a]=(0,y.useState)(null),l=(0,y.useRef)(n);return I((()=>{if(!t&&n!==l.current&&r.current){const e=o.current;if(e){const t=fe(r.current,{ignoreTransform:!0}),n={x:e.left-t.left,y:e.top-t.top,scaleX:e.width/t.width,scaleY:e.height/t.height};(n.x||n.y)&&a(n)}}n!==l.current&&(l.current=n)}),[t,n,r,o]),(0,y.useEffect)((()=>{i&&a(null)}),[i]),i}({disabled:!te,index:x,node:R,rect:D});return(0,y.useEffect)((()=>{X&&Q.current.newIndex!==G&&(Q.current.newIndex=G),d!==Q.current.containerId&&(Q.current.containerId=d),u!==Q.current.items&&(Q.current.items=u)}),[X,G,d,u]),(0,y.useEffect)((()=>{if($===Q.current.activeId)return;if($&&!Q.current.activeId)return void(Q.current.activeId=$);const e=setTimeout((()=>{Q.current.activeId=$}),50);return()=>clearTimeout(e)}),[$]),{active:k,activeIndex:f,attributes:_,data:E,rect:D,index:x,newIndex:G,items:u,isOver:S,isSorting:X,isDragging:L,listeners:j,node:R,overIndex:g,over:B,setNodeRef:W,setActivatorNodeRef:F,setDroppableNodeRef:O,setDraggableNodeRef:A,transform:null!=ne?ne:J,transition:ne||ee&&Q.current.newIndex===x?Pt:H&&!U(M)||!s?void 0:X||te?Y.Transition.toString({...s,property:jt}):void 0}}Ne.Down,Ne.Right,Ne.Up,Ne.Left;const Ft=window.wp.compose;function Ut(e){return Ut="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},Ut(e)}function Vt(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=Array(t);ne.controlData.rows_min?wp.element.createElement("button",{className:"lzb-gutenberg-repeater-btn-remove",onClick:e.onRemove},wp.element.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},wp.element.createElement("path",{d:"M3 6h18"}),wp.element.createElement("path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"}),wp.element.createElement("path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"}),wp.element.createElement("line",{x1:"10",x2:"10",y1:"11",y2:"17"}),wp.element.createElement("line",{x1:"14",x2:"14",y1:"11",y2:"17"}))):null,wp.element.createElement("div",{className:"lzb-gutenberg-repeater-btn-arrow"},wp.element.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-hidden":"true",focusable:"false"},wp.element.createElement("path",{d:"M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"})))),e.active?e.renderContent():"")};const Qt=(0,Ft.withInstanceId)((function(e){var t,n,r=e.count,o=void 0===r?0:r,a=e.controlData,s=e.renderRow,u=void 0===s?function(){}:s,d=e.addRow,f=void 0===d?function(){}:d,p=e.duplicateRow,v=void 0===p?function(){}:p,h=e.removeRow,g=void 0===h?function(){}:h,m=e.resortRow,b=void 0===m?function(){}:m,w=e.getInnerControls,x=void 0===w?function(){}:w,E=function(){for(var e=arguments.length,t=new Array(e),n=0;n[...t].filter((e=>null!=e))),[...t])}((t=Ht,(0,y.useMemo)((()=>({sensor:t,options:{}})),[t,n]))),C=-1;("false"===a.rows_collapsible||"false"===a.rows_collapsed)&&(C=-2);var D,R,S=(D=(0,l.useState)(C),R=2,function(e){if(Array.isArray(e))return e}(D)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,l=[],c=!0,s=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(e){s=!0,o=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(s)throw o}}return l}}(D,R)||function(e,t){if(e){if("string"==typeof e)return Jt(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)?Jt(e,t):void 0}}(D,R)||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.")}()),O=S[0],k=S[1];function M(e){var t=["alt","url","title","caption","description","id","link"],n=a.rows_label||(0,i.__)("Row {{#}}","lazy-blocks");n=n.replace(/{{#}}/g,e+1);var r=x(e);return r&&Object.keys(r).forEach((function(e){var o=r[e].data,i=r[e].val||"";"object"===qt(i)&&t.forEach((function(e){n=n.replace(new RegExp("{{".concat(o.name,".").concat(e,"}}"),"g"),i[e]||"")})),"image"===o.type&&i.url&&(i='')),"object"===qt(i)&&(i=""),n=n.replace(new RegExp("{{".concat(o.name,"}}"),"g"),i)})),n}(0,l.useEffect)((function(){if(a.rows_min&&a.rows_min>0&&a.rows_min>o)for(var e=a.rows_min-o,t=0;t-1&&k(n.id-1))}},I.length?wp.element.createElement("div",{className:"lzb-gutenberg-repeater-items"},wp.element.createElement(Nt,{items:I,strategy:Mt},I.map((function(e){return wp.element.createElement($t,Gt({key:"lzb-constructor-controls-items-sortable-".concat(e.id)},e))})))):null),wp.element.createElement(c.ButtonGroup,{className:"lzb-gutenberg-repeater-options"},wp.element.createElement(c.Button,{variant:"secondary",size:"compact",className:"lzb-gutenberg-repeater-options-add",disabled:a.rows_max&&o>=a.rows_max,onClick:function(){f(),-2!==O&&k(I.length)}},a.rows_add_button_label||(0,i.__)("+ Add Row","lazy-blocks")),"true"===a.rows_collapsible&&I.length&&I.length>1?wp.element.createElement(c.Tooltip,{text:(0,i.__)("Toggle all rows","lazy-blocks")},wp.element.createElement(c.Button,{variant:-2===O?"primary":"secondary",size:"compact",className:"lzb-gutenberg-repeater-options-expand",onClick:function(){k(-2===O?-1:-2)}},wp.element.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},wp.element.createElement("path",{d:"m7 15 5 5 5-5"}),wp.element.createElement("path",{d:"m7 9 5-5 5 5"})))):""))}));function Zt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n1&&void 0!==arguments[1]?arguments[1]:{},r=n.className,i=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.includes(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r-1&&(r.splice(e,1),n.onChange(r),a&&a())},addRow:function(){var e=n.getControls(n.uniqueId),t={};Object.keys(e).forEach((function(n){var r=e[n];t[r.name]=r.default||r.checked||""})),r.push(t),n.onChange(r),a&&a()},duplicateRow:function(o){r.push((0,e.cloneDeep)(r[o]));var i=t(r,r.length-1,o+1);n.onChange(i),a&&a()},resortRow:function(e,o){var i=t(r,e,o);n.onChange(i),a&&a()}}))}function nn(e){var t,n,r=e.printControls,a=e.id,c=e.controls,s=(t=(0,l.useState)(!1),n=2,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,l=[],c=!0,s=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(e){s=!0,o=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(s)throw o}}return l}}(t,n)||function(e,t){if(e){if("string"==typeof e)return Zt(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)?Zt(e,t):void 0}}(t,n)||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.")}()),u=s[0],d=s[1],f=0;Object.keys(c).forEach((function(e){c[e].child_of===a&&(f+=1)}));var p=(0,i.__)("Show Child Controls","lazy-blocks");return u?p=(0,i.__)("Hide Child Controls","lazy-blocks"):f&&(p=(0,i.sprintf)( +(()=>{var e={8655:(e,t)=>{var n;!function(){"use strict";var r=function(){function e(){}function t(e,t){for(var n=t.length,r=0;r{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";const e=window.lodash;function t(e,t,n){return function(e,t,n){const r=t<0?e.length+t:t;if(r>=0&&r{t.current=e})),(0,y.useCallback)((function(){for(var e=arguments.length,n=new Array(e),r=0;r{n.current!==e&&(n.current=e)}),t),n}function _(e,t){const n=(0,y.useRef)();return(0,y.useMemo)((()=>{const t=e(n.current);return n.current=t,t}),[...t])}function T(e){const t=z(e),n=(0,y.useRef)(null),r=(0,y.useCallback)((e=>{e!==n.current&&(null==t||t(e,n.current)),n.current=e}),[]);return[n,r]}function A(e){const t=(0,y.useRef)();return(0,y.useEffect)((()=>{t.current=e}),[e]),t.current}let j={};function P(e,t){return(0,y.useMemo)((()=>{if(t)return t;const n=null==j[e]?0:j[e]+1;return j[e]=n,e+"-"+n}),[e,t])}function L(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o{const r=Object.entries(n);for(const[n,o]of r){const r=t[n];null!=r&&(t[n]=r+e*o)}return t}),{...t})}}const B=L(1),F=L(-1);function U(e){if(!e)return!1;const{KeyboardEvent:t}=R(e.target);return t&&e instanceof t}function V(e){if(function(e){if(!e)return!1;const{TouchEvent:t}=R(e.target);return t&&e instanceof t}(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return function(e){return"clientX"in e&&"clientY"in e}(e)?{x:e.clientX,y:e.clientY}:null}const Y=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[Y.Translate.toString(e),Y.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),W="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function X(e){return e.matches(W)?e:e.querySelector(W)}const K={display:"none"};function H(e){let{id:t,value:n}=e;return w().createElement("div",{id:t,style:K},n)}function q(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;return w().createElement("div",{id:t,style:{position:"fixed",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"},role:"status","aria-live":r,"aria-atomic":!0},n)}const J=(0,y.createContext)(null),G={draggable:"\n To pick up a draggable item, press the space bar.\n While dragging, use the arrow keys to move the item.\n Press space again to drop the item in its new position, or press escape to cancel.\n "},$={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function Q(e){let{announcements:t=$,container:n,hiddenTextDescribedById:r,screenReaderInstructions:o=G}=e;const{announce:i,announcement:a}=function(){const[e,t]=(0,y.useState)("");return{announce:(0,y.useCallback)((e=>{null!=e&&t(e)}),[]),announcement:e}}(),l=P("DndLiveRegion"),[c,s]=(0,y.useState)(!1);if((0,y.useEffect)((()=>{s(!0)}),[]),function(e){const t=(0,y.useContext)(J);(0,y.useEffect)((()=>{if(!t)throw new Error("useDndMonitor must be used within a children of ");return t(e)}),[e,t])}((0,y.useMemo)((()=>({onDragStart(e){let{active:n}=e;i(t.onDragStart({active:n}))},onDragMove(e){let{active:n,over:r}=e;t.onDragMove&&i(t.onDragMove({active:n,over:r}))},onDragOver(e){let{active:n,over:r}=e;i(t.onDragOver({active:n,over:r}))},onDragEnd(e){let{active:n,over:r}=e;i(t.onDragEnd({active:n,over:r}))},onDragCancel(e){let{active:n,over:r}=e;i(t.onDragCancel({active:n,over:r}))}})),[i,t])),!c)return null;const u=w().createElement(w().Fragment,null,w().createElement(H,{id:r,value:o.draggable}),w().createElement(q,{id:l,announcement:a}));return n?(0,x.createPortal)(u,n):u}var Z;function ee(){}!function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"}(Z||(Z={}));const te=Object.freeze({x:0,y:0});function ne(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function re(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function oe(e,t,n){return void 0===t&&(t=e.left),void 0===n&&(n=e.top),{x:t+.5*e.width,y:n+.5*e.height}}const ie=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=oe(t,t.left,t.top),i=[];for(const e of r){const{id:t}=e,r=n.get(t);if(r){const n=(a=oe(r),l=o,Math.sqrt(Math.pow(a.x-l.x,2)+Math.pow(a.y-l.y,2)));i.push({id:t,data:{droppableContainer:e,value:n}})}}var a,l;return i.sort(ne)};function ae(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),i=Math.min(t.top+t.height,e.top+e.height),a=o-r,l=i-n;if(r{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=[];for(const e of r){const{id:r}=e,i=n.get(r);if(i){const n=ae(i,t);n>0&&o.push({id:r,data:{droppableContainer:e,value:n}})}}return o.sort(re)};function ce(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:te}function se(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o({...t,top:t.top+e*n.y,bottom:t.bottom+e*n.y,left:t.left+e*n.x,right:t.right+e*n.x})),{...t})}}const ue=se(1);const de={ignoreTransform:!1};function fe(e,t){void 0===t&&(t=de);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:t,transformOrigin:r}=R(e).getComputedStyle(e);t&&(n=function(e,t,n){const r=function(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}(t);if(!r)return e;const{scaleX:o,scaleY:i,x:a,y:l}=r,c=e.left-a-(1-o)*parseFloat(n),s=e.top-l-(1-i)*parseFloat(n.slice(n.indexOf(" ")+1)),u=o?e.width/o:e.width,d=i?e.height/i:e.height;return{width:u,height:d,top:s,right:c+u,bottom:s+d,left:c}}(n,t,r))}const{top:r,left:o,width:i,height:a,bottom:l,right:c}=n;return{top:r,left:o,width:i,height:a,bottom:l,right:c}}function pe(e){return fe(e,{ignoreTransform:!0})}function ve(e,t){const n=[];return e?function r(o){if(null!=t&&n.length>=t)return n;if(!o)return n;if(S(o)&&null!=o.scrollingElement&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!O(o)||k(o))return n;if(n.includes(o))return n;const i=R(e).getComputedStyle(o);return o!==e&&function(e,t){void 0===t&&(t=R(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some((e=>{const r=t[e];return"string"==typeof r&&n.test(r)}))}(o,i)&&n.push(o),function(e,t){return void 0===t&&(t=R(e).getComputedStyle(e)),"fixed"===t.position}(o,i)?n:r(o.parentNode)}(e):n}function he(e){const[t]=ve(e,1);return null!=t?t:null}function ge(e){return E&&e?C(e)?e:D(e)?S(e)||e===M(e).scrollingElement?window:O(e)?e:null:null:null}function me(e){return C(e)?e.scrollX:e.scrollLeft}function be(e){return C(e)?e.scrollY:e.scrollTop}function ye(e){return{x:me(e),y:be(e)}}var we;function xe(e){return!(!E||!e)&&e===document.scrollingElement}function Ee(e){const t={x:0,y:0},n=xe(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=r.y,isRight:e.scrollLeft>=r.x,maxScroll:r,minScroll:t}}!function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"}(we||(we={}));const Ce={x:.2,y:.2};function De(e,t,n,r,o){let{top:i,left:a,right:l,bottom:c}=n;void 0===r&&(r=10),void 0===o&&(o=Ce);const{isTop:s,isBottom:u,isLeft:d,isRight:f}=Ee(e),p={x:0,y:0},v={x:0,y:0},h=t.height*o.y,g=t.width*o.x;return!s&&i<=t.top+h?(p.y=we.Backward,v.y=r*Math.abs((t.top+h-i)/h)):!u&&c>=t.bottom-h&&(p.y=we.Forward,v.y=r*Math.abs((t.bottom-h-c)/h)),!f&&l>=t.right-g?(p.x=we.Forward,v.x=r*Math.abs((t.right-g-l)/g)):!d&&a<=t.left+g&&(p.x=we.Backward,v.x=r*Math.abs((t.left+g-a)/g)),{direction:p,speed:v}}function Re(e){if(e===document.scrollingElement){const{innerWidth:e,innerHeight:t}=window;return{top:0,left:0,right:e,bottom:t,width:e,height:t}}const{top:t,left:n,right:r,bottom:o}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:o,width:e.clientWidth,height:e.clientHeight}}function Se(e){return e.reduce(((e,t)=>B(e,ye(t))),te)}const Oe=[["x",["left","right"],function(e){return e.reduce(((e,t)=>e+me(t)),0)}],["y",["top","bottom"],function(e){return e.reduce(((e,t)=>e+be(t)),0)}]];class ke{constructor(e,t){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const n=ve(t),r=Se(n);this.rect={...e},this.width=e.width,this.height=e.height;for(const[e,t,o]of Oe)for(const i of t)Object.defineProperty(this,i,{get:()=>{const t=o(n),a=r[e]-t;return this.rect[i]+a},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Me{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach((e=>{var t;return null==(t=this.target)?void 0:t.removeEventListener(...e)}))},this.target=e}add(e,t,n){var r;null==(r=this.target)||r.addEventListener(e,t,n),this.listeners.push([e,t,n])}}function Ie(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return"number"==typeof t?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t&&r>t.y}var ze,Ne,_e;function Te(e){e.preventDefault()}function Ae(e){e.stopPropagation()}!function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"}(ze||(ze={})),(_e=Ne||(Ne={})).Space="Space",_e.Down="ArrowDown",_e.Right="ArrowRight",_e.Left="ArrowLeft",_e.Up="ArrowUp",_e.Esc="Escape",_e.Enter="Enter";const je={start:[Ne.Space,Ne.Enter],cancel:[Ne.Esc],end:[Ne.Space,Ne.Enter]},Pe=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case Ne.Right:return{...n,x:n.x+25};case Ne.Left:return{...n,x:n.x-25};case Ne.Down:return{...n,y:n.y+25};case Ne.Up:return{...n,y:n.y-25}}};class Le{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;const{event:{target:t}}=e;this.props=e,this.listeners=new Me(M(t)),this.windowListeners=new Me(R(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(ze.Resize,this.handleCancel),this.windowListeners.add(ze.VisibilityChange,this.handleCancel),setTimeout((()=>this.listeners.add(ze.Keydown,this.handleKeyDown)))}handleStart(){const{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&function(e,t){if(void 0===t&&(t=fe),!e)return;const{top:n,left:r,bottom:o,right:i}=t(e);he(e)&&(o<=0||i<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}(n),t(te)}handleKeyDown(e){if(U(e)){const{active:t,context:n,options:r}=this.props,{keyboardCodes:o=je,coordinateGetter:i=Pe,scrollBehavior:a="smooth"}=r,{code:l}=e;if(o.end.includes(l))return void this.handleEnd(e);if(o.cancel.includes(l))return void this.handleCancel(e);const{collisionRect:c}=n.current,s=c?{x:c.left,y:c.top}:te;this.referenceCoordinates||(this.referenceCoordinates=s);const u=i(e,{active:t,context:n.current,currentCoordinates:s});if(u){const t=F(u,s),r={x:0,y:0},{scrollableAncestors:o}=n.current;for(const n of o){const o=e.code,{isTop:i,isRight:l,isLeft:c,isBottom:s,maxScroll:d,minScroll:f}=Ee(n),p=Re(n),v={x:Math.min(o===Ne.Right?p.right-p.width/2:p.right,Math.max(o===Ne.Right?p.left:p.left+p.width/2,u.x)),y:Math.min(o===Ne.Down?p.bottom-p.height/2:p.bottom,Math.max(o===Ne.Down?p.top:p.top+p.height/2,u.y))},h=o===Ne.Right&&!l||o===Ne.Left&&!c,g=o===Ne.Down&&!s||o===Ne.Up&&!i;if(h&&v.x!==u.x){const e=n.scrollLeft+t.x,i=o===Ne.Right&&e<=d.x||o===Ne.Left&&e>=f.x;if(i&&!t.y)return void n.scrollTo({left:e,behavior:a});r.x=i?n.scrollLeft-e:o===Ne.Right?n.scrollLeft-d.x:n.scrollLeft-f.x,r.x&&n.scrollBy({left:-r.x,behavior:a});break}if(g&&v.y!==u.y){const e=n.scrollTop+t.y,i=o===Ne.Down&&e<=d.y||o===Ne.Up&&e>=f.y;if(i&&!t.x)return void n.scrollTo({top:e,behavior:a});r.y=i?n.scrollTop-e:o===Ne.Down?n.scrollTop-d.y:n.scrollTop-f.y,r.y&&n.scrollBy({top:-r.y,behavior:a});break}}this.handleMove(e,B(F(u,this.referenceCoordinates),r))}}}handleMove(e,t){const{onMove:n}=this.props;e.preventDefault(),n(t)}handleEnd(e){const{onEnd:t}=this.props;e.preventDefault(),this.detach(),t()}handleCancel(e){const{onCancel:t}=this.props;e.preventDefault(),this.detach(),t()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}function Be(e){return Boolean(e&&"distance"in e)}function Fe(e){return Boolean(e&&"delay"in e)}Le.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=je,onActivation:o}=t,{active:i}=n;const{code:a}=e.nativeEvent;if(r.start.includes(a)){const t=i.activatorNode.current;return!(t&&e.target!==t||(e.preventDefault(),null==o||o({event:e.nativeEvent}),0))}return!1}}];class Ue{constructor(e,t,n){var r;void 0===n&&(n=function(e){const{EventTarget:t}=R(e);return e instanceof t?e:M(e)}(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=t;const{event:o}=e,{target:i}=o;this.props=e,this.events=t,this.document=M(i),this.documentListeners=new Me(this.document),this.listeners=new Me(n),this.windowListeners=new Me(R(i)),this.initialCoordinates=null!=(r=V(o))?r:te,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:e,props:{options:{activationConstraint:t,bypassActivationConstraint:n}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),this.windowListeners.add(ze.Resize,this.handleCancel),this.windowListeners.add(ze.DragStart,Te),this.windowListeners.add(ze.VisibilityChange,this.handleCancel),this.windowListeners.add(ze.ContextMenu,Te),this.documentListeners.add(ze.Keydown,this.handleKeydown),t){if(null!=n&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Fe(t))return void(this.timeoutId=setTimeout(this.handleStart,t.delay));if(Be(t))return}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),null!==this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handleStart(){const{initialCoordinates:e}=this,{onStart:t}=this.props;e&&(this.activated=!0,this.documentListeners.add(ze.Click,Ae,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(ze.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){var t;const{activated:n,initialCoordinates:r,props:o}=this,{onMove:i,options:{activationConstraint:a}}=o;if(!r)return;const l=null!=(t=V(e))?t:te,c=F(r,l);if(!n&&a){if(Be(a)){if(null!=a.tolerance&&Ie(c,a.tolerance))return this.handleCancel();if(Ie(c,a.distance))return this.handleStart()}return Fe(a)&&Ie(c,a.tolerance)?this.handleCancel():void 0}e.cancelable&&e.preventDefault(),i(l)}handleEnd(){const{onEnd:e}=this.props;this.detach(),e()}handleCancel(){const{onCancel:e}=this.props;this.detach(),e()}handleKeydown(e){e.code===Ne.Esc&&this.handleCancel()}removeTextSelection(){var e;null==(e=this.document.getSelection())||e.removeAllRanges()}}const Ve={move:{name:"pointermove"},end:{name:"pointerup"}};class Ye extends Ue{constructor(e){const{event:t}=e,n=M(t.target);super(e,Ve,n)}}Ye.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!(!n.isPrimary||0!==n.button||(null==r||r({event:n}),0))}}];const We={move:{name:"mousemove"},end:{name:"mouseup"}};var Xe;!function(e){e[e.RightClick=2]="RightClick"}(Xe||(Xe={})),class extends Ue{constructor(e){super(e,We,M(e.event.target))}}.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button!==Xe.RightClick&&(null==r||r({event:n}),!0)}}];const Ke={move:{name:"touchmove"},end:{name:"touchend"}};var He,qe;(class extends Ue{constructor(e){super(e,Ke)}static setup(){return window.addEventListener(Ke.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(Ke.move.name,e)};function e(){}}}).activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:o}=n;return!(o.length>1||(null==r||r({event:n}),0))}}],function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"}(He||(He={})),function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"}(qe||(qe={}));const Je={x:{[we.Backward]:!1,[we.Forward]:!1},y:{[we.Backward]:!1,[we.Forward]:!1}};var Ge,$e;!function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"}(Ge||(Ge={})),function(e){e.Optimized="optimized"}($e||($e={}));const Qe=new Map;function Ze(e,t){return _((n=>e?n||("function"==typeof t?t(e):e):null),[t,e])}function et(e){let{callback:t,disabled:n}=e;const r=z(t),o=(0,y.useMemo)((()=>{if(n||"undefined"==typeof window||void 0===window.ResizeObserver)return;const{ResizeObserver:e}=window;return new e(r)}),[n]);return(0,y.useEffect)((()=>()=>null==o?void 0:o.disconnect()),[o]),o}function tt(e){return new ke(fe(e),e)}function nt(e,t,n){void 0===t&&(t=tt);const[r,o]=(0,y.useReducer)((function(r){if(!e)return null;var o;if(!1===e.isConnected)return null!=(o=null!=r?r:n)?o:null;const i=t(e);return JSON.stringify(r)===JSON.stringify(i)?r:i}),null),i=function(e){let{callback:t,disabled:n}=e;const r=z(t),o=(0,y.useMemo)((()=>{if(n||"undefined"==typeof window||void 0===window.MutationObserver)return;const{MutationObserver:e}=window;return new e(r)}),[r,n]);return(0,y.useEffect)((()=>()=>null==o?void 0:o.disconnect()),[o]),o}({callback(t){if(e)for(const n of t){const{type:t,target:r}=n;if("childList"===t&&r instanceof HTMLElement&&r.contains(e)){o();break}}}}),a=et({callback:o});return I((()=>{o(),e?(null==a||a.observe(e),null==i||i.observe(document.body,{childList:!0,subtree:!0})):(null==a||a.disconnect(),null==i||i.disconnect())}),[e]),r}const rt=[];function ot(e,t){void 0===t&&(t=[]);const n=(0,y.useRef)(null);return(0,y.useEffect)((()=>{n.current=null}),t),(0,y.useEffect)((()=>{const t=e!==te;t&&!n.current&&(n.current=e),!t&&n.current&&(n.current=null)}),[e]),n.current?F(e,n.current):te}function it(e){return(0,y.useMemo)((()=>e?function(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}(e):null),[e])}const at=[];const lt=[{sensor:Ye,options:{}},{sensor:Le,options:{}}],ct={current:{}},st={draggable:{measure:pe},droppable:{measure:pe,strategy:Ge.WhileDragging,frequency:$e.Optimized},dragOverlay:{measure:fe}};class ut extends Map{get(e){var t;return null!=e&&null!=(t=super.get(e))?t:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter((e=>{let{disabled:t}=e;return!t}))}getNodeFor(e){var t,n;return null!=(t=null==(n=this.get(e))?void 0:n.node.current)?t:void 0}}const dt={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new ut,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:ee},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:st,measureDroppableContainers:ee,windowRect:null,measuringScheduled:!1},ft={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:ee,draggableNodes:new Map,over:null,measureDroppableContainers:ee},pt=(0,y.createContext)(ft),vt=(0,y.createContext)(dt);function ht(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new ut}}}function gt(e,t){switch(t.type){case Z.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case Z.DragMove:return e.draggable.active?{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}}:e;case Z.DragEnd:case Z.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Z.RegisterDroppable:{const{element:n}=t,{id:r}=n,o=new ut(e.droppable.containers);return o.set(r,n),{...e,droppable:{...e.droppable,containers:o}}}case Z.SetDroppableDisabled:{const{id:n,key:r,disabled:o}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;const a=new ut(e.droppable.containers);return a.set(n,{...i,disabled:o}),{...e,droppable:{...e.droppable,containers:a}}}case Z.UnregisterDroppable:{const{id:n,key:r}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const i=new ut(e.droppable.containers);return i.delete(n),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function mt(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:o}=(0,y.useContext)(pt),i=A(r),a=A(null==n?void 0:n.id);return(0,y.useEffect)((()=>{if(!t&&!r&&i&&null!=a){if(!U(i))return;if(document.activeElement===i.target)return;const e=o.get(a);if(!e)return;const{activatorNode:t,node:n}=e;if(!t.current&&!n.current)return;requestAnimationFrame((()=>{for(const e of[t.current,n.current]){if(!e)continue;const t=X(e);if(t){t.focus();break}}}))}}),[r,t,o,a,i]),null}const bt=(0,y.createContext)({...te,scaleX:1,scaleY:1});var yt;!function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"}(yt||(yt={}));const wt=(0,y.memo)((function(e){var t,n,r,o;let{id:i,accessibility:a,autoScroll:l=!0,children:c,sensors:s=lt,collisionDetection:u=le,measuring:d,modifiers:f,...p}=e;const v=(0,y.useReducer)(gt,void 0,ht),[h,g]=v,[m,b]=function(){const[e]=(0,y.useState)((()=>new Set)),t=(0,y.useCallback)((t=>(e.add(t),()=>e.delete(t))),[e]),n=(0,y.useCallback)((t=>{let{type:n,event:r}=t;e.forEach((e=>{var t;return null==(t=e[n])?void 0:t.call(e,r)}))}),[e]);return[n,t]}(),[C,D]=(0,y.useState)(yt.Uninitialized),S=C===yt.Initialized,{draggable:{active:k,nodes:M,translate:z},droppable:{containers:j}}=h,L=k?M.get(k):null,F=(0,y.useRef)({initial:null,translated:null}),U=(0,y.useMemo)((()=>{var e;return null!=k?{id:k,data:null!=(e=null==L?void 0:L.data)?e:ct,rect:F}:null}),[k,L]),Y=(0,y.useRef)(null),[W,X]=(0,y.useState)(null),[K,H]=(0,y.useState)(null),q=N(p,Object.values(p)),G=P("DndDescribedBy",i),$=(0,y.useMemo)((()=>j.getEnabled()),[j]),ee=(ne=d,(0,y.useMemo)((()=>({draggable:{...st.draggable,...null==ne?void 0:ne.draggable},droppable:{...st.droppable,...null==ne?void 0:ne.droppable},dragOverlay:{...st.dragOverlay,...null==ne?void 0:ne.dragOverlay}})),[null==ne?void 0:ne.draggable,null==ne?void 0:ne.droppable,null==ne?void 0:ne.dragOverlay]));var ne;const{droppableRects:re,measureDroppableContainers:oe,measuringScheduled:ie}=function(e,t){let{dragging:n,dependencies:r,config:o}=t;const[i,a]=(0,y.useState)(null),{frequency:l,measure:c,strategy:s}=o,u=(0,y.useRef)(e),d=function(){switch(s){case Ge.Always:return!1;case Ge.BeforeDragging:return n;default:return!n}}(),f=N(d),p=(0,y.useCallback)((function(e){void 0===e&&(e=[]),f.current||a((t=>null===t?e:t.concat(e.filter((e=>!t.includes(e))))))}),[f]),v=(0,y.useRef)(null),h=_((t=>{if(d&&!n)return Qe;if(!t||t===Qe||u.current!==e||null!=i){const t=new Map;for(let n of e){if(!n)continue;if(i&&i.length>0&&!i.includes(n.id)&&n.rect.current){t.set(n.id,n.rect.current);continue}const e=n.node.current,r=e?new ke(c(e),e):null;n.rect.current=r,r&&t.set(n.id,r)}return t}return t}),[e,i,n,d,c]);return(0,y.useEffect)((()=>{u.current=e}),[e]),(0,y.useEffect)((()=>{d||p()}),[n,d]),(0,y.useEffect)((()=>{i&&i.length>0&&a(null)}),[JSON.stringify(i)]),(0,y.useEffect)((()=>{d||"number"!=typeof l||null!==v.current||(v.current=setTimeout((()=>{p(),v.current=null}),l))}),[l,d,p,...r]),{droppableRects:h,measureDroppableContainers:p,measuringScheduled:null!=i}}($,{dragging:S,dependencies:[z.x,z.y],config:ee.droppable}),ae=function(e,t){const n=null!==t?e.get(t):void 0,r=n?n.node.current:null;return _((e=>{var n;return null===t?null:null!=(n=null!=r?r:e)?n:null}),[r,t])}(M,k),se=(0,y.useMemo)((()=>K?V(K):null),[K]),de=function(){const e=!1===(null==W?void 0:W.autoScrollEnabled),t="object"==typeof l?!1===l.enabled:!1===l,n=S&&!e&&!t;return"object"==typeof l?{...l,enabled:n}:{enabled:n}}(),pe=function(e,t){return Ze(e,t)}(ae,ee.draggable.measure);!function(e){let{activeNode:t,measure:n,initialRect:r,config:o=!0}=e;const i=(0,y.useRef)(!1),{x:a,y:l}="boolean"==typeof o?{x:o,y:o}:o;I((()=>{if(!a&&!l||!t)return void(i.current=!1);if(i.current||!r)return;const e=null==t?void 0:t.node.current;if(!e||!1===e.isConnected)return;const o=ce(n(e),r);if(a||(o.x=0),l||(o.y=0),i.current=!0,Math.abs(o.x)>0||Math.abs(o.y)>0){const t=he(e);t&&t.scrollBy({top:o.y,left:o.x})}}),[t,a,l,r,n])}({activeNode:k?M.get(k):null,config:de.layoutShiftCompensation,initialRect:pe,measure:ee.draggable.measure});const me=nt(ae,ee.draggable.measure,pe),be=nt(ae?ae.parentElement:null),Ee=(0,y.useRef)({activatorEvent:null,active:null,activeNode:ae,collisionRect:null,collisions:null,droppableRects:re,draggableNodes:M,draggingNode:null,draggingNodeRect:null,droppableContainers:j,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Ce=j.getNodeFor(null==(t=Ee.current.over)?void 0:t.id),Re=function(e){let{measure:t}=e;const[n,r]=(0,y.useState)(null),o=et({callback:(0,y.useCallback)((e=>{for(const{target:n}of e)if(O(n)){r((e=>{const r=t(n);return e?{...e,width:r.width,height:r.height}:r}));break}}),[t])}),i=(0,y.useCallback)((e=>{const n=function(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return O(t)?t:e}(e);null==o||o.disconnect(),n&&(null==o||o.observe(n)),r(n?t(n):null)}),[t,o]),[a,l]=T(i);return(0,y.useMemo)((()=>({nodeRef:a,rect:n,setRef:l})),[n,a,l])}({measure:ee.dragOverlay.measure}),Oe=null!=(n=Re.nodeRef.current)?n:ae,Me=S?null!=(r=Re.rect)?r:me:null,Ie=Boolean(Re.nodeRef.current&&Re.rect),ze=ce(Ne=Ie?null:me,Ze(Ne));var Ne;const _e=it(Oe?R(Oe):null),Te=function(e){const t=(0,y.useRef)(e),n=_((n=>e?n&&n!==rt&&e&&t.current&&e.parentNode===t.current.parentNode?n:ve(e):rt),[e]);return(0,y.useEffect)((()=>{t.current=e}),[e]),n}(S?null!=Ce?Ce:ae:null),Ae=function(e,t){void 0===t&&(t=fe);const[n]=e,r=it(n?R(n):null),[o,i]=(0,y.useReducer)((function(){return e.length?e.map((e=>xe(e)?r:new ke(t(e),e))):at}),at),a=et({callback:i});return e.length>0&&o===at&&i(),I((()=>{e.length?e.forEach((e=>null==a?void 0:a.observe(e))):(null==a||a.disconnect(),i())}),[e]),o}(Te),je=function(e,t){let{transform:n,...r}=t;return null!=e&&e.length?e.reduce(((e,t)=>t({transform:e,...r})),n):n}(f,{transform:{x:z.x-ze.x,y:z.y-ze.y,scaleX:1,scaleY:1},activatorEvent:K,active:U,activeNodeRect:me,containerNodeRect:be,draggingNodeRect:Me,over:Ee.current.over,overlayNodeRect:Re.rect,scrollableAncestors:Te,scrollableAncestorRects:Ae,windowRect:_e}),Pe=se?B(se,z):null,Le=function(e){const[t,n]=(0,y.useState)(null),r=(0,y.useRef)(e),o=(0,y.useCallback)((e=>{const t=ge(e.target);t&&n((e=>e?(e.set(t,ye(t)),new Map(e)):null))}),[]);return(0,y.useEffect)((()=>{const t=r.current;if(e!==t){i(t);const a=e.map((e=>{const t=ge(e);return t?(t.addEventListener("scroll",o,{passive:!0}),[t,ye(t)]):null})).filter((e=>null!=e));n(a.length?new Map(a):null),r.current=e}return()=>{i(e),i(t)};function i(e){e.forEach((e=>{const t=ge(e);null==t||t.removeEventListener("scroll",o)}))}}),[o,e]),(0,y.useMemo)((()=>e.length?t?Array.from(t.values()).reduce(((e,t)=>B(e,t)),te):Se(e):te),[e,t])}(Te),Be=ot(Le),Fe=ot(Le,[me]),Ue=B(je,Be),Ve=Me?ue(Me,je):null,Ye=U&&Ve?u({active:U,collisionRect:Ve,droppableRects:re,droppableContainers:$,pointerCoordinates:Pe}):null,We=function(e){if(!e||0===e.length)return null;const[t]=e;return t.id}(Ye),[Xe,Ke]=(0,y.useState)(null),$e=function(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}(Ie?je:B(je,Fe),null!=(o=null==Xe?void 0:Xe.rect)?o:null,me),tt=(0,y.useCallback)(((e,t)=>{let{sensor:n,options:r}=t;if(null==Y.current)return;const o=M.get(Y.current);if(!o)return;const i=e.nativeEvent,a=new n({active:Y.current,activeNode:o,event:i,options:r,context:Ee,onStart(e){const t=Y.current;if(null==t)return;const n=M.get(t);if(!n)return;const{onDragStart:r}=q.current,o={active:{id:t,data:n.data,rect:F}};(0,x.unstable_batchedUpdates)((()=>{null==r||r(o),D(yt.Initializing),g({type:Z.DragStart,initialCoordinates:e,active:t}),m({type:"onDragStart",event:o})}))},onMove(e){g({type:Z.DragMove,coordinates:e})},onEnd:l(Z.DragEnd),onCancel:l(Z.DragCancel)});function l(e){return async function(){const{active:t,collisions:n,over:r,scrollAdjustedTranslate:o}=Ee.current;let a=null;if(t&&o){const{cancelDrop:l}=q.current;a={activatorEvent:i,active:t,collisions:n,delta:o,over:r},e===Z.DragEnd&&"function"==typeof l&&await Promise.resolve(l(a))&&(e=Z.DragCancel)}Y.current=null,(0,x.unstable_batchedUpdates)((()=>{g({type:e}),D(yt.Uninitialized),Ke(null),X(null),H(null);const t=e===Z.DragEnd?"onDragEnd":"onDragCancel";if(a){const e=q.current[t];null==e||e(a),m({type:t,event:a})}}))}}(0,x.unstable_batchedUpdates)((()=>{X(a),H(e.nativeEvent)}))}),[M]),ut=(0,y.useCallback)(((e,t)=>(n,r)=>{const o=n.nativeEvent,i=M.get(r);if(null!==Y.current||!i||o.dndKit||o.defaultPrevented)return;const a={active:i};!0===e(n,t.options,a)&&(o.dndKit={capturedBy:t.sensor},Y.current=r,tt(n,t))}),[M,tt]),dt=function(e,t){return(0,y.useMemo)((()=>e.reduce(((e,n)=>{const{sensor:r}=n;return[...e,...r.activators.map((e=>({eventName:e.eventName,handler:t(e.handler,n)})))]}),[])),[e,t])}(s,ut);!function(e){(0,y.useEffect)((()=>{if(!E)return;const t=e.map((e=>{let{sensor:t}=e;return null==t.setup?void 0:t.setup()}));return()=>{for(const e of t)null==e||e()}}),e.map((e=>{let{sensor:t}=e;return t})))}(s),I((()=>{me&&C===yt.Initializing&&D(yt.Initialized)}),[me,C]),(0,y.useEffect)((()=>{const{onDragMove:e}=q.current,{active:t,activatorEvent:n,collisions:r,over:o}=Ee.current;if(!t||!n)return;const i={active:t,activatorEvent:n,collisions:r,delta:{x:Ue.x,y:Ue.y},over:o};(0,x.unstable_batchedUpdates)((()=>{null==e||e(i),m({type:"onDragMove",event:i})}))}),[Ue.x,Ue.y]),(0,y.useEffect)((()=>{const{active:e,activatorEvent:t,collisions:n,droppableContainers:r,scrollAdjustedTranslate:o}=Ee.current;if(!e||null==Y.current||!t||!o)return;const{onDragOver:i}=q.current,a=r.get(We),l=a&&a.rect.current?{id:a.id,rect:a.rect.current,data:a.data,disabled:a.disabled}:null,c={active:e,activatorEvent:t,collisions:n,delta:{x:o.x,y:o.y},over:l};(0,x.unstable_batchedUpdates)((()=>{Ke(l),null==i||i(c),m({type:"onDragOver",event:c})}))}),[We]),I((()=>{Ee.current={activatorEvent:K,active:U,activeNode:ae,collisionRect:Ve,collisions:Ye,droppableRects:re,draggableNodes:M,draggingNode:Oe,draggingNodeRect:Me,droppableContainers:j,over:Xe,scrollableAncestors:Te,scrollAdjustedTranslate:Ue},F.current={initial:Me,translated:Ve}}),[U,ae,Ye,Ve,M,Oe,Me,re,j,Xe,Te,Ue]),function(e){let{acceleration:t,activator:n=He.Pointer,canScroll:r,draggingRect:o,enabled:i,interval:a=5,order:l=qe.TreeOrder,pointerCoordinates:c,scrollableAncestors:s,scrollableAncestorRects:u,delta:d,threshold:f}=e;const p=function(e){let{delta:t,disabled:n}=e;const r=A(t);return _((e=>{if(n||!r||!e)return Je;const o=Math.sign(t.x-r.x),i=Math.sign(t.y-r.y);return{x:{[we.Backward]:e.x[we.Backward]||-1===o,[we.Forward]:e.x[we.Forward]||1===o},y:{[we.Backward]:e.y[we.Backward]||-1===i,[we.Forward]:e.y[we.Forward]||1===i}}}),[n,t,r])}({delta:d,disabled:!i}),[v,h]=function(){const e=(0,y.useRef)(null);return[(0,y.useCallback)(((t,n)=>{e.current=setInterval(t,n)}),[]),(0,y.useCallback)((()=>{null!==e.current&&(clearInterval(e.current),e.current=null)}),[])]}(),g=(0,y.useRef)({x:0,y:0}),m=(0,y.useRef)({x:0,y:0}),b=(0,y.useMemo)((()=>{switch(n){case He.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case He.DraggableRect:return o}}),[n,o,c]),w=(0,y.useRef)(null),x=(0,y.useCallback)((()=>{const e=w.current;if(!e)return;const t=g.current.x*m.current.x,n=g.current.y*m.current.y;e.scrollBy(t,n)}),[]),E=(0,y.useMemo)((()=>l===qe.TreeOrder?[...s].reverse():s),[l,s]);(0,y.useEffect)((()=>{if(i&&s.length&&b){for(const e of E){if(!1===(null==r?void 0:r(e)))continue;const n=s.indexOf(e),o=u[n];if(!o)continue;const{direction:i,speed:l}=De(e,o,b,t,f);for(const e of["x","y"])p[e][i[e]]||(l[e]=0,i[e]=0);if(l.x>0||l.y>0)return h(),w.current=e,v(x,a),g.current=l,void(m.current=i)}g.current={x:0,y:0},m.current={x:0,y:0},h()}else h()}),[t,x,r,h,i,a,JSON.stringify(b),JSON.stringify(p),v,s,E,u,JSON.stringify(f)])}({...de,delta:z,draggingRect:Ve,pointerCoordinates:Pe,scrollableAncestors:Te,scrollableAncestorRects:Ae});const ft=(0,y.useMemo)((()=>({active:U,activeNode:ae,activeNodeRect:me,activatorEvent:K,collisions:Ye,containerNodeRect:be,dragOverlay:Re,draggableNodes:M,droppableContainers:j,droppableRects:re,over:Xe,measureDroppableContainers:oe,scrollableAncestors:Te,scrollableAncestorRects:Ae,measuringConfiguration:ee,measuringScheduled:ie,windowRect:_e})),[U,ae,me,K,Ye,be,Re,M,j,re,Xe,oe,Te,Ae,ee,ie,_e]),wt=(0,y.useMemo)((()=>({activatorEvent:K,activators:dt,active:U,activeNodeRect:me,ariaDescribedById:{draggable:G},dispatch:g,draggableNodes:M,over:Xe,measureDroppableContainers:oe})),[K,dt,U,me,g,G,M,Xe,oe]);return w().createElement(J.Provider,{value:b},w().createElement(pt.Provider,{value:wt},w().createElement(vt.Provider,{value:ft},w().createElement(bt.Provider,{value:$e},c)),w().createElement(mt,{disabled:!1===(null==a?void 0:a.restoreFocus)})),w().createElement(Q,{...a,hiddenTextDescribedById:G}))})),xt=(0,y.createContext)(null),Et="button";const Ct={timeout:25};function Dt(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function Rt(e,t){return e.reduce(((e,n,r)=>{const o=t.get(n);return o&&(e[r]=o),e}),Array(e.length))}function St(e){return null!==e&&e>=0}const Ot=e=>{let{rects:t,activeIndex:n,overIndex:r,index:o}=e;const i=Dt(t,r,n),a=t[o],l=i[o];return l&&a?{x:l.left-a.left,y:l.top-a.top,scaleX:l.width/a.width,scaleY:l.height/a.height}:null},kt={scaleX:1,scaleY:1},Mt=e=>{var t;let{activeIndex:n,activeNodeRect:r,index:o,rects:i,overIndex:a}=e;const l=null!=(t=i[n])?t:r;if(!l)return null;if(o===n){const e=i[a];return e?{x:0,y:nn&&o<=a?{x:0,y:-l.height-c,...kt}:o=a?{x:0,y:l.height+c,...kt}:{x:0,y:0,...kt}},It="Sortable",zt=w().createContext({activeIndex:-1,containerId:It,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Ot,disabled:{draggable:!1,droppable:!1}});function Nt(e){let{children:t,id:n,items:r,strategy:o=Ot,disabled:i=!1}=e;const{active:a,dragOverlay:l,droppableRects:c,over:s,measureDroppableContainers:u}=(0,y.useContext)(vt),d=P(It,n),f=Boolean(null!==l.rect),p=(0,y.useMemo)((()=>r.map((e=>"object"==typeof e&&"id"in e?e.id:e))),[r]),v=null!=a,h=a?p.indexOf(a.id):-1,g=s?p.indexOf(s.id):-1,m=(0,y.useRef)(p),b=!function(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n{b&&v&&u(p)}),[b,p,v,u]),(0,y.useEffect)((()=>{m.current=p}),[p]);const C=(0,y.useMemo)((()=>({activeIndex:h,containerId:d,disabled:E,disableTransforms:x,items:p,overIndex:g,useDragOverlay:f,sortedRects:Rt(p,c),strategy:o})),[h,d,E.draggable,E.droppable,x,p,g,c,f,o]);return w().createElement(zt.Provider,{value:C},t)}const _t=e=>{let{id:t,items:n,activeIndex:r,overIndex:o}=e;return Dt(n,r,o).indexOf(t)},Tt=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:o,items:i,newIndex:a,previousItems:l,previousContainerId:c,transition:s}=e;return!(!s||!r||l!==i&&o===a||!n&&(a===o||t!==c))},At={duration:200,easing:"ease"},jt="transform",Pt=Y.Transition.toString({property:jt,duration:0,easing:"linear"}),Lt={roleDescription:"sortable"};function Bt(e){let{animateLayoutChanges:t=Tt,attributes:n,disabled:r,data:o,getNewIndex:i=_t,id:a,strategy:l,resizeObserverConfig:c,transition:s=At}=e;const{items:u,containerId:d,activeIndex:f,disabled:p,disableTransforms:v,sortedRects:h,overIndex:g,useDragOverlay:m,strategy:b}=(0,y.useContext)(zt),w=function(e,t){var n,r;return"boolean"==typeof e?{draggable:e,droppable:!1}:{draggable:null!=(n=null==e?void 0:e.draggable)?n:t.draggable,droppable:null!=(r=null==e?void 0:e.droppable)?r:t.droppable}}(r,p),x=u.indexOf(a),E=(0,y.useMemo)((()=>({sortable:{containerId:d,index:x,items:u},...o})),[d,o,x,u]),C=(0,y.useMemo)((()=>u.slice(u.indexOf(a))),[u,a]),{rect:D,node:R,isOver:S,setNodeRef:O}=function(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:o}=e;const i=P("Droppable"),{active:a,dispatch:l,over:c,measureDroppableContainers:s}=(0,y.useContext)(pt),u=(0,y.useRef)({disabled:n}),d=(0,y.useRef)(!1),f=(0,y.useRef)(null),p=(0,y.useRef)(null),{disabled:v,updateMeasurementsFor:h,timeout:g}={...Ct,...o},m=N(null!=h?h:r),b=et({callback:(0,y.useCallback)((()=>{d.current?(null!=p.current&&clearTimeout(p.current),p.current=setTimeout((()=>{s(Array.isArray(m.current)?m.current:[m.current]),p.current=null}),g)):d.current=!0}),[g]),disabled:v||!a}),w=(0,y.useCallback)(((e,t)=>{b&&(t&&(b.unobserve(t),d.current=!1),e&&b.observe(e))}),[b]),[x,E]=T(w),C=N(t);return(0,y.useEffect)((()=>{b&&x.current&&(b.disconnect(),d.current=!1,b.observe(x.current))}),[x,b]),I((()=>(l({type:Z.RegisterDroppable,element:{id:r,key:i,disabled:n,node:x,rect:f,data:C}}),()=>l({type:Z.UnregisterDroppable,key:i,id:r}))),[r]),(0,y.useEffect)((()=>{n!==u.current.disabled&&(l({type:Z.SetDroppableDisabled,id:r,key:i,disabled:n}),u.current.disabled=n)}),[r,i,n,l]),{active:a,rect:f,isOver:(null==c?void 0:c.id)===r,node:x,over:c,setNodeRef:E}}({id:a,data:E,disabled:w.droppable,resizeObserverConfig:{updateMeasurementsFor:C,...c}}),{active:k,activatorEvent:M,activeNodeRect:z,attributes:_,setNodeRef:A,listeners:j,isDragging:L,over:B,setActivatorNodeRef:F,transform:V}=function(e){let{id:t,data:n,disabled:r=!1,attributes:o}=e;const i=P("Droppable"),{activators:a,activatorEvent:l,active:c,activeNodeRect:s,ariaDescribedById:u,draggableNodes:d,over:f}=(0,y.useContext)(pt),{role:p=Et,roleDescription:v="draggable",tabIndex:h=0}=null!=o?o:{},g=(null==c?void 0:c.id)===t,m=(0,y.useContext)(g?bt:xt),[b,w]=T(),[x,E]=T(),C=function(e,t){return(0,y.useMemo)((()=>e.reduce(((e,n)=>{let{eventName:r,handler:o}=n;return e[r]=e=>{o(e,t)},e}),{})),[e,t])}(a,t),D=N(n);return I((()=>(d.set(t,{id:t,key:i,node:b,activatorNode:x,data:D}),()=>{const e=d.get(t);e&&e.key===i&&d.delete(t)})),[d,t]),{active:c,activatorEvent:l,activeNodeRect:s,attributes:(0,y.useMemo)((()=>({role:p,tabIndex:h,"aria-disabled":r,"aria-pressed":!(!g||p!==Et)||void 0,"aria-roledescription":v,"aria-describedby":u.draggable})),[r,p,h,g,v,u.draggable]),isDragging:g,listeners:r?void 0:C,node:b,over:f,setNodeRef:w,setActivatorNodeRef:E,transform:m}}({id:a,data:E,attributes:{...Lt,...n},disabled:w.draggable}),W=function(){for(var e=arguments.length,t=new Array(e),n=0;ne=>{t.forEach((t=>t(e)))}),t)}(O,A),X=Boolean(k),K=X&&!v&&St(f)&&St(g),H=!m&&L,q=H&&K?V:null,J=K?null!=q?q:(null!=l?l:b)({rects:h,activeNodeRect:z,activeIndex:f,overIndex:g,index:x}):null,G=St(f)&&St(g)?i({id:a,items:u,activeIndex:f,overIndex:g}):x,$=null==k?void 0:k.id,Q=(0,y.useRef)({activeId:$,items:u,newIndex:G,containerId:d}),ee=u!==Q.current.items,te=t({active:k,containerId:d,isDragging:L,isSorting:X,id:a,index:x,items:u,newIndex:Q.current.newIndex,previousItems:Q.current.items,previousContainerId:Q.current.containerId,transition:s,wasDragging:null!=Q.current.activeId}),ne=function(e){let{disabled:t,index:n,node:r,rect:o}=e;const[i,a]=(0,y.useState)(null),l=(0,y.useRef)(n);return I((()=>{if(!t&&n!==l.current&&r.current){const e=o.current;if(e){const t=fe(r.current,{ignoreTransform:!0}),n={x:e.left-t.left,y:e.top-t.top,scaleX:e.width/t.width,scaleY:e.height/t.height};(n.x||n.y)&&a(n)}}n!==l.current&&(l.current=n)}),[t,n,r,o]),(0,y.useEffect)((()=>{i&&a(null)}),[i]),i}({disabled:!te,index:x,node:R,rect:D});return(0,y.useEffect)((()=>{X&&Q.current.newIndex!==G&&(Q.current.newIndex=G),d!==Q.current.containerId&&(Q.current.containerId=d),u!==Q.current.items&&(Q.current.items=u)}),[X,G,d,u]),(0,y.useEffect)((()=>{if($===Q.current.activeId)return;if($&&!Q.current.activeId)return void(Q.current.activeId=$);const e=setTimeout((()=>{Q.current.activeId=$}),50);return()=>clearTimeout(e)}),[$]),{active:k,activeIndex:f,attributes:_,data:E,rect:D,index:x,newIndex:G,items:u,isOver:S,isSorting:X,isDragging:L,listeners:j,node:R,overIndex:g,over:B,setNodeRef:W,setActivatorNodeRef:F,setDroppableNodeRef:O,setDraggableNodeRef:A,transform:null!=ne?ne:J,transition:ne||ee&&Q.current.newIndex===x?Pt:H&&!U(M)||!s?void 0:X||te?Y.Transition.toString({...s,property:jt}):void 0}}Ne.Down,Ne.Right,Ne.Up,Ne.Left;const Ft=window.wp.compose;function Ut(e){return Ut="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},Ut(e)}function Vt(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=Array(t);ne.controlData.rows_min?wp.element.createElement("button",{className:"lzb-gutenberg-repeater-btn-remove",onClick:e.onRemove},wp.element.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},wp.element.createElement("path",{d:"M3 6h18"}),wp.element.createElement("path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"}),wp.element.createElement("path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"}),wp.element.createElement("line",{x1:"10",x2:"10",y1:"11",y2:"17"}),wp.element.createElement("line",{x1:"14",x2:"14",y1:"11",y2:"17"}))):null,wp.element.createElement("div",{className:"lzb-gutenberg-repeater-btn-arrow"},wp.element.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-hidden":"true",focusable:"false"},wp.element.createElement("path",{d:"M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"})))),e.active?e.renderContent():"")};const Qt=(0,Ft.withInstanceId)((function(e){var t,n,r=e.count,o=void 0===r?0:r,a=e.controlData,s=e.renderRow,u=void 0===s?function(){}:s,d=e.addRow,f=void 0===d?function(){}:d,p=e.duplicateRow,v=void 0===p?function(){}:p,h=e.removeRow,g=void 0===h?function(){}:h,m=e.resortRow,b=void 0===m?function(){}:m,w=e.getInnerControls,x=void 0===w?function(){}:w,E=function(){for(var e=arguments.length,t=new Array(e),n=0;n[...t].filter((e=>null!=e))),[...t])}((t=Ht,(0,y.useMemo)((()=>({sensor:t,options:{}})),[t,n]))),C=-1;("false"===a.rows_collapsible||"false"===a.rows_collapsed)&&(C=-2);var D,R,S=(D=(0,l.useState)(C),R=2,function(e){if(Array.isArray(e))return e}(D)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,l=[],c=!0,s=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(e){s=!0,o=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(s)throw o}}return l}}(D,R)||function(e,t){if(e){if("string"==typeof e)return Jt(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)?Jt(e,t):void 0}}(D,R)||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.")}()),O=S[0],k=S[1];function M(e){var t=["alt","url","title","caption","description","id","link"],n=a.rows_label||(0,i.__)("Row {{#}}","lazy-blocks");n=n.replace(/{{#}}/g,e+1);var r=x(e);return r&&Object.keys(r).forEach((function(e){var o=r[e].data,i=r[e].val||"";"object"===qt(i)&&t.forEach((function(e){n=n.replace(new RegExp("{{".concat(o.name,".").concat(e,"}}"),"g"),i[e]||"")})),"image"===o.type&&i.url&&(i='')),"object"===qt(i)&&(i=""),n=n.replace(new RegExp("{{".concat(o.name,"}}"),"g"),i)})),n}(0,l.useEffect)((function(){if(a.rows_min&&a.rows_min>0&&a.rows_min>o)for(var e=a.rows_min-o,t=0;t-1&&k(n.id-1))}},I.length?wp.element.createElement("div",{className:"lzb-gutenberg-repeater-items"},wp.element.createElement(Nt,{items:I,strategy:Mt},I.map((function(e){return wp.element.createElement($t,Gt({key:"lzb-constructor-controls-items-sortable-".concat(e.id)},e))})))):null),wp.element.createElement(c.ButtonGroup,{className:"lzb-gutenberg-repeater-options"},wp.element.createElement(c.Button,{variant:"secondary",size:"compact",className:"lzb-gutenberg-repeater-options-add",disabled:a.rows_max&&o>=a.rows_max,onClick:function(){f(),-2!==O&&k(I.length)}},a.rows_add_button_label||(0,i.__)("+ Add Row","lazy-blocks")),"true"===a.rows_collapsible&&I.length&&I.length>1?wp.element.createElement(c.Tooltip,{text:(0,i.__)("Toggle all rows","lazy-blocks")},wp.element.createElement(c.Button,{variant:-2===O?"primary":"secondary",size:"compact",className:"lzb-gutenberg-repeater-options-expand",onClick:function(){k(-2===O?-1:-2)}},wp.element.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},wp.element.createElement("path",{d:"m7 15 5 5 5-5"}),wp.element.createElement("path",{d:"m7 9 5-5 5 5"})))):""))}));function Zt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n1&&void 0!==arguments[1]?arguments[1]:{},r=n.className,i=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.includes(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r-1&&(r.splice(e,1),n.onChange(r),a&&a())},addRow:function(){var e=n.getControls(n.uniqueId),t={};Object.keys(e).forEach((function(n){var r=e[n];t[r.name]=r.default||r.checked||""})),r.push(t),n.onChange(r),a&&a()},duplicateRow:function(o){r.push((0,e.cloneDeep)(r[o]));var i=t(r,r.length-1,o+1);n.onChange(i),a&&a()},resortRow:function(e,o){var i=t(r,e,o);n.onChange(i),a&&a()}}))}function nn(e){var t,n,r=e.printControls,a=e.id,c=e.controls,s=(t=(0,l.useState)(!1),n=2,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,l=[],c=!0,s=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(e){s=!0,o=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(s)throw o}}return l}}(t,n)||function(e,t){if(e){if("string"==typeof e)return Zt(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)?Zt(e,t):void 0}}(t,n)||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.")}()),u=s[0],d=s[1],f=0;Object.keys(c).forEach((function(e){c[e].child_of===a&&(f+=1)}));var p=(0,i.__)("Show Child Controls","lazy-blocks");return u?p=(0,i.__)("Hide Child Controls","lazy-blocks"):f&&(p=(0,i.sprintf)( // translators: %d: number of child controls. // translators: %d: number of child controls. (0,i._n)("Show %d Child Control","Show %d Child Controls",f,"lazy-blocks"),f)),wp.element.createElement(wp.element.Fragment,null,wp.element.createElement("button",{className:o()("lzb-constructor-controls-item-repeater-toggle",u?"lzb-constructor-controls-item-repeater-toggle-collapsed":""),onClick:function(e){e.stopPropagation(),e.preventDefault(),d(!u)}},p,wp.element.createElement("svg",{"aria-hidden":"true",focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 320 512"},wp.element.createElement("path",{fill:"currentColor",d:"M285.476 272.971L91.132 467.314c-9.373 9.373-24.569 9.373-33.941 0l-22.667-22.667c-9.357-9.357-9.375-24.522-.04-33.901L188.505 256 34.484 101.255c-9.335-9.379-9.317-24.544.04-33.901l22.667-22.667c9.373-9.373 24.569-9.373 33.941 0L285.475 239.03c9.373 9.372 9.373 24.568.001 33.941z"}))),u?wp.element.createElement("div",{className:"lzb-constructor-controls-item-childs"},r(a)):"")}(0,a.addFilter)("lzb.editor.control.repeater.render","lzb.editor",(function(e,t){return wp.element.createElement(tn,t)})),(0,a.addFilter)("lzb.editor.control.repeater.getValue","lzb.editor",(function(e){if("string"==typeof e)try{e=e.includes(":")?JSON.parse(decodeURI(e)):JSON.parse(decodeURIComponent(e))}catch(t){e=[]}return e})),(0,a.addFilter)("lzb.editor.control.repeater.updateValue","lzb.editor",(function(e){return("object"===en(e)||Array.isArray(e))&&(e=encodeURI(JSON.stringify(e))),e})),(0,a.addFilter)("lzb.constructor.controls.repeater.item","lzb.constructor",(function(e,t){return wp.element.createElement(wp.element.Fragment,null,e,wp.element.createElement(nn,t))})),(0,a.addFilter)("lzb.constructor.control.repeater.settings","lzb.constructor",(function(e,t){var n=t.updateData,r=t.data;return wp.element.createElement(wp.element.Fragment,null,wp.element.createElement(c.PanelBody,null,wp.element.createElement(c.TextControl,{label:(0,i.__)("Row Label","lazy-blocks"),placeholder:(0,i.__)("Row {{#}}","lazy-blocks"),help:(0,i.__)('Example: "My row number {{#}} with inner control {{control_name}}"',"lazy-blocks"),value:r.rows_label,onChange:function(e){return n({rows_label:e})}})),wp.element.createElement(c.PanelBody,null,wp.element.createElement(c.TextControl,{label:(0,i.__)("Add Button Label","lazy-blocks"),placeholder:(0,i.__)("+ Add Row","lazy-blocks"),value:r.rows_add_button_label,onChange:function(e){return n({rows_add_button_label:e})}})),wp.element.createElement(c.PanelBody,null,wp.element.createElement(c.TextControl,{type:"number",label:(0,i.__)("Minimum Rows","lazy-blocks"),placeholder:0,min:0,value:r.rows_min,onChange:function(e){return n({rows_min:e})}})),wp.element.createElement(c.PanelBody,null,wp.element.createElement(c.TextControl,{type:"number",label:(0,i.__)("Maximum Rows","lazy-blocks"),placeholder:0,min:0,value:r.rows_max,onChange:function(e){return n({rows_max:e})}})),wp.element.createElement(c.PanelBody,null,wp.element.createElement(f,{id:"lazyblocks-control-repeater-collapsible",label:(0,i.__)("Collapsible Rows","lazy-blocks")},wp.element.createElement(c.ToggleControl,{id:"lazyblocks-control-repeater-collapsible",label:(0,i.__)("Yes","lazy-blocks"),checked:"true"===r.rows_collapsible,onChange:function(e){return n({rows_collapsible:e?"true":"false"})}}),"true"===r.rows_collapsible?wp.element.createElement(c.ToggleControl,{label:(0,i.__)("Collapsed by Default","lazy-blocks"),checked:"true"===r.rows_collapsed,onChange:function(e){return n({rows_collapsed:e?"true":"false"})}}):"")))}))})()})(); \ No newline at end of file diff --git a/build/editor.asset.php b/build/editor.asset.php index c9ab6b14..6ffa8c5c 100644 --- a/build/editor.asset.php +++ b/build/editor.asset.php @@ -1 +1 @@ - array('lodash', 'react', 'react-dom', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-element', 'wp-hooks', 'wp-i18n'), 'version' => 'c748fc0fe9b6034cc671'); \ No newline at end of file + array('lodash', 'react', 'react-dom', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-element', 'wp-hooks', 'wp-i18n'), 'version' => '85c38b9fdbb50e1b08b4'); diff --git a/controls/repeater/script.js b/controls/repeater/script.js index 7abcdfc6..106abcdc 100644 --- a/controls/repeater/script.js +++ b/controls/repeater/script.js @@ -56,6 +56,7 @@ function RepeaterControlWrapper(props) { <> {props.renderControls( props.placement, + props.group, props.uniqueId, index )}