forked from bombastictranz/awesome
-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
991-31f60a9cfbd3daef.js.download
125 lines (111 loc) · 50.3 KB
/
991-31f60a9cfbd3daef.js.download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[991],{23094:function(e,t,n){n.d(t,{LB:function(){return qe},y9:function(){return at},MA:function(){return ce},LO:function(){return de},Cj:function(){return We},IJ:function(){return d},O1:function(){return Ye},Zj:function(){return Ke},VT:function(){return b},Dy:function(){return m}});var r=n(2784),o=n(28316),i=n(82851);const a={display:"none"};function l(e){let{id:t,value:n}=e;return r.createElement("div",{id:t,style:a},n)}const s={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"};function c(e){let{id:t,announcement:n}=e;return r.createElement("div",{id:t,style:s,role:"status","aria-live":"assertive","aria-atomic":!0},n)}const u=(0,r.createContext)(null);function d(e){const t=(0,r.useContext)(u);(0,r.useEffect)((()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)}),[e,t])}const f={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 "},h={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 v(e){let{announcements:t=h,container:n,hiddenTextDescribedById:a,screenReaderInstructions:s=f}=e;const{announce:u,announcement:v}=function(){const[e,t]=(0,r.useState)("");return{announce:(0,r.useCallback)((e=>{null!=e&&t(e)}),[]),announcement:e}}(),g=(0,i.Ld)("DndLiveRegion"),[p,b]=(0,r.useState)(!1);if((0,r.useEffect)((()=>{b(!0)}),[]),d((0,r.useMemo)((()=>({onDragStart(e){let{active:n}=e;u(t.onDragStart({active:n}))},onDragMove(e){let{active:n,over:r}=e;t.onDragMove&&u(t.onDragMove({active:n,over:r}))},onDragOver(e){let{active:n,over:r}=e;u(t.onDragOver({active:n,over:r}))},onDragEnd(e){let{active:n,over:r}=e;u(t.onDragEnd({active:n,over:r}))},onDragCancel(e){let{active:n,over:r}=e;u(t.onDragCancel({active:n,over:r}))}})),[u,t])),!p)return null;const m=r.createElement(r.Fragment,null,r.createElement(l,{id:a,value:s.draggable}),r.createElement(c,{id:g,announcement:v}));return n?(0,o.createPortal)(m,n):m}var g;function p(){}function b(e,t){return(0,r.useMemo)((()=>({sensor:e,options:null!=t?t:{}})),[e,t])}function m(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return(0,r.useMemo)((()=>[...t].filter((e=>null!=e))),[...t])}!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"}(g||(g={}));const y=Object.freeze({x:0,y:0});function w(e,t){const n=(0,i.DC)(e);if(!n)return"0 0";return(n.x-t.left)/t.width*100+"% "+(n.y-t.top)/t.height*100+"%"}function x(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function C(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<o&&n<i){const n=t.width*t.height,r=e.width*e.height,o=a*l;return Number((o/(n+r-o)).toFixed(4))}return 0}const E=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=[];for(const i of r){const{id:e}=i,r=n.get(e);if(r){const n=C(r,t);n>0&&o.push({id:e,data:{droppableContainer:i,value:n}})}}return o.sort(x)};function D(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:y}function R(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.reduce(((t,n)=>({...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 S=R(1);function k(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}const T={ignoreTransform:!1};function M(e,t){void 0===t&&(t=T);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:t,transformOrigin:r}=(0,i.Jj)(e).getComputedStyle(e);t&&(n=function(e,t,n){const r=k(t);if(!r)return e;const{scaleX:o,scaleY:i,x:a,y:l}=r,s=e.left-a-(1-o)*parseFloat(n),c=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:c,right:s+u,bottom:c+d,left:s}}(n,t,r))}const{top:r,left:o,width:a,height:l,bottom:s,right:c}=n;return{top:r,left:o,width:a,height:l,bottom:s,right:c}}function N(e){return M(e,{ignoreTransform:!0})}function L(e,t){const n=[];return e?function r(o){if(null!=t&&n.length>=t)return n;if(!o)return n;if((0,i.qk)(o)&&null!=o.scrollingElement&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!(0,i.Re)(o)||(0,i.vZ)(o))return n;if(n.includes(o))return n;const a=(0,i.Jj)(e).getComputedStyle(o);return o!==e&&function(e,t){void 0===t&&(t=(0,i.Jj)(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,a)&&n.push(o),function(e,t){return void 0===t&&(t=(0,i.Jj)(e).getComputedStyle(e)),"fixed"===t.position}(o,a)?n:r(o.parentNode)}(e):n}function O(e){const[t]=L(e,1);return null!=t?t:null}function I(e){return i.Nq&&e?(0,i.FJ)(e)?e:(0,i.UG)(e)?(0,i.qk)(e)||e===(0,i.r3)(e).scrollingElement?window:(0,i.Re)(e)?e:null:null:null}function j(e){return(0,i.FJ)(e)?e.scrollX:e.scrollLeft}function A(e){return(0,i.FJ)(e)?e.scrollY:e.scrollTop}function B(e){return{x:j(e),y:A(e)}}var U;function z(e){return!(!i.Nq||!e)&&e===document.scrollingElement}function P(e){const t={x:0,y:0},n=z(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"}(U||(U={}));const F={x:.2,y:.2};function X(e,t,n,r,o){let{top:i,left:a,right:l,bottom:s}=n;void 0===r&&(r=10),void 0===o&&(o=F);const{isTop:c,isBottom:u,isLeft:d,isRight:f}=P(e),h={x:0,y:0},v={x:0,y:0},g=t.height*o.y,p=t.width*o.x;return!c&&i<=t.top+g?(h.y=U.Backward,v.y=r*Math.abs((t.top+g-i)/g)):!u&&s>=t.bottom-g&&(h.y=U.Forward,v.y=r*Math.abs((t.bottom-g-s)/g)),!f&&l>=t.right-p?(h.x=U.Forward,v.x=r*Math.abs((t.right-p-l)/p)):!d&&a<=t.left+p&&(h.x=U.Backward,v.x=r*Math.abs((t.left+p-a)/p)),{direction:h,speed:v}}function q(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 $(e){return e.reduce(((e,t)=>(0,i.IH)(e,B(t))),y)}function J(e,t){if(void 0===t&&(t=M),!e)return;const{top:n,left:r,bottom:o,right:i}=t(e);O(e)&&(o<=0||i<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const Y=[["x",["left","right"],function(e){return e.reduce(((e,t)=>e+j(t)),0)}],["y",["top","bottom"],function(e){return e.reduce(((e,t)=>e+A(t)),0)}]];class W{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=L(t),r=$(n);this.rect={...e},this.width=e.width,this.height=e.height;for(const[o,i,a]of Y)for(const e of i)Object.defineProperty(this,e,{get:()=>{const t=a(n),i=r[o]-t;return this.rect[e]+i},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class H{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 K(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 G,V;function _(e){e.preventDefault()}function Q(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"}(G||(G={})),function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter"}(V||(V={}));const Z={start:[V.Space,V.Enter],cancel:[V.Esc],end:[V.Space,V.Enter]},ee=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case V.Right:return{...n,x:n.x+25};case V.Left:return{...n,x:n.x-25};case V.Down:return{...n,y:n.y+25};case V.Up:return{...n,y:n.y-25}}};class te{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 H((0,i.r3)(t)),this.windowListeners=new H((0,i.Jj)(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(G.Resize,this.handleCancel),this.windowListeners.add(G.VisibilityChange,this.handleCancel),setTimeout((()=>this.listeners.add(G.Keydown,this.handleKeyDown)))}handleStart(){const{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&J(n),t(y)}handleKeyDown(e){if((0,i.vd)(e)){const{active:t,context:n,options:r}=this.props,{keyboardCodes:o=Z,coordinateGetter:a=ee,scrollBehavior:l="smooth"}=r,{code:s}=e;if(o.end.includes(s))return void this.handleEnd(e);if(o.cancel.includes(s))return void this.handleCancel(e);const{collisionRect:c}=n.current,u=c?{x:c.left,y:c.top}:y;this.referenceCoordinates||(this.referenceCoordinates=u);const d=a(e,{active:t,context:n.current,currentCoordinates:u});if(d){const t=(0,i.$X)(d,u),r={x:0,y:0},{scrollableAncestors:o}=n.current;for(const n of o){const o=e.code,{isTop:i,isRight:a,isLeft:s,isBottom:c,maxScroll:u,minScroll:f}=P(n),h=q(n),v={x:Math.min(o===V.Right?h.right-h.width/2:h.right,Math.max(o===V.Right?h.left:h.left+h.width/2,d.x)),y:Math.min(o===V.Down?h.bottom-h.height/2:h.bottom,Math.max(o===V.Down?h.top:h.top+h.height/2,d.y))},g=o===V.Right&&!a||o===V.Left&&!s,p=o===V.Down&&!c||o===V.Up&&!i;if(g&&v.x!==d.x){const e=n.scrollLeft+t.x,i=o===V.Right&&e<=u.x||o===V.Left&&e>=f.x;if(i&&!t.y)return void n.scrollTo({left:e,behavior:l});r.x=i?n.scrollLeft-e:o===V.Right?n.scrollLeft-u.x:n.scrollLeft-f.x,r.x&&n.scrollBy({left:-r.x,behavior:l});break}if(p&&v.y!==d.y){const e=n.scrollTop+t.y,i=o===V.Down&&e<=u.y||o===V.Up&&e>=f.y;if(i&&!t.x)return void n.scrollTo({top:e,behavior:l});r.y=i?n.scrollTop-e:o===V.Down?n.scrollTop-u.y:n.scrollTop-f.y,r.y&&n.scrollBy({top:-r.y,behavior:l});break}}this.handleMove(e,(0,i.IH)((0,i.$X)(d,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 ne(e){return Boolean(e&&"distance"in e)}function re(e){return Boolean(e&&"delay"in e)}te.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=Z,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 oe{constructor(e,t,n){var r;void 0===n&&(n=function(e){const{EventTarget:t}=(0,i.Jj)(e);return e instanceof t?e:(0,i.r3)(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:a}=o;this.props=e,this.events=t,this.document=(0,i.r3)(a),this.documentListeners=new H(this.document),this.listeners=new H(n),this.windowListeners=new H((0,i.Jj)(a)),this.initialCoordinates=null!=(r=(0,i.DC)(o))?r:y,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}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),this.windowListeners.add(G.Resize,this.handleCancel),this.windowListeners.add(G.DragStart,_),this.windowListeners.add(G.VisibilityChange,this.handleCancel),this.windowListeners.add(G.ContextMenu,_),this.documentListeners.add(G.Keydown,this.handleKeydown),t){if(ne(t))return;if(re(t))return void(this.timeoutId=setTimeout(this.handleStart,t.delay))}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(G.Click,Q,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(G.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){var t;const{activated:n,initialCoordinates:r,props:o}=this,{onMove:a,options:{activationConstraint:l}}=o;if(!r)return;const s=null!=(t=(0,i.DC)(e))?t:y,c=(0,i.$X)(r,s);if(!n&&l){if(re(l))return K(c,l.tolerance)?this.handleCancel():void 0;if(ne(l))return null!=l.tolerance&&K(c,l.tolerance)?this.handleCancel():K(c,l.distance)?this.handleStart():void 0}e.cancelable&&e.preventDefault(),a(s)}handleEnd(){const{onEnd:e}=this.props;this.detach(),e()}handleCancel(){const{onCancel:e}=this.props;this.detach(),e()}handleKeydown(e){e.code===V.Esc&&this.handleCancel()}removeTextSelection(){var e;null==(e=this.document.getSelection())||e.removeAllRanges()}}const ie={move:{name:"pointermove"},end:{name:"pointerup"}};class ae extends oe{constructor(e){const{event:t}=e,n=(0,i.r3)(t.target);super(e,ie,n)}}ae.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 le={move:{name:"mousemove"},end:{name:"mouseup"}};var se;!function(e){e[e.RightClick=2]="RightClick"}(se||(se={}));class ce extends oe{constructor(e){super(e,le,(0,i.r3)(e.event.target))}}ce.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button!==se.RightClick&&(null==r||r({event:n}),!0)}}];const ue={move:{name:"touchmove"},end:{name:"touchend"}};class de extends oe{constructor(e){super(e,ue)}static setup(){return window.addEventListener(ue.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(ue.move.name,e)};function e(){}}}var fe,he;function ve(e){let{acceleration:t,activator:n=fe.Pointer,canScroll:o,draggingRect:a,enabled:l,interval:s=5,order:c=he.TreeOrder,pointerCoordinates:u,scrollableAncestors:d,scrollableAncestorRects:f,delta:h,threshold:v}=e;const g=function(e){let{delta:t,disabled:n}=e;const r=(0,i.D9)(t);return(0,i.Gj)((e=>{if(n||!r||!e)return ge;const o={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[U.Backward]:e.x[U.Backward]||-1===o.x,[U.Forward]:e.x[U.Forward]||1===o.x},y:{[U.Backward]:e.y[U.Backward]||-1===o.y,[U.Forward]:e.y[U.Forward]||1===o.y}}}),[n,t,r])}({delta:h,disabled:!l}),[p,b]=(0,i.Yz)(),m=(0,r.useRef)({x:0,y:0}),y=(0,r.useRef)({x:0,y:0}),w=(0,r.useMemo)((()=>{switch(n){case fe.Pointer:return u?{top:u.y,bottom:u.y,left:u.x,right:u.x}:null;case fe.DraggableRect:return a}}),[n,a,u]),x=(0,r.useRef)(null),C=(0,r.useCallback)((()=>{const e=x.current;if(!e)return;const t=m.current.x*y.current.x,n=m.current.y*y.current.y;e.scrollBy(t,n)}),[]),E=(0,r.useMemo)((()=>c===he.TreeOrder?[...d].reverse():d),[c,d]);(0,r.useEffect)((()=>{if(l&&d.length&&w){for(const e of E){if(!1===(null==o?void 0:o(e)))continue;const n=d.indexOf(e),r=f[n];if(!r)continue;const{direction:i,speed:a}=X(e,r,w,t,v);for(const e of["x","y"])g[e][i[e]]||(a[e]=0,i[e]=0);if(a.x>0||a.y>0)return b(),x.current=e,p(C,s),m.current=a,void(y.current=i)}m.current={x:0,y:0},y.current={x:0,y:0},b()}else b()}),[t,C,o,b,l,s,JSON.stringify(w),JSON.stringify(g),p,d,E,f,JSON.stringify(v)])}de.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"}(fe||(fe={})),function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"}(he||(he={}));const ge={x:{[U.Backward]:!1,[U.Forward]:!1},y:{[U.Backward]:!1,[U.Forward]:!1}};var pe,be;!function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"}(pe||(pe={})),function(e){e.Optimized="optimized"}(be||(be={}));const me=new Map;function ye(e,t){return(0,i.Gj)((n=>e?n||("function"===typeof t?t(e):e):null),[t,e])}function we(e){let{callback:t,disabled:n}=e;const o=(0,i.zX)(t),a=(0,r.useMemo)((()=>{if(n||"undefined"===typeof window||"undefined"===typeof window.ResizeObserver)return;const{ResizeObserver:e}=window;return new e(o)}),[n]);return(0,r.useEffect)((()=>()=>null==a?void 0:a.disconnect()),[a]),a}function xe(e){return new W(M(e),e)}function Ce(e,t,n){void 0===t&&(t=xe);const[o,a]=(0,r.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);if(JSON.stringify(r)===JSON.stringify(i))return r;return i}),null),l=function(e){let{callback:t,disabled:n}=e;const o=(0,i.zX)(t),a=(0,r.useMemo)((()=>{if(n||"undefined"===typeof window||"undefined"===typeof window.MutationObserver)return;const{MutationObserver:e}=window;return new e(o)}),[o,n]);return(0,r.useEffect)((()=>()=>null==a?void 0:a.disconnect()),[a]),a}({callback(t){if(e)for(const n of t){const{type:t,target:r}=n;if("childList"===t&&r instanceof HTMLElement&&r.contains(e)){a();break}}}}),s=we({callback:a});return(0,i.LI)((()=>{a(),e?(null==s||s.observe(e),null==l||l.observe(document.body,{childList:!0,subtree:!0})):(null==s||s.disconnect(),null==l||l.disconnect())}),[e]),o}const Ee=[];function De(e,t){void 0===t&&(t=[]);const n=(0,r.useRef)(null);return(0,r.useEffect)((()=>{n.current=null}),t),(0,r.useEffect)((()=>{const t=e!==y;t&&!n.current&&(n.current=e),!t&&n.current&&(n.current=null)}),[e]),n.current?(0,i.$X)(e,n.current):y}function Re(e){return(0,r.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 Se=[];function ke(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return(0,i.Re)(t)?t:e}const Te=[{sensor:ae,options:{}},{sensor:te,options:{}}],Me={current:{}},Ne={draggable:{measure:N},droppable:{measure:N,strategy:pe.WhileDragging,frequency:be.Optimized},dragOverlay:{measure:M}};class Le 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 Oe={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Le,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:p},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Ne,measureDroppableContainers:p,windowRect:null,measuringScheduled:!1},Ie={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:p,draggableNodes:new Map,over:null,measureDroppableContainers:p},je=(0,r.createContext)(Ie),Ae=(0,r.createContext)(Oe);function Be(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Le}}}function Ue(e,t){switch(t.type){case g.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case g.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 g.DragEnd:case g.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case g.RegisterDroppable:{const{element:n}=t,{id:r}=n,o=new Le(e.droppable.containers);return o.set(r,n),{...e,droppable:{...e.droppable,containers:o}}}case g.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 Le(e.droppable.containers);return a.set(n,{...i,disabled:o}),{...e,droppable:{...e.droppable,containers:a}}}case g.UnregisterDroppable:{const{id:n,key:r}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const i=new Le(e.droppable.containers);return i.delete(n),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function ze(e){let{disabled:t}=e;const{active:n,activatorEvent:o,draggableNodes:a}=(0,r.useContext)(je),l=(0,i.D9)(o),s=(0,i.D9)(null==n?void 0:n.id);return(0,r.useEffect)((()=>{if(!t&&!o&&l&&null!=s){if(!(0,i.vd)(l))return;if(document.activeElement===l.target)return;const e=a.get(s);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=(0,i.so)(e);if(t){t.focus();break}}}))}}),[o,t,a,s,l]),null}function Pe(e,t){let{transform:n,...r}=t;return null!=e&&e.length?e.reduce(((e,t)=>t({transform:e,...r})),n):n}const Fe=(0,r.createContext)({...y,scaleX:1,scaleY:1});var Xe;!function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"}(Xe||(Xe={}));const qe=(0,r.memo)((function(e){var t,n,a,l;let{id:s,accessibility:c,autoScroll:d=!0,children:f,sensors:h=Te,collisionDetection:p=E,measuring:b,modifiers:m,...w}=e;const x=(0,r.useReducer)(Ue,void 0,Be),[C,R]=x,[k,T]=function(){const[e]=(0,r.useState)((()=>new Set)),t=(0,r.useCallback)((t=>(e.add(t),()=>e.delete(t))),[e]);return[(0,r.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]),t]}(),[N,j]=(0,r.useState)(Xe.Uninitialized),A=N===Xe.Initialized,{draggable:{active:U,nodes:P,translate:F},droppable:{containers:X}}=C,q=U?P.get(U):null,J=(0,r.useRef)({initial:null,translated:null}),Y=(0,r.useMemo)((()=>{var e;return null!=U?{id:U,data:null!=(e=null==q?void 0:q.data)?e:Me,rect:J}:null}),[U,q]),H=(0,r.useRef)(null),[K,G]=(0,r.useState)(null),[V,_]=(0,r.useState)(null),Q=(0,i.Ey)(w,Object.values(w)),Z=(0,i.Ld)("DndDescribedBy",s),ee=(0,r.useMemo)((()=>X.getEnabled()),[X]),te=(ne=b,(0,r.useMemo)((()=>({draggable:{...Ne.draggable,...null==ne?void 0:ne.draggable},droppable:{...Ne.droppable,...null==ne?void 0:ne.droppable},dragOverlay:{...Ne.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:o,config:a}=t;const[l,s]=(0,r.useState)(null),{frequency:c,measure:u,strategy:d}=a,f=(0,r.useRef)(e),h=function(){switch(d){case pe.Always:return!1;case pe.BeforeDragging:return n;default:return!n}}(),v=(0,i.Ey)(h),g=(0,r.useCallback)((function(e){void 0===e&&(e=[]),v.current||s((t=>null===t?e:t.concat(e.filter((e=>!t.includes(e))))))}),[v]),p=(0,r.useRef)(null),b=(0,i.Gj)((t=>{if(h&&!n)return me;if(!t||t===me||f.current!==e||null!=l){const t=new Map;for(let n of e){if(!n)continue;if(l&&l.length>0&&!l.includes(n.id)&&n.rect.current){t.set(n.id,n.rect.current);continue}const e=n.node.current,r=e?new W(u(e),e):null;n.rect.current=r,r&&t.set(n.id,r)}return t}return t}),[e,l,n,h,u]);return(0,r.useEffect)((()=>{f.current=e}),[e]),(0,r.useEffect)((()=>{h||g()}),[n,h]),(0,r.useEffect)((()=>{l&&l.length>0&&s(null)}),[JSON.stringify(l)]),(0,r.useEffect)((()=>{h||"number"!==typeof c||null!==p.current||(p.current=setTimeout((()=>{g(),p.current=null}),c))}),[c,h,g,...o]),{droppableRects:b,measureDroppableContainers:g,measuringScheduled:null!=l}}(ee,{dragging:A,dependencies:[F.x,F.y],config:te.droppable}),ae=function(e,t){const n=null!==t?e.get(t):void 0,r=n?n.node.current:null;return(0,i.Gj)((e=>{var n;return null===t?null:null!=(n=null!=r?r:e)?n:null}),[r,t])}(P,U),le=(0,r.useMemo)((()=>V?(0,i.DC)(V):null),[V]),se=function(){const e=!1===(null==K?void 0:K.autoScrollEnabled),t="object"===typeof d?!1===d.enabled:!1===d,n=A&&!e&&!t;if("object"===typeof d)return{...d,enabled:n};return{enabled:n}}(),ce=function(e,t){return ye(e,t)}(ae,te.draggable.measure);!function(e){let{activeNode:t,measure:n,initialRect:o,config:a=!0}=e;const l=(0,r.useRef)(!1),{x:s,y:c}="boolean"===typeof a?{x:a,y:a}:a;(0,i.LI)((()=>{if(!s&&!c||!t)return void(l.current=!1);if(l.current||!o)return;const e=null==t?void 0:t.node.current;if(!e||!1===e.isConnected)return;const r=D(n(e),o);if(s||(r.x=0),c||(r.y=0),l.current=!0,Math.abs(r.x)>0||Math.abs(r.y)>0){const t=O(e);t&&t.scrollBy({top:r.y,left:r.x})}}),[t,s,c,o,n])}({activeNode:U?P.get(U):null,config:se.layoutShiftCompensation,initialRect:ce,measure:te.draggable.measure});const ue=Ce(ae,te.draggable.measure,ce),de=Ce(ae?ae.parentElement:null),fe=(0,r.useRef)({activatorEvent:null,active:null,activeNode:ae,collisionRect:null,collisions:null,droppableRects:re,draggableNodes:P,draggingNode:null,draggingNodeRect:null,droppableContainers:X,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),he=X.getNodeFor(null==(t=fe.current.over)?void 0:t.id),ge=function(e){let{measure:t}=e;const[n,o]=(0,r.useState)(null),a=(0,r.useCallback)((e=>{for(const{target:n}of e)if((0,i.Re)(n)){o((e=>{const r=t(n);return e?{...e,width:r.width,height:r.height}:r}));break}}),[t]),l=we({callback:a}),s=(0,r.useCallback)((e=>{const n=ke(e);null==l||l.disconnect(),n&&(null==l||l.observe(n)),o(n?t(n):null)}),[t,l]),[c,u]=(0,i.wm)(s);return(0,r.useMemo)((()=>({nodeRef:c,rect:n,setRef:u})),[n,c,u])}({measure:te.dragOverlay.measure}),be=null!=(n=ge.nodeRef.current)?n:ae,xe=A?null!=(a=ge.rect)?a:ue:null,Le=Boolean(ge.nodeRef.current&&ge.rect),Oe=D(Ie=Le?null:ue,ye(Ie));var Ie;const qe=Re(be?(0,i.Jj)(be):null),$e=function(e){const t=(0,r.useRef)(e),n=(0,i.Gj)((n=>e?n&&n!==Ee&&e&&t.current&&e.parentNode===t.current.parentNode?n:L(e):Ee),[e]);return(0,r.useEffect)((()=>{t.current=e}),[e]),n}(A?null!=he?he:ae:null),Je=function(e,t){void 0===t&&(t=M);const[n]=e,o=Re(n?(0,i.Jj)(n):null),[a,l]=(0,r.useReducer)((function(){return e.length?e.map((e=>z(e)?o:new W(t(e),e))):Se}),Se),s=we({callback:l});return e.length>0&&a===Se&&l(),(0,i.LI)((()=>{e.length?e.forEach((e=>null==s?void 0:s.observe(e))):(null==s||s.disconnect(),l())}),[e]),a}($e),Ye=Pe(m,{transform:{x:F.x-Oe.x,y:F.y-Oe.y,scaleX:1,scaleY:1},activatorEvent:V,active:Y,activeNodeRect:ue,containerNodeRect:de,draggingNodeRect:xe,over:fe.current.over,overlayNodeRect:ge.rect,scrollableAncestors:$e,scrollableAncestorRects:Je,windowRect:qe}),We=le?(0,i.IH)(le,F):null,He=function(e){const[t,n]=(0,r.useState)(null),o=(0,r.useRef)(e),a=(0,r.useCallback)((e=>{const t=I(e.target);t&&n((e=>e?(e.set(t,B(t)),new Map(e)):null))}),[]);return(0,r.useEffect)((()=>{const t=o.current;if(e!==t){r(t);const i=e.map((e=>{const t=I(e);return t?(t.addEventListener("scroll",a,{passive:!0}),[t,B(t)]):null})).filter((e=>null!=e));n(i.length?new Map(i):null),o.current=e}return()=>{r(e),r(t)};function r(e){e.forEach((e=>{const t=I(e);null==t||t.removeEventListener("scroll",a)}))}}),[a,e]),(0,r.useMemo)((()=>e.length?t?Array.from(t.values()).reduce(((e,t)=>(0,i.IH)(e,t)),y):$(e):y),[e,t])}($e),Ke=De(He),Ge=De(He,[ue]),Ve=(0,i.IH)(Ye,Ke),_e=xe?S(xe,Ye):null,Qe=Y&&_e?p({active:Y,collisionRect:_e,droppableRects:re,droppableContainers:ee,pointerCoordinates:We}):null,Ze=function(e,t){if(!e||0===e.length)return null;const[n]=e;return t?n[t]:n}(Qe,"id"),[et,tt]=(0,r.useState)(null),nt=function(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}(Le?Ye:(0,i.IH)(Ye,Ge),null!=(l=null==et?void 0:et.rect)?l:null,ue),rt=(0,r.useCallback)(((e,t)=>{let{sensor:n,options:r}=t;if(null==H.current)return;const i=P.get(H.current);if(!i)return;const a=e.nativeEvent,l=new n({active:H.current,activeNode:i,event:a,options:r,context:fe,onStart(e){const t=H.current;if(null==t)return;const n=P.get(t);if(!n)return;const{onDragStart:r}=Q.current,i={active:{id:t,data:n.data,rect:J}};(0,o.unstable_batchedUpdates)((()=>{null==r||r(i),j(Xe.Initializing),R({type:g.DragStart,initialCoordinates:e,active:t}),k({type:"onDragStart",event:i})}))},onMove(e){R({type:g.DragMove,coordinates:e})},onEnd:s(g.DragEnd),onCancel:s(g.DragCancel)});function s(e){return async function(){const{active:t,collisions:n,over:r,scrollAdjustedTranslate:i}=fe.current;let l=null;if(t&&i){const{cancelDrop:o}=Q.current;if(l={activatorEvent:a,active:t,collisions:n,delta:i,over:r},e===g.DragEnd&&"function"===typeof o){await Promise.resolve(o(l))&&(e=g.DragCancel)}}H.current=null,(0,o.unstable_batchedUpdates)((()=>{R({type:e}),j(Xe.Uninitialized),tt(null),G(null),_(null);const t=e===g.DragEnd?"onDragEnd":"onDragCancel";if(l){const e=Q.current[t];null==e||e(l),k({type:t,event:l})}}))}}(0,o.unstable_batchedUpdates)((()=>{G(l),_(e.nativeEvent)}))}),[P]),ot=(0,r.useCallback)(((e,t)=>(n,r)=>{const o=n.nativeEvent,i=P.get(r);if(null!==H.current||!i||o.dndKit||o.defaultPrevented)return;const a={active:i};!0===e(n,t.options,a)&&(o.dndKit={capturedBy:t.sensor},H.current=r,rt(n,t))}),[P,rt]),it=function(e,t){return(0,r.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])}(h,ot);!function(e){(0,r.useEffect)((()=>{if(!i.Nq)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})))}(h),(0,i.LI)((()=>{ue&&N===Xe.Initializing&&j(Xe.Initialized)}),[ue,N]),(0,r.useEffect)((()=>{const{onDragMove:e}=Q.current,{active:t,activatorEvent:n,collisions:r,over:i}=fe.current;if(!t||!n)return;const a={active:t,activatorEvent:n,collisions:r,delta:{x:Ve.x,y:Ve.y},over:i};(0,o.unstable_batchedUpdates)((()=>{null==e||e(a),k({type:"onDragMove",event:a})}))}),[Ve.x,Ve.y]),(0,r.useEffect)((()=>{const{active:e,activatorEvent:t,collisions:n,droppableContainers:r,scrollAdjustedTranslate:i}=fe.current;if(!e||null==H.current||!t||!i)return;const{onDragOver:a}=Q.current,l=r.get(Ze),s=l&&l.rect.current?{id:l.id,rect:l.rect.current,data:l.data,disabled:l.disabled}:null,c={active:e,activatorEvent:t,collisions:n,delta:{x:i.x,y:i.y},over:s};(0,o.unstable_batchedUpdates)((()=>{tt(s),null==a||a(c),k({type:"onDragOver",event:c})}))}),[Ze]),(0,i.LI)((()=>{fe.current={activatorEvent:V,active:Y,activeNode:ae,collisionRect:_e,collisions:Qe,droppableRects:re,draggableNodes:P,draggingNode:be,draggingNodeRect:xe,droppableContainers:X,over:et,scrollableAncestors:$e,scrollAdjustedTranslate:Ve},J.current={initial:xe,translated:_e}}),[Y,ae,Qe,_e,P,be,xe,re,X,et,$e,Ve]),ve({...se,delta:F,draggingRect:_e,pointerCoordinates:We,scrollableAncestors:$e,scrollableAncestorRects:Je});const at=(0,r.useMemo)((()=>({active:Y,activeNode:ae,activeNodeRect:ue,activatorEvent:V,collisions:Qe,containerNodeRect:de,dragOverlay:ge,draggableNodes:P,droppableContainers:X,droppableRects:re,over:et,measureDroppableContainers:oe,scrollableAncestors:$e,scrollableAncestorRects:Je,measuringConfiguration:te,measuringScheduled:ie,windowRect:qe})),[Y,ae,ue,V,Qe,de,ge,P,X,re,et,oe,$e,Je,te,ie,qe]),lt=(0,r.useMemo)((()=>({activatorEvent:V,activators:it,active:Y,activeNodeRect:ue,ariaDescribedById:{draggable:Z},dispatch:R,draggableNodes:P,over:et,measureDroppableContainers:oe})),[V,it,Y,ue,R,Z,P,et,oe]);return r.createElement(u.Provider,{value:T},r.createElement(je.Provider,{value:lt},r.createElement(Ae.Provider,{value:at},r.createElement(Fe.Provider,{value:nt},f)),r.createElement(ze,{disabled:!1===(null==c?void 0:c.restoreFocus)})),r.createElement(v,{...c,hiddenTextDescribedById:Z}))})),$e=(0,r.createContext)(null),Je="button";function Ye(e){let{id:t,data:n,disabled:o=!1,attributes:a}=e;const l=(0,i.Ld)("Droppable"),{activators:s,activatorEvent:c,active:u,activeNodeRect:d,ariaDescribedById:f,draggableNodes:h,over:v}=(0,r.useContext)(je),{role:g=Je,roleDescription:p="draggable",tabIndex:b=0}=null!=a?a:{},m=(null==u?void 0:u.id)===t,y=(0,r.useContext)(m?Fe:$e),[w,x]=(0,i.wm)(),[C,E]=(0,i.wm)(),D=function(e,t){return(0,r.useMemo)((()=>e.reduce(((e,n)=>{let{eventName:r,handler:o}=n;return e[r]=e=>{o(e,t)},e}),{})),[e,t])}(s,t),R=(0,i.Ey)(n);(0,i.LI)((()=>(h.set(t,{id:t,key:l,node:w,activatorNode:C,data:R}),()=>{const e=h.get(t);e&&e.key===l&&h.delete(t)})),[h,t]);return{active:u,activatorEvent:c,activeNodeRect:d,attributes:(0,r.useMemo)((()=>({role:g,tabIndex:b,"aria-disabled":o,"aria-pressed":!(!m||g!==Je)||void 0,"aria-roledescription":p,"aria-describedby":f.draggable})),[o,g,b,m,p,f.draggable]),isDragging:m,listeners:o?void 0:D,node:w,over:v,setNodeRef:x,setActivatorNodeRef:E,transform:y}}function We(){return(0,r.useContext)(Ae)}const He={timeout:25};function Ke(e){let{data:t,disabled:n=!1,id:o,resizeObserverConfig:a}=e;const l=(0,i.Ld)("Droppable"),{active:s,dispatch:c,over:u,measureDroppableContainers:d}=(0,r.useContext)(je),f=(0,r.useRef)({disabled:n}),h=(0,r.useRef)(!1),v=(0,r.useRef)(null),p=(0,r.useRef)(null),{disabled:b,updateMeasurementsFor:m,timeout:y}={...He,...a},w=(0,i.Ey)(null!=m?m:o),x=we({callback:(0,r.useCallback)((()=>{h.current?(null!=p.current&&clearTimeout(p.current),p.current=setTimeout((()=>{d(Array.isArray(w.current)?w.current:[w.current]),p.current=null}),y)):h.current=!0}),[y]),disabled:b||!s}),C=(0,r.useCallback)(((e,t)=>{x&&(t&&(x.unobserve(t),h.current=!1),e&&x.observe(e))}),[x]),[E,D]=(0,i.wm)(C),R=(0,i.Ey)(t);return(0,r.useEffect)((()=>{x&&E.current&&(x.disconnect(),h.current=!1,x.observe(E.current))}),[E,x]),(0,i.LI)((()=>(c({type:g.RegisterDroppable,element:{id:o,key:l,disabled:n,node:E,rect:v,data:R}}),()=>c({type:g.UnregisterDroppable,key:l,id:o}))),[o]),(0,r.useEffect)((()=>{n!==f.current.disabled&&(c({type:g.SetDroppableDisabled,id:o,key:l,disabled:n}),f.current.disabled=n)}),[o,l,n,c]),{active:s,rect:v,isOver:(null==u?void 0:u.id)===o,node:E,over:u,setNodeRef:D}}function Ge(e){let{animation:t,children:n}=e;const[o,a]=(0,r.useState)(null),[l,s]=(0,r.useState)(null),c=(0,i.D9)(n);return n||o||!c||a(c),(0,i.LI)((()=>{if(!l)return;const e=null==o?void 0:o.key,n=null==o?void 0:o.props.id;null!=e&&null!=n?Promise.resolve(t(n,l)).then((()=>{a(null)})):a(null)}),[t,o,l]),r.createElement(r.Fragment,null,n,o?(0,r.cloneElement)(o,{ref:s}):null)}const Ve={x:0,y:0,scaleX:1,scaleY:1};function _e(e){let{children:t}=e;return r.createElement(je.Provider,{value:Ie},r.createElement(Fe.Provider,{value:Ve},t))}const Qe={position:"fixed",touchAction:"none"},Ze=e=>(0,i.vd)(e)?"transform 250ms ease":void 0,et=(0,r.forwardRef)(((e,t)=>{let{as:n,activatorEvent:o,adjustScale:a,children:l,className:s,rect:c,style:u,transform:d,transition:f=Ze}=e;if(!c)return null;const h=a?d:{...d,scaleX:1,scaleY:1},v={...Qe,width:c.width,height:c.height,top:c.top,left:c.left,transform:i.ux.Transform.toString(h),transformOrigin:a&&o?w(o,c):void 0,transition:"function"===typeof f?f(o):f,...u};return r.createElement(n,{className:s,style:v,ref:t},l)})),tt=e=>t=>{let{active:n,dragOverlay:r}=t;const o={},{styles:i,className:a}=e;if(null!=i&&i.active)for(const[e,l]of Object.entries(i.active))void 0!==l&&(o[e]=n.node.style.getPropertyValue(e),n.node.style.setProperty(e,l));if(null!=i&&i.dragOverlay)for(const[e,l]of Object.entries(i.dragOverlay))void 0!==l&&r.node.style.setProperty(e,l);return null!=a&&a.active&&n.node.classList.add(a.active),null!=a&&a.dragOverlay&&r.node.classList.add(a.dragOverlay),function(){for(const[e,t]of Object.entries(o))n.node.style.setProperty(e,t);null!=a&&a.active&&n.node.classList.remove(a.active)}},nt={duration:250,easing:"ease",keyframes:e=>{let{transform:{initial:t,final:n}}=e;return[{transform:i.ux.Transform.toString(t)},{transform:i.ux.Transform.toString(n)}]},sideEffects:tt({styles:{active:{opacity:"0"}}})};function rt(e){let{config:t,draggableNodes:n,droppableContainers:r,measuringConfiguration:o}=e;return(0,i.zX)(((e,a)=>{if(null===t)return;const l=n.get(e);if(!l)return;const s=l.node.current;if(!s)return;const c=ke(a);if(!c)return;const{transform:u}=(0,i.Jj)(a).getComputedStyle(a),d=k(u);if(!d)return;const f="function"===typeof t?t:function(e){const{duration:t,easing:n,sideEffects:r,keyframes:o}={...nt,...e};return e=>{let{active:i,dragOverlay:a,transform:l,...s}=e;if(!t)return;const c={x:a.rect.left-i.rect.left,y:a.rect.top-i.rect.top},u={scaleX:1!==l.scaleX?i.rect.width*l.scaleX/a.rect.width:1,scaleY:1!==l.scaleY?i.rect.height*l.scaleY/a.rect.height:1},d={x:l.x-c.x,y:l.y-c.y,...u},f=o({...s,active:i,dragOverlay:a,transform:{initial:l,final:d}}),[h]=f,v=f[f.length-1];if(JSON.stringify(h)===JSON.stringify(v))return;const g=null==r?void 0:r({active:i,dragOverlay:a,...s}),p=a.node.animate(f,{duration:t,easing:n,fill:"forwards"});return new Promise((e=>{p.onfinish=()=>{null==g||g(),e()}}))}}(t);return J(s,o.draggable.measure),f({active:{id:e,data:l.data,node:s,rect:o.draggable.measure(s)},draggableNodes:n,dragOverlay:{node:a,rect:o.dragOverlay.measure(c)},droppableContainers:r,measuringConfiguration:o,transform:d})}))}let ot=0;function it(e){return(0,r.useMemo)((()=>{if(null!=e)return ot++,ot}),[e])}const at=r.memo((e=>{let{adjustScale:t=!1,children:n,dropAnimation:o,style:i,transition:a,modifiers:l,wrapperElement:s="div",className:c,zIndex:u=999}=e;const{activatorEvent:d,active:f,activeNodeRect:h,containerNodeRect:v,draggableNodes:g,droppableContainers:p,dragOverlay:b,over:m,measuringConfiguration:y,scrollableAncestors:w,scrollableAncestorRects:x,windowRect:C}=We(),E=(0,r.useContext)(Fe),D=it(null==f?void 0:f.id),R=Pe(l,{activatorEvent:d,active:f,activeNodeRect:h,containerNodeRect:v,draggingNodeRect:b.rect,over:m,overlayNodeRect:b.rect,scrollableAncestors:w,scrollableAncestorRects:x,transform:E,windowRect:C}),S=ye(h),k=rt({config:o,draggableNodes:g,droppableContainers:p,measuringConfiguration:y}),T=S?b.setRef:void 0;return r.createElement(_e,null,r.createElement(Ge,{animation:k},f&&D?r.createElement(et,{key:D,id:f.id,ref:T,as:s,activatorEvent:d,adjustScale:t,className:c,transition:a,rect:S,style:{zIndex:u,...i},transform:R},n):null))}))},82851:function(e,t,n){n.d(t,{$X:function(){return E},D9:function(){return m},DC:function(){return R},Ey:function(){return g},FJ:function(){return i},Gj:function(){return p},IH:function(){return C},Jj:function(){return l},LI:function(){return f},Ld:function(){return w},Nq:function(){return o},Re:function(){return c},UG:function(){return a},Yz:function(){return v},qk:function(){return s},r3:function(){return d},so:function(){return T},ux:function(){return S},vZ:function(){return u},vd:function(){return D},wm:function(){return b},zX:function(){return h}});var r=n(2784);const o="undefined"!==typeof window&&"undefined"!==typeof window.document&&"undefined"!==typeof window.document.createElement;function i(e){const t=Object.prototype.toString.call(e);return"[object Window]"===t||"[object global]"===t}function a(e){return"nodeType"in e}function l(e){var t,n;return e?i(e)?e:a(e)&&null!=(t=null==(n=e.ownerDocument)?void 0:n.defaultView)?t:window:window}function s(e){const{Document:t}=l(e);return e instanceof t}function c(e){return!i(e)&&e instanceof l(e).HTMLElement}function u(e){return e instanceof l(e).SVGElement}function d(e){return e?i(e)?e.document:a(e)?s(e)?e:c(e)?e.ownerDocument:document:document:document}const f=o?r.useLayoutEffect:r.useEffect;function h(e){const t=(0,r.useRef)(e);return f((()=>{t.current=e})),(0,r.useCallback)((function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return null==t.current?void 0:t.current(...n)}),[])}function v(){const e=(0,r.useRef)(null);return[(0,r.useCallback)(((t,n)=>{e.current=setInterval(t,n)}),[]),(0,r.useCallback)((()=>{null!==e.current&&(clearInterval(e.current),e.current=null)}),[])]}function g(e,t){void 0===t&&(t=[e]);const n=(0,r.useRef)(e);return f((()=>{n.current!==e&&(n.current=e)}),t),n}function p(e,t){const n=(0,r.useRef)();return(0,r.useMemo)((()=>{const t=e(n.current);return n.current=t,t}),[...t])}function b(e){const t=h(e),n=(0,r.useRef)(null),o=(0,r.useCallback)((e=>{e!==n.current&&(null==t||t(e,n.current)),n.current=e}),[]);return[n,o]}function m(e){const t=(0,r.useRef)();return(0,r.useEffect)((()=>{t.current=e}),[e]),t.current}let y={};function w(e,t){return(0,r.useMemo)((()=>{if(t)return t;const n=null==y[e]?0:y[e]+1;return y[e]=n,e+"-"+n}),[e,t])}function x(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.reduce(((t,n)=>{const r=Object.entries(n);for(const[o,i]of r){const n=t[o];null!=n&&(t[o]=n+e*i)}return t}),{...t})}}const C=x(1),E=x(-1);function D(e){if(!e)return!1;const{KeyboardEvent:t}=l(e.target);return t&&e instanceof t}function R(e){if(function(e){if(!e)return!1;const{TouchEvent:t}=l(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 S=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[S.Translate.toString(e),S.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),k="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function T(e){return e.matches(k)?e:e.querySelector(k)}},31738:function(e,t,n){n.d(t,{K:function(){return d}});var r=n(28165),o=n(39479),i=n(52676),a=n(77293),l=n(61854),s=n(70776),c=n(98628);const u=(0,o.B)("BooleanInput",{root:()=>[(0,r.iv)({position:"relative",display:"inline-block"})],inner:e=>[(0,r.iv)({display:"block",position:"relative",zIndex:1,border:`2px solid ${s.w.neutral600}`,backgroundColor:"transparent",cursor:"pointer",transition:`all ${c.f.transitionDuration} ease-in-out`}),"checkbox"===e.type&&[(0,i.Q)("checkbox",(0,r.iv)({width:18,height:18,borderRadius:3,color:s.w.neutral100})),e.checked&&(0,i.Q)("checked",(0,r.iv)({backgroundColor:s.w.blue,borderColor:"transparent"})),e.isErrored&&(0,i.Q)("errored",(0,r.iv)({backgroundColor:e.checked?s.w.error:"transparent",borderColor:s.w.error})),e.disabled&&(0,i.Q)("disabled",(0,r.iv)({backgroundColor:e.checked?s.w.neutral500:"transparent",borderColor:s.w.neutral500,cursor:"not-allowed"}))],"radio"===e.type&&[(0,i.Q)("radio",(0,r.iv)({color:"transparent",width:20,height:20,borderRadius:20})),e.checked&&(0,i.Q)("checked",(0,r.iv)({borderColor:s.w.blue,color:s.w.blue})),e.isErrored&&(0,i.Q)("errored",(0,r.iv)({borderColor:s.w.error,color:s.w.error})),e.disabled&&(0,i.Q)("disabled",(0,r.iv)({borderColor:s.w.neutral500,color:s.w.neutral500,cursor:"not-allowed"}))]],layer:(0,r.iv)({display:"flex",alignItems:"center",justifyContent:"center",position:"absolute",top:-2,left:-2,width:"calc(100% + 4px)",height:"calc(100% + 4px)"})}),d=({type:e,ariaLabel:t,checked:n=!1,disabled:r,id:o,isErrored:i,isRequired:s,name:c,onChange:d=(()=>{}),tabIndex:f=0,value:h})=>{const v={type:e,ariaLabel:t,checked:n,disabled:r,id:o,isErrored:i,isRequired:s,name:c,onChange:d,tabIndex:f,value:h};return(0,a.U)("span",{css:u.root()},(0,a.U)("span",{css:u.inner(v)},(0,a.U)("input",{"aria-label":t,checked:n,css:u.layer,disabled:r,id:o,name:c,onChange:d,required:s,tabIndex:f,type:e,value:h}),n&&(0,a.U)("span",{css:u.layer},(0,a.U)(l.J,{isBlock:!0,name:{checkbox:"formCheck",radio:"formRadioDot"}[e],size:18}))))}},71802:function(e,t,n){n.d(t,{G:function(){return h}});var r=n(28165),o=n(39479),i=n(77293),a=n(38137),l=n(98628),s=n(70776),c=n(61446),u=n(31738);const d=(0,a.F)("LabeledBooleanInput",["outlineColor"]),f=(0,o.B)("LabeledBooleanInput",{root:r.iv`
${d.outlineColor}: transparent;
position: relative;
display: grid;
grid-template-columns: auto 1fr;
gap: 8px;
align-items: center;
padding: 10px 8px;
min-height: 0;
// This is the outline that renders around the label when
// it's focused. It's a pseudo element to preserve transparency
// between the edge of the label and the edge of the outline.
// It's defined here vs only in ':focus-with' so that it can transition
// between states.
&::before {
content: '';
position: absolute;
pointer-events: none;
top: 0;
right: 0;
bottom: 0;
left: 0;
border: 2px solid var(${d.outlineColor});
border-radius: 3px;
transition: ${l.f.transitionValue};
}
&:focus-within {
${d.outlineColor}: ${s.w.blue};
&[data-errored] {
${d.outlineColor}: ${s.w.error};
}
}
`}),h=({children:e,type:t,value:n,ariaLabel:r,id:o,isDisabled:a,isErrored:l,isRequired:s,name:d,checked:h=!1,onChange:v=(()=>{}),tabIndex:g=0})=>(0,i.U)(c.l,{isDisabled:a,isErrored:l,isRequired:s,isSelected:h,justifyContent:"stretch"},(0,i.U)("span",{css:f.root,"data-errored":l?"":void 0},(0,i.U)(u.K,{ariaLabel:r,checked:h,disabled:a,id:o,isErrored:l,name:d,onChange:v,tabIndex:g,type:t,value:n}),e))},90818:function(e,t,n){n.d(t,{f:function(){return a}});var r=n(77293),o=n(71802),i=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n};const a=e=>{var{disabled:t,isDisabled:n}=e,a=i(e,["disabled","isDisabled"]);return(0,r.U)(o.G,Object.assign({},a,{isDisabled:t||n,type:"checkbox"}))}},17688:function(e,t,n){n.d(t,{g:function(){return g}});var r=n(2784),o=n(28165),i=n(39479),a=n(77293),l=n(61854),s=n(61446),c=n(3e3),u=n(70776),d=n(60196),f=n(61814);const h=(0,i.B)("Field",{root:o.iv`
display: grid;
grid-gap: 5px;
`,helpTextWrapper:o.iv`
${c.ZT.smallPrint1}
`,helpText:o.iv`
display: grid;
grid-template-columns: 1fr auto;
grid-gap: 10px;
align-items: start;
color: ${u.w.neutral700};
`,helpTextInner:o.iv`
padding-top: 1px;
overflow: hidden;
display: -webkit-box;
-webkit-box-orient: vertical;
// Without this truncation won't properly occur.
* {
display: inline;
margin: 0;
}
`,helpTextToggle:o.iv`
cursor: pointer;
text-decoration: underline;
text-transform: lowercase;
// Prevent help text toggle size from changing.
width: 33px;
&:hover,
&:focus {
outline: 1px solid ${u.w.blue};
outline-offset: 1px;
color: ${u.w.blue};
}
`,error:o.iv`
display: inline;
color: ${u.w.error400};
`}),v=({children:e,helpTextLineClamp:t})=>{const[n,o]=(0,r.useState)(!1),[i,l]=(0,d.I)(),s=i&&(0,a.U)("button",{"aria-hidden":"true",css:h.helpTextToggle,onClick:()=>o(!n),type:"button"},n?"Less":"More"),c={WebkitLineClamp:n?void 0:t};return(0,a.U)("div",{css:h.helpText},(0,a.U)("div",{css:h.helpTextInner,ref:e=>l(e),style:c},(0,a.U)("div",null,e)),s)},g=({label:e,renderInput:t,error:n,inputId:o,isDisabled:i,isRequired:c,helpTextLineClamp:u=1,renderHelpText:d,renderLabel:g,requiredText:p})=>{const[b]=(0,r.useState)(o||(0,f.E)("Field-")),m=`${b}-description`,y=d&&d();return(0,a.U)("div",{css:h.root},(0,a.U)("div",null,g?g({htmlFor:b,isDisabled:i,isErrored:!!n,isRequired:c,label:e,requiredText:p}):(0,a.U)(s.l,{alignItems:"start",htmlFor:b,isDisabled:i,isErrored:!!n,isRequired:c,requiredText:p,size:"small"},n&&(0,a.U)(l.J,{color:"error400",isBlock:!0,name:"formXCircle",size:18}),(0,a.U)("span",null,e))),(0,a.U)("div",null,t({ariaDescribedBy:y||n?m:void 0,id:b,isDisabled:!!i,isErrored:!!n,isRequired:!!c})),(0,a.U)("div",{"aria-live":n?"polite":"off",css:h.helpTextWrapper,id:m},(y||n)&&(0,a.U)(v,{helpTextLineClamp:u},n&&(0,a.U)("div",{css:h.error},n," "),y)))}},61446:function(e,t,n){n.d(t,{l:function(){return d}});var r=n(28165),o=n(39479),i=n(77293),a=n(70776),l=n(3e3);const s=(0,o.B)("FormLabelRequiredText",{root:Object.assign(Object.assign({},l.ZT.smallPrint1),{color:a.w.neutral700,textTransform:"lowercase","&::before":{content:'"("'},"&::after":{content:'")"'},'&[data-state="disabled"]':{color:a.w.neutral500}})}),c=({children:e="Required",isDisabled:t=!1})=>(0,i.U)("span",{"aria-hidden":"true",css:s.root,"data-state":t?"disabled":void 0},e),u=(0,o.B)("FormLabel",{root:r.iv`
display: grid;
justify-content: start;
grid-gap: 5px;
grid-auto-flow: column;
grid-auto-columns: auto;
cursor: pointer;
color: ${a.w.neutral700};
&[data-align-items='center'] {
align-items: center;
}
&[data-align-items='start'] {
align-items: start;
}
&[data-justify-content='start'] {
justify-content: start;
}
&[data-justify-content='stretch'] {
justify-content: stretch;
}
&[data-state~='selected'] {
color: ${a.w.blue};
}
&[data-state~='errored'] {
color: ${a.w.error400};
}
&[data-state~='disabled'] {
cursor: not-allowed;
}
&[data-state~='disabled'] {
color: ${a.w.neutral500};
}
&[data-size='small'] {
${l.ZT.smallPrint1Semibold};
}
&[data-size='medium'] {
${l.ZT.paragraph3Medium};
}
&[data-size='medium'][data-state='selected'] {
${l.ZT.paragraph3Semibold}
}
`}),d=({children:e,alignItems:t="center",htmlFor:n,isDisabled:r,isErrored:o,isRequired:a,isSelected:l,justifyContent:s="start",requiredText:d,size:f="medium"})=>(0,i.U)("label",{css:u.root,"data-align-items":t,"data-justify-content":s,"data-size":f,"data-state":[l&&"selected",o&&"errored",r&&"disabled"].filter(Boolean).join(" ")||void 0,htmlFor:n},a&&"*",e,a?d?(0,i.U)(c,{isDisabled:r},d):(0,i.U)(c,{isDisabled:r}):null)}}]);
//# sourceMappingURL=991-31f60a9cfbd3daef.js.map