react-reflex
Version:
Flex layout component for advanced React web applications
3 lines • 46.1 kB
JavaScript
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,a)=>(a=n==null?{}:e(i(n)),s(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));let l=require(`react`);l=c(l);let u=require(`react/jsx-runtime`);var d=class e{static isBrowser(){return typeof window<`u`}static isOpera(){return e.isBrowser()&&(!!window.opera||navigator.userAgent.indexOf(` OPR/`)>=0)}static isFirefox(){return e.isBrowser()&&typeof InstallTrigger<`u`}static isSafari(){return e.isBrowser()?/^((?!chrome|android).)*safari/i.test(navigator.userAgent):!1}static isIE(){return e.isBrowser()&&!!document.documentMode}static isEdge(){return e.isBrowser()&&!e.isIE()&&!!window.StyleMedia}static isChrome(){return e.isBrowser()&&!!window.chrome&&!!window.chrome.webstore}static isBlink(){return e.isBrowser()&&(e.isChrome()||e.isOpera())&&!!window.CSS}static getUserAgent(){return typeof navigator>`u`?``:navigator.userAgent}static isAndroid(){return e.isBrowser()&&e.getUserAgent().match(/Android/i)}static isBlackBerry(){return e.isBrowser()&&e.getUserAgent().match(/BlackBerry/i)}static isIOS(){return e.isBrowser()&&e.getUserAgent().match(/iPhone|iPad|iPod/i)}static isOpera(){return e.isBrowser()&&e.getUserAgent().match(/Opera Mini/i)}static isWindows(){return e.isBrowser()&&e.isWindowsDesktop()||e.isWindowsMobile()}static isWindowsMobile(){return e.isBrowser()&&e.getUserAgent().match(/IEMobile/i)}static isWindowsDesktop(){return e.isBrowser()&&e.getUserAgent().match(/WPDesktop/i)}static isMobile(){return e.isBrowser()&&(e.isWindowsMobile()||e.isBlackBerry()||e.isAndroid()||e.isIOS())}},f=e=>Object.keys(e).reduce((t,n)=>n.substr(0,5)===`data-`?{...t,[n]:e[n]}:t,{}),p=o((e=>{var t=typeof Symbol==`function`&&Symbol.for,n=t?Symbol.for(`react.element`):60103,r=t?Symbol.for(`react.portal`):60106,i=t?Symbol.for(`react.fragment`):60107,a=t?Symbol.for(`react.strict_mode`):60108,o=t?Symbol.for(`react.profiler`):60114,s=t?Symbol.for(`react.provider`):60109,c=t?Symbol.for(`react.context`):60110,l=t?Symbol.for(`react.async_mode`):60111,u=t?Symbol.for(`react.concurrent_mode`):60111,d=t?Symbol.for(`react.forward_ref`):60112,f=t?Symbol.for(`react.suspense`):60113,p=t?Symbol.for(`react.suspense_list`):60120,m=t?Symbol.for(`react.memo`):60115,h=t?Symbol.for(`react.lazy`):60116,g=t?Symbol.for(`react.block`):60121,_=t?Symbol.for(`react.fundamental`):60117,v=t?Symbol.for(`react.responder`):60118,y=t?Symbol.for(`react.scope`):60119;function b(e){if(typeof e==`object`&&e){var t=e.$$typeof;switch(t){case n:switch(e=e.type,e){case l:case u:case i:case o:case a:case f:return e;default:switch(e&&=e.$$typeof,e){case c:case d:case h:case m:case s:return e;default:return t}}case r:return t}}}function x(e){return b(e)===u}e.AsyncMode=l,e.ConcurrentMode=u,e.ContextConsumer=c,e.ContextProvider=s,e.Element=n,e.ForwardRef=d,e.Fragment=i,e.Lazy=h,e.Memo=m,e.Portal=r,e.Profiler=o,e.StrictMode=a,e.Suspense=f,e.isAsyncMode=function(e){return x(e)||b(e)===l},e.isConcurrentMode=x,e.isContextConsumer=function(e){return b(e)===c},e.isContextProvider=function(e){return b(e)===s},e.isElement=function(e){return typeof e==`object`&&!!e&&e.$$typeof===n},e.isForwardRef=function(e){return b(e)===d},e.isFragment=function(e){return b(e)===i},e.isLazy=function(e){return b(e)===h},e.isMemo=function(e){return b(e)===m},e.isPortal=function(e){return b(e)===r},e.isProfiler=function(e){return b(e)===o},e.isStrictMode=function(e){return b(e)===a},e.isSuspense=function(e){return b(e)===f},e.isValidElementType=function(e){return typeof e==`string`||typeof e==`function`||e===i||e===u||e===o||e===a||e===f||e===p||typeof e==`object`&&!!e&&(e.$$typeof===h||e.$$typeof===m||e.$$typeof===s||e.$$typeof===c||e.$$typeof===d||e.$$typeof===_||e.$$typeof===v||e.$$typeof===y||e.$$typeof===g)},e.typeOf=b})),m=o((e=>{process.env.NODE_ENV!==`production`&&(function(){var t=typeof Symbol==`function`&&Symbol.for,n=t?Symbol.for(`react.element`):60103,r=t?Symbol.for(`react.portal`):60106,i=t?Symbol.for(`react.fragment`):60107,a=t?Symbol.for(`react.strict_mode`):60108,o=t?Symbol.for(`react.profiler`):60114,s=t?Symbol.for(`react.provider`):60109,c=t?Symbol.for(`react.context`):60110,l=t?Symbol.for(`react.async_mode`):60111,u=t?Symbol.for(`react.concurrent_mode`):60111,d=t?Symbol.for(`react.forward_ref`):60112,f=t?Symbol.for(`react.suspense`):60113,p=t?Symbol.for(`react.suspense_list`):60120,m=t?Symbol.for(`react.memo`):60115,h=t?Symbol.for(`react.lazy`):60116,g=t?Symbol.for(`react.block`):60121,_=t?Symbol.for(`react.fundamental`):60117,v=t?Symbol.for(`react.responder`):60118,y=t?Symbol.for(`react.scope`):60119;function b(e){return typeof e==`string`||typeof e==`function`||e===i||e===u||e===o||e===a||e===f||e===p||typeof e==`object`&&!!e&&(e.$$typeof===h||e.$$typeof===m||e.$$typeof===s||e.$$typeof===c||e.$$typeof===d||e.$$typeof===_||e.$$typeof===v||e.$$typeof===y||e.$$typeof===g)}function x(e){if(typeof e==`object`&&e){var t=e.$$typeof;switch(t){case n:var p=e.type;switch(p){case l:case u:case i:case o:case a:case f:return p;default:var g=p&&p.$$typeof;switch(g){case c:case d:case h:case m:case s:return g;default:return t}}case r:return t}}}var S=l,C=u,w=c,T=s,E=n,D=d,O=i,k=h,A=m,j=r,M=o,N=a,P=f,F=!1;function ee(e){return F||(F=!0,console.warn(`The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.`)),I(e)||x(e)===l}function I(e){return x(e)===u}function L(e){return x(e)===c}function R(e){return x(e)===s}function te(e){return typeof e==`object`&&!!e&&e.$$typeof===n}function z(e){return x(e)===d}function B(e){return x(e)===i}function V(e){return x(e)===h}function H(e){return x(e)===m}function ne(e){return x(e)===r}function re(e){return x(e)===o}function U(e){return x(e)===a}function W(e){return x(e)===f}e.AsyncMode=S,e.ConcurrentMode=C,e.ContextConsumer=w,e.ContextProvider=T,e.Element=E,e.ForwardRef=D,e.Fragment=O,e.Lazy=k,e.Memo=A,e.Portal=j,e.Profiler=M,e.StrictMode=N,e.Suspense=P,e.isAsyncMode=ee,e.isConcurrentMode=I,e.isContextConsumer=L,e.isContextProvider=R,e.isElement=te,e.isForwardRef=z,e.isFragment=B,e.isLazy=V,e.isMemo=H,e.isPortal=ne,e.isProfiler=re,e.isStrictMode=U,e.isSuspense=W,e.isValidElementType=b,e.typeOf=x})()})),h=o(((e,t)=>{process.env.NODE_ENV===`production`?t.exports=p():t.exports=m()})),g=o(((e,t)=>{var n=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;function a(e){if(e==null)throw TypeError(`Object.assign cannot be called with null or undefined`);return Object(e)}function o(){try{if(!Object.assign)return!1;var e=new String(`abc`);if(e[5]=`de`,Object.getOwnPropertyNames(e)[0]===`5`)return!1;for(var t={},n=0;n<10;n++)t[`_`+String.fromCharCode(n)]=n;if(Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(``)!==`0123456789`)return!1;var r={};return`abcdefghijklmnopqrst`.split(``).forEach(function(e){r[e]=e}),Object.keys(Object.assign({},r)).join(``)===`abcdefghijklmnopqrst`}catch{return!1}}t.exports=o()?Object.assign:function(e,t){for(var o,s=a(e),c,l=1;l<arguments.length;l++){for(var u in o=Object(arguments[l]),o)r.call(o,u)&&(s[u]=o[u]);if(n){c=n(o);for(var d=0;d<c.length;d++)i.call(o,c[d])&&(s[c[d]]=o[c[d]])}}return s}})),_=o(((e,t)=>{t.exports=`SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED`})),v=o(((e,t)=>{t.exports=Function.call.bind(Object.prototype.hasOwnProperty)})),y=o(((e,t)=>{var n=function(){};if(process.env.NODE_ENV!==`production`){var r=_(),i={},a=v();n=function(e){var t=`Warning: `+e;typeof console<`u`&&console.error(t);try{throw Error(t)}catch{}}}function o(e,t,o,s,c){if(process.env.NODE_ENV!==`production`){for(var l in e)if(a(e,l)){var u;try{if(typeof e[l]!=`function`){var d=Error((s||`React class`)+`: `+o+" type `"+l+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[l]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw d.name=`Invariant Violation`,d}u=e[l](t,l,s,o,null,r)}catch(e){u=e}if(u&&!(u instanceof Error)&&n((s||`React class`)+`: type specification of `+o+" `"+l+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof u+`. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).`),u instanceof Error&&!(u.message in i)){i[u.message]=!0;var f=c?c():``;n(`Failed `+o+` type: `+u.message+(f??``))}}}}o.resetWarningCache=function(){process.env.NODE_ENV!==`production`&&(i={})},t.exports=o})),b=o(((e,t)=>{var n=h(),r=g(),i=_(),a=v(),o=y(),s=function(){};process.env.NODE_ENV!==`production`&&(s=function(e){var t=`Warning: `+e;typeof console<`u`&&console.error(t);try{throw Error(t)}catch{}});function c(){return null}t.exports=function(e,t){var l=typeof Symbol==`function`&&Symbol.iterator,u=`@`;function d(e){var t=e&&(l&&e[l]||e[u]);if(typeof t==`function`)return t}var f=`<<anonymous>>`,p={array:_(`array`),bigint:_(`bigint`),bool:_(`boolean`),func:_(`function`),number:_(`number`),object:_(`object`),string:_(`string`),symbol:_(`symbol`),any:v(),arrayOf:y,element:b(),elementType:x(),instanceOf:S,node:E(),objectOf:w,oneOf:C,oneOfType:T,shape:O,exact:k};function m(e,t){return e===t?e!==0||1/e==1/t:e!==e&&t!==t}function h(e,t){this.message=e,this.data=t&&typeof t==`object`?t:{},this.stack=``}h.prototype=Error.prototype;function g(e){if(process.env.NODE_ENV!==`production`)var n={},r=0;function a(a,o,c,l,u,d,p){if(l||=f,d||=c,p!==i){if(t){var m=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw m.name=`Invariant Violation`,m}else if(process.env.NODE_ENV!==`production`&&typeof console<`u`){var g=l+`:`+c;!n[g]&&r<3&&(s("You are manually calling a React.PropTypes validation function for the `"+d+"` prop on `"+l+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),n[g]=!0,r++)}}return o[c]==null?a?o[c]===null?new h(`The `+u+" `"+d+"` is marked as required "+("in `"+l+"`, but its value is `null`.")):new h(`The `+u+" `"+d+"` is marked as required in "+("`"+l+"`, but its value is `undefined`.")):null:e(o,c,l,u,d)}var o=a.bind(null,!1);return o.isRequired=a.bind(null,!0),o}function _(e){function t(t,n,r,i,a,o){var s=t[n];if(M(s)!==e){var c=N(s);return new h(`Invalid `+i+" `"+a+"` of type "+("`"+c+"` supplied to `"+r+"`, expected ")+("`"+e+"`."),{expectedType:e})}return null}return g(t)}function v(){return g(c)}function y(e){function t(t,n,r,a,o){if(typeof e!=`function`)return new h("Property `"+o+"` of component `"+r+"` has invalid PropType notation inside arrayOf.");var s=t[n];if(!Array.isArray(s)){var c=M(s);return new h(`Invalid `+a+" `"+o+"` of type "+("`"+c+"` supplied to `"+r+"`, expected an array."))}for(var l=0;l<s.length;l++){var u=e(s,l,r,a,o+`[`+l+`]`,i);if(u instanceof Error)return u}return null}return g(t)}function b(){function t(t,n,r,i,a){var o=t[n];if(!e(o)){var s=M(o);return new h(`Invalid `+i+" `"+a+"` of type "+("`"+s+"` supplied to `"+r+"`, expected a single ReactElement."))}return null}return g(t)}function x(){function e(e,t,r,i,a){var o=e[t];if(!n.isValidElementType(o)){var s=M(o);return new h(`Invalid `+i+" `"+a+"` of type "+("`"+s+"` supplied to `"+r+"`, expected a single ReactElement type."))}return null}return g(e)}function S(e){function t(t,n,r,i,a){if(!(t[n]instanceof e)){var o=e.name||f,s=F(t[n]);return new h(`Invalid `+i+" `"+a+"` of type "+("`"+s+"` supplied to `"+r+"`, expected ")+("instance of `"+o+"`."))}return null}return g(t)}function C(e){if(!Array.isArray(e))return process.env.NODE_ENV!==`production`&&(arguments.length>1?s(`Invalid arguments supplied to oneOf, expected an array, got `+arguments.length+` arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).`):s(`Invalid argument supplied to oneOf, expected an array.`)),c;function t(t,n,r,i,a){for(var o=t[n],s=0;s<e.length;s++)if(m(o,e[s]))return null;var c=JSON.stringify(e,function(e,t){return N(t)===`symbol`?String(t):t});return new h(`Invalid `+i+" `"+a+"` of value `"+String(o)+"` "+("supplied to `"+r+"`, expected one of "+c+`.`))}return g(t)}function w(e){function t(t,n,r,o,s){if(typeof e!=`function`)return new h("Property `"+s+"` of component `"+r+"` has invalid PropType notation inside objectOf.");var c=t[n],l=M(c);if(l!==`object`)return new h(`Invalid `+o+" `"+s+"` of type "+("`"+l+"` supplied to `"+r+"`, expected an object."));for(var u in c)if(a(c,u)){var d=e(c,u,r,o,s+`.`+u,i);if(d instanceof Error)return d}return null}return g(t)}function T(e){if(!Array.isArray(e))return process.env.NODE_ENV!==`production`&&s(`Invalid argument supplied to oneOfType, expected an instance of array.`),c;for(var t=0;t<e.length;t++){var n=e[t];if(typeof n!=`function`)return s(`Invalid argument supplied to oneOfType. Expected an array of check functions, but received `+P(n)+` at index `+t+`.`),c}function r(t,n,r,o,s){for(var c=[],l=0;l<e.length;l++){var u=e[l],d=u(t,n,r,o,s,i);if(d==null)return null;d.data&&a(d.data,`expectedType`)&&c.push(d.data.expectedType)}var f=c.length>0?`, expected one of type [`+c.join(`, `)+`]`:``;return new h(`Invalid `+o+" `"+s+"` supplied to "+("`"+r+"`"+f+`.`))}return g(r)}function E(){function e(e,t,n,r,i){return A(e[t])?null:new h(`Invalid `+r+" `"+i+"` supplied to "+("`"+n+"`, expected a ReactNode."))}return g(e)}function D(e,t,n,r,i){return new h((e||`React class`)+`: `+t+" type `"+n+`.`+r+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+i+"`.")}function O(e){function t(t,n,r,a,o){var s=t[n],c=M(s);if(c!==`object`)return new h(`Invalid `+a+" `"+o+"` of type `"+c+"` "+("supplied to `"+r+"`, expected `object`."));for(var l in e){var u=e[l];if(typeof u!=`function`)return D(r,a,o,l,N(u));var d=u(s,l,r,a,o+`.`+l,i);if(d)return d}return null}return g(t)}function k(e){function t(t,n,o,s,c){var l=t[n],u=M(l);if(u!==`object`)return new h(`Invalid `+s+" `"+c+"` of type `"+u+"` "+("supplied to `"+o+"`, expected `object`."));for(var d in r({},t[n],e)){var f=e[d];if(a(e,d)&&typeof f!=`function`)return D(o,s,c,d,N(f));if(!f)return new h(`Invalid `+s+" `"+c+"` key `"+d+"` supplied to `"+o+`\`.
Bad object: `+JSON.stringify(t[n],null,` `)+`
Valid keys: `+JSON.stringify(Object.keys(e),null,` `));var p=f(l,d,o,s,c+`.`+d,i);if(p)return p}return null}return g(t)}function A(t){switch(typeof t){case`number`:case`string`:case`undefined`:return!0;case`boolean`:return!t;case`object`:if(Array.isArray(t))return t.every(A);if(t===null||e(t))return!0;var n=d(t);if(n){var r=n.call(t),i;if(n!==t.entries){for(;!(i=r.next()).done;)if(!A(i.value))return!1}else for(;!(i=r.next()).done;){var a=i.value;if(a&&!A(a[1]))return!1}}else return!1;return!0;default:return!1}}function j(e,t){return e===`symbol`?!0:t?t[`@`]===`Symbol`||typeof Symbol==`function`&&t instanceof Symbol:!1}function M(e){var t=typeof e;return Array.isArray(e)?`array`:e instanceof RegExp?`object`:j(t,e)?`symbol`:t}function N(e){if(e==null)return``+e;var t=M(e);if(t===`object`){if(e instanceof Date)return`date`;if(e instanceof RegExp)return`regexp`}return t}function P(e){var t=N(e);switch(t){case`array`:case`object`:return`an `+t;case`boolean`:case`date`:case`regexp`:return`a `+t;default:return t}}function F(e){return!e.constructor||!e.constructor.name?f:e.constructor.name}return p.checkPropTypes=o,p.resetWarningCache=o.resetWarningCache,p.PropTypes=p,p}})),x=o(((e,t)=>{var n=_();function r(){}function i(){}i.resetWarningCache=r,t.exports=function(){function e(e,t,r,i,a,o){if(o!==n){var s=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name=`Invariant Violation`,s}}e.isRequired=e;function t(){return e}var a={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:r};return a.PropTypes=a,a}})),S=o(((e,t)=>{if(process.env.NODE_ENV!==`production`){var n=h();t.exports=b()(n.isElement,!0)}else t.exports=x()()})),C=c(S(),1),w=class e extends l.default.Component{ref=l.default.createRef();static propTypes={children:C.default.oneOfType([C.default.arrayOf(C.default.node),C.default.node]),onStartResize:C.default.func,onStopResize:C.default.func,className:C.default.string,propagate:C.default.bool,onResize:C.default.func,style:C.default.object};static defaultProps={document:typeof document<`u`?document:null,onStartResize:null,onStopResize:null,propagate:!1,onResize:null,className:``,style:{}};static isA(t){return t?process.env.NODE_ENV===`development`?t.type===(0,u.jsx)(e,{}).type:t.type===e:!1}constructor(e){super(e),this.state={active:!1},this.document=e.document}componentDidMount(){this.document&&(this.document.addEventListener(`touchend`,this.onMouseUp),this.document.addEventListener(`mouseup`,this.onMouseUp),this.document.addEventListener(`mousemove`,this.onMouseMove,{passive:!1}),this.document.addEventListener(`touchmove`,this.onMouseMove,{passive:!1}))}componentWillUnmount(){this.document&&(this.document.removeEventListener(`mouseup`,this.onMouseUp),this.document.removeEventListener(`touchend`,this.onMouseUp),this.document.removeEventListener(`mousemove`,this.onMouseMove),this.document.removeEventListener(`touchmove`,this.onMouseMove),this.state.active&&this.props.events.emit(`stopResize`,{index:this.props.index,event:null}))}onMouseMove=e=>{if(this.state.active){let t=this.ref.current;this.props.events.emit(`resize`,{index:this.props.index,domElement:t,event:e}),this.props.onResize&&this.props.onResize({component:this,domElement:t}),e.stopPropagation(),e.preventDefault()}};onMouseDown=e=>{this.setState({active:!0}),!(this.props.onStartResize&&this.props.onStartResize({domElement:this.ref.current,component:this}))&&this.props.events.emit(`startResize`,{index:this.props.index,event:e})};onMouseUp=e=>{this.state.active&&(this.setState({active:!1}),this.props.onStopResize&&this.props.onStopResize({domElement:this.ref.current,component:this}),this.props.events.emit(`stopResize`,{index:this.props.index,event:e}))};render(){let e=[d.isMobile()?`reflex-thin`:``,...this.props.className.split(` `),this.state.active?`active`:``,`reflex-splitter`].join(` `).trim();return(0,u.jsx)(`div`,{...f(this.props),onTouchStart:this.onMouseDown,onMouseDown:this.onMouseDown,style:this.props.style,className:e,id:this.props.id,ref:this.ref,children:this.props.children})}},T=class{constructor(){this._events={}}on(e,t){return e.split(` `).forEach(e=>{this._events[e]=this._events[e]||[],this._events[e].push(t)}),this}off(e,t){if(e==null){this._events={};return}return e.split(` `).forEach(e=>{e in this._events&&(t?this._events[e].splice(this._events[e].indexOf(t),1):this._events[e]=[])}),this}emit(e){if(this._events[e]!==void 0)for(var t=this._events[e].slice(),n=0;n<t.length;++n){var r=t[n].apply(this,Array.prototype.slice.call(arguments,1));if(r!==void 0)return r}}},E=T;Array.prototype.includes||Object.defineProperty(Array.prototype,`includes`,{value:function(e,t){if(this==null)throw TypeError(`"this" is null or not defined`);var n=Object(this),r=n.length>>>0;if(r===0)return!1;var i=t|0,a=Math.max(i>=0?i:r-Math.abs(i),0);function o(e,t){return e===t||typeof e==`number`&&typeof t==`number`&&isNaN(e)&&isNaN(t)}for(;a<r;){if(o(n[a],e))return!0;a++}return!1}}),Math.sign||(Math.sign=function(e){return(e>0)-(e<0)||+e});var D=c(S(),1),O=class extends l.default.Component{static propTypes={windowResizeAware:D.default.bool,orientation:D.default.oneOf([`horizontal`,`vertical`]),maxRecDepth:D.default.number,className:D.default.string,style:D.default.object};static defaultProps={orientation:`horizontal`,windowResizeAware:!1,maxRecDepth:100,className:``,style:{}};constructor(e){super(e),this.events=new E,this.children=[],this.state={flexData:[]},this.ref=l.default.createRef()}componentDidMount(){let e=this.computeFlexData(),{windowResizeAware:t}=this.props;t&&window.addEventListener(`resize`,this.onWindowResize),this.setState({windowResizeAware:t,flexData:e}),this.events.on(`element.size`,this.onElementSize),this.events.on(`startResize`,this.onStartResize),this.events.on(`stopResize`,this.onStopResize),this.events.on(`resize`,this.onResize)}componentWillUnmount(){this.events.off(),window.removeEventListener(`resize`,this.onWindowResize)}getValidChildren(e=this.props){return this.toArray(e.children).filter(e=>!!e)}componentDidUpdate(e,t){let n=this.getValidChildren(this.props);if(n.length!==this.state.flexData.length||e.orientation!==this.props.orientation||this.flexHasChanged(e)){let e=this.computeFlexData(n,this.props);this.setState({flexData:e})}this.props.windowResizeAware!==this.state.windowResizeAware&&(this.props.windowResizeAware?window.addEventListener(`resize`,this.onWindowResize):window.removeEventListener(`resize`,this.onWindowResize),this.setState({windowResizeAware:this.props.windowResizeAware}))}onWindowResize=()=>{this.setState({flexData:this.computeFlexData()})};flexHasChanged(e){let t=this.getValidChildren(e).map(e=>e.props.flex||0);return!this.getValidChildren().map(e=>e.props.flex||0).every((e,n)=>e===t[n])}getSize(e){let t=(e?.props.ref||e?.ref)?.current;switch(this.props.orientation){case`horizontal`:return t?.offsetHeight??0;case`vertical`:default:return t?.offsetWidth??0}}getOffset(e,t){let{top:n,bottom:r,left:i,right:a}=t.getBoundingClientRect();switch(this.props.orientation){case`horizontal`:{let t=e.clientY-this.previousPos;if(t>0){if(e.clientY>=n)return t}else if(e.clientY<=r)return t;break}case`vertical`:default:{let t=e.clientX-this.previousPos;if(t>0){if(e.clientX>i)return t}else if(e.clientX<a)return t}break}return 0}onStartResize=e=>{let t=e.event.changedTouches?e.event.changedTouches[0]:e.event;switch(this.props.orientation){case`horizontal`:document.body.classList.add(`reflex-row-resize`),this.previousPos=t.clientY;break;case`vertical`:default:document.body.classList.add(`reflex-col-resize`),this.previousPos=t.clientX;break}this.elements=[this.children[e.index-1],this.children[e.index+1]],this.emitElementsEvent(this.elements,`onStartResize`)};onResize=e=>{let t=e.event.changedTouches?e.event.changedTouches[0]:e.event,n=this.getOffset(t,e.domElement);switch(this.props.orientation){case`horizontal`:this.previousPos=t.clientY;break;case`vertical`:default:this.previousPos=t.clientX;break}if(n){let t=this.computeAvailableOffset(e.index,n);t&&(this.elements=this.dispatchOffset(e.index,t),this.adjustFlex(this.elements),this.setState({resizing:!0},()=>{this.emitElementsEvent(this.elements,`onResize`)}))}};onStopResize=e=>{document.body.classList.remove(`reflex-row-resize`),document.body.classList.remove(`reflex-col-resize`);let t=this.elements?this.elements.map(e=>e.props.ref||e.ref):[],n=this.children.filter(e=>!w.isA(e)&&t.includes(e.props.ref||e.ref));this.emitElementsEvent(n,`onStopResize`),this.setState({resizing:!1})};onElementSize=e=>new Promise(t=>{try{let n=e.index,r=this.getSize(this.children[n]),i=e.size-r,a=e.direction,o=n+a,s=this.computeAvailableOffset(o,a*i);this.elements=null,s&&(this.elements=this.dispatchOffset(o,s),this.adjustFlex(this.elements)),this.setState(this.state,()=>{this.emitElementsEvent(this.elements,`onResize`),t()})}catch(e){console.log(e)}});adjustFlex(e){let t=e.reduce((t,n)=>{let r=n.props.index;return t+(n.props.flex-this.state.flexData[r].flex)/e.length},0);e.forEach(e=>{this.state.flexData[e.props.index].flex+=t})}computeAvailableOffset(e,t){let n=this.computeAvailableStretch(e,t),r=this.computeAvailableShrink(e,t);return Math.min(n,r)*Math.sign(t)}checkPropagate(e,t){if(t>0){if(e<this.children.length-2){let t=this.children[e+2];return w.isA(t)&&t.props.propagate}}else if(e>2){let t=this.children[e-2];return w.isA(t)&&t.props.propagate}return!1}computeAvailableStretch(e,t){let n=t<0?e+1:e-1,r=this.children[n],i=this.getSize(r),a=(r?.props.maxSize??0)-i;if(a<Math.abs(t)&&this.checkPropagate(e,-1*t)){let n=Math.sign(t)*(Math.abs(t)-a);return a+this.computeAvailableStretch(t<0?e+2:e-2,n)}return Math.min(a,Math.abs(t))}computeAvailableShrink(e,t){let n=t>0?e+1:e-1,r=this.children[n],i=this.getSize(r)-Math.max(r?.props.minSize??0,0);if(i<Math.abs(t)&&this.checkPropagate(e,t)){let n=Math.sign(t)*(Math.abs(t)-i);return i+this.computeAvailableShrink(t>0?e+2:e-2,n)}return Math.min(i,Math.abs(t))}computePixelFlex(e=this.props.orientation){if(!this.ref.current)return console.warn(`Unable to locate ReflexContainer dom node`),0;switch(e){case`horizontal`:return this.ref.current.offsetHeight===0?(console.warn(`Found ReflexContainer with height=0, this will cause invalid behavior...`),console.warn(this.ref.current),0):1/this.ref.current.offsetHeight;case`vertical`:default:return this.ref.current.offsetWidth===0?(console.warn(`Found ReflexContainer with width=0, this will cause invalid behavior...`),console.warn(this.ref.current),0):1/this.ref.current.offsetWidth}}addOffset(e,t){let n=this.getSize(e),r=e.props.index,i=Math.max(n+t,0),a=this.state.flexData[r].flex,o=a>0?a*i/n:this.computePixelFlex()*i;this.state.flexData[r].flex=!isFinite(o)||isNaN(o)?0:o}dispatchStretch(e,t){let n=t<0?e+1:e-1;if(n<0||n>this.children.length-1)return[];let r=this.children[n],i=this.getSize(r),a=Math.min(r.props.maxSize,i+Math.abs(t))-i;if(this.addOffset(r,a),a<Math.abs(t)){let n=e-Math.sign(t)*2,i=Math.sign(t)*(Math.abs(t)-a);return[r,...this.dispatchStretch(n,i)]}return[r]}dispatchShrink(e,t){let n=t>0?e+1:e-1;if(n<0||n>this.children.length-1)return[];let r=this.children[n],i=this.getSize(r),a=Math.max(r.props.minSize,i-Math.abs(t))-i;if(this.addOffset(r,a),Math.abs(a)<Math.abs(t)){let n=e+Math.sign(t)*2,i=Math.sign(t)*(Math.abs(t)+a);return[r,...this.dispatchShrink(n,i)]}return[r]}dispatchOffset(e,t){return[...this.dispatchStretch(e,t),...this.dispatchShrink(e,t)]}emitElementsEvent(e,t){this.toArray(e).forEach(e=>{if(e.props[t]){let n=e.props.ref||e.ref;e.props[t]({domElement:n?.current,component:e})}})}computeFlexData(e=this.getValidChildren(),t=this.props){let n=this.computePixelFlex(t.orientation),r=e=>e.reduce((e,t)=>!w.isA(t)&&t.constrained?e-t.flex:e,1),i=e=>e.reduce((e,t)=>!w.isA(t)&&!t.constrained?e+1:e,0),a=e.map(e=>{let t=e.props;return{maxFlex:(t.maxSize||Number.MAX_VALUE)*n,sizeFlex:(t.size||Number.MAX_VALUE)*n,minFlex:(t.minSize||1)*n,constrained:t.flex!==void 0,flex:t.flex||0,type:e.type}}),o=(e,t=0)=>{let n=!1,a=i(e),s=r(e),c=e.map(e=>{if(w.isA(e))return e;let t=e.constrained?e.flex:s/a,r=Math.min(e.sizeFlex,Math.min(e.maxFlex,Math.max(e.minFlex,t))),i=e.constrained||r!==t;return n||=i,{...e,flex:r,constrained:i}});return n&&t<this.props.maxRecDepth?o(c,t+1):c};return o(a).map(e=>({flex:w.isA(e)?0:e.flex,ref:l.default.createRef()}))}toArray(e){return e?Array.isArray(e)?e:[e]:[]}render(){let e=[this.state.resizing?`reflex-resizing`:``,...this.props.className.split(` `),this.props.orientation,`reflex-container`].join(` `).trim();return this.children=l.default.Children.map(this.getValidChildren(),(e,t)=>{if(t>this.state.flexData.length-1)return(0,u.jsx)(`div`,{});let n=this.state.flexData[t],r={...e.props,maxSize:e.props.maxSize||Number.MAX_VALUE,orientation:this.props.orientation,minSize:e.props.minSize||1,events:this.events,flex:n.flex,ref:n.ref,index:t};return l.default.cloneElement(e,r)}),(0,u.jsx)(`div`,{...f(this.props),style:this.props.style,className:e,ref:this.ref,children:this.children})}},k=c(S(),1),A=class e extends l.default.Component{ref=l.default.createRef();static propTypes={children:k.default.oneOfType([k.default.arrayOf(k.default.node),k.default.node]),onStartResize:k.default.func,onStopResize:k.default.func,className:k.default.string,propagate:k.default.bool,onResize:k.default.func,style:k.default.object};static defaultProps={document:typeof document>`u`?null:document,onStartResize:null,onStopResize:null,propagate:!1,onResize:null,className:``,style:{}};static isA(t){return t?process.env.NODE_ENV===`development`?t.type===(0,u.jsx)(e,{}).type:t.type===e:!1}constructor(e){super(e),this.state={active:!1},this.document=e.document}componentDidMount(){this.document&&(this.document.addEventListener(`touchend`,this.onMouseUp),this.document.addEventListener(`mouseup`,this.onMouseUp),this.document.addEventListener(`mousemove`,this.onMouseMove,{passive:!1}),this.document.addEventListener(`touchmove`,this.onMouseMove,{passive:!1}))}componentWillUnmount(){this.document&&(this.document.removeEventListener(`mouseup`,this.onMouseUp),this.document.removeEventListener(`touchend`,this.onMouseUp),this.document.removeEventListener(`mousemove`,this.onMouseMove),this.document.removeEventListener(`touchmove`,this.onMouseMove),this.state.active&&this.props.events.emit(`stopResize`,{index:this.props.index,event:null}))}onMouseMove=e=>{if(this.state.active){let t=this.ref.current;this.props.events.emit(`resize`,{index:this.props.index,domElement:t,event:e}),this.props.onResize&&this.props.onResize({component:this,domElement:t}),e.stopPropagation(),e.preventDefault()}};onMouseDown=e=>{this.setState({active:!0}),!(this.props.onStartResize&&this.props.onStartResize({domElement:this.ref.current,component:this}))&&this.props.events.emit(`startResize`,{index:this.props.index,event:e})};onMouseUp=e=>{this.state.active&&(this.setState({active:!1}),this.props.onStopResize&&this.props.onStopResize({domElement:this.ref.current,component:this}),this.props.events.emit(`stopResize`,{index:this.props.index,event:e}))};render(){let e=[...this.props.className.split(` `),this.state.active?`active`:``,`reflex-handle`].join(` `).trim();return(0,u.jsx)(`div`,{...f(this.props),onTouchStart:this.onMouseDown,onMouseDown:this.onMouseDown,style:this.props.style,className:e,id:this.props.id,ref:this.ref,children:this.props.children})}},j=o(((e,t)=>{var n=`Expected a function`,r=NaN,i=`[object Symbol]`,a=/^\s+|\s+$/g,o=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,c=/^0o[0-7]+$/i,l=parseInt,u=typeof global==`object`&&global&&global.Object===Object&&global,d=typeof self==`object`&&self&&self.Object===Object&&self,f=u||d||Function(`return this`)(),p=Object.prototype.toString,m=Math.max,h=Math.min,g=function(){return f.Date.now()};function _(e,t,r){var i,a,o,s,c,l,u=0,d=!1,f=!1,p=!0;if(typeof e!=`function`)throw TypeError(n);t=S(t)||0,y(r)&&(d=!!r.leading,f=`maxWait`in r,o=f?m(S(r.maxWait)||0,t):o,p=`trailing`in r?!!r.trailing:p);function _(t){var n=i,r=a;return i=a=void 0,u=t,s=e.apply(r,n),s}function v(e){return u=e,c=setTimeout(C,t),d?_(e):s}function b(e){var n=e-l,r=e-u,i=t-n;return f?h(i,o-r):i}function x(e){var n=e-l,r=e-u;return l===void 0||n>=t||n<0||f&&r>=o}function C(){var e=g();if(x(e))return w(e);c=setTimeout(C,b(e))}function w(e){return c=void 0,p&&i?_(e):(i=a=void 0,s)}function T(){c!==void 0&&clearTimeout(c),u=0,i=l=a=c=void 0}function E(){return c===void 0?s:w(g())}function D(){var e=g(),n=x(e);if(i=arguments,a=this,l=e,n){if(c===void 0)return v(l);if(f)return c=setTimeout(C,t),_(l)}return c===void 0&&(c=setTimeout(C,t)),s}return D.cancel=T,D.flush=E,D}function v(e,t,r){var i=!0,a=!0;if(typeof e!=`function`)throw TypeError(n);return y(r)&&(i=`leading`in r?!!r.leading:i,a=`trailing`in r?!!r.trailing:a),_(e,t,{leading:i,maxWait:t,trailing:a})}function y(e){var t=typeof e;return!!e&&(t==`object`||t==`function`)}function b(e){return!!e&&typeof e==`object`}function x(e){return typeof e==`symbol`||b(e)&&p.call(e)==i}function S(e){if(typeof e==`number`)return e;if(x(e))return r;if(y(e)){var t=typeof e.valueOf==`function`?e.valueOf():e;e=y(t)?t+``:t}if(typeof e!=`string`)return e===0?e:+e;e=e.replace(a,``);var n=s.test(e);return n||c.test(e)?l(e.slice(2),n?2:8):o.test(e)?r:+e}t.exports=v})),M=c(j(),1);function N(){return N=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},N.apply(null,arguments)}function P(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function F(e,t){return F=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},F(e,t)}function ee(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,F(e,t)}var I=(function(){if(typeof Map<`u`)return Map;function e(e,t){var n=-1;return e.some(function(e,r){return e[0]===t?(n=r,!0):!1}),n}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,`size`,{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(t){var n=e(this.__entries__,t),r=this.__entries__[n];return r&&r[1]},t.prototype.set=function(t,n){var r=e(this.__entries__,t);~r?this.__entries__[r][1]=n:this.__entries__.push([t,n])},t.prototype.delete=function(t){var n=this.__entries__,r=e(n,t);~r&&n.splice(r,1)},t.prototype.has=function(t){return!!~e(this.__entries__,t)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(e,t){t===void 0&&(t=null);for(var n=0,r=this.__entries__;n<r.length;n++){var i=r[n];e.call(t,i[1],i[0])}},t}()})(),L=typeof window<`u`&&typeof document<`u`&&window.document===document,R=(function(){return typeof global<`u`&&global.Math===Math?global:typeof self<`u`&&self.Math===Math?self:typeof window<`u`&&window.Math===Math?window:Function(`return this`)()})(),te=(function(){return typeof requestAnimationFrame==`function`?requestAnimationFrame.bind(R):function(e){return setTimeout(function(){return e(Date.now())},1e3/60)}})(),z=2;function B(e,t){var n=!1,r=!1,i=0;function a(){n&&(n=!1,e()),r&&s()}function o(){te(a)}function s(){var e=Date.now();if(n){if(e-i<z)return;r=!0}else n=!0,r=!1,setTimeout(o,t);i=e}return s}var V=20,H=[`top`,`right`,`bottom`,`left`,`width`,`height`,`size`,`weight`],ne=typeof MutationObserver<`u`,re=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=B(this.refresh.bind(this),V)}return e.prototype.addObserver=function(e){~this.observers_.indexOf(e)||this.observers_.push(e),this.connected_||this.connect_()},e.prototype.removeObserver=function(e){var t=this.observers_,n=t.indexOf(e);~n&&t.splice(n,1),!t.length&&this.connected_&&this.disconnect_()},e.prototype.refresh=function(){this.updateObservers_()&&this.refresh()},e.prototype.updateObservers_=function(){var e=this.observers_.filter(function(e){return e.gatherActive(),e.hasActive()});return e.forEach(function(e){return e.broadcastActive()}),e.length>0},e.prototype.connect_=function(){!L||this.connected_||(document.addEventListener(`transitionend`,this.onTransitionEnd_),window.addEventListener(`resize`,this.refresh),ne?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener(`DOMSubtreeModified`,this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){!L||!this.connected_||(document.removeEventListener(`transitionend`,this.onTransitionEnd_),window.removeEventListener(`resize`,this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener(`DOMSubtreeModified`,this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(e){var t=e.propertyName,n=t===void 0?``:t;H.some(function(e){return!!~n.indexOf(e)})&&this.refresh()},e.getInstance=function(){return this.instance_||=new e,this.instance_},e.instance_=null,e}(),U=(function(e,t){for(var n=0,r=Object.keys(t);n<r.length;n++){var i=r[n];Object.defineProperty(e,i,{value:t[i],enumerable:!1,writable:!1,configurable:!0})}return e}),W=(function(e){return e&&e.ownerDocument&&e.ownerDocument.defaultView||R}),G=J(0,0,0,0);function K(e){return parseFloat(e)||0}function q(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return t.reduce(function(t,n){var r=e[`border-`+n+`-width`];return t+K(r)},0)}function ie(e){for(var t=[`top`,`right`,`bottom`,`left`],n={},r=0,i=t;r<i.length;r++){var a=i[r],o=e[`padding-`+a];n[a]=K(o)}return n}function ae(e){var t=e.getBBox();return J(0,0,t.width,t.height)}function oe(e){var t=e.clientWidth,n=e.clientHeight;if(!t&&!n)return G;var r=W(e).getComputedStyle(e),i=ie(r),a=i.left+i.right,o=i.top+i.bottom,s=K(r.width),c=K(r.height);if(r.boxSizing===`border-box`&&(Math.round(s+a)!==t&&(s-=q(r,`left`,`right`)+a),Math.round(c+o)!==n&&(c-=q(r,`top`,`bottom`)+o)),!ce(e)){var l=Math.round(s+a)-t,u=Math.round(c+o)-n;Math.abs(l)!==1&&(s-=l),Math.abs(u)!==1&&(c-=u)}return J(i.left,i.top,s,c)}var se=(function(){return typeof SVGGraphicsElement<`u`?function(e){return e instanceof W(e).SVGGraphicsElement}:function(e){return e instanceof W(e).SVGElement&&typeof e.getBBox==`function`}})();function ce(e){return e===W(e).document.documentElement}function le(e){return L?se(e)?ae(e):oe(e):G}function ue(e){var t=e.x,n=e.y,r=e.width,i=e.height,a=typeof DOMRectReadOnly<`u`?DOMRectReadOnly:Object,o=Object.create(a.prototype);return U(o,{x:t,y:n,width:r,height:i,top:n,right:t+r,bottom:i+n,left:t}),o}function J(e,t,n,r){return{x:e,y:t,width:n,height:r}}var de=function(){function e(e){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=J(0,0,0,0),this.target=e}return e.prototype.isActive=function(){var e=le(this.target);return this.contentRect_=e,e.width!==this.broadcastWidth||e.height!==this.broadcastHeight},e.prototype.broadcastRect=function(){var e=this.contentRect_;return this.broadcastWidth=e.width,this.broadcastHeight=e.height,e},e}(),fe=function(){function e(e,t){var n=ue(t);U(this,{target:e,contentRect:n})}return e}(),pe=function(){function e(e,t,n){if(this.activeObservations_=[],this.observations_=new I,typeof e!=`function`)throw TypeError(`The callback provided as parameter 1 is not a function.`);this.callback_=e,this.controller_=t,this.callbackCtx_=n}return e.prototype.observe=function(e){if(!arguments.length)throw TypeError(`1 argument required, but only 0 present.`);if(!(typeof Element>`u`||!(Element instanceof Object))){if(!(e instanceof W(e).Element))throw TypeError(`parameter 1 is not of type "Element".`);var t=this.observations_;t.has(e)||(t.set(e,new de(e)),this.controller_.addObserver(this),this.controller_.refresh())}},e.prototype.unobserve=function(e){if(!arguments.length)throw TypeError(`1 argument required, but only 0 present.`);if(!(typeof Element>`u`||!(Element instanceof Object))){if(!(e instanceof W(e).Element))throw TypeError(`parameter 1 is not of type "Element".`);var t=this.observations_;t.has(e)&&(t.delete(e),t.size||this.controller_.removeObserver(this))}},e.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},e.prototype.gatherActive=function(){var e=this;this.clearActive(),this.observations_.forEach(function(t){t.isActive()&&e.activeObservations_.push(t)})},e.prototype.broadcastActive=function(){if(this.hasActive()){var e=this.callbackCtx_,t=this.activeObservations_.map(function(e){return new fe(e.target,e.broadcastRect())});this.callback_.call(e,t,e),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e}(),Y=typeof WeakMap<`u`?new WeakMap:new I,me=function(){function e(t){if(!(this instanceof e))throw TypeError(`Cannot call a class as a function.`);if(!arguments.length)throw TypeError(`1 argument required, but only 0 present.`);var n=new pe(t,re.getInstance(),this);Y.set(this,n)}return e}();[`observe`,`unobserve`,`disconnect`].forEach(function(e){me.prototype[e]=function(){var t;return(t=Y.get(this))[e].apply(t,arguments)}});var he=(function(){return R.ResizeObserver===void 0?me:R.ResizeObserver})(),ge=he,X=c(S()),_e=[`client`,`offset`,`scroll`,`bounds`,`margin`];function ve(e){var t=[];return _e.forEach(function(n){e[n]&&t.push(n)}),t}function ye(e,t){var n={};if(t.indexOf(`client`)>-1&&(n.client={top:e.clientTop,left:e.clientLeft,width:e.clientWidth,height:e.clientHeight}),t.indexOf(`offset`)>-1&&(n.offset={top:e.offsetTop,left:e.offsetLeft,width:e.offsetWidth,height:e.offsetHeight}),t.indexOf(`scroll`)>-1&&(n.scroll={top:e.scrollTop,left:e.scrollLeft,width:e.scrollWidth,height:e.scrollHeight}),t.indexOf(`bounds`)>-1){var r=e.getBoundingClientRect();n.bounds={top:r.top,right:r.right,bottom:r.bottom,left:r.left,width:r.width,height:r.height}}if(t.indexOf(`margin`)>-1){var i=getComputedStyle(e);n.margin={top:i?parseInt(i.marginTop):0,right:i?parseInt(i.marginRight):0,bottom:i?parseInt(i.marginBottom):0,left:i?parseInt(i.marginLeft):0}}return n}function be(e){return e&&e.ownerDocument&&e.ownerDocument.defaultView||window}function xe(e){return function(t){var n,r;return r=n=function(n){ee(r,n);function r(){for(var t,r=arguments.length,i=Array(r),a=0;a<r;a++)i[a]=arguments[a];return t=n.call.apply(n,[this].concat(i))||this,t.state={contentRect:{entry:{},client:{},offset:{},scroll:{},bounds:{},margin:{}}},t._animationFrameID=null,t._resizeObserver=null,t._node=null,t._window=null,t.measure=function(n){var r=ye(t._node,e||ve(t.props));n&&(r.entry=n[0].contentRect),t._animationFrameID=t._window.requestAnimationFrame(function(){t._resizeObserver!==null&&(t.setState({contentRect:r}),typeof t.props.onResize==`function`&&t.props.onResize(r))})},t._handleRef=function(e){t._resizeObserver!==null&&t._node!==null&&t._resizeObserver.unobserve(t._node),t._node=e,t._window=be(t._node);var n=t.props.innerRef;n&&(typeof n==`function`?n(t._node):n.current=t._node),t._resizeObserver!==null&&t._node!==null&&t._resizeObserver.observe(t._node)},t}var i=r.prototype;return i.componentDidMount=function(){this._resizeObserver=this._window!==null&&this._window.ResizeObserver?new this._window.ResizeObserver(this.measure):new ge(this.measure),this._node!==null&&(this._resizeObserver.observe(this._node),typeof this.props.onResize==`function`&&this.props.onResize(ye(this._node,e||ve(this.props))))},i.componentWillUnmount=function(){this._window!==null&&this._window.cancelAnimationFrame(this._animationFrameID),this._resizeObserver!==null&&(this._resizeObserver.disconnect(),this._resizeObserver=null)},i.render=function(){var e=this.props;return e.innerRef,e.onResize,(0,l.createElement)(t,N({},P(e,[`innerRef`,`onResize`]),{measureRef:this._handleRef,measure:this.measure,contentRect:this.state.contentRect}))},r}(l.Component),n.propTypes={client:X.default.bool,offset:X.default.bool,scroll:X.default.bool,bounds:X.default.bool,margin:X.default.bool,innerRef:X.default.oneOfType([X.default.object,X.default.func]),onResize:X.default.func},r}}var Z=xe()(function(e){var t=e.measure,n=e.measureRef,r=e.contentRect,i=e.children;return i({measure:t,measureRef:n,contentRect:r})});Z.displayName=`Measure`,Z.propTypes.children=X.default.func;var Se=Z,Q=c(S(),1),$=e=>e?Array.isArray(e)?e:[e]:[],Ce=class extends l.default.Component{constructor(e){super(e),this.setDimensions=(0,M.default)(e=>{this.setState(e)},this.props.propagateDimensionsRate/1e3),this.state={height:`100%`,width:`100%`}}onResize=e=>{let{resizeHeight:t,resizeWidth:n}=this.props,{height:r,width:i}=e.bounds;this.setDimensions({...t&&{height:r},...n&&{width:i}})};renderChildren(){let{propagateDimensions:e}=this.props,t=$(this.props.children).filter(e=>!!e);return l.default.Children.map(t,t=>this.props.withHandle||A.isA(t)?l.default.cloneElement(t,{dimensions:e&&this.state,...t.props,index:this.props.index-1,events:this.props.events}):e?l.default.cloneElement(t,{...t.props,dimensions:this.state}):t)}render(){return(0,u.jsx)(Se,{bounds:!0,onResize:this.onResize,children:({measureRef:e})=>(0,u.jsx)(`div`,{ref:e,className:`reflex-size-aware`,children:(0,u.jsx)(`div`,{style:this.state,children:this.renderChildren()})})})}},we=class extends l.default.Component{static propTypes={propagateDimensions:Q.default.bool,resizeHeight:Q.default.bool,resizeWidth:Q.default.bool,className:Q.default.string,size:Q.default.number};static defaultProps={propagateDimensionsRate:100,propagateDimensions:!1,resizeHeight:!0,resizeWidth:!0,direction:[1],className:``};constructor(e){super(e),this.state={size:e.size}}static getDerivedStateFromProps(e,t){return e.size===t.size?null:{...t,size:e.size}}async componentDidUpdate(e,t,n){if(t.size!==this.state.size){let e=$(this.props.direction);for(let t of e)await this.props.events.emit(`element.size`,{index:this.props.index,size:this.props.size,direction:t})}}renderChildren(){let e=$(this.props.children).filter(e=>!!e);return l.default.Children.map(e,e=>this.props.withHandle||A.isA(e)?l.default.cloneElement(e,{...e.props,index:this.props.index-1,events:this.props.events}):e)}render(){let e=[...this.props.className.split(` `),this.props.orientation,`reflex-element`].join(` `).trim(),t={...this.props.style,flexGrow:this.props.flex,flexShrink:1,flexBasis:`0%`};return(0,u.jsx)(`div`,{...f(this.props),ref:this.props.innerRef,className:e,style:t,children:this.props.propagateDimensions?(0,u.jsx)(Ce,{...this.props}):this.renderChildren()})}},Te=l.default.forwardRef((e,t)=>(0,u.jsx)(we,{innerRef:t,...e}));exports.ReflexContainer=O,exports.ReflexElement=Te,exports.ReflexHandle=A,exports.ReflexSplitter=w;