@wilow_app/design-system 0.0.6 → 0.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.umd.js CHANGED
@@ -1,4 +1,4 @@
1
- (function(Q,E){typeof exports=="object"&&typeof module<"u"?E(exports,require("react/jsx-runtime"),require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","react-dom"],E):(Q=typeof globalThis<"u"?globalThis:Q||self,E(Q["my-react-component"]={},Q.jsxRuntime,Q.React,Q.ReactDOM))})(this,function(Q,E,D,rt){"use strict";function _o(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const C=_o(D);function G(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var Po=typeof Symbol=="function"&&Symbol.observable||"@@observable",mn=Po,hn=()=>Math.random().toString(36).substring(7).split("").join("."),To={INIT:`@@redux/INIT${hn()}`,REPLACE:`@@redux/REPLACE${hn()}`},bn=To;function Bo(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function Vo(e){if(e===void 0)return"undefined";if(e===null)return"null";const t=typeof e;switch(t){case"boolean":case"string":case"number":case"symbol":case"function":return t}if(Array.isArray(e))return"array";if(Mo(e))return"date";if(Ro(e))return"error";const n=Lo(e);switch(n){case"Symbol":case"Promise":case"WeakMap":case"WeakSet":case"Map":case"Set":return n}return Object.prototype.toString.call(e).slice(8,-1).toLowerCase().replace(/\s/g,"")}function Lo(e){return typeof e.constructor=="function"?e.constructor.name:null}function Ro(e){return e instanceof Error||typeof e.message=="string"&&e.constructor&&typeof e.constructor.stackTraceLimit=="number"}function Mo(e){return e instanceof Date?!0:typeof e.toDateString=="function"&&typeof e.getDate=="function"&&typeof e.setDate=="function"}function ee(e){let t=typeof e;return process.env.NODE_ENV!=="production"&&(t=Vo(e)),t}function vn(e,t,n){if(typeof e!="function")throw new Error(process.env.NODE_ENV==="production"?G(2):`Expected the root reducer to be a function. Instead, received: '${ee(e)}'`);if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(process.env.NODE_ENV==="production"?G(0):"It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.");if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(process.env.NODE_ENV==="production"?G(1):`Expected the enhancer to be a function. Instead, received: '${ee(n)}'`);return n(vn)(e,t)}let r=e,o=t,i=new Map,s=i,c=0,a=!1;function d(){s===i&&(s=new Map,i.forEach((h,y)=>{s.set(y,h)}))}function p(){if(a)throw new Error(process.env.NODE_ENV==="production"?G(3):"You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return o}function l(h){if(typeof h!="function")throw new Error(process.env.NODE_ENV==="production"?G(4):`Expected the listener to be a function. Instead, received: '${ee(h)}'`);if(a)throw new Error(process.env.NODE_ENV==="production"?G(5):"You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api/store#subscribelistener for more details.");let y=!0;d();const v=c++;return s.set(v,h),function(){if(y){if(a)throw new Error(process.env.NODE_ENV==="production"?G(6):"You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api/store#subscribelistener for more details.");y=!1,d(),s.delete(v),i=null}}}function u(h){if(!Bo(h))throw new Error(process.env.NODE_ENV==="production"?G(7):`Actions must be plain objects. Instead, the actual type was: '${ee(h)}'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.`);if(typeof h.type>"u")throw new Error(process.env.NODE_ENV==="production"?G(8):'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');if(typeof h.type!="string")throw new Error(process.env.NODE_ENV==="production"?G(17):`Action "type" property must be a string. Instead, the actual type was: '${ee(h.type)}'. Value was: '${h.type}' (stringified)`);if(a)throw new Error(process.env.NODE_ENV==="production"?G(9):"Reducers may not dispatch actions.");try{a=!0,o=r(o,h)}finally{a=!1}return(i=s).forEach(v=>{v()}),h}function g(h){if(typeof h!="function")throw new Error(process.env.NODE_ENV==="production"?G(10):`Expected the nextReducer to be a function. Instead, received: '${ee(h)}`);r=h,u({type:bn.REPLACE})}function m(){const h=l;return{subscribe(y){if(typeof y!="object"||y===null)throw new Error(process.env.NODE_ENV==="production"?G(11):`Expected the observer to be an object. Instead, received: '${ee(y)}'`);function v(){const I=y;I.next&&I.next(p())}return v(),{unsubscribe:h(v)}},[mn](){return this}}}return u({type:bn.INIT}),{dispatch:u,subscribe:l,getState:p,replaceReducer:g,[mn]:m}}function yn(e,t){return function(...n){return t(e.apply(this,n))}}function En(e,t){if(typeof e=="function")return yn(e,t);if(typeof e!="object"||e===null)throw new Error(process.env.NODE_ENV==="production"?G(16):`bindActionCreators expected an object or a function, but instead received: '${ee(e)}'. Did you write "import ActionCreators from" instead of "import * as ActionCreators from"?`);const n={};for(const r in e){const o=e[r];typeof o=="function"&&(n[r]=yn(o,t))}return n}function Dn(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,n)=>(...r)=>t(n(...r)))}function $o(...e){return t=>(n,r)=>{const o=t(n,r);let i=()=>{throw new Error(process.env.NODE_ENV==="production"?G(15):"Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch.")};const s={getState:o.getState,dispatch:(a,...d)=>i(a,...d)},c=e.map(a=>a(s));return i=Dn(...c)(o.dispatch),{...o,dispatch:i}}}var ot={};/**
1
+ (function(Q,y){typeof exports=="object"&&typeof module<"u"?y(exports,require("react/jsx-runtime"),require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","react-dom"],y):(Q=typeof globalThis<"u"?globalThis:Q||self,y(Q["my-react-component"]={},Q.jsxRuntime,Q.React,Q.ReactDOM))})(this,function(Q,y,D,rt){"use strict";function _o(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const w=_o(D);function G(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var Po=typeof Symbol=="function"&&Symbol.observable||"@@observable",mn=Po,hn=()=>Math.random().toString(36).substring(7).split("").join("."),To={INIT:`@@redux/INIT${hn()}`,REPLACE:`@@redux/REPLACE${hn()}`},bn=To;function Bo(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function Vo(e){if(e===void 0)return"undefined";if(e===null)return"null";const t=typeof e;switch(t){case"boolean":case"string":case"number":case"symbol":case"function":return t}if(Array.isArray(e))return"array";if(Mo(e))return"date";if(Ro(e))return"error";const n=Lo(e);switch(n){case"Symbol":case"Promise":case"WeakMap":case"WeakSet":case"Map":case"Set":return n}return Object.prototype.toString.call(e).slice(8,-1).toLowerCase().replace(/\s/g,"")}function Lo(e){return typeof e.constructor=="function"?e.constructor.name:null}function Ro(e){return e instanceof Error||typeof e.message=="string"&&e.constructor&&typeof e.constructor.stackTraceLimit=="number"}function Mo(e){return e instanceof Date?!0:typeof e.toDateString=="function"&&typeof e.getDate=="function"&&typeof e.setDate=="function"}function ee(e){let t=typeof e;return process.env.NODE_ENV!=="production"&&(t=Vo(e)),t}function vn(e,t,n){if(typeof e!="function")throw new Error(process.env.NODE_ENV==="production"?G(2):`Expected the root reducer to be a function. Instead, received: '${ee(e)}'`);if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(process.env.NODE_ENV==="production"?G(0):"It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.");if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(process.env.NODE_ENV==="production"?G(1):`Expected the enhancer to be a function. Instead, received: '${ee(n)}'`);return n(vn)(e,t)}let r=e,o=t,i=new Map,s=i,c=0,a=!1;function d(){s===i&&(s=new Map,i.forEach((h,E)=>{s.set(E,h)}))}function p(){if(a)throw new Error(process.env.NODE_ENV==="production"?G(3):"You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return o}function l(h){if(typeof h!="function")throw new Error(process.env.NODE_ENV==="production"?G(4):`Expected the listener to be a function. Instead, received: '${ee(h)}'`);if(a)throw new Error(process.env.NODE_ENV==="production"?G(5):"You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api/store#subscribelistener for more details.");let E=!0;d();const v=c++;return s.set(v,h),function(){if(E){if(a)throw new Error(process.env.NODE_ENV==="production"?G(6):"You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api/store#subscribelistener for more details.");E=!1,d(),s.delete(v),i=null}}}function u(h){if(!Bo(h))throw new Error(process.env.NODE_ENV==="production"?G(7):`Actions must be plain objects. Instead, the actual type was: '${ee(h)}'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.`);if(typeof h.type>"u")throw new Error(process.env.NODE_ENV==="production"?G(8):'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');if(typeof h.type!="string")throw new Error(process.env.NODE_ENV==="production"?G(17):`Action "type" property must be a string. Instead, the actual type was: '${ee(h.type)}'. Value was: '${h.type}' (stringified)`);if(a)throw new Error(process.env.NODE_ENV==="production"?G(9):"Reducers may not dispatch actions.");try{a=!0,o=r(o,h)}finally{a=!1}return(i=s).forEach(v=>{v()}),h}function f(h){if(typeof h!="function")throw new Error(process.env.NODE_ENV==="production"?G(10):`Expected the nextReducer to be a function. Instead, received: '${ee(h)}`);r=h,u({type:bn.REPLACE})}function m(){const h=l;return{subscribe(E){if(typeof E!="object"||E===null)throw new Error(process.env.NODE_ENV==="production"?G(11):`Expected the observer to be an object. Instead, received: '${ee(E)}'`);function v(){const I=E;I.next&&I.next(p())}return v(),{unsubscribe:h(v)}},[mn](){return this}}}return u({type:bn.INIT}),{dispatch:u,subscribe:l,getState:p,replaceReducer:f,[mn]:m}}function yn(e,t){return function(...n){return t(e.apply(this,n))}}function En(e,t){if(typeof e=="function")return yn(e,t);if(typeof e!="object"||e===null)throw new Error(process.env.NODE_ENV==="production"?G(16):`bindActionCreators expected an object or a function, but instead received: '${ee(e)}'. Did you write "import ActionCreators from" instead of "import * as ActionCreators from"?`);const n={};for(const r in e){const o=e[r];typeof o=="function"&&(n[r]=yn(o,t))}return n}function Dn(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,n)=>(...r)=>t(n(...r)))}function $o(...e){return t=>(n,r)=>{const o=t(n,r);let i=()=>{throw new Error(process.env.NODE_ENV==="production"?G(15):"Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch.")};const s={getState:o.getState,dispatch:(a,...d)=>i(a,...d)},c=e.map(a=>a(s));return i=Dn(...c)(o.dispatch),{...o,dispatch:i}}}var ot={};/**
2
2
  * @license React
3
3
  * use-sync-external-store-with-selector.production.js
4
4
  *
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * This source code is licensed under the MIT license found in the
8
8
  * LICENSE file in the root directory of this source tree.
9
- */var Nn;function Go(){if(Nn)return ot;Nn=1;var e=D;function t(a,d){return a===d&&(a!==0||1/a===1/d)||a!==a&&d!==d}var n=typeof Object.is=="function"?Object.is:t,r=e.useSyncExternalStore,o=e.useRef,i=e.useEffect,s=e.useMemo,c=e.useDebugValue;return ot.useSyncExternalStoreWithSelector=function(a,d,p,l,u){var g=o(null);if(g.current===null){var m={hasValue:!1,value:null};g.current=m}else m=g.current;g=s(function(){function h(N){if(!y){if(y=!0,v=N,N=l(N),u!==void 0&&m.hasValue){var O=m.value;if(u(O,N))return S=O}return S=N}if(O=S,n(v,N))return O;var A=l(N);return u!==void 0&&u(O,A)?(v=N,O):(v=N,S=A)}var y=!1,v,S,I=p===void 0?null:p;return[function(){return h(d())},I===null?void 0:function(){return h(I())}]},[d,p,l,u]);var b=r(a,g[0],g[1]);return i(function(){m.hasValue=!0,m.value=b},[b]),c(b),b},ot}var it={};/**
9
+ */var Nn;function Go(){if(Nn)return ot;Nn=1;var e=D;function t(a,d){return a===d&&(a!==0||1/a===1/d)||a!==a&&d!==d}var n=typeof Object.is=="function"?Object.is:t,r=e.useSyncExternalStore,o=e.useRef,i=e.useEffect,s=e.useMemo,c=e.useDebugValue;return ot.useSyncExternalStoreWithSelector=function(a,d,p,l,u){var f=o(null);if(f.current===null){var m={hasValue:!1,value:null};f.current=m}else m=f.current;f=s(function(){function h(N){if(!E){if(E=!0,v=N,N=l(N),u!==void 0&&m.hasValue){var O=m.value;if(u(O,N))return C=O}return C=N}if(O=C,n(v,N))return O;var _=l(N);return u!==void 0&&u(O,_)?(v=N,O):(v=N,C=_)}var E=!1,v,C,I=p===void 0?null:p;return[function(){return h(d())},I===null?void 0:function(){return h(I())}]},[d,p,l,u]);var b=r(a,f[0],f[1]);return i(function(){m.hasValue=!0,m.value=b},[b]),c(b),b},ot}var it={};/**
10
10
  * @license React
11
11
  * use-sync-external-store-with-selector.development.js
12
12
  *
@@ -14,17 +14,17 @@
14
14
  *
15
15
  * This source code is licensed under the MIT license found in the
16
16
  * LICENSE file in the root directory of this source tree.
17
- */var xn;function Fo(){return xn||(xn=1,process.env.NODE_ENV!=="production"&&function(){function e(a,d){return a===d&&(a!==0||1/a===1/d)||a!==a&&d!==d}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=D,n=typeof Object.is=="function"?Object.is:e,r=t.useSyncExternalStore,o=t.useRef,i=t.useEffect,s=t.useMemo,c=t.useDebugValue;it.useSyncExternalStoreWithSelector=function(a,d,p,l,u){var g=o(null);if(g.current===null){var m={hasValue:!1,value:null};g.current=m}else m=g.current;g=s(function(){function h(N){if(!y){if(y=!0,v=N,N=l(N),u!==void 0&&m.hasValue){var O=m.value;if(u(O,N))return S=O}return S=N}if(O=S,n(v,N))return O;var A=l(N);return u!==void 0&&u(O,A)?(v=N,O):(v=N,S=A)}var y=!1,v,S,I=p===void 0?null:p;return[function(){return h(d())},I===null?void 0:function(){return h(I())}]},[d,p,l,u]);var b=r(a,g[0],g[1]);return i(function(){m.hasValue=!0,m.value=b},[b]),c(b),b},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),it}process.env.NODE_ENV==="production"?Go():Fo();var In=C.version.startsWith("19"),ko=Symbol.for(In?"react.transitional.element":"react.element"),Wo=Symbol.for("react.portal"),On=Symbol.for("react.fragment"),Sn=Symbol.for("react.strict_mode"),wn=Symbol.for("react.profiler"),st=Symbol.for("react.consumer"),ct=Symbol.for("react.context"),at=Symbol.for("react.forward_ref"),Cn=Symbol.for("react.suspense"),An=Symbol.for("react.suspense_list"),Me=Symbol.for("react.memo"),_n=Symbol.for("react.lazy"),Uo=Symbol.for("react.offscreen"),Ho=Symbol.for("react.client.reference"),jo=at,zo=Me;function qo(e){return typeof e=="string"||typeof e=="function"||e===On||e===wn||e===Sn||e===Cn||e===An||e===Uo||typeof e=="object"&&e!==null&&(e.$$typeof===_n||e.$$typeof===Me||e.$$typeof===ct||e.$$typeof===st||e.$$typeof===at||e.$$typeof===Ho||e.getModuleId!==void 0)}function lt(e){if(typeof e=="object"&&e!==null){const{$$typeof:t}=e;switch(t){case ko:switch(e=e.type,e){case On:case wn:case Sn:case Cn:case An:return e;default:switch(e=e&&e.$$typeof,e){case ct:case at:case _n:case Me:return e;case st:return e;default:return t}}case Wo:return t}}}function Yo(e){return In?lt(e)===st:lt(e)===ct}function Xo(e){return lt(e)===Me}function dt(e){typeof console<"u"&&typeof console.error=="function"&&console.error(e);try{throw new Error(e)}catch{}}function ut(e,t){if(e)(t==="mapStateToProps"||t==="mapDispatchToProps")&&(Object.prototype.hasOwnProperty.call(e,"dependsOnOwnProps")||dt(`The selector for ${t} of connect did not specify a value for dependsOnOwnProps.`));else throw new Error(`Unexpected value for ${t} in connect.`)}function Ko(e,t,n){ut(e,"mapStateToProps"),ut(t,"mapDispatchToProps"),ut(n,"mergeProps")}function Jo(e,t,n,r,{areStatesEqual:o,areOwnPropsEqual:i,areStatePropsEqual:s}){let c=!1,a,d,p,l,u;function g(v,S){return a=v,d=S,p=e(a,d),l=t(r,d),u=n(p,l,d),c=!0,u}function m(){return p=e(a,d),t.dependsOnOwnProps&&(l=t(r,d)),u=n(p,l,d),u}function b(){return e.dependsOnOwnProps&&(p=e(a,d)),t.dependsOnOwnProps&&(l=t(r,d)),u=n(p,l,d),u}function h(){const v=e(a,d),S=!s(v,p);return p=v,S&&(u=n(p,l,d)),u}function y(v,S){const I=!i(S,d),N=!o(v,a,S,d);return a=v,d=S,I&&N?m():I?b():N?h():u}return function(S,I){return c?y(S,I):g(S,I)}}function Zo(e,{initMapStateToProps:t,initMapDispatchToProps:n,initMergeProps:r,...o}){const i=t(e,o),s=n(e,o),c=r(e,o);return process.env.NODE_ENV!=="production"&&Ko(i,s,c),Jo(i,s,c,e,o)}function Qo(e,t){const n={};for(const r in e){const o=e[r];typeof o=="function"&&(n[r]=(...i)=>t(o(...i)))}return n}function ei(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);if(t===null)return!0;let n=t;for(;Object.getPrototypeOf(n)!==null;)n=Object.getPrototypeOf(n);return t===n}function Pn(e,t,n){ei(e)||dt(`${n}() in ${t} must return a plain object. Instead received ${e}.`)}function pt(e){return function(n){const r=e(n);function o(){return r}return o.dependsOnOwnProps=!1,o}}function Tn(e){return e.dependsOnOwnProps?!!e.dependsOnOwnProps:e.length!==1}function Bn(e,t){return function(r,{displayName:o}){const i=function(c,a){return i.dependsOnOwnProps?i.mapToProps(c,a):i.mapToProps(c,void 0)};return i.dependsOnOwnProps=!0,i.mapToProps=function(c,a){i.mapToProps=e,i.dependsOnOwnProps=Tn(e);let d=i(c,a);return typeof d=="function"&&(i.mapToProps=d,i.dependsOnOwnProps=Tn(d),d=i(c,a)),process.env.NODE_ENV!=="production"&&Pn(d,o,t),d},i}}function ft(e,t){return(n,r)=>{throw new Error(`Invalid value of type ${typeof e} for ${t} argument when connecting component ${r.wrappedComponentName}.`)}}function ti(e){return e&&typeof e=="object"?pt(t=>Qo(e,t)):e?typeof e=="function"?Bn(e,"mapDispatchToProps"):ft(e,"mapDispatchToProps"):pt(t=>({dispatch:t}))}function ni(e){return e?typeof e=="function"?Bn(e,"mapStateToProps"):ft(e,"mapStateToProps"):pt(()=>({}))}function ri(e,t,n){return{...n,...e,...t}}function oi(e){return function(n,{displayName:r,areMergedPropsEqual:o}){let i=!1,s;return function(a,d,p){const l=e(a,d,p);return i?o(l,s)||(s=l):(i=!0,s=l,process.env.NODE_ENV!=="production"&&Pn(s,r,"mergeProps")),s}}}function ii(e){return e?typeof e=="function"?oi(e):ft(e,"mergeProps"):()=>ri}function si(e){e()}function ci(){let e=null,t=null;return{clear(){e=null,t=null},notify(){si(()=>{let n=e;for(;n;)n.callback(),n=n.next})},get(){const n=[];let r=e;for(;r;)n.push(r),r=r.next;return n},subscribe(n){let r=!0;const o=t={callback:n,next:null,prev:t};return o.prev?o.prev.next=o:e=o,function(){!r||e===null||(r=!1,o.next?o.next.prev=o.prev:t=o.prev,o.prev?o.prev.next=o.next:e=o.next)}}}}var Vn={notify(){},get:()=>[]};function Ln(e,t){let n,r=Vn,o=0,i=!1;function s(b){p();const h=r.subscribe(b);let y=!1;return()=>{y||(y=!0,h(),l())}}function c(){r.notify()}function a(){m.onStateChange&&m.onStateChange()}function d(){return i}function p(){o++,n||(n=t?t.addNestedSub(a):e.subscribe(a),r=ci())}function l(){o--,n&&o===0&&(n(),n=void 0,r.clear(),r=Vn)}function u(){i||(i=!0,p())}function g(){i&&(i=!1,l())}const m={addNestedSub:s,notifyNestedSubs:c,handleChangeWrapper:a,isSubscribed:d,trySubscribe:u,tryUnsubscribe:g,getListeners:()=>r};return m}var ai=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",li=ai(),di=()=>typeof navigator<"u"&&navigator.product==="ReactNative",ui=di(),pi=()=>li||ui?C.useLayoutEffect:C.useEffect,$e=pi();function Rn(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function gt(e,t){if(Rn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let o=0;o<n.length;o++)if(!Object.prototype.hasOwnProperty.call(t,n[o])||!Rn(e[n[o]],t[n[o]]))return!1;return!0}var fi={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},gi={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},mi={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},Mn={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},hi={[jo]:mi,[zo]:Mn};function $n(e){return Xo(e)?Mn:hi[e.$$typeof]||fi}var bi=Object.defineProperty,vi=Object.getOwnPropertyNames,Gn=Object.getOwnPropertySymbols,yi=Object.getOwnPropertyDescriptor,Ei=Object.getPrototypeOf,Fn=Object.prototype;function mt(e,t){if(typeof t!="string"){if(Fn){const i=Ei(t);i&&i!==Fn&&mt(e,i)}let n=vi(t);Gn&&(n=n.concat(Gn(t)));const r=$n(e),o=$n(t);for(let i=0;i<n.length;++i){const s=n[i];if(!gi[s]&&!(o&&o[s])&&!(r&&r[s])){const c=yi(t,s);try{bi(e,s,c)}catch{}}}}return e}var ht=Symbol.for("react-redux-context"),bt=typeof globalThis<"u"?globalThis:{};function Di(){if(!C.createContext)return{};const e=bt[ht]??(bt[ht]=new Map);let t=e.get(C.createContext);return t||(t=C.createContext(null),process.env.NODE_ENV!=="production"&&(t.displayName="ReactRedux"),e.set(C.createContext,t)),t}var kn=Di(),Ni=[null,null],xi=e=>{try{return JSON.stringify(e)}catch{return String(e)}};function Ii(e,t,n){$e(()=>e(...t),n)}function Oi(e,t,n,r,o,i){e.current=r,n.current=!1,o.current&&(o.current=null,i())}function Si(e,t,n,r,o,i,s,c,a,d,p){if(!e)return()=>{};let l=!1,u=null;const g=()=>{if(l||!c.current)return;const b=t.getState();let h,y;try{h=r(b,o.current)}catch(v){y=v,u=v}y||(u=null),h===i.current?s.current||d():(i.current=h,a.current=h,s.current=!0,p())};return n.onStateChange=g,n.trySubscribe(),g(),()=>{if(l=!0,n.tryUnsubscribe(),n.onStateChange=null,u)throw u}}function wi(e,t){return e===t}var Wn=!1;function Ci(e,t,n,{pure:r,areStatesEqual:o=wi,areOwnPropsEqual:i=gt,areStatePropsEqual:s=gt,areMergedPropsEqual:c=gt,forwardRef:a=!1,context:d=kn}={}){process.env.NODE_ENV!=="production"&&r!==void 0&&!Wn&&(Wn=!0,dt('The `pure` option has been removed. `connect` is now always a "pure/memoized" component'));const p=d,l=ni(e),u=ti(t),g=ii(n),m=!!e;return h=>{if(process.env.NODE_ENV!=="production"&&!qo(h))throw new Error(`You must pass a component to the function returned by connect. Instead received ${xi(h)}`);const y=h.displayName||h.name||"Component",v=`Connect(${y})`,S={shouldHandleStateChanges:m,displayName:v,wrappedComponentName:y,WrappedComponent:h,initMapStateToProps:l,initMapDispatchToProps:u,initMergeProps:g,areStatesEqual:o,areStatePropsEqual:s,areOwnPropsEqual:i,areMergedPropsEqual:c};function I(A){const[T,H,V]=C.useMemo(()=>{const{reactReduxForwardedRef:z,...ge}=A;return[A.context,z,ge]},[A]),j=C.useMemo(()=>{let z=p;if(T!=null&&T.Consumer&&process.env.NODE_ENV!=="production"){if(!Yo(C.createElement(T.Consumer,null)))throw new Error("You must pass a valid React context consumer as `props.context`");z=T}return z},[T,p]),L=C.useContext(j),J=!!A.store&&!!A.store.getState&&!!A.store.dispatch,fe=!!L&&!!L.store;if(process.env.NODE_ENV!=="production"&&!J&&!fe)throw new Error(`Could not find "store" in the context of "${v}". Either wrap the root component in a <Provider>, or pass a custom React context provider to <Provider> and the corresponding React context consumer to ${v} in connect options.`);const Z=J?A.store:L.store,tt=fe?L.getServerState:Z.getState,ln=C.useMemo(()=>Zo(Z.dispatch,S),[Z]),[Le,So]=C.useMemo(()=>{if(!m)return Ni;const z=Ln(Z,J?void 0:L.subscription),ge=z.notifyNestedSubs.bind(z);return[z,ge]},[Z,J,L]),wo=C.useMemo(()=>J?L:{...L,subscription:Le},[J,L,Le]),dn=C.useRef(void 0),un=C.useRef(V),Re=C.useRef(void 0),Co=C.useRef(!1),pn=C.useRef(!1),fn=C.useRef(void 0);$e(()=>(pn.current=!0,()=>{pn.current=!1}),[]);const Ao=C.useMemo(()=>()=>Re.current&&V===un.current?Re.current:ln(Z.getState(),V),[Z,V]),yd=C.useMemo(()=>ge=>Le?Si(m,Z,Le,ln,un,dn,Co,pn,Re,So,ge):()=>{},[Le]);Ii(Oi,[un,dn,Co,V,Re,So]);let nt;try{nt=C.useSyncExternalStore(yd,Ao,tt?()=>ln(tt(),V):Ao)}catch(z){throw fn.current&&(z.message+=`
17
+ */var xn;function Fo(){return xn||(xn=1,process.env.NODE_ENV!=="production"&&function(){function e(a,d){return a===d&&(a!==0||1/a===1/d)||a!==a&&d!==d}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=D,n=typeof Object.is=="function"?Object.is:e,r=t.useSyncExternalStore,o=t.useRef,i=t.useEffect,s=t.useMemo,c=t.useDebugValue;it.useSyncExternalStoreWithSelector=function(a,d,p,l,u){var f=o(null);if(f.current===null){var m={hasValue:!1,value:null};f.current=m}else m=f.current;f=s(function(){function h(N){if(!E){if(E=!0,v=N,N=l(N),u!==void 0&&m.hasValue){var O=m.value;if(u(O,N))return C=O}return C=N}if(O=C,n(v,N))return O;var _=l(N);return u!==void 0&&u(O,_)?(v=N,O):(v=N,C=_)}var E=!1,v,C,I=p===void 0?null:p;return[function(){return h(d())},I===null?void 0:function(){return h(I())}]},[d,p,l,u]);var b=r(a,f[0],f[1]);return i(function(){m.hasValue=!0,m.value=b},[b]),c(b),b},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),it}process.env.NODE_ENV==="production"?Go():Fo();var In=w.version.startsWith("19"),ko=Symbol.for(In?"react.transitional.element":"react.element"),Wo=Symbol.for("react.portal"),On=Symbol.for("react.fragment"),Cn=Symbol.for("react.strict_mode"),Sn=Symbol.for("react.profiler"),st=Symbol.for("react.consumer"),ct=Symbol.for("react.context"),at=Symbol.for("react.forward_ref"),wn=Symbol.for("react.suspense"),An=Symbol.for("react.suspense_list"),Me=Symbol.for("react.memo"),_n=Symbol.for("react.lazy"),Uo=Symbol.for("react.offscreen"),Ho=Symbol.for("react.client.reference"),jo=at,zo=Me;function qo(e){return typeof e=="string"||typeof e=="function"||e===On||e===Sn||e===Cn||e===wn||e===An||e===Uo||typeof e=="object"&&e!==null&&(e.$$typeof===_n||e.$$typeof===Me||e.$$typeof===ct||e.$$typeof===st||e.$$typeof===at||e.$$typeof===Ho||e.getModuleId!==void 0)}function lt(e){if(typeof e=="object"&&e!==null){const{$$typeof:t}=e;switch(t){case ko:switch(e=e.type,e){case On:case Sn:case Cn:case wn:case An:return e;default:switch(e=e&&e.$$typeof,e){case ct:case at:case _n:case Me:return e;case st:return e;default:return t}}case Wo:return t}}}function Yo(e){return In?lt(e)===st:lt(e)===ct}function Xo(e){return lt(e)===Me}function dt(e){typeof console<"u"&&typeof console.error=="function"&&console.error(e);try{throw new Error(e)}catch{}}function ut(e,t){if(e)(t==="mapStateToProps"||t==="mapDispatchToProps")&&(Object.prototype.hasOwnProperty.call(e,"dependsOnOwnProps")||dt(`The selector for ${t} of connect did not specify a value for dependsOnOwnProps.`));else throw new Error(`Unexpected value for ${t} in connect.`)}function Ko(e,t,n){ut(e,"mapStateToProps"),ut(t,"mapDispatchToProps"),ut(n,"mergeProps")}function Jo(e,t,n,r,{areStatesEqual:o,areOwnPropsEqual:i,areStatePropsEqual:s}){let c=!1,a,d,p,l,u;function f(v,C){return a=v,d=C,p=e(a,d),l=t(r,d),u=n(p,l,d),c=!0,u}function m(){return p=e(a,d),t.dependsOnOwnProps&&(l=t(r,d)),u=n(p,l,d),u}function b(){return e.dependsOnOwnProps&&(p=e(a,d)),t.dependsOnOwnProps&&(l=t(r,d)),u=n(p,l,d),u}function h(){const v=e(a,d),C=!s(v,p);return p=v,C&&(u=n(p,l,d)),u}function E(v,C){const I=!i(C,d),N=!o(v,a,C,d);return a=v,d=C,I&&N?m():I?b():N?h():u}return function(C,I){return c?E(C,I):f(C,I)}}function Zo(e,{initMapStateToProps:t,initMapDispatchToProps:n,initMergeProps:r,...o}){const i=t(e,o),s=n(e,o),c=r(e,o);return process.env.NODE_ENV!=="production"&&Ko(i,s,c),Jo(i,s,c,e,o)}function Qo(e,t){const n={};for(const r in e){const o=e[r];typeof o=="function"&&(n[r]=(...i)=>t(o(...i)))}return n}function ei(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);if(t===null)return!0;let n=t;for(;Object.getPrototypeOf(n)!==null;)n=Object.getPrototypeOf(n);return t===n}function Pn(e,t,n){ei(e)||dt(`${n}() in ${t} must return a plain object. Instead received ${e}.`)}function pt(e){return function(n){const r=e(n);function o(){return r}return o.dependsOnOwnProps=!1,o}}function Tn(e){return e.dependsOnOwnProps?!!e.dependsOnOwnProps:e.length!==1}function Bn(e,t){return function(r,{displayName:o}){const i=function(c,a){return i.dependsOnOwnProps?i.mapToProps(c,a):i.mapToProps(c,void 0)};return i.dependsOnOwnProps=!0,i.mapToProps=function(c,a){i.mapToProps=e,i.dependsOnOwnProps=Tn(e);let d=i(c,a);return typeof d=="function"&&(i.mapToProps=d,i.dependsOnOwnProps=Tn(d),d=i(c,a)),process.env.NODE_ENV!=="production"&&Pn(d,o,t),d},i}}function ft(e,t){return(n,r)=>{throw new Error(`Invalid value of type ${typeof e} for ${t} argument when connecting component ${r.wrappedComponentName}.`)}}function ti(e){return e&&typeof e=="object"?pt(t=>Qo(e,t)):e?typeof e=="function"?Bn(e,"mapDispatchToProps"):ft(e,"mapDispatchToProps"):pt(t=>({dispatch:t}))}function ni(e){return e?typeof e=="function"?Bn(e,"mapStateToProps"):ft(e,"mapStateToProps"):pt(()=>({}))}function ri(e,t,n){return{...n,...e,...t}}function oi(e){return function(n,{displayName:r,areMergedPropsEqual:o}){let i=!1,s;return function(a,d,p){const l=e(a,d,p);return i?o(l,s)||(s=l):(i=!0,s=l,process.env.NODE_ENV!=="production"&&Pn(s,r,"mergeProps")),s}}}function ii(e){return e?typeof e=="function"?oi(e):ft(e,"mergeProps"):()=>ri}function si(e){e()}function ci(){let e=null,t=null;return{clear(){e=null,t=null},notify(){si(()=>{let n=e;for(;n;)n.callback(),n=n.next})},get(){const n=[];let r=e;for(;r;)n.push(r),r=r.next;return n},subscribe(n){let r=!0;const o=t={callback:n,next:null,prev:t};return o.prev?o.prev.next=o:e=o,function(){!r||e===null||(r=!1,o.next?o.next.prev=o.prev:t=o.prev,o.prev?o.prev.next=o.next:e=o.next)}}}}var Vn={notify(){},get:()=>[]};function Ln(e,t){let n,r=Vn,o=0,i=!1;function s(b){p();const h=r.subscribe(b);let E=!1;return()=>{E||(E=!0,h(),l())}}function c(){r.notify()}function a(){m.onStateChange&&m.onStateChange()}function d(){return i}function p(){o++,n||(n=t?t.addNestedSub(a):e.subscribe(a),r=ci())}function l(){o--,n&&o===0&&(n(),n=void 0,r.clear(),r=Vn)}function u(){i||(i=!0,p())}function f(){i&&(i=!1,l())}const m={addNestedSub:s,notifyNestedSubs:c,handleChangeWrapper:a,isSubscribed:d,trySubscribe:u,tryUnsubscribe:f,getListeners:()=>r};return m}var ai=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",li=ai(),di=()=>typeof navigator<"u"&&navigator.product==="ReactNative",ui=di(),pi=()=>li||ui?w.useLayoutEffect:w.useEffect,$e=pi();function Rn(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function gt(e,t){if(Rn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let o=0;o<n.length;o++)if(!Object.prototype.hasOwnProperty.call(t,n[o])||!Rn(e[n[o]],t[n[o]]))return!1;return!0}var fi={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},gi={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},mi={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},Mn={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},hi={[jo]:mi,[zo]:Mn};function $n(e){return Xo(e)?Mn:hi[e.$$typeof]||fi}var bi=Object.defineProperty,vi=Object.getOwnPropertyNames,Gn=Object.getOwnPropertySymbols,yi=Object.getOwnPropertyDescriptor,Ei=Object.getPrototypeOf,Fn=Object.prototype;function mt(e,t){if(typeof t!="string"){if(Fn){const i=Ei(t);i&&i!==Fn&&mt(e,i)}let n=vi(t);Gn&&(n=n.concat(Gn(t)));const r=$n(e),o=$n(t);for(let i=0;i<n.length;++i){const s=n[i];if(!gi[s]&&!(o&&o[s])&&!(r&&r[s])){const c=yi(t,s);try{bi(e,s,c)}catch{}}}}return e}var ht=Symbol.for("react-redux-context"),bt=typeof globalThis<"u"?globalThis:{};function Di(){if(!w.createContext)return{};const e=bt[ht]??(bt[ht]=new Map);let t=e.get(w.createContext);return t||(t=w.createContext(null),process.env.NODE_ENV!=="production"&&(t.displayName="ReactRedux"),e.set(w.createContext,t)),t}var kn=Di(),Ni=[null,null],xi=e=>{try{return JSON.stringify(e)}catch{return String(e)}};function Ii(e,t,n){$e(()=>e(...t),n)}function Oi(e,t,n,r,o,i){e.current=r,n.current=!1,o.current&&(o.current=null,i())}function Ci(e,t,n,r,o,i,s,c,a,d,p){if(!e)return()=>{};let l=!1,u=null;const f=()=>{if(l||!c.current)return;const b=t.getState();let h,E;try{h=r(b,o.current)}catch(v){E=v,u=v}E||(u=null),h===i.current?s.current||d():(i.current=h,a.current=h,s.current=!0,p())};return n.onStateChange=f,n.trySubscribe(),f(),()=>{if(l=!0,n.tryUnsubscribe(),n.onStateChange=null,u)throw u}}function Si(e,t){return e===t}var Wn=!1;function wi(e,t,n,{pure:r,areStatesEqual:o=Si,areOwnPropsEqual:i=gt,areStatePropsEqual:s=gt,areMergedPropsEqual:c=gt,forwardRef:a=!1,context:d=kn}={}){process.env.NODE_ENV!=="production"&&r!==void 0&&!Wn&&(Wn=!0,dt('The `pure` option has been removed. `connect` is now always a "pure/memoized" component'));const p=d,l=ni(e),u=ti(t),f=ii(n),m=!!e;return h=>{if(process.env.NODE_ENV!=="production"&&!qo(h))throw new Error(`You must pass a component to the function returned by connect. Instead received ${xi(h)}`);const E=h.displayName||h.name||"Component",v=`Connect(${E})`,C={shouldHandleStateChanges:m,displayName:v,wrappedComponentName:E,WrappedComponent:h,initMapStateToProps:l,initMapDispatchToProps:u,initMergeProps:f,areStatesEqual:o,areStatePropsEqual:s,areOwnPropsEqual:i,areMergedPropsEqual:c};function I(_){const[T,H,V]=w.useMemo(()=>{const{reactReduxForwardedRef:z,...ge}=_;return[_.context,z,ge]},[_]),j=w.useMemo(()=>{let z=p;if(T!=null&&T.Consumer&&process.env.NODE_ENV!=="production"){if(!Yo(w.createElement(T.Consumer,null)))throw new Error("You must pass a valid React context consumer as `props.context`");z=T}return z},[T,p]),L=w.useContext(j),J=!!_.store&&!!_.store.getState&&!!_.store.dispatch,fe=!!L&&!!L.store;if(process.env.NODE_ENV!=="production"&&!J&&!fe)throw new Error(`Could not find "store" in the context of "${v}". Either wrap the root component in a <Provider>, or pass a custom React context provider to <Provider> and the corresponding React context consumer to ${v} in connect options.`);const Z=J?_.store:L.store,tt=fe?L.getServerState:Z.getState,ln=w.useMemo(()=>Zo(Z.dispatch,C),[Z]),[Le,Co]=w.useMemo(()=>{if(!m)return Ni;const z=Ln(Z,J?void 0:L.subscription),ge=z.notifyNestedSubs.bind(z);return[z,ge]},[Z,J,L]),So=w.useMemo(()=>J?L:{...L,subscription:Le},[J,L,Le]),dn=w.useRef(void 0),un=w.useRef(V),Re=w.useRef(void 0),wo=w.useRef(!1),pn=w.useRef(!1),fn=w.useRef(void 0);$e(()=>(pn.current=!0,()=>{pn.current=!1}),[]);const Ao=w.useMemo(()=>()=>Re.current&&V===un.current?Re.current:ln(Z.getState(),V),[Z,V]),yd=w.useMemo(()=>ge=>Le?Ci(m,Z,Le,ln,un,dn,wo,pn,Re,Co,ge):()=>{},[Le]);Ii(Oi,[un,dn,wo,V,Re,Co]);let nt;try{nt=w.useSyncExternalStore(yd,Ao,tt?()=>ln(tt(),V):Ao)}catch(z){throw fn.current&&(z.message+=`
18
18
  The error may be correlated with this previous error:
19
19
  ${fn.current.stack}
20
20
 
21
- `),z}$e(()=>{fn.current=void 0,Re.current=void 0,dn.current=nt});const gn=C.useMemo(()=>C.createElement(h,{...nt,ref:H}),[H,h,nt]);return C.useMemo(()=>m?C.createElement(j.Provider,{value:wo},gn):gn,[j,gn,wo])}const O=C.memo(I);if(O.WrappedComponent=h,O.displayName=I.displayName=v,a){const T=C.forwardRef(function(V,j){return C.createElement(O,{...V,reactReduxForwardedRef:j})});return T.displayName=v,T.WrappedComponent=h,mt(T,h)}return mt(O,h)}}var Un=Ci;function Ai(e){const{children:t,context:n,serverState:r,store:o}=e,i=C.useMemo(()=>{const a=Ln(o),d={store:o,subscription:a,getServerState:r?()=>r:void 0};if(process.env.NODE_ENV==="production")return d;{const{identityFunctionCheck:p="once",stabilityCheck:l="once"}=e;return Object.assign(d,{stabilityCheck:l,identityFunctionCheck:p})}},[o,r]),s=C.useMemo(()=>o.getState(),[o]);$e(()=>{const{subscription:a}=i;return a.onStateChange=a.notifyNestedSubs,a.trySubscribe(),s!==o.getState()&&a.notifyNestedSubs(),()=>{a.tryUnsubscribe(),a.onStateChange=void 0}},[i,s]);const c=n||kn;return C.createElement(c.Provider,{value:i},t)}var _i=Ai,Pi=process.env.NODE_ENV==="production",vt="Invariant failed";function Hn(e,t){if(Pi)throw new Error(vt);var n=typeof t=="function"?t():t,r=n?"".concat(vt,": ").concat(n):vt;throw new Error(r)}var K=function(t){var n=t.top,r=t.right,o=t.bottom,i=t.left,s=r-i,c=o-n,a={top:n,right:r,bottom:o,left:i,width:s,height:c,x:i,y:n,center:{x:(r+i)/2,y:(o+n)/2}};return a},yt=function(t,n){return{top:t.top-n.top,left:t.left-n.left,bottom:t.bottom+n.bottom,right:t.right+n.right}},jn=function(t,n){return{top:t.top+n.top,left:t.left+n.left,bottom:t.bottom-n.bottom,right:t.right-n.right}},Ti=function(t,n){return{top:t.top+n.y,left:t.left+n.x,bottom:t.bottom+n.y,right:t.right+n.x}},Et={top:0,right:0,bottom:0,left:0},Dt=function(t){var n=t.borderBox,r=t.margin,o=r===void 0?Et:r,i=t.border,s=i===void 0?Et:i,c=t.padding,a=c===void 0?Et:c,d=K(yt(n,o)),p=K(jn(n,s)),l=K(jn(p,a));return{marginBox:d,borderBox:K(n),paddingBox:p,contentBox:l,margin:o,border:s,padding:a}},q=function(t){var n=t.slice(0,-2),r=t.slice(-2);if(r!=="px")return 0;var o=Number(n);return isNaN(o)&&(process.env.NODE_ENV!=="production"?Hn(!1,"Could not parse value [raw: "+t+", without suffix: "+n+"]"):Hn()),o},Bi=function(){return{x:window.pageXOffset,y:window.pageYOffset}},Ge=function(t,n){var r=t.borderBox,o=t.border,i=t.margin,s=t.padding,c=Ti(r,n);return Dt({borderBox:c,border:o,margin:i,padding:s})},Fe=function(t,n){return n===void 0&&(n=Bi()),Ge(t,n)},zn=function(t,n){var r={top:q(n.marginTop),right:q(n.marginRight),bottom:q(n.marginBottom),left:q(n.marginLeft)},o={top:q(n.paddingTop),right:q(n.paddingRight),bottom:q(n.paddingBottom),left:q(n.paddingLeft)},i={top:q(n.borderTopWidth),right:q(n.borderRightWidth),bottom:q(n.borderBottomWidth),left:q(n.borderLeftWidth)};return Dt({borderBox:t,margin:r,padding:o,border:i})},qn=function(t){var n=t.getBoundingClientRect(),r=window.getComputedStyle(t);return zn(n,r)},me=function(t){var n=[],r=null,o=function(){for(var s=arguments.length,c=new Array(s),a=0;a<s;a++)c[a]=arguments[a];n=c,!r&&(r=requestAnimationFrame(function(){r=null,t.apply(void 0,n)}))};return o.cancel=function(){r&&(cancelAnimationFrame(r),r=null)},o};function ke(){return ke=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ke.apply(null,arguments)}const Vi=process.env.NODE_ENV==="production",Li=/[ \t]{2,}/g,Ri=/^[ \t]*/gm,Yn=e=>e.replace(Li," ").replace(Ri,"").trim(),Mi=e=>Yn(`
21
+ `),z}$e(()=>{fn.current=void 0,Re.current=void 0,dn.current=nt});const gn=w.useMemo(()=>w.createElement(h,{...nt,ref:H}),[H,h,nt]);return w.useMemo(()=>m?w.createElement(j.Provider,{value:So},gn):gn,[j,gn,So])}const O=w.memo(I);if(O.WrappedComponent=h,O.displayName=I.displayName=v,a){const T=w.forwardRef(function(V,j){return w.createElement(O,{...V,reactReduxForwardedRef:j})});return T.displayName=v,T.WrappedComponent=h,mt(T,h)}return mt(O,h)}}var Un=wi;function Ai(e){const{children:t,context:n,serverState:r,store:o}=e,i=w.useMemo(()=>{const a=Ln(o),d={store:o,subscription:a,getServerState:r?()=>r:void 0};if(process.env.NODE_ENV==="production")return d;{const{identityFunctionCheck:p="once",stabilityCheck:l="once"}=e;return Object.assign(d,{stabilityCheck:l,identityFunctionCheck:p})}},[o,r]),s=w.useMemo(()=>o.getState(),[o]);$e(()=>{const{subscription:a}=i;return a.onStateChange=a.notifyNestedSubs,a.trySubscribe(),s!==o.getState()&&a.notifyNestedSubs(),()=>{a.tryUnsubscribe(),a.onStateChange=void 0}},[i,s]);const c=n||kn;return w.createElement(c.Provider,{value:i},t)}var _i=Ai,Pi=process.env.NODE_ENV==="production",vt="Invariant failed";function Hn(e,t){if(Pi)throw new Error(vt);var n=typeof t=="function"?t():t,r=n?"".concat(vt,": ").concat(n):vt;throw new Error(r)}var K=function(t){var n=t.top,r=t.right,o=t.bottom,i=t.left,s=r-i,c=o-n,a={top:n,right:r,bottom:o,left:i,width:s,height:c,x:i,y:n,center:{x:(r+i)/2,y:(o+n)/2}};return a},yt=function(t,n){return{top:t.top-n.top,left:t.left-n.left,bottom:t.bottom+n.bottom,right:t.right+n.right}},jn=function(t,n){return{top:t.top+n.top,left:t.left+n.left,bottom:t.bottom-n.bottom,right:t.right-n.right}},Ti=function(t,n){return{top:t.top+n.y,left:t.left+n.x,bottom:t.bottom+n.y,right:t.right+n.x}},Et={top:0,right:0,bottom:0,left:0},Dt=function(t){var n=t.borderBox,r=t.margin,o=r===void 0?Et:r,i=t.border,s=i===void 0?Et:i,c=t.padding,a=c===void 0?Et:c,d=K(yt(n,o)),p=K(jn(n,s)),l=K(jn(p,a));return{marginBox:d,borderBox:K(n),paddingBox:p,contentBox:l,margin:o,border:s,padding:a}},q=function(t){var n=t.slice(0,-2),r=t.slice(-2);if(r!=="px")return 0;var o=Number(n);return isNaN(o)&&(process.env.NODE_ENV!=="production"?Hn(!1,"Could not parse value [raw: "+t+", without suffix: "+n+"]"):Hn()),o},Bi=function(){return{x:window.pageXOffset,y:window.pageYOffset}},Ge=function(t,n){var r=t.borderBox,o=t.border,i=t.margin,s=t.padding,c=Ti(r,n);return Dt({borderBox:c,border:o,margin:i,padding:s})},Fe=function(t,n){return n===void 0&&(n=Bi()),Ge(t,n)},zn=function(t,n){var r={top:q(n.marginTop),right:q(n.marginRight),bottom:q(n.marginBottom),left:q(n.marginLeft)},o={top:q(n.paddingTop),right:q(n.paddingRight),bottom:q(n.paddingBottom),left:q(n.paddingLeft)},i={top:q(n.borderTopWidth),right:q(n.borderRightWidth),bottom:q(n.borderBottomWidth),left:q(n.borderLeftWidth)};return Dt({borderBox:t,margin:r,padding:o,border:i})},qn=function(t){var n=t.getBoundingClientRect(),r=window.getComputedStyle(t);return zn(n,r)},me=function(t){var n=[],r=null,o=function(){for(var s=arguments.length,c=new Array(s),a=0;a<s;a++)c[a]=arguments[a];n=c,!r&&(r=requestAnimationFrame(function(){r=null,t.apply(void 0,n)}))};return o.cancel=function(){r&&(cancelAnimationFrame(r),r=null)},o};function ke(){return ke=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ke.apply(null,arguments)}const Vi=process.env.NODE_ENV==="production",Li=/[ \t]{2,}/g,Ri=/^[ \t]*/gm,Yn=e=>e.replace(Li," ").replace(Ri,"").trim(),Mi=e=>Yn(`
22
22
  %c@hello-pangea/dnd
23
23
 
24
24
  %c${Yn(e)}
25
25
 
26
26
  %c👷‍ This is a development only message. It will be removed in production builds.
27
- `),$i=e=>[Mi(e),"color: #00C584; font-size: 1.2em; font-weight: bold;","line-height: 1.5","color: #723874;"],Gi="__@hello-pangea/dnd-disable-dev-warnings";function Xn(e,t){Vi||typeof window<"u"&&window[Gi]||console[e](...$i(t))}const B=Xn.bind(null,"warn"),Nt=Xn.bind(null,"error");function te(){}function Fi(e,t){return{...e,...t}}function Y(e,t,n){const r=t.map(o=>{const i=Fi(n,o.options);return e.addEventListener(o.eventName,o.fn,i),function(){e.removeEventListener(o.eventName,o.fn,i)}});return function(){r.forEach(i=>{i()})}}const ki=process.env.NODE_ENV==="production",Kn="Invariant failed";class he extends Error{}he.prototype.toString=function(){return this.message};function f(e,t){throw ki?new he(Kn):new he(`${Kn}: ${t||""}`)}class Wi extends D.Component{constructor(...t){super(...t),this.callbacks=null,this.unbind=te,this.onWindowError=n=>{const r=this.getCallbacks();r.isDragging()&&(r.tryAbort(),process.env.NODE_ENV!=="production"&&B(`
27
+ `),$i=e=>[Mi(e),"color: #00C584; font-size: 1.2em; font-weight: bold;","line-height: 1.5","color: #723874;"],Gi="__@hello-pangea/dnd-disable-dev-warnings";function Xn(e,t){Vi||typeof window<"u"&&window[Gi]||console[e](...$i(t))}const B=Xn.bind(null,"warn"),Nt=Xn.bind(null,"error");function te(){}function Fi(e,t){return{...e,...t}}function Y(e,t,n){const r=t.map(o=>{const i=Fi(n,o.options);return e.addEventListener(o.eventName,o.fn,i),function(){e.removeEventListener(o.eventName,o.fn,i)}});return function(){r.forEach(i=>{i()})}}const ki=process.env.NODE_ENV==="production",Kn="Invariant failed";class he extends Error{}he.prototype.toString=function(){return this.message};function g(e,t){throw ki?new he(Kn):new he(`${Kn}: ${t||""}`)}class Wi extends D.Component{constructor(...t){super(...t),this.callbacks=null,this.unbind=te,this.onWindowError=n=>{const r=this.getCallbacks();r.isDragging()&&(r.tryAbort(),process.env.NODE_ENV!=="production"&&B(`
28
28
  An error was caught by our window 'error' event listener while a drag was occurring.
29
29
  The active drag has been aborted.
30
30
  `));const o=n.error;o instanceof he&&(n.preventDefault(),process.env.NODE_ENV!=="production"&&Nt(o.message))},this.getCallbacks=()=>{if(!this.callbacks)throw new Error("Unable to find AppCallbacks in <ErrorBoundary/>");return this.callbacks},this.setCallbacks=n=>{this.callbacks=n}}componentDidMount(){this.unbind=Y(window,[{eventName:"error",fn:this.onWindowError}])}componentDidCatch(t){if(t instanceof he){process.env.NODE_ENV!=="production"&&Nt(t.message),this.setState({});return}throw t}componentWillUnmount(){this.unbind()}render(){return this.props.children(this.setCallbacks)}}const Ui=`
@@ -63,27 +63,27 @@ ${fn.current.stack}
63
63
  `:`
64
64
  The item has been dropped while not over a drop area.
65
65
  ${Qn(e.source)}
66
- `}};function zi(e,t){return!!(e===t||Number.isNaN(e)&&Number.isNaN(t))}function er(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!zi(e[n],t[n]))return!1;return!0}function w(e,t){const n=D.useState(()=>({inputs:t,result:e()}))[0],r=D.useRef(!0),o=D.useRef(n),s=r.current||!!(t&&o.current.inputs&&er(t,o.current.inputs))?o.current:{inputs:t,result:e()};return D.useEffect(()=>{r.current=!1,o.current=s},[s]),s.result}function x(e,t){return w(()=>e,t)}const R={x:0,y:0},$=(e,t)=>({x:e.x+t.x,y:e.y+t.y}),k=(e,t)=>({x:e.x-t.x,y:e.y-t.y}),ne=(e,t)=>e.x===t.x&&e.y===t.y,ae=e=>({x:e.x!==0?-e.x:0,y:e.y!==0?-e.y:0}),oe=(e,t,n=0)=>e==="x"?{x:t,y:n}:{x:n,y:t},be=(e,t)=>Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2),tr=(e,t)=>Math.min(...t.map(n=>be(e,n))),nr=e=>t=>({x:e(t.x),y:e(t.y)});var qi=(e,t)=>{const n=K({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};const ve=(e,t)=>({top:e.top+t.y,left:e.left+t.x,bottom:e.bottom+t.y,right:e.right+t.x}),rr=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}],Yi={top:0,right:0,bottom:0,left:0},Xi=(e,t)=>t?ve(e,t.scroll.diff.displacement):e,Ki=(e,t,n)=>n&&n.increasedBy?{...e,[t.end]:e[t.end]+n.increasedBy[t.line]}:e,Ji=(e,t)=>t&&t.shouldClipSubject?qi(t.pageMarginBox,e):K(e);var le=({page:e,withPlaceholder:t,axis:n,frame:r})=>{const o=Xi(e.marginBox,r),i=Ki(o,n,t),s=Ji(i,r);return{page:e,withPlaceholder:t,active:s}},xt=(e,t)=>{e.frame||(process.env.NODE_ENV,f());const n=e.frame,r=k(t,n.scroll.initial),o=ae(r),i={...n,scroll:{initial:n.scroll.initial,current:t,diff:{value:r,displacement:o},max:n.scroll.max}},s=le({page:e.subject.page,withPlaceholder:e.subject.withPlaceholder,axis:e.axis,frame:i});return{...e,frame:i,subject:s}};function M(e,t=er){let n=null;function r(...o){if(n&&n.lastThis===this&&t(o,n.lastArgs))return n.lastResult;const i=e.apply(this,o);return n={lastResult:i,lastArgs:o,lastThis:this},i}return r.clear=function(){n=null},r}const or=M(e=>e.reduce((t,n)=>(t[n.descriptor.id]=n,t),{})),ir=M(e=>e.reduce((t,n)=>(t[n.descriptor.id]=n,t),{})),He=M(e=>Object.values(e)),Zi=M(e=>Object.values(e));var ie=M((e,t)=>Zi(t).filter(r=>e===r.descriptor.droppableId).sort((r,o)=>r.descriptor.index-o.descriptor.index));function It(e){return e.at&&e.at.type==="REORDER"?e.at.destination:null}function je(e){return e.at&&e.at.type==="COMBINE"?e.at.combine:null}var ze=M((e,t)=>t.filter(n=>n.descriptor.id!==e.descriptor.id)),Qi=({isMovingForward:e,draggable:t,destination:n,insideDestination:r,previousImpact:o})=>{if(!n.isCombineEnabled||!It(o))return null;function s(g){const m={type:"COMBINE",combine:{draggableId:g,droppableId:n.descriptor.id}};return{...o,at:m}}const c=o.displaced.all,a=c.length?c[0]:null;if(e)return a?s(a):null;const d=ze(t,r);if(!a){if(!d.length)return null;const g=d[d.length-1];return s(g.descriptor.id)}const p=d.findIndex(g=>g.descriptor.id===a);p===-1&&(process.env.NODE_ENV!=="production"?f(!1,"Could not find displaced item in set"):f());const l=p-1;if(l<0)return null;const u=d[l];return s(u.descriptor.id)},de=(e,t)=>e.descriptor.droppableId===t.descriptor.id;const sr={point:R,value:0},ye={invisible:{},visible:{},all:[]},es={displaced:ye,displacedBy:sr,at:null};var X=(e,t)=>n=>e<=n&&n<=t,cr=e=>{const t=X(e.top,e.bottom),n=X(e.left,e.right);return r=>{if(t(r.top)&&t(r.bottom)&&n(r.left)&&n(r.right))return!0;const i=t(r.top)||t(r.bottom),s=n(r.left)||n(r.right);if(i&&s)return!0;const a=r.top<e.top&&r.bottom>e.bottom,d=r.left<e.left&&r.right>e.right;return a&&d?!0:a&&s||d&&i}},ts=e=>{const t=X(e.top,e.bottom),n=X(e.left,e.right);return r=>t(r.top)&&t(r.bottom)&&n(r.left)&&n(r.right)};const Ot={direction:"vertical",line:"y",crossAxisLine:"x",start:"top",end:"bottom",size:"height",crossAxisStart:"left",crossAxisEnd:"right",crossAxisSize:"width"},ar={direction:"horizontal",line:"x",crossAxisLine:"y",start:"left",end:"right",size:"width",crossAxisStart:"top",crossAxisEnd:"bottom",crossAxisSize:"height"};var ns=e=>t=>{const n=X(t.top,t.bottom),r=X(t.left,t.right);return o=>e===Ot?n(o.top)&&n(o.bottom):r(o.left)&&r(o.right)};const rs=(e,t)=>{const n=t.frame?t.frame.scroll.diff.displacement:R;return ve(e,n)},os=(e,t,n)=>t.subject.active?n(t.subject.active)(e):!1,is=(e,t,n)=>n(t)(e),St=({target:e,destination:t,viewport:n,withDroppableDisplacement:r,isVisibleThroughFrameFn:o})=>{const i=r?rs(e,t):e;return os(i,t,o)&&is(i,n,o)},ss=e=>St({...e,isVisibleThroughFrameFn:cr}),lr=e=>St({...e,isVisibleThroughFrameFn:ts}),cs=e=>St({...e,isVisibleThroughFrameFn:ns(e.destination.axis)}),as=(e,t,n)=>{if(typeof n=="boolean")return n;if(!t)return!0;const{invisible:r,visible:o}=t;if(r[e])return!1;const i=o[e];return i?i.shouldAnimate:!0};function ls(e,t){const n=e.page.marginBox,r={top:t.point.y,right:0,bottom:0,left:t.point.x};return K(yt(n,r))}function Ee({afterDragging:e,destination:t,displacedBy:n,viewport:r,forceShouldAnimate:o,last:i}){return e.reduce(function(c,a){const d=ls(a,n),p=a.descriptor.id;if(c.all.push(p),!ss({target:d,destination:t,viewport:r,withDroppableDisplacement:!0}))return c.invisible[a.descriptor.id]=!0,c;const u=as(p,i,o),g={draggableId:p,shouldAnimate:u};return c.visible[p]=g,c},{all:[],visible:{},invisible:{}})}function ds(e,t){if(!e.length)return 0;const n=e[e.length-1].descriptor.index;return t.inHomeList?n:n+1}function dr({insideDestination:e,inHomeList:t,displacedBy:n,destination:r}){const o=ds(e,{inHomeList:t});return{displaced:ye,displacedBy:n,at:{type:"REORDER",destination:{droppableId:r.descriptor.id,index:o}}}}function qe({draggable:e,insideDestination:t,destination:n,viewport:r,displacedBy:o,last:i,index:s,forceShouldAnimate:c}){const a=de(e,n);if(s==null)return dr({insideDestination:t,inHomeList:a,displacedBy:o,destination:n});const d=t.find(m=>m.descriptor.index===s);if(!d)return dr({insideDestination:t,inHomeList:a,displacedBy:o,destination:n});const p=ze(e,t),l=t.indexOf(d),u=p.slice(l);return{displaced:Ee({afterDragging:u,destination:n,displacedBy:o,last:i,viewport:r.frame,forceShouldAnimate:c}),displacedBy:o,at:{type:"REORDER",destination:{droppableId:n.descriptor.id,index:s}}}}function re(e,t){return!!t.effected[e]}var us=({isMovingForward:e,destination:t,draggables:n,combine:r,afterCritical:o})=>{if(!t.isCombineEnabled)return null;const i=r.draggableId,c=n[i].descriptor.index;return re(i,o)?e?c:c-1:e?c+1:c},ps=({isMovingForward:e,isInHomeList:t,insideDestination:n,location:r})=>{if(!n.length)return null;const o=r.index,i=e?o+1:o-1,s=n[0].descriptor.index,c=n[n.length-1].descriptor.index,a=t?c:c+1;return i<s||i>a?null:i},fs=({isMovingForward:e,isInHomeList:t,draggable:n,draggables:r,destination:o,insideDestination:i,previousImpact:s,viewport:c,afterCritical:a})=>{const d=s.at;if(d||(process.env.NODE_ENV!=="production"?f(!1,"Cannot move in direction without previous impact location"):f()),d.type==="REORDER"){const l=ps({isMovingForward:e,isInHomeList:t,location:d.destination,insideDestination:i});return l==null?null:qe({draggable:n,insideDestination:i,destination:o,viewport:c,last:s.displaced,displacedBy:s.displacedBy,index:l})}const p=us({isMovingForward:e,destination:o,displaced:s.displaced,draggables:r,combine:d.combine,afterCritical:a});return p==null?null:qe({draggable:n,insideDestination:i,destination:o,viewport:c,last:s.displaced,displacedBy:s.displacedBy,index:p})},gs=({displaced:e,afterCritical:t,combineWith:n,displacedBy:r})=>{const o=!!(e.visible[n]||e.invisible[n]);return re(n,t)?o?R:ae(r.point):o?r.point:R},ms=({afterCritical:e,impact:t,draggables:n})=>{const r=je(t);r||(process.env.NODE_ENV,f());const o=r.draggableId,i=n[o].page.borderBox.center,s=gs({displaced:t.displaced,afterCritical:e,combineWith:o,displacedBy:t.displacedBy});return $(i,s)};const ur=(e,t)=>t.margin[e.start]+t.borderBox[e.size]/2,hs=(e,t)=>t.margin[e.end]+t.borderBox[e.size]/2,wt=(e,t,n)=>t[e.crossAxisStart]+n.margin[e.crossAxisStart]+n.borderBox[e.crossAxisSize]/2,pr=({axis:e,moveRelativeTo:t,isMoving:n})=>oe(e.line,t.marginBox[e.end]+ur(e,n),wt(e,t.marginBox,n)),fr=({axis:e,moveRelativeTo:t,isMoving:n})=>oe(e.line,t.marginBox[e.start]-hs(e,n),wt(e,t.marginBox,n)),bs=({axis:e,moveInto:t,isMoving:n})=>oe(e.line,t.contentBox[e.start]+ur(e,n),wt(e,t.contentBox,n));var vs=({impact:e,draggable:t,draggables:n,droppable:r,afterCritical:o})=>{const i=ie(r.descriptor.id,n),s=t.page,c=r.axis;if(!i.length)return bs({axis:c,moveInto:r.page,isMoving:s});const{displaced:a,displacedBy:d}=e,p=a.all[0];if(p){const u=n[p];if(re(p,o))return fr({axis:c,moveRelativeTo:u.page,isMoving:s});const g=Ge(u.page,d.point);return fr({axis:c,moveRelativeTo:g,isMoving:s})}const l=i[i.length-1];if(l.descriptor.id===t.descriptor.id)return s.borderBox.center;if(re(l.descriptor.id,o)){const u=Ge(l.page,ae(o.displacedBy.point));return pr({axis:c,moveRelativeTo:u,isMoving:s})}return pr({axis:c,moveRelativeTo:l.page,isMoving:s})},Ct=(e,t)=>{const n=e.frame;return n?$(t,n.scroll.diff.displacement):t};const ys=({impact:e,draggable:t,droppable:n,draggables:r,afterCritical:o})=>{const i=t.page.borderBox.center,s=e.at;return!n||!s?i:s.type==="REORDER"?vs({impact:e,draggable:t,draggables:r,droppable:n,afterCritical:o}):ms({impact:e,draggables:r,afterCritical:o})};var Ye=e=>{const t=ys(e),n=e.droppable;return n?Ct(n,t):t},gr=(e,t)=>{const n=k(t,e.scroll.initial),r=ae(n);return{frame:K({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 mr(e,t){return e.map(n=>t[n])}function Es(e,t){for(let n=0;n<t.length;n++){const r=t[n].visible[e];if(r)return r}return null}var Ds=({impact:e,viewport:t,destination:n,draggables:r,maxScrollChange:o})=>{const i=gr(t,$(t.scroll.current,o)),s=n.frame?xt(n,$(n.frame.scroll.current,o)):n,c=e.displaced,a=Ee({afterDragging:mr(c.all,r),destination:n,displacedBy:e.displacedBy,viewport:i.frame,last:c,forceShouldAnimate:!1}),d=Ee({afterDragging:mr(c.all,r),destination:s,displacedBy:e.displacedBy,viewport:t.frame,last:c,forceShouldAnimate:!1}),p={},l={},u=[c,a,d];return c.all.forEach(m=>{const b=Es(m,u);if(b){l[m]=b;return}p[m]=!0}),{...e,displaced:{all:c.all,invisible:p,visible:l}}},Ns=(e,t)=>$(e.scroll.diff.displacement,t),At=({pageBorderBoxCenter:e,draggable:t,viewport:n})=>{const r=Ns(n,e),o=k(r,t.page.borderBox.center);return $(t.client.borderBox.center,o)},hr=({draggable:e,destination:t,newPageBorderBoxCenter:n,viewport:r,withDroppableDisplacement:o,onlyOnMainAxis:i=!1})=>{const s=k(n,e.page.borderBox.center),a={target:ve(e.page.borderBox,s),destination:t,withDroppableDisplacement:o,viewport:r};return i?cs(a):lr(a)},xs=({isMovingForward:e,draggable:t,destination:n,draggables:r,previousImpact:o,viewport:i,previousPageBorderBoxCenter:s,previousClientSelection:c,afterCritical:a})=>{if(!n.isEnabled)return null;const d=ie(n.descriptor.id,r),p=de(t,n),l=Qi({isMovingForward:e,draggable:t,destination:n,insideDestination:d,previousImpact:o})||fs({isMovingForward:e,isInHomeList:p,draggable:t,draggables:r,destination:n,insideDestination:d,previousImpact:o,viewport:i,afterCritical:a});if(!l)return null;const u=Ye({impact:l,draggable:t,droppable:n,draggables:r,afterCritical:a});if(hr({draggable:t,destination:n,newPageBorderBoxCenter:u,viewport:i.frame,withDroppableDisplacement:!1,onlyOnMainAxis:!0}))return{clientSelection:At({pageBorderBoxCenter:u,draggable:t,viewport:i}),impact:l,scrollJumpRequest:null};const m=k(u,s),b=Ds({impact:l,viewport:i,destination:n,draggables:r,maxScrollChange:m});return{clientSelection:c,impact:b,scrollJumpRequest:m}};const F=e=>{const t=e.subject.active;return t||(process.env.NODE_ENV!=="production"?f(!1,"Cannot get clipped area from droppable"):f()),t};var Is=({isMovingForward:e,pageBorderBoxCenter:t,source:n,droppables:r,viewport:o})=>{const i=n.subject.active;if(!i)return null;const s=n.axis,c=X(i[s.start],i[s.end]),a=He(r).filter(p=>p!==n).filter(p=>p.isEnabled).filter(p=>!!p.subject.active).filter(p=>cr(o.frame)(F(p))).filter(p=>{const l=F(p);return e?i[s.crossAxisEnd]<l[s.crossAxisEnd]:l[s.crossAxisStart]<i[s.crossAxisStart]}).filter(p=>{const l=F(p),u=X(l[s.start],l[s.end]);return c(l[s.start])||c(l[s.end])||u(i[s.start])||u(i[s.end])}).sort((p,l)=>{const u=F(p)[s.crossAxisStart],g=F(l)[s.crossAxisStart];return e?u-g:g-u}).filter((p,l,u)=>F(p)[s.crossAxisStart]===F(u[0])[s.crossAxisStart]);if(!a.length)return null;if(a.length===1)return a[0];const d=a.filter(p=>X(F(p)[s.start],F(p)[s.end])(t[s.line]));return d.length===1?d[0]:d.length>1?d.sort((p,l)=>F(p)[s.start]-F(l)[s.start])[0]:a.sort((p,l)=>{const u=tr(t,rr(F(p))),g=tr(t,rr(F(l)));return u!==g?u-g:F(p)[s.start]-F(l)[s.start]})[0]};const br=(e,t)=>{const n=e.page.borderBox.center;return re(e.descriptor.id,t)?k(n,t.displacedBy.point):n},Os=(e,t)=>{const n=e.page.borderBox;return re(e.descriptor.id,t)?ve(n,ae(t.displacedBy.point)):n};var Ss=({pageBorderBoxCenter:e,viewport:t,destination:n,insideDestination:r,afterCritical:o})=>r.filter(s=>lr({target:Os(s,o),destination:n,viewport:t.frame,withDroppableDisplacement:!0})).sort((s,c)=>{const a=be(e,Ct(n,br(s,o))),d=be(e,Ct(n,br(c,o)));return a<d?-1:d<a?1:s.descriptor.index-c.descriptor.index})[0]||null,De=M(function(t,n){const r=n[t.line];return{value:r,point:oe(t.line,r)}});const ws=(e,t,n)=>{const r=e.axis;if(e.descriptor.mode==="virtual")return oe(r.line,t[r.line]);const o=e.subject.page.contentBox[r.size],a=ie(e.descriptor.id,n).reduce((d,p)=>d+p.client.marginBox[r.size],0)+t[r.line]-o;return a<=0?null:oe(r.line,a)},vr=(e,t)=>({...e,scroll:{...e.scroll,max:t}}),yr=(e,t,n)=>{const r=e.frame;de(t,e)&&(process.env.NODE_ENV!=="production"?f(!1,"Should not add placeholder space to home list"):f()),e.subject.withPlaceholder&&(process.env.NODE_ENV!=="production"?f(!1,"Cannot add placeholder size to a subject when it already has one"):f());const o=De(e.axis,t.displaceBy).point,i=ws(e,o,n),s={placeholderSize:o,increasedBy:i,oldFrameMaxScroll:e.frame?e.frame.scroll.max:null};if(!r){const p=le({page:e.subject.page,withPlaceholder:s,axis:e.axis,frame:e.frame});return{...e,subject:p}}const c=i?$(r.scroll.max,i):r.scroll.max,a=vr(r,c),d=le({page:e.subject.page,withPlaceholder:s,axis:e.axis,frame:a});return{...e,subject:d,frame:a}},Cs=e=>{const t=e.subject.withPlaceholder;t||(process.env.NODE_ENV!=="production"?f(!1,"Cannot remove placeholder form subject when there was none"):f());const n=e.frame;if(!n){const s=le({page:e.subject.page,axis:e.axis,frame:null,withPlaceholder:null});return{...e,subject:s}}const r=t.oldFrameMaxScroll;r||(process.env.NODE_ENV!=="production"?f(!1,"Expected droppable with frame to have old max frame scroll when removing placeholder"):f());const o=vr(n,r),i=le({page:e.subject.page,axis:e.axis,frame:o,withPlaceholder:null});return{...e,subject:i,frame:o}};var As=({previousPageBorderBoxCenter:e,moveRelativeTo:t,insideDestination:n,draggable:r,draggables:o,destination:i,viewport:s,afterCritical:c})=>{if(!t){if(n.length)return null;const l={displaced:ye,displacedBy:sr,at:{type:"REORDER",destination:{droppableId:i.descriptor.id,index:0}}},u=Ye({impact:l,draggable:r,droppable:i,draggables:o,afterCritical:c}),g=de(r,i)?i:yr(i,r,o);return hr({draggable:r,destination:g,newPageBorderBoxCenter:u,viewport:s.frame,withDroppableDisplacement:!1,onlyOnMainAxis:!0})?l:null}const a=e[i.axis.line]<=t.page.borderBox.center[i.axis.line],d=(()=>{const l=t.descriptor.index;return t.descriptor.id===r.descriptor.id||a?l:l+1})(),p=De(i.axis,r.displaceBy);return qe({draggable:r,insideDestination:n,destination:i,viewport:s,displacedBy:p,last:ye,index:d})},_s=({isMovingForward:e,previousPageBorderBoxCenter:t,draggable:n,isOver:r,draggables:o,droppables:i,viewport:s,afterCritical:c})=>{const a=Is({isMovingForward:e,pageBorderBoxCenter:t,source:r,droppables:i,viewport:s});if(!a)return null;const d=ie(a.descriptor.id,o),p=Ss({pageBorderBoxCenter:t,viewport:s,destination:a,insideDestination:d,afterCritical:c}),l=As({previousPageBorderBoxCenter:t,destination:a,draggable:n,draggables:o,moveRelativeTo:p,insideDestination:d,viewport:s,afterCritical:c});if(!l)return null;const u=Ye({impact:l,draggable:n,droppable:a,draggables:o,afterCritical:c});return{clientSelection:At({pageBorderBoxCenter:u,draggable:n,viewport:s}),impact:l,scrollJumpRequest:null}},W=e=>{const t=e.at;return t?t.type==="REORDER"?t.destination.droppableId:t.combine.droppableId:null};const Ps=(e,t)=>{const n=W(e);return n?t[n]:null};var Ts=({state:e,type:t})=>{const n=Ps(e.impact,e.dimensions.droppables),r=!!n,o=e.dimensions.droppables[e.critical.droppable.id],i=n||o,s=i.axis.direction,c=s==="vertical"&&(t==="MOVE_UP"||t==="MOVE_DOWN")||s==="horizontal"&&(t==="MOVE_LEFT"||t==="MOVE_RIGHT");if(c&&!r)return null;const a=t==="MOVE_DOWN"||t==="MOVE_RIGHT",d=e.dimensions.draggables[e.critical.draggable.id],p=e.current.page.borderBoxCenter,{draggables:l,droppables:u}=e.dimensions;return c?xs({isMovingForward:a,previousPageBorderBoxCenter:p,draggable:d,destination:i,draggables:l,viewport:e.viewport,previousClientSelection:e.current.client.selection,previousImpact:e.impact,afterCritical:e.afterCritical}):_s({isMovingForward:a,previousPageBorderBoxCenter:p,draggable:d,isOver:i,draggables:l,droppables:u,viewport:e.viewport,afterCritical:e.afterCritical})};function se(e){return e.phase==="DRAGGING"||e.phase==="COLLECTING"}function Er(e){const t=X(e.top,e.bottom),n=X(e.left,e.right);return function(o){return t(o.y)&&n(o.x)}}function Bs(e,t){return e.left<t.right&&e.right>t.left&&e.top<t.bottom&&e.bottom>t.top}function Vs({pageBorderBox:e,draggable:t,candidates:n}){const r=t.page.borderBox.center,o=n.map(i=>{const s=i.axis,c=oe(i.axis.line,e.center[s.line],i.page.borderBox.center[s.crossAxisLine]);return{id:i.descriptor.id,distance:be(r,c)}}).sort((i,s)=>s.distance-i.distance);return o[0]?o[0].id:null}function Ls({pageBorderBox:e,draggable:t,droppables:n}){const r=He(n).filter(o=>{if(!o.isEnabled)return!1;const i=o.subject.active;if(!i||!Bs(e,i))return!1;if(Er(i)(e.center))return!0;const s=o.axis,c=i.center[s.crossAxisLine],a=e[s.crossAxisStart],d=e[s.crossAxisEnd],p=X(i[s.crossAxisStart],i[s.crossAxisEnd]),l=p(a),u=p(d);return!l&&!u?!0:l?a<c:d>c});return r.length?r.length===1?r[0].descriptor.id:Vs({pageBorderBox:e,draggable:t,candidates:r}):null}const Dr=(e,t)=>K(ve(e,t));var Rs=(e,t)=>{const n=e.frame;return n?Dr(t,n.scroll.diff.value):t};function Nr({displaced:e,id:t}){return!!(e.visible[t]||e.invisible[t])}function Ms({draggable:e,closest:t,inHomeList:n}){return t?n&&t.descriptor.index>e.descriptor.index?t.descriptor.index-1:t.descriptor.index:null}var $s=({pageBorderBoxWithDroppableScroll:e,draggable:t,destination:n,insideDestination:r,last:o,viewport:i,afterCritical:s})=>{const c=n.axis,a=De(n.axis,t.displaceBy),d=a.value,p=e[c.start],l=e[c.end],g=ze(t,r).find(b=>{const h=b.descriptor.id,y=b.page.borderBox.center[c.line],v=re(h,s),S=Nr({displaced:o,id:h});return v?S?l<=y:p<y-d:S?l<=y+d:p<y})||null,m=Ms({draggable:t,closest:g,inHomeList:de(t,n)});return qe({draggable:t,insideDestination:r,destination:n,viewport:i,last:o,displacedBy:a,index:m})};const Gs=4;var Fs=({draggable:e,pageBorderBoxWithDroppableScroll:t,previousImpact:n,destination:r,insideDestination:o,afterCritical:i})=>{if(!r.isCombineEnabled)return null;const s=r.axis,c=De(r.axis,e.displaceBy),a=c.value,d=t[s.start],p=t[s.end],u=ze(e,o).find(m=>{const b=m.descriptor.id,h=m.page.borderBox,v=h[s.size]/Gs,S=re(b,i),I=Nr({displaced:n.displaced,id:b});return S?I?p>h[s.start]+v&&p<h[s.end]-v:d>h[s.start]-a+v&&d<h[s.end]-a-v:I?p>h[s.start]+a+v&&p<h[s.end]+a-v:d>h[s.start]+v&&d<h[s.end]-v});return u?{displacedBy:c,displaced:n.displaced,at:{type:"COMBINE",combine:{draggableId:u.descriptor.id,droppableId:r.descriptor.id}}}:null},xr=({pageOffset:e,draggable:t,draggables:n,droppables:r,previousImpact:o,viewport:i,afterCritical:s})=>{const c=Dr(t.page.borderBox,e),a=Ls({pageBorderBox:c,draggable:t,droppables:r});if(!a)return es;const d=r[a],p=ie(d.descriptor.id,n),l=Rs(d,c);return Fs({pageBorderBoxWithDroppableScroll:l,draggable:t,previousImpact:o,destination:d,insideDestination:p,afterCritical:s})||$s({pageBorderBoxWithDroppableScroll:l,draggable:t,destination:d,insideDestination:p,last:o.displaced,viewport:i,afterCritical:s})},_t=(e,t)=>({...e,[t.descriptor.id]:t});const ks=({previousImpact:e,impact:t,droppables:n})=>{const r=W(e),o=W(t);if(!r||r===o)return n;const i=n[r];if(!i.subject.withPlaceholder)return n;const s=Cs(i);return _t(n,s)};var Ws=({draggable:e,draggables:t,droppables:n,previousImpact:r,impact:o})=>{const i=ks({previousImpact:r,impact:o,droppables:n}),s=W(o);if(!s)return i;const c=n[s];if(de(e,c)||c.subject.withPlaceholder)return i;const a=yr(c,e,t);return _t(i,a)},Ne=({state:e,clientSelection:t,dimensions:n,viewport:r,impact:o,scrollJumpRequest:i})=>{const s=r||e.viewport,c=n||e.dimensions,a=t||e.current.client.selection,d=k(a,e.initial.client.selection),p={offset:d,selection:a,borderBoxCenter:$(e.initial.client.borderBoxCenter,d)},l={selection:$(p.selection,s.scroll.current),borderBoxCenter:$(p.borderBoxCenter,s.scroll.current),offset:$(p.offset,s.scroll.diff.value)},u={client:p,page:l};if(e.phase==="COLLECTING")return{...e,dimensions:c,viewport:s,current:u};const g=c.draggables[e.critical.draggable.id],m=o||xr({pageOffset:l.offset,draggable:g,draggables:c.draggables,droppables:c.droppables,previousImpact:e.impact,viewport:s,afterCritical:e.afterCritical}),b=Ws({draggable:g,impact:m,previousImpact:e.impact,draggables:c.draggables,droppables:c.droppables});return{...e,current:u,dimensions:{draggables:c.draggables,droppables:b},impact:m,viewport:s,scrollJumpRequest:i||null,forceShouldAnimate:i?!1:null}};function Us(e,t){return e.map(n=>t[n])}var Ir=({impact:e,viewport:t,draggables:n,destination:r,forceShouldAnimate:o})=>{const i=e.displaced,s=Us(i.all,n),c=Ee({afterDragging:s,destination:r,displacedBy:e.displacedBy,viewport:t.frame,forceShouldAnimate:o,last:i});return{...e,displaced:c}},Or=({impact:e,draggable:t,droppable:n,draggables:r,viewport:o,afterCritical:i})=>{const s=Ye({impact:e,draggable:t,draggables:r,droppable:n,afterCritical:i});return At({pageBorderBoxCenter:s,draggable:t,viewport:o})},Sr=({state:e,dimensions:t,viewport:n})=>{e.movementMode!=="SNAP"&&(process.env.NODE_ENV,f());const r=e.impact,o=n||e.viewport,i=t||e.dimensions,{draggables:s,droppables:c}=i,a=s[e.critical.draggable.id],d=W(r);d||(process.env.NODE_ENV!=="production"?f(!1,"Must be over a destination in SNAP movement mode"):f());const p=c[d],l=Ir({impact:r,viewport:o,destination:p,draggables:s}),u=Or({impact:l,draggable:a,droppable:p,draggables:s,viewport:o,afterCritical:e.afterCritical});return Ne({impact:l,clientSelection:u,state:e,dimensions:i,viewport:o})},Hs=e=>({index:e.index,droppableId:e.droppableId}),wr=({draggable:e,home:t,draggables:n,viewport:r})=>{const o=De(t.axis,e.displaceBy),i=ie(t.descriptor.id,n),s=i.indexOf(e);s===-1&&(process.env.NODE_ENV!=="production"?f(!1,"Expected draggable to be inside home list"):f());const c=i.slice(s+1),a=c.reduce((u,g)=>(u[g.descriptor.id]=!0,u),{}),d={inVirtualList:t.descriptor.mode==="virtual",displacedBy:o,effected:a};return{impact:{displaced:Ee({afterDragging:c,destination:t,displacedBy:o,last:null,viewport:r.frame,forceShouldAnimate:!1}),displacedBy:o,at:{type:"REORDER",destination:Hs(e.descriptor)}},afterCritical:d}},js=(e,t)=>({draggables:e.draggables,droppables:_t(e.droppables,t)});const xe=e=>{process.env.NODE_ENV},Ie=e=>{process.env.NODE_ENV};var zs=({draggable:e,offset:t,initialWindowScroll:n})=>{const r=Ge(e.client,t),o=Fe(r,n);return{...e,placeholder:{...e.placeholder,client:r},client:r,page:o}},qs=e=>{const t=e.frame;return t||(process.env.NODE_ENV!=="production"?f(!1,"Expected Droppable to have a frame"):f()),t},Ys=({additions:e,updatedDroppables:t,viewport:n})=>{const r=n.scroll.diff.value;return e.map(o=>{const i=o.descriptor.droppableId,s=t[i],a=qs(s).scroll.diff.value,d=$(r,a);return zs({draggable:o,offset:d,initialWindowScroll:n.scroll.initial})})},Xs=({state:e,published:t})=>{xe();const n=t.modified.map(y=>{const v=e.dimensions.droppables[y.droppableId];return xt(v,y.scroll)}),r={...e.dimensions.droppables,...or(n)},o=ir(Ys({additions:t.additions,updatedDroppables:r,viewport:e.viewport})),i={...e.dimensions.draggables,...o};t.removals.forEach(y=>{delete i[y]});const s={droppables:r,draggables:i},c=W(e.impact),a=c?s.droppables[c]:null,d=s.draggables[e.critical.draggable.id],p=s.droppables[e.critical.droppable.id],{impact:l,afterCritical:u}=wr({draggable:d,home:p,draggables:i,viewport:e.viewport}),g=a&&a.isCombineEnabled?e.impact:l,m=xr({pageOffset:e.current.page.offset,draggable:s.draggables[e.critical.draggable.id],draggables:s.draggables,droppables:s.droppables,previousImpact:g,viewport:e.viewport,afterCritical:u});Ie();const b={...e,phase:"DRAGGING",impact:m,onLiftImpact:l,dimensions:s,afterCritical:u,forceShouldAnimate:!1};return e.phase==="COLLECTING"?b:{...b,phase:"DROP_PENDING",reason:e.reason,isWaiting:!1}};const Pt=e=>e.movementMode==="SNAP",Tt=(e,t,n)=>{const r=js(e.dimensions,t);return!Pt(e)||n?Ne({state:e,dimensions:r}):Sr({state:e,dimensions:r})};function Bt(e){return e.isDragging&&e.movementMode==="SNAP"?{...e,scrollJumpRequest:null}:e}const Cr={phase:"IDLE",completed:null,shouldFlush:!1};var Ks=(e=Cr,t)=>{if(t.type==="FLUSH")return{...Cr,shouldFlush:!0};if(t.type==="INITIAL_PUBLISH"){e.phase!=="IDLE"&&(process.env.NODE_ENV!=="production"?f(!1,"INITIAL_PUBLISH must come after a IDLE phase"):f());const{critical:n,clientSelection:r,viewport:o,dimensions:i,movementMode:s}=t.payload,c=i.draggables[n.draggable.id],a=i.droppables[n.droppable.id],d={selection:r,borderBoxCenter:c.client.borderBox.center,offset:R},p={client:d,page:{selection:$(d.selection,o.scroll.initial),borderBoxCenter:$(d.selection,o.scroll.initial),offset:$(d.selection,o.scroll.diff.value)}},l=He(i.droppables).every(b=>!b.isFixedOnPage),{impact:u,afterCritical:g}=wr({draggable:c,home:a,draggables:i.draggables,viewport:o});return{phase:"DRAGGING",isDragging:!0,critical:n,movementMode:s,dimensions:i,initial:p,current:p,isWindowScrollAllowed:l,impact:u,afterCritical:g,onLiftImpact:u,viewport:o,scrollJumpRequest:null,forceShouldAnimate:null}}if(t.type==="COLLECTION_STARTING")return e.phase==="COLLECTING"||e.phase==="DROP_PENDING"?e:(e.phase!=="DRAGGING"&&(process.env.NODE_ENV!=="production"?f(!1,`Collection cannot start from phase ${e.phase}`):f()),{...e,phase:"COLLECTING"});if(t.type==="PUBLISH_WHILE_DRAGGING")return e.phase==="COLLECTING"||e.phase==="DROP_PENDING"||(process.env.NODE_ENV!=="production"?f(!1,`Unexpected ${t.type} received in phase ${e.phase}`):f()),Xs({state:e,published:t.payload});if(t.type==="MOVE"){if(e.phase==="DROP_PENDING")return e;se(e)||(process.env.NODE_ENV!=="production"?f(!1,`${t.type} not permitted in phase ${e.phase}`):f());const{client:n}=t.payload;return ne(n,e.current.client.selection)?e:Ne({state:e,clientSelection:n,impact:Pt(e)?e.impact:null})}if(t.type==="UPDATE_DROPPABLE_SCROLL"){if(e.phase==="DROP_PENDING"||e.phase==="COLLECTING")return Bt(e);se(e)||(process.env.NODE_ENV!=="production"?f(!1,`${t.type} not permitted in phase ${e.phase}`):f());const{id:n,newScroll:r}=t.payload,o=e.dimensions.droppables[n];if(!o)return e;const i=xt(o,r);return Tt(e,i,!1)}if(t.type==="UPDATE_DROPPABLE_IS_ENABLED"){if(e.phase==="DROP_PENDING")return e;se(e)||(process.env.NODE_ENV!=="production"?f(!1,`Attempting to move in an unsupported phase ${e.phase}`):f());const{id:n,isEnabled:r}=t.payload,o=e.dimensions.droppables[n];o||(process.env.NODE_ENV!=="production"?f(!1,`Cannot find Droppable[id: ${n}] to toggle its enabled state`):f()),o.isEnabled===r&&(process.env.NODE_ENV!=="production"?f(!1,`Trying to set droppable isEnabled to ${String(r)}
67
- but it is already ${String(o.isEnabled)}`):f());const i={...o,isEnabled:r};return Tt(e,i,!0)}if(t.type==="UPDATE_DROPPABLE_IS_COMBINE_ENABLED"){if(e.phase==="DROP_PENDING")return e;se(e)||(process.env.NODE_ENV!=="production"?f(!1,`Attempting to move in an unsupported phase ${e.phase}`):f());const{id:n,isCombineEnabled:r}=t.payload,o=e.dimensions.droppables[n];o||(process.env.NODE_ENV!=="production"?f(!1,`Cannot find Droppable[id: ${n}] to toggle its isCombineEnabled state`):f()),o.isCombineEnabled===r&&(process.env.NODE_ENV!=="production"?f(!1,`Trying to set droppable isCombineEnabled to ${String(r)}
68
- but it is already ${String(o.isCombineEnabled)}`):f());const i={...o,isCombineEnabled:r};return Tt(e,i,!0)}if(t.type==="MOVE_BY_WINDOW_SCROLL"){if(e.phase==="DROP_PENDING"||e.phase==="DROP_ANIMATING")return e;se(e)||(process.env.NODE_ENV!=="production"?f(!1,`Cannot move by window in phase ${e.phase}`):f()),e.isWindowScrollAllowed||(process.env.NODE_ENV!=="production"?f(!1,"Window scrolling is currently not supported for fixed lists"):f());const n=t.payload.newScroll;if(ne(e.viewport.scroll.current,n))return Bt(e);const r=gr(e.viewport,n);return Pt(e)?Sr({state:e,viewport:r}):Ne({state:e,viewport:r})}if(t.type==="UPDATE_VIEWPORT_MAX_SCROLL"){if(!se(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(t.type==="MOVE_UP"||t.type==="MOVE_DOWN"||t.type==="MOVE_LEFT"||t.type==="MOVE_RIGHT"){if(e.phase==="COLLECTING"||e.phase==="DROP_PENDING")return e;e.phase!=="DRAGGING"&&(process.env.NODE_ENV!=="production"?f(!1,`${t.type} received while not in DRAGGING phase`):f());const n=Ts({state:e,type:t.type});return n?Ne({state:e,impact:n.impact,clientSelection:n.clientSelection,scrollJumpRequest:n.scrollJumpRequest}):e}if(t.type==="DROP_PENDING"){const n=t.payload.reason;return e.phase!=="COLLECTING"&&(process.env.NODE_ENV!=="production"?f(!1,"Can only move into the DROP_PENDING phase from the COLLECTING phase"):f()),{...e,phase:"DROP_PENDING",isWaiting:!0,reason:n}}if(t.type==="DROP_ANIMATE"){const{completed:n,dropDuration:r,newHomeClientOffset:o}=t.payload;return e.phase==="DRAGGING"||e.phase==="DROP_PENDING"||(process.env.NODE_ENV!=="production"?f(!1,`Cannot animate drop from phase ${e.phase}`):f()),{phase:"DROP_ANIMATING",completed:n,dropDuration:r,newHomeClientOffset:o,dimensions:e.dimensions}}if(t.type==="DROP_COMPLETE"){const{completed:n}=t.payload;return{phase:"IDLE",completed:n,shouldFlush:!1}}return e};function P(e,t){return e instanceof Object&&"type"in e&&e.type===t}const Js=e=>({type:"BEFORE_INITIAL_CAPTURE",payload:e}),Zs=e=>({type:"LIFT",payload:e}),Qs=e=>({type:"INITIAL_PUBLISH",payload:e}),ec=e=>({type:"PUBLISH_WHILE_DRAGGING",payload:e}),tc=()=>({type:"COLLECTION_STARTING",payload:null}),nc=e=>({type:"UPDATE_DROPPABLE_SCROLL",payload:e}),rc=e=>({type:"UPDATE_DROPPABLE_IS_ENABLED",payload:e}),oc=e=>({type:"UPDATE_DROPPABLE_IS_COMBINE_ENABLED",payload:e}),Ar=e=>({type:"MOVE",payload:e}),ic=e=>({type:"MOVE_BY_WINDOW_SCROLL",payload:e}),sc=e=>({type:"UPDATE_VIEWPORT_MAX_SCROLL",payload:e}),cc=()=>({type:"MOVE_UP",payload:null}),ac=()=>({type:"MOVE_DOWN",payload:null}),lc=()=>({type:"MOVE_RIGHT",payload:null}),dc=()=>({type:"MOVE_LEFT",payload:null}),Vt=()=>({type:"FLUSH",payload:null}),uc=e=>({type:"DROP_ANIMATE",payload:e}),Lt=e=>({type:"DROP_COMPLETE",payload:e}),_r=e=>({type:"DROP",payload:e}),pc=e=>({type:"DROP_PENDING",payload:e}),Pr=()=>({type:"DROP_ANIMATION_FINISHED",payload:null});function fc(e){if(e.length<=1)return;const t=e.map(o=>o.descriptor.index),n={};for(let o=1;o<t.length;o++){const i=t[o],s=t[o-1];i!==s+1&&(n[i]=!0)}if(!Object.keys(n).length)return;const r=t.map(o=>!!n[o]?`[🔥${o}]`:`${o}`).join(", ");process.env.NODE_ENV!=="production"&&B(`
66
+ `}};function zi(e,t){return!!(e===t||Number.isNaN(e)&&Number.isNaN(t))}function er(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!zi(e[n],t[n]))return!1;return!0}function S(e,t){const n=D.useState(()=>({inputs:t,result:e()}))[0],r=D.useRef(!0),o=D.useRef(n),s=r.current||!!(t&&o.current.inputs&&er(t,o.current.inputs))?o.current:{inputs:t,result:e()};return D.useEffect(()=>{r.current=!1,o.current=s},[s]),s.result}function x(e,t){return S(()=>e,t)}const R={x:0,y:0},$=(e,t)=>({x:e.x+t.x,y:e.y+t.y}),k=(e,t)=>({x:e.x-t.x,y:e.y-t.y}),ne=(e,t)=>e.x===t.x&&e.y===t.y,ae=e=>({x:e.x!==0?-e.x:0,y:e.y!==0?-e.y:0}),oe=(e,t,n=0)=>e==="x"?{x:t,y:n}:{x:n,y:t},be=(e,t)=>Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2),tr=(e,t)=>Math.min(...t.map(n=>be(e,n))),nr=e=>t=>({x:e(t.x),y:e(t.y)});var qi=(e,t)=>{const n=K({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};const ve=(e,t)=>({top:e.top+t.y,left:e.left+t.x,bottom:e.bottom+t.y,right:e.right+t.x}),rr=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}],Yi={top:0,right:0,bottom:0,left:0},Xi=(e,t)=>t?ve(e,t.scroll.diff.displacement):e,Ki=(e,t,n)=>n&&n.increasedBy?{...e,[t.end]:e[t.end]+n.increasedBy[t.line]}:e,Ji=(e,t)=>t&&t.shouldClipSubject?qi(t.pageMarginBox,e):K(e);var le=({page:e,withPlaceholder:t,axis:n,frame:r})=>{const o=Xi(e.marginBox,r),i=Ki(o,n,t),s=Ji(i,r);return{page:e,withPlaceholder:t,active:s}},xt=(e,t)=>{e.frame||(process.env.NODE_ENV,g());const n=e.frame,r=k(t,n.scroll.initial),o=ae(r),i={...n,scroll:{initial:n.scroll.initial,current:t,diff:{value:r,displacement:o},max:n.scroll.max}},s=le({page:e.subject.page,withPlaceholder:e.subject.withPlaceholder,axis:e.axis,frame:i});return{...e,frame:i,subject:s}};function M(e,t=er){let n=null;function r(...o){if(n&&n.lastThis===this&&t(o,n.lastArgs))return n.lastResult;const i=e.apply(this,o);return n={lastResult:i,lastArgs:o,lastThis:this},i}return r.clear=function(){n=null},r}const or=M(e=>e.reduce((t,n)=>(t[n.descriptor.id]=n,t),{})),ir=M(e=>e.reduce((t,n)=>(t[n.descriptor.id]=n,t),{})),He=M(e=>Object.values(e)),Zi=M(e=>Object.values(e));var ie=M((e,t)=>Zi(t).filter(r=>e===r.descriptor.droppableId).sort((r,o)=>r.descriptor.index-o.descriptor.index));function It(e){return e.at&&e.at.type==="REORDER"?e.at.destination:null}function je(e){return e.at&&e.at.type==="COMBINE"?e.at.combine:null}var ze=M((e,t)=>t.filter(n=>n.descriptor.id!==e.descriptor.id)),Qi=({isMovingForward:e,draggable:t,destination:n,insideDestination:r,previousImpact:o})=>{if(!n.isCombineEnabled||!It(o))return null;function s(f){const m={type:"COMBINE",combine:{draggableId:f,droppableId:n.descriptor.id}};return{...o,at:m}}const c=o.displaced.all,a=c.length?c[0]:null;if(e)return a?s(a):null;const d=ze(t,r);if(!a){if(!d.length)return null;const f=d[d.length-1];return s(f.descriptor.id)}const p=d.findIndex(f=>f.descriptor.id===a);p===-1&&(process.env.NODE_ENV!=="production"?g(!1,"Could not find displaced item in set"):g());const l=p-1;if(l<0)return null;const u=d[l];return s(u.descriptor.id)},de=(e,t)=>e.descriptor.droppableId===t.descriptor.id;const sr={point:R,value:0},ye={invisible:{},visible:{},all:[]},es={displaced:ye,displacedBy:sr,at:null};var X=(e,t)=>n=>e<=n&&n<=t,cr=e=>{const t=X(e.top,e.bottom),n=X(e.left,e.right);return r=>{if(t(r.top)&&t(r.bottom)&&n(r.left)&&n(r.right))return!0;const i=t(r.top)||t(r.bottom),s=n(r.left)||n(r.right);if(i&&s)return!0;const a=r.top<e.top&&r.bottom>e.bottom,d=r.left<e.left&&r.right>e.right;return a&&d?!0:a&&s||d&&i}},ts=e=>{const t=X(e.top,e.bottom),n=X(e.left,e.right);return r=>t(r.top)&&t(r.bottom)&&n(r.left)&&n(r.right)};const Ot={direction:"vertical",line:"y",crossAxisLine:"x",start:"top",end:"bottom",size:"height",crossAxisStart:"left",crossAxisEnd:"right",crossAxisSize:"width"},ar={direction:"horizontal",line:"x",crossAxisLine:"y",start:"left",end:"right",size:"width",crossAxisStart:"top",crossAxisEnd:"bottom",crossAxisSize:"height"};var ns=e=>t=>{const n=X(t.top,t.bottom),r=X(t.left,t.right);return o=>e===Ot?n(o.top)&&n(o.bottom):r(o.left)&&r(o.right)};const rs=(e,t)=>{const n=t.frame?t.frame.scroll.diff.displacement:R;return ve(e,n)},os=(e,t,n)=>t.subject.active?n(t.subject.active)(e):!1,is=(e,t,n)=>n(t)(e),Ct=({target:e,destination:t,viewport:n,withDroppableDisplacement:r,isVisibleThroughFrameFn:o})=>{const i=r?rs(e,t):e;return os(i,t,o)&&is(i,n,o)},ss=e=>Ct({...e,isVisibleThroughFrameFn:cr}),lr=e=>Ct({...e,isVisibleThroughFrameFn:ts}),cs=e=>Ct({...e,isVisibleThroughFrameFn:ns(e.destination.axis)}),as=(e,t,n)=>{if(typeof n=="boolean")return n;if(!t)return!0;const{invisible:r,visible:o}=t;if(r[e])return!1;const i=o[e];return i?i.shouldAnimate:!0};function ls(e,t){const n=e.page.marginBox,r={top:t.point.y,right:0,bottom:0,left:t.point.x};return K(yt(n,r))}function Ee({afterDragging:e,destination:t,displacedBy:n,viewport:r,forceShouldAnimate:o,last:i}){return e.reduce(function(c,a){const d=ls(a,n),p=a.descriptor.id;if(c.all.push(p),!ss({target:d,destination:t,viewport:r,withDroppableDisplacement:!0}))return c.invisible[a.descriptor.id]=!0,c;const u=as(p,i,o),f={draggableId:p,shouldAnimate:u};return c.visible[p]=f,c},{all:[],visible:{},invisible:{}})}function ds(e,t){if(!e.length)return 0;const n=e[e.length-1].descriptor.index;return t.inHomeList?n:n+1}function dr({insideDestination:e,inHomeList:t,displacedBy:n,destination:r}){const o=ds(e,{inHomeList:t});return{displaced:ye,displacedBy:n,at:{type:"REORDER",destination:{droppableId:r.descriptor.id,index:o}}}}function qe({draggable:e,insideDestination:t,destination:n,viewport:r,displacedBy:o,last:i,index:s,forceShouldAnimate:c}){const a=de(e,n);if(s==null)return dr({insideDestination:t,inHomeList:a,displacedBy:o,destination:n});const d=t.find(m=>m.descriptor.index===s);if(!d)return dr({insideDestination:t,inHomeList:a,displacedBy:o,destination:n});const p=ze(e,t),l=t.indexOf(d),u=p.slice(l);return{displaced:Ee({afterDragging:u,destination:n,displacedBy:o,last:i,viewport:r.frame,forceShouldAnimate:c}),displacedBy:o,at:{type:"REORDER",destination:{droppableId:n.descriptor.id,index:s}}}}function re(e,t){return!!t.effected[e]}var us=({isMovingForward:e,destination:t,draggables:n,combine:r,afterCritical:o})=>{if(!t.isCombineEnabled)return null;const i=r.draggableId,c=n[i].descriptor.index;return re(i,o)?e?c:c-1:e?c+1:c},ps=({isMovingForward:e,isInHomeList:t,insideDestination:n,location:r})=>{if(!n.length)return null;const o=r.index,i=e?o+1:o-1,s=n[0].descriptor.index,c=n[n.length-1].descriptor.index,a=t?c:c+1;return i<s||i>a?null:i},fs=({isMovingForward:e,isInHomeList:t,draggable:n,draggables:r,destination:o,insideDestination:i,previousImpact:s,viewport:c,afterCritical:a})=>{const d=s.at;if(d||(process.env.NODE_ENV!=="production"?g(!1,"Cannot move in direction without previous impact location"):g()),d.type==="REORDER"){const l=ps({isMovingForward:e,isInHomeList:t,location:d.destination,insideDestination:i});return l==null?null:qe({draggable:n,insideDestination:i,destination:o,viewport:c,last:s.displaced,displacedBy:s.displacedBy,index:l})}const p=us({isMovingForward:e,destination:o,displaced:s.displaced,draggables:r,combine:d.combine,afterCritical:a});return p==null?null:qe({draggable:n,insideDestination:i,destination:o,viewport:c,last:s.displaced,displacedBy:s.displacedBy,index:p})},gs=({displaced:e,afterCritical:t,combineWith:n,displacedBy:r})=>{const o=!!(e.visible[n]||e.invisible[n]);return re(n,t)?o?R:ae(r.point):o?r.point:R},ms=({afterCritical:e,impact:t,draggables:n})=>{const r=je(t);r||(process.env.NODE_ENV,g());const o=r.draggableId,i=n[o].page.borderBox.center,s=gs({displaced:t.displaced,afterCritical:e,combineWith:o,displacedBy:t.displacedBy});return $(i,s)};const ur=(e,t)=>t.margin[e.start]+t.borderBox[e.size]/2,hs=(e,t)=>t.margin[e.end]+t.borderBox[e.size]/2,St=(e,t,n)=>t[e.crossAxisStart]+n.margin[e.crossAxisStart]+n.borderBox[e.crossAxisSize]/2,pr=({axis:e,moveRelativeTo:t,isMoving:n})=>oe(e.line,t.marginBox[e.end]+ur(e,n),St(e,t.marginBox,n)),fr=({axis:e,moveRelativeTo:t,isMoving:n})=>oe(e.line,t.marginBox[e.start]-hs(e,n),St(e,t.marginBox,n)),bs=({axis:e,moveInto:t,isMoving:n})=>oe(e.line,t.contentBox[e.start]+ur(e,n),St(e,t.contentBox,n));var vs=({impact:e,draggable:t,draggables:n,droppable:r,afterCritical:o})=>{const i=ie(r.descriptor.id,n),s=t.page,c=r.axis;if(!i.length)return bs({axis:c,moveInto:r.page,isMoving:s});const{displaced:a,displacedBy:d}=e,p=a.all[0];if(p){const u=n[p];if(re(p,o))return fr({axis:c,moveRelativeTo:u.page,isMoving:s});const f=Ge(u.page,d.point);return fr({axis:c,moveRelativeTo:f,isMoving:s})}const l=i[i.length-1];if(l.descriptor.id===t.descriptor.id)return s.borderBox.center;if(re(l.descriptor.id,o)){const u=Ge(l.page,ae(o.displacedBy.point));return pr({axis:c,moveRelativeTo:u,isMoving:s})}return pr({axis:c,moveRelativeTo:l.page,isMoving:s})},wt=(e,t)=>{const n=e.frame;return n?$(t,n.scroll.diff.displacement):t};const ys=({impact:e,draggable:t,droppable:n,draggables:r,afterCritical:o})=>{const i=t.page.borderBox.center,s=e.at;return!n||!s?i:s.type==="REORDER"?vs({impact:e,draggable:t,draggables:r,droppable:n,afterCritical:o}):ms({impact:e,draggables:r,afterCritical:o})};var Ye=e=>{const t=ys(e),n=e.droppable;return n?wt(n,t):t},gr=(e,t)=>{const n=k(t,e.scroll.initial),r=ae(n);return{frame:K({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 mr(e,t){return e.map(n=>t[n])}function Es(e,t){for(let n=0;n<t.length;n++){const r=t[n].visible[e];if(r)return r}return null}var Ds=({impact:e,viewport:t,destination:n,draggables:r,maxScrollChange:o})=>{const i=gr(t,$(t.scroll.current,o)),s=n.frame?xt(n,$(n.frame.scroll.current,o)):n,c=e.displaced,a=Ee({afterDragging:mr(c.all,r),destination:n,displacedBy:e.displacedBy,viewport:i.frame,last:c,forceShouldAnimate:!1}),d=Ee({afterDragging:mr(c.all,r),destination:s,displacedBy:e.displacedBy,viewport:t.frame,last:c,forceShouldAnimate:!1}),p={},l={},u=[c,a,d];return c.all.forEach(m=>{const b=Es(m,u);if(b){l[m]=b;return}p[m]=!0}),{...e,displaced:{all:c.all,invisible:p,visible:l}}},Ns=(e,t)=>$(e.scroll.diff.displacement,t),At=({pageBorderBoxCenter:e,draggable:t,viewport:n})=>{const r=Ns(n,e),o=k(r,t.page.borderBox.center);return $(t.client.borderBox.center,o)},hr=({draggable:e,destination:t,newPageBorderBoxCenter:n,viewport:r,withDroppableDisplacement:o,onlyOnMainAxis:i=!1})=>{const s=k(n,e.page.borderBox.center),a={target:ve(e.page.borderBox,s),destination:t,withDroppableDisplacement:o,viewport:r};return i?cs(a):lr(a)},xs=({isMovingForward:e,draggable:t,destination:n,draggables:r,previousImpact:o,viewport:i,previousPageBorderBoxCenter:s,previousClientSelection:c,afterCritical:a})=>{if(!n.isEnabled)return null;const d=ie(n.descriptor.id,r),p=de(t,n),l=Qi({isMovingForward:e,draggable:t,destination:n,insideDestination:d,previousImpact:o})||fs({isMovingForward:e,isInHomeList:p,draggable:t,draggables:r,destination:n,insideDestination:d,previousImpact:o,viewport:i,afterCritical:a});if(!l)return null;const u=Ye({impact:l,draggable:t,droppable:n,draggables:r,afterCritical:a});if(hr({draggable:t,destination:n,newPageBorderBoxCenter:u,viewport:i.frame,withDroppableDisplacement:!1,onlyOnMainAxis:!0}))return{clientSelection:At({pageBorderBoxCenter:u,draggable:t,viewport:i}),impact:l,scrollJumpRequest:null};const m=k(u,s),b=Ds({impact:l,viewport:i,destination:n,draggables:r,maxScrollChange:m});return{clientSelection:c,impact:b,scrollJumpRequest:m}};const F=e=>{const t=e.subject.active;return t||(process.env.NODE_ENV!=="production"?g(!1,"Cannot get clipped area from droppable"):g()),t};var Is=({isMovingForward:e,pageBorderBoxCenter:t,source:n,droppables:r,viewport:o})=>{const i=n.subject.active;if(!i)return null;const s=n.axis,c=X(i[s.start],i[s.end]),a=He(r).filter(p=>p!==n).filter(p=>p.isEnabled).filter(p=>!!p.subject.active).filter(p=>cr(o.frame)(F(p))).filter(p=>{const l=F(p);return e?i[s.crossAxisEnd]<l[s.crossAxisEnd]:l[s.crossAxisStart]<i[s.crossAxisStart]}).filter(p=>{const l=F(p),u=X(l[s.start],l[s.end]);return c(l[s.start])||c(l[s.end])||u(i[s.start])||u(i[s.end])}).sort((p,l)=>{const u=F(p)[s.crossAxisStart],f=F(l)[s.crossAxisStart];return e?u-f:f-u}).filter((p,l,u)=>F(p)[s.crossAxisStart]===F(u[0])[s.crossAxisStart]);if(!a.length)return null;if(a.length===1)return a[0];const d=a.filter(p=>X(F(p)[s.start],F(p)[s.end])(t[s.line]));return d.length===1?d[0]:d.length>1?d.sort((p,l)=>F(p)[s.start]-F(l)[s.start])[0]:a.sort((p,l)=>{const u=tr(t,rr(F(p))),f=tr(t,rr(F(l)));return u!==f?u-f:F(p)[s.start]-F(l)[s.start]})[0]};const br=(e,t)=>{const n=e.page.borderBox.center;return re(e.descriptor.id,t)?k(n,t.displacedBy.point):n},Os=(e,t)=>{const n=e.page.borderBox;return re(e.descriptor.id,t)?ve(n,ae(t.displacedBy.point)):n};var Cs=({pageBorderBoxCenter:e,viewport:t,destination:n,insideDestination:r,afterCritical:o})=>r.filter(s=>lr({target:Os(s,o),destination:n,viewport:t.frame,withDroppableDisplacement:!0})).sort((s,c)=>{const a=be(e,wt(n,br(s,o))),d=be(e,wt(n,br(c,o)));return a<d?-1:d<a?1:s.descriptor.index-c.descriptor.index})[0]||null,De=M(function(t,n){const r=n[t.line];return{value:r,point:oe(t.line,r)}});const Ss=(e,t,n)=>{const r=e.axis;if(e.descriptor.mode==="virtual")return oe(r.line,t[r.line]);const o=e.subject.page.contentBox[r.size],a=ie(e.descriptor.id,n).reduce((d,p)=>d+p.client.marginBox[r.size],0)+t[r.line]-o;return a<=0?null:oe(r.line,a)},vr=(e,t)=>({...e,scroll:{...e.scroll,max:t}}),yr=(e,t,n)=>{const r=e.frame;de(t,e)&&(process.env.NODE_ENV!=="production"?g(!1,"Should not add placeholder space to home list"):g()),e.subject.withPlaceholder&&(process.env.NODE_ENV!=="production"?g(!1,"Cannot add placeholder size to a subject when it already has one"):g());const o=De(e.axis,t.displaceBy).point,i=Ss(e,o,n),s={placeholderSize:o,increasedBy:i,oldFrameMaxScroll:e.frame?e.frame.scroll.max:null};if(!r){const p=le({page:e.subject.page,withPlaceholder:s,axis:e.axis,frame:e.frame});return{...e,subject:p}}const c=i?$(r.scroll.max,i):r.scroll.max,a=vr(r,c),d=le({page:e.subject.page,withPlaceholder:s,axis:e.axis,frame:a});return{...e,subject:d,frame:a}},ws=e=>{const t=e.subject.withPlaceholder;t||(process.env.NODE_ENV!=="production"?g(!1,"Cannot remove placeholder form subject when there was none"):g());const n=e.frame;if(!n){const s=le({page:e.subject.page,axis:e.axis,frame:null,withPlaceholder:null});return{...e,subject:s}}const r=t.oldFrameMaxScroll;r||(process.env.NODE_ENV!=="production"?g(!1,"Expected droppable with frame to have old max frame scroll when removing placeholder"):g());const o=vr(n,r),i=le({page:e.subject.page,axis:e.axis,frame:o,withPlaceholder:null});return{...e,subject:i,frame:o}};var As=({previousPageBorderBoxCenter:e,moveRelativeTo:t,insideDestination:n,draggable:r,draggables:o,destination:i,viewport:s,afterCritical:c})=>{if(!t){if(n.length)return null;const l={displaced:ye,displacedBy:sr,at:{type:"REORDER",destination:{droppableId:i.descriptor.id,index:0}}},u=Ye({impact:l,draggable:r,droppable:i,draggables:o,afterCritical:c}),f=de(r,i)?i:yr(i,r,o);return hr({draggable:r,destination:f,newPageBorderBoxCenter:u,viewport:s.frame,withDroppableDisplacement:!1,onlyOnMainAxis:!0})?l:null}const a=e[i.axis.line]<=t.page.borderBox.center[i.axis.line],d=(()=>{const l=t.descriptor.index;return t.descriptor.id===r.descriptor.id||a?l:l+1})(),p=De(i.axis,r.displaceBy);return qe({draggable:r,insideDestination:n,destination:i,viewport:s,displacedBy:p,last:ye,index:d})},_s=({isMovingForward:e,previousPageBorderBoxCenter:t,draggable:n,isOver:r,draggables:o,droppables:i,viewport:s,afterCritical:c})=>{const a=Is({isMovingForward:e,pageBorderBoxCenter:t,source:r,droppables:i,viewport:s});if(!a)return null;const d=ie(a.descriptor.id,o),p=Cs({pageBorderBoxCenter:t,viewport:s,destination:a,insideDestination:d,afterCritical:c}),l=As({previousPageBorderBoxCenter:t,destination:a,draggable:n,draggables:o,moveRelativeTo:p,insideDestination:d,viewport:s,afterCritical:c});if(!l)return null;const u=Ye({impact:l,draggable:n,droppable:a,draggables:o,afterCritical:c});return{clientSelection:At({pageBorderBoxCenter:u,draggable:n,viewport:s}),impact:l,scrollJumpRequest:null}},W=e=>{const t=e.at;return t?t.type==="REORDER"?t.destination.droppableId:t.combine.droppableId:null};const Ps=(e,t)=>{const n=W(e);return n?t[n]:null};var Ts=({state:e,type:t})=>{const n=Ps(e.impact,e.dimensions.droppables),r=!!n,o=e.dimensions.droppables[e.critical.droppable.id],i=n||o,s=i.axis.direction,c=s==="vertical"&&(t==="MOVE_UP"||t==="MOVE_DOWN")||s==="horizontal"&&(t==="MOVE_LEFT"||t==="MOVE_RIGHT");if(c&&!r)return null;const a=t==="MOVE_DOWN"||t==="MOVE_RIGHT",d=e.dimensions.draggables[e.critical.draggable.id],p=e.current.page.borderBoxCenter,{draggables:l,droppables:u}=e.dimensions;return c?xs({isMovingForward:a,previousPageBorderBoxCenter:p,draggable:d,destination:i,draggables:l,viewport:e.viewport,previousClientSelection:e.current.client.selection,previousImpact:e.impact,afterCritical:e.afterCritical}):_s({isMovingForward:a,previousPageBorderBoxCenter:p,draggable:d,isOver:i,draggables:l,droppables:u,viewport:e.viewport,afterCritical:e.afterCritical})};function se(e){return e.phase==="DRAGGING"||e.phase==="COLLECTING"}function Er(e){const t=X(e.top,e.bottom),n=X(e.left,e.right);return function(o){return t(o.y)&&n(o.x)}}function Bs(e,t){return e.left<t.right&&e.right>t.left&&e.top<t.bottom&&e.bottom>t.top}function Vs({pageBorderBox:e,draggable:t,candidates:n}){const r=t.page.borderBox.center,o=n.map(i=>{const s=i.axis,c=oe(i.axis.line,e.center[s.line],i.page.borderBox.center[s.crossAxisLine]);return{id:i.descriptor.id,distance:be(r,c)}}).sort((i,s)=>s.distance-i.distance);return o[0]?o[0].id:null}function Ls({pageBorderBox:e,draggable:t,droppables:n}){const r=He(n).filter(o=>{if(!o.isEnabled)return!1;const i=o.subject.active;if(!i||!Bs(e,i))return!1;if(Er(i)(e.center))return!0;const s=o.axis,c=i.center[s.crossAxisLine],a=e[s.crossAxisStart],d=e[s.crossAxisEnd],p=X(i[s.crossAxisStart],i[s.crossAxisEnd]),l=p(a),u=p(d);return!l&&!u?!0:l?a<c:d>c});return r.length?r.length===1?r[0].descriptor.id:Vs({pageBorderBox:e,draggable:t,candidates:r}):null}const Dr=(e,t)=>K(ve(e,t));var Rs=(e,t)=>{const n=e.frame;return n?Dr(t,n.scroll.diff.value):t};function Nr({displaced:e,id:t}){return!!(e.visible[t]||e.invisible[t])}function Ms({draggable:e,closest:t,inHomeList:n}){return t?n&&t.descriptor.index>e.descriptor.index?t.descriptor.index-1:t.descriptor.index:null}var $s=({pageBorderBoxWithDroppableScroll:e,draggable:t,destination:n,insideDestination:r,last:o,viewport:i,afterCritical:s})=>{const c=n.axis,a=De(n.axis,t.displaceBy),d=a.value,p=e[c.start],l=e[c.end],f=ze(t,r).find(b=>{const h=b.descriptor.id,E=b.page.borderBox.center[c.line],v=re(h,s),C=Nr({displaced:o,id:h});return v?C?l<=E:p<E-d:C?l<=E+d:p<E})||null,m=Ms({draggable:t,closest:f,inHomeList:de(t,n)});return qe({draggable:t,insideDestination:r,destination:n,viewport:i,last:o,displacedBy:a,index:m})};const Gs=4;var Fs=({draggable:e,pageBorderBoxWithDroppableScroll:t,previousImpact:n,destination:r,insideDestination:o,afterCritical:i})=>{if(!r.isCombineEnabled)return null;const s=r.axis,c=De(r.axis,e.displaceBy),a=c.value,d=t[s.start],p=t[s.end],u=ze(e,o).find(m=>{const b=m.descriptor.id,h=m.page.borderBox,v=h[s.size]/Gs,C=re(b,i),I=Nr({displaced:n.displaced,id:b});return C?I?p>h[s.start]+v&&p<h[s.end]-v:d>h[s.start]-a+v&&d<h[s.end]-a-v:I?p>h[s.start]+a+v&&p<h[s.end]+a-v:d>h[s.start]+v&&d<h[s.end]-v});return u?{displacedBy:c,displaced:n.displaced,at:{type:"COMBINE",combine:{draggableId:u.descriptor.id,droppableId:r.descriptor.id}}}:null},xr=({pageOffset:e,draggable:t,draggables:n,droppables:r,previousImpact:o,viewport:i,afterCritical:s})=>{const c=Dr(t.page.borderBox,e),a=Ls({pageBorderBox:c,draggable:t,droppables:r});if(!a)return es;const d=r[a],p=ie(d.descriptor.id,n),l=Rs(d,c);return Fs({pageBorderBoxWithDroppableScroll:l,draggable:t,previousImpact:o,destination:d,insideDestination:p,afterCritical:s})||$s({pageBorderBoxWithDroppableScroll:l,draggable:t,destination:d,insideDestination:p,last:o.displaced,viewport:i,afterCritical:s})},_t=(e,t)=>({...e,[t.descriptor.id]:t});const ks=({previousImpact:e,impact:t,droppables:n})=>{const r=W(e),o=W(t);if(!r||r===o)return n;const i=n[r];if(!i.subject.withPlaceholder)return n;const s=ws(i);return _t(n,s)};var Ws=({draggable:e,draggables:t,droppables:n,previousImpact:r,impact:o})=>{const i=ks({previousImpact:r,impact:o,droppables:n}),s=W(o);if(!s)return i;const c=n[s];if(de(e,c)||c.subject.withPlaceholder)return i;const a=yr(c,e,t);return _t(i,a)},Ne=({state:e,clientSelection:t,dimensions:n,viewport:r,impact:o,scrollJumpRequest:i})=>{const s=r||e.viewport,c=n||e.dimensions,a=t||e.current.client.selection,d=k(a,e.initial.client.selection),p={offset:d,selection:a,borderBoxCenter:$(e.initial.client.borderBoxCenter,d)},l={selection:$(p.selection,s.scroll.current),borderBoxCenter:$(p.borderBoxCenter,s.scroll.current),offset:$(p.offset,s.scroll.diff.value)},u={client:p,page:l};if(e.phase==="COLLECTING")return{...e,dimensions:c,viewport:s,current:u};const f=c.draggables[e.critical.draggable.id],m=o||xr({pageOffset:l.offset,draggable:f,draggables:c.draggables,droppables:c.droppables,previousImpact:e.impact,viewport:s,afterCritical:e.afterCritical}),b=Ws({draggable:f,impact:m,previousImpact:e.impact,draggables:c.draggables,droppables:c.droppables});return{...e,current:u,dimensions:{draggables:c.draggables,droppables:b},impact:m,viewport:s,scrollJumpRequest:i||null,forceShouldAnimate:i?!1:null}};function Us(e,t){return e.map(n=>t[n])}var Ir=({impact:e,viewport:t,draggables:n,destination:r,forceShouldAnimate:o})=>{const i=e.displaced,s=Us(i.all,n),c=Ee({afterDragging:s,destination:r,displacedBy:e.displacedBy,viewport:t.frame,forceShouldAnimate:o,last:i});return{...e,displaced:c}},Or=({impact:e,draggable:t,droppable:n,draggables:r,viewport:o,afterCritical:i})=>{const s=Ye({impact:e,draggable:t,draggables:r,droppable:n,afterCritical:i});return At({pageBorderBoxCenter:s,draggable:t,viewport:o})},Cr=({state:e,dimensions:t,viewport:n})=>{e.movementMode!=="SNAP"&&(process.env.NODE_ENV,g());const r=e.impact,o=n||e.viewport,i=t||e.dimensions,{draggables:s,droppables:c}=i,a=s[e.critical.draggable.id],d=W(r);d||(process.env.NODE_ENV!=="production"?g(!1,"Must be over a destination in SNAP movement mode"):g());const p=c[d],l=Ir({impact:r,viewport:o,destination:p,draggables:s}),u=Or({impact:l,draggable:a,droppable:p,draggables:s,viewport:o,afterCritical:e.afterCritical});return Ne({impact:l,clientSelection:u,state:e,dimensions:i,viewport:o})},Hs=e=>({index:e.index,droppableId:e.droppableId}),Sr=({draggable:e,home:t,draggables:n,viewport:r})=>{const o=De(t.axis,e.displaceBy),i=ie(t.descriptor.id,n),s=i.indexOf(e);s===-1&&(process.env.NODE_ENV!=="production"?g(!1,"Expected draggable to be inside home list"):g());const c=i.slice(s+1),a=c.reduce((u,f)=>(u[f.descriptor.id]=!0,u),{}),d={inVirtualList:t.descriptor.mode==="virtual",displacedBy:o,effected:a};return{impact:{displaced:Ee({afterDragging:c,destination:t,displacedBy:o,last:null,viewport:r.frame,forceShouldAnimate:!1}),displacedBy:o,at:{type:"REORDER",destination:Hs(e.descriptor)}},afterCritical:d}},js=(e,t)=>({draggables:e.draggables,droppables:_t(e.droppables,t)});const xe=e=>{process.env.NODE_ENV},Ie=e=>{process.env.NODE_ENV};var zs=({draggable:e,offset:t,initialWindowScroll:n})=>{const r=Ge(e.client,t),o=Fe(r,n);return{...e,placeholder:{...e.placeholder,client:r},client:r,page:o}},qs=e=>{const t=e.frame;return t||(process.env.NODE_ENV!=="production"?g(!1,"Expected Droppable to have a frame"):g()),t},Ys=({additions:e,updatedDroppables:t,viewport:n})=>{const r=n.scroll.diff.value;return e.map(o=>{const i=o.descriptor.droppableId,s=t[i],a=qs(s).scroll.diff.value,d=$(r,a);return zs({draggable:o,offset:d,initialWindowScroll:n.scroll.initial})})},Xs=({state:e,published:t})=>{xe();const n=t.modified.map(E=>{const v=e.dimensions.droppables[E.droppableId];return xt(v,E.scroll)}),r={...e.dimensions.droppables,...or(n)},o=ir(Ys({additions:t.additions,updatedDroppables:r,viewport:e.viewport})),i={...e.dimensions.draggables,...o};t.removals.forEach(E=>{delete i[E]});const s={droppables:r,draggables:i},c=W(e.impact),a=c?s.droppables[c]:null,d=s.draggables[e.critical.draggable.id],p=s.droppables[e.critical.droppable.id],{impact:l,afterCritical:u}=Sr({draggable:d,home:p,draggables:i,viewport:e.viewport}),f=a&&a.isCombineEnabled?e.impact:l,m=xr({pageOffset:e.current.page.offset,draggable:s.draggables[e.critical.draggable.id],draggables:s.draggables,droppables:s.droppables,previousImpact:f,viewport:e.viewport,afterCritical:u});Ie();const b={...e,phase:"DRAGGING",impact:m,onLiftImpact:l,dimensions:s,afterCritical:u,forceShouldAnimate:!1};return e.phase==="COLLECTING"?b:{...b,phase:"DROP_PENDING",reason:e.reason,isWaiting:!1}};const Pt=e=>e.movementMode==="SNAP",Tt=(e,t,n)=>{const r=js(e.dimensions,t);return!Pt(e)||n?Ne({state:e,dimensions:r}):Cr({state:e,dimensions:r})};function Bt(e){return e.isDragging&&e.movementMode==="SNAP"?{...e,scrollJumpRequest:null}:e}const wr={phase:"IDLE",completed:null,shouldFlush:!1};var Ks=(e=wr,t)=>{if(t.type==="FLUSH")return{...wr,shouldFlush:!0};if(t.type==="INITIAL_PUBLISH"){e.phase!=="IDLE"&&(process.env.NODE_ENV!=="production"?g(!1,"INITIAL_PUBLISH must come after a IDLE phase"):g());const{critical:n,clientSelection:r,viewport:o,dimensions:i,movementMode:s}=t.payload,c=i.draggables[n.draggable.id],a=i.droppables[n.droppable.id],d={selection:r,borderBoxCenter:c.client.borderBox.center,offset:R},p={client:d,page:{selection:$(d.selection,o.scroll.initial),borderBoxCenter:$(d.selection,o.scroll.initial),offset:$(d.selection,o.scroll.diff.value)}},l=He(i.droppables).every(b=>!b.isFixedOnPage),{impact:u,afterCritical:f}=Sr({draggable:c,home:a,draggables:i.draggables,viewport:o});return{phase:"DRAGGING",isDragging:!0,critical:n,movementMode:s,dimensions:i,initial:p,current:p,isWindowScrollAllowed:l,impact:u,afterCritical:f,onLiftImpact:u,viewport:o,scrollJumpRequest:null,forceShouldAnimate:null}}if(t.type==="COLLECTION_STARTING")return e.phase==="COLLECTING"||e.phase==="DROP_PENDING"?e:(e.phase!=="DRAGGING"&&(process.env.NODE_ENV!=="production"?g(!1,`Collection cannot start from phase ${e.phase}`):g()),{...e,phase:"COLLECTING"});if(t.type==="PUBLISH_WHILE_DRAGGING")return e.phase==="COLLECTING"||e.phase==="DROP_PENDING"||(process.env.NODE_ENV!=="production"?g(!1,`Unexpected ${t.type} received in phase ${e.phase}`):g()),Xs({state:e,published:t.payload});if(t.type==="MOVE"){if(e.phase==="DROP_PENDING")return e;se(e)||(process.env.NODE_ENV!=="production"?g(!1,`${t.type} not permitted in phase ${e.phase}`):g());const{client:n}=t.payload;return ne(n,e.current.client.selection)?e:Ne({state:e,clientSelection:n,impact:Pt(e)?e.impact:null})}if(t.type==="UPDATE_DROPPABLE_SCROLL"){if(e.phase==="DROP_PENDING"||e.phase==="COLLECTING")return Bt(e);se(e)||(process.env.NODE_ENV!=="production"?g(!1,`${t.type} not permitted in phase ${e.phase}`):g());const{id:n,newScroll:r}=t.payload,o=e.dimensions.droppables[n];if(!o)return e;const i=xt(o,r);return Tt(e,i,!1)}if(t.type==="UPDATE_DROPPABLE_IS_ENABLED"){if(e.phase==="DROP_PENDING")return e;se(e)||(process.env.NODE_ENV!=="production"?g(!1,`Attempting to move in an unsupported phase ${e.phase}`):g());const{id:n,isEnabled:r}=t.payload,o=e.dimensions.droppables[n];o||(process.env.NODE_ENV!=="production"?g(!1,`Cannot find Droppable[id: ${n}] to toggle its enabled state`):g()),o.isEnabled===r&&(process.env.NODE_ENV!=="production"?g(!1,`Trying to set droppable isEnabled to ${String(r)}
67
+ but it is already ${String(o.isEnabled)}`):g());const i={...o,isEnabled:r};return Tt(e,i,!0)}if(t.type==="UPDATE_DROPPABLE_IS_COMBINE_ENABLED"){if(e.phase==="DROP_PENDING")return e;se(e)||(process.env.NODE_ENV!=="production"?g(!1,`Attempting to move in an unsupported phase ${e.phase}`):g());const{id:n,isCombineEnabled:r}=t.payload,o=e.dimensions.droppables[n];o||(process.env.NODE_ENV!=="production"?g(!1,`Cannot find Droppable[id: ${n}] to toggle its isCombineEnabled state`):g()),o.isCombineEnabled===r&&(process.env.NODE_ENV!=="production"?g(!1,`Trying to set droppable isCombineEnabled to ${String(r)}
68
+ but it is already ${String(o.isCombineEnabled)}`):g());const i={...o,isCombineEnabled:r};return Tt(e,i,!0)}if(t.type==="MOVE_BY_WINDOW_SCROLL"){if(e.phase==="DROP_PENDING"||e.phase==="DROP_ANIMATING")return e;se(e)||(process.env.NODE_ENV!=="production"?g(!1,`Cannot move by window in phase ${e.phase}`):g()),e.isWindowScrollAllowed||(process.env.NODE_ENV!=="production"?g(!1,"Window scrolling is currently not supported for fixed lists"):g());const n=t.payload.newScroll;if(ne(e.viewport.scroll.current,n))return Bt(e);const r=gr(e.viewport,n);return Pt(e)?Cr({state:e,viewport:r}):Ne({state:e,viewport:r})}if(t.type==="UPDATE_VIEWPORT_MAX_SCROLL"){if(!se(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(t.type==="MOVE_UP"||t.type==="MOVE_DOWN"||t.type==="MOVE_LEFT"||t.type==="MOVE_RIGHT"){if(e.phase==="COLLECTING"||e.phase==="DROP_PENDING")return e;e.phase!=="DRAGGING"&&(process.env.NODE_ENV!=="production"?g(!1,`${t.type} received while not in DRAGGING phase`):g());const n=Ts({state:e,type:t.type});return n?Ne({state:e,impact:n.impact,clientSelection:n.clientSelection,scrollJumpRequest:n.scrollJumpRequest}):e}if(t.type==="DROP_PENDING"){const n=t.payload.reason;return e.phase!=="COLLECTING"&&(process.env.NODE_ENV!=="production"?g(!1,"Can only move into the DROP_PENDING phase from the COLLECTING phase"):g()),{...e,phase:"DROP_PENDING",isWaiting:!0,reason:n}}if(t.type==="DROP_ANIMATE"){const{completed:n,dropDuration:r,newHomeClientOffset:o}=t.payload;return e.phase==="DRAGGING"||e.phase==="DROP_PENDING"||(process.env.NODE_ENV!=="production"?g(!1,`Cannot animate drop from phase ${e.phase}`):g()),{phase:"DROP_ANIMATING",completed:n,dropDuration:r,newHomeClientOffset:o,dimensions:e.dimensions}}if(t.type==="DROP_COMPLETE"){const{completed:n}=t.payload;return{phase:"IDLE",completed:n,shouldFlush:!1}}return e};function P(e,t){return e instanceof Object&&"type"in e&&e.type===t}const Js=e=>({type:"BEFORE_INITIAL_CAPTURE",payload:e}),Zs=e=>({type:"LIFT",payload:e}),Qs=e=>({type:"INITIAL_PUBLISH",payload:e}),ec=e=>({type:"PUBLISH_WHILE_DRAGGING",payload:e}),tc=()=>({type:"COLLECTION_STARTING",payload:null}),nc=e=>({type:"UPDATE_DROPPABLE_SCROLL",payload:e}),rc=e=>({type:"UPDATE_DROPPABLE_IS_ENABLED",payload:e}),oc=e=>({type:"UPDATE_DROPPABLE_IS_COMBINE_ENABLED",payload:e}),Ar=e=>({type:"MOVE",payload:e}),ic=e=>({type:"MOVE_BY_WINDOW_SCROLL",payload:e}),sc=e=>({type:"UPDATE_VIEWPORT_MAX_SCROLL",payload:e}),cc=()=>({type:"MOVE_UP",payload:null}),ac=()=>({type:"MOVE_DOWN",payload:null}),lc=()=>({type:"MOVE_RIGHT",payload:null}),dc=()=>({type:"MOVE_LEFT",payload:null}),Vt=()=>({type:"FLUSH",payload:null}),uc=e=>({type:"DROP_ANIMATE",payload:e}),Lt=e=>({type:"DROP_COMPLETE",payload:e}),_r=e=>({type:"DROP",payload:e}),pc=e=>({type:"DROP_PENDING",payload:e}),Pr=()=>({type:"DROP_ANIMATION_FINISHED",payload:null});function fc(e){if(e.length<=1)return;const t=e.map(o=>o.descriptor.index),n={};for(let o=1;o<t.length;o++){const i=t[o],s=t[o-1];i!==s+1&&(n[i]=!0)}if(!Object.keys(n).length)return;const r=t.map(o=>!!n[o]?`[🔥${o}]`:`${o}`).join(", ");process.env.NODE_ENV!=="production"&&B(`
69
69
  Detected non-consecutive <Draggable /> indexes.
70
70
 
71
71
  (This can cause unexpected bugs)
72
72
 
73
73
  ${r}
74
- `)}function gc(e,t){if(process.env.NODE_ENV!=="production"){const n=ie(e.droppable.id,t.draggables);fc(n)}}var mc=e=>({getState:t,dispatch:n})=>r=>o=>{if(!P(o,"LIFT")){r(o);return}const{id:i,clientSelection:s,movementMode:c}=o.payload,a=t();a.phase==="DROP_ANIMATING"&&n(Lt({completed:a.completed})),t().phase!=="IDLE"&&(process.env.NODE_ENV!=="production"?f(!1,"Unexpected phase to start a drag"):f()),n(Vt()),n(Js({draggableId:i,movementMode:c}));const p={draggableId:i,scrollOptions:{shouldPublishImmediately:c==="SNAP"}},{critical:l,dimensions:u,viewport:g}=e.startPublishing(p);gc(l,u),n(Qs({critical:l,dimensions:u,clientSelection:s,movementMode:c,viewport:g}))},hc=e=>()=>t=>n=>{P(n,"INITIAL_PUBLISH")&&e.dragging(),P(n,"DROP_ANIMATE")&&e.dropping(n.payload.completed.result.reason),(P(n,"FLUSH")||P(n,"DROP_COMPLETE"))&&e.resting(),t(n)};const Rt={outOfTheWay:"cubic-bezier(0.2, 0, 0, 1)",drop:"cubic-bezier(.2,1,.1,1)"},Oe={opacity:{drop:0,combining:.7},scale:{drop:.75}},Tr={outOfTheWay:.2,minDropTime:.33,maxDropTime:.55},ce=`${Tr.outOfTheWay}s ${Rt.outOfTheWay}`,Se={fluid:`opacity ${ce}`,snap:`transform ${ce}, opacity ${ce}`,drop:e=>{const t=`${e}s ${Rt.drop}`;return`transform ${t}, opacity ${t}`},outOfTheWay:`transform ${ce}`,placeholder:`height ${ce}, width ${ce}, margin ${ce}`},Br=e=>ne(e,R)?void 0:`translate(${e.x}px, ${e.y}px)`,Mt={moveTo:Br,drop:(e,t)=>{const n=Br(e);if(n)return t?`${n} scale(${Oe.scale.drop})`:n}},{minDropTime:$t,maxDropTime:Vr}=Tr,bc=Vr-$t,Lr=1500,vc=.6;var yc=({current:e,destination:t,reason:n})=>{const r=be(e,t);if(r<=0)return $t;if(r>=Lr)return Vr;const o=r/Lr,i=$t+bc*o,s=n==="CANCEL"?i*vc:i;return Number(s.toFixed(2))},Ec=({impact:e,draggable:t,dimensions:n,viewport:r,afterCritical:o})=>{const{draggables:i,droppables:s}=n,c=W(e),a=c?s[c]:null,d=s[t.descriptor.droppableId],p=Or({impact:e,draggable:t,draggables:i,afterCritical:o,droppable:a||d,viewport:r});return k(p,t.client.borderBox.center)},Dc=({draggables:e,reason:t,lastImpact:n,home:r,viewport:o,onLiftImpact:i})=>!n.at||t!=="DROP"?{impact:Ir({draggables:e,impact:i,destination:r,viewport:o,forceShouldAnimate:!0}),didDropInsideDroppable:!1}:n.at.type==="REORDER"?{impact:n,didDropInsideDroppable:!0}:{impact:{...n,displaced:ye},didDropInsideDroppable:!0};const Nc=({getState:e,dispatch:t})=>n=>r=>{if(!P(r,"DROP")){n(r);return}const o=e(),i=r.payload.reason;if(o.phase==="COLLECTING"){t(pc({reason:i}));return}if(o.phase==="IDLE")return;o.phase==="DROP_PENDING"&&o.isWaiting&&(process.env.NODE_ENV!=="production"?f(!1,"A DROP action occurred while DROP_PENDING and still waiting"):f()),o.phase==="DRAGGING"||o.phase==="DROP_PENDING"||(process.env.NODE_ENV!=="production"?f(!1,`Cannot drop in phase: ${o.phase}`):f());const c=o.critical,a=o.dimensions,d=a.draggables[o.critical.draggable.id],{impact:p,didDropInsideDroppable:l}=Dc({reason:i,lastImpact:o.impact,afterCritical:o.afterCritical,onLiftImpact:o.onLiftImpact,home:o.dimensions.droppables[o.critical.droppable.id],viewport:o.viewport,draggables:o.dimensions.draggables}),u=l?It(p):null,g=l?je(p):null,m={index:c.draggable.index,droppableId:c.droppable.id},b={draggableId:d.descriptor.id,type:d.descriptor.type,source:m,reason:i,mode:o.movementMode,destination:u,combine:g},h=Ec({impact:p,draggable:d,dimensions:a,viewport:o.viewport,afterCritical:o.afterCritical}),y={critical:o.critical,afterCritical:o.afterCritical,result:b,impact:p};if(!(!ne(o.current.client.offset,h)||!!b.combine)){t(Lt({completed:y}));return}const S=yc({current:o.current.client.offset,destination:h,reason:i});t(uc({newHomeClientOffset:h,dropDuration:S,completed:y}))};var Rr=()=>({x:window.pageXOffset,y:window.pageYOffset});function xc(e){return{eventName:"scroll",options:{passive:!0,capture:!1},fn:t=>{t.target!==window&&t.target!==window.document||e()}}}function Ic({onWindowScroll:e}){function t(){e(Rr())}const n=me(t),r=xc(n);let o=te;function i(){return o!==te}function s(){i()&&(process.env.NODE_ENV!=="production"?f(!1,"Cannot start scroll listener when already active"):f()),o=Y(window,[r])}function c(){i()||(process.env.NODE_ENV!=="production"?f(!1,"Cannot stop scroll listener when not active"):f()),n.cancel(),o(),o=te}return{start:s,stop:c,isActive:i}}const Oc=e=>P(e,"DROP_COMPLETE")||P(e,"DROP_ANIMATE")||P(e,"FLUSH"),Sc=e=>{const t=Ic({onWindowScroll:n=>{e.dispatch(ic({newScroll:n}))}});return n=>r=>{!t.isActive()&&P(r,"INITIAL_PUBLISH")&&t.start(),t.isActive()&&Oc(r)&&t.stop(),n(r)}};var wc=e=>{let t=!1,n=!1;const r=setTimeout(()=>{n=!0}),o=i=>{if(t){process.env.NODE_ENV!=="production"&&B("Announcement already made. Not making a second announcement");return}if(n){process.env.NODE_ENV!=="production"&&B(`
74
+ `)}function gc(e,t){if(process.env.NODE_ENV!=="production"){const n=ie(e.droppable.id,t.draggables);fc(n)}}var mc=e=>({getState:t,dispatch:n})=>r=>o=>{if(!P(o,"LIFT")){r(o);return}const{id:i,clientSelection:s,movementMode:c}=o.payload,a=t();a.phase==="DROP_ANIMATING"&&n(Lt({completed:a.completed})),t().phase!=="IDLE"&&(process.env.NODE_ENV!=="production"?g(!1,"Unexpected phase to start a drag"):g()),n(Vt()),n(Js({draggableId:i,movementMode:c}));const p={draggableId:i,scrollOptions:{shouldPublishImmediately:c==="SNAP"}},{critical:l,dimensions:u,viewport:f}=e.startPublishing(p);gc(l,u),n(Qs({critical:l,dimensions:u,clientSelection:s,movementMode:c,viewport:f}))},hc=e=>()=>t=>n=>{P(n,"INITIAL_PUBLISH")&&e.dragging(),P(n,"DROP_ANIMATE")&&e.dropping(n.payload.completed.result.reason),(P(n,"FLUSH")||P(n,"DROP_COMPLETE"))&&e.resting(),t(n)};const Rt={outOfTheWay:"cubic-bezier(0.2, 0, 0, 1)",drop:"cubic-bezier(.2,1,.1,1)"},Oe={opacity:{drop:0,combining:.7},scale:{drop:.75}},Tr={outOfTheWay:.2,minDropTime:.33,maxDropTime:.55},ce=`${Tr.outOfTheWay}s ${Rt.outOfTheWay}`,Ce={fluid:`opacity ${ce}`,snap:`transform ${ce}, opacity ${ce}`,drop:e=>{const t=`${e}s ${Rt.drop}`;return`transform ${t}, opacity ${t}`},outOfTheWay:`transform ${ce}`,placeholder:`height ${ce}, width ${ce}, margin ${ce}`},Br=e=>ne(e,R)?void 0:`translate(${e.x}px, ${e.y}px)`,Mt={moveTo:Br,drop:(e,t)=>{const n=Br(e);if(n)return t?`${n} scale(${Oe.scale.drop})`:n}},{minDropTime:$t,maxDropTime:Vr}=Tr,bc=Vr-$t,Lr=1500,vc=.6;var yc=({current:e,destination:t,reason:n})=>{const r=be(e,t);if(r<=0)return $t;if(r>=Lr)return Vr;const o=r/Lr,i=$t+bc*o,s=n==="CANCEL"?i*vc:i;return Number(s.toFixed(2))},Ec=({impact:e,draggable:t,dimensions:n,viewport:r,afterCritical:o})=>{const{draggables:i,droppables:s}=n,c=W(e),a=c?s[c]:null,d=s[t.descriptor.droppableId],p=Or({impact:e,draggable:t,draggables:i,afterCritical:o,droppable:a||d,viewport:r});return k(p,t.client.borderBox.center)},Dc=({draggables:e,reason:t,lastImpact:n,home:r,viewport:o,onLiftImpact:i})=>!n.at||t!=="DROP"?{impact:Ir({draggables:e,impact:i,destination:r,viewport:o,forceShouldAnimate:!0}),didDropInsideDroppable:!1}:n.at.type==="REORDER"?{impact:n,didDropInsideDroppable:!0}:{impact:{...n,displaced:ye},didDropInsideDroppable:!0};const Nc=({getState:e,dispatch:t})=>n=>r=>{if(!P(r,"DROP")){n(r);return}const o=e(),i=r.payload.reason;if(o.phase==="COLLECTING"){t(pc({reason:i}));return}if(o.phase==="IDLE")return;o.phase==="DROP_PENDING"&&o.isWaiting&&(process.env.NODE_ENV!=="production"?g(!1,"A DROP action occurred while DROP_PENDING and still waiting"):g()),o.phase==="DRAGGING"||o.phase==="DROP_PENDING"||(process.env.NODE_ENV!=="production"?g(!1,`Cannot drop in phase: ${o.phase}`):g());const c=o.critical,a=o.dimensions,d=a.draggables[o.critical.draggable.id],{impact:p,didDropInsideDroppable:l}=Dc({reason:i,lastImpact:o.impact,afterCritical:o.afterCritical,onLiftImpact:o.onLiftImpact,home:o.dimensions.droppables[o.critical.droppable.id],viewport:o.viewport,draggables:o.dimensions.draggables}),u=l?It(p):null,f=l?je(p):null,m={index:c.draggable.index,droppableId:c.droppable.id},b={draggableId:d.descriptor.id,type:d.descriptor.type,source:m,reason:i,mode:o.movementMode,destination:u,combine:f},h=Ec({impact:p,draggable:d,dimensions:a,viewport:o.viewport,afterCritical:o.afterCritical}),E={critical:o.critical,afterCritical:o.afterCritical,result:b,impact:p};if(!(!ne(o.current.client.offset,h)||!!b.combine)){t(Lt({completed:E}));return}const C=yc({current:o.current.client.offset,destination:h,reason:i});t(uc({newHomeClientOffset:h,dropDuration:C,completed:E}))};var Rr=()=>({x:window.pageXOffset,y:window.pageYOffset});function xc(e){return{eventName:"scroll",options:{passive:!0,capture:!1},fn:t=>{t.target!==window&&t.target!==window.document||e()}}}function Ic({onWindowScroll:e}){function t(){e(Rr())}const n=me(t),r=xc(n);let o=te;function i(){return o!==te}function s(){i()&&(process.env.NODE_ENV!=="production"?g(!1,"Cannot start scroll listener when already active"):g()),o=Y(window,[r])}function c(){i()||(process.env.NODE_ENV!=="production"?g(!1,"Cannot stop scroll listener when not active"):g()),n.cancel(),o(),o=te}return{start:s,stop:c,isActive:i}}const Oc=e=>P(e,"DROP_COMPLETE")||P(e,"DROP_ANIMATE")||P(e,"FLUSH"),Cc=e=>{const t=Ic({onWindowScroll:n=>{e.dispatch(ic({newScroll:n}))}});return n=>r=>{!t.isActive()&&P(r,"INITIAL_PUBLISH")&&t.start(),t.isActive()&&Oc(r)&&t.stop(),n(r)}};var Sc=e=>{let t=!1,n=!1;const r=setTimeout(()=>{n=!0}),o=i=>{if(t){process.env.NODE_ENV!=="production"&&B("Announcement already made. Not making a second announcement");return}if(n){process.env.NODE_ENV!=="production"&&B(`
75
75
  Announcements cannot be made asynchronously.
76
76
  Default message has already been announced.
77
- `);return}t=!0,e(i),clearTimeout(r)};return o.wasCalled=()=>t,o},Cc=()=>{const e=[],t=o=>{const i=e.findIndex(c=>c.timerId===o);i===-1&&(process.env.NODE_ENV!=="production"?f(!1,"Could not find timer"):f());const[s]=e.splice(i,1);s.callback()};return{add:o=>{const i=setTimeout(()=>t(i)),s={timerId:i,callback:o};e.push(s)},flush:()=>{if(!e.length)return;const o=[...e];e.length=0,o.forEach(i=>{clearTimeout(i.timerId),i.callback()})}}};const Ac=(e,t)=>e==null&&t==null?!0:e==null||t==null?!1:e.droppableId===t.droppableId&&e.index===t.index,_c=(e,t)=>e==null&&t==null?!0:e==null||t==null?!1:e.draggableId===t.draggableId&&e.droppableId===t.droppableId,Pc=(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},we=(e,t)=>{xe(),t(),Ie()},Xe=(e,t)=>({draggableId:e.draggable.id,type:e.droppable.type,source:{droppableId:e.droppable.id,index:e.draggable.index},mode:t});function Gt(e,t,n,r){if(!e){n(r(t));return}const o=wc(n);e(t,{announce:o}),o.wasCalled()||n(r(t))}var Tc=(e,t)=>{const n=Cc();let r=null;const o=(l,u)=>{r&&(process.env.NODE_ENV!=="production"?f(!1,"Cannot fire onBeforeCapture as a drag start has already been published"):f()),we("onBeforeCapture",()=>{const g=e().onBeforeCapture;g&&g({draggableId:l,mode:u})})},i=(l,u)=>{r&&(process.env.NODE_ENV!=="production"?f(!1,"Cannot fire onBeforeDragStart as a drag start has already been published"):f()),we("onBeforeDragStart",()=>{const g=e().onBeforeDragStart;g&&g(Xe(l,u))})},s=(l,u)=>{r&&(process.env.NODE_ENV!=="production"?f(!1,"Cannot fire onBeforeDragStart as a drag start has already been published"):f());const g=Xe(l,u);r={mode:u,lastCritical:l,lastLocation:g.source,lastCombine:null},n.add(()=>{we("onDragStart",()=>Gt(e().onDragStart,g,t,Ue.onDragStart))})},c=(l,u)=>{const g=It(u),m=je(u);r||(process.env.NODE_ENV!=="production"?f(!1,"Cannot fire onDragMove when onDragStart has not been called"):f());const b=!Pc(l,r.lastCritical);b&&(r.lastCritical=l);const h=!Ac(r.lastLocation,g);h&&(r.lastLocation=g);const y=!_c(r.lastCombine,m);if(y&&(r.lastCombine=m),!b&&!h&&!y)return;const v={...Xe(l,r.mode),combine:m,destination:g};n.add(()=>{we("onDragUpdate",()=>Gt(e().onDragUpdate,v,t,Ue.onDragUpdate))})},a=()=>{r||(process.env.NODE_ENV!=="production"?f(!1,"Can only flush responders while dragging"):f()),n.flush()},d=l=>{r||(process.env.NODE_ENV!=="production"?f(!1,"Cannot fire onDragEnd when there is no matching onDragStart"):f()),r=null,we("onDragEnd",()=>Gt(e().onDragEnd,l,t,Ue.onDragEnd))};return{beforeCapture:o,beforeStart:i,start:s,update:c,flush:a,drop:d,abort:()=>{if(!r)return;const l={...Xe(r.lastCritical,r.mode),combine:null,destination:null,reason:"CANCEL"};d(l)}}},Bc=(e,t)=>{const n=Tc(e,t);return r=>o=>i=>{if(P(i,"BEFORE_INITIAL_CAPTURE")){n.beforeCapture(i.payload.draggableId,i.payload.movementMode);return}if(P(i,"INITIAL_PUBLISH")){const c=i.payload.critical;n.beforeStart(c,i.payload.movementMode),o(i),n.start(c,i.payload.movementMode);return}if(P(i,"DROP_COMPLETE")){const c=i.payload.completed.result;n.flush(),o(i),n.drop(c);return}if(o(i),P(i,"FLUSH")){n.abort();return}const s=r.getState();s.phase==="DRAGGING"&&n.update(s.critical,s.impact)}};const Vc=e=>t=>n=>{if(!P(n,"DROP_ANIMATION_FINISHED")){t(n);return}const r=e.getState();r.phase!=="DROP_ANIMATING"&&(process.env.NODE_ENV!=="production"?f(!1,"Cannot finish a drop animating when no drop is occurring"):f()),e.dispatch(Lt({completed:r.completed}))},Lc=e=>{let t=null,n=null;function r(){n&&(cancelAnimationFrame(n),n=null),t&&(t(),t=null)}return o=>i=>{if((P(i,"FLUSH")||P(i,"DROP_COMPLETE")||P(i,"DROP_ANIMATION_FINISHED"))&&r(),o(i),!P(i,"DROP_ANIMATE"))return;const s={eventName:"scroll",options:{capture:!0,passive:!1,once:!0},fn:function(){e.getState().phase==="DROP_ANIMATING"&&e.dispatch(Pr())}};n=requestAnimationFrame(()=>{n=null,t=Y(window,[s])})}};var Rc=e=>()=>t=>n=>{(P(n,"DROP_COMPLETE")||P(n,"FLUSH")||P(n,"DROP_ANIMATE"))&&e.stopPublishing(),t(n)},Mc=e=>{let t=!1;return()=>n=>r=>{if(P(r,"INITIAL_PUBLISH")){t=!0,e.tryRecordFocus(r.payload.critical.draggable.id),n(r),e.tryRestoreFocusRecorded();return}if(n(r),!!t){if(P(r,"FLUSH")){t=!1,e.tryRestoreFocusRecorded();return}if(P(r,"DROP_COMPLETE")){t=!1;const o=r.payload.completed.result;o.combine&&e.tryShiftRecord(o.draggableId,o.combine.draggableId),e.tryRestoreFocusRecorded()}}}};const $c=e=>P(e,"DROP_COMPLETE")||P(e,"DROP_ANIMATE")||P(e,"FLUSH");var Gc=e=>t=>n=>r=>{if($c(r)){e.stop(),n(r);return}if(P(r,"INITIAL_PUBLISH")){n(r);const o=t.getState();o.phase!=="DRAGGING"&&(process.env.NODE_ENV!=="production"?f(!1,"Expected phase to be DRAGGING after INITIAL_PUBLISH"):f()),e.start(o);return}n(r),e.scroll(t.getState())};const Fc=e=>t=>n=>{if(t(n),!P(n,"PUBLISH_WHILE_DRAGGING"))return;const r=e.getState();r.phase==="DROP_PENDING"&&(r.isWaiting||e.dispatch(_r({reason:r.reason})))},kc=process.env.NODE_ENV!=="production"&&typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({name:"@hello-pangea/dnd"}):Dn;var Wc=({dimensionMarshal:e,focusMarshal:t,styleMarshal:n,getResponders:r,announce:o,autoScroller:i})=>vn(Ks,kc($o(hc(n),Rc(e),mc(e),Nc,Vc,Lc,Fc,Gc(i),Sc,Mc(t),Bc(r,o))));const Ft=()=>({additions:{},removals:{},modified:{}});function Uc({registry:e,callbacks:t}){let n=Ft(),r=null;const o=()=>{r||(t.collectionStarting(),r=requestAnimationFrame(()=>{r=null,xe();const{additions:a,removals:d,modified:p}=n,l=Object.keys(a).map(m=>e.draggable.getById(m).getDimension(R)).sort((m,b)=>m.descriptor.index-b.descriptor.index),u=Object.keys(p).map(m=>{const h=e.droppable.getById(m).callbacks.getScrollWhileDragging();return{droppableId:m,scroll:h}}),g={additions:l,removals:Object.keys(d),modified:u};n=Ft(),Ie(),t.publish(g)}))};return{add:a=>{const d=a.descriptor.id;n.additions[d]=a,n.modified[a.descriptor.droppableId]=!0,n.removals[d]&&delete n.removals[d],o()},remove:a=>{const d=a.descriptor;n.removals[d.id]=!0,n.modified[d.droppableId]=!0,n.additions[d.id]&&delete n.additions[d.id],o()},stop:()=>{r&&(cancelAnimationFrame(r),r=null,n=Ft())}}}var Mr=({scrollHeight:e,scrollWidth:t,height:n,width:r})=>{const o=k({x:t,y:e},{x:r,y:n});return{x:Math.max(0,o.x),y:Math.max(0,o.y)}},$r=()=>{const e=document.documentElement;return e||(process.env.NODE_ENV!=="production"?f(!1,"Cannot find document.documentElement"):f()),e},Gr=()=>{const e=$r();return Mr({scrollHeight:e.scrollHeight,scrollWidth:e.scrollWidth,width:e.clientWidth,height:e.clientHeight})},Hc=()=>{const e=Rr(),t=Gr(),n=e.y,r=e.x,o=$r(),i=o.clientWidth,s=o.clientHeight,c=r+i,a=n+s;return{frame:K({top:n,left:r,right:c,bottom:a}),scroll:{initial:e,current:e,max:t,diff:{value:R,displacement:R}}}},jc=({critical:e,scrollOptions:t,registry:n})=>{xe();const r=Hc(),o=r.scroll.current,i=e.droppable,s=n.droppable.getAllByType(i.type).map(p=>p.callbacks.getDimensionAndWatchScroll(o,t)),c=n.draggable.getAllByType(e.draggable.type).map(p=>p.getDimension(o)),a={draggables:ir(c),droppables:or(s)};return Ie(),{dimensions:a,critical:e,viewport:r}};function Fr(e,t,n){return n.descriptor.id===t.id||n.descriptor.type!==t.type?!1:e.droppable.getById(n.descriptor.droppableId).descriptor.mode!=="virtual"?(process.env.NODE_ENV!=="production"&&B(`
77
+ `);return}t=!0,e(i),clearTimeout(r)};return o.wasCalled=()=>t,o},wc=()=>{const e=[],t=o=>{const i=e.findIndex(c=>c.timerId===o);i===-1&&(process.env.NODE_ENV!=="production"?g(!1,"Could not find timer"):g());const[s]=e.splice(i,1);s.callback()};return{add:o=>{const i=setTimeout(()=>t(i)),s={timerId:i,callback:o};e.push(s)},flush:()=>{if(!e.length)return;const o=[...e];e.length=0,o.forEach(i=>{clearTimeout(i.timerId),i.callback()})}}};const Ac=(e,t)=>e==null&&t==null?!0:e==null||t==null?!1:e.droppableId===t.droppableId&&e.index===t.index,_c=(e,t)=>e==null&&t==null?!0:e==null||t==null?!1:e.draggableId===t.draggableId&&e.droppableId===t.droppableId,Pc=(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},Se=(e,t)=>{xe(),t(),Ie()},Xe=(e,t)=>({draggableId:e.draggable.id,type:e.droppable.type,source:{droppableId:e.droppable.id,index:e.draggable.index},mode:t});function Gt(e,t,n,r){if(!e){n(r(t));return}const o=Sc(n);e(t,{announce:o}),o.wasCalled()||n(r(t))}var Tc=(e,t)=>{const n=wc();let r=null;const o=(l,u)=>{r&&(process.env.NODE_ENV!=="production"?g(!1,"Cannot fire onBeforeCapture as a drag start has already been published"):g()),Se("onBeforeCapture",()=>{const f=e().onBeforeCapture;f&&f({draggableId:l,mode:u})})},i=(l,u)=>{r&&(process.env.NODE_ENV!=="production"?g(!1,"Cannot fire onBeforeDragStart as a drag start has already been published"):g()),Se("onBeforeDragStart",()=>{const f=e().onBeforeDragStart;f&&f(Xe(l,u))})},s=(l,u)=>{r&&(process.env.NODE_ENV!=="production"?g(!1,"Cannot fire onBeforeDragStart as a drag start has already been published"):g());const f=Xe(l,u);r={mode:u,lastCritical:l,lastLocation:f.source,lastCombine:null},n.add(()=>{Se("onDragStart",()=>Gt(e().onDragStart,f,t,Ue.onDragStart))})},c=(l,u)=>{const f=It(u),m=je(u);r||(process.env.NODE_ENV!=="production"?g(!1,"Cannot fire onDragMove when onDragStart has not been called"):g());const b=!Pc(l,r.lastCritical);b&&(r.lastCritical=l);const h=!Ac(r.lastLocation,f);h&&(r.lastLocation=f);const E=!_c(r.lastCombine,m);if(E&&(r.lastCombine=m),!b&&!h&&!E)return;const v={...Xe(l,r.mode),combine:m,destination:f};n.add(()=>{Se("onDragUpdate",()=>Gt(e().onDragUpdate,v,t,Ue.onDragUpdate))})},a=()=>{r||(process.env.NODE_ENV!=="production"?g(!1,"Can only flush responders while dragging"):g()),n.flush()},d=l=>{r||(process.env.NODE_ENV!=="production"?g(!1,"Cannot fire onDragEnd when there is no matching onDragStart"):g()),r=null,Se("onDragEnd",()=>Gt(e().onDragEnd,l,t,Ue.onDragEnd))};return{beforeCapture:o,beforeStart:i,start:s,update:c,flush:a,drop:d,abort:()=>{if(!r)return;const l={...Xe(r.lastCritical,r.mode),combine:null,destination:null,reason:"CANCEL"};d(l)}}},Bc=(e,t)=>{const n=Tc(e,t);return r=>o=>i=>{if(P(i,"BEFORE_INITIAL_CAPTURE")){n.beforeCapture(i.payload.draggableId,i.payload.movementMode);return}if(P(i,"INITIAL_PUBLISH")){const c=i.payload.critical;n.beforeStart(c,i.payload.movementMode),o(i),n.start(c,i.payload.movementMode);return}if(P(i,"DROP_COMPLETE")){const c=i.payload.completed.result;n.flush(),o(i),n.drop(c);return}if(o(i),P(i,"FLUSH")){n.abort();return}const s=r.getState();s.phase==="DRAGGING"&&n.update(s.critical,s.impact)}};const Vc=e=>t=>n=>{if(!P(n,"DROP_ANIMATION_FINISHED")){t(n);return}const r=e.getState();r.phase!=="DROP_ANIMATING"&&(process.env.NODE_ENV!=="production"?g(!1,"Cannot finish a drop animating when no drop is occurring"):g()),e.dispatch(Lt({completed:r.completed}))},Lc=e=>{let t=null,n=null;function r(){n&&(cancelAnimationFrame(n),n=null),t&&(t(),t=null)}return o=>i=>{if((P(i,"FLUSH")||P(i,"DROP_COMPLETE")||P(i,"DROP_ANIMATION_FINISHED"))&&r(),o(i),!P(i,"DROP_ANIMATE"))return;const s={eventName:"scroll",options:{capture:!0,passive:!1,once:!0},fn:function(){e.getState().phase==="DROP_ANIMATING"&&e.dispatch(Pr())}};n=requestAnimationFrame(()=>{n=null,t=Y(window,[s])})}};var Rc=e=>()=>t=>n=>{(P(n,"DROP_COMPLETE")||P(n,"FLUSH")||P(n,"DROP_ANIMATE"))&&e.stopPublishing(),t(n)},Mc=e=>{let t=!1;return()=>n=>r=>{if(P(r,"INITIAL_PUBLISH")){t=!0,e.tryRecordFocus(r.payload.critical.draggable.id),n(r),e.tryRestoreFocusRecorded();return}if(n(r),!!t){if(P(r,"FLUSH")){t=!1,e.tryRestoreFocusRecorded();return}if(P(r,"DROP_COMPLETE")){t=!1;const o=r.payload.completed.result;o.combine&&e.tryShiftRecord(o.draggableId,o.combine.draggableId),e.tryRestoreFocusRecorded()}}}};const $c=e=>P(e,"DROP_COMPLETE")||P(e,"DROP_ANIMATE")||P(e,"FLUSH");var Gc=e=>t=>n=>r=>{if($c(r)){e.stop(),n(r);return}if(P(r,"INITIAL_PUBLISH")){n(r);const o=t.getState();o.phase!=="DRAGGING"&&(process.env.NODE_ENV!=="production"?g(!1,"Expected phase to be DRAGGING after INITIAL_PUBLISH"):g()),e.start(o);return}n(r),e.scroll(t.getState())};const Fc=e=>t=>n=>{if(t(n),!P(n,"PUBLISH_WHILE_DRAGGING"))return;const r=e.getState();r.phase==="DROP_PENDING"&&(r.isWaiting||e.dispatch(_r({reason:r.reason})))},kc=process.env.NODE_ENV!=="production"&&typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({name:"@hello-pangea/dnd"}):Dn;var Wc=({dimensionMarshal:e,focusMarshal:t,styleMarshal:n,getResponders:r,announce:o,autoScroller:i})=>vn(Ks,kc($o(hc(n),Rc(e),mc(e),Nc,Vc,Lc,Fc,Gc(i),Cc,Mc(t),Bc(r,o))));const Ft=()=>({additions:{},removals:{},modified:{}});function Uc({registry:e,callbacks:t}){let n=Ft(),r=null;const o=()=>{r||(t.collectionStarting(),r=requestAnimationFrame(()=>{r=null,xe();const{additions:a,removals:d,modified:p}=n,l=Object.keys(a).map(m=>e.draggable.getById(m).getDimension(R)).sort((m,b)=>m.descriptor.index-b.descriptor.index),u=Object.keys(p).map(m=>{const h=e.droppable.getById(m).callbacks.getScrollWhileDragging();return{droppableId:m,scroll:h}}),f={additions:l,removals:Object.keys(d),modified:u};n=Ft(),Ie(),t.publish(f)}))};return{add:a=>{const d=a.descriptor.id;n.additions[d]=a,n.modified[a.descriptor.droppableId]=!0,n.removals[d]&&delete n.removals[d],o()},remove:a=>{const d=a.descriptor;n.removals[d.id]=!0,n.modified[d.droppableId]=!0,n.additions[d.id]&&delete n.additions[d.id],o()},stop:()=>{r&&(cancelAnimationFrame(r),r=null,n=Ft())}}}var Mr=({scrollHeight:e,scrollWidth:t,height:n,width:r})=>{const o=k({x:t,y:e},{x:r,y:n});return{x:Math.max(0,o.x),y:Math.max(0,o.y)}},$r=()=>{const e=document.documentElement;return e||(process.env.NODE_ENV!=="production"?g(!1,"Cannot find document.documentElement"):g()),e},Gr=()=>{const e=$r();return Mr({scrollHeight:e.scrollHeight,scrollWidth:e.scrollWidth,width:e.clientWidth,height:e.clientHeight})},Hc=()=>{const e=Rr(),t=Gr(),n=e.y,r=e.x,o=$r(),i=o.clientWidth,s=o.clientHeight,c=r+i,a=n+s;return{frame:K({top:n,left:r,right:c,bottom:a}),scroll:{initial:e,current:e,max:t,diff:{value:R,displacement:R}}}},jc=({critical:e,scrollOptions:t,registry:n})=>{xe();const r=Hc(),o=r.scroll.current,i=e.droppable,s=n.droppable.getAllByType(i.type).map(p=>p.callbacks.getDimensionAndWatchScroll(o,t)),c=n.draggable.getAllByType(e.draggable.type).map(p=>p.getDimension(o)),a={draggables:ir(c),droppables:or(s)};return Ie(),{dimensions:a,critical:e,viewport:r}};function Fr(e,t,n){return n.descriptor.id===t.id||n.descriptor.type!==t.type?!1:e.droppable.getById(n.descriptor.droppableId).descriptor.mode!=="virtual"?(process.env.NODE_ENV!=="production"&&B(`
78
78
  You are attempting to add or remove a Draggable [id: ${n.descriptor.id}]
79
79
  while a drag is occurring. This is only supported for virtual lists.
80
80
 
81
81
  See https://github.com/hello-pangea/dnd/blob/main/docs/patterns/virtual-lists.md
82
- `),!1):!0}var zc=(e,t)=>{let n=null;const r=Uc({callbacks:{publish:t.publishWhileDragging,collectionStarting:t.collectionStarting},registry:e}),o=(u,g)=>{e.droppable.exists(u)||(process.env.NODE_ENV!=="production"?f(!1,`Cannot update is enabled flag of Droppable ${u} as it is not registered`):f()),n&&t.updateDroppableIsEnabled({id:u,isEnabled:g})},i=(u,g)=>{n&&(e.droppable.exists(u)||(process.env.NODE_ENV!=="production"?f(!1,`Cannot update isCombineEnabled flag of Droppable ${u} as it is not registered`):f()),t.updateDroppableIsCombineEnabled({id:u,isCombineEnabled:g}))},s=(u,g)=>{n&&(e.droppable.exists(u)||(process.env.NODE_ENV!=="production"?f(!1,`Cannot update the scroll on Droppable ${u} as it is not registered`):f()),t.updateDroppableScroll({id:u,newScroll:g}))},c=(u,g)=>{n&&e.droppable.getById(u).callbacks.scroll(g)},a=()=>{if(!n)return;r.stop();const u=n.critical.droppable;e.droppable.getAllByType(u.type).forEach(g=>g.callbacks.dragStopped()),n.unsubscribe(),n=null},d=u=>{n||(process.env.NODE_ENV!=="production"?f(!1,"Should only be subscribed when a collection is occurring"):f());const g=n.critical.draggable;u.type==="ADDITION"&&Fr(e,g,u.value)&&r.add(u.value),u.type==="REMOVAL"&&Fr(e,g,u.value)&&r.remove(u.value)};return{updateDroppableIsEnabled:o,updateDroppableIsCombineEnabled:i,scrollDroppable:c,updateDroppableScroll:s,startPublishing:u=>{n&&(process.env.NODE_ENV!=="production"?f(!1,"Cannot start capturing critical dimensions as there is already a collection"):f());const g=e.draggable.getById(u.draggableId),m=e.droppable.getById(g.descriptor.droppableId),b={draggable:g.descriptor,droppable:m.descriptor},h=e.subscribe(d);return n={critical:b,unsubscribe:h},jc({critical:b,registry:e,scrollOptions:u.scrollOptions})},stopPublishing:a}},kr=(e,t)=>e.phase==="IDLE"?!0:e.phase!=="DROP_ANIMATING"||e.completed.result.draggableId===t?!1:e.completed.result.reason==="DROP",qc=e=>{window.scrollBy(e.x,e.y)};const Yc=M(e=>He(e).filter(t=>!(!t.isEnabled||!t.frame))),Xc=(e,t)=>Yc(t).find(r=>(r.frame||(process.env.NODE_ENV!=="production"?f(!1,"Invalid result"):f()),Er(r.frame.pageMarginBox)(e)))||null;var Kc=({center:e,destination:t,droppables:n})=>{if(t){const o=n[t];return o.frame?o:null}return Xc(e,n)};const Ce={startFromPercentage:.25,maxScrollAtPercentage:.05,maxPixelScroll:28,ease:e=>e**2,durationDampening:{stopDampeningAt:1200,accelerateAt:360},disabled:!1};var Jc=(e,t,n=()=>Ce)=>{const r=n(),o=e[t.size]*r.startFromPercentage,i=e[t.size]*r.maxScrollAtPercentage;return{startScrollingFrom:o,maxScrollValueAt:i}},Wr=({startOfRange:e,endOfRange:t,current:n})=>{const r=t-e;return r===0?(process.env.NODE_ENV!=="production"&&B(`
82
+ `),!1):!0}var zc=(e,t)=>{let n=null;const r=Uc({callbacks:{publish:t.publishWhileDragging,collectionStarting:t.collectionStarting},registry:e}),o=(u,f)=>{e.droppable.exists(u)||(process.env.NODE_ENV!=="production"?g(!1,`Cannot update is enabled flag of Droppable ${u} as it is not registered`):g()),n&&t.updateDroppableIsEnabled({id:u,isEnabled:f})},i=(u,f)=>{n&&(e.droppable.exists(u)||(process.env.NODE_ENV!=="production"?g(!1,`Cannot update isCombineEnabled flag of Droppable ${u} as it is not registered`):g()),t.updateDroppableIsCombineEnabled({id:u,isCombineEnabled:f}))},s=(u,f)=>{n&&(e.droppable.exists(u)||(process.env.NODE_ENV!=="production"?g(!1,`Cannot update the scroll on Droppable ${u} as it is not registered`):g()),t.updateDroppableScroll({id:u,newScroll:f}))},c=(u,f)=>{n&&e.droppable.getById(u).callbacks.scroll(f)},a=()=>{if(!n)return;r.stop();const u=n.critical.droppable;e.droppable.getAllByType(u.type).forEach(f=>f.callbacks.dragStopped()),n.unsubscribe(),n=null},d=u=>{n||(process.env.NODE_ENV!=="production"?g(!1,"Should only be subscribed when a collection is occurring"):g());const f=n.critical.draggable;u.type==="ADDITION"&&Fr(e,f,u.value)&&r.add(u.value),u.type==="REMOVAL"&&Fr(e,f,u.value)&&r.remove(u.value)};return{updateDroppableIsEnabled:o,updateDroppableIsCombineEnabled:i,scrollDroppable:c,updateDroppableScroll:s,startPublishing:u=>{n&&(process.env.NODE_ENV!=="production"?g(!1,"Cannot start capturing critical dimensions as there is already a collection"):g());const f=e.draggable.getById(u.draggableId),m=e.droppable.getById(f.descriptor.droppableId),b={draggable:f.descriptor,droppable:m.descriptor},h=e.subscribe(d);return n={critical:b,unsubscribe:h},jc({critical:b,registry:e,scrollOptions:u.scrollOptions})},stopPublishing:a}},kr=(e,t)=>e.phase==="IDLE"?!0:e.phase!=="DROP_ANIMATING"||e.completed.result.draggableId===t?!1:e.completed.result.reason==="DROP",qc=e=>{window.scrollBy(e.x,e.y)};const Yc=M(e=>He(e).filter(t=>!(!t.isEnabled||!t.frame))),Xc=(e,t)=>Yc(t).find(r=>(r.frame||(process.env.NODE_ENV!=="production"?g(!1,"Invalid result"):g()),Er(r.frame.pageMarginBox)(e)))||null;var Kc=({center:e,destination:t,droppables:n})=>{if(t){const o=n[t];return o.frame?o:null}return Xc(e,n)};const we={startFromPercentage:.25,maxScrollAtPercentage:.05,maxPixelScroll:28,ease:e=>e**2,durationDampening:{stopDampeningAt:1200,accelerateAt:360},disabled:!1};var Jc=(e,t,n=()=>we)=>{const r=n(),o=e[t.size]*r.startFromPercentage,i=e[t.size]*r.maxScrollAtPercentage;return{startScrollingFrom:o,maxScrollValueAt:i}},Wr=({startOfRange:e,endOfRange:t,current:n})=>{const r=t-e;return r===0?(process.env.NODE_ENV!=="production"&&B(`
83
83
  Detected distance range of 0 in the fluid auto scroller
84
84
  This is unexpected and would cause a divide by 0 issue.
85
85
  Not allowing an auto scroll
86
- `),0):(n-e)/r},kt=1,Zc=(e,t,n=()=>Ce)=>{const r=n();if(e>t.startScrollingFrom)return 0;if(e<=t.maxScrollValueAt)return r.maxPixelScroll;if(e===t.startScrollingFrom)return kt;const i=1-Wr({startOfRange:t.maxScrollValueAt,endOfRange:t.startScrollingFrom,current:e}),s=r.maxPixelScroll*r.ease(i);return Math.ceil(s)},Qc=(e,t,n)=>{const r=n(),o=r.durationDampening.accelerateAt,i=r.durationDampening.stopDampeningAt,s=t,c=i,d=Date.now()-s;if(d>=i)return e;if(d<o)return kt;const p=Wr({startOfRange:o,endOfRange:c,current:d}),l=e*r.ease(p);return Math.ceil(l)},Ur=({distanceToEdge:e,thresholds:t,dragStartTime:n,shouldUseTimeDampening:r,getAutoScrollerOptions:o})=>{const i=Zc(e,t,o);return i===0?0:r?Math.max(Qc(i,n,o),kt):i},Hr=({container:e,distanceToEdges:t,dragStartTime:n,axis:r,shouldUseTimeDampening:o,getAutoScrollerOptions:i})=>{const s=Jc(e,r,i);return t[r.end]<t[r.start]?Ur({distanceToEdge:t[r.end],thresholds:s,dragStartTime:n,shouldUseTimeDampening:o,getAutoScrollerOptions:i}):-1*Ur({distanceToEdge:t[r.start],thresholds:s,dragStartTime:n,shouldUseTimeDampening:o,getAutoScrollerOptions:i})},ea=({container:e,subject:t,proposedScroll:n})=>{const r=t.height>e.height,o=t.width>e.width;return!o&&!r?n:o&&r?null:{x:o?0:n.x,y:r?0:n.y}};const ta=nr(e=>e===0?0:e);var jr=({dragStartTime:e,container:t,subject:n,center:r,shouldUseTimeDampening:o,getAutoScrollerOptions:i})=>{const s={top:r.y-t.top,right:t.right-r.x,bottom:t.bottom-r.y,left:r.x-t.left},c=Hr({container:t,distanceToEdges:s,dragStartTime:e,axis:Ot,shouldUseTimeDampening:o,getAutoScrollerOptions:i}),a=Hr({container:t,distanceToEdges:s,dragStartTime:e,axis:ar,shouldUseTimeDampening:o,getAutoScrollerOptions:i}),d=ta({x:a,y:c});if(ne(d,R))return null;const p=ea({container:t,subject:n,proposedScroll:d});return p?ne(p,R)?null:p:null};const na=nr(e=>e===0?0:e>0?1:-1),Wt=(()=>{const e=(t,n)=>t<0?t:t>n?t-n:0;return({current:t,max:n,change:r})=>{const o=$(t,r),i={x:e(o.x,n.x),y:e(o.y,n.y)};return ne(i,R)?null:i}})(),zr=({max:e,current:t,change:n})=>{const r={x:Math.max(t.x,e.x),y:Math.max(t.y,e.y)},o=na(n),i=Wt({max:r,current:t,change:o});return!i||o.x!==0&&i.x===0||o.y!==0&&i.y===0},Ut=(e,t)=>zr({current:e.scroll.current,max:e.scroll.max,change:t}),ra=(e,t)=>{if(!Ut(e,t))return null;const n=e.scroll.max,r=e.scroll.current;return Wt({current:r,max:n,change:t})},Ht=(e,t)=>{const n=e.frame;return n?zr({current:n.scroll.current,max:n.scroll.max,change:t}):!1},oa=(e,t)=>{const n=e.frame;return!n||!Ht(e,t)?null:Wt({current:n.scroll.current,max:n.scroll.max,change:t})};var ia=({viewport:e,subject:t,center:n,dragStartTime:r,shouldUseTimeDampening:o,getAutoScrollerOptions:i})=>{const s=jr({dragStartTime:r,container:e.frame,subject:t,center:n,shouldUseTimeDampening:o,getAutoScrollerOptions:i});return s&&Ut(e,s)?s:null},sa=({droppable:e,subject:t,center:n,dragStartTime:r,shouldUseTimeDampening:o,getAutoScrollerOptions:i})=>{const s=e.frame;if(!s)return null;const c=jr({dragStartTime:r,container:s.pageMarginBox,subject:t,center:n,shouldUseTimeDampening:o,getAutoScrollerOptions:i});return c&&Ht(e,c)?c:null},qr=({state:e,dragStartTime:t,shouldUseTimeDampening:n,scrollWindow:r,scrollDroppable:o,getAutoScrollerOptions:i})=>{const s=e.current.page.borderBoxCenter,a=e.dimensions.draggables[e.critical.draggable.id].page.marginBox;if(e.isWindowScrollAllowed){const l=e.viewport,u=ia({dragStartTime:t,viewport:l,subject:a,center:s,shouldUseTimeDampening:n,getAutoScrollerOptions:i});if(u){r(u);return}}const d=Kc({center:s,destination:W(e.impact),droppables:e.dimensions.droppables});if(!d)return;const p=sa({dragStartTime:t,droppable:d,subject:a,center:s,shouldUseTimeDampening:n,getAutoScrollerOptions:i});p&&o(d.descriptor.id,p)},ca=({scrollWindow:e,scrollDroppable:t,getAutoScrollerOptions:n=()=>Ce})=>{const r=me(e),o=me(t);let i=null;const s=d=>{i||(process.env.NODE_ENV!=="production"?f(!1,"Cannot fluid scroll if not dragging"):f());const{shouldUseTimeDampening:p,dragStartTime:l}=i;qr({state:d,scrollWindow:r,scrollDroppable:o,dragStartTime:l,shouldUseTimeDampening:p,getAutoScrollerOptions:n})};return{start:d=>{xe(),i&&(process.env.NODE_ENV!=="production"?f(!1,"Cannot start auto scrolling when already started"):f());const p=Date.now();let l=!1;const u=()=>{l=!0};qr({state:d,dragStartTime:0,shouldUseTimeDampening:!1,scrollWindow:u,scrollDroppable:u,getAutoScrollerOptions:n}),i={dragStartTime:p,shouldUseTimeDampening:l},Ie(),l&&s(d)},stop:()=>{i&&(r.cancel(),o.cancel(),i=null)},scroll:s}},aa=({move:e,scrollDroppable:t,scrollWindow:n})=>{const r=(c,a)=>{const d=$(c.current.client.selection,a);e({client:d})},o=(c,a)=>{if(!Ht(c,a))return a;const d=oa(c,a);if(!d)return t(c.descriptor.id,a),null;const p=k(a,d);return t(c.descriptor.id,p),k(a,p)},i=(c,a,d)=>{if(!c||!Ut(a,d))return d;const p=ra(a,d);if(!p)return n(d),null;const l=k(d,p);return n(l),k(d,l)};return c=>{const a=c.scrollJumpRequest;if(!a)return;const d=W(c.impact);d||(process.env.NODE_ENV!=="production"?f(!1,"Cannot perform a jump scroll when there is no destination"):f());const p=o(c.dimensions.droppables[d],a);if(!p)return;const l=c.viewport,u=i(c.isWindowScrollAllowed,l,p);u&&r(c,u)}},la=({scrollDroppable:e,scrollWindow:t,move:n,getAutoScrollerOptions:r})=>{const o=ca({scrollWindow:t,scrollDroppable:e,getAutoScrollerOptions:r}),i=aa({move:n,scrollWindow:t,scrollDroppable:e});return{scroll:a=>{if(!(r().disabled||a.phase!=="DRAGGING")){if(a.movementMode==="FLUID"){o.scroll(a);return}a.scrollJumpRequest&&i(a)}},start:o.start,stop:o.stop}};const ue="data-rfd",pe=(()=>{const e=`${ue}-drag-handle`;return{base:e,draggableId:`${e}-draggable-id`,contextId:`${e}-context-id`}})(),jt=(()=>{const e=`${ue}-draggable`;return{base:e,contextId:`${e}-context-id`,id:`${e}-id`}})(),da=(()=>{const e=`${ue}-droppable`;return{base:e,contextId:`${e}-context-id`,id:`${e}-id`}})(),Yr={contextId:`${ue}-scroll-container-context-id`},ua=e=>t=>`[${t}="${e}"]`,Ae=(e,t)=>e.map(n=>{const r=n.styles[t];return r?`${n.selector} { ${r} }`:""}).join(" "),pa="pointer-events: none;";var fa=e=>{const t=ua(e),n=(()=>{const c=`
86
+ `),0):(n-e)/r},kt=1,Zc=(e,t,n=()=>we)=>{const r=n();if(e>t.startScrollingFrom)return 0;if(e<=t.maxScrollValueAt)return r.maxPixelScroll;if(e===t.startScrollingFrom)return kt;const i=1-Wr({startOfRange:t.maxScrollValueAt,endOfRange:t.startScrollingFrom,current:e}),s=r.maxPixelScroll*r.ease(i);return Math.ceil(s)},Qc=(e,t,n)=>{const r=n(),o=r.durationDampening.accelerateAt,i=r.durationDampening.stopDampeningAt,s=t,c=i,d=Date.now()-s;if(d>=i)return e;if(d<o)return kt;const p=Wr({startOfRange:o,endOfRange:c,current:d}),l=e*r.ease(p);return Math.ceil(l)},Ur=({distanceToEdge:e,thresholds:t,dragStartTime:n,shouldUseTimeDampening:r,getAutoScrollerOptions:o})=>{const i=Zc(e,t,o);return i===0?0:r?Math.max(Qc(i,n,o),kt):i},Hr=({container:e,distanceToEdges:t,dragStartTime:n,axis:r,shouldUseTimeDampening:o,getAutoScrollerOptions:i})=>{const s=Jc(e,r,i);return t[r.end]<t[r.start]?Ur({distanceToEdge:t[r.end],thresholds:s,dragStartTime:n,shouldUseTimeDampening:o,getAutoScrollerOptions:i}):-1*Ur({distanceToEdge:t[r.start],thresholds:s,dragStartTime:n,shouldUseTimeDampening:o,getAutoScrollerOptions:i})},ea=({container:e,subject:t,proposedScroll:n})=>{const r=t.height>e.height,o=t.width>e.width;return!o&&!r?n:o&&r?null:{x:o?0:n.x,y:r?0:n.y}};const ta=nr(e=>e===0?0:e);var jr=({dragStartTime:e,container:t,subject:n,center:r,shouldUseTimeDampening:o,getAutoScrollerOptions:i})=>{const s={top:r.y-t.top,right:t.right-r.x,bottom:t.bottom-r.y,left:r.x-t.left},c=Hr({container:t,distanceToEdges:s,dragStartTime:e,axis:Ot,shouldUseTimeDampening:o,getAutoScrollerOptions:i}),a=Hr({container:t,distanceToEdges:s,dragStartTime:e,axis:ar,shouldUseTimeDampening:o,getAutoScrollerOptions:i}),d=ta({x:a,y:c});if(ne(d,R))return null;const p=ea({container:t,subject:n,proposedScroll:d});return p?ne(p,R)?null:p:null};const na=nr(e=>e===0?0:e>0?1:-1),Wt=(()=>{const e=(t,n)=>t<0?t:t>n?t-n:0;return({current:t,max:n,change:r})=>{const o=$(t,r),i={x:e(o.x,n.x),y:e(o.y,n.y)};return ne(i,R)?null:i}})(),zr=({max:e,current:t,change:n})=>{const r={x:Math.max(t.x,e.x),y:Math.max(t.y,e.y)},o=na(n),i=Wt({max:r,current:t,change:o});return!i||o.x!==0&&i.x===0||o.y!==0&&i.y===0},Ut=(e,t)=>zr({current:e.scroll.current,max:e.scroll.max,change:t}),ra=(e,t)=>{if(!Ut(e,t))return null;const n=e.scroll.max,r=e.scroll.current;return Wt({current:r,max:n,change:t})},Ht=(e,t)=>{const n=e.frame;return n?zr({current:n.scroll.current,max:n.scroll.max,change:t}):!1},oa=(e,t)=>{const n=e.frame;return!n||!Ht(e,t)?null:Wt({current:n.scroll.current,max:n.scroll.max,change:t})};var ia=({viewport:e,subject:t,center:n,dragStartTime:r,shouldUseTimeDampening:o,getAutoScrollerOptions:i})=>{const s=jr({dragStartTime:r,container:e.frame,subject:t,center:n,shouldUseTimeDampening:o,getAutoScrollerOptions:i});return s&&Ut(e,s)?s:null},sa=({droppable:e,subject:t,center:n,dragStartTime:r,shouldUseTimeDampening:o,getAutoScrollerOptions:i})=>{const s=e.frame;if(!s)return null;const c=jr({dragStartTime:r,container:s.pageMarginBox,subject:t,center:n,shouldUseTimeDampening:o,getAutoScrollerOptions:i});return c&&Ht(e,c)?c:null},qr=({state:e,dragStartTime:t,shouldUseTimeDampening:n,scrollWindow:r,scrollDroppable:o,getAutoScrollerOptions:i})=>{const s=e.current.page.borderBoxCenter,a=e.dimensions.draggables[e.critical.draggable.id].page.marginBox;if(e.isWindowScrollAllowed){const l=e.viewport,u=ia({dragStartTime:t,viewport:l,subject:a,center:s,shouldUseTimeDampening:n,getAutoScrollerOptions:i});if(u){r(u);return}}const d=Kc({center:s,destination:W(e.impact),droppables:e.dimensions.droppables});if(!d)return;const p=sa({dragStartTime:t,droppable:d,subject:a,center:s,shouldUseTimeDampening:n,getAutoScrollerOptions:i});p&&o(d.descriptor.id,p)},ca=({scrollWindow:e,scrollDroppable:t,getAutoScrollerOptions:n=()=>we})=>{const r=me(e),o=me(t);let i=null;const s=d=>{i||(process.env.NODE_ENV!=="production"?g(!1,"Cannot fluid scroll if not dragging"):g());const{shouldUseTimeDampening:p,dragStartTime:l}=i;qr({state:d,scrollWindow:r,scrollDroppable:o,dragStartTime:l,shouldUseTimeDampening:p,getAutoScrollerOptions:n})};return{start:d=>{xe(),i&&(process.env.NODE_ENV!=="production"?g(!1,"Cannot start auto scrolling when already started"):g());const p=Date.now();let l=!1;const u=()=>{l=!0};qr({state:d,dragStartTime:0,shouldUseTimeDampening:!1,scrollWindow:u,scrollDroppable:u,getAutoScrollerOptions:n}),i={dragStartTime:p,shouldUseTimeDampening:l},Ie(),l&&s(d)},stop:()=>{i&&(r.cancel(),o.cancel(),i=null)},scroll:s}},aa=({move:e,scrollDroppable:t,scrollWindow:n})=>{const r=(c,a)=>{const d=$(c.current.client.selection,a);e({client:d})},o=(c,a)=>{if(!Ht(c,a))return a;const d=oa(c,a);if(!d)return t(c.descriptor.id,a),null;const p=k(a,d);return t(c.descriptor.id,p),k(a,p)},i=(c,a,d)=>{if(!c||!Ut(a,d))return d;const p=ra(a,d);if(!p)return n(d),null;const l=k(d,p);return n(l),k(d,l)};return c=>{const a=c.scrollJumpRequest;if(!a)return;const d=W(c.impact);d||(process.env.NODE_ENV!=="production"?g(!1,"Cannot perform a jump scroll when there is no destination"):g());const p=o(c.dimensions.droppables[d],a);if(!p)return;const l=c.viewport,u=i(c.isWindowScrollAllowed,l,p);u&&r(c,u)}},la=({scrollDroppable:e,scrollWindow:t,move:n,getAutoScrollerOptions:r})=>{const o=ca({scrollWindow:t,scrollDroppable:e,getAutoScrollerOptions:r}),i=aa({move:n,scrollWindow:t,scrollDroppable:e});return{scroll:a=>{if(!(r().disabled||a.phase!=="DRAGGING")){if(a.movementMode==="FLUID"){o.scroll(a);return}a.scrollJumpRequest&&i(a)}},start:o.start,stop:o.stop}};const ue="data-rfd",pe=(()=>{const e=`${ue}-drag-handle`;return{base:e,draggableId:`${e}-draggable-id`,contextId:`${e}-context-id`}})(),jt=(()=>{const e=`${ue}-draggable`;return{base:e,contextId:`${e}-context-id`,id:`${e}-id`}})(),da=(()=>{const e=`${ue}-droppable`;return{base:e,contextId:`${e}-context-id`,id:`${e}-id`}})(),Yr={contextId:`${ue}-scroll-container-context-id`},ua=e=>t=>`[${t}="${e}"]`,Ae=(e,t)=>e.map(n=>{const r=n.styles[t];return r?`${n.selector} { ${r} }`:""}).join(" "),pa="pointer-events: none;";var fa=e=>{const t=ua(e),n=(()=>{const c=`
87
87
  cursor: -webkit-grab;
88
88
  cursor: grab;
89
89
  `;return{selector:t(pe.contextId),styles:{always:`
@@ -91,7 +91,7 @@ ${fn.current.stack}
91
91
  -webkit-tap-highlight-color: rgba(0,0,0,0);
92
92
  touch-action: manipulation;
93
93
  `,resting:c,dragging:pa,dropAnimating:c}}})(),r=(()=>{const c=`
94
- transition: ${Se.outOfTheWay};
94
+ transition: ${Ce.outOfTheWay};
95
95
  `;return{selector:t(jt.contextId),styles:{dragging:c,dropAnimating:c,userCancel:c}}})(),o={selector:t(da.contextId),styles:{always:"overflow-anchor: none;"}},s=[r,n,o,{selector:"body",styles:{dragging:`
96
96
  cursor: grabbing;
97
97
  cursor: -webkit-grabbing;
@@ -100,7 +100,7 @@ ${fn.current.stack}
100
100
  -moz-user-select: none;
101
101
  -ms-user-select: none;
102
102
  overflow-anchor: none;
103
- `}}];return{always:Ae(s,"always"),resting:Ae(s,"resting"),dragging:Ae(s,"dragging"),dropAnimating:Ae(s,"dropAnimating"),userCancel:Ae(s,"userCancel")}};const U=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?D.useLayoutEffect:D.useEffect,zt=()=>{const e=document.querySelector("head");return e||(process.env.NODE_ENV!=="production"?f(!1,"Cannot find the head to append a style to"):f()),e},Xr=e=>{const t=document.createElement("style");return e&&t.setAttribute("nonce",e),t.type="text/css",t};function ga(e,t){const n=w(()=>fa(e),[e]),r=D.useRef(null),o=D.useRef(null),i=x(M(l=>{const u=o.current;u||(process.env.NODE_ENV!=="production"?f(!1,"Cannot set dynamic style element if it is not set"):f()),u.textContent=l}),[]),s=x(l=>{const u=r.current;u||(process.env.NODE_ENV!=="production"?f(!1,"Cannot set dynamic style element if it is not set"):f()),u.textContent=l},[]);U(()=>{!r.current&&!o.current||(process.env.NODE_ENV!=="production"?f(!1,"style elements already mounted"):f());const l=Xr(t),u=Xr(t);return r.current=l,o.current=u,l.setAttribute(`${ue}-always`,e),u.setAttribute(`${ue}-dynamic`,e),zt().appendChild(l),zt().appendChild(u),s(n.always),i(n.resting),()=>{const g=m=>{const b=m.current;b||(process.env.NODE_ENV!=="production"?f(!1,"Cannot unmount ref as it is not set"):f()),zt().removeChild(b),m.current=null};g(r),g(o)}},[t,s,i,n.always,n.resting,e]);const c=x(()=>i(n.dragging),[i,n.dragging]),a=x(l=>{if(l==="DROP"){i(n.dropAnimating);return}i(n.userCancel)},[i,n.dropAnimating,n.userCancel]),d=x(()=>{o.current&&i(n.resting)},[i,n.resting]);return w(()=>({dragging:c,dropping:a,resting:d}),[c,a,d])}function Kr(e,t){return Array.from(e.querySelectorAll(t))}var Jr=e=>e&&e.ownerDocument&&e.ownerDocument.defaultView?e.ownerDocument.defaultView:window;function _e(e){return e instanceof Jr(e).HTMLElement}function Zr(e,t){const n=`[${pe.contextId}="${e}"]`,r=Kr(document,n);if(!r.length)return process.env.NODE_ENV!=="production"&&B(`Unable to find any drag handles in the context "${e}"`),null;const o=r.find(i=>i.getAttribute(pe.draggableId)===t);return o?_e(o)?o:(process.env.NODE_ENV!=="production"&&B("drag handle needs to be a HTMLElement"),null):(process.env.NODE_ENV!=="production"&&B(`Unable to find drag handle with id "${t}" as no handle with a matching id was found`),null)}function ma(e){const t=D.useRef({}),n=D.useRef(null),r=D.useRef(null),o=D.useRef(!1),i=x(function(u,g){const m={id:u,focus:g};return t.current[u]=m,function(){const h=t.current;h[u]!==m&&delete h[u]}},[]),s=x(function(u){const g=Zr(e,u);g&&g!==document.activeElement&&g.focus()},[e]),c=x(function(u,g){n.current===u&&(n.current=g)},[]),a=x(function(){r.current||o.current&&(r.current=requestAnimationFrame(()=>{r.current=null;const u=n.current;u&&s(u)}))},[s]),d=x(function(u){n.current=null;const g=document.activeElement;g&&g.getAttribute(pe.draggableId)===u&&(n.current=u)},[]);return U(()=>(o.current=!0,function(){o.current=!1;const u=r.current;u&&cancelAnimationFrame(u)}),[]),w(()=>({register:i,tryRecordFocus:d,tryRestoreFocusRecorded:a,tryShiftRecord:c}),[i,d,a,c])}function ha(){const e={draggables:{},droppables:{}},t=[];function n(l){return t.push(l),function(){const g=t.indexOf(l);g!==-1&&t.splice(g,1)}}function r(l){t.length&&t.forEach(u=>u(l))}function o(l){return e.draggables[l]||null}function i(l){const u=o(l);return u||(process.env.NODE_ENV!=="production"?f(!1,`Cannot find draggable entry with id [${l}]`):f()),u}const s={register:l=>{e.draggables[l.descriptor.id]=l,r({type:"ADDITION",value:l})},update:(l,u)=>{const g=e.draggables[u.descriptor.id];g&&g.uniqueId===l.uniqueId&&(delete e.draggables[u.descriptor.id],e.draggables[l.descriptor.id]=l)},unregister:l=>{const u=l.descriptor.id,g=o(u);g&&l.uniqueId===g.uniqueId&&(delete e.draggables[u],e.droppables[l.descriptor.droppableId]&&r({type:"REMOVAL",value:l}))},getById:i,findById:o,exists:l=>!!o(l),getAllByType:l=>Object.values(e.draggables).filter(u=>u.descriptor.type===l)};function c(l){return e.droppables[l]||null}function a(l){const u=c(l);return u||(process.env.NODE_ENV!=="production"?f(!1,`Cannot find droppable entry with id [${l}]`):f()),u}const d={register:l=>{e.droppables[l.descriptor.id]=l},unregister:l=>{const u=c(l.descriptor.id);u&&l.uniqueId===u.uniqueId&&delete e.droppables[l.descriptor.id]},getById:a,findById:c,exists:l=>!!c(l),getAllByType:l=>Object.values(e.droppables).filter(u=>u.descriptor.type===l)};function p(){e.draggables={},e.droppables={},t.length=0}return{draggable:s,droppable:d,subscribe:n,clean:p}}function ba(){const e=w(ha,[]);return D.useEffect(()=>function(){e.clean()},[e]),e}var qt=D.createContext(null),Pe=()=>{const e=document.body;return e||(process.env.NODE_ENV!=="production"?f(!1,"Cannot find document.body"):f()),e};const va={position:"absolute",width:"1px",height:"1px",margin:"-1px",border:"0",padding:"0",overflow:"hidden",clip:"rect(0 0 0 0)","clip-path":"inset(100%)"},ya=e=>`rfd-announcement-${e}`;function Ea(e){const t=w(()=>ya(e),[e]),n=D.useRef(null);return D.useEffect(function(){const i=document.createElement("div");return n.current=i,i.id=t,i.setAttribute("aria-live","assertive"),i.setAttribute("aria-atomic","true"),ke(i.style,va),Pe().appendChild(i),function(){setTimeout(function(){const a=Pe();a.contains(i)&&a.removeChild(i),i===n.current&&(n.current=null)})}},[t]),x(o=>{const i=n.current;if(i){i.textContent=o;return}process.env.NODE_ENV!=="production"&&B(`
103
+ `}}];return{always:Ae(s,"always"),resting:Ae(s,"resting"),dragging:Ae(s,"dragging"),dropAnimating:Ae(s,"dropAnimating"),userCancel:Ae(s,"userCancel")}};const U=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?D.useLayoutEffect:D.useEffect,zt=()=>{const e=document.querySelector("head");return e||(process.env.NODE_ENV!=="production"?g(!1,"Cannot find the head to append a style to"):g()),e},Xr=e=>{const t=document.createElement("style");return e&&t.setAttribute("nonce",e),t.type="text/css",t};function ga(e,t){const n=S(()=>fa(e),[e]),r=D.useRef(null),o=D.useRef(null),i=x(M(l=>{const u=o.current;u||(process.env.NODE_ENV!=="production"?g(!1,"Cannot set dynamic style element if it is not set"):g()),u.textContent=l}),[]),s=x(l=>{const u=r.current;u||(process.env.NODE_ENV!=="production"?g(!1,"Cannot set dynamic style element if it is not set"):g()),u.textContent=l},[]);U(()=>{!r.current&&!o.current||(process.env.NODE_ENV!=="production"?g(!1,"style elements already mounted"):g());const l=Xr(t),u=Xr(t);return r.current=l,o.current=u,l.setAttribute(`${ue}-always`,e),u.setAttribute(`${ue}-dynamic`,e),zt().appendChild(l),zt().appendChild(u),s(n.always),i(n.resting),()=>{const f=m=>{const b=m.current;b||(process.env.NODE_ENV!=="production"?g(!1,"Cannot unmount ref as it is not set"):g()),zt().removeChild(b),m.current=null};f(r),f(o)}},[t,s,i,n.always,n.resting,e]);const c=x(()=>i(n.dragging),[i,n.dragging]),a=x(l=>{if(l==="DROP"){i(n.dropAnimating);return}i(n.userCancel)},[i,n.dropAnimating,n.userCancel]),d=x(()=>{o.current&&i(n.resting)},[i,n.resting]);return S(()=>({dragging:c,dropping:a,resting:d}),[c,a,d])}function Kr(e,t){return Array.from(e.querySelectorAll(t))}var Jr=e=>e&&e.ownerDocument&&e.ownerDocument.defaultView?e.ownerDocument.defaultView:window;function _e(e){return e instanceof Jr(e).HTMLElement}function Zr(e,t){const n=`[${pe.contextId}="${e}"]`,r=Kr(document,n);if(!r.length)return process.env.NODE_ENV!=="production"&&B(`Unable to find any drag handles in the context "${e}"`),null;const o=r.find(i=>i.getAttribute(pe.draggableId)===t);return o?_e(o)?o:(process.env.NODE_ENV!=="production"&&B("drag handle needs to be a HTMLElement"),null):(process.env.NODE_ENV!=="production"&&B(`Unable to find drag handle with id "${t}" as no handle with a matching id was found`),null)}function ma(e){const t=D.useRef({}),n=D.useRef(null),r=D.useRef(null),o=D.useRef(!1),i=x(function(u,f){const m={id:u,focus:f};return t.current[u]=m,function(){const h=t.current;h[u]!==m&&delete h[u]}},[]),s=x(function(u){const f=Zr(e,u);f&&f!==document.activeElement&&f.focus()},[e]),c=x(function(u,f){n.current===u&&(n.current=f)},[]),a=x(function(){r.current||o.current&&(r.current=requestAnimationFrame(()=>{r.current=null;const u=n.current;u&&s(u)}))},[s]),d=x(function(u){n.current=null;const f=document.activeElement;f&&f.getAttribute(pe.draggableId)===u&&(n.current=u)},[]);return U(()=>(o.current=!0,function(){o.current=!1;const u=r.current;u&&cancelAnimationFrame(u)}),[]),S(()=>({register:i,tryRecordFocus:d,tryRestoreFocusRecorded:a,tryShiftRecord:c}),[i,d,a,c])}function ha(){const e={draggables:{},droppables:{}},t=[];function n(l){return t.push(l),function(){const f=t.indexOf(l);f!==-1&&t.splice(f,1)}}function r(l){t.length&&t.forEach(u=>u(l))}function o(l){return e.draggables[l]||null}function i(l){const u=o(l);return u||(process.env.NODE_ENV!=="production"?g(!1,`Cannot find draggable entry with id [${l}]`):g()),u}const s={register:l=>{e.draggables[l.descriptor.id]=l,r({type:"ADDITION",value:l})},update:(l,u)=>{const f=e.draggables[u.descriptor.id];f&&f.uniqueId===l.uniqueId&&(delete e.draggables[u.descriptor.id],e.draggables[l.descriptor.id]=l)},unregister:l=>{const u=l.descriptor.id,f=o(u);f&&l.uniqueId===f.uniqueId&&(delete e.draggables[u],e.droppables[l.descriptor.droppableId]&&r({type:"REMOVAL",value:l}))},getById:i,findById:o,exists:l=>!!o(l),getAllByType:l=>Object.values(e.draggables).filter(u=>u.descriptor.type===l)};function c(l){return e.droppables[l]||null}function a(l){const u=c(l);return u||(process.env.NODE_ENV!=="production"?g(!1,`Cannot find droppable entry with id [${l}]`):g()),u}const d={register:l=>{e.droppables[l.descriptor.id]=l},unregister:l=>{const u=c(l.descriptor.id);u&&l.uniqueId===u.uniqueId&&delete e.droppables[l.descriptor.id]},getById:a,findById:c,exists:l=>!!c(l),getAllByType:l=>Object.values(e.droppables).filter(u=>u.descriptor.type===l)};function p(){e.draggables={},e.droppables={},t.length=0}return{draggable:s,droppable:d,subscribe:n,clean:p}}function ba(){const e=S(ha,[]);return D.useEffect(()=>function(){e.clean()},[e]),e}var qt=D.createContext(null),Pe=()=>{const e=document.body;return e||(process.env.NODE_ENV!=="production"?g(!1,"Cannot find document.body"):g()),e};const va={position:"absolute",width:"1px",height:"1px",margin:"-1px",border:"0",padding:"0",overflow:"hidden",clip:"rect(0 0 0 0)","clip-path":"inset(100%)"},ya=e=>`rfd-announcement-${e}`;function Ea(e){const t=S(()=>ya(e),[e]),n=D.useRef(null);return D.useEffect(function(){const i=document.createElement("div");return n.current=i,i.id=t,i.setAttribute("aria-live","assertive"),i.setAttribute("aria-atomic","true"),ke(i.style,va),Pe().appendChild(i),function(){setTimeout(function(){const a=Pe();a.contains(i)&&a.removeChild(i),i===n.current&&(n.current=null)})}},[t]),x(o=>{const i=n.current;if(i){i.textContent=o;return}process.env.NODE_ENV!=="production"&&B(`
104
104
  A screen reader message was trying to be announced but it was unable to do so.
105
105
  This can occur if you unmount your <DragDropContext /> in your onDragEnd.
106
106
  Consider calling provided.announce() before the unmount so that the instruction will
@@ -109,7 +109,7 @@ ${fn.current.stack}
109
109
  Message not passed to screen reader:
110
110
 
111
111
  "${o}"
112
- `)},[])}const Da={separator:"::"};function Yt(e,t=Da){const n=D.useId();return w(()=>`${e}${t.separator}${n}`,[t.separator,e,n])}function Na({contextId:e,uniqueId:t}){return`rfd-hidden-text-${e}-${t}`}function xa({contextId:e,text:t}){const n=Yt("hidden-text",{separator:"-"}),r=w(()=>Na({contextId:e,uniqueId:n}),[n,e]);return D.useEffect(function(){const i=document.createElement("div");return i.id=r,i.textContent=t,i.style.display="none",Pe().appendChild(i),function(){const c=Pe();c.contains(i)&&c.removeChild(i)}},[r,t]),r}var Ke=D.createContext(null),Ia={react:"^18.0.0 || ^19.0.0"};const Oa=/(\d+)\.(\d+)\.(\d+)/,Qr=e=>{const t=Oa.exec(e);t==null&&(process.env.NODE_ENV!=="production"?f(!1,`Unable to parse React version ${e}`):f());const n=Number(t[1]),r=Number(t[2]),o=Number(t[3]);return{major:n,minor:r,patch:o,raw:e}},Sa=(e,t)=>t.major>e.major?!0:t.major<e.major?!1:t.minor>e.minor?!0:t.minor<e.minor?!1:t.patch>=e.patch;var wa=(e,t)=>{const n=Qr(e),r=Qr(t);Sa(n,r)||process.env.NODE_ENV!=="production"&&B(`
112
+ `)},[])}const Da={separator:"::"};function Yt(e,t=Da){const n=D.useId();return S(()=>`${e}${t.separator}${n}`,[t.separator,e,n])}function Na({contextId:e,uniqueId:t}){return`rfd-hidden-text-${e}-${t}`}function xa({contextId:e,text:t}){const n=Yt("hidden-text",{separator:"-"}),r=S(()=>Na({contextId:e,uniqueId:n}),[n,e]);return D.useEffect(function(){const i=document.createElement("div");return i.id=r,i.textContent=t,i.style.display="none",Pe().appendChild(i),function(){const c=Pe();c.contains(i)&&c.removeChild(i)}},[r,t]),r}var Ke=D.createContext(null),Ia={react:"^18.0.0 || ^19.0.0"};const Oa=/(\d+)\.(\d+)\.(\d+)/,Qr=e=>{const t=Oa.exec(e);t==null&&(process.env.NODE_ENV!=="production"?g(!1,`Unable to parse React version ${e}`):g());const n=Number(t[1]),r=Number(t[2]),o=Number(t[3]);return{major:n,minor:r,patch:o,raw:e}},Ca=(e,t)=>t.major>e.major?!0:t.major<e.major?!1:t.minor>e.minor?!0:t.minor<e.minor?!1:t.patch>=e.patch;var Sa=(e,t)=>{const n=Qr(e),r=Qr(t);Ca(n,r)||process.env.NODE_ENV!=="production"&&B(`
113
113
  React version: [${r.raw}]
114
114
  does not satisfy expected peer dependency version: [${n.raw}]
115
115
 
@@ -119,7 +119,7 @@ ${fn.current.stack}
119
119
  This is to ensure consistent browser layout and measurement
120
120
 
121
121
  More information: https://github.com/hello-pangea/dnd/blob/main/docs/guides/doctype.md
122
- `;var Ca=e=>{const t=e.doctype;if(!t){process.env.NODE_ENV!=="production"&&B(`
122
+ `;var wa=e=>{const t=e.doctype;if(!t){process.env.NODE_ENV!=="production"&&B(`
123
123
  No <!doctype html> found.
124
124
 
125
125
  ${Xt}
@@ -136,7 +136,7 @@ ${fn.current.stack}
136
136
  A setup problem was encountered.
137
137
 
138
138
  > ${n.message}
139
- `)}},t)})}function Aa(){Te(()=>{wa(Ia.react,D.version),Ca(document)},[])}function Jt(e){const t=D.useRef(e);return D.useEffect(()=>{t.current=e}),t}function _a(){let e=null;function t(){return!!e}function n(s){return s===e}function r(s){e&&(process.env.NODE_ENV!=="production"?f(!1,"Cannot claim lock as it is already claimed"):f());const c={abandon:s};return e=c,c}function o(){e||(process.env.NODE_ENV!=="production"?f(!1,"Cannot release lock when there is no lock"):f()),e=null}function i(){e&&(e.abandon(),o())}return{isClaimed:t,isActive:n,claim:r,release:o,tryAbandon:i}}function Be(e){return e.phase==="IDLE"||e.phase==="DROP_ANIMATING"?!1:e.isDragging}const Pa=9,Ta=13,Zt=27,eo=32,Ba=33,Va=34,La=35,Ra=36,Ma=37,$a=38,Ga=39,Fa=40,ka={[Ta]:!0,[Pa]:!0};var to=e=>{ka[e.keyCode]&&e.preventDefault()};const Je=(()=>{const e="visibilitychange";return typeof document>"u"?e:[e,`ms${e}`,`webkit${e}`,`moz${e}`,`o${e}`].find(r=>`on${r}`in document)||e})(),no=0,ro=5;function Wa(e,t){return Math.abs(t.x-e.x)>=ro||Math.abs(t.y-e.y)>=ro}const oo={type:"IDLE"};function Ua({cancel:e,completed:t,getPhase:n,setPhase:r}){return[{eventName:"mousemove",fn:o=>{const{button:i,clientX:s,clientY:c}=o;if(i!==no)return;const a={x:s,y:c},d=n();if(d.type==="DRAGGING"){o.preventDefault(),d.actions.move(a);return}d.type!=="PENDING"&&(process.env.NODE_ENV!=="production"?f(!1,"Cannot be IDLE"):f());const p=d.point;if(!Wa(p,a))return;o.preventDefault();const l=d.actions.fluidLift(a);r({type:"DRAGGING",actions:l})}},{eventName:"mouseup",fn:o=>{const i=n();if(i.type!=="DRAGGING"){e();return}o.preventDefault(),i.actions.drop({shouldBlockNextClick:!0}),t()}},{eventName:"mousedown",fn:o=>{n().type==="DRAGGING"&&o.preventDefault(),e()}},{eventName:"keydown",fn:o=>{if(n().type==="PENDING"){e();return}if(o.keyCode===Zt){o.preventDefault(),e();return}to(o)}},{eventName:"resize",fn:e},{eventName:"scroll",options:{passive:!0,capture:!1},fn:()=>{n().type==="PENDING"&&e()}},{eventName:"webkitmouseforcedown",fn:o=>{const i=n();if(i.type==="IDLE"&&(process.env.NODE_ENV!=="production"?f(!1,"Unexpected phase"):f()),i.actions.shouldRespectForcePress()){e();return}o.preventDefault()}},{eventName:Je,fn:e}]}function Ha(e){const t=D.useRef(oo),n=D.useRef(te),r=w(()=>({eventName:"mousedown",fn:function(l){if(l.defaultPrevented||l.button!==no||l.ctrlKey||l.metaKey||l.shiftKey||l.altKey)return;const u=e.findClosestDraggableId(l);if(!u)return;const g=e.tryGetLock(u,s,{sourceEvent:l});if(!g)return;l.preventDefault();const m={x:l.clientX,y:l.clientY};n.current(),d(g,m)}}),[e]),o=w(()=>({eventName:"webkitmouseforcewillbegin",fn:p=>{if(p.defaultPrevented)return;const l=e.findClosestDraggableId(p);if(!l)return;const u=e.findOptionsForDraggable(l);u&&(u.shouldRespectForcePress||e.canGetLock(l)&&p.preventDefault())}}),[e]),i=x(function(){const l={passive:!1,capture:!0};n.current=Y(window,[o,r],l)},[o,r]),s=x(()=>{t.current.type!=="IDLE"&&(t.current=oo,n.current(),i())},[i]),c=x(()=>{const p=t.current;s(),p.type==="DRAGGING"&&p.actions.cancel({shouldBlockNextClick:!0}),p.type==="PENDING"&&p.actions.abort()},[s]),a=x(function(){const l={capture:!0,passive:!1},u=Ua({cancel:c,completed:s,getPhase:()=>t.current,setPhase:g=>{t.current=g}});n.current=Y(window,u,l)},[c,s]),d=x(function(l,u){t.current.type!=="IDLE"&&(process.env.NODE_ENV!=="production"?f(!1,"Expected to move from IDLE to PENDING drag"):f()),t.current={type:"PENDING",point:u,actions:l},a()},[a]);U(function(){return i(),function(){n.current()}},[i])}function ja(){}const za={[Va]:!0,[Ba]:!0,[Ra]:!0,[La]:!0};function qa(e,t){function n(){t(),e.cancel()}function r(){t(),e.drop()}return[{eventName:"keydown",fn:o=>{if(o.keyCode===Zt){o.preventDefault(),n();return}if(o.keyCode===eo){o.preventDefault(),r();return}if(o.keyCode===Fa){o.preventDefault(),e.moveDown();return}if(o.keyCode===$a){o.preventDefault(),e.moveUp();return}if(o.keyCode===Ga){o.preventDefault(),e.moveRight();return}if(o.keyCode===Ma){o.preventDefault(),e.moveLeft();return}if(za[o.keyCode]){o.preventDefault();return}to(o)}},{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:Je,fn:n}]}function Ya(e){const t=D.useRef(ja),n=w(()=>({eventName:"keydown",fn:function(i){if(i.defaultPrevented||i.keyCode!==eo)return;const s=e.findClosestDraggableId(i);if(!s)return;const c=e.tryGetLock(s,p,{sourceEvent:i});if(!c)return;i.preventDefault();let a=!0;const d=c.snapLift();t.current();function p(){a||(process.env.NODE_ENV!=="production"?f(!1,"Cannot stop capturing a keyboard drag when not capturing"):f()),a=!1,t.current(),r()}t.current=Y(window,qa(d,p),{capture:!0,passive:!1})}}),[e]),r=x(function(){const i={passive:!1,capture:!0};t.current=Y(window,[n],i)},[n]);U(function(){return r(),function(){t.current()}},[r])}const Qt={type:"IDLE"},Xa=120,Ka=.15;function Ja({cancel:e,getPhase:t}){return[{eventName:"orientationchange",fn:e},{eventName:"resize",fn:e},{eventName:"contextmenu",fn:n=>{n.preventDefault()}},{eventName:"keydown",fn:n=>{if(t().type!=="DRAGGING"){e();return}n.keyCode===Zt&&n.preventDefault(),e()}},{eventName:Je,fn:e}]}function Za({cancel:e,completed:t,getPhase:n}){return[{eventName:"touchmove",options:{capture:!1},fn:r=>{const o=n();if(o.type!=="DRAGGING"){e();return}o.hasMoved=!0;const{clientX:i,clientY:s}=r.touches[0],c={x:i,y:s};r.preventDefault(),o.actions.move(c)}},{eventName:"touchend",fn:r=>{const o=n();if(o.type!=="DRAGGING"){e();return}r.preventDefault(),o.actions.drop({shouldBlockNextClick:!0}),t()}},{eventName:"touchcancel",fn:r=>{if(n().type!=="DRAGGING"){e();return}r.preventDefault(),e()}},{eventName:"touchforcechange",fn:r=>{const o=n();o.type==="IDLE"&&(process.env.NODE_ENV,f());const i=r.touches[0];if(!i||!(i.force>=Ka))return;const c=o.actions.shouldRespectForcePress();if(o.type==="PENDING"){c&&e();return}if(c){if(o.hasMoved){r.preventDefault();return}e();return}r.preventDefault()}},{eventName:Je,fn:e}]}function Qa(e){const t=D.useRef(Qt),n=D.useRef(te),r=x(function(){return t.current},[]),o=x(function(g){t.current=g},[]),i=w(()=>({eventName:"touchstart",fn:function(g){if(g.defaultPrevented)return;const m=e.findClosestDraggableId(g);if(!m)return;const b=e.tryGetLock(m,c,{sourceEvent:g});if(!b)return;const h=g.touches[0],{clientX:y,clientY:v}=h,S={x:y,y:v};n.current(),l(b,S)}}),[e]),s=x(function(){const g={capture:!0,passive:!1};n.current=Y(window,[i],g)},[i]),c=x(()=>{const u=t.current;u.type!=="IDLE"&&(u.type==="PENDING"&&clearTimeout(u.longPressTimerId),o(Qt),n.current(),s())},[s,o]),a=x(()=>{const u=t.current;c(),u.type==="DRAGGING"&&u.actions.cancel({shouldBlockNextClick:!0}),u.type==="PENDING"&&u.actions.abort()},[c]),d=x(function(){const g={capture:!0,passive:!1},m={cancel:a,completed:c,getPhase:r},b=Y(window,Za(m),g),h=Y(window,Ja(m),g);n.current=function(){b(),h()}},[a,r,c]),p=x(function(){const g=r();g.type!=="PENDING"&&(process.env.NODE_ENV!=="production"?f(!1,`Cannot start dragging from phase ${g.type}`):f());const m=g.actions.fluidLift(g.point);o({type:"DRAGGING",actions:m,hasMoved:!1})},[r,o]),l=x(function(g,m){r().type!=="IDLE"&&(process.env.NODE_ENV!=="production"?f(!1,"Expected to move from IDLE to PENDING drag"):f());const b=setTimeout(p,Xa);o({type:"PENDING",point:m,actions:g,longPressTimerId:b}),d()},[d,r,o,p]);U(function(){return s(),function(){n.current();const m=r();m.type==="PENDING"&&(clearTimeout(m.longPressTimerId),o(Qt))}},[r,s,o]),U(function(){return Y(window,[{eventName:"touchmove",fn:()=>{},options:{capture:!1,passive:!1}}])},[])}function el(e){Kt(()=>{const t=Jt(e);Te(()=>{t.current.length!==e.length&&(process.env.NODE_ENV!=="production"?f(!1,"Cannot change the amount of sensor hooks after mounting"):f(!1))})})}const tl=["input","button","textarea","select","option","optgroup","video","audio"];function io(e,t){if(t==null)return!1;if(tl.includes(t.tagName.toLowerCase()))return!0;const r=t.getAttribute("contenteditable");return r==="true"||r===""?!0:t===e?!1:io(e,t.parentElement)}function nl(e,t){const n=t.target;return _e(n)?io(e,n):!1}var rl=e=>K(e.getBoundingClientRect()).center;function ol(e){return e instanceof Jr(e).Element}const il=(()=>{const e="matches";return typeof document>"u"?e:[e,"msMatchesSelector","webkitMatchesSelector"].find(r=>r in Element.prototype)||e})();function so(e,t){return e==null?null:e[il](t)?e:so(e.parentElement,t)}function sl(e,t){return e.closest?e.closest(t):so(e,t)}function cl(e){return`[${pe.contextId}="${e}"]`}function al(e,t){const n=t.target;if(!ol(n))return process.env.NODE_ENV!=="production"&&B("event.target must be a Element"),null;const r=cl(e),o=sl(n,r);return o?_e(o)?o:(process.env.NODE_ENV!=="production"&&B("drag handle must be a HTMLElement"),null):null}function ll(e,t){const n=al(e,t);return n?n.getAttribute(pe.draggableId):null}function dl(e,t){const n=`[${jt.contextId}="${e}"]`,o=Kr(document,n).find(i=>i.getAttribute(jt.id)===t);return o?_e(o)?o:(process.env.NODE_ENV!=="production"&&B("Draggable element is not a HTMLElement"),null):null}function ul(e){e.preventDefault()}function Ze({expected:e,phase:t,isLockActive:n,shouldWarn:r}){return n()?e!==t?(r&&process.env.NODE_ENV!=="production"&&B(`
139
+ `)}},t)})}function Aa(){Te(()=>{Sa(Ia.react,D.version),wa(document)},[])}function Jt(e){const t=D.useRef(e);return D.useEffect(()=>{t.current=e}),t}function _a(){let e=null;function t(){return!!e}function n(s){return s===e}function r(s){e&&(process.env.NODE_ENV!=="production"?g(!1,"Cannot claim lock as it is already claimed"):g());const c={abandon:s};return e=c,c}function o(){e||(process.env.NODE_ENV!=="production"?g(!1,"Cannot release lock when there is no lock"):g()),e=null}function i(){e&&(e.abandon(),o())}return{isClaimed:t,isActive:n,claim:r,release:o,tryAbandon:i}}function Be(e){return e.phase==="IDLE"||e.phase==="DROP_ANIMATING"?!1:e.isDragging}const Pa=9,Ta=13,Zt=27,eo=32,Ba=33,Va=34,La=35,Ra=36,Ma=37,$a=38,Ga=39,Fa=40,ka={[Ta]:!0,[Pa]:!0};var to=e=>{ka[e.keyCode]&&e.preventDefault()};const Je=(()=>{const e="visibilitychange";return typeof document>"u"?e:[e,`ms${e}`,`webkit${e}`,`moz${e}`,`o${e}`].find(r=>`on${r}`in document)||e})(),no=0,ro=5;function Wa(e,t){return Math.abs(t.x-e.x)>=ro||Math.abs(t.y-e.y)>=ro}const oo={type:"IDLE"};function Ua({cancel:e,completed:t,getPhase:n,setPhase:r}){return[{eventName:"mousemove",fn:o=>{const{button:i,clientX:s,clientY:c}=o;if(i!==no)return;const a={x:s,y:c},d=n();if(d.type==="DRAGGING"){o.preventDefault(),d.actions.move(a);return}d.type!=="PENDING"&&(process.env.NODE_ENV!=="production"?g(!1,"Cannot be IDLE"):g());const p=d.point;if(!Wa(p,a))return;o.preventDefault();const l=d.actions.fluidLift(a);r({type:"DRAGGING",actions:l})}},{eventName:"mouseup",fn:o=>{const i=n();if(i.type!=="DRAGGING"){e();return}o.preventDefault(),i.actions.drop({shouldBlockNextClick:!0}),t()}},{eventName:"mousedown",fn:o=>{n().type==="DRAGGING"&&o.preventDefault(),e()}},{eventName:"keydown",fn:o=>{if(n().type==="PENDING"){e();return}if(o.keyCode===Zt){o.preventDefault(),e();return}to(o)}},{eventName:"resize",fn:e},{eventName:"scroll",options:{passive:!0,capture:!1},fn:()=>{n().type==="PENDING"&&e()}},{eventName:"webkitmouseforcedown",fn:o=>{const i=n();if(i.type==="IDLE"&&(process.env.NODE_ENV!=="production"?g(!1,"Unexpected phase"):g()),i.actions.shouldRespectForcePress()){e();return}o.preventDefault()}},{eventName:Je,fn:e}]}function Ha(e){const t=D.useRef(oo),n=D.useRef(te),r=S(()=>({eventName:"mousedown",fn:function(l){if(l.defaultPrevented||l.button!==no||l.ctrlKey||l.metaKey||l.shiftKey||l.altKey)return;const u=e.findClosestDraggableId(l);if(!u)return;const f=e.tryGetLock(u,s,{sourceEvent:l});if(!f)return;l.preventDefault();const m={x:l.clientX,y:l.clientY};n.current(),d(f,m)}}),[e]),o=S(()=>({eventName:"webkitmouseforcewillbegin",fn:p=>{if(p.defaultPrevented)return;const l=e.findClosestDraggableId(p);if(!l)return;const u=e.findOptionsForDraggable(l);u&&(u.shouldRespectForcePress||e.canGetLock(l)&&p.preventDefault())}}),[e]),i=x(function(){const l={passive:!1,capture:!0};n.current=Y(window,[o,r],l)},[o,r]),s=x(()=>{t.current.type!=="IDLE"&&(t.current=oo,n.current(),i())},[i]),c=x(()=>{const p=t.current;s(),p.type==="DRAGGING"&&p.actions.cancel({shouldBlockNextClick:!0}),p.type==="PENDING"&&p.actions.abort()},[s]),a=x(function(){const l={capture:!0,passive:!1},u=Ua({cancel:c,completed:s,getPhase:()=>t.current,setPhase:f=>{t.current=f}});n.current=Y(window,u,l)},[c,s]),d=x(function(l,u){t.current.type!=="IDLE"&&(process.env.NODE_ENV!=="production"?g(!1,"Expected to move from IDLE to PENDING drag"):g()),t.current={type:"PENDING",point:u,actions:l},a()},[a]);U(function(){return i(),function(){n.current()}},[i])}function ja(){}const za={[Va]:!0,[Ba]:!0,[Ra]:!0,[La]:!0};function qa(e,t){function n(){t(),e.cancel()}function r(){t(),e.drop()}return[{eventName:"keydown",fn:o=>{if(o.keyCode===Zt){o.preventDefault(),n();return}if(o.keyCode===eo){o.preventDefault(),r();return}if(o.keyCode===Fa){o.preventDefault(),e.moveDown();return}if(o.keyCode===$a){o.preventDefault(),e.moveUp();return}if(o.keyCode===Ga){o.preventDefault(),e.moveRight();return}if(o.keyCode===Ma){o.preventDefault(),e.moveLeft();return}if(za[o.keyCode]){o.preventDefault();return}to(o)}},{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:Je,fn:n}]}function Ya(e){const t=D.useRef(ja),n=S(()=>({eventName:"keydown",fn:function(i){if(i.defaultPrevented||i.keyCode!==eo)return;const s=e.findClosestDraggableId(i);if(!s)return;const c=e.tryGetLock(s,p,{sourceEvent:i});if(!c)return;i.preventDefault();let a=!0;const d=c.snapLift();t.current();function p(){a||(process.env.NODE_ENV!=="production"?g(!1,"Cannot stop capturing a keyboard drag when not capturing"):g()),a=!1,t.current(),r()}t.current=Y(window,qa(d,p),{capture:!0,passive:!1})}}),[e]),r=x(function(){const i={passive:!1,capture:!0};t.current=Y(window,[n],i)},[n]);U(function(){return r(),function(){t.current()}},[r])}const Qt={type:"IDLE"},Xa=120,Ka=.15;function Ja({cancel:e,getPhase:t}){return[{eventName:"orientationchange",fn:e},{eventName:"resize",fn:e},{eventName:"contextmenu",fn:n=>{n.preventDefault()}},{eventName:"keydown",fn:n=>{if(t().type!=="DRAGGING"){e();return}n.keyCode===Zt&&n.preventDefault(),e()}},{eventName:Je,fn:e}]}function Za({cancel:e,completed:t,getPhase:n}){return[{eventName:"touchmove",options:{capture:!1},fn:r=>{const o=n();if(o.type!=="DRAGGING"){e();return}o.hasMoved=!0;const{clientX:i,clientY:s}=r.touches[0],c={x:i,y:s};r.preventDefault(),o.actions.move(c)}},{eventName:"touchend",fn:r=>{const o=n();if(o.type!=="DRAGGING"){e();return}r.preventDefault(),o.actions.drop({shouldBlockNextClick:!0}),t()}},{eventName:"touchcancel",fn:r=>{if(n().type!=="DRAGGING"){e();return}r.preventDefault(),e()}},{eventName:"touchforcechange",fn:r=>{const o=n();o.type==="IDLE"&&(process.env.NODE_ENV,g());const i=r.touches[0];if(!i||!(i.force>=Ka))return;const c=o.actions.shouldRespectForcePress();if(o.type==="PENDING"){c&&e();return}if(c){if(o.hasMoved){r.preventDefault();return}e();return}r.preventDefault()}},{eventName:Je,fn:e}]}function Qa(e){const t=D.useRef(Qt),n=D.useRef(te),r=x(function(){return t.current},[]),o=x(function(f){t.current=f},[]),i=S(()=>({eventName:"touchstart",fn:function(f){if(f.defaultPrevented)return;const m=e.findClosestDraggableId(f);if(!m)return;const b=e.tryGetLock(m,c,{sourceEvent:f});if(!b)return;const h=f.touches[0],{clientX:E,clientY:v}=h,C={x:E,y:v};n.current(),l(b,C)}}),[e]),s=x(function(){const f={capture:!0,passive:!1};n.current=Y(window,[i],f)},[i]),c=x(()=>{const u=t.current;u.type!=="IDLE"&&(u.type==="PENDING"&&clearTimeout(u.longPressTimerId),o(Qt),n.current(),s())},[s,o]),a=x(()=>{const u=t.current;c(),u.type==="DRAGGING"&&u.actions.cancel({shouldBlockNextClick:!0}),u.type==="PENDING"&&u.actions.abort()},[c]),d=x(function(){const f={capture:!0,passive:!1},m={cancel:a,completed:c,getPhase:r},b=Y(window,Za(m),f),h=Y(window,Ja(m),f);n.current=function(){b(),h()}},[a,r,c]),p=x(function(){const f=r();f.type!=="PENDING"&&(process.env.NODE_ENV!=="production"?g(!1,`Cannot start dragging from phase ${f.type}`):g());const m=f.actions.fluidLift(f.point);o({type:"DRAGGING",actions:m,hasMoved:!1})},[r,o]),l=x(function(f,m){r().type!=="IDLE"&&(process.env.NODE_ENV!=="production"?g(!1,"Expected to move from IDLE to PENDING drag"):g());const b=setTimeout(p,Xa);o({type:"PENDING",point:m,actions:f,longPressTimerId:b}),d()},[d,r,o,p]);U(function(){return s(),function(){n.current();const m=r();m.type==="PENDING"&&(clearTimeout(m.longPressTimerId),o(Qt))}},[r,s,o]),U(function(){return Y(window,[{eventName:"touchmove",fn:()=>{},options:{capture:!1,passive:!1}}])},[])}function el(e){Kt(()=>{const t=Jt(e);Te(()=>{t.current.length!==e.length&&(process.env.NODE_ENV!=="production"?g(!1,"Cannot change the amount of sensor hooks after mounting"):g(!1))})})}const tl=["input","button","textarea","select","option","optgroup","video","audio"];function io(e,t){if(t==null)return!1;if(tl.includes(t.tagName.toLowerCase()))return!0;const r=t.getAttribute("contenteditable");return r==="true"||r===""?!0:t===e?!1:io(e,t.parentElement)}function nl(e,t){const n=t.target;return _e(n)?io(e,n):!1}var rl=e=>K(e.getBoundingClientRect()).center;function ol(e){return e instanceof Jr(e).Element}const il=(()=>{const e="matches";return typeof document>"u"?e:[e,"msMatchesSelector","webkitMatchesSelector"].find(r=>r in Element.prototype)||e})();function so(e,t){return e==null?null:e[il](t)?e:so(e.parentElement,t)}function sl(e,t){return e.closest?e.closest(t):so(e,t)}function cl(e){return`[${pe.contextId}="${e}"]`}function al(e,t){const n=t.target;if(!ol(n))return process.env.NODE_ENV!=="production"&&B("event.target must be a Element"),null;const r=cl(e),o=sl(n,r);return o?_e(o)?o:(process.env.NODE_ENV!=="production"&&B("drag handle must be a HTMLElement"),null):null}function ll(e,t){const n=al(e,t);return n?n.getAttribute(pe.draggableId):null}function dl(e,t){const n=`[${jt.contextId}="${e}"]`,o=Kr(document,n).find(i=>i.getAttribute(jt.id)===t);return o?_e(o)?o:(process.env.NODE_ENV!=="production"&&B("Draggable element is not a HTMLElement"),null):null}function ul(e){e.preventDefault()}function Ze({expected:e,phase:t,isLockActive:n,shouldWarn:r}){return n()?e!==t?(r&&process.env.NODE_ENV!=="production"&&B(`
140
140
  Cannot perform action.
141
141
  The actions you used belong to an outdated phase
142
142
 
@@ -154,13 +154,13 @@ ${fn.current.stack}
154
154
 
155
155
  - Throw away your action handlers when forceStop() is called
156
156
  - Check actions.isActive() if you really need to
157
- `),!1)}function co({lockAPI:e,store:t,registry:n,draggableId:r}){if(e.isClaimed())return!1;const o=n.draggable.findById(r);return o?!(!o.options.isEnabled||!kr(t.getState(),r)):(process.env.NODE_ENV!=="production"&&B(`Unable to find draggable with id: ${r}`),!1)}function pl({lockAPI:e,contextId:t,store:n,registry:r,draggableId:o,forceSensorStop:i,sourceEvent:s}){if(!co({lockAPI:e,store:n,registry:r,draggableId:o}))return null;const a=r.draggable.getById(o),d=dl(t,a.descriptor.id);if(!d)return process.env.NODE_ENV!=="production"&&B(`Unable to find draggable element with id: ${o}`),null;if(s&&!a.options.canDragInteractiveElements&&nl(d,s))return null;const p=e.claim(i||te);let l="PRE_DRAG";function u(){return a.options.shouldRespectForcePress}function g(){return e.isActive(p)}function m(N,O){Ze({expected:N,phase:l,isLockActive:g,shouldWarn:!0})&&n.dispatch(O())}const b=m.bind(null,"DRAGGING");function h(N){function O(){e.release(),l="COMPLETED"}l!=="PRE_DRAG"&&(O(),process.env.NODE_ENV!=="production"?f(!1,`Cannot lift in phase ${l}`):f()),n.dispatch(Zs(N.liftActionArgs)),l="DRAGGING";function A(T,H={shouldBlockNextClick:!1}){if(N.cleanup(),H.shouldBlockNextClick){const V=Y(window,[{eventName:"click",fn:ul,options:{once:!0,passive:!1,capture:!0}}]);setTimeout(V)}O(),n.dispatch(_r({reason:T}))}return{isActive:()=>Ze({expected:"DRAGGING",phase:l,isLockActive:g,shouldWarn:!1}),shouldRespectForcePress:u,drop:T=>A("DROP",T),cancel:T=>A("CANCEL",T),...N.actions}}function y(N){const O=me(T=>{b(()=>Ar({client:T}))});return{...h({liftActionArgs:{id:o,clientSelection:N,movementMode:"FLUID"},cleanup:()=>O.cancel(),actions:{move:O}}),move:O}}function v(){const N={moveUp:()=>b(cc),moveRight:()=>b(lc),moveDown:()=>b(ac),moveLeft:()=>b(dc)};return h({liftActionArgs:{id:o,clientSelection:rl(d),movementMode:"SNAP"},cleanup:te,actions:N})}function S(){Ze({expected:"PRE_DRAG",phase:l,isLockActive:g,shouldWarn:!0})&&e.release()}return{isActive:()=>Ze({expected:"PRE_DRAG",phase:l,isLockActive:g,shouldWarn:!1}),shouldRespectForcePress:u,fluidLift:y,snapLift:v,abort:S}}const fl=[Ha,Ya,Qa];function gl({contextId:e,store:t,registry:n,customSensors:r,enableDefaultSensors:o}){const i=[...o?fl:[],...r||[]],s=D.useState(()=>_a())[0],c=x(function(h,y){Be(h)&&!Be(y)&&s.tryAbandon()},[s]);U(function(){let h=t.getState();return t.subscribe(()=>{const v=t.getState();c(h,v),h=v})},[s,t,c]),U(()=>s.tryAbandon,[s.tryAbandon]);const a=x(b=>co({lockAPI:s,registry:n,store:t,draggableId:b}),[s,n,t]),d=x((b,h,y)=>pl({lockAPI:s,registry:n,contextId:e,store:t,draggableId:b,forceSensorStop:h||null,sourceEvent:y&&y.sourceEvent?y.sourceEvent:null}),[e,s,n,t]),p=x(b=>ll(e,b),[e]),l=x(b=>{const h=n.draggable.findById(b);return h?h.options:null},[n.draggable]),u=x(function(){s.isClaimed()&&(s.tryAbandon(),t.getState().phase!=="IDLE"&&t.dispatch(Vt()))},[s,t]),g=x(()=>s.isClaimed(),[s]),m=w(()=>({canGetLock:a,tryGetLock:d,findClosestDraggableId:p,findOptionsForDraggable:l,tryReleaseLock:u,isLockClaimed:g}),[a,d,p,l,u,g]);el(i);for(let b=0;b<i.length;b++)i[b](m)}const ml=e=>({onBeforeCapture:t=>{const n=()=>{e.onBeforeCapture&&e.onBeforeCapture(t)};rt.flushSync(n)},onBeforeDragStart:e.onBeforeDragStart,onDragStart:e.onDragStart,onDragEnd:e.onDragEnd,onDragUpdate:e.onDragUpdate}),hl=e=>({...Ce,...e.autoScrollerOptions,durationDampening:{...Ce.durationDampening,...e.autoScrollerOptions}});function Ve(e){return e.current||(process.env.NODE_ENV!=="production"?f(!1,"Could not find store from lazy ref"):f()),e.current}function bl(e){const{contextId:t,setCallbacks:n,sensors:r,nonce:o,dragHandleUsageInstructions:i}=e,s=D.useRef(null);Aa();const c=Jt(e),a=x(()=>ml(c.current),[c]),d=x(()=>hl(c.current),[c]),p=Ea(t),l=xa({contextId:t,text:i}),u=ga(t,o),g=x(V=>{Ve(s).dispatch(V)},[]),m=w(()=>En({publishWhileDragging:ec,updateDroppableScroll:nc,updateDroppableIsEnabled:rc,updateDroppableIsCombineEnabled:oc,collectionStarting:tc},g),[g]),b=ba(),h=w(()=>zc(b,m),[b,m]),y=w(()=>la({scrollWindow:qc,scrollDroppable:h.scrollDroppable,getAutoScrollerOptions:d,...En({move:Ar},g)}),[h.scrollDroppable,g,d]),v=ma(t),S=w(()=>Wc({announce:p,autoScroller:y,dimensionMarshal:h,focusMarshal:v,getResponders:a,styleMarshal:u}),[p,y,h,v,a,u]);process.env.NODE_ENV!=="production"&&s.current&&s.current!==S&&process.env.NODE_ENV!=="production"&&B("unexpected store change"),s.current=S;const I=x(()=>{const V=Ve(s);V.getState().phase!=="IDLE"&&V.dispatch(Vt())},[]),N=x(()=>{const V=Ve(s).getState();return V.phase==="DROP_ANIMATING"?!0:V.phase==="IDLE"?!1:V.isDragging},[]),O=w(()=>({isDragging:N,tryAbort:I}),[N,I]);n(O);const A=x(V=>kr(Ve(s).getState(),V),[]),T=x(()=>se(Ve(s).getState()),[]),H=w(()=>({marshal:h,focus:v,contextId:t,canLift:A,isMovementAllowed:T,dragHandleUsageInstructionsId:l,registry:b}),[t,h,l,v,A,T,b]);return gl({contextId:t,store:S,registry:b,customSensors:r||null,enableDefaultSensors:e.enableDefaultSensors!==!1}),D.useEffect(()=>I,[I]),D.createElement(Ke.Provider,{value:H},D.createElement(_i,{context:qt,store:S},e.children))}function vl(){return D.useId()}function yl(e){const t=vl(),n=e.dragHandleUsageInstructions||Ue.dragHandleUsageInstructions;return D.createElement(Wi,null,r=>D.createElement(bl,{nonce:e.nonce,contextId:t,setCallbacks:r,dragHandleUsageInstructions:n,enableDefaultSensors:e.enableDefaultSensors,sensors:e.sensors,onBeforeCapture:e.onBeforeCapture,onBeforeDragStart:e.onBeforeDragStart,onDragStart:e.onDragStart,onDragUpdate:e.onDragUpdate,onDragEnd:e.onDragEnd,autoScrollerOptions:e.autoScrollerOptions},e.children))}const ao={dragging:5e3,dropAnimating:4500},El=(e,t)=>t?Se.drop(t.duration):e?Se.snap:Se.fluid,Dl=(e,t)=>{if(e)return t?Oe.opacity.drop:Oe.opacity.combining},Nl=e=>e.forceShouldAnimate!=null?e.forceShouldAnimate:e.mode==="SNAP";function xl(e){const n=e.dimension.client,{offset:r,combineWith:o,dropping:i}=e,s=!!o,c=Nl(e),a=!!i,d=a?Mt.drop(r,s):Mt.moveTo(r);return{position:"fixed",top:n.marginBox.top,left:n.marginBox.left,boxSizing:"border-box",width:n.borderBox.width,height:n.borderBox.height,transition:El(c,i),transform:d,opacity:Dl(s,a),zIndex:a?ao.dropAnimating:ao.dragging,pointerEvents:"none"}}function Il(e){return{transform:Mt.moveTo(e.offset),transition:e.shouldAnimateDisplacement?void 0:"none"}}function Ol(e){return e.type==="DRAGGING"?xl(e):Il(e)}function Sl(e,t,n=R){const r=window.getComputedStyle(t),o=t.getBoundingClientRect(),i=zn(o,r),s=Fe(i,n),c={client:i,tagName:t.tagName.toLowerCase(),display:r.display},a={x:i.marginBox.width,y:i.marginBox.height};return{descriptor:e,placeholder:c,displaceBy:a,client:i,page:s}}function wl(e){const t=Yt("draggable"),{descriptor:n,registry:r,getDraggableRef:o,canDragInteractiveElements:i,shouldRespectForcePress:s,isEnabled:c}=e,a=w(()=>({canDragInteractiveElements:i,shouldRespectForcePress:s,isEnabled:c}),[i,c,s]),d=x(g=>{const m=o();return m||(process.env.NODE_ENV!=="production"?f(!1,"Cannot get dimension when no ref is set"):f()),Sl(n,m,g)},[n,o]),p=w(()=>({uniqueId:t,descriptor:n,options:a,getDimension:d}),[n,d,a,t]),l=D.useRef(p),u=D.useRef(!0);U(()=>(r.draggable.register(l.current),()=>r.draggable.unregister(l.current)),[r.draggable]),U(()=>{if(u.current){u.current=!1;return}const g=l.current;l.current=p,r.draggable.update(p,g)},[p,r.draggable])}var en=D.createContext(null);function lo(e){e&&_e(e)||(process.env.NODE_ENV!=="production"?f(!1,`
157
+ `),!1)}function co({lockAPI:e,store:t,registry:n,draggableId:r}){if(e.isClaimed())return!1;const o=n.draggable.findById(r);return o?!(!o.options.isEnabled||!kr(t.getState(),r)):(process.env.NODE_ENV!=="production"&&B(`Unable to find draggable with id: ${r}`),!1)}function pl({lockAPI:e,contextId:t,store:n,registry:r,draggableId:o,forceSensorStop:i,sourceEvent:s}){if(!co({lockAPI:e,store:n,registry:r,draggableId:o}))return null;const a=r.draggable.getById(o),d=dl(t,a.descriptor.id);if(!d)return process.env.NODE_ENV!=="production"&&B(`Unable to find draggable element with id: ${o}`),null;if(s&&!a.options.canDragInteractiveElements&&nl(d,s))return null;const p=e.claim(i||te);let l="PRE_DRAG";function u(){return a.options.shouldRespectForcePress}function f(){return e.isActive(p)}function m(N,O){Ze({expected:N,phase:l,isLockActive:f,shouldWarn:!0})&&n.dispatch(O())}const b=m.bind(null,"DRAGGING");function h(N){function O(){e.release(),l="COMPLETED"}l!=="PRE_DRAG"&&(O(),process.env.NODE_ENV!=="production"?g(!1,`Cannot lift in phase ${l}`):g()),n.dispatch(Zs(N.liftActionArgs)),l="DRAGGING";function _(T,H={shouldBlockNextClick:!1}){if(N.cleanup(),H.shouldBlockNextClick){const V=Y(window,[{eventName:"click",fn:ul,options:{once:!0,passive:!1,capture:!0}}]);setTimeout(V)}O(),n.dispatch(_r({reason:T}))}return{isActive:()=>Ze({expected:"DRAGGING",phase:l,isLockActive:f,shouldWarn:!1}),shouldRespectForcePress:u,drop:T=>_("DROP",T),cancel:T=>_("CANCEL",T),...N.actions}}function E(N){const O=me(T=>{b(()=>Ar({client:T}))});return{...h({liftActionArgs:{id:o,clientSelection:N,movementMode:"FLUID"},cleanup:()=>O.cancel(),actions:{move:O}}),move:O}}function v(){const N={moveUp:()=>b(cc),moveRight:()=>b(lc),moveDown:()=>b(ac),moveLeft:()=>b(dc)};return h({liftActionArgs:{id:o,clientSelection:rl(d),movementMode:"SNAP"},cleanup:te,actions:N})}function C(){Ze({expected:"PRE_DRAG",phase:l,isLockActive:f,shouldWarn:!0})&&e.release()}return{isActive:()=>Ze({expected:"PRE_DRAG",phase:l,isLockActive:f,shouldWarn:!1}),shouldRespectForcePress:u,fluidLift:E,snapLift:v,abort:C}}const fl=[Ha,Ya,Qa];function gl({contextId:e,store:t,registry:n,customSensors:r,enableDefaultSensors:o}){const i=[...o?fl:[],...r||[]],s=D.useState(()=>_a())[0],c=x(function(h,E){Be(h)&&!Be(E)&&s.tryAbandon()},[s]);U(function(){let h=t.getState();return t.subscribe(()=>{const v=t.getState();c(h,v),h=v})},[s,t,c]),U(()=>s.tryAbandon,[s.tryAbandon]);const a=x(b=>co({lockAPI:s,registry:n,store:t,draggableId:b}),[s,n,t]),d=x((b,h,E)=>pl({lockAPI:s,registry:n,contextId:e,store:t,draggableId:b,forceSensorStop:h||null,sourceEvent:E&&E.sourceEvent?E.sourceEvent:null}),[e,s,n,t]),p=x(b=>ll(e,b),[e]),l=x(b=>{const h=n.draggable.findById(b);return h?h.options:null},[n.draggable]),u=x(function(){s.isClaimed()&&(s.tryAbandon(),t.getState().phase!=="IDLE"&&t.dispatch(Vt()))},[s,t]),f=x(()=>s.isClaimed(),[s]),m=S(()=>({canGetLock:a,tryGetLock:d,findClosestDraggableId:p,findOptionsForDraggable:l,tryReleaseLock:u,isLockClaimed:f}),[a,d,p,l,u,f]);el(i);for(let b=0;b<i.length;b++)i[b](m)}const ml=e=>({onBeforeCapture:t=>{const n=()=>{e.onBeforeCapture&&e.onBeforeCapture(t)};rt.flushSync(n)},onBeforeDragStart:e.onBeforeDragStart,onDragStart:e.onDragStart,onDragEnd:e.onDragEnd,onDragUpdate:e.onDragUpdate}),hl=e=>({...we,...e.autoScrollerOptions,durationDampening:{...we.durationDampening,...e.autoScrollerOptions}});function Ve(e){return e.current||(process.env.NODE_ENV!=="production"?g(!1,"Could not find store from lazy ref"):g()),e.current}function bl(e){const{contextId:t,setCallbacks:n,sensors:r,nonce:o,dragHandleUsageInstructions:i}=e,s=D.useRef(null);Aa();const c=Jt(e),a=x(()=>ml(c.current),[c]),d=x(()=>hl(c.current),[c]),p=Ea(t),l=xa({contextId:t,text:i}),u=ga(t,o),f=x(V=>{Ve(s).dispatch(V)},[]),m=S(()=>En({publishWhileDragging:ec,updateDroppableScroll:nc,updateDroppableIsEnabled:rc,updateDroppableIsCombineEnabled:oc,collectionStarting:tc},f),[f]),b=ba(),h=S(()=>zc(b,m),[b,m]),E=S(()=>la({scrollWindow:qc,scrollDroppable:h.scrollDroppable,getAutoScrollerOptions:d,...En({move:Ar},f)}),[h.scrollDroppable,f,d]),v=ma(t),C=S(()=>Wc({announce:p,autoScroller:E,dimensionMarshal:h,focusMarshal:v,getResponders:a,styleMarshal:u}),[p,E,h,v,a,u]);process.env.NODE_ENV!=="production"&&s.current&&s.current!==C&&process.env.NODE_ENV!=="production"&&B("unexpected store change"),s.current=C;const I=x(()=>{const V=Ve(s);V.getState().phase!=="IDLE"&&V.dispatch(Vt())},[]),N=x(()=>{const V=Ve(s).getState();return V.phase==="DROP_ANIMATING"?!0:V.phase==="IDLE"?!1:V.isDragging},[]),O=S(()=>({isDragging:N,tryAbort:I}),[N,I]);n(O);const _=x(V=>kr(Ve(s).getState(),V),[]),T=x(()=>se(Ve(s).getState()),[]),H=S(()=>({marshal:h,focus:v,contextId:t,canLift:_,isMovementAllowed:T,dragHandleUsageInstructionsId:l,registry:b}),[t,h,l,v,_,T,b]);return gl({contextId:t,store:C,registry:b,customSensors:r||null,enableDefaultSensors:e.enableDefaultSensors!==!1}),D.useEffect(()=>I,[I]),D.createElement(Ke.Provider,{value:H},D.createElement(_i,{context:qt,store:C},e.children))}function vl(){return D.useId()}function yl(e){const t=vl(),n=e.dragHandleUsageInstructions||Ue.dragHandleUsageInstructions;return D.createElement(Wi,null,r=>D.createElement(bl,{nonce:e.nonce,contextId:t,setCallbacks:r,dragHandleUsageInstructions:n,enableDefaultSensors:e.enableDefaultSensors,sensors:e.sensors,onBeforeCapture:e.onBeforeCapture,onBeforeDragStart:e.onBeforeDragStart,onDragStart:e.onDragStart,onDragUpdate:e.onDragUpdate,onDragEnd:e.onDragEnd,autoScrollerOptions:e.autoScrollerOptions},e.children))}const ao={dragging:5e3,dropAnimating:4500},El=(e,t)=>t?Ce.drop(t.duration):e?Ce.snap:Ce.fluid,Dl=(e,t)=>{if(e)return t?Oe.opacity.drop:Oe.opacity.combining},Nl=e=>e.forceShouldAnimate!=null?e.forceShouldAnimate:e.mode==="SNAP";function xl(e){const n=e.dimension.client,{offset:r,combineWith:o,dropping:i}=e,s=!!o,c=Nl(e),a=!!i,d=a?Mt.drop(r,s):Mt.moveTo(r);return{position:"fixed",top:n.marginBox.top,left:n.marginBox.left,boxSizing:"border-box",width:n.borderBox.width,height:n.borderBox.height,transition:El(c,i),transform:d,opacity:Dl(s,a),zIndex:a?ao.dropAnimating:ao.dragging,pointerEvents:"none"}}function Il(e){return{transform:Mt.moveTo(e.offset),transition:e.shouldAnimateDisplacement?void 0:"none"}}function Ol(e){return e.type==="DRAGGING"?xl(e):Il(e)}function Cl(e,t,n=R){const r=window.getComputedStyle(t),o=t.getBoundingClientRect(),i=zn(o,r),s=Fe(i,n),c={client:i,tagName:t.tagName.toLowerCase(),display:r.display},a={x:i.marginBox.width,y:i.marginBox.height};return{descriptor:e,placeholder:c,displaceBy:a,client:i,page:s}}function Sl(e){const t=Yt("draggable"),{descriptor:n,registry:r,getDraggableRef:o,canDragInteractiveElements:i,shouldRespectForcePress:s,isEnabled:c}=e,a=S(()=>({canDragInteractiveElements:i,shouldRespectForcePress:s,isEnabled:c}),[i,c,s]),d=x(f=>{const m=o();return m||(process.env.NODE_ENV!=="production"?g(!1,"Cannot get dimension when no ref is set"):g()),Cl(n,m,f)},[n,o]),p=S(()=>({uniqueId:t,descriptor:n,options:a,getDimension:d}),[n,d,a,t]),l=D.useRef(p),u=D.useRef(!0);U(()=>(r.draggable.register(l.current),()=>r.draggable.unregister(l.current)),[r.draggable]),U(()=>{if(u.current){u.current=!1;return}const f=l.current;l.current=p,r.draggable.update(p,f)},[p,r.draggable])}var en=D.createContext(null);function lo(e){e&&_e(e)||(process.env.NODE_ENV!=="production"?g(!1,`
158
158
  provided.innerRef has not been provided with a HTMLElement.
159
159
 
160
160
  You can find a guide on using the innerRef callback functions at:
161
161
  https://github.com/hello-pangea/dnd/blob/main/docs/guides/using-inner-ref.md
162
- `):f())}function Cl(e,t,n){Te(()=>{function r(i){return`Draggable[id: ${i}]: `}const o=e.draggableId;o||(process.env.NODE_ENV!=="production"?f(!1,"Draggable requires a draggableId"):f(!1)),typeof o!="string"&&(process.env.NODE_ENV!=="production"?f(!1,`Draggable requires a [string] draggableId.
163
- Provided: [type: ${typeof o}] (value: ${o})`):f(!1)),Number.isInteger(e.index)||(process.env.NODE_ENV!=="production"?f(!1,`${r(o)} requires an integer index prop`):f(!1)),e.mapped.type!=="DRAGGING"&&(lo(n()),e.isEnabled&&(Zr(t,o)||(process.env.NODE_ENV!=="production"?f(!1,`${r(o)} Unable to find drag handle`):f(!1))))})}function Al(e){Kt(()=>{const t=D.useRef(e);Te(()=>{e!==t.current&&(process.env.NODE_ENV!=="production"?f(!1,"Draggable isClone prop value changed during component life"):f(!1))},[e])})}function Qe(e){const t=D.useContext(e);return t||(process.env.NODE_ENV!=="production"?f(!1,"Could not find required context"):f()),t}function _l(e){e.preventDefault()}const Pl=e=>{const t=D.useRef(null),n=x((O=null)=>{t.current=O},[]),r=x(()=>t.current,[]),{contextId:o,dragHandleUsageInstructionsId:i,registry:s}=Qe(Ke),{type:c,droppableId:a}=Qe(en),d=w(()=>({id:e.draggableId,index:e.index,type:c,droppableId:a}),[e.draggableId,e.index,c,a]),{children:p,draggableId:l,isEnabled:u,shouldRespectForcePress:g,canDragInteractiveElements:m,isClone:b,mapped:h,dropAnimationFinished:y}=e;if(Cl(e,o,r),Al(b),!b){const O=w(()=>({descriptor:d,registry:s,getDraggableRef:r,canDragInteractiveElements:m,shouldRespectForcePress:g,isEnabled:u}),[d,s,r,m,g,u]);wl(O)}const v=w(()=>u?{tabIndex:0,role:"button","aria-describedby":i,"data-rfd-drag-handle-draggable-id":l,"data-rfd-drag-handle-context-id":o,draggable:!1,onDragStart:_l}:null,[o,i,l,u]),S=x(O=>{h.type==="DRAGGING"&&h.dropping&&O.propertyName==="transform"&&rt.flushSync(y)},[y,h]),I=w(()=>{const O=Ol(h),A=h.type==="DRAGGING"&&h.dropping?S:void 0;return{innerRef:n,draggableProps:{"data-rfd-draggable-context-id":o,"data-rfd-draggable-id":l,style:O,onTransitionEnd:A},dragHandleProps:v}},[o,v,l,h,S,n]),N=w(()=>({draggableId:d.id,type:d.type,source:{index:d.index,droppableId:d.droppableId}}),[d.droppableId,d.id,d.index,d.type]);return D.createElement(D.Fragment,null,p(I,h.snapshot,N))};var uo=(e,t)=>e===t,po=e=>{const{combine:t,destination:n}=e;return n?n.droppableId:t?t.droppableId:null};const Tl=e=>e.combine?e.combine.draggableId:null,Bl=e=>e.at&&e.at.type==="COMBINE"?e.at.combine.draggableId:null;function Vl(){const e=M((o,i)=>({x:o,y:i})),t=M((o,i,s=null,c=null,a=null)=>({isDragging:!0,isClone:i,isDropAnimating:!!a,dropAnimation:a,mode:o,draggingOver:s,combineWith:c,combineTargetFor:null})),n=M((o,i,s,c,a=null,d=null,p=null)=>({mapped:{type:"DRAGGING",dropping:null,draggingOver:a,combineWith:d,mode:i,offset:o,dimension:s,forceShouldAnimate:p,snapshot:t(i,c,a,d,null)}}));return(o,i)=>{if(Be(o)){if(o.critical.draggable.id!==i.draggableId)return null;const s=o.current.client.offset,c=o.dimensions.draggables[i.draggableId],a=W(o.impact),d=Bl(o.impact),p=o.forceShouldAnimate;return n(e(s.x,s.y),o.movementMode,c,i.isClone,a,d,p)}if(o.phase==="DROP_ANIMATING"){const s=o.completed;if(s.result.draggableId!==i.draggableId)return null;const c=i.isClone,a=o.dimensions.draggables[i.draggableId],d=s.result,p=d.mode,l=po(d),u=Tl(d),m={duration:o.dropDuration,curve:Rt.drop,moveTo:o.newHomeClientOffset,opacity:u?Oe.opacity.drop:null,scale:u?Oe.scale.drop:null};return{mapped:{type:"DRAGGING",offset:o.newHomeClientOffset,dimension:a,dropping:m,draggingOver:l,combineWith:u,mode:p,forceShouldAnimate:null,snapshot:t(p,c,l,u,m)}}}return null}}function fo(e=null){return{isDragging:!1,isDropAnimating:!1,isClone:!1,dropAnimation:null,mode:null,draggingOver:null,combineTargetFor:e,combineWith:null}}const Ll={mapped:{type:"SECONDARY",offset:R,combineTargetFor:null,shouldAnimateDisplacement:!0,snapshot:fo(null)}};function Rl(){const e=M((s,c)=>({x:s,y:c})),t=M(fo),n=M((s,c=null,a)=>({mapped:{type:"SECONDARY",offset:s,combineTargetFor:c,shouldAnimateDisplacement:a,snapshot:t(c)}})),r=s=>s?n(R,s,!0):null,o=(s,c,a,d)=>{const p=a.displaced.visible[s],l=!!(d.inVirtualList&&d.effected[s]),u=je(a),g=u&&u.draggableId===s?c:null;if(!p){if(!l)return r(g);if(a.displaced.invisible[s])return null;const h=ae(d.displacedBy.point),y=e(h.x,h.y);return n(y,g,!0)}if(l)return r(g);const m=a.displacedBy.point,b=e(m.x,m.y);return n(b,g,p.shouldAnimate)};return(s,c)=>{if(Be(s))return s.critical.draggable.id===c.draggableId?null:o(c.draggableId,s.critical.draggable.id,s.impact,s.afterCritical);if(s.phase==="DROP_ANIMATING"){const a=s.completed;return a.result.draggableId===c.draggableId?null:o(c.draggableId,a.result.draggableId,a.impact,a.afterCritical)}return null}}const Ml=Un(()=>{const e=Vl(),t=Rl();return(r,o)=>e(r,o)||t(r,o)||Ll},{dropAnimationFinished:Pr},null,{context:qt,areStatePropsEqual:uo})(Pl);function go(e){return Qe(en).isUsingCloneFor===e.draggableId&&!e.isClone?null:D.createElement(Ml,e)}function $l(e){const t=typeof e.isDragDisabled=="boolean"?!e.isDragDisabled:!0,n=!!e.disableInteractiveElementBlocking,r=!!e.shouldRespectForcePress;return D.createElement(go,ke({},e,{isClone:!1,isEnabled:t,canDragInteractiveElements:n,shouldRespectForcePress:r}))}const tn=e=>t=>e===t,Gl=tn("scroll"),Fl=tn("auto"),kl=tn("visible"),mo=(e,t)=>t(e.overflowX)||t(e.overflowY),Wl=(e,t)=>t(e.overflowX)&&t(e.overflowY),ho=e=>{const t=window.getComputedStyle(e),n={overflowX:t.overflowX,overflowY:t.overflowY};return mo(n,Gl)||mo(n,Fl)},Ul=()=>{if(process.env.NODE_ENV==="production")return!1;const e=Pe(),t=document.documentElement;if(t||(process.env.NODE_ENV,f()),!ho(e))return!1;const n=window.getComputedStyle(t),r={overflowX:n.overflowX,overflowY:n.overflowY};return Wl(r,kl)||process.env.NODE_ENV!=="production"&&B(`
162
+ `):g())}function wl(e,t,n){Te(()=>{function r(i){return`Draggable[id: ${i}]: `}const o=e.draggableId;o||(process.env.NODE_ENV!=="production"?g(!1,"Draggable requires a draggableId"):g(!1)),typeof o!="string"&&(process.env.NODE_ENV!=="production"?g(!1,`Draggable requires a [string] draggableId.
163
+ Provided: [type: ${typeof o}] (value: ${o})`):g(!1)),Number.isInteger(e.index)||(process.env.NODE_ENV!=="production"?g(!1,`${r(o)} requires an integer index prop`):g(!1)),e.mapped.type!=="DRAGGING"&&(lo(n()),e.isEnabled&&(Zr(t,o)||(process.env.NODE_ENV!=="production"?g(!1,`${r(o)} Unable to find drag handle`):g(!1))))})}function Al(e){Kt(()=>{const t=D.useRef(e);Te(()=>{e!==t.current&&(process.env.NODE_ENV!=="production"?g(!1,"Draggable isClone prop value changed during component life"):g(!1))},[e])})}function Qe(e){const t=D.useContext(e);return t||(process.env.NODE_ENV!=="production"?g(!1,"Could not find required context"):g()),t}function _l(e){e.preventDefault()}const Pl=e=>{const t=D.useRef(null),n=x((O=null)=>{t.current=O},[]),r=x(()=>t.current,[]),{contextId:o,dragHandleUsageInstructionsId:i,registry:s}=Qe(Ke),{type:c,droppableId:a}=Qe(en),d=S(()=>({id:e.draggableId,index:e.index,type:c,droppableId:a}),[e.draggableId,e.index,c,a]),{children:p,draggableId:l,isEnabled:u,shouldRespectForcePress:f,canDragInteractiveElements:m,isClone:b,mapped:h,dropAnimationFinished:E}=e;if(wl(e,o,r),Al(b),!b){const O=S(()=>({descriptor:d,registry:s,getDraggableRef:r,canDragInteractiveElements:m,shouldRespectForcePress:f,isEnabled:u}),[d,s,r,m,f,u]);Sl(O)}const v=S(()=>u?{tabIndex:0,role:"button","aria-describedby":i,"data-rfd-drag-handle-draggable-id":l,"data-rfd-drag-handle-context-id":o,draggable:!1,onDragStart:_l}:null,[o,i,l,u]),C=x(O=>{h.type==="DRAGGING"&&h.dropping&&O.propertyName==="transform"&&rt.flushSync(E)},[E,h]),I=S(()=>{const O=Ol(h),_=h.type==="DRAGGING"&&h.dropping?C:void 0;return{innerRef:n,draggableProps:{"data-rfd-draggable-context-id":o,"data-rfd-draggable-id":l,style:O,onTransitionEnd:_},dragHandleProps:v}},[o,v,l,h,C,n]),N=S(()=>({draggableId:d.id,type:d.type,source:{index:d.index,droppableId:d.droppableId}}),[d.droppableId,d.id,d.index,d.type]);return D.createElement(D.Fragment,null,p(I,h.snapshot,N))};var uo=(e,t)=>e===t,po=e=>{const{combine:t,destination:n}=e;return n?n.droppableId:t?t.droppableId:null};const Tl=e=>e.combine?e.combine.draggableId:null,Bl=e=>e.at&&e.at.type==="COMBINE"?e.at.combine.draggableId:null;function Vl(){const e=M((o,i)=>({x:o,y:i})),t=M((o,i,s=null,c=null,a=null)=>({isDragging:!0,isClone:i,isDropAnimating:!!a,dropAnimation:a,mode:o,draggingOver:s,combineWith:c,combineTargetFor:null})),n=M((o,i,s,c,a=null,d=null,p=null)=>({mapped:{type:"DRAGGING",dropping:null,draggingOver:a,combineWith:d,mode:i,offset:o,dimension:s,forceShouldAnimate:p,snapshot:t(i,c,a,d,null)}}));return(o,i)=>{if(Be(o)){if(o.critical.draggable.id!==i.draggableId)return null;const s=o.current.client.offset,c=o.dimensions.draggables[i.draggableId],a=W(o.impact),d=Bl(o.impact),p=o.forceShouldAnimate;return n(e(s.x,s.y),o.movementMode,c,i.isClone,a,d,p)}if(o.phase==="DROP_ANIMATING"){const s=o.completed;if(s.result.draggableId!==i.draggableId)return null;const c=i.isClone,a=o.dimensions.draggables[i.draggableId],d=s.result,p=d.mode,l=po(d),u=Tl(d),m={duration:o.dropDuration,curve:Rt.drop,moveTo:o.newHomeClientOffset,opacity:u?Oe.opacity.drop:null,scale:u?Oe.scale.drop:null};return{mapped:{type:"DRAGGING",offset:o.newHomeClientOffset,dimension:a,dropping:m,draggingOver:l,combineWith:u,mode:p,forceShouldAnimate:null,snapshot:t(p,c,l,u,m)}}}return null}}function fo(e=null){return{isDragging:!1,isDropAnimating:!1,isClone:!1,dropAnimation:null,mode:null,draggingOver:null,combineTargetFor:e,combineWith:null}}const Ll={mapped:{type:"SECONDARY",offset:R,combineTargetFor:null,shouldAnimateDisplacement:!0,snapshot:fo(null)}};function Rl(){const e=M((s,c)=>({x:s,y:c})),t=M(fo),n=M((s,c=null,a)=>({mapped:{type:"SECONDARY",offset:s,combineTargetFor:c,shouldAnimateDisplacement:a,snapshot:t(c)}})),r=s=>s?n(R,s,!0):null,o=(s,c,a,d)=>{const p=a.displaced.visible[s],l=!!(d.inVirtualList&&d.effected[s]),u=je(a),f=u&&u.draggableId===s?c:null;if(!p){if(!l)return r(f);if(a.displaced.invisible[s])return null;const h=ae(d.displacedBy.point),E=e(h.x,h.y);return n(E,f,!0)}if(l)return r(f);const m=a.displacedBy.point,b=e(m.x,m.y);return n(b,f,p.shouldAnimate)};return(s,c)=>{if(Be(s))return s.critical.draggable.id===c.draggableId?null:o(c.draggableId,s.critical.draggable.id,s.impact,s.afterCritical);if(s.phase==="DROP_ANIMATING"){const a=s.completed;return a.result.draggableId===c.draggableId?null:o(c.draggableId,a.result.draggableId,a.impact,a.afterCritical)}return null}}const Ml=Un(()=>{const e=Vl(),t=Rl();return(r,o)=>e(r,o)||t(r,o)||Ll},{dropAnimationFinished:Pr},null,{context:qt,areStatePropsEqual:uo})(Pl);function go(e){return Qe(en).isUsingCloneFor===e.draggableId&&!e.isClone?null:D.createElement(Ml,e)}function $l(e){const t=typeof e.isDragDisabled=="boolean"?!e.isDragDisabled:!0,n=!!e.disableInteractiveElementBlocking,r=!!e.shouldRespectForcePress;return D.createElement(go,ke({},e,{isClone:!1,isEnabled:t,canDragInteractiveElements:n,shouldRespectForcePress:r}))}const tn=e=>t=>e===t,Gl=tn("scroll"),Fl=tn("auto"),kl=tn("visible"),mo=(e,t)=>t(e.overflowX)||t(e.overflowY),Wl=(e,t)=>t(e.overflowX)&&t(e.overflowY),ho=e=>{const t=window.getComputedStyle(e),n={overflowX:t.overflowX,overflowY:t.overflowY};return mo(n,Gl)||mo(n,Fl)},Ul=()=>{if(process.env.NODE_ENV==="production")return!1;const e=Pe(),t=document.documentElement;if(t||(process.env.NODE_ENV,g()),!ho(e))return!1;const n=window.getComputedStyle(t),r={overflowX:n.overflowX,overflowY:n.overflowY};return Wl(r,kl)||process.env.NODE_ENV!=="production"&&B(`
164
164
  We have detected that your <body> element might be a scroll container.
165
165
  We have found no reliable way of detecting whether the <body> element is a scroll container.
166
166
  Under most circumstances a <body> scroll bar will be on the <html> element (document.documentElement)
@@ -175,10 +175,10 @@ ${fn.current.stack}
175
175
  Nested scroll containers are currently not supported.
176
176
 
177
177
  We hope to support nested scroll containers soon: https://github.com/atlassian/react-beautiful-dnd/issues/131
178
- `)},rn=e=>({x:e.scrollLeft,y:e.scrollTop});const bo=e=>e?window.getComputedStyle(e).position==="fixed"?!0:bo(e.parentElement):!1;var jl=e=>{const t=nn(e),n=bo(e);return{closestScrollable:t,isFixedOnPage:n}},zl=({descriptor:e,isEnabled:t,isCombineEnabled:n,isFixedOnPage:r,direction:o,client:i,page:s,closest:c})=>{const a=(()=>{if(!c)return null;const{scrollSize:u,client:g}=c,m=Mr({scrollHeight:u.scrollHeight,scrollWidth:u.scrollWidth,height:g.paddingBox.height,width:g.paddingBox.width});return{pageMarginBox:c.page.marginBox,frameClient:g,scrollSize:u,shouldClipSubject:c.shouldClipSubject,scroll:{initial:c.scroll,current:c.scroll,max:m,diff:{value:R,displacement:R}}}})(),d=o==="vertical"?Ot:ar,p=le({page:s,withPlaceholder:null,axis:d,frame:a});return{descriptor:e,isCombineEnabled:n,isFixedOnPage:r,axis:d,isEnabled:t,client:i,page:s,frame:a,subject:p}};const ql=(e,t)=>{const n=qn(e);if(!t||e!==t)return n;const r=n.paddingBox.top-t.scrollTop,o=n.paddingBox.left-t.scrollLeft,i=r+t.scrollHeight,s=o+t.scrollWidth,a=yt({top:r,right:s,bottom:i,left:o},n.border);return Dt({borderBox:a,margin:n.margin,border:n.border,padding:n.padding})};var Yl=({ref:e,descriptor:t,env:n,windowScroll:r,direction:o,isDropDisabled:i,isCombineEnabled:s,shouldClipSubject:c})=>{const a=n.closestScrollable,d=ql(e,a),p=Fe(d,r),l=(()=>{if(!a)return null;const g=qn(a),m={scrollHeight:a.scrollHeight,scrollWidth:a.scrollWidth};return{client:g,page:Fe(g,r),scroll:rn(a),scrollSize:m,shouldClipSubject:c}})();return zl({descriptor:t,isEnabled:!i,isCombineEnabled:s,isFixedOnPage:n.isFixedOnPage,direction:o,client:d,page:p,closest:l})};const Xl={passive:!1},Kl={passive:!0};var vo=e=>e.shouldPublishImmediately?Xl:Kl;const et=e=>e&&e.env.closestScrollable||null;function Jl(e){const t=D.useRef(null),n=Qe(Ke),r=Yt("droppable"),{registry:o,marshal:i}=n,s=Jt(e),c=w(()=>({id:e.droppableId,type:e.type,mode:e.mode}),[e.droppableId,e.mode,e.type]),a=D.useRef(c),d=w(()=>M((I,N)=>{t.current||(process.env.NODE_ENV!=="production"?f(!1,"Can only update scroll when dragging"):f());const O={x:I,y:N};i.updateDroppableScroll(c.id,O)}),[c.id,i]),p=x(()=>{const I=t.current;return!I||!I.env.closestScrollable?R:rn(I.env.closestScrollable)},[]),l=x(()=>{const I=p();d(I.x,I.y)},[p,d]),u=w(()=>me(l),[l]),g=x(()=>{const I=t.current,N=et(I);if(I&&N||(process.env.NODE_ENV!=="production"?f(!1,"Could not find scroll options while scrolling"):f()),I.scrollOptions.shouldPublishImmediately){l();return}u()},[u,l]),m=x((I,N)=>{t.current&&(process.env.NODE_ENV!=="production"?f(!1,"Cannot collect a droppable while a drag is occurring"):f());const O=s.current,A=O.getDroppableRef();A||(process.env.NODE_ENV!=="production"?f(!1,"Cannot collect without a droppable ref"):f());const T=jl(A),H={ref:A,descriptor:c,env:T,scrollOptions:N};t.current=H;const V=Yl({ref:A,descriptor:c,env:T,windowScroll:I,direction:O.direction,isDropDisabled:O.isDropDisabled,isCombineEnabled:O.isCombineEnabled,shouldClipSubject:!O.ignoreContainerClipping}),j=T.closestScrollable;return j&&(j.setAttribute(Yr.contextId,n.contextId),j.addEventListener("scroll",g,vo(H.scrollOptions)),process.env.NODE_ENV!=="production"&&Hl(j)),V},[n.contextId,c,g,s]),b=x(()=>{const I=t.current,N=et(I);return I&&N||(process.env.NODE_ENV!=="production"?f(!1,"Can only recollect Droppable client for Droppables that have a scroll container"):f()),rn(N)},[]),h=x(()=>{const I=t.current;I||(process.env.NODE_ENV!=="production"?f(!1,"Cannot stop drag when no active drag"):f());const N=et(I);t.current=null,N&&(u.cancel(),N.removeAttribute(Yr.contextId),N.removeEventListener("scroll",g,vo(I.scrollOptions)))},[g,u]),y=x(I=>{const N=t.current;N||(process.env.NODE_ENV!=="production"?f(!1,"Cannot scroll when there is no drag"):f());const O=et(N);O||(process.env.NODE_ENV!=="production"?f(!1,"Cannot scroll a droppable with no closest scrollable"):f()),O.scrollTop+=I.y,O.scrollLeft+=I.x},[]),v=w(()=>({getDimensionAndWatchScroll:m,getScrollWhileDragging:b,dragStopped:h,scroll:y}),[h,m,b,y]),S=w(()=>({uniqueId:r,descriptor:c,callbacks:v}),[v,c,r]);U(()=>(a.current=S.descriptor,o.droppable.register(S),()=>{t.current&&(process.env.NODE_ENV!=="production"&&B("Unsupported: changing the droppableId or type of a Droppable during a drag"),h()),o.droppable.unregister(S)}),[v,c,h,S,i,o.droppable]),U(()=>{t.current&&i.updateDroppableIsEnabled(a.current.id,!e.isDropDisabled)},[e.isDropDisabled,i]),U(()=>{t.current&&i.updateDroppableIsCombineEnabled(a.current.id,e.isCombineEnabled)},[e.isCombineEnabled,i])}function on(){}const yo={width:0,height:0,margin:Yi},Zl=({isAnimatingOpenOnMount:e,placeholder:t,animate:n})=>e||n==="close"?yo:{height:t.client.borderBox.height,width:t.client.borderBox.width,margin:t.client.margin},Ql=({isAnimatingOpenOnMount:e,placeholder:t,animate:n})=>{const r=Zl({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:n!=="none"?Se.placeholder:null}},ed=e=>{const t=D.useRef(null),n=x(()=>{t.current&&(clearTimeout(t.current),t.current=null)},[]),{animate:r,onTransitionEnd:o,onClose:i,contextId:s}=e,[c,a]=D.useState(e.animate==="open");D.useEffect(()=>c?r!=="open"?(n(),a(!1),on):t.current?on:(t.current=setTimeout(()=>{t.current=null,a(!1)}),n):on,[r,c,n]);const d=x(l=>{l.propertyName==="height"&&(o(),r==="close"&&i())},[r,i,o]),p=Ql({isAnimatingOpenOnMount:c,animate:e.animate,placeholder:e.placeholder});return D.createElement(e.placeholder.tagName,{style:p,"data-rfd-placeholder-context-id":s,onTransitionEnd:d,ref:e.innerRef})};var td=D.memo(ed);function sn(e){return typeof e=="boolean"}function cn(e,t){t.forEach(n=>n(e))}const nd=[function({props:t}){t.droppableId||(process.env.NODE_ENV!=="production"?f(!1,"A Droppable requires a droppableId prop"):f()),typeof t.droppableId!="string"&&(process.env.NODE_ENV!=="production"?f(!1,`A Droppable requires a [string] droppableId. Provided: [${typeof t.droppableId}]`):f())},function({props:t}){sn(t.isDropDisabled)||(process.env.NODE_ENV!=="production"?f(!1,"isDropDisabled must be a boolean"):f()),sn(t.isCombineEnabled)||(process.env.NODE_ENV!=="production"?f(!1,"isCombineEnabled must be a boolean"):f()),sn(t.ignoreContainerClipping)||(process.env.NODE_ENV!=="production"?f(!1,"ignoreContainerClipping must be a boolean"):f())},function({getDroppableRef:t}){lo(t())}],rd=[function({props:t,getPlaceholderRef:n}){!t.placeholder||n()||process.env.NODE_ENV!=="production"&&B(`
178
+ `)},rn=e=>({x:e.scrollLeft,y:e.scrollTop});const bo=e=>e?window.getComputedStyle(e).position==="fixed"?!0:bo(e.parentElement):!1;var jl=e=>{const t=nn(e),n=bo(e);return{closestScrollable:t,isFixedOnPage:n}},zl=({descriptor:e,isEnabled:t,isCombineEnabled:n,isFixedOnPage:r,direction:o,client:i,page:s,closest:c})=>{const a=(()=>{if(!c)return null;const{scrollSize:u,client:f}=c,m=Mr({scrollHeight:u.scrollHeight,scrollWidth:u.scrollWidth,height:f.paddingBox.height,width:f.paddingBox.width});return{pageMarginBox:c.page.marginBox,frameClient:f,scrollSize:u,shouldClipSubject:c.shouldClipSubject,scroll:{initial:c.scroll,current:c.scroll,max:m,diff:{value:R,displacement:R}}}})(),d=o==="vertical"?Ot:ar,p=le({page:s,withPlaceholder:null,axis:d,frame:a});return{descriptor:e,isCombineEnabled:n,isFixedOnPage:r,axis:d,isEnabled:t,client:i,page:s,frame:a,subject:p}};const ql=(e,t)=>{const n=qn(e);if(!t||e!==t)return n;const r=n.paddingBox.top-t.scrollTop,o=n.paddingBox.left-t.scrollLeft,i=r+t.scrollHeight,s=o+t.scrollWidth,a=yt({top:r,right:s,bottom:i,left:o},n.border);return Dt({borderBox:a,margin:n.margin,border:n.border,padding:n.padding})};var Yl=({ref:e,descriptor:t,env:n,windowScroll:r,direction:o,isDropDisabled:i,isCombineEnabled:s,shouldClipSubject:c})=>{const a=n.closestScrollable,d=ql(e,a),p=Fe(d,r),l=(()=>{if(!a)return null;const f=qn(a),m={scrollHeight:a.scrollHeight,scrollWidth:a.scrollWidth};return{client:f,page:Fe(f,r),scroll:rn(a),scrollSize:m,shouldClipSubject:c}})();return zl({descriptor:t,isEnabled:!i,isCombineEnabled:s,isFixedOnPage:n.isFixedOnPage,direction:o,client:d,page:p,closest:l})};const Xl={passive:!1},Kl={passive:!0};var vo=e=>e.shouldPublishImmediately?Xl:Kl;const et=e=>e&&e.env.closestScrollable||null;function Jl(e){const t=D.useRef(null),n=Qe(Ke),r=Yt("droppable"),{registry:o,marshal:i}=n,s=Jt(e),c=S(()=>({id:e.droppableId,type:e.type,mode:e.mode}),[e.droppableId,e.mode,e.type]),a=D.useRef(c),d=S(()=>M((I,N)=>{t.current||(process.env.NODE_ENV!=="production"?g(!1,"Can only update scroll when dragging"):g());const O={x:I,y:N};i.updateDroppableScroll(c.id,O)}),[c.id,i]),p=x(()=>{const I=t.current;return!I||!I.env.closestScrollable?R:rn(I.env.closestScrollable)},[]),l=x(()=>{const I=p();d(I.x,I.y)},[p,d]),u=S(()=>me(l),[l]),f=x(()=>{const I=t.current,N=et(I);if(I&&N||(process.env.NODE_ENV!=="production"?g(!1,"Could not find scroll options while scrolling"):g()),I.scrollOptions.shouldPublishImmediately){l();return}u()},[u,l]),m=x((I,N)=>{t.current&&(process.env.NODE_ENV!=="production"?g(!1,"Cannot collect a droppable while a drag is occurring"):g());const O=s.current,_=O.getDroppableRef();_||(process.env.NODE_ENV!=="production"?g(!1,"Cannot collect without a droppable ref"):g());const T=jl(_),H={ref:_,descriptor:c,env:T,scrollOptions:N};t.current=H;const V=Yl({ref:_,descriptor:c,env:T,windowScroll:I,direction:O.direction,isDropDisabled:O.isDropDisabled,isCombineEnabled:O.isCombineEnabled,shouldClipSubject:!O.ignoreContainerClipping}),j=T.closestScrollable;return j&&(j.setAttribute(Yr.contextId,n.contextId),j.addEventListener("scroll",f,vo(H.scrollOptions)),process.env.NODE_ENV!=="production"&&Hl(j)),V},[n.contextId,c,f,s]),b=x(()=>{const I=t.current,N=et(I);return I&&N||(process.env.NODE_ENV!=="production"?g(!1,"Can only recollect Droppable client for Droppables that have a scroll container"):g()),rn(N)},[]),h=x(()=>{const I=t.current;I||(process.env.NODE_ENV!=="production"?g(!1,"Cannot stop drag when no active drag"):g());const N=et(I);t.current=null,N&&(u.cancel(),N.removeAttribute(Yr.contextId),N.removeEventListener("scroll",f,vo(I.scrollOptions)))},[f,u]),E=x(I=>{const N=t.current;N||(process.env.NODE_ENV!=="production"?g(!1,"Cannot scroll when there is no drag"):g());const O=et(N);O||(process.env.NODE_ENV!=="production"?g(!1,"Cannot scroll a droppable with no closest scrollable"):g()),O.scrollTop+=I.y,O.scrollLeft+=I.x},[]),v=S(()=>({getDimensionAndWatchScroll:m,getScrollWhileDragging:b,dragStopped:h,scroll:E}),[h,m,b,E]),C=S(()=>({uniqueId:r,descriptor:c,callbacks:v}),[v,c,r]);U(()=>(a.current=C.descriptor,o.droppable.register(C),()=>{t.current&&(process.env.NODE_ENV!=="production"&&B("Unsupported: changing the droppableId or type of a Droppable during a drag"),h()),o.droppable.unregister(C)}),[v,c,h,C,i,o.droppable]),U(()=>{t.current&&i.updateDroppableIsEnabled(a.current.id,!e.isDropDisabled)},[e.isDropDisabled,i]),U(()=>{t.current&&i.updateDroppableIsCombineEnabled(a.current.id,e.isCombineEnabled)},[e.isCombineEnabled,i])}function on(){}const yo={width:0,height:0,margin:Yi},Zl=({isAnimatingOpenOnMount:e,placeholder:t,animate:n})=>e||n==="close"?yo:{height:t.client.borderBox.height,width:t.client.borderBox.width,margin:t.client.margin},Ql=({isAnimatingOpenOnMount:e,placeholder:t,animate:n})=>{const r=Zl({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:n!=="none"?Ce.placeholder:null}},ed=e=>{const t=D.useRef(null),n=x(()=>{t.current&&(clearTimeout(t.current),t.current=null)},[]),{animate:r,onTransitionEnd:o,onClose:i,contextId:s}=e,[c,a]=D.useState(e.animate==="open");D.useEffect(()=>c?r!=="open"?(n(),a(!1),on):t.current?on:(t.current=setTimeout(()=>{t.current=null,a(!1)}),n):on,[r,c,n]);const d=x(l=>{l.propertyName==="height"&&(o(),r==="close"&&i())},[r,i,o]),p=Ql({isAnimatingOpenOnMount:c,animate:e.animate,placeholder:e.placeholder});return D.createElement(e.placeholder.tagName,{style:p,"data-rfd-placeholder-context-id":s,onTransitionEnd:d,ref:e.innerRef})};var td=D.memo(ed);function sn(e){return typeof e=="boolean"}function cn(e,t){t.forEach(n=>n(e))}const nd=[function({props:t}){t.droppableId||(process.env.NODE_ENV!=="production"?g(!1,"A Droppable requires a droppableId prop"):g()),typeof t.droppableId!="string"&&(process.env.NODE_ENV!=="production"?g(!1,`A Droppable requires a [string] droppableId. Provided: [${typeof t.droppableId}]`):g())},function({props:t}){sn(t.isDropDisabled)||(process.env.NODE_ENV!=="production"?g(!1,"isDropDisabled must be a boolean"):g()),sn(t.isCombineEnabled)||(process.env.NODE_ENV!=="production"?g(!1,"isCombineEnabled must be a boolean"):g()),sn(t.ignoreContainerClipping)||(process.env.NODE_ENV!=="production"?g(!1,"ignoreContainerClipping must be a boolean"):g())},function({getDroppableRef:t}){lo(t())}],rd=[function({props:t,getPlaceholderRef:n}){!t.placeholder||n()||process.env.NODE_ENV!=="production"&&B(`
179
179
  Droppable setup issue [droppableId: "${t.droppableId}"]:
180
180
  DroppableProvided > placeholder could not be found.
181
181
 
182
182
  Please be sure to add the {provided.placeholder} React Node as a child of your Droppable.
183
183
  More information: https://github.com/hello-pangea/dnd/blob/main/docs/api/droppable.md
184
- `)}],od=[function({props:t}){t.renderClone||(process.env.NODE_ENV!=="production"?f(!1,"Must provide a clone render function (renderClone) for virtual lists"):f())},function({getPlaceholderRef:t}){t()&&(process.env.NODE_ENV!=="production"?f(!1,"Expected virtual list to not have a placeholder"):f())}];function id(e){Te(()=>{cn(e,nd),e.props.mode==="standard"&&cn(e,rd),e.props.mode==="virtual"&&cn(e,od)})}class sd extends D.PureComponent{constructor(...t){super(...t),this.state={isVisible:!!this.props.on,data:this.props.on,animate:this.props.shouldAnimate&&this.props.on?"open":"none"},this.onClose=()=>{this.state.animate==="close"&&this.setState({isVisible:!1})}}static getDerivedStateFromProps(t,n){return t.shouldAnimate?t.on?{isVisible:!0,data:t.on,animate:"open"}:n.isVisible?{isVisible:!0,data:n.data,animate:"close"}:{isVisible:!1,animate:"close",data:null}:{isVisible:!!t.on,data:t.on,animate:"none"}}render(){if(!this.state.isVisible)return null;const t={onClose:this.onClose,data:this.state.data,animate:this.state.animate};return this.props.children(t)}}const cd=e=>{const t=D.useContext(Ke);t||(process.env.NODE_ENV!=="production"?f(!1,"Could not find app context"):f());const{contextId:n,isMovementAllowed:r}=t,o=D.useRef(null),i=D.useRef(null),{children:s,droppableId:c,type:a,mode:d,direction:p,ignoreContainerClipping:l,isDropDisabled:u,isCombineEnabled:g,snapshot:m,useClone:b,updateViewportMaxScroll:h,getContainerForClone:y}=e,v=x(()=>o.current,[]),S=x((L=null)=>{o.current=L},[]),I=x(()=>i.current,[]),N=x((L=null)=>{i.current=L},[]);id({props:e,getDroppableRef:v,getPlaceholderRef:I});const O=x(()=>{r()&&h({maxScroll:Gr()})},[r,h]);Jl({droppableId:c,type:a,mode:d,direction:p,isDropDisabled:u,isCombineEnabled:g,ignoreContainerClipping:l,getDroppableRef:v});const A=w(()=>D.createElement(sd,{on:e.placeholder,shouldAnimate:e.shouldAnimatePlaceholder},({onClose:L,data:J,animate:fe})=>D.createElement(td,{placeholder:J,onClose:L,innerRef:N,animate:fe,contextId:n,onTransitionEnd:O})),[n,O,e.placeholder,e.shouldAnimatePlaceholder,N]),T=w(()=>({innerRef:S,placeholder:A,droppableProps:{"data-rfd-droppable-id":c,"data-rfd-droppable-context-id":n}}),[n,c,A,S]),H=b?b.dragging.draggableId:null,V=w(()=>({droppableId:c,type:a,isUsingCloneFor:H}),[c,H,a]);function j(){if(!b)return null;const{dragging:L,render:J}=b,fe=D.createElement(go,{draggableId:L.draggableId,index:L.source.index,isClone:!0,isEnabled:!0,shouldRespectForcePress:!1,canDragInteractiveElements:!0},(Z,tt)=>J(Z,tt,L));return rt.createPortal(fe,y())}return D.createElement(en.Provider,{value:V},s(T,m),j())};function ad(){return document.body||(process.env.NODE_ENV!=="production"?f(!1,"document.body is not ready"):f()),document.body}const Eo={mode:"standard",type:"DEFAULT",direction:"vertical",isDropDisabled:!1,isCombineEnabled:!1,ignoreContainerClipping:!1,renderClone:null,getContainerForClone:ad},Do=e=>{let t={...e},n;for(n in Eo)e[n]===void 0&&(t={...t,[n]:Eo[n]});return t},an=(e,t)=>e===t.droppable.type,No=(e,t)=>t.draggables[e.draggable.id],ld=Un(()=>{const e={placeholder:null,shouldAnimatePlaceholder:!0,snapshot:{isDraggingOver:!1,draggingOverWith:null,draggingFromThisWith:null,isUsingPlaceholder:!1},useClone:null},t={...e,shouldAnimatePlaceholder:!1},n=M(i=>({draggableId:i.id,type:i.type,source:{index:i.index,droppableId:i.droppableId}})),r=M((i,s,c,a,d,p)=>{const l=d.descriptor.id;if(d.descriptor.droppableId===i){const m=p?{render:p,dragging:n(d.descriptor)}:null,b={isDraggingOver:c,draggingOverWith:c?l:null,draggingFromThisWith:l,isUsingPlaceholder:!0};return{placeholder:d.placeholder,shouldAnimatePlaceholder:!1,snapshot:b,useClone:m}}if(!s)return t;if(!a)return e;const g={isDraggingOver:c,draggingOverWith:l,draggingFromThisWith:null,isUsingPlaceholder:!0};return{placeholder:d.placeholder,shouldAnimatePlaceholder:!0,snapshot:g,useClone:null}});return(i,s)=>{const c=Do(s),a=c.droppableId,d=c.type,p=!c.isDropDisabled,l=c.renderClone;if(Be(i)){const u=i.critical;if(!an(d,u))return t;const g=No(u,i.dimensions),m=W(i.impact)===a;return r(a,p,m,m,g,l)}if(i.phase==="DROP_ANIMATING"){const u=i.completed;if(!an(d,u.critical))return t;const g=No(u.critical,i.dimensions);return r(a,p,po(u.result)===a,W(u.impact)===a,g,l)}if(i.phase==="IDLE"&&i.completed&&!i.shouldFlush){const u=i.completed;if(!an(d,u.critical))return t;const g=W(u.impact)===a,m=!!(u.impact.at&&u.impact.at.type==="COMBINE"),b=u.critical.droppable.id===a;return g?m?e:t:b?e:t}return t}},{updateViewportMaxScroll:sc},(e,t,n)=>({...Do(n),...e,...t}),{context:qt,areStatePropsEqual:uo})(cd),dd=()=>E.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[E.jsx("path",{d:"M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z"}),E.jsx("circle",{cx:"12",cy:"10",r:"3"})]}),ud=()=>E.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[E.jsx("circle",{cx:"12",cy:"12",r:"10"}),E.jsx("polyline",{points:"12 6 12 12 16 14"})]}),pd=()=>E.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"#9ca3af",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:{cursor:"grab"},children:[E.jsx("line",{x1:"3",y1:"12",x2:"21",y2:"12"}),E.jsx("line",{x1:"3",y1:"6",x2:"21",y2:"6"}),E.jsx("line",{x1:"3",y1:"18",x2:"21",y2:"18"})]}),fd=()=>E.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[E.jsx("polyline",{points:"15 3 21 3 21 9"}),E.jsx("polyline",{points:"9 21 3 21 3 15"}),E.jsx("line",{x1:"21",y1:"3",x2:"14",y2:"10"}),E.jsx("line",{x1:"3",y1:"21",x2:"10",y2:"14"})]}),gd=()=>E.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[E.jsx("polyline",{points:"4 14 10 14 10 20"}),E.jsx("polyline",{points:"20 10 14 10 14 4"}),E.jsx("line",{x1:"14",y1:"10",x2:"21",y2:"3"}),E.jsx("line",{x1:"3",y1:"21",x2:"10",y2:"14"})]}),xo=e=>e?new Date(e).toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0}):"--:--",Io=e=>typeof e=="object"&&(e!=null&&e.name)?e.name:e,Oo=e=>{var t,n;return typeof e.status=="string"?e.status.toLowerCase()==="completed":((n=(t=e.status)==null?void 0:t.code)==null?void 0:n.toLowerCase())==="completed"},md=e=>{const t=[];return[...e].sort((r,o)=>r.sequence_rank-o.sequence_rank).forEach(r=>{const o=t[t.length-1];o&&o.stop_id===r.stop_id?o.orders.push(r):t.push({stop_id:r.stop_id,sequence_rank:r.sequence_rank,orders:[r]})}),t},hd=({order:e,pathPeriod:t,isFirst:n,isDone:r,renderOrderExtraData:o})=>{var c,a;const[i,s]=D.useState(!1);return E.jsxs("div",{style:{..._.orderBlock,borderTop:n?"none":"1px solid #f3f4f6"},children:[E.jsxs("div",{style:_.orderHeader,children:[E.jsxs("div",{style:_.gridItem,children:[E.jsxs("div",{style:_.gridLabel,children:["ORDER"," ",r&&E.jsx("span",{style:{color:"#16a34a",marginLeft:"4px"},children:"✓ DONE"})]}),E.jsxs("div",{style:_.gridValue,children:["#",e.order_id]})]}),o&&E.jsx("button",{onClick:()=>s(!i),style:_.expandButton,children:i?E.jsx(gd,{}):E.jsx(fd,{})})]}),E.jsxs("div",{style:_.detailsGrid,children:[E.jsxs("div",{style:_.gridItem,children:[E.jsx("div",{style:_.gridLabel,children:"LOCATION"}),E.jsxs("div",{style:_.gridValueWithIcon,children:[E.jsx(dd,{})," ",E.jsx("span",{style:_.truncate,children:((a=(c=e.customer)==null?void 0:c.address)==null?void 0:a.street_area)||"N/A"})]})]}),E.jsxs("div",{style:_.gridItem,children:[E.jsx("div",{style:_.gridLabel,children:"PERIOD"}),E.jsx("div",{style:_.gridValue,children:t})]}),E.jsxs("div",{style:_.gridItem,children:[E.jsx("div",{style:_.gridLabel,children:"TIME WINDOW"}),E.jsxs("div",{style:_.gridValueWithIcon,children:[E.jsx(ud,{})," ",E.jsxs("span",{children:[xo(e.eta_start)," - ",xo(e.eta_end)]})]})]})]}),i&&o&&E.jsx("div",{style:_.extraDataContainer,children:o(e)})]})},bd=({stopGroup:e,index:t,pathType:n,pathPeriod:r,renderStopActions:o,renderOrderExtraData:i})=>{const s=e.orders.every(Oo);return E.jsx($l,{draggableId:e.stop_id.toString(),index:t,isDragDisabled:s,children:c=>{var a,d;return E.jsxs("div",{ref:c.innerRef,...c.draggableProps,style:{..._.timelineItem,...c.draggableProps.style},children:[E.jsx("div",{style:{..._.bubble,...s?_.bubbleCompleted:_.bubblePending},children:t+1}),E.jsxs("div",{style:_.card,children:[E.jsxs("div",{style:_.cardHeader,children:[E.jsxs("span",{style:_.title,children:[n," #",e.sequence_rank]}),!s&&E.jsx("div",{...c.dragHandleProps,children:E.jsx(pd,{})})]}),E.jsxs("div",{style:_.customerName,children:["Customer: ",(d=(a=e.orders[0])==null?void 0:a.customer)==null?void 0:d.name]}),E.jsx("div",{style:_.ordersList,children:e.orders.map((p,l)=>E.jsx(hd,{order:p,pathPeriod:r,isFirst:l===0,isDone:Oo(p),renderOrderExtraData:i},p.id))}),o&&E.jsx("div",{style:_.actionsSlot,children:o(e)})]})]})}})},vd=({path:e,onReorder:t,renderStopActions:n,renderOrderExtraData:r})=>{const[o,i]=D.useState([]);D.useEffect(()=>{e!=null&&e.path_orders&&i(md(e.path_orders))},[e]);const s=c=>{if(!c.destination)return;const a=Array.from(o),[d]=a.splice(c.source.index,1);a.splice(c.destination.index,0,d),i(a),t&&t(e.id,a.map(p=>p.stop_id))};return!e||!o.length?E.jsx("div",{children:"No Path Data"}):E.jsx("div",{style:_.container,children:E.jsx(yl,{onDragEnd:s,children:E.jsx(ld,{droppableId:"path-list",children:c=>E.jsxs("div",{ref:c.innerRef,...c.droppableProps,style:_.timelineWrapper,children:[E.jsx("div",{style:_.verticalLine}),E.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"24px"},children:o.map((a,d)=>E.jsx(bd,{stopGroup:a,index:d,pathType:Io(e.type),pathPeriod:Io(e.period),renderStopActions:n,renderOrderExtraData:r},a.stop_id))}),c.placeholder]})})})})},_={container:{fontFamily:"sans-serif",maxWidth:"800px",margin:"0 auto"},timelineWrapper:{position:"relative",padding:"20px 0"},verticalLine:{position:"absolute",left:"19px",top:"40px",bottom:"40px",width:"2px",backgroundColor:"#f3f4f6"},timelineItem:{display:"flex",gap:"16px",marginBottom:"24px",position:"relative",zIndex:1},bubble:{width:"40px",height:"40px",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",fontWeight:"bold",backgroundColor:"#fff",border:"2px solid"},bubblePending:{borderColor:"#f3f4f6",color:"#9ca3af"},bubbleCompleted:{borderColor:"#dcfce7",color:"#16a34a",backgroundColor:"#f0fdf4"},card:{flex:1,backgroundColor:"#fff",border:"1px solid #f3f4f6",borderRadius:"12px",padding:"16px",boxShadow:"0 1px 3px rgba(0,0,0,0.1)"},cardHeader:{display:"flex",justifyContent:"space-between",marginBottom:"8px"},title:{fontSize:"16px",fontWeight:"bold"},customerName:{fontSize:"14px",color:"#6b7280",marginBottom:"12px"},ordersList:{backgroundColor:"#f9fafb",borderRadius:"8px",overflow:"hidden"},orderBlock:{padding:"12px"},orderHeader:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",marginBottom:"8px"},detailsGrid:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"12px"},gridItem:{display:"flex",flexDirection:"column"},gridLabel:{fontSize:"10px",color:"#9ca3af",fontWeight:"bold"},gridValue:{fontSize:"13px",fontWeight:"600"},gridValueWithIcon:{fontSize:"13px",display:"flex",alignItems:"center",gap:"4px",color:"#374151"},expandButton:{background:"none",border:"none",cursor:"pointer",color:"#6b7280"},extraDataContainer:{marginTop:"12px",padding:"12px",borderTop:"1px dashed #e5e7eb"},actionsSlot:{marginTop:"16px"},truncate:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"150px"}};Q.LogisticsDashboard=vd,Object.defineProperty(Q,Symbol.toStringTag,{value:"Module"})});
184
+ `)}],od=[function({props:t}){t.renderClone||(process.env.NODE_ENV!=="production"?g(!1,"Must provide a clone render function (renderClone) for virtual lists"):g())},function({getPlaceholderRef:t}){t()&&(process.env.NODE_ENV!=="production"?g(!1,"Expected virtual list to not have a placeholder"):g())}];function id(e){Te(()=>{cn(e,nd),e.props.mode==="standard"&&cn(e,rd),e.props.mode==="virtual"&&cn(e,od)})}class sd extends D.PureComponent{constructor(...t){super(...t),this.state={isVisible:!!this.props.on,data:this.props.on,animate:this.props.shouldAnimate&&this.props.on?"open":"none"},this.onClose=()=>{this.state.animate==="close"&&this.setState({isVisible:!1})}}static getDerivedStateFromProps(t,n){return t.shouldAnimate?t.on?{isVisible:!0,data:t.on,animate:"open"}:n.isVisible?{isVisible:!0,data:n.data,animate:"close"}:{isVisible:!1,animate:"close",data:null}:{isVisible:!!t.on,data:t.on,animate:"none"}}render(){if(!this.state.isVisible)return null;const t={onClose:this.onClose,data:this.state.data,animate:this.state.animate};return this.props.children(t)}}const cd=e=>{const t=D.useContext(Ke);t||(process.env.NODE_ENV!=="production"?g(!1,"Could not find app context"):g());const{contextId:n,isMovementAllowed:r}=t,o=D.useRef(null),i=D.useRef(null),{children:s,droppableId:c,type:a,mode:d,direction:p,ignoreContainerClipping:l,isDropDisabled:u,isCombineEnabled:f,snapshot:m,useClone:b,updateViewportMaxScroll:h,getContainerForClone:E}=e,v=x(()=>o.current,[]),C=x((L=null)=>{o.current=L},[]),I=x(()=>i.current,[]),N=x((L=null)=>{i.current=L},[]);id({props:e,getDroppableRef:v,getPlaceholderRef:I});const O=x(()=>{r()&&h({maxScroll:Gr()})},[r,h]);Jl({droppableId:c,type:a,mode:d,direction:p,isDropDisabled:u,isCombineEnabled:f,ignoreContainerClipping:l,getDroppableRef:v});const _=S(()=>D.createElement(sd,{on:e.placeholder,shouldAnimate:e.shouldAnimatePlaceholder},({onClose:L,data:J,animate:fe})=>D.createElement(td,{placeholder:J,onClose:L,innerRef:N,animate:fe,contextId:n,onTransitionEnd:O})),[n,O,e.placeholder,e.shouldAnimatePlaceholder,N]),T=S(()=>({innerRef:C,placeholder:_,droppableProps:{"data-rfd-droppable-id":c,"data-rfd-droppable-context-id":n}}),[n,c,_,C]),H=b?b.dragging.draggableId:null,V=S(()=>({droppableId:c,type:a,isUsingCloneFor:H}),[c,H,a]);function j(){if(!b)return null;const{dragging:L,render:J}=b,fe=D.createElement(go,{draggableId:L.draggableId,index:L.source.index,isClone:!0,isEnabled:!0,shouldRespectForcePress:!1,canDragInteractiveElements:!0},(Z,tt)=>J(Z,tt,L));return rt.createPortal(fe,E())}return D.createElement(en.Provider,{value:V},s(T,m),j())};function ad(){return document.body||(process.env.NODE_ENV!=="production"?g(!1,"document.body is not ready"):g()),document.body}const Eo={mode:"standard",type:"DEFAULT",direction:"vertical",isDropDisabled:!1,isCombineEnabled:!1,ignoreContainerClipping:!1,renderClone:null,getContainerForClone:ad},Do=e=>{let t={...e},n;for(n in Eo)e[n]===void 0&&(t={...t,[n]:Eo[n]});return t},an=(e,t)=>e===t.droppable.type,No=(e,t)=>t.draggables[e.draggable.id],ld=Un(()=>{const e={placeholder:null,shouldAnimatePlaceholder:!0,snapshot:{isDraggingOver:!1,draggingOverWith:null,draggingFromThisWith:null,isUsingPlaceholder:!1},useClone:null},t={...e,shouldAnimatePlaceholder:!1},n=M(i=>({draggableId:i.id,type:i.type,source:{index:i.index,droppableId:i.droppableId}})),r=M((i,s,c,a,d,p)=>{const l=d.descriptor.id;if(d.descriptor.droppableId===i){const m=p?{render:p,dragging:n(d.descriptor)}:null,b={isDraggingOver:c,draggingOverWith:c?l:null,draggingFromThisWith:l,isUsingPlaceholder:!0};return{placeholder:d.placeholder,shouldAnimatePlaceholder:!1,snapshot:b,useClone:m}}if(!s)return t;if(!a)return e;const f={isDraggingOver:c,draggingOverWith:l,draggingFromThisWith:null,isUsingPlaceholder:!0};return{placeholder:d.placeholder,shouldAnimatePlaceholder:!0,snapshot:f,useClone:null}});return(i,s)=>{const c=Do(s),a=c.droppableId,d=c.type,p=!c.isDropDisabled,l=c.renderClone;if(Be(i)){const u=i.critical;if(!an(d,u))return t;const f=No(u,i.dimensions),m=W(i.impact)===a;return r(a,p,m,m,f,l)}if(i.phase==="DROP_ANIMATING"){const u=i.completed;if(!an(d,u.critical))return t;const f=No(u.critical,i.dimensions);return r(a,p,po(u.result)===a,W(u.impact)===a,f,l)}if(i.phase==="IDLE"&&i.completed&&!i.shouldFlush){const u=i.completed;if(!an(d,u.critical))return t;const f=W(u.impact)===a,m=!!(u.impact.at&&u.impact.at.type==="COMBINE"),b=u.critical.droppable.id===a;return f?m?e:t:b?e:t}return t}},{updateViewportMaxScroll:sc},(e,t,n)=>({...Do(n),...e,...t}),{context:qt,areStatePropsEqual:uo})(cd),dd=()=>y.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:{flexShrink:0},children:[y.jsx("path",{d:"M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z"}),y.jsx("circle",{cx:"12",cy:"10",r:"3"})]}),ud=()=>y.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:{flexShrink:0},children:[y.jsx("circle",{cx:"12",cy:"12",r:"10"}),y.jsx("polyline",{points:"12 6 12 12 16 14"})]}),pd=()=>y.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"#9ca3af",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:{cursor:"grab"},children:[y.jsx("line",{x1:"3",y1:"12",x2:"21",y2:"12"}),y.jsx("line",{x1:"3",y1:"6",x2:"21",y2:"6"}),y.jsx("line",{x1:"3",y1:"18",x2:"21",y2:"18"})]}),fd=()=>y.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[y.jsx("polyline",{points:"15 3 21 3 21 9"}),y.jsx("polyline",{points:"9 21 3 21 3 15"}),y.jsx("line",{x1:"21",y1:"3",x2:"14",y2:"10"}),y.jsx("line",{x1:"3",y1:"21",x2:"10",y2:"14"})]}),gd=()=>y.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[y.jsx("polyline",{points:"4 14 10 14 10 20"}),y.jsx("polyline",{points:"20 10 14 10 14 4"}),y.jsx("line",{x1:"14",y1:"10",x2:"21",y2:"3"}),y.jsx("line",{x1:"3",y1:"21",x2:"10",y2:"14"})]}),xo=e=>e?new Date(e).toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0}):"--:--",Io=e=>typeof e=="object"&&(e!=null&&e.name)?e.name:e,Oo=e=>{var t,n;return typeof e.status=="string"?e.status.toLowerCase()==="completed":((n=(t=e.status)==null?void 0:t.code)==null?void 0:n.toLowerCase())==="completed"},md=e=>{const t=[];return[...e].sort((r,o)=>r.sequence_rank-o.sequence_rank).forEach(r=>{const o=t[t.length-1];o&&o.stop_id===r.stop_id?o.orders.push(r):t.push({stop_id:r.stop_id,sequence_rank:r.sequence_rank,orders:[r]})}),t},hd=({order:e,pathPeriod:t,isFirst:n,isDone:r,renderOrderExtraData:o})=>{var a,d,p,l,u,f;const[i,s]=D.useState(!1),c=(d=(a=e.customer)==null?void 0:a.address)!=null&&d.lat&&((l=(p=e.customer)==null?void 0:p.address)!=null&&l.long)?`https://maps.google.com/?q=${e.customer.address.lat},${e.customer.address.long}`:"#";return y.jsxs("div",{style:{...A.orderBlock,borderTop:n?"none":"1px solid #f3f4f6",backgroundColor:r?"#fafafa":"transparent"},children:[y.jsxs("div",{style:A.orderHeader,children:[y.jsxs("div",{style:A.gridItem,children:[y.jsxs("div",{style:A.gridLabel,children:["ORDER"," ",r&&y.jsx("span",{style:{color:"#16a34a",marginLeft:"4px"},children:"✓ DONE"})]}),y.jsxs("div",{style:A.gridValue,children:["#",e.order_id]})]}),o&&y.jsx("button",{onClick:()=>s(!i),style:A.expandButton,children:i?y.jsx(gd,{}):y.jsx(fd,{})})]}),y.jsxs("div",{style:A.detailsGrid,children:[y.jsxs("div",{style:A.gridItem,children:[y.jsx("div",{style:A.gridLabel,children:"LOCATION"}),y.jsxs("div",{style:A.gridValueWithIcon,children:[y.jsx(dd,{}),y.jsx("a",{href:c,target:"_blank",rel:"noopener noreferrer",style:A.addressLink,children:((f=(u=e.customer)==null?void 0:u.address)==null?void 0:f.street_area)||"N/A"})]})]}),y.jsxs("div",{style:A.gridItem,children:[y.jsx("div",{style:A.gridLabel,children:"PERIOD"}),y.jsx("div",{style:A.gridValue,children:t})]}),y.jsxs("div",{style:A.gridItem,children:[y.jsx("div",{style:A.gridLabel,children:"TIME WINDOW"}),y.jsxs("div",{style:A.gridValueWithIcon,children:[y.jsx(ud,{})," ",y.jsxs("span",{children:[xo(e.eta_start)," - ",xo(e.eta_end)]})]})]})]}),i&&o&&y.jsx("div",{style:A.extraDataContainer,children:o(e)})]})},bd=({stopGroup:e,index:t,pathType:n,pathPeriod:r,canEditPath:o,isPathCompleted:i,renderStopActions:s,renderOrderExtraData:c})=>{const a=e.orders.every(Oo),d=!o||i||a;return y.jsx($l,{draggableId:e.stop_id.toString(),index:t,isDragDisabled:d,children:p=>{var l,u;return y.jsxs("div",{ref:p.innerRef,...p.draggableProps,style:{...A.timelineItem,...p.draggableProps.style},children:[y.jsx("div",{style:{...A.bubble,...a?A.bubbleCompleted:A.bubblePending},children:t+1}),y.jsxs("div",{style:A.card,children:[y.jsxs("div",{style:A.cardHeader,children:[y.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[y.jsxs("span",{style:A.title,children:[n," #",e.sequence_rank]}),y.jsx("span",{style:a?A.badgeCompleted:A.badgePending,children:a?"Completed":"Pending"})]}),!d&&y.jsx("div",{...p.dragHandleProps,children:y.jsx(pd,{})})]}),y.jsxs("div",{style:A.customerName,children:["Customer: ",(u=(l=e.orders[0])==null?void 0:l.customer)==null?void 0:u.name]}),y.jsx("div",{style:A.ordersList,children:e.orders.map((f,m)=>y.jsx(hd,{order:f,pathPeriod:r,isFirst:m===0,isDone:Oo(f),renderOrderExtraData:c},f.id))}),s&&y.jsx("div",{style:A.actionsSlot,children:s(e)})]})]})}})},vd=({path:e,onReorder:t,renderStopActions:n,renderOrderExtraData:r,canEditPath:o=!0})=>{var d,p;const[i,s]=D.useState([]);D.useEffect(()=>{e!=null&&e.path_orders&&s(md(e.path_orders))},[e]);const c=l=>{if(!l.destination)return;const u=Array.from(i),[f]=u.splice(l.source.index,1);u.splice(l.destination.index,0,f),s(u),t&&t(e.id,u.map(m=>m.stop_id))};if(!e||!i.length)return y.jsx("div",{children:"No Path Data"});const a=typeof e.status=="string"?e.status.toLowerCase()==="completed":((p=(d=e.status)==null?void 0:d.code)==null?void 0:p.toLowerCase())==="completed";return y.jsx("div",{style:A.container,children:y.jsx(yl,{onDragEnd:c,children:y.jsx(ld,{droppableId:"path-list",children:l=>y.jsxs("div",{ref:l.innerRef,...l.droppableProps,style:A.timelineWrapper,children:[y.jsx("div",{style:A.verticalLine}),y.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"24px"},children:i.map((u,f)=>y.jsx(bd,{stopGroup:u,index:f,pathType:Io(e.type),pathPeriod:Io(e.period),canEditPath:o,isPathCompleted:a,renderStopActions:n,renderOrderExtraData:r},u.stop_id))}),l.placeholder]})})})})},A={container:{fontFamily:"sans-serif",maxWidth:"800px",margin:"0 auto"},timelineWrapper:{position:"relative",padding:"20px 0"},verticalLine:{position:"absolute",left:"19px",top:"40px",bottom:"40px",width:"2px",backgroundColor:"#f3f4f6"},timelineItem:{display:"flex",gap:"16px",marginBottom:"24px",position:"relative",zIndex:1},bubble:{width:"40px",height:"40px",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",fontWeight:"bold",backgroundColor:"#fff",border:"2px solid",flexShrink:0},bubblePending:{borderColor:"#f3f4f6",color:"#9ca3af"},bubbleCompleted:{borderColor:"#dcfce7",color:"#16a34a",backgroundColor:"#f0fdf4"},card:{flex:1,backgroundColor:"#fff",border:"1px solid #f3f4f6",borderRadius:"12px",padding:"16px",boxShadow:"0 1px 3px rgba(0,0,0,0.1)"},cardHeader:{display:"flex",justifyContent:"space-between",marginBottom:"8px",alignItems:"center"},title:{fontSize:"16px",fontWeight:"bold"},badgePending:{fontSize:"11px",padding:"2px 8px",borderRadius:"12px",backgroundColor:"#f3f4f6",color:"#4b5563",fontWeight:"600"},badgeCompleted:{fontSize:"11px",padding:"2px 8px",borderRadius:"12px",backgroundColor:"#dcfce7",color:"#16a34a",fontWeight:"600"},customerName:{fontSize:"14px",color:"#6b7280",marginBottom:"12px"},ordersList:{backgroundColor:"#f9fafb",borderRadius:"8px",overflow:"hidden"},orderBlock:{padding:"12px",transition:"background-color 0.2s"},orderHeader:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",marginBottom:"8px"},detailsGrid:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"12px"},gridItem:{display:"flex",flexDirection:"column"},gridLabel:{fontSize:"10px",color:"#9ca3af",fontWeight:"bold"},gridValue:{fontSize:"13px",fontWeight:"600"},gridValueWithIcon:{fontSize:"13px",display:"flex",alignItems:"flex-start",gap:"4px",color:"#374151"},addressLink:{color:"#3b82f6",textDecoration:"underline",wordBreak:"break-word",lineHeight:"1.4"},expandButton:{background:"none",border:"none",cursor:"pointer",color:"#6b7280",padding:"4px"},extraDataContainer:{marginTop:"12px",padding:"12px",borderTop:"1px dashed #e5e7eb",backgroundColor:"#fff",borderRadius:"4px"},actionsSlot:{marginTop:"16px"}};Q.LogisticsDashboard=vd,Object.defineProperty(Q,Symbol.toStringTag,{value:"Module"})});