this.primereact=this.primereact||{},this.primereact.splitter=function(e,t,r,n,u,i){"use strict";function l(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var o=l(t);function a(){return a=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=Array(t);r .p-splitter-gutter > .p-splitter-gutter-handle {\n height: 24px;\n width: 100%;\n }\n\n .p-splitter-horizontal > .p-splitter-gutter {\n cursor: col-resize;\n }\n\n .p-splitter-vertical.p-splitter-resizing {\n cursor: row-resize;\n user-select: none;\n }\n\n .p-splitter-vertical > .p-splitter-gutter {\n cursor: row-resize;\n }\n\n .p-splitter-vertical > .p-splitter-gutter > .p-splitter-gutter-handle {\n width: 24px;\n height: 100%;\n }\n}\n\n"}}),E=n.ComponentBase.extend({defaultProps:{__TYPE:"SplitterPanel",className:null,minSize:null,size:null,style:null,children:void 0},getCProps:function(e){return i.ObjectUtils.getComponentProps(e,E.defaultProps)},getCOtherProps:function(e){return i.ObjectUtils.getComponentDiffProps(e,E.defaultProps)},getCProp:function(e,t){return i.ObjectUtils.getComponentProp(e,t,E.defaultProps)}});function D(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function P(e){for(var t=1;t100||e<0)&&(!(t>100||t<0)&&(!(s.children[C.current].props&&s.children[C.current].props.minSize&&s.children[C.current].props.minSize>e)&&!(s.children[C.current+1].props&&s.children[C.current+1].props.minSize&&s.children[C.current+1].props.minSize>t)))},re=o.useCallback((function(){switch(s.stateStorage){case"local":return window.localStorage;case"session":return window.sessionStorage;default:throw new Error(s.stateStorage+' is not a valid value for the state storage, supported values are "local" and "session".')}}),[s.stateStorage]),ne=function(e){i.ObjectUtils.isArray(e)&&re().setItem(s.stateKey,JSON.stringify(e))},ue=o.useCallback((function(){var e=re().getItem(s.stateKey);e&&k(JSON.parse(e))}),[re,s.stateKey]),ie=function(e,t,r){var n="touchstart"===e.type?e.touches[0].pageX:e.pageX,u="touchstart"===e.type?e.touches[0].pageY:e.pageY;d.current=g.current[t],h.current=L?i.DomHandler.getWidth(f.current):i.DomHandler.getHeight(f.current),y.current=!0,b.current=L?n:u,v.current=d.current.previousElementSibling,S.current=d.current.nextElementSibling,r?(w.current=L?i.DomHandler.getOuterWidth(v.current,!0):i.DomHandler.getOuterHeight(v.current,!0),x.current=L?i.DomHandler.getOuterWidth(S.current,!0):i.DomHandler.getOuterHeight(S.current,!0)):(w.current=100*(L?i.DomHandler.getOuterWidth(v.current,!0):i.DomHandler.getOuterHeight(v.current,!0))/h.current,x.current=100*(L?i.DomHandler.getOuterWidth(S.current,!0):i.DomHandler.getOuterHeight(S.current,!0))/h.current),j.current=w.current,H.current=x.current,C.current=t,!X()&&i.DomHandler.addClass(d.current,"p-splitter-gutter-resizing"),d.current.setAttribute("data-p-splitter-gutter-resizing",!0),!X()&&i.DomHandler.addClass(f.current,"p-splitter-resizing"),f.current.setAttribute("data-p-splitter-resizing",!0)},le=function(e){var t,r,n,u=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;arguments.length>2&&void 0!==arguments[2]&&arguments[2]?L?(n=100*(w.current+u)/h.current,r=100*(x.current-u)/h.current):(n=100*(w.current-u)/h.current,r=100*(x.current+u)/h.current):(n=w.current+(t=L?100*("touchmove"===e.type?e.touches[0].pageX:e.pageX)/h.current-100*b.current/h.current:100*("touchmove"===e.type?e.touches[0].pageY:e.pageY)/h.current-100*b.current/h.current),r=x.current-t),se(C.current,n,r)},oe=function(e){var t=m(N);t[C.current]=j.current,t[C.current+1]=H.current,s.onResizeEnd&&s.onResizeEnd({originalEvent:e,sizes:t}),M&&ne(t),k(t),!X()&&i.DomHandler.removeClass(d.current,"p-splitter-gutter-resizing"),g.current&&Object.keys(g.current).forEach((function(e){return g.current[e].setAttribute("data-p-splitter-gutter-resizing",!1)})),!X()&&i.DomHandler.removeClass(f.current,"p-splitter-resizing"),f.current.setAttribute("data-p-splitter-resizing",!1),y.current=!1,h.current=null,b.current=null,v.current=null,S.current=null,w.current=null,j.current=null,x.current=null,H.current=null,C.current=null},ae=function(){de(),oe()},ce=function(e,t){var r=s.children[t].props&&s.children[t].props.minSize||0;switch(e.code){case"ArrowLeft":L&&fe(e,t,-1*s.step),e.preventDefault();break;case"ArrowRight":L&&fe(e,t,s.step),e.preventDefault();break;case"ArrowDown":L||fe(e,t,-1*s.step),e.preventDefault();break;case"ArrowUp":L||fe(e,t,s.step),e.preventDefault();break;case"Home":se(t,100-r,r),e.preventDefault();break;case"End":se(t,r,100-r),e.preventDefault();break;case"NumpadEnter":case"Enter":D.current>=100-(r||5)?se(t,r,100-r):se(t,100-r,r),e.preventDefault()}},se=function(e,t,r){C.current=e,d.current=g.current[e],h.current=L?i.DomHandler.getWidth(f.current):i.DomHandler.getHeight(f.current),v.current=d.current.previousElementSibling,S.current=d.current.nextElementSibling,te(t,r)&&(j.current=t,H.current=r,v.current.style.flexBasis="calc("+t+"% - "+(s.children.length-1)*s.gutterSize+"px)",S.current.style.flexBasis="calc("+r+"% - "+(s.children.length-1)*s.gutterSize+"px)",D.current=parseFloat(t).toFixed(4))},pe=function(e,t,r){ie(e,t,!0),le(e,r,!0)},fe=function(e,t,r){R.current||(R.current=setInterval((function(){pe(e,t,r)}),40))},de=function(){R.current&&(clearInterval(R.current),R.current=null)},me=function(e,t){ie(e,t,!1),q(),Q()},ge=function(e,t){ie(e,t,!1),window.addEventListener("touchmove",he,{passive:!1,cancelable:!1}),window.addEventListener("touchend",ye)},he=function(e){le(e)},ye=function(e){oe(e),window.removeEventListener("touchmove",he),window.removeEventListener("touchend",ye)};o.useImperativeHandle(t,(function(){return{props:s,getElement:function(){return f.current}}})),u.useMountEffect((function(){f.current&&(p.current=i.UniqueComponentId())})),o.useEffect((function(){var e=m(f.current.children).filter((function(e){return"splitterpanel.root"===i.DomHandler.getAttribute(e,"data-pc-section")})),t=[];e.map((function(e,r){D.current=K(N,0),t[r]=K(N,r),e.childNodes&&i.ObjectUtils.isNotEmpty(i.DomHandler.find(e,"[data-pc-name='splitter']")&&i.DomHandler.find(e,"[data-pc-section='root']"))&&(!X()&&i.DomHandler.addClass(e,"p-splitter-panel-nested"),e.setAttribute("data-p-splitter-panel-nested",!0),_(!0))})),k(t)}),[]),o.useEffect((function(){M&&ue()}),[ue,M]);var be=function(e,t){var r=ee(e,"id")||"".concat(p.current,"_").concat(t),n=i.classNames(ee(e,"className"),F("panel.root")),u=l({ref:function(e){return g.current[t]=e},className:F("gutter"),style:L?{width:s.gutterSize+"px"}:{height:s.gutterSize+"px"},onMouseDown:function(e){return me(e,t)},onKeyDown:function(e){return ce(e,t)},onKeyUp:ae,onTouchStart:function(e){return ge(e,t)},onTouchMove:function(e){return he(e)},onTouchEnd:function(e){return ye(e)},"data-p-splitter-gutter-resizing":!1},B("gutter")),a=l({tabIndex:ee(e,"tabIndex")||0,className:F("gutterHandler"),role:"separator","aria-orientation":L?"vertical":"horizontal","aria-controls":r,"aria-label":ee(e,"aria-label"),"aria-labelledby":ee(e,"aria-labelledby"),"aria-valuenow":D.current,"aria-valuetext":parseFloat(D.current).toFixed(0)+"%","aria-valuemin":ee(e,"minSize")||"0","aria-valuemax":"100"},B("gutterHandler")),c=t!==s.children.length-1&&o.createElement("div",u,o.createElement("div",a)),f="calc("+K(N,t)+"% - "+(T-1)*s.gutterSize+"px)",d=l({key:t,id:r,className:n,style:P(P({},ee(e,"style")),{},{flexBasis:f}),role:"presentation","data-p-splitter-panel-nested":!1,onClick:ee(e,"onClick")},B("splitterpanel.root",{context:{nested:U}}));return o.createElement(o.Fragment,null,o.createElement("div",d,ee(e,"children")),c)},ve=l({id:s.id,style:s.style,className:i.classNames(s.className,F("root")),"data-p-splitter-resizing":!1},z.getOtherProps(s),B("root")),Se=o.Children.map(s.children,be);return o.createElement("div",a({ref:f},ve),Se)})));return j.displayName="SplitterPanel",x.displayName="Splitter",e.Splitter=x,e.SplitterPanel=j,Object.defineProperty(e,"__esModule",{value:!0}),e}({},React,primereact.api,primereact.componentbase,primereact.hooks,primereact.utils);