a(u,n)))break e;e[r]=u,e[c]=n,r=c}}}return t}function a(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if("object"==typeof performance&&"function"==typeof performance.now){var i=performance;t.unstable_now=function(){return i.now()}}else{var l=Date,s=l.now();t.unstable_now=function(){return l.now()-s}}var c=[],u=[],d=1,f=null,p=3,m=!1,g=!1,h=!1,y="function"==typeof setTimeout?setTimeout:null,b="function"==typeof clearTimeout?clearTimeout:null,v="undefined"!=typeof setImmediate?setImmediate:null;function w(e){for(var t=r(u);null!==t;){if(null===t.callback)o(u);else{if(!(t.startTime<=e))break;o(u),t.sortIndex=t.expirationTime,n(c,t)}t=r(u)}}function E(e){if(h=!1,w(e),!g)if(null!==r(c))g=!0,T(x);else{var t=r(u);null!==t&&A(E,t.startTime-e)}}function x(e,n){g=!1,h&&(h=!1,b(C),C=-1),m=!0;var a=p;try{for(w(n),f=r(c);null!==f&&(!(f.expirationTime>n)||e&&!_());){var i=f.callback;if("function"==typeof i){f.callback=null,p=f.priorityLevel;var l=i(f.expirationTime<=n);n=t.unstable_now(),"function"==typeof l?f.callback=l:f===r(c)&&o(c),w(n)}else o(c);f=r(c)}if(null!==f)var s=!0;else{var d=r(u);null!==d&&A(E,d.startTime-n),s=!1}return s}finally{f=null,p=a,m=!1}}"undefined"!=typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var S,O=!1,k=null,C=-1,P=5,D=-1;function _(){return!(t.unstable_now()-De||125i?(e.sortIndex=a,n(u,e),null===r(c)&&e===r(u)&&(h?(b(C),C=-1):h=!0,A(E,a-i))):(e.sortIndex=l,n(c,e),g||m||(g=!0,T(x))),e},t.unstable_shouldYield=_,t.unstable_wrapCallback=function(e){var t=p;return function(){var n=p;p=t;try{return e.apply(this,arguments)}finally{p=n}}}},840:(e,t,n)=>{"use strict";e.exports=n(53)},250:(e,t,n)=>{"use strict";var r=n(294),o="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},a=r.useState,i=r.useEffect,l=r.useLayoutEffect,s=r.useDebugValue;function c(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!o(e,n)}catch(e){return!0}}var u="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var n=t(),r=a({inst:{value:n,getSnapshot:t}}),o=r[0].inst,u=r[1];return l((function(){o.value=n,o.getSnapshot=t,c(o)&&u({inst:o})}),[e,n,t]),i((function(){return c(o)&&u({inst:o}),e((function(){c(o)&&u({inst:o})}))}),[e]),s(n),n};t.useSyncExternalStore=void 0!==r.useSyncExternalStore?r.useSyncExternalStore:u},139:(e,t,n)=>{"use strict";var r=n(294),o=n(688),a="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},i=o.useSyncExternalStore,l=r.useRef,s=r.useEffect,c=r.useMemo,u=r.useDebugValue;t.useSyncExternalStoreWithSelector=function(e,t,n,r,o){var d=l(null);if(null===d.current){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c((function(){function e(e){if(!s){if(s=!0,i=e,e=r(e),void 0!==o&&f.hasValue){var t=f.value;if(o(t,e))return l=t}return l=e}if(t=l,a(i,e))return t;var n=r(e);return void 0!==o&&o(t,n)?t:(i=e,l=n)}var i,l,s=!1,c=void 0===n?null:n;return[function(){return e(t())},null===c?void 0:function(){return e(c())}]}),[t,n,r,o]);var p=i(e,d[0],d[1]);return s((function(){f.hasValue=!0,f.value=p}),[p]),u(p),p}},688:(e,t,n)=>{"use strict";e.exports=n(250)},798:(e,t,n)=>{"use strict";e.exports=n(139)},473:e=>{"use strict";e.exports=function(){}}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var a=t[r]={exports:{}};return e[r].call(a.exports,a,a.exports,n),a.exports}n.n=e=>{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.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";var e=n(294),t=n(745),r=n(935);function o(e){return o="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},o(e)}function a(e){var t=function(e,t){if("object"!=o(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=o(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==o(t)?t:String(t)}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function l(e){for(var t=1;tb,w=Symbol.for("react-redux-context"),E="undefined"!=typeof globalThis?globalThis:{};function x(){var t;if(!e.createContext)return{};const n=null!=(t=E[w])?t:E[w]=new Map;let r=n.get(e.createContext);return r||(r=e.createContext(null),n.set(e.createContext,r)),r}const S=x();let O=null;function k(){return k=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0||(o[n]=e[n]);return o}var P=n(679),D=n.n(P),_=n(366);const N=["initMapStateToProps","initMapDispatchToProps","initMergeProps"];function I(e,t,n,r,{areStatesEqual:o,areOwnPropsEqual:a,areStatePropsEqual:i}){let l,s,c,u,d,f=!1;return function(p,m){return f?function(f,p){const m=!a(p,s),g=!o(f,l,p,s);return l=f,s=p,m&&g?(c=e(l,s),t.dependsOnOwnProps&&(u=t(r,s)),d=n(c,u,s),d):m?(e.dependsOnOwnProps&&(c=e(l,s)),t.dependsOnOwnProps&&(u=t(r,s)),d=n(c,u,s),d):g?function(){const t=e(l,s),r=!i(t,c);return c=t,r&&(d=n(c,u,s)),d}():d}(p,m):(l=p,s=m,c=e(l,s),u=t(r,s),d=n(c,u,s),f=!0,d)}}function R(e){return function(t){const n=e(t);function r(){return n}return r.dependsOnOwnProps=!1,r}}function T(e){return e.dependsOnOwnProps?Boolean(e.dependsOnOwnProps):1!==e.length}function A(e,t){return function(t,{displayName:n}){const r=function(e,t){return r.dependsOnOwnProps?r.mapToProps(e,t):r.mapToProps(e,void 0)};return r.dependsOnOwnProps=!0,r.mapToProps=function(t,n){r.mapToProps=e,r.dependsOnOwnProps=T(e);let o=r(t,n);return"function"==typeof o&&(r.mapToProps=o,r.dependsOnOwnProps=T(o),o=r(t,n)),o},r}}function j(e,t){return(n,r)=>{throw new Error(`Invalid value of type ${typeof e} for ${t} argument when connecting component ${r.wrappedComponentName}.`)}}function L(e,t,n){return k({},n,e,t)}const M={notify(){},get:()=>[]};function B(e,t){let n,r=M,o=0,a=!1;function i(){c.onStateChange&&c.onStateChange()}function l(){o++,n||(n=t?t.addNestedSub(i):e.subscribe(i),r=function(){const e=v();let t=null,n=null;return{clear(){t=null,n=null},notify(){e((()=>{let e=t;for(;e;)e.callback(),e=e.next}))},get(){let e=[],n=t;for(;n;)e.push(n),n=n.next;return e},subscribe(e){let r=!0,o=n={callback:e,next:null,prev:n};return o.prev?o.prev.next=o:t=o,function(){r&&null!==t&&(r=!1,o.next?o.next.prev=o.prev:n=o.prev,o.prev?o.prev.next=o.next:t=o.next)}}}}())}function s(){o--,n&&0===o&&(n(),n=void 0,r.clear(),r=M)}const c={addNestedSub:function(e){l();const t=r.subscribe(e);let n=!1;return()=>{n||(n=!0,t(),s())}},notifyNestedSubs:function(){r.notify()},handleChangeWrapper:i,isSubscribed:function(){return a},trySubscribe:function(){a||(a=!0,l())},tryUnsubscribe:function(){a&&(a=!1,s())},getListeners:()=>r};return c}const F="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?e.useLayoutEffect:e.useEffect;function z(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!=e&&t!=t}function U(e,t){if(z(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r=0;r{throw new Error("uSES not initialized!")};const H=[null,null];function G(e,t,n,r,o,a){e.current=r,n.current=!1,o.current&&(o.current=null,a())}function V(e,t){return e===t}const q=function(t,n,r,{pure:o,areStatesEqual:a=V,areOwnPropsEqual:i=U,areStatePropsEqual:l=U,areMergedPropsEqual:s=U,forwardRef:c=!1,context:u=S}={}){const d=u,f=function(e){return e?"function"==typeof e?A(e):j(e,"mapStateToProps"):R((()=>({})))}(t),p=function(e){return e&&"object"==typeof e?R((t=>function(e,t){const n={};for(const r in e){const o=e[r];"function"==typeof o&&(n[r]=(...e)=>t(o(...e)))}return n}(e,t))):e?"function"==typeof e?A(e):j(e,"mapDispatchToProps"):R((e=>({dispatch:e})))}(n),m=function(e){return e?"function"==typeof e?function(e){return function(t,{displayName:n,areMergedPropsEqual:r}){let o,a=!1;return function(t,n,i){const l=e(t,n,i);return a?r(l,o)||(o=l):(a=!0,o=l),o}}}(e):j(e,"mergeProps"):()=>L}(r),g=Boolean(t);return t=>{const n=t.displayName||t.name||"Component",r=`Connect(${n})`,o={shouldHandleStateChanges:g,displayName:r,wrappedComponentName:n,WrappedComponent:t,initMapStateToProps:f,initMapDispatchToProps:p,initMergeProps:m,areStatesEqual:a,areStatePropsEqual:l,areOwnPropsEqual:i,areMergedPropsEqual:s};function u(n){const[r,a,i]=e.useMemo((()=>{const{reactReduxForwardedRef:e}=n,t=C(n,$);return[n.context,e,t]}),[n]),l=e.useMemo((()=>r&&r.Consumer&&(0,_.isContextConsumer)(e.createElement(r.Consumer,null))?r:d),[r,d]),s=e.useContext(l),c=Boolean(n.store)&&Boolean(n.store.getState)&&Boolean(n.store.dispatch),u=Boolean(s)&&Boolean(s.store),f=c?n.store:s.store,p=u?s.getServerState:f.getState,m=e.useMemo((()=>function(e,t){let{initMapStateToProps:n,initMapDispatchToProps:r,initMergeProps:o}=t,a=C(t,N);return I(n(e,a),r(e,a),o(e,a),e,a)}(f.dispatch,o)),[f]),[h,y]=e.useMemo((()=>{if(!g)return H;const e=B(f,c?void 0:s.subscription),t=e.notifyNestedSubs.bind(e);return[e,t]}),[f,c,s]),b=e.useMemo((()=>c?s:k({},s,{subscription:h})),[c,s,h]),v=e.useRef(),w=e.useRef(i),E=e.useRef(),x=e.useRef(!1),S=(e.useRef(!1),e.useRef(!1)),O=e.useRef();F((()=>(S.current=!0,()=>{S.current=!1})),[]);const P=e.useMemo((()=>()=>E.current&&i===w.current?E.current:m(f.getState(),i)),[f,i]),D=e.useMemo((()=>e=>h?function(e,t,n,r,o,a,i,l,s,c,u){if(!e)return()=>{};let d=!1,f=null;const p=()=>{if(d||!l.current)return;const e=t.getState();let n,p;try{n=r(e,o.current)}catch(e){p=e,f=e}p||(f=null),n===a.current?i.current||c():(a.current=n,s.current=n,i.current=!0,u())};return n.onStateChange=p,n.trySubscribe(),p(),()=>{if(d=!0,n.tryUnsubscribe(),n.onStateChange=null,f)throw f}}(g,f,h,m,w,v,x,S,E,y,e):()=>{}),[h]);var R,T;let A;R=G,T=[w,v,x,i,E,y],F((()=>R(...T)),undefined);try{A=W(D,P,p?()=>m(p(),i):P)}catch(e){throw O.current&&(e.message+=`\nThe error may be correlated with this previous error:\n${O.current.stack}\n\n`),e}F((()=>{O.current=void 0,E.current=void 0,v.current=A}));const j=e.useMemo((()=>e.createElement(t,k({},A,{ref:a}))),[a,t,A]);return e.useMemo((()=>g?e.createElement(l.Provider,{value:b},j):j),[l,j,b])}const h=e.memo(u);if(h.WrappedComponent=t,h.displayName=u.displayName=r,c){const n=e.forwardRef((function(t,n){return e.createElement(h,k({},t,{reactReduxForwardedRef:n}))}));return n.displayName=r,n.WrappedComponent=t,D()(n,t)}return D()(h,t)}},K=function({store:t,context:n,children:r,serverState:o,stabilityCheck:a="once",noopCheck:i="once"}){const l=e.useMemo((()=>{const e=B(t);return{store:t,subscription:e,getServerState:o?()=>o:void 0,stabilityCheck:a,noopCheck:i}}),[t,o,a,i]),s=e.useMemo((()=>t.getState()),[t]);F((()=>{const{subscription:e}=l;return e.onStateChange=e.notifyNestedSubs,e.trySubscribe(),s!==t.getState()&&e.notifyNestedSubs(),()=>{e.tryUnsubscribe(),e.onStateChange=void 0}}),[l,s]);const c=n||S;return e.createElement(c.Provider,{value:l},r)};var Q;function Y(t,n){var r=(0,e.useState)((function(){return{inputs:n,result:t()}}))[0],o=(0,e.useRef)(!0),a=(0,e.useRef)(r),i=o.current||Boolean(n&&a.current.inputs&&function(e,t){if(e.length!==t.length)return!1;for(var n=0;n{W=e})(h.useSyncExternalStore),Q=r.unstable_batchedUpdates,b=Q;var X=Y,J=function(e,t){return Y((function(){return e}),t)},Z=function(e){var t=e.top,n=e.right,r=e.bottom,o=e.left;return{top:t,right:n,bottom:r,left:o,width:n-o,height:r-t,x:o,y:t,center:{x:(n+o)/2,y:(r+t)/2}}},ee=function(e,t){return{top:e.top-t.top,left:e.left-t.left,bottom:e.bottom+t.bottom,right:e.right+t.right}},te=function(e,t){return{top:e.top+t.top,left:e.left+t.left,bottom:e.bottom-t.bottom,right:e.right-t.right}},ne={top:0,right:0,bottom:0,left:0},re=function(e){var t=e.borderBox,n=e.margin,r=void 0===n?ne:n,o=e.border,a=void 0===o?ne:o,i=e.padding,l=void 0===i?ne:i,s=Z(ee(t,r)),c=Z(te(t,a)),u=Z(te(c,l));return{marginBox:s,borderBox:Z(t),paddingBox:c,contentBox:u,margin:r,border:a,padding:l}},oe=function(e){var t=e.slice(0,-2);if("px"!==e.slice(-2))return 0;var n=Number(t);return isNaN(n)&&function(e,t){throw new Error("Invariant failed")}(),n},ae=function(e,t){var n,r,o=e.borderBox,a=e.border,i=e.margin,l=e.padding,s=(r=t,{top:(n=o).top+r.y,left:n.left+r.x,bottom:n.bottom+r.y,right:n.right+r.x});return re({borderBox:s,border:a,margin:i,padding:l})},ie=function(e,t){return void 0===t&&(t={x:window.pageXOffset,y:window.pageYOffset}),ae(e,t)},le=function(e,t){var n={top:oe(t.marginTop),right:oe(t.marginRight),bottom:oe(t.marginBottom),left:oe(t.marginLeft)},r={top:oe(t.paddingTop),right:oe(t.paddingRight),bottom:oe(t.paddingBottom),left:oe(t.paddingLeft)},o={top:oe(t.borderTopWidth),right:oe(t.borderRightWidth),bottom:oe(t.borderBottomWidth),left:oe(t.borderLeftWidth)};return re({borderBox:e,margin:n,padding:r,border:o})},se=function(e){var t=e.getBoundingClientRect(),n=window.getComputedStyle(e);return le(t,n)},ce=Number.isNaN||function(e){return"number"==typeof e&&e!=e};function ue(e,t){if(e.length!==t.length)return!1;for(var n=0;n{const r=(o=n,a=t.options,{...o,...a});var o,a;return e.addEventListener(t.eventName,t.fn,r),function(){e.removeEventListener(t.eventName,t.fn,r)}}));return function(){r.forEach((e=>{e()}))}}pe.bind(null,"warn"),pe.bind(null,"error");const he=!0,ye="Invariant failed";class be extends Error{}function ve(e,t){if(!e)throw new be(he?ye:`${ye}: ${t||""}`)}be.prototype.toString=function(){return this.message};class we extends e.Component{constructor(...e){super(...e),this.callbacks=null,this.unbind=me,this.onWindowError=e=>{const t=this.getCallbacks();t.isDragging()&&t.tryAbort(),e.error instanceof be&&e.preventDefault()},this.getCallbacks=()=>{if(!this.callbacks)throw new Error("Unable to find AppCallbacks in ");return this.callbacks},this.setCallbacks=e=>{this.callbacks=e}}componentDidMount(){this.unbind=ge(window,[{eventName:"error",fn:this.onWindowError}])}componentDidCatch(e){if(!(e instanceof be))throw e;this.setState({})}componentWillUnmount(){this.unbind()}render(){return this.props.children(this.setCallbacks)}}const Ee=e=>e+1,xe=(e,t)=>{const n=e.droppableId===t.droppableId,r=Ee(e.index),o=Ee(t.index);return n?`\n You have moved the item from position ${r}\n to position ${o}\n `:`\n You have moved the item from position ${r}\n in list ${e.droppableId}\n to list ${t.droppableId}\n in position ${o}\n `},Se=(e,t,n)=>t.droppableId===n.droppableId?`\n The item ${e}\n has been combined with ${n.draggableId}`:`\n The item ${e}\n in list ${t.droppableId}\n has been combined with ${n.draggableId}\n in list ${n.droppableId}\n `,Oe=e=>`\n The item has returned to its starting position\n of ${Ee(e.index)}\n`,ke={dragHandleUsageInstructions:"\n Press space bar to start a drag.\n When dragging you can use the arrow keys to move the item around and escape to cancel.\n Some screen readers may require you to be in focus mode or to use your pass through key\n",onDragStart:e=>`\n You have lifted an item in position ${Ee(e.source.index)}\n`,onDragUpdate:e=>{const t=e.destination;if(t)return xe(e.source,t);const n=e.combine;return n?Se(e.draggableId,e.source,n):"You are over an area that cannot be dropped on"},onDragEnd:e=>{if("CANCEL"===e.reason)return`\n Movement cancelled.\n ${Oe(e.source)}\n `;const t=e.destination,n=e.combine;return t?`\n You have dropped the item.\n ${xe(e.source,t)}\n `:n?`\n You have dropped the item.\n ${Se(e.draggableId,e.source,n)}\n `:`\n The item has been dropped while not over a drop area.\n ${Oe(e.source)}\n `}};var Ce=ke;const Pe={x:0,y:0},De=(e,t)=>({x:e.x+t.x,y:e.y+t.y}),_e=(e,t)=>({x:e.x-t.x,y:e.y-t.y}),Ne=(e,t)=>e.x===t.x&&e.y===t.y,Ie=e=>({x:0!==e.x?-e.x:0,y:0!==e.y?-e.y:0}),Re=(e,t,n=0)=>"x"===e?{x:t,y:n}:{x:n,y:t},Te=(e,t)=>Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2),Ae=(e,t)=>Math.min(...t.map((t=>Te(e,t)))),je=e=>t=>({x:e(t.x),y:e(t.y)}),Le=(e,t)=>({top:e.top+t.y,left:e.left+t.x,bottom:e.bottom+t.y,right:e.right+t.x}),Me=e=>[{x:e.left,y:e.top},{x:e.right,y:e.top},{x:e.left,y:e.bottom},{x:e.right,y:e.bottom}],Be=(e,t)=>t&&t.shouldClipSubject?((e,t)=>{const n=Z({top:Math.max(t.top,e.top),right:Math.min(t.right,e.right),bottom:Math.min(t.bottom,e.bottom),left:Math.max(t.left,e.left)});return n.width<=0||n.height<=0?null:n})(t.pageMarginBox,e):Z(e);var Fe=({page:e,withPlaceholder:t,axis:n,frame:r})=>{const o=((e,t)=>t?Le(e,t.scroll.diff.displacement):e)(e.marginBox,r),a=((e,t,n)=>n&&n.increasedBy?{...e,[t.end]:e[t.end]+n.increasedBy[t.line]}:e)(o,n,t);return{page:e,withPlaceholder:t,active:Be(a,r)}},ze=(e,t)=>{e.frame||ve(!1);const n=e.frame,r=_e(t,n.scroll.initial),o=Ie(r),a={...n,scroll:{initial:n.scroll.initial,current:t,diff:{value:r,displacement:o},max:n.scroll.max}},i=Fe({page:e.subject.page,withPlaceholder:e.subject.withPlaceholder,axis:e.axis,frame:a});return{...e,frame:a,subject:i}};const Ue=de((e=>e.reduce(((e,t)=>(e[t.descriptor.id]=t,e)),{}))),$e=de((e=>e.reduce(((e,t)=>(e[t.descriptor.id]=t,e)),{}))),We=de((e=>Object.values(e))),He=de((e=>Object.values(e)));var Ge=de(((e,t)=>{const n=He(t).filter((t=>e===t.descriptor.droppableId)).sort(((e,t)=>e.descriptor.index-t.descriptor.index));return n}));function Ve(e){return e.at&&"REORDER"===e.at.type?e.at.destination:null}function qe(e){return e.at&&"COMBINE"===e.at.type?e.at.combine:null}var Ke=de(((e,t)=>t.filter((t=>t.descriptor.id!==e.descriptor.id)))),Qe=(e,t)=>e.descriptor.droppableId===t.descriptor.id;const Ye={point:Pe,value:0},Xe={invisible:{},visible:{},all:[]};var Je={displaced:Xe,displacedBy:Ye,at:null},Ze=(e,t)=>n=>e<=n&&n<=t,et=e=>{const t=Ze(e.top,e.bottom),n=Ze(e.left,e.right);return r=>{if(t(r.top)&&t(r.bottom)&&n(r.left)&&n(r.right))return!0;const o=t(r.top)||t(r.bottom),a=n(r.left)||n(r.right);if(o&&a)return!0;const i=r.tope.bottom,l=r.lefte.right;return!(!i||!l)||(i&&a||l&&o)}},tt=e=>{const t=Ze(e.top,e.bottom),n=Ze(e.left,e.right);return e=>t(e.top)&&t(e.bottom)&&n(e.left)&&n(e.right)};const nt={direction:"vertical",line:"y",crossAxisLine:"x",start:"top",end:"bottom",size:"height",crossAxisStart:"left",crossAxisEnd:"right",crossAxisSize:"width"},rt={direction:"horizontal",line:"x",crossAxisLine:"y",start:"left",end:"right",size:"width",crossAxisStart:"top",crossAxisEnd:"bottom",crossAxisSize:"height"},ot=({target:e,destination:t,viewport:n,withDroppableDisplacement:r,isVisibleThroughFrameFn:o})=>{const a=r?((e,t)=>{const n=t.frame?t.frame.scroll.diff.displacement:Pe;return Le(e,n)})(e,t):e;return((e,t,n)=>!!t.subject.active&&n(t.subject.active)(e))(a,t,o)&&((e,t,n)=>n(t)(e))(a,n,o)},at=e=>ot({...e,isVisibleThroughFrameFn:et}),it=e=>ot({...e,isVisibleThroughFrameFn:tt}),lt=(e,t,n)=>{if("boolean"==typeof n)return n;if(!t)return!0;const{invisible:r,visible:o}=t;if(r[e])return!1;const a=o[e];return!a||a.shouldAnimate};function st({afterDragging:e,destination:t,displacedBy:n,viewport:r,forceShouldAnimate:o,last:a}){return e.reduce((function(e,i){const l=function(e,t){const n=e.page.marginBox,r={top:t.point.y,right:0,bottom:0,left:t.point.x};return Z(ee(n,r))}(i,n),s=i.descriptor.id;if(e.all.push(s),!at({target:l,destination:t,viewport:r,withDroppableDisplacement:!0}))return e.invisible[i.descriptor.id]=!0,e;const c={draggableId:s,shouldAnimate:lt(s,a,o)};return e.visible[s]=c,e}),{all:[],visible:{},invisible:{}})}function ct({insideDestination:e,inHomeList:t,displacedBy:n,destination:r}){const o=function(e,t){if(!e.length)return 0;const n=e[e.length-1].descriptor.index;return t.inHomeList?n:n+1}(e,{inHomeList:t});return{displaced:Xe,displacedBy:n,at:{type:"REORDER",destination:{droppableId:r.descriptor.id,index:o}}}}function ut({draggable:e,insideDestination:t,destination:n,viewport:r,displacedBy:o,last:a,index:i,forceShouldAnimate:l}){const s=Qe(e,n);if(null==i)return ct({insideDestination:t,inHomeList:s,displacedBy:o,destination:n});const c=t.find((e=>e.descriptor.index===i));if(!c)return ct({insideDestination:t,inHomeList:s,displacedBy:o,destination:n});const u=Ke(e,t),d=t.indexOf(c);return{displaced:st({afterDragging:u.slice(d),destination:n,displacedBy:o,last:a,viewport:r.frame,forceShouldAnimate:l}),displacedBy:o,at:{type:"REORDER",destination:{droppableId:n.descriptor.id,index:i}}}}function dt(e,t){return Boolean(t.effected[e])}const ft=(e,t)=>t.margin[e.start]+t.borderBox[e.size]/2,pt=(e,t,n)=>t[e.crossAxisStart]+n.margin[e.crossAxisStart]+n.borderBox[e.crossAxisSize]/2,mt=({axis:e,moveRelativeTo:t,isMoving:n})=>Re(e.line,t.marginBox[e.end]+ft(e,n),pt(e,t.marginBox,n)),gt=({axis:e,moveRelativeTo:t,isMoving:n})=>Re(e.line,t.marginBox[e.start]-((e,t)=>t.margin[e.end]+t.borderBox[e.size]/2)(e,n),pt(e,t.marginBox,n));var ht=(e,t)=>{const n=e.frame;return n?De(t,n.scroll.diff.displacement):t},yt=e=>{const t=(({impact:e,draggable:t,droppable:n,draggables:r,afterCritical:o})=>{const a=t.page.borderBox.center,i=e.at;return n&&i?"REORDER"===i.type?(({impact:e,draggable:t,draggables:n,droppable:r,afterCritical:o})=>{const a=Ge(r.descriptor.id,n),i=t.page,l=r.axis;if(!a.length)return(({axis:e,moveInto:t,isMoving:n})=>Re(e.line,t.contentBox[e.start]+ft(e,n),pt(e,t.contentBox,n)))({axis:l,moveInto:r.page,isMoving:i});const{displaced:s,displacedBy:c}=e,u=s.all[0];if(u){const e=n[u];if(dt(u,o))return gt({axis:l,moveRelativeTo:e.page,isMoving:i});const t=ae(e.page,c.point);return gt({axis:l,moveRelativeTo:t,isMoving:i})}const d=a[a.length-1];if(d.descriptor.id===t.descriptor.id)return i.borderBox.center;if(dt(d.descriptor.id,o)){const e=ae(d.page,Ie(o.displacedBy.point));return mt({axis:l,moveRelativeTo:e,isMoving:i})}return mt({axis:l,moveRelativeTo:d.page,isMoving:i})})({impact:e,draggable:t,draggables:r,droppable:n,afterCritical:o}):(({afterCritical:e,impact:t,draggables:n})=>{const r=qe(t);r||ve(!1);const o=r.draggableId,a=n[o].page.borderBox.center,i=(({displaced:e,afterCritical:t,combineWith:n,displacedBy:r})=>{const o=Boolean(e.visible[n]||e.invisible[n]);return dt(n,t)?o?Pe:Ie(r.point):o?r.point:Pe})({displaced:t.displaced,afterCritical:e,combineWith:o,displacedBy:t.displacedBy});return De(a,i)})({impact:e,draggables:r,afterCritical:o}):a})(e),n=e.droppable;return n?ht(n,t):t},bt=(e,t)=>{const n=_e(t,e.scroll.initial),r=Ie(n);return{frame:Z({top:t.y,bottom:t.y+e.frame.height,left:t.x,right:t.x+e.frame.width}),scroll:{initial:e.scroll.initial,max:e.scroll.max,current:t,diff:{value:n,displacement:r}}}};function vt(e,t){return e.map((e=>t[e]))}var wt=({pageBorderBoxCenter:e,draggable:t,viewport:n})=>{const r=((e,t)=>De(e.scroll.diff.displacement,t))(n,e),o=_e(r,t.page.borderBox.center);return De(t.client.borderBox.center,o)},Et=({draggable:e,destination:t,newPageBorderBoxCenter:n,viewport:r,withDroppableDisplacement:o,onlyOnMainAxis:a=!1})=>{const i=_e(n,e.page.borderBox.center),l={target:Le(e.page.borderBox,i),destination:t,withDroppableDisplacement:o,viewport:r};return a?(e=>{return ot({...e,isVisibleThroughFrameFn:(t=e.destination.axis,e=>{const n=Ze(e.top,e.bottom),r=Ze(e.left,e.right);return e=>t===nt?n(e.top)&&n(e.bottom):r(e.left)&&r(e.right)})});var t})(l):it(l)},xt=({isMovingForward:e,draggable:t,destination:n,draggables:r,previousImpact:o,viewport:a,previousPageBorderBoxCenter:i,previousClientSelection:l,afterCritical:s})=>{if(!n.isEnabled)return null;const c=Ge(n.descriptor.id,r),u=Qe(t,n),d=(({isMovingForward:e,draggable:t,destination:n,insideDestination:r,previousImpact:o})=>{if(!n.isCombineEnabled)return null;if(!Ve(o))return null;function a(e){const t={type:"COMBINE",combine:{draggableId:e,droppableId:n.descriptor.id}};return{...o,at:t}}const i=o.displaced.all,l=i.length?i[0]:null;if(e)return l?a(l):null;const s=Ke(t,r);if(!l)return s.length?a(s[s.length-1].descriptor.id):null;const c=s.findIndex((e=>e.descriptor.id===l));-1===c&&ve(!1);const u=c-1;return u<0?null:a(s[u].descriptor.id)})({isMovingForward:e,draggable:t,destination:n,insideDestination:c,previousImpact:o})||(({isMovingForward:e,isInHomeList:t,draggable:n,draggables:r,destination:o,insideDestination:a,previousImpact:i,viewport:l,afterCritical:s})=>{const c=i.at;if(c||ve(!1),"REORDER"===c.type){const r=(({isMovingForward:e,isInHomeList:t,insideDestination:n,location:r})=>{if(!n.length)return null;const o=r.index,a=e?o+1:o-1,i=n[0].descriptor.index,l=n[n.length-1].descriptor.index;return a(t?l:l+1)?null:a})({isMovingForward:e,isInHomeList:t,location:c.destination,insideDestination:a});return null==r?null:ut({draggable:n,insideDestination:a,destination:o,viewport:l,last:i.displaced,displacedBy:i.displacedBy,index:r})}const u=(({isMovingForward:e,destination:t,draggables:n,combine:r,afterCritical:o})=>{if(!t.isCombineEnabled)return null;const a=r.draggableId,i=n[a].descriptor.index;return dt(a,o)?e?i:i-1:e?i+1:i})({isMovingForward:e,destination:o,displaced:i.displaced,draggables:r,combine:c.combine,afterCritical:s});return null==u?null:ut({draggable:n,insideDestination:a,destination:o,viewport:l,last:i.displaced,displacedBy:i.displacedBy,index:u})})({isMovingForward:e,isInHomeList:u,draggable:t,draggables:r,destination:n,insideDestination:c,previousImpact:o,viewport:a,afterCritical:s});if(!d)return null;const f=yt({impact:d,draggable:t,droppable:n,draggables:r,afterCritical:s});if(Et({draggable:t,destination:n,newPageBorderBoxCenter:f,viewport:a.frame,withDroppableDisplacement:!1,onlyOnMainAxis:!0}))return{clientSelection:wt({pageBorderBoxCenter:f,draggable:t,viewport:a}),impact:d,scrollJumpRequest:null};const p=_e(f,i),m=(({impact:e,viewport:t,destination:n,draggables:r,maxScrollChange:o})=>{const a=bt(t,De(t.scroll.current,o)),i=n.frame?ze(n,De(n.frame.scroll.current,o)):n,l=e.displaced,s=st({afterDragging:vt(l.all,r),destination:n,displacedBy:e.displacedBy,viewport:a.frame,last:l,forceShouldAnimate:!1}),c=st({afterDragging:vt(l.all,r),destination:i,displacedBy:e.displacedBy,viewport:t.frame,last:l,forceShouldAnimate:!1}),u={},d={},f=[l,s,c];return l.all.forEach((e=>{const t=function(e,t){for(let n=0;n{const t=e.subject.active;return t||ve(!1),t},Ot=(e,t)=>{const n=e.page.borderBox.center;return dt(e.descriptor.id,t)?_e(n,t.displacedBy.point):n},kt=(e,t)=>{const n=e.page.borderBox;return dt(e.descriptor.id,t)?Le(n,Ie(t.displacedBy.point)):n};var Ct=de((function(e,t){const n=t[e.line];return{value:n,point:Re(e.line,n)}}));const Pt=(e,t)=>({...e,scroll:{...e.scroll,max:t}}),Dt=(e,t,n)=>{const r=e.frame;Qe(t,e)&&ve(!1),e.subject.withPlaceholder&&ve(!1);const o=Ct(e.axis,t.displaceBy).point,a=((e,t,n)=>{const r=e.axis;if("virtual"===e.descriptor.mode)return Re(r.line,t[r.line]);const o=e.subject.page.contentBox[r.size],a=Ge(e.descriptor.id,n).reduce(((e,t)=>e+t.client.marginBox[r.size]),0)+t[r.line]-o;return a<=0?null:Re(r.line,a)})(e,o,n),i={placeholderSize:o,increasedBy:a,oldFrameMaxScroll:e.frame?e.frame.scroll.max:null};if(!r){const t=Fe({page:e.subject.page,withPlaceholder:i,axis:e.axis,frame:e.frame});return{...e,subject:t}}const l=a?De(r.scroll.max,a):r.scroll.max,s=Pt(r,l),c=Fe({page:e.subject.page,withPlaceholder:i,axis:e.axis,frame:s});return{...e,subject:c,frame:s}};var _t=e=>{const t=e.at;return t?"REORDER"===t.type?t.destination.droppableId:t.combine.droppableId:null},Nt=({state:e,type:t})=>{const n=((e,t)=>{const n=_t(e);return n?t[n]:null})(e.impact,e.dimensions.droppables),r=Boolean(n),o=e.dimensions.droppables[e.critical.droppable.id],a=n||o,i=a.axis.direction,l="vertical"===i&&("MOVE_UP"===t||"MOVE_DOWN"===t)||"horizontal"===i&&("MOVE_LEFT"===t||"MOVE_RIGHT"===t);if(l&&!r)return null;const s="MOVE_DOWN"===t||"MOVE_RIGHT"===t,c=e.dimensions.draggables[e.critical.draggable.id],u=e.current.page.borderBoxCenter,{draggables:d,droppables:f}=e.dimensions;return l?xt({isMovingForward:s,previousPageBorderBoxCenter:u,draggable:c,destination:a,draggables:d,viewport:e.viewport,previousClientSelection:e.current.client.selection,previousImpact:e.impact,afterCritical:e.afterCritical}):(({isMovingForward:e,previousPageBorderBoxCenter:t,draggable:n,isOver:r,draggables:o,droppables:a,viewport:i,afterCritical:l})=>{const s=(({isMovingForward:e,pageBorderBoxCenter:t,source:n,droppables:r,viewport:o})=>{const a=n.subject.active;if(!a)return null;const i=n.axis,l=Ze(a[i.start],a[i.end]),s=We(r).filter((e=>e!==n)).filter((e=>e.isEnabled)).filter((e=>Boolean(e.subject.active))).filter((e=>et(o.frame)(St(e)))).filter((t=>{const n=St(t);return e?a[i.crossAxisEnd]{const t=St(e),n=Ze(t[i.start],t[i.end]);return l(t[i.start])||l(t[i.end])||n(a[i.start])||n(a[i.end])})).sort(((t,n)=>{const r=St(t)[i.crossAxisStart],o=St(n)[i.crossAxisStart];return e?r-o:o-r})).filter(((e,t,n)=>St(e)[i.crossAxisStart]===St(n[0])[i.crossAxisStart]));if(!s.length)return null;if(1===s.length)return s[0];const c=s.filter((e=>Ze(St(e)[i.start],St(e)[i.end])(t[i.line])));return 1===c.length?c[0]:c.length>1?c.sort(((e,t)=>St(e)[i.start]-St(t)[i.start]))[0]:s.sort(((e,n)=>{const r=Ae(t,Me(St(e))),o=Ae(t,Me(St(n)));return r!==o?r-o:St(e)[i.start]-St(n)[i.start]}))[0]})({isMovingForward:e,pageBorderBoxCenter:t,source:r,droppables:a,viewport:i});if(!s)return null;const c=Ge(s.descriptor.id,o),u=(({pageBorderBoxCenter:e,viewport:t,destination:n,insideDestination:r,afterCritical:o})=>{const a=r.filter((e=>it({target:kt(e,o),destination:n,viewport:t.frame,withDroppableDisplacement:!0}))).sort(((t,r)=>{const a=Te(e,ht(n,Ot(t,o))),i=Te(e,ht(n,Ot(r,o)));return a{if(!t){if(n.length)return null;const e={displaced:Xe,displacedBy:Ye,at:{type:"REORDER",destination:{droppableId:a.descriptor.id,index:0}}},t=yt({impact:e,draggable:r,droppable:a,draggables:o,afterCritical:l}),s=Qe(r,a)?a:Dt(a,r,o);return Et({draggable:r,destination:s,newPageBorderBoxCenter:t,viewport:i.frame,withDroppableDisplacement:!1,onlyOnMainAxis:!0})?e:null}const s=Boolean(e[a.axis.line]<=t.page.borderBox.center[a.axis.line]),c=(()=>{const e=t.descriptor.index;return t.descriptor.id===r.descriptor.id||s?e:e+1})(),u=Ct(a.axis,r.displaceBy);return ut({draggable:r,insideDestination:n,destination:a,viewport:i,displacedBy:u,last:Xe,index:c})})({previousPageBorderBoxCenter:t,destination:s,draggable:n,draggables:o,moveRelativeTo:u,insideDestination:c,viewport:i,afterCritical:l});if(!d)return null;const f=yt({impact:d,draggable:n,droppable:s,draggables:o,afterCritical:l});return{clientSelection:wt({pageBorderBoxCenter:f,draggable:n,viewport:i}),impact:d,scrollJumpRequest:null}})({isMovingForward:s,previousPageBorderBoxCenter:u,draggable:c,isOver:a,draggables:d,droppables:f,viewport:e.viewport,afterCritical:e.afterCritical})};function It(e){return"DRAGGING"===e.phase||"COLLECTING"===e.phase}function Rt(e){const t=Ze(e.top,e.bottom),n=Ze(e.left,e.right);return function(e){return t(e.y)&&n(e.x)}}const Tt=(e,t)=>Z(Le(e,t));function At({displaced:e,id:t}){return Boolean(e.visible[t]||e.invisible[t])}var jt=({pageOffset:e,draggable:t,draggables:n,droppables:r,previousImpact:o,viewport:a,afterCritical:i})=>{const l=Tt(t.page.borderBox,e),s=function({pageBorderBox:e,draggable:t,droppables:n}){const r=We(n).filter((t=>{if(!t.isEnabled)return!1;const n=t.subject.active;if(!n)return!1;if(o=n,!((r=e).lefto.left&&r.topo.top))return!1;var r,o;if(Rt(n)(e.center))return!0;const a=t.axis,i=n.center[a.crossAxisLine],l=e[a.crossAxisStart],s=e[a.crossAxisEnd],c=Ze(n[a.crossAxisStart],n[a.crossAxisEnd]),u=c(l),d=c(s);return!u&&!d||(u?li)}));return r.length?1===r.length?r[0].descriptor.id:function({pageBorderBox:e,draggable:t,candidates:n}){const r=t.page.borderBox.center,o=n.map((t=>{const n=t.axis,o=Re(t.axis.line,e.center[n.line],t.page.borderBox.center[n.crossAxisLine]);return{id:t.descriptor.id,distance:Te(r,o)}})).sort(((e,t)=>t.distance-e.distance));return o[0]?o[0].id:null}({pageBorderBox:e,draggable:t,candidates:r}):null}({pageBorderBox:l,draggable:t,droppables:r});if(!s)return Je;const c=r[s],u=Ge(c.descriptor.id,n),d=((e,t)=>{const n=e.frame;return n?Tt(t,n.scroll.diff.value):t})(c,l);return(({draggable:e,pageBorderBoxWithDroppableScroll:t,previousImpact:n,destination:r,insideDestination:o,afterCritical:a})=>{if(!r.isCombineEnabled)return null;const i=r.axis,l=Ct(r.axis,e.displaceBy),s=l.value,c=t[i.start],u=t[i.end],d=Ke(e,o).find((e=>{const t=e.descriptor.id,r=e.page.borderBox,o=r[i.size]/4,l=dt(t,a),d=At({displaced:n.displaced,id:t});return l?d?u>r[i.start]+o&&ur[i.start]-s+o&&cr[i.start]+s+o&&ur[i.start]+o&&c{const l=n.axis,s=Ct(n.axis,t.displaceBy),c=s.value,u=e[l.start],d=e[l.end],f=function({draggable:e,closest:t,inHomeList:n}){return t?n&&t.descriptor.index>e.descriptor.index?t.descriptor.index-1:t.descriptor.index:null}({draggable:t,closest:Ke(t,r).find((e=>{const t=e.descriptor.id,n=e.page.borderBox.center[l.line],r=dt(t,i),a=At({displaced:o,id:t});return r?a?d<=n:u({...e,[t.descriptor.id]:t});var Mt=({state:e,clientSelection:t,dimensions:n,viewport:r,impact:o,scrollJumpRequest:a})=>{const i=r||e.viewport,l=n||e.dimensions,s=t||e.current.client.selection,c=_e(s,e.initial.client.selection),u={offset:c,selection:s,borderBoxCenter:De(e.initial.client.borderBoxCenter,c)},d={selection:De(u.selection,i.scroll.current),borderBoxCenter:De(u.borderBoxCenter,i.scroll.current),offset:De(u.offset,i.scroll.diff.value)},f={client:u,page:d};if("COLLECTING"===e.phase)return{...e,dimensions:l,viewport:i,current:f};const p=l.draggables[e.critical.draggable.id],m=o||jt({pageOffset:d.offset,draggable:p,draggables:l.draggables,droppables:l.droppables,previousImpact:e.impact,viewport:i,afterCritical:e.afterCritical}),g=(({draggable:e,draggables:t,droppables:n,previousImpact:r,impact:o})=>{const a=(({previousImpact:e,impact:t,droppables:n})=>{const r=_t(e),o=_t(t);if(!r)return n;if(r===o)return n;const a=n[r];if(!a.subject.withPlaceholder)return n;const i=(e=>{const t=e.subject.withPlaceholder;t||ve(!1);const n=e.frame;if(!n){const t=Fe({page:e.subject.page,axis:e.axis,frame:null,withPlaceholder:null});return{...e,subject:t}}const r=t.oldFrameMaxScroll;r||ve(!1);const o=Pt(n,r),a=Fe({page:e.subject.page,axis:e.axis,frame:o,withPlaceholder:null});return{...e,subject:a,frame:o}})(a);return Lt(n,i)})({previousImpact:r,impact:o,droppables:n}),i=_t(o);if(!i)return a;const l=n[i];if(Qe(e,l))return a;if(l.subject.withPlaceholder)return a;const s=Dt(l,e,t);return Lt(a,s)})({draggable:p,impact:m,previousImpact:e.impact,draggables:l.draggables,droppables:l.droppables});return{...e,current:f,dimensions:{draggables:l.draggables,droppables:g},impact:m,viewport:i,scrollJumpRequest:a||null,forceShouldAnimate:!a&&null}},Bt=({impact:e,viewport:t,draggables:n,destination:r,forceShouldAnimate:o})=>{const a=e.displaced,i=function(e,t){return e.map((e=>t[e]))}(a.all,n),l=st({afterDragging:i,destination:r,displacedBy:e.displacedBy,viewport:t.frame,forceShouldAnimate:o,last:a});return{...e,displaced:l}},Ft=({impact:e,draggable:t,droppable:n,draggables:r,viewport:o,afterCritical:a})=>{const i=yt({impact:e,draggable:t,draggables:r,droppable:n,afterCritical:a});return wt({pageBorderBoxCenter:i,draggable:t,viewport:o})},zt=({state:e,dimensions:t,viewport:n})=>{"SNAP"!==e.movementMode&&ve(!1);const r=e.impact,o=n||e.viewport,a=t||e.dimensions,{draggables:i,droppables:l}=a,s=i[e.critical.draggable.id],c=_t(r);c||ve(!1);const u=l[c],d=Bt({impact:r,viewport:o,destination:u,draggables:i}),f=Ft({impact:d,draggable:s,droppable:u,draggables:i,viewport:o,afterCritical:e.afterCritical});return Mt({impact:d,clientSelection:f,state:e,dimensions:a,viewport:o})},Ut=({draggable:e,home:t,draggables:n,viewport:r})=>{const o=Ct(t.axis,e.displaceBy),a=Ge(t.descriptor.id,n),i=a.indexOf(e);-1===i&&ve(!1);const l=a.slice(i+1),s=l.reduce(((e,t)=>(e[t.descriptor.id]=!0,e)),{}),c={inVirtualList:"virtual"===t.descriptor.mode,displacedBy:o,effected:s};var u;return{impact:{displaced:st({afterDragging:l,destination:t,displacedBy:o,last:null,viewport:r.frame,forceShouldAnimate:!1}),displacedBy:o,at:{type:"REORDER",destination:(u=e.descriptor,{index:u.index,droppableId:u.droppableId})}},afterCritical:c}};const $t=e=>"SNAP"===e.movementMode,Wt=(e,t,n)=>{const r=((e,t)=>({draggables:e.draggables,droppables:Lt(e.droppables,t)}))(e.dimensions,t);return!$t(e)||n?Mt({state:e,dimensions:r}):zt({state:e,dimensions:r})};function Ht(e){return e.isDragging&&"SNAP"===e.movementMode?{...e,scrollJumpRequest:null}:e}const Gt={phase:"IDLE",completed:null,shouldFlush:!1};var Vt=(e=Gt,t)=>{if("FLUSH"===t.type)return{...Gt,shouldFlush:!0};if("INITIAL_PUBLISH"===t.type){"IDLE"!==e.phase&&ve(!1);const{critical:n,clientSelection:r,viewport:o,dimensions:a,movementMode:i}=t.payload,l=a.draggables[n.draggable.id],s=a.droppables[n.droppable.id],c={selection:r,borderBoxCenter:l.client.borderBox.center,offset:Pe},u={client:c,page:{selection:De(c.selection,o.scroll.initial),borderBoxCenter:De(c.selection,o.scroll.initial),offset:De(c.selection,o.scroll.diff.value)}},d=We(a.droppables).every((e=>!e.isFixedOnPage)),{impact:f,afterCritical:p}=Ut({draggable:l,home:s,draggables:a.draggables,viewport:o});return{phase:"DRAGGING",isDragging:!0,critical:n,movementMode:i,dimensions:a,initial:u,current:u,isWindowScrollAllowed:d,impact:f,afterCritical:p,onLiftImpact:f,viewport:o,scrollJumpRequest:null,forceShouldAnimate:null}}if("COLLECTION_STARTING"===t.type)return"COLLECTING"===e.phase||"DROP_PENDING"===e.phase?e:("DRAGGING"!==e.phase&&ve(!1),{...e,phase:"COLLECTING"});if("PUBLISH_WHILE_DRAGGING"===t.type)return"COLLECTING"!==e.phase&&"DROP_PENDING"!==e.phase&&ve(!1),(({state:e,published:t})=>{const n=t.modified.map((t=>{const n=e.dimensions.droppables[t.droppableId];return ze(n,t.scroll)})),r={...e.dimensions.droppables,...Ue(n)},o=$e((({additions:e,updatedDroppables:t,viewport:n})=>{const r=n.scroll.diff.value;return e.map((e=>{const o=e.descriptor.droppableId,a=(e=>{const t=e.frame;return t||ve(!1),t})(t[o]),i=a.scroll.diff.value,l=(({draggable:e,offset:t,initialWindowScroll:n})=>{const r=ae(e.client,t),o=ie(r,n);return{...e,placeholder:{...e.placeholder,client:r},client:r,page:o}})({draggable:e,offset:De(r,i),initialWindowScroll:n.scroll.initial});return l}))})({additions:t.additions,updatedDroppables:r,viewport:e.viewport})),a={...e.dimensions.draggables,...o};t.removals.forEach((e=>{delete a[e]}));const i={droppables:r,draggables:a},l=_t(e.impact),s=l?i.droppables[l]:null,c=i.draggables[e.critical.draggable.id],u=i.droppables[e.critical.droppable.id],{impact:d,afterCritical:f}=Ut({draggable:c,home:u,draggables:a,viewport:e.viewport}),p=s&&s.isCombineEnabled?e.impact:d,m=jt({pageOffset:e.current.page.offset,draggable:i.draggables[e.critical.draggable.id],draggables:i.draggables,droppables:i.droppables,previousImpact:p,viewport:e.viewport,afterCritical:f}),g={...e,phase:"DRAGGING",impact:m,onLiftImpact:d,dimensions:i,afterCritical:f,forceShouldAnimate:!1};return"COLLECTING"===e.phase?g:{...g,phase:"DROP_PENDING",reason:e.reason,isWaiting:!1}})({state:e,published:t.payload});if("MOVE"===t.type){if("DROP_PENDING"===e.phase)return e;It(e)||ve(!1);const{client:n}=t.payload;return Ne(n,e.current.client.selection)?e:Mt({state:e,clientSelection:n,impact:$t(e)?e.impact:null})}if("UPDATE_DROPPABLE_SCROLL"===t.type){if("DROP_PENDING"===e.phase)return Ht(e);if("COLLECTING"===e.phase)return Ht(e);It(e)||ve(!1);const{id:n,newScroll:r}=t.payload,o=e.dimensions.droppables[n];if(!o)return e;const a=ze(o,r);return Wt(e,a,!1)}if("UPDATE_DROPPABLE_IS_ENABLED"===t.type){if("DROP_PENDING"===e.phase)return e;It(e)||ve(!1);const{id:n,isEnabled:r}=t.payload,o=e.dimensions.droppables[n];o||ve(!1),o.isEnabled===r&&ve(!1);const a={...o,isEnabled:r};return Wt(e,a,!0)}if("UPDATE_DROPPABLE_IS_COMBINE_ENABLED"===t.type){if("DROP_PENDING"===e.phase)return e;It(e)||ve(!1);const{id:n,isCombineEnabled:r}=t.payload,o=e.dimensions.droppables[n];o||ve(!1),o.isCombineEnabled===r&&ve(!1);const a={...o,isCombineEnabled:r};return Wt(e,a,!0)}if("MOVE_BY_WINDOW_SCROLL"===t.type){if("DROP_PENDING"===e.phase||"DROP_ANIMATING"===e.phase)return e;It(e)||ve(!1),e.isWindowScrollAllowed||ve(!1);const n=t.payload.newScroll;if(Ne(e.viewport.scroll.current,n))return Ht(e);const r=bt(e.viewport,n);return $t(e)?zt({state:e,viewport:r}):Mt({state:e,viewport:r})}if("UPDATE_VIEWPORT_MAX_SCROLL"===t.type){if(!It(e))return e;const n=t.payload.maxScroll;if(Ne(n,e.viewport.scroll.max))return e;const r={...e.viewport,scroll:{...e.viewport.scroll,max:n}};return{...e,viewport:r}}if("MOVE_UP"===t.type||"MOVE_DOWN"===t.type||"MOVE_LEFT"===t.type||"MOVE_RIGHT"===t.type){if("COLLECTING"===e.phase||"DROP_PENDING"===e.phase)return e;"DRAGGING"!==e.phase&&ve(!1);const n=Nt({state:e,type:t.type});return n?Mt({state:e,impact:n.impact,clientSelection:n.clientSelection,scrollJumpRequest:n.scrollJumpRequest}):e}if("DROP_PENDING"===t.type){const n=t.payload.reason;return"COLLECTING"!==e.phase&&ve(!1),{...e,phase:"DROP_PENDING",isWaiting:!0,reason:n}}if("DROP_ANIMATE"===t.type){const{completed:n,dropDuration:r,newHomeClientOffset:o}=t.payload;return"DRAGGING"!==e.phase&&"DROP_PENDING"!==e.phase&&ve(!1),{phase:"DROP_ANIMATING",completed:n,dropDuration:r,newHomeClientOffset:o,dimensions:e.dimensions}}if("DROP_COMPLETE"===t.type){const{completed:e}=t.payload;return{phase:"IDLE",completed:e,shouldFlush:!1}}return e};const qt=e=>({type:"LIFT",payload:e}),Kt=e=>({type:"PUBLISH_WHILE_DRAGGING",payload:e}),Qt=()=>({type:"COLLECTION_STARTING",payload:null}),Yt=e=>({type:"UPDATE_DROPPABLE_SCROLL",payload:e}),Xt=e=>({type:"UPDATE_DROPPABLE_IS_ENABLED",payload:e}),Jt=e=>({type:"UPDATE_DROPPABLE_IS_COMBINE_ENABLED",payload:e}),Zt=e=>({type:"MOVE",payload:e}),en=()=>({type:"MOVE_UP",payload:null}),tn=()=>({type:"MOVE_DOWN",payload:null}),nn=()=>({type:"MOVE_RIGHT",payload:null}),rn=()=>({type:"MOVE_LEFT",payload:null}),on=()=>({type:"FLUSH",payload:null}),an=e=>({type:"DROP_COMPLETE",payload:e}),ln=e=>({type:"DROP",payload:e}),sn="cubic-bezier(.2,1,.1,1)",cn=0,un=.7,dn=.75,fn={outOfTheWay:.2,minDropTime:.33,maxDropTime:.55},pn=`${fn.outOfTheWay}s cubic-bezier(0.2, 0, 0, 1)`,mn={fluid:`opacity ${pn}`,snap:`transform ${pn}, opacity ${pn}`,drop:e=>{const t=`${e}s ${sn}`;return`transform ${t}, opacity ${t}`},outOfTheWay:`transform ${pn}`,placeholder:`height ${pn}, width ${pn}, margin ${pn}`},gn=e=>Ne(e,Pe)?void 0:`translate(${e.x}px, ${e.y}px)`,hn=gn,yn=(e,t)=>{const n=gn(e);if(n)return t?`${n} scale(${dn})`:n},{minDropTime:bn,maxDropTime:vn}=fn,wn=vn-bn;var En=({getState:e,dispatch:t})=>n=>r=>{if("DROP"!==r.type)return void n(r);const o=e(),a=r.payload.reason;if("COLLECTING"===o.phase)return void t((i={reason:a},{type:"DROP_PENDING",payload:i}));var i;if("IDLE"===o.phase)return;"DROP_PENDING"===o.phase&&o.isWaiting&&ve(!1),"DRAGGING"!==o.phase&&"DROP_PENDING"!==o.phase&&ve(!1);const l=o.critical,s=o.dimensions,c=s.draggables[o.critical.draggable.id],{impact:u,didDropInsideDroppable:d}=(({draggables:e,reason:t,lastImpact:n,home:r,viewport:o,onLiftImpact:a})=>n.at&&"DROP"===t?"REORDER"===n.at.type?{impact:n,didDropInsideDroppable:!0}:{impact:{...n,displaced:Xe},didDropInsideDroppable:!0}:{impact:Bt({draggables:e,impact:a,destination:r,viewport:o,forceShouldAnimate:!0}),didDropInsideDroppable:!1})({reason:a,lastImpact:o.impact,afterCritical:o.afterCritical,onLiftImpact:o.onLiftImpact,home:o.dimensions.droppables[o.critical.droppable.id],viewport:o.viewport,draggables:o.dimensions.draggables}),f=d?Ve(u):null,p=d?qe(u):null,m={index:l.draggable.index,droppableId:l.droppable.id},g={draggableId:c.descriptor.id,type:c.descriptor.type,source:m,reason:a,mode:o.movementMode,destination:f,combine:p},h=(({impact:e,draggable:t,dimensions:n,viewport:r,afterCritical:o})=>{const{draggables:a,droppables:i}=n,l=_t(e),s=l?i[l]:null,c=i[t.descriptor.droppableId],u=Ft({impact:e,draggable:t,draggables:a,afterCritical:o,droppable:s||c,viewport:r});return _e(u,t.client.borderBox.center)})({impact:u,draggable:c,dimensions:s,viewport:o.viewport,afterCritical:o.afterCritical}),y={critical:o.critical,afterCritical:o.afterCritical,result:g,impact:u};if(Ne(o.current.client.offset,h)&&!Boolean(g.combine))return void t(an({completed:y}));const b=(({current:e,destination:t,reason:n})=>{const r=Te(e,t);if(r<=0)return bn;if(r>=1500)return vn;const o=bn+wn*(r/1500);return Number(("CANCEL"===n?.6*o:o).toFixed(2))})({current:o.current.client.offset,destination:h,reason:a});t((e=>({type:"DROP_ANIMATE",payload:e}))({newHomeClientOffset:h,dropDuration:b,completed:y}))},xn=()=>({x:window.pageXOffset,y:window.pageYOffset});var Sn=e=>{const t=function({onWindowScroll:e}){const t=fe((function(){e(xn())})),n=function(e){return{eventName:"scroll",options:{passive:!0,capture:!1},fn:t=>{t.target!==window&&t.target!==window.document||e()}}}(t);let r=me;function o(){return r!==me}return{start:function(){o()&&ve(!1),r=ge(window,[n])},stop:function(){o()||ve(!1),t.cancel(),r(),r=me},isActive:o}}({onWindowScroll:t=>{e.dispatch({type:"MOVE_BY_WINDOW_SCROLL",payload:{newScroll:t}})}});return e=>n=>{t.isActive()||"INITIAL_PUBLISH"!==n.type||t.start(),t.isActive()&&(e=>"DROP_COMPLETE"===e.type||"DROP_ANIMATE"===e.type||"FLUSH"===e.type)(n)&&t.stop(),e(n)}};const On=(e,t)=>{t()},kn=(e,t)=>({draggableId:e.draggable.id,type:e.droppable.type,source:{droppableId:e.droppable.id,index:e.draggable.index},mode:t});function Cn(e,t,n,r){if(!e)return void n(r(t));const o=(e=>{let t=!1,n=!1;const r=setTimeout((()=>{n=!0})),o=o=>{t||n||(t=!0,e(o),clearTimeout(r))};return o.wasCalled=()=>t,o})(n);e(t,{announce:o}),o.wasCalled()||n(r(t))}var Pn=(e,t)=>{const n=((e,t)=>{const n=(()=>{const e=[];return{add:t=>{const n=setTimeout((()=>(t=>{const n=e.findIndex((e=>e.timerId===t));-1===n&&ve(!1);const[r]=e.splice(n,1);r.callback()})(n))),r={timerId:n,callback:t};e.push(r)},flush:()=>{if(!e.length)return;const t=[...e];e.length=0,t.forEach((e=>{clearTimeout(e.timerId),e.callback()}))}}})();let r=null;const o=n=>{r||ve(!1),r=null,On(0,(()=>Cn(e().onDragEnd,n,t,Ce.onDragEnd)))};return{beforeCapture:(t,n)=>{r&&ve(!1),On(0,(()=>{const r=e().onBeforeCapture;r&&r({draggableId:t,mode:n})}))},beforeStart:(t,n)=>{r&&ve(!1),On(0,(()=>{const r=e().onBeforeDragStart;r&&r(kn(t,n))}))},start:(o,a)=>{r&&ve(!1);const i=kn(o,a);r={mode:a,lastCritical:o,lastLocation:i.source,lastCombine:null},n.add((()=>{On(0,(()=>Cn(e().onDragStart,i,t,Ce.onDragStart)))}))},update:(o,a)=>{const i=Ve(a),l=qe(a);r||ve(!1);const s=!((e,t)=>{if(e===t)return!0;const n=e.draggable.id===t.draggable.id&&e.draggable.droppableId===t.draggable.droppableId&&e.draggable.type===t.draggable.type&&e.draggable.index===t.draggable.index,r=e.droppable.id===t.droppable.id&&e.droppable.type===t.droppable.type;return n&&r})(o,r.lastCritical);s&&(r.lastCritical=o);const c=(d=i,!(null==(u=r.lastLocation)&&null==d||null!=u&&null!=d&&u.droppableId===d.droppableId&&u.index===d.index));var u,d;c&&(r.lastLocation=i);const f=!((e,t)=>null==e&&null==t||null!=e&&null!=t&&e.draggableId===t.draggableId&&e.droppableId===t.droppableId)(r.lastCombine,l);if(f&&(r.lastCombine=l),!s&&!c&&!f)return;const p={...kn(o,r.mode),combine:l,destination:i};n.add((()=>{On(0,(()=>Cn(e().onDragUpdate,p,t,Ce.onDragUpdate)))}))},flush:()=>{r||ve(!1),n.flush()},drop:o,abort:()=>{if(!r)return;const e={...kn(r.lastCritical,r.mode),combine:null,destination:null,reason:"CANCEL"};o(e)}}})(e,t);return e=>t=>r=>{if("BEFORE_INITIAL_CAPTURE"===r.type)return void n.beforeCapture(r.payload.draggableId,r.payload.movementMode);if("INITIAL_PUBLISH"===r.type){const e=r.payload.critical;return n.beforeStart(e,r.payload.movementMode),t(r),void n.start(e,r.payload.movementMode)}if("DROP_COMPLETE"===r.type){const e=r.payload.completed.result;return n.flush(),t(r),void n.drop(e)}if(t(r),"FLUSH"===r.type)return void n.abort();const o=e.getState();"DRAGGING"===o.phase&&n.update(o.critical,o.impact)}},Dn=e=>t=>n=>{if("DROP_ANIMATION_FINISHED"!==n.type)return void t(n);const r=e.getState();"DROP_ANIMATING"!==r.phase&&ve(!1),e.dispatch(an({completed:r.completed}))},_n=e=>{let t=null,n=null;return r=>o=>{if("FLUSH"!==o.type&&"DROP_COMPLETE"!==o.type&&"DROP_ANIMATION_FINISHED"!==o.type||(n&&(cancelAnimationFrame(n),n=null),t&&(t(),t=null)),r(o),"DROP_ANIMATE"!==o.type)return;const a={eventName:"scroll",options:{capture:!0,passive:!1,once:!0},fn:function(){"DROP_ANIMATING"===e.getState().phase&&e.dispatch({type:"DROP_ANIMATION_FINISHED",payload:null})}};n=requestAnimationFrame((()=>{n=null,t=ge(window,[a])}))}},Nn=e=>t=>n=>{if(t(n),"PUBLISH_WHILE_DRAGGING"!==n.type)return;const r=e.getState();"DROP_PENDING"===r.phase&&(r.isWaiting||e.dispatch(ln({reason:r.reason})))};const In=g;var Rn=({dimensionMarshal:e,focusMarshal:t,styleMarshal:n,getResponders:r,announce:o,autoScroller:a})=>{return f(Vt,In(function(){for(var e=arguments.length,t=new Array(e),n=0;ne=>t=>{"INITIAL_PUBLISH"===t.type&&i.dragging(),"DROP_ANIMATE"===t.type&&i.dropping(t.payload.completed.result.reason),"FLUSH"!==t.type&&"DROP_COMPLETE"!==t.type||i.resting(),e(t)}),(e=>()=>t=>n=>{"DROP_COMPLETE"!==n.type&&"FLUSH"!==n.type&&"DROP_ANIMATE"!==n.type||e.stopPublishing(),t(n)})(e),(e=>({getState:t,dispatch:n})=>r=>o=>{if("LIFT"!==o.type)return void r(o);const{id:a,clientSelection:i,movementMode:l}=o.payload,s=t();"DROP_ANIMATING"===s.phase&&n(an({completed:s.completed})),"IDLE"!==t().phase&&ve(!1),n(on()),n({type:"BEFORE_INITIAL_CAPTURE",payload:{draggableId:a,movementMode:l}});const c={draggableId:a,scrollOptions:{shouldPublishImmediately:"SNAP"===l}},{critical:u,dimensions:d,viewport:f}=e.startPublishing(c);n({type:"INITIAL_PUBLISH",payload:{critical:u,dimensions:d,clientSelection:i,movementMode:l,viewport:f}})})(e),En,Dn,_n,Nn,(e=>t=>n=>r=>{if((e=>"DROP_COMPLETE"===e.type||"DROP_ANIMATE"===e.type||"FLUSH"===e.type)(r))return e.stop(),void n(r);if("INITIAL_PUBLISH"===r.type){n(r);const o=t.getState();return"DRAGGING"!==o.phase&&ve(!1),void e.start(o)}n(r),e.scroll(t.getState())})(a),Sn,(e=>{let t=!1;return()=>n=>r=>{if("INITIAL_PUBLISH"===r.type)return t=!0,e.tryRecordFocus(r.payload.critical.draggable.id),n(r),void e.tryRestoreFocusRecorded();if(n(r),t){if("FLUSH"===r.type)return t=!1,void e.tryRestoreFocusRecorded();if("DROP_COMPLETE"===r.type){t=!1;const n=r.payload.completed.result;n.combine&&e.tryShiftRecord(n.draggableId,n.combine.draggableId),e.tryRestoreFocusRecorded()}}}})(t),Pn(r,o))));var i},Tn=({scrollHeight:e,scrollWidth:t,height:n,width:r})=>{const o=_e({x:t,y:e},{x:r,y:n});return{x:Math.max(0,o.x),y:Math.max(0,o.y)}},An=()=>{const e=document.documentElement;return e||ve(!1),e},jn=()=>{const e=An();return Tn({scrollHeight:e.scrollHeight,scrollWidth:e.scrollWidth,width:e.clientWidth,height:e.clientHeight})};function Ln(e,t,n){return n.descriptor.id!==t.id&&(n.descriptor.type===t.type&&"virtual"===e.droppable.getById(n.descriptor.droppableId).descriptor.mode)}var Mn=(e,t)=>{let n=null;const r=function({registry:e,callbacks:t}){let n={additions:{},removals:{},modified:{}},r=null;const o=()=>{r||(t.collectionStarting(),r=requestAnimationFrame((()=>{r=null;const{additions:o,removals:a,modified:i}=n,l=Object.keys(o).map((t=>e.draggable.getById(t).getDimension(Pe))).sort(((e,t)=>e.descriptor.index-t.descriptor.index)),s=Object.keys(i).map((t=>({droppableId:t,scroll:e.droppable.getById(t).callbacks.getScrollWhileDragging()}))),c={additions:l,removals:Object.keys(a),modified:s};n={additions:{},removals:{},modified:{}},t.publish(c)})))};return{add:e=>{const t=e.descriptor.id;n.additions[t]=e,n.modified[e.descriptor.droppableId]=!0,n.removals[t]&&delete n.removals[t],o()},remove:e=>{const t=e.descriptor;n.removals[t.id]=!0,n.modified[t.droppableId]=!0,n.additions[t.id]&&delete n.additions[t.id],o()},stop:()=>{r&&(cancelAnimationFrame(r),r=null,n={additions:{},removals:{},modified:{}})}}}({callbacks:{publish:t.publishWhileDragging,collectionStarting:t.collectionStarting},registry:e}),o=t=>{n||ve(!1);const o=n.critical.draggable;"ADDITION"===t.type&&Ln(e,o,t.value)&&r.add(t.value),"REMOVAL"===t.type&&Ln(e,o,t.value)&&r.remove(t.value)},a={updateDroppableIsEnabled:(r,o)=>{e.droppable.exists(r)||ve(!1),n&&t.updateDroppableIsEnabled({id:r,isEnabled:o})},updateDroppableIsCombineEnabled:(r,o)=>{n&&(e.droppable.exists(r)||ve(!1),t.updateDroppableIsCombineEnabled({id:r,isCombineEnabled:o}))},scrollDroppable:(t,r)=>{n&&e.droppable.getById(t).callbacks.scroll(r)},updateDroppableScroll:(r,o)=>{n&&(e.droppable.exists(r)||ve(!1),t.updateDroppableScroll({id:r,newScroll:o}))},startPublishing:t=>{n&&ve(!1);const r=e.draggable.getById(t.draggableId),a=e.droppable.getById(r.descriptor.droppableId),i={draggable:r.descriptor,droppable:a.descriptor},l=e.subscribe(o);return n={critical:i,unsubscribe:l},(({critical:e,scrollOptions:t,registry:n})=>{const r=(()=>{const e=xn(),t=jn(),n=e.y,r=e.x,o=An(),a=o.clientWidth,i=o.clientHeight;return{frame:Z({top:n,left:r,right:r+a,bottom:n+i}),scroll:{initial:e,current:e,max:t,diff:{value:Pe,displacement:Pe}}}})(),o=r.scroll.current,a=e.droppable,i=n.droppable.getAllByType(a.type).map((e=>e.callbacks.getDimensionAndWatchScroll(o,t))),l=n.draggable.getAllByType(e.draggable.type).map((e=>e.getDimension(o)));return{dimensions:{draggables:$e(l),droppables:Ue(i)},critical:e,viewport:r}})({critical:i,registry:e,scrollOptions:t.scrollOptions})},stopPublishing:()=>{if(!n)return;r.stop();const t=n.critical.droppable;e.droppable.getAllByType(t.type).forEach((e=>e.callbacks.dragStopped())),n.unsubscribe(),n=null}};return a},Bn=(e,t)=>"IDLE"===e.phase||"DROP_ANIMATING"===e.phase&&e.completed.result.draggableId!==t&&"DROP"===e.completed.result.reason,Fn=e=>{window.scrollBy(e.x,e.y)};const zn=de((e=>We(e).filter((e=>!!e.isEnabled&&!!e.frame))));const Un={startFromPercentage:.25,maxScrollAtPercentage:.05,maxPixelScroll:28,ease:e=>e**2,durationDampening:{stopDampeningAt:1200,accelerateAt:360},disabled:!1};var $n=({startOfRange:e,endOfRange:t,current:n})=>{const r=t-e;return 0===r?0:(n-e)/r},Wn=({distanceToEdge:e,thresholds:t,dragStartTime:n,shouldUseTimeDampening:r,getAutoScrollerOptions:o})=>{const a=((e,t,n=(()=>Un))=>{const r=n();if(e>t.startScrollingFrom)return 0;if(e<=t.maxScrollValueAt)return r.maxPixelScroll;if(e===t.startScrollingFrom)return 1;const o=1-$n({startOfRange:t.maxScrollValueAt,endOfRange:t.startScrollingFrom,current:e}),a=r.maxPixelScroll*r.ease(o);return Math.ceil(a)})(e,t,o);return 0===a?0:r?Math.max(((e,t,n)=>{const r=n(),o=r.durationDampening.accelerateAt,a=r.durationDampening.stopDampeningAt,i=t,l=a,s=Date.now()-i;if(s>=a)return e;if(s{const i=((e,t,n=(()=>Un))=>{const r=n();return{startScrollingFrom:e[t.size]*r.startFromPercentage,maxScrollValueAt:e[t.size]*r.maxScrollAtPercentage}})(e,r,a);return t[r.end]0===e?0:e));var Vn=({dragStartTime:e,container:t,subject:n,center:r,shouldUseTimeDampening:o,getAutoScrollerOptions:a})=>{const i={top:r.y-t.top,right:t.right-r.x,bottom:t.bottom-r.y,left:r.x-t.left},l=Hn({container:t,distanceToEdges:i,dragStartTime:e,axis:nt,shouldUseTimeDampening:o,getAutoScrollerOptions:a}),s=Hn({container:t,distanceToEdges:i,dragStartTime:e,axis:rt,shouldUseTimeDampening:o,getAutoScrollerOptions:a}),c=Gn({x:s,y:l});if(Ne(c,Pe))return null;const u=(({container:e,subject:t,proposedScroll:n})=>{const r=t.height>e.height,o=t.width>e.width;return o||r?o&&r?null:{x:o?0:n.x,y:r?0:n.y}:n})({container:t,subject:n,proposedScroll:c});return u?Ne(u,Pe)?null:u:null};const qn=je((e=>0===e?0:e>0?1:-1)),Kn=(()=>{const e=(e,t)=>e<0?e:e>t?e-t:0;return({current:t,max:n,change:r})=>{const o=De(t,r),a={x:e(o.x,n.x),y:e(o.y,n.y)};return Ne(a,Pe)?null:a}})(),Qn=({max:e,current:t,change:n})=>{const r={x:Math.max(t.x,e.x),y:Math.max(t.y,e.y)},o=qn(n),a=Kn({max:r,current:t,change:o});return!a||0!==o.x&&0===a.x||0!==o.y&&0===a.y},Yn=(e,t)=>Qn({current:e.scroll.current,max:e.scroll.max,change:t}),Xn=(e,t)=>{const n=e.frame;return!!n&&Qn({current:n.scroll.current,max:n.scroll.max,change:t})};var Jn=({state:e,dragStartTime:t,shouldUseTimeDampening:n,scrollWindow:r,scrollDroppable:o,getAutoScrollerOptions:a})=>{const i=e.current.page.borderBoxCenter,l=e.dimensions.draggables[e.critical.draggable.id].page.marginBox;if(e.isWindowScrollAllowed){const o=(({viewport:e,subject:t,center:n,dragStartTime:r,shouldUseTimeDampening:o,getAutoScrollerOptions:a})=>{const i=Vn({dragStartTime:r,container:e.frame,subject:t,center:n,shouldUseTimeDampening:o,getAutoScrollerOptions:a});return i&&Yn(e,i)?i:null})({dragStartTime:t,viewport:e.viewport,subject:l,center:i,shouldUseTimeDampening:n,getAutoScrollerOptions:a});if(o)return void r(o)}const s=(({center:e,destination:t,droppables:n})=>{if(t){const e=n[t];return e.frame?e:null}const r=((e,t)=>{const n=zn(t).find((t=>(t.frame||ve(!1),Rt(t.frame.pageMarginBox)(e))))||null;return n})(e,n);return r})({center:i,destination:_t(e.impact),droppables:e.dimensions.droppables});if(!s)return;const c=(({droppable:e,subject:t,center:n,dragStartTime:r,shouldUseTimeDampening:o,getAutoScrollerOptions:a})=>{const i=e.frame;if(!i)return null;const l=Vn({dragStartTime:r,container:i.pageMarginBox,subject:t,center:n,shouldUseTimeDampening:o,getAutoScrollerOptions:a});return l&&Xn(e,l)?l:null})({dragStartTime:t,droppable:s,subject:l,center:i,shouldUseTimeDampening:n,getAutoScrollerOptions:a});c&&o(s.descriptor.id,c)},Zn=({move:e,scrollDroppable:t,scrollWindow:n})=>r=>{const o=r.scrollJumpRequest;if(!o)return;const a=_t(r.impact);a||ve(!1);const i=((e,n)=>{if(!Xn(e,n))return n;const r=((e,t)=>{const n=e.frame;return n&&Xn(e,t)?Kn({current:n.scroll.current,max:n.scroll.max,change:t}):null})(e,n);if(!r)return t(e.descriptor.id,n),null;const o=_e(n,r);return t(e.descriptor.id,o),_e(n,o)})(r.dimensions.droppables[a],o);if(!i)return;const l=r.viewport,s=((e,t,r)=>{if(!e)return r;if(!Yn(t,r))return r;const o=((e,t)=>{if(!Yn(e,t))return null;const n=e.scroll.max,r=e.scroll.current;return Kn({current:r,max:n,change:t})})(t,r);if(!o)return n(r),null;const a=_e(r,o);return n(a),_e(r,a)})(r.isWindowScrollAllowed,l,i);s&&((t,n)=>{const r=De(t.current.client.selection,n);e({client:r})})(r,s)},er=({scrollDroppable:e,scrollWindow:t,move:n,getAutoScrollerOptions:r})=>{const o=(({scrollWindow:e,scrollDroppable:t,getAutoScrollerOptions:n=(()=>Un)})=>{const r=fe(e),o=fe(t);let a=null;const i=e=>{a||ve(!1);const{shouldUseTimeDampening:t,dragStartTime:i}=a;Jn({state:e,scrollWindow:r,scrollDroppable:o,dragStartTime:i,shouldUseTimeDampening:t,getAutoScrollerOptions:n})};return{start:e=>{a&&ve(!1);const t=Date.now();let r=!1;const o=()=>{r=!0};Jn({state:e,dragStartTime:0,shouldUseTimeDampening:!1,scrollWindow:o,scrollDroppable:o,getAutoScrollerOptions:n}),a={dragStartTime:t,shouldUseTimeDampening:r},r&&i(e)},stop:()=>{a&&(r.cancel(),o.cancel(),a=null)},scroll:i}})({scrollWindow:t,scrollDroppable:e,getAutoScrollerOptions:r}),a=Zn({move:n,scrollWindow:t,scrollDroppable:e});return{scroll:e=>{r().disabled||"DRAGGING"!==e.phase||("FLUID"!==e.movementMode?e.scrollJumpRequest&&a(e):o.scroll(e))},start:o.start,stop:o.stop}};const tr="data-rfd",nr=(()=>{const e=`${tr}-drag-handle`;return{base:e,draggableId:`${e}-draggable-id`,contextId:`${e}-context-id`}})(),rr=(()=>{const e=`${tr}-draggable`;return{base:e,contextId:`${e}-context-id`,id:`${e}-id`}})(),or=(()=>{const e=`${tr}-droppable`;return{base:e,contextId:`${e}-context-id`,id:`${e}-id`}})(),ar={contextId:`${tr}-scroll-container-context-id`},ir=(e,t)=>e.map((e=>{const n=e.styles[t];return n?`${e.selector} { ${n} }`:""})).join(" ");var lr=e=>{const t=(e=>t=>`[${t}="${e}"]`)(e),n=(()=>{const e="\n cursor: -webkit-grab;\n cursor: grab;\n ";return{selector:t(nr.contextId),styles:{always:"\n -webkit-touch-callout: none;\n -webkit-tap-highlight-color: rgba(0,0,0,0);\n touch-action: manipulation;\n ",resting:e,dragging:"pointer-events: none;",dropAnimating:e}}})(),r=[(()=>{const e=`\n transition: ${mn.outOfTheWay};\n `;return{selector:t(rr.contextId),styles:{dragging:e,dropAnimating:e,userCancel:e}}})(),n,{selector:t(or.contextId),styles:{always:"overflow-anchor: none;"}},{selector:"body",styles:{dragging:"\n cursor: grabbing;\n cursor: -webkit-grabbing;\n user-select: none;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n overflow-anchor: none;\n "}}];return{always:ir(r,"always"),resting:ir(r,"resting"),dragging:ir(r,"dragging"),dropAnimating:ir(r,"dropAnimating"),userCancel:ir(r,"userCancel")}},sr="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?e.useLayoutEffect:e.useEffect;const cr=()=>{const e=document.querySelector("head");return e||ve(!1),e},ur=e=>{const t=document.createElement("style");return e&&t.setAttribute("nonce",e),t.type="text/css",t};function dr(e,t){return Array.from(e.querySelectorAll(t))}var fr=e=>e&&e.ownerDocument&&e.ownerDocument.defaultView?e.ownerDocument.defaultView:window;function pr(e){return e instanceof fr(e).HTMLElement}function mr(){const e={draggables:{},droppables:{}},t=[];function n(e){t.length&&t.forEach((t=>t(e)))}function r(t){return e.draggables[t]||null}function o(t){return e.droppables[t]||null}return{draggable:{register:t=>{e.draggables[t.descriptor.id]=t,n({type:"ADDITION",value:t})},update:(t,n)=>{const r=e.draggables[n.descriptor.id];r&&r.uniqueId===t.uniqueId&&(delete e.draggables[n.descriptor.id],e.draggables[t.descriptor.id]=t)},unregister:t=>{const o=t.descriptor.id,a=r(o);a&&t.uniqueId===a.uniqueId&&(delete e.draggables[o],e.droppables[t.descriptor.droppableId]&&n({type:"REMOVAL",value:t}))},getById:function(e){const t=r(e);return t||ve(!1),t},findById:r,exists:e=>Boolean(r(e)),getAllByType:t=>Object.values(e.draggables).filter((e=>e.descriptor.type===t))},droppable:{register:t=>{e.droppables[t.descriptor.id]=t},unregister:t=>{const n=o(t.descriptor.id);n&&t.uniqueId===n.uniqueId&&delete e.droppables[t.descriptor.id]},getById:function(e){const t=o(e);return t||ve(!1),t},findById:o,exists:e=>Boolean(o(e)),getAllByType:t=>Object.values(e.droppables).filter((e=>e.descriptor.type===t))},subscribe:function(e){return t.push(e),function(){const n=t.indexOf(e);-1!==n&&t.splice(n,1)}},clean:function(){e.draggables={},e.droppables={},t.length=0}}}var gr=e.createContext(null),hr=()=>{const e=document.body;return e||ve(!1),e},yr={position:"absolute",width:"1px",height:"1px",margin:"-1px",border:"0",padding:"0",overflow:"hidden",clip:"rect(0 0 0 0)","clip-path":"inset(100%)"};const br=e=>`rfd-announcement-${e}`,vr={separator:"::"};var wr=function(t,n=vr){const r=e.useId();return X((()=>`${t}${n.separator}${r}`),[n.separator,t,r])},Er=e.createContext(null);function xr(t){const n=(0,e.useRef)(t);return(0,e.useEffect)((()=>{n.current=t})),n}function Sr(e){return"IDLE"!==e.phase&&"DROP_ANIMATING"!==e.phase&&e.isDragging}const Or={13:!0,9:!0};var kr=e=>{Or[e.keyCode]&&e.preventDefault()},Cr=(()=>{const e="visibilitychange";return"undefined"==typeof document?e:[e,`ms${e}`,`webkit${e}`,`moz${e}`,`o${e}`].find((e=>`on${e}`in document))||e})();const Pr={type:"IDLE"};function Dr(){}const _r={34:!0,33:!0,36:!0,35:!0};const Nr={type:"IDLE"},Ir=["input","button","textarea","select","option","optgroup","video","audio"];function Rr(e,t){if(null==t)return!1;if(Ir.includes(t.tagName.toLowerCase()))return!0;const n=t.getAttribute("contenteditable");return"true"===n||""===n||t!==e&&Rr(e,t.parentElement)}function Tr(e,t){const n=t.target;return!!pr(n)&&Rr(e,n)}var Ar=e=>Z(e.getBoundingClientRect()).center;const jr=(()=>{const e="matches";return"undefined"==typeof document?e:[e,"msMatchesSelector","webkitMatchesSelector"].find((e=>e in Element.prototype))||e})();function Lr(e,t){return null==e?null:e[jr](t)?e:Lr(e.parentElement,t)}function Mr(e,t){return e.closest?e.closest(t):Lr(e,t)}function Br(e){e.preventDefault()}function Fr({expected:e,phase:t,isLockActive:n,shouldWarn:r}){return!!n()&&e===t}function zr({lockAPI:e,store:t,registry:n,draggableId:r}){if(e.isClaimed())return!1;const o=n.draggable.findById(r);return!!o&&!!o.options.isEnabled&&!!Bn(t.getState(),r)}const Ur=[function(t){const n=(0,e.useRef)(Pr),r=(0,e.useRef)(me),o=X((()=>({eventName:"mousedown",fn:function(e){if(e.defaultPrevented)return;if(0!==e.button)return;if(e.ctrlKey||e.metaKey||e.shiftKey||e.altKey)return;const n=t.findClosestDraggableId(e);if(!n)return;const o=t.tryGetLock(n,l,{sourceEvent:e});if(!o)return;e.preventDefault();const a={x:e.clientX,y:e.clientY};r.current(),u(o,a)}})),[t]),a=X((()=>({eventName:"webkitmouseforcewillbegin",fn:e=>{if(e.defaultPrevented)return;const n=t.findClosestDraggableId(e);if(!n)return;const r=t.findOptionsForDraggable(n);r&&(r.shouldRespectForcePress||t.canGetLock(n)&&e.preventDefault())}})),[t]),i=J((function(){r.current=ge(window,[a,o],{passive:!1,capture:!0})}),[a,o]),l=J((()=>{"IDLE"!==n.current.type&&(n.current=Pr,r.current(),i())}),[i]),s=J((()=>{const e=n.current;l(),"DRAGGING"===e.type&&e.actions.cancel({shouldBlockNextClick:!0}),"PENDING"===e.type&&e.actions.abort()}),[l]),c=J((function(){const e=function({cancel:e,completed:t,getPhase:n,setPhase:r}){return[{eventName:"mousemove",fn:e=>{const{button:t,clientX:o,clientY:a}=e;if(0!==t)return;const i={x:o,y:a},l=n();if("DRAGGING"===l.type)return e.preventDefault(),void l.actions.move(i);if("PENDING"!==l.type&&ve(!1),s=l.point,c=i,!(Math.abs(c.x-s.x)>=5||Math.abs(c.y-s.y)>=5))return;var s,c;e.preventDefault();const u=l.actions.fluidLift(i);r({type:"DRAGGING",actions:u})}},{eventName:"mouseup",fn:r=>{const o=n();"DRAGGING"===o.type?(r.preventDefault(),o.actions.drop({shouldBlockNextClick:!0}),t()):e()}},{eventName:"mousedown",fn:t=>{"DRAGGING"===n().type&&t.preventDefault(),e()}},{eventName:"keydown",fn:t=>{if("PENDING"!==n().type)return 27===t.keyCode?(t.preventDefault(),void e()):void kr(t);e()}},{eventName:"resize",fn:e},{eventName:"scroll",options:{passive:!0,capture:!1},fn:()=>{"PENDING"===n().type&&e()}},{eventName:"webkitmouseforcedown",fn:t=>{const r=n();"IDLE"===r.type&&ve(!1),r.actions.shouldRespectForcePress()?e():t.preventDefault()}},{eventName:Cr,fn:e}]}({cancel:s,completed:l,getPhase:()=>n.current,setPhase:e=>{n.current=e}});r.current=ge(window,e,{capture:!0,passive:!1})}),[s,l]),u=J((function(e,t){"IDLE"!==n.current.type&&ve(!1),n.current={type:"PENDING",point:t,actions:e},c()}),[c]);sr((function(){return i(),function(){r.current()}}),[i])},function(t){const n=(0,e.useRef)(Dr),r=X((()=>({eventName:"keydown",fn:function(e){if(e.defaultPrevented)return;if(32!==e.keyCode)return;const r=t.findClosestDraggableId(e);if(!r)return;const a=t.tryGetLock(r,s,{sourceEvent:e});if(!a)return;e.preventDefault();let i=!0;const l=a.snapLift();function s(){i||ve(!1),i=!1,n.current(),o()}n.current(),n.current=ge(window,function(e,t){function n(){t(),e.cancel()}return[{eventName:"keydown",fn:r=>27===r.keyCode?(r.preventDefault(),void n()):32===r.keyCode?(r.preventDefault(),t(),void e.drop()):40===r.keyCode?(r.preventDefault(),void e.moveDown()):38===r.keyCode?(r.preventDefault(),void e.moveUp()):39===r.keyCode?(r.preventDefault(),void e.moveRight()):37===r.keyCode?(r.preventDefault(),void e.moveLeft()):void(_r[r.keyCode]?r.preventDefault():kr(r))},{eventName:"mousedown",fn:n},{eventName:"mouseup",fn:n},{eventName:"click",fn:n},{eventName:"touchstart",fn:n},{eventName:"resize",fn:n},{eventName:"wheel",fn:n,options:{passive:!0}},{eventName:Cr,fn:n}]}(l,s),{capture:!0,passive:!1})}})),[t]),o=J((function(){n.current=ge(window,[r],{passive:!1,capture:!0})}),[r]);sr((function(){return o(),function(){n.current()}}),[o])},function(t){const n=(0,e.useRef)(Nr),r=(0,e.useRef)(me),o=J((function(){return n.current}),[]),a=J((function(e){n.current=e}),[]),i=X((()=>({eventName:"touchstart",fn:function(e){if(e.defaultPrevented)return;const n=t.findClosestDraggableId(e);if(!n)return;const o=t.tryGetLock(n,s,{sourceEvent:e});if(!o)return;const a=e.touches[0],{clientX:i,clientY:l}=a,c={x:i,y:l};r.current(),f(o,c)}})),[t]),l=J((function(){r.current=ge(window,[i],{capture:!0,passive:!1})}),[i]),s=J((()=>{const e=n.current;"IDLE"!==e.type&&("PENDING"===e.type&&clearTimeout(e.longPressTimerId),a(Nr),r.current(),l())}),[l,a]),c=J((()=>{const e=n.current;s(),"DRAGGING"===e.type&&e.actions.cancel({shouldBlockNextClick:!0}),"PENDING"===e.type&&e.actions.abort()}),[s]),u=J((function(){const e={capture:!0,passive:!1},t={cancel:c,completed:s,getPhase:o},n=ge(window,function({cancel:e,completed:t,getPhase:n}){return[{eventName:"touchmove",options:{capture:!1},fn:t=>{const r=n();if("DRAGGING"!==r.type)return void e();r.hasMoved=!0;const{clientX:o,clientY:a}=t.touches[0],i={x:o,y:a};t.preventDefault(),r.actions.move(i)}},{eventName:"touchend",fn:r=>{const o=n();"DRAGGING"===o.type?(r.preventDefault(),o.actions.drop({shouldBlockNextClick:!0}),t()):e()}},{eventName:"touchcancel",fn:t=>{"DRAGGING"===n().type?(t.preventDefault(),e()):e()}},{eventName:"touchforcechange",fn:t=>{const r=n();"IDLE"===r.type&&ve(!1);const o=t.touches[0];if(!o)return;if(!(o.force>=.15))return;const a=r.actions.shouldRespectForcePress();if("PENDING"!==r.type)return a?r.hasMoved?void t.preventDefault():void e():void t.preventDefault();a&&e()}},{eventName:Cr,fn:e}]}(t),e),a=ge(window,function({cancel:e,getPhase:t}){return[{eventName:"orientationchange",fn:e},{eventName:"resize",fn:e},{eventName:"contextmenu",fn:e=>{e.preventDefault()}},{eventName:"keydown",fn:n=>{"DRAGGING"===t().type?(27===n.keyCode&&n.preventDefault(),e()):e()}},{eventName:Cr,fn:e}]}(t),e);r.current=function(){n(),a()}}),[c,o,s]),d=J((function(){const e=o();"PENDING"!==e.type&&ve(!1);const t=e.actions.fluidLift(e.point);a({type:"DRAGGING",actions:t,hasMoved:!1})}),[o,a]),f=J((function(e,t){"IDLE"!==o().type&&ve(!1);const n=setTimeout(d,120);a({type:"PENDING",point:t,actions:e,longPressTimerId:n}),u()}),[u,o,a,d]);sr((function(){return l(),function(){r.current();const e=o();"PENDING"===e.type&&(clearTimeout(e.longPressTimerId),a(Nr))}}),[o,l,a]),sr((function(){return ge(window,[{eventName:"touchmove",fn:()=>{},options:{capture:!1,passive:!1}}])}),[])}];function $r({contextId:t,store:n,registry:r,customSensors:o,enableDefaultSensors:a}){const i=[...a?Ur:[],...o||[]],l=(0,e.useState)((()=>function(){let e=null;function t(){e||ve(!1),e=null}return{isClaimed:function(){return Boolean(e)},isActive:function(t){return t===e},claim:function(t){e&&ve(!1);const n={abandon:t};return e=n,n},release:t,tryAbandon:function(){e&&(e.abandon(),t())}}}()))[0],s=J((function(e,t){Sr(e)&&!Sr(t)&&l.tryAbandon()}),[l]);sr((function(){let e=n.getState();return n.subscribe((()=>{const t=n.getState();s(e,t),e=t}))}),[l,n,s]),sr((()=>l.tryAbandon),[l.tryAbandon]);const c=J((e=>zr({lockAPI:l,registry:r,store:n,draggableId:e})),[l,r,n]),u=J(((e,o,a)=>function({lockAPI:e,contextId:t,store:n,registry:r,draggableId:o,forceSensorStop:a,sourceEvent:i}){if(!zr({lockAPI:e,store:n,registry:r,draggableId:o}))return null;const l=r.draggable.getById(o),s=function(e,t){const n=`[${rr.contextId}="${e}"]`,r=dr(document,n).find((e=>e.getAttribute(rr.id)===t));return r&&pr(r)?r:null}(t,l.descriptor.id);if(!s)return null;if(i&&!l.options.canDragInteractiveElements&&Tr(s,i))return null;const c=e.claim(a||me);let u="PRE_DRAG";function d(){return l.options.shouldRespectForcePress}function f(){return e.isActive(c)}const p=function(e,t){Fr({expected:e,phase:u,isLockActive:f,shouldWarn:!0})&&n.dispatch(t())}.bind(null,"DRAGGING");function m(t){function r(){e.release(),u="COMPLETED"}function o(e,o={shouldBlockNextClick:!1}){if(t.cleanup(),o.shouldBlockNextClick){const e=ge(window,[{eventName:"click",fn:Br,options:{once:!0,passive:!1,capture:!0}}]);setTimeout(e)}r(),n.dispatch(ln({reason:e}))}return"PRE_DRAG"!==u&&(r(),ve(!1)),n.dispatch(qt(t.liftActionArgs)),u="DRAGGING",{isActive:()=>Fr({expected:"DRAGGING",phase:u,isLockActive:f,shouldWarn:!1}),shouldRespectForcePress:d,drop:e=>o("DROP",e),cancel:e=>o("CANCEL",e),...t.actions}}const g={isActive:()=>Fr({expected:"PRE_DRAG",phase:u,isLockActive:f,shouldWarn:!1}),shouldRespectForcePress:d,fluidLift:function(e){const t=fe((e=>{p((()=>Zt({client:e})))}));return{...m({liftActionArgs:{id:o,clientSelection:e,movementMode:"FLUID"},cleanup:()=>t.cancel(),actions:{move:t}}),move:t}},snapLift:function(){const e={moveUp:()=>p(en),moveRight:()=>p(nn),moveDown:()=>p(tn),moveLeft:()=>p(rn)};return m({liftActionArgs:{id:o,clientSelection:Ar(s),movementMode:"SNAP"},cleanup:me,actions:e})},abort:function(){Fr({expected:"PRE_DRAG",phase:u,isLockActive:f,shouldWarn:!0})&&e.release()}};return g}({lockAPI:l,registry:r,contextId:t,store:n,draggableId:e,forceSensorStop:o||null,sourceEvent:a&&a.sourceEvent?a.sourceEvent:null})),[t,l,r,n]),d=J((e=>function(e,t){const n=function(e,t){const n=t.target;if(!((r=n)instanceof fr(r).Element))return null;var r;const o=function(e){return`[${nr.contextId}="${e}"]`}(e),a=Mr(n,o);return a&&pr(a)?a:null}(e,t);return n?n.getAttribute(nr.draggableId):null}(t,e)),[t]),f=J((e=>{const t=r.draggable.findById(e);return t?t.options:null}),[r.draggable]),p=J((function(){l.isClaimed()&&(l.tryAbandon(),"IDLE"!==n.getState().phase&&n.dispatch(on()))}),[l,n]),m=J((()=>l.isClaimed()),[l]),g=X((()=>({canGetLock:c,tryGetLock:u,findClosestDraggableId:d,findOptionsForDraggable:f,tryReleaseLock:p,isLockClaimed:m})),[c,u,d,f,p,m]);for(let e=0;e({onBeforeCapture:n=>{const o=()=>{t.onBeforeCapture&&t.onBeforeCapture(n)};e.version.startsWith("16")||e.version.startsWith("17")?o():(0,r.flushSync)(o)},onBeforeDragStart:t.onBeforeDragStart,onDragStart:t.onDragStart,onDragEnd:t.onDragEnd,onDragUpdate:t.onDragUpdate}),Hr=e=>({...Un,...e.autoScrollerOptions,durationDampening:{...Un.durationDampening,...e.autoScrollerOptions}});function Gr(e){return e.current||ve(!1),e.current}function Vr(t){const{contextId:n,setCallbacks:r,sensors:o,nonce:a,dragHandleUsageInstructions:i}=t,l=(0,e.useRef)(null),s=xr(t),c=J((()=>Wr(s.current)),[s]),u=J((()=>Hr(s.current)),[s]),d=function(t){const n=X((()=>br(t)),[t]),r=(0,e.useRef)(null);return(0,e.useEffect)((function(){const e=document.createElement("div");return r.current=e,e.id=n,e.setAttribute("aria-live","assertive"),e.setAttribute("aria-atomic","true"),k(e.style,yr),hr().appendChild(e),function(){setTimeout((function(){const t=hr();t.contains(e)&&t.removeChild(e),e===r.current&&(r.current=null)}))}}),[n]),J((e=>{const t=r.current;t&&(t.textContent=e)}),[])}(n),f=function({contextId:t,text:n}){const r=wr("hidden-text",{separator:"-"}),o=X((()=>function({contextId:e,uniqueId:t}){return`rfd-hidden-text-${e}-${t}`}({contextId:t,uniqueId:r})),[r,t]);return(0,e.useEffect)((function(){const e=document.createElement("div");return e.id=o,e.textContent=n,e.style.display="none",hr().appendChild(e),function(){const t=hr();t.contains(e)&&t.removeChild(e)}}),[o,n]),o}({contextId:n,text:i}),p=function(t,n){const r=X((()=>lr(t)),[t]),o=(0,e.useRef)(null),a=(0,e.useRef)(null),i=J(de((e=>{const t=a.current;t||ve(!1),t.textContent=e})),[]),l=J((e=>{const t=o.current;t||ve(!1),t.textContent=e}),[]);sr((()=>{(o.current||a.current)&&ve(!1);const e=ur(n),s=ur(n);return o.current=e,a.current=s,e.setAttribute(`${tr}-always`,t),s.setAttribute(`${tr}-dynamic`,t),cr().appendChild(e),cr().appendChild(s),l(r.always),i(r.resting),()=>{const e=e=>{const t=e.current;t||ve(!1),cr().removeChild(t),e.current=null};e(o),e(a)}}),[n,l,i,r.always,r.resting,t]);const s=J((()=>i(r.dragging)),[i,r.dragging]),c=J((e=>{i("DROP"!==e?r.userCancel:r.dropAnimating)}),[i,r.dropAnimating,r.userCancel]),u=J((()=>{a.current&&i(r.resting)}),[i,r.resting]);return X((()=>({dragging:s,dropping:c,resting:u})),[s,c,u])}(n,a),g=J((e=>{Gr(l).dispatch(e)}),[]),h=X((()=>m({publishWhileDragging:Kt,updateDroppableScroll:Yt,updateDroppableIsEnabled:Xt,updateDroppableIsCombineEnabled:Jt,collectionStarting:Qt},g)),[g]),y=function(){const t=X(mr,[]);return(0,e.useEffect)((()=>function(){e.version.startsWith("16")||e.version.startsWith("17")?requestAnimationFrame(t.clean):t.clean()}),[t]),t}(),b=X((()=>Mn(y,h)),[y,h]),v=X((()=>er({scrollWindow:Fn,scrollDroppable:b.scrollDroppable,getAutoScrollerOptions:u,...m({move:Zt},g)})),[b.scrollDroppable,g,u]),w=function(t){const n=(0,e.useRef)({}),r=(0,e.useRef)(null),o=(0,e.useRef)(null),a=(0,e.useRef)(!1),i=J((function(e,t){const r={id:e,focus:t};return n.current[e]=r,function(){const t=n.current;t[e]!==r&&delete t[e]}}),[]),l=J((function(e){const n=function(e,t){const n=`[${nr.contextId}="${e}"]`,r=dr(document,n);if(!r.length)return null;const o=r.find((e=>e.getAttribute(nr.draggableId)===t));return o&&pr(o)?o:null}(t,e);n&&n!==document.activeElement&&n.focus()}),[t]),s=J((function(e,t){r.current===e&&(r.current=t)}),[]),c=J((function(){o.current||a.current&&(o.current=requestAnimationFrame((()=>{o.current=null;const e=r.current;e&&l(e)})))}),[l]),u=J((function(e){r.current=null;const t=document.activeElement;t&&t.getAttribute(nr.draggableId)===e&&(r.current=e)}),[]);return sr((()=>(a.current=!0,function(){a.current=!1;const e=o.current;e&&cancelAnimationFrame(e)})),[]),X((()=>({register:i,tryRecordFocus:u,tryRestoreFocusRecorded:c,tryShiftRecord:s})),[i,u,c,s])}(n),E=X((()=>Rn({announce:d,autoScroller:v,dimensionMarshal:b,focusMarshal:w,getResponders:c,styleMarshal:p})),[d,v,b,w,c,p]);l.current=E;const x=J((()=>{const e=Gr(l);"IDLE"!==e.getState().phase&&e.dispatch(on())}),[]),S=J((()=>{const e=Gr(l).getState();return"DROP_ANIMATING"===e.phase||"IDLE"!==e.phase&&e.isDragging}),[]);r(X((()=>({isDragging:S,tryAbort:x})),[S,x]));const O=J((e=>Bn(Gr(l).getState(),e)),[]),C=J((()=>It(Gr(l).getState())),[]),P=X((()=>({marshal:b,focus:w,contextId:n,canLift:O,isMovementAllowed:C,dragHandleUsageInstructionsId:f,registry:y})),[n,b,f,w,O,C,y]);return $r({contextId:n,store:E,registry:y,customSensors:o||null,enableDefaultSensors:!1!==t.enableDefaultSensors}),(0,e.useEffect)((()=>x),[x]),e.createElement(Er.Provider,{value:P},e.createElement(K,{context:gr,store:E},t.children))}var qr=function(){return e.useId()};function Kr(t){const n=qr(),r=t.dragHandleUsageInstructions||Ce.dragHandleUsageInstructions;return e.createElement(we,null,(o=>e.createElement(Vr,{nonce:t.nonce,contextId:n,setCallbacks:o,dragHandleUsageInstructions:r,enableDefaultSensors:t.enableDefaultSensors,sensors:t.sensors,onBeforeCapture:t.onBeforeCapture,onBeforeDragStart:t.onBeforeDragStart,onDragStart:t.onDragStart,onDragUpdate:t.onDragUpdate,onDragEnd:t.onDragEnd,autoScrollerOptions:t.autoScrollerOptions},t.children)))}const Qr=5e3,Yr=4500,Xr=(e,t)=>t?mn.drop(t.duration):e?mn.snap:mn.fluid,Jr=(e,t)=>{if(e)return t?cn:un};var Zr=e.createContext(null);function eo(t){const n=(0,e.useContext)(t);return n||ve(!1),n}function to(e){e.preventDefault()}var no=(e,t)=>e===t,ro=e=>{const{combine:t,destination:n}=e;return n?n.droppableId:t?t.droppableId:null};function oo(e=null){return{isDragging:!1,isDropAnimating:!1,isClone:!1,dropAnimation:null,mode:null,draggingOver:null,combineTargetFor:e,combineWith:null}}const ao={mapped:{type:"SECONDARY",offset:Pe,combineTargetFor:null,shouldAnimateDisplacement:!0,snapshot:oo(null)}},io=q((()=>{const e=function(){const e=de(((e,t)=>({x:e,y:t}))),t=de(((e,t,n=null,r=null,o=null)=>({isDragging:!0,isClone:t,isDropAnimating:Boolean(o),dropAnimation:o,mode:e,draggingOver:n,combineWith:r,combineTargetFor:null}))),n=de(((e,n,r,o,a=null,i=null,l=null)=>({mapped:{type:"DRAGGING",dropping:null,draggingOver:a,combineWith:i,mode:n,offset:e,dimension:r,forceShouldAnimate:l,snapshot:t(n,o,a,i,null)}})));return(r,o)=>{if(Sr(r)){if(r.critical.draggable.id!==o.draggableId)return null;const t=r.current.client.offset,i=r.dimensions.draggables[o.draggableId],l=_t(r.impact),s=(a=r.impact).at&&"COMBINE"===a.at.type?a.at.combine.draggableId:null,c=r.forceShouldAnimate;return n(e(t.x,t.y),r.movementMode,i,o.isClone,l,s,c)}var a;if("DROP_ANIMATING"===r.phase){const e=r.completed;if(e.result.draggableId!==o.draggableId)return null;const n=o.isClone,a=r.dimensions.draggables[o.draggableId],i=e.result,l=i.mode,s=ro(i),c=(e=>e.combine?e.combine.draggableId:null)(i),u={duration:r.dropDuration,curve:sn,moveTo:r.newHomeClientOffset,opacity:c?cn:null,scale:c?dn:null};return{mapped:{type:"DRAGGING",offset:r.newHomeClientOffset,dimension:a,dropping:u,draggingOver:s,combineWith:c,mode:l,forceShouldAnimate:null,snapshot:t(l,n,s,c,u)}}}return null}}(),t=function(){const e=de(((e,t)=>({x:e,y:t}))),t=de(oo),n=de(((e,n=null,r)=>({mapped:{type:"SECONDARY",offset:e,combineTargetFor:n,shouldAnimateDisplacement:r,snapshot:t(n)}}))),r=e=>e?n(Pe,e,!0):null,o=(t,o,a,i)=>{const l=a.displaced.visible[t],s=Boolean(i.inVirtualList&&i.effected[t]),c=qe(a),u=c&&c.draggableId===t?o:null;if(!l){if(!s)return r(u);if(a.displaced.invisible[t])return null;const o=Ie(i.displacedBy.point),l=e(o.x,o.y);return n(l,u,!0)}if(s)return r(u);const d=a.displacedBy.point,f=e(d.x,d.y);return n(f,u,l.shouldAnimate)};return(e,t)=>{if(Sr(e))return e.critical.draggable.id===t.draggableId?null:o(t.draggableId,e.critical.draggable.id,e.impact,e.afterCritical);if("DROP_ANIMATING"===e.phase){const n=e.completed;return n.result.draggableId===t.draggableId?null:o(t.draggableId,n.result.draggableId,n.impact,n.afterCritical)}return null}}();return(n,r)=>e(n,r)||t(n,r)||ao}),{dropAnimationFinished:()=>({type:"DROP_ANIMATION_FINISHED",payload:null})},null,{context:gr,areStatePropsEqual:no})((t=>{const n=(0,e.useRef)(null),o=J(((e=null)=>{n.current=e}),[]),a=J((()=>n.current),[]),{contextId:i,dragHandleUsageInstructionsId:l,registry:s}=eo(Er),{type:c,droppableId:u}=eo(Zr),d=X((()=>({id:t.draggableId,index:t.index,type:c,droppableId:u})),[t.draggableId,t.index,c,u]),{children:f,draggableId:p,isEnabled:m,shouldRespectForcePress:g,canDragInteractiveElements:h,isClone:y,mapped:b,dropAnimationFinished:v}=t;y||function(t){const n=wr("draggable"),{descriptor:r,registry:o,getDraggableRef:a,canDragInteractiveElements:i,shouldRespectForcePress:l,isEnabled:s}=t,c=X((()=>({canDragInteractiveElements:i,shouldRespectForcePress:l,isEnabled:s})),[i,s,l]),u=J((e=>{const t=a();return t||ve(!1),function(e,t,n=Pe){const r=window.getComputedStyle(t),o=t.getBoundingClientRect(),a=le(o,r),i=ie(a,n);return{descriptor:e,placeholder:{client:a,tagName:t.tagName.toLowerCase(),display:r.display},displaceBy:{x:a.marginBox.width,y:a.marginBox.height},client:a,page:i}}(r,t,e)}),[r,a]),d=X((()=>({uniqueId:n,descriptor:r,options:c,getDimension:u})),[r,u,c,n]),f=(0,e.useRef)(d),p=(0,e.useRef)(!0);sr((()=>(o.draggable.register(f.current),()=>o.draggable.unregister(f.current))),[o.draggable]),sr((()=>{if(p.current)return void(p.current=!1);const e=f.current;f.current=d,o.draggable.update(d,e)}),[d,o.draggable])}(X((()=>({descriptor:d,registry:s,getDraggableRef:a,canDragInteractiveElements:h,shouldRespectForcePress:g,isEnabled:m})),[d,s,a,h,g,m]));const w=X((()=>m?{tabIndex:0,role:"button","aria-describedby":l,"data-rfd-drag-handle-draggable-id":p,"data-rfd-drag-handle-context-id":i,draggable:!1,onDragStart:to}:null),[i,l,p,m]),E=J((t=>{"DRAGGING"===b.type&&b.dropping&&"transform"===t.propertyName&&(e.version.startsWith("16")||e.version.startsWith("17")?v():(0,r.flushSync)(v))}),[v,b]),x=X((()=>{const e=function(e){return"DRAGGING"===e.type?function(e){const t=e.dimension.client,{offset:n,combineWith:r,dropping:o}=e,a=Boolean(r),i=(e=>null!=e.forceShouldAnimate?e.forceShouldAnimate:"SNAP"===e.mode)(e),l=Boolean(o),s=l?yn(n,a):hn(n);return{position:"fixed",top:t.marginBox.top,left:t.marginBox.left,boxSizing:"border-box",width:t.borderBox.width,height:t.borderBox.height,transition:Xr(i,o),transform:s,opacity:Jr(a,l),zIndex:l?Yr:Qr,pointerEvents:"none"}}(e):{transform:hn((t=e).offset),transition:t.shouldAnimateDisplacement?void 0:"none"};var t}(b),t="DRAGGING"===b.type&&b.dropping?E:void 0;return{innerRef:o,draggableProps:{"data-rfd-draggable-context-id":i,"data-rfd-draggable-id":p,style:e,onTransitionEnd:t},dragHandleProps:w}}),[i,w,p,b,E,o]),S=X((()=>({draggableId:d.id,type:d.type,source:{index:d.index,droppableId:d.droppableId}})),[d.droppableId,d.id,d.index,d.type]);return e.createElement(e.Fragment,null,f(x,b.snapshot,S))}));var lo=io;function so(t){return eo(Zr).isUsingCloneFor!==t.draggableId||t.isClone?e.createElement(lo,t):null}function co(t){const n="boolean"!=typeof t.isDragDisabled||!t.isDragDisabled,r=Boolean(t.disableInteractiveElementBlocking),o=Boolean(t.shouldRespectForcePress);return e.createElement(so,k({},t,{isClone:!1,isEnabled:n,canDragInteractiveElements:r,shouldRespectForcePress:o}))}const uo=e=>t=>e===t,fo=uo("scroll"),po=uo("auto"),mo=(uo("visible"),(e,t)=>t(e.overflowX)||t(e.overflowY)),go=e=>null==e||e===document.body||e===document.documentElement?null:(e=>{const t=window.getComputedStyle(e),n={overflowX:t.overflowX,overflowY:t.overflowY};return mo(n,fo)||mo(n,po)})(e)?e:go(e.parentElement);var ho=go,yo=e=>({x:e.scrollLeft,y:e.scrollTop});const bo=e=>!!e&&("fixed"===window.getComputedStyle(e).position||bo(e.parentElement));const vo={passive:!1},wo={passive:!0};var Eo=e=>e.shouldPublishImmediately?vo:wo;const xo=e=>e&&e.env.closestScrollable||null;function So(t){const n=(0,e.useRef)(null),r=eo(Er),o=wr("droppable"),{registry:a,marshal:i}=r,l=xr(t),s=X((()=>({id:t.droppableId,type:t.type,mode:t.mode})),[t.droppableId,t.mode,t.type]),c=(0,e.useRef)(s),u=X((()=>de(((e,t)=>{n.current||ve(!1);const r={x:e,y:t};i.updateDroppableScroll(s.id,r)}))),[s.id,i]),d=J((()=>{const e=n.current;return e&&e.env.closestScrollable?yo(e.env.closestScrollable):Pe}),[]),f=J((()=>{const e=d();u(e.x,e.y)}),[d,u]),p=X((()=>fe(f)),[f]),m=J((()=>{const e=n.current,t=xo(e);e&&t||ve(!1),e.scrollOptions.shouldPublishImmediately?f():p()}),[p,f]),g=J(((e,t)=>{n.current&&ve(!1);const o=l.current,a=o.getDroppableRef();a||ve(!1);const i=(e=>({closestScrollable:ho(e),isFixedOnPage:bo(e)}))(a),c={ref:a,descriptor:s,env:i,scrollOptions:t};n.current=c;const u=(({ref:e,descriptor:t,env:n,windowScroll:r,direction:o,isDropDisabled:a,isCombineEnabled:i,shouldClipSubject:l})=>{const s=n.closestScrollable,c=((e,t)=>{const n=se(e);if(!t)return n;if(e!==t)return n;const r=n.paddingBox.top-t.scrollTop,o=n.paddingBox.left-t.scrollLeft,a=r+t.scrollHeight,i=o+t.scrollWidth,l=ee({top:r,right:i,bottom:a,left:o},n.border);return re({borderBox:l,margin:n.margin,border:n.border,padding:n.padding})})(e,s),u=ie(c,r),d=(()=>{if(!s)return null;const e=se(s),t={scrollHeight:s.scrollHeight,scrollWidth:s.scrollWidth};return{client:e,page:ie(e,r),scroll:yo(s),scrollSize:t,shouldClipSubject:l}})(),f=(({descriptor:e,isEnabled:t,isCombineEnabled:n,isFixedOnPage:r,direction:o,client:a,page:i,closest:l})=>{const s=(()=>{if(!l)return null;const{scrollSize:e,client:t}=l,n=Tn({scrollHeight:e.scrollHeight,scrollWidth:e.scrollWidth,height:t.paddingBox.height,width:t.paddingBox.width});return{pageMarginBox:l.page.marginBox,frameClient:t,scrollSize:e,shouldClipSubject:l.shouldClipSubject,scroll:{initial:l.scroll,current:l.scroll,max:n,diff:{value:Pe,displacement:Pe}}}})(),c="vertical"===o?nt:rt;return{descriptor:e,isCombineEnabled:n,isFixedOnPage:r,axis:c,isEnabled:t,client:a,page:i,frame:s,subject:Fe({page:i,withPlaceholder:null,axis:c,frame:s})}})({descriptor:t,isEnabled:!a,isCombineEnabled:i,isFixedOnPage:n.isFixedOnPage,direction:o,client:c,page:u,closest:d});return f})({ref:a,descriptor:s,env:i,windowScroll:e,direction:o.direction,isDropDisabled:o.isDropDisabled,isCombineEnabled:o.isCombineEnabled,shouldClipSubject:!o.ignoreContainerClipping}),d=i.closestScrollable;return d&&(d.setAttribute(ar.contextId,r.contextId),d.addEventListener("scroll",m,Eo(c.scrollOptions))),u}),[r.contextId,s,m,l]),h=J((()=>{const e=n.current,t=xo(e);return e&&t||ve(!1),yo(t)}),[]),y=J((()=>{const e=n.current;e||ve(!1);const t=xo(e);n.current=null,t&&(p.cancel(),t.removeAttribute(ar.contextId),t.removeEventListener("scroll",m,Eo(e.scrollOptions)))}),[m,p]),b=J((e=>{const t=n.current;t||ve(!1);const r=xo(t);r||ve(!1),r.scrollTop+=e.y,r.scrollLeft+=e.x}),[]),v=X((()=>({getDimensionAndWatchScroll:g,getScrollWhileDragging:h,dragStopped:y,scroll:b})),[y,g,h,b]),w=X((()=>({uniqueId:o,descriptor:s,callbacks:v})),[v,s,o]);sr((()=>(c.current=w.descriptor,a.droppable.register(w),()=>{n.current&&y(),a.droppable.unregister(w)})),[v,s,y,w,i,a.droppable]),sr((()=>{n.current&&i.updateDroppableIsEnabled(c.current.id,!t.isDropDisabled)}),[t.isDropDisabled,i]),sr((()=>{n.current&&i.updateDroppableIsCombineEnabled(c.current.id,t.isCombineEnabled)}),[t.isCombineEnabled,i])}function Oo(){}const ko={width:0,height:0,margin:{top:0,right:0,bottom:0,left:0}};var Co=e.memo((t=>{const n=(0,e.useRef)(null),r=J((()=>{n.current&&(clearTimeout(n.current),n.current=null)}),[]),{animate:o,onTransitionEnd:a,onClose:i,contextId:l}=t,[s,c]=(0,e.useState)("open"===t.animate);(0,e.useEffect)((()=>s?"open"!==o?(r(),c(!1),Oo):n.current?Oo:(n.current=setTimeout((()=>{n.current=null,c(!1)})),r):Oo),[o,s,r]);const u=J((e=>{"height"===e.propertyName&&(a(),"close"===o&&i())}),[o,i,a]),d=(({isAnimatingOpenOnMount:e,placeholder:t,animate:n})=>{const r=(({isAnimatingOpenOnMount:e,placeholder:t,animate:n})=>e||"close"===n?ko:{height:t.client.borderBox.height,width:t.client.borderBox.width,margin:t.client.margin})({isAnimatingOpenOnMount:e,placeholder:t,animate:n});return{display:t.display,boxSizing:"border-box",width:r.width,height:r.height,marginTop:r.margin.top,marginRight:r.margin.right,marginBottom:r.margin.bottom,marginLeft:r.margin.left,flexShrink:"0",flexGrow:"0",pointerEvents:"none",transition:"none"!==n?mn.placeholder:null}})({isAnimatingOpenOnMount:s,animate:t.animate,placeholder:t.placeholder});return e.createElement(t.placeholder.tagName,{style:d,"data-rfd-placeholder-context-id":l,onTransitionEnd:u,ref:t.innerRef})}));class Po extends e.PureComponent{constructor(...e){super(...e),this.state={isVisible:Boolean(this.props.on),data:this.props.on,animate:this.props.shouldAnimate&&this.props.on?"open":"none"},this.onClose=()=>{"close"===this.state.animate&&this.setState({isVisible:!1})}}static getDerivedStateFromProps(e,t){return e.shouldAnimate?e.on?{isVisible:!0,data:e.on,animate:"open"}:t.isVisible?{isVisible:!0,data:t.data,animate:"close"}:{isVisible:!1,animate:"close",data:null}:{isVisible:Boolean(e.on),data:e.on,animate:"none"}}render(){if(!this.state.isVisible)return null;const e={onClose:this.onClose,data:this.state.data,animate:this.state.animate};return this.props.children(e)}}const Do={mode:"standard",type:"DEFAULT",direction:"vertical",isDropDisabled:!1,isCombineEnabled:!1,ignoreContainerClipping:!1,renderClone:null,getContainerForClone:function(){return document.body||ve(!1),document.body}},_o=e=>{let t,n={...e};for(t in Do)void 0===e[t]&&(n={...n,[t]:Do[t]});return n},No=(e,t)=>e===t.droppable.type,Io=(e,t)=>t.draggables[e.draggable.id];var Ro=q((()=>{const e={placeholder:null,shouldAnimatePlaceholder:!0,snapshot:{isDraggingOver:!1,draggingOverWith:null,draggingFromThisWith:null,isUsingPlaceholder:!1},useClone:null},t={...e,shouldAnimatePlaceholder:!1},n=de((e=>({draggableId:e.id,type:e.type,source:{index:e.index,droppableId:e.droppableId}}))),r=de(((r,o,a,i,l,s)=>{const c=l.descriptor.id;if(l.descriptor.droppableId===r){const e=s?{render:s,dragging:n(l.descriptor)}:null,t={isDraggingOver:a,draggingOverWith:a?c:null,draggingFromThisWith:c,isUsingPlaceholder:!0};return{placeholder:l.placeholder,shouldAnimatePlaceholder:!1,snapshot:t,useClone:e}}if(!o)return t;if(!i)return e;const u={isDraggingOver:a,draggingOverWith:c,draggingFromThisWith:null,isUsingPlaceholder:!0};return{placeholder:l.placeholder,shouldAnimatePlaceholder:!0,snapshot:u,useClone:null}}));return(n,o)=>{const a=_o(o),i=a.droppableId,l=a.type,s=!a.isDropDisabled,c=a.renderClone;if(Sr(n)){const e=n.critical;if(!No(l,e))return t;const o=Io(e,n.dimensions),a=_t(n.impact)===i;return r(i,s,a,a,o,c)}if("DROP_ANIMATING"===n.phase){const e=n.completed;if(!No(l,e.critical))return t;const o=Io(e.critical,n.dimensions);return r(i,s,ro(e.result)===i,_t(e.impact)===i,o,c)}if("IDLE"===n.phase&&n.completed&&!n.shouldFlush){const r=n.completed;if(!No(l,r.critical))return t;const o=_t(r.impact)===i,a=Boolean(r.impact.at&&"COMBINE"===r.impact.at.type),s=r.critical.droppable.id===i;return o?a?e:t:s?e:t}return t}}),{updateViewportMaxScroll:e=>({type:"UPDATE_VIEWPORT_MAX_SCROLL",payload:e})},((e,t,n)=>({..._o(n),...e,...t})),{context:gr,areStatePropsEqual:no})((t=>{const n=(0,e.useContext)(Er);n||ve(!1);const{contextId:o,isMovementAllowed:a}=n,i=(0,e.useRef)(null),l=(0,e.useRef)(null),{children:s,droppableId:c,type:u,mode:d,direction:f,ignoreContainerClipping:p,isDropDisabled:m,isCombineEnabled:g,snapshot:h,useClone:y,updateViewportMaxScroll:b,getContainerForClone:v}=t,w=J((()=>i.current),[]),E=J(((e=null)=>{i.current=e}),[]),x=(J((()=>l.current),[]),J(((e=null)=>{l.current=e}),[])),S=J((()=>{a()&&b({maxScroll:jn()})}),[a,b]);So({droppableId:c,type:u,mode:d,direction:f,isDropDisabled:m,isCombineEnabled:g,ignoreContainerClipping:p,getDroppableRef:w});const O=X((()=>e.createElement(Po,{on:t.placeholder,shouldAnimate:t.shouldAnimatePlaceholder},(({onClose:t,data:n,animate:r})=>e.createElement(Co,{placeholder:n,onClose:t,innerRef:x,animate:r,contextId:o,onTransitionEnd:S})))),[o,S,t.placeholder,t.shouldAnimatePlaceholder,x]),k=X((()=>({innerRef:E,placeholder:O,droppableProps:{"data-rfd-droppable-id":c,"data-rfd-droppable-context-id":o}})),[o,c,O,E]),C=y?y.dragging.draggableId:null,P=X((()=>({droppableId:c,type:u,isUsingCloneFor:C})),[c,C,u]);return e.createElement(Zr.Provider,{value:P},s(k,h),function(){if(!y)return null;const{dragging:t,render:n}=y,o=e.createElement(so,{draggableId:t.draggableId,index:t.source.index,isClone:!0,isEnabled:!0,shouldRespectForcePress:!1,canDragInteractiveElements:!0},((e,r)=>n(e,r,t)));return r.createPortal(o,v())}())}));const To=e=>{let t;const n=new Set,r=(e,r)=>{const o="function"==typeof e?e(t):e;if(!Object.is(o,t)){const e=t;t=(null!=r?r:"object"!=typeof o||null===o)?o:Object.assign({},t,o),n.forEach((n=>n(t,e)))}},o=()=>t,a={setState:r,getState:o,subscribe:e=>(n.add(e),()=>n.delete(e)),destroy:()=>{console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}};return t=e(r,o,a),a},{useDebugValue:Ao}=e,{useSyncExternalStoreWithSelector:jo}=y,Lo=(e,t)=>{const n=(e=>e?To(e):To)(e),r=(e,r=t)=>function(e,t=e.getState,n){const r=jo(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return Ao(r),r}(n,e,r);return Object.assign(r,n),r};function Mo(e){return Mo="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},Mo(e)}function Bo(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Fo(e){for(var t=1;t5&&void 0!==arguments[5]&&arguments[5],i={opacity:t.isDragging?.7:1,backgroundColor:r||o?"#eae7f7":"initial"};return!a&&null==t.draggingOver&&(!t.isDragging||t.isDragging&&t.isDropAnimating)&&(e.transform="none"),t.isDropAnimating?(n&&(i.transitionDuration="0.001s"),Fo(Fo({},e),i)):Fo(Fo({},e),i)},Wo=function(e,t){var n=t.isDraggingOver;return Fo(Fo({},e),{backgroundColor:n?"#f2f2f2":"#f9f9f9",border:n?"1px dashed #ccc":"0"})};function Ho(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:".",r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:",";try{t=Math.abs(t),t=isNaN(t)?2:t;var o=e<0?"-":"",a=parseInt(e=Math.abs(Number(e)||0).toFixed(t)).toString(),i=a.length>3?a.length%3:0;return o+(i?a.substr(0,i)+r:"")+a.substr(i).replace(/(\d{3})(?=\d)/g,"$1"+r)+(t?n+Math.abs(e-a).toFixed(t).slice(2):"")}catch(t){return e}}var Go=function(e,t){var n=t-e;return Array.from({length:n},(function(t,n){return e+n}))},Vo=function(e,t){return e.length===t.length&&e.every((function(e,n){return e.id===t[n].id}))},qo=function(e,t){return e.length===t.length&&e.every((function(e,n){return e===t[n]}))};function Ko(e,t){return!e&&!t||!(!e!=!t)&&Object.getPrototypeOf(e)===Object.getPrototypeOf(t)&&(Object.getPrototypeOf(e)!==Object.getPrototypeOf([])||!!Object.keys(e).length==!!Object.keys(t).length)}var Qo=n(962);function Yo(e,t){return e.contains?e.contains(t):e.compareDocumentPosition?e===t||!!(16&e.compareDocumentPosition(t)):void 0}var Xo=n(697),Jo=n.n(Xo);function Zo(){const t=(0,e.useRef)(!0),n=(0,e.useRef)((()=>t.current));return(0,e.useEffect)((()=>(t.current=!0,()=>{t.current=!1})),[]),n.current}function ea(t){const n=function(t){const n=(0,e.useRef)(t);return n.current=t,n}(t);(0,e.useEffect)((()=>()=>n.current()),[])}const ta=2**31-1;function na(e,t,n){const r=n-Date.now();e.current=r<=ta?setTimeout(t,r):setTimeout((()=>na(e,t,n)),ta)}function ra(){const t=Zo(),n=(0,e.useRef)();return ea((()=>clearTimeout(n.current))),(0,e.useMemo)((()=>{const e=()=>clearTimeout(n.current);return{set:function(r,o=0){t()&&(e(),o<=ta?n.current=setTimeout(r,o):na(n,r,Date.now()+o))},clear:e}}),[])}var oa=n(473),aa=n.n(oa);function ia(e){return"default"+e.charAt(0).toUpperCase()+e.substr(1)}function la(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}function sa(t,n,r){var o=(0,e.useRef)(void 0!==t),a=(0,e.useState)(n),i=a[0],l=a[1],s=void 0!==t,c=o.current;return o.current=s,!s&&c&&i!==n&&l(n),[s?t:i,(0,e.useCallback)((function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;oe&&"function"!=typeof e?t=>{e.current=t}:e,ua=function(t,n){return(0,e.useMemo)((()=>function(e,t){const n=ca(e),r=ca(t);return e=>{n&&n(e),r&&r(e)}}(t,n)),[t,n])};var da=n(184),fa=n.n(da);function pa(){return(0,e.useState)(null)}var ma=Object.prototype.hasOwnProperty;function ga(e,t,n){for(n of e.keys())if(ha(n,t))return n}function ha(e,t){var n,r,o;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((r=e.length)===t.length)for(;r--&&ha(e[r],t[r]););return-1===r}if(n===Set){if(e.size!==t.size)return!1;for(r of e){if((o=r)&&"object"==typeof o&&!(o=ga(t,o)))return!1;if(!t.has(o))return!1}return!0}if(n===Map){if(e.size!==t.size)return!1;for(r of e){if((o=r[0])&&"object"==typeof o&&!(o=ga(t,o)))return!1;if(!ha(r[1],t.get(o)))return!1}return!0}if(n===ArrayBuffer)e=new Uint8Array(e),t=new Uint8Array(t);else if(n===DataView){if((r=e.byteLength)===t.byteLength)for(;r--&&e.getInt8(r)===t.getInt8(r););return-1===r}if(ArrayBuffer.isView(e)){if((r=e.byteLength)===t.byteLength)for(;r--&&e[r]===t[r];);return-1===r}if(!n||"object"==typeof e){for(n in r=0,e){if(ma.call(e,n)&&++r&&!ma.call(t,n))return!1;if(!(n in t)||!ha(e[n],t[n]))return!1}return Object.keys(t).length===r}}return e!=e&&t!=t}function ya(e){return e.split("-")[0]}function ba(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function va(e){return e instanceof ba(e).Element||e instanceof Element}function wa(e){return e instanceof ba(e).HTMLElement||e instanceof HTMLElement}function Ea(e){return"undefined"!=typeof ShadowRoot&&(e instanceof ba(e).ShadowRoot||e instanceof ShadowRoot)}var xa=Math.max,Sa=Math.min,Oa=Math.round;function ka(){var e=navigator.userAgentData;return null!=e&&e.brands&&Array.isArray(e.brands)?e.brands.map((function(e){return e.brand+"/"+e.version})).join(" "):navigator.userAgent}function Ca(){return!/^((?!chrome|android).)*safari/i.test(ka())}function Pa(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var r=e.getBoundingClientRect(),o=1,a=1;t&&wa(e)&&(o=e.offsetWidth>0&&Oa(r.width)/e.offsetWidth||1,a=e.offsetHeight>0&&Oa(r.height)/e.offsetHeight||1);var i=(va(e)?ba(e):window).visualViewport,l=!Ca()&&n,s=(r.left+(l&&i?i.offsetLeft:0))/o,c=(r.top+(l&&i?i.offsetTop:0))/a,u=r.width/o,d=r.height/a;return{width:u,height:d,top:c,right:s+u,bottom:c+d,left:s,x:s,y:c}}function Da(e){var t=Pa(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function _a(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&Ea(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function Na(e){return e?(e.nodeName||"").toLowerCase():null}function Ia(e){return ba(e).getComputedStyle(e)}function Ra(e){return["table","td","th"].indexOf(Na(e))>=0}function Ta(e){return((va(e)?e.ownerDocument:e.document)||window.document).documentElement}function Aa(e){return"html"===Na(e)?e:e.assignedSlot||e.parentNode||(Ea(e)?e.host:null)||Ta(e)}function ja(e){return wa(e)&&"fixed"!==Ia(e).position?e.offsetParent:null}function La(e){for(var t=ba(e),n=ja(e);n&&Ra(n)&&"static"===Ia(n).position;)n=ja(n);return n&&("html"===Na(n)||"body"===Na(n)&&"static"===Ia(n).position)?t:n||function(e){var t=/firefox/i.test(ka());if(/Trident/i.test(ka())&&wa(e)&&"fixed"===Ia(e).position)return null;var n=Aa(e);for(Ea(n)&&(n=n.host);wa(n)&&["html","body"].indexOf(Na(n))<0;){var r=Ia(n);if("none"!==r.transform||"none"!==r.perspective||"paint"===r.contain||-1!==["transform","perspective"].indexOf(r.willChange)||t&&"filter"===r.willChange||t&&r.filter&&"none"!==r.filter)return n;n=n.parentNode}return null}(e)||t}function Ma(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function Ba(e,t,n){return xa(e,Sa(t,n))}function Fa(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function za(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}var Ua="top",$a="bottom",Wa="right",Ha="left",Ga="auto",Va=[Ua,$a,Wa,Ha],qa="start",Ka="end",Qa="viewport",Ya="popper",Xa=Va.reduce((function(e,t){return e.concat([t+"-"+qa,t+"-"+Ka])}),[]),Ja=[].concat(Va,[Ga]).reduce((function(e,t){return e.concat([t,t+"-"+qa,t+"-"+Ka])}),[]),Za=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];const ei={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,r=e.name,o=e.options,a=n.elements.arrow,i=n.modifiersData.popperOffsets,l=ya(n.placement),s=Ma(l),c=[Ha,Wa].indexOf(l)>=0?"height":"width";if(a&&i){var u=function(e,t){return Fa("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:za(e,Va))}(o.padding,n),d=Da(a),f="y"===s?Ua:Ha,p="y"===s?$a:Wa,m=n.rects.reference[c]+n.rects.reference[s]-i[s]-n.rects.popper[c],g=i[s]-n.rects.reference[s],h=La(a),y=h?"y"===s?h.clientHeight||0:h.clientWidth||0:0,b=m/2-g/2,v=u[f],w=y-d[c]-u[p],E=y/2-d[c]/2+b,x=Ba(v,E,w),S=s;n.modifiersData[r]=((t={})[S]=x,t.centerOffset=x-E,t)}},effect:function(e){var t=e.state,n=e.options.element,r=void 0===n?"[data-popper-arrow]":n;null!=r&&("string"!=typeof r||(r=t.elements.popper.querySelector(r)))&&_a(t.elements.popper,r)&&(t.elements.arrow=r)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function ti(e){return e.split("-")[1]}var ni={top:"auto",right:"auto",bottom:"auto",left:"auto"};function ri(e){var t,n=e.popper,r=e.popperRect,o=e.placement,a=e.variation,i=e.offsets,l=e.position,s=e.gpuAcceleration,c=e.adaptive,u=e.roundOffsets,d=e.isFixed,f=i.x,p=void 0===f?0:f,m=i.y,g=void 0===m?0:m,h="function"==typeof u?u({x:p,y:g}):{x:p,y:g};p=h.x,g=h.y;var y=i.hasOwnProperty("x"),b=i.hasOwnProperty("y"),v=Ha,w=Ua,E=window;if(c){var x=La(n),S="clientHeight",O="clientWidth";x===ba(n)&&"static"!==Ia(x=Ta(n)).position&&"absolute"===l&&(S="scrollHeight",O="scrollWidth"),(o===Ua||(o===Ha||o===Wa)&&a===Ka)&&(w=$a,g-=(d&&x===E&&E.visualViewport?E.visualViewport.height:x[S])-r.height,g*=s?1:-1),o!==Ha&&(o!==Ua&&o!==$a||a!==Ka)||(v=Wa,p-=(d&&x===E&&E.visualViewport?E.visualViewport.width:x[O])-r.width,p*=s?1:-1)}var k,C=Object.assign({position:l},c&&ni),P=!0===u?function(e,t){var n=e.x,r=e.y,o=t.devicePixelRatio||1;return{x:Oa(n*o)/o||0,y:Oa(r*o)/o||0}}({x:p,y:g},ba(n)):{x:p,y:g};return p=P.x,g=P.y,s?Object.assign({},C,((k={})[w]=b?"0":"",k[v]=y?"0":"",k.transform=(E.devicePixelRatio||1)<=1?"translate("+p+"px, "+g+"px)":"translate3d("+p+"px, "+g+"px, 0)",k)):Object.assign({},C,((t={})[w]=b?g+"px":"",t[v]=y?p+"px":"",t.transform="",t))}const oi={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,r=n.gpuAcceleration,o=void 0===r||r,a=n.adaptive,i=void 0===a||a,l=n.roundOffsets,s=void 0===l||l,c={placement:ya(t.placement),variation:ti(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:o,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,ri(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:i,roundOffsets:s})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,ri(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:s})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}};var ai={passive:!0};const ii={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,n=e.instance,r=e.options,o=r.scroll,a=void 0===o||o,i=r.resize,l=void 0===i||i,s=ba(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return a&&c.forEach((function(e){e.addEventListener("scroll",n.update,ai)})),l&&s.addEventListener("resize",n.update,ai),function(){a&&c.forEach((function(e){e.removeEventListener("scroll",n.update,ai)})),l&&s.removeEventListener("resize",n.update,ai)}},data:{}};var li={left:"right",right:"left",bottom:"top",top:"bottom"};function si(e){return e.replace(/left|right|bottom|top/g,(function(e){return li[e]}))}var ci={start:"end",end:"start"};function ui(e){return e.replace(/start|end/g,(function(e){return ci[e]}))}function di(e){var t=ba(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function fi(e){return Pa(Ta(e)).left+di(e).scrollLeft}function pi(e){var t=Ia(e),n=t.overflow,r=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+r)}function mi(e){return["html","body","#document"].indexOf(Na(e))>=0?e.ownerDocument.body:wa(e)&&pi(e)?e:mi(Aa(e))}function gi(e,t){var n;void 0===t&&(t=[]);var r=mi(e),o=r===(null==(n=e.ownerDocument)?void 0:n.body),a=ba(r),i=o?[a].concat(a.visualViewport||[],pi(r)?r:[]):r,l=t.concat(i);return o?l:l.concat(gi(Aa(i)))}function hi(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function yi(e,t,n){return t===Qa?hi(function(e,t){var n=ba(e),r=Ta(e),o=n.visualViewport,a=r.clientWidth,i=r.clientHeight,l=0,s=0;if(o){a=o.width,i=o.height;var c=Ca();(c||!c&&"fixed"===t)&&(l=o.offsetLeft,s=o.offsetTop)}return{width:a,height:i,x:l+fi(e),y:s}}(e,n)):va(t)?function(e,t){var n=Pa(e,!1,"fixed"===t);return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}(t,n):hi(function(e){var t,n=Ta(e),r=di(e),o=null==(t=e.ownerDocument)?void 0:t.body,a=xa(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),i=xa(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),l=-r.scrollLeft+fi(e),s=-r.scrollTop;return"rtl"===Ia(o||n).direction&&(l+=xa(n.clientWidth,o?o.clientWidth:0)-a),{width:a,height:i,x:l,y:s}}(Ta(e)))}function bi(e){var t,n=e.reference,r=e.element,o=e.placement,a=o?ya(o):null,i=o?ti(o):null,l=n.x+n.width/2-r.width/2,s=n.y+n.height/2-r.height/2;switch(a){case Ua:t={x:l,y:n.y-r.height};break;case $a:t={x:l,y:n.y+n.height};break;case Wa:t={x:n.x+n.width,y:s};break;case Ha:t={x:n.x-r.width,y:s};break;default:t={x:n.x,y:n.y}}var c=a?Ma(a):null;if(null!=c){var u="y"===c?"height":"width";switch(i){case qa:t[c]=t[c]-(n[u]/2-r[u]/2);break;case Ka:t[c]=t[c]+(n[u]/2-r[u]/2)}}return t}function vi(e,t){void 0===t&&(t={});var n=t,r=n.placement,o=void 0===r?e.placement:r,a=n.strategy,i=void 0===a?e.strategy:a,l=n.boundary,s=void 0===l?"clippingParents":l,c=n.rootBoundary,u=void 0===c?Qa:c,d=n.elementContext,f=void 0===d?Ya:d,p=n.altBoundary,m=void 0!==p&&p,g=n.padding,h=void 0===g?0:g,y=Fa("number"!=typeof h?h:za(h,Va)),b=f===Ya?"reference":Ya,v=e.rects.popper,w=e.elements[m?b:f],E=function(e,t,n,r){var o="clippingParents"===t?function(e){var t=gi(Aa(e)),n=["absolute","fixed"].indexOf(Ia(e).position)>=0&&wa(e)?La(e):e;return va(n)?t.filter((function(e){return va(e)&&_a(e,n)&&"body"!==Na(e)})):[]}(e):[].concat(t),a=[].concat(o,[n]),i=a[0],l=a.reduce((function(t,n){var o=yi(e,n,r);return t.top=xa(o.top,t.top),t.right=Sa(o.right,t.right),t.bottom=Sa(o.bottom,t.bottom),t.left=xa(o.left,t.left),t}),yi(e,i,r));return l.width=l.right-l.left,l.height=l.bottom-l.top,l.x=l.left,l.y=l.top,l}(va(w)?w:w.contextElement||Ta(e.elements.popper),s,u,i),x=Pa(e.elements.reference),S=bi({reference:x,element:v,strategy:"absolute",placement:o}),O=hi(Object.assign({},v,S)),k=f===Ya?O:x,C={top:E.top-k.top+y.top,bottom:k.bottom-E.bottom+y.bottom,left:E.left-k.left+y.left,right:k.right-E.right+y.right},P=e.modifiersData.offset;if(f===Ya&&P){var D=P[o];Object.keys(C).forEach((function(e){var t=[Wa,$a].indexOf(e)>=0?1:-1,n=[Ua,$a].indexOf(e)>=0?"y":"x";C[e]+=D[n]*t}))}return C}const wi={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var o=n.mainAxis,a=void 0===o||o,i=n.altAxis,l=void 0===i||i,s=n.fallbackPlacements,c=n.padding,u=n.boundary,d=n.rootBoundary,f=n.altBoundary,p=n.flipVariations,m=void 0===p||p,g=n.allowedAutoPlacements,h=t.options.placement,y=ya(h),b=s||(y!==h&&m?function(e){if(ya(e)===Ga)return[];var t=si(e);return[ui(e),t,ui(t)]}(h):[si(h)]),v=[h].concat(b).reduce((function(e,n){return e.concat(ya(n)===Ga?function(e,t){void 0===t&&(t={});var n=t,r=n.placement,o=n.boundary,a=n.rootBoundary,i=n.padding,l=n.flipVariations,s=n.allowedAutoPlacements,c=void 0===s?Ja:s,u=ti(r),d=u?l?Xa:Xa.filter((function(e){return ti(e)===u})):Va,f=d.filter((function(e){return c.indexOf(e)>=0}));0===f.length&&(f=d);var p=f.reduce((function(t,n){return t[n]=vi(e,{placement:n,boundary:o,rootBoundary:a,padding:i})[ya(n)],t}),{});return Object.keys(p).sort((function(e,t){return p[e]-p[t]}))}(t,{placement:n,boundary:u,rootBoundary:d,padding:c,flipVariations:m,allowedAutoPlacements:g}):n)}),[]),w=t.rects.reference,E=t.rects.popper,x=new Map,S=!0,O=v[0],k=0;k=0,N=_?"width":"height",I=vi(t,{placement:C,boundary:u,rootBoundary:d,altBoundary:f,padding:c}),R=_?D?Wa:Ha:D?$a:Ua;w[N]>E[N]&&(R=si(R));var T=si(R),A=[];if(a&&A.push(I[P]<=0),l&&A.push(I[R]<=0,I[T]<=0),A.every((function(e){return e}))){O=C,S=!1;break}x.set(C,A)}if(S)for(var j=function(e){var t=v.find((function(t){var n=x.get(t);if(n)return n.slice(0,e).every((function(e){return e}))}));if(t)return O=t,"break"},L=m?3:1;L>0&&"break"!==j(L);L--);t.placement!==O&&(t.modifiersData[r]._skip=!0,t.placement=O,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function Ei(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function xi(e){return[Ua,Wa,$a,Ha].some((function(t){return e[t]>=0}))}const Si={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,r=t.rects.reference,o=t.rects.popper,a=t.modifiersData.preventOverflow,i=vi(t,{elementContext:"reference"}),l=vi(t,{altBoundary:!0}),s=Ei(i,r),c=Ei(l,o,a),u=xi(s),d=xi(c);t.modifiersData[n]={referenceClippingOffsets:s,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:d},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":d})}},Oi={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.options,r=e.name,o=n.offset,a=void 0===o?[0,0]:o,i=Ja.reduce((function(e,n){return e[n]=function(e,t,n){var r=ya(e),o=[Ha,Ua].indexOf(r)>=0?-1:1,a="function"==typeof n?n(Object.assign({},t,{placement:e})):n,i=a[0],l=a[1];return i=i||0,l=(l||0)*o,[Ha,Wa].indexOf(r)>=0?{x:l,y:i}:{x:i,y:l}}(n,t.rects,a),e}),{}),l=i[t.placement],s=l.x,c=l.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=s,t.modifiersData.popperOffsets.y+=c),t.modifiersData[r]=i}},ki={name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=bi({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}},Ci={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name,o=n.mainAxis,a=void 0===o||o,i=n.altAxis,l=void 0!==i&&i,s=n.boundary,c=n.rootBoundary,u=n.altBoundary,d=n.padding,f=n.tether,p=void 0===f||f,m=n.tetherOffset,g=void 0===m?0:m,h=vi(t,{boundary:s,rootBoundary:c,padding:d,altBoundary:u}),y=ya(t.placement),b=ti(t.placement),v=!b,w=Ma(y),E="x"===w?"y":"x",x=t.modifiersData.popperOffsets,S=t.rects.reference,O=t.rects.popper,k="function"==typeof g?g(Object.assign({},t.rects,{placement:t.placement})):g,C="number"==typeof k?{mainAxis:k,altAxis:k}:Object.assign({mainAxis:0,altAxis:0},k),P=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,D={x:0,y:0};if(x){if(a){var _,N="y"===w?Ua:Ha,I="y"===w?$a:Wa,R="y"===w?"height":"width",T=x[w],A=T+h[N],j=T-h[I],L=p?-O[R]/2:0,M=b===qa?S[R]:O[R],B=b===qa?-O[R]:-S[R],F=t.elements.arrow,z=p&&F?Da(F):{width:0,height:0},U=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},$=U[N],W=U[I],H=Ba(0,S[R],z[R]),G=v?S[R]/2-L-H-$-C.mainAxis:M-H-$-C.mainAxis,V=v?-S[R]/2+L+H+W+C.mainAxis:B+H+W+C.mainAxis,q=t.elements.arrow&&La(t.elements.arrow),K=q?"y"===w?q.clientTop||0:q.clientLeft||0:0,Q=null!=(_=null==P?void 0:P[w])?_:0,Y=T+V-Q,X=Ba(p?Sa(A,T+G-Q-K):A,T,p?xa(j,Y):j);x[w]=X,D[w]=X-T}if(l){var J,Z="x"===w?Ua:Ha,ee="x"===w?$a:Wa,te=x[E],ne="y"===E?"height":"width",re=te+h[Z],oe=te-h[ee],ae=-1!==[Ua,Ha].indexOf(y),ie=null!=(J=null==P?void 0:P[E])?J:0,le=ae?re:te-S[ne]-O[ne]-ie+C.altAxis,se=ae?te+S[ne]+O[ne]-ie-C.altAxis:oe,ce=p&&ae?function(e,t,n){var r=Ba(e,t,n);return r>n?n:r}(le,te,se):Ba(p?le:re,te,p?se:oe);x[E]=ce,D[E]=ce-te}t.modifiersData[r]=D}},requiresIfExists:["offset"]};function Pi(e,t,n){void 0===n&&(n=!1);var r,o,a=wa(t),i=wa(t)&&function(e){var t=e.getBoundingClientRect(),n=Oa(t.width)/e.offsetWidth||1,r=Oa(t.height)/e.offsetHeight||1;return 1!==n||1!==r}(t),l=Ta(t),s=Pa(e,i,n),c={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(a||!a&&!n)&&(("body"!==Na(t)||pi(l))&&(c=(r=t)!==ba(r)&&wa(r)?{scrollLeft:(o=r).scrollLeft,scrollTop:o.scrollTop}:di(r)),wa(t)?((u=Pa(t,!0)).x+=t.clientLeft,u.y+=t.clientTop):l&&(u.x=fi(l))),{x:s.left+c.scrollLeft-u.x,y:s.top+c.scrollTop-u.y,width:s.width,height:s.height}}function Di(e){var t=new Map,n=new Set,r=[];function o(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!n.has(e)){var r=t.get(e);r&&o(r)}})),r.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||o(e)})),r}function _i(e){var t;return function(){return t||(t=new Promise((function(n){Promise.resolve().then((function(){t=void 0,n(e())}))}))),t}}var Ni={placement:"bottom",modifiers:[],strategy:"absolute"};function Ii(){for(var e=arguments.length,t=new Array(e),n=0;n{}},ji={name:"ariaDescribedBy",enabled:!0,phase:"afterWrite",effect:({state:e})=>()=>{const{reference:t,popper:n}=e.elements;if("removeAttribute"in t){const e=(t.getAttribute("aria-describedby")||"").split(",").filter((e=>e.trim()!==n.id));e.length?t.setAttribute("aria-describedby",e.join(",")):t.removeAttribute("aria-describedby")}},fn:({state:e})=>{var t;const{popper:n,reference:r}=e.elements,o=null==(t=n.getAttribute("role"))?void 0:t.toLowerCase();if(n.id&&"tooltip"===o&&"setAttribute"in r){const e=r.getAttribute("aria-describedby");if(e&&-1!==e.split(",").indexOf(n.id))return;r.setAttribute("aria-describedby",e?`${e},${n.id}`:n.id)}}},Li=[],Mi=function(t,n,r={}){let{enabled:o=!0,placement:a="bottom",strategy:i="absolute",modifiers:l=Li}=r,s=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r=0||(o[n]=e[n]);return o}(r,Ti);const c=(0,e.useRef)(l),u=(0,e.useRef)(),d=(0,e.useCallback)((()=>{var e;null==(e=u.current)||e.update()}),[]),f=(0,e.useCallback)((()=>{var e;null==(e=u.current)||e.forceUpdate()}),[]),[p,m]=function(t){const n=Zo();return[t[0],(0,e.useCallback)((e=>{if(n())return t[1](e)}),[n,t[1]])]}((0,e.useState)({placement:a,update:d,forceUpdate:f,attributes:{},styles:{popper:{},arrow:{}}})),g=(0,e.useMemo)((()=>({name:"updateStateModifier",enabled:!0,phase:"write",requires:["computeStyles"],fn:({state:e})=>{const t={},n={};Object.keys(e.elements).forEach((r=>{t[r]=e.styles[r],n[r]=e.attributes[r]})),m({state:e,styles:t,attributes:n,update:d,forceUpdate:f,placement:e.placement})}})),[d,f,m]),h=(0,e.useMemo)((()=>(ha(c.current,l)||(c.current=l),c.current)),[l]);return(0,e.useEffect)((()=>{u.current&&o&&u.current.setOptions({placement:a,strategy:i,modifiers:[...h,g,Ai]})}),[i,a,g,o,h]),(0,e.useEffect)((()=>{if(o&&null!=t&&null!=n)return u.current=Ri(t,n,Object.assign({},s,{placement:a,strategy:i,modifiers:[...h,ji,g]})),()=>{null!=u.current&&(u.current.destroy(),u.current=void 0,m((e=>Object.assign({},e,{attributes:{},styles:{popper:{}}}))))}}),[o,t,n]),p},Bi=!("undefined"==typeof window||!window.document||!window.document.createElement);var Fi=!1,zi=!1;try{var Ui={get passive(){return Fi=!0},get once(){return zi=Fi=!0}};Bi&&(window.addEventListener("test",Ui,Ui),window.removeEventListener("test",Ui,!0))}catch(e){}const $i=function(e,t,n,r){if(r&&"boolean"!=typeof r&&!zi){var o=r.once,a=r.capture,i=n;!zi&&o&&(i=n.__once||function e(r){this.removeEventListener(t,e,a),n.call(this,r)},n.__once=i),e.addEventListener(t,i,Fi?r:a)}e.addEventListener(t,n,r)},Wi=function(e,t,n,r){var o=r&&"boolean"!=typeof r?r.capture:r;e.removeEventListener(t,n,o),n.__once&&e.removeEventListener(t,n.__once,o)},Hi=function(e,t,n,r){return $i(e,t,n,r),function(){Wi(e,t,n,r)}};function Gi(e){return e&&e.ownerDocument||document}const Vi=function(t){const n=(0,e.useRef)(t);return(0,e.useEffect)((()=>{n.current=t}),[t]),n};function qi(t){const n=Vi(t);return(0,e.useCallback)((function(...e){return n.current&&n.current(...e)}),[n])}const Ki=()=>{},Qi=e=>e&&("current"in e?e.current:e),Yi={click:"mousedown",mouseup:"mousedown",pointerup:"pointerdown"};function Xi(e){return"Escape"===e.code||27===e.keyCode}const Ji=()=>{},Zi=function(t,n,{disabled:r,clickTrigger:o}={}){const a=n||Ji;!function(t,n=Ki,{disabled:r,clickTrigger:o="click"}={}){const a=(0,e.useRef)(!1),i=(0,e.useRef)(!1),l=(0,e.useCallback)((e=>{const n=Qi(t);var r;aa()(!!n,"ClickOutside captured a close event but does not have a ref to compare it to. useClickOutside(), should be passed a ref that resolves to a DOM node"),a.current=!n||!!((r=e).metaKey||r.altKey||r.ctrlKey||r.shiftKey)||!function(e){return 0===e.button}(e)||!!Yo(n,e.target)||i.current,i.current=!1}),[t]),s=qi((e=>{const n=Qi(t);n&&Yo(n,e.target)&&(i.current=!0)})),c=qi((e=>{a.current||n(e)}));(0,e.useEffect)((()=>{var e,n;if(r||null==t)return;const a=Gi(Qi(t)),i=a.defaultView||window;let u=null!=(e=i.event)?e:null==(n=i.parent)?void 0:n.event,d=null;Yi[o]&&(d=Hi(a,Yi[o],s,!0));const f=Hi(a,o,l,!0),p=Hi(a,o,(e=>{e!==u?c(e):u=void 0}));let m=[];return"ontouchstart"in a.documentElement&&(m=[].slice.call(a.body.children).map((e=>Hi(e,"mousemove",Ki)))),()=>{null==d||d(),f(),p(),m.forEach((e=>e()))}}),[t,r,o,l,s,c])}(t,a,{disabled:r,clickTrigger:o});const i=qi((e=>{Xi(e)&&a(e)}));(0,e.useEffect)((()=>{if(r||null==t)return;const e=Gi(Qi(t));let n=(e.defaultView||window).event;const o=Hi(e,"keyup",(e=>{e!==n?i(e):n=void 0}));return()=>{o()}}),[t,r,i])},el=(0,e.createContext)(Bi?window:void 0);function tl(){return(0,e.useContext)(el)}el.Provider;const nl=(e,t)=>Bi?null==e?(t||Gi()).body:("function"==typeof e&&(e=e()),e&&"current"in e&&(e=e.current),e&&("nodeType"in e||e.getBoundingClientRect)?e:null):null;function rl(t,n){const r=tl(),[o,a]=(0,e.useState)((()=>nl(t,null==r?void 0:r.document)));if(!o){const e=nl(t);e&&a(e)}return(0,e.useEffect)((()=>{n&&o&&n(o)}),[n,o]),(0,e.useEffect)((()=>{const e=nl(t);e!==o&&a(e)}),[t,o]),o}function ol(e={}){return Array.isArray(e)?e:Object.keys(e).map((t=>(e[t].name=t,e[t])))}const al=void 0!==n.g&&n.g.navigator&&"ReactNative"===n.g.navigator.product,il="undefined"!=typeof document||al?e.useLayoutEffect:e.useEffect,ll=function({children:t,in:n,onExited:r,mountOnEnter:o,unmountOnExit:a}){const i=(0,e.useRef)(null),l=(0,e.useRef)(n),s=qi(r);(0,e.useEffect)((()=>{n?l.current=!0:s(i.current)}),[n,s]);const c=ua(i,t.ref),u=(0,e.cloneElement)(t,{ref:c});return n?u:a||!l.current&&o?null:u};var sl=n(893);function cl({children:t,in:n,onExited:r,onEntered:o,transition:a}){const[i,l]=(0,e.useState)(!n);n&&i&&l(!1);const s=function({in:t,onTransition:n}){const r=(0,e.useRef)(null),o=(0,e.useRef)(!0),a=qi(n);return il((()=>{if(!r.current)return;let e=!1;return a({in:t,element:r.current,initial:o.current,isStale:()=>e}),()=>{e=!0}}),[t,a]),il((()=>(o.current=!1,()=>{o.current=!0})),[]),r}({in:!!n,onTransition:e=>{Promise.resolve(a(e)).then((()=>{e.isStale()||(e.in?null==o||o(e.element,e.initial):(l(!0),null==r||r(e.element)))}),(t=>{throw e.in||l(!0),t}))}}),c=ua(s,t.ref);return i&&!n?null:(0,e.cloneElement)(t,{ref:c})}function ul(e,t,n){return e?(0,sl.jsx)(e,Object.assign({},n)):t?(0,sl.jsx)(cl,Object.assign({},n,{transition:t})):(0,sl.jsx)(ll,Object.assign({},n))}const dl=e.forwardRef(((t,n)=>{const{flip:o,offset:a,placement:i,containerPadding:l,popperConfig:s={},transition:c,runTransition:u}=t,[d,f]=pa(),[p,m]=pa(),g=ua(f,n),h=rl(t.container),y=rl(t.target),[b,v]=(0,e.useState)(!t.show),w=Mi(y,d,function({enabled:e,enableEvents:t,placement:n,flip:r,offset:o,fixed:a,containerPadding:i,arrowElement:l,popperConfig:s={}}){var c,u,d,f,p;const m=function(e){const t={};return Array.isArray(e)?(null==e||e.forEach((e=>{t[e.name]=e})),t):e||t}(s.modifiers);return Object.assign({},s,{placement:n,enabled:e,strategy:a?"fixed":s.strategy,modifiers:ol(Object.assign({},m,{eventListeners:{enabled:t,options:null==(c=m.eventListeners)?void 0:c.options},preventOverflow:Object.assign({},m.preventOverflow,{options:i?Object.assign({padding:i},null==(u=m.preventOverflow)?void 0:u.options):null==(d=m.preventOverflow)?void 0:d.options}),offset:{options:Object.assign({offset:o},null==(f=m.offset)?void 0:f.options)},arrow:Object.assign({},m.arrow,{enabled:!!l,options:Object.assign({},null==(p=m.arrow)?void 0:p.options,{element:l})}),flip:Object.assign({enabled:!!r},m.flip)}))})}({placement:i,enableEvents:!!t.show,containerPadding:l||5,flip:o,offset:a,arrowElement:p,popperConfig:s}));t.show&&b&&v(!1);const E=t.show||!b;if(Zi(d,t.onHide,{disabled:!t.rootClose||t.rootCloseDisabled,clickTrigger:t.rootCloseEvent}),!E)return null;const{onExit:x,onExiting:S,onEnter:O,onEntering:k,onEntered:C}=t;let P=t.children(Object.assign({},w.attributes.popper,{style:w.styles.popper,ref:g}),{popper:w,placement:i,show:!!t.show,arrowProps:Object.assign({},w.attributes.arrow,{style:w.styles.arrow,ref:m})});return P=ul(c,u,{in:!!t.show,appear:!0,mountOnEnter:!0,unmountOnExit:!0,children:P,onExit:x,onExiting:S,onExited:(...e)=>{v(!0),t.onExited&&t.onExited(...e)},onEnter:O,onEntering:k,onEntered:C}),h?r.createPortal(P,h):null}));dl.displayName="Overlay";const fl=dl;function pl(e,t){return e.classList?!!t&&e.classList.contains(t):-1!==(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")}const ml=e.createContext({prefixes:{},breakpoints:["xxl","xl","lg","md","sm","xs"],minBreakpoint:"xs"}),{Consumer:gl,Provider:hl}=ml;function yl(t,n){const{prefixes:r}=(0,e.useContext)(ml);return t||r[n]||n}function bl(){const{dir:t}=(0,e.useContext)(ml);return"rtl"===t}const vl=e.forwardRef((({className:e,bsPrefix:t,as:n="div",...r},o)=>(t=yl(t,"popover-header"),(0,sl.jsx)(n,{ref:o,className:fa()(e,t),...r}))));vl.displayName="PopoverHeader";const wl=vl,El=e.forwardRef((({className:e,bsPrefix:t,as:n="div",...r},o)=>(t=yl(t,"popover-body"),(0,sl.jsx)(n,{ref:o,className:fa()(e,t),...r}))));El.displayName="PopoverBody";const xl=El;function Sl(e,t){let n=e;return"left"===e?n=t?"end":"start":"right"===e&&(n=t?"start":"end"),n}function Ol(e="absolute"){return{position:e,top:"0",left:"0",opacity:"0",pointerEvents:"none"}}e.Component;const kl=e.forwardRef((({bsPrefix:e,placement:t="right",className:n,style:r,children:o,body:a,arrowProps:i,hasDoneInitialMeasure:l,popper:s,show:c,...u},d)=>{const f=yl(e,"popover"),p=bl(),[m]=(null==t?void 0:t.split("-"))||[],g=Sl(m,p);let h=r;return c&&!l&&(h={...r,...Ol(null==s?void 0:s.strategy)}),(0,sl.jsxs)("div",{ref:d,role:"tooltip",style:h,"x-placement":m,className:fa()(n,f,m&&`bs-popover-${g}`),...u,children:[(0,sl.jsx)("div",{className:"popover-arrow",...i}),a?(0,sl.jsx)(xl,{children:o}):o]})})),Cl=Object.assign(kl,{Header:wl,Body:xl,POPPER_OFFSET:[0,8]}),Pl=e.forwardRef((({bsPrefix:e,placement:t="right",className:n,style:r,children:o,arrowProps:a,hasDoneInitialMeasure:i,popper:l,show:s,...c},u)=>{e=yl(e,"tooltip");const d=bl(),[f]=(null==t?void 0:t.split("-"))||[],p=Sl(f,d);let m=r;return s&&!i&&(m={...r,...Ol(null==l?void 0:l.strategy)}),(0,sl.jsxs)("div",{ref:u,style:m,role:"tooltip","x-placement":f,className:fa()(n,e,`bs-tooltip-${p}`),...c,children:[(0,sl.jsx)("div",{className:"tooltip-arrow",...a}),(0,sl.jsx)("div",{className:`${e}-inner`,children:o})]})}));Pl.displayName="Tooltip";const Dl=Object.assign(Pl,{TOOLTIP_OFFSET:[0,6]});function _l(e,t){return _l=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},_l(e,t)}const Nl=e.createContext(null);var Il="unmounted",Rl="exited",Tl="entering",Al="entered",jl="exiting",Ll=function(t){var n,o;function a(e,n){var r;r=t.call(this,e,n)||this;var o,a=n&&!n.isMounting?e.enter:e.appear;return r.appearStatus=null,e.in?a?(o=Rl,r.appearStatus=Tl):o=Al:o=e.unmountOnExit||e.mountOnEnter?Il:Rl,r.state={status:o},r.nextCallback=null,r}o=t,(n=a).prototype=Object.create(o.prototype),n.prototype.constructor=n,_l(n,o),a.getDerivedStateFromProps=function(e,t){return e.in&&t.status===Il?{status:Rl}:null};var i=a.prototype;return i.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},i.componentDidUpdate=function(e){var t=null;if(e!==this.props){var n=this.state.status;this.props.in?n!==Tl&&n!==Al&&(t=Tl):n!==Tl&&n!==Al||(t=jl)}this.updateStatus(!1,t)},i.componentWillUnmount=function(){this.cancelNextCallback()},i.getTimeouts=function(){var e,t,n,r=this.props.timeout;return e=t=n=r,null!=r&&"number"!=typeof r&&(e=r.exit,t=r.enter,n=void 0!==r.appear?r.appear:t),{exit:e,enter:t,appear:n}},i.updateStatus=function(e,t){if(void 0===e&&(e=!1),null!==t)if(this.cancelNextCallback(),t===Tl){if(this.props.unmountOnExit||this.props.mountOnEnter){var n=this.props.nodeRef?this.props.nodeRef.current:r.findDOMNode(this);n&&function(e){e.scrollTop}(n)}this.performEnter(e)}else this.performExit();else this.props.unmountOnExit&&this.state.status===Rl&&this.setState({status:Il})},i.performEnter=function(e){var t=this,n=this.props.enter,o=this.context?this.context.isMounting:e,a=this.props.nodeRef?[o]:[r.findDOMNode(this),o],i=a[0],l=a[1],s=this.getTimeouts(),c=o?s.appear:s.enter;e||n?(this.props.onEnter(i,l),this.safeSetState({status:Tl},(function(){t.props.onEntering(i,l),t.onTransitionEnd(c,(function(){t.safeSetState({status:Al},(function(){t.props.onEntered(i,l)}))}))}))):this.safeSetState({status:Al},(function(){t.props.onEntered(i)}))},i.performExit=function(){var e=this,t=this.props.exit,n=this.getTimeouts(),o=this.props.nodeRef?void 0:r.findDOMNode(this);t?(this.props.onExit(o),this.safeSetState({status:jl},(function(){e.props.onExiting(o),e.onTransitionEnd(n.exit,(function(){e.safeSetState({status:Rl},(function(){e.props.onExited(o)}))}))}))):this.safeSetState({status:Rl},(function(){e.props.onExited(o)}))},i.cancelNextCallback=function(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},i.safeSetState=function(e,t){t=this.setNextCallback(t),this.setState(e,t)},i.setNextCallback=function(e){var t=this,n=!0;return this.nextCallback=function(r){n&&(n=!1,t.nextCallback=null,e(r))},this.nextCallback.cancel=function(){n=!1},this.nextCallback},i.onTransitionEnd=function(e,t){this.setNextCallback(t);var n=this.props.nodeRef?this.props.nodeRef.current:r.findDOMNode(this),o=null==e&&!this.props.addEndListener;if(n&&!o){if(this.props.addEndListener){var a=this.props.nodeRef?[this.nextCallback]:[n,this.nextCallback],i=a[0],l=a[1];this.props.addEndListener(i,l)}null!=e&&setTimeout(this.nextCallback,e)}else setTimeout(this.nextCallback,0)},i.render=function(){var t=this.state.status;if(t===Il)return null;var n=this.props,r=n.children,o=(n.in,n.mountOnEnter,n.unmountOnExit,n.appear,n.enter,n.exit,n.timeout,n.addEndListener,n.onEnter,n.onEntering,n.onEntered,n.onExit,n.onExiting,n.onExited,n.nodeRef,C(n,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]));return e.createElement(Nl.Provider,{value:null},"function"==typeof r?r(t,o):e.cloneElement(e.Children.only(r),o))},a}(e.Component);function Ml(){}Ll.contextType=Nl,Ll.propTypes={},Ll.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Ml,onEntering:Ml,onEntered:Ml,onExit:Ml,onExiting:Ml,onExited:Ml},Ll.UNMOUNTED=Il,Ll.EXITED=Rl,Ll.ENTERING=Tl,Ll.ENTERED=Al,Ll.EXITING=jl;const Bl=Ll;var Fl=/([A-Z])/g,zl=/^ms-/;function Ul(e){return function(e){return e.replace(Fl,"-$1").toLowerCase()}(e).replace(zl,"-ms-")}var $l=/^((translate|rotate|scale)(X|Y|Z|3d)?|matrix(3d)?|perspective|skew(X|Y)?)$/i;const Wl=function(e,t){var n="",r="";if("string"==typeof t)return e.style.getPropertyValue(Ul(t))||function(e,t){return function(e){var t=Gi(e);return t&&t.defaultView||window}(e).getComputedStyle(e,t)}(e).getPropertyValue(Ul(t));Object.keys(t).forEach((function(o){var a=t[o];a||0===a?function(e){return!(!e||!$l.test(e))}(o)?r+=o+"("+a+") ":n+=Ul(o)+": "+a+";":e.style.removeProperty(Ul(o))})),r&&(n+="transform: "+r+";"),e.style.cssText+=";"+n};function Hl(e,t,n,r){var o,a;null==n&&(a=-1===(o=Wl(e,"transitionDuration")||"").indexOf("ms")?1e3:1,n=parseFloat(o)*a||0);var i=function(e,t,n){void 0===n&&(n=5);var r=!1,o=setTimeout((function(){r||function(e,t,n,r){if(void 0===n&&(n=!1),void 0===r&&(r=!0),e){var o=document.createEvent("HTMLEvents");o.initEvent("transitionend",n,r),e.dispatchEvent(o)}}(e,0,!0)}),t+n),a=Hi(e,"transitionend",(function(){r=!0}),{once:!0});return function(){clearTimeout(o),a()}}(e,n,r),l=Hi(e,"transitionend",t);return function(){i(),l()}}function Gl(e,t){const n=Wl(e,t)||"",r=-1===n.indexOf("ms")?1e3:1;return parseFloat(n)*r}function Vl(e,t){const n=Gl(e,"transitionDuration"),r=Gl(e,"transitionDelay"),o=Hl(e,(n=>{n.target===e&&(o(),t(n))}),n+r)}function ql(e){e.offsetHeight}function Kl(e){return e&&"setState"in e?r.findDOMNode(e):null!=e?e:null}const Ql=e.forwardRef((({onEnter:t,onEntering:n,onEntered:r,onExit:o,onExiting:a,onExited:i,addEndListener:l,children:s,childRef:c,...u},d)=>{const f=(0,e.useRef)(null),p=ua(f,c),m=e=>{p(Kl(e))},g=e=>t=>{e&&f.current&&e(f.current,t)},h=(0,e.useCallback)(g(t),[t]),y=(0,e.useCallback)(g(n),[n]),b=(0,e.useCallback)(g(r),[r]),v=(0,e.useCallback)(g(o),[o]),w=(0,e.useCallback)(g(a),[a]),E=(0,e.useCallback)(g(i),[i]),x=(0,e.useCallback)(g(l),[l]);return(0,sl.jsx)(Bl,{ref:d,...u,onEnter:h,onEntered:b,onEntering:y,onExit:v,onExited:E,onExiting:w,addEndListener:x,nodeRef:f,children:"function"==typeof s?(e,t)=>s(e,{...t,ref:m}):e.cloneElement(s,{ref:m})})})),Yl={[Tl]:"show",[Al]:"show"},Xl=e.forwardRef((({className:t,children:n,transitionClasses:r={},onEnter:o,...a},i)=>{const l={in:!1,timeout:300,mountOnEnter:!1,unmountOnExit:!1,appear:!1,...a},s=(0,e.useCallback)(((e,t)=>{ql(e),null==o||o(e,t)}),[o]);return(0,sl.jsx)(Ql,{ref:i,addEndListener:Vl,...l,onEnter:s,childRef:n.ref,children:(o,a)=>e.cloneElement(n,{...a,className:fa()("fade",t,n.props.className,Yl[o],r[o])})})}));Xl.displayName="Fade";const Jl=Xl,Zl=e.forwardRef((({children:t,transition:n=Jl,popperConfig:r={},rootClose:o=!1,placement:a="top",show:i=!1,...l},s)=>{const c=(0,e.useRef)({}),[u,d]=(0,e.useState)(null),[f,p]=function(t){const n=(0,e.useRef)(null),r=yl(void 0,"popover"),o=yl(void 0,"tooltip"),a=(0,e.useMemo)((()=>({name:"offset",options:{offset:()=>{if(t)return t;if(n.current){if(pl(n.current,r))return Cl.POPPER_OFFSET;if(pl(n.current,o))return Dl.TOOLTIP_OFFSET}return[0,0]}}})),[t,r,o]);return[n,[a]]}(l.offset),m=ua(s,f),g=!0===n?Jl:n||void 0,h=qi((e=>{d(e),null==r||null==r.onFirstUpdate||r.onFirstUpdate(e)}));return il((()=>{u&&l.target&&(null==c.current.scheduleUpdate||c.current.scheduleUpdate())}),[u,l.target]),(0,e.useEffect)((()=>{i||d(null)}),[i]),(0,sl.jsx)(fl,{...l,ref:m,popperConfig:{...r,modifiers:p.concat(r.modifiers||[]),onFirstUpdate:h},transition:g,rootClose:o,placement:a,show:i,children:(o,{arrowProps:a,popper:i,show:l})=>{var s,d;!function(e,t){const{ref:n}=e,{ref:r}=t;e.ref=n.__wrapped||(n.__wrapped=e=>n(Kl(e))),t.ref=r.__wrapped||(r.__wrapped=e=>r(Kl(e)))}(o,a);const f=null==i?void 0:i.placement,p=Object.assign(c.current,{state:null==i?void 0:i.state,scheduleUpdate:null==i?void 0:i.update,placement:f,outOfBoundaries:(null==i||null==(s=i.state)||null==(d=s.modifiersData.hide)?void 0:d.isReferenceHidden)||!1,strategy:r.strategy}),m=!!u;return"function"==typeof t?t({...o,placement:f,show:l,...!n&&l&&{className:"show"},popper:p,arrowProps:a,hasDoneInitialMeasure:m}):e.cloneElement(t,{...o,placement:f,arrowProps:a,popper:p,hasDoneInitialMeasure:m,className:fa()(t.props.className,!n&&l&&"show"),style:{...t.props.style,...o.style}})}})}));Zl.displayName="Overlay";const es=Zl;function ts(e,t,n){const[r]=t,o=r.currentTarget,a=r.relatedTarget||r.nativeEvent[n];a&&a===o||Yo(o,a)||e(...t)}Jo().oneOf(["click","hover","focus"]);const ns=({trigger:t=["hover","focus"],overlay:n,children:r,popperConfig:o={},show:a,defaultShow:i=!1,onToggle:l,delay:s,placement:c,flip:u=c&&-1!==c.indexOf("auto"),...d})=>{const f=(0,e.useRef)(null),p=ua(f,r.ref),m=ra(),g=(0,e.useRef)(""),[h,y]=sa(a,i,l),b=function(e){return e&&"object"==typeof e?e:{show:e,hide:e}}(s),{onFocus:v,onBlur:w,onClick:E}="function"!=typeof r?e.Children.only(r).props:{},x=(0,e.useCallback)((()=>{m.clear(),g.current="show",b.show?m.set((()=>{"show"===g.current&&y(!0)}),b.show):y(!0)}),[b.show,y,m]),S=(0,e.useCallback)((()=>{m.clear(),g.current="hide",b.hide?m.set((()=>{"hide"===g.current&&y(!1)}),b.hide):y(!1)}),[b.hide,y,m]),O=(0,e.useCallback)(((...e)=>{x(),null==v||v(...e)}),[x,v]),k=(0,e.useCallback)(((...e)=>{S(),null==w||w(...e)}),[S,w]),C=(0,e.useCallback)(((...e)=>{y(!h),null==E||E(...e)}),[E,y,h]),P=(0,e.useCallback)(((...e)=>{ts(x,e,"fromElement")}),[x]),D=(0,e.useCallback)(((...e)=>{ts(S,e,"toElement")}),[S]),_=null==t?[]:[].concat(t),N={ref:e=>{p(Kl(e))}};return-1!==_.indexOf("click")&&(N.onClick=C),-1!==_.indexOf("focus")&&(N.onFocus=O,N.onBlur=k),-1!==_.indexOf("hover")&&(N.onMouseOver=P,N.onMouseOut=D),(0,sl.jsxs)(sl.Fragment,{children:["function"==typeof r?r(N):(0,e.cloneElement)(r,N),(0,sl.jsx)(es,{...d,show:h,onHide:S,flip:u,placement:c,popperConfig:o,target:f.current,children:n})]})};function rs(t){var n=t.id,r=t.tip;return e.createElement(ns,{placement:"auto",trigger:["click","hover","focus"],style:{display:"inline"},overlay:e.createElement(Dl,{id:n},r),rootClose:!0},e.createElement("img",{src:"/images/shop/icon-reminder.svg",className:"options-icon"}))}function os(e){return os="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},os(e)}function as(e,t){for(var n=0;n0,has_dds:e.filter((function(e,t){return!("DDS"!==e.name||"4410"!==e.name_number||e.options_data&&e.options_data.mono_eem)})).length>0,has_sampler:e.filter((function(e,t){return!("Sampler"!==e.name||e.options_data&&e.options_data.mono_eem)})).length>0}}function Ms(e,t){var n=js(e),r={};return"array"===n?e.map((function(e,n){Object.assign(r,Ms(e,t))})):"object"===n&&("string"!==js(e.type)||"object"!==js(e.args)&&"array"!==js(e.items)?Object.assign(r,Ms((0,Qo.apply)(e,t),t)):e.type in As?r[e.args.outvar]=t[e.args.outvar]:"Group"===e.type&&Object.assign(r,Ms((0,Qo.apply)(e.items,t),t))),r}const Bs={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let Fs;const zs=new Uint8Array(16);function Us(){if(!Fs&&(Fs="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Fs))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Fs(zs)}const $s=[];for(let e=0;e<256;++e)$s.push((e+256).toString(16).slice(1));const Ws=function(e,t,n){if(Bs.randomUUID&&!t&&!e)return Bs.randomUUID();const r=(e=e||{}).random||(e.rng||Us)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(let e=0;e<16;++e)t[n+e]=r[e];return t}return function(e,t=0){return $s[e[t+0]]+$s[e[t+1]]+$s[e[t+2]]+$s[e[t+3]]+"-"+$s[e[t+4]]+$s[e[t+5]]+"-"+$s[e[t+6]]+$s[e[t+7]]+"-"+$s[e[t+8]]+$s[e[t+9]]+"-"+$s[e[t+10]]+$s[e[t+11]]+$s[e[t+12]]+$s[e[t+13]]+$s[e[t+14]]+$s[e[t+15]]}(r)};var Hs={eem:function(e){return e.options_data&&!1!==e.options_data.ext_pwr&&!1!==e.options_data.mono_eem?!0===e.options_data.ext_pwr?0:!0===e.options_data.mono_eem||"1 EEM"===e.options_data.n_eem?1:"3 EEM"===e.options_data.n_eem?3:e.consumes&&e.consumes.eem||0:e.consumes&&e.consumes.eem||0},clk:function(e){return e.options_data&&(!0===e.options_data.ext_clk||e.options_data.ext_clk&&!0===e.options_data.ext_clk.checked)?0:e.consumes&&e.consumes.clk||0},idc:function(e){return e.consumes&&e.consumes.idc||0},hp:function(e){return e.consumes&&e.consumes.hp||0}};function Gs(e){return function(t,n){for(var r=0,o=n+1;oe.length)&&(t=e.length);for(var n=0,r=new Array(t);no.max}},nc=function(e){return function(t,n,r){return Hs[e](t[n])>0&&!function(e,t,n){return e.slice(0,t).find((function(e){return e.resources&&ec(e.resources,n)}))}(t,n,e)}},rc={eem_resource:{level:"warning",trigger:tc("eem"),message:"Insufficient EEM connectors"},no_eem_source:{level:"warning",trigger:nc("eem"),message:"This card needs a card that provides a EEM connector (e.g. Kasli) at its left."},idc_resource:{level:"warning",trigger:tc("idc"),message:"Insufficient IDC connectors."},no_idc_source:{level:"warning",trigger:nc("idc"),message:"Should be after a Zotino or a HD68-IDC or with another IDC-BNC."},clk_resource:{level:"warning",trigger:tc("clk"),message:"Insufficient clock connectors."},no_clk_source:{level:"warning",trigger:nc("clk"),message:"This card needs either a card that provides a clock source (e.g. Kasli or Clocker) at its left or use an external clock source."},eem_wiring_constraint:{level:"reminder",trigger:("eem",function(e,t,n){var r=function(e,t,n){return e.slice(t+1).findIndex((function(e){return e.resources&&ec(e.resources,n)}))+t+1}(e,t,"eem");return r-t==1}),message:"Due to wiring constraints, the carrier can only connect to EEM cards immediately at its right, without crossing another carrier."},default:{level:"warning",trigger:function(e,t,n){return!0},message:"This item has unimplemented warning"}};function oc(e){var t,n={priority:0,icon:null},r=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=Qs(e))){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return i=e.done,e},e:function(e){l=!0,a=e},f:function(){try{i||null==n.return||n.return()}finally{if(l)throw a}}}}(e);try{for(r.s();!(t=r.n()).done;){var o=t.value;Zs[o.level].priority>n.priority&&(n=Zs[o.level])}}catch(e){r.e(e)}finally{r.f()}return n}function ac(e){var t=Zs[e];return{icon:t.icon,color:t.color}}var ic={overfit:{message:"You have reached the maximum number of slots allowed for this crate. Consider removing cards.",level:"warning",trigger:function(e,t){var n=Nc.getState().crateParams(e.crate_mode).hp;return t>n&&n>0}},underfit_rack:{message:"The selected cards fit in a 42hp desktop crate, consider switching to it for a more compact system",level:"reminder",trigger:function(e,t){var n=Nc.getState().crate_modes.desktop.hp;return e.crate_mode===Nc.getState().crate_modes.rack.id&&t=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return i=e.done,e},e:function(e){l=!0,a=e},f:function(){try{i||null==n.return||n.return()}finally{if(l)throw a}}}}function fc(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&e.createElement("ul",null,i.specs.map((function(t,n){return e.createElement("li",{key:n},t)}))),s=i.datasheet_file&&i.datasheet_name&&e.createElement("div",{className:"ds"},e.createElement("span",{className:"doc-icon"}),e.createElement("a",{href:i.datasheet_file,target:"_blank",rel:"noopener noreferrer"},i.datasheet_name));return e.createElement("section",{className:"productItem"},e.createElement("div",{className:"content"},e.createElement("h3",{style:{marginBottom:i.name_codename?"5px":"20px"}},i.name),i.name_codename?e.createElement("p",null,i.name_codename):null,e.createElement("div",{className:"price"},"".concat(o," ").concat(Ho(i.price))),l,s),e.createElement("div",{className:"content"},e.createElement("button",{onClick:function(){return a(null,n,null)}},e.createElement("img",{src:"/images/shop/icon-add.svg",alt:"add"})),e.createElement(co,{draggableId:i.id,index:n},(function(t,n){return e.createElement(e.Fragment,null,e.createElement("img",Rc({ref:t.innerRef},t.draggableProps,t.dragHandleProps,{style:$o(t.draggableProps.style,n,!0),src:i.image})),n.isDragging&&e.createElement("img",{className:"simclone",src:i.image}))}))))}function Ac(){return Ac=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(t,Fc);return e.createElement("div",zc({className:"k-popup-warning",style:$c($c({},n),{},{backgroundColor:a.color})},i),o.map((function(t,n){return e.createElement("p",{className:"rule warning",key:"warnmsg_".concat(r,"_").concat(t.name)},e.createElement("i",null,t.message))})))},rootClose:!0},e.createElement("img",{className:"alert-warning p-0",src:a.icon}))}function Hc(t){var n=t.crate_index,r=t.card_index,o=oc(Nc((function(e){return e.crates[n].items[r].show_warnings}),qo));return o.priority===Zs.warning.priority?e.createElement("img",{className:"alert-warning align-self-start d-block",src:o.icon}):e.createElement("span",{className:"alert-warning align-self-start d-block"})}function Gc(t){var n=e.useRef(null),r=e.useRef(t);return e.useLayoutEffect((function(){r.current=t})),e.useEffect((function(){var e=function(e){var t=n.current;t&&!t.contains(e.target)&&r.current(e)};return document.addEventListener("mousedown",e),document.addEventListener("touchstart",e),function(){document.removeEventListener("mousedown",e),document.removeEventListener("touchstart",e)}}),[]),n}function Vc(t){var n=t.options,r=t.data,o=t.target,a=t.id,i=js(n);return"array"===i?Array.from(n.map((function(e,t){return Vc({options:e,data:r,target:o,id:a+t})}))):"object"===i?"string"!==js(n.type)||"object"!==js(n.args)&&"array"!==js(n.items)?Vc({options:(0,Qo.apply)(n,r),data:r,target:o,id:a}):n.type in As?As[n.type](o,a+n.type,r,n.args):"Group"===n.type?e.createElement("div",{className:"border rounded",key:a+"group"},Vc({options:(0,Qo.apply)(n.items,r),data:r,target:o,id:a})):As.Default(n.type,a+"missing"):void 0}function qc(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);nwindow.innerWidth?u({x:r-f.w-20,y:o-f.h/2}):u({x:r-f.w/2,y:o-f.h-20})}else document.removeEventListener("scroll",b,!0)},b=function(e){e.target!==document.getElementById(n)&&g()};return(0,e.useEffect)((function(){if(i){var e=document.getElementById(n),t=e.offsetWidth,r=e.offsetHeight;p({w:t,h:r}),y()}}),[i]),(0,e.useEffect)((function(){i&&y()}),[i,f]),e.createElement("div",{ref:h},e.createElement("img",{className:"alert-info d-block",src:i?"/images/shop/icon-close.svg":"/images/shop/icon-customize.svg",id:n+"img",onClick:function(e){l(!i),i||document.addEventListener("scroll",b,!0)}}),e.createElement("div",{style:{display:i?"flex":"none",top:c.y,left:c.x},className:"overlayVariant card border rounded",id:n},e.createElement("div",{className:"card-body"},Array.from(Object.entries(m).filter((function(e,t){var n=Xc(e,2),r=n[0];return n[1],"ext_data"!==r})).map((function(t,r){var o=Xc(t,2),a=o[0],i=o[1];return e.createElement("p",{className:"card-text",key:n+a},e.createElement("i",null,a),": ",function(e){var t=js(e);if("string"===t)return e;if("object"===t){if(!1===e.checked)return"off";if(!0===e.checked&&e.text)return e.text}return JSON.stringify(e)}(i))}))))))}function eu(e){return eu="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},eu(e)}function tu(t){var n=t.crate_index,r=t.card_index,o=t.first,a=t.last,i=Nc((function(e){return e.crates[n].id})),l=Nc((function(e){return e.crates[n].items[r].options})),s=Nc((function(e){return e.crates[n].items[r].options_data})),c=Nc((function(e){return e.crates[n].items[r].size})),u=Nc((function(e){return e.crates[n].items[r].id})),d=Nc((function(e){return e.crates[n].items[r].options_class})),f=Nc((function(e){return e.sideMenuIsOpen})),p=Nc((function(e){return e.updateOptions}));return e.createElement(Yc,{options:l,data:s,options_class:d,key:"popover"+i+u,id:"popover"+i+u,big:"big"===c,first:o,last:a,sideMenuIsOpen:f,target:{construct:function(e,t){s[e]=t},update:function(e,t){e in s&&(s[e]=t),p(i,r,function(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==eu(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==eu(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===eu(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}({},e,t))}}})}function nu(t){var n=t.crate_index,r=t.card_index,o=Nc((function(e){return e.crates[n].items[r].id})),a=Nc((function(e){return e.crates[n].items[r].options})),i=Nc((function(e){return e.crates[n].items[r].options_data}));return e.createElement(Zc,{id:o+"options",options:a,data:i})}function ru(t){var n=t.crate_index,r=t.card_index,o=Nc((function(e){return e.currency})),a=Nc((function(e){return e.deleteCard})),i=Nc((function(e){return e.highlightCard})),l=Nc((function(e){return e.highlightReset})),s=Nc((function(e){return e.crates[n].id===e.highlighted.crate&&r===e.highlighted.card})),c=Nc((function(e){return e.crates[n].id})),u=Nc((function(e){return e.crates[n].items[r]}),(function(e,t){return e.id===t.id})),d=Nc((function(e){return e.crates[n].items[r].show_warnings}),Ko),f=Nc((function(e){return e.crates[n].items[r].options_data}),Ko),p=Nc((function(e){return!!e.crateParams(e.crates[n].crate_mode).warnings_disabled})),m=!p&&u&&u.options&&u.options.length>0,g=!p&&f&&Object.keys(f).length>0,h=!p&&d&&d.length>0;return e.createElement("tr",{key:"summary_crate_"+c+"_"+r,className:"hoverable ".concat(s?"selected":""),onClick:function(){return i(c,r)},onMouseEnter:function(){return i(c,r)},onMouseLeave:function(){return l()}},e.createElement("td",{className:"item-card-name"},e.createElement("span",{style:{display:"inline-block",width:"16px"}}," "),e.createElement("div",null,"".concat(u.name_number," ").concat(u.name," ").concat(u.name_codename))),e.createElement("td",{className:"price"},e.createElement("div",{className:"d-inline-flex align-content-center"},"".concat(o," ").concat(Ho(u.price)),e.createElement("button",{onClick:function(){return a(c,r)}},e.createElement("img",{src:"/images/shop/icon-remove.svg",className:"d-block"})),e.createElement("div",{style:{width:"45px",height:"20px"},className:"d-inline-flex align-content-center align-self-center justify-content-evenly"},h?e.createElement(Hc,{crate_index:n,card_index:r}):e.createElement("span",{style:{display:"inline-block",minWidth:"20px"}}," "),m&&g?e.createElement(nu,{crate_index:n,card_index:r}):e.createElement("span",{style:{display:"inline-block",width:"20px"}}," ")))))}function ou(t){var n=t.crate_index,r=Nc((function(e){return e.crates[n].id})),o=Nc((function(e){return e.crates[n].items.length}));return e.createElement("tbody",{key:"summary_crate_body"+r},e.createElement(Lc,{crate_index:n}),Go(0,o).map((function(t,o){return e.createElement(ru,{crate_index:n,card_index:t,key:"summary_crate_"+r+"_"+t})})))}function au(){var t=Nc((function(e){return e.crates.length}));return e.createElement(e.Fragment,null,Go(0,t).map((function(t,n){return e.createElement(ou,{crate_index:t,key:"summary_crate_body_"+t})})))}function iu(){var t=Nc((function(e){return e.currency})),n=Nc((function(e){return e.totalOrderPrice()}));return e.createElement("div",null,t," ",Ho(n),e.createElement("button",{style:{opacity:"0",cursor:"initial"}},e.createElement("img",{src:"/images/shop/icon-remove.svg",alt:"icon remove"})))}function lu(){return e.createElement("div",{className:"summary-price"},e.createElement("table",null,e.createElement(au,null),e.createElement("tfoot",null,e.createElement("tr",null,e.createElement("td",{className:"item-card-name"},"Price estimate"),e.createElement("td",{className:"price"},e.createElement(iu,null),e.createElement("span",{style:{display:"inline-block",width:"30px"}}," "))))))}function su(e){if((!Bc&&0!==Bc||e)&&Bi){var t=document.createElement("div");t.style.position="absolute",t.style.top="-9999px",t.style.width="50px",t.style.height="50px",t.style.overflow="scroll",document.body.appendChild(t),Bc=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return Bc}function cu(e){void 0===e&&(e=Gi());try{var t=e.activeElement;return t&&t.nodeName?t:null}catch(t){return e.body}}const uu="data-rr-ui-modal-open",du=class{constructor({ownerDocument:e,handleContainerOverflow:t=!0,isRTL:n=!1}={}){this.handleContainerOverflow=t,this.isRTL=n,this.modals=[],this.ownerDocument=e}getScrollbarWidth(){return function(e=document){const t=e.defaultView;return Math.abs(t.innerWidth-e.documentElement.clientWidth)}(this.ownerDocument)}getElement(){return(this.ownerDocument||document).body}setModalAttributes(e){}removeModalAttributes(e){}setContainerStyle(e){const t={overflow:"hidden"},n=this.isRTL?"paddingLeft":"paddingRight",r=this.getElement();e.style={overflow:r.style.overflow,[n]:r.style[n]},e.scrollBarWidth&&(t[n]=`${parseInt(Wl(r,n)||"0",10)+e.scrollBarWidth}px`),r.setAttribute(uu,""),Wl(r,t)}reset(){[...this.modals].forEach((e=>this.remove(e)))}removeContainerStyle(e){const t=this.getElement();t.removeAttribute(uu),Object.assign(t.style,e.style)}add(e){let t=this.modals.indexOf(e);return-1!==t||(t=this.modals.length,this.modals.push(e),this.setModalAttributes(e),0!==t||(this.state={scrollBarWidth:this.getScrollbarWidth(),style:{}},this.handleContainerOverflow&&this.setContainerStyle(this.state))),t}remove(e){const t=this.modals.indexOf(e);-1!==t&&(this.modals.splice(t,1),!this.modals.length&&this.handleContainerOverflow&&this.removeContainerStyle(this.state),this.removeModalAttributes(e))}isTopModal(e){return!!this.modals.length&&this.modals[this.modals.length-1]===e}},fu=["show","role","className","style","children","backdrop","keyboard","onBackdropClick","onEscapeKeyDown","transition","runTransition","backdropTransition","runBackdropTransition","autoFocus","enforceFocus","restoreFocus","restoreFocusOptions","renderDialog","renderBackdrop","manager","container","onShow","onHide","onExit","onExited","onExiting","onEnter","onEntering","onEntered"];let pu;const mu=(0,e.forwardRef)(((t,n)=>{let{show:o=!1,role:a="dialog",className:i,style:l,children:s,backdrop:c=!0,keyboard:u=!0,onBackdropClick:d,onEscapeKeyDown:f,transition:p,runTransition:m,backdropTransition:g,runBackdropTransition:h,autoFocus:y=!0,enforceFocus:b=!0,restoreFocus:v=!0,restoreFocusOptions:w,renderDialog:E,renderBackdrop:x=(e=>(0,sl.jsx)("div",Object.assign({},e))),manager:S,container:O,onShow:k,onHide:C=(()=>{}),onExit:P,onExited:D,onExiting:_,onEnter:N,onEntering:I,onEntered:R}=t,T=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r=0||(o[n]=e[n]);return o}(t,fu);const A=tl(),j=rl(O),L=function(t){const n=tl(),r=t||function(e){return pu||(pu=new du({ownerDocument:null==e?void 0:e.document})),pu}(n),o=(0,e.useRef)({dialog:null,backdrop:null});return Object.assign(o.current,{add:()=>r.add(o.current),remove:()=>r.remove(o.current),isTopModal:()=>r.isTopModal(o.current),setDialogRef:(0,e.useCallback)((e=>{o.current.dialog=e}),[]),setBackdropRef:(0,e.useCallback)((e=>{o.current.backdrop=e}),[])})}(S),M=Zo(),B=function(t){const n=(0,e.useRef)(null);return(0,e.useEffect)((()=>{n.current=t})),n.current}(o),[F,z]=(0,e.useState)(!o),U=(0,e.useRef)(null);(0,e.useImperativeHandle)(n,(()=>L),[L]),Bi&&!B&&o&&(U.current=cu(null==A?void 0:A.document)),o&&F&&z(!1);const $=qi((()=>{if(L.add(),K.current=Hi(document,"keydown",V),q.current=Hi(document,"focus",(()=>setTimeout(H)),!0),k&&k(),y){var e,t;const n=cu(null!=(e=null==(t=L.dialog)?void 0:t.ownerDocument)?e:null==A?void 0:A.document);L.dialog&&n&&!Yo(L.dialog,n)&&(U.current=n,L.dialog.focus())}})),W=qi((()=>{var e;L.remove(),null==K.current||K.current(),null==q.current||q.current(),v&&(null==(e=U.current)||null==e.focus||e.focus(w),U.current=null)}));(0,e.useEffect)((()=>{o&&j&&$()}),[o,j,$]),(0,e.useEffect)((()=>{F&&W()}),[F,W]),ea((()=>{W()}));const H=qi((()=>{if(!b||!M()||!L.isTopModal())return;const e=cu(null==A?void 0:A.document);L.dialog&&e&&!Yo(L.dialog,e)&&L.dialog.focus()})),G=qi((e=>{e.target===e.currentTarget&&(null==d||d(e),!0===c&&C())})),V=qi((e=>{u&&Xi(e)&&L.isTopModal()&&(null==f||f(e),e.defaultPrevented||C())})),q=(0,e.useRef)(),K=(0,e.useRef)();if(!j)return null;const Q=Object.assign({role:a,ref:L.setDialogRef,"aria-modal":"dialog"===a||void 0},T,{style:l,className:i,tabIndex:-1});let Y=E?E(Q):(0,sl.jsx)("div",Object.assign({},Q,{children:e.cloneElement(s,{role:"document"})}));Y=ul(p,m,{unmountOnExit:!0,mountOnEnter:!0,appear:!0,in:!!o,onExit:P,onExiting:_,onExited:(...e)=>{z(!0),null==D||D(...e)},onEnter:N,onEntering:I,onEntered:R,children:Y});let X=null;return c&&(X=x({ref:L.setBackdropRef,onClick:G}),X=ul(g,h,{in:!!o,appear:!0,mountOnEnter:!0,unmountOnExit:!0,children:X})),(0,sl.jsx)(sl.Fragment,{children:r.createPortal((0,sl.jsxs)(sl.Fragment,{children:[X,Y]}),j)})}));mu.displayName="Modal";const gu=Object.assign(mu,{Manager:du});var hu=Function.prototype.bind.call(Function.prototype.call,[].slice);function yu(e,t){return hu(e.querySelectorAll(t))}function bu(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}const vu=".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",wu=".sticky-top",Eu=".navbar-toggler";class xu extends du{adjustAndStore(e,t,n){const r=t.style[e];t.dataset[e]=r,Wl(t,{[e]:`${parseFloat(Wl(t,e))+n}px`})}restore(e,t){const n=t.dataset[e];void 0!==n&&(delete t.dataset[e],Wl(t,{[e]:n}))}setContainerStyle(e){super.setContainerStyle(e);const t=this.getElement();var n,r;if(r="modal-open",(n=t).classList?n.classList.add(r):pl(n,r)||("string"==typeof n.className?n.className=n.className+" "+r:n.setAttribute("class",(n.className&&n.className.baseVal||"")+" "+r)),!e.scrollBarWidth)return;const o=this.isRTL?"paddingLeft":"paddingRight",a=this.isRTL?"marginLeft":"marginRight";yu(t,vu).forEach((t=>this.adjustAndStore(o,t,e.scrollBarWidth))),yu(t,wu).forEach((t=>this.adjustAndStore(a,t,-e.scrollBarWidth))),yu(t,Eu).forEach((t=>this.adjustAndStore(a,t,e.scrollBarWidth)))}removeContainerStyle(e){super.removeContainerStyle(e);const t=this.getElement();var n,r;r="modal-open",(n=t).classList?n.classList.remove(r):"string"==typeof n.className?n.className=bu(n.className,r):n.setAttribute("class",bu(n.className&&n.className.baseVal||"",r));const o=this.isRTL?"paddingLeft":"paddingRight",a=this.isRTL?"marginLeft":"marginRight";yu(t,vu).forEach((e=>this.restore(o,e))),yu(t,wu).forEach((e=>this.restore(a,e))),yu(t,Eu).forEach((e=>this.restore(a,e)))}}let Su;const Ou=e.forwardRef((({className:e,bsPrefix:t,as:n="div",...r},o)=>(t=yl(t,"modal-body"),(0,sl.jsx)(n,{ref:o,className:fa()(e,t),...r}))));Ou.displayName="ModalBody";const ku=Ou,Cu=e.createContext({onHide(){}}),Pu=e.forwardRef((({bsPrefix:e,className:t,contentClassName:n,centered:r,size:o,fullscreen:a,children:i,scrollable:l,...s},c)=>{const u=`${e=yl(e,"modal")}-dialog`,d="string"==typeof a?`${e}-fullscreen-${a}`:`${e}-fullscreen`;return(0,sl.jsx)("div",{...s,ref:c,className:fa()(u,t,o&&`${e}-${o}`,r&&`${u}-centered`,l&&`${u}-scrollable`,a&&d),children:(0,sl.jsx)("div",{className:fa()(`${e}-content`,n),children:i})})}));Pu.displayName="ModalDialog";const Du=Pu,_u=e.forwardRef((({className:e,bsPrefix:t,as:n="div",...r},o)=>(t=yl(t,"modal-footer"),(0,sl.jsx)(n,{ref:o,className:fa()(e,t),...r}))));_u.displayName="ModalFooter";const Nu=_u,Iu={"aria-label":Jo().string,onClick:Jo().func,variant:Jo().oneOf(["white"])},Ru=e.forwardRef((({className:e,variant:t,"aria-label":n="Close",...r},o)=>(0,sl.jsx)("button",{ref:o,type:"button",className:fa()("btn-close",t&&`btn-close-${t}`,e),"aria-label":n,...r})));Ru.displayName="CloseButton",Ru.propTypes=Iu;const Tu=Ru,Au=e.forwardRef((({closeLabel:t="Close",closeVariant:n,closeButton:r=!1,onHide:o,children:a,...i},l)=>{const s=(0,e.useContext)(Cu),c=qi((()=>{null==s||s.onHide(),null==o||o()}));return(0,sl.jsxs)("div",{ref:l,...i,children:[a,r&&(0,sl.jsx)(Tu,{"aria-label":t,variant:n,onClick:c})]})})),ju=Au,Lu=e.forwardRef((({bsPrefix:e,className:t,closeLabel:n="Close",closeButton:r=!1,...o},a)=>(e=yl(e,"modal-header"),(0,sl.jsx)(ju,{ref:a,...o,className:fa()(t,e),closeLabel:n,closeButton:r}))));Lu.displayName="ModalHeader";const Mu=Lu,Bu=("h4",e.forwardRef(((e,t)=>(0,sl.jsx)("div",{...e,ref:t,className:fa()(e.className,"h4")}))));const Fu=e.forwardRef((({className:e,bsPrefix:t,as:n=Bu,...r},o)=>(t=yl(t,"modal-title"),(0,sl.jsx)(n,{ref:o,className:fa()(e,t),...r}))));Fu.displayName="ModalTitle";const zu=Fu;function Uu(e){return(0,sl.jsx)(Jl,{...e,timeout:null})}function $u(e){return(0,sl.jsx)(Jl,{...e,timeout:null})}const Wu=e.forwardRef((({bsPrefix:t,className:n,style:r,dialogClassName:o,contentClassName:a,children:i,dialogAs:l=Du,"aria-labelledby":s,"aria-describedby":c,"aria-label":u,show:d=!1,animation:f=!0,backdrop:p=!0,keyboard:m=!0,onEscapeKeyDown:g,onShow:h,onHide:y,container:b,autoFocus:v=!0,enforceFocus:w=!0,restoreFocus:E=!0,restoreFocusOptions:x,onEntered:S,onExit:O,onExiting:k,onEnter:C,onEntering:P,onExited:D,backdropClassName:_,manager:N,...I},R)=>{const[T,A]=(0,e.useState)({}),[j,L]=(0,e.useState)(!1),M=(0,e.useRef)(!1),B=(0,e.useRef)(!1),F=(0,e.useRef)(null),[z,U]=pa(),$=ua(R,U),W=qi(y),H=bl();t=yl(t,"modal");const G=(0,e.useMemo)((()=>({onHide:W})),[W]);function V(){return N||function(e){return Su||(Su=new xu(e)),Su}({isRTL:H})}function q(e){if(!Bi)return;const t=V().getScrollbarWidth()>0,n=e.scrollHeight>Gi(e).documentElement.clientHeight;A({paddingRight:t&&!n?su():void 0,paddingLeft:!t&&n?su():void 0})}const K=qi((()=>{z&&q(z.dialog)}));ea((()=>{Wi(window,"resize",K),null==F.current||F.current()}));const Q=()=>{M.current=!0},Y=e=>{M.current&&z&&e.target===z.dialog&&(B.current=!0),M.current=!1},X=()=>{L(!0),F.current=Hl(z.dialog,(()=>{L(!1)}))},J=e=>{"static"!==p?B.current||e.target!==e.currentTarget?B.current=!1:null==y||y():(e=>{e.target===e.currentTarget&&X()})(e)},Z=(0,e.useCallback)((e=>(0,sl.jsx)("div",{...e,className:fa()(`${t}-backdrop`,_,!f&&"show")})),[f,_,t]),ee={...r,...T};return ee.display="block",(0,sl.jsx)(Cu.Provider,{value:G,children:(0,sl.jsx)(gu,{show:d,ref:$,backdrop:p,container:b,keyboard:!0,autoFocus:v,enforceFocus:w,restoreFocus:E,restoreFocusOptions:x,onEscapeKeyDown:e=>{m?null==g||g(e):(e.preventDefault(),"static"===p&&X())},onShow:h,onHide:y,onEnter:(e,t)=>{e&&q(e),null==C||C(e,t)},onEntering:(e,t)=>{null==P||P(e,t),$i(window,"resize",K)},onEntered:S,onExit:e=>{null==F.current||F.current(),null==O||O(e)},onExiting:k,onExited:e=>{e&&(e.style.display=""),null==D||D(e),Wi(window,"resize",K)},manager:V(),transition:f?Uu:void 0,backdropTransition:f?$u:void 0,renderBackdrop:Z,renderDialog:e=>(0,sl.jsx)("div",{role:"dialog",...e,style:ee,className:fa()(n,t,j&&`${t}-static`,!f&&"show"),onClick:p?J:void 0,onMouseUp:Y,"aria-label":u,"aria-labelledby":s,"aria-describedby":c,children:(0,sl.jsx)(l,{...I,onMouseDown:Q,className:o,contentClassName:a,children:i})})})})}));Wu.displayName="Modal";const Hu=Object.assign(Wu,{Body:ku,Header:Mu,Title:zu,Footer:Nu,Dialog:Du,TRANSITION_DURATION:300,BACKDROP_TRANSITION_DURATION:150});var Gu;function Vu(e){return Vu="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},Vu(e)}function qu(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0?"errorField":""),type:"email",placeholder:"Email",onFocus:s,onChange:function(e){return o(e.target.value)},onBlur:function(e){return o(e.target.value)},value:t.value}),t.error===mc.Empty?e.createElement("div",{className:"error"},e.createElement("small",null,"Required")):null,t.error===mc.Invalid?e.createElement("div",{className:"error"},e.createElement("small",null,"Your email is incomplete")):null,e.createElement("textarea",{onChange:function(e){return a(e.target.value)},defaultValue:n.value,rows:"5",placeholder:"Additional notes"}),e.createElement("div",{className:"d-flex flex-column flex-sm-row justify-content-between"},e.createElement(Yu,null),e.createElement("input",{className:"btn btn-primary w-100 m-0 ms-sm-2 order-form-submit",type:"button",disabled:l(),onClick:i,value:"".concat(r?"Processing ...":"Request quote")}))))}const Ju=function(...e){return e.filter((e=>null!=e)).reduce(((e,t)=>{if("function"!=typeof t)throw new Error("Invalid Argument Type, must only provide functions, undefined, or null.");return null===e?t:function(...n){e.apply(this,n),t.apply(this,n)}}),null)},Zu={height:["marginTop","marginBottom"],width:["marginLeft","marginRight"]};function ed(e,t){const n=t[`offset${e[0].toUpperCase()}${e.slice(1)}`],r=Zu[e];return n+parseInt(Wl(t,r[0]),10)+parseInt(Wl(t,r[1]),10)}const td={[Rl]:"collapse",[jl]:"collapsing",[Tl]:"collapsing",[Al]:"collapse show"},nd=e.forwardRef((({onEnter:t,onEntering:n,onEntered:r,onExit:o,onExiting:a,className:i,children:l,dimension:s="height",in:c=!1,timeout:u=300,mountOnEnter:d=!1,unmountOnExit:f=!1,appear:p=!1,getDimensionValue:m=ed,...g},h)=>{const y="function"==typeof s?s():s,b=(0,e.useMemo)((()=>Ju((e=>{e.style[y]="0"}),t)),[y,t]),v=(0,e.useMemo)((()=>Ju((e=>{const t=`scroll${y[0].toUpperCase()}${y.slice(1)}`;e.style[y]=`${e[t]}px`}),n)),[y,n]),w=(0,e.useMemo)((()=>Ju((e=>{e.style[y]=null}),r)),[y,r]),E=(0,e.useMemo)((()=>Ju((e=>{e.style[y]=`${m(y,e)}px`,ql(e)}),o)),[o,m,y]),x=(0,e.useMemo)((()=>Ju((e=>{e.style[y]=null}),a)),[y,a]);return(0,sl.jsx)(Ql,{ref:h,addEndListener:Vl,...g,"aria-expanded":g.role?c:null,onEnter:b,onEntering:v,onEntered:w,onExit:E,onExiting:x,childRef:l.ref,in:c,timeout:u,mountOnEnter:d,unmountOnExit:f,appear:p,children:(t,n)=>e.cloneElement(l,{...n,className:fa()(i,l.props.className,td[t],"width"===y&&"collapse-horizontal")})})})),rd=nd;function od(e,t){return Array.isArray(e)?e.includes(t):e===t}const ad=e.createContext({});ad.displayName="AccordionContext";const id=ad,ld=e.forwardRef((({as:t="div",bsPrefix:n,className:r,children:o,eventKey:a,...i},l)=>{const{activeEventKey:s}=(0,e.useContext)(id);return n=yl(n,"accordion-collapse"),(0,sl.jsx)(rd,{ref:l,in:od(s,a),...i,className:fa()(r,n),children:(0,sl.jsx)(t,{children:e.Children.only(o)})})}));ld.displayName="AccordionCollapse";const sd=ld,cd=e.createContext({eventKey:""});cd.displayName="AccordionItemContext";const ud=cd,dd=e.forwardRef((({as:t="div",bsPrefix:n,className:r,onEnter:o,onEntering:a,onEntered:i,onExit:l,onExiting:s,onExited:c,...u},d)=>{n=yl(n,"accordion-body");const{eventKey:f}=(0,e.useContext)(ud);return(0,sl.jsx)(sd,{eventKey:f,onEnter:o,onEntering:a,onEntered:i,onExit:l,onExiting:s,onExited:c,children:(0,sl.jsx)(t,{ref:d,...u,className:fa()(r,n)})})}));dd.displayName="AccordionBody";const fd=dd,pd=e.forwardRef((({as:t="button",bsPrefix:n,className:r,onClick:o,...a},i)=>{n=yl(n,"accordion-button");const{eventKey:l}=(0,e.useContext)(ud),s=function(t,n){const{activeEventKey:r,onSelect:o,alwaysOpen:a}=(0,e.useContext)(id);return e=>{let i=t===r?null:t;a&&(i=Array.isArray(r)?r.includes(t)?r.filter((e=>e!==t)):[...r,t]:[t]),null==o||o(i,e),null==n||n(e)}}(l,o),{activeEventKey:c}=(0,e.useContext)(id);return"button"===t&&(a.type="button"),(0,sl.jsx)(t,{ref:i,onClick:s,...a,"aria-expanded":Array.isArray(c)?c.includes(l):l===c,className:fa()(r,n,!od(c,l)&&"collapsed")})}));pd.displayName="AccordionButton";const md=pd,gd=e.forwardRef((({as:e="h2",bsPrefix:t,className:n,children:r,onClick:o,...a},i)=>(t=yl(t,"accordion-header"),(0,sl.jsx)(e,{ref:i,...a,className:fa()(n,t),children:(0,sl.jsx)(md,{onClick:o,children:r})}))));gd.displayName="AccordionHeader";const hd=gd,yd=e.forwardRef((({as:t="div",bsPrefix:n,className:r,eventKey:o,...a},i)=>{n=yl(n,"accordion-item");const l=(0,e.useMemo)((()=>({eventKey:o})),[o]);return(0,sl.jsx)(ud.Provider,{value:l,children:(0,sl.jsx)(t,{ref:i,...a,className:fa()(r,n)})})}));yd.displayName="AccordionItem";const bd=yd,vd=e.forwardRef(((t,n)=>{const{as:r="div",activeKey:o,bsPrefix:a,className:i,onSelect:l,flush:s,alwaysOpen:c,...u}=function(e,t){return Object.keys(t).reduce((function(n,r){var o,a=n,i=a[ia(r)],l=a[r],s=C(a,[ia(r),r].map(la)),c=t[r],u=sa(l,i,e[c]),d=u[0],f=u[1];return k({},s,((o={})[r]=d,o[c]=f,o))}),e)}(t,{activeKey:"onSelect"}),d=yl(a,"accordion"),f=(0,e.useMemo)((()=>({activeEventKey:o,onSelect:l,alwaysOpen:c})),[o,l,c]);return(0,sl.jsx)(id.Provider,{value:f,children:(0,sl.jsx)(r,{ref:n,...u,className:fa()(i,d,s&&`${d}-flush`)})})}));vd.displayName="Accordion";const wd=Object.assign(vd,{Button:md,Collapse:sd,Item:bd,Header:hd,Body:fd});var Ed=["arrowProps","hasDoneInitialMeasure","show"];function xd(e){return xd="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},xd(e)}function Sd(){return Sd=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(t,Ed);return e.createElement("div",Sd({className:"k-popup-connectors"},n),e.createElement(Nd,{resources:o,library:_d}))},rootClose:!0},e.createElement("div",{className:"progress-container"},e.createElement(Nd,{resources:o,library:Dd})))}function Rd(e){return Rd="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},Rd(e)}function Td(){return Td=Object.assign?Object.assign.bind():function(e){for(var t=1;t0,h=!u&&l&&l.length>0,y=!u&&s&&s.length>0;return e.createElement(co,{draggableId:i.id,index:n},(function(t,l){return e.createElement("div",Td({ref:t.innerRef},t.draggableProps,t.dragHandleProps,{style:jd({},$o(t.draggableProps.style,l,!0,!!c,!1,!0)),onMouseEnter:function(){return f(d,n)},onMouseLeave:p}),e.createElement("div",{className:"progress-container warning d-flex justify-content-evenly"},h&&e.createElement(Wc,{crate_index:r,card_index:n}),g&&e.createElement(tu,{crate_index:r,card_index:n,first:o,last:a})),e.createElement("h6",null,i.name_number),e.createElement("div",{onMouseEnter:function(){return f(d,n)},onClick:function(){return f(d,n)}},e.createElement("img",{className:"item-cart",src:i.image})),e.createElement("div",{style:{display:c?"flex":"none"},className:"overlayRemove",onClick:function(){return m(d,n)}},e.createElement("img",{src:"/images/shop/icon-remove.svg",alt:"rm"}),e.createElement("p",null,"Remove")),y&&e.createElement(Id,{crate_index:r,card_index:n}))}))}function Md(t){for(var n=t.isDraggingOver,r=[],o=t.nToDraw;o>0;o--)r.push(e.createElement("div",{key:o,style:{display:n?"none":"block",border:"1px dashed #ccc",width:"45px",marginBottom:"5px"}}));return e.createElement(e.Fragment,null,r)}function Bd(){return Bd=Object.assign?Object.assign.bind():function(e){for(var t=1;t=i,key:t.id})}));return e.createElement(Ro,{droppableId:r.id,direction:"horizontal"},(function(t,n){return e.createElement("div",Bd({ref:t.innerRef},t.droppableProps,{style:Wo(t.droppableProps.style,n),className:"items-cart-list"}),l,t.placeholder&&e.createElement("div",{style:{display:"none"}},t.placeholder),e.createElement(Md,{nToDraw:i-a,isDraggingOver:n.isDraggingOver}))}))}function zd(t){var n=t.crate_index,r=Nc((function(e){return e.modes_order})),o=Nc((function(e){return e.crate_modes})),a=Nc((function(e){return e.crates[n]}),(function(e,t){return e.id===t.id&&e.crate_mode===t.crate_mode})),i=Nc((function(e){return e.setCrateMode}));return e.createElement("div",{className:"crate-mode"},r.map((function(t,n){return e.createElement("a",{key:t,className:a.crate_mode===t?"active":"",onClick:function(){return i(a.id,t)},href:"#",role:"button"},o[t].name)})))}function Ud(t){var n=t.crate_index,r=Nc((function(e){return e.crates[n].warnings}),Vo);return e.createElement("div",{className:"crate-info"},r.map((function(t,n){return e.createElement("p",{key:n,className:"rule",style:{color:ac(t.level).color}},e.createElement("img",{src:ac(t.level).icon})," ",e.createElement("i",null,t.message))})))}function $d(t){var n=t.crate_index,r=Nc((function(e){return e.crates[n]}),(function(e,t){return e.length===t.length&&e.id===t.id})),o=Nc((function(e){return e.modes_order})),a=Nc((function(e){return e.delCrate}));return e.createElement("div",{className:"crate"},o.includes(r.crate_mode)?e.createElement("div",{className:"crate-bar d-inline-flex justify-content-between"},e.createElement(zd,{crate_index:n}),e.createElement("div",{className:"delete-crate align-self-start align-content-start justify-content-end",onClick:function(){return a(r.id)}},"Delete crate ",e.createElement("img",{src:"/images/shop/icon-remove.svg",alt:"remove"}))):e.createElement(e.Fragment,null),e.createElement("div",{className:"crate-products"},e.createElement(Fd,{crate_index:n}),e.createElement(Ud,{crate_index:n})))}function Wd(){var t=Nc((function(e){return e.crates}),(function(e,t){return e.length===t.length})),n=Nc((function(e){return e.active_crate})),r=Nc((function(e){return e.newCrate})),o=Nc((function(e){return e.setActiveCrate}));return e.createElement(wd,{id:"accordion_crates",flush:!0,activeKey:n,onSelect:function(e){o(null!==e?e:"")}},t.map((function(t,n){return e.createElement(wd.Item,{eventKey:t.id,key:"accordion"+t.id,className:"accordion_crates_item"},e.createElement(wd.Header,null,t.name?t.name:e.createElement(e.Fragment,null,"Crate #","".concat(n))," "),e.createElement(wd.Body,null,e.createElement($d,{crate_index:n})))})),e.createElement(wd.Item,{eventKey:"last",id:"accordion_crates_add"},e.createElement(wd.Header,{onClick:r},"Add new crate")))}var Hd=JSON.stringify({crates:[{items:[{pn:"1124",options:null},{pn:"2128",options:null},{pn:"2128",options:null},{pn:"2128",options:null}],type:"rack"},{items:[],type:"no_crate"}]});function Gd(){var t=Nc((function(e){return e.importShouldOpen})),n=Nc((function(e){return e.importValue})),r=Nc((function(e){return e.loadDescription})),o=Nc((function(e){return e.updateImportDescription})),a=Nc((function(e){return e.closeImport})),i=Nc((function(e){return e.openImport})),l=Gc((function(e){"mousedown"===e.type&&a()}));return e.createElement(e.Fragment,null,e.createElement("button",{className:"btn btn-sm btn-outline-primary m-0 mb-2",style:{cursor:"pointer"},onClick:i},"Import JSON"),e.createElement(Hu,{show:t,animation:!0,centered:!0,className:"rfqFeedback"},e.createElement(Hu.Body,{ref:l},e.createElement("div",{className:"form-group"},e.createElement("p",{className:"small"},"Input the JSON description below. Should be something like:",e.createElement("br",null),Hd)),e.createElement("div",{className:"form-group w-100"},e.createElement("textarea",{onChange:function(e){o(e.target.value)},value:n.value,className:"form-control w-100",rows:"5",placeholder:"Input JSON description here."})),n.error!==mc.OK?e.createElement("div",{className:"form-group"},e.createElement("p",{className:"text-danger"},n.error===mc.Empty?"Empty input":"Invalid JSON")):null,e.createElement("div",{className:"d-flex flex-column flex-sm-row justify-content-end"},e.createElement("a",{type:"button",onClick:a,className:"btn btn-sm btn-outline-primary m-0 mb-2 mt-2 mb-sm-0 me-sm-2"},"Close"),e.createElement("a",{type:"button",onClick:r,className:"btn btn-sm btn-primary m-0 ms-sm-2 mt-2 ".concat(n.error?"disabled":"")},"Load configuration")))))}function Vd(){var t=Nc((function(e){return e.closeRFQFeedback})),n=Nc((function(e){return e.shouldShowRFQFeedback})),r=Nc((function(e){return e.processingResult})),o=Gc((function(e){"mousedown"===e.type&&t()}));return e.createElement(Hu,{show:n,animation:!0,centered:!0},e.createElement(Hu.Body,{ref:o,className:"rfqFeedback"},e.createElement("div",{className:"d-flex"},e.createElement("div",null,r.status===mc.OK?e.createElement("img",{width:"30px",src:"/images/shop/icon-done.svg",alt:"close"}):e.createElement("img",{width:"30px",src:"/images/shop/icon-warning.svg",alt:"close"})),e.createElement("div",{style:{padding:"0 .5em"}},r.message))))}function qd(t){var n=t.title,r=t.description,o=Nc((function(e){return e.isMobile})),a=Nc((function(e){return e.switchSideMenu}));return e.createElement("section",{className:"panel"},e.createElement("h2",null,n),e.createElement("div",{className:"control justify-content-between"},r),e.createElement("div",null,e.createElement(Gd,null)),e.createElement(Vd,null),o?e.createElement("div",{className:"mobileBtnDisplaySideMenu"},e.createElement("button",{onClick:a},e.createElement("img",{src:"/images/shop/icon-add.svg",alt:"add"}))):null,e.createElement(Wd,null),e.createElement("section",{className:"summary"},e.createElement(lu,null),e.createElement(Xu,null)))}function Kd(){var t=Nc((function(e){return e.addCardFromBacklog})),n=Nc((function(e){return e.moveCard})),r=Nc((function(e){return e.deleteCard})),o=Nc((function(e){return e.cardIndexById}));return(0,e.useEffect)((function(){t(null,[o("eem_pwr_mod"),o("kasli")],-1,!0)}),[]),e.createElement(Kr,{onDragEnd:function(e,o){e.destination?"backlog"===e.source.droppableId?t(e.destination.droppableId,e.source.index,e.destination.index):"backlog"===e.destination.droppableId?r(e.source.droppableId,e.source.index):n(e.source.droppableId,e.source.index,e.destination.droppableId,e.destination.index):console.warn("No drop destination")}},e.createElement(Ic,{aside:e.createElement(jc,null),main:e.createElement(qd,{title:"Order hardware",description:e.createElement("p",{className:"description"},"Drag and drop the cards you want into the crate below to see how the combination would look like. Configure the card settings by tapping on the top of the card; many of the options can be adjusted even after the card has been shipped. If you have any issues with this ordering system, or if you need other configurations, email us directly anytime at ",e.createElement("a",{href:"mailto:sales@m-labs.hk"},"sales@m-labs.hk"),". The price is estimated and must be confirmed by a quote.")})}))}(0,t.s)(document.querySelector("#root-shop")).render(e.createElement(Kd,null))})()})();
\ No newline at end of file
diff --git a/static/js/shop.jsx b/static/js/shop.jsx
index fc92248..e506a05 100644
--- a/static/js/shop.jsx
+++ b/static/js/shop.jsx
@@ -2,2487 +2,7 @@
import React from "react";
import { createRoot } from "react-dom/client";
-import PropTypes from "prop-types";
-import { DragDropContext, Droppable, Draggable } from "react-beautiful-dnd";
-import { v4 as uuidv4 } from 'uuid';
-import { OptionsDialogPopup, OptionsSummaryPopup, FilterOptions, FillExtData } from "./shop_components.jsx";
-import { OverlayTrigger } from "react-bootstrap";
-const data = window.shop_data;
-const itemsUnfoldedList = Array.from(data.columns.backlog.categories.map(groupId => groupId.itemIds).flat());
+import { Shop } from "./shop/Shop.jsx"
-const productStyle = (style, snapshot, removeAnim, hovered, selected, cart=false) => {
- const custom = {
- opacity: snapshot.isDragging ? .7 : 1,
- backgroundColor: (hovered || selected) ? '#eae7f7' : 'initial',
- };
-
- if (!cart && snapshot.draggingOver == null && // hack for backlog
- ((!snapshot.isDragging) // prevent next elements from animation
- || (snapshot.isDragging && snapshot.isDropAnimating))) { // prevent dragged element from weird animation
- style.transform = "none";
- }
-
- if (!snapshot.isDropAnimating) {
- return { ...style, ...custom};
- }
-
- if (removeAnim) {
- // cannot be 0, but make it super tiny
- custom.transitionDuration = '0.001s';
- }
-
- return {
- ...style,
- ...custom,
- };
-}
-
-const cartStyle = (style, snapshot) => {
- const isDraggingOver = snapshot.isDraggingOver;
- return {
- ...style,
- ...{
- backgroundColor: isDraggingOver ? '#f2f2f2' : '#f9f9f9',
- border: isDraggingOver ? '1px dashed #ccc' : '0',
- },
- };
-}
-
-const nbrConnectorsStyle = (data) => {
- if (!data || !data.nbrCurrentSlot) {
- return {};
- }
-
- let p = data.nbrCurrentSlot * 100 / data.nbrSlotMax;
- if (p > 100) {
- p = 100;
- }
- return {
- width: `${p}%`,
- }
-};
-
-const nbrClocksStyle = (data) => {
- if (!data || !data.nbrCurrentClock) {
- return {};
- }
-
- let p = data.nbrCurrentClock * 100 / data.nbrClockMax;
- if (p > 100) {
- p = 100;
- }
- return {
- width: `${p}%`,
- }
-};
-
-const copy = (
- model,
- source,
- destination,
- draggableSource,
- droppableDestination
-) => {
- const destClone = Array.from(destination.items);
-
- destClone.splice(droppableDestination.index, 0, ...draggableSource.map((dragged_item, _) => {
- return {
- ...model[dragged_item],
- id: uuidv4(),
- }
- }));
-
- return destClone;
-};
-
-const reorder = (list, startIndex, endIndex) => {
- const result = Array.from(list);
- const [removed] = result.splice(startIndex, 1);
- result.splice(endIndex, 0, removed);
-
- return result;
-};
-
-const remove = (list, startIndex) => {
- const result = Array.from(list);
- result.splice(startIndex, 1);
- return result;
-};
-
-const nbrOccupiedSlotsInCrate = (items) => {
- return items.reduce((prev, next) => {
- return prev + (next.hp === 8 ? 2 : 1);
- }, 0);
-};
-
-function formatMoney(amount, decimalCount = 2, decimal = ".", thousands = ",") {
- // https://stackoverflow.com/questions/149055/how-can-i-format-numbers-as-currency-string-in-javascript
- // changes: return amount if error in order to avoid empty value
- try {
- decimalCount = Math.abs(decimalCount);
- decimalCount = isNaN(decimalCount) ? 2 : decimalCount;
-
- const negativeSign = amount < 0 ? "-" : "";
-
- let i = parseInt(amount = Math.abs(Number(amount) || 0).toFixed(decimalCount)).toString();
- let j = (i.length > 3) ? i.length % 3 : 0;
-
- return negativeSign + (j ? i.substr(0, j) + thousands : '') + i.substr(j).replace(/(\d{3})(?=\d)/g, "$1" + thousands) + (decimalCount ? decimal + Math.abs(amount - i).toFixed(decimalCount).slice(2) : "");
- } catch (e) {
- return amount;
- }
-};
-
-
-/**
- * Component that provides a base layout (aside/main) for the page.
- */
-class Layout extends React.PureComponent {
-
- static get propTypes() {
- return {
- aside: PropTypes.any,
- main: PropTypes.any,
- mobileSideMenuShouldOpen: PropTypes.bool,
- isMobile: PropTypes.bool,
- newCardJustAdded: PropTypes.bool,
- onClickToggleMobileSideMenu: PropTypes.func,
- onClickCloseRFQFeedback: PropTypes.func,
- RFQBodyType: PropTypes.string,
- RFQBodyOrder: PropTypes.string,
- onClickLoadCustomConf: PropTypes.func,
- items: PropTypes.object,
- };
- }
-
- static get defaultProps() {
- return {
- mobileSideMenuShouldOpen: false,
- };
- }
-
- constructor(props) {
- super(props);
-
- this.state = {
- customconf: '',
- error: null,
- };
-
- this.handleCustomConfig = this.handleCustomConfig.bind(this);
- this.handleClickLoad = this.handleClickLoad.bind(this);
- this.checkValidation = this.checkValidation.bind(this);
-
- // retrieve list of available pn
- const items_keys = Object.keys(props.items);
- this.list_pn = items_keys.map(function (key) {
- return props.items[key].name_number;
- });
- }
-
- handleCustomConfig(e) {
- const value = e.target.value;
-
- this.checkValidation(value);
- }
-
- checkValidation(conf) {
- let conf_obj;
-
- try {
- conf_obj = JSON.parse(conf);
- } catch (e) {
- return this.setState({
- ...this.state,
- customconf: conf,
- customconf_ready: null,
- error: 'invalid format',
- });
- }
-
- if (!conf_obj) {
- return this.setState({
- ...this.state,
- customconf: conf,
- customconf_ready: null,
- error: 'invalid format',
- });
- }
-
- if ((!conf_obj.items || !conf_obj.type) &&
- (Object.prototype.toString.call(conf_obj.items) !== '[object Array]' ||
- Object.prototype.toString.call(conf_obj.type) !== '[object String]')) {
- return this.setState({
- ...this.state,
- customconf: conf,
- customconf_ready: null,
- error: 'invalid format',
- });
- }
-
- if (conf_obj.type !== "desktop" && conf_obj.type !== "rack") {
- return this.setState({
- ...this.state,
- customconf: conf,
- customconf_ready: null,
- error: 'invalid format',
- });
- }
-
- conf_obj.items.map(function (item) {
- try {
- return JSON.parse(item);
- } catch (e) {
- return null;
- }
- });
-
- conf_obj.items = conf_obj.items.filter(function (item) {
- return item;
- });
-
- if (conf_obj.items.filter(function (item) {
- return Object.prototype.toString.call(item) !== '[object Object]' || !item.pn || Object.prototype.toString.call(item.pn) !== '[object String]';
- }).length > 0) {
- return this.setState({
- ...this.state,
- customconf: conf,
- customconf_ready: null,
- error: 'invalid format',
- });
- }
-
- conf_obj.items = conf_obj.items.map(function (item) {
- return {
- pn: item.pn,
- options: item.options ? item.options : null,
- };
- });
-
- const self = this;
- const unknow_pn = conf_obj.items.filter(function (item_pn) {
- return self.list_pn.includes(item_pn.pn) === false;
- }).map(function (item_pn) {
- return item_pn.pn;
- });
-
- if (unknow_pn.length > 0) {
- return this.setState({
- ...this.state,
- customconf: conf,
- customconf_ready: null,
- error: `${unknow_pn.join(', ')} unknown${unknow_pn.length > 1 ? 's':''} pn number`,
- });
- }
-
- this.setState({
- ...this.state,
- customconf: conf,
- error: null,
- customconf_ready: conf_obj,
- });
- }
-
- handleClickLoad() {
- this.checkValidation(this.state.customconf);
-
- if (this.props.onClickLoadCustomConf) {
- this.props.onClickLoadCustomConf(this.state.customconf_ready);
- }
- }
-
- render() {
- const {
- aside,
- main,
- mobileSideMenuShouldOpen,
- isMobile,
- newCardJustAdded,
- onClickToggleMobileSideMenu,
- onClickCloseRFQFeedback,
- showRFQFeedback,
- RFQBodyType,
- RFQBodyOrder,
- } = this.props;
-
- return (
-
-
-
-
- {mobileSideMenuShouldOpen ? (
-
- ) : (
-
- )}
-
- {isMobile && newCardJustAdded ? (
-
- ✓ added
-
- ) : null}
-
-
-
-
-
-
-
-
-
- {RFQBodyType === 'email' ? (
-
-
-
-
-
-
-
- We've received your request and will be in contact soon.
-
-
-
- ) : null }
-
- {RFQBodyType === 'show' ? (
-
- {RFQBodyOrder}
-
- ) : null}
-
- {RFQBodyType === 'import' ? (
-
- ) : null}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- );
- }
-}
-
-
-/**
- * Component that renders a product.
- * Used in the aside (e.g backlog of product)
- */
-class ProductItem extends React.PureComponent {
-
- static get propTypes() {
- return {
- id: PropTypes.string.isRequired,
- index: PropTypes.number.isRequired,
- name: PropTypes.string.isRequired,
- name_codename: PropTypes.string,
- price: PropTypes.number.isRequired,
- currency: PropTypes.string.isRequired,
- image: PropTypes.string.isRequired,
- specs: PropTypes.array,
- datasheet_file: PropTypes.string,
- datasheet_name: PropTypes.string,
- onClickAddItem: PropTypes.func,
- };
- }
-
- constructor(props) {
- super(props);
- this.handleOnClickAddItem = this.handleOnClickAddItem.bind(this);
- }
-
- handleOnClickAddItem(id, tap, e) {
- if (this.props.onClickAddItem) {
- this.props.onClickAddItem(id, tap);
- }
- e.preventDefault();
- }
-
- render() {
- const {
- id,
- index,
- name,
- name_codename,
- price,
- currency,
- image,
- specs,
- datasheet_file,
- datasheet_name,
- } = this.props;
-
- const render_specs = (specs && specs.length > 0 && (
-
- {specs.map((spec, index) =>
- {spec}
- )}
-
- ));
-
- const render_datasheet_link = (datasheet_file && datasheet_name && (
-
- ));
-
- return (
-
-
-
-
{name}
- {name_codename ? (
-
{name_codename}
- ) : null }
-
-
{`${currency} ${formatMoney(price)}`}
-
- {render_specs}
-
- {render_datasheet_link}
-
-
-
-
-
-
-
-
-
- {(provided, snapshot) => (
-
-
-
- {/* Allows to simulate a clone */}
- {snapshot.isDragging && (
-
- )}
-
- )}
-
-
-
-
-
- );
- }
-}
-
-
-/**
- * Component that renders a product.
- * Used in the crate
- */
-class ProductCartItem extends React.PureComponent {
-
- static get propTypes() {
- return {
- isMobile: PropTypes.bool,
- isTouch: PropTypes.bool,
- hovered: PropTypes.bool,
- first: PropTypes.bool,
- last: PropTypes.bool,
- index: PropTypes.number.isRequired,
- model: PropTypes.object.isRequired,
- data: PropTypes.object,
- ext_data: PropTypes.object,
- onToggleOverlayRemove: PropTypes.func,
- onClickRemoveItem: PropTypes.func,
- onClickItem: PropTypes.func,
- onCardUpdate: PropTypes.func,
- };
- }
-
- static get defaultProps() {
- return {
- hovered: false,
- };
- }
-
- constructor(props) {
- super(props);
- this.handleOnMouseEnterRemoveItem = this.handleOnMouseEnterRemoveItem.bind(this);
- this.handleOnMouseLeaveRemoveItem = this.handleOnMouseLeaveRemoveItem.bind(this);
- this.handleOnClickRemoveItem = this.handleOnClickRemoveItem.bind(this);
- this.handleOnClickItem = this.handleOnClickItem.bind(this);
- }
-
- handleOnMouseEnterRemoveItem(index, e) {
- if (this.props.onToggleOverlayRemove && !this.props.isMobile) {
- this.props.onToggleOverlayRemove(index, true);
- }
- e.preventDefault();
- }
-
- handleOnMouseLeaveRemoveItem(index, e) {
- if (this.props.onToggleOverlayRemove && !this.props.isMobile) {
- this.props.onToggleOverlayRemove(index, false);
- }
- e.preventDefault();
- }
-
- handleOnClickItem(index, e) {
- if (this.props.onClickItem && this.props.isTouch) {
- this.props.onClickItem(index);
- }
- e.preventDefault();
- }
-
- handleOnClickRemoveItem(index, e) {
- if (this.props.onClickRemoveItem) {
- this.props.onClickRemoveItem(index);
- }
- }
-
- render() {
- const {
- hovered,
- model,
- data,
- index,
- first,
- last,
- ext_data,
- onCardUpdate,
- } = this.props;
-
- let warning, options, options_data;
- if (data && data.warnings) {
- const warningsKeys = Object.keys(data.warnings);
- if (warningsKeys && warningsKeys.length > 0) {
- // we display only the first warning
- warning = data.warnings[warningsKeys[0]];
- }
- }
-
-
-
- if (data && data.options) {
- options = data.options;
- if (!data.options_data) data.options_data = {};
- options_data = data.options_data;
- options_data.ext_data = ext_data;
- }
-
- let render_progress;
- if (data) {
- switch(model.type) {
- case 'kasli':
- render_progress = [
- ({`${data.nbrCurrentSlot}/${model.nbrSlotMax} EEM connectors used`}
),
- ({`${data.nbrCurrentClock}/${model.nbrClockMax} Clock connectors used`}
)
- ];
- break;
-
- case 'vhdcicarrier':
- render_progress = ({`${data.nbrCurrentSlot}/${model.nbrSlotMax} EEM connectors used`}
);
- break;
-
- case 'zotino':
- case 'hd68':
- render_progress = ({`${data.nbrCurrentSlot}/${model.nbrSlotMax} connectors used`}
);
- break;
-
- case 'clocker':
- render_progress = ({`${data.nbrCurrentClock}/${model.nbrClockMax} Clock connectors used`}
);
- break;
-
- default:
- break;
- }
- }
-
- return (
-
-
- {(provided, snapshot) => (
-
-
- {/* warning container */}
-
-
- {warning &&
- (
(
-
-
- {warning.message}
-
-
)
- }
- rootClose
- >
-
- )
- }
-
- {options && (
-
{
- // console.log("construct", outvar, value, options_data);
- options_data[outvar] = value;
- }),
- update: ((outvar, value) => {
- // console.log("update", outvar, value, options_data);
- if (outvar in options_data) options_data[outvar] = value;
- onCardUpdate();
- })
- }}
- />
- )}
-
-
-
{model.name_number}
-
-
-
-
-
-
- {/* remove container */}
-
-
-
-
-
Remove
-
-
- {/* progression container */}
- {render_progress && (
-
({render_progress}
)}
- rootClose
- >
-
-
- {model.nbrSlotMax > 0 && (
-
- )}
-
- {model.nbrClockMax > 0 && (
-
- )}
-
-
- )}
-
-
-
- )}
-
-
- );
- }
-}
-
-
-/**
- * Component that displays a placeholder inside crate.
- * Allows to display how it remains space for the current crate.
- */
-class FakePlaceholder extends React.PureComponent {
-
- static get propTypes() {
- return {
- isDraggingOver: PropTypes.bool,
- nbrSlots: PropTypes.number.isRequired,
- items: PropTypes.array.isRequired,
- };
- }
-
- render() {
- const {
- isDraggingOver,
- nbrSlots,
- items,
- } = this.props;
-
- const fakePlaceholder = [];
- const nbrOccupied = nbrOccupiedSlotsInCrate(items);
-
- for (var i = (nbrSlots - nbrOccupied); i > 0; i--) {
- fakePlaceholder.push(
-
- );
- }
-
- return (
-
- {fakePlaceholder}
-
- );
-
- }
-}
-
-
-/**
- * Component that displays a list of
- */
-class Cart extends React.PureComponent {
-
- static get propTypes() {
- return {
- isMobile: PropTypes.bool,
- isTouch: PropTypes.bool,
- nbrSlots: PropTypes.number,
- itemHovered: PropTypes.string,
- data: PropTypes.object.isRequired,
- onToggleOverlayRemove: PropTypes.func,
- onClickRemoveItem: PropTypes.func,
- onCardUpdate: PropTypes.func,
- onClickItem: PropTypes.func,
- };
- }
-
- render() {
- const {
- isMobile,
- isTouch,
- nbrSlots,
- itemHovered,
- data,
- onToggleOverlayRemove,
- onClickRemoveItem,
- onClickItem,
- onCardUpdate,
- } = this.props;
-
- const nbrOccupied = nbrOccupiedSlotsInCrate(data.items);
-
- const products = data.items.map((item, index) => {
- let itemData;
- let ext_data = FillExtData(data.itemsData, index);
- if (data.itemsData && index in data.itemsData) {
- itemData = data.itemsData[index];
- }
- return (
- = nbrSlots}
- data={itemData}
- ext_data={ext_data}
- onToggleOverlayRemove={onToggleOverlayRemove}
- onClickRemoveItem={onClickRemoveItem}
- onCardUpdate={onCardUpdate}
- onClickItem={onClickItem}
- model={item}>
-
- );
- });
-
- return (
-
-
- {(provided, snapshot) => (
-
-
- {products}
-
- {provided.placeholder && (
-
- {provided.placeholder}
-
- )}
-
-
-
- )}
-
-
- );
- }
-}
-
-
-/**
- * Component that displays crate modes
- */
-class CrateMode extends React.PureComponent {
-
- static get propTypes() {
- return {
- items: PropTypes.array.isRequired,
- mode: PropTypes.string.isRequired,
- onClickMode: PropTypes.func,
- };
- }
-
- constructor(props) {
- super(props);
- this.handleOnClickMode = this.handleOnClickMode.bind(this);
- }
-
- handleOnClickMode(mode, e) {
- if (this.props.onClickMode) {
- this.props.onClickMode(mode);
- }
- e.preventDefault();
- }
-
- render() {
- const {
- mode,
- items,
- } = this.props;
-
- return (
-
- );
- }
-}
-
-
-/**
- * Component that displays the main crate with reminder rules.
- * It includes and rules
- */
-class Crate extends React.PureComponent {
-
- static get propTypes() {
- return {
- rules: PropTypes.array,
- cart: PropTypes.element,
- };
- }
-
- render() {
- const {
- rules,
- cart,
- } = this.props;
-
- return (
-
-
-
-
- {cart}
-
- {rules && rules.length > 0 && (
-
- {rules.map((rule, index) => (
-
- {rule.name}: {rule.message}
-
- ))}
-
- )}
-
-
-
- );
- }
-}
-
-
-/**
- * Component that renders all things for order.
- * It acts like-a layout, this component do nothing more.
- */
-class OrderPanel extends React.PureComponent {
-
- static get propTypes() {
- return {
- title: PropTypes.string,
- description: PropTypes.element,
- crateMode: PropTypes.element,
- crate: PropTypes.element,
- summaryPrice: PropTypes.element,
- form: PropTypes.element,
- isMobile: PropTypes.bool,
- onClickToggleMobileSideMenu: PropTypes.func,
- onClickOpenImport: PropTypes.func,
- };
- }
-
- render() {
- const {
- title,
- description,
- crateMode,
- crate,
- summaryPrice,
- form,
- isMobile,
- onClickToggleMobileSideMenu,
- onClickOpenImport,
- } = this.props;
-
- return (
-
-
- {title}
-
-
-
{description}
-
- {crateMode}
-
-
-
- Import JSON
-
-
- {isMobile ? (
-
-
-
-
-
- ) : null}
-
- {crate}
-
-
- {summaryPrice}
-
- {form}
-
-
-
- );
- }
-}
-
-
-/**
- * Components that renders the form to request quote.
- */
-class OrderForm extends React.PureComponent {
-
- static get propTypes() {
- return {
- isProcessing: PropTypes.bool,
- isProcessingComplete: PropTypes.bool,
- onClickSubmit: PropTypes.func,
- };
- }
-
- constructor(props) {
- super(props);
- this.state = {
- note: '',
- email: '',
- error: {
- note: null,
- email: null,
- },
- empty: {
- note: null,
- email: null,
- },
- };
-
- this.handleEmail = this.handleEmail.bind(this);
- this.handleNote = this.handleNote.bind(this);
- this.handleSubmit = this.handleSubmit.bind(this);
- this.resetEmptyError = this.resetEmptyError.bind(this);
- this.checkValidation = this.checkValidation.bind(this);
- }
-
- checkValidation() {
- let isValid = true;
- let validationFields = {...this.state};
-
- const {
- isEmpty: isEmailEmpty,
- isError: isEmailError
- } = this.validateEmail(this.state.email);
-
- validationFields = {
- ...validationFields,
- error: {
- ...this.state.error,
- email: isEmailError,
- },
- empty: {
- ...this.state.empty,
- email: isEmailEmpty,
- }
- }
-
- this.setState(validationFields);
-
- isValid =
- !isEmailEmpty &&
- !isEmailError
-
- return isValid;
- }
-
- validateEmail(value) {
- let isEmpty = null;
- let isError = null;
-
- const { t } = this.props;
-
- if (!value || value.trim() === '') {
- isEmpty = true;
- } else if (value && !value.match(/^\w+([\+\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/)) {
- isError = {
- message: 'Your email is incomplete',
- };
- }
-
- return { isEmpty, isError };
- }
-
- validateNote(value) {
- let isEmpty = null;
-
- if (!value || value.trim() === '') {
- isEmpty = true;
- }
-
- return { isEmpty };
- }
-
- resetEmptyError(key) {
- this.setState({
- ...this.state,
- error: {
- ...this.state.error,
- [key]: null,
- },
- empty: {
- ...this.state.empty,
- [key]: null,
- },
- });
- }
-
- handleEmail(e) {
- const value = e.target.value;
- const { isEmpty, isError } = this.validateEmail(value);
-
- this.setState({
- ...this.state,
- email: value,
- error: {
- ...this.state.error,
- email: isError,
- },
- empty: {
- ...this.state.empty,
- email: isEmpty,
- }
- });
- }
-
- handleNote(e) {
- const value = e.target.value;
-
- this.setState({
- ...this.state,
- note: value,
- });
- }
-
- handleSubmit(event) {
- event.preventDefault();
-
- if (this.props.onClickSubmit) {
- // check validation input fields
- const isValidated = this.checkValidation();
- if (!isValidated) {
- return false;
- }
-
- this.props.onClickSubmit(this.state.note, this.state.email);
- }
- }
-
- render() {
- const {
- handleEmail,
- handleNote,
- resetEmptyError,
- handleSubmit,
- } = this;
-
- const {
- onClickShow,
- } = this.props;
-
- const {
- email,
- note,
- error,
- empty
- } = this.state;
-
- const { isProcessing, isProcessingComplete } = this.props;
-
- return (
-
- );
- }
-}
-
-
-/**
- * Components that displays the list of card that are used in the crate.
- * It is a summary of purchase
- */
-class OrderSumary extends React.PureComponent {
-
- static get propTypes() {
- return {
- currency: PropTypes.string,
- modes: PropTypes.array,
- currentMode: PropTypes.string,
- summary: PropTypes.array,
- itemsData: PropTypes.array,
- onDeleteItem: PropTypes.func,
- onDeleteAllItems: PropTypes.func,
- onMouseEnterItem: PropTypes.func,
- onMouseLeaveItem: PropTypes.func,
- onClickSelectItem: PropTypes.func,
- };
- }
-
- constructor(props) {
- super(props);
- this.handleOnDeleteItem = this.handleOnDeleteItem.bind(this);
- this.handleOnDeleteAllItems = this.handleOnDeleteAllItems.bind(this);
- this.handleOnMouseEnterItem = this.handleOnMouseEnterItem.bind(this);
- this.handleOnMouseLeaveItem = this.handleOnMouseLeaveItem.bind(this);
- this.handleOnClickSelectItem = this.handleOnClickSelectItem.bind(this);
- }
-
- handleOnDeleteItem(index, e) {
- if (this.props.onDeleteItem) {
- this.props.onDeleteItem(index);
- }
- e.preventDefault();
- }
-
- handleOnDeleteAllItems(e) {
- if (this.props.onDeleteAllItems) {
- this.props.onDeleteAllItems();
- }
- e.preventDefault();
- }
-
- handleOnMouseEnterItem(id, e) {
- if (this.props.onMouseEnterItem) {
- this.props.onMouseEnterItem(id);
- }
- e.preventDefault();
- }
-
- handleOnMouseLeaveItem(e) {
- if (this.props.onMouseLeaveItem) {
- this.props.onMouseLeaveItem();
- }
- e.preventDefault();
- }
-
- handleOnClickSelectItem(index, e) {
- if (e.target.tagName !== 'IMG') {
- if (this.props.onClickSelectItem) {
- this.props.onClickSelectItem(index);
- }
- }
- return e.preventDefault();
- }
-
- render() {
- const {
- currency,
- modes,
- currentMode,
- summary,
- itemsData,
- } = this.props;
-
- const mode = modes.find(elem => elem.id === currentMode);
-
- return (
-
-
-
-
-
-
-
- Remove all cards
-
-
-
-
-
-
-
- {mode && (
-
- {mode.name}
-
-
- {`${currency} ${formatMoney(mode.price)}`}
-
-
-
-
-
-
-
-
-
- )}
-
-
-
- {summary.map((item, index) => {
- let alert, warning, options, options_data;
-
- if (itemsData[index] && itemsData[index].warnings) {
- alert = itemsData[index];
- const warningsKeys = Object.keys(alert.warnings);
- if (warningsKeys && warningsKeys.length > 0) {
- warning = alert.warnings[warningsKeys[0]];
- }
- }
- options = itemsData[index] && itemsData[index].options;
- options_data = itemsData[index] && itemsData[index].options_data;
-
- return (
-
-
-
- {`${item.name_number} ${item.name} ${item.name_codename}`}
-
-
-
-
- {`${currency} ${formatMoney(item.price)}`}
-
-
-
-
-
-
- {(warning ? (
-
- ) : (
-
- ))}
- {((options && options_data) ? (
-
- ) : (
-
- ))}
-
-
-
-
- );
- })}
-
-
-
-
- Price estimate
-
-
- {summary.length ? (
- `${currency} ${formatMoney(summary.reduce(
- (prev, next) => {
- return prev + next.price;
- }, 0
- ) + mode.price)}`
- ) : (
- `${currency} ${formatMoney(mode.price)}`
- )}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- );
- }
-}
-
-
-/**
- * Component that renders the backlog in the aside
- */
-class Backlog extends React.PureComponent {
-
- static get propTypes() {
- return {
- currency: PropTypes.string,
- data: PropTypes.object.isRequired,
- items: PropTypes.object,
- isMobile: PropTypes.bool,
- onClickAddItem: PropTypes.func,
- onClickToggleMobileSideMenu: PropTypes.func,
- };
- }
-
- static get defaultProps() {
- return {
- items: {},
- };
- }
-
- render() {
- const {
- currency,
- data,
- items,
- onClickAddItem,
- onClickToggleMobileSideMenu,
- isMobile,
- } = this.props;
-
-
- const ordered_groups = data.categories.map(groupItem => ({ name: groupItem.name,
- items: groupItem.itemIds.map(itemId => items[itemId])
- }));
- let item_index = -1;
- const groups = ordered_groups.map((group, g_index) => {
- return (
-
-
-
- {group.name}
-
-
-
-
- {group.items.map(item => {
- item_index++;
- return (
-
- )})}
-
-
-
- );
- }
- );
-
- return (
-
-
- {(provided) => (
-
-
- {isMobile ? (
-
-
-
-
-
- ) : null}
-
-
- {groups}
-
-
- {provided.placeholder && (
-
- {provided.placeholder}
-
- )}
-
- )}
-
-
- );
- }
-}
-
-
-/**
- * Component that render the entire shop
- */
-class Shop extends React.PureComponent {
-
- static get propTypes() {
- return {
- data: PropTypes.object.isRequired,
- };
- }
-
- constructor(props) {
- super(props);
- this.state = this.props.data;
- this.handleCrateModeChange = this.handleCrateModeChange.bind(this);
- this.handleOnDragEnd = this.handleOnDragEnd.bind(this);
- this.handleDeleteItem = this.handleDeleteItem.bind(this);
- this.handleDeleteAllItems = this.handleDeleteAllItems.bind(this);
- this.handleMouseEnterItem = this.handleMouseEnterItem.bind(this);
- this.handleMouseLeaveItem = this.handleMouseLeaveItem.bind(this);
- this.handleClickAddItem = this.handleClickAddItem.bind(this);
- this.checkAlerts = this.checkAlerts.bind(this);
- this.handleClickSelectItem = this.handleClickSelectItem.bind(this);
- this.handleClickSubmit = this.handleClickSubmit.bind(this);
- this.handleToggleOverlayRemove = this.handleToggleOverlayRemove.bind(this);
- this.handleShowOverlayRemove = this.handleShowOverlayRemove.bind(this);
- this.handleClickToggleMobileSideMenu = this.handleClickToggleMobileSideMenu.bind(this);
- this.handleClickCloseRFQFeedback = this.handleClickCloseRFQFeedback.bind(this);
- this.handleClickShowOrder = this.handleClickShowOrder.bind(this);
- this.handleClickOpenImport = this.handleClickOpenImport.bind(this);
- this.handleLoadCustomConf = this.handleLoadCustomConf.bind(this);
- this.handleCardsUpdated = this.handleCardsUpdated.bind(this);
-
- this.timer = null;
- this.timer_remove = null;
- }
-
- componentDidMount() {
- const source = {
- droppableId: 'backlog',
- indexes: [
- itemsUnfoldedList.findIndex(element => element === "eem_pwr_mod"),
- itemsUnfoldedList.findIndex(element => element === "kasli")
- ],
- };
- const destination = {
- droppableId: 'cart',
- index: 0,
- };
-
- this.handleOnDragEnd({
- source,
- destination
- });
- }
-
- componentDidUpdate(prevProps, prevState) {
- /**
- * We check alerts (reminder + warning) only when items inside crate or
- * crate mode change.
- *
- * In the function checkAlerts, we DO NOT want to change items as we will
- * trigger again this function (componentDidUpdate) and thus,
- * making an infinite loop.
- */
- if (
- (prevState.columns.cart.items !== this.state.columns.cart.items) ||
- (prevState.currentMode !== this.state.currentMode)
- ) {
- this.checkAlerts(this.state.columns.cart.items);
- }
-
- if (this.state.newCardJustAdded) {
- this.timer = setTimeout(() => {
- this.setState({
- newCardJustAdded: false,
- });
- }, 2000);
- }
- }
-
- componentWillUnmount() {
- clearTimeout(this.timer);
- }
-
- handleCardsUpdated() {
- this.checkAlerts(this.state.columns.cart.items);
- }
-
- handleCrateModeChange(mode) {
- this.setState({
- currentMode: mode,
- });
- }
-
- handleDeleteItem(index) {
- let cloned = Array.from(this.state.columns.cart.items);
- let cloned_data = Array.from(this.state.columns.cart.itemsData);
- cloned.splice(index, 1);
- cloned_data.splice(index, 1);
-
- this.setState({
- ...this.state,
- columns: {
- ...this.state.columns,
- cart: {
- ...this.state.columns.cart,
- items: cloned,
- itemsData: cloned_data,
- },
- },
- });
- }
-
- handleDeleteAllItems() {
- this.setState({
- ...this.state,
- columns: {
- ...this.state.columns,
- cart: {
- ...this.state.columns.cart,
- items: [],
- itemsData: []
- },
- },
- });
- }
-
- handleMouseEnterItem(id) {
- this.setState({
- ...this.state,
- currentItemHovered: id,
- });
- }
-
- handleMouseLeaveItem() {
- this.setState({
- ...this.state,
- currentItemHovered: null,
- });
- }
-
- handleClickAddItem(index, tap) {
- const source = {
- droppableId: 'backlog',
- index: index,
- };
- const destination = {
- droppableId: 'cart',
- index: this.state.columns.cart.items.length,
- };
-
- this.handleOnDragEnd({
- source,
- destination
- }, tap);
- }
-
- handleClickSelectItem(index) {
- const itemsCloned = Array.from(this.state.columns.cart.items);
-
- this.setState({
- ...this.state,
- columns: {
- ...this.state.columns,
- cart: {
- ...this.state.columns.cart,
- items: itemsCloned.map((item, id) => {
- return {...item, selected: id === index ? true : false};
- }),
- }
- },
- });
- }
-
- handleToggleOverlayRemove(index, show) {
- const itemsCloned = Array.from(this.state.columns.cart.items);
-
- this.setState({
- ...this.state,
- columns: {
- ...this.state.columns,
- cart: {
- ...this.state.columns.cart,
- items: itemsCloned.map((item, id) => {
- return {
- ...item,
- showOverlayRemove: id === index ? show : false
- };
- }),
- }
- },
- });
- }
-
- handleShowOverlayRemove(index) {
- if (this.timer_remove)
- clearTimeout(this.timer_remove);
-
- this.handleToggleOverlayRemove(index, true);
-
- this.timer_remove = setTimeout(() => {
- this.handleToggleOverlayRemove(index, false);
- }, 2000);
- }
-
- handleClickShowOrder() {
- const crate = {
- items: [],
- type: this.state.currentMode,
- };
- const clonedCart = Array.from(this.state.columns.cart.items);
- const clonedCartData = Array.from(this.state.columns.cart.itemsData);
- for (const i in clonedCart) {
- const item = clonedCart[i];
- const item_data = clonedCartData[i];
- crate.items.push({
- 'pn': item.name_number,
- 'options': (item_data.options_data && item_data.options) ? FilterOptions(item_data.options, item_data.options_data) : null,
- });
- }
-
- this.setState({
- isProcessing: false,
- shouldShowRFQFeedback: true,
- RFQBodyType: 'show',
- RFQBodyOrder: JSON.stringify(crate, null, 2),
- });
- }
-
- handleClickOpenImport() {
- this.setState({
- isProcessing: false,
- shouldShowRFQFeedback: true,
- RFQBodyType: 'import',
- });
- }
-
- handleLoadCustomConf(customconf) {
- if (!customconf) {return; }
-
- const items = this.props.data.items;
-
- let new_items = [];
- let new_items_data = [];
-
-
- this.setState({
- ...this.state,
- columns: {
- ...this.state.columns,
- cart: {
- ...this.state.columns.cart,
- items: [],
- },
- },
- }, function () {
-
- customconf.items.map(function (item) {
- Object.keys(items).map(key => {
- if (item.pn && item.pn === items[key].name_number) {
- new_items.push(Object.assign({
- ...items[key],
- }, {
- id: uuidv4(),
- options_data: item.options ? item.options : null,
- }));
- new_items_data.push({options_data: item.options ? item.options : null});
- }
- });
-
- return item;
- });
-
- this.setState({
- ...this.state,
- columns: {
- ...this.state.columns,
- cart: {
- ...this.state.columns.cart,
- items: new_items,
- itemsData: new_items_data,
- },
- },
- currentMode: customconf.type,
- });
- });
- }
-
- handleClickSubmit(note, email) {
- const crate = {
- items: [],
- type: this.state.currentMode,
- };
- const clonedCart = Array.from(this.state.columns.cart.items);
- const clonedCartData = Array.from(this.state.columns.cart.itemsData);
- for (const i in clonedCart) {
- const item = clonedCart[i];
- const item_data = clonedCartData[i];
- crate.items.push({
- 'pn': item.name_number,
- 'options': (item_data.options_data && item_data.options) ? FilterOptions(item_data.options, item_data.options_data) : null,
- });
- }
-
- const {data} = this.props;
-
- this.setState({isProcessing: true});
-
- fetch(data.API_RFQ, {
- method: "POST",
- headers: {'Content-Type': 'application/json'},
- body: JSON.stringify({
- email,
- note,
- configuration: JSON.stringify(crate)
- })
- }).then(response => {
- if (response.status !== 200) {
- throw Error("Response status is not OK: " + response.status + ".\n" + response);
- }
- this.setState({
- isProcessing: false,
- shouldShowRFQFeedback: true,
- RFQBodyType: 'email',
- isProcessingComplete: true,
- });
- }).catch(err => {
- console.error("Request failed, reason:", err)
- this.setState({isProcessing: false}, () => {
- alert("We cannot receive your request. Try using the export by coping the configuration and send it to us at sales@m-labs.hk");
- });
- })
- }
-
- handleOnDragEnd(result, newAdded) {
- const {
- source,
- destination,
- } = result;
- let dragged_items = [];
- if (source.indexes) {
- source.indexes.forEach((card_index, _) => {
- dragged_items.push(itemsUnfoldedList[card_index]);
- })
- } else if (source.index >= 0) {
- dragged_items.push(itemsUnfoldedList[source.index]);
- }
-
-
- if (!destination) {
- if (source.droppableId === 'cart') {
- this.setState({
- ...this.state,
- newCardJustAdded: false,
- columns: {
- ...this.state.columns,
- [source.droppableId]: {
- ...this.state.columns[source.droppableId],
- items: remove(
- this.state.columns[source.droppableId].items,
- source.index,
- ),
- itemsData: remove(
- this.state.columns[source.droppableId].itemsData,
- source.index,
- )
- },
- },
- });
- }
-
- return;
- }
-
- switch(source.droppableId) {
-
- case 'backlog':
- if (source.droppableId !== destination.droppableId) {
- this.setState({
- ...this.state,
- newCardJustAdded: newAdded ? true : false,
- columns: {
- ...this.state.columns,
- [destination.droppableId]: {
- ...this.state.columns[destination.droppableId],
- items: copy(
- this.state.items,
- this.state.columns[source.droppableId],
- this.state.columns[destination.droppableId],
- dragged_items,
- destination,
- ),
- },
- },
- });
- }
- break;
-
- case destination.droppableId:
- this.setState({
- ...this.state,
- newCardJustAdded: false,
- columns: {
- ...this.state.columns,
- [destination.droppableId]: {
- ...this.state.columns[destination.droppableId],
- items: reorder(
- this.state.columns[destination.droppableId].items,
- source.index,
- destination.index,
- ),
- itemsData: reorder(
- this.state.columns[destination.droppableId].itemsData,
- source.index,
- destination.index,
- ),
- },
- },
- });
- break;
-
- default:
- break;
- }
- }
-
- handleClickToggleMobileSideMenu() {
- this.setState({
- ...this.state,
- mobileSideMenuShouldOpen: !this.state.mobileSideMenuShouldOpen,
- });
- }
-
- handleClickCloseRFQFeedback() {
- this.setState({
- shouldShowRFQFeedback: false,
- });
- }
-
- checkAlerts(newItems) {
- console.log('--- START CHECKING CRATE WARNING ---');
-
- const {
- currentMode,
- crateModeSlots,
- crateRules,
- } = this.state;
-
- const itemsCloned = Array.from(newItems);
- const itemsData = [];
- const rules = {};
-
- itemsCloned.forEach((elem, idx) => {
- if (!(idx in itemsData)) itemsData[idx] = elem;
- if (idx in this.state.columns.cart.itemsData && this.state.columns.cart.itemsData[idx].options_data) {
- itemsCloned[idx].options_data = this.state.columns.cart.itemsData[idx].options_data;
- }
- itemsData[idx].warnings = {};
- });
-
-
- // check number of slot in crate
- const nbrOccupied = nbrOccupiedSlotsInCrate(newItems);
- if (nbrOccupied > crateModeSlots[currentMode]) {
- rules[crateRules.maxSlot.type] = {...crateRules.maxSlot};
- } else if (crateModeSlots[currentMode] === 21 && nbrOccupied <= 10) {
- rules[crateRules.compactSlot.type] = {...crateRules.compactSlot};
- }
-
-
- // check the number of EEM connectors available for all Kasli
- const idxK = itemsCloned.reduce((prev, next, i) => {
- if (next.type === 'kasli' || next.type === 'vhdcicarrier') {
- prev.push(i);
- }
- return prev;
- }, []);
- for (let i = 0; i <= idxK.length - 1; i++) {
- let slots;
- let nbUsedSlot = 0;
- let nbrCurrentClock = 0;
- let idx = idxK[i];
-
- if (i !== idxK.length - 1) {
- slots = itemsCloned.slice(idx + 1, idxK[i + 1]);
- } else {
- slots = itemsCloned.slice(idx + 1);
- }
-
- if (i == 0) {
- const slots_need_resource = itemsCloned.slice(0, idx);
- const idx_need = slots_need_resource.findIndex(e => (e.rules && e.rules.resources));
-
- if (idx_need != -1) {
- if (idx_need in itemsData) {
- if ('warnings' in itemsData[idx_need]) {
- itemsData[idx_need].warnings.resources = {...itemsCloned[idx_need].rules.resources};
- } else {
- itemsData[idx_need].warnings = {};
- itemsData[idx_need].warnings.resources = {...itemsCloned[idx_need].rules.resources};
- }
- } else {
- itemsData[idx_need] = {...itemsCloned[idx_need]};
- itemsData[idx_need].warnings = {};
- itemsData[idx_need].warnings.resources = {...itemsCloned[idx_need].rules.resources};
- }
- }
- }
-
- const process_slots = (item) => {
- if (!item.options_data
- || item.options_data.ext_pwr === false
- || item.options_data.mono_eem === false
- )
- return item.slotOccupied;
- else if (item.options_data.ext_pwr === true)
- return 0;
- else if (item.options_data.mono_eem === true || item.options_data.n_eem === "1 EEM")
- return 1;
- else if (item.options_data.n_eem === "3 EEM")
- return 3;
-
- return item.slotOccupied;
- }
-
- nbUsedSlot = slots
- .filter(item => item.type !== 'idc-bnc')
- .reduce((prev, next) => {
- return prev + process_slots(next);
- }, 0);
-
- nbrCurrentClock = slots
- .reduce((prev, next) => {
- return next.type === 'clocker' ? prev + ((next.options_data && next.options_data.ext_clk === true) ? 0 : next.clockOccupied) : prev;
- }, 0);
-
- if (idx in itemsData) {
- itemsData[idx].nbrCurrentSlot = nbUsedSlot;
- itemsData[idx].nbrCurrentClock = nbrCurrentClock;
- if (!('warnings' in itemsData[idx])) {
- itemsData[idx].warnings = {};
- }
- } else {
- itemsData[idx] = {...itemsCloned[idx]};
- itemsData[idx].nbrCurrentSlot = nbUsedSlot;
- itemsData[idx].nbrCurrentClock = nbrCurrentClock;
- itemsData[idx].warnings = {};
- }
-
- if (nbUsedSlot > itemsCloned[idx].nbrSlotMax) {
- if (itemsCloned[idx].rules.maxSlot.message) {
- rules[itemsCloned[idx].rules.maxSlot.type] = {...itemsCloned[idx].rules.maxSlot};
- }
- itemsData[idx].warnings.maxSlotWarning = {...itemsCloned[idx].rules.maxSlotWarning};
- }
-
- if (nbrCurrentClock > itemsCloned[idx].nbrClockMax) {
- rules[itemsCloned[idx].rules.maxClock.type] = {...itemsCloned[idx].rules.maxClock};
- itemsData[idx].warnings.maxClockWarning = {...itemsCloned[idx].rules.maxClockWarning};
- }
-
- if (itemsCloned.length > (idx + 1)) {
- const ddkali = itemsCloned[idx + 1];
- if (ddkali.type === 'kasli' || ddkali.type === 'vhdcicarrier') {
- rules[ddkali.rules.follow.type] = {...ddkali.rules.follow};
- }
- }
- }
-
- if (idxK.length === 0) {
- const slots_need_resource = itemsCloned.slice(0);
- const idx_need = slots_need_resource.findIndex(e => (e.rules && e.rules.resources));
-
- if (idx_need != -1) {
- if (idx_need in itemsData) {
- if ('warnings' in itemsData[idx_need]) {
- itemsData[idx_need].warnings.resources = {...itemsCloned[idx_need].rules.resources};
- } else {
- itemsData[idx_need].warnings = {};
- itemsData[idx_need].warnings.resources = {...itemsCloned[idx_need].rules.resources};
- }
- } else {
- itemsData[idx_need] = {...itemsCloned[idx_need]};
- itemsData[idx_need].warnings = {};
- itemsData[idx_need].warnings.resources = {...itemsCloned[idx_need].rules.resources};
- }
- }
- }
-
-
- // check number of clock connector available
- const idxC = itemsCloned.reduce((prev, next, i) => {
- if (next.type === 'kasli' || next.type === 'clocker') {
- prev.push(i);
- }
- return prev;
- }, []);
- for (let i = 0; i <= idxC.length - 1; i++) {
- let slots;
- let nbrCurrentClock = 0;
- let idx = idxC[i];
-
- if (i !== idxC.length - 1) {
- slots = itemsCloned.slice(idx + 1, idxC[i + 1]);
- } else {
- slots = itemsCloned.slice(idx + 1);
- }
-
- nbrCurrentClock = slots.reduce((prev, next) => {
- return prev + ((next.options_data && next.options_data.ext_clk && next.options_data.ext_clk.checked) ? 0 : next.clockOccupied);
- }, 0);
-
- if (idx in itemsData) {
- if (itemsData[idx].nbrCurrentClock && itemsData[idx].type !== "clocker") {
- itemsData[idx].nbrCurrentClock += nbrCurrentClock;
- } else {
- itemsData[idx].nbrCurrentClock = nbrCurrentClock;
- }
- } else {
- itemsData[idx] = {...itemsCloned[idx]};
- itemsData[idx].nbrCurrentClock = nbrCurrentClock;
- itemsData[idx].warnings = {};
- }
-
- if (nbrCurrentClock > itemsCloned[idx].nbrClockMax) {
- rules[itemsCloned[idx].rules.maxClock.type] = {...itemsCloned[idx].rules.maxClock};
- itemsData[idx].warnings.maxClockWarning = {...itemsCloned[idx].rules.maxClockWarning};
- }
- }
-
-
- if (itemsCloned.find(elem => elem.type === 'urukul')) {
- if (this.state.items['urukul'].rules.info) {
- rules[this.state.items['urukul'].rules.info.type] = {...this.state.items['urukul'].rules.info};
- }
- }
-
-
- // check if IDC-BNC is correctly positionned (after Zotino or HD68)
- const idxIDCBNC = itemsCloned.reduce((prev, next, i) => {
- if (next.type === 'idc-bnc') {
- prev.push(i);
- }
- return prev;
- }, []);
- for (var i = idxIDCBNC.length - 1; i >= 0; i--) {
- const ce = idxIDCBNC[i];
- let shouldWarning = false;
-
- if (ce == 0) {
- shouldWarning = true;
- } else if (ce >= 1) {
- const pe = idxIDCBNC[i] - 1;
- if (itemsCloned[pe].type !== 'zotino' &&
- itemsCloned[pe].type !== 'hd68' &&
- itemsCloned[pe].type !== 'idc-bnc') {
- shouldWarning = true;
- }
- }
-
- if (shouldWarning) {
- itemsData[ce] = {...itemsCloned[ce]};
- itemsData[ce].warnings = {};
- itemsData[ce].warnings.wrong = {...itemsCloned[ce].rules.wrong};
- }
- }
-
-
- // check number of IDC-BNC adapters for a Zotino and HD68-IDC
- const idxZH = itemsCloned.reduce((prev, next, i) => {
- if (next.type === 'zotino' || next.type === 'hd68') {
- prev.push(i);
- }
- return prev;
- }, []);
- for (let i = 0; i <= idxZH.length - 1; i++) {
- let slots;
- let nbUsedSlot = 0;
- let idx = idxZH[i];
-
- if (i !== idxZH.length - 1) {
- slots = itemsCloned.slice(idx + 1, idxZH[i + 1]);
- } else {
- slots = itemsCloned.slice(idx + 1);
- }
-
- let stopCount = false;
- nbUsedSlot = slots.reduce((prev, next, ci, ca) => {
- if (ci === 0 && next.type === 'idc-bnc') {
- return prev + 1;
- } else if (ca[0].type === 'idc-bnc' && ci > 0 && ca[ci - 1].type === 'idc-bnc') {
- if (next.type !== 'idc-bnc') { stopCount = true; }
- return prev + (next.type === 'idc-bnc' && !stopCount ? 1 : 0);
- }
- return prev;
- }, 0);
-
- if (idx in itemsData) {
- itemsData[idx].nbrCurrentSlot = nbUsedSlot;
- if (!('warnings' in itemsData[idx])) {
- itemsData[idx].warnings = {};
- }
- } else {
- itemsData[idx] = {...itemsCloned[idx]};
- itemsData[idx].nbrCurrentSlot = nbUsedSlot;
- itemsData[idx].warnings = {};
- }
-
- if (nbUsedSlot > 0) {
- if (itemsCloned[idx].rules.maxSlot.message) {
- rules[itemsCloned[idx].rules.maxSlot.type] = {...itemsCloned[idx].rules.maxSlot};
- }
- }
- if (nbUsedSlot > itemsCloned[idx].nbrSlotMax) {
- itemsData[idx].warnings.maxSlotWarning = {...itemsCloned[idx].rules.maxSlotWarning};
- }
-
- // check if HD68-IDC has at least 1 IDC-BNC adapter
- if (itemsCloned[idx].type === 'hd68') {
- let shouldWarning = false;
-
- if (idx < itemsCloned.length - 1) {
- if (itemsCloned[idx + 1].type !== 'idc-bnc') {
- shouldWarning = true;
- }
- } else if (idx === itemsCloned.length - 1) {
- shouldWarning = true;
- }
-
- if (shouldWarning) {
- if (idx in itemsData) {
- itemsData[idx].warnings.minAdapter = {...itemsCloned[idx].rules.minAdapter};
- } else {
- itemsData[idx] = {...itemsCloned[idx]};
- itemsData[idx].warnings = {};
- itemsData[idx].warnings.minAdapter = {...itemsCloned[idx].rules.minAdapter};
- }
- }
- }
- }
-
- // update state with rules
- this.setState({
- ...this.state,
- columns: {
- ...this.state.columns,
- cart: {
- ...this.state.columns.cart,
- itemsData: itemsData,
- }
- },
- rules: {
- ...rules,
- },
- });
- }
-
- render() {
-
- const {
- currency,
- currentItemHovered,
- currentMode,
- crateModeSlots,
- crateModeItems,
- items,
- columns,
- rules,
- mobileSideMenuShouldOpen,
- newCardJustAdded,
- isProcessing,
- shouldShowRFQFeedback,
- RFQBodyType,
- RFQBodyOrder,
- isProcessingComplete,
- } = this.state;
-
- const isMobile = window.deviceIsMobile();
- const isTouch = window.isTouchEnabled();
-
- return (
-
-
-
-
- }
- main={(
- Drag and drop the cards you want into the crate below to see how the combination would look like. Setup card's configuration by tapping at the top of the card, most of the options can be modified after shipment. If you have any issues with this ordering system, or if you need other configurations, email us directly anytime at sales@m-labs.hk . The price is estimated and must be confirmed by a quote.
)}
- crateMode={
-
- }
- crate={
-
-
- }
- rules={Object.values(rules).filter(rule => rule)}>
-
- }
- summaryPrice={
-
-
- }
- form={
-
-
- }>
-
- )}>
-
-
-
- );
- }
-}
-
-createRoot(document.querySelector('#root-shop')).render( );
+createRoot(document.querySelector('#root-shop')).render( );
diff --git a/static/js/shop/Backlog.jsx b/static/js/shop/Backlog.jsx
new file mode 100644
index 0000000..2b14ff7
--- /dev/null
+++ b/static/js/shop/Backlog.jsx
@@ -0,0 +1,88 @@
+import React from 'react';
+import {Droppable} from "@hello-pangea/dnd";
+import {ProductItem} from "./ProductItem";
+import {useShopStore} from "./shop_store";
+// #!render_count
+import {useRenderCount} from "@uidotdev/usehooks";
+
+/**
+ * Component that renders the backlog in the aside
+ */
+export function Backlog() {
+ // #!render_count
+ const renderCount = useRenderCount();
+
+ const data = useShopStore((state) => state.groups);
+ const items = useShopStore((state) => state.cards);
+ const onClickToggleMobileSideMenu = useShopStore((state) => state.switchSideMenu);
+ const isMobile = useShopStore((state) => state.isMobile);
+
+ // #!render_count
+ console.log("Backlog renders: ", renderCount)
+
+ const ordered_groups = data.categories.map(groupItem => ({
+ name: groupItem.name,
+ items: groupItem.itemIds.map(itemId => items[itemId])
+ }));
+ let item_index = -1;
+ const groups = ordered_groups.map((group, g_index) => {
+ return (
+
+
+
+ {group.name}
+
+
+
+
+ {group.items.map(item => {
+ item_index++;
+ return (
+
+ )
+ })}
+
+
+
+ );
+ }
+ );
+
+ return (
+
+
+ {(provided) => (
+
+
+ {isMobile ? (
+
+
+
+
+
+ ) : null}
+
+
+ {groups}
+
+
+ {provided.placeholder && (
+
+ {provided.placeholder}
+
+ )}
+
+ )}
+
+
+ );
+
+}
\ No newline at end of file
diff --git a/static/js/shop/CardWarnings.jsx b/static/js/shop/CardWarnings.jsx
new file mode 100644
index 0000000..c2707b4
--- /dev/null
+++ b/static/js/shop/CardWarnings.jsx
@@ -0,0 +1,46 @@
+import {OverlayTrigger} from "react-bootstrap";
+import React from "react";
+import {Levels, MaxLevel} from "./warnings";
+import {useShopStore} from "./shop_store";
+import {compareArraysLevelOne} from "./utils";
+
+
+export function CardWarnings({crate_index, card_index}) {
+
+ const warnings = useShopStore(state => state.crates[crate_index].items[card_index].show_warnings, compareArraysLevelOne);
+
+ const max_level = MaxLevel(warnings);
+ return (
+ (
+
+ {warnings.map((warning, _i) => {
+ return (
+
+ {warning.message}
+
+ )
+ })}
+
)
+ }
+ rootClose
+ >
+
+
+ )
+}
+
+export function WarningIndicator({crate_index, card_index}) {
+ const warnings = useShopStore(state => state.crates[crate_index].items[card_index].show_warnings, compareArraysLevelOne);
+
+ const max_level = MaxLevel(warnings);
+ return max_level.priority === Levels.warning.priority ? (
+
+ ) : ( );
+}
\ No newline at end of file
diff --git a/static/js/shop/Cart.jsx b/static/js/shop/Cart.jsx
new file mode 100644
index 0000000..fcc0aaa
--- /dev/null
+++ b/static/js/shop/Cart.jsx
@@ -0,0 +1,73 @@
+import React from 'react'
+import {Droppable} from "@hello-pangea/dnd";
+import {cartStyle, compareArraysWithIds} from "./utils";
+import {ProductCartItem} from "./ProductCartItem";
+import {FakePlaceholder} from "./FakePlaceholder";
+import {FillExtData} from "./options/utils";
+import {hp_to_slots} from "./count_resources";
+import {useShopStore} from "./shop_store";
+
+// #!render_count
+import {useRenderCount} from "@uidotdev/usehooks";
+
+/**
+ * Component that displays a list of
+ */
+export function Cart({crate_index}) {
+ // #!render_count
+ const renderCount = useRenderCount();
+
+ const crate = useShopStore((state) => state.crates[crate_index], (a, b) => {
+ return compareArraysWithIds(a.items, b.items) && a.occupiedHP === b.occupiedHP && a.crate_mode === b.crate_mode
+ });
+ const crateParams = useShopStore((state) => state.crateParams);
+
+ // #!render_count
+ console.log("Cart renders: ", renderCount)
+
+ const nbrOccupied = hp_to_slots(crate.occupiedHP);
+ const nbrSlots = hp_to_slots(crateParams(crate.crate_mode).hp);
+
+ const products = crate.items.map((item, index) => {
+ const ext_data = FillExtData(crate.items, index);
+ return (
+ = nbrSlots}
+ key={item.id}/>
+ );
+ });
+
+ return (
+
+
+ {(provided, snapshot) => (
+
+
+ {products}
+
+ {provided.placeholder && (
+
+ {provided.placeholder}
+
+ )}
+
+
+
+ )}
+
+
+ );
+}
\ No newline at end of file
diff --git a/static/js/shop/Crate.jsx b/static/js/shop/Crate.jsx
new file mode 100644
index 0000000..a771a1f
--- /dev/null
+++ b/static/js/shop/Crate.jsx
@@ -0,0 +1,50 @@
+import React from 'react';
+import {Cart} from "./Cart";
+import {CrateMode} from "./CrateMode";
+import {CrateWarnings} from "./CrateWarnings";
+import {useShopStore} from "./shop_store";
+
+// #!render_count
+import {useRenderCount} from "@uidotdev/usehooks";
+
+
+/**
+ * Component that displays the main crate with reminder rules.
+ * It includes and rules
+ */
+export function Crate({crate_index}) {
+ // #!render_count
+ const renderCount = useRenderCount();
+
+ const crate = useShopStore((state) => state.crates[crate_index],
+ (a, b) => a.length === b.length && a.id === b.id);
+ const modes_order = useShopStore((state) => state.modes_order);
+ const onDeleteCrate = useShopStore((state) => state.delCrate);
+
+ // #!render_count
+ console.log("Crate renders: ", renderCount)
+
+ return (
+
+ {
+ modes_order.includes(crate.crate_mode) ? (
+
+
+
+ onDeleteCrate(crate.id)}>
+ Delete crate
+
+
+ ) : <>>
+ }
+
+
+
+
+
+
+
+
+ );
+
+}
\ No newline at end of file
diff --git a/static/js/shop/CrateList.jsx b/static/js/shop/CrateList.jsx
new file mode 100644
index 0000000..a382351
--- /dev/null
+++ b/static/js/shop/CrateList.jsx
@@ -0,0 +1,45 @@
+import React from 'react'
+import {Accordion} from "react-bootstrap";
+import {Crate} from "./Crate";
+import {useShopStore} from "./shop_store";
+
+// #!render_count
+import {useRenderCount} from "@uidotdev/usehooks";
+
+export function CrateList() {
+ // #!render_count
+ const renderCount = useRenderCount();
+
+ const crates = useShopStore((state) => state.crates,
+ (a, b) => a.length === b.length);
+ const active_crate = useShopStore((state) => state.active_crate);
+ const onAddCrate = useShopStore((state) => state.newCrate);
+ const setActiveCrate = useShopStore((state) => state.setActiveCrate);
+
+ const onSelectHandler = (e) => {
+ // if e === null, that means that an accordion item was collapsed rather than expanded. e will be non-null when an item is expanded
+ if (e !== null)
+ setActiveCrate(e);
+ else
+ setActiveCrate("")
+ };
+
+ // #!render_count
+ console.log("CrateList renders: ", renderCount)
+ return (
+
+ {crates.map((crate, index) =>
+
+ {crate.name ? crate.name : <>Crate #{`${index}`}>}
+
+
+
+
+ )}
+
+
+ Add new crate
+
+
+ )
+}
\ No newline at end of file
diff --git a/static/js/shop/CrateMode.jsx b/static/js/shop/CrateMode.jsx
new file mode 100644
index 0000000..b8b7e37
--- /dev/null
+++ b/static/js/shop/CrateMode.jsx
@@ -0,0 +1,35 @@
+import React from 'react';
+import {useShopStore} from "./shop_store";
+
+// #!render_count
+import {useRenderCount} from "@uidotdev/usehooks";
+
+/**
+ * Component that displays crate modes
+ */
+export function CrateMode({crate_index}) {
+ // #!render_count
+ const renderCount = useRenderCount();
+
+ const modes_order = useShopStore((state) => state.modes_order);
+ const crate_modes = useShopStore((state) => state.crate_modes);
+ const crate = useShopStore((state) => state.crates[crate_index],
+ (a, b) => a.id === b.id && a.crate_mode === b.crate_mode);
+ const setMode = useShopStore((state) => state.setCrateMode);
+
+ // #!render_count
+ console.log("CrateMode renders: ", renderCount)
+
+ return (
+
+ );
+}
\ No newline at end of file
diff --git a/static/js/shop/CrateWarnings.jsx b/static/js/shop/CrateWarnings.jsx
new file mode 100644
index 0000000..3c8e3fb
--- /dev/null
+++ b/static/js/shop/CrateWarnings.jsx
@@ -0,0 +1,27 @@
+import React from "react";
+import {LevelUI} from "./warnings";
+import {useShopStore} from "./shop_store";
+import {compareArraysWithIds} from "./utils";
+
+// #!render_count
+import {useRenderCount} from "@uidotdev/usehooks";
+
+
+export function CrateWarnings({crate_index}) {
+ // #!render_count
+ const renderCount = useRenderCount();
+
+ const crate_warnings = useShopStore(state => (state.crates[crate_index].warnings), compareArraysWithIds)
+
+ // #!render_count
+ console.log("CrateWarnings renders: ", renderCount)
+ return (
+
+ {crate_warnings.map((rule, index) => (
+
+ {rule.message}
+
+ ))}
+
+ )
+}
\ No newline at end of file
diff --git a/static/js/shop/FakePlaceholder.jsx b/static/js/shop/FakePlaceholder.jsx
new file mode 100644
index 0000000..00f1a34
--- /dev/null
+++ b/static/js/shop/FakePlaceholder.jsx
@@ -0,0 +1,27 @@
+import React from 'react';
+
+/**
+ * Component that displays a placeholder inside crate.
+ * Allows to display how it remains space for the current crate.
+ */
+export function FakePlaceholder({isDraggingOver, nToDraw}) {
+ const fakePlaceholder = [];
+
+ for (let i = nToDraw; i > 0; i--) {
+ fakePlaceholder.push(
+
+ );
+ }
+
+ return (
+
+ {fakePlaceholder}
+
+ );
+
+}
diff --git a/static/js/shop/ImportJSON.jsx b/static/js/shop/ImportJSON.jsx
new file mode 100644
index 0000000..4c0a2c4
--- /dev/null
+++ b/static/js/shop/ImportJSON.jsx
@@ -0,0 +1,101 @@
+import {useShopStore} from "./shop_store";
+import {useClickAway} from "./options/useClickAway";
+import {Modal} from "react-bootstrap";
+import React from "react";
+import {Validation} from "./validate";
+// #!render_count
+import {useRenderCount} from "@uidotdev/usehooks";
+
+const JSONExample = JSON.stringify({
+ "crates": [
+ {
+ "items": [
+ {
+ "pn": "1124",
+ "options": null
+ },
+ {
+ "pn": "2128",
+ "options": null
+ },
+ {
+ "pn": "2128",
+ "options": null
+ },
+ {
+ "pn": "2128",
+ "options": null
+ }
+ ],
+ "type": "rack"
+ },
+ {
+ "items": [],
+ "type": "no_crate"
+ }
+ ]
+});
+
+export function ImportJSON() {
+ // #!render_count
+ const renderCount = useRenderCount();
+
+ const shouldShow = useShopStore((state) => state.importShouldOpen);
+ const data = useShopStore((state) => state.importValue);
+ const loadDescription = useShopStore((state) => state.loadDescription);
+ const updateImportDescription = useShopStore((state) => state.updateImportDescription);
+ const closeImport = useShopStore((state) => state.closeImport);
+ const showImport = useShopStore((state) => state.openImport);
+
+ // #!render_count
+ console.log("ImportJSON renders: ", renderCount)
+
+ const ref = useClickAway((e) => {
+ if (e.type === "mousedown") // ignore touchstart
+ closeImport()
+ }
+ );
+
+ return (<>
+ Import JSON
+
+
+
+
+
+ Input the JSON description below. Should be something like:
+
+ {JSONExample}
+
+
+
+
+ {
+ updateImportDescription(event.target.value)
+ }}
+ value={data.value}
+ className="form-control w-100"
+ rows="5"
+ placeholder="Input JSON description here."/>
+
+ {data.error !== Validation.OK ? (
+
+
{data.error === Validation.Empty ? "Empty input" : "Invalid JSON"}
+
+ ) : null}
+
+
+
+
+ >)
+}
\ No newline at end of file
diff --git a/static/js/shop/Layout.jsx b/static/js/shop/Layout.jsx
new file mode 100644
index 0000000..048e76d
--- /dev/null
+++ b/static/js/shop/Layout.jsx
@@ -0,0 +1,46 @@
+import React from 'react';
+import {useShopStore} from "./shop_store";
+
+// #!render_count
+import {useRenderCount} from "@uidotdev/usehooks";
+
+/**
+ * Component that provides a base layout (aside/main) for the page.
+ */
+
+
+export function Layout({aside, main}) {
+ // #!render_count
+ const renderCount = useRenderCount();
+
+ const mobileSideMenuShouldOpen = useShopStore(state => state.sideMenuIsOpen);
+ const onClickToggleMobileSideMenu = useShopStore(state => state.switchSideMenu);
+ const showCardAddedFeedback = useShopStore(state => state.showCardAddedFeedback);
+ const showNoDestination = useShopStore(state => state.showNoDestination);
+
+ // #!render_count
+ console.log("Layout renders: ", renderCount)
+
+ return (
+
+
+
+
+ {mobileSideMenuShouldOpen ? (
+
+ ) : (
+
+ )}
+
+ {showCardAddedFeedback ? (
+ !showNoDestination ?
+ (
+ ✓ added
+
)
+ : (
+ No cards added: all crates are closed
+
)
+ ) : null}
+
+ );
+}
diff --git a/static/js/shop/OptionsWrapper.jsx b/static/js/shop/OptionsWrapper.jsx
new file mode 100644
index 0000000..d5b1e55
--- /dev/null
+++ b/static/js/shop/OptionsWrapper.jsx
@@ -0,0 +1,56 @@
+import {DialogPopup} from "./options/DialogPopup";
+import React from "react";
+import {useShopStore} from "./shop_store";
+import {SummaryPopup} from "./options/SummaryPopup";
+
+export function OptionsDialogWrapper({crate_index, card_index, first, last}) {
+ const crate_id = useShopStore((state) => state.crates[crate_index].id);
+ const options = useShopStore((state) => state.crates[crate_index].items[card_index].options);
+ const options_data = useShopStore((state) => state.crates[crate_index].items[card_index].options_data);
+ const card_size = useShopStore((state) => state.crates[crate_index].items[card_index].size);
+ const card_id = useShopStore((state) => state.crates[crate_index].items[card_index].id);
+ const options_class = useShopStore((state) => state.crates[crate_index].items[card_index].options_class);
+ const sideMenuIsOpen = useShopStore((state) => state.sideMenuIsOpen);
+
+ const onOptionsUpdate = useShopStore((state) => state.updateOptions);
+
+ return (
+ {
+ // #!options_log
+ console.log("construct", outvar, value, options_data);
+
+ options_data[outvar] = value;
+ }),
+ update: ((outvar, value) => {
+ // #!options_log
+ console.log("update", outvar, value, options_data);
+
+ if (outvar in options_data) options_data[outvar] = value;
+ onOptionsUpdate(crate_id, card_index, {[outvar]: value});
+ })
+ }}
+ />
+ )
+}
+
+export function OptionsSummaryWrapper({crate_index, card_index}) {
+ const card_id = useShopStore((state) => state.crates[crate_index].items[card_index].id);
+ const options = useShopStore((state) => state.crates[crate_index].items[card_index].options);
+ const options_data = useShopStore((state) => state.crates[crate_index].items[card_index].options_data);
+
+ return (
+
+ )
+}
\ No newline at end of file
diff --git a/static/js/shop/OrderForm.jsx b/static/js/shop/OrderForm.jsx
new file mode 100644
index 0000000..49686f7
--- /dev/null
+++ b/static/js/shop/OrderForm.jsx
@@ -0,0 +1,75 @@
+import React from 'react'
+import {Validation} from "./validate.js";
+import {useShopStore} from "./shop_store";
+import {ShowJSON} from "./ShowJSON";
+
+// #!render_count
+import {useRenderCount} from "@uidotdev/usehooks";
+
+
+/**
+ * Components that renders the form to request quote.
+ */
+export function OrderForm() {
+ // #!render_count
+ const renderCount = useRenderCount();
+
+ const email = useShopStore((state) => state.email);
+ const note = useShopStore((state) => state.note);
+ const isProcessing = useShopStore((state) => state.isProcessing);
+ const updateEmail = useShopStore((state) => state.updateEmail);
+ const updateNote = useShopStore((state) => state.updateNote);
+ const submitForm = useShopStore((state) => state.submitForm);
+ const submitDisabled = useShopStore((state) => state.submitDisabled);
+ const resetEmailValidation = useShopStore((state) => state.resetEmailValidation);
+
+ // #!render_count
+ console.log("OrderForm renders: ", renderCount)
+
+ return (
+
+ );
+
+}
\ No newline at end of file
diff --git a/static/js/shop/OrderPanel.jsx b/static/js/shop/OrderPanel.jsx
new file mode 100644
index 0000000..51c6f89
--- /dev/null
+++ b/static/js/shop/OrderPanel.jsx
@@ -0,0 +1,56 @@
+import React from 'react'
+import {OrderSummary} from "./OrderSummary";
+import {OrderForm} from "./OrderForm";
+import {CrateList} from "./CrateList";
+import {useShopStore} from "./shop_store";
+import {ImportJSON} from "./ImportJSON";
+import {RFQFeedback} from "./RFQFeedback";
+
+// #!render_count
+import {useRenderCount} from "@uidotdev/usehooks";
+
+/**
+ * Component that renders all things for order.
+ * It acts like-a layout, this component do nothing more.
+ */
+export function OrderPanel({title, description}) {
+ // #!render_count
+ const renderCount = useRenderCount();
+ const isMobile = useShopStore((state) => state.isMobile);
+ const onClickToggleMobileSideMenu = useShopStore((state) => state.switchSideMenu);
+
+ // #!render_count
+ console.log("OrderPanel renders: ", renderCount)
+
+ return (
+
+ {title}
+
+
+ {description}
+
+
+
+
+
+
+
+
+ {isMobile ? (
+
+
+
+
+
+ ) : null}
+
+
+
+
+
+ );
+}
\ No newline at end of file
diff --git a/static/js/shop/OrderSummary.jsx b/static/js/shop/OrderSummary.jsx
new file mode 100644
index 0000000..7d63568
--- /dev/null
+++ b/static/js/shop/OrderSummary.jsx
@@ -0,0 +1,45 @@
+import React from 'react';
+import {useShopStore} from "./shop_store";
+import {SummaryCrates} from "./SummaryCrates";
+import {SummaryTotalPrice} from "./SummaryTotalPrice";
+
+// #!render_count
+import {useRenderCount} from "@uidotdev/usehooks";
+
+
+/**
+ * Components that displays the list of card that are used in the crate.
+ * It is a summary of purchase
+ */
+export function OrderSummary() {
+ // #!render_count
+ const renderCount = useRenderCount();
+
+ // #!render_count
+ console.log("OrderSummary renders: ", renderCount)
+
+ return (
+
+
+
+
+
+
+
+ Price estimate
+
+
+
+
+
+
+
+
+
+
+
+ );
+}
\ No newline at end of file
diff --git a/static/js/shop/ProductCartItem.jsx b/static/js/shop/ProductCartItem.jsx
new file mode 100644
index 0000000..39b7fc7
--- /dev/null
+++ b/static/js/shop/ProductCartItem.jsx
@@ -0,0 +1,115 @@
+import React from 'react'
+import {Draggable} from "@hello-pangea/dnd";
+import {compareObjectsEmptiness, productStyle} from "./utils";
+import {Resources} from "./Resources";
+import {CardWarnings} from "./CardWarnings";
+import {useShopStore} from "./shop_store";
+import {OptionsDialogWrapper} from "./OptionsWrapper";
+
+// #!render_count
+import {useRenderCount} from "@uidotdev/usehooks";
+
+/**
+ * Component that renders a product.
+ * Used in the crate
+ */
+export function ProductCartItem({card_index, crate_index, first, last}) {
+ // #!render_count
+ const renderCount = useRenderCount();
+
+
+ const card = useShopStore((state) => state.crates[crate_index].items[card_index],
+ (a, b) => a.id === b.id);
+
+ const card_show_warnings = useShopStore(state => state.crates[crate_index].items[card_index].show_warnings, compareObjectsEmptiness);
+ const card_counted_resources = useShopStore(state => state.crates[crate_index].items[card_index].counted_resources, compareObjectsEmptiness);
+
+ const highlighted = useShopStore((state) => state.crates[crate_index].id === state.highlighted.crate && card_index === state.highlighted.card);
+ const options_disabled = useShopStore((state) => !!state.crateParams(state.crates[crate_index].crate_mode).warnings_disabled);
+ const crate_id = useShopStore((state) => state.crates[crate_index].id);
+ const setHighlight = useShopStore((state) => state.highlightCard);
+ const removeHighlight = useShopStore((state) => state.highlightReset);
+ const onCardRemove = useShopStore((state) => state.deleteCard);
+
+ // #!render_count
+ console.log("ProductCartItem renders: ", renderCount)
+
+
+ const options = !options_disabled && card && card.options && card.options.length > 0;
+ const warnings = !options_disabled && card_show_warnings && card_show_warnings.length > 0;
+ const resources = !options_disabled && card_counted_resources && card_counted_resources.length > 0;
+
+ return (
+
+
+ {(provided, snapshot) => (
+ setHighlight(crate_id, card_index)}
+ onMouseLeave={removeHighlight}
+ >
+
+ {/* warning container */}
+
+
+ {warnings &&
+ ( )
+ }
+
+ {options && (
+
+ )}
+
+
+
{card.name_number}
+
+
setHighlight(crate_id, card_index)}
+ onClick={() => setHighlight(crate_id, card_index)}
+ >
+
+
+
+
+ {/* remove container */}
+
onCardRemove(crate_id, card_index)}>
+
+
+
+
Remove
+
+
+ {/* progression container */}
+ {resources && (
+
+ )}
+
+
+
+ )}
+
+
+ );
+}
diff --git a/static/js/shop/ProductItem.jsx b/static/js/shop/ProductItem.jsx
new file mode 100644
index 0000000..393af65
--- /dev/null
+++ b/static/js/shop/ProductItem.jsx
@@ -0,0 +1,92 @@
+import React from 'react';
+import {Draggable} from "@hello-pangea/dnd";
+import {formatMoney, productStyle} from "./utils";
+import {useShopStore} from "./shop_store";
+
+// #!render_count
+import {useRenderCount} from "@uidotdev/usehooks";
+
+/**
+ * Component that renders a product.
+ * Used in the aside (e.g backlog of product)
+ */
+export function ProductItem({card_index}) {
+ // #!render_count
+ const renderCount = useRenderCount();
+
+ const getCardDescription = useShopStore((state) => state.getCardDescription);
+ const currency = useShopStore((state) => state.currency);
+ const onAddCard = useShopStore((state) => state.addCardFromBacklog);
+ const card = getCardDescription(card_index);
+
+ // #!render_count
+ console.log("ProductItem renders: ", renderCount)
+
+
+ const render_specs = (card.specs && card.specs.length > 0 && (
+
+ {card.specs.map((spec, index) =>
+ {spec}
+ )}
+
+ ));
+
+ const render_datasheet_link = (card.datasheet_file && card.datasheet_name && (
+
+ ));
+
+ return (
+
+
+
+
{card.name}
+ {card.name_codename ? (
+
{card.name_codename}
+ ) : null}
+
+
{`${currency} ${formatMoney(card.price)}`}
+
+ {render_specs}
+
+ {render_datasheet_link}
+
+
+
+
+
onAddCard(null, card_index, null)}>
+
+
+
+
+ {(provided, snapshot) => (
+
+
+
+ {/* Allows to simulate a clone */}
+ {snapshot.isDragging && (
+
+ )}
+
+ )}
+
+
+
+
+
+ );
+
+}
\ No newline at end of file
diff --git a/static/js/shop/RFQFeedback.jsx b/static/js/shop/RFQFeedback.jsx
new file mode 100644
index 0000000..f7ca108
--- /dev/null
+++ b/static/js/shop/RFQFeedback.jsx
@@ -0,0 +1,42 @@
+import {useShopStore} from "./shop_store";
+import {useClickAway} from "./options/useClickAway";
+import {Modal} from "react-bootstrap";
+import {Validation} from "./validate";
+import React from "react";
+// #!render_count
+import {useRenderCount} from "@uidotdev/usehooks";
+
+export function RFQFeedback() {
+ // #!render_count
+ const renderCount = useRenderCount();
+
+ const closeRFQ = useShopStore((state) => state.closeRFQFeedback);
+ const shouldShow = useShopStore((state) => state.shouldShowRFQFeedback);
+ const status = useShopStore((state) => state.processingResult);
+
+ // #!render_count
+ console.log("RFQFeedback renders: ", renderCount)
+
+ const ref = useClickAway((e) => {
+ if (e.type === "mousedown") // ignore touchstart
+ closeRFQ()
+ });
+
+ return (
+
+
+
+
+ {status.status === Validation.OK ?
+
+ :
+ }
+
+
+ {status.message}
+
+
+
+
+ )
+}
\ No newline at end of file
diff --git a/static/js/shop/Resources.jsx b/static/js/shop/Resources.jsx
new file mode 100644
index 0000000..6148687
--- /dev/null
+++ b/static/js/shop/Resources.jsx
@@ -0,0 +1,99 @@
+import {OverlayTrigger} from "react-bootstrap";
+import React from "react";
+import {v4 as uuidv4} from "uuid";
+
+// #!render_count
+import {useRenderCount} from "@uidotdev/usehooks";
+import {useShopStore} from "./shop_store";
+import {compareArraysLevelOne} from "./utils";
+
+
+const resourcesWidthStyle = (occupied, max) => {
+ return {
+ width: `${Math.min(occupied * 100 / max, 100)}%`,
+ }
+};
+
+function EEMRenderer({occupied, max}) {
+ return (
+
+ )
+}
+
+function ClockRenderer({occupied, max}) {
+ return (
+
+ )
+}
+
+const resource_progress_renderers = {
+ "eem": EEMRenderer,
+ "clk": ClockRenderer,
+ "idc": EEMRenderer
+}
+
+
+function EEMTipRender({occupied, max}) {
+ return ({`${occupied}/${max} EEM connectors used`}
);
+}
+
+function IDCTipRender({occupied, max}) {
+ return ({`${occupied}/${max} IDC connectors used`}
);
+}
+
+function ClockTipRender({occupied, max}) {
+ return ({`${occupied}/${max} clock connectors used`}
);
+}
+
+const resource_tip = {
+ "eem": EEMTipRender,
+ "clk": ClockTipRender,
+ "idc": IDCTipRender
+}
+
+function RenderResources({resources, library}) {
+ if (!resources) return null;
+ let result = [];
+
+ resources.forEach((value, _) => {
+ if (library[value.name]) result.push(library[value.name](value));
+ });
+
+ return result;
+}
+
+export function Resources({crate_index, card_index}) {
+ // #!render_count
+ const renderCount = useRenderCount();
+
+ const resources = useShopStore(state => state.crates[crate_index].items[card_index].counted_resources, compareArraysLevelOne);
+
+ // #!render_count
+ console.log("Resources renders: ", renderCount)
+ return (
+ (
+
+
+
+ )}
+ rootClose
+ >
+
+
+
+
+ )
+}
\ No newline at end of file
diff --git a/static/js/shop/Shop.jsx b/static/js/shop/Shop.jsx
new file mode 100644
index 0000000..7e5e63e
--- /dev/null
+++ b/static/js/shop/Shop.jsx
@@ -0,0 +1,71 @@
+import React, {useEffect} from 'react';
+import {DragDropContext} from "@hello-pangea/dnd";
+
+// #!render_count
+import {useRenderCount} from "@uidotdev/usehooks";
+
+
+import {Layout} from "./Layout";
+import {Backlog} from "./Backlog";
+import {OrderPanel} from "./OrderPanel";
+import {useShopStore} from "./shop_store";
+
+/**
+ * Component that renders the entire shop
+ */
+
+export function Shop() {
+ // #!render_count
+ const renderCount = useRenderCount();
+
+ const addCardFromBacklog = useShopStore((state) => state.addCardFromBacklog);
+ const moveCard = useShopStore((state) => state.moveCard);
+ const deleteCard = useShopStore((state) => state.deleteCard);
+ const cardIndexById = useShopStore((state) => state.cardIndexById);
+
+ const handleOnDragEnd = (drop_result, _provided) => {
+ if (!drop_result.destination) {
+ console.warn("No drop destination");
+ return;
+ }
+ if (drop_result.source.droppableId === "backlog")
+ addCardFromBacklog(drop_result.destination.droppableId, drop_result.source.index, drop_result.destination.index);
+ else if (drop_result.destination.droppableId === "backlog")
+ deleteCard(drop_result.source.droppableId, drop_result.source.index);
+ else
+ moveCard(drop_result.source.droppableId, drop_result.source.index, drop_result.destination.droppableId, drop_result.destination.index)
+ }
+
+ useEffect(() => {
+ addCardFromBacklog(null, [cardIndexById("eem_pwr_mod"), cardIndexById("kasli")], -1, true);
+ }, []);
+
+ // #!render_count
+ console.log("Shop renders: ", renderCount)
+
+ return (
+
+
+ }
+ main={(
+
+ Drag and drop the cards you want into the crate below to see how
+ the combination would look like. Configure the card settings by tapping on the top of
+ the card; many of the options can be adjusted even after the card has been shipped.
+ If you have any issues with this ordering system, or if you need other configurations,
+ email us directly anytime at sales@m-labs.hk .
+ The price is estimated and must be confirmed by a quote.
+