Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

resizable-panes-js

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

resizable-panes-js - npm Package Compare versions

Comparing version 6.0.2 to 6.0.13

lib/cjs/index.cjs.js.map

3

lib/cjs/index.cjs.js

@@ -1,1 +0,2 @@

"use strict";var e=require("react"),i=-1,n=0,t=1,r=1,o=2,a="ratio",s="setSize",u="visibility",c="size",f="defaultMinSize",l="defaultMaxSize",d="resize",v="onNormalSize",z="mouseup",h="mousemove",S="mousedown",m="touchmove",p="touchend",x="touchStartCapture",g=function(e){return"".concat(e,"px")},y=function(e){return e?"width":"height"},b=function(e){return Object.keys(e).map((function(i){return e[i]?i:""})).join(" ")},M=function(e,i,n){return e.preventDefault(),e.type.startsWith("touch")?function(e,i,n){var t,r=e.targetTouches[0],o=null!==(t=n.current)&&void 0!==t?t:{},a=o.pageX,s=void 0===a?0:a,u=o.pageY,c=void 0===u?0:u;return n.current=r,i?[r.clientX,r.pageX-s]:[r.clientY,r.pageY-c]}(e,i,n):function(e,i){var n=e.clientX,t=e.clientY,r=e.movementX,o=e.movementY;return i?[n,r]:[t,o]}(e,i)},w=function(e,i){for(var n=[],t=2;t<arguments.length;t++)n[t-2]=arguments[t];n.forEach((function(n){return e.addEventListener(n,i)}))},E=function(e,i){for(var n=[],t=2;t<arguments.length;t++)n[t-2]=arguments[t];n.forEach((function(n){return e.removeEventListener(n,i)}))},R=function(){return R=Object.assign||function(e){for(var i,n=1,t=arguments.length;n<t;n++)for(var r in i=arguments[n])Object.prototype.hasOwnProperty.call(i,r)&&(e[r]=i[r]);return e},R.apply(this,arguments)};function C(e,i,n){if(n||2===arguments.length)for(var t,r=0,o=i.length;r<o;r++)!t&&r in i||(t||(t=Array.prototype.slice.call(i,0,r)),t[r]=i[r]);return e.concat(t||Array.prototype.slice.call(i))}"function"==typeof SuppressedError&&SuppressedError;var O=function(e,i,n,t){if(e<i)throw new Error("Size(".concat(e,") can not be smaller than minSize(").concat(i,") for pane id ").concat(t));if(e>n)throw new Error("Size(".concat(e,") can not be greatter than maxSize(").concat(n,") for pane id ").concat(t))},V=function(e,i){var n=e.minSize,t=e.maxSize,r=e.minSize;return i>=n&&i<=t?r=i:i>t&&(r=t),e.size=r,r},k=function(e,i,n){var t=e.axisSize+(n===r?i:-i),o=V(e,t);return Math.abs(o-t)},I=function(e,i,n){void 0===n&&(n=!1),e&&(e.visibility=i,i?(e.maxSize=e.defaultMaxSize,e.minSize=e.defaultMinSize,function(e,i){e.isHandle&&(e.size=i?0:e.resizerSize)}(e,n)):(e.maxSize=0,e.minSize=0),e.api&&e.api.destroy&&e.api.destroy(i))},L=function(e){e.oldVisibleSize=e.size,e.oldVisibility=e.visibility},T=function(e){e.initialSetSize=e.size},N=function(e){e.size=e.initialSetSize},A=function(e){e.sizeRatio=e.size,e.minSizeRatio=e.defaultMinSize,e.maxSizeRatio=e.defaultMaxSize},P=function(e){e.size=e.defaultSize,D(e),I(e,e.defaultVisibility)},D=function(e){e.minSize=e.defaultMinSize,e.maxSize=e.defaultMaxSize},H=function(e){return e.maxSize=e.defaultMaxSize,e.maxSize},j=function(e){return e.minSize=e.defaultMinSize,e.minSize},U=function(e){return e.maxSize=e.size,e.size},X=function(e){return e.minSize=e.size,e.size},Y=function(e){return e.size-e.defaultMinSize},F=function(e){return e.defaultMaxSize-e.size},B=function(e){e.size=e.minSize},_=function(e){e.size=e.maxSize},q=function(e){e.axisSize=e.size},K=function(e){e.api.setSize(G(e))},J=function(e){if(e.visibility&&!e.isHandle){var i=e.size,n=e.id,t=void 0;t=i===e.defaultMaxSize?"onMaxSize":i===e.defaultMinSize?"onMinSize":v,e.sizeState!==t&&(e.props[t](n,i),e.sizeState=t)}},W=function(e){var i,n=oe(e,"id",c,"defaultSize",f,u,"storedSize");return R(R({},n),((i={})[l]=e[l].toString(),i))},G=function(e){return e.visibility?e.size:0},Q=function(e){return e.visibility?e.sizeRatio:0},Z=function(e,i){e.size=i,e.storedSize=i},$=function(e,i,n,t,r,o,a){Z(e,i),e.defaultSize=r,e.minSize=n,e.maxSize=t,e.defaultMinSize=n,e.defaultMaxSize=t,e.storedSize=o,e.visibility=a},ee=function(e){return e},ie=function(e,i){return e.find((function(e){return e.id===i}))},ne=function(e){for(var i=[],n=1;n<arguments.length;n++)i[n-1]=arguments[n];var t={};return e.forEach((function(e){var n=function(i){return i===c?G(e):e[i]},r=e.id;1===i.length?t[r]=n(i[0]):t[r]=i.reduce((function(e,i){return e[i]=n(i),e}),{})})),t},te=function(e,i,n){return void 0===n&&(n="id"),e.findIndex((function(e){return e[n]===i}))},re=function(e,i,n){return Math.round(function(e,i,n){return Number((e*(n/i)).toFixed(0))}(e,i,n))},oe=function(e){for(var i=[],n=1;n<arguments.length;n++)i[n-1]=arguments[n];var t={};return i.forEach((function(i){t[i]=e[i]})),t},ae=function(e){return e===t},se=function(e){return"".concat("resizer","-").concat(e)},ue=function(e){return Object.keys(e).forEach((function(i){void 0===e[i]&&delete e[i]})),e},ce=function(e){return C([],e,!0).reverse()},fe=function(e){return e.filter((function(e){return e}))},le=function(e,i,n,t){var r;this.sizeState=v,this.storedSize=0,this.axisSize=0,this.oldVisibleSize=0,this.oldVisibility=!0,this.props=function(e,i){var n=ue(R({},e)),t=i.onMinSize,r=void 0===t?ee:t,o=i.onMaxSize,a=void 0===o?ee:o,s=i.onNormalSize,u=void 0===s?ee:s,c=i.resizerClass,f=i.activeResizerClass,l=i.resizerSize,d=i.detectionRadius;return R({onMinSize:r,onMaxSize:a,onNormalSize:u,resizerSize:l,resizerClass:c,detectionRadius:d,activeResizerClass:f,minSize:0,maxSize:1/0},n)}(e,i);var o=this.props,s=o.id,u=o.minSize,c=o.size,f=o.maxSize,l=o.resizerSize,d=o.detectionRadius,z=i.visibility,h=i.vertical,S=i.minMaxUnit,m=i.unit;this.minMaxUnit=null!=S?S:m,m!==a&&O(c,u,f,s);var p=null===(r=z[s])||void 0===r||r;this.defaultVisibility=p;var x=n.getStoredPane(s);if(x){var g=x.size,y=x.defaultMaxSize,b=x.defaultMinSize,M=x.defaultSize,w=x.visibility,E=x.storedSize;$(this,g,b,y,M,E,w)}else $(this,c,u,f,c,c,p);this.id=s,this.vertical=h,A(this),this.isHandle=t,t&&(this.id=se(s),this.resizerSize=l,this.detectionRadius=d)},de=function(){function e(){this.isSetRatioMode=!1,this.newVisibilityModel=!1,this.isViewSizeChanged=!1}return e.prototype.register=function(e){Object.assign(this,e)},e}(),ve=function(e){e.forEach(K)},ze=function(e){return e.filter((function(e){return e.visibility}))};function he(e,i,n,t){void 0===n&&(n=0),void 0===t&&(t=e.length-1);for(var r=0,o=n;o<=t;o++)r+=i(e[o]);return r}var Se=function(e,i,n){return he(e,U,i,n)},me=function(e,i,n){return he(e,X,i,n)},pe=function(e,i,n){return he(e,G,i,n)},xe=function(e,i,n,t){for(var r=e.virtualOrderList,o=e.index,a=0;a<r.length;a++)a<=o?i(r[a],t):n(r[a],t)},ge=function(e,i,n){var t=e.size+(n===r?i:-i);Z(e,t)},ye=function(e,i,n){for(var t,r=0,o=e.length;i>1;)e[t=r%o].visibility&&(ge(e[t],1,n),--i),++r;for(;;){if(e[t=r%o].visibility)return void ge(e[t],i,n);++r}},be=function(e){var i=e.items,n=e.index,t=Ee(e).maxTopAxis,r=ze(i);e.bottomAxis=t+he(r,(function(e){return e.maxSize}),0,n-1),e.topAxis=t+function(e,i,n){return he(e,(function(e){return e.minSize}),i,n)}(r,0,n-1)},Me=function(e,i,n,t,r,o){var a,s=e.length-1,u=n,c=t,f=e[n],l=e[t],d=function(){r+=j(f)},v=function(){r+=H(l)};switch(!0){case n>0&&t<s:switch(!0){case i<0:d(),a=Y(e[u=n-1])+i;break;case 0===i:d(),v(),c=t+1,a=Y(e[u=n-1])-F(e[c]);break;case i>0:v(),a=i-F(e[c=t+1])}break;case 0===n&&t<s:switch(!0){case i<0:return d(),r+=Se(e,t+1,s),void(l.maxSize=o-r);case 0===i:return d(),v(),void Se(e,t+1,s);case i>0:v(),a=i-F(e[c=t+1])}break;case n>0&&t===s:switch(!0){case i<0:d(),a=Y(e[u=n-1])+i;break;case 0===i:return d(),v(),void me(e,0,n-1);case i>0:return v(),r+=me(e,0,n-1),void(f.minSize=o-r)}break;case 0===n&&t===s:switch(!0){case i<0:return d(),void(l.maxSize=o-r);case 0===i:return d(),void v();case i>0:return v(),void(f.minSize=o-r)}}Me(e,a,u,c,r,o)},we=function(e,i,n,t,r,o){var a,s=e.length-1,u=n,c=t,f=e[n],l=e[t],d=function(){r+=H(f)},v=function(){r+=j(l)};switch(!0){case n>0&&t<s:switch(!0){case i<0:d(),a=F(e[u=n-1])+i;break;case 0===i:d(),v(),c=t+1,a=F(e[u=n-1])-Y(e[c]);break;case i>0:v(),a=i-Y(e[c=t+1])}break;case 0===n&&t<s:switch(!0){case i<0:return d(),r+=me(e,t+1,s),void(l.minSize=o-r);case 0===i:return d(),v(),void me(e,t+1,s);case i>0:v(),a=i-Y(e[c=t+1])}break;case n>0&&t===s:switch(!0){case i<0:d(),a=F(e[u=n-1])+i;break;case 0===i:return d(),v(),void Se(e,0,n-1);case i>0:return v(),r+=Se(e,0,n-1),void(f.maxSize=o-r)}break;case 0===n&&t===s:switch(!0){case i<0:return d(),void(l.minSize=o-r);case 0===i:return v(),void d();case i>0:return v(),void(f.maxSize=o-r)}}we(e,a,u,c,r,o)},Ee=function(e){var i=e.getContainerRect,n=e.vertical,t=e.resizersList,r=i(),o=r.top,a=r.height,s=r.left,u=r.width,c=n?s:o,f=Math.round(n?u:a);return{containerSize:f,maxTopAxis:c,maxPaneSize:f-pe(t)}},Re=function(e,i){void 0===i&&(i=!1);var n=e.panesList,t=e.items,s=Ee(e).maxPaneSize,u=function(e){return he(e,Q)}(n);if(!(u<0)){n.forEach((function(e){!function(e){e.size=e.sizeRatio,e.defaultMinSize=e.minSizeRatio,e.defaultMaxSize=e.maxSizeRatio}(e),function(e,i,n,t){var r,o,s=e.props,u=s.minSize,c=s.size,f=s.maxSize,l=t?[e.minSizeRatio,e.size,e.maxSizeRatio]:[u,c,f],d=l[0],v=l[2],z=re(i,n,l[1]);e.minMaxUnit!==a?(r=e.defaultMinSize,o=e.defaultMaxSize):(r=re(i,n,d),o=re(i,n,v)),t||(e.minMaxUnit!==a?O(z,r,o,e.id):O(c,u,f,e.id)),$(e,z,r,o,z,z,e.visibility)}(e,s,u,i)}));var c=pe(n),f=s-c,l=f<0?o:r;ye(n,Math.abs(f),l),ve(t)}},Ce=function(e){var i=e.items;return Ee(e).containerSize-pe(i)},Oe=function(){function e(e,i,n){this.store=null,this.empty=!1,this.panesComponents=n,this.getStorage(e,i)}return e.prototype.getStorage=function(e,i){var n,t=this,r=this.store;if(r)return r;if(i){n=i.getItem(e);var o=JSON.parse(n,(function(e,i){return"defaultMaxSize"===e?Number(i):i}));if("[object Object]"===toString.call(o)){var a=o.panes;if(a){if(a.every((function(e,i){var n;return(null===(n=t.panesComponents[i])||void 0===n?void 0:n.props.id)===e.id}))&&a.length===this.panesComponents.length)return this.store=o,o;i.removeItem(e)}else i.removeItem(e)}}this.empty=!0,this.store={panes:[]}},e.prototype.getStoredPane=function(e){var i,n=this.store.panes;return null!==(i=ie(n,e))&&void 0!==i?i:null},e}(),Ve=function(e,i,n){var t=i-pe(e);if(0!==t&&0!==n.length){var a=t>0?r:o,s=Math.abs(t);if(s<=n.length)ye(n,s,a);else{var u=pe(n),c=[];n.forEach((function(e){var i=G(e),n=function(e,i,n){var t=e.size+(n===r?i:-i);return D(e),V(e,t)===t}(e,Math.round(s*(i/u)),a);n&&c.push(e)})),Ve(e,i,c)}}},ke=function(e,i,n,t){var a,s,u=function(){var i,n=C(C([],a,!0),s,!0),t=o;e<0&&(e=Math.abs(e),t=r),n.forEach((i=t,function(n){q(n),D(n),e=k(n,e,i)}))};"1"===i?(a=n.slice(t+2),s=n.slice(0,t-1).reverse(),u()):"2"===i&&(a=n.slice(0,t-1).reverse(),s=n.slice(t+2),u())},Ie=function(e,i,n,t,r){void 0===t&&(t=a),void 0===r&&(r=!1);var o=e.panesList,s=e.items,u=ze(o),c=ze(s),f=te(u,i);if(!(-1===f||n<0)){var l="".concat(i,"-").concat(t);e.setSizeKey===l?o.forEach(N):(o.forEach(T),e.setSizeKey=l);var d=pe(u),v=u[f];D(v);var z=v.size,h=V(v,n)-z;if(h){var S=te(c,i);if(t===a){var m=C([],u,!0);m.splice(f,1);var p=d-v.size;Ve(m,p,m)}if(ke(h,t,c,S),!r){var x=Ce(e);Ie(e,i,n+x,t,!0)}}}};function Le(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Te=Le((function(e,i){let n,t=0;return function(...r){clearTimeout(n);const o=Date.now(),a=i-(o-t);a<=0?(t=o,e.apply(this,r)):n=setTimeout((()=>{t=Date.now(),e.apply(this,r)}),a)}})),Ne=function(e){for(var i=e.vertical,n=e.items,t=(0,e.getContainerRect)(),r=t.left,o=t.top,a=i?r:o,s=ze(n),u=[],c=0;c<s.length-1;c+=2){var f=s[c];if(!f.isHandle){var l=s[c+1],d=l.defaultSize,v=l.id,z=l.detectionRadius,h=G(f),S=a+h-z,m=a+h+d+z;a+=h+d,u.push([S,m,v])}}e.detectionDetails=u},Ae=function(e,i,n){return function(t){var r=e.detectionDetails,o=i?t.clientX:t.clientY,a=r.map((function(e){var i=e[0],n=e[1];return Math.abs((i+n)/2-o)})),s=C([],a,!0).sort((function(e,i){return e>i?-1:i>e?1:0})).pop(),u=r[a.indexOf(s)],c=u[0],f=u[1],l=u[2];if(s<=(f-c)/2){e.previousTouchEvent=t;var d=M(t,i,{});e.onMouseDown(d,l),n()}}},Pe=function(e,i){var n=i.vertical,t=Te(function(e,i,n,t){return function(r){var o=i.detectionDetails,a=n?r.clientX:r.clientY;e.style.cursor="auto",o.forEach((function(i){var n=i[0],r=i[1];a>=n&&a<=r&&(e.style.cursor=t)}))}}(e,i,n,n?"col-resize":"row-resize"),100);w(e,t,h),document.addEventListener(m,t,{passive:!1});var r=function(e,i){return function(n){var t=M(n,i,e.previousTouchEvent);e.resizeOnMove(t)}}(i,n),o=Ae(i,n,(function(){w(document,r,h),document.addEventListener(m,r,{passive:!1})}));w(e,o,S,x),w(document,(function(){i.onMouseUp(),E(document,r,h,m)}),z,p)},De=function(e){var d=e.vertical,v=e.children,z=e.unit,h=e.uniqueId,S=e.storageApi,m=e.onResizeStop,p=e.onChangeVisibility,x=e.onResize,b=function(e){return Array.isArray(e)?e:[e]}(v),M=new Oe(h,S,b),w=function(e,i,n){var t=[];return e.forEach((function(e){return t.push(new le(e.props,i,n,!1),new le(e.props,i,n,!0))})),t.pop(),t}(b,e,M),E=function(e){return[e.filter((function(e){return!e.isHandle})),e.filter((function(e){return e.isHandle}))]}(w),O=E[0],V=E[1],T=new de;T.register({vertical:d,items:w,panesList:O,resizersList:V});var N=function(){return function(e){return e.forEach(q)}(w)},D=function(){var e=j();m(e),function(e,i,n){var t={panes:n.panesList.map(W)};i&&i.setItem(e,JSON.stringify(t))}(h,S,T),Ne(T)},H=function(){var e=U();p(e)},j=function(){return ne(O,c)},U=function(){return ne(O,u)},X=function(e){V.forEach((function(i){i.api.setMouseDownFlag(T.handleId,e)}))};T.onMouseDown=function(e,i){var t=e[0];T.register({handleId:i,direction:n,axisCoordinate:t}),console.log(i,t),X(!0),N()};var K=function(e){void 0===e&&(e=""),function(e){e!==a&&O.forEach(A),e!==u&&(T.newVisibilityModel=!1),e!==s&&(T.setSizeKey=null)}(e),function(e){e.forEach(J)}(O)};T.resizeOnMove=function(e){var i,n=e[0],t=e[1];!T.isViewSizeChanged&&t&&(Q(n,t),ee(n)&&function(e,i){var n,t=i.axisCoordinate,a=i.decreasingItems,s=i.increasingItems,u=i.direction,c=a,f=s;if(ae(u)?(n=t-e,c=ce(a)):(n=e-t,f=ce(s)),n<0);else if(0===n)return;var l=n;c.forEach((function(e){n=k(e,n,o)})),l-=n,f.forEach((function(e){l=k(e,l,r)}))}(n,T),ve(w),K(),i=j(),x(i))};var Q=function(e,n){var r=T.direction,o=function(e){return e<0?t:i}(n);o!==r&&(T.direction=o,Z(e))},Z=function(e){T.axisCoordinate=e,function(e){var i,n=e.items,t=e.direction,r=e.handleId,o=ze(n),a=te(o,r),s=[],u=[],c=function(e,i){var n=o[e];n.size?(u[e]=n,u[e+i]=o[e+i]):(u[e]=o[e+i],u[e+i]=n)};if(ae(t)){for(var f=a-1;f>-1;f-=2)s.push(o[f],o[f-1]);for(s.reverse(),u=[o[a]],f=a+1;f<o.length;f+=2)c(f,1);i=C(C([],s,!0),u,!0)}else{for(u=[o[0]],f=a-1;f>0;f-=2)c(f,-1);for(u.push(o[a]),f=a+1;f<o.length;f+=2)s.push(o[f],o[f+1]);i=C(C([],u,!0),s,!0)}e.virtualOrderList=fe(i),e.increasingItems=fe(u),e.decreasingItems=fe(s),e.index=te(e.virtualOrderList,r)}(T),N(),function(e){var i=Ee(e).containerSize,n=e.virtualOrderList,t=e.index,r=t+1,o=Y(n[t]),a=F(n[r]);Me(n,o-a,t,r,0,i);var s=Y(n[r]),u=F(n[t]);we(n,u-s,t,r,0,i)}(T),be(T)},ee=function(e){var n=T.topAxis,r=T.bottomAxis;return e<=n?(xe(T,B,_,t),N(),T.axisCoordinate=n,!1):!(e>=r)||(xe(T,_,B,i),N(),T.axisCoordinate=r,!1)},re=function(e){var i=T.newVisibilityModel,n=ne(O,u),t=R(R({},n),e);i||(T.newVisibilityModel=!0,O.forEach(L)),function(e,i){for(var n,t=e.panesList,r=e.items,o=-1,a=0;a<r.length;a+=2){var s=r[a];(n=s).size=n.oldVisibleSize,n.visibility=n.oldVisibility;var u=s.id;I(s,i[u]),I(r[a+1],!1),s.visibility&&(-1!==o&&I(r[a-1],!0),o=a)}var c=ze(t);0===pe(c)&&c.forEach((function(e){e.size=1}));var f=Ee(e).maxPaneSize;Ve(c,f,c)}(T,t);var r=Ce(T);T.isViewSizeChanged=!!r,ve(w),D(),H(),K(u)};T.onMouseUp=function(){var e,i,n;D(),X(!1),e=T.items,i=0,n=e.map((function(e){return i+=G(e),G(e)})),console.log("consoleGetSize",n,i)};var oe=function(){ve(w),D(),K(s)},se={restore:function(){!function(e){e.forEach(P),ve(e)}(T.items),K(),D(),H(),T.isViewSizeChanged=!1},setVisibilities:re,getSizes:j,getVisibilities:function(){return U()},getState:function(){return ne(O,c,u,f,l)},setSize:function(e,i,n){Ie(T,e,i,n),oe()},setSizeRatio:function(e,i,n){var t=Ee(T).containerSize;Ie(T,e,t*i,n),oe()}};return T.register({api:se,registerItem:function(e,i){!function(e,i){if(e.api=i,e.isHandle){var n=e.resizerSize;i.setSize(n),$(e,n,n,n,n,n,e.visibility)}}(ie(w,i),e)},registerContainer:function(i){T.getContainerRect=function(){return i.getBoundingClientRect()};var n=e.visibility;if(M.empty&&z===a&&!T.isSetRatioMode)Re(T),T.isSetRatioMode=!0;else{var t=M.getStorage(h,S).panes;n=ne(t,u)}re(n),Pe(i,T)},vertical:d,props:e,getPaneSizeStyle:function(e){var i=G(ie(O,e));return function(e,i){var n;return(n={})[y(e)]=g(i),n}(d,i)}}),T},He=e.createContext({});function je(i,n){void 0===n&&(n=ee);var t=e.useRef(null);return[e.useCallback((function(e){t.current,e?i(e):n(t.current),t.current=e}),[])]}var Ue=function(i){var n,t,r=i.children,o=i.id,a=se(o),s=e.useContext(He),u=s.registerItem,c=s.panesList,f=s.vertical,l=te(c,o),d=c[l].props,v=d.resizerClass,z=d.activeResizerClass,h=l<c.length-1,S=e.useState(!1),m=S[0],p=S[1],x=e.useCallback((function(e,i){a===e&&p(i)}),[a]),y=je((function(e){var i=function(e,i){return function(n){e.style[function(e){return e?"minWidth":"minHeight"}(i)]=g(n)}}(e,f);u({setSize:i,setMouseDownFlag:x},a)}))[0],M=b(((n={"overflow-hidden":!0})[z]=m,n[v]=!m,n));return e.isValidElement(r)&&(t=e.cloneElement(r,R(R({},r.props),{isMouseDown:m,id:"".concat(a)}))),h?e.createElement("div",{className:M,"data-cy":a,ref:y},t):null};!function(e,i){void 0===i&&(i={});var n=i.insertAt;if(e&&"undefined"!=typeof document){var t=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css","top"===n&&t.firstChild?t.insertBefore(r,t.firstChild):t.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}}("\r\n.flex{\r\n display: flex;\r\n}\r\n\r\n.f-column{\r\n flex-direction: column;\r\n}\r\n\r\n.f-row {\r\n flex-direction: row;\r\n}\r\n\r\n.w-fit-content{\r\n width: fit-content;\r\n}\r\n\r\n.m-auto {\r\n margin: auto;\r\n}\r\n\r\n.resizer {\r\n box-sizing: border-box;\r\n background-clip: padding-box;\r\n}\r\n\r\n/* .resizer-vertical {\r\n cursor: row-resize;\r\n} */\r\n\r\n/* .resizer-horizontal {\r\n cursor: col-resize;\r\n} */\r\n\r\n.overflow-hidden {\r\n overflow: hidden; \r\n}\r\n\r\n.w-100p{\r\n width: 100%\r\n}\r\n\r\n.h-100p{\r\n height: 100%;\r\n}\r\n\r\n.flex-shrink-0{\r\n flex-shrink: 0;\r\n}");var Xe=function(i){var n=i.children,t=i.className,r=i.unit,o=i.vertical,s=i.uniqueId,u=e.useContext(He).registerContainer,c=je((function(e){return u(e)}))[0],f=function(e,i,n){var t;return b(((t={flex:!0,"f-row w-fit-content h-100p":e,"f-column":!e,"w-100p h-100p":n===a})[i]=i,t))}(o,t,r);return e.createElement("div",{className:f,"data-cy":s,ref:c},n)},Ye={};exports.BUTTOM_FIRST="1",exports.Pane=function(i){var n,t=e.useContext(He),r=e.useState(!0),o=r[0],a=r[1],s=t.vertical,u=t.registerItem,c=t.getPaneSizeStyle,f=t.props,l=f.resizer,d=f.unmountOnHide,v=i.className,z=i.children,h=i.resizer,S=i.id,m=i.unmountOnHide,p=null!=m?m:d,x=je((function(e){var i=function(e,i){return function(n){e.style[y(i)]=g(n)}}(e,s);u({node:e,destroy:function(e){p&&a(e)},setSize:i},S)}))[0],M=b(((n={"overflow-hidden flex-shrink-0":!0})[v]=v,n)),w=c(S);return e.createElement(e.Fragment,null,e.createElement("div",{className:M,"data-cy":S,key:S,ref:x,style:w},o&&z),e.createElement(Ue,{id:S},h||l))},exports.RATIO=a,exports.ResizablePanes=function(i){var n,t=(n=ue(R({},i)),R({onResize:ee,onResizeStop:ee,onReady:ee,onChangeVisibility:ee,vertical:!1,unit:a,resizerSize:2,detectionRadius:6,visibility:Ye,unmountOnHide:!0},n)),r=t.visibility,o=t.onReady,s=t.unit,u=e.useRef(De(t)),c=u.current,f=c.api;e.useEffect((function(){var e=function(){s===a&&(Re(c,!0),Ne(c))};return w(window,e,d),function(){return E(window,e,d)}}),[s,c]);var l=e.useRef(!0);return e.useEffect((function(){o(f)}),[f]),e.useEffect((function(){!1===l.current?u.current.api.setVisibilities(r):l.current=!1}),[r,l]),e.createElement(He.Provider,{value:u.current},e.createElement(Xe,R({},t)))},exports.TOP_FIRST="2";
"use strict";var i=function(){return i=Object.assign||function(i){for(var e,n=1,t=arguments.length;n<t;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(i[r]=e[r]);return i},i.apply(this,arguments)};function e(i,e,n){if(n||2===arguments.length)for(var t,r=0,o=e.length;r<o;r++)!t&&r in e||(t||(t=Array.prototype.slice.call(e,0,r)),t[r]=e[r]);return i.concat(t||Array.prototype.slice.call(e))}"function"==typeof SuppressedError&&SuppressedError;var n=-1,t=0,r=1,o=1,a=2,u="ratio",s="setSize",c="visibility",f="size",l="defaultMinSize",v="defaultMaxSize",d="onNormalSize",z="mouseup",S="mousemove",h="mousedown",p="touchmove",m="touchend",g="touchstart",y=function(i,e,n,t){if(i<e)throw new Error("Size(".concat(i,") can not be smaller than minSize(").concat(e,") for pane id ").concat(t));if(i>n)throw new Error("Size(".concat(i,") can not be greatter than maxSize(").concat(n,") for pane id ").concat(t))},x=function(e,n){var t=ei(i({},e)),r=n.onMinSize,o=void 0===r?W:r,a=n.onMaxSize,u=void 0===a?W:a,s=n.onNormalSize,c=void 0===s?W:s,f=n.resizerClass,l=n.activeResizerClass,v=n.resizerSize,d=n.detectionRadius;return i({onMinSize:o,onMaxSize:u,onNormalSize:c,resizerSize:v,resizerClass:f,detectionRadius:d,activeResizerClass:l,minSize:0,maxSize:1/0},t)},b=function(i,e){var n=i.minSize,t=i.maxSize,r=i.minSize;return e>=n&&e<=t?r=e:e>t&&(r=t),i.size=r,r},M=function(i,e,n){var t=i.axisSize+(n===o?e:-e),r=b(i,t);return Math.abs(r-t)},w=function(i,e,n){void 0===n&&(n=!1),i&&(i.visibility=e,e?(i.maxSize=i.defaultMaxSize,i.minSize=i.defaultMinSize,function(i,e){i.isHandle&&(i.size=e?0:i.resizerSize)}(i,n)):(i.maxSize=0,i.minSize=0),i.api&&i.api.destroy&&i.api.destroy(e))},E=function(i){i.oldVisibleSize=i.size,i.oldVisibility=i.visibility},R=function(i){i.initialSetSize=i.size},C=function(i){i.size=i.initialSetSize},V=function(i){i.sizeRatio=i.size,i.minSizeRatio=i.defaultMinSize,i.maxSizeRatio=i.defaultMaxSize},O=function(i){i.size=i.defaultSize,I(i),w(i,i.defaultVisibility)},I=function(i){i.minSize=i.defaultMinSize,i.maxSize=i.defaultMaxSize},L=function(i){return i.maxSize=i.defaultMaxSize,i.maxSize},k=function(i){return i.minSize=i.defaultMinSize,i.minSize},j=function(i){return i.maxSize=i.size,i.size},A=function(i){return i.minSize=i.size,i.size},D=function(i){return i.size-i.defaultMinSize},P=function(i){return i.defaultMaxSize-i.size},H=function(i){i.size=i.minSize},N=function(i){i.size=i.maxSize},T=function(i){i.axisSize=i.size},U=function(i){i.api.setSize(B(i))},X=function(i){if(i.visibility&&!i.isHandle){var e,n=i.size,t=i.id;e=n===i.defaultMaxSize?"onMaxSize":n===i.defaultMinSize?"onMinSize":d,i.sizeState!==e&&(i.props[e](t,n),i.sizeState=e)}},Y=function(e){var n,t=Z(e,"id",f,"defaultSize",l,c,"storedSize");return i(i({},t),((n={})[v]=e[v].toString(),n))},B=function(i){return i.visibility?i.size:0},F=function(i){return i.visibility?i.sizeRatio:0},K=function(i,e){i.size=e,i.storedSize=e},J=function(i,e,n,t,r,o,a){K(i,e),i.defaultSize=r,i.minSize=n,i.maxSize=t,i.defaultMinSize=n,i.defaultMaxSize=t,i.storedSize=o,i.visibility=a},W=function(i){return i},_=function(i,e){return i.find((function(i){return i.id===e}))},q=function(i){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var t={};return i.forEach((function(i){var n=function(e){return e===f?B(i):i[e]},r=i.id;1===e.length?t[r]=n(e[0]):t[r]=e.reduce((function(i,e){return i[e]=n(e),i}),{})})),t},G=function(i,e,n){return void 0===n&&(n="id"),i.findIndex((function(i){return i[n]===e}))},Q=function(i,e,n){return Math.round(function(i,e,n){return Number((i*(n/e)).toFixed(0))}(i,e,n))},Z=function(i){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var t={};return e.forEach((function(e){t[e]=i[e]})),t},$=function(i){return i===r},ii=function(i){return"".concat("resizer","-").concat(i)},ei=function(i){return Object.keys(i).forEach((function(e){void 0===i[e]&&delete i[e]})),i},ni=function(i){return e([],i,!0).reverse()},ti=function(i){return i.filter((function(i){return i}))},ri=function(i){return e([],i,!0).sort((function(i,e){return i>e?-1:e>i?1:0}))},oi=function(i,e,n,t){var r;this.sizeState=d,this.storedSize=0,this.axisSize=0,this.oldVisibleSize=0,this.oldVisibility=!0,this.props=x(i,e);var o=this.props,a=o.id,s=o.minSize,c=o.size,f=o.maxSize,l=o.resizerSize,v=o.detectionRadius,z=e.visibility,S=e.vertical,h=e.minMaxUnit,p=e.unit;this.minMaxUnit=null!=h?h:p,p!==u&&y(c,s,f,a);var m=null===(r=z[a])||void 0===r||r;this.defaultVisibility=m;var g=n.getStoredPane(a);if(g){var b=g.size,M=g.defaultMaxSize,w=g.defaultMinSize,E=g.defaultSize,R=g.visibility,C=g.storedSize;J(this,b,w,M,E,C,R)}else J(this,c,s,f,c,c,m);this.id=a,this.vertical=S,V(this),this.isHandle=t,t&&(this.id=ii(a),this.resizerSize=l,this.detectionRadius=v)},ai=function(){function i(){this.isSetRatioMode=!1,this.newVisibilityModel=!1,this.isViewSizeChanged=!1}return i.prototype.register=function(i){Object.assign(this,i)},i}(),ui=function(i){i.forEach(U)},si=function(i){return i.filter((function(i){return i.visibility}))};function ci(i,e,n,t){void 0===n&&(n=0),void 0===t&&(t=i.length-1);for(var r=0,o=n;o<=t;o++)r+=e(i[o]);return r}var fi=function(i,e,n){return ci(i,j,e,n)},li=function(i,e,n){return ci(i,A,e,n)},vi=function(i,e,n){return ci(i,B,e,n)},di=function(i,e,n,t){for(var r=i.virtualOrderList,o=i.index,a=0;a<r.length;a++)a<=o?e(r[a],t):n(r[a],t)},zi=function(i,e,n){var t=i.size+(n===o?e:-e);K(i,t)},Si=function(i,e,n){for(var t,r=0,o=i.length;e>1;)i[t=r%o].visibility&&(zi(i[t],1,n),--e),++r;for(;;){if(i[t=r%o].visibility)return void zi(i[t],e,n);++r}},hi=function(i,e){var n,t=e.axisCoordinate,r=e.decreasingItems,u=e.increasingItems,s=e.direction,c=r,f=u;if($(s)?(n=t-i,c=ni(r)):(n=i-t,f=ni(u)),n<0);else if(0===n)return;var l=n;c.forEach((function(i){n=M(i,n,a)})),l-=n,f.forEach((function(i){l=M(i,l,o)}))},pi=function(i){var n,t=i.items,r=i.direction,o=i.handleId,a=si(t),u=G(a,o),s=[],c=[],f=function(i,e){var n=a[i];n.size?(c[i]=n,c[i+e]=a[i+e]):(c[i]=a[i+e],c[i+e]=n)};if($(r)){for(var l=u-1;l>-1;l-=2)s.push(a[l],a[l-1]);for(s.reverse(),c=[a[u]],l=u+1;l<a.length;l+=2)f(l,1);n=e(e([],s,!0),c,!0)}else{for(c=[a[0]],l=u-1;l>0;l-=2)f(l,-1);for(c.push(a[u]),l=u+1;l<a.length;l+=2)s.push(a[l],a[l+1]);n=e(e([],c,!0),s,!0)}i.virtualOrderList=ti(n),i.increasingItems=ti(c),i.decreasingItems=ti(s),i.index=G(i.virtualOrderList,o)},mi=function(i){var e=xi(i).containerSize,n=i.virtualOrderList,t=i.index,r=t+1,o=D(n[t]),a=P(n[r]);gi(n,o-a,t,r,0,e);var u=D(n[r]),s=P(n[t]);yi(n,s-u,t,r,0,e)},gi=function(i,e,n,t,r,o){var a,u=i.length-1,s=n,c=t,f=i[n],l=i[t],v=function(){r+=k(f)},d=function(){r+=L(l)};switch(!0){case n>0&&t<u:switch(!0){case e<0:v(),a=D(i[s=n-1])+e;break;case 0===e:v(),d(),c=t+1,a=D(i[s=n-1])-P(i[c]);break;case e>0:d(),a=e-P(i[c=t+1])}break;case 0===n&&t<u:switch(!0){case e<0:return v(),r+=fi(i,t+1,u),void(l.maxSize=o-r);case 0===e:return v(),d(),void fi(i,t+1,u);case e>0:d(),a=e-P(i[c=t+1])}break;case n>0&&t===u:switch(!0){case e<0:v(),a=D(i[s=n-1])+e;break;case 0===e:return v(),d(),void li(i,0,n-1);case e>0:return d(),r+=li(i,0,n-1),void(f.minSize=o-r)}break;case 0===n&&t===u:switch(!0){case e<0:return v(),void(l.maxSize=o-r);case 0===e:return v(),void d();case e>0:return d(),void(f.minSize=o-r)}}gi(i,a,s,c,r,o)},yi=function(i,e,n,t,r,o){var a,u=i.length-1,s=n,c=t,f=i[n],l=i[t],v=function(){r+=L(f)},d=function(){r+=k(l)};switch(!0){case n>0&&t<u:switch(!0){case e<0:v(),a=P(i[s=n-1])+e;break;case 0===e:v(),d(),c=t+1,a=P(i[s=n-1])-D(i[c]);break;case e>0:d(),a=e-D(i[c=t+1])}break;case 0===n&&t<u:switch(!0){case e<0:return v(),r+=li(i,t+1,u),void(l.minSize=o-r);case 0===e:return v(),d(),void li(i,t+1,u);case e>0:d(),a=e-D(i[c=t+1])}break;case n>0&&t===u:switch(!0){case e<0:v(),a=P(i[s=n-1])+e;break;case 0===e:return v(),d(),void fi(i,0,n-1);case e>0:return d(),r+=fi(i,0,n-1),void(f.maxSize=o-r)}break;case 0===n&&t===u:switch(!0){case e<0:return v(),void(l.minSize=o-r);case 0===e:return d(),void v();case e>0:return d(),void(f.maxSize=o-r)}}yi(i,a,s,c,r,o)},xi=function(i){var e=i.getContainerRect,n=i.vertical,t=i.resizersList,r=e(),o=r.top,a=r.height,u=r.left,s=r.width,c=n?u:o,f=Math.round(n?s:a);return{containerSize:f,maxTopAxis:c,maxPaneSize:f-vi(t)}},bi=function(i,e){void 0===e&&(e=!1);var n=i.panesList,t=i.items,r=xi(i).maxPaneSize,s=function(i){return ci(i,F)}(n);if(!(s<0)){n.forEach((function(i){!function(i){i.size=i.sizeRatio,i.defaultMinSize=i.minSizeRatio,i.defaultMaxSize=i.maxSizeRatio}(i),function(i,e,n,t){var r,o,a=i.props,s=a.minSize,c=a.size,f=a.maxSize,l=t?[i.minSizeRatio,i.size,i.maxSizeRatio]:[s,c,f],v=l[0],d=l[2],z=Q(e,n,l[1]);i.minMaxUnit!==u?(r=i.defaultMinSize,o=i.defaultMaxSize):(r=Q(e,n,v),o=Q(e,n,d)),t||(i.minMaxUnit!==u?y(z,r,o,i.id):y(c,s,f,i.id)),J(i,z,r,o,z,z,i.visibility)}(i,r,s,e)}));var c=vi(n),f=r-c,l=f<0?a:o;Si(n,Math.abs(f),l),ui(t)}},Mi=function(i){var e=i.items;return xi(i).containerSize-vi(e)},wi=function(i,e){var n=i.panesList;e!==u&&n.forEach(V),e!==c&&(i.newVisibilityModel=!1),e!==s&&(i.setSizeKey=null)},Ei=function(i){return"".concat(i,"px")},Ri=function(i){return i?"width":"height"},Ci=function(i,e,n){var t;return function(i){return Object.keys(i).map((function(e){return i[e]?e:""})).join(" ")}(((t={flex:!0,"f-row w-fit-content h-100p":i,"f-column":!i,"w-100p h-100p":n===u})[e]=e,t))},Vi=function(i,e,n){return i.preventDefault(),function(i){return i.type.startsWith("touch")}(i)?function(i,e,n){var t,r=i.targetTouches[0],o=null!==(t=n.current)&&void 0!==t?t:{},a=o.pageX,u=void 0===a?0:a,s=o.pageY,c=void 0===s?0:s;return n.current=r,e?[r.clientX,r.pageX-u]:[r.clientY,r.pageY-c]}(i,e,n):function(i,e){var n=i.clientX,t=i.clientY,r=i.movementX,o=i.movementY;return e?[n,r]:[t,o]}(i,e)},Oi=function(i){return i<0?r:n},Ii=function(i,e){return function(n){i.style[Ri(e)]=Ei(n)}},Li=function(i,e){return function(n){i.style[function(i){return i?"minWidth":"minHeight"}(e)]=Ei(n)}},ki=function(i,e){for(var n=[],t=2;t<arguments.length;t++)n[t-2]=arguments[t];n.forEach((function(n){return i.addEventListener(n,e)}))},ji=function(i,e,n){i.addEventListener(n,e,{passive:!1})},Ai=function(i,e){for(var n=[],t=2;t<arguments.length;t++)n[t-2]=arguments[t];n.forEach((function(n){return i.removeEventListener(n,e)}))},Di=function(i,e,n){var t={panes:n.panesList.map(Y)};e&&e.setItem(i,JSON.stringify(t))},Pi=function(){function i(i,e,n){this.store=null,this.empty=!1,this.panesComponents=n,this.getStorage(i,e)}return i.prototype.getStorage=function(i,e){var n,t=this,r=this.store;if(r)return r;if(e){n=e.getItem(i);var o=JSON.parse(n,(function(i,e){return"defaultMaxSize"===i?Number(e):e}));if("[object Object]"===toString.call(o)){var a=o.panes;if(a){if(a.every((function(i,e){var n;return(null===(n=t.panesComponents[e])||void 0===n?void 0:n.props.id)===i.id}))&&a.length===this.panesComponents.length)return this.store=o,o;e.removeItem(i)}else e.removeItem(i)}}this.empty=!0,this.store={panes:[]}},i.prototype.getStoredPane=function(i){var e,n=this.store.panes;return null!==(e=_(n,i))&&void 0!==e?e:null},i}(),Hi=function(i,e,n){var t=e-vi(i);if(0!==t&&0!==n.length){var r=t>0?o:a,u=Math.abs(t);if(u<=n.length)Si(n,u,r);else{var s=vi(n),c=[];n.forEach((function(i){var e=B(i),n=function(i,e,n){var t=i.size+(n===o?e:-e);return I(i),b(i,t)===t}(i,Math.round(u*(e/s)),r);n&&c.push(i)})),Hi(i,e,c)}}},Ni=function(i,n,t,r){var u,s,c=function(){var n,t=e(e([],u,!0),s,!0),r=a;i<0&&(i=Math.abs(i),r=o),t.forEach((n=r,function(e){T(e),I(e),i=M(e,i,n)}))};"1"===n?(u=t.slice(r+2),s=t.slice(0,r-1).reverse(),c()):"2"===n&&(u=t.slice(0,r-1).reverse(),s=t.slice(r+2),c())},Ti=function(i,n,t,r,o){void 0===r&&(r=u),void 0===o&&(o=!1);var a=i.panesList,s=i.items,c=si(a),f=si(s),l=G(c,n);if(!(-1===l||t<0)){var v="".concat(n,"-").concat(r);i.setSizeKey===v?a.forEach(C):(a.forEach(R),i.setSizeKey=v);var d=vi(c),z=c[l];I(z);var S=z.size,h=b(z,t),p=h-S;if(p){var m=G(f,n);if(r===u){var g=e([],c,!0);g.splice(l,1);var y=d-z.size;Hi(g,y,g)}if(Ni(p,r,f,m),!o){var x=Mi(i);Ti(i,n,h+x,r,!0)}}}};var Ui=function(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}((function(i,e){let n,t=0;return function(...r){clearTimeout(n);const o=Date.now(),a=e-(o-t);a<=0?(t=o,i.apply(this,r)):n=setTimeout((()=>{t=Date.now(),i.apply(this,r)}),a)}})),Xi=function(e){var o=e.vertical,a=e.children,d=e.unit,z=e.uniqueId,S=e.storageApi,h=e.onResizeStop,p=e.onChangeVisibility,m=e.onResize,g=function(i){return Array.isArray(i)?i:[i]}(a),y=new Pi(z,S,g),x=function(i,e,n){var t=[];return i.forEach((function(i){return t.push(new oi(i.props,e,n,!1),new oi(i.props,e,n,!0))})),t.pop(),t}(g,e,y),b=function(i){return[i.filter((function(i){return!i.isHandle})),i.filter((function(i){return i.isHandle}))]}(x),M=b[0],R=b[1],C=new ai;C.register({vertical:o,items:x,panesList:M,resizersList:R});var V=function(){return function(i){return i.forEach(T)}(x)},I=function(){var i=k();h(i),Di(z,S,C),function(i){for(var e=i.vertical,n=i.items,t=(0,i.getContainerRect)(),r=t.left,o=t.top,a=e?r:o,u=si(n),s=[],c=0;c<u.length-1;c+=2){var f=u[c];if(!f.isHandle){var l=u[c+1],v=l.defaultSize,d=l.id,z=l.detectionRadius,S=B(f),h=a+S-z,p=a+S+v+z;a+=S+v,s.push([h,p,d])}}i.detectionDetails=s}(C)},L=function(){var i=j();p(i)},k=function(){return q(M,f)},j=function(){return q(M,c)},A=function(i){R.forEach((function(e){e.api.setMouseDownFlag(C.handleId,i)}))};C.onMouseDown=function(i,e){var n=i[0];C.register({handleId:e,direction:t,axisCoordinate:n}),A(!0),V()};var D=function(i){void 0===i&&(i=""),wi(C,i),function(i){i.forEach(X)}(M)};C.onMoveResize=function(i){var e,n=i[0],t=i[1];!C.isViewSizeChanged&&t&&(P(n,t),Y(n)&&hi(n,C),ui(x),D(),e=k(),m(e))};var P=function(i,e){var n=C.direction,t=Oi(e);t!==n&&(C.direction=t,U(i))},U=function(i){C.axisCoordinate=i,pi(C),V(),mi(C),function(i){var e=i.items,n=i.index,t=xi(i).maxTopAxis,r=si(e);i.bottomAxis=t+ci(r,(function(i){return i.maxSize}),0,n-1),i.topAxis=t+function(i,e,n){return ci(i,(function(i){return i.minSize}),0,n)}(r,0,n-1)}(C)},Y=function(i){var e=C.topAxis,t=C.bottomAxis;return i<=e?(di(C,H,N,r),V(),C.axisCoordinate=e,!1):!(i>=t&&(di(C,N,H,n),V(),C.axisCoordinate=t,1))},F=function(e){var n=C.newVisibilityModel,t=q(M,c),r=i(i({},t),e);n||(C.newVisibilityModel=!0,M.forEach(E)),function(i,e){for(var n,t=i.panesList,r=i.items,o=-1,a=0;a<r.length;a+=2){var u=r[a];(n=u).size=n.oldVisibleSize,n.visibility=n.oldVisibility;var s=u.id;w(u,e[s]),w(r[a+1],!1),u.visibility&&(-1!==o&&w(r[a-1],!0),o=a)}var c=si(t);0===vi(c)&&c.forEach((function(i){i.size=1}));var f=xi(i).maxPaneSize;Hi(c,f,c)}(C,r);var o=Mi(C);C.isViewSizeChanged=!!o,ui(x),I(),L(),D(c)};C.onMouseUp=function(){I(),A(!1)};var K=function(){ui(x),I(),D(s)},W={restore:function(){!function(i){i.forEach(O),ui(i)}(C.items),D(),I(),L(),C.isViewSizeChanged=!1},setVisibilities:F,getSizes:k,getVisibilities:function(){return j()},getState:function(){return q(M,f,c,l,v)},setSize:function(i,e,n){Ti(C,i,e,n),K()},setSizeRatio:function(i,e,n){var t=xi(C).containerSize;Ti(C,i,t*e,n),K()}};return C.register({api:W,registerItem:function(i,e){!function(i,e){if(i.api=e,i.isHandle){var n=i.resizerSize;e.setSize(n),J(i,n,n,n,n,n,i.visibility)}}(_(x,e),i)},registerContainer:function(i){C.getContainerRect=function(){return i.getBoundingClientRect()};var n=e.visibility;if(y.empty&&d===u&&!C.isSetRatioMode)bi(C),C.isSetRatioMode=!0;else{var t=y.getStorage(z,S).panes;n=q(t,c)}F(n)},vertical:o,props:e,getPaneSizeStyle:function(i){var e=B(_(M,i));return function(i,e){var n;return(n={})[Ri(i)]=Ei(e),n}(o,e)}}),C},Yi=function(){return Yi=Object.assign||function(i){for(var e,n=1,t=arguments.length;n<t;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(i[r]=e[r]);return i},Yi.apply(this,arguments)};"function"==typeof SuppressedError&&SuppressedError;var Bi=function(i,e){e.split(" ").forEach((function(e){return e&&i.classList.add(e)}))},Fi=function(i,e){e.split(" ").forEach((function(e){return e&&i.classList.remove(e)}))},Ki=function(i,e,n,t){return void 0===n&&(n=""),void 0===t&&(t=""),function(r,o){r===e&&(o?(Bi(i,n),Fi(i,t)):(Bi(i,t),Fi(i,n)))}};module.exports=function(i){var e=function(i){var e=i.panes.map((function(i){return{props:i}}));return Yi({onResize:W,onResizeStop:W,onReady:W,onChangeVisibility:W,vertical:!1,unit:u,resizerSize:2,detectionRadius:6,visibility:{},children:e},i)}(i),n=Xi(e),t=n.registerItem,r=n.registerContainer,o=n.api;e.panes.forEach((function(i,n){var r=i.id,o=document.getElementById(r);t({setSize:Ii(o,!0)},r),Bi(o,"overflow-hidden flex-shrink-0");var a=ii(r),u=document.getElementById(a);n!==e.panes.length-1&&t({setSize:Li(u,!0),setMouseDownFlag:Ki(u,a,"",e.activeResizerClass)},a)}));var a=Ci(e.vertical,"",e.unit),s=function(i){var e=i.vertical,n=e?"col-resize":"row-resize",t=function(i,e){return function(n){var t=Vi(n,e,i.previousTouchEvent);i.onMoveResize(t)}}(i,e),r=function(){i.onMouseUp(),Ai(document,t,S,p)},o=function(i,e,n){return function(t){var r=i.detectionDetails,o=Vi(t,e,{})[0],a=r.map((function(i){var e=i[0],n=i[1];return Math.abs((e+n)/2-o)})),u=ri(a).pop(),s=r[a.indexOf(u)],c=s[0],f=s[1],l=s[2];if(u<=(f-c)/2){i.previousTouchEvent=t;var v=Vi(t,e,{});i.onMouseDown(v,l),n()}}}(i,e,(function(){ki(document,t,S),ji(document,t,p)}));return[function(t){var a=Ui(function(i,e,n,t){return function(r){var o=e.detectionDetails,a=n?r.clientX:r.clientY;i.style.cursor="auto",o.forEach((function(e){var n=e[0],r=e[1];a>=n&&a<=r&&(i.style.cursor=t)}))}}(t,i,e,n),100);ji(t,a,S),ji(t,a,p),ki(t,o,h),ji(t,o,g),ki(document,r,z,m)},function(){Ai(document,r,z,m)}]}(n),c=s[0],f=s[1],l=document.getElementById(e.id);return Bi(l,a),r(l),c(l),[o,c,f]};
//# sourceMappingURL=index.cjs.js.map

@@ -1,1 +0,2 @@

import e,{createContext as i,useRef as n,useCallback as t,useContext as r,useState as o,isValidElement as a,cloneElement as u,Fragment as s,useEffect as c}from"react";var f=-1,l=0,d=1,v=1,z=2,h="ratio",S="setSize",m="1",p="2",g="visibility",x="size",y="defaultMinSize",b="defaultMaxSize",M="resize",w="onNormalSize",E="mouseup",R="mousemove",C="mousedown",O="touchmove",V="touchend",k="touchStartCapture",I=function(e){return"".concat(e,"px")},L=function(e){return e?"width":"height"},N=function(e){return Object.keys(e).map((function(i){return e[i]?i:""})).join(" ")},A=function(e,i,n){return e.preventDefault(),e.type.startsWith("touch")?function(e,i,n){var t,r=e.targetTouches[0],o=null!==(t=n.current)&&void 0!==t?t:{},a=o.pageX,u=void 0===a?0:a,s=o.pageY,c=void 0===s?0:s;return n.current=r,i?[r.clientX,r.pageX-u]:[r.clientY,r.pageY-c]}(e,i,n):function(e,i){var n=e.clientX,t=e.clientY,r=e.movementX,o=e.movementY;return i?[n,r]:[t,o]}(e,i)},D=function(e,i){for(var n=[],t=2;t<arguments.length;t++)n[t-2]=arguments[t];n.forEach((function(n){return e.addEventListener(n,i)}))},H=function(e,i){for(var n=[],t=2;t<arguments.length;t++)n[t-2]=arguments[t];n.forEach((function(n){return e.removeEventListener(n,i)}))},P=function(){return P=Object.assign||function(e){for(var i,n=1,t=arguments.length;n<t;n++)for(var r in i=arguments[n])Object.prototype.hasOwnProperty.call(i,r)&&(e[r]=i[r]);return e},P.apply(this,arguments)};function T(e,i,n){if(n||2===arguments.length)for(var t,r=0,o=i.length;r<o;r++)!t&&r in i||(t||(t=Array.prototype.slice.call(i,0,r)),t[r]=i[r]);return e.concat(t||Array.prototype.slice.call(i))}"function"==typeof SuppressedError&&SuppressedError;var j=function(e,i,n,t){if(e<i)throw new Error("Size(".concat(e,") can not be smaller than minSize(").concat(i,") for pane id ").concat(t));if(e>n)throw new Error("Size(".concat(e,") can not be greatter than maxSize(").concat(n,") for pane id ").concat(t))},X=function(e,i){var n=e.minSize,t=e.maxSize,r=e.minSize;return i>=n&&i<=t?r=i:i>t&&(r=t),e.size=r,r},Y=function(e,i,n){var t=e.axisSize+(n===v?i:-i),r=X(e,t);return Math.abs(r-t)},U=function(e,i,n){void 0===n&&(n=!1),e&&(e.visibility=i,i?(e.maxSize=e.defaultMaxSize,e.minSize=e.defaultMinSize,function(e,i){e.isHandle&&(e.size=i?0:e.resizerSize)}(e,n)):(e.maxSize=0,e.minSize=0),e.api&&e.api.destroy&&e.api.destroy(i))},B=function(e){e.oldVisibleSize=e.size,e.oldVisibility=e.visibility},F=function(e){e.initialSetSize=e.size},K=function(e){e.size=e.initialSetSize},q=function(e){e.sizeRatio=e.size,e.minSizeRatio=e.defaultMinSize,e.maxSizeRatio=e.defaultMaxSize},J=function(e){e.size=e.defaultSize,W(e),U(e,e.defaultVisibility)},W=function(e){e.minSize=e.defaultMinSize,e.maxSize=e.defaultMaxSize},_=function(e){return e.maxSize=e.defaultMaxSize,e.maxSize},G=function(e){return e.minSize=e.defaultMinSize,e.minSize},Q=function(e){return e.maxSize=e.size,e.size},Z=function(e){return e.minSize=e.size,e.size},$=function(e){return e.size-e.defaultMinSize},ee=function(e){return e.defaultMaxSize-e.size},ie=function(e){e.size=e.minSize},ne=function(e){e.size=e.maxSize},te=function(e){e.axisSize=e.size},re=function(e){e.api.setSize(ue(e))},oe=function(e){if(e.visibility&&!e.isHandle){var i=e.size,n=e.id,t=void 0;t=i===e.defaultMaxSize?"onMaxSize":i===e.defaultMinSize?"onMinSize":w,e.sizeState!==t&&(e.props[t](n,i),e.sizeState=t)}},ae=function(e){var i,n=Se(e,"id",x,"defaultSize",y,g,"storedSize");return P(P({},n),((i={})[b]=e[b].toString(),i))},ue=function(e){return e.visibility?e.size:0},se=function(e){return e.visibility?e.sizeRatio:0},ce=function(e,i){e.size=i,e.storedSize=i},fe=function(e,i,n,t,r,o,a){ce(e,i),e.defaultSize=r,e.minSize=n,e.maxSize=t,e.defaultMinSize=n,e.defaultMaxSize=t,e.storedSize=o,e.visibility=a},le=function(e){return e},de=function(e,i){return e.find((function(e){return e.id===i}))},ve=function(e){for(var i=[],n=1;n<arguments.length;n++)i[n-1]=arguments[n];var t={};return e.forEach((function(e){var n=function(i){return i===x?ue(e):e[i]},r=e.id;1===i.length?t[r]=n(i[0]):t[r]=i.reduce((function(e,i){return e[i]=n(i),e}),{})})),t},ze=function(e,i,n){return void 0===n&&(n="id"),e.findIndex((function(e){return e[n]===i}))},he=function(e,i,n){return Math.round(function(e,i,n){return Number((e*(n/i)).toFixed(0))}(e,i,n))},Se=function(e){for(var i=[],n=1;n<arguments.length;n++)i[n-1]=arguments[n];var t={};return i.forEach((function(i){t[i]=e[i]})),t},me=function(e){return e===d},pe=function(e){return"".concat("resizer","-").concat(e)},ge=function(e){return Object.keys(e).forEach((function(i){void 0===e[i]&&delete e[i]})),e},xe=function(e){return T([],e,!0).reverse()},ye=function(e){return e.filter((function(e){return e}))},be=function(e,i,n,t){var r;this.sizeState=w,this.storedSize=0,this.axisSize=0,this.oldVisibleSize=0,this.oldVisibility=!0,this.props=function(e,i){var n=ge(P({},e)),t=i.onMinSize,r=void 0===t?le:t,o=i.onMaxSize,a=void 0===o?le:o,u=i.onNormalSize,s=void 0===u?le:u,c=i.resizerClass,f=i.activeResizerClass,l=i.resizerSize,d=i.detectionRadius;return P({onMinSize:r,onMaxSize:a,onNormalSize:s,resizerSize:l,resizerClass:c,detectionRadius:d,activeResizerClass:f,minSize:0,maxSize:1/0},n)}(e,i);var o=this.props,a=o.id,u=o.minSize,s=o.size,c=o.maxSize,f=o.resizerSize,l=o.detectionRadius,d=i.visibility,v=i.vertical,z=i.minMaxUnit,S=i.unit;this.minMaxUnit=null!=z?z:S,S!==h&&j(s,u,c,a);var m=null===(r=d[a])||void 0===r||r;this.defaultVisibility=m;var p=n.getStoredPane(a);if(p){var g=p.size,x=p.defaultMaxSize,y=p.defaultMinSize,b=p.defaultSize,M=p.visibility,E=p.storedSize;fe(this,g,y,x,b,E,M)}else fe(this,s,u,c,s,s,m);this.id=a,this.vertical=v,q(this),this.isHandle=t,t&&(this.id=pe(a),this.resizerSize=f,this.detectionRadius=l)},Me=function(){function e(){this.isSetRatioMode=!1,this.newVisibilityModel=!1,this.isViewSizeChanged=!1}return e.prototype.register=function(e){Object.assign(this,e)},e}(),we=function(e){e.forEach(re)},Ee=function(e){return e.filter((function(e){return e.visibility}))};function Re(e,i,n,t){void 0===n&&(n=0),void 0===t&&(t=e.length-1);for(var r=0,o=n;o<=t;o++)r+=i(e[o]);return r}var Ce=function(e,i,n){return Re(e,Q,i,n)},Oe=function(e,i,n){return Re(e,Z,i,n)},Ve=function(e,i,n){return Re(e,ue,i,n)},ke=function(e,i,n,t){for(var r=e.virtualOrderList,o=e.index,a=0;a<r.length;a++)a<=o?i(r[a],t):n(r[a],t)},Ie=function(e,i,n){var t=e.size+(n===v?i:-i);ce(e,t)},Le=function(e,i,n){for(var t,r=0,o=e.length;i>1;)e[t=r%o].visibility&&(Ie(e[t],1,n),--i),++r;for(;;){if(e[t=r%o].visibility)return void Ie(e[t],i,n);++r}},Ne=function(e){var i=e.items,n=e.index,t=He(e).maxTopAxis,r=Ee(i);e.bottomAxis=t+Re(r,(function(e){return e.maxSize}),0,n-1),e.topAxis=t+function(e,i,n){return Re(e,(function(e){return e.minSize}),i,n)}(r,0,n-1)},Ae=function(e,i,n,t,r,o){var a,u=e.length-1,s=n,c=t,f=e[n],l=e[t],d=function(){r+=G(f)},v=function(){r+=_(l)};switch(!0){case n>0&&t<u:switch(!0){case i<0:d(),a=$(e[s=n-1])+i;break;case 0===i:d(),v(),c=t+1,a=$(e[s=n-1])-ee(e[c]);break;case i>0:v(),a=i-ee(e[c=t+1])}break;case 0===n&&t<u:switch(!0){case i<0:return d(),r+=Ce(e,t+1,u),void(l.maxSize=o-r);case 0===i:return d(),v(),void Ce(e,t+1,u);case i>0:v(),a=i-ee(e[c=t+1])}break;case n>0&&t===u:switch(!0){case i<0:d(),a=$(e[s=n-1])+i;break;case 0===i:return d(),v(),void Oe(e,0,n-1);case i>0:return v(),r+=Oe(e,0,n-1),void(f.minSize=o-r)}break;case 0===n&&t===u:switch(!0){case i<0:return d(),void(l.maxSize=o-r);case 0===i:return d(),void v();case i>0:return v(),void(f.minSize=o-r)}}Ae(e,a,s,c,r,o)},De=function(e,i,n,t,r,o){var a,u=e.length-1,s=n,c=t,f=e[n],l=e[t],d=function(){r+=_(f)},v=function(){r+=G(l)};switch(!0){case n>0&&t<u:switch(!0){case i<0:d(),a=ee(e[s=n-1])+i;break;case 0===i:d(),v(),c=t+1,a=ee(e[s=n-1])-$(e[c]);break;case i>0:v(),a=i-$(e[c=t+1])}break;case 0===n&&t<u:switch(!0){case i<0:return d(),r+=Oe(e,t+1,u),void(l.minSize=o-r);case 0===i:return d(),v(),void Oe(e,t+1,u);case i>0:v(),a=i-$(e[c=t+1])}break;case n>0&&t===u:switch(!0){case i<0:d(),a=ee(e[s=n-1])+i;break;case 0===i:return d(),v(),void Ce(e,0,n-1);case i>0:return v(),r+=Ce(e,0,n-1),void(f.maxSize=o-r)}break;case 0===n&&t===u:switch(!0){case i<0:return d(),void(l.minSize=o-r);case 0===i:return v(),void d();case i>0:return v(),void(f.maxSize=o-r)}}De(e,a,s,c,r,o)},He=function(e){var i=e.getContainerRect,n=e.vertical,t=e.resizersList,r=i(),o=r.top,a=r.height,u=r.left,s=r.width,c=n?u:o,f=Math.round(n?s:a);return{containerSize:f,maxTopAxis:c,maxPaneSize:f-Ve(t)}},Pe=function(e,i){void 0===i&&(i=!1);var n=e.panesList,t=e.items,r=He(e).maxPaneSize,o=function(e){return Re(e,se)}(n);if(!(o<0)){n.forEach((function(e){!function(e){e.size=e.sizeRatio,e.defaultMinSize=e.minSizeRatio,e.defaultMaxSize=e.maxSizeRatio}(e),function(e,i,n,t){var r,o,a=e.props,u=a.minSize,s=a.size,c=a.maxSize,f=t?[e.minSizeRatio,e.size,e.maxSizeRatio]:[u,s,c],l=f[0],d=f[2],v=he(i,n,f[1]);e.minMaxUnit!==h?(r=e.defaultMinSize,o=e.defaultMaxSize):(r=he(i,n,l),o=he(i,n,d)),t||(e.minMaxUnit!==h?j(v,r,o,e.id):j(s,u,c,e.id)),fe(e,v,r,o,v,v,e.visibility)}(e,r,o,i)}));var a=Ve(n),u=r-a,s=u<0?z:v;Le(n,Math.abs(u),s),we(t)}},Te=function(e){var i=e.items;return He(e).containerSize-Ve(i)},je=function(){function e(e,i,n){this.store=null,this.empty=!1,this.panesComponents=n,this.getStorage(e,i)}return e.prototype.getStorage=function(e,i){var n,t=this,r=this.store;if(r)return r;if(i){n=i.getItem(e);var o=JSON.parse(n,(function(e,i){return"defaultMaxSize"===e?Number(i):i}));if("[object Object]"===toString.call(o)){var a=o.panes;if(a){if(a.every((function(e,i){var n;return(null===(n=t.panesComponents[i])||void 0===n?void 0:n.props.id)===e.id}))&&a.length===this.panesComponents.length)return this.store=o,o;i.removeItem(e)}else i.removeItem(e)}}this.empty=!0,this.store={panes:[]}},e.prototype.getStoredPane=function(e){var i,n=this.store.panes;return null!==(i=de(n,e))&&void 0!==i?i:null},e}(),Xe=function(e,i,n){var t=i-Ve(e);if(0!==t&&0!==n.length){var r=t>0?v:z,o=Math.abs(t);if(o<=n.length)Le(n,o,r);else{var a=Ve(n),u=[];n.forEach((function(e){var i=ue(e),n=function(e,i,n){var t=e.size+(n===v?i:-i);return W(e),X(e,t)===t}(e,Math.round(o*(i/a)),r);n&&u.push(e)})),Xe(e,i,u)}}},Ye=function(e,i,n,t){var r,o,a=function(){var i,n=T(T([],r,!0),o,!0),t=z;e<0&&(e=Math.abs(e),t=v),n.forEach((i=t,function(n){te(n),W(n),e=Y(n,e,i)}))};"1"===i?(r=n.slice(t+2),o=n.slice(0,t-1).reverse(),a()):"2"===i&&(r=n.slice(0,t-1).reverse(),o=n.slice(t+2),a())},Ue=function(e,i,n,t,r){void 0===t&&(t=h),void 0===r&&(r=!1);var o=e.panesList,a=e.items,u=Ee(o),s=Ee(a),c=ze(u,i);if(!(-1===c||n<0)){var f="".concat(i,"-").concat(t);e.setSizeKey===f?o.forEach(K):(o.forEach(F),e.setSizeKey=f);var l=Ve(u),d=u[c];W(d);var v=d.size,z=X(d,n)-v;if(z){var S=ze(s,i);if(t===h){var m=T([],u,!0);m.splice(c,1);var p=l-d.size;Xe(m,p,m)}if(Ye(z,t,s,S),!r){var g=Te(e);Ue(e,i,n+g,t,!0)}}}};function Be(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Fe=Be((function(e,i){let n,t=0;return function(...r){clearTimeout(n);const o=Date.now(),a=i-(o-t);a<=0?(t=o,e.apply(this,r)):n=setTimeout((()=>{t=Date.now(),e.apply(this,r)}),a)}})),Ke=function(e){for(var i=e.vertical,n=e.items,t=(0,e.getContainerRect)(),r=t.left,o=t.top,a=i?r:o,u=Ee(n),s=[],c=0;c<u.length-1;c+=2){var f=u[c];if(!f.isHandle){var l=u[c+1],d=l.defaultSize,v=l.id,z=l.detectionRadius,h=ue(f),S=a+h-z,m=a+h+d+z;a+=h+d,s.push([S,m,v])}}e.detectionDetails=s},qe=function(e,i,n){return function(t){var r=e.detectionDetails,o=i?t.clientX:t.clientY,a=r.map((function(e){var i=e[0],n=e[1];return Math.abs((i+n)/2-o)})),u=T([],a,!0).sort((function(e,i){return e>i?-1:i>e?1:0})).pop(),s=r[a.indexOf(u)],c=s[0],f=s[1],l=s[2];if(u<=(f-c)/2){e.previousTouchEvent=t;var d=A(t,i,{});e.onMouseDown(d,l),n()}}},Je=function(e,i){var n=i.vertical,t=Fe(function(e,i,n,t){return function(r){var o=i.detectionDetails,a=n?r.clientX:r.clientY;e.style.cursor="auto",o.forEach((function(i){var n=i[0],r=i[1];a>=n&&a<=r&&(e.style.cursor=t)}))}}(e,i,n,n?"col-resize":"row-resize"),100);D(e,t,R),document.addEventListener(O,t,{passive:!1});var r=function(e,i){return function(n){var t=A(n,i,e.previousTouchEvent);e.resizeOnMove(t)}}(i,n),o=qe(i,n,(function(){D(document,r,R),document.addEventListener(O,r,{passive:!1})}));D(e,o,C,k),D(document,(function(){i.onMouseUp(),H(document,r,R,O)}),E,V)},We=function(e){var i=e.vertical,n=e.children,t=e.unit,r=e.uniqueId,o=e.storageApi,a=e.onResizeStop,u=e.onChangeVisibility,s=e.onResize,c=function(e){return Array.isArray(e)?e:[e]}(n),m=new je(r,o,c),p=function(e,i,n){var t=[];return e.forEach((function(e){return t.push(new be(e.props,i,n,!1),new be(e.props,i,n,!0))})),t.pop(),t}(c,e,m),M=function(e){return[e.filter((function(e){return!e.isHandle})),e.filter((function(e){return e.isHandle}))]}(p),w=M[0],E=M[1],R=new Me;R.register({vertical:i,items:p,panesList:w,resizersList:E});var C=function(){return function(e){return e.forEach(te)}(p)},O=function(){var e=k();a(e),function(e,i,n){var t={panes:n.panesList.map(ae)};i&&i.setItem(e,JSON.stringify(t))}(r,o,R),Ke(R)},V=function(){var e=N();u(e)},k=function(){return ve(w,x)},N=function(){return ve(w,g)},A=function(e){E.forEach((function(i){i.api.setMouseDownFlag(R.handleId,e)}))};R.onMouseDown=function(e,i){var n=e[0];R.register({handleId:i,direction:l,axisCoordinate:n}),console.log(i,n),A(!0),C()};var D=function(e){void 0===e&&(e=""),function(e){e!==h&&w.forEach(q),e!==g&&(R.newVisibilityModel=!1),e!==S&&(R.setSizeKey=null)}(e),function(e){e.forEach(oe)}(w)};R.resizeOnMove=function(e){var i,n=e[0],t=e[1];!R.isViewSizeChanged&&t&&(H(n,t),X(n)&&function(e,i){var n,t=i.axisCoordinate,r=i.decreasingItems,o=i.increasingItems,a=i.direction,u=r,s=o;if(me(a)?(n=t-e,u=xe(r)):(n=e-t,s=xe(o)),n<0);else if(0===n)return;var c=n;u.forEach((function(e){n=Y(e,n,z)})),c-=n,s.forEach((function(e){c=Y(e,c,v)}))}(n,R),we(p),D(),i=k(),s(i))};var H=function(e,i){var n=R.direction,t=function(e){return e<0?d:f}(i);t!==n&&(R.direction=t,j(e))},j=function(e){R.axisCoordinate=e,function(e){var i,n=e.items,t=e.direction,r=e.handleId,o=Ee(n),a=ze(o,r),u=[],s=[],c=function(e,i){var n=o[e];n.size?(s[e]=n,s[e+i]=o[e+i]):(s[e]=o[e+i],s[e+i]=n)};if(me(t)){for(var f=a-1;f>-1;f-=2)u.push(o[f],o[f-1]);for(u.reverse(),s=[o[a]],f=a+1;f<o.length;f+=2)c(f,1);i=T(T([],u,!0),s,!0)}else{for(s=[o[0]],f=a-1;f>0;f-=2)c(f,-1);for(s.push(o[a]),f=a+1;f<o.length;f+=2)u.push(o[f],o[f+1]);i=T(T([],s,!0),u,!0)}e.virtualOrderList=ye(i),e.increasingItems=ye(s),e.decreasingItems=ye(u),e.index=ze(e.virtualOrderList,r)}(R),C(),function(e){var i=He(e).containerSize,n=e.virtualOrderList,t=e.index,r=t+1,o=$(n[t]),a=ee(n[r]);Ae(n,o-a,t,r,0,i);var u=$(n[r]),s=ee(n[t]);De(n,s-u,t,r,0,i)}(R),Ne(R)},X=function(e){var i=R.topAxis,n=R.bottomAxis;return e<=i?(ke(R,ie,ne,d),C(),R.axisCoordinate=i,!1):!(e>=n)||(ke(R,ne,ie,f),C(),R.axisCoordinate=n,!1)},F=function(e){var i=R.newVisibilityModel,n=ve(w,g),t=P(P({},n),e);i||(R.newVisibilityModel=!0,w.forEach(B)),function(e,i){for(var n,t=e.panesList,r=e.items,o=-1,a=0;a<r.length;a+=2){var u=r[a];(n=u).size=n.oldVisibleSize,n.visibility=n.oldVisibility;var s=u.id;U(u,i[s]),U(r[a+1],!1),u.visibility&&(-1!==o&&U(r[a-1],!0),o=a)}var c=Ee(t);0===Ve(c)&&c.forEach((function(e){e.size=1}));var f=He(e).maxPaneSize;Xe(c,f,c)}(R,t);var r=Te(R);R.isViewSizeChanged=!!r,we(p),O(),V(),D(g)};R.onMouseUp=function(){var e,i,n;O(),A(!1),e=R.items,i=0,n=e.map((function(e){return i+=ue(e),ue(e)})),console.log("consoleGetSize",n,i)};var K=function(){we(p),O(),D(S)},W={restore:function(){!function(e){e.forEach(J),we(e)}(R.items),D(),O(),V(),R.isViewSizeChanged=!1},setVisibilities:F,getSizes:k,getVisibilities:function(){return N()},getState:function(){return ve(w,x,g,y,b)},setSize:function(e,i,n){Ue(R,e,i,n),K()},setSizeRatio:function(e,i,n){var t=He(R).containerSize;Ue(R,e,t*i,n),K()}};return R.register({api:W,registerItem:function(e,i){!function(e,i){if(e.api=i,e.isHandle){var n=e.resizerSize;i.setSize(n),fe(e,n,n,n,n,n,e.visibility)}}(de(p,i),e)},registerContainer:function(i){R.getContainerRect=function(){return i.getBoundingClientRect()};var n=e.visibility;if(m.empty&&t===h&&!R.isSetRatioMode)Pe(R),R.isSetRatioMode=!0;else{var a=m.getStorage(r,o).panes;n=ve(a,g)}F(n),Je(i,R)},vertical:i,props:e,getPaneSizeStyle:function(e){var n=ue(de(w,e));return function(e,i){var n;return(n={})[L(e)]=I(i),n}(i,n)}}),R},_e=i({});function Ge(e,i){void 0===i&&(i=le);var r=n(null);return[t((function(n){r.current,n?e(n):i(r.current),r.current=n}),[])]}var Qe=function(i){var n,s,c=i.children,f=i.id,l=pe(f),d=r(_e),v=d.registerItem,z=d.panesList,h=d.vertical,S=ze(z,f),m=z[S].props,p=m.resizerClass,g=m.activeResizerClass,x=S<z.length-1,y=o(!1),b=y[0],M=y[1],w=t((function(e,i){l===e&&M(i)}),[l]),E=Ge((function(e){var i=function(e,i){return function(n){e.style[function(e){return e?"minWidth":"minHeight"}(i)]=I(n)}}(e,h);v({setSize:i,setMouseDownFlag:w},l)}))[0],R=N(((n={"overflow-hidden":!0})[g]=b,n[p]=!b,n));return a(c)&&(s=u(c,P(P({},c.props),{isMouseDown:b,id:"".concat(l)}))),x?e.createElement("div",{className:R,"data-cy":l,ref:E},s):null},Ze=function(i){var n,t=r(_e),a=o(!0),u=a[0],c=a[1],f=t.vertical,l=t.registerItem,d=t.getPaneSizeStyle,v=t.props,z=v.resizer,h=v.unmountOnHide,S=i.className,m=i.children,p=i.resizer,g=i.id,x=i.unmountOnHide,y=null!=x?x:h,b=Ge((function(e){var i=function(e,i){return function(n){e.style[L(i)]=I(n)}}(e,f);l({node:e,destroy:function(e){y&&c(e)},setSize:i},g)}))[0],M=N(((n={"overflow-hidden flex-shrink-0":!0})[S]=S,n)),w=d(g);return e.createElement(s,null,e.createElement("div",{className:M,"data-cy":g,key:g,ref:b,style:w},u&&m),e.createElement(Qe,{id:g},p||z))};!function(e,i){void 0===i&&(i={});var n=i.insertAt;if(e&&"undefined"!=typeof document){var t=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css","top"===n&&t.firstChild?t.insertBefore(r,t.firstChild):t.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}}("\r\n.flex{\r\n display: flex;\r\n}\r\n\r\n.f-column{\r\n flex-direction: column;\r\n}\r\n\r\n.f-row {\r\n flex-direction: row;\r\n}\r\n\r\n.w-fit-content{\r\n width: fit-content;\r\n}\r\n\r\n.m-auto {\r\n margin: auto;\r\n}\r\n\r\n.resizer {\r\n box-sizing: border-box;\r\n background-clip: padding-box;\r\n}\r\n\r\n/* .resizer-vertical {\r\n cursor: row-resize;\r\n} */\r\n\r\n/* .resizer-horizontal {\r\n cursor: col-resize;\r\n} */\r\n\r\n.overflow-hidden {\r\n overflow: hidden; \r\n}\r\n\r\n.w-100p{\r\n width: 100%\r\n}\r\n\r\n.h-100p{\r\n height: 100%;\r\n}\r\n\r\n.flex-shrink-0{\r\n flex-shrink: 0;\r\n}");var $e=function(i){var n=i.children,t=i.className,o=i.unit,a=i.vertical,u=i.uniqueId,s=r(_e).registerContainer,c=Ge((function(e){return s(e)}))[0],f=function(e,i,n){var t;return N(((t={flex:!0,"f-row w-fit-content h-100p":e,"f-column":!e,"w-100p h-100p":n===h})[i]=i,t))}(a,t,o);return e.createElement("div",{className:f,"data-cy":u,ref:c},n)},ei={},ii=function(i){var t,r=(t=ge(P({},i)),P({onResize:le,onResizeStop:le,onReady:le,onChangeVisibility:le,vertical:!1,unit:h,resizerSize:2,detectionRadius:6,visibility:ei,unmountOnHide:!0},t)),o=r.visibility,a=r.onReady,u=r.unit,s=n(We(r)),f=s.current,l=f.api;c((function(){var e=function(){u===h&&(Pe(f,!0),Ke(f))};return D(window,e,M),function(){return H(window,e,M)}}),[u,f]);var d=n(!0);return c((function(){a(l)}),[l]),c((function(){!1===d.current?s.current.api.setVisibilities(o):d.current=!1}),[o,d]),e.createElement(_e.Provider,{value:s.current},e.createElement($e,P({},r)))};export{m as BUTTOM_FIRST,Ze as Pane,h as RATIO,ii as ResizablePanes,p as TOP_FIRST};
var i=function(){return i=Object.assign||function(i){for(var e,n=1,t=arguments.length;n<t;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(i[r]=e[r]);return i},i.apply(this,arguments)};function e(i,e,n){if(n||2===arguments.length)for(var t,r=0,o=e.length;r<o;r++)!t&&r in e||(t||(t=Array.prototype.slice.call(e,0,r)),t[r]=e[r]);return i.concat(t||Array.prototype.slice.call(e))}"function"==typeof SuppressedError&&SuppressedError;var n=-1,t=0,r=1,o=1,a=2,u="ratio",s="setSize",c="visibility",f="size",l="defaultMinSize",v="defaultMaxSize",d="onNormalSize",z="mouseup",S="mousemove",h="mousedown",p="touchmove",m="touchend",g="touchstart",y=function(i,e,n,t){if(i<e)throw new Error("Size(".concat(i,") can not be smaller than minSize(").concat(e,") for pane id ").concat(t));if(i>n)throw new Error("Size(".concat(i,") can not be greatter than maxSize(").concat(n,") for pane id ").concat(t))},x=function(e,n){var t=ei(i({},e)),r=n.onMinSize,o=void 0===r?W:r,a=n.onMaxSize,u=void 0===a?W:a,s=n.onNormalSize,c=void 0===s?W:s,f=n.resizerClass,l=n.activeResizerClass,v=n.resizerSize,d=n.detectionRadius;return i({onMinSize:o,onMaxSize:u,onNormalSize:c,resizerSize:v,resizerClass:f,detectionRadius:d,activeResizerClass:l,minSize:0,maxSize:1/0},t)},b=function(i,e){var n=i.minSize,t=i.maxSize,r=i.minSize;return e>=n&&e<=t?r=e:e>t&&(r=t),i.size=r,r},M=function(i,e,n){var t=i.axisSize+(n===o?e:-e),r=b(i,t);return Math.abs(r-t)},w=function(i,e,n){void 0===n&&(n=!1),i&&(i.visibility=e,e?(i.maxSize=i.defaultMaxSize,i.minSize=i.defaultMinSize,function(i,e){i.isHandle&&(i.size=e?0:i.resizerSize)}(i,n)):(i.maxSize=0,i.minSize=0),i.api&&i.api.destroy&&i.api.destroy(e))},E=function(i){i.oldVisibleSize=i.size,i.oldVisibility=i.visibility},R=function(i){i.initialSetSize=i.size},C=function(i){i.size=i.initialSetSize},V=function(i){i.sizeRatio=i.size,i.minSizeRatio=i.defaultMinSize,i.maxSizeRatio=i.defaultMaxSize},O=function(i){i.size=i.defaultSize,I(i),w(i,i.defaultVisibility)},I=function(i){i.minSize=i.defaultMinSize,i.maxSize=i.defaultMaxSize},L=function(i){return i.maxSize=i.defaultMaxSize,i.maxSize},k=function(i){return i.minSize=i.defaultMinSize,i.minSize},j=function(i){return i.maxSize=i.size,i.size},A=function(i){return i.minSize=i.size,i.size},D=function(i){return i.size-i.defaultMinSize},P=function(i){return i.defaultMaxSize-i.size},H=function(i){i.size=i.minSize},N=function(i){i.size=i.maxSize},T=function(i){i.axisSize=i.size},U=function(i){i.api.setSize(B(i))},X=function(i){if(i.visibility&&!i.isHandle){var e,n=i.size,t=i.id;e=n===i.defaultMaxSize?"onMaxSize":n===i.defaultMinSize?"onMinSize":d,i.sizeState!==e&&(i.props[e](t,n),i.sizeState=e)}},Y=function(e){var n,t=Z(e,"id",f,"defaultSize",l,c,"storedSize");return i(i({},t),((n={})[v]=e[v].toString(),n))},B=function(i){return i.visibility?i.size:0},F=function(i){return i.visibility?i.sizeRatio:0},K=function(i,e){i.size=e,i.storedSize=e},J=function(i,e,n,t,r,o,a){K(i,e),i.defaultSize=r,i.minSize=n,i.maxSize=t,i.defaultMinSize=n,i.defaultMaxSize=t,i.storedSize=o,i.visibility=a},W=function(i){return i},_=function(i,e){return i.find((function(i){return i.id===e}))},q=function(i){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var t={};return i.forEach((function(i){var n=function(e){return e===f?B(i):i[e]},r=i.id;1===e.length?t[r]=n(e[0]):t[r]=e.reduce((function(i,e){return i[e]=n(e),i}),{})})),t},G=function(i,e,n){return void 0===n&&(n="id"),i.findIndex((function(i){return i[n]===e}))},Q=function(i,e,n){return Math.round(function(i,e,n){return Number((i*(n/e)).toFixed(0))}(i,e,n))},Z=function(i){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var t={};return e.forEach((function(e){t[e]=i[e]})),t},$=function(i){return i===r},ii=function(i){return"".concat("resizer","-").concat(i)},ei=function(i){return Object.keys(i).forEach((function(e){void 0===i[e]&&delete i[e]})),i},ni=function(i){return e([],i,!0).reverse()},ti=function(i){return i.filter((function(i){return i}))},ri=function(i){return e([],i,!0).sort((function(i,e){return i>e?-1:e>i?1:0}))},oi=function(i,e,n,t){var r;this.sizeState=d,this.storedSize=0,this.axisSize=0,this.oldVisibleSize=0,this.oldVisibility=!0,this.props=x(i,e);var o=this.props,a=o.id,s=o.minSize,c=o.size,f=o.maxSize,l=o.resizerSize,v=o.detectionRadius,z=e.visibility,S=e.vertical,h=e.minMaxUnit,p=e.unit;this.minMaxUnit=null!=h?h:p,p!==u&&y(c,s,f,a);var m=null===(r=z[a])||void 0===r||r;this.defaultVisibility=m;var g=n.getStoredPane(a);if(g){var b=g.size,M=g.defaultMaxSize,w=g.defaultMinSize,E=g.defaultSize,R=g.visibility,C=g.storedSize;J(this,b,w,M,E,C,R)}else J(this,c,s,f,c,c,m);this.id=a,this.vertical=S,V(this),this.isHandle=t,t&&(this.id=ii(a),this.resizerSize=l,this.detectionRadius=v)},ai=function(){function i(){this.isSetRatioMode=!1,this.newVisibilityModel=!1,this.isViewSizeChanged=!1}return i.prototype.register=function(i){Object.assign(this,i)},i}(),ui=function(i){i.forEach(U)},si=function(i){return i.filter((function(i){return i.visibility}))};function ci(i,e,n,t){void 0===n&&(n=0),void 0===t&&(t=i.length-1);for(var r=0,o=n;o<=t;o++)r+=e(i[o]);return r}var fi=function(i,e,n){return ci(i,j,e,n)},li=function(i,e,n){return ci(i,A,e,n)},vi=function(i,e,n){return ci(i,B,e,n)},di=function(i,e,n,t){for(var r=i.virtualOrderList,o=i.index,a=0;a<r.length;a++)a<=o?e(r[a],t):n(r[a],t)},zi=function(i,e,n){var t=i.size+(n===o?e:-e);K(i,t)},Si=function(i,e,n){for(var t,r=0,o=i.length;e>1;)i[t=r%o].visibility&&(zi(i[t],1,n),--e),++r;for(;;){if(i[t=r%o].visibility)return void zi(i[t],e,n);++r}},hi=function(i,e){var n,t=e.axisCoordinate,r=e.decreasingItems,u=e.increasingItems,s=e.direction,c=r,f=u;if($(s)?(n=t-i,c=ni(r)):(n=i-t,f=ni(u)),n<0);else if(0===n)return;var l=n;c.forEach((function(i){n=M(i,n,a)})),l-=n,f.forEach((function(i){l=M(i,l,o)}))},pi=function(i){var n,t=i.items,r=i.direction,o=i.handleId,a=si(t),u=G(a,o),s=[],c=[],f=function(i,e){var n=a[i];n.size?(c[i]=n,c[i+e]=a[i+e]):(c[i]=a[i+e],c[i+e]=n)};if($(r)){for(var l=u-1;l>-1;l-=2)s.push(a[l],a[l-1]);for(s.reverse(),c=[a[u]],l=u+1;l<a.length;l+=2)f(l,1);n=e(e([],s,!0),c,!0)}else{for(c=[a[0]],l=u-1;l>0;l-=2)f(l,-1);for(c.push(a[u]),l=u+1;l<a.length;l+=2)s.push(a[l],a[l+1]);n=e(e([],c,!0),s,!0)}i.virtualOrderList=ti(n),i.increasingItems=ti(c),i.decreasingItems=ti(s),i.index=G(i.virtualOrderList,o)},mi=function(i){var e=xi(i).containerSize,n=i.virtualOrderList,t=i.index,r=t+1,o=D(n[t]),a=P(n[r]);gi(n,o-a,t,r,0,e);var u=D(n[r]),s=P(n[t]);yi(n,s-u,t,r,0,e)},gi=function(i,e,n,t,r,o){var a,u=i.length-1,s=n,c=t,f=i[n],l=i[t],v=function(){r+=k(f)},d=function(){r+=L(l)};switch(!0){case n>0&&t<u:switch(!0){case e<0:v(),a=D(i[s=n-1])+e;break;case 0===e:v(),d(),c=t+1,a=D(i[s=n-1])-P(i[c]);break;case e>0:d(),a=e-P(i[c=t+1])}break;case 0===n&&t<u:switch(!0){case e<0:return v(),r+=fi(i,t+1,u),void(l.maxSize=o-r);case 0===e:return v(),d(),void fi(i,t+1,u);case e>0:d(),a=e-P(i[c=t+1])}break;case n>0&&t===u:switch(!0){case e<0:v(),a=D(i[s=n-1])+e;break;case 0===e:return v(),d(),void li(i,0,n-1);case e>0:return d(),r+=li(i,0,n-1),void(f.minSize=o-r)}break;case 0===n&&t===u:switch(!0){case e<0:return v(),void(l.maxSize=o-r);case 0===e:return v(),void d();case e>0:return d(),void(f.minSize=o-r)}}gi(i,a,s,c,r,o)},yi=function(i,e,n,t,r,o){var a,u=i.length-1,s=n,c=t,f=i[n],l=i[t],v=function(){r+=L(f)},d=function(){r+=k(l)};switch(!0){case n>0&&t<u:switch(!0){case e<0:v(),a=P(i[s=n-1])+e;break;case 0===e:v(),d(),c=t+1,a=P(i[s=n-1])-D(i[c]);break;case e>0:d(),a=e-D(i[c=t+1])}break;case 0===n&&t<u:switch(!0){case e<0:return v(),r+=li(i,t+1,u),void(l.minSize=o-r);case 0===e:return v(),d(),void li(i,t+1,u);case e>0:d(),a=e-D(i[c=t+1])}break;case n>0&&t===u:switch(!0){case e<0:v(),a=P(i[s=n-1])+e;break;case 0===e:return v(),d(),void fi(i,0,n-1);case e>0:return d(),r+=fi(i,0,n-1),void(f.maxSize=o-r)}break;case 0===n&&t===u:switch(!0){case e<0:return v(),void(l.minSize=o-r);case 0===e:return d(),void v();case e>0:return d(),void(f.maxSize=o-r)}}yi(i,a,s,c,r,o)},xi=function(i){var e=i.getContainerRect,n=i.vertical,t=i.resizersList,r=e(),o=r.top,a=r.height,u=r.left,s=r.width,c=n?u:o,f=Math.round(n?s:a);return{containerSize:f,maxTopAxis:c,maxPaneSize:f-vi(t)}},bi=function(i,e){void 0===e&&(e=!1);var n=i.panesList,t=i.items,r=xi(i).maxPaneSize,s=function(i){return ci(i,F)}(n);if(!(s<0)){n.forEach((function(i){!function(i){i.size=i.sizeRatio,i.defaultMinSize=i.minSizeRatio,i.defaultMaxSize=i.maxSizeRatio}(i),function(i,e,n,t){var r,o,a=i.props,s=a.minSize,c=a.size,f=a.maxSize,l=t?[i.minSizeRatio,i.size,i.maxSizeRatio]:[s,c,f],v=l[0],d=l[2],z=Q(e,n,l[1]);i.minMaxUnit!==u?(r=i.defaultMinSize,o=i.defaultMaxSize):(r=Q(e,n,v),o=Q(e,n,d)),t||(i.minMaxUnit!==u?y(z,r,o,i.id):y(c,s,f,i.id)),J(i,z,r,o,z,z,i.visibility)}(i,r,s,e)}));var c=vi(n),f=r-c,l=f<0?a:o;Si(n,Math.abs(f),l),ui(t)}},Mi=function(i){var e=i.items;return xi(i).containerSize-vi(e)},wi=function(i,e){var n=i.panesList;e!==u&&n.forEach(V),e!==c&&(i.newVisibilityModel=!1),e!==s&&(i.setSizeKey=null)},Ei=function(i){return"".concat(i,"px")},Ri=function(i){return i?"width":"height"},Ci=function(i,e,n){var t;return function(i){return Object.keys(i).map((function(e){return i[e]?e:""})).join(" ")}(((t={flex:!0,"f-row w-fit-content h-100p":i,"f-column":!i,"w-100p h-100p":n===u})[e]=e,t))},Vi=function(i,e,n){return i.preventDefault(),function(i){return i.type.startsWith("touch")}(i)?function(i,e,n){var t,r=i.targetTouches[0],o=null!==(t=n.current)&&void 0!==t?t:{},a=o.pageX,u=void 0===a?0:a,s=o.pageY,c=void 0===s?0:s;return n.current=r,e?[r.clientX,r.pageX-u]:[r.clientY,r.pageY-c]}(i,e,n):function(i,e){var n=i.clientX,t=i.clientY,r=i.movementX,o=i.movementY;return e?[n,r]:[t,o]}(i,e)},Oi=function(i){return i<0?r:n},Ii=function(i,e){return function(n){i.style[Ri(e)]=Ei(n)}},Li=function(i,e){return function(n){i.style[function(i){return i?"minWidth":"minHeight"}(e)]=Ei(n)}},ki=function(i,e){for(var n=[],t=2;t<arguments.length;t++)n[t-2]=arguments[t];n.forEach((function(n){return i.addEventListener(n,e)}))},ji=function(i,e,n){i.addEventListener(n,e,{passive:!1})},Ai=function(i,e){for(var n=[],t=2;t<arguments.length;t++)n[t-2]=arguments[t];n.forEach((function(n){return i.removeEventListener(n,e)}))},Di=function(i,e,n){var t={panes:n.panesList.map(Y)};e&&e.setItem(i,JSON.stringify(t))},Pi=function(){function i(i,e,n){this.store=null,this.empty=!1,this.panesComponents=n,this.getStorage(i,e)}return i.prototype.getStorage=function(i,e){var n,t=this,r=this.store;if(r)return r;if(e){n=e.getItem(i);var o=JSON.parse(n,(function(i,e){return"defaultMaxSize"===i?Number(e):e}));if("[object Object]"===toString.call(o)){var a=o.panes;if(a){if(a.every((function(i,e){var n;return(null===(n=t.panesComponents[e])||void 0===n?void 0:n.props.id)===i.id}))&&a.length===this.panesComponents.length)return this.store=o,o;e.removeItem(i)}else e.removeItem(i)}}this.empty=!0,this.store={panes:[]}},i.prototype.getStoredPane=function(i){var e,n=this.store.panes;return null!==(e=_(n,i))&&void 0!==e?e:null},i}(),Hi=function(i,e,n){var t=e-vi(i);if(0!==t&&0!==n.length){var r=t>0?o:a,u=Math.abs(t);if(u<=n.length)Si(n,u,r);else{var s=vi(n),c=[];n.forEach((function(i){var e=B(i),n=function(i,e,n){var t=i.size+(n===o?e:-e);return I(i),b(i,t)===t}(i,Math.round(u*(e/s)),r);n&&c.push(i)})),Hi(i,e,c)}}},Ni=function(i,n,t,r){var u,s,c=function(){var n,t=e(e([],u,!0),s,!0),r=a;i<0&&(i=Math.abs(i),r=o),t.forEach((n=r,function(e){T(e),I(e),i=M(e,i,n)}))};"1"===n?(u=t.slice(r+2),s=t.slice(0,r-1).reverse(),c()):"2"===n&&(u=t.slice(0,r-1).reverse(),s=t.slice(r+2),c())},Ti=function(i,n,t,r,o){void 0===r&&(r=u),void 0===o&&(o=!1);var a=i.panesList,s=i.items,c=si(a),f=si(s),l=G(c,n);if(!(-1===l||t<0)){var v="".concat(n,"-").concat(r);i.setSizeKey===v?a.forEach(C):(a.forEach(R),i.setSizeKey=v);var d=vi(c),z=c[l];I(z);var S=z.size,h=b(z,t),p=h-S;if(p){var m=G(f,n);if(r===u){var g=e([],c,!0);g.splice(l,1);var y=d-z.size;Hi(g,y,g)}if(Ni(p,r,f,m),!o){var x=Mi(i);Ti(i,n,h+x,r,!0)}}}};var Ui=function(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}((function(i,e){let n,t=0;return function(...r){clearTimeout(n);const o=Date.now(),a=e-(o-t);a<=0?(t=o,i.apply(this,r)):n=setTimeout((()=>{t=Date.now(),i.apply(this,r)}),a)}})),Xi=function(e){var o=e.vertical,a=e.children,d=e.unit,z=e.uniqueId,S=e.storageApi,h=e.onResizeStop,p=e.onChangeVisibility,m=e.onResize,g=function(i){return Array.isArray(i)?i:[i]}(a),y=new Pi(z,S,g),x=function(i,e,n){var t=[];return i.forEach((function(i){return t.push(new oi(i.props,e,n,!1),new oi(i.props,e,n,!0))})),t.pop(),t}(g,e,y),b=function(i){return[i.filter((function(i){return!i.isHandle})),i.filter((function(i){return i.isHandle}))]}(x),M=b[0],R=b[1],C=new ai;C.register({vertical:o,items:x,panesList:M,resizersList:R});var V=function(){return function(i){return i.forEach(T)}(x)},I=function(){var i=k();h(i),Di(z,S,C),function(i){for(var e=i.vertical,n=i.items,t=(0,i.getContainerRect)(),r=t.left,o=t.top,a=e?r:o,u=si(n),s=[],c=0;c<u.length-1;c+=2){var f=u[c];if(!f.isHandle){var l=u[c+1],v=l.defaultSize,d=l.id,z=l.detectionRadius,S=B(f),h=a+S-z,p=a+S+v+z;a+=S+v,s.push([h,p,d])}}i.detectionDetails=s}(C)},L=function(){var i=j();p(i)},k=function(){return q(M,f)},j=function(){return q(M,c)},A=function(i){R.forEach((function(e){e.api.setMouseDownFlag(C.handleId,i)}))};C.onMouseDown=function(i,e){var n=i[0];C.register({handleId:e,direction:t,axisCoordinate:n}),A(!0),V()};var D=function(i){void 0===i&&(i=""),wi(C,i),function(i){i.forEach(X)}(M)};C.onMoveResize=function(i){var e,n=i[0],t=i[1];!C.isViewSizeChanged&&t&&(P(n,t),Y(n)&&hi(n,C),ui(x),D(),e=k(),m(e))};var P=function(i,e){var n=C.direction,t=Oi(e);t!==n&&(C.direction=t,U(i))},U=function(i){C.axisCoordinate=i,pi(C),V(),mi(C),function(i){var e=i.items,n=i.index,t=xi(i).maxTopAxis,r=si(e);i.bottomAxis=t+ci(r,(function(i){return i.maxSize}),0,n-1),i.topAxis=t+function(i,e,n){return ci(i,(function(i){return i.minSize}),0,n)}(r,0,n-1)}(C)},Y=function(i){var e=C.topAxis,t=C.bottomAxis;return i<=e?(di(C,H,N,r),V(),C.axisCoordinate=e,!1):!(i>=t&&(di(C,N,H,n),V(),C.axisCoordinate=t,1))},F=function(e){var n=C.newVisibilityModel,t=q(M,c),r=i(i({},t),e);n||(C.newVisibilityModel=!0,M.forEach(E)),function(i,e){for(var n,t=i.panesList,r=i.items,o=-1,a=0;a<r.length;a+=2){var u=r[a];(n=u).size=n.oldVisibleSize,n.visibility=n.oldVisibility;var s=u.id;w(u,e[s]),w(r[a+1],!1),u.visibility&&(-1!==o&&w(r[a-1],!0),o=a)}var c=si(t);0===vi(c)&&c.forEach((function(i){i.size=1}));var f=xi(i).maxPaneSize;Hi(c,f,c)}(C,r);var o=Mi(C);C.isViewSizeChanged=!!o,ui(x),I(),L(),D(c)};C.onMouseUp=function(){I(),A(!1)};var K=function(){ui(x),I(),D(s)},W={restore:function(){!function(i){i.forEach(O),ui(i)}(C.items),D(),I(),L(),C.isViewSizeChanged=!1},setVisibilities:F,getSizes:k,getVisibilities:function(){return j()},getState:function(){return q(M,f,c,l,v)},setSize:function(i,e,n){Ti(C,i,e,n),K()},setSizeRatio:function(i,e,n){var t=xi(C).containerSize;Ti(C,i,t*e,n),K()}};return C.register({api:W,registerItem:function(i,e){!function(i,e){if(i.api=e,i.isHandle){var n=i.resizerSize;e.setSize(n),J(i,n,n,n,n,n,i.visibility)}}(_(x,e),i)},registerContainer:function(i){C.getContainerRect=function(){return i.getBoundingClientRect()};var n=e.visibility;if(y.empty&&d===u&&!C.isSetRatioMode)bi(C),C.isSetRatioMode=!0;else{var t=y.getStorage(z,S).panes;n=q(t,c)}F(n)},vertical:o,props:e,getPaneSizeStyle:function(i){var e=B(_(M,i));return function(i,e){var n;return(n={})[Ri(i)]=Ei(e),n}(o,e)}}),C},Yi=function(){return Yi=Object.assign||function(i){for(var e,n=1,t=arguments.length;n<t;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(i[r]=e[r]);return i},Yi.apply(this,arguments)};"function"==typeof SuppressedError&&SuppressedError;var Bi=function(i,e){e.split(" ").forEach((function(e){return e&&i.classList.add(e)}))},Fi=function(i,e){e.split(" ").forEach((function(e){return e&&i.classList.remove(e)}))},Ki=function(i,e,n,t){return void 0===n&&(n=""),void 0===t&&(t=""),function(r,o){r===e&&(o?(Bi(i,n),Fi(i,t)):(Bi(i,t),Fi(i,n)))}},Ji=function(i){var e=function(i){var e=i.panes.map((function(i){return{props:i}}));return Yi({onResize:W,onResizeStop:W,onReady:W,onChangeVisibility:W,vertical:!1,unit:u,resizerSize:2,detectionRadius:6,visibility:{},children:e},i)}(i),n=Xi(e),t=n.registerItem,r=n.registerContainer,o=n.api;e.panes.forEach((function(i,n){var r=i.id,o=document.getElementById(r);t({setSize:Ii(o,!0)},r),Bi(o,"overflow-hidden flex-shrink-0");var a=ii(r),u=document.getElementById(a);n!==e.panes.length-1&&t({setSize:Li(u,!0),setMouseDownFlag:Ki(u,a,"",e.activeResizerClass)},a)}));var a=Ci(e.vertical,"",e.unit),s=function(i){var e=i.vertical,n=e?"col-resize":"row-resize",t=function(i,e){return function(n){var t=Vi(n,e,i.previousTouchEvent);i.onMoveResize(t)}}(i,e),r=function(){i.onMouseUp(),Ai(document,t,S,p)},o=function(i,e,n){return function(t){var r=i.detectionDetails,o=Vi(t,e,{})[0],a=r.map((function(i){var e=i[0],n=i[1];return Math.abs((e+n)/2-o)})),u=ri(a).pop(),s=r[a.indexOf(u)],c=s[0],f=s[1],l=s[2];if(u<=(f-c)/2){i.previousTouchEvent=t;var v=Vi(t,e,{});i.onMouseDown(v,l),n()}}}(i,e,(function(){ki(document,t,S),ji(document,t,p)}));return[function(t){var a=Ui(function(i,e,n,t){return function(r){var o=e.detectionDetails,a=n?r.clientX:r.clientY;i.style.cursor="auto",o.forEach((function(e){var n=e[0],r=e[1];a>=n&&a<=r&&(i.style.cursor=t)}))}}(t,i,e,n),100);ji(t,a,S),ji(t,a,p),ki(t,o,h),ji(t,o,g),ki(document,r,z,m)},function(){Ai(document,r,z,m)}]}(n),c=s[0],f=s[1],l=document.getElementById(e.id);return Bi(l,a),r(l),c(l),[o,c,f]};export{Ji as default};
//# sourceMappingURL=index.esm.js.map

@@ -1,2 +0,30 @@

import React, { ReactElement, ReactNode } from 'react';
interface IKeyToBoolMap$1 {
[name: string]: boolean;
}
type IVisibilityState = 'zipped' | 'visible' | 'hidden';
type ISetSizeBehaviour$1 = 'ratio' | '1' | '2';
interface INumberMap$1 {
[key: string]: number;
}
interface IVisibilityMap$1 {
[key: string]: IVisibilityState;
}
interface IGetStateItem$1 {
size: number;
visibility: boolean;
defaultMinSize: number;
defaultMaxSize: number;
}
interface IGetState$1 {
[key: string]: IGetStateItem$1;
}
interface IResizableApi$1 {
restore: () => void;
setVisibilities: (map: IKeyToBoolMap$1) => void;
getVisibilities: () => IVisibilityMap$1;
getSizes: () => INumberMap$1;
getState: () => IGetState$1;
setSize: (id: string, size: number, behavior?: ISetSizeBehaviour$1) => void;
setSizeRatio: (id: string, ratio: number, behavior?: ISetSizeBehaviour$1) => void;
}

@@ -11,3 +39,2 @@ interface IKeyToBoolMap {

type UnitTypes = 'ratio' | 'pixel' | undefined;
type IVisibilityState = 'zipped' | 'visible' | 'hidden';
type ISetSizeBehaviour = 'ratio' | '1' | '2';

@@ -20,3 +47,3 @@

interface IVisibilityMap {
[key: string]: IVisibilityState;
[key: string]: boolean;
}

@@ -42,7 +69,19 @@ interface IGetStateItem {

type onReadyType = (api: IResizableApi) => void;
interface IResizablePaneProviderProps {
uniqueId: string;
className?: string;
interface IPane {
id: string;
size: number;
maxSize?: number;
minSize?: number;
detectionRadius?: number;
resizerSize?: number;
resizerClass?: string;
activeResizerClass?: string;
onMinSize?: (id: string, minSize: number) => void;
onMaxSize?: (id: string, maxSize: number) => void;
onNormalSize?: (id: string) => void;
}
interface IResizableOptions {
id: string;
resizerClass?: string;
activeResizerClass?: string;
vertical?: boolean;

@@ -52,8 +91,5 @@ unit?: UnitTypes;

storageApi?: any;
resizer?: ReactElement;
resizerSize?: number;
visibility?: IKeyToBoolMap;
unmountOnHide?: boolean;
detectionRadius?: number;
children: ReactElement | ReactElement[];
onResize?: onResizeType;

@@ -66,29 +102,7 @@ onResizeStop?: onResizeType;

onNormalSize?: (id: string) => void;
panes: IPane[];
}
interface IPane {
id: string;
size: number;
unmountOnHide?: boolean;
className?: string;
children?: ReactNode[] | ReactNode;
maxSize?: number;
minSize?: number;
detectionRadius?: number;
resizer?: ReactElement;
resizerSize?: number;
resizerClass?: string;
activeResizerClass?: string;
onMinSize?: (id: string, minSize: number) => void;
onMaxSize?: (id: string, maxSize: number) => void;
onNormalSize?: (id: string) => void;
}
declare const Pane: (props: IPane) => React.JSX.Element;
declare const getResizablePanes: (options: IResizableOptions) => (IResizableApi$1 | ((containerNode: HTMLElement) => void))[];
declare const ResizablePaneProvider: (props: IResizablePaneProviderProps) => React.JSX.Element;
declare const RATIO = "ratio";
declare const BUTTOM_FIRST = "1";
declare const TOP_FIRST = "2";
export { BUTTOM_FIRST, Pane, RATIO, ResizablePaneProvider as ResizablePanes, TOP_FIRST };
export { getResizablePanes as default };
{
"name": "resizable-panes-js",
"version": "6.0.2",
"version": "6.0.13",
"description": "A simple library for resizing elements in the browser",

@@ -17,5 +17,6 @@ "module": "./lib/esm/index.esm.js",

"prod": "rimraf lib && cross-env NODE_ENV=prod rollup -c --bundleConfigAsCjs",
"build": "rimraf lib && cross-env NODE_ENV=dev rollup -c --bundleConfigAsCjs",
"dev": "rimraf lib && cross-env NODE_ENV=dev rollup -c -w --bundleConfigAsCjs",
"link-local": "npm link && cd ./node_modules/react && npm link",
"start": "run-s -n link-local dev",
"start": "run-s -n dev",
"patch": "npm version patch",

@@ -33,3 +34,3 @@ "predeploy": "run-s -n patch clean Install test prod",

"keywords": [
"react",
"js",
"panel",

@@ -50,2 +51,3 @@ "resizable",

"devDependencies": {
"rimraf": "^5.0.7",
"@babel/core": "^7.22.10",

@@ -103,3 +105,2 @@ "@babel/eslint-parser": "^7.22.11",

"style-loader": "^3.3.3",
"terser-webpack-plugin": "^5.3.9",
"ts-loader": "^9.4.4",

@@ -120,9 +121,9 @@ "tslib": "^2.6.2",

"type": "git",
"url": "https://github.com/BipanKishore/resizable-panes-react.git"
"url": "https://github.com/BipanKishore/resizable-panes.git"
},
"bugs": {
"url": "https://github.com/BipanKishore/resizable-panes-react/issues",
"url": "https://github.com/BipanKishore/resizable-panes/issues",
"email": "bipankishore@gmail.com"
},
"homepage": "https://bipankishore.github.io/resizable-panes-demo/"
"homepage": "https://bipankishore.github.io/resizable-panes/packages/resizable-panes-react"
}
# The modern library that solve all resizing use cases. Don't trust! Try it
[![resizable-panes-react](https://github.com/BipanKishore/resizable-panes-react/actions/workflows/build.yml/badge.svg?branch=master)](https://github.com/BipanKishore/resizable-panes-react/actions/workflows/build.yml) ![nycrc config on GitHub](https://img.shields.io/nycrc/BipanKishore/resizable-panes-react)
[![NPM Version](https://img.shields.io/npm/v/resizable-panes-react)](https://www.npmjs.com/package/resizable-panes-react) [![npm bundle size](https://img.shields.io/bundlephobia/minzip/resizable-panes-react)](https://www.npmjs.com/package/resizable-panes-react) [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=BipanKishore_resizable-panes-react&branch=master&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=BipanKishore_resizable-panes-react)
[![resizable-panes-react][build-n-deploy-badge-link]][build-n-deploy-link]
[![nycrc config on GitHub][nyc-link]][build-n-deploy-link]
[![NPM Version][npm-version-badge]][npm-link]
[![npm bundle size][npm-min-size-badge-link]][npm-min-size-link]
[![Quality Gate Status][sonar-react-badge-link]][sonar-react-link]
[Cypress Recoreded tests are available here](https://cloud.cypress.io/projects/2xc7po/branches/master/overview)
<!-- [Cypress Recoreded tests are available here](https://cloud.cypress.io/projects/2xc7po/branches/master/overview) -->

@@ -79,3 +82,4 @@ ## [Quick Demo](https://bipankishore.github.io/resizable-panes/)

| unit | 'ratio' or 'pixel' | ratio | false | It sets the unit of size of panes. |
| minMaxUnit | 'ratio' or 'pixel' | ratio | false | It sets the unit of minSize and maxSize of panes. |
| minMaxUnit | 'ratio' or 'pixel' | Same value as of unit props | false | It sets the unit of minSize and maxSize of panes. |
| detectionRadius | number | 6 | false | It create the extra margin on both side for handle/resizer detection. |
| visibility | Object | | false | It accepts a boolean map of Pane Ids visibility. |

@@ -107,2 +111,3 @@ | storageApi | Object | | false | It used to store data across session. It can be localStorage, sessionStorage or any other following the interface of localStorage. |

| resizerSize | number | | Optionally required | It is the size of attached Resizer Element. It is required when we have passed resizer prop to the Pane. |
| detectionRadius | number | 6 | false | Works at individual Pane level. |
| onMinSize | (id: string, minSize:number) => void | | false | It emits when it enters min size of the Pane. |

@@ -117,3 +122,4 @@ | onMaxSize | (id: string, maxSize:number) => void | | false | It emits when it enters max size of the Pane. |

| restore | | It restores the default view of layout. |
| setSize | (paneId: string, size: number, <br /> behaviour: ISetSizeBehaviour) | It excepts the positive number. It sets the size of Pane depending upon: <br /> 1. Its min and max. <br />2. min and max of other panes.|
| setSize | (paneId: string, size: number, <br /> behaviour: ISetSizeBehaviour) | It excepts the positive number. It sets the size of Pane depending upon: <br /> 1. Its min and max. <br />2. Min and max of other panes.|
| setSizeRatio | (paneId: string, size: number, <br /> behaviour: ISetSizeBehaviour) | Pass value 0 to 1. It will automatically covert it percent in Pixel. <br /> 1 corresponds to the sum of size of visible Panes.|
| setVisibilities | Object | It sets the visibility of Panes using the Boolean map of id of Panes. |

@@ -128,4 +134,2 @@ | getSizes | | It returns the size map object of Ids of Panes |

| ------------------- | -------- | ------- | -------- | -------------------------------------------------------------------------------------------------------------------------- |
| onMouseDown | function | | | Attached it to the element that, upon being clicked and dragged, initiates the resizing of the Pane's size. |
| onTouchStartCapture | | | | Attached it to the element that, upon being clicked and dragged, initiates the resizing of the Pane's size.(Touch devices) |
| isMouseDown | boolean | | | Use it style you Custom resizer element behavior. |

@@ -136,5 +140,3 @@

interface ICustomResizerProp {
onMouseDown: (e: HTMLEvent) => void,
isMouseDown: boolean,
onTouchStartCapture: (e: HTMLEvent) => void
}

@@ -144,5 +146,3 @@

export const CustomResizer = ({
onMouseDown,
isMouseDown,
onTouchStartCapture
isMouseDown
}: ICustomResizerProp) => {

@@ -154,6 +154,4 @@

<SOME_ELEMENT>
<TARGET_ELEMENT
onMouseDown={onMouseDown}
onTouchStartCapture={onTouchStartCapture}
>
<TARGET_ELEMENT>
</TARGET_ELEMENT>

@@ -215,1 +213,15 @@ </SOME_ELEMENT>

### Feel Free to Raise Pull Request
[nyc-link]:https://img.shields.io/nycrc/BipanKishore/resizable-panes?config=%2Fpackages%2Fresizable-panes-react%2F.nycrc
[npm-link]: https://www.npmjs.com/package/resizable-panes-react
[npm-version-badge]: https://img.shields.io/npm/v/resizable-panes-react
[npm-min-size-badge-link]: https://img.shields.io/bundlephobia/minzip/resizable-panes-react
[npm-min-size-link]: https://www.npmjs.com/package/resizable-panes-react
[sonar-react-badge-link]: https://sonarcloud.io/api/project_badges/measure?project=BipanKishore_resizable-panes-react&branch=master&metric=alert_status
[sonar-react-link]:https://sonarcloud.io/summary/new_code?id=BipanKishore_resizable-panes-react
[build-n-deploy-badge-link]: https://github.com/BipanKishore/resizable-panes-react/actions/workflows/build-n-deploy.yml/badge.svg?branch=master
[build-n-deploy-link]: https://github.com/BipanKishore/resizable-panes/actions/workflows/build-n-deploy.yml?query=branch%3Amaster

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc