PageSourceSearch

https://webstashai.com/static/mue79wob/features-max-Bwu9q97t.js

js webstashai.com collected 2026-09-24 14:57:47 UTC 44,471 bytes, 1 lines download raw bytes

1import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{i as t,t as n}from"./react-vendor-Cg1XyO4h.js";import{a as r,i,n as a,s as o,t as s}from"./is-ref-object-DQN3HbkU.js";import{$ as c,C as l,Dt as u,Et as d,J as f,M as ee,Ot as p,S as m,_t as te,ct as h,dt as g,et as ne,ft as _,gt as re,ht as ie,j as ae,lt as v,ot as y,p as oe,st as se,ut as b,vt as x,w as ce,wt as le,xt as ue}from"./is-svg-component-DcFEyEO2.js";import{C as de,D as fe,O as S,S as pe,T as me,_ as he,a as C,b as w,c as ge,d as T,f as _e,g as ve,h as ye,k as be,l as xe,m as E,n as Se,o as Ce,p as we,r as D,s as Te,t as Ee,u as O,v as De,w as Oe,x as ke,y as Ae}from"./features-animation-CUNdgdGB.js";function je(e){return e===`x`||e===`y`?w[e]?null:(w[e]=!0,()=>{w[e]=!1}):w.x||w.y?null:(w.x=w.y=!0,()=>{w.x=w.y=!1})}function k(e){return ue(e)&&`ownerSVGElement`in e}var A=new WeakMap,j,Me=(e,t,n)=>(r,i)=>i&&i[0]?i[0][e+`Size`]:k(r)&&`getBBox`in r?r.getBBox()[t]:r[n],Ne=Me(`inline`,`width`,`offsetWidth`),Pe=Me(`block`,`height`,`offsetHeight`);function Fe({target:e,borderBoxSize:t}){A.get(e)?.forEach(n=>{n(e,{get width(){return Ne(e,t)},get height(){return Pe(e,t)}})})}function Ie(e){e.forEach(Fe)}function Le(){typeof ResizeObserver>`u`||(j=new ResizeObserver(Ie))}function Re(e,t){j||Le();let n=ke(e);return n.forEach(e=>{let n=A.get(e);n||(n=new Set,A.set(e,n)),n.add(t),j?.observe(e)}),()=>{n.forEach(e=>{let n=A.get(e);n?.delete(t),n?.size||j?.unobserve(e)})}}var M=new Set,N;function ze(){N=()=>{let e={get width(){return window.innerWidth},get height(){return window.innerHeight}};M.forEach(t=>t(e))},window.addEventListener(`resize`,N)}function Be(e){return M.add(e),N||ze(),()=>{M.delete(e),!M.size&&typeof N==`function`&&(window.removeEventListener(`resize`,N),N=void 0)}}function Ve(e,t){return typeof e==`function`?Be(e):Re(e,t)}function He(e){return k(e)&&e.tagName===`svg`}function Ue(e,t){e.min=t.min,e.max=t.max}function P(e,t){Ue(e.x,t.x),Ue(e.y,t.y)}function We(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}var Ge=.9999,Ke=1.0001,qe=-.01,Je=.01;function F(e){return e.max-e.min}function Ye(e,t,n){return Math.abs(e-t)<=n}function Xe(e,t,n,r=.5){e.origin=r,e.originPoint=f(t.min,t.max,e.origin),e.scale=F(n)/F(t),e.translate=f(n.min,n.max,e.origin)-e.originPoint,(e.scale>=Ge&&e.scale<=Ke||isNaN(e.scale))&&(e.scale=1),(e.translate>=qe&&e.translate<=Je||isNaN(e.translate))&&(e.translate=0)}function I(e,t,n,r){Xe(e.x,t.x,n.x,r?r.originX:void 0),Xe(e.y,t.y,n.y,r?r.originY:void 0)}function Ze(e,t,n){e.min=n.min+t.min,e.max=e.min+F(t)}function Qe(e,t,n){Ze(e.x,t.x,n.x),Ze(e.y,t.y,n.y)}function $e(e,t,n){e.min=t.min-n.min,e.max=e.min+F(t)}function L(e,t,n){$e(e.x,t.x,n.x),$e(e.y,t.y,n.y)}function R(e,t,n,r,i){return e-=t,e=xe(e,1/n,r),i!==void 0&&(e=xe(e,1/i,r)),e}function et(e,t=0,n=1,r=.5,i,a=e,o=e){if(c.test(t)&&(t=parseFloat(t),t=f(o.min,o.max,t/100)-o.min),typeof t!=`number`)return;let s=f(a.min,a.max,r);e===a&&(s-=t),e.min=R(e.min,t,n,s,i),e.max=R(e.max,t,n,s,i)}function tt(e,t,[n,r,i],a,o){et(e,t[n],t[r],t[i],t.scale,a,o)}var nt=[`x`,`scaleX`,`originX`],rt=[`y`,`scaleY`,`originY`];function it(e,t,n,r){tt(e.x,t,nt,n?n.x:void 0,r?r.x:void 0),tt(e.y,t,rt,n?n.y:void 0,r?r.y:void 0)}function at(e){return e.translate===0&&e.scale===1}function ot(e){return at(e.x)&&at(e.y)}function st(e,t){return e.min===t.min&&e.max===t.max}function ct(e,t){return st(e.x,t.x)&&st(e.y,t.y)}function lt(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function ut(e,t){return lt(e.x,t.x)&&lt(e.y,t.y)}function dt(e){return F(e.x)/F(e.y)}function ft(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function z(e){return[e(`x`),e(`y`)]}function pt(e,t,n){let r=``,i=e.x.translate/t.x,a=e.y.translate/t.y,o=n?.z||0;if((i||a||o)&&(r=`translate3d(${i}px, ${a}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){let{transformPerspective:e,rotate:t,rotateX:i,rotateY:a,skewX:o,skewY:s}=n;e&&(r=`perspective(${e}px) ${r}`),t&&(r+=`rotate(${t}deg) `),i&&(r+=`rotateX(${i}deg) `),a&&(r+=`rotateY(${a}deg) `),o&&(r+=`skewX(${o}deg) `),s&&(r+=`skewY(${s}deg) `)}let s=e.x.scale*t.x,c=e.y.scale*t.y;return(s!==1||c!==1)&&(r+=`scale(${s}, ${c})`),r||`none`}var mt=[`TopLeft`,`TopRight`,`BottomLeft`,`BottomRight`],ht=mt.length,gt=e=>typeof e==`string`?parseFloat(e):e,_t=e=>typeof e==`number`||ne.test(e);function vt(e,t,n,r,i,a){i?(e.opacity=f(0,n.opacity??1,bt(r)),e.o
1pacityExit=f(t.opacity??1,0,xt(r))):a&&(e.opacity=f(t.opacity??1,n.opacity??1,r));for(let i=0;i<ht;i++){let a=`border${mt[i]}Radius`,o=yt(t,a),s=yt(n,a);(o!==void 0||s!==void 0)&&(o||=0,s||=0,o===0||s===0||_t(o)===_t(s)?(e[a]=Math.max(f(gt(o),gt(s),r),0),(c.test(s)||c.test(o))&&(e[a]+=`%`)):e[a]=s)}(t.rotate||n.rotate)&&(e.rotate=f(t.rotate||0,n.rotate||0,r))}function yt(e,t){return e[t]===void 0?e.borderRadius:e[t]}var bt=St(0,.5,fe),xt=St(.5,.95,x);function St(e,t,n){return r=>r<e?0:r>t?1:n(S(e,t,r))}function Ct(e,t,n){let r=ae(e)?e:ee(e);return r.start(Oe(``,r,t,n)),r.animation}var wt=(e,t)=>e.depth-t.depth,Tt=class{constructor(){this.children=[],this.isDirty=!1}add(e){u(this.children,e),this.isDirty=!0}remove(e){p(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(wt),this.isDirty=!1,this.children.forEach(e)}};function Et(e,t){let n=se.now(),r=({timestamp:i})=>{let a=i-n;a>=t&&(h(r),e(a-t))};return v.setup(r,!0),()=>h(r)}var Dt=class{constructor(){this.members=[]}add(e){u(this.members,e);for(let t=this.members.length-1;t>=0;t--){let n=this.members[t];if(n===e||n===this.lead||n===this.prevLead)continue;let r=n.instance;(!r||r.isConnected===!1)&&!n.snapshot&&(p(this.members,n),n.unmount())}e.scheduleRender()}remove(e){if(p(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){let e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){for(let t=this.members.indexOf(e)-1;t>=0;t--){let e=this.members[t];if(e.isPresent!==!1&&e.instance?.isConnected!==!1)return this.promote(e),!0}return!1}promote(e,t){let n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.updateSnapshot(),e.scheduleRender();let{layoutDependency:r}=n.options,{layoutDependency:i}=e.options;(r===void 0||r!==i)&&(e.resumeFrom=n,t&&(n.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root?.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(e=>{e.options.onExitComplete?.(),e.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}},B={hasAnimatedSinceResize:!0,hasEverUpdated:!1},V={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},H=[``,`X`,`Y`,`Z`],Ot=1e3,kt=0;function U(e,t,n,r){let{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function At(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let n=pe(t);if(window.MotionHasOptimisedAnimation(n,`transform`)){let{layout:t,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,`transform`,v,!(t||r))}let{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&At(r)}function jt({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:i,resetTransform:a}){return class{constructor(e={},n=t?.()){this.id=kt++,this.animationId=0,this.animationCommitId=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.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,_.value&&(V.nodes=V.calculatedTargetDeltas=V.calculatedProjections=0),this.nodes.forEach(Pt),this.nodes.forEach(Vt),this.nodes.forEach(Ht),this.nodes.forEach(Ft),_.addProjectionMetrics&&_.addProjectionMetrics(V)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=e,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let e=0;e<this.path.length;e++)this.path[e].shouldResetTransform=!0;this.root===this&&(this.nodes=new Tt)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new te),this.eventHandlers.get(e).add(t)}notifyListeners(e,...t){let n=this.eventHandlers.get(e);n&&n.notify(...t)}hasListeners(e){return this.eventHandlers.has(e)}mount(t){if(this.instance)return;this.isSVG=k(t)&&!He(t),this.instance=t;let{layoutId:n,layout:r,visualElement:i}=this.options;if(i&&!i.current&&i.mount(t),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(r||n)&&(this.isLayoutDirty=!0),e){let n,r=0,i=()=>this.root.updateBlockedByResize=!1;v.read(()=>{r=window.innerWidth}),e(t,()=>{let e=window.innerWidth;e!==r&&(r=e,this.root.updateBlockedByResize=!0,n&&n(),n=Et(i,250),B.hasAnimatedSinceResize&&(B.hasAnimatedSinceResize=!1,this.nodes.forEac
1h(Bt)))})}n&&this.root.registerSharedNode(n,this),this.options.animate!==!1&&i&&(n||r)&&this.addEventListener(`didUpdate`,({delta:e,hasLayoutChanged:t,hasRelativeLayoutChanged:n,layout:r})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}let a=this.options.transition||i.getDefaultTransition()||Yt,{onLayoutAnimationStart:o,onLayoutAnimationComplete:s}=i.getProps(),c=!this.targetLayout||!ut(this.targetLayout,r),l=!t&&n;if(this.options.layoutRoot||this.resumeFrom||l||t&&(c||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);let t={...me(a,`layout`),onPlay:o,onComplete:s};(i.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t),this.setAnimationOrigin(e,l)}else t||Bt(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=r})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);let e=this.getStack();e&&e.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),h(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(Ut),this.animationId++)}getTransformTemplate(){let{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&At(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let e=0;e<this.path.length;e++){let t=this.path[e];t.shouldResetTransform=!0,(typeof t.latestValues.x==`string`||typeof t.latestValues.y==`string`)&&(t.isLayoutDirty=!0),t.updateScroll(`snapshot`),t.options.layoutRoot&&t.willUpdate(!1)}let{layoutId:t,layout:n}=this.options;if(t===void 0&&!n)return;let r=this.getTransformTemplate();this.prevTransformTemplateValue=r?r(this.latestValues,``):void 0,this.updateSnapshot(),e&&this.notifyListeners(`willUpdate`)}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(Lt);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Rt);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(zt),this.nodes.forEach(Mt),this.nodes.forEach(Nt)):this.nodes.forEach(Rt),this.clearAllSnapshots();let e=se.now();b.delta=d(0,1e3/60,e-b.timestamp),b.timestamp=e,b.isProcessing=!0,g.update.process(b),g.preRender.process(b),g.render.process(b),b.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,ce.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(It),this.sharedNodes.forEach(Wt)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,v.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){v.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!F(this.snapshot.measuredBox.x)&&!F(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let e=0;e<this.path.length;e++)this.path[e].updateScroll();let e=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected=m(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners(`measure`,this.layout.layoutBox);let{visualElement:t}=this.options;t&&t.notify(`LayoutMeasure`,this.layout.layoutBox,e?e.layoutBox:void 0)}updateScroll(e=`measure`){let t=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===e&&(t=!1),t&&this.instance){let t=i(this.instance);this.scroll={animationId:this.root.animationId,phase:e,isRoot:t,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:t}}}resetTransform(){if(!a)return;let e=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,t=this.projectionDelta&&!ot(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,``):void 0,i=r!==this.prevTransformTemplateValue;e&&this.instance&&(t||E(this.latestValues)||i)&&(a(this.instance,r),this.shouldResetTransform=!1,this.scheduleRender())}measure(e=!0){let t=this.measurePageBox(),n=this.removeElementScroll(t);return e&&(n=this.removeTransform(n)),$t(n),{animationId:this.root.animationId,measuredBox:t,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){let{visualElement:e}=this.options;if(!e)return m();let t=e.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(tn))){let{scroll:e}=this.root;e&&(T(t.x,e.offset.x),T(t.y,e.offset.y))}return t}removeElementScroll(e){let t=m();if(P(t,e),this.scroll?.wasRoot)return t;for(let n=0;n<this.path.length;n++){let r=this.path[n],{scroll:i,options:a}=r;r!==this.root&&i&&a.layoutScroll&&(i.wasRoot&&P(t,e),T(t.x,i.offset.x),T(t.y,i.offset.y))}return t}applyTransform(e,t=!1){let n=m();P(n,e);for(let e=0;e<this.path.length;e++){let r=this.path[e];!t&&r.options.layoutScroll&&r.scroll&&r!==r.root&&O(n,{x:-r.scroll.offset.x,y:-r.scroll.offset.y}),E(r.latestValues)&&O(n,r.latestValues,r.layout?.layoutBox)}return E(this.latestValues)&&O(n,this.latestValues,this.layout?.layoutBox),n}removeTransform(e){let t=m();P(t,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];if(!E(n.latestValues))continue;let r;n.instance&&(we(n.latestValues)&&n.updateSnapshot(),r=m(),P(r,n.measurePageBox())),it(t,n.latestValues,n.snapshot?.layoutBox,r)}return E(this.latestValues)&&it(t,this.latestValues),t}setTargetDelta(e){this.targetDelta=e,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(e){this.options={...this.options,...e,crossfade:e.crossfade===void 0||e.crossfade}}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.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(e=!1){let t=this.getLead();this.isProjectionDirty||=t.isProjectionDirty,this.isTransformDirty||=t.isTransformDirty,this.isSharedProjectionDirty||=t.isSharedProjectionDirty;let n=!!this.resumingFrom||this!==t;if(!(e||n&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:r,layoutId:i}=this.options;
1if(!this.layout||!(r||i))return;this.resolvedRelativeTargetAt=b.timestamp;let a=this.getClosestProjectingParent();a&&this.linkedParentVersion!==a.layoutVersion&&!a.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(a&&a.layout?this.createRelativeTarget(a,this.layout.layoutBox,a.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=m(),this.targetWithTransforms=m()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Qe(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):P(this.target,this.layout.layoutBox),Te(this.target,this.targetDelta)):P(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,a&&!!a.resumingFrom==!!this.resumingFrom&&!a.options.layoutScroll&&a.target&&this.animationProgress!==1?this.createRelativeTarget(a,this.target,a.target):this.relativeParent=this.relativeTarget=void 0),_.value&&V.calculatedTargetDeltas++)}getClosestProjectingParent(){if(!(!this.parent||we(this.parent.latestValues)||_e(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(e,t,n){this.relativeParent=e,this.linkedParentVersion=e.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=m(),this.relativeTargetOrigin=m(),L(this.relativeTargetOrigin,t,n),P(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){let e=this.getLead(),t=!!this.resumingFrom||this!==e,n=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(n=!1),t&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(n=!1),this.resolvedRelativeTargetAt===b.timestamp&&(n=!1),n)return;let{layout:r,layoutId:i}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(r||i))return;P(this.layoutCorrected,this.layout.layoutBox);let a=this.treeScale.x,o=this.treeScale.y;ge(this.layoutCorrected,this.treeScale,this.path,t),e.layout&&!e.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(e.target=e.layout.layoutBox,e.targetWithTransforms=m());let{target:s}=e;if(!s){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(We(this.prevProjectionDelta.x,this.projectionDelta.x),We(this.prevProjectionDelta.y,this.projectionDelta.y)),I(this.projectionDelta,this.layoutCorrected,s,this.latestValues),(this.treeScale.x!==a||this.treeScale.y!==o||!ft(this.projectionDelta.x,this.prevProjectionDelta.x)||!ft(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners(`projectionUpdate`,s)),_.value&&V.calculatedProjections++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(e=!0){if(this.options.visualElement?.scheduleRender(),e){let e=this.getStack();e&&e.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=l(),this.projectionDelta=l(),this.projectionDeltaWithTransform=l()}setAnimationOrigin(e,t=!1){let n=this.snapshot,r=n?n.latestValues:{},i={...this.latestValues},a=l();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;let o=m(),s=(n?n.source:void 0)!==(this.layout?this.layout.source:void 0),c=this.getStack(),u=!c||c.members.length<=1,d=!!(s&&!u&&this.options.crossfade===!0&&!this.path.some(Jt));this.animationProgress=0;let f;this.mixTargetDelta=t=>{let n=t/1e3;Gt(a.x,e.x,n),Gt(a.y,e.y,n),this.setTargetDelta(a),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(L(o,this.layout.layoutBox,this.relativeParent.layout.layoutBox),qt(this.relativeTarget,this.relativeTargetOrigin,o,n),f&&ct(this.relativeTarget,f)&&(this.isProjectionDirty=!1),f||=m(),P(f,this.relativeTarget)),s&&(this.animationValues=i,vt(i,r,this.latestValues,n,d,u)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(e){this.notifyListeners(`animationStart`),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&=(h(this.pendingAnimation),void 0),this.pendingAnimation=v.update(()=>{B.hasAnimatedSinceResize=!0,y.layout++,this.motionValue||=ee(0),this.motionValue.jump(0,!1),this.currentAnimation=Ct(this.motionValue,[0,1e3],{...e,velocity:0,isSync:!0,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onStop:()=>{y.layout--},onComplete:()=>{y.layout--,e.onComplete&&e.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);let e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners(`animationComplete`)}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Ot),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let e=this.getLead(),{targetWithTransforms:t,target:n,layout:r,latestValues:i}=e;if(!(!t||!n||!r)){if(this!==e&&this.layout&&r&&en(this.options.animationType,this.layout.layoutBox,r.layoutBox)){n=this.target||m(
1);let t=F(this.layout.layoutBox.x);n.x.min=e.target.x.min,n.x.max=n.x.min+t;let r=F(this.layout.layoutBox.y);n.y.min=e.target.y.min,n.y.max=n.y.min+r}P(t,n),O(t,i),I(this.projectionDeltaWithTransform,this.layoutCorrected,t,i)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new Dt),this.sharedNodes.get(e).add(t);let n=t.options.initialPromotionConfig;t.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(t):void 0})}isLead(){let e=this.getStack();return!e||e.lead===this}getLead(){let{layoutId:e}=this.options;return e&&this.getStack()?.lead||this}getPrevLead(){let{layoutId:e}=this.options;return e?this.getStack()?.prevLead:void 0}getStack(){let{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:n}={}){let r=this.getStack();r&&r.promote(this,n),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){let e=this.getStack();return e?e.relegate(this):!1}resetSkewAndRotation(){let{visualElement:e}=this.options;if(!e)return;let t=!1,{latestValues:n}=e;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(t=!0),!t)return;let r={};n.z&&U(`z`,e,r,this.animationValues);for(let t=0;t<H.length;t++)U(`rotate${H[t]}`,e,r,this.animationValues),U(`skew${H[t]}`,e,r,this.animationValues);e.render();for(let t in r)e.setStaticValue(t,r[t]),this.animationValues&&(this.animationValues[t]=r[t]);e.scheduleRender()}applyProjectionStyles(e,t){if(!this.instance||this.isSVG)return;if(!this.isVisible){e.visibility=`hidden`;return}let n=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,e.visibility=``,e.opacity=``,e.pointerEvents=r(t?.pointerEvents)||``,e.transform=n?n(this.latestValues,``):`none`;return}let i=this.getLead();if(!this.projectionDelta||!this.layout||!i.target){this.options.layoutId&&(e.opacity=this.latestValues.opacity===void 0?1:this.latestValues.opacity,e.pointerEvents=r(t?.pointerEvents)||``),this.hasProjected&&!E(this.latestValues)&&(e.transform=n?n({},``):`none`,this.hasProjected=!1);return}e.visibility=``;let a=i.animationValues||i.latestValues;this.applyTransformsToTarget();let o=pt(this.projectionDeltaWithTransform,this.treeScale,a);n&&(o=n(a,o)),e.transform=o;let{x:s,y:c}=this.projectionDelta;e.transformOrigin=`${s.origin*100}% ${c.origin*100}% 0`,e.opacity=i.animationValues?i===this?a.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:a.opacityExit:i===this?a.opacity===void 0?``:a.opacity:a.opacityExit===void 0?0:a.opacityExit;for(let t in oe){if(a[t]===void 0)continue;let{correct:n,applyTo:r,isCSSVariable:s}=oe[t],c=o===`none`?a[t]:n(a[t],i);if(r){let t=r.length;for(let n=0;n<t;n++)e[r[n]]=c}else s?this.options.visualElement.renderState.vars[t]=c:e[t]=c}this.options.layoutId&&(e.pointerEvents=i===this?r(t?.pointerEvents)||``:`none`)}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(e=>e.currentAnimation?.stop()),this.root.nodes.forEach(Lt),this.root.sharedNodes.clear()}}}function Mt(e){e.updateLayout()}function Nt(e){let t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners(`didUpdate`)){let{layoutBox:n,measuredBox:r}=e.layout,{animationType:i}=e.options,a=t.source!==e.layout.source;i===`size`?z(e=>{let r=a?t.measuredBox[e]:t.layoutBox[e],i=F(r);r.min=n[e].min,r.max=r.min+i}):en(i,t.layoutBox,n)&&z(r=>{let i=a?t.measuredBox[r]:t.layoutBox[r],o=F(n[r]);i.max=i.min+o,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[r].max=e.relativeTarget[r].min+o)});let o=l();I(o,n,t.layoutBox);let s=l();a?I(s,e.applyTransform(r,!0),t.measuredBox):I(s,n,t.layoutBox);let c=!ot(o),u=!1;if(!e.resumeFrom){let r=e.getClosestProjectingParent();if(r&&!r.resumeFrom){let{snapshot:i,layout:a}=r;if(i&&a){let o=m();L(o,t.layoutBox,i.layoutBox);let s=m();L(s,n,a.layoutBox),ut(o,s)||(u=!0),r.options.layoutRoot&&(e.relativeTarget=s,e.relativeTargetOrigin=o,e.relativeParent=r)}}}e.notifyListeners(`didUpdate`,{layout:n,snapshot:t,delta:s,layoutDelta:o,hasLayoutChanged:c,hasRelativeLayoutChanged:u})}else if(e.isLead()){let{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function Pt(e){_.value&&V.nodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty),e.isTransformDirty||=e.parent.isTransformDirty)}function Ft(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function It(e){e.clearSnapshot()}function Lt(e){e.clearMeasurements()}function Rt(e){e.isLayoutDirty=!1}function zt(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify(`BeforeLayoutMeasure`),e.resetTransform()}function Bt(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Vt(e){e.resolveTargetDelta()}function Ht(e){e.calcProjection()}
1function Ut(e){e.resetSkewAndRotation()}function Wt(e){e.removeLeadSnapshot()}function Gt(e,t,n){e.translate=f(t.translate,0,n),e.scale=f(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function Kt(e,t,n,r){e.min=f(t.min,n.min,r),e.max=f(t.max,n.max,r)}function qt(e,t,n,r){Kt(e.x,t.x,n.x,r),Kt(e.y,t.y,n.y,r)}function Jt(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}var Yt={duration:.45,ease:[.4,0,.1,1]},Xt=e=>typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Zt=Xt(`applewebkit/`)&&!Xt(`chrome/`)?Math.round:x;function Qt(e){e.min=Zt(e.min),e.max=Zt(e.max)}function $t(e){Qt(e.x),Qt(e.y)}function en(e,t,n){return e===`position`||e===`preserve-aspect`&&!Ye(dt(t),dt(n),.2)}function tn(e){return e!==e.root&&e.scroll?.wasRoot}var nn=jt({attachResizeListener:(e,t)=>C(e,`resize`,t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),W={current:void 0},rn=jt({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!W.current){let e=new nn({});e.mount(window),e.setOptions({layoutScroll:!0}),W.current=e}return W.current},resetTransform:(e,t)=>{e.style.transform=t===void 0?`none`:t},checkIsScrollRoot:e=>window.getComputedStyle(e).position===`fixed`});function G(e,t,n,r){return C(e,t,Se(n),r)}var an=({current:e})=>e?e.ownerDocument.defaultView:null,on=(e,t)=>Math.abs(e-t);function sn(e,t){let n=on(e.x,t.x),r=on(e.y,t.y);return Math.sqrt(n**2+r**2)}var cn=new Set([`auto`,`scroll`]),ln=class{constructor(e,t,{transformPagePoint:n,contextWindow:r=window,dragSnapToOrigin:i=!1,distanceThreshold:a=3,element:o}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=e=>{this.handleScroll(e.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=K(this.lastRawMoveEventInfo,this.transformPagePoint));let e=q(this.lastMoveEventInfo,this.history),t=this.startEvent!==null,n=sn(e.offset,{x:0,y:0})>=this.distanceThreshold;if(!t&&!n)return;let{point:r}=e,{timestamp:i}=b;this.history.push({...r,timestamp:i});let{onStart:a,onMove:o}=this.handlers;t||(a&&a(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),o&&o(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastRawMoveEventInfo=t,this.lastMoveEventInfo=K(t,this.transformPagePoint),v.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.end();let{onEnd:n,onSessionEnd:r,resumeAnimation:i}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&i&&i(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let a=q(e.type===`pointercancel`?this.lastMoveEventInfo:K(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,a),r&&r(e,a)},!Ae(e))return;this.dragSnapToOrigin=i,this.handlers=t,this.transformPagePoint=n,this.distanceThreshold=a,this.contextWindow=r||window;let s=K(D(e),this.transformPagePoint),{point:c}=s,{timestamp:l}=b;this.history=[{...c,timestamp:l}];let{onSessionStart:u}=t;u&&u(e,q(s,this.history)),this.removeListeners=be(G(this.contextWindow,`pointermove`,this.handlePointerMove),G(this.contextWindow,`pointerup`,this.handlePointerUp),G(this.contextWindow,`pointercancel`,this.handlePointerUp)),o&&this.startScrollTracking(o)}startScrollTracking(e){let t=e.parentElement;for(;t;){let e=getComputedStyle(t);(cn.has(e.overflowX)||cn.has(e.overflowY))&&this.scrollPositions.set(t,{x:t.scrollLeft,y:t.scrollTop}),t=t.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener(`scroll`,this.onElementScroll,{capture:!0}),window.addEventListener(`scroll`,this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener(`scroll`,this.onElementScroll,{capture:!0}),window.removeEventListener(`scroll`,this.onWindowScroll)}}handleScroll(e){let t=this.scrollPositions.get(e);if(!t)return;let n=e===window,r=n?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},i={x:r.x-t.x,y:r.y-t.y};(i.x!==0||i.y!==0)&&(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i.x,this.lastMoveEventInfo.point.y+=i.y):this.history.length>0&&(this.history[0].x-=i.x,this.history[0].y-=i.y),this.scrollPositions.set(e,r),v.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),h(this.updatePoint)}};function K(e,t){return t?{point:t(e.point)}:e}function un(e,t){return{x:e.x-t.x,y:e.y-t.y}}function q({point:e},t){return{point:e,delta:un(e,J(t)),offset:un(e,dn(t)),velocity:fn(t,.1)}}function dn(e){return e[0]}function J(e){return e[e.length-1]}function fn(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null,i=J(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>re(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&i.timestamp-r.timestamp>re(t)*2&&(r=e[1]);let a=ie(i.timestamp-r.timestamp);if(a===0)return{x:0,y:0};let o={x:(i.x-r.x)/a,y:(i.y-r.y)/a};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function pn(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?f(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?f(n,e,r.max):Math.min(e,n)),e}
1function mn(e,t,n){return{min:t===void 0?void 0:e.min+t,max:n===void 0?void 0:e.max+n-(e.max-e.min)}}function hn(e,{top:t,left:n,bottom:r,right:i}){return{x:mn(e.x,n,i),y:mn(e.y,t,r)}}function gn(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function _n(e,t){return{x:gn(e.x,t.x),y:gn(e.y,t.y)}}function vn(e,t){let n=.5,r=F(e),i=F(t);return i>r?n=S(t.min,t.max-r,e.min):r>i&&(n=S(e.min,e.max-i,t.min)),d(0,1,n)}function yn(e,t){let n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}var Y=.35;function bn(e=Y){return e===!1?e=0:e===!0&&(e=Y),{x:xn(e,`left`,`right`),y:xn(e,`top`,`bottom`)}}function xn(e,t,n){return{min:Sn(e,t),max:Sn(e,n)}}function Sn(e,t){return typeof e==`number`?e:e[t]||0}var Cn=new WeakMap,wn=class{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=m(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:t=!1,distanceThreshold:n}={}){let{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;let i=e=>{t&&this.snapToCursor(D(e).point),this.stopAnimation()},a=(e,t)=>{let{drag:n,dragPropagation:r,onDragStart:i}=this.getProps();if(n&&!r&&(this.openDragLock&&this.openDragLock(),this.openDragLock=je(n),!this.openDragLock))return;this.latestPointerEvent=e,this.latestPanInfo=t,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),z(e=>{let t=this.getAxisMotionValue(e).get()||0;if(c.test(t)){let{projection:n}=this.visualElement;if(n&&n.layout){let r=n.layout.layoutBox[e];r&&(t=F(r)*(parseFloat(t)/100))}}this.originPoint[e]=t}),i&&v.update(()=>i(e,t),!1,!0),de(this.visualElement,`transform`);let{animationState:a}=this.visualElement;a&&a.setActive(`whileDrag`,!0)},o=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t;let{dragPropagation:n,dragDirectionLock:r,onDirectionLock:i,onDrag:a}=this.getProps();if(!n&&!this.openDragLock)return;let{offset:o}=t;if(r&&this.currentDirection===null){this.currentDirection=Dn(o),this.currentDirection!==null&&i&&i(this.currentDirection);return}this.updateAxis(`x`,t.point,o),this.updateAxis(`y`,t.point,o),this.visualElement.render(),a&&v.update(()=>a(e,t),!1,!0)},s=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t,this.stop(e,t),this.latestPointerEvent=null,this.latestPanInfo=null},l=()=>{let{dragSnapToOrigin:e}=this.getProps();(e||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:u}=this.getProps();this.panSession=new ln(e,{onSessionStart:i,onStart:a,onMove:o,onSessionEnd:s,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,distanceThreshold:n,contextWindow:an(this.visualElement),element:this.visualElement.current})}stop(e,t){let n=e||this.latestPointerEvent,r=t||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!r||!n)return;let{velocity:a}=r;this.startAnimation(a);let{onDragEnd:o}=this.getProps();o&&v.postRender(()=>o(n,r))}cancel(){this.isDragging=!1;let{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();let{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t&&t.setActive(`whileDrag`,!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,t,n){let{drag:r}=this.getProps();if(!n||!X(e,r,this.currentDirection))return;let i=this.getAxisMotionValue(e),a=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(a=pn(a,this.constraints[e],this.elastic[e])),i.set(a)}resolveConstraints(){let{dragConstraints:e,dragElastic:t}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,r=this.constraints;e&&s(e)?this.constraints||=this.resolveRefConstraints():this.constraints=e&&n?hn(n.layoutBox,e):!1,this.elastic=bn(t),r!==this.constraints&&!s(e)&&n&&this.constraints&&!this.hasMutatedConstraints&&z(e=>{this.constraints!==!1&&this.getAxisMotionValue(e)&&(this.constraints[e]=yn(n.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){let{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!s(e))return!1;let n=e.current;le(n!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.",`drag-constraints-ref`);let{projection:r}=this.visualElement;if(!r||!r.layout)return!1;let i=Ce(n,r.root,this.visualElement.getTransformPagePoint()),a=_n(r.layout.layoutBox,i);if(t){let e=t(ve(a));this.hasMutatedConstraints=!!e,e&&(a=ye(e))}return a}startAnimation(e){let{drag:t,dragMomentum:n,dragElastic:r,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:o}=this.getProps(),s=this.constraints||{},c=z(o=>{if(!X(o,t,this.currentDirection))return;let c=s&&s[o]||{};a&&(c={min:0,max:0});let l=r?200:1e6,u=r?40:1e7,d={type:`inertia`,velocity:n?e[o]:0,bounceStiffness:l,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...i,...c};return this.startAxisValueAnimation(o,d)});return Promise.all(c).then(o)}startAxisValueAnimation(e,t){let n=this.getAxisMotionValue(e);return de(this.visualElement,e),n.start(Oe(e,n,0,t,this.visualElement,!1))}stopAnimation(){z(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){let t=`_drag${e.toUpperCase()}`,n=this.visualElement.getProps();return n[t]||this.visualElement.getValue(e,(n.initial?n.initial[e]:void 0)||0)}snapToCursor(e){z(t=>{let{drag:n}=this.getProps();if(!X(t,n,this.currentDirection))return;let{projection:r}=this.visualElement,i=this.getAxisMotionValue(t);if(r&&r.layout){let{min:n,max:a}=r.layout.layoutBox[t],o=i.get()||0;i.set(e[t]-f(n,a,.5)+o)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!s(t)||!n||!this.constraints)return;this.stopAnimation();let r={x:0,y:0};z(e=>{let t=this.getAxisMotionValue(e);if(t&&this.constraints!==!1){let n=t.get();r[e]=vn({min:n,max:n},this.constraints[e])}});let{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},``):`none`,n.root&&n.root.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),z(t=>{if(!X(t,e,null))return;let n=this.getAxisMotionValue(t),{min:i,max:a}=this.constraints[t];n.set(f(i,a,r[t]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;Cn.set(this.visualElement,this);let e=this.visualElement.current,t=G(e,`pointerdown`,t=>{let{drag:n,dragListener:r=!0}=this.getProps(),i=t.target,a=i!==e&&De(i);n&&r&&!a&&this.start(t)}),n,r=()=>{let{dragConstraints:t}=this.getProps();s(t)&&t.current&&(this.constraints=this.resolveRefConstraints(),n||=En(e,t.current,()=>this.scalePositionWithinConstraints()))},{projection:i}=this.visualElement,a=i.addEventListener(`measure`,r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),v.read(r);let o=C(window,`resize`,()=>this.scalePositionWithinConstraints()),c=i.addEventListener(`didUpdate`,(({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(z(t=>{let n=this.getAxisMotionValue(t);n&&(this.originPoint[t]+=e[t].translate,n.set(n.get()+e[t].translate))}),this.visualElement.render())}));return()=>{o(),t(),a(),c&&c(),n&&n()}}getProps(){let e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:n=!1,dragPropagation:r=!1,dragConstraints:i=!1,dragElastic:a=Y,dragMomentum:o=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:r,dragConstraints:i,dragElastic:a,dragMomentum:o}}};function Tn(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function En(e,t,n){let r=Ve(e,Tn(n)),i=Ve(t,Tn(n));return()=>{r(),i()}}
1function X(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function Dn(e,t=10){let n=null;return Math.abs(e.y)>t?n=`y`:Math.abs(e.x)>t&&(n=`x`),n}var On=class extends he{constructor(e){super(e),this.removeGroupControls=x,this.removeListeners=x,this.controls=new wn(e)}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||x}update(){let{dragControls:e}=this.node.getProps(),{dragControls:t}=this.node.prevProps||{};e!==t&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}},Z=e=>(t,n)=>{e&&v.update(()=>e(t,n),!1,!0)},kn=class extends he{constructor(){super(...arguments),this.removePointerDownListener=x}onPointerDown(e){this.session=new ln(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:an(this.node)})}createPanHandlers(){let{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:Z(e),onStart:Z(t),onMove:Z(n),onEnd:(e,t)=>{delete this.session,r&&v.postRender(()=>r(e,t))}}}mount(){this.removePointerDownListener=G(this.node.current,`pointerdown`,e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}},An=n(),Q=e(t(),1),$=!1,jn=class extends Q.Component{componentDidMount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:r}=this.props,{projection:i}=e;i&&(t.group&&t.group.add(i),n&&n.register&&r&&n.register(i),$&&i.root.didUpdate(),i.addEventListener(`animationComplete`,()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),B.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){let{layoutDependency:t,visualElement:n,drag:r,isPresent:i}=this.props,{projection:a}=n;return a?(a.isPresent=i,e.layoutDependency!==t&&a.setOptions({...a.options,layoutDependency:t}),$=!0,r||e.layoutDependency!==t||t===void 0||e.isPresent!==i?a.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?a.promote():a.relegate()||v.postRender(()=>{let e=a.getStack();(!e||!e.members.length)&&this.safeToRemove()})),null):null}componentDidUpdate(){let{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),ce.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;$=!0,r&&(r.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(r),n&&n.deregister&&n.deregister(r))}safeToRemove(){let{safeToRemove:e}=this.props;e&&e()}render(){return null}};function Mn(e){let[t,n]=i(),r=(0,Q.useContext)(o);return(0,An.jsx)(jn,{...e,layoutGroup:r,switchLayoutGroup:(0,Q.useContext)(a),isPresent:t,safeToRemove:n})}var Nn={pan:{Feature:kn},drag:{Feature:On,ProjectionNode:rn,MeasureLayout:Mn}},Pn={layout:{ProjectionNode:rn,MeasureLayout:Mn}},Fn={...Ee,...Nn,...Pn};export{Fn as t};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.