resizable-panes-js
Advanced tools
Comparing version 6.0.17 to 6.0.18
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});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="resize",z="onNormalSize",S="mouseup",h="mousemove",p="mousedown",m="touchmove",g="touchend",x="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))},b=function(e,n){var t=ni(i({},e)),r=n.onMinSize,o=void 0===r?J:r,a=n.onMaxSize,u=void 0===a?J:a,s=n.onNormalSize,c=void 0===s?J: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)},M=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},w=function(i,e,n){var t=i.axisSize+(n===o?e:-e),r=M(i,t);return Math.abs(r-t)},E=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))},R=function(i){i.oldVisibleSize=i.size,i.oldVisibility=i.visibility},C=function(i){i.initialSetSize=i.size},O=function(i){i.size=i.initialSetSize},V=function(i){i.sizeRatio=i.size,i.minSizeRatio=i.defaultMinSize,i.maxSizeRatio=i.defaultMaxSize},I=function(i){i.size=i.defaultSize,L(i),E(i,i.defaultVisibility)},L=function(i){i.minSize=i.defaultMinSize,i.maxSize=i.defaultMaxSize},k=function(i){return i.maxSize=i.defaultMaxSize,i.maxSize},T=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},P=function(i){return i.size-i.defaultMinSize},D=function(i){return i.defaultMaxSize-i.size},H=function(i){i.size=i.minSize},N=function(i){i.size=i.maxSize},U=function(i){i.axisSize=i.size},X=function(i){i.api.setSize(F(i))},Y=function(i){if(i.visibility&&!i.isHandle){var e,n=i.size,t=i.id;e=n===i.defaultMaxSize?"onMaxSize":n===i.defaultMinSize?"onMinSize":z,i.sizeState!==e&&(i.props[e](t,n),i.sizeState=e)}},_=function(e){var n,t=$(e,"id",f,"defaultSize",l,c,"storedSize");return i(i({},t),((n={})[v]=e[v].toString(),n))},F=function(i){return i.visibility?i.size:0},B=function(i){return i.visibility?i.sizeRatio:0},K=function(i,e){i.size=e,i.storedSize=e},q=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},J=function(i){return i},W=function(i,e){return i.find((function(i){return i.id===e}))},G=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?F(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},Q=function(i,e,n){return void 0===n&&(n="id"),i.findIndex((function(i){return i[n]===e}))},Z=function(i,e,n){return Math.round(function(i,e,n){return Number((i*(n/e)).toFixed(0))}(i,e,n))},$=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},ii=function(i){return i===r},ei=function(i){return"".concat("resizer","-").concat(i)},ni=function(i){return Object.keys(i).forEach((function(e){void 0===i[e]&&delete i[e]})),i},ti=function(i){return e([],i,!0).reverse()},ri=function(i){return i.filter((function(i){return i}))},oi=function(i){return e([],i,!0).sort((function(i,e){return i>e?-1:e>i?1:0}))},ai=function(i,e,n,t){var r;this.sizeState=z,this.storedSize=0,this.axisSize=0,this.oldVisibleSize=0,this.oldVisibility=!0,this.props=b(i,e);var o=this.props,a=o.id,s=o.minSize,c=o.size,f=o.maxSize,l=o.resizerSize,v=o.detectionRadius,d=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=d[a])||void 0===r||r;this.defaultVisibility=m;var g=n.getStoredPane(a);if(g){var x=g.size,M=g.defaultMaxSize,w=g.defaultMinSize,E=g.defaultSize,R=g.visibility,C=g.storedSize;q(this,x,w,M,E,C,R)}else q(this,c,s,f,c,c,m);this.id=a,this.vertical=S,V(this),this.isHandle=t,t&&(this.id=ei(a),this.resizerSize=l,this.detectionRadius=v)},ui=function(){function i(){this.isSetRatioMode=!1,this.newVisibilityModel=!1,this.isViewSizeChanged=!1}return i.prototype.register=function(i){Object.assign(this,i)},i}(),si=function(i){i.forEach(X)},ci=function(i){return i.filter((function(i){return i.visibility}))};function fi(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 li=function(i,e,n){return fi(i,j,e,n)},vi=function(i,e,n){return fi(i,A,e,n)},di=function(i,e,n){return fi(i,F,e,n)},zi=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)},Si=function(i,e,n){var t=i.size+(n===o?e:-e);K(i,t)},hi=function(i,e,n){for(var t,r=0,o=i.length;e>1;)i[t=r%o].visibility&&(Si(i[t],1,n),--e),++r;for(;;){if(i[t=r%o].visibility)return void Si(i[t],e,n);++r}},pi=function(i,e){var n,t=e.axisCoordinate,r=e.decreasingItems,u=e.increasingItems,s=e.direction,c=r,f=u;if(ii(s)?(n=t-i,c=ti(r)):(n=i-t,f=ti(u)),n<0);else if(0===n)return;var l=n;c.forEach((function(i){n=w(i,n,a)})),l-=n,f.forEach((function(i){l=w(i,l,o)}))},mi=function(i){var n,t=i.items,r=i.direction,o=i.handleId,a=ci(t),u=Q(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(ii(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=ri(n),i.increasingItems=ri(c),i.decreasingItems=ri(s),i.index=Q(i.virtualOrderList,o)},gi=function(i){var e=bi(i).containerSize,n=i.virtualOrderList,t=i.index,r=t+1,o=P(n[t]),a=D(n[r]);xi(n,o-a,t,r,0,e);var u=P(n[r]),s=D(n[t]);yi(n,s-u,t,r,0,e)},xi=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+=T(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.maxSize=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 vi(i,0,n-1);case e>0:return d(),r+=vi(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)}}xi(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+=k(f)},d=function(){r+=T(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+=vi(i,t+1,u),void(l.minSize=o-r);case 0===e:return v(),d(),void vi(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.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)},bi=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-di(t)}},Mi=function(i,e){void 0===e&&(e=!1);var n=i.panesList,t=i.items,r=bi(i).maxPaneSize,s=function(i){return fi(i,B)}(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=Z(e,n,l[1]);i.minMaxUnit!==u?(r=i.defaultMinSize,o=i.defaultMaxSize):(r=Z(e,n,v),o=Z(e,n,d)),t||(i.minMaxUnit!==u?y(z,r,o,i.id):y(c,s,f,i.id)),q(i,z,r,o,z,z,i.visibility)}(i,r,s,e)}));var c=di(n),f=r-c,l=f<0?a:o;hi(n,Math.abs(f),l),si(t)}},wi=function(i){var e=i.items;return bi(i).containerSize-di(e)},Ei=function(i,e){var n=i.panesList;e!==u&&n.forEach(V),e!==c&&(i.newVisibilityModel=!1),e!==s&&(i.setSizeKey=null)},Ri=function(i){return"".concat(i,"px")},Ci=function(i){return i?"width":"height"},Oi=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)},Ii=function(i){return i<0?r:n},Li=function(i,e){return function(n){i.style[Ci(e)]=Ri(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)}))},Ti=function(i,e,n){i.addEventListener(n,e,{passive:!1})},ji=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)}))},Ai=function(i,e,n){var t={panes:n.panesList.map(_)};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=W(n,i))&&void 0!==e?e:null},i}(),Di=function(i,e,n){var t=e-di(i);if(0!==t&&0!==n.length){var r=t>0?o:a,u=Math.abs(t);if(u<=n.length)hi(n,u,r);else{var s=di(n),c=[];n.forEach((function(i){var e=F(i),n=function(i,e,n){var t=i.size+(n===o?e:-e);return L(i),M(i,t)===t}(i,Math.round(u*(e/s)),r);n&&c.push(i)})),Di(i,e,c)}}},Hi=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){U(e),L(e),i=w(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())},Ni=function(i,n,t,r,o){void 0===r&&(r=u),void 0===o&&(o=!1);var a=i.panesList,s=i.items,c=ci(a),f=ci(s),l=Q(c,n);if(!(-1===l||t<0)){var v="".concat(n,"-").concat(r);i.setSizeKey===v?a.forEach(O):(a.forEach(C),i.setSizeKey=v);var d=di(c),z=c[l];L(z);var S=z.size,h=M(z,t),p=h-S;if(p){var m=Q(f,n);if(r===u){var g=e([],c,!0);g.splice(l,1);var x=d-z.size;Di(g,x,g)}if(Hi(p,r,f,m),!o){var y=wi(i);Ni(i,n,h+y,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(i){for(var e=i.vertical,n=i.items,t=(0,i.getContainerRect)(),r=t.left,o=t.top,a=e?r:o,u=ci(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=F(f),h=a+S-z,p=a+S+v+z;a+=S+v,s.push([h,p,d])}}i.detectionDetails=s},Yi=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),x=new Pi(z,S,g),y=function(i,e,n){var t=[];return i.forEach((function(i){return t.push(new ai(i.props,e,n,!1),new ai(i.props,e,n,!0))})),t.pop(),t}(g,e,x),b=function(i){return[i.filter((function(i){return!i.isHandle})),i.filter((function(i){return i.isHandle}))]}(y),M=b[0],w=b[1],C=new ui;C.register({vertical:o,items:y,panesList:M,resizersList:w});var O=function(){return function(i){return i.forEach(U)}(y)},V=function(){var i=k();h(i),Ai(z,S,C),Xi(C)},L=function(){var i=T();p(i)},k=function(){return G(M,f)},T=function(){return G(M,c)},j=function(i){w.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}),j(!0),O()};var A=function(i){void 0===i&&(i=""),Ei(C,i),function(i){i.forEach(Y)}(M)};C.onMoveResize=function(i){var e,n=i[0],t=i[1];!C.isViewSizeChanged&&t&&(P(n,t),X(n)&&pi(n,C),si(y),A(),e=k(),m(e))};var P=function(i,e){var n=C.direction,t=Ii(e);t!==n&&(C.direction=t,D(i))},D=function(i){C.axisCoordinate=i,mi(C),O(),gi(C),function(i){var e=i.items,n=i.index,t=bi(i).maxTopAxis,r=ci(e);i.bottomAxis=t+fi(r,(function(i){return i.maxSize}),0,n-1),i.topAxis=t+function(i,e,n){return fi(i,(function(i){return i.minSize}),0,n)}(r,0,n-1)}(C)},X=function(i){var e=C.topAxis,t=C.bottomAxis;return i<=e?(zi(C,H,N,r),O(),C.axisCoordinate=e,!1):!(i>=t&&(zi(C,N,H,n),O(),C.axisCoordinate=t,1))},_=function(e){var n=C.newVisibilityModel,t=G(M,c),r=i(i({},t),e);n||(C.newVisibilityModel=!0,M.forEach(R)),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;E(u,e[s]),E(r[a+1],!1),u.visibility&&(-1!==o&&E(r[a-1],!0),o=a)}var c=ci(t);0===di(c)&&c.forEach((function(i){i.size=1}));var f=bi(i).maxPaneSize;Di(c,f,c)}(C,r);var o=wi(C);C.isViewSizeChanged=!!o,si(y),V(),L(),A(c)};C.onMouseUp=function(){V(),j(!1)};var B=function(){si(y),V(),A(s)},K={restore:function(){!function(i){i.forEach(I),si(i)}(C.items),A(),V(),L(),C.isViewSizeChanged=!1},setVisibilities:_,getSizes:k,getVisibilities:function(){return T()},getState:function(){return G(M,f,c,l,v)},setSize:function(i,e,n){Ni(C,i,e,n),B()},setSizeRatio:function(i,e,n){var t=bi(C).containerSize;Ni(C,i,t*e,n),B()}};return C.register({api:K,registerItem:function(i,e){!function(i,e){if(i.api=e,i.isHandle){var n=i.resizerSize;e.setSize(n),q(i,n,n,n,n,n,i.visibility)}}(W(y,e),i)},registerContainer:function(i){C.getContainerRect=function(){return i.getBoundingClientRect()};var n=e.visibility;if(x.empty&&d===u&&!C.isSetRatioMode)Mi(C),C.isSetRatioMode=!0;else{var t=x.getStorage(z,S).panes;n=G(t,c)}_(n)},vertical:o,props:e,getPaneSizeStyle:function(i){var e=F(W(M,i));return function(i,e){var n;return(n={})[Ci(i)]=Ri(e),n}(o,e)}}),C},_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"==typeof SuppressedError&&SuppressedError;var Fi=function(i,e){e.split(" ").forEach((function(e){return e&&i.classList.add(e)}))},Bi=function(i,e){e.split(" ").forEach((function(e){return e&&i.classList.remove(e)}))},Ki=function(i){return document.getElementById(i)},qi=function(i,e,n){var t=n.panesList,r=n.vertical,o=t[Q(t,i)].props,a=o.resizerClass,u=o.activeResizerClass,s=ei(i),c=Ki(s),f=function(i,e){return function(n){i.style[function(i){return i?"minWidth":"minHeight"}(e)]=Ri(n)}}(c,r);Fi(c,"overflow-hidden");var l=function(i,e,n,t){return void 0===n&&(n=""),void 0===t&&(t=""),function(r,o){r===e&&(o?(Fi(i,n),Bi(i,t)):(Fi(i,t),Bi(i,n)))}}(c,s,u,a);l(s,!1),e({setSize:f,setMouseDownFlag:l},s)};exports.BUTTOM_FIRST="1",exports.RATIO=u,exports.TOP_FIRST="2",exports.default=function(i){var e=function(i){var e=i.panes.map((function(i){return{props:i}}));return _i({onResize:J,onResizeStop:J,onReady:J,onChangeVisibility:J,vertical:!1,unit:u,resizerSize:2,detectionRadius:6,visibility:{},children:e},i)}(i),n=e.panes,t=e.uniqueId,r=e.unit,o=Yi(e),a=o.registerItem,s=o.registerContainer,c=o.api;n.forEach((function(i,t){var r=i.id;!function(i,e,n){var t=n.vertical,r=Ki(i);Fi(r,"overflow-hidden flex-shrink-0"),e({setSize:Li(r,t)},i)}(r,a,e),t!==n.length-1&&qi(r,a,o)}));var f=function(){r===u&&(Mi(o,!0),Xi(o),Ei(o))};ki(window,f,d);var l=function(i,e,n){var t=n.vertical,r=n.unit,o=Ki(i),a=Oi(t,"",r);return Fi(o,a),e(o),o}(t,s,e),v=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(),ji(document,t,h,m)},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=oi(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,h),Ti(document,t,m)}));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);Ti(t,a,h),Ti(t,a,m),ki(t,o,p),Ti(t,o,x),ki(document,r,S,g)},function(){ji(document,r,S,g)}]}(o),z=v[0],y=v[1],b=function(){y(l),z(l)};return b(),console.log("Vimal"),setTimeout((function(){return c.setVisibilities({P1:!0})}),2e3),[c,b,function(){y(l),ji(window,f,d)}]}; | ||
//# sourceMappingURL=index.cjs.js.map |
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="1",f="2",l="visibility",v="size",d="defaultMinSize",z="defaultMaxSize",S="resize",h="onNormalSize",p="mouseup",m="mousemove",g="mousedown",x="touchmove",y="touchend",b="touchstart",M=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))},w=function(e,n){var t=ri(i({},e)),r=n.onMinSize,o=void 0===r?G:r,a=n.onMaxSize,u=void 0===a?G:a,s=n.onNormalSize,c=void 0===s?G: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)},E=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},R=function(i,e,n){var t=i.axisSize+(n===o?e:-e),r=E(i,t);return Math.abs(r-t)},C=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))},O=function(i){i.oldVisibleSize=i.size,i.oldVisibility=i.visibility},V=function(i){i.initialSetSize=i.size},I=function(i){i.size=i.initialSetSize},L=function(i){i.sizeRatio=i.size,i.minSizeRatio=i.defaultMinSize,i.maxSizeRatio=i.defaultMaxSize},k=function(i){i.size=i.defaultSize,T(i),C(i,i.defaultVisibility)},T=function(i){i.minSize=i.defaultMinSize,i.maxSize=i.defaultMaxSize},A=function(i){return i.maxSize=i.defaultMaxSize,i.maxSize},j=function(i){return i.minSize=i.defaultMinSize,i.minSize},P=function(i){return i.maxSize=i.size,i.size},D=function(i){return i.minSize=i.size,i.size},H=function(i){return i.size-i.defaultMinSize},N=function(i){return i.defaultMaxSize-i.size},U=function(i){i.size=i.minSize},X=function(i){i.size=i.maxSize},Y=function(i){i.axisSize=i.size},F=function(i){i.api.setSize(K(i))},_=function(i){if(i.visibility&&!i.isHandle){var e,n=i.size,t=i.id;e=n===i.defaultMaxSize?"onMaxSize":n===i.defaultMinSize?"onMinSize":h,i.sizeState!==e&&(i.props[e](t,n),i.sizeState=e)}},B=function(e){var n,t=ei(e,"id",v,"defaultSize",d,l,"storedSize");return i(i({},t),((n={})[z]=e[z].toString(),n))},K=function(i){return i.visibility?i.size:0},q=function(i){return i.visibility?i.sizeRatio:0},J=function(i,e){i.size=e,i.storedSize=e},W=function(i,e,n,t,r,o,a){J(i,e),i.defaultSize=r,i.minSize=n,i.maxSize=t,i.defaultMinSize=n,i.defaultMaxSize=t,i.storedSize=o,i.visibility=a},G=function(i){return i},Q=function(i,e){return i.find((function(i){return i.id===e}))},Z=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===v?K(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},$=function(i,e,n){return void 0===n&&(n="id"),i.findIndex((function(i){return i[n]===e}))},ii=function(i,e,n){return Math.round(function(i,e,n){return Number((i*(n/e)).toFixed(0))}(i,e,n))},ei=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},ni=function(i){return i===r},ti=function(i){return"".concat("resizer","-").concat(i)},ri=function(i){return Object.keys(i).forEach((function(e){void 0===i[e]&&delete i[e]})),i},oi=function(i){return e([],i,!0).reverse()},ai=function(i){return i.filter((function(i){return i}))},ui=function(i){return e([],i,!0).sort((function(i,e){return i>e?-1:e>i?1:0}))},si=function(i,e,n,t){var r;this.sizeState=h,this.storedSize=0,this.axisSize=0,this.oldVisibleSize=0,this.oldVisibility=!0,this.props=w(i,e);var o=this.props,a=o.id,s=o.minSize,c=o.size,f=o.maxSize,l=o.resizerSize,v=o.detectionRadius,d=e.visibility,z=e.vertical,S=e.minMaxUnit,p=e.unit;this.minMaxUnit=null!=S?S:p,p!==u&&M(c,s,f,a);var m=null===(r=d[a])||void 0===r||r;this.defaultVisibility=m;var g=n.getStoredPane(a);if(g){var x=g.size,y=g.defaultMaxSize,b=g.defaultMinSize,E=g.defaultSize,R=g.visibility,C=g.storedSize;W(this,x,b,y,E,C,R)}else W(this,c,s,f,c,c,m);this.id=a,this.vertical=z,L(this),this.isHandle=t,t&&(this.id=ti(a),this.resizerSize=l,this.detectionRadius=v)},ci=function(){function i(){this.isSetRatioMode=!1,this.newVisibilityModel=!1,this.isViewSizeChanged=!1}return i.prototype.register=function(i){Object.assign(this,i)},i}(),fi=function(i){i.forEach(F)},li=function(i){return i.filter((function(i){return i.visibility}))};function vi(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 di=function(i,e,n){return vi(i,P,e,n)},zi=function(i,e,n){return vi(i,D,e,n)},Si=function(i,e,n){return vi(i,K,e,n)},hi=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)},pi=function(i,e,n){var t=i.size+(n===o?e:-e);J(i,t)},mi=function(i,e,n){for(var t,r=0,o=i.length;e>1;)i[t=r%o].visibility&&(pi(i[t],1,n),--e),++r;for(;;){if(i[t=r%o].visibility)return void pi(i[t],e,n);++r}},gi=function(i,e){var n,t=e.axisCoordinate,r=e.decreasingItems,u=e.increasingItems,s=e.direction,c=r,f=u;if(ni(s)?(n=t-i,c=oi(r)):(n=i-t,f=oi(u)),n<0);else if(0===n)return;var l=n;c.forEach((function(i){n=R(i,n,a)})),l-=n,f.forEach((function(i){l=R(i,l,o)}))},xi=function(i){var n,t=i.items,r=i.direction,o=i.handleId,a=li(t),u=$(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(ni(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=ai(n),i.increasingItems=ai(c),i.decreasingItems=ai(s),i.index=$(i.virtualOrderList,o)},yi=function(i){var e=wi(i).containerSize,n=i.virtualOrderList,t=i.index,r=t+1,o=H(n[t]),a=N(n[r]);bi(n,o-a,t,r,0,e);var u=H(n[r]),s=N(n[t]);Mi(n,s-u,t,r,0,e)},bi=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+=j(f)},d=function(){r+=A(l)};switch(!0){case n>0&&t<u:switch(!0){case e<0:v(),a=H(i[s=n-1])+e;break;case 0===e:v(),d(),c=t+1,a=H(i[s=n-1])-N(i[c]);break;case e>0:d(),a=e-N(i[c=t+1])}break;case 0===n&&t<u:switch(!0){case e<0:return v(),r+=di(i,t+1,u),void(l.maxSize=o-r);case 0===e:return v(),d(),void di(i,t+1,u);case e>0:d(),a=e-N(i[c=t+1])}break;case n>0&&t===u:switch(!0){case e<0:v(),a=H(i[s=n-1])+e;break;case 0===e:return v(),d(),void zi(i,0,n-1);case e>0:return d(),r+=zi(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)}}bi(i,a,s,c,r,o)},Mi=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+=A(f)},d=function(){r+=j(l)};switch(!0){case n>0&&t<u:switch(!0){case e<0:v(),a=N(i[s=n-1])+e;break;case 0===e:v(),d(),c=t+1,a=N(i[s=n-1])-H(i[c]);break;case e>0:d(),a=e-H(i[c=t+1])}break;case 0===n&&t<u:switch(!0){case e<0:return v(),r+=zi(i,t+1,u),void(l.minSize=o-r);case 0===e:return v(),d(),void zi(i,t+1,u);case e>0:d(),a=e-H(i[c=t+1])}break;case n>0&&t===u:switch(!0){case e<0:v(),a=N(i[s=n-1])+e;break;case 0===e:return v(),d(),void di(i,0,n-1);case e>0:return d(),r+=di(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)}}Mi(i,a,s,c,r,o)},wi=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-Si(t)}},Ei=function(i,e){void 0===e&&(e=!1);var n=i.panesList,t=i.items,r=wi(i).maxPaneSize,s=function(i){return vi(i,q)}(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=ii(e,n,l[1]);i.minMaxUnit!==u?(r=i.defaultMinSize,o=i.defaultMaxSize):(r=ii(e,n,v),o=ii(e,n,d)),t||(i.minMaxUnit!==u?M(z,r,o,i.id):M(c,s,f,i.id)),W(i,z,r,o,z,z,i.visibility)}(i,r,s,e)}));var c=Si(n),f=r-c,l=f<0?a:o;mi(n,Math.abs(f),l),fi(t)}},Ri=function(i){var e=i.items;return wi(i).containerSize-Si(e)},Ci=function(i,e){var n=i.panesList;e!==u&&n.forEach(L),e!==l&&(i.newVisibilityModel=!1),e!==s&&(i.setSizeKey=null)},Oi=function(i){return"".concat(i,"px")},Vi=function(i){return i?"width":"height"},Ii=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))},Li=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)},ki=function(i){return i<0?r:n},Ti=function(i,e){return function(n){i.style[Vi(e)]=Oi(n)}},Ai=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})},Pi=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(B)};e&&e.setItem(i,JSON.stringify(t))},Hi=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=Q(n,i))&&void 0!==e?e:null},i}(),Ni=function(i,e,n){var t=e-Si(i);if(0!==t&&0!==n.length){var r=t>0?o:a,u=Math.abs(t);if(u<=n.length)mi(n,u,r);else{var s=Si(n),c=[];n.forEach((function(i){var e=K(i),n=function(i,e,n){var t=i.size+(n===o?e:-e);return T(i),E(i,t)===t}(i,Math.round(u*(e/s)),r);n&&c.push(i)})),Ni(i,e,c)}}},Ui=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){Y(e),T(e),i=R(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())},Xi=function(i,n,t,r,o){void 0===r&&(r=u),void 0===o&&(o=!1);var a=i.panesList,s=i.items,c=li(a),f=li(s),l=$(c,n);if(!(-1===l||t<0)){var v="".concat(n,"-").concat(r);i.setSizeKey===v?a.forEach(I):(a.forEach(V),i.setSizeKey=v);var d=Si(c),z=c[l];T(z);var S=z.size,h=E(z,t),p=h-S;if(p){var m=$(f,n);if(r===u){var g=e([],c,!0);g.splice(l,1);var x=d-z.size;Ni(g,x,g)}if(Ui(p,r,f,m),!o){var y=Ri(i);Xi(i,n,h+y,r,!0)}}}};var Yi=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)}})),Fi=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=li(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=K(f),h=a+S-z,p=a+S+v+z;a+=S+v,s.push([h,p,d])}}i.detectionDetails=s},_i=function(e){var o=e.vertical,a=e.children,c=e.unit,f=e.uniqueId,S=e.storageApi,h=e.onResizeStop,p=e.onChangeVisibility,m=e.onResize,g=function(i){return Array.isArray(i)?i:[i]}(a),x=new Hi(f,S,g),y=function(i,e,n){var t=[];return i.forEach((function(i){return t.push(new si(i.props,e,n,!1),new si(i.props,e,n,!0))})),t.pop(),t}(g,e,x),b=function(i){return[i.filter((function(i){return!i.isHandle})),i.filter((function(i){return i.isHandle}))]}(y),M=b[0],w=b[1],E=new ci;E.register({vertical:o,items:y,panesList:M,resizersList:w});var R=function(){return function(i){return i.forEach(Y)}(y)},V=function(){var i=L();h(i),Di(f,S,E),Fi(E)},I=function(){var i=T();p(i)},L=function(){return Z(M,v)},T=function(){return Z(M,l)},A=function(i){w.forEach((function(e){e.api.setMouseDownFlag(E.handleId,i)}))};E.onMouseDown=function(i,e){var n=i[0];E.register({handleId:e,direction:t,axisCoordinate:n}),A(!0),R()};var j=function(i){void 0===i&&(i=""),Ci(E,i),function(i){i.forEach(_)}(M)};E.onMoveResize=function(i){var e,n=i[0],t=i[1];!E.isViewSizeChanged&&t&&(P(n,t),H(n)&&gi(n,E),fi(y),j(),e=L(),m(e))};var P=function(i,e){var n=E.direction,t=ki(e);t!==n&&(E.direction=t,D(i))},D=function(i){E.axisCoordinate=i,xi(E),R(),yi(E),function(i){var e=i.items,n=i.index,t=wi(i).maxTopAxis,r=li(e);i.bottomAxis=t+vi(r,(function(i){return i.maxSize}),0,n-1),i.topAxis=t+function(i,e,n){return vi(i,(function(i){return i.minSize}),0,n)}(r,0,n-1)}(E)},H=function(i){var e=E.topAxis,t=E.bottomAxis;return i<=e?(hi(E,U,X,r),R(),E.axisCoordinate=e,!1):!(i>=t&&(hi(E,X,U,n),R(),E.axisCoordinate=t,1))},N=function(e){var n=E.newVisibilityModel,t=Z(M,l),r=i(i({},t),e);n||(E.newVisibilityModel=!0,M.forEach(O)),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;C(u,e[s]),C(r[a+1],!1),u.visibility&&(-1!==o&&C(r[a-1],!0),o=a)}var c=li(t);0===Si(c)&&c.forEach((function(i){i.size=1}));var f=wi(i).maxPaneSize;Ni(c,f,c)}(E,r);var o=Ri(E);E.isViewSizeChanged=!!o,fi(y),V(),I(),j(l)};E.onMouseUp=function(){V(),A(!1)};var F=function(){fi(y),V(),j(s)},B={restore:function(){!function(i){i.forEach(k),fi(i)}(E.items),j(),V(),I(),E.isViewSizeChanged=!1},setVisibilities:N,getSizes:L,getVisibilities:function(){return T()},getState:function(){return Z(M,v,l,d,z)},setSize:function(i,e,n){Xi(E,i,e,n),F()},setSizeRatio:function(i,e,n){var t=wi(E).containerSize;Xi(E,i,t*e,n),F()}};return E.register({api:B,registerItem:function(i,e){!function(i,e){if(i.api=e,i.isHandle){var n=i.resizerSize;e.setSize(n),W(i,n,n,n,n,n,i.visibility)}}(Q(y,e),i)},registerContainer:function(i){E.getContainerRect=function(){return i.getBoundingClientRect()};var n=e.visibility;if(x.empty&&c===u&&!E.isSetRatioMode)Ei(E),E.isSetRatioMode=!0;else{var t=x.getStorage(f,S).panes;n=Z(t,l)}N(n)},vertical:o,props:e,getPaneSizeStyle:function(i){var e=K(Q(M,i));return function(i,e){var n;return(n={})[Vi(i)]=Oi(e),n}(o,e)}}),E},Bi=function(){return Bi=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},Bi.apply(this,arguments)};"function"==typeof SuppressedError&&SuppressedError;var Ki=function(i,e){e.split(" ").forEach((function(e){return e&&i.classList.add(e)}))},qi=function(i,e){e.split(" ").forEach((function(e){return e&&i.classList.remove(e)}))},Ji=function(i){return document.getElementById(i)},Wi=function(i,e,n){var t=n.panesList,r=n.vertical,o=t[$(t,i)].props,a=o.resizerClass,u=o.activeResizerClass,s=ti(i),c=Ji(s),f=function(i,e){return function(n){i.style[function(i){return i?"minWidth":"minHeight"}(e)]=Oi(n)}}(c,r);Ki(c,"overflow-hidden");var l=function(i,e,n,t){return void 0===n&&(n=""),void 0===t&&(t=""),function(r,o){r===e&&(o?(Ki(i,n),qi(i,t)):(Ki(i,t),qi(i,n)))}}(c,s,u,a);l(s,!1),e({setSize:f,setMouseDownFlag:l},s)},Gi=function(i){var e=function(i){var e=i.panes.map((function(i){return{props:i}}));return Bi({onResize:G,onResizeStop:G,onReady:G,onChangeVisibility:G,vertical:!1,unit:u,resizerSize:2,detectionRadius:6,visibility:{},children:e},i)}(i),n=e.panes,t=e.uniqueId,r=e.unit,o=_i(e),a=o.registerItem,s=o.registerContainer,c=o.api;n.forEach((function(i,t){var r=i.id;!function(i,e,n){var t=n.vertical,r=Ji(i);Ki(r,"overflow-hidden flex-shrink-0"),e({setSize:Ti(r,t)},i)}(r,a,e),t!==n.length-1&&Wi(r,a,o)}));var f=function(){r===u&&(Ei(o,!0),Fi(o),Ci(o))};Ai(window,f,S);var l=function(i,e,n){var t=n.vertical,r=n.unit,o=Ji(i),a=Ii(t,"",r);return Ki(o,a),e(o),o}(t,s,e),v=function(i){var e=i.vertical,n=e?"col-resize":"row-resize",t=function(i,e){return function(n){var t=Li(n,e,i.previousTouchEvent);i.onMoveResize(t)}}(i,e),r=function(){i.onMouseUp(),Pi(document,t,m,x)},o=function(i,e,n){return function(t){var r=i.detectionDetails,o=Li(t,e,{})[0],a=r.map((function(i){var e=i[0],n=i[1];return Math.abs((e+n)/2-o)})),u=ui(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=Li(t,e,{});i.onMouseDown(v,l),n()}}}(i,e,(function(){Ai(document,t,m),ji(document,t,x)}));return[function(t){var a=Yi(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,m),ji(t,a,x),Ai(t,o,g),ji(t,o,b),Ai(document,r,p,y)},function(){Pi(document,r,p,y)}]}(o),d=v[0],z=v[1],h=function(){z(l),d(l)};return h(),console.log("Vimal"),setTimeout((function(){return c.setVisibilities({P1:!0})}),2e3),[c,h,function(){z(l),Pi(window,f,S)}]};export{c as BUTTOM_FIRST,u as RATIO,f as TOP_FIRST,Gi as default}; | ||
//# sourceMappingURL=index.esm.js.map |
{ | ||
"name": "resizable-panes-js", | ||
"version": "6.0.17", | ||
"version": "6.0.18", | ||
"description": "A simple library for resizing elements in the browser", | ||
@@ -5,0 +5,0 @@ "module": "./lib/esm/index.esm.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
356
94136
1