-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path3201.async.js
More file actions
2 lines (2 loc) · 63.7 KB
/
3201.async.js
File metadata and controls
2 lines (2 loc) · 63.7 KB
1
2
!(function(){"use strict";var _i=Object.defineProperty,tn=Object.defineProperties;var en=Object.getOwnPropertyDescriptors;var qt=Object.getOwnPropertySymbols;var ps=Object.prototype.hasOwnProperty,gs=Object.prototype.propertyIsEnumerable;var ue=Math.pow,ms=(B,A,h)=>A in B?_i(B,A,{enumerable:!0,configurable:!0,writable:!0,value:h}):B[A]=h,y=(B,A)=>{for(var h in A||(A={}))ps.call(A,h)&&ms(B,h,A[h]);if(qt)for(var h of qt(A))gs.call(A,h)&&ms(B,h,A[h]);return B},L=(B,A)=>tn(B,en(A));var _t=(B,A)=>{var h={};for(var C in B)ps.call(B,C)&&A.indexOf(C)<0&&(h[C]=B[C]);if(B!=null&&qt)for(var C of qt(B))A.indexOf(C)<0&&gs.call(B,C)&&(h[C]=B[C]);return h};(self.webpackChunk=self.webpackChunk||[]).push([[3201],{79510:function(B,A,h){h.d(A,{n:function(){return Ji}});var C=h(15607),_=h(33295),U=h(49869),O=h(37127);const lt=new WeakMap;function tt(t,e,s){return typeof e=="string"&&(e=e.replace(/\s+/g,"")),`${lt.get(t)}-${s}-${e}`}var x=h(38768),w=h(37873),v=h(67294),et=h(69786);function st(t,e){let s=e==null?void 0:e.isDisabled,[i,a]=(0,v.useState)(!1);return(0,et.b)(()=>{if(t!=null&&t.current&&!s){let d=()=>{if(t.current){let o=(0,w.QL)(t.current,{tabbable:!0});a(!!o.nextNode())}};d();let n=new MutationObserver(d);return n.observe(t.current,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["tabIndex","disabled"]}),()=>{n.disconnect()}}}),s?!1:i}function N(t,e,s){let i=st(s)?void 0:0;var a;const d=tt(e,(a=t.id)!==null&&a!==void 0?a:e==null?void 0:e.selectedKey,"tabpanel"),n=(0,x.b)(L(y({},t),{id:d,"aria-labelledby":tt(e,e==null?void 0:e.selectedKey,"tab")}));return{tabPanelProps:(0,O.d)(n,{tabIndex:i,role:"tabpanel","aria-describedby":t["aria-describedby"],"aria-details":t["aria-details"]})}}var Q=h(2459),D=h(85893),Z=(0,C.Gp)((t,e)=>{var s,i;const J=t,{as:a,tabKey:d,destroyInactiveTabPanel:n,state:o,className:r,slots:l,classNames:c}=J,u=_t(J,["as","tabKey","destroyInactiveTabPanel","state","className","slots","classNames"]),f=a||"div",m=(0,_.gy)(e),{tabPanelProps:p}=N(L(y({},t),{id:String(d)}),o,m),{focusProps:g,isFocused:P,isFocusVisible:T}=(0,Q.F)(),R=o.selectedItem,j=o.collection.getItem(d).props.children,I=(0,U.W)(c==null?void 0:c.panel,r,(s=R==null?void 0:R.props)==null?void 0:s.className),V=d===(R==null?void 0:R.key);return!j||!V&&n?null:(0,D.jsx)(f,L(y({ref:m,"data-focus":P,"data-focus-visible":T,"data-inert":V?void 0:"true",inert:V?void 0:"true"},V&&(0,O.d)(p,g,u)),{className:(i=l.panel)==null?void 0:i.call(l,{class:I}),"data-slot":"panel",children:j}))});Z.displayName="NextUI.TabPanel";var wt=Z,kt=h(27963),nt=h(50262),$t=h(11086),ct=h(65706);const F=t=>t===!1?{block:"end",inline:"nearest"}:(e=>e===Object(e)&&Object.keys(e).length!==0)(t)?t:{block:"start",inline:"nearest"};function ut(t,e){if(!t.isConnected||!(i=>{let a=i;for(;a&&a.parentNode;){if(a.parentNode===document)return!0;a=a.parentNode instanceof ShadowRoot?a.parentNode.host:a.parentNode}return!1})(t))return;if((i=>typeof i=="object"&&typeof i.behavior=="function")(e))return e.behavior((0,ct.Q)(t,e));const s=typeof e=="boolean"||e==null?void 0:e.behavior;for(const{el:i,top:a,left:d}of(0,ct.Q)(t,F(e)))i.scroll({top:a,left:d,behavior:s})}var dt=h(3136),ht=h(32433),ft=h(36400);function mt(t,e,s){let{key:i,isDisabled:a,shouldSelectOnPressUp:d}=t,{selectionManager:n,selectedKey:o}=e,r=i===o,l=a||e.isDisabled||e.selectionManager.isDisabled(i),{itemProps:c,isPressed:u}=(0,ft.C)({selectionManager:n,key:i,ref:s,isDisabled:l,shouldSelectOnPressUp:d,linkBehavior:"selection"}),f=tt(e,i,"tab"),m=tt(e,i,"tabpanel"),{tabIndex:p}=c,g=e.collection.getItem(i),P=(0,dt.z)(g==null?void 0:g.props,{labelable:!0});delete P.id;let T=(0,ht.eY)(g==null?void 0:g.props);return{tabProps:(0,O.d)(P,T,c,{id:f,"aria-selected":r,"aria-disabled":l||void 0,"aria-controls":r?m:void 0,tabIndex:l?void 0:p,role:"tab"}),isSelected:r,isDisabled:l,isPressed:u}}var pt=h(18419),Dt=h(18522),Tt=h(33526),it=h(81662),St=h(45487),K=h(28148),W=h(86917),ot=h(70486),gt=h(83624);const M=(t,e)=>Math.abs(t-e);function Lt(t,e){const s=M(t.x,e.x),i=M(t.y,e.y);return Math.sqrt(ue(s,2)+ue(i,2))}var Ct=h(9403),b=h(25368);class Rt{constructor(e,s,{transformPagePoint:i,contextWindow:a,dragSnapToOrigin:d=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const u=rt(this.lastMoveEventInfo,this.history),f=this.startEvent!==null,m=Lt(u.offset,{x:0,y:0})>=3;if(!f&&!m)return;const{point:p}=u,{timestamp:g}=b.frameData;this.history.push(L(y({},p),{timestamp:g}));const{onStart:P,onMove:T}=this.handlers;f||(P&&P(this.lastMoveEvent,u),this.startEvent=this.lastMoveEvent),T&&T(this.lastMoveEvent,u)},this.handlePointerMove=(u,f)=>{this.lastMoveEvent=u,this.lastMoveEventInfo=vt(f,this.transformPagePoint),b.Wi.update(this.updatePoint,!0)},this.handlePointerUp=(u,f)=>{this.end();const{onEnd:m,onSessionEnd:p,resumeAnimation:g}=this.handlers;if(this.dragSnapToOrigin&&g&&g(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const P=rt(u.type==="pointercancel"?this.lastMoveEventInfo:vt(f,this.transformPagePoint),this.history);this.startEvent&&m&&m(u,P),p&&p(u,P)},!(0,Ct.D)(e))return;this.dragSnapToOrigin=d,this.handlers=s,this.transformPagePoint=i,this.contextWindow=a||window;const n=(0,K.Q)(e),o=vt(n,this.transformPagePoint),{point:r}=o,{timestamp:l}=b.frameData;this.history=[L(y({},r),{timestamp:l})];const{onSessionStart:c}=s;c&&c(e,rt(o,this.history)),this.removeListeners=(0,gt.z)((0,ot.a)(this.contextWindow,"pointermove",this.handlePointerMove),(0,ot.a)(this.contextWindow,"pointerup",this.handlePointerUp),(0,ot.a)(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),(0,b.Pn)(this.updatePoint)}}function vt(t,e){return e?{point:e(t.point)}:t}function yt(t,e){return{x:t.x-e.x,y:t.y-e.y}}function rt({point:t},e){return{point:t,delta:yt(t,bt(e)),offset:yt(t,At(e)),velocity:Et(e,.1)}}function At(t){return t[0]}function bt(t){return t[t.length-1]}function Et(t,e){if(t.length<2)return{x:0,y:0};let s=t.length-1,i=null;const a=bt(t);for(;s>=0&&(i=t[s],!(a.timestamp-i.timestamp>(0,W.w)(e)));)s--;if(!i)return{x:0,y:0};const d=(0,W.X)(a.timestamp-i.timestamp);if(d===0)return{x:0,y:0};const n={x:(a.x-i.x)/d,y:(a.y-i.y)/d};return n.x===1/0&&(n.x=0),n.y===1/0&&(n.y=0),n}var Mt=h(37544),k=h(18402),G=h(23967),E=h(40179);const xt=1e-4,Gt=1-xt,zt=1+xt,It=.01,Ht=0-It,vs=0+It;function $(t){return t.max-t.min}function ys(t,e,s){return Math.abs(t-e)<=s}function de(t,e,s,i=.5){t.origin=i,t.originPoint=(0,E.t)(e.min,e.max,t.origin),t.scale=$(s)/$(e),t.translate=(0,E.t)(s.min,s.max,t.origin)-t.originPoint,(t.scale>=Gt&&t.scale<=zt||isNaN(t.scale))&&(t.scale=1),(t.translate>=Ht&&t.translate<=vs||isNaN(t.translate))&&(t.translate=0)}function Vt(t,e,s,i){de(t.x,e.x,s.x,i?i.originX:void 0),de(t.y,e.y,s.y,i?i.originY:void 0)}function he(t,e,s){t.min=s.min+e.min,t.max=t.min+$(e)}function bs(t,e,s){he(t.x,e.x,s.x),he(t.y,e.y,s.y)}function fe(t,e,s){t.min=e.min-s.min,t.max=t.min+$(e)}function Ot(t,e,s){fe(t.x,e.x,s.x),fe(t.y,e.y,s.y)}var me=h(24169);function xs(t,{min:e,max:s},i){return e!==void 0&&t<e?t=i?(0,E.t)(e,t,i.min):Math.max(t,e):s!==void 0&&t>s&&(t=i?(0,E.t)(s,t,i.max):Math.min(t,s)),t}function pe(t,e,s){return{min:e!==void 0?t.min+e:void 0,max:s!==void 0?t.max+s-(t.max-t.min):void 0}}function Ps(t,{top:e,left:s,bottom:i,right:a}){return{x:pe(t.x,s,a),y:pe(t.y,e,i)}}function ge(t,e){let s=e.min-t.min,i=e.max-t.max;return e.max-e.min<t.max-t.min&&([s,i]=[i,s]),{min:s,max:i}}function Ds(t,e){return{x:ge(t.x,e.x),y:ge(t.y,e.y)}}function Ts(t,e){let s=.5;const i=$(t),a=$(e);return a>i?s=(0,G.Y)(e.min,e.max-i,t.min):i>a&&(s=(0,G.Y)(t.min,t.max-a,e.min)),(0,me.u)(0,1,s)}function Ss(t,e){const s={};return e.min!==void 0&&(s.min=e.min-t.min),e.max!==void 0&&(s.max=e.max-t.min),s}const te=.35;function Ls(t=te){return t===!1?t=0:t===!0&&(t=te),{x:ve(t,"left","right"),y:ve(t,"top","bottom")}}function ve(t,e,s){return{min:ye(t,e),max:ye(t,s)}}function ye(t,e){return typeof t=="number"?t:t[e]||0}var S=h(61512);function z(t){return[t("x"),t("y")]}var Cs=h(56460),be=h(76117),xe=h(18456),jt=h(96190),Pe=h(8443);const De=({current:t})=>t?t.ownerDocument.defaultView:null;var Te=h(30607);const Rs=new WeakMap;class As{constructor(e){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=(0,S.dO)(),this.visualElement=e}start(e,{snapToCursor:s=!1}={}){const{presenceContext:i}=this.visualElement;if(i&&i.isPresent===!1)return;const a=c=>{const{dragSnapToOrigin:u}=this.getProps();u?this.pauseAnimation():this.stopAnimation(),s&&this.snapToCursor((0,K.Q)(c,"page").point)},d=(c,u)=>{const{drag:f,dragPropagation:m,onDragStart:p}=this.getProps();if(f&&!m&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=(0,Mt.fJ)(f),!this.openGlobalLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),z(P=>{let T=this.getAxisMotionValue(P).get()||0;if(jt.aQ.test(T)){const{projection:R}=this.visualElement;if(R&&R.layout){const j=R.layout.layoutBox[P];j&&(T=$(j)*(parseFloat(T)/100))}}this.originPoint[P]=T}),p&&b.Wi.postRender(()=>p(c,u)),(0,Te.K)(this.visualElement,"transform");const{animationState:g}=this.visualElement;g&&g.setActive("whileDrag",!0)},n=(c,u)=>{const{dragPropagation:f,dragDirectionLock:m,onDirectionLock:p,onDrag:g}=this.getProps();if(!f&&!this.openGlobalLock)return;const{offset:P}=u;if(m&&this.currentDirection===null){this.currentDirection=Es(P),this.currentDirection!==null&&p&&p(this.currentDirection);return}this.updateAxis("x",u.point,P),this.updateAxis("y",u.point,P),this.visualElement.render(),g&&g(c,u)},o=(c,u)=>this.stop(c,u),r=()=>z(c=>{var u;return this.getAnimationState(c)==="paused"&&((u=this.getAxisMotionValue(c).animation)===null||u===void 0?void 0:u.play())}),{dragSnapToOrigin:l}=this.getProps();this.panSession=new Rt(e,{onSessionStart:a,onStart:d,onMove:n,onSessionEnd:o,resumeAnimation:r},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:l,contextWindow:De(this.visualElement)})}stop(e,s){const i=this.isDragging;if(this.cancel(),!i)return;const{velocity:a}=s;this.startAnimation(a);const{onDragEnd:d}=this.getProps();d&&b.Wi.postRender(()=>d(e,s))}cancel(){this.isDragging=!1;const{projection:e,animationState:s}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:i}=this.getProps();!i&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),s&&s.setActive("whileDrag",!1)}updateAxis(e,s,i){const{drag:a}=this.getProps();if(!i||!Xt(e,a,this.currentDirection))return;const d=this.getAxisMotionValue(e);let n=this.originPoint[e]+i[e];this.constraints&&this.constraints[e]&&(n=xs(n,this.constraints[e],this.elastic[e])),d.set(n)}resolveConstraints(){var e;const{dragConstraints:s,dragElastic:i}=this.getProps(),a=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(e=this.visualElement.projection)===null||e===void 0?void 0:e.layout,d=this.constraints;s&&(0,k.I)(s)?this.constraints||(this.constraints=this.resolveRefConstraints()):s&&a?this.constraints=Ps(a.layoutBox,s):this.constraints=!1,this.elastic=Ls(i),d!==this.constraints&&a&&this.constraints&&!this.hasMutatedConstraints&&z(n=>{this.constraints!==!1&&this.getAxisMotionValue(n)&&(this.constraints[n]=Ss(a.layoutBox[n],this.constraints[n]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:s}=this.getProps();if(!e||!(0,k.I)(e))return!1;const i=e.current;(0,St.k)(i!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");const{projection:a}=this.visualElement;if(!a||!a.layout)return!1;const d=(0,Cs.z)(i,a.root,this.visualElement.getTransformPagePoint());let n=Ds(a.layout.layoutBox,d);if(s){const o=s((0,be.z2)(n));this.hasMutatedConstraints=!!o,o&&(n=(0,be.i8)(o))}return n}startAnimation(e){const{drag:s,dragMomentum:i,dragElastic:a,dragTransition:d,dragSnapToOrigin:n,onDragTransitionEnd:o}=this.getProps(),r=this.constraints||{},l=z(c=>{if(!Xt(c,s,this.currentDirection))return;let u=r&&r[c]||{};n&&(u={min:0,max:0});const f=a?200:1e6,m=a?40:1e7,p=y(y({type:"inertia",velocity:i?e[c]:0,bounceStiffness:f,bounceDamping:m,timeConstant:750,restDelta:1,restSpeed:10},d),u);return this.startAxisValueAnimation(c,p)});return Promise.all(l).then(o)}startAxisValueAnimation(e,s){const i=this.getAxisMotionValue(e);return(0,Te.K)(this.visualElement,e),i.start((0,Pe.v)(e,i,0,s,this.visualElement,!1))}stopAnimation(){z(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){z(e=>{var s;return(s=this.getAxisMotionValue(e).animation)===null||s===void 0?void 0:s.pause()})}getAnimationState(e){var s;return(s=this.getAxisMotionValue(e).animation)===null||s===void 0?void 0:s.state}getAxisMotionValue(e){const s=`_drag${e.toUpperCase()}`,i=this.visualElement.getProps(),a=i[s];return a||this.visualElement.getValue(e,(i.initial?i.initial[e]:void 0)||0)}snapToCursor(e){z(s=>{const{drag:i}=this.getProps();if(!Xt(s,i,this.currentDirection))return;const{projection:a}=this.visualElement,d=this.getAxisMotionValue(s);if(a&&a.layout){const{min:n,max:o}=a.layout.layoutBox[s];d.set(e[s]-(0,E.t)(n,o,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:s}=this.getProps(),{projection:i}=this.visualElement;if(!(0,k.I)(s)||!i||!this.constraints)return;this.stopAnimation();const a={x:0,y:0};z(n=>{const o=this.getAxisMotionValue(n);if(o&&this.constraints!==!1){const r=o.get();a[n]=Ts({min:r,max:r},this.constraints[n])}});const{transformTemplate:d}=this.visualElement.getProps();this.visualElement.current.style.transform=d?d({},""):"none",i.root&&i.root.updateScroll(),i.updateLayout(),this.resolveConstraints(),z(n=>{if(!Xt(n,e,null))return;const o=this.getAxisMotionValue(n),{min:r,max:l}=this.constraints[n];o.set((0,E.t)(r,l,a[n]))})}addListeners(){if(!this.visualElement.current)return;Rs.set(this.visualElement,this);const e=this.visualElement.current,s=(0,ot.a)(e,"pointerdown",r=>{const{drag:l,dragListener:c=!0}=this.getProps();l&&c&&this.start(r)}),i=()=>{const{dragConstraints:r}=this.getProps();(0,k.I)(r)&&r.current&&(this.constraints=this.resolveRefConstraints())},{projection:a}=this.visualElement,d=a.addEventListener("measure",i);a&&!a.layout&&(a.root&&a.root.updateScroll(),a.updateLayout()),b.Wi.read(i);const n=(0,xe.E)(window,"resize",()=>this.scalePositionWithinConstraints()),o=a.addEventListener("didUpdate",({delta:r,hasLayoutChanged:l})=>{this.isDragging&&l&&(z(c=>{const u=this.getAxisMotionValue(c);u&&(this.originPoint[c]+=r[c].translate,u.set(u.get()+r[c].translate))}),this.visualElement.render())});return()=>{n(),s(),d(),o&&o()}}getProps(){const e=this.visualElement.getProps(),{drag:s=!1,dragDirectionLock:i=!1,dragPropagation:a=!1,dragConstraints:d=!1,dragElastic:n=te,dragMomentum:o=!0}=e;return L(y({},e),{drag:s,dragDirectionLock:i,dragPropagation:a,dragConstraints:d,dragElastic:n,dragMomentum:o})}}function Xt(t,e,s){return(e===!0||e===t)&&(s===null||s===t)}function Es(t,e=10){let s=null;return Math.abs(t.y)>e?s="y":Math.abs(t.x)>e&&(s="x"),s}class Ms extends Tt.L{constructor(e){super(e),this.removeGroupControls=it.Z,this.removeListeners=it.Z,this.controls=new As(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||it.Z}unmount(){this.removeGroupControls(),this.removeListeners()}}const Se=t=>(e,s)=>{t&&b.Wi.postRender(()=>t(e,s))};class js extends Tt.L{constructor(){super(...arguments),this.removePointerDownListener=it.Z}onPointerDown(e){this.session=new Rt(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:De(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:s,onPan:i,onPanEnd:a}=this.node.getProps();return{onSessionStart:Se(e),onStart:Se(s),onMove:i,onEnd:(d,n)=>{delete this.session,a&&b.Wi.postRender(()=>a(d,n))}}}mount(){this.removePointerDownListener=(0,ot.a)(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}var Bs=h(240);function ws(){const t=(0,v.useContext)(Bs.O);if(t===null)return[!0,null];const{isPresent:e,onExitComplete:s,register:i}=t,a=(0,v.useId)();(0,v.useEffect)(()=>i(a),[]);const d=(0,v.useCallback)(()=>s&&s(a),[a,s]);return!e&&s?[!1,d]:[!0]}function sn(){return Is(useContext(PresenceContext))}function Is(t){return t===null?!0:t.isPresent}var ee=h(25364),Vs=h(41705);const Yt={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Le(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const Ut={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(jt.px.test(t))t=parseFloat(t);else return t;const s=Le(t,e.target.x),i=Le(t,e.target.y);return`${s}% ${i}%`}};var Ce=h(56737);const Os={correct:(t,{treeScale:e,projectionDelta:s})=>{const i=t,a=Ce.P.parse(t);if(a.length>5)return i;const d=Ce.P.createTransformer(t),n=typeof a[0]!="number"?1:0,o=s.x.scale*e.x,r=s.y.scale*e.y;a[0+n]/=o,a[1+n]/=r;const l=(0,E.t)(o,r,.5);return typeof a[2+n]=="number"&&(a[2+n]/=l),typeof a[3+n]=="number"&&(a[3+n]/=l),d(a)}};var se=h(64561),Re=h(83582);class Us extends v.Component{componentDidMount(){const{visualElement:e,layoutGroup:s,switchLayoutGroup:i,layoutId:a}=this.props,{projection:d}=e;(0,se.B)(Ns),d&&(s.group&&s.group.add(d),i&&i.register&&a&&i.register(d),d.root.didUpdate(),d.addEventListener("animationComplete",()=>{this.safeToRemove()}),d.setOptions(L(y({},d.options),{onExitComplete:()=>this.safeToRemove()}))),Yt.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:s,visualElement:i,drag:a,isPresent:d}=this.props,n=i.projection;return n&&(n.isPresent=d,a||e.layoutDependency!==s||s===void 0?n.willUpdate():this.safeToRemove(),e.isPresent!==d&&(d?n.promote():n.relegate()||b.Wi.postRender(()=>{const o=n.getStack();(!o||!o.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),Re.g.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:s,switchLayoutGroup:i}=this.props,{projection:a}=e;a&&(a.scheduleCheckAfterUnmount(),s&&s.group&&s.group.remove(a),i&&i.deregister&&i.deregister(a))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function Ae(t){const[e,s]=ws(),i=(0,v.useContext)(ee.p);return(0,D.jsx)(Us,L(y({},t),{layoutGroup:i,switchLayoutGroup:(0,v.useContext)(Vs.g),isPresent:e,safeToRemove:s}))}const Ns={borderRadius:L(y({},Ut),{applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]}),borderTopLeftRadius:Ut,borderTopRightRadius:Ut,borderBottomLeftRadius:Ut,borderBottomRightRadius:Ut,boxShadow:Os};var Fs=h(21560),Ks=h(27255);const Ee=["TopLeft","TopRight","BottomLeft","BottomRight"],Ws=Ee.length,Me=t=>typeof t=="string"?parseFloat(t):t,je=t=>typeof t=="number"||jt.px.test(t);function ks(t,e,s,i,a,d){a?(t.opacity=(0,E.t)(0,s.opacity!==void 0?s.opacity:1,$s(i)),t.opacityExit=(0,E.t)(e.opacity!==void 0?e.opacity:1,0,Gs(i))):d&&(t.opacity=(0,E.t)(e.opacity!==void 0?e.opacity:1,s.opacity!==void 0?s.opacity:1,i));for(let n=0;n<Ws;n++){const o=`border${Ee[n]}Radius`;let r=Be(e,o),l=Be(s,o);if(r===void 0&&l===void 0)continue;r||(r=0),l||(l=0),r===0||l===0||je(r)===je(l)?(t[o]=Math.max((0,E.t)(Me(r),Me(l),i),0),(jt.aQ.test(l)||jt.aQ.test(r))&&(t[o]+="%")):t[o]=l}(e.rotate||s.rotate)&&(t.rotate=(0,E.t)(e.rotate||0,s.rotate||0,i))}function Be(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const $s=we(0,.5,Ks.Bn),Gs=we(.5,.95,it.Z);function we(t,e,s){return i=>i<t?0:i>e?1:s((0,G.Y)(t,e,i))}function Ie(t,e){t.min=e.min,t.max=e.max}function H(t,e){Ie(t.x,e.x),Ie(t.y,e.y)}function Ve(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}var X=h(16e3);function Oe(t,e,s,i,a){return t-=e,t=(0,X.q2)(t,1/s,i),a!==void 0&&(t=(0,X.q2)(t,1/a,i)),t}function zs(t,e=0,s=1,i=.5,a,d=t,n=t){if(jt.aQ.test(e)&&(e=parseFloat(e),e=(0,E.t)(n.min,n.max,e/100)-n.min),typeof e!="number")return;let o=(0,E.t)(d.min,d.max,i);t===d&&(o-=e),t.min=Oe(t.min,e,s,o,a),t.max=Oe(t.max,e,s,o,a)}function Ue(t,e,[s,i,a],d,n){zs(t,e[s],e[i],e[a],e.scale,d,n)}const Hs=["x","scaleX","originX"],Xs=["y","scaleY","originY"];function Ne(t,e,s,i){Ue(t.x,e,Hs,s?s.x:void 0,i?i.x:void 0),Ue(t.y,e,Xs,s?s.y:void 0,i?i.y:void 0)}var Ys=h(13918);function Fe(t){return t.translate===0&&t.scale===1}function Ke(t){return Fe(t.x)&&Fe(t.y)}function We(t,e){return t.min===e.min&&t.max===e.max}function Qs(t,e){return We(t.x,e.x)&&We(t.y,e.y)}function ke(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function $e(t,e){return ke(t.x,e.x)&&ke(t.y,e.y)}function Ge(t){return $(t.x)/$(t.y)}function ze(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}var Qt=h(10010);class Zs{constructor(){this.members=[]}add(e){(0,Qt.y4)(this.members,e),e.scheduleRender()}remove(e){if((0,Qt.cl)(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const s=this.members[this.members.length-1];s&&this.promote(s)}}relegate(e){const s=this.members.findIndex(a=>e===a);if(s===0)return!1;let i;for(let a=s;a>=0;a--){const d=this.members[a];if(d.isPresent!==!1){i=d;break}}return i?(this.promote(i),!0):!1}promote(e,s){const i=this.lead;if(e!==i&&(this.prevLead=i,this.lead=e,e.show(),i)){i.instance&&i.scheduleRender(),e.scheduleRender(),e.resumeFrom=i,s&&(e.resumeFrom.preserveOpacity=!0),i.snapshot&&(e.snapshot=i.snapshot,e.snapshot.latestValues=i.animationValues||i.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0);const{crossfade:a}=e.options;a===!1&&i.hide()}}exitAnimationComplete(){this.members.forEach(e=>{const{options:s,resumingFrom:i}=e;s.onExitComplete&&s.onExitComplete(),i&&i.options.onExitComplete&&i.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function Js(t,e,s){let i="";const a=t.x.translate/e.x,d=t.y.translate/e.y,n=(s==null?void 0:s.z)||0;if((a||d||n)&&(i=`translate3d(${a}px, ${d}px, ${n}px) `),(e.x!==1||e.y!==1)&&(i+=`scale(${1/e.x}, ${1/e.y}) `),s){const{transformPerspective:l,rotate:c,rotateX:u,rotateY:f,skewX:m,skewY:p}=s;l&&(i=`perspective(${l}px) ${i}`),c&&(i+=`rotate(${c}deg) `),u&&(i+=`rotateX(${u}deg) `),f&&(i+=`rotateY(${f}deg) `),m&&(i+=`skewX(${m}deg) `),p&&(i+=`skewY(${p}deg) `)}const o=t.x.scale*e.x,r=t.y.scale*e.y;return(o!==1||r!==1)&&(i+=`scale(${o}, ${r})`),i||"none"}var at=h(99527);const qs=(t,e)=>t.depth-e.depth;class _s{constructor(){this.children=[],this.isDirty=!1}add(e){(0,Qt.y4)(this.children,e),this.isDirty=!0}remove(e){(0,Qt.cl)(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(qs),this.isDirty=!1,this.children.forEach(e)}}var ie=h(16399),He=h(1117);function Xe(t,e){const s=He.X.now(),i=({timestamp:a})=>{const d=a-s;d>=e&&((0,b.Pn)(i),t(d-e))};return b.Wi.read(i,!0),()=>(0,b.Pn)(i)}function nn(t,e){return Xe(t,secondsToMilliseconds(e))}function ti(t){return t instanceof SVGElement&&t.tagName!=="svg"}var ei=h(33234),si=h(40406);function ii(t,e,s){const i=(0,si.i)(t)?t:(0,ei.BX)(t);return i.start((0,Pe.v)("",i,e,s)),i.animation}var ni=h(93785);const Pt={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},Nt=typeof window!="undefined"&&window.MotionDebug!==void 0,ne=["","X","Y","Z"],oi={visibility:"hidden"},Ye=1e3;let ai=0;function oe(t,e,s,i){const{latestValues:a}=e;a[t]&&(s[t]=a[t],e.setStaticValue(t,0),i&&(i[t]=0))}function Qe(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const s=(0,ni.s)(e);if(window.MotionHasOptimisedAnimation(s,"transform")){const{layout:a,layoutId:d}=t.options;window.MotionCancelOptimisedAnimation(s,"transform",b.Wi,!(a||d))}const{parent:i}=t;i&&!i.hasCheckedOptimisedAppear&&Qe(i)}function Ze({attachResizeListener:t,defaultParent:e,measureScroll:s,checkIsScrollRoot:i,resetTransform:a}){return class{constructor(n={},o=e==null?void 0:e()){this.id=ai++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,Nt&&(Pt.totalNodes=Pt.resolvedTargetDeltas=Pt.recalculatedProjection=0),this.nodes.forEach(ci),this.nodes.forEach(mi),this.nodes.forEach(pi),this.nodes.forEach(ui),Nt&&window.MotionDebug.record(Pt)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=n,this.root=o?o.root||o:this,this.path=o?[...o.path,o]:[],this.parent=o,this.depth=o?o.depth+1:0;for(let r=0;r<this.path.length;r++)this.path[r].shouldResetTransform=!0;this.root===this&&(this.nodes=new _s)}addEventListener(n,o){return this.eventHandlers.has(n)||this.eventHandlers.set(n,new Fs.L),this.eventHandlers.get(n).add(o)}notifyListeners(n,...o){const r=this.eventHandlers.get(n);r&&r.notify(...o)}hasListeners(n){return this.eventHandlers.has(n)}mount(n,o=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=ti(n),this.instance=n;const{layoutId:r,layout:l,visualElement:c}=this.options;if(c&&!c.current&&c.mount(n),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),o&&(l||r)&&(this.isLayoutDirty=!0),t){let u;const f=()=>this.root.updateBlockedByResize=!1;t(n,()=>{this.root.updateBlockedByResize=!0,u&&u(),u=Xe(f,250),Yt.hasAnimatedSinceResize&&(Yt.hasAnimatedSinceResize=!1,this.nodes.forEach(qe))})}r&&this.root.registerSharedNode(r,this),this.options.animate!==!1&&c&&(r||l)&&this.addEventListener("didUpdate",({delta:u,hasLayoutChanged:f,hasRelativeTargetChanged:m,layout:p})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const g=this.options.transition||c.getDefaultTransition()||xi,{onLayoutAnimationStart:P,onLayoutAnimationComplete:T}=c.getProps(),R=!this.targetLayout||!$e(this.targetLayout,p)||m,j=!f&&m;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||j||f&&(R||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(u,j);const I=L(y({},(0,Ys.e)(g,"layout")),{onPlay:P,onComplete:T});(c.shouldReduceMotion||this.options.layoutRoot)&&(I.delay=0,I.type=!1),this.startAnimation(I)}else f||qe(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=p})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const n=this.getStack();n&&n.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,(0,b.Pn)(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(gi),this.animationId++)}getTransformTemplate(){const{visualElement:n}=this.options;return n&&n.getProps().transformTemplate}willUpdate(n=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Qe(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let c=0;c<this.path.length;c++){const u=this.path[c];u.shouldResetTransform=!0,u.updateScroll("snapshot"),u.options.layoutRoot&&u.willUpdate(!1)}const{layoutId:o,layout:r}=this.options;if(o===void 0&&!r)return;const l=this.getTransformTemplate();this.prevTransformTemplateValue=l?l(this.latestValues,""):void 0,this.updateSnapshot(),n&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(Je);return}this.isUpdating||this.nodes.forEach(hi),this.isUpdating=!1,this.nodes.forEach(fi),this.nodes.forEach(ri),this.nodes.forEach(li),this.clearAllSnapshots();const o=He.X.now();b.frameData.delta=(0,me.u)(0,1e3/60,o-b.frameData.timestamp),b.frameData.timestamp=o,b.frameData.isProcessing=!0,b.yL.update.process(b.frameData),b.yL.preRender.process(b.frameData),b.yL.render.process(b.frameData),b.frameData.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Re.g.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(di),this.sharedNodes.forEach(vi)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,b.Wi.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){b.Wi.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let r=0;r<this.path.length;r++)this.path[r].updateScroll();const n=this.layout;this.layout=this.measure(!1),this.layoutCorrected=(0,S.dO)(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:o}=this.options;o&&o.notify("LayoutMeasure",this.layout.layoutBox,n?n.layoutBox:void 0)}updateScroll(n="measure"){let o=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===n&&(o=!1),o){const r=i(this.instance);this.scroll={animationId:this.root.animationId,phase:n,isRoot:r,offset:s(this.instance),wasRoot:this.scroll?this.scroll.isRoot:r}}}resetTransform(){if(!a)return;const n=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,o=this.projectionDelta&&!Ke(this.projectionDelta),r=this.getTransformTemplate(),l=r?r(this.latestValues,""):void 0,c=l!==this.prevTransformTemplateValue;n&&(o||(0,at.ud)(this.latestValues)||c)&&(a(this.instance,l),this.shouldResetTransform=!1,this.scheduleRender())}measure(n=!0){const o=this.measurePageBox();let r=this.removeElementScroll(o);return n&&(r=this.removeTransform(r)),Pi(r),{animationId:this.root.animationId,measuredBox:o,layoutBox:r,latestValues:{},source:this.id}}measurePageBox(){var n;const{visualElement:o}=this.options;if(!o)return(0,S.dO)();const r=o.measureViewportBox();if(!(((n=this.scroll)===null||n===void 0?void 0:n.wasRoot)||this.path.some(Di))){const{scroll:c}=this.root;c&&((0,X.am)(r.x,c.offset.x),(0,X.am)(r.y,c.offset.y))}return r}removeElementScroll(n){var o;const r=(0,S.dO)();if(H(r,n),!((o=this.scroll)===null||o===void 0)&&o.wasRoot)return r;for(let l=0;l<this.path.length;l++){const c=this.path[l],{scroll:u,options:f}=c;c!==this.root&&u&&f.layoutScroll&&(u.wasRoot&&H(r,n),(0,X.am)(r.x,u.offset.x),(0,X.am)(r.y,u.offset.y))}return r}applyTransform(n,o=!1){const r=(0,S.dO)();H(r,n);for(let l=0;l<this.path.length;l++){const c=this.path[l];!o&&c.options.layoutScroll&&c.scroll&&c!==c.root&&(0,X.D2)(r,{x:-c.scroll.offset.x,y:-c.scroll.offset.y}),(0,at.ud)(c.latestValues)&&(0,X.D2)(r,c.latestValues)}return(0,at.ud)(this.latestValues)&&(0,X.D2)(r,this.latestValues),r}removeTransform(n){const o=(0,S.dO)();H(o,n);for(let r=0;r<this.path.length;r++){const l=this.path[r];if(!l.instance||!(0,at.ud)(l.latestValues))continue;(0,at.Lj)(l.latestValues)&&l.updateSnapshot();const c=(0,S.dO)(),u=l.measurePageBox();H(c,u),Ne(o,l.latestValues,l.snapshot?l.snapshot.layoutBox:void 0,c)}return(0,at.ud)(this.latestValues)&&Ne(o,this.latestValues),o}setTargetDelta(n){this.targetDelta=n,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(n){this.options=L(y(y({},this.options),n),{crossfade:n.crossfade!==void 0?n.crossfade:!0})}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==b.frameData.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(n=!1){var o;const r=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=r.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=r.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=r.isSharedProjectionDirty);const l=!!this.resumingFrom||this!==r;if(!(n||l&&this.isSharedProjectionDirty||this.isProjectionDirty||!((o=this.parent)===null||o===void 0)&&o.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:u,layoutId:f}=this.options;if(!(!this.layout||!(u||f))){if(this.resolvedRelativeTargetAt=b.frameData.timestamp,!this.targetDelta&&!this.relativeTarget){const m=this.getClosestProjectingParent();m&&m.layout&&this.animationProgress!==1?(this.relativeParent=m,this.forceRelativeParentToResolveTarget(),this.relativeTarget=(0,S.dO)(),this.relativeTargetOrigin=(0,S.dO)(),Ot(this.relativeTargetOrigin,this.layout.layoutBox,m.layout.layoutBox),H(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=(0,S.dO)(),this.targetWithTransforms=(0,S.dO)()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),bs(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):H(this.target,this.layout.layoutBox),(0,X.o2)(this.target,this.targetDelta)):H(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const m=this.getClosestProjectingParent();m&&!!m.resumingFrom==!!this.resumingFrom&&!m.options.layoutScroll&&m.target&&this.animationProgress!==1?(this.relativeParent=m,this.forceRelativeParentToResolveTarget(),this.relativeTarget=(0,S.dO)(),this.relativeTargetOrigin=(0,S.dO)(),Ot(this.relativeTargetOrigin,this.target,m.target),H(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}Nt&&Pt.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||(0,at.Lj)(this.parent.latestValues)||(0,at.D_)(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var n;const o=this.getLead(),r=!!this.resumingFrom||this!==o;let l=!0;if((this.isProjectionDirty||!((n=this.parent)===null||n===void 0)&&n.isProjectionDirty)&&(l=!1),r&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(l=!1),this.resolvedRelativeTargetAt===b.frameData.timestamp&&(l=!1),l)return;const{layout:c,layoutId:u}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(c||u))return;H(this.layoutCorrected,this.layout.layoutBox);const f=this.treeScale.x,m=this.treeScale.y;(0,X.YY)(this.layoutCorrected,this.treeScale,this.path,r),o.layout&&!o.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(o.target=o.layout.layoutBox,o.targetWithTransforms=(0,S.dO)());const{target:p}=o;if(!p){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Ve(this.prevProjectionDelta.x,this.projectionDelta.x),Ve(this.prevProjectionDelta.y,this.projectionDelta.y)),Vt(this.projectionDelta,this.layoutCorrected,p,this.latestValues),(this.treeScale.x!==f||this.treeScale.y!==m||!ze(this.projectionDelta.x,this.prevProjectionDelta.x)||!ze(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",p)),Nt&&Pt.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(n=!0){var o;if((o=this.options.visualElement)===null||o===void 0||o.scheduleRender(),n){const r=this.getStack();r&&r.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=(0,S.wc)(),this.projectionDelta=(0,S.wc)(),this.projectionDeltaWithTransform=(0,S.wc)()}setAnimationOrigin(n,o=!1){const r=this.snapshot,l=r?r.latestValues:{},c=y({},this.latestValues),u=(0,S.wc)();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!o;const f=(0,S.dO)(),m=r?r.source:void 0,p=this.layout?this.layout.source:void 0,g=m!==p,P=this.getStack(),T=!P||P.members.length<=1,R=!!(g&&!T&&this.options.crossfade===!0&&!this.path.some(bi));this.animationProgress=0;let j;this.mixTargetDelta=I=>{const V=I/1e3;_e(u.x,n.x,V),_e(u.y,n.y,V),this.setTargetDelta(u),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Ot(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox),yi(this.relativeTarget,this.relativeTargetOrigin,f,V),j&&Qs(this.relativeTarget,j)&&(this.isProjectionDirty=!1),j||(j=(0,S.dO)()),H(j,this.relativeTarget)),g&&(this.animationValues=c,ks(c,l,this.latestValues,V,R,T)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=V},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(n){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&((0,b.Pn)(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=b.Wi.update(()=>{Yt.hasAnimatedSinceResize=!0,this.currentAnimation=ii(0,Ye,L(y({},n),{onUpdate:o=>{this.mixTargetDelta(o),n.onUpdate&&n.onUpdate(o)},onComplete:()=>{n.onComplete&&n.onComplete(),this.completeAnimation()}})),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const n=this.getStack();n&&n.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Ye),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const n=this.getLead();let{targetWithTransforms:o,target:r,layout:l,latestValues:c}=n;if(!(!o||!r||!l)){if(this!==n&&this.layout&&l&&ns(this.options.animationType,this.layout.layoutBox,l.layoutBox)){r=this.target||(0,S.dO)();const u=$(this.layout.layoutBox.x);r.x.min=n.target.x.min,r.x.max=r.x.min+u;const f=$(this.layout.layoutBox.y);r.y.min=n.target.y.min,r.y.max=r.y.min+f}H(o,r),(0,X.D2)(o,c),Vt(this.projectionDeltaWithTransform,this.layoutCorrected,o,c)}}registerSharedNode(n,o){this.sharedNodes.has(n)||this.sharedNodes.set(n,new Zs),this.sharedNodes.get(n).add(o);const l=o.options.initialPromotionConfig;o.promote({transition:l?l.transition:void 0,preserveFollowOpacity:l&&l.shouldPreserveFollowOpacity?l.shouldPreserveFollowOpacity(o):void 0})}isLead(){const n=this.getStack();return n?n.lead===this:!0}getLead(){var n;const{layoutId:o}=this.options;return o?((n=this.getStack())===null||n===void 0?void 0:n.lead)||this:this}getPrevLead(){var n;const{layoutId:o}=this.options;return o?(n=this.getStack())===null||n===void 0?void 0:n.prevLead:void 0}getStack(){const{layoutId:n}=this.options;if(n)return this.root.sharedNodes.get(n)}promote({needsReset:n,transition:o,preserveFollowOpacity:r}={}){const l=this.getStack();l&&l.promote(this,r),n&&(this.projectionDelta=void 0,this.needsReset=!0),o&&this.setOptions({transition:o})}relegate(){const n=this.getStack();return n?n.relegate(this):!1}resetSkewAndRotation(){const{visualElement:n}=this.options;if(!n)return;let o=!1;const{latestValues:r}=n;if((r.z||r.rotate||r.rotateX||r.rotateY||r.rotateZ||r.skewX||r.skewY)&&(o=!0),!o)return;const l={};r.z&&oe("z",n,l,this.animationValues);for(let c=0;c<ne.length;c++)oe(`rotate${ne[c]}`,n,l,this.animationValues),oe(`skew${ne[c]}`,n,l,this.animationValues);n.render();for(const c in l)n.setStaticValue(c,l[c]),this.animationValues&&(this.animationValues[c]=l[c]);n.scheduleRender()}getProjectionStyles(n){var o,r;if(!this.instance||this.isSVG)return;if(!this.isVisible)return oi;const l={visibility:""},c=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,l.opacity="",l.pointerEvents=(0,ie.b)(n==null?void 0:n.pointerEvents)||"",l.transform=c?c(this.latestValues,""):"none",l;const u=this.getLead();if(!this.projectionDelta||!this.layout||!u.target){const g={};return this.options.layoutId&&(g.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,g.pointerEvents=(0,ie.b)(n==null?void 0:n.pointerEvents)||""),this.hasProjected&&!(0,at.ud)(this.latestValues)&&(g.transform=c?c({},""):"none",this.hasProjected=!1),g}const f=u.animationValues||u.latestValues;this.applyTransformsToTarget(),l.transform=Js(this.projectionDeltaWithTransform,this.treeScale,f),c&&(l.transform=c(f,l.transform));const{x:m,y:p}=this.projectionDelta;l.transformOrigin=`${m.origin*100}% ${p.origin*100}% 0`,u.animationValues?l.opacity=u===this?(r=(o=f.opacity)!==null&&o!==void 0?o:this.latestValues.opacity)!==null&&r!==void 0?r:1:this.preserveOpacity?this.latestValues.opacity:f.opacityExit:l.opacity=u===this?f.opacity!==void 0?f.opacity:"":f.opacityExit!==void 0?f.opacityExit:0;for(const g in se.P){if(f[g]===void 0)continue;const{correct:P,applyTo:T}=se.P[g],R=l.transform==="none"?f[g]:P(f[g],u);if(T){const j=T.length;for(let I=0;I<j;I++)l[T[I]]=R}else l[g]=R}return this.options.layoutId&&(l.pointerEvents=u===this?(0,ie.b)(n==null?void 0:n.pointerEvents)||"":"none"),l}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(n=>{var o;return(o=n.currentAnimation)===null||o===void 0?void 0:o.stop()}),this.root.nodes.forEach(Je),this.root.sharedNodes.clear()}}}function ri(t){t.updateLayout()}function li(t){var e;const s=((e=t.resumeFrom)===null||e===void 0?void 0:e.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&s&&t.hasListeners("didUpdate")){const{layoutBox:i,measuredBox:a}=t.layout,{animationType:d}=t.options,n=s.source!==t.layout.source;d==="size"?z(u=>{const f=n?s.measuredBox[u]:s.layoutBox[u],m=$(f);f.min=i[u].min,f.max=f.min+m}):ns(d,s.layoutBox,i)&&z(u=>{const f=n?s.measuredBox[u]:s.layoutBox[u],m=$(i[u]);f.max=f.min+m,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[u].max=t.relativeTarget[u].min+m)});const o=(0,S.wc)();Vt(o,i,s.layoutBox);const r=(0,S.wc)();n?Vt(r,t.applyTransform(a,!0),s.measuredBox):Vt(r,i,s.layoutBox);const l=!Ke(o);let c=!1;if(!t.resumeFrom){const u=t.getClosestProjectingParent();if(u&&!u.resumeFrom){const{snapshot:f,layout:m}=u;if(f&&m){const p=(0,S.dO)();Ot(p,s.layoutBox,f.layoutBox);const g=(0,S.dO)();Ot(g,i,m.layoutBox),$e(p,g)||(c=!0),u.options.layoutRoot&&(t.relativeTarget=g,t.relativeTargetOrigin=p,t.relativeParent=u)}}}t.notifyListeners("didUpdate",{layout:i,snapshot:s,delta:r,layoutDelta:o,hasLayoutChanged:l,hasRelativeTargetChanged:c})}else if(t.isLead()){const{onExitComplete:i}=t.options;i&&i()}t.options.transition=void 0}function ci(t){Nt&&Pt.totalNodes++,t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function ui(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function di(t){t.clearSnapshot()}function Je(t){t.clearMeasurements()}function hi(t){t.isLayoutDirty=!1}function fi(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function qe(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function mi(t){t.resolveTargetDelta()}function pi(t){t.calcProjection()}function gi(t){t.resetSkewAndRotation()}function vi(t){t.removeLeadSnapshot()}function _e(t,e,s){t.translate=(0,E.t)(e.translate,0,s),t.scale=(0,E.t)(e.scale,1,s),t.origin=e.origin,t.originPoint=e.originPoint}function ts(t,e,s,i){t.min=(0,E.t)(e.min,s.min,i),t.max=(0,E.t)(e.max,s.max,i)}function yi(t,e,s,i){ts(t.x,e.x,s.x,i),ts(t.y,e.y,s.y,i)}function bi(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const xi={duration:.45,ease:[.4,0,.1,1]},es=t=>typeof navigator!="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),ss=es("applewebkit/")&&!es("chrome/")?Math.round:it.Z;function is(t){t.min=ss(t.min),t.max=ss(t.max)}function Pi(t){is(t.x),is(t.y)}function ns(t,e,s){return t==="position"||t==="preserve-aspect"&&!ys(Ge(e),Ge(s),.2)}function Di(t){var e;return t!==t.root&&((e=t.scroll)===null||e===void 0?void 0:e.wasRoot)}const Ti=Ze({attachResizeListener:(t,e)=>(0,xe.E)(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),ae={current:void 0},os=Ze({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!ae.current){const t=new Ti({});t.mount(window),t.setOptions({layoutScroll:!0}),ae.current=t}return ae.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),Si={pan:{Feature:js},drag:{Feature:Ms,ProjectionNode:os,MeasureLayout:Ae}},Li={layout:{ProjectionNode:os,MeasureLayout:Ae}};var Ci=h(94889);const Ri=y(y(y({},Ci.H),Si),Li);var Ai=h(80663),Ei=h(80666),as=(0,C.Gp)((t,e)=>{var s;const fs=t,{className:i,as:a,item:d,state:n,classNames:o,isDisabled:r,listRef:l,slots:c,motionProps:u,disableAnimation:f,disableCursorAnimation:m,shouldSelectOnPressUp:p,onClick:g}=fs,P=_t(fs,["className","as","item","state","classNames","isDisabled","listRef","slots","motionProps","disableAnimation","disableCursorAnimation","shouldSelectOnPressUp","onClick"]),{key:T}=d,R=(0,_.gy)(e),j=a||(t.href?"a":"button"),I=typeof j=="string",{tabProps:V,isSelected:J,isDisabled:Kt,isPressed:q}=mt({key:T,isDisabled:r,shouldSelectOnPressUp:p},n,R);t.children==null&&delete V["aria-controls"];const Wt=r||Kt,{focusProps:re,isFocused:le,isFocusVisible:Bt}=(0,Q.F)(),{hoverProps:ce,isHovered:Zt}=(0,pt.X)({isDisabled:Wt}),Jt=(0,U.W)(o==null?void 0:o.tab,i),[,Y]=(0,Ei.t)({rerender:!0}),qi=()=>{(0,$t.t)(g,V.onClick),!(!(R!=null&&R.current)||!(l!=null&&l.current))&&ut(R.current,{scrollMode:"if-needed",behavior:"smooth",block:"end",inline:"end",boundary:l==null?void 0:l.current})};return(0,D.jsxs)(j,L(y({ref:R,"data-disabled":(0,nt.PB)(Kt),"data-focus":(0,nt.PB)(le),"data-focus-visible":(0,nt.PB)(Bt),"data-hover":(0,nt.PB)(Zt),"data-hover-unselected":(0,nt.PB)((Zt||q)&&!J),"data-pressed":(0,nt.PB)(q),"data-selected":(0,nt.PB)(J),"data-slot":"tab"},(0,O.d)(V,Wt?{}:y(y({},re),ce),(0,kt.z)(P,{enabled:I,omitPropNames:new Set(["title"])}),{onClick:qi})),{className:(s=c.tab)==null?void 0:s.call(c,{class:Jt}),title:P==null?void 0:P.titleValue,type:j==="button"?"button":void 0,children:[J&&!f&&!m&&Y?(0,D.jsx)(Dt.X,{features:Ri,children:(0,D.jsx)(Ai.m.span,y({className:c.cursor({class:o==null?void 0:o.cursor}),"data-slot":"cursor",layoutDependency:!1,layoutId:"cursor",transition:{type:"spring",bounce:.15,duration:.5}},u))}):null,(0,D.jsx)("div",{className:c.tabContent({class:o==null?void 0:o.tabContent}),"data-slot":"tabContent",children:d.rendered})]}))});as.displayName="NextUI.Tab";var Mi=as,ji=h(76733),Ft=h(67381),Bi=h(55344),rs=h(65512),ls=(0,Bi.tv)({slots:{base:"inline-flex",tabList:["flex","p-1","h-fit","gap-2","items-center","flex-nowrap","overflow-x-scroll","scrollbar-hide","bg-default-100"],tab:["z-0","w-full","px-3","py-1","flex","group","relative","justify-center","items-center","outline-none","cursor-pointer","transition-opacity","tap-highlight-transparent","data-[disabled=true]:cursor-not-allowed","data-[disabled=true]:opacity-30","data-[hover-unselected=true]:opacity-disabled",...rs.Dh],tabContent:["relative","z-10","text-inherit","whitespace-nowrap","transition-colors","text-default-500","group-data-[selected=true]:text-foreground"],cursor:["absolute","z-0","bg-white"],panel:["py-3","px-1","outline-none","data-[inert=true]:hidden",...rs.Dh],wrapper:[]},variants:{variant:{solid:{cursor:"inset-0"},light:{tabList:"bg-transparent dark:bg-transparent",cursor:"inset-0"},underlined:{tabList:"bg-transparent dark:bg-transparent",cursor:"h-[2px] w-[80%] bottom-0 shadow-[0_1px_0px_0_rgba(0,0,0,0.05)]"},bordered:{tabList:"bg-transparent dark:bg-transparent border-medium border-default-200 shadow-sm",cursor:"inset-0"}},color:{default:{},primary:{},secondary:{},success:{},warning:{},danger:{}},size:{sm:{tabList:"rounded-medium",tab:"h-7 text-tiny rounded-small",cursor:"rounded-small"},md:{tabList:"rounded-medium",tab:"h-8 text-small rounded-small",cursor:"rounded-small"},lg:{tabList:"rounded-large",tab:"h-9 text-medium rounded-medium",cursor:"rounded-medium"}},radius:{none:{tabList:"rounded-none",tab:"rounded-none",cursor:"rounded-none"},sm:{tabList:"rounded-medium",tab:"rounded-small",cursor:"rounded-small"},md:{tabList:"rounded-medium",tab:"rounded-small",cursor:"rounded-small"},lg:{tabList:"rounded-large",tab:"rounded-medium",cursor:"rounded-medium"},full:{tabList:"rounded-full",tab:"rounded-full",cursor:"rounded-full"}},fullWidth:{true:{base:"w-full",tabList:"w-full"}},isDisabled:{true:{tabList:"opacity-disabled pointer-events-none"}},disableAnimation:{true:{tab:"transition-none",tabContent:"transition-none"}},placement:{top:{},start:{tabList:"flex-col",panel:"py-0 px-3",wrapper:"flex"},end:{tabList:"flex-col",panel:"py-0 px-3",wrapper:"flex flex-row-reverse"},bottom:{wrapper:"flex flex-col-reverse"}}},defaultVariants:{color:"default",variant:"solid",size:"md",fullWidth:!1,isDisabled:!1},compoundVariants:[{variant:["solid","bordered","light"],color:"default",class:{cursor:["bg-background","dark:bg-default","shadow-small"],tabContent:"group-data-[selected=true]:text-default-foreground"}},{variant:["solid","bordered","light"],color:"primary",class:{cursor:Ft.J.solid.primary,tabContent:"group-data-[selected=true]:text-primary-foreground"}},{variant:["solid","bordered","light"],color:"secondary",class:{cursor:Ft.J.solid.secondary,tabContent:"group-data-[selected=true]:text-secondary-foreground"}},{variant:["solid","bordered","light"],color:"success",class:{cursor:Ft.J.solid.success,tabContent:"group-data-[selected=true]:text-success-foreground"}},{variant:["solid","bordered","light"],color:"warning",class:{cursor:Ft.J.solid.warning,tabContent:"group-data-[selected=true]:text-warning-foreground"}},{variant:["solid","bordered","light"],color:"danger",class:{cursor:Ft.J.solid.danger,tabContent:"group-data-[selected=true]:text-danger-foreground"}},{variant:"underlined",color:"default",class:{cursor:"bg-foreground",tabContent:"group-data-[selected=true]:text-foreground"}},{variant:"underlined",color:"primary",class:{cursor:"bg-primary",tabContent:"group-data-[selected=true]:text-primary"}},{variant:"underlined",color:"secondary",class:{cursor:"bg-secondary",tabContent:"group-data-[selected=true]:text-secondary"}},{variant:"underlined",color:"success",class:{cursor:"bg-success",tabContent:"group-data-[selected=true]:text-success"}},{variant:"underlined",color:"warning",class:{cursor:"bg-warning",tabContent:"group-data-[selected=true]:text-warning"}},{variant:"underlined",color:"danger",class:{cursor:"bg-danger",tabContent:"group-data-[selected=true]:text-danger"}},{disableAnimation:!0,variant:"underlined",class:{tab:["after:content-['']","after:absolute","after:bottom-0","after:h-[2px]","after:w-[80%]","after:opacity-0","after:shadow-[0_1px_0px_0_rgba(0,0,0,0.05)]","data-[selected=true]:after:opacity-100"]}},{disableAnimation:!0,color:"default",variant:["solid","bordered","light"],class:{tab:"data-[selected=true]:bg-default data-[selected=true]:text-default-foreground"}},{disableAnimation:!0,color:"primary",variant:["solid","bordered","light"],class:{tab:"data-[selected=true]:bg-primary data-[selected=true]:text-primary-foreground"}},{disableAnimation:!0,color:"secondary",variant:["solid","bordered","light"],class:{tab:"data-[selected=true]:bg-secondary data-[selected=true]:text-secondary-foreground"}},{disableAnimation:!0,color:"success",variant:["solid","bordered","light"],class:{tab:"data-[selected=true]:bg-success data-[selected=true]:text-success-foreground"}},{disableAnimation:!0,color:"warning",variant:["solid","bordered","light"],class:{tab:"data-[selected=true]:bg-warning data-[selected=true]:text-warning-foreground"}},{disableAnimation:!0,color:"danger",variant:["solid","bordered","light"],class:{tab:"data-[selected=true]:bg-danger data-[selected=true]:text-danger-foreground"}},{disableAnimation:!0,color:"default",variant:"underlined",class:{tab:"data-[selected=true]:after:bg-foreground"}},{disableAnimation:!0,color:"primary",variant:"underlined",class:{tab:"data-[selected=true]:after:bg-primary"}},{disableAnimation:!0,color:"secondary",variant:"underlined",class:{tab:"data-[selected=true]:after:bg-secondary"}},{disableAnimation:!0,color:"success",variant:"underlined",class:{tab:"data-[selected=true]:after:bg-success"}},{disableAnimation:!0,color:"warning",variant:"underlined",class:{tab:"data-[selected=true]:after:bg-warning"}},{disableAnimation:!0,color:"danger",variant:"underlined",class:{tab:"data-[selected=true]:after:bg-danger"}}],compoundSlots:[{variant:"underlined",slots:["tab","tabList","cursor"],class:["rounded-none"]}]}),wi=h(49037),Ii=h(5935),Vi=h(99373);function Oi(t){var e;let[s,i]=(0,Vi.z)(t.selectedKey,(e=t.defaultSelectedKey)!==null&&e!==void 0?e:null,t.onSelectionChange),a=(0,v.useMemo)(()=>s!=null?[s]:[],[s]),{collection:d,disabledKeys:n,selectionManager:o}=(0,Ii.n)(L(y({},t),{selectionMode:"single",disallowEmptySelection:!0,allowDuplicateSelectionEvents:!0,selectedKeys:a,onSelectionChange:l=>{var c;let u=(c=l.values().next().value)!==null&&c!==void 0?c:null;u===s&&t.onSelectionChange&&t.onSelectionChange(u),i(u)}})),r=s!=null?d.getItem(s):null;return{collection:d,disabledKeys:n,selectionManager:o,selectedKey:s,setSelectedKey:i,selectedItem:r}}function Ui(t){var e;let s=Oi(L(y({},t),{suppressTextValueWarning:!0,defaultSelectedKey:(e=t.defaultSelectedKey)!==null&&e!==void 0?e:cs(t.collection,t.disabledKeys?new Set(t.disabledKeys):new Set)})),{selectionManager:i,collection:a,selectedKey:d}=s,n=(0,v.useRef)(d);return(0,v.useEffect)(()=>{let o=d;(i.isEmpty||!a.getItem(o))&&(o=cs(a,s.disabledKeys),o!=null&&i.setSelectedKeys([o])),(o!=null&&i.focusedKey==null||!i.isFocused&&o!==n.current)&&i.setFocusedKey(o),n.current=o}),L(y({},s),{isDisabled:t.isDisabled||!1})}function cs(t,e){let s=null;if(t){for(s=t.getFirstKey();e.has(s)&&s!==t.getLastKey();)s=t.getKeyAfter(s);e.has(s)&&s===t.getLastKey()&&(s=t.getFirstKey())}return s}class Ni{getKeyLeftOf(e){return this.flipDirection?this.getNextKey(e):this.getPreviousKey(e)}getKeyRightOf(e){return this.flipDirection?this.getPreviousKey(e):this.getNextKey(e)}getKeyAbove(e){return this.getPreviousKey(e)}getKeyBelow(e){return this.getNextKey(e)}isDisabled(e){var s,i;return this.disabledKeys.has(e)||!!(!((i=this.collection.getItem(e))===null||i===void 0||(s=i.props)===null||s===void 0)&&s.isDisabled)}getFirstKey(){let e=this.collection.getFirstKey();return e!=null&&this.isDisabled(e)&&(e=this.getNextKey(e)),e}getLastKey(){let e=this.collection.getLastKey();return e!=null&&this.isDisabled(e)&&(e=this.getPreviousKey(e)),e}getNextKey(e){do e=this.collection.getKeyAfter(e),e==null&&(e=this.collection.getFirstKey());while(this.isDisabled(e));return e}getPreviousKey(e){do e=this.collection.getKeyBefore(e),e==null&&(e=this.collection.getLastKey());while(this.isDisabled(e));return e}constructor(e,s,i,a=new Set){this.collection=e,this.flipDirection=s==="rtl"&&i==="horizontal",this.disabledKeys=a}}var Fi=h(9188),Ki=h(54792),Wi=h(84409);function ki(t,e,s){let{orientation:i="horizontal",keyboardActivation:a="automatic"}=t,{collection:d,selectionManager:n,disabledKeys:o}=e,{direction:r}=(0,Ki.j)(),l=(0,v.useMemo)(()=>new Ni(d,r,i,o),[d,o,i,r]),{collectionProps:c}=(0,Wi.g)({ref:s,selectionManager:n,keyboardDelegate:l,selectOnFocus:a==="automatic",disallowEmptySelection:!0,scrollRef:s,linkBehavior:"selection"}),u=(0,Fi.Me)();lt.set(e,u);let f=(0,x.b)(L(y({},t),{id:u}));return{tabListProps:L(y({},(0,O.d)(c,f)),{role:"tablist","aria-orientation":i,tabIndex:void 0})}}function $i(t){var e,s,i;const a=(0,ji.w)(),[d,n]=(0,C.oe)(t,ls.variantKeys),Jt=d,{ref:o,as:r,className:l,classNames:c,children:u,disableCursorAnimation:f,motionProps:m,isVertical:p=!1,shouldSelectOnPressUp:g=!0,destroyInactiveTabPanel:P=!0}=Jt,T=_t(Jt,["ref","as","className","classNames","children","disableCursorAnimation","motionProps","isVertical","shouldSelectOnPressUp","destroyInactiveTabPanel"]),R=r||"div",j=typeof R=="string",I=(0,_.gy)(o),V=(s=(e=t==null?void 0:t.disableAnimation)!=null?e:a==null?void 0:a.disableAnimation)!=null?s:!1,J=Ui(y({children:u},T)),{tabListProps:Kt}=ki(T,J,I),q=(0,v.useMemo)(()=>ls(y(L(y({},n),{className:l,disableAnimation:V}),p?{placement:"start"}:{})),[(0,wi.Xx)(n),l,V,p]),Wt=(0,U.W)(c==null?void 0:c.base,l),re=(0,v.useMemo)(()=>({state:J,slots:q,classNames:c,motionProps:m,disableAnimation:V,listRef:I,shouldSelectOnPressUp:g,disableCursorAnimation:f,isDisabled:t==null?void 0:t.isDisabled}),[J,q,I,m,V,f,g,t==null?void 0:t.isDisabled,c]),le=(0,v.useCallback)(Y=>y({"data-slot":"base",className:q.base({class:(0,U.W)(Wt,Y==null?void 0:Y.className)})},(0,O.d)((0,kt.z)(T,{enabled:j}),Y)),[Wt,T,q]),Bt=(i=n.placement)!=null?i:p?"start":"top",ce=(0,v.useCallback)(Y=>({"data-slot":"tabWrapper",className:q.wrapper({class:(0,U.W)(c==null?void 0:c.wrapper,Y==null?void 0:Y.className)}),"data-placement":Bt,"data-vertical":p||Bt==="start"||Bt==="end"?"vertical":"horizontal"}),[c,q,Bt,p]),Zt=(0,v.useCallback)(Y=>y({ref:I,"data-slot":"tabList",className:q.tabList({class:(0,U.W)(c==null?void 0:c.tabList,Y==null?void 0:Y.className)})},(0,O.d)(Kt,Y)),[I,Kt,c,q]);return{Component:R,domRef:I,state:J,values:re,destroyInactiveTabPanel:P,getBaseProps:le,getTabListProps:Zt,getWrapperProps:ce}}const Gi=(0,v.createContext)(null);var zi=h(58868);function Hi(){const t=(0,v.useRef)(!1);return(0,zi.L)(()=>(t.current=!0,()=>{t.current=!1}),[]),t}function Xi(){const t=Hi(),[e,s]=(0,v.useState)(0),i=(0,v.useCallback)(()=>{t.current&&s(e+1)},[e]);return[(0,v.useCallback)(()=>b.Wi.postRender(i),[i]),e]}const Yi=t=>!t.isLayoutDirty&&t.willUpdate(!1);function us(){const t=new Set,e=new WeakMap,s=()=>t.forEach(Yi);return{add:i=>{t.add(i),e.set(i,i.addEventListener("willUpdate",s))},remove:i=>{t.delete(i);const a=e.get(i);a&&(a(),e.delete(i)),s()},dirty:s}}const ds=t=>t===!0,Qi=t=>ds(t===!0)||t==="id",Zi=({children:t,id:e,inherit:s=!0})=>{const i=(0,v.useContext)(ee.p),a=(0,v.useContext)(Gi),[d,n]=Xi(),o=(0,v.useRef)(null),r=i.id||a;o.current===null&&(Qi(s)&&r&&(e=e?r+"-"+e:r),o.current={id:e,group:ds(s)&&i.group||us()});const l=(0,v.useMemo)(()=>L(y({},o.current),{forceRender:d}),[n]);return(0,D.jsx)(ee.p.Provider,{value:l,children:t})};function hs(t,e){const{Component:s,values:i,state:a,destroyInactiveTabPanel:d,getBaseProps:n,getTabListProps:o,getWrapperProps:r}=$i(L(y({},t),{ref:e})),l=(0,v.useId)(),c=!t.disableAnimation&&!t.disableCursorAnimation,u={state:a,listRef:i.listRef,slots:i.slots,classNames:i.classNames,isDisabled:i.isDisabled,motionProps:i.motionProps,disableAnimation:i.disableAnimation,shouldSelectOnPressUp:i.shouldSelectOnPressUp,disableCursorAnimation:i.disableCursorAnimation},f=[...a.collection].map(p=>(0,D.jsx)(Mi,y(y({item:p},u),p.props),p.key)),m=(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)("div",L(y({},n()),{children:(0,D.jsx)(s,L(y({},o()),{children:c?(0,D.jsx)(Zi,{id:l,children:f}):f}))})),[...a.collection].map(p=>(0,D.jsx)(wt,{classNames:i.classNames,destroyInactiveTabPanel:d,slots:i.slots,state:i.state,tabKey:p.key},p.key))]});return"placement"in t||"isVertical"in t?(0,D.jsx)("div",L(y({},r()),{children:m})):m}var Ji=(0,C.Gp)(hs);hs.displayName="NextUI.Tabs"},29505:function(B,A,h){h.d(A,{r:function(){return U}});var C=h(11594),_=C.c,U=_},80666:function(B,A,h){h.d(A,{t:function(){return _}});var C=h(67294);function _(U={}){const{rerender:O=!1,delay:lt=0}=U,tt=(0,C.useRef)(!1),[x,w]=(0,C.useState)(!1);return(0,C.useEffect)(()=>{tt.current=!0;let v=null;return O&&(lt>0?v=setTimeout(()=>{w(!0)},lt):w(!0)),()=>{tt.current=!1,O&&w(!1),v&&clearTimeout(v)}},[O]),[(0,C.useCallback)(()=>tt.current,[]),x]}},65706:function(B,A,h){h.d(A,{Q:function(){return tt}});const C=x=>typeof x=="object"&&x!=null&&x.nodeType===1,_=(x,w)=>(!w||x!=="hidden")&&x!=="visible"&&x!=="clip",U=(x,w)=>{if(x.clientHeight<x.scrollHeight||x.clientWidth<x.scrollWidth){const v=getComputedStyle(x,null);return _(v.overflowY,w)||_(v.overflowX,w)||(et=>{const st=(N=>{if(!N.ownerDocument||!N.ownerDocument.defaultView)return null;try{return N.ownerDocument.defaultView.frameElement}catch(Q){return null}})(et);return!!st&&(st.clientHeight<et.scrollHeight||st.clientWidth<et.scrollWidth)})(x)}return!1},O=(x,w,v,et,st,N,Q,D)=>N<x&&Q>w||N>x&&Q<w?0:N<=x&&D<=v||Q>=w&&D>=v?N-x-et:Q>w&&D<v||N<x&&D>v?Q-w+st:0,lt=x=>{const w=x.parentElement;return w==null?x.getRootNode().host||null:w},tt=(x,w)=>{var v,et,st,N;if(typeof document=="undefined")return[];const{scrollMode:Q,block:D,inline:Z,boundary:wt,skipOverflowHiddenElements:kt}=w,nt=typeof wt=="function"?wt:gt=>gt!==wt;if(!C(x))throw new TypeError("Invalid target");const $t=document.scrollingElement||document.documentElement,ct=[];let F=x;for(;C(F)&&nt(F);){if(F=lt(F),F===$t){ct.push(F);break}F!=null&&F===document.body&&U(F)&&!U(document.documentElement)||F!=null&&U(F,kt)&&ct.push(F)}const ut=(et=(v=window.visualViewport)==null?void 0:v.width)!=null?et:innerWidth,dt=(N=(st=window.visualViewport)==null?void 0:st.height)!=null?N:innerHeight,{scrollX:ht,scrollY:ft}=window,{height:mt,width:pt,top:Dt,right:Tt,bottom:it,left:St}=x.getBoundingClientRect();let K=D==="start"||D==="nearest"?Dt:D==="end"?it:Dt+mt/2,W=Z==="center"?St+pt/2:Z==="end"?Tt:St;const ot=[];for(let gt=0;gt<ct.length;gt++){const M=ct[gt],{height:Lt,width:Ct,top:b,right:Rt,bottom:vt,left:yt}=M.getBoundingClientRect();if(Q==="if-needed"&&Dt>=0&&St>=0&&it<=dt&&Tt<=ut&&Dt>=b&&it<=vt&&St>=yt&&Tt<=Rt)return ot;const rt=getComputedStyle(M),At=parseInt(rt.borderLeftWidth,10),bt=parseInt(rt.borderTopWidth,10),Et=parseInt(rt.borderRightWidth,10),Mt=parseInt(rt.borderBottomWidth,10);let k=0,G=0;const E="offsetWidth"in M?M.offsetWidth-M.clientWidth-At-Et:0,xt="offsetHeight"in M?M.offsetHeight-M.clientHeight-bt-Mt:0,Gt="offsetWidth"in M?M.offsetWidth===0?0:Ct/M.offsetWidth:0,zt="offsetHeight"in M?M.offsetHeight===0?0:Lt/M.offsetHeight:0;if($t===M)k=D==="start"?K:D==="end"?K-dt:D==="nearest"?O(ft,ft+dt,dt,bt,Mt,ft+K,ft+K+mt,mt):K-dt/2,G=Z==="start"?W:Z==="center"?W-ut/2:Z==="end"?W-ut:O(ht,ht+ut,ut,At,Et,ht+W,ht+W+pt,pt),k=Math.max(0,k+ft),G=Math.max(0,G+ht);else{k=D==="start"?K-b-bt:D==="end"?K-vt+Mt+xt:D==="nearest"?O(b,vt,Lt,bt,Mt+xt,K,K+mt,mt):K-(b+Lt/2)+xt/2,G=Z==="start"?W-yt-At:Z==="center"?W-(yt+Ct/2)+E/2:Z==="end"?W-Rt+Et+E:O(yt,Rt,Ct,At,Et+E,W,W+pt,pt);const{scrollLeft:It,scrollTop:Ht}=M;k=Math.max(0,Math.min(Ht+k/zt,M.scrollHeight-Lt/zt+xt)),G=Math.max(0,Math.min(It+G/Gt,M.scrollWidth-Ct/Gt+E)),K+=Ht-k,W+=It-G}ot.push({el:M,top:k,left:G})}return ot}}}]);
}());