adminizer 4.1.0-build.34 → 4.1.0-build.35

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/assets/{add-NjsCZZct.js → add-VGaP5zEb.js} +1 -1
  2. package/assets/{add-form-DJnEBqvy.js → add-form-DAMJbss4.js} +1 -1
  3. package/assets/{app-DVaaqBB5.css → app-DVDnphrb.css} +1 -1
  4. package/assets/app.js +2 -2
  5. package/assets/catalog-C88wv-rq.js +16 -0
  6. package/assets/{dashboard-BTmXuc5F.js → dashboard-DKUwxgt4.js} +1 -1
  7. package/assets/{dialog-stack-BAuaxCy1.js → dialog-stack-V6c1TlnC.js} +1 -1
  8. package/assets/field-renderer-zGC76llY.js +1 -1
  9. package/assets/{form-DOt5Fa6e.js → form-BMth9K43.js} +1 -1
  10. package/assets/{form-CN2xVSMK.js → form-DkRGBp5e.js} +1 -1
  11. package/assets/{home-3FBATYFh.js → home-lYdYhEcS.js} +2 -2
  12. package/assets/{init-user-BBfP40-3.js → init-user-GyTJdhrh.js} +1 -1
  13. package/assets/{list-DqIUjXSX.js → list-B-EsqncQ.js} +1 -1
  14. package/assets/{list-table-1aXDvDPl.js → list-table-DqU7Spnz.js} +1 -1
  15. package/assets/{login-Bv4hqwaM.js → login-BMJ97XcF.js} +1 -1
  16. package/assets/manifest.json +90 -152
  17. package/assets/module-CsWq478Z.js +1 -0
  18. package/assets/{register-D8SyTFBZ.js → register-CcA8kQ56.js} +1 -1
  19. package/assets/sonner-Dp8PyHu_.js +1 -0
  20. package/controllers/catalog/Catalog.js +2 -3
  21. package/controllers/catalog/FrontentCatalogAdapter.d.ts +4 -8
  22. package/controllers/catalog/FrontentCatalogAdapter.js +20 -22
  23. package/lib/v4/catalog/AbstractCatalog.d.ts +12 -23
  24. package/lib/v4/catalog/AbstractCatalog.js +5 -7
  25. package/package.json +1 -1
  26. package/system/bindModels.js +1 -1
  27. package/assets/catalog-CeUUKxG9.js +0 -17
  28. package/assets/group-link-add-CCNISxeF.js +0 -1
  29. package/assets/item-add-CX7EOX0H.js +0 -1
  30. package/assets/module-DziT22BH.js +0 -1
  31. package/assets/sonner-MAL0i2dq.js +0 -1
@@ -0,0 +1,16 @@
1
+ import{r as p,j as v,g as nd,W as H,a as rd,R as id,b as te,f as sd}from"./app.js";import{c as Oe}from"./compiler-runtime-Cj7rbuyn.js";import{A as od}from"./app-layout-NY6MXzc5.js";import{r as ad,d as cd}from"./debounce-qdyXyOeG.js";import{S as bi,a as Ti,b as Si,c as wi,d as Ci}from"./select-MzwxLt1D.js";import{B as vt}from"./button-BV-GbIpN.js";import{I as $r}from"./input-B7wUhbil.js";import{S as gr}from"./skeleton-C3gmNc1Z.js";import Ei from"./material-icon-BAd3Wrgn.js";import{C as ld}from"./chevron-right-D5q8rF7h.js";import{L as wt}from"./loader-circle-Utah5tGx.js";import{P as ud,D as dd}from"./del-modal-BUVjhY0k.js";import{u as fd,c as $,a as hd,b as pd,o as gd,s as md,f as vd,d as yd,e as xd,h as bd,l as Td,g as Sd,i as wd,j as Cd}from"./index-BCpOvf4m.js";import{c as sn,u as ke,a as Ur}from"./index-Cq31rrfZ.js";import{c as Da,u as ve}from"./index-DU8vYhyh.js";import{u as Pa}from"./index-B__NksD2.js";import{h as Ed,u as Dd,R as Pd}from"./index-CcxvoJO6.js";import{P as Jn}from"./index-lqMxC6QB.js";import{c as Oa}from"./utils-DjqsqOe8.js";import{D as Od,a as mr,b as Md,c as Id}from"./dialog-stack-V6c1TlnC.js";import Ps from"./add-form-DAMJbss4.js";import{L as Ct}from"./label-GEoZpZr4.js";import{C as Ma}from"./checkbox-DrkQu16U.js";import{c as Ia}from"./createLucideIcon-BFG25zNo.js";import{t as Os,T as Rd}from"./sonner-Dp8PyHu_.js";import"./sidebar-DGp3i7GG.js";import"./index-C0o7vG6r.js";import"./index-DN1K56yz.js";import"./tooltip-Du62rBCn.js";import"./index-DoVAC0HX.js";import"./app-shell-BjaxjNs9.js";import"./app-sidebar-CLu13Pcu.js";import"./nav-main-JVt9gzn8.js";import"./index-oMAR28Sy.js";import"./chevrons-up-down-kALltqHV.js";import"./app-sidebar-header-5IaQpngt.js";import"./breadcrumbs-CDxSbsTe.js";import"./nav-user-DgYX0wO7.js";import"./dropdown-menu-CeMIoM8d.js";import"./user-info-C_11jYGE.js";import"./user-menu-content-BNRzhEo_.js";import"./icon-CqJOMij7.js";import"./use-appearance-DeUiDZ72.js";import"./index-DwctwfU0.js";import"./chevron-down-B5XuAFRu.js";import"./check-LAUWAnlX.js";import"./trash-2-BoK5Xp2F.js";import"./field-renderer-zGC76llY.js";import"./dynamic-controls-CSVVCONh.js";import"./multi-select-CSxVlxon.js";import"./popover-B3ZOyoLQ.js";import"./search-BspystAk.js";import"./form-state-702tb_BV.js";import"./input-error-DFk1EyT_.js";import"./move-left-BhKZRPb4.js";/**
2
+ * @license lucide-react v0.485.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const Ad=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.9 4.9 14.2 14.2",key:"1m5liu"}]],Nd=Ia("ban",Ad);/**
7
+ * @license lucide-react v0.485.0 - ISC
8
+ *
9
+ * This source code is licensed under the ISC license.
10
+ * See the LICENSE file in the root directory of this source tree.
11
+ */const _d=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Ra=Ia("plus",_d);function Aa(t){let e=null;return()=>(e==null&&(e=t()),e)}function Ld(t,e){return t.filter(n=>n!==e)}function kd(t,e){const n=new Set,r=s=>n.add(s);t.forEach(r),e.forEach(r);const i=[];return n.forEach(s=>i.push(s)),i}class jd{enter(e){const n=this.entered.length,r=i=>this.isNodeInDocument(i)&&(!i.contains||i.contains(e));return this.entered=kd(this.entered.filter(r),[e]),n===0&&this.entered.length>0}leave(e){const n=this.entered.length;return this.entered=Ld(this.entered.filter(this.isNodeInDocument),e),n>0&&this.entered.length===0}reset(){this.entered=[]}constructor(e){this.entered=[],this.isNodeInDocument=e}}class Vd{initializeExposedProperties(){Object.keys(this.config.exposeProperties).forEach(e=>{Object.defineProperty(this.item,e,{configurable:!0,enumerable:!0,get(){return console.warn(`Browser doesn't allow reading "${e}" until the drop event.`),null}})})}loadDataTransfer(e){if(e){const n={};Object.keys(this.config.exposeProperties).forEach(r=>{const i=this.config.exposeProperties[r];i!=null&&(n[r]={value:i(e,this.config.matchesTypes),configurable:!0,enumerable:!0})}),Object.defineProperties(this.item,n)}}canDrag(){return!0}beginDrag(){return this.item}isDragging(e,n){return n===e.getSourceId()}endDrag(){}constructor(e){this.config=e,this.item={},this.initializeExposedProperties()}}const Na="__NATIVE_FILE__",_a="__NATIVE_URL__",La="__NATIVE_TEXT__",ka="__NATIVE_HTML__",Ms=Object.freeze(Object.defineProperty({__proto__:null,FILE:Na,HTML:ka,TEXT:La,URL:_a},Symbol.toStringTag,{value:"Module"}));function vr(t,e,n){const r=e.reduce((i,s)=>i||t.getData(s),"");return r??n}const Hr={[Na]:{exposeProperties:{files:t=>Array.prototype.slice.call(t.files),items:t=>t.items,dataTransfer:t=>t},matchesTypes:["Files"]},[ka]:{exposeProperties:{html:(t,e)=>vr(t,e,""),dataTransfer:t=>t},matchesTypes:["Html","text/html"]},[_a]:{exposeProperties:{urls:(t,e)=>vr(t,e,"").split(`
12
+ `),dataTransfer:t=>t},matchesTypes:["Url","text/uri-list"]},[La]:{exposeProperties:{text:(t,e)=>vr(t,e,""),dataTransfer:t=>t},matchesTypes:["Text","text/plain"]}};function Fd(t,e){const n=Hr[t];if(!n)throw new Error(`native type ${t} has no configuration`);const r=new Vd(n);return r.loadDataTransfer(e),r}function yr(t){if(!t)return null;const e=Array.prototype.slice.call(t.types||[]);return Object.keys(Hr).filter(n=>{const r=Hr[n];return r!=null&&r.matchesTypes?r.matchesTypes.some(i=>e.indexOf(i)>-1):!1})[0]||null}const Bd=Aa(()=>/firefox/i.test(navigator.userAgent)),ja=Aa(()=>!!window.safari);class Is{interpolate(e){const{xs:n,ys:r,c1s:i,c2s:s,c3s:o}=this;let a=n.length-1;if(e===n[a])return r[a];let c=0,l=o.length-1,u;for(;c<=l;){u=Math.floor(.5*(c+l));const h=n[u];if(h<e)c=u+1;else if(h>e)l=u-1;else return r[u]}a=Math.max(0,l);const d=e-n[a],f=d*d;return r[a]+i[a]*d+s[a]*f+o[a]*d*f}constructor(e,n){const{length:r}=e,i=[];for(let h=0;h<r;h++)i.push(h);i.sort((h,m)=>e[h]<e[m]?-1:1);const s=[],o=[];let a,c;for(let h=0;h<r-1;h++)a=e[h+1]-e[h],c=n[h+1]-n[h],s.push(a),o.push(c/a);const l=[o[0]];for(let h=0;h<s.length-1;h++){const m=o[h],g=o[h+1];if(m*g<=0)l.push(0);else{a=s[h];const y=s[h+1],x=a+y;l.push(3*x/((x+y)/m+(x+a)/g))}}l.push(o[o.length-1]);const u=[],d=[];let f;for(let h=0;h<l.length-1;h++){f=o[h];const m=l[h],g=1/s[h],y=m+l[h+1]-f-f;u.push((f-m-y)*g),d.push(y*g*g)}this.xs=e,this.ys=n,this.c1s=l,this.c2s=u,this.c3s=d}}const $d=1;function Va(t){const e=t.nodeType===$d?t:t.parentElement;if(!e)return null;const{top:n,left:r}=e.getBoundingClientRect();return{x:r,y:n}}function xn(t){return{x:t.clientX,y:t.clientY}}function Ud(t){var e;return t.nodeName==="IMG"&&(Bd()||!(!((e=document.documentElement)===null||e===void 0)&&e.contains(t)))}function Hd(t,e,n,r){let i=t?e.width:n,s=t?e.height:r;return ja()&&t&&(s/=window.devicePixelRatio,i/=window.devicePixelRatio),{dragPreviewWidth:i,dragPreviewHeight:s}}function zd(t,e,n,r,i){const s=Ud(e),a=Va(s?t:e),c={x:n.x-a.x,y:n.y-a.y},{offsetWidth:l,offsetHeight:u}=t,{anchorX:d,anchorY:f}=r,{dragPreviewWidth:h,dragPreviewHeight:m}=Hd(s,e,l,u),g=()=>{let P=new Is([0,.5,1],[c.y,c.y/u*m,c.y+m-u]).interpolate(f);return ja()&&s&&(P+=(window.devicePixelRatio-1)*m),P},y=()=>new Is([0,.5,1],[c.x,c.x/l*h,c.x+h-l]).interpolate(d),{offsetX:x,offsetY:b}=i,T=x===0||x,S=b===0||b;return{x:T?x:y(),y:S?b:g()}}let Wd=class{get window(){if(this.globalContext)return this.globalContext;if(typeof window<"u")return window}get document(){var e;return!((e=this.globalContext)===null||e===void 0)&&e.document?this.globalContext.document:this.window?this.window.document:void 0}get rootElement(){var e;return((e=this.optionsArgs)===null||e===void 0?void 0:e.rootElement)||this.window}constructor(e,n){this.ownerDocument=null,this.globalContext=e,this.optionsArgs=n}};function Gd(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Rs(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable}))),r.forEach(function(i){Gd(t,i,n[i])})}return t}class Kd{profile(){var e,n;return{sourcePreviewNodes:this.sourcePreviewNodes.size,sourcePreviewNodeOptions:this.sourcePreviewNodeOptions.size,sourceNodeOptions:this.sourceNodeOptions.size,sourceNodes:this.sourceNodes.size,dragStartSourceIds:((e=this.dragStartSourceIds)===null||e===void 0?void 0:e.length)||0,dropTargetIds:this.dropTargetIds.length,dragEnterTargetIds:this.dragEnterTargetIds.length,dragOverTargetIds:((n=this.dragOverTargetIds)===null||n===void 0?void 0:n.length)||0}}get window(){return this.options.window}get document(){return this.options.document}get rootElement(){return this.options.rootElement}setup(){const e=this.rootElement;if(e!==void 0){if(e.__isReactDndBackendSetUp)throw new Error("Cannot have two HTML5 backends at the same time.");e.__isReactDndBackendSetUp=!0,this.addEventListeners(e)}}teardown(){const e=this.rootElement;if(e!==void 0&&(e.__isReactDndBackendSetUp=!1,this.removeEventListeners(this.rootElement),this.clearCurrentDragSourceNode(),this.asyncEndDragFrameId)){var n;(n=this.window)===null||n===void 0||n.cancelAnimationFrame(this.asyncEndDragFrameId)}}connectDragPreview(e,n,r){return this.sourcePreviewNodeOptions.set(e,r),this.sourcePreviewNodes.set(e,n),()=>{this.sourcePreviewNodes.delete(e),this.sourcePreviewNodeOptions.delete(e)}}connectDragSource(e,n,r){this.sourceNodes.set(e,n),this.sourceNodeOptions.set(e,r);const i=o=>this.handleDragStart(o,e),s=o=>this.handleSelectStart(o);return n.setAttribute("draggable","true"),n.addEventListener("dragstart",i),n.addEventListener("selectstart",s),()=>{this.sourceNodes.delete(e),this.sourceNodeOptions.delete(e),n.removeEventListener("dragstart",i),n.removeEventListener("selectstart",s),n.setAttribute("draggable","false")}}connectDropTarget(e,n){const r=o=>this.handleDragEnter(o,e),i=o=>this.handleDragOver(o,e),s=o=>this.handleDrop(o,e);return n.addEventListener("dragenter",r),n.addEventListener("dragover",i),n.addEventListener("drop",s),()=>{n.removeEventListener("dragenter",r),n.removeEventListener("dragover",i),n.removeEventListener("drop",s)}}addEventListeners(e){e.addEventListener&&(e.addEventListener("dragstart",this.handleTopDragStart),e.addEventListener("dragstart",this.handleTopDragStartCapture,!0),e.addEventListener("dragend",this.handleTopDragEndCapture,!0),e.addEventListener("dragenter",this.handleTopDragEnter),e.addEventListener("dragenter",this.handleTopDragEnterCapture,!0),e.addEventListener("dragleave",this.handleTopDragLeaveCapture,!0),e.addEventListener("dragover",this.handleTopDragOver),e.addEventListener("dragover",this.handleTopDragOverCapture,!0),e.addEventListener("drop",this.handleTopDrop),e.addEventListener("drop",this.handleTopDropCapture,!0))}removeEventListeners(e){e.removeEventListener&&(e.removeEventListener("dragstart",this.handleTopDragStart),e.removeEventListener("dragstart",this.handleTopDragStartCapture,!0),e.removeEventListener("dragend",this.handleTopDragEndCapture,!0),e.removeEventListener("dragenter",this.handleTopDragEnter),e.removeEventListener("dragenter",this.handleTopDragEnterCapture,!0),e.removeEventListener("dragleave",this.handleTopDragLeaveCapture,!0),e.removeEventListener("dragover",this.handleTopDragOver),e.removeEventListener("dragover",this.handleTopDragOverCapture,!0),e.removeEventListener("drop",this.handleTopDrop),e.removeEventListener("drop",this.handleTopDropCapture,!0))}getCurrentSourceNodeOptions(){const e=this.monitor.getSourceId(),n=this.sourceNodeOptions.get(e);return Rs({dropEffect:this.altKeyPressed?"copy":"move"},n||{})}getCurrentDropEffect(){return this.isDraggingNativeItem()?"copy":this.getCurrentSourceNodeOptions().dropEffect}getCurrentSourcePreviewNodeOptions(){const e=this.monitor.getSourceId(),n=this.sourcePreviewNodeOptions.get(e);return Rs({anchorX:.5,anchorY:.5,captureDraggingState:!1},n||{})}isDraggingNativeItem(){const e=this.monitor.getItemType();return Object.keys(Ms).some(n=>Ms[n]===e)}beginDragNativeItem(e,n){this.clearCurrentDragSourceNode(),this.currentNativeSource=Fd(e,n),this.currentNativeHandle=this.registry.addSource(e,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle])}setCurrentDragSourceNode(e){this.clearCurrentDragSourceNode(),this.currentDragSourceNode=e;const n=1e3;this.mouseMoveTimeoutTimer=setTimeout(()=>{var r;return(r=this.rootElement)===null||r===void 0?void 0:r.addEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)},n)}clearCurrentDragSourceNode(){if(this.currentDragSourceNode){if(this.currentDragSourceNode=null,this.rootElement){var e;(e=this.window)===null||e===void 0||e.clearTimeout(this.mouseMoveTimeoutTimer||void 0),this.rootElement.removeEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)}return this.mouseMoveTimeoutTimer=null,!0}return!1}handleDragStart(e,n){e.defaultPrevented||(this.dragStartSourceIds||(this.dragStartSourceIds=[]),this.dragStartSourceIds.unshift(n))}handleDragEnter(e,n){this.dragEnterTargetIds.unshift(n)}handleDragOver(e,n){this.dragOverTargetIds===null&&(this.dragOverTargetIds=[]),this.dragOverTargetIds.unshift(n)}handleDrop(e,n){this.dropTargetIds.unshift(n)}constructor(e,n,r){this.sourcePreviewNodes=new Map,this.sourcePreviewNodeOptions=new Map,this.sourceNodes=new Map,this.sourceNodeOptions=new Map,this.dragStartSourceIds=null,this.dropTargetIds=[],this.dragEnterTargetIds=[],this.currentNativeSource=null,this.currentNativeHandle=null,this.currentDragSourceNode=null,this.altKeyPressed=!1,this.mouseMoveTimeoutTimer=null,this.asyncEndDragFrameId=null,this.dragOverTargetIds=null,this.lastClientOffset=null,this.hoverRafId=null,this.getSourceClientOffset=i=>{const s=this.sourceNodes.get(i);return s&&Va(s)||null},this.endDragNativeItem=()=>{this.isDraggingNativeItem()&&(this.actions.endDrag(),this.currentNativeHandle&&this.registry.removeSource(this.currentNativeHandle),this.currentNativeHandle=null,this.currentNativeSource=null)},this.isNodeInDocument=i=>!!(i&&this.document&&this.document.body&&this.document.body.contains(i)),this.endDragIfSourceWasRemovedFromDOM=()=>{const i=this.currentDragSourceNode;i==null||this.isNodeInDocument(i)||(this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover())},this.scheduleHover=i=>{this.hoverRafId===null&&typeof requestAnimationFrame<"u"&&(this.hoverRafId=requestAnimationFrame(()=>{this.monitor.isDragging()&&this.actions.hover(i||[],{clientOffset:this.lastClientOffset}),this.hoverRafId=null}))},this.cancelHover=()=>{this.hoverRafId!==null&&typeof cancelAnimationFrame<"u"&&(cancelAnimationFrame(this.hoverRafId),this.hoverRafId=null)},this.handleTopDragStartCapture=()=>{this.clearCurrentDragSourceNode(),this.dragStartSourceIds=[]},this.handleTopDragStart=i=>{if(i.defaultPrevented)return;const{dragStartSourceIds:s}=this;this.dragStartSourceIds=null;const o=xn(i);this.monitor.isDragging()&&(this.actions.endDrag(),this.cancelHover()),this.actions.beginDrag(s||[],{publishSource:!1,getSourceClientOffset:this.getSourceClientOffset,clientOffset:o});const{dataTransfer:a}=i,c=yr(a);if(this.monitor.isDragging()){if(a&&typeof a.setDragImage=="function"){const u=this.monitor.getSourceId(),d=this.sourceNodes.get(u),f=this.sourcePreviewNodes.get(u)||d;if(f){const{anchorX:h,anchorY:m,offsetX:g,offsetY:y}=this.getCurrentSourcePreviewNodeOptions(),T=zd(d,f,o,{anchorX:h,anchorY:m},{offsetX:g,offsetY:y});a.setDragImage(f,T.x,T.y)}}try{a==null||a.setData("application/json",{})}catch{}this.setCurrentDragSourceNode(i.target);const{captureDraggingState:l}=this.getCurrentSourcePreviewNodeOptions();l?this.actions.publishDragSource():setTimeout(()=>this.actions.publishDragSource(),0)}else if(c)this.beginDragNativeItem(c);else{if(a&&!a.types&&(i.target&&!i.target.hasAttribute||!i.target.hasAttribute("draggable")))return;i.preventDefault()}},this.handleTopDragEndCapture=()=>{this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleTopDragEnterCapture=i=>{if(this.dragEnterTargetIds=[],this.isDraggingNativeItem()){var s;(s=this.currentNativeSource)===null||s===void 0||s.loadDataTransfer(i.dataTransfer)}if(!this.enterLeaveCounter.enter(i.target)||this.monitor.isDragging())return;const{dataTransfer:a}=i,c=yr(a);c&&this.beginDragNativeItem(c,a)},this.handleTopDragEnter=i=>{const{dragEnterTargetIds:s}=this;if(this.dragEnterTargetIds=[],!this.monitor.isDragging())return;this.altKeyPressed=i.altKey,s.length>0&&this.actions.hover(s,{clientOffset:xn(i)}),s.some(a=>this.monitor.canDropOnTarget(a))&&(i.preventDefault(),i.dataTransfer&&(i.dataTransfer.dropEffect=this.getCurrentDropEffect()))},this.handleTopDragOverCapture=i=>{if(this.dragOverTargetIds=[],this.isDraggingNativeItem()){var s;(s=this.currentNativeSource)===null||s===void 0||s.loadDataTransfer(i.dataTransfer)}},this.handleTopDragOver=i=>{const{dragOverTargetIds:s}=this;if(this.dragOverTargetIds=[],!this.monitor.isDragging()){i.preventDefault(),i.dataTransfer&&(i.dataTransfer.dropEffect="none");return}this.altKeyPressed=i.altKey,this.lastClientOffset=xn(i),this.scheduleHover(s),(s||[]).some(a=>this.monitor.canDropOnTarget(a))?(i.preventDefault(),i.dataTransfer&&(i.dataTransfer.dropEffect=this.getCurrentDropEffect())):this.isDraggingNativeItem()?i.preventDefault():(i.preventDefault(),i.dataTransfer&&(i.dataTransfer.dropEffect="none"))},this.handleTopDragLeaveCapture=i=>{this.isDraggingNativeItem()&&i.preventDefault(),this.enterLeaveCounter.leave(i.target)&&(this.isDraggingNativeItem()&&setTimeout(()=>this.endDragNativeItem(),0),this.cancelHover())},this.handleTopDropCapture=i=>{if(this.dropTargetIds=[],this.isDraggingNativeItem()){var s;i.preventDefault(),(s=this.currentNativeSource)===null||s===void 0||s.loadDataTransfer(i.dataTransfer)}else yr(i.dataTransfer)&&i.preventDefault();this.enterLeaveCounter.reset()},this.handleTopDrop=i=>{const{dropTargetIds:s}=this;this.dropTargetIds=[],this.actions.hover(s,{clientOffset:xn(i)}),this.actions.drop({dropEffect:this.getCurrentDropEffect()}),this.isDraggingNativeItem()?this.endDragNativeItem():this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleSelectStart=i=>{const s=i.target;typeof s.dragDrop=="function"&&(s.tagName==="INPUT"||s.tagName==="SELECT"||s.tagName==="TEXTAREA"||s.isContentEditable||(i.preventDefault(),s.dragDrop()))},this.options=new Wd(n,r),this.actions=e.getActions(),this.monitor=e.getMonitor(),this.registry=e.getRegistry(),this.enterLeaveCounter=new jd(this.isNodeInDocument)}}let bn;function Yd(){return bn||(bn=new Image,bn.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="),bn}const Xd=function(e,n,r){return new Kd(e,n,r)};var at=[],qd=function(){return at.some(function(t){return t.activeTargets.length>0})},Zd=function(){return at.some(function(t){return t.skippedTargets.length>0})},As="ResizeObserver loop completed with undelivered notifications.",Jd=function(){var t;typeof ErrorEvent=="function"?t=new ErrorEvent("error",{message:As}):(t=document.createEvent("Event"),t.initEvent("error",!1,!1),t.message=As),window.dispatchEvent(t)},qt;(function(t){t.BORDER_BOX="border-box",t.CONTENT_BOX="content-box",t.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"})(qt||(qt={}));var ct=function(t){return Object.freeze(t)},Qd=function(){function t(e,n){this.inlineSize=e,this.blockSize=n,ct(this)}return t}(),Fa=function(){function t(e,n,r,i){return this.x=e,this.y=n,this.width=r,this.height=i,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,ct(this)}return t.prototype.toJSON=function(){var e=this,n=e.x,r=e.y,i=e.top,s=e.right,o=e.bottom,a=e.left,c=e.width,l=e.height;return{x:n,y:r,top:i,right:s,bottom:o,left:a,width:c,height:l}},t.fromRect=function(e){return new t(e.x,e.y,e.width,e.height)},t}(),Di=function(t){return t instanceof SVGElement&&"getBBox"in t},Ba=function(t){if(Di(t)){var e=t.getBBox(),n=e.width,r=e.height;return!n&&!r}var i=t,s=i.offsetWidth,o=i.offsetHeight;return!(s||o||t.getClientRects().length)},Ns=function(t){var e;if(t instanceof Element)return!0;var n=(e=t==null?void 0:t.ownerDocument)===null||e===void 0?void 0:e.defaultView;return!!(n&&t instanceof n.Element)},ef=function(t){switch(t.tagName){case"INPUT":if(t.type!=="image")break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1},Ht=typeof window<"u"?window:{},Tn=new WeakMap,_s=/auto|scroll/,tf=/^tb|vertical/,nf=/msie|trident/i.test(Ht.navigator&&Ht.navigator.userAgent),Ie=function(t){return parseFloat(t||"0")},Et=function(t,e,n){return t===void 0&&(t=0),e===void 0&&(e=0),n===void 0&&(n=!1),new Qd((n?e:t)||0,(n?t:e)||0)},Ls=ct({devicePixelContentBoxSize:Et(),borderBoxSize:Et(),contentBoxSize:Et(),contentRect:new Fa(0,0,0,0)}),$a=function(t,e){if(e===void 0&&(e=!1),Tn.has(t)&&!e)return Tn.get(t);if(Ba(t))return Tn.set(t,Ls),Ls;var n=getComputedStyle(t),r=Di(t)&&t.ownerSVGElement&&t.getBBox(),i=!nf&&n.boxSizing==="border-box",s=tf.test(n.writingMode||""),o=!r&&_s.test(n.overflowY||""),a=!r&&_s.test(n.overflowX||""),c=r?0:Ie(n.paddingTop),l=r?0:Ie(n.paddingRight),u=r?0:Ie(n.paddingBottom),d=r?0:Ie(n.paddingLeft),f=r?0:Ie(n.borderTopWidth),h=r?0:Ie(n.borderRightWidth),m=r?0:Ie(n.borderBottomWidth),g=r?0:Ie(n.borderLeftWidth),y=d+l,x=c+u,b=g+h,T=f+m,S=a?t.offsetHeight-T-t.clientHeight:0,C=o?t.offsetWidth-b-t.clientWidth:0,P=i?y+b:0,D=i?x+T:0,E=r?r.width:Ie(n.width)-P-C,_=r?r.height:Ie(n.height)-D-S,N=E+y+C+b,z=_+x+S+T,K=ct({devicePixelContentBoxSize:Et(Math.round(E*devicePixelRatio),Math.round(_*devicePixelRatio),s),borderBoxSize:Et(N,z,s),contentBoxSize:Et(E,_,s),contentRect:new Fa(d,c,E,_)});return Tn.set(t,K),K},Ua=function(t,e,n){var r=$a(t,n),i=r.borderBoxSize,s=r.contentBoxSize,o=r.devicePixelContentBoxSize;switch(e){case qt.DEVICE_PIXEL_CONTENT_BOX:return o;case qt.BORDER_BOX:return i;default:return s}},rf=function(){function t(e){var n=$a(e);this.target=e,this.contentRect=n.contentRect,this.borderBoxSize=ct([n.borderBoxSize]),this.contentBoxSize=ct([n.contentBoxSize]),this.devicePixelContentBoxSize=ct([n.devicePixelContentBoxSize])}return t}(),Ha=function(t){if(Ba(t))return 1/0;for(var e=0,n=t.parentNode;n;)e+=1,n=n.parentNode;return e},sf=function(){var t=1/0,e=[];at.forEach(function(o){if(o.activeTargets.length!==0){var a=[];o.activeTargets.forEach(function(l){var u=new rf(l.target),d=Ha(l.target);a.push(u),l.lastReportedSize=Ua(l.target,l.observedBox),d<t&&(t=d)}),e.push(function(){o.callback.call(o.observer,a,o.observer)}),o.activeTargets.splice(0,o.activeTargets.length)}});for(var n=0,r=e;n<r.length;n++){var i=r[n];i()}return t},ks=function(t){at.forEach(function(n){n.activeTargets.splice(0,n.activeTargets.length),n.skippedTargets.splice(0,n.skippedTargets.length),n.observationTargets.forEach(function(i){i.isActive()&&(Ha(i.target)>t?n.activeTargets.push(i):n.skippedTargets.push(i))})})},of=function(){var t=0;for(ks(t);qd();)t=sf(),ks(t);return Zd()&&Jd(),t>0},xr,za=[],af=function(){return za.splice(0).forEach(function(t){return t()})},cf=function(t){if(!xr){var e=0,n=document.createTextNode(""),r={characterData:!0};new MutationObserver(function(){return af()}).observe(n,r),xr=function(){n.textContent="".concat(e?e--:e++)}}za.push(t),xr()},lf=function(t){cf(function(){requestAnimationFrame(t)})},An=0,uf=function(){return!!An},df=250,ff={attributes:!0,characterData:!0,childList:!0,subtree:!0},js=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],Vs=function(t){return t===void 0&&(t=0),Date.now()+t},br=!1,hf=function(){function t(){var e=this;this.stopped=!0,this.listener=function(){return e.schedule()}}return t.prototype.run=function(e){var n=this;if(e===void 0&&(e=df),!br){br=!0;var r=Vs(e);lf(function(){var i=!1;try{i=of()}finally{if(br=!1,e=r-Vs(),!uf())return;i?n.run(1e3):e>0?n.run(e):n.start()}})}},t.prototype.schedule=function(){this.stop(),this.run()},t.prototype.observe=function(){var e=this,n=function(){return e.observer&&e.observer.observe(document.body,ff)};document.body?n():Ht.addEventListener("DOMContentLoaded",n)},t.prototype.start=function(){var e=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),js.forEach(function(n){return Ht.addEventListener(n,e.listener,!0)}))},t.prototype.stop=function(){var e=this;this.stopped||(this.observer&&this.observer.disconnect(),js.forEach(function(n){return Ht.removeEventListener(n,e.listener,!0)}),this.stopped=!0)},t}(),zr=new hf,Fs=function(t){!An&&t>0&&zr.start(),An+=t,!An&&zr.stop()},pf=function(t){return!Di(t)&&!ef(t)&&getComputedStyle(t).display==="inline"},gf=function(){function t(e,n){this.target=e,this.observedBox=n||qt.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return t.prototype.isActive=function(){var e=Ua(this.target,this.observedBox,!0);return pf(this.target)&&(this.lastReportedSize=e),this.lastReportedSize.inlineSize!==e.inlineSize||this.lastReportedSize.blockSize!==e.blockSize},t}(),mf=function(){function t(e,n){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=e,this.callback=n}return t}(),Sn=new WeakMap,Bs=function(t,e){for(var n=0;n<t.length;n+=1)if(t[n].target===e)return n;return-1},wn=function(){function t(){}return t.connect=function(e,n){var r=new mf(e,n);Sn.set(e,r)},t.observe=function(e,n,r){var i=Sn.get(e),s=i.observationTargets.length===0;Bs(i.observationTargets,n)<0&&(s&&at.push(i),i.observationTargets.push(new gf(n,r&&r.box)),Fs(1),zr.schedule())},t.unobserve=function(e,n){var r=Sn.get(e),i=Bs(r.observationTargets,n),s=r.observationTargets.length===1;i>=0&&(s&&at.splice(at.indexOf(r),1),r.observationTargets.splice(i,1),Fs(-1))},t.disconnect=function(e){var n=this,r=Sn.get(e);r.observationTargets.slice().forEach(function(i){return n.unobserve(e,i.target)}),r.activeTargets.splice(0,r.activeTargets.length)},t}(),vf=function(){function t(e){if(arguments.length===0)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if(typeof e!="function")throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");wn.connect(this,e)}return t.prototype.observe=function(e,n){if(arguments.length===0)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!Ns(e))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");wn.observe(this,e,n)},t.prototype.unobserve=function(e){if(arguments.length===0)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!Ns(e))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");wn.unobserve(this,e)},t.prototype.disconnect=function(){wn.disconnect(this)},t.toString=function(){return"function ResizeObserver () { [polyfill code] }"},t}();const Wa=p.createContext({});function yf(t){const e=p.useRef(null);return e.current===null&&(e.current=t()),e.current}const Pi=p.createContext(null),Ga=p.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});function xf(t=!0){const e=p.useContext(Pi);if(e===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:i}=e,s=p.useId();p.useEffect(()=>{t&&i(s)},[t]);const o=p.useCallback(()=>t&&r&&r(s),[s,r,t]);return!n&&r?[!1,o]:[!0]}const Oi=typeof window<"u",bf=Oi?p.useLayoutEffect:p.useEffect,me=t=>t;let Ka=me;function Mi(t){let e;return()=>(e===void 0&&(e=t()),e)}const Dt=(t,e,n)=>{const r=e-t;return r===0?1:(n-t)/r},_e=t=>t*1e3,Le=t=>t/1e3,Tf={useManualTiming:!1};function Sf(t){let e=new Set,n=new Set,r=!1,i=!1;const s=new WeakSet;let o={delta:0,timestamp:0,isProcessing:!1};function a(l){s.has(l)&&(c.schedule(l),t()),l(o)}const c={schedule:(l,u=!1,d=!1)=>{const h=d&&r?e:n;return u&&s.add(l),h.has(l)||h.add(l),l},cancel:l=>{n.delete(l),s.delete(l)},process:l=>{if(o=l,r){i=!0;return}r=!0,[e,n]=[n,e],e.forEach(a),e.clear(),r=!1,i&&(i=!1,c.process(l))}};return c}const Cn=["read","resolveKeyframes","update","preRender","render","postRender"],wf=40;function Ya(t,e){let n=!1,r=!0;const i={delta:0,timestamp:0,isProcessing:!1},s=()=>n=!0,o=Cn.reduce((x,b)=>(x[b]=Sf(s),x),{}),{read:a,resolveKeyframes:c,update:l,preRender:u,render:d,postRender:f}=o,h=()=>{const x=performance.now();n=!1,i.delta=r?1e3/60:Math.max(Math.min(x-i.timestamp,wf),1),i.timestamp=x,i.isProcessing=!0,a.process(i),c.process(i),l.process(i),u.process(i),d.process(i),f.process(i),i.isProcessing=!1,n&&e&&(r=!1,t(h))},m=()=>{n=!0,r=!0,i.isProcessing||t(h)};return{schedule:Cn.reduce((x,b)=>{const T=o[b];return x[b]=(S,C=!1,P=!1)=>(n||m(),T.schedule(S,C,P)),x},{}),cancel:x=>{for(let b=0;b<Cn.length;b++)o[Cn[b]].cancel(x)},state:i,steps:o}}const{schedule:G,cancel:We,state:se,steps:Tr}=Ya(typeof requestAnimationFrame<"u"?requestAnimationFrame:me,!0),Xa=p.createContext({strict:!1}),$s={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},Pt={};for(const t in $s)Pt[t]={isEnabled:e=>$s[t].some(n=>!!e[n])};function Cf(t){for(const e in t)Pt[e]={...Pt[e],...t[e]}}const Ef=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function $n(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||Ef.has(t)}let qa=t=>!$n(t);function Df(t){t&&(qa=e=>e.startsWith("on")?!$n(e):t(e))}try{Df(require("@emotion/is-prop-valid").default)}catch{}function Pf(t,e,n){const r={};for(const i in t)i==="values"&&typeof t.values=="object"||(qa(i)||n===!0&&$n(i)||!e&&!$n(i)||t.draggable&&i.startsWith("onDrag"))&&(r[i]=t[i]);return r}function Of(t){if(typeof Proxy>"u")return t;const e=new Map,n=(...r)=>t(...r);return new Proxy(n,{get:(r,i)=>i==="create"?t:(e.has(i)||e.set(i,t(i)),e.get(i))})}const Qn=p.createContext({});function Zt(t){return typeof t=="string"||Array.isArray(t)}function er(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}const Ii=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Ri=["initial",...Ii];function tr(t){return er(t.animate)||Ri.some(e=>Zt(t[e]))}function Za(t){return!!(tr(t)||t.variants)}function Mf(t,e){if(tr(t)){const{initial:n,animate:r}=t;return{initial:n===!1||Zt(n)?n:void 0,animate:Zt(r)?r:void 0}}return t.inherit!==!1?e:{}}function If(t){const{initial:e,animate:n}=Mf(t,p.useContext(Qn));return p.useMemo(()=>({initial:e,animate:n}),[Us(e),Us(n)])}function Us(t){return Array.isArray(t)?t.join(" "):t}const Rf=Symbol.for("motionComponentSymbol");function yt(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function Af(t,e,n){return p.useCallback(r=>{r&&t.onMount&&t.onMount(r),e&&(r?e.mount(r):e.unmount()),n&&(typeof n=="function"?n(r):yt(n)&&(n.current=r))},[e])}const Ai=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),Nf="framerAppearId",Ja="data-"+Ai(Nf),{schedule:Ni}=Ya(queueMicrotask,!1),Qa=p.createContext({});function _f(t,e,n,r,i){var s,o;const{visualElement:a}=p.useContext(Qn),c=p.useContext(Xa),l=p.useContext(Pi),u=p.useContext(Ga).reducedMotion,d=p.useRef(null);r=r||c.renderer,!d.current&&r&&(d.current=r(t,{visualState:e,parent:a,props:n,presenceContext:l,blockInitialAnimation:l?l.initial===!1:!1,reducedMotionConfig:u}));const f=d.current,h=p.useContext(Qa);f&&!f.projection&&i&&(f.type==="html"||f.type==="svg")&&Lf(d.current,n,i,h);const m=p.useRef(!1);p.useInsertionEffect(()=>{f&&m.current&&f.update(n,l)});const g=n[Ja],y=p.useRef(!!g&&!(!((s=window.MotionHandoffIsComplete)===null||s===void 0)&&s.call(window,g))&&((o=window.MotionHasOptimisedAnimation)===null||o===void 0?void 0:o.call(window,g)));return bf(()=>{f&&(m.current=!0,window.MotionIsMounted=!0,f.updateFeatures(),Ni.render(f.render),y.current&&f.animationState&&f.animationState.animateChanges())}),p.useEffect(()=>{f&&(!y.current&&f.animationState&&f.animationState.animateChanges(),y.current&&(queueMicrotask(()=>{var x;(x=window.MotionHandoffMarkAsComplete)===null||x===void 0||x.call(window,g)}),y.current=!1))}),f}function Lf(t,e,n,r){const{layoutId:i,layout:s,drag:o,dragConstraints:a,layoutScroll:c,layoutRoot:l}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:ec(t.parent)),t.projection.setOptions({layoutId:i,layout:s,alwaysMeasureLayout:!!o||a&&yt(a),visualElement:t,animationType:typeof s=="string"?s:"both",initialPromotionConfig:r,layoutScroll:c,layoutRoot:l})}function ec(t){if(t)return t.options.allowProjection!==!1?t.projection:ec(t.parent)}function kf({preloadedFeatures:t,createVisualElement:e,useRender:n,useVisualState:r,Component:i}){var s,o;t&&Cf(t);function a(l,u){let d;const f={...p.useContext(Ga),...l,layoutId:jf(l)},{isStatic:h}=f,m=If(l),g=r(l,h);if(!h&&Oi){Vf();const y=Ff(f);d=y.MeasureLayout,m.visualElement=_f(i,g,f,e,y.ProjectionNode)}return v.jsxs(Qn.Provider,{value:m,children:[d&&m.visualElement?v.jsx(d,{visualElement:m.visualElement,...f}):null,n(i,l,Af(g,m.visualElement,u),g,h,m.visualElement)]})}a.displayName=`motion.${typeof i=="string"?i:`create(${(o=(s=i.displayName)!==null&&s!==void 0?s:i.name)!==null&&o!==void 0?o:""})`}`;const c=p.forwardRef(a);return c[Rf]=i,c}function jf({layoutId:t}){const e=p.useContext(Wa).id;return e&&t!==void 0?e+"-"+t:t}function Vf(t,e){p.useContext(Xa).strict}function Ff(t){const{drag:e,layout:n}=Pt;if(!e&&!n)return{};const r={...e,...n};return{MeasureLayout:e!=null&&e.isEnabled(t)||n!=null&&n.isEnabled(t)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}const Bf=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function _i(t){return typeof t!="string"||t.includes("-")?!1:!!(Bf.indexOf(t)>-1||/[A-Z]/u.test(t))}function Hs(t){const e=[{},{}];return t==null||t.values.forEach((n,r)=>{e[0][r]=n.get(),e[1][r]=n.getVelocity()}),e}function Li(t,e,n,r){if(typeof e=="function"){const[i,s]=Hs(r);e=e(n!==void 0?n:t.custom,i,s)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[i,s]=Hs(r);e=e(n!==void 0?n:t.custom,i,s)}return e}const Wr=t=>Array.isArray(t),$f=t=>!!(t&&typeof t=="object"&&t.mix&&t.toValue),Uf=t=>Wr(t)?t[t.length-1]||0:t,ae=t=>!!(t&&t.getVelocity);function Nn(t){const e=ae(t)?t.get():t;return $f(e)?e.toValue():e}function Hf({scrapeMotionValuesFromProps:t,createRenderState:e,onUpdate:n},r,i,s){const o={latestValues:zf(r,i,s,t),renderState:e()};return n&&(o.onMount=a=>n({props:r,current:a,...o}),o.onUpdate=a=>n(a)),o}const tc=t=>(e,n)=>{const r=p.useContext(Qn),i=p.useContext(Pi),s=()=>Hf(t,e,r,i);return n?s():yf(s)};function zf(t,e,n,r){const i={},s=r(t,{});for(const f in s)i[f]=Nn(s[f]);let{initial:o,animate:a}=t;const c=tr(t),l=Za(t);e&&l&&!c&&t.inherit!==!1&&(o===void 0&&(o=e.initial),a===void 0&&(a=e.animate));let u=n?n.initial===!1:!1;u=u||o===!1;const d=u?a:o;if(d&&typeof d!="boolean"&&!er(d)){const f=Array.isArray(d)?d:[d];for(let h=0;h<f.length;h++){const m=Li(t,f[h]);if(m){const{transitionEnd:g,transition:y,...x}=m;for(const b in x){let T=x[b];if(Array.isArray(T)){const S=u?T.length-1:0;T=T[S]}T!==null&&(i[b]=T)}for(const b in g)i[b]=g[b]}}}return i}const Mt=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],dt=new Set(Mt),nc=t=>e=>typeof e=="string"&&e.startsWith(t),rc=nc("--"),Wf=nc("var(--"),ki=t=>Wf(t)?Gf.test(t.split("/*")[0].trim()):!1,Gf=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,ic=(t,e)=>e&&typeof t=="number"?e.transform(t):t,je=(t,e,n)=>n>e?e:n<t?t:n,It={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},Jt={...It,transform:t=>je(0,1,t)},En={...It,default:1},on=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),$e=on("deg"),Re=on("%"),A=on("px"),Kf=on("vh"),Yf=on("vw"),zs={...Re,parse:t=>Re.parse(t)/100,transform:t=>Re.transform(t*100)},Xf={borderWidth:A,borderTopWidth:A,borderRightWidth:A,borderBottomWidth:A,borderLeftWidth:A,borderRadius:A,radius:A,borderTopLeftRadius:A,borderTopRightRadius:A,borderBottomRightRadius:A,borderBottomLeftRadius:A,width:A,maxWidth:A,height:A,maxHeight:A,top:A,right:A,bottom:A,left:A,padding:A,paddingTop:A,paddingRight:A,paddingBottom:A,paddingLeft:A,margin:A,marginTop:A,marginRight:A,marginBottom:A,marginLeft:A,backgroundPositionX:A,backgroundPositionY:A},qf={rotate:$e,rotateX:$e,rotateY:$e,rotateZ:$e,scale:En,scaleX:En,scaleY:En,scaleZ:En,skew:$e,skewX:$e,skewY:$e,distance:A,translateX:A,translateY:A,translateZ:A,x:A,y:A,z:A,perspective:A,transformPerspective:A,opacity:Jt,originX:zs,originY:zs,originZ:A},Ws={...It,transform:Math.round},ji={...Xf,...qf,zIndex:Ws,size:A,fillOpacity:Jt,strokeOpacity:Jt,numOctaves:Ws},Zf={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Jf=Mt.length;function Qf(t,e,n){let r="",i=!0;for(let s=0;s<Jf;s++){const o=Mt[s],a=t[o];if(a===void 0)continue;let c=!0;if(typeof a=="number"?c=a===(o.startsWith("scale")?1:0):c=parseFloat(a)===0,!c||n){const l=ic(a,ji[o]);if(!c){i=!1;const u=Zf[o]||o;r+=`${u}(${l}) `}n&&(e[o]=l)}}return r=r.trim(),n?r=n(e,i?"":r):i&&(r="none"),r}function Vi(t,e,n){const{style:r,vars:i,transformOrigin:s}=t;let o=!1,a=!1;for(const c in e){const l=e[c];if(dt.has(c)){o=!0;continue}else if(rc(c)){i[c]=l;continue}else{const u=ic(l,ji[c]);c.startsWith("origin")?(a=!0,s[c]=u):r[c]=u}}if(e.transform||(o||n?r.transform=Qf(e,t.transform,n):r.transform&&(r.transform="none")),a){const{originX:c="50%",originY:l="50%",originZ:u=0}=s;r.transformOrigin=`${c} ${l} ${u}`}}const eh={offset:"stroke-dashoffset",array:"stroke-dasharray"},th={offset:"strokeDashoffset",array:"strokeDasharray"};function nh(t,e,n=1,r=0,i=!0){t.pathLength=1;const s=i?eh:th;t[s.offset]=A.transform(-r);const o=A.transform(e),a=A.transform(n);t[s.array]=`${o} ${a}`}function Gs(t,e,n){return typeof t=="string"?t:A.transform(e+n*t)}function rh(t,e,n){const r=Gs(e,t.x,t.width),i=Gs(n,t.y,t.height);return`${r} ${i}`}function Fi(t,{attrX:e,attrY:n,attrScale:r,originX:i,originY:s,pathLength:o,pathSpacing:a=1,pathOffset:c=0,...l},u,d){if(Vi(t,l,d),u){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:f,style:h,dimensions:m}=t;f.transform&&(m&&(h.transform=f.transform),delete f.transform),m&&(i!==void 0||s!==void 0||h.transform)&&(h.transformOrigin=rh(m,i!==void 0?i:.5,s!==void 0?s:.5)),e!==void 0&&(f.x=e),n!==void 0&&(f.y=n),r!==void 0&&(f.scale=r),o!==void 0&&nh(f,o,a,c,!1)}const Bi=()=>({style:{},transform:{},transformOrigin:{},vars:{}}),sc=()=>({...Bi(),attrs:{}}),$i=t=>typeof t=="string"&&t.toLowerCase()==="svg";function oc(t,{style:e,vars:n},r,i){Object.assign(t.style,e,i&&i.getProjectionStyles(r));for(const s in n)t.style.setProperty(s,n[s])}const ac=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function cc(t,e,n,r){oc(t,e,void 0,r);for(const i in e.attrs)t.setAttribute(ac.has(i)?i:Ai(i),e.attrs[i])}const Un={};function ih(t){Object.assign(Un,t)}function lc(t,{layout:e,layoutId:n}){return dt.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!Un[t]||t==="opacity")}function Ui(t,e,n){var r;const{style:i}=t,s={};for(const o in i)(ae(i[o])||e.style&&ae(e.style[o])||lc(o,t)||((r=n==null?void 0:n.getValue(o))===null||r===void 0?void 0:r.liveStyle)!==void 0)&&(s[o]=i[o]);return s}function uc(t,e,n){const r=Ui(t,e,n);for(const i in t)if(ae(t[i])||ae(e[i])){const s=Mt.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;r[s]=t[i]}return r}function sh(t,e){try{e.dimensions=typeof t.getBBox=="function"?t.getBBox():t.getBoundingClientRect()}catch{e.dimensions={x:0,y:0,width:0,height:0}}}const Ks=["x","y","width","height","cx","cy","r"],oh={useVisualState:tc({scrapeMotionValuesFromProps:uc,createRenderState:sc,onUpdate:({props:t,prevProps:e,current:n,renderState:r,latestValues:i})=>{if(!n)return;let s=!!t.drag;if(!s){for(const a in i)if(dt.has(a)){s=!0;break}}if(!s)return;let o=!e;if(e)for(let a=0;a<Ks.length;a++){const c=Ks[a];t[c]!==e[c]&&(o=!0)}o&&G.read(()=>{sh(n,r),G.render(()=>{Fi(r,i,$i(n.tagName),t.transformTemplate),cc(n,r)})})}})},ah={useVisualState:tc({scrapeMotionValuesFromProps:Ui,createRenderState:Bi})};function dc(t,e,n){for(const r in e)!ae(e[r])&&!lc(r,n)&&(t[r]=e[r])}function ch({transformTemplate:t},e){return p.useMemo(()=>{const n=Bi();return Vi(n,e,t),Object.assign({},n.vars,n.style)},[e])}function lh(t,e){const n=t.style||{},r={};return dc(r,n,t),Object.assign(r,ch(t,e)),r}function uh(t,e){const n={},r=lh(t,e);return t.drag&&t.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=r,n}function dh(t,e,n,r){const i=p.useMemo(()=>{const s=sc();return Fi(s,e,$i(r),t.transformTemplate),{...s.attrs,style:{...s.style}}},[e]);if(t.style){const s={};dc(s,t.style,t),i.style={...s,...i.style}}return i}function fh(t=!1){return(n,r,i,{latestValues:s},o)=>{const c=(_i(n)?dh:uh)(r,s,o,n),l=Pf(r,typeof n=="string",t),u=n!==p.Fragment?{...l,...c,ref:i}:{},{children:d}=r,f=p.useMemo(()=>ae(d)?d.get():d,[d]);return p.createElement(n,{...u,children:f})}}function hh(t,e){return function(r,{forwardMotionProps:i}={forwardMotionProps:!1}){const o={..._i(r)?oh:ah,preloadedFeatures:t,useRender:fh(i),createVisualElement:e,Component:r};return kf(o)}}function fc(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let r=0;r<n;r++)if(e[r]!==t[r])return!1;return!0}function nr(t,e,n){const r=t.getProps();return Li(r,e,n!==void 0?n:r.custom,t)}const ph=Mi(()=>window.ScrollTimeline!==void 0);class gh{constructor(e){this.stop=()=>this.runAll("stop"),this.animations=e.filter(Boolean)}get finished(){return Promise.all(this.animations.map(e=>"finished"in e?e.finished:e))}getAll(e){return this.animations[0][e]}setAll(e,n){for(let r=0;r<this.animations.length;r++)this.animations[r][e]=n}attachTimeline(e,n){const r=this.animations.map(i=>{if(ph()&&i.attachTimeline)return i.attachTimeline(e);if(typeof n=="function")return n(i)});return()=>{r.forEach((i,s)=>{i&&i(),this.animations[s].stop()})}}get time(){return this.getAll("time")}set time(e){this.setAll("time",e)}get speed(){return this.getAll("speed")}set speed(e){this.setAll("speed",e)}get startTime(){return this.getAll("startTime")}get duration(){let e=0;for(let n=0;n<this.animations.length;n++)e=Math.max(e,this.animations[n].duration);return e}runAll(e){this.animations.forEach(n=>n[e]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class mh extends gh{then(e,n){return Promise.all(this.animations).then(e).catch(n)}}function Hi(t,e){return t?t[e]||t.default||t:void 0}const Gr=2e4;function hc(t){let e=0;const n=50;let r=t.next(e);for(;!r.done&&e<Gr;)e+=n,r=t.next(e);return e>=Gr?1/0:e}function zi(t){return typeof t=="function"}function Ys(t,e){t.timeline=e,t.onfinish=null}const Wi=t=>Array.isArray(t)&&typeof t[0]=="number",vh={linearEasing:void 0};function yh(t,e){const n=Mi(t);return()=>{var r;return(r=vh[e])!==null&&r!==void 0?r:n()}}const Hn=yh(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),pc=(t,e,n=10)=>{let r="";const i=Math.max(Math.round(e/n),2);for(let s=0;s<i;s++)r+=t(Dt(0,i-1,s))+", ";return`linear(${r.substring(0,r.length-2)})`};function gc(t){return!!(typeof t=="function"&&Hn()||!t||typeof t=="string"&&(t in Kr||Hn())||Wi(t)||Array.isArray(t)&&t.every(gc))}const jt=([t,e,n,r])=>`cubic-bezier(${t}, ${e}, ${n}, ${r})`,Kr={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:jt([0,.65,.55,1]),circOut:jt([.55,0,1,.45]),backIn:jt([.31,.01,.66,-.59]),backOut:jt([.33,1.53,.69,.99])};function mc(t,e){if(t)return typeof t=="function"&&Hn()?pc(t,e):Wi(t)?jt(t):Array.isArray(t)?t.map(n=>mc(n,e)||Kr.easeOut):Kr[t]}const Pe={x:!1,y:!1};function vc(){return Pe.x||Pe.y}function xh(t,e,n){var r;if(t instanceof Element)return[t];if(typeof t=="string"){let i=document;const s=(r=void 0)!==null&&r!==void 0?r:i.querySelectorAll(t);return s?Array.from(s):[]}return Array.from(t)}function yc(t,e){const n=xh(t),r=new AbortController,i={passive:!0,...e,signal:r.signal};return[n,i,()=>r.abort()]}function Xs(t){return e=>{e.pointerType==="touch"||vc()||t(e)}}function bh(t,e,n={}){const[r,i,s]=yc(t,n),o=Xs(a=>{const{target:c}=a,l=e(a);if(typeof l!="function"||!c)return;const u=Xs(d=>{l(d),c.removeEventListener("pointerleave",u)});c.addEventListener("pointerleave",u,i)});return r.forEach(a=>{a.addEventListener("pointerenter",o,i)}),s}const xc=(t,e)=>e?t===e?!0:xc(t,e.parentElement):!1,Gi=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,Th=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Sh(t){return Th.has(t.tagName)||t.tabIndex!==-1}const Vt=new WeakSet;function qs(t){return e=>{e.key==="Enter"&&t(e)}}function Sr(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const wh=(t,e)=>{const n=t.currentTarget;if(!n)return;const r=qs(()=>{if(Vt.has(n))return;Sr(n,"down");const i=qs(()=>{Sr(n,"up")}),s=()=>Sr(n,"cancel");n.addEventListener("keyup",i,e),n.addEventListener("blur",s,e)});n.addEventListener("keydown",r,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),e)};function Zs(t){return Gi(t)&&!vc()}function Ch(t,e,n={}){const[r,i,s]=yc(t,n),o=a=>{const c=a.currentTarget;if(!Zs(a)||Vt.has(c))return;Vt.add(c);const l=e(a),u=(h,m)=>{window.removeEventListener("pointerup",d),window.removeEventListener("pointercancel",f),!(!Zs(h)||!Vt.has(c))&&(Vt.delete(c),typeof l=="function"&&l(h,{success:m}))},d=h=>{u(h,n.useGlobalTarget||xc(c,h.target))},f=h=>{u(h,!1)};window.addEventListener("pointerup",d,i),window.addEventListener("pointercancel",f,i)};return r.forEach(a=>{!Sh(a)&&a.getAttribute("tabindex")===null&&(a.tabIndex=0),(n.useGlobalTarget?window:a).addEventListener("pointerdown",o,i),a.addEventListener("focus",l=>wh(l,i),i)}),s}function Eh(t){return t==="x"||t==="y"?Pe[t]?null:(Pe[t]=!0,()=>{Pe[t]=!1}):Pe.x||Pe.y?null:(Pe.x=Pe.y=!0,()=>{Pe.x=Pe.y=!1})}const bc=new Set(["width","height","top","left","right","bottom",...Mt]);let _n;function Dh(){_n=void 0}const Ae={now:()=>(_n===void 0&&Ae.set(se.isProcessing||Tf.useManualTiming?se.timestamp:performance.now()),_n),set:t=>{_n=t,queueMicrotask(Dh)}};function Ki(t,e){t.indexOf(e)===-1&&t.push(e)}function Yi(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}class Xi{constructor(){this.subscriptions=[]}add(e){return Ki(this.subscriptions,e),()=>Yi(this.subscriptions,e)}notify(e,n,r){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](e,n,r);else for(let s=0;s<i;s++){const o=this.subscriptions[s];o&&o(e,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function Tc(t,e){return e?t*(1e3/e):0}const Js=30,Ph=t=>!isNaN(parseFloat(t));class Oh{constructor(e,n={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,i=!0)=>{const s=Ae.now();this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),i&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(e),this.owner=n.owner}setCurrent(e){this.current=e,this.updatedAt=Ae.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=Ph(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,n){this.events[e]||(this.events[e]=new Xi);const r=this.events[e].add(n);return e==="change"?()=>{r(),G.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,n){this.passiveEffect=e,this.stopPassiveEffect=n}set(e,n=!0){!n||!this.passiveEffect?this.updateAndNotify(e,n):this.passiveEffect(e,this.updateAndNotify)}setWithVelocity(e,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-r}jump(e,n=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=Ae.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>Js)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,Js);return Tc(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(e){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=e(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Qt(t,e){return new Oh(t,e)}function Mh(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Qt(n))}function Ih(t,e){const n=nr(t,e);let{transitionEnd:r={},transition:i={},...s}=n||{};s={...s,...r};for(const o in s){const a=Uf(s[o]);Mh(t,o,a)}}function Rh(t){return!!(ae(t)&&t.add)}function Yr(t,e){const n=t.getValue("willChange");if(Rh(n))return n.add(e)}function Sc(t){return t.props[Ja]}const wc=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,Ah=1e-7,Nh=12;function _h(t,e,n,r,i){let s,o,a=0;do o=e+(n-e)/2,s=wc(o,r,i)-t,s>0?n=o:e=o;while(Math.abs(s)>Ah&&++a<Nh);return o}function an(t,e,n,r){if(t===e&&n===r)return me;const i=s=>_h(s,0,1,t,n);return s=>s===0||s===1?s:wc(i(s),e,r)}const Cc=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,Ec=t=>e=>1-t(1-e),Dc=an(.33,1.53,.69,.99),qi=Ec(Dc),Pc=Cc(qi),Oc=t=>(t*=2)<1?.5*qi(t):.5*(2-Math.pow(2,-10*(t-1))),Zi=t=>1-Math.sin(Math.acos(t)),Mc=Ec(Zi),Ic=Cc(Zi),Rc=t=>/^0[^.\s]+$/u.test(t);function Lh(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||Rc(t):!0}const zt=t=>Math.round(t*1e5)/1e5,Ji=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function kh(t){return t==null}const jh=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Qi=(t,e)=>n=>!!(typeof n=="string"&&jh.test(n)&&n.startsWith(t)||e&&!kh(n)&&Object.prototype.hasOwnProperty.call(n,e)),Ac=(t,e,n)=>r=>{if(typeof r!="string")return r;const[i,s,o,a]=r.match(Ji);return{[t]:parseFloat(i),[e]:parseFloat(s),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},Vh=t=>je(0,255,t),wr={...It,transform:t=>Math.round(Vh(t))},ot={test:Qi("rgb","red"),parse:Ac("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:r=1})=>"rgba("+wr.transform(t)+", "+wr.transform(e)+", "+wr.transform(n)+", "+zt(Jt.transform(r))+")"};function Fh(t){let e="",n="",r="",i="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),r=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),r=t.substring(3,4),i=t.substring(4,5),e+=e,n+=n,r+=r,i+=i),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}const Xr={test:Qi("#"),parse:Fh,transform:ot.transform},xt={test:Qi("hsl","hue"),parse:Ac("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:r=1})=>"hsla("+Math.round(t)+", "+Re.transform(zt(e))+", "+Re.transform(zt(n))+", "+zt(Jt.transform(r))+")"},oe={test:t=>ot.test(t)||Xr.test(t)||xt.test(t),parse:t=>ot.test(t)?ot.parse(t):xt.test(t)?xt.parse(t):Xr.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?ot.transform(t):xt.transform(t)},Bh=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function $h(t){var e,n;return isNaN(t)&&typeof t=="string"&&(((e=t.match(Ji))===null||e===void 0?void 0:e.length)||0)+(((n=t.match(Bh))===null||n===void 0?void 0:n.length)||0)>0}const Nc="number",_c="color",Uh="var",Hh="var(",Qs="${}",zh=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function en(t){const e=t.toString(),n=[],r={color:[],number:[],var:[]},i=[];let s=0;const a=e.replace(zh,c=>(oe.test(c)?(r.color.push(s),i.push(_c),n.push(oe.parse(c))):c.startsWith(Hh)?(r.var.push(s),i.push(Uh),n.push(c)):(r.number.push(s),i.push(Nc),n.push(parseFloat(c))),++s,Qs)).split(Qs);return{values:n,split:a,indexes:r,types:i}}function Lc(t){return en(t).values}function kc(t){const{split:e,types:n}=en(t),r=e.length;return i=>{let s="";for(let o=0;o<r;o++)if(s+=e[o],i[o]!==void 0){const a=n[o];a===Nc?s+=zt(i[o]):a===_c?s+=oe.transform(i[o]):s+=i[o]}return s}}const Wh=t=>typeof t=="number"?0:t;function Gh(t){const e=Lc(t);return kc(t)(e.map(Wh))}const Ge={test:$h,parse:Lc,createTransformer:kc,getAnimatableNone:Gh},Kh=new Set(["brightness","contrast","saturate","opacity"]);function Yh(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[r]=n.match(Ji)||[];if(!r)return t;const i=n.replace(r,"");let s=Kh.has(e)?1:0;return r!==n&&(s*=100),e+"("+s+i+")"}const Xh=/\b([a-z-]*)\(.*?\)/gu,qr={...Ge,getAnimatableNone:t=>{const e=t.match(Xh);return e?e.map(Yh).join(" "):t}},qh={...ji,color:oe,backgroundColor:oe,outlineColor:oe,fill:oe,stroke:oe,borderColor:oe,borderTopColor:oe,borderRightColor:oe,borderBottomColor:oe,borderLeftColor:oe,filter:qr,WebkitFilter:qr},es=t=>qh[t];function jc(t,e){let n=es(t);return n!==qr&&(n=Ge),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const Zh=new Set(["auto","none","0"]);function Jh(t,e,n){let r=0,i;for(;r<t.length&&!i;){const s=t[r];typeof s=="string"&&!Zh.has(s)&&en(s).values.length&&(i=t[r]),r++}if(i&&n)for(const s of e)t[s]=jc(n,i)}const eo=t=>t===It||t===A,to=(t,e)=>parseFloat(t.split(", ")[e]),no=(t,e)=>(n,{transform:r})=>{if(r==="none"||!r)return 0;const i=r.match(/^matrix3d\((.+)\)$/u);if(i)return to(i[1],e);{const s=r.match(/^matrix\((.+)\)$/u);return s?to(s[1],t):0}},Qh=new Set(["x","y","z"]),ep=Mt.filter(t=>!Qh.has(t));function tp(t){const e=[];return ep.forEach(n=>{const r=t.getValue(n);r!==void 0&&(e.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),e}const Ot={width:({x:t},{paddingLeft:e="0",paddingRight:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),height:({y:t},{paddingTop:e="0",paddingBottom:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:no(4,13),y:no(5,14)};Ot.translateX=Ot.x;Ot.translateY=Ot.y;const lt=new Set;let Zr=!1,Jr=!1;function Vc(){if(Jr){const t=Array.from(lt).filter(r=>r.needsMeasurement),e=new Set(t.map(r=>r.element)),n=new Map;e.forEach(r=>{const i=tp(r);i.length&&(n.set(r,i),r.render())}),t.forEach(r=>r.measureInitialState()),e.forEach(r=>{r.render();const i=n.get(r);i&&i.forEach(([s,o])=>{var a;(a=r.getValue(s))===null||a===void 0||a.set(o)})}),t.forEach(r=>r.measureEndState()),t.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}Jr=!1,Zr=!1,lt.forEach(t=>t.complete()),lt.clear()}function Fc(){lt.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Jr=!0)})}function np(){Fc(),Vc()}class ts{constructor(e,n,r,i,s,o=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...e],this.onComplete=n,this.name=r,this.motionValue=i,this.element=s,this.isAsync=o}scheduleResolve(){this.isScheduled=!0,this.isAsync?(lt.add(this),Zr||(Zr=!0,G.read(Fc),G.resolveKeyframes(Vc))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:n,element:r,motionValue:i}=this;for(let s=0;s<e.length;s++)if(e[s]===null)if(s===0){const o=i==null?void 0:i.get(),a=e[e.length-1];if(o!==void 0)e[0]=o;else if(r&&n){const c=r.readValue(n,a);c!=null&&(e[0]=c)}e[0]===void 0&&(e[0]=a),i&&o===void 0&&i.set(e[0])}else e[s]=e[s-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),lt.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,lt.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const Bc=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),rp=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function ip(t){const e=rp.exec(t);if(!e)return[,];const[,n,r,i]=e;return[`--${n??r}`,i]}function $c(t,e,n=1){const[r,i]=ip(t);if(!r)return;const s=window.getComputedStyle(e).getPropertyValue(r);if(s){const o=s.trim();return Bc(o)?parseFloat(o):o}return ki(i)?$c(i,e,n+1):i}const Uc=t=>e=>e.test(t),sp={test:t=>t==="auto",parse:t=>t},Hc=[It,A,Re,$e,Yf,Kf,sp],ro=t=>Hc.find(Uc(t));class zc extends ts{constructor(e,n,r,i,s){super(e,n,r,i,s,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let c=0;c<e.length;c++){let l=e[c];if(typeof l=="string"&&(l=l.trim(),ki(l))){const u=$c(l,n.current);u!==void 0&&(e[c]=u),c===e.length-1&&(this.finalKeyframe=l)}}if(this.resolveNoneKeyframes(),!bc.has(r)||e.length!==2)return;const[i,s]=e,o=ro(i),a=ro(s);if(o!==a)if(eo(o)&&eo(a))for(let c=0;c<e.length;c++){const l=e[c];typeof l=="string"&&(e[c]=parseFloat(l))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,r=[];for(let i=0;i<e.length;i++)Lh(e[i])&&r.push(i);r.length&&Jh(e,r,n)}measureInitialState(){const{element:e,unresolvedKeyframes:n,name:r}=this;if(!e||!e.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Ot[r](e.measureViewportBox(),window.getComputedStyle(e.current)),n[0]=this.measuredOrigin;const i=n[n.length-1];i!==void 0&&e.getValue(r,i).jump(i,!1)}measureEndState(){var e;const{element:n,name:r,unresolvedKeyframes:i}=this;if(!n||!n.current)return;const s=n.getValue(r);s&&s.jump(this.measuredOrigin,!1);const o=i.length-1,a=i[o];i[o]=Ot[r](n.measureViewportBox(),window.getComputedStyle(n.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),!((e=this.removedTransforms)===null||e===void 0)&&e.length&&this.removedTransforms.forEach(([c,l])=>{n.getValue(c).set(l)}),this.resolveNoneKeyframes()}}const io=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(Ge.test(t)||t==="0")&&!t.startsWith("url("));function op(t){const e=t[0];if(t.length===1)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}function ap(t,e,n,r){const i=t[0];if(i===null)return!1;if(e==="display"||e==="visibility")return!0;const s=t[t.length-1],o=io(i,e),a=io(s,e);return!o||!a?!1:op(t)||(n==="spring"||zi(n))&&r}const cp=t=>t!==null;function rr(t,{repeat:e,repeatType:n="loop"},r){const i=t.filter(cp),s=e&&n!=="loop"&&e%2===1?0:i.length-1;return!s||r===void 0?i[s]:r}const lp=40;class Wc{constructor({autoplay:e=!0,delay:n=0,type:r="keyframes",repeat:i=0,repeatDelay:s=0,repeatType:o="loop",...a}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=Ae.now(),this.options={autoplay:e,delay:n,type:r,repeat:i,repeatDelay:s,repeatType:o,...a},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>lp?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&np(),this._resolved}onKeyframesResolved(e,n){this.resolvedAt=Ae.now(),this.hasAttemptedResolve=!0;const{name:r,type:i,velocity:s,delay:o,onComplete:a,onUpdate:c,isGenerator:l}=this.options;if(!l&&!ap(e,r,i,s))if(o)this.options.duration=0;else{c&&c(rr(e,this.options,n)),a&&a(),this.resolveFinishedPromise();return}const u=this.initPlayback(e,n);u!==!1&&(this._resolved={keyframes:e,finalKeyframe:n,...u},this.onPostResolved())}onPostResolved(){}then(e,n){return this.currentFinishedPromise.then(e,n)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(e=>{this.resolveFinishedPromise=e})}}const X=(t,e,n)=>t+(e-t)*n;function Cr(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function up({hue:t,saturation:e,lightness:n,alpha:r}){t/=360,e/=100,n/=100;let i=0,s=0,o=0;if(!e)i=s=o=n;else{const a=n<.5?n*(1+e):n+e-n*e,c=2*n-a;i=Cr(c,a,t+1/3),s=Cr(c,a,t),o=Cr(c,a,t-1/3)}return{red:Math.round(i*255),green:Math.round(s*255),blue:Math.round(o*255),alpha:r}}function zn(t,e){return n=>n>0?e:t}const Er=(t,e,n)=>{const r=t*t,i=n*(e*e-r)+r;return i<0?0:Math.sqrt(i)},dp=[Xr,ot,xt],fp=t=>dp.find(e=>e.test(t));function so(t){const e=fp(t);if(!e)return!1;let n=e.parse(t);return e===xt&&(n=up(n)),n}const oo=(t,e)=>{const n=so(t),r=so(e);if(!n||!r)return zn(t,e);const i={...n};return s=>(i.red=Er(n.red,r.red,s),i.green=Er(n.green,r.green,s),i.blue=Er(n.blue,r.blue,s),i.alpha=X(n.alpha,r.alpha,s),ot.transform(i))},hp=(t,e)=>n=>e(t(n)),cn=(...t)=>t.reduce(hp),Qr=new Set(["none","hidden"]);function pp(t,e){return Qr.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function gp(t,e){return n=>X(t,e,n)}function ns(t){return typeof t=="number"?gp:typeof t=="string"?ki(t)?zn:oe.test(t)?oo:yp:Array.isArray(t)?Gc:typeof t=="object"?oe.test(t)?oo:mp:zn}function Gc(t,e){const n=[...t],r=n.length,i=t.map((s,o)=>ns(s)(s,e[o]));return s=>{for(let o=0;o<r;o++)n[o]=i[o](s);return n}}function mp(t,e){const n={...t,...e},r={};for(const i in n)t[i]!==void 0&&e[i]!==void 0&&(r[i]=ns(t[i])(t[i],e[i]));return i=>{for(const s in r)n[s]=r[s](i);return n}}function vp(t,e){var n;const r=[],i={color:0,var:0,number:0};for(let s=0;s<e.values.length;s++){const o=e.types[s],a=t.indexes[o][i[o]],c=(n=t.values[a])!==null&&n!==void 0?n:0;r[s]=c,i[o]++}return r}const yp=(t,e)=>{const n=Ge.createTransformer(e),r=en(t),i=en(e);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?Qr.has(t)&&!i.values.length||Qr.has(e)&&!r.values.length?pp(t,e):cn(Gc(vp(r,i),i.values),n):zn(t,e)};function Kc(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?X(t,e,n):ns(t)(t,e)}const xp=5;function Yc(t,e,n){const r=Math.max(e-xp,0);return Tc(n-t(r),e-r)}const q={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},ao=.001;function bp({duration:t=q.duration,bounce:e=q.bounce,velocity:n=q.velocity,mass:r=q.mass}){let i,s,o=1-e;o=je(q.minDamping,q.maxDamping,o),t=je(q.minDuration,q.maxDuration,Le(t)),o<1?(i=l=>{const u=l*o,d=u*t,f=u-n,h=ei(l,o),m=Math.exp(-d);return ao-f/h*m},s=l=>{const d=l*o*t,f=d*n+n,h=Math.pow(o,2)*Math.pow(l,2)*t,m=Math.exp(-d),g=ei(Math.pow(l,2),o);return(-i(l)+ao>0?-1:1)*((f-h)*m)/g}):(i=l=>{const u=Math.exp(-l*t),d=(l-n)*t+1;return-.001+u*d},s=l=>{const u=Math.exp(-l*t),d=(n-l)*(t*t);return u*d});const a=5/t,c=Sp(i,s,a);if(t=_e(t),isNaN(c))return{stiffness:q.stiffness,damping:q.damping,duration:t};{const l=Math.pow(c,2)*r;return{stiffness:l,damping:o*2*Math.sqrt(r*l),duration:t}}}const Tp=12;function Sp(t,e,n){let r=n;for(let i=1;i<Tp;i++)r=r-t(r)/e(r);return r}function ei(t,e){return t*Math.sqrt(1-e*e)}const wp=["duration","bounce"],Cp=["stiffness","damping","mass"];function co(t,e){return e.some(n=>t[n]!==void 0)}function Ep(t){let e={velocity:q.velocity,stiffness:q.stiffness,damping:q.damping,mass:q.mass,isResolvedFromDuration:!1,...t};if(!co(t,Cp)&&co(t,wp))if(t.visualDuration){const n=t.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,s=2*je(.05,1,1-(t.bounce||0))*Math.sqrt(i);e={...e,mass:q.mass,stiffness:i,damping:s}}else{const n=bp(t);e={...e,...n,mass:q.mass},e.isResolvedFromDuration=!0}return e}function Xc(t=q.visualDuration,e=q.bounce){const n=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:r,restDelta:i}=n;const s=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],a={done:!1,value:s},{stiffness:c,damping:l,mass:u,duration:d,velocity:f,isResolvedFromDuration:h}=Ep({...n,velocity:-Le(n.velocity||0)}),m=f||0,g=l/(2*Math.sqrt(c*u)),y=o-s,x=Le(Math.sqrt(c/u)),b=Math.abs(y)<5;r||(r=b?q.restSpeed.granular:q.restSpeed.default),i||(i=b?q.restDelta.granular:q.restDelta.default);let T;if(g<1){const C=ei(x,g);T=P=>{const D=Math.exp(-g*x*P);return o-D*((m+g*x*y)/C*Math.sin(C*P)+y*Math.cos(C*P))}}else if(g===1)T=C=>o-Math.exp(-x*C)*(y+(m+x*y)*C);else{const C=x*Math.sqrt(g*g-1);T=P=>{const D=Math.exp(-g*x*P),E=Math.min(C*P,300);return o-D*((m+g*x*y)*Math.sinh(E)+C*y*Math.cosh(E))/C}}const S={calculatedDuration:h&&d||null,next:C=>{const P=T(C);if(h)a.done=C>=d;else{let D=0;g<1&&(D=C===0?_e(m):Yc(T,C,P));const E=Math.abs(D)<=r,_=Math.abs(o-P)<=i;a.done=E&&_}return a.value=a.done?o:P,a},toString:()=>{const C=Math.min(hc(S),Gr),P=pc(D=>S.next(C*D).value,C,30);return C+"ms "+P}};return S}function lo({keyframes:t,velocity:e=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:s=500,modifyTarget:o,min:a,max:c,restDelta:l=.5,restSpeed:u}){const d=t[0],f={done:!1,value:d},h=E=>a!==void 0&&E<a||c!==void 0&&E>c,m=E=>a===void 0?c:c===void 0||Math.abs(a-E)<Math.abs(c-E)?a:c;let g=n*e;const y=d+g,x=o===void 0?y:o(y);x!==y&&(g=x-d);const b=E=>-g*Math.exp(-E/r),T=E=>x+b(E),S=E=>{const _=b(E),N=T(E);f.done=Math.abs(_)<=l,f.value=f.done?x:N};let C,P;const D=E=>{h(f.value)&&(C=E,P=Xc({keyframes:[f.value,m(f.value)],velocity:Yc(T,E,f.value),damping:i,stiffness:s,restDelta:l,restSpeed:u}))};return D(0),{calculatedDuration:null,next:E=>{let _=!1;return!P&&C===void 0&&(_=!0,S(E),D(E)),C!==void 0&&E>=C?P.next(E-C):(!_&&S(E),f)}}}const Dp=an(.42,0,1,1),Pp=an(0,0,.58,1),qc=an(.42,0,.58,1),Op=t=>Array.isArray(t)&&typeof t[0]!="number",Mp={linear:me,easeIn:Dp,easeInOut:qc,easeOut:Pp,circIn:Zi,circInOut:Ic,circOut:Mc,backIn:qi,backInOut:Pc,backOut:Dc,anticipate:Oc},uo=t=>{if(Wi(t)){Ka(t.length===4);const[e,n,r,i]=t;return an(e,n,r,i)}else if(typeof t=="string")return Mp[t];return t};function Ip(t,e,n){const r=[],i=n||Kc,s=t.length-1;for(let o=0;o<s;o++){let a=i(t[o],t[o+1]);if(e){const c=Array.isArray(e)?e[o]||me:e;a=cn(c,a)}r.push(a)}return r}function Rp(t,e,{clamp:n=!0,ease:r,mixer:i}={}){const s=t.length;if(Ka(s===e.length),s===1)return()=>e[0];if(s===2&&e[0]===e[1])return()=>e[1];const o=t[0]===t[1];t[0]>t[s-1]&&(t=[...t].reverse(),e=[...e].reverse());const a=Ip(e,r,i),c=a.length,l=u=>{if(o&&u<t[0])return e[0];let d=0;if(c>1)for(;d<t.length-2&&!(u<t[d+1]);d++);const f=Dt(t[d],t[d+1],u);return a[d](f)};return n?u=>l(je(t[0],t[s-1],u)):l}function Ap(t,e){const n=t[t.length-1];for(let r=1;r<=e;r++){const i=Dt(0,e,r);t.push(X(n,1,i))}}function Np(t){const e=[0];return Ap(e,t.length-1),e}function _p(t,e){return t.map(n=>n*e)}function Lp(t,e){return t.map(()=>e||qc).splice(0,t.length-1)}function Wn({duration:t=300,keyframes:e,times:n,ease:r="easeInOut"}){const i=Op(r)?r.map(uo):uo(r),s={done:!1,value:e[0]},o=_p(n&&n.length===e.length?n:Np(e),t),a=Rp(o,e,{ease:Array.isArray(i)?i:Lp(e,i)});return{calculatedDuration:t,next:c=>(s.value=a(c),s.done=c>=t,s)}}const kp=t=>{const e=({timestamp:n})=>t(n);return{start:()=>G.update(e,!0),stop:()=>We(e),now:()=>se.isProcessing?se.timestamp:Ae.now()}},jp={decay:lo,inertia:lo,tween:Wn,keyframes:Wn,spring:Xc},Vp=t=>t/100;class rs extends Wc{constructor(e){super(e),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:c}=this.options;c&&c()};const{name:n,motionValue:r,element:i,keyframes:s}=this.options,o=(i==null?void 0:i.KeyframeResolver)||ts,a=(c,l)=>this.onKeyframesResolved(c,l);this.resolver=new o(s,a,n,r,i),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(e){const{type:n="keyframes",repeat:r=0,repeatDelay:i=0,repeatType:s,velocity:o=0}=this.options,a=zi(n)?n:jp[n]||Wn;let c,l;a!==Wn&&typeof e[0]!="number"&&(c=cn(Vp,Kc(e[0],e[1])),e=[0,100]);const u=a({...this.options,keyframes:e});s==="mirror"&&(l=a({...this.options,keyframes:[...e].reverse(),velocity:-o})),u.calculatedDuration===null&&(u.calculatedDuration=hc(u));const{calculatedDuration:d}=u,f=d+i,h=f*(r+1)-i;return{generator:u,mirroredGenerator:l,mapPercentToKeyframes:c,calculatedDuration:d,resolvedDuration:f,totalDuration:h}}onPostResolved(){const{autoplay:e=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!e?this.pause():this.state=this.pendingPlayState}tick(e,n=!1){const{resolved:r}=this;if(!r){const{keyframes:E}=this.options;return{done:!0,value:E[E.length-1]}}const{finalKeyframe:i,generator:s,mirroredGenerator:o,mapPercentToKeyframes:a,keyframes:c,calculatedDuration:l,totalDuration:u,resolvedDuration:d}=r;if(this.startTime===null)return s.next(0);const{delay:f,repeat:h,repeatType:m,repeatDelay:g,onUpdate:y}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-u/this.speed,this.startTime)),n?this.currentTime=e:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(e-this.startTime)*this.speed;const x=this.currentTime-f*(this.speed>=0?1:-1),b=this.speed>=0?x<0:x>u;this.currentTime=Math.max(x,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=u);let T=this.currentTime,S=s;if(h){const E=Math.min(this.currentTime,u)/d;let _=Math.floor(E),N=E%1;!N&&E>=1&&(N=1),N===1&&_--,_=Math.min(_,h+1),!!(_%2)&&(m==="reverse"?(N=1-N,g&&(N-=g/d)):m==="mirror"&&(S=o)),T=je(0,1,N)*d}const C=b?{done:!1,value:c[0]}:S.next(T);a&&(C.value=a(C.value));let{done:P}=C;!b&&l!==null&&(P=this.speed>=0?this.currentTime>=u:this.currentTime<=0);const D=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&P);return D&&i!==void 0&&(C.value=rr(c,this.options,i)),y&&y(C.value),D&&this.finish(),C}get duration(){const{resolved:e}=this;return e?Le(e.calculatedDuration):0}get time(){return Le(this.currentTime)}set time(e){e=_e(e),this.currentTime=e,this.holdTime!==null||this.speed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.speed)}get speed(){return this.playbackSpeed}set speed(e){const n=this.playbackSpeed!==e;this.playbackSpeed=e,n&&(this.time=Le(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:e=kp,onPlay:n,startTime:r}=this.options;this.driver||(this.driver=e(s=>this.tick(s))),n&&n();const i=this.driver.now();this.holdTime!==null?this.startTime=i-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=i):this.startTime=r??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var e;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(e=this.currentTime)!==null&&e!==void 0?e:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:e}=this.options;e&&e()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}}const Fp=new Set(["opacity","clipPath","filter","transform"]);function Bp(t,e,n,{delay:r=0,duration:i=300,repeat:s=0,repeatType:o="loop",ease:a="easeInOut",times:c}={}){const l={[e]:n};c&&(l.offset=c);const u=mc(a,i);return Array.isArray(u)&&(l.easing=u),t.animate(l,{delay:r,duration:i,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:s+1,direction:o==="reverse"?"alternate":"normal"})}const $p=Mi(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),Gn=10,Up=2e4;function Hp(t){return zi(t.type)||t.type==="spring"||!gc(t.ease)}function zp(t,e){const n=new rs({...e,keyframes:t,repeat:0,delay:0,isGenerator:!0});let r={done:!1,value:t[0]};const i=[];let s=0;for(;!r.done&&s<Up;)r=n.sample(s),i.push(r.value),s+=Gn;return{times:void 0,keyframes:i,duration:s-Gn,ease:"linear"}}const Zc={anticipate:Oc,backInOut:Pc,circInOut:Ic};function Wp(t){return t in Zc}class fo extends Wc{constructor(e){super(e);const{name:n,motionValue:r,element:i,keyframes:s}=this.options;this.resolver=new zc(s,(o,a)=>this.onKeyframesResolved(o,a),n,r,i),this.resolver.scheduleResolve()}initPlayback(e,n){let{duration:r=300,times:i,ease:s,type:o,motionValue:a,name:c,startTime:l}=this.options;if(!a.owner||!a.owner.current)return!1;if(typeof s=="string"&&Hn()&&Wp(s)&&(s=Zc[s]),Hp(this.options)){const{onComplete:d,onUpdate:f,motionValue:h,element:m,...g}=this.options,y=zp(e,g);e=y.keyframes,e.length===1&&(e[1]=e[0]),r=y.duration,i=y.times,s=y.ease,o="keyframes"}const u=Bp(a.owner.current,c,e,{...this.options,duration:r,times:i,ease:s});return u.startTime=l??this.calcStartTime(),this.pendingTimeline?(Ys(u,this.pendingTimeline),this.pendingTimeline=void 0):u.onfinish=()=>{const{onComplete:d}=this.options;a.set(rr(e,this.options,n)),d&&d(),this.cancel(),this.resolveFinishedPromise()},{animation:u,duration:r,times:i,type:o,ease:s,keyframes:e}}get duration(){const{resolved:e}=this;if(!e)return 0;const{duration:n}=e;return Le(n)}get time(){const{resolved:e}=this;if(!e)return 0;const{animation:n}=e;return Le(n.currentTime||0)}set time(e){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.currentTime=_e(e)}get speed(){const{resolved:e}=this;if(!e)return 1;const{animation:n}=e;return n.playbackRate}set speed(e){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.playbackRate=e}get state(){const{resolved:e}=this;if(!e)return"idle";const{animation:n}=e;return n.playState}get startTime(){const{resolved:e}=this;if(!e)return null;const{animation:n}=e;return n.startTime}attachTimeline(e){if(!this._resolved)this.pendingTimeline=e;else{const{resolved:n}=this;if(!n)return me;const{animation:r}=n;Ys(r,e)}return me}play(){if(this.isStopped)return;const{resolved:e}=this;if(!e)return;const{animation:n}=e;n.playState==="finished"&&this.updateFinishedPromise(),n.play()}pause(){const{resolved:e}=this;if(!e)return;const{animation:n}=e;n.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:e}=this;if(!e)return;const{animation:n,keyframes:r,duration:i,type:s,ease:o,times:a}=e;if(n.playState==="idle"||n.playState==="finished")return;if(this.time){const{motionValue:l,onUpdate:u,onComplete:d,element:f,...h}=this.options,m=new rs({...h,keyframes:r,duration:i,type:s,ease:o,times:a,isGenerator:!0}),g=_e(this.time);l.setWithVelocity(m.sample(g-Gn).value,m.sample(g).value,Gn)}const{onStop:c}=this.options;c&&c(),this.cancel()}complete(){const{resolved:e}=this;e&&e.animation.finish()}cancel(){const{resolved:e}=this;e&&e.animation.cancel()}static supports(e){const{motionValue:n,name:r,repeatDelay:i,repeatType:s,damping:o,type:a}=e;if(!n||!n.owner||!(n.owner.current instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:l}=n.owner.getProps();return $p()&&r&&Fp.has(r)&&!c&&!l&&!i&&s!=="mirror"&&o!==0&&a!=="inertia"}}const Gp={type:"spring",stiffness:500,damping:25,restSpeed:10},Kp=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),Yp={type:"keyframes",duration:.8},Xp={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},qp=(t,{keyframes:e})=>e.length>2?Yp:dt.has(t)?t.startsWith("scale")?Kp(e[1]):Gp:Xp;function Zp({when:t,delay:e,delayChildren:n,staggerChildren:r,staggerDirection:i,repeat:s,repeatType:o,repeatDelay:a,from:c,elapsed:l,...u}){return!!Object.keys(u).length}const is=(t,e,n,r={},i,s)=>o=>{const a=Hi(r,t)||{},c=a.delay||r.delay||0;let{elapsed:l=0}=r;l=l-_e(c);let u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-l,onUpdate:f=>{e.set(f),a.onUpdate&&a.onUpdate(f)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:s?void 0:i};Zp(a)||(u={...u,...qp(t,u)}),u.duration&&(u.duration=_e(u.duration)),u.repeatDelay&&(u.repeatDelay=_e(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(u.duration=0,u.delay===0&&(d=!0)),d&&!s&&e.get()!==void 0){const f=rr(u.keyframes,a);if(f!==void 0)return G.update(()=>{u.onUpdate(f),u.onComplete()}),new mh([])}return!s&&fo.supports(u)?new fo(u):new rs(u)};function Jp({protectedKeys:t,needsAnimating:e},n){const r=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,r}function Jc(t,e,{delay:n=0,transitionOverride:r,type:i}={}){var s;let{transition:o=t.getDefaultTransition(),transitionEnd:a,...c}=e;r&&(o=r);const l=[],u=i&&t.animationState&&t.animationState.getState()[i];for(const d in c){const f=t.getValue(d,(s=t.latestValues[d])!==null&&s!==void 0?s:null),h=c[d];if(h===void 0||u&&Jp(u,d))continue;const m={delay:n,...Hi(o||{},d)};let g=!1;if(window.MotionHandoffAnimation){const x=Sc(t);if(x){const b=window.MotionHandoffAnimation(x,d,G);b!==null&&(m.startTime=b,g=!0)}}Yr(t,d),f.start(is(d,f,h,t.shouldReduceMotion&&bc.has(d)?{type:!1}:m,t,g));const y=f.animation;y&&l.push(y)}return a&&Promise.all(l).then(()=>{G.update(()=>{a&&Ih(t,a)})}),l}function ti(t,e,n={}){var r;const i=nr(t,e,n.type==="exit"?(r=t.presenceContext)===null||r===void 0?void 0:r.custom:void 0);let{transition:s=t.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(s=n.transitionOverride);const o=i?()=>Promise.all(Jc(t,i,n)):()=>Promise.resolve(),a=t.variantChildren&&t.variantChildren.size?(l=0)=>{const{delayChildren:u=0,staggerChildren:d,staggerDirection:f}=s;return Qp(t,e,u+l,d,f,n)}:()=>Promise.resolve(),{when:c}=s;if(c){const[l,u]=c==="beforeChildren"?[o,a]:[a,o];return l().then(()=>u())}else return Promise.all([o(),a(n.delay)])}function Qp(t,e,n=0,r=0,i=1,s){const o=[],a=(t.variantChildren.size-1)*r,c=i===1?(l=0)=>l*r:(l=0)=>a-l*r;return Array.from(t.variantChildren).sort(eg).forEach((l,u)=>{l.notify("AnimationStart",e),o.push(ti(l,e,{...s,delay:n+c(u)}).then(()=>l.notify("AnimationComplete",e)))}),Promise.all(o)}function eg(t,e){return t.sortNodePosition(e)}function tg(t,e,n={}){t.notify("AnimationStart",e);let r;if(Array.isArray(e)){const i=e.map(s=>ti(t,s,n));r=Promise.all(i)}else if(typeof e=="string")r=ti(t,e,n);else{const i=typeof e=="function"?nr(t,e,n.custom):e;r=Promise.all(Jc(t,i,n))}return r.then(()=>{t.notify("AnimationComplete",e)})}const ng=Ri.length;function Qc(t){if(!t)return;if(!t.isControllingVariants){const n=t.parent?Qc(t.parent)||{}:{};return t.props.initial!==void 0&&(n.initial=t.props.initial),n}const e={};for(let n=0;n<ng;n++){const r=Ri[n],i=t.props[r];(Zt(i)||i===!1)&&(e[r]=i)}return e}const rg=[...Ii].reverse(),ig=Ii.length;function sg(t){return e=>Promise.all(e.map(({animation:n,options:r})=>tg(t,n,r)))}function og(t){let e=sg(t),n=ho(),r=!0;const i=c=>(l,u)=>{var d;const f=nr(t,u,c==="exit"?(d=t.presenceContext)===null||d===void 0?void 0:d.custom:void 0);if(f){const{transition:h,transitionEnd:m,...g}=f;l={...l,...g,...m}}return l};function s(c){e=c(t)}function o(c){const{props:l}=t,u=Qc(t.parent)||{},d=[],f=new Set;let h={},m=1/0;for(let y=0;y<ig;y++){const x=rg[y],b=n[x],T=l[x]!==void 0?l[x]:u[x],S=Zt(T),C=x===c?b.isActive:null;C===!1&&(m=y);let P=T===u[x]&&T!==l[x]&&S;if(P&&r&&t.manuallyAnimateOnMount&&(P=!1),b.protectedKeys={...h},!b.isActive&&C===null||!T&&!b.prevProp||er(T)||typeof T=="boolean")continue;const D=ag(b.prevProp,T);let E=D||x===c&&b.isActive&&!P&&S||y>m&&S,_=!1;const N=Array.isArray(T)?T:[T];let z=N.reduce(i(x),{});C===!1&&(z={});const{prevResolvedValues:K={}}=b,re={...K,...z},ne=B=>{E=!0,f.has(B)&&(_=!0,f.delete(B)),b.needsAnimating[B]=!0;const F=t.getValue(B);F&&(F.liveStyle=!1)};for(const B in re){const F=z[B],M=K[B];if(h.hasOwnProperty(B))continue;let J=!1;Wr(F)&&Wr(M)?J=!fc(F,M):J=F!==M,J?F!=null?ne(B):f.add(B):F!==void 0&&f.has(B)?ne(B):b.protectedKeys[B]=!0}b.prevProp=T,b.prevResolvedValues=z,b.isActive&&(h={...h,...z}),r&&t.blockInitialAnimation&&(E=!1),E&&(!(P&&D)||_)&&d.push(...N.map(B=>({animation:B,options:{type:x}})))}if(f.size){const y={};f.forEach(x=>{const b=t.getBaseTarget(x),T=t.getValue(x);T&&(T.liveStyle=!0),y[x]=b??null}),d.push({animation:y})}let g=!!d.length;return r&&(l.initial===!1||l.initial===l.animate)&&!t.manuallyAnimateOnMount&&(g=!1),r=!1,g?e(d):Promise.resolve()}function a(c,l){var u;if(n[c].isActive===l)return Promise.resolve();(u=t.variantChildren)===null||u===void 0||u.forEach(f=>{var h;return(h=f.animationState)===null||h===void 0?void 0:h.setActive(c,l)}),n[c].isActive=l;const d=o(c);for(const f in n)n[f].protectedKeys={};return d}return{animateChanges:o,setActive:a,setAnimateFunction:s,getState:()=>n,reset:()=>{n=ho(),r=!0}}}function ag(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!fc(e,t):!1}function tt(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function ho(){return{animate:tt(!0),whileInView:tt(),whileHover:tt(),whileTap:tt(),whileDrag:tt(),whileFocus:tt(),exit:tt()}}class Ye{constructor(e){this.isMounted=!1,this.node=e}update(){}}class cg extends Ye{constructor(e){super(e),e.animationState||(e.animationState=og(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();er(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:n}=this.node.prevProps||{};e!==n&&this.updateAnimationControlsSubscription()}unmount(){var e;this.node.animationState.reset(),(e=this.unmountControls)===null||e===void 0||e.call(this)}}let lg=0;class ug extends Ye{constructor(){super(...arguments),this.id=lg++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===r)return;const i=this.node.animationState.setActive("exit",!e);n&&!e&&i.then(()=>n(this.id))}mount(){const{register:e}=this.node.presenceContext||{};e&&(this.unmount=e(this.id))}unmount(){}}const dg={animation:{Feature:cg},exit:{Feature:ug}};function tn(t,e,n,r={passive:!0}){return t.addEventListener(e,n,r),()=>t.removeEventListener(e,n)}function ln(t){return{point:{x:t.pageX,y:t.pageY}}}const fg=t=>e=>Gi(e)&&t(e,ln(e));function Wt(t,e,n,r){return tn(t,e,fg(n),r)}const po=(t,e)=>Math.abs(t-e);function hg(t,e){const n=po(t.x,e.x),r=po(t.y,e.y);return Math.sqrt(n**2+r**2)}class el{constructor(e,n,{transformPagePoint:r,contextWindow:i,dragSnapToOrigin:s=!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 d=Pr(this.lastMoveEventInfo,this.history),f=this.startEvent!==null,h=hg(d.offset,{x:0,y:0})>=3;if(!f&&!h)return;const{point:m}=d,{timestamp:g}=se;this.history.push({...m,timestamp:g});const{onStart:y,onMove:x}=this.handlers;f||(y&&y(this.lastMoveEvent,d),this.startEvent=this.lastMoveEvent),x&&x(this.lastMoveEvent,d)},this.handlePointerMove=(d,f)=>{this.lastMoveEvent=d,this.lastMoveEventInfo=Dr(f,this.transformPagePoint),G.update(this.updatePoint,!0)},this.handlePointerUp=(d,f)=>{this.end();const{onEnd:h,onSessionEnd:m,resumeAnimation:g}=this.handlers;if(this.dragSnapToOrigin&&g&&g(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const y=Pr(d.type==="pointercancel"?this.lastMoveEventInfo:Dr(f,this.transformPagePoint),this.history);this.startEvent&&h&&h(d,y),m&&m(d,y)},!Gi(e))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=r,this.contextWindow=i||window;const o=ln(e),a=Dr(o,this.transformPagePoint),{point:c}=a,{timestamp:l}=se;this.history=[{...c,timestamp:l}];const{onSessionStart:u}=n;u&&u(e,Pr(a,this.history)),this.removeListeners=cn(Wt(this.contextWindow,"pointermove",this.handlePointerMove),Wt(this.contextWindow,"pointerup",this.handlePointerUp),Wt(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),We(this.updatePoint)}}function Dr(t,e){return e?{point:e(t.point)}:t}function go(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Pr({point:t},e){return{point:t,delta:go(t,tl(e)),offset:go(t,pg(e)),velocity:gg(e,.1)}}function pg(t){return t[0]}function tl(t){return t[t.length-1]}function gg(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,r=null;const i=tl(t);for(;n>=0&&(r=t[n],!(i.timestamp-r.timestamp>_e(e)));)n--;if(!r)return{x:0,y:0};const s=Le(i.timestamp-r.timestamp);if(s===0)return{x:0,y:0};const o={x:(i.x-r.x)/s,y:(i.y-r.y)/s};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}const nl=1e-4,mg=1-nl,vg=1+nl,rl=.01,yg=0-rl,xg=0+rl;function ye(t){return t.max-t.min}function bg(t,e,n){return Math.abs(t-e)<=n}function mo(t,e,n,r=.5){t.origin=r,t.originPoint=X(e.min,e.max,t.origin),t.scale=ye(n)/ye(e),t.translate=X(n.min,n.max,t.origin)-t.originPoint,(t.scale>=mg&&t.scale<=vg||isNaN(t.scale))&&(t.scale=1),(t.translate>=yg&&t.translate<=xg||isNaN(t.translate))&&(t.translate=0)}function Gt(t,e,n,r){mo(t.x,e.x,n.x,r?r.originX:void 0),mo(t.y,e.y,n.y,r?r.originY:void 0)}function vo(t,e,n){t.min=n.min+e.min,t.max=t.min+ye(e)}function Tg(t,e,n){vo(t.x,e.x,n.x),vo(t.y,e.y,n.y)}function yo(t,e,n){t.min=e.min-n.min,t.max=t.min+ye(e)}function Kt(t,e,n){yo(t.x,e.x,n.x),yo(t.y,e.y,n.y)}function Sg(t,{min:e,max:n},r){return e!==void 0&&t<e?t=r?X(e,t,r.min):Math.max(t,e):n!==void 0&&t>n&&(t=r?X(n,t,r.max):Math.min(t,n)),t}function xo(t,e,n){return{min:e!==void 0?t.min+e:void 0,max:n!==void 0?t.max+n-(t.max-t.min):void 0}}function wg(t,{top:e,left:n,bottom:r,right:i}){return{x:xo(t.x,n,i),y:xo(t.y,e,r)}}function bo(t,e){let n=e.min-t.min,r=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,r]=[r,n]),{min:n,max:r}}function Cg(t,e){return{x:bo(t.x,e.x),y:bo(t.y,e.y)}}function Eg(t,e){let n=.5;const r=ye(t),i=ye(e);return i>r?n=Dt(e.min,e.max-r,t.min):r>i&&(n=Dt(t.min,t.max-i,e.min)),je(0,1,n)}function Dg(t,e){const n={};return e.min!==void 0&&(n.min=e.min-t.min),e.max!==void 0&&(n.max=e.max-t.min),n}const ni=.35;function Pg(t=ni){return t===!1?t=0:t===!0&&(t=ni),{x:To(t,"left","right"),y:To(t,"top","bottom")}}function To(t,e,n){return{min:So(t,e),max:So(t,n)}}function So(t,e){return typeof t=="number"?t:t[e]||0}const wo=()=>({translate:0,scale:1,origin:0,originPoint:0}),bt=()=>({x:wo(),y:wo()}),Co=()=>({min:0,max:0}),Z=()=>({x:Co(),y:Co()});function we(t){return[t("x"),t("y")]}function il({top:t,left:e,right:n,bottom:r}){return{x:{min:e,max:n},y:{min:t,max:r}}}function Og({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function Mg(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),r=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function Or(t){return t===void 0||t===1}function ri({scale:t,scaleX:e,scaleY:n}){return!Or(t)||!Or(e)||!Or(n)}function nt(t){return ri(t)||sl(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function sl(t){return Eo(t.x)||Eo(t.y)}function Eo(t){return t&&t!=="0%"}function Kn(t,e,n){const r=t-n,i=e*r;return n+i}function Do(t,e,n,r,i){return i!==void 0&&(t=Kn(t,i,r)),Kn(t,n,r)+e}function ii(t,e=0,n=1,r,i){t.min=Do(t.min,e,n,r,i),t.max=Do(t.max,e,n,r,i)}function ol(t,{x:e,y:n}){ii(t.x,e.translate,e.scale,e.originPoint),ii(t.y,n.translate,n.scale,n.originPoint)}const Po=.999999999999,Oo=1.0000000000001;function Ig(t,e,n,r=!1){const i=n.length;if(!i)return;e.x=e.y=1;let s,o;for(let a=0;a<i;a++){s=n[a],o=s.projectionDelta;const{visualElement:c}=s.options;c&&c.props.style&&c.props.style.display==="contents"||(r&&s.options.layoutScroll&&s.scroll&&s!==s.root&&St(t,{x:-s.scroll.offset.x,y:-s.scroll.offset.y}),o&&(e.x*=o.x.scale,e.y*=o.y.scale,ol(t,o)),r&&nt(s.latestValues)&&St(t,s.latestValues))}e.x<Oo&&e.x>Po&&(e.x=1),e.y<Oo&&e.y>Po&&(e.y=1)}function Tt(t,e){t.min=t.min+e,t.max=t.max+e}function Mo(t,e,n,r,i=.5){const s=X(t.min,t.max,i);ii(t,e,n,s,r)}function St(t,e){Mo(t.x,e.x,e.scaleX,e.scale,e.originX),Mo(t.y,e.y,e.scaleY,e.scale,e.originY)}function al(t,e){return il(Mg(t.getBoundingClientRect(),e))}function Rg(t,e,n){const r=al(t,n),{scroll:i}=e;return i&&(Tt(r.x,i.offset.x),Tt(r.y,i.offset.y)),r}const cl=({current:t})=>t?t.ownerDocument.defaultView:null,Ag=new WeakMap;class Ng{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=Z(),this.visualElement=e}start(e,{snapToCursor:n=!1}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const i=u=>{const{dragSnapToOrigin:d}=this.getProps();d?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(ln(u).point)},s=(u,d)=>{const{drag:f,dragPropagation:h,onDragStart:m}=this.getProps();if(f&&!h&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Eh(f),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),we(y=>{let x=this.getAxisMotionValue(y).get()||0;if(Re.test(x)){const{projection:b}=this.visualElement;if(b&&b.layout){const T=b.layout.layoutBox[y];T&&(x=ye(T)*(parseFloat(x)/100))}}this.originPoint[y]=x}),m&&G.postRender(()=>m(u,d)),Yr(this.visualElement,"transform");const{animationState:g}=this.visualElement;g&&g.setActive("whileDrag",!0)},o=(u,d)=>{const{dragPropagation:f,dragDirectionLock:h,onDirectionLock:m,onDrag:g}=this.getProps();if(!f&&!this.openDragLock)return;const{offset:y}=d;if(h&&this.currentDirection===null){this.currentDirection=_g(y),this.currentDirection!==null&&m&&m(this.currentDirection);return}this.updateAxis("x",d.point,y),this.updateAxis("y",d.point,y),this.visualElement.render(),g&&g(u,d)},a=(u,d)=>this.stop(u,d),c=()=>we(u=>{var d;return this.getAnimationState(u)==="paused"&&((d=this.getAxisMotionValue(u).animation)===null||d===void 0?void 0:d.play())}),{dragSnapToOrigin:l}=this.getProps();this.panSession=new el(e,{onSessionStart:i,onStart:s,onMove:o,onSessionEnd:a,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:l,contextWindow:cl(this.visualElement)})}stop(e,n){const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:i}=n;this.startAnimation(i);const{onDragEnd:s}=this.getProps();s&&G.postRender(()=>s(e,n))}cancel(){this.isDragging=!1;const{projection:e,animationState:n}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(e,n,r){const{drag:i}=this.getProps();if(!r||!Dn(e,i,this.currentDirection))return;const s=this.getAxisMotionValue(e);let o=this.originPoint[e]+r[e];this.constraints&&this.constraints[e]&&(o=Sg(o,this.constraints[e],this.elastic[e])),s.set(o)}resolveConstraints(){var e;const{dragConstraints:n,dragElastic:r}=this.getProps(),i=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(e=this.visualElement.projection)===null||e===void 0?void 0:e.layout,s=this.constraints;n&&yt(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&i?this.constraints=wg(i.layoutBox,n):this.constraints=!1,this.elastic=Pg(r),s!==this.constraints&&i&&this.constraints&&!this.hasMutatedConstraints&&we(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=Dg(i.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!yt(e))return!1;const r=e.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const s=Rg(r,i.root,this.visualElement.getTransformPagePoint());let o=Cg(i.layout.layoutBox,s);if(n){const a=n(Og(o));this.hasMutatedConstraints=!!a,a&&(o=il(a))}return o}startAnimation(e){const{drag:n,dragMomentum:r,dragElastic:i,dragTransition:s,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),c=this.constraints||{},l=we(u=>{if(!Dn(u,n,this.currentDirection))return;let d=c&&c[u]||{};o&&(d={min:0,max:0});const f=i?200:1e6,h=i?40:1e7,m={type:"inertia",velocity:r?e[u]:0,bounceStiffness:f,bounceDamping:h,timeConstant:750,restDelta:1,restSpeed:10,...s,...d};return this.startAxisValueAnimation(u,m)});return Promise.all(l).then(a)}startAxisValueAnimation(e,n){const r=this.getAxisMotionValue(e);return Yr(this.visualElement,e),r.start(is(e,r,0,n,this.visualElement,!1))}stopAnimation(){we(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){we(e=>{var n;return(n=this.getAxisMotionValue(e).animation)===null||n===void 0?void 0:n.pause()})}getAnimationState(e){var n;return(n=this.getAxisMotionValue(e).animation)===null||n===void 0?void 0:n.state}getAxisMotionValue(e){const n=`_drag${e.toUpperCase()}`,r=this.visualElement.getProps(),i=r[n];return i||this.visualElement.getValue(e,(r.initial?r.initial[e]:void 0)||0)}snapToCursor(e){we(n=>{const{drag:r}=this.getProps();if(!Dn(n,r,this.currentDirection))return;const{projection:i}=this.visualElement,s=this.getAxisMotionValue(n);if(i&&i.layout){const{min:o,max:a}=i.layout.layoutBox[n];s.set(e[n]-X(o,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!yt(n)||!r||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};we(o=>{const a=this.getAxisMotionValue(o);if(a&&this.constraints!==!1){const c=a.get();i[o]=Eg({min:c,max:c},this.constraints[o])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),we(o=>{if(!Dn(o,e,null))return;const a=this.getAxisMotionValue(o),{min:c,max:l}=this.constraints[o];a.set(X(c,l,i[o]))})}addListeners(){if(!this.visualElement.current)return;Ag.set(this.visualElement,this);const e=this.visualElement.current,n=Wt(e,"pointerdown",c=>{const{drag:l,dragListener:u=!0}=this.getProps();l&&u&&this.start(c)}),r=()=>{const{dragConstraints:c}=this.getProps();yt(c)&&c.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,s=i.addEventListener("measure",r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),G.read(r);const o=tn(window,"resize",()=>this.scalePositionWithinConstraints()),a=i.addEventListener("didUpdate",({delta:c,hasLayoutChanged:l})=>{this.isDragging&&l&&(we(u=>{const d=this.getAxisMotionValue(u);d&&(this.originPoint[u]+=c[u].translate,d.set(d.get()+c[u].translate))}),this.visualElement.render())});return()=>{o(),n(),s(),a&&a()}}getProps(){const e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:i=!1,dragConstraints:s=!1,dragElastic:o=ni,dragMomentum:a=!0}=e;return{...e,drag:n,dragDirectionLock:r,dragPropagation:i,dragConstraints:s,dragElastic:o,dragMomentum:a}}}function Dn(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function _g(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class Lg extends Ye{constructor(e){super(e),this.removeGroupControls=me,this.removeListeners=me,this.controls=new Ng(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||me}unmount(){this.removeGroupControls(),this.removeListeners()}}const Io=t=>(e,n)=>{t&&G.postRender(()=>t(e,n))};class kg extends Ye{constructor(){super(...arguments),this.removePointerDownListener=me}onPointerDown(e){this.session=new el(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:cl(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:r,onPanEnd:i}=this.node.getProps();return{onSessionStart:Io(e),onStart:Io(n),onMove:r,onEnd:(s,o)=>{delete this.session,i&&G.postRender(()=>i(s,o))}}}mount(){this.removePointerDownListener=Wt(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const Ln={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Ro(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const Nt={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(A.test(t))t=parseFloat(t);else return t;const n=Ro(t,e.target.x),r=Ro(t,e.target.y);return`${n}% ${r}%`}},jg={correct:(t,{treeScale:e,projectionDelta:n})=>{const r=t,i=Ge.parse(t);if(i.length>5)return r;const s=Ge.createTransformer(t),o=typeof i[0]!="number"?1:0,a=n.x.scale*e.x,c=n.y.scale*e.y;i[0+o]/=a,i[1+o]/=c;const l=X(a,c,.5);return typeof i[2+o]=="number"&&(i[2+o]/=l),typeof i[3+o]=="number"&&(i[3+o]/=l),s(i)}};class Vg extends p.Component{componentDidMount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:r,layoutId:i}=this.props,{projection:s}=e;ih(Fg),s&&(n.group&&n.group.add(s),r&&r.register&&i&&r.register(s),s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,onExitComplete:()=>this.safeToRemove()})),Ln.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:n,visualElement:r,drag:i,isPresent:s}=this.props,o=r.projection;return o&&(o.isPresent=s,i||e.layoutDependency!==n||n===void 0?o.willUpdate():this.safeToRemove(),e.isPresent!==s&&(s?o.promote():o.relegate()||G.postRender(()=>{const a=o.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),Ni.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:i}=e;i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),r&&r.deregister&&r.deregister(i))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function ll(t){const[e,n]=xf(),r=p.useContext(Wa);return v.jsx(Vg,{...t,layoutGroup:r,switchLayoutGroup:p.useContext(Qa),isPresent:e,safeToRemove:n})}const Fg={borderRadius:{...Nt,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Nt,borderTopRightRadius:Nt,borderBottomLeftRadius:Nt,borderBottomRightRadius:Nt,boxShadow:jg};function Bg(t,e,n){const r=ae(t)?t:Qt(t);return r.start(is("",r,e,n)),r.animation}function $g(t){return t instanceof SVGElement&&t.tagName!=="svg"}const Ug=(t,e)=>t.depth-e.depth;class Hg{constructor(){this.children=[],this.isDirty=!1}add(e){Ki(this.children,e),this.isDirty=!0}remove(e){Yi(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(Ug),this.isDirty=!1,this.children.forEach(e)}}function zg(t,e){const n=Ae.now(),r=({timestamp:i})=>{const s=i-n;s>=e&&(We(r),t(s-e))};return G.read(r,!0),()=>We(r)}const ul=["TopLeft","TopRight","BottomLeft","BottomRight"],Wg=ul.length,Ao=t=>typeof t=="string"?parseFloat(t):t,No=t=>typeof t=="number"||A.test(t);function Gg(t,e,n,r,i,s){i?(t.opacity=X(0,n.opacity!==void 0?n.opacity:1,Kg(r)),t.opacityExit=X(e.opacity!==void 0?e.opacity:1,0,Yg(r))):s&&(t.opacity=X(e.opacity!==void 0?e.opacity:1,n.opacity!==void 0?n.opacity:1,r));for(let o=0;o<Wg;o++){const a=`border${ul[o]}Radius`;let c=_o(e,a),l=_o(n,a);if(c===void 0&&l===void 0)continue;c||(c=0),l||(l=0),c===0||l===0||No(c)===No(l)?(t[a]=Math.max(X(Ao(c),Ao(l),r),0),(Re.test(l)||Re.test(c))&&(t[a]+="%")):t[a]=l}(e.rotate||n.rotate)&&(t.rotate=X(e.rotate||0,n.rotate||0,r))}function _o(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const Kg=dl(0,.5,Mc),Yg=dl(.5,.95,me);function dl(t,e,n){return r=>r<t?0:r>e?1:n(Dt(t,e,r))}function Lo(t,e){t.min=e.min,t.max=e.max}function be(t,e){Lo(t.x,e.x),Lo(t.y,e.y)}function ko(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function jo(t,e,n,r,i){return t-=e,t=Kn(t,1/n,r),i!==void 0&&(t=Kn(t,1/i,r)),t}function Xg(t,e=0,n=1,r=.5,i,s=t,o=t){if(Re.test(e)&&(e=parseFloat(e),e=X(o.min,o.max,e/100)-o.min),typeof e!="number")return;let a=X(s.min,s.max,r);t===s&&(a-=e),t.min=jo(t.min,e,n,a,i),t.max=jo(t.max,e,n,a,i)}function Vo(t,e,[n,r,i],s,o){Xg(t,e[n],e[r],e[i],e.scale,s,o)}const qg=["x","scaleX","originX"],Zg=["y","scaleY","originY"];function Fo(t,e,n,r){Vo(t.x,e,qg,n?n.x:void 0,r?r.x:void 0),Vo(t.y,e,Zg,n?n.y:void 0,r?r.y:void 0)}function Bo(t){return t.translate===0&&t.scale===1}function fl(t){return Bo(t.x)&&Bo(t.y)}function $o(t,e){return t.min===e.min&&t.max===e.max}function Jg(t,e){return $o(t.x,e.x)&&$o(t.y,e.y)}function Uo(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function hl(t,e){return Uo(t.x,e.x)&&Uo(t.y,e.y)}function Ho(t){return ye(t.x)/ye(t.y)}function zo(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}class Qg{constructor(){this.members=[]}add(e){Ki(this.members,e),e.scheduleRender()}remove(e){if(Yi(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(e){const n=this.members.findIndex(i=>e===i);if(n===0)return!1;let r;for(let i=n;i>=0;i--){const s=this.members[i];if(s.isPresent!==!1){r=s;break}}return r?(this.promote(r),!0):!1}promote(e,n){const r=this.lead;if(e!==r&&(this.prevLead=r,this.lead=e,e.show(),r)){r.instance&&r.scheduleRender(),e.scheduleRender(),e.resumeFrom=r,n&&(e.resumeFrom.preserveOpacity=!0),r.snapshot&&(e.snapshot=r.snapshot,e.snapshot.latestValues=r.animationValues||r.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0);const{crossfade:i}=e.options;i===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(e=>{const{options:n,resumingFrom:r}=e;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function em(t,e,n){let r="";const i=t.x.translate/e.x,s=t.y.translate/e.y,o=(n==null?void 0:n.z)||0;if((i||s||o)&&(r=`translate3d(${i}px, ${s}px, ${o}px) `),(e.x!==1||e.y!==1)&&(r+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:l,rotate:u,rotateX:d,rotateY:f,skewX:h,skewY:m}=n;l&&(r=`perspective(${l}px) ${r}`),u&&(r+=`rotate(${u}deg) `),d&&(r+=`rotateX(${d}deg) `),f&&(r+=`rotateY(${f}deg) `),h&&(r+=`skewX(${h}deg) `),m&&(r+=`skewY(${m}deg) `)}const a=t.x.scale*e.x,c=t.y.scale*e.y;return(a!==1||c!==1)&&(r+=`scale(${a}, ${c})`),r||"none"}const rt={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},Ft=typeof window<"u"&&window.MotionDebug!==void 0,Mr=["","X","Y","Z"],tm={visibility:"hidden"},Wo=1e3;let nm=0;function Ir(t,e,n,r){const{latestValues:i}=e;i[t]&&(n[t]=i[t],e.setStaticValue(t,0),r&&(r[t]=0))}function pl(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=Sc(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:s}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",G,!(i||s))}const{parent:r}=t;r&&!r.hasCheckedOptimisedAppear&&pl(r)}function gl({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(o={},a=e==null?void 0:e()){this.id=nm++,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,Ft&&(rt.totalNodes=rt.resolvedTargetDeltas=rt.recalculatedProjection=0),this.nodes.forEach(sm),this.nodes.forEach(um),this.nodes.forEach(dm),this.nodes.forEach(om),Ft&&window.MotionDebug.record(rt)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let c=0;c<this.path.length;c++)this.path[c].shouldResetTransform=!0;this.root===this&&(this.nodes=new Hg)}addEventListener(o,a){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new Xi),this.eventHandlers.get(o).add(a)}notifyListeners(o,...a){const c=this.eventHandlers.get(o);c&&c.notify(...a)}hasListeners(o){return this.eventHandlers.has(o)}mount(o,a=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=$g(o),this.instance=o;const{layoutId:c,layout:l,visualElement:u}=this.options;if(u&&!u.current&&u.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),a&&(l||c)&&(this.isLayoutDirty=!0),t){let d;const f=()=>this.root.updateBlockedByResize=!1;t(o,()=>{this.root.updateBlockedByResize=!0,d&&d(),d=zg(f,250),Ln.hasAnimatedSinceResize&&(Ln.hasAnimatedSinceResize=!1,this.nodes.forEach(Ko))})}c&&this.root.registerSharedNode(c,this),this.options.animate!==!1&&u&&(c||l)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:f,hasRelativeTargetChanged:h,layout:m})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const g=this.options.transition||u.getDefaultTransition()||mm,{onLayoutAnimationStart:y,onLayoutAnimationComplete:x}=u.getProps(),b=!this.targetLayout||!hl(this.targetLayout,m)||h,T=!f&&h;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||T||f&&(b||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(d,T);const S={...Hi(g,"layout"),onPlay:y,onComplete:x};(u.shouldReduceMotion||this.options.layoutRoot)&&(S.delay=0,S.type=!1),this.startAnimation(S)}else f||Ko(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=m})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,We(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(fm),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&pl(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;u<this.path.length;u++){const d=this.path[u];d.shouldResetTransform=!0,d.updateScroll("snapshot"),d.options.layoutRoot&&d.willUpdate(!1)}const{layoutId:a,layout:c}=this.options;if(a===void 0&&!c)return;const l=this.getTransformTemplate();this.prevTransformTemplateValue=l?l(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(Go);return}this.isUpdating||this.nodes.forEach(cm),this.isUpdating=!1,this.nodes.forEach(lm),this.nodes.forEach(rm),this.nodes.forEach(im),this.clearAllSnapshots();const a=Ae.now();se.delta=je(0,1e3/60,a-se.timestamp),se.timestamp=a,se.isProcessing=!0,Tr.update.process(se),Tr.preRender.process(se),Tr.render.process(se),se.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Ni.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(am),this.sharedNodes.forEach(hm)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,G.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){G.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 c=0;c<this.path.length;c++)this.path[c].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutCorrected=Z(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(a=!1),a){const c=r(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:c,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:c}}}resetTransform(){if(!i)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!fl(this.projectionDelta),c=this.getTransformTemplate(),l=c?c(this.latestValues,""):void 0,u=l!==this.prevTransformTemplateValue;o&&(a||nt(this.latestValues)||u)&&(i(this.instance,l),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const a=this.measurePageBox();let c=this.removeElementScroll(a);return o&&(c=this.removeTransform(c)),vm(c),{animationId:this.root.animationId,measuredBox:a,layoutBox:c,latestValues:{},source:this.id}}measurePageBox(){var o;const{visualElement:a}=this.options;if(!a)return Z();const c=a.measureViewportBox();if(!(((o=this.scroll)===null||o===void 0?void 0:o.wasRoot)||this.path.some(ym))){const{scroll:u}=this.root;u&&(Tt(c.x,u.offset.x),Tt(c.y,u.offset.y))}return c}removeElementScroll(o){var a;const c=Z();if(be(c,o),!((a=this.scroll)===null||a===void 0)&&a.wasRoot)return c;for(let l=0;l<this.path.length;l++){const u=this.path[l],{scroll:d,options:f}=u;u!==this.root&&d&&f.layoutScroll&&(d.wasRoot&&be(c,o),Tt(c.x,d.offset.x),Tt(c.y,d.offset.y))}return c}applyTransform(o,a=!1){const c=Z();be(c,o);for(let l=0;l<this.path.length;l++){const u=this.path[l];!a&&u.options.layoutScroll&&u.scroll&&u!==u.root&&St(c,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),nt(u.latestValues)&&St(c,u.latestValues)}return nt(this.latestValues)&&St(c,this.latestValues),c}removeTransform(o){const a=Z();be(a,o);for(let c=0;c<this.path.length;c++){const l=this.path[c];if(!l.instance||!nt(l.latestValues))continue;ri(l.latestValues)&&l.updateSnapshot();const u=Z(),d=l.measurePageBox();be(u,d),Fo(a,l.latestValues,l.snapshot?l.snapshot.layoutBox:void 0,u)}return nt(this.latestValues)&&Fo(a,this.latestValues),a}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.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!==se.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){var a;const c=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=c.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=c.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=c.isSharedProjectionDirty);const l=!!this.resumingFrom||this!==c;if(!(o||l&&this.isSharedProjectionDirty||this.isProjectionDirty||!((a=this.parent)===null||a===void 0)&&a.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:d,layoutId:f}=this.options;if(!(!this.layout||!(d||f))){if(this.resolvedRelativeTargetAt=se.timestamp,!this.targetDelta&&!this.relativeTarget){const h=this.getClosestProjectingParent();h&&h.layout&&this.animationProgress!==1?(this.relativeParent=h,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Z(),this.relativeTargetOrigin=Z(),Kt(this.relativeTargetOrigin,this.layout.layoutBox,h.layout.layoutBox),be(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=Z(),this.targetWithTransforms=Z()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Tg(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):be(this.target,this.layout.layoutBox),ol(this.target,this.targetDelta)):be(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const h=this.getClosestProjectingParent();h&&!!h.resumingFrom==!!this.resumingFrom&&!h.options.layoutScroll&&h.target&&this.animationProgress!==1?(this.relativeParent=h,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Z(),this.relativeTargetOrigin=Z(),Kt(this.relativeTargetOrigin,this.target,h.target),be(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}Ft&&rt.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||ri(this.parent.latestValues)||sl(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 o;const a=this.getLead(),c=!!this.resumingFrom||this!==a;let l=!0;if((this.isProjectionDirty||!((o=this.parent)===null||o===void 0)&&o.isProjectionDirty)&&(l=!1),c&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(l=!1),this.resolvedRelativeTargetAt===se.timestamp&&(l=!1),l)return;const{layout:u,layoutId:d}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(u||d))return;be(this.layoutCorrected,this.layout.layoutBox);const f=this.treeScale.x,h=this.treeScale.y;Ig(this.layoutCorrected,this.treeScale,this.path,c),a.layout&&!a.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(a.target=a.layout.layoutBox,a.targetWithTransforms=Z());const{target:m}=a;if(!m){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(ko(this.prevProjectionDelta.x,this.projectionDelta.x),ko(this.prevProjectionDelta.y,this.projectionDelta.y)),Gt(this.projectionDelta,this.layoutCorrected,m,this.latestValues),(this.treeScale.x!==f||this.treeScale.y!==h||!zo(this.projectionDelta.x,this.prevProjectionDelta.x)||!zo(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",m)),Ft&&rt.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){var a;if((a=this.options.visualElement)===null||a===void 0||a.scheduleRender(),o){const c=this.getStack();c&&c.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=bt(),this.projectionDelta=bt(),this.projectionDeltaWithTransform=bt()}setAnimationOrigin(o,a=!1){const c=this.snapshot,l=c?c.latestValues:{},u={...this.latestValues},d=bt();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const f=Z(),h=c?c.source:void 0,m=this.layout?this.layout.source:void 0,g=h!==m,y=this.getStack(),x=!y||y.members.length<=1,b=!!(g&&!x&&this.options.crossfade===!0&&!this.path.some(gm));this.animationProgress=0;let T;this.mixTargetDelta=S=>{const C=S/1e3;Yo(d.x,o.x,C),Yo(d.y,o.y,C),this.setTargetDelta(d),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Kt(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox),pm(this.relativeTarget,this.relativeTargetOrigin,f,C),T&&Jg(this.relativeTarget,T)&&(this.isProjectionDirty=!1),T||(T=Z()),be(T,this.relativeTarget)),g&&(this.animationValues=u,Gg(u,l,this.latestValues,C,b,x)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=C},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(We(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=G.update(()=>{Ln.hasAnimatedSinceResize=!0,this.currentAnimation=Bg(0,Wo,{...o,onUpdate:a=>{this.mixTargetDelta(a),o.onUpdate&&o.onUpdate(a)},onComplete:()=>{o.onComplete&&o.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 o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Wo),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:c,layout:l,latestValues:u}=o;if(!(!a||!c||!l)){if(this!==o&&this.layout&&l&&ml(this.options.animationType,this.layout.layoutBox,l.layoutBox)){c=this.target||Z();const d=ye(this.layout.layoutBox.x);c.x.min=o.target.x.min,c.x.max=c.x.min+d;const f=ye(this.layout.layoutBox.y);c.y.min=o.target.y.min,c.y.max=c.y.min+f}be(a,c),St(a,u),Gt(this.projectionDeltaWithTransform,this.layoutCorrected,a,u)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new Qg),this.sharedNodes.get(o).add(a);const l=a.options.initialPromotionConfig;a.promote({transition:l?l.transition:void 0,preserveFollowOpacity:l&&l.shouldPreserveFollowOpacity?l.shouldPreserveFollowOpacity(a):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var o;const{layoutId:a}=this.options;return a?((o=this.getStack())===null||o===void 0?void 0:o.lead)||this:this}getPrevLead(){var o;const{layoutId:a}=this.options;return a?(o=this.getStack())===null||o===void 0?void 0:o.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:a,preserveFollowOpacity:c}={}){const l=this.getStack();l&&l.promote(this,c),o&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let a=!1;const{latestValues:c}=o;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(a=!0),!a)return;const l={};c.z&&Ir("z",o,l,this.animationValues);for(let u=0;u<Mr.length;u++)Ir(`rotate${Mr[u]}`,o,l,this.animationValues),Ir(`skew${Mr[u]}`,o,l,this.animationValues);o.render();for(const u in l)o.setStaticValue(u,l[u]),this.animationValues&&(this.animationValues[u]=l[u]);o.scheduleRender()}getProjectionStyles(o){var a,c;if(!this.instance||this.isSVG)return;if(!this.isVisible)return tm;const l={visibility:""},u=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,l.opacity="",l.pointerEvents=Nn(o==null?void 0:o.pointerEvents)||"",l.transform=u?u(this.latestValues,""):"none",l;const d=this.getLead();if(!this.projectionDelta||!this.layout||!d.target){const g={};return this.options.layoutId&&(g.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,g.pointerEvents=Nn(o==null?void 0:o.pointerEvents)||""),this.hasProjected&&!nt(this.latestValues)&&(g.transform=u?u({},""):"none",this.hasProjected=!1),g}const f=d.animationValues||d.latestValues;this.applyTransformsToTarget(),l.transform=em(this.projectionDeltaWithTransform,this.treeScale,f),u&&(l.transform=u(f,l.transform));const{x:h,y:m}=this.projectionDelta;l.transformOrigin=`${h.origin*100}% ${m.origin*100}% 0`,d.animationValues?l.opacity=d===this?(c=(a=f.opacity)!==null&&a!==void 0?a:this.latestValues.opacity)!==null&&c!==void 0?c:1:this.preserveOpacity?this.latestValues.opacity:f.opacityExit:l.opacity=d===this?f.opacity!==void 0?f.opacity:"":f.opacityExit!==void 0?f.opacityExit:0;for(const g in Un){if(f[g]===void 0)continue;const{correct:y,applyTo:x}=Un[g],b=l.transform==="none"?f[g]:y(f[g],d);if(x){const T=x.length;for(let S=0;S<T;S++)l[x[S]]=b}else l[g]=b}return this.options.layoutId&&(l.pointerEvents=d===this?Nn(o==null?void 0:o.pointerEvents)||"":"none"),l}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>{var a;return(a=o.currentAnimation)===null||a===void 0?void 0:a.stop()}),this.root.nodes.forEach(Go),this.root.sharedNodes.clear()}}}function rm(t){t.updateLayout()}function im(t){var e;const n=((e=t.resumeFrom)===null||e===void 0?void 0:e.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&n&&t.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:i}=t.layout,{animationType:s}=t.options,o=n.source!==t.layout.source;s==="size"?we(d=>{const f=o?n.measuredBox[d]:n.layoutBox[d],h=ye(f);f.min=r[d].min,f.max=f.min+h}):ml(s,n.layoutBox,r)&&we(d=>{const f=o?n.measuredBox[d]:n.layoutBox[d],h=ye(r[d]);f.max=f.min+h,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[d].max=t.relativeTarget[d].min+h)});const a=bt();Gt(a,r,n.layoutBox);const c=bt();o?Gt(c,t.applyTransform(i,!0),n.measuredBox):Gt(c,r,n.layoutBox);const l=!fl(a);let u=!1;if(!t.resumeFrom){const d=t.getClosestProjectingParent();if(d&&!d.resumeFrom){const{snapshot:f,layout:h}=d;if(f&&h){const m=Z();Kt(m,n.layoutBox,f.layoutBox);const g=Z();Kt(g,r,h.layoutBox),hl(m,g)||(u=!0),d.options.layoutRoot&&(t.relativeTarget=g,t.relativeTargetOrigin=m,t.relativeParent=d)}}}t.notifyListeners("didUpdate",{layout:r,snapshot:n,delta:c,layoutDelta:a,hasLayoutChanged:l,hasRelativeTargetChanged:u})}else if(t.isLead()){const{onExitComplete:r}=t.options;r&&r()}t.options.transition=void 0}function sm(t){Ft&&rt.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 om(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function am(t){t.clearSnapshot()}function Go(t){t.clearMeasurements()}function cm(t){t.isLayoutDirty=!1}function lm(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function Ko(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function um(t){t.resolveTargetDelta()}function dm(t){t.calcProjection()}function fm(t){t.resetSkewAndRotation()}function hm(t){t.removeLeadSnapshot()}function Yo(t,e,n){t.translate=X(e.translate,0,n),t.scale=X(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function Xo(t,e,n,r){t.min=X(e.min,n.min,r),t.max=X(e.max,n.max,r)}function pm(t,e,n,r){Xo(t.x,e.x,n.x,r),Xo(t.y,e.y,n.y,r)}function gm(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const mm={duration:.45,ease:[.4,0,.1,1]},qo=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),Zo=qo("applewebkit/")&&!qo("chrome/")?Math.round:me;function Jo(t){t.min=Zo(t.min),t.max=Zo(t.max)}function vm(t){Jo(t.x),Jo(t.y)}function ml(t,e,n){return t==="position"||t==="preserve-aspect"&&!bg(Ho(e),Ho(n),.2)}function ym(t){var e;return t!==t.root&&((e=t.scroll)===null||e===void 0?void 0:e.wasRoot)}const xm=gl({attachResizeListener:(t,e)=>tn(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Rr={current:void 0},vl=gl({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Rr.current){const t=new xm({});t.mount(window),t.setOptions({layoutScroll:!0}),Rr.current=t}return Rr.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),bm={pan:{Feature:kg},drag:{Feature:Lg,ProjectionNode:vl,MeasureLayout:ll}};function Qo(t,e,n){const{props:r}=t;t.animationState&&r.whileHover&&t.animationState.setActive("whileHover",n==="Start");const i="onHover"+n,s=r[i];s&&G.postRender(()=>s(e,ln(e)))}class Tm extends Ye{mount(){const{current:e}=this.node;e&&(this.unmount=bh(e,n=>(Qo(this.node,n,"Start"),r=>Qo(this.node,r,"End"))))}unmount(){}}class Sm extends Ye{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=cn(tn(this.node.current,"focus",()=>this.onFocus()),tn(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function ea(t,e,n){const{props:r}=t;t.animationState&&r.whileTap&&t.animationState.setActive("whileTap",n==="Start");const i="onTap"+(n==="End"?"":n),s=r[i];s&&G.postRender(()=>s(e,ln(e)))}class wm extends Ye{mount(){const{current:e}=this.node;e&&(this.unmount=Ch(e,n=>(ea(this.node,n,"Start"),(r,{success:i})=>ea(this.node,r,i?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const si=new WeakMap,Ar=new WeakMap,Cm=t=>{const e=si.get(t.target);e&&e(t)},Em=t=>{t.forEach(Cm)};function Dm({root:t,...e}){const n=t||document;Ar.has(n)||Ar.set(n,{});const r=Ar.get(n),i=JSON.stringify(e);return r[i]||(r[i]=new IntersectionObserver(Em,{root:t,...e})),r[i]}function Pm(t,e,n){const r=Dm(e);return si.set(t,n),r.observe(t),()=>{si.delete(t),r.unobserve(t)}}const Om={some:0,all:1};class Mm extends Ye{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:n,margin:r,amount:i="some",once:s}=e,o={root:n?n.current:void 0,rootMargin:r,threshold:typeof i=="number"?i:Om[i]},a=c=>{const{isIntersecting:l}=c;if(this.isInView===l||(this.isInView=l,s&&!l&&this.hasEnteredView))return;l&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",l);const{onViewportEnter:u,onViewportLeave:d}=this.node.getProps(),f=l?u:d;f&&f(c)};return Pm(this.node.current,o,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:n}=this.node;["amount","margin","root"].some(Im(e,n))&&this.startObserver()}unmount(){}}function Im({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const Rm={inView:{Feature:Mm},tap:{Feature:wm},focus:{Feature:Sm},hover:{Feature:Tm}},Am={layout:{ProjectionNode:vl,MeasureLayout:ll}},oi={current:null},yl={current:!1};function Nm(){if(yl.current=!0,!!Oi)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>oi.current=t.matches;t.addListener(e),e()}else oi.current=!1}const _m=[...Hc,oe,Ge],Lm=t=>_m.find(Uc(t)),ta=new WeakMap;function km(t,e,n){for(const r in e){const i=e[r],s=n[r];if(ae(i))t.addValue(r,i);else if(ae(s))t.addValue(r,Qt(i,{owner:t}));else if(s!==i)if(t.hasValue(r)){const o=t.getValue(r);o.liveStyle===!0?o.jump(i):o.hasAnimated||o.set(i)}else{const o=t.getStaticValue(r);t.addValue(r,Qt(o!==void 0?o:i,{owner:t}))}}for(const r in n)e[r]===void 0&&t.removeValue(r);return e}const na=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class jm{scrapeMotionValuesFromProps(e,n,r){return{}}constructor({parent:e,props:n,presenceContext:r,reducedMotionConfig:i,blockInitialAnimation:s,visualState:o},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=ts,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const h=Ae.now();this.renderScheduledAt<h&&(this.renderScheduledAt=h,G.render(this.render,!1,!0))};const{latestValues:c,renderState:l,onUpdate:u}=o;this.onUpdate=u,this.latestValues=c,this.baseTarget={...c},this.initialValues=n.initial?{...c}:{},this.renderState=l,this.parent=e,this.props=n,this.presenceContext=r,this.depth=e?e.depth+1:0,this.reducedMotionConfig=i,this.options=a,this.blockInitialAnimation=!!s,this.isControllingVariants=tr(n),this.isVariantNode=Za(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:d,...f}=this.scrapeMotionValuesFromProps(n,{},this);for(const h in f){const m=f[h];c[h]!==void 0&&ae(m)&&m.set(c[h],!1)}}mount(e){this.current=e,ta.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,r)=>this.bindToMotionValue(r,n)),yl.current||Nm(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:oi.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){ta.delete(this.current),this.projection&&this.projection.unmount(),We(this.notifyUpdate),We(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const e in this.events)this.events[e].clear();for(const e in this.features){const n=this.features[e];n&&(n.unmount(),n.isMounted=!1)}this.current=null}bindToMotionValue(e,n){this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)();const r=dt.has(e),i=n.on("change",a=>{this.latestValues[e]=a,this.props.onUpdate&&G.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0)}),s=n.on("renderRequest",this.scheduleRender);let o;window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,e,n)),this.valueSubscriptions.set(e,()=>{i(),s(),o&&o(),n.owner&&n.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in Pt){const n=Pt[e];if(!n)continue;const{isEnabled:r,Feature:i}=n;if(!this.features[e]&&i&&r(this.props)&&(this.features[e]=new i(this)),this.features[e]){const s=this.features[e];s.isMounted?s.update():(s.mount(),s.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Z()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,n){this.latestValues[e]=n}update(e,n){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<na.length;r++){const i=na[r];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const s="on"+i,o=e[s];o&&(this.propEventSubscriptions[i]=this.on(i,o))}this.prevMotionValues=km(this,this.scrapeMotionValuesFromProps(e,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(e),()=>n.variantChildren.delete(e)}addValue(e,n){const r=this.values.get(e);n!==r&&(r&&this.removeValue(e),this.bindToMotionValue(e,n),this.values.set(e,n),this.latestValues[e]=n.get())}removeValue(e){this.values.delete(e);const n=this.valueSubscriptions.get(e);n&&(n(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,n){if(this.props.values&&this.props.values[e])return this.props.values[e];let r=this.values.get(e);return r===void 0&&n!==void 0&&(r=Qt(n===null?void 0:n,{owner:this}),this.addValue(e,r)),r}readValue(e,n){var r;let i=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:(r=this.getBaseTargetFromProps(this.props,e))!==null&&r!==void 0?r:this.readValueFromInstance(this.current,e,this.options);return i!=null&&(typeof i=="string"&&(Bc(i)||Rc(i))?i=parseFloat(i):!Lm(i)&&Ge.test(n)&&(i=jc(e,n)),this.setBaseTarget(e,ae(i)?i.get():i)),ae(i)?i.get():i}setBaseTarget(e,n){this.baseTarget[e]=n}getBaseTarget(e){var n;const{initial:r}=this.props;let i;if(typeof r=="string"||typeof r=="object"){const o=Li(this.props,r,(n=this.presenceContext)===null||n===void 0?void 0:n.custom);o&&(i=o[e])}if(r&&i!==void 0)return i;const s=this.getBaseTargetFromProps(this.props,e);return s!==void 0&&!ae(s)?s:this.initialValues[e]!==void 0&&i===void 0?void 0:this.baseTarget[e]}on(e,n){return this.events[e]||(this.events[e]=new Xi),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}}class xl extends jm{constructor(){super(...arguments),this.KeyframeResolver=zc}sortInstanceNodePosition(e,n){return e.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(e,n){return e.style?e.style[n]:void 0}removeValueFromRenderState(e,{vars:n,style:r}){delete n[e],delete r[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;ae(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function Vm(t){return window.getComputedStyle(t)}class Fm extends xl{constructor(){super(...arguments),this.type="html",this.renderInstance=oc}readValueFromInstance(e,n){if(dt.has(n)){const r=es(n);return r&&r.default||0}else{const r=Vm(e),i=(rc(n)?r.getPropertyValue(n):r[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(e,{transformPagePoint:n}){return al(e,n)}build(e,n,r){Vi(e,n,r.transformTemplate)}scrapeMotionValuesFromProps(e,n,r){return Ui(e,n,r)}}class Bm extends xl{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Z}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(dt.has(n)){const r=es(n);return r&&r.default||0}return n=ac.has(n)?n:Ai(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,r){return uc(e,n,r)}build(e,n,r){Fi(e,n,this.isSVGTag,r.transformTemplate)}renderInstance(e,n,r,i){cc(e,n,r,i)}mount(e){this.isSVGTag=$i(e.tagName),super.mount(e)}}const $m=(t,e)=>_i(t)?new Bm(e):new Fm(e,{allowProjection:t!==p.Fragment}),Um=hh({...dg,...Rm,...bm,...Am},$m),Hm=Of(Um);function ra(t,e){let n;return(...r)=>{window.clearTimeout(n),n=window.setTimeout(()=>t(...r),e)}}function zm({debounce:t,scroll:e,polyfill:n,offsetSize:r}={debounce:0,scroll:!1,offsetSize:!1}){const i=n||(typeof window>"u"?class{}:window.ResizeObserver);if(!i)throw new Error("This browser does not support ResizeObserver out of the box. See: https://github.com/react-spring/react-use-measure/#resize-observer-polyfills");const[s,o]=p.useState({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0}),a=p.useRef({element:null,scrollContainers:null,resizeObserver:null,lastBounds:s,orientationHandler:null}),c=t?typeof t=="number"?t:t.scroll:null,l=t?typeof t=="number"?t:t.resize:null,u=p.useRef(!1);p.useEffect(()=>(u.current=!0,()=>void(u.current=!1)));const[d,f,h]=p.useMemo(()=>{const x=()=>{if(!a.current.element)return;const{left:b,top:T,width:S,height:C,bottom:P,right:D,x:E,y:_}=a.current.element.getBoundingClientRect(),N={left:b,top:T,width:S,height:C,bottom:P,right:D,x:E,y:_};a.current.element instanceof HTMLElement&&r&&(N.height=a.current.element.offsetHeight,N.width=a.current.element.offsetWidth),Object.freeze(N),u.current&&!Ym(a.current.lastBounds,N)&&o(a.current.lastBounds=N)};return[x,l?ra(x,l):x,c?ra(x,c):x]},[o,r,c,l]);function m(){a.current.scrollContainers&&(a.current.scrollContainers.forEach(x=>x.removeEventListener("scroll",h,!0)),a.current.scrollContainers=null),a.current.resizeObserver&&(a.current.resizeObserver.disconnect(),a.current.resizeObserver=null),a.current.orientationHandler&&("orientation"in screen&&"removeEventListener"in screen.orientation?screen.orientation.removeEventListener("change",a.current.orientationHandler):"onorientationchange"in window&&window.removeEventListener("orientationchange",a.current.orientationHandler))}function g(){a.current.element&&(a.current.resizeObserver=new i(h),a.current.resizeObserver.observe(a.current.element),e&&a.current.scrollContainers&&a.current.scrollContainers.forEach(x=>x.addEventListener("scroll",h,{capture:!0,passive:!0})),a.current.orientationHandler=()=>{h()},"orientation"in screen&&"addEventListener"in screen.orientation?screen.orientation.addEventListener("change",a.current.orientationHandler):"onorientationchange"in window&&window.addEventListener("orientationchange",a.current.orientationHandler))}const y=x=>{!x||x===a.current.element||(m(),a.current.element=x,a.current.scrollContainers=bl(x),g())};return Gm(h,!!e),Wm(f),p.useEffect(()=>{m(),g()},[e,h,f]),p.useEffect(()=>m,[]),[y,s,d]}function Wm(t){p.useEffect(()=>{const e=t;return window.addEventListener("resize",e),()=>void window.removeEventListener("resize",e)},[t])}function Gm(t,e){p.useEffect(()=>{if(e){const n=t;return window.addEventListener("scroll",n,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",n,!0)}},[t,e])}function bl(t){const e=[];if(!t||t===document.body)return e;const{overflow:n,overflowX:r,overflowY:i}=window.getComputedStyle(t);return[n,r,i].some(s=>s==="auto"||s==="scroll")&&e.push(t),[...e,...bl(t.parentElement)]}const Km=["x","y","top","bottom","left","right","width","height"],Ym=(t,e)=>Km.every(n=>t[n]===e[n]),Tl=p.createContext({dragDropManager:void 0});function Te(t){return"Minified Redux error #"+t+"; visit https://redux.js.org/Errors?code="+t+" for the full message or use the non-minified dev environment for full errors. "}var ia=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),sa=function(){return Math.random().toString(36).substring(7).split("").join(".")},oa={INIT:"@@redux/INIT"+sa(),REPLACE:"@@redux/REPLACE"+sa()};function Xm(t){if(typeof t!="object"||t===null)return!1;for(var e=t;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function Sl(t,e,n){var r;if(typeof e=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(Te(0));if(typeof e=="function"&&typeof n>"u"&&(n=e,e=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(Te(1));return n(Sl)(t,e)}if(typeof t!="function")throw new Error(Te(2));var i=t,s=e,o=[],a=o,c=!1;function l(){a===o&&(a=o.slice())}function u(){if(c)throw new Error(Te(3));return s}function d(g){if(typeof g!="function")throw new Error(Te(4));if(c)throw new Error(Te(5));var y=!0;return l(),a.push(g),function(){if(y){if(c)throw new Error(Te(6));y=!1,l();var b=a.indexOf(g);a.splice(b,1),o=null}}}function f(g){if(!Xm(g))throw new Error(Te(7));if(typeof g.type>"u")throw new Error(Te(8));if(c)throw new Error(Te(9));try{c=!0,s=i(s,g)}finally{c=!1}for(var y=o=a,x=0;x<y.length;x++){var b=y[x];b()}return g}function h(g){if(typeof g!="function")throw new Error(Te(10));i=g,f({type:oa.REPLACE})}function m(){var g,y=d;return g={subscribe:function(b){if(typeof b!="object"||b===null)throw new Error(Te(11));function T(){b.next&&b.next(u())}T();var S=y(T);return{unsubscribe:S}}},g[ia]=function(){return this},g}return f({type:oa.INIT}),r={dispatch:f,subscribe:d,getState:u,replaceReducer:h},r[ia]=m,r}function j(t,e,...n){if(qm()&&e===void 0)throw new Error("invariant requires an error message argument");if(!t){let r;if(e===void 0)r=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{let i=0;r=new Error(e.replace(/%s/g,function(){return n[i++]})),r.name="Invariant Violation"}throw r.framesToPop=1,r}}function qm(){return typeof process<"u"&&!0}function Zm(t,e,n){return e.split(".").reduce((r,i)=>r&&r[i]?r[i]:n||null,t)}function Jm(t,e){return t.filter(n=>n!==e)}function wl(t){return typeof t=="object"}function Qm(t,e){const n=new Map,r=s=>{n.set(s,n.has(s)?n.get(s)+1:1)};t.forEach(r),e.forEach(r);const i=[];return n.forEach((s,o)=>{s===1&&i.push(o)}),i}function ev(t,e){return t.filter(n=>e.indexOf(n)>-1)}const ss="dnd-core/INIT_COORDS",ir="dnd-core/BEGIN_DRAG",os="dnd-core/PUBLISH_DRAG_SOURCE",sr="dnd-core/HOVER",or="dnd-core/DROP",ar="dnd-core/END_DRAG";function aa(t,e){return{type:ss,payload:{sourceClientOffset:e||null,clientOffset:t||null}}}const tv={type:ss,payload:{clientOffset:null,sourceClientOffset:null}};function nv(t){return function(n=[],r={publishSource:!0}){const{publishSource:i=!0,clientOffset:s,getSourceClientOffset:o}=r,a=t.getMonitor(),c=t.getRegistry();t.dispatch(aa(s)),rv(n,a,c);const l=ov(n,a);if(l==null){t.dispatch(tv);return}let u=null;if(s){if(!o)throw new Error("getSourceClientOffset must be defined");iv(o),u=o(l)}t.dispatch(aa(s,u));const f=c.getSource(l).beginDrag(a,l);if(f==null)return;sv(f),c.pinSource(l);const h=c.getSourceType(l);return{type:ir,payload:{itemType:h,item:f,sourceId:l,clientOffset:s||null,sourceClientOffset:u||null,isSourcePublic:!!i}}}}function rv(t,e,n){j(!e.isDragging(),"Cannot call beginDrag while dragging."),t.forEach(function(r){j(n.getSource(r),"Expected sourceIds to be registered.")})}function iv(t){j(typeof t=="function","When clientOffset is provided, getSourceClientOffset must be a function.")}function sv(t){j(wl(t),"Item must be an object.")}function ov(t,e){let n=null;for(let r=t.length-1;r>=0;r--)if(e.canDragSource(t[r])){n=t[r];break}return n}function av(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function cv(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable}))),r.forEach(function(i){av(t,i,n[i])})}return t}function lv(t){return function(n={}){const r=t.getMonitor(),i=t.getRegistry();uv(r),hv(r).forEach((o,a)=>{const c=dv(o,a,i,r),l={type:or,payload:{dropResult:cv({},n,c)}};t.dispatch(l)})}}function uv(t){j(t.isDragging(),"Cannot call drop while not dragging."),j(!t.didDrop(),"Cannot call drop twice during one drag operation.")}function dv(t,e,n,r){const i=n.getTarget(t);let s=i?i.drop(r,t):void 0;return fv(s),typeof s>"u"&&(s=e===0?{}:r.getDropResult()),s}function fv(t){j(typeof t>"u"||wl(t),"Drop result must either be an object or undefined.")}function hv(t){const e=t.getTargetIds().filter(t.canDropOnTarget,t);return e.reverse(),e}function pv(t){return function(){const n=t.getMonitor(),r=t.getRegistry();gv(n);const i=n.getSourceId();return i!=null&&(r.getSource(i,!0).endDrag(n,i),r.unpinSource()),{type:ar}}}function gv(t){j(t.isDragging(),"Cannot call endDrag while not dragging.")}function ai(t,e){return e===null?t===null:Array.isArray(t)?t.some(n=>n===e):t===e}function mv(t){return function(n,{clientOffset:r}={}){vv(n);const i=n.slice(0),s=t.getMonitor(),o=t.getRegistry(),a=s.getItemType();return xv(i,o,a),yv(i,s,o),bv(i,s,o),{type:sr,payload:{targetIds:i,clientOffset:r||null}}}}function vv(t){j(Array.isArray(t),"Expected targetIds to be an array.")}function yv(t,e,n){j(e.isDragging(),"Cannot call hover while not dragging."),j(!e.didDrop(),"Cannot call hover after drop.");for(let r=0;r<t.length;r++){const i=t[r];j(t.lastIndexOf(i)===r,"Expected targetIds to be unique in the passed array.");const s=n.getTarget(i);j(s,"Expected targetIds to be registered.")}}function xv(t,e,n){for(let r=t.length-1;r>=0;r--){const i=t[r],s=e.getTargetType(i);ai(s,n)||t.splice(r,1)}}function bv(t,e,n){t.forEach(function(r){n.getTarget(r).hover(e,r)})}function Tv(t){return function(){if(t.getMonitor().isDragging())return{type:os}}}function Sv(t){return{beginDrag:nv(t),publishDragSource:Tv(t),hover:mv(t),drop:lv(t),endDrag:pv(t)}}class wv{receiveBackend(e){this.backend=e}getMonitor(){return this.monitor}getBackend(){return this.backend}getRegistry(){return this.monitor.registry}getActions(){const e=this,{dispatch:n}=this.store;function r(s){return(...o)=>{const a=s.apply(e,o);typeof a<"u"&&n(a)}}const i=Sv(this);return Object.keys(i).reduce((s,o)=>{const a=i[o];return s[o]=r(a),s},{})}dispatch(e){this.store.dispatch(e)}constructor(e,n){this.isSetUp=!1,this.handleRefCountChange=()=>{const r=this.store.getState().refCount>0;this.backend&&(r&&!this.isSetUp?(this.backend.setup(),this.isSetUp=!0):!r&&this.isSetUp&&(this.backend.teardown(),this.isSetUp=!1))},this.store=e,this.monitor=n,e.subscribe(this.handleRefCountChange)}}function Cv(t,e){return{x:t.x+e.x,y:t.y+e.y}}function Cl(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Ev(t){const{clientOffset:e,initialClientOffset:n,initialSourceClientOffset:r}=t;return!e||!n||!r?null:Cl(Cv(e,r),n)}function Dv(t){const{clientOffset:e,initialClientOffset:n}=t;return!e||!n?null:Cl(e,n)}const Yt=[],as=[];Yt.__IS_NONE__=!0;as.__IS_ALL__=!0;function Pv(t,e){return t===Yt?!1:t===as||typeof e>"u"?!0:ev(e,t).length>0}class Ov{subscribeToStateChange(e,n={}){const{handlerIds:r}=n;j(typeof e=="function","listener must be a function."),j(typeof r>"u"||Array.isArray(r),"handlerIds, when specified, must be an array of strings.");let i=this.store.getState().stateId;const s=()=>{const o=this.store.getState(),a=o.stateId;try{a===i||a===i+1&&!Pv(o.dirtyHandlerIds,r)||e()}finally{i=a}};return this.store.subscribe(s)}subscribeToOffsetChange(e){j(typeof e=="function","listener must be a function.");let n=this.store.getState().dragOffset;const r=()=>{const i=this.store.getState().dragOffset;i!==n&&(n=i,e())};return this.store.subscribe(r)}canDragSource(e){if(!e)return!1;const n=this.registry.getSource(e);return j(n,`Expected to find a valid source. sourceId=${e}`),this.isDragging()?!1:n.canDrag(this,e)}canDropOnTarget(e){if(!e)return!1;const n=this.registry.getTarget(e);if(j(n,`Expected to find a valid target. targetId=${e}`),!this.isDragging()||this.didDrop())return!1;const r=this.registry.getTargetType(e),i=this.getItemType();return ai(r,i)&&n.canDrop(this,e)}isDragging(){return!!this.getItemType()}isDraggingSource(e){if(!e)return!1;const n=this.registry.getSource(e,!0);if(j(n,`Expected to find a valid source. sourceId=${e}`),!this.isDragging()||!this.isSourcePublic())return!1;const r=this.registry.getSourceType(e),i=this.getItemType();return r!==i?!1:n.isDragging(this,e)}isOverTarget(e,n={shallow:!1}){if(!e)return!1;const{shallow:r}=n;if(!this.isDragging())return!1;const i=this.registry.getTargetType(e),s=this.getItemType();if(s&&!ai(i,s))return!1;const o=this.getTargetIds();if(!o.length)return!1;const a=o.indexOf(e);return r?a===o.length-1:a>-1}getItemType(){return this.store.getState().dragOperation.itemType}getItem(){return this.store.getState().dragOperation.item}getSourceId(){return this.store.getState().dragOperation.sourceId}getTargetIds(){return this.store.getState().dragOperation.targetIds}getDropResult(){return this.store.getState().dragOperation.dropResult}didDrop(){return this.store.getState().dragOperation.didDrop}isSourcePublic(){return!!this.store.getState().dragOperation.isSourcePublic}getInitialClientOffset(){return this.store.getState().dragOffset.initialClientOffset}getInitialSourceClientOffset(){return this.store.getState().dragOffset.initialSourceClientOffset}getClientOffset(){return this.store.getState().dragOffset.clientOffset}getSourceClientOffset(){return Ev(this.store.getState().dragOffset)}getDifferenceFromInitialOffset(){return Dv(this.store.getState().dragOffset)}constructor(e,n){this.store=e,this.registry=n}}const ca=typeof global<"u"?global:self,El=ca.MutationObserver||ca.WebKitMutationObserver;function Dl(t){return function(){const n=setTimeout(i,0),r=setInterval(i,50);function i(){clearTimeout(n),clearInterval(r),t()}}}function Mv(t){let e=1;const n=new El(t),r=document.createTextNode("");return n.observe(r,{characterData:!0}),function(){e=-e,r.data=e}}const Iv=typeof El=="function"?Mv:Dl;class Rv{enqueueTask(e){const{queue:n,requestFlush:r}=this;n.length||(r(),this.flushing=!0),n[n.length]=e}constructor(){this.queue=[],this.pendingErrors=[],this.flushing=!1,this.index=0,this.capacity=1024,this.flush=()=>{const{queue:e}=this;for(;this.index<e.length;){const n=this.index;if(this.index++,e[n].call(),this.index>this.capacity){for(let r=0,i=e.length-this.index;r<i;r++)e[r]=e[r+this.index];e.length-=this.index,this.index=0}}e.length=0,this.index=0,this.flushing=!1},this.registerPendingError=e=>{this.pendingErrors.push(e),this.requestErrorThrow()},this.requestFlush=Iv(this.flush),this.requestErrorThrow=Dl(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}}class Av{call(){try{this.task&&this.task()}catch(e){this.onError(e)}finally{this.task=null,this.release(this)}}constructor(e,n){this.onError=e,this.release=n,this.task=null}}class Nv{create(e){const n=this.freeTasks,r=n.length?n.pop():new Av(this.onError,i=>n[n.length]=i);return r.task=e,r}constructor(e){this.onError=e,this.freeTasks=[]}}const Pl=new Rv,_v=new Nv(Pl.registerPendingError);function Lv(t){Pl.enqueueTask(_v.create(t))}const cs="dnd-core/ADD_SOURCE",ls="dnd-core/ADD_TARGET",us="dnd-core/REMOVE_SOURCE",cr="dnd-core/REMOVE_TARGET";function kv(t){return{type:cs,payload:{sourceId:t}}}function jv(t){return{type:ls,payload:{targetId:t}}}function Vv(t){return{type:us,payload:{sourceId:t}}}function Fv(t){return{type:cr,payload:{targetId:t}}}function Bv(t){j(typeof t.canDrag=="function","Expected canDrag to be a function."),j(typeof t.beginDrag=="function","Expected beginDrag to be a function."),j(typeof t.endDrag=="function","Expected endDrag to be a function.")}function $v(t){j(typeof t.canDrop=="function","Expected canDrop to be a function."),j(typeof t.hover=="function","Expected hover to be a function."),j(typeof t.drop=="function","Expected beginDrag to be a function.")}function ci(t,e){if(e&&Array.isArray(t)){t.forEach(n=>ci(n,!1));return}j(typeof t=="string"||typeof t=="symbol",e?"Type can only be a string, a symbol, or an array of either.":"Type can only be a string or a symbol.")}var Ce;(function(t){t.SOURCE="SOURCE",t.TARGET="TARGET"})(Ce||(Ce={}));let Uv=0;function Hv(){return Uv++}function zv(t){const e=Hv().toString();switch(t){case Ce.SOURCE:return`S${e}`;case Ce.TARGET:return`T${e}`;default:throw new Error(`Unknown Handler Role: ${t}`)}}function la(t){switch(t[0]){case"S":return Ce.SOURCE;case"T":return Ce.TARGET;default:throw new Error(`Cannot parse handler ID: ${t}`)}}function ua(t,e){const n=t.entries();let r=!1;do{const{done:i,value:[,s]}=n.next();if(s===e)return!0;r=!!i}while(!r);return!1}class Wv{addSource(e,n){ci(e),Bv(n);const r=this.addHandler(Ce.SOURCE,e,n);return this.store.dispatch(kv(r)),r}addTarget(e,n){ci(e,!0),$v(n);const r=this.addHandler(Ce.TARGET,e,n);return this.store.dispatch(jv(r)),r}containsHandler(e){return ua(this.dragSources,e)||ua(this.dropTargets,e)}getSource(e,n=!1){return j(this.isSourceId(e),"Expected a valid source ID."),n&&e===this.pinnedSourceId?this.pinnedSource:this.dragSources.get(e)}getTarget(e){return j(this.isTargetId(e),"Expected a valid target ID."),this.dropTargets.get(e)}getSourceType(e){return j(this.isSourceId(e),"Expected a valid source ID."),this.types.get(e)}getTargetType(e){return j(this.isTargetId(e),"Expected a valid target ID."),this.types.get(e)}isSourceId(e){return la(e)===Ce.SOURCE}isTargetId(e){return la(e)===Ce.TARGET}removeSource(e){j(this.getSource(e),"Expected an existing source."),this.store.dispatch(Vv(e)),Lv(()=>{this.dragSources.delete(e),this.types.delete(e)})}removeTarget(e){j(this.getTarget(e),"Expected an existing target."),this.store.dispatch(Fv(e)),this.dropTargets.delete(e),this.types.delete(e)}pinSource(e){const n=this.getSource(e);j(n,"Expected an existing source."),this.pinnedSourceId=e,this.pinnedSource=n}unpinSource(){j(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}addHandler(e,n,r){const i=zv(e);return this.types.set(i,n),e===Ce.SOURCE?this.dragSources.set(i,r):e===Ce.TARGET&&this.dropTargets.set(i,r),i}constructor(e){this.types=new Map,this.dragSources=new Map,this.dropTargets=new Map,this.pinnedSourceId=null,this.pinnedSource=null,this.store=e}}const Gv=(t,e)=>t===e;function Kv(t,e){return!t&&!e?!0:!t||!e?!1:t.x===e.x&&t.y===e.y}function Yv(t,e,n=Gv){if(t.length!==e.length)return!1;for(let r=0;r<t.length;++r)if(!n(t[r],e[r]))return!1;return!0}function Xv(t=Yt,e){switch(e.type){case sr:break;case cs:case ls:case cr:case us:return Yt;case ir:case os:case ar:case or:default:return as}const{targetIds:n=[],prevTargetIds:r=[]}=e.payload,i=Qm(n,r);if(!(i.length>0||!Yv(n,r)))return Yt;const o=r[r.length-1],a=n[n.length-1];return o!==a&&(o&&i.push(o),a&&i.push(a)),i}function qv(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Zv(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable}))),r.forEach(function(i){qv(t,i,n[i])})}return t}const da={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};function Jv(t=da,e){const{payload:n}=e;switch(e.type){case ss:case ir:return{initialSourceClientOffset:n.sourceClientOffset,initialClientOffset:n.clientOffset,clientOffset:n.clientOffset};case sr:return Kv(t.clientOffset,n.clientOffset)?t:Zv({},t,{clientOffset:n.clientOffset});case ar:case or:return da;default:return t}}function Qv(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function mt(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable}))),r.forEach(function(i){Qv(t,i,n[i])})}return t}const ey={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};function ty(t=ey,e){const{payload:n}=e;switch(e.type){case ir:return mt({},t,{itemType:n.itemType,item:n.item,sourceId:n.sourceId,isSourcePublic:n.isSourcePublic,dropResult:null,didDrop:!1});case os:return mt({},t,{isSourcePublic:!0});case sr:return mt({},t,{targetIds:n.targetIds});case cr:return t.targetIds.indexOf(n.targetId)===-1?t:mt({},t,{targetIds:Jm(t.targetIds,n.targetId)});case or:return mt({},t,{dropResult:n.dropResult,didDrop:!0,targetIds:[]});case ar:return mt({},t,{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return t}}function ny(t=0,e){switch(e.type){case cs:case ls:return t+1;case us:case cr:return t-1;default:return t}}function ry(t=0){return t+1}function iy(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function sy(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable}))),r.forEach(function(i){iy(t,i,n[i])})}return t}function oy(t={},e){return{dirtyHandlerIds:Xv(t.dirtyHandlerIds,{type:e.type,payload:sy({},e.payload,{prevTargetIds:Zm(t,"dragOperation.targetIds",[])})}),dragOffset:Jv(t.dragOffset,e),refCount:ny(t.refCount,e),dragOperation:ty(t.dragOperation,e),stateId:ry(t.stateId)}}function ay(t,e=void 0,n={},r=!1){const i=cy(r),s=new Ov(i,new Wv(i)),o=new wv(i,s),a=t(o,e,n);return o.receiveBackend(a),o}function cy(t){const e=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__;return Sl(oy,t&&e&&e({name:"dnd-core",instanceId:"dnd-core"}))}function ly(t,e){if(t==null)return{};var n=uy(t,e),r,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(i=0;i<s.length;i++)r=s[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function uy(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,s;for(s=0;s<r.length;s++)i=r[s],!(e.indexOf(i)>=0)&&(n[i]=t[i]);return n}let fa=0;const kn=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__");var dy=p.memo(function(e){var{children:n}=e,r=ly(e,["children"]);const[i,s]=fy(r);return p.useEffect(()=>{if(s){const o=Ol();return++fa,()=>{--fa===0&&(o[kn]=null)}}},[]),v.jsx(Tl.Provider,{value:i,children:n})});function fy(t){if("manager"in t)return[{dragDropManager:t.manager},!1];const e=hy(t.backend,t.context,t.options,t.debugMode),n=!t.context;return[e,n]}function hy(t,e=Ol(),n,r){const i=e;return i[kn]||(i[kn]={dragDropManager:ay(t,e,n,r)}),i[kn]}function Ol(){return typeof global<"u"?global:window}var py=ad();const gy=nd(py),ut=typeof window<"u"?p.useLayoutEffect:p.useEffect;function Ml(t,e,n){const[r,i]=p.useState(()=>e(t)),s=p.useCallback(()=>{const o=e(t);gy(r,o)||(i(o),n&&n())},[r,t,n]);return ut(s),[r,s]}function my(t,e,n){const[r,i]=Ml(t,e,n);return ut(function(){const o=t.getHandlerId();if(o!=null)return t.subscribeToStateChange(i,{handlerIds:[o]})},[t,i]),r}function Il(t,e,n){return my(e,t||(()=>({})),()=>n.reconnect())}function Rl(t,e){const n=[];return typeof t!="function"&&n.push(t),p.useMemo(()=>typeof t=="function"?t():t,n)}function vy(t){return p.useMemo(()=>t.hooks.dragSource(),[t])}function yy(t){return p.useMemo(()=>t.hooks.dragPreview(),[t])}let Nr=!1,_r=!1;class xy{receiveHandlerId(e){this.sourceId=e}getHandlerId(){return this.sourceId}canDrag(){j(!Nr,"You may not call monitor.canDrag() inside your canDrag() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return Nr=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{Nr=!1}}isDragging(){if(!this.sourceId)return!1;j(!_r,"You may not call monitor.isDragging() inside your isDragging() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return _r=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{_r=!1}}subscribeToStateChange(e,n){return this.internalMonitor.subscribeToStateChange(e,n)}isDraggingSource(e){return this.internalMonitor.isDraggingSource(e)}isOverTarget(e,n){return this.internalMonitor.isOverTarget(e,n)}getTargetIds(){return this.internalMonitor.getTargetIds()}isSourcePublic(){return this.internalMonitor.isSourcePublic()}getSourceId(){return this.internalMonitor.getSourceId()}subscribeToOffsetChange(e){return this.internalMonitor.subscribeToOffsetChange(e)}canDragSource(e){return this.internalMonitor.canDragSource(e)}canDropOnTarget(e){return this.internalMonitor.canDropOnTarget(e)}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(e){this.sourceId=null,this.internalMonitor=e.getMonitor()}}let Lr=!1;class by{receiveHandlerId(e){this.targetId=e}getHandlerId(){return this.targetId}subscribeToStateChange(e,n){return this.internalMonitor.subscribeToStateChange(e,n)}canDrop(){if(!this.targetId)return!1;j(!Lr,"You may not call monitor.canDrop() inside your canDrop() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target-monitor");try{return Lr=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{Lr=!1}}isOver(e){return this.targetId?this.internalMonitor.isOverTarget(this.targetId,e):!1}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(e){this.targetId=null,this.internalMonitor=e.getMonitor()}}function Ty(t,e,n){const r=n.getRegistry(),i=r.addTarget(t,e);return[i,()=>r.removeTarget(i)]}function Sy(t,e,n){const r=n.getRegistry(),i=r.addSource(t,e);return[i,()=>r.removeSource(i)]}function li(t,e,n,r){let i;if(i!==void 0)return!!i;if(t===e)return!0;if(typeof t!="object"||!t||typeof e!="object"||!e)return!1;const s=Object.keys(t),o=Object.keys(e);if(s.length!==o.length)return!1;const a=Object.prototype.hasOwnProperty.bind(e);for(let c=0;c<s.length;c++){const l=s[c];if(!a(l))return!1;const u=t[l],d=e[l];if(i=void 0,i===!1||i===void 0&&u!==d)return!1}return!0}function ui(t){return t!==null&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function wy(t){if(typeof t.type=="string")return;const e=t.type.displayName||t.type.name||"the component";throw new Error(`Only native element nodes can now be passed to React DnD connectors.You can either wrap ${e} into a <div>, or turn it into a drag source or a drop target itself.`)}function Cy(t){return(e=null,n=null)=>{if(!p.isValidElement(e)){const s=e;return t(s,n),s}const r=e;return wy(r),Ey(r,n?s=>t(s,n):t)}}function Al(t){const e={};return Object.keys(t).forEach(n=>{const r=t[n];if(n.endsWith("Ref"))e[n]=t[n];else{const i=Cy(r);e[n]=()=>i}}),e}function ha(t,e){typeof t=="function"?t(e):t.current=e}function Ey(t,e){const n=t.ref;return j(typeof n!="string","Cannot connect React DnD to an element with an existing string ref. Please convert it to use a callback ref instead, or wrap it into a <span> or <div>. Read more: https://reactjs.org/docs/refs-and-the-dom.html#callback-refs"),n?p.cloneElement(t,{ref:r=>{ha(n,r),ha(e,r)}}):p.cloneElement(t,{ref:e})}class Dy{receiveHandlerId(e){this.handlerId!==e&&(this.handlerId=e,this.reconnect())}get connectTarget(){return this.dragSource}get dragSourceOptions(){return this.dragSourceOptionsInternal}set dragSourceOptions(e){this.dragSourceOptionsInternal=e}get dragPreviewOptions(){return this.dragPreviewOptionsInternal}set dragPreviewOptions(e){this.dragPreviewOptionsInternal=e}reconnect(){const e=this.reconnectDragSource();this.reconnectDragPreview(e)}reconnectDragSource(){const e=this.dragSource,n=this.didHandlerIdChange()||this.didConnectedDragSourceChange()||this.didDragSourceOptionsChange();return n&&this.disconnectDragSource(),this.handlerId?e?(n&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragSource=e,this.lastConnectedDragSourceOptions=this.dragSourceOptions,this.dragSourceUnsubscribe=this.backend.connectDragSource(this.handlerId,e,this.dragSourceOptions)),n):(this.lastConnectedDragSource=e,n):n}reconnectDragPreview(e=!1){const n=this.dragPreview,r=e||this.didHandlerIdChange()||this.didConnectedDragPreviewChange()||this.didDragPreviewOptionsChange();if(r&&this.disconnectDragPreview(),!!this.handlerId){if(!n){this.lastConnectedDragPreview=n;return}r&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragPreview=n,this.lastConnectedDragPreviewOptions=this.dragPreviewOptions,this.dragPreviewUnsubscribe=this.backend.connectDragPreview(this.handlerId,n,this.dragPreviewOptions))}}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didConnectedDragSourceChange(){return this.lastConnectedDragSource!==this.dragSource}didConnectedDragPreviewChange(){return this.lastConnectedDragPreview!==this.dragPreview}didDragSourceOptionsChange(){return!li(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}didDragPreviewOptionsChange(){return!li(this.lastConnectedDragPreviewOptions,this.dragPreviewOptions)}disconnectDragSource(){this.dragSourceUnsubscribe&&(this.dragSourceUnsubscribe(),this.dragSourceUnsubscribe=void 0)}disconnectDragPreview(){this.dragPreviewUnsubscribe&&(this.dragPreviewUnsubscribe(),this.dragPreviewUnsubscribe=void 0,this.dragPreviewNode=null,this.dragPreviewRef=null)}get dragSource(){return this.dragSourceNode||this.dragSourceRef&&this.dragSourceRef.current}get dragPreview(){return this.dragPreviewNode||this.dragPreviewRef&&this.dragPreviewRef.current}clearDragSource(){this.dragSourceNode=null,this.dragSourceRef=null}clearDragPreview(){this.dragPreviewNode=null,this.dragPreviewRef=null}constructor(e){this.hooks=Al({dragSource:(n,r)=>{this.clearDragSource(),this.dragSourceOptions=r||null,ui(n)?this.dragSourceRef=n:this.dragSourceNode=n,this.reconnectDragSource()},dragPreview:(n,r)=>{this.clearDragPreview(),this.dragPreviewOptions=r||null,ui(n)?this.dragPreviewRef=n:this.dragPreviewNode=n,this.reconnectDragPreview()}}),this.handlerId=null,this.dragSourceRef=null,this.dragSourceOptionsInternal=null,this.dragPreviewRef=null,this.dragPreviewOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDragSource=null,this.lastConnectedDragSourceOptions=null,this.lastConnectedDragPreview=null,this.lastConnectedDragPreviewOptions=null,this.backend=e}}class Py{get connectTarget(){return this.dropTarget}reconnect(){const e=this.didHandlerIdChange()||this.didDropTargetChange()||this.didOptionsChange();e&&this.disconnectDropTarget();const n=this.dropTarget;if(this.handlerId){if(!n){this.lastConnectedDropTarget=n;return}e&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDropTarget=n,this.lastConnectedDropTargetOptions=this.dropTargetOptions,this.unsubscribeDropTarget=this.backend.connectDropTarget(this.handlerId,n,this.dropTargetOptions))}}receiveHandlerId(e){e!==this.handlerId&&(this.handlerId=e,this.reconnect())}get dropTargetOptions(){return this.dropTargetOptionsInternal}set dropTargetOptions(e){this.dropTargetOptionsInternal=e}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didDropTargetChange(){return this.lastConnectedDropTarget!==this.dropTarget}didOptionsChange(){return!li(this.lastConnectedDropTargetOptions,this.dropTargetOptions)}disconnectDropTarget(){this.unsubscribeDropTarget&&(this.unsubscribeDropTarget(),this.unsubscribeDropTarget=void 0)}get dropTarget(){return this.dropTargetNode||this.dropTargetRef&&this.dropTargetRef.current}clearDropTarget(){this.dropTargetRef=null,this.dropTargetNode=null}constructor(e){this.hooks=Al({dropTarget:(n,r)=>{this.clearDropTarget(),this.dropTargetOptions=r,ui(n)?this.dropTargetRef=n:this.dropTargetNode=n,this.reconnect()}}),this.handlerId=null,this.dropTargetRef=null,this.dropTargetOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDropTarget=null,this.lastConnectedDropTargetOptions=null,this.backend=e}}function Ve(){const{dragDropManager:t}=p.useContext(Tl);return j(t!=null,"Expected drag drop context"),t}function Oy(t,e){const n=Ve(),r=p.useMemo(()=>new Dy(n.getBackend()),[n]);return ut(()=>(r.dragSourceOptions=t||null,r.reconnect(),()=>r.disconnectDragSource()),[r,t]),ut(()=>(r.dragPreviewOptions=e||null,r.reconnect(),()=>r.disconnectDragPreview()),[r,e]),r}function My(){const t=Ve();return p.useMemo(()=>new xy(t),[t])}class Iy{beginDrag(){const e=this.spec,n=this.monitor;let r=null;return typeof e.item=="object"?r=e.item:typeof e.item=="function"?r=e.item(n):r={},r??null}canDrag(){const e=this.spec,n=this.monitor;return typeof e.canDrag=="boolean"?e.canDrag:typeof e.canDrag=="function"?e.canDrag(n):!0}isDragging(e,n){const r=this.spec,i=this.monitor,{isDragging:s}=r;return s?s(i):n===e.getSourceId()}endDrag(){const e=this.spec,n=this.monitor,r=this.connector,{end:i}=e;i&&i(n.getItem(),n),r.reconnect()}constructor(e,n,r){this.spec=e,this.monitor=n,this.connector=r}}function Ry(t,e,n){const r=p.useMemo(()=>new Iy(t,e,n),[e,n]);return p.useEffect(()=>{r.spec=t},[t]),r}function Ay(t){return p.useMemo(()=>{const e=t.type;return j(e!=null,"spec.type must be defined"),e},[t])}function Ny(t,e,n){const r=Ve(),i=Ry(t,e,n),s=Ay(t);ut(function(){if(s!=null){const[a,c]=Sy(s,i,r);return e.receiveHandlerId(a),n.receiveHandlerId(a),c}},[r,e,n,i,s])}function _y(t,e){const n=Rl(t);j(!n.begin,"useDrag::spec.begin was deprecated in v14. Replace spec.begin() with spec.item(). (see more here - https://react-dnd.github.io/react-dnd/docs/api/use-drag)");const r=My(),i=Oy(n.options,n.previewOptions);return Ny(n,r,i),[Il(n.collect,r,i),vy(i),yy(i)]}function Ly(t){const n=Ve().getMonitor(),[r,i]=Ml(n,t);return p.useEffect(()=>n.subscribeToOffsetChange(i)),p.useEffect(()=>n.subscribeToStateChange(i)),r}function ky(t){return p.useMemo(()=>t.hooks.dropTarget(),[t])}function jy(t){const e=Ve(),n=p.useMemo(()=>new Py(e.getBackend()),[e]);return ut(()=>(n.dropTargetOptions=t||null,n.reconnect(),()=>n.disconnectDropTarget()),[t]),n}function Vy(){const t=Ve();return p.useMemo(()=>new by(t),[t])}function Fy(t){const{accept:e}=t;return p.useMemo(()=>(j(t.accept!=null,"accept must be defined"),Array.isArray(e)?e:[e]),[e])}class By{canDrop(){const e=this.spec,n=this.monitor;return e.canDrop?e.canDrop(n.getItem(),n):!0}hover(){const e=this.spec,n=this.monitor;e.hover&&e.hover(n.getItem(),n)}drop(){const e=this.spec,n=this.monitor;if(e.drop)return e.drop(n.getItem(),n)}constructor(e,n){this.spec=e,this.monitor=n}}function $y(t,e){const n=p.useMemo(()=>new By(t,e),[e]);return p.useEffect(()=>{n.spec=t},[t]),n}function Uy(t,e,n){const r=Ve(),i=$y(t,e),s=Fy(t);ut(function(){const[a,c]=Ty(s,i,r);return e.receiveHandlerId(a),n.receiveHandlerId(a),c},[r,e,i,n,s.map(o=>o.toString()).join("|")])}function Nl(t,e){const n=Rl(t),r=Vy(),i=jy(n.options);return Uy(n,r,i),[Il(n.collect,r,i),ky(i)]}var _l=t=>{throw TypeError(t)},Ll=(t,e,n)=>e.has(t)||_l("Cannot "+n),k=(t,e,n)=>(Ll(t,e,"read from private field"),n?n.call(t):e.get(t)),Se=(t,e,n)=>e.has(t)?_l("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),it=(t,e,n,r)=>(Ll(t,e,"write to private field"),e.set(t,n),n),Ue,Hy=class{constructor(){Se(this,Ue),this.register=t=>{k(this,Ue).push(t)},this.unregister=t=>{for(;k(this,Ue).indexOf(t)!==-1;)k(this,Ue).splice(k(this,Ue).indexOf(t),1)},this.backendChanged=t=>{for(let e of k(this,Ue))e.backendChanged(t)},it(this,Ue,[])}};Ue=new WeakMap;var pe,Bt,ge,Ne,st,di,fi,hi,jn,Vn,$t,kl=class Fn{constructor(e,n,r){if(Se(this,pe),Se(this,Bt),Se(this,ge),Se(this,Ne),Se(this,st),Se(this,di,(i,s,o)=>{if(!o.backend)throw new Error(`You must specify a 'backend' property in your Backend entry: ${JSON.stringify(o)}`);let a=o.backend(i,s,o.options),c=o.id,l=!o.id&&a&&a.constructor;if(l&&(c=a.constructor.name),!c)throw new Error(`You must specify an 'id' property in your Backend entry: ${JSON.stringify(o)}
13
+ see this guide: https://github.com/louisbrunner/dnd-multi-backend/tree/master/packages/react-dnd-multi-backend#migrating-from-5xx`);if(l&&console.warn(`Deprecation notice: You are using a pipeline which doesn't include backends' 'id'.
14
+ This might be unsupported in the future, please specify 'id' explicitely for every backend.`),k(this,ge)[c])throw new Error(`You must specify a unique 'id' property in your Backend entry:
15
+ ${JSON.stringify(o)} (conflicts with: ${JSON.stringify(k(this,ge)[c])})`);return{id:c,instance:a,preview:o.preview??!1,transition:o.transition,skipDispatchOnTransition:o.skipDispatchOnTransition??!1}}),this.setup=()=>{if(!(typeof window>"u")){if(Fn.isSetUp)throw new Error("Cannot have two MultiBackends at the same time.");Fn.isSetUp=!0,k(this,fi).call(this,window),k(this,ge)[k(this,pe)].instance.setup()}},this.teardown=()=>{typeof window>"u"||(Fn.isSetUp=!1,k(this,hi).call(this,window),k(this,ge)[k(this,pe)].instance.teardown())},this.connectDragSource=(i,s,o)=>k(this,$t).call(this,"connectDragSource",i,s,o),this.connectDragPreview=(i,s,o)=>k(this,$t).call(this,"connectDragPreview",i,s,o),this.connectDropTarget=(i,s,o)=>k(this,$t).call(this,"connectDropTarget",i,s,o),this.profile=()=>k(this,ge)[k(this,pe)].instance.profile(),this.previewEnabled=()=>k(this,ge)[k(this,pe)].preview,this.previewsList=()=>k(this,Bt),this.backendsList=()=>k(this,Ne),Se(this,fi,i=>{for(let s of k(this,Ne))s.transition&&i.addEventListener(s.transition.event,k(this,jn))}),Se(this,hi,i=>{for(let s of k(this,Ne))s.transition&&i.removeEventListener(s.transition.event,k(this,jn))}),Se(this,jn,i=>{var o;let s=k(this,pe);if(k(this,Ne).some(a=>a.id!==k(this,pe)&&a.transition&&a.transition.check(i)?(it(this,pe,a.id),!0):!1),k(this,pe)!==s){k(this,ge)[s].instance.teardown();for(let[u,d]of Object.entries(k(this,st)))d.unsubscribe(),d.unsubscribe=k(this,Vn).call(this,d.func,...d.args);k(this,Bt).backendChanged(this);let a=k(this,ge)[k(this,pe)];if(a.instance.setup(),a.skipDispatchOnTransition)return;let c=i.constructor,l=new c(i.type,i);(o=i.target)==null||o.dispatchEvent(l)}}),Se(this,Vn,(i,s,o,a)=>k(this,ge)[k(this,pe)].instance[i](s,o,a)),Se(this,$t,(i,s,o,a)=>{let c=`${i}_${s}`,l=k(this,Vn).call(this,i,s,o,a);return k(this,st)[c]={func:i,args:[s,o,a],unsubscribe:l},()=>{k(this,st)[c].unsubscribe(),delete k(this,st)[c]}}),!r||!r.backends||r.backends.length<1)throw new Error(`You must specify at least one Backend, if you are coming from 2.x.x (or don't understand this error)
16
+ see this guide: https://github.com/louisbrunner/dnd-multi-backend/tree/master/packages/react-dnd-multi-backend#migrating-from-2xx`);it(this,Bt,new Hy),it(this,ge,{}),it(this,Ne,[]);for(let i of r.backends){let s=k(this,di).call(this,e,n,i);k(this,ge)[s.id]=s,k(this,Ne).push(s)}it(this,pe,k(this,Ne)[0].id),it(this,st,{})}};pe=new WeakMap,Bt=new WeakMap,ge=new WeakMap,Ne=new WeakMap,st=new WeakMap,di=new WeakMap,fi=new WeakMap,hi=new WeakMap,jn=new WeakMap,Vn=new WeakMap,$t=new WeakMap,kl.isSetUp=!1;var zy=kl,Wy=(t,e,n)=>new zy(t,e,n),jl=(t,e)=>({event:t,check:e}),Gy=jl("touchstart",t=>{let e=t;return e.touches!==null&&e.touches!==void 0}),Ky=jl("pointerdown",t=>t.pointerType==="mouse"),ze;(function(t){t.mouse="mouse",t.touch="touch",t.keyboard="keyboard"})(ze||(ze={}));class Yy{get delay(){var e;return(e=this.args.delay)!==null&&e!==void 0?e:0}get scrollAngleRanges(){return this.args.scrollAngleRanges}get getDropTargetElementsAtPoint(){return this.args.getDropTargetElementsAtPoint}get ignoreContextMenu(){var e;return(e=this.args.ignoreContextMenu)!==null&&e!==void 0?e:!1}get enableHoverOutsideTarget(){var e;return(e=this.args.enableHoverOutsideTarget)!==null&&e!==void 0?e:!1}get enableKeyboardEvents(){var e;return(e=this.args.enableKeyboardEvents)!==null&&e!==void 0?e:!1}get enableMouseEvents(){var e;return(e=this.args.enableMouseEvents)!==null&&e!==void 0?e:!1}get enableTouchEvents(){var e;return(e=this.args.enableTouchEvents)!==null&&e!==void 0?e:!0}get touchSlop(){return this.args.touchSlop||0}get delayTouchStart(){var e,n,r,i;return(i=(r=(e=this.args)===null||e===void 0?void 0:e.delayTouchStart)!==null&&r!==void 0?r:(n=this.args)===null||n===void 0?void 0:n.delay)!==null&&i!==void 0?i:0}get delayMouseStart(){var e,n,r,i;return(i=(r=(e=this.args)===null||e===void 0?void 0:e.delayMouseStart)!==null&&r!==void 0?r:(n=this.args)===null||n===void 0?void 0:n.delay)!==null&&i!==void 0?i:0}get window(){if(this.context&&this.context.window)return this.context.window;if(typeof window<"u")return window}get document(){var e;if(!((e=this.context)===null||e===void 0)&&e.document)return this.context.document;if(this.window)return this.window.document}get rootElement(){var e;return((e=this.args)===null||e===void 0?void 0:e.rootElement)||this.document}constructor(e,n){this.args=e,this.context=n}}function Xy(t,e,n,r){return Math.sqrt(Math.pow(Math.abs(n-t),2)+Math.pow(Math.abs(r-e),2))}function qy(t,e,n,r,i){if(!i)return!1;const s=Math.atan2(r-e,n-t)*180/Math.PI+180;for(let o=0;o<i.length;++o){const a=i[o];if(a&&(a.start==null||s>=a.start)&&(a.end==null||s<=a.end))return!0}return!1}const Zy={Left:1},Jy={Left:0};function kr(t){return t.button===void 0||t.button===Jy.Left}function Qy(t){return t.buttons===void 0||(t.buttons&Zy.Left)===0}function Vl(t){return!!t.targetTouches}const ex=1;function tx(t){const e=t.nodeType===ex?t:t.parentElement;if(!e)return;const{top:n,left:r}=e.getBoundingClientRect();return{x:r,y:n}}function nx(t,e){if(t.targetTouches.length===1)return Yn(t.targetTouches[0]);if(e&&t.touches.length===1&&t.touches[0].target===e.target)return Yn(t.touches[0])}function Yn(t,e){return Vl(t)?nx(t,e):{x:t.clientX,y:t.clientY}}const pa=(()=>{let t=!1;try{addEventListener("test",()=>{},Object.defineProperty({},"passive",{get(){return t=!0,!0}}))}catch{}return t})(),_t={[ze.mouse]:{start:"mousedown",move:"mousemove",end:"mouseup",contextmenu:"contextmenu"},[ze.touch]:{start:"touchstart",move:"touchmove",end:"touchend"},[ze.keyboard]:{keydown:"keydown"}};class Xt{profile(){var e;return{sourceNodes:this.sourceNodes.size,sourcePreviewNodes:this.sourcePreviewNodes.size,sourcePreviewNodeOptions:this.sourcePreviewNodeOptions.size,targetNodes:this.targetNodes.size,dragOverTargetIds:((e=this.dragOverTargetIds)===null||e===void 0?void 0:e.length)||0}}get document(){return this.options.document}setup(){const e=this.options.rootElement;e&&(j(!Xt.isSetUp,"Cannot have two Touch backends at the same time."),Xt.isSetUp=!0,this.addEventListener(e,"start",this.getTopMoveStartHandler()),this.addEventListener(e,"start",this.handleTopMoveStartCapture,!0),this.addEventListener(e,"move",this.handleTopMove),this.addEventListener(e,"move",this.handleTopMoveCapture,!0),this.addEventListener(e,"end",this.handleTopMoveEndCapture,!0),this.options.enableMouseEvents&&!this.options.ignoreContextMenu&&this.addEventListener(e,"contextmenu",this.handleTopMoveEndCapture),this.options.enableKeyboardEvents&&this.addEventListener(e,"keydown",this.handleCancelOnEscape,!0))}teardown(){const e=this.options.rootElement;e&&(Xt.isSetUp=!1,this._mouseClientOffset={},this.removeEventListener(e,"start",this.handleTopMoveStartCapture,!0),this.removeEventListener(e,"start",this.handleTopMoveStart),this.removeEventListener(e,"move",this.handleTopMoveCapture,!0),this.removeEventListener(e,"move",this.handleTopMove),this.removeEventListener(e,"end",this.handleTopMoveEndCapture,!0),this.options.enableMouseEvents&&!this.options.ignoreContextMenu&&this.removeEventListener(e,"contextmenu",this.handleTopMoveEndCapture),this.options.enableKeyboardEvents&&this.removeEventListener(e,"keydown",this.handleCancelOnEscape,!0),this.uninstallSourceNodeRemovalObserver())}addEventListener(e,n,r,i=!1){const s=pa?{capture:i,passive:!1}:i;this.listenerTypes.forEach(function(o){const a=_t[o][n];a&&e.addEventListener(a,r,s)})}removeEventListener(e,n,r,i=!1){const s=pa?{capture:i,passive:!1}:i;this.listenerTypes.forEach(function(o){const a=_t[o][n];a&&e.removeEventListener(a,r,s)})}connectDragSource(e,n){const r=this.handleMoveStart.bind(this,e);return this.sourceNodes.set(e,n),this.addEventListener(n,"start",r),()=>{this.sourceNodes.delete(e),this.removeEventListener(n,"start",r)}}connectDragPreview(e,n,r){return this.sourcePreviewNodeOptions.set(e,r),this.sourcePreviewNodes.set(e,n),()=>{this.sourcePreviewNodes.delete(e),this.sourcePreviewNodeOptions.delete(e)}}connectDropTarget(e,n){const r=this.options.rootElement;if(!this.document||!r)return()=>{};const i=s=>{if(!this.document||!r||!this.monitor.isDragging())return;let o;switch(s.type){case _t.mouse.move:o={x:s.clientX,y:s.clientY};break;case _t.touch.move:var a,c;o={x:((a=s.touches[0])===null||a===void 0?void 0:a.clientX)||0,y:((c=s.touches[0])===null||c===void 0?void 0:c.clientY)||0};break}const l=o!=null?this.document.elementFromPoint(o.x,o.y):void 0,u=l&&n.contains(l);if(l===n||u)return this.handleMove(s,e)};return this.addEventListener(this.document.body,"move",i),this.targetNodes.set(e,n),()=>{this.document&&(this.targetNodes.delete(e),this.removeEventListener(this.document.body,"move",i))}}getTopMoveStartHandler(){return!this.options.delayTouchStart&&!this.options.delayMouseStart?this.handleTopMoveStart:this.handleTopMoveStartDelay}installSourceNodeRemovalObserver(e){this.uninstallSourceNodeRemovalObserver(),this.draggedSourceNode=e,this.draggedSourceNodeRemovalObserver=new MutationObserver(()=>{e&&!e.parentElement&&(this.resurrectSourceNode(),this.uninstallSourceNodeRemovalObserver())}),!(!e||!e.parentElement)&&this.draggedSourceNodeRemovalObserver.observe(e.parentElement,{childList:!0})}resurrectSourceNode(){this.document&&this.draggedSourceNode&&(this.draggedSourceNode.style.display="none",this.draggedSourceNode.removeAttribute("data-reactid"),this.document.body.appendChild(this.draggedSourceNode))}uninstallSourceNodeRemovalObserver(){this.draggedSourceNodeRemovalObserver&&this.draggedSourceNodeRemovalObserver.disconnect(),this.draggedSourceNodeRemovalObserver=void 0,this.draggedSourceNode=void 0}constructor(e,n,r){this.getSourceClientOffset=i=>{const s=this.sourceNodes.get(i);return s&&tx(s)},this.handleTopMoveStartCapture=i=>{kr(i)&&(this.moveStartSourceIds=[])},this.handleMoveStart=i=>{Array.isArray(this.moveStartSourceIds)&&this.moveStartSourceIds.unshift(i)},this.handleTopMoveStart=i=>{if(!kr(i))return;const s=Yn(i);s&&(Vl(i)&&(this.lastTargetTouchFallback=i.targetTouches[0]),this._mouseClientOffset=s),this.waitingForDelay=!1},this.handleTopMoveStartDelay=i=>{if(!kr(i))return;const s=i.type===_t.touch.start?this.options.delayTouchStart:this.options.delayMouseStart;this.timeout=setTimeout(this.handleTopMoveStart.bind(this,i),s),this.waitingForDelay=!0},this.handleTopMoveCapture=()=>{this.dragOverTargetIds=[]},this.handleMove=(i,s)=>{this.dragOverTargetIds&&this.dragOverTargetIds.unshift(s)},this.handleTopMove=i=>{if(this.timeout&&clearTimeout(this.timeout),!this.document||this.waitingForDelay)return;const{moveStartSourceIds:s,dragOverTargetIds:o}=this,a=this.options.enableHoverOutsideTarget,c=Yn(i,this.lastTargetTouchFallback);if(!c)return;if(this._isScrolling||!this.monitor.isDragging()&&qy(this._mouseClientOffset.x||0,this._mouseClientOffset.y||0,c.x,c.y,this.options.scrollAngleRanges)){this._isScrolling=!0;return}if(!this.monitor.isDragging()&&this._mouseClientOffset.hasOwnProperty("x")&&s&&Xy(this._mouseClientOffset.x||0,this._mouseClientOffset.y||0,c.x,c.y)>(this.options.touchSlop?this.options.touchSlop:0)&&(this.moveStartSourceIds=void 0,this.actions.beginDrag(s,{clientOffset:this._mouseClientOffset,getSourceClientOffset:this.getSourceClientOffset,publishSource:!1})),!this.monitor.isDragging())return;const l=this.sourceNodes.get(this.monitor.getSourceId());this.installSourceNodeRemovalObserver(l),this.actions.publishDragSource(),i.cancelable&&i.preventDefault();const u=(o||[]).map(m=>this.targetNodes.get(m)).filter(m=>!!m),d=this.options.getDropTargetElementsAtPoint?this.options.getDropTargetElementsAtPoint(c.x,c.y,u):this.document.elementsFromPoint(c.x,c.y),f=[];for(const m in d){if(!d.hasOwnProperty(m))continue;let g=d[m];for(g!=null&&f.push(g);g;)g=g.parentElement,g&&f.indexOf(g)===-1&&f.push(g)}const h=f.filter(m=>u.indexOf(m)>-1).map(m=>this._getDropTargetId(m)).filter(m=>!!m).filter((m,g,y)=>y.indexOf(m)===g);if(a)for(const m in this.targetNodes){const g=this.targetNodes.get(m);if(l&&g&&g.contains(l)&&h.indexOf(m)===-1){h.unshift(m);break}}h.reverse(),this.actions.hover(h,{clientOffset:c})},this._getDropTargetId=i=>{const s=this.targetNodes.keys();let o=s.next();for(;o.done===!1;){const a=o.value;if(i===this.targetNodes.get(a))return a;o=s.next()}},this.handleTopMoveEndCapture=i=>{if(this._isScrolling=!1,this.lastTargetTouchFallback=void 0,!!Qy(i)){if(!this.monitor.isDragging()||this.monitor.didDrop()){this.moveStartSourceIds=void 0;return}i.cancelable&&i.preventDefault(),this._mouseClientOffset={},this.uninstallSourceNodeRemovalObserver(),this.actions.drop(),this.actions.endDrag()}},this.handleCancelOnEscape=i=>{i.key==="Escape"&&this.monitor.isDragging()&&(this._mouseClientOffset={},this.uninstallSourceNodeRemovalObserver(),this.actions.endDrag())},this.options=new Yy(r,n),this.actions=e.getActions(),this.monitor=e.getMonitor(),this.sourceNodes=new Map,this.sourcePreviewNodes=new Map,this.sourcePreviewNodeOptions=new Map,this.targetNodes=new Map,this.listenerTypes=[],this._mouseClientOffset={},this._isScrolling=!1,this.options.enableMouseEvents&&this.listenerTypes.push(ze.mouse),this.options.enableTouchEvents&&this.listenerTypes.push(ze.touch),this.options.enableKeyboardEvents&&this.listenerTypes.push(ze.keyboard)}}const rx=function(e,n={},r={}){return new Xt(e,n,r)};var De=function(){return De=Object.assign||function(e){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},De.apply(this,arguments)};function ce(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,s;r<i;r++)(s||!(r in e))&&(s||(s=Array.prototype.slice.call(e,0,r)),s[r]=e[r]);return t.concat(s||Array.prototype.slice.call(e))}function ix(t){var e=t.isVisible,n=t.ease,r=n===void 0?"easeIn":n,i=t.duration,s=t.variants,o=s===void 0?{open:{opacity:1,height:"auto"},close:{opacity:0,height:0}}:s,a=t.children,c=zm({polyfill:vf}),l=c[0],u=c[1].height,d=p.useState(e),f=d[0],h=d[1],m=p.useState(e),g=m[0],y=m[1],x=p.useState(!1),b=x[0],T=x[1],S=function(){T(!1),e||h(!1)};p.useEffect(function(){T(!0),e?h(!0):y(!1)},[e]);var C=u===0;return p.useEffect(function(){f&&y(!0)},[C]),H.createElement(Hm.div,{style:b?{overflow:"hidden"}:void 0,onAnimationComplete:S,initial:g?"open":"close",animate:g?"open":"close",inherit:!1,variants:o,transition:{ease:r,duration:sx(u,i)}},H.createElement("div",{ref:l},f&&a))}function sx(t,e){if(e)return e;if(!t)return 0;var n=t/36;return Math.round((4+10*Math.pow(n,.25)+n/5)*10)/1500}var Fl=p.createContext({}),ox={isLock:!1},ax=function(t){var e=p.useState(ox.isLock),n=e[0],r=e[1];return H.createElement(Fl.Provider,{value:{isLock:n,lock:function(){return r(!0)},unlock:function(){return r(!1)}}},t.children)},un=p.createContext({}),Pn={dropTargetId:void 0,index:void 0},cx=function(t){var e=p.useState(Pn.dropTargetId),n=e[0],r=e[1],i=p.useState(Pn.index),s=i[0],o=i[1],a=function(l,u){r(l),o(u)},c=function(){r(Pn.dropTargetId),o(Pn.index)};return H.createElement(un.Provider,{value:{dropTargetId:n,index:s,showPlaceholder:a,hidePlaceholder:c}},t.children)},lx=function(t,e){return t.text>e.text?1:t.text<e.text?-1:0},Lt=function(t,e){return t.find(function(n){return n.id===e})},Bl=function(t,e,n){if(n===0)return!1;var r=t.find(function(i){return i.id===n});return r===void 0?!1:r.parent===e?!0:Bl(t,e,r.parent)},ds=function(t){return typeof t=="object"&&t!==null&&"id"in t&&"parent"in t&&"text"in t},Ke=function(t,e,n){var r=n.tree,i=n.rootId,s=n.canDrop;if(t===null){if(e===i)return!0;var o=r.find(function(u){return u.id===e});return!!(o&&o.droppable)}else{var a=ds(t)?t.id:null;if(s){var c=s(a,e);if(c!==void 0)return c}if(a===e)return!1;var l=r.find(function(d){return d.id===a}),o=r.find(function(d){return d.id===e});return l===void 0||a===null?e===i||!!(o!=null&&o.droppable):o===void 0?l.parent!==0:l.parent===e||!o.droppable?!1:!Bl(r,a,e)}},ux=function(t,e,n){return t.map(function(r){return r.id===e?De(De({},r),{parent:n}):r})},$l=function(t,e,n){if(n===0)return 0;var r=t.filter(function(i){return i.parent===e});return r[n]?t.findIndex(function(i){return i.id===r[n].id}):t.findIndex(function(i){return i.id===r[n-1].id})+1},dx=function(t,e){return t.findIndex(function(n){return n.id===e})},Ul=function(t,e,n,r){var i=dx(t,e),s=$l(t,n,r);return s=s>i?s-1:s,[i,s]},fx=function(t,e,n){var r=e<0?t.length+e:e;if(r>=0&&r<t.length){var i=n<0?t.length+n:n,s=t.splice(e,1)[0];t.splice(i,0,s)}},hx=function(t,e,n,r){var i=Ul(t,e,n,r),s=i[0],o=i[1],a=ce([],t,!0);return fx(a,s,o),a.map(function(c){return c.id===e?De(De({},c),{parent:n}):c})},px=function(t,e){var n=t.getBoundingClientRect(),r=n.top+n.height/2;return e>r?"down":"up"},pi=function(t,e){var n="",r=0;return t.forEach(function(i,s){var o,a=px(i,((o=e.getClientOffset())===null||o===void 0?void 0:o.y)||0);n===""?n=a:n!==a&&(n=a,r=s),s===t.length-1&&a==="down"&&(r=s+1)}),r},ga=function(t,e,n){var r=e.closest('[role="list"]'),i=r==null?void 0:r.querySelectorAll(':scope > [role="listitem"]');return i?pi(i,n):null},gx=function(t,e,n){var r=t.getBoundingClientRect(),i=n.dropTargetOffset;if(i===0)return"middle";var s=r.top+i,o=r.bottom-i;return e>o?"lower":e<s?"upper":"middle"},gi=function(t,e,n,r){var i;if(!e)return null;if(t===null){var s=e.querySelectorAll(':scope > [role="listitem"]');return{id:r.rootId,index:pi(s,n)}}var o=n.getItem(),a=e.querySelector('[role="list"]'),c=gx(e,((i=n.getClientOffset())===null||i===void 0?void 0:i.y)||0,r);if(a){if(c==="upper")if(Ke(o,t.parent,r)){var l=ga(t,e,n);return l===null?null:{id:t.parent,index:l}}else return{id:t.id,index:0};var s=a.querySelectorAll(':scope > [role="listitem"]');return{id:t.id,index:pi(s,n)}}else{if(c==="middle")return{id:t.id,index:0};if(Ke(o,t.parent,r)){var l=ga(t,e,n);return l===null?null:{id:t.parent,index:l}}return null}},mx=function(t){return t===void 0&&(t={}),{backends:[{id:"html5",backend:Xd,options:t.html5,transition:Ky},{id:"touch",backend:rx,options:t.touch||{enableMouseEvents:!0},preview:!0,transition:Gy}]}},Bn=function(t,e){return t.some(function(n){return n.parent===e})},Hl=p.createContext({}),vx=function(t){var e=wx(t.tree,t.initialOpen),n=e[0],r=e[1],i=r.handleToggle,s=r.handleCloseAll,o=r.handleOpenAll,a=r.handleOpen,c=r.handleClose;p.useImperativeHandle(t.treeRef,function(){return{open:function(h){return a(h,t.onChangeOpen)},close:function(h){return c(h,t.onChangeOpen)},openAll:function(){return o(t.onChangeOpen)},closeAll:function(){return s(t.onChangeOpen)}}});var l=Ve().getMonitor(),u=t.canDrop,d=t.canDrag,f=De(De({extraAcceptTypes:[],listComponent:"ul",listItemComponent:"li",placeholderComponent:"li",sort:!0,insertDroppableFirst:!0,enableAnimateExpand:!1,dropTargetOffset:0,initialOpen:!1},t),{openIds:n,onDrop:function(h,m,g){if(h){var y={dragSourceId:h.id,dropTargetId:m,dragSource:h,dropTarget:Lt(t.tree,m),monitor:l},x=t.tree;if(Lt(x,h.id)||(x=ce(ce([],x,!0),[h],!1)),t.sort===!1){var b=Ul(x,h.id,m,g),T=b[1];y.destinationIndex=T,y.relativeIndex=g,t.onDrop(hx(x,h.id,m,g),y);return}t.onDrop(ux(x,h.id,m),y)}else{var y={dropTargetId:m,dropTarget:Lt(t.tree,m),monitor:l};t.sort===!1&&(y.destinationIndex=$l(t.tree,m,g),y.relativeIndex=g),t.onDrop(t.tree,y)}},canDrop:u?function(h,m){return u(t.tree,{dragSourceId:h??void 0,dropTargetId:m,dragSource:l.getItem(),dropTarget:Lt(t.tree,m),monitor:l})}:void 0,canDrag:d?function(h){return d(Lt(t.tree,h))}:void 0,onToggle:function(h){return i(h,t.onChangeOpen)}});return H.createElement(Hl.Provider,{value:f},t.children)},yx=function(t){return H.createElement(vx,De({},t),H.createElement(ax,null,H.createElement(cx,null,t.children)))},xx=function(t){var e=p.useContext(Fl);p.useEffect(function(){if(t.current){var n=t.current,r=function(u){var d=u.target;(d instanceof HTMLInputElement||d instanceof HTMLTextAreaElement)&&e.lock()},i=function(u){var d=u.target;(d instanceof HTMLInputElement||d instanceof HTMLTextAreaElement)&&e.unlock()},s=function(u){return r(u)},o=function(u){return i(u)},a=function(u){return r(u)},c=function(u){return i(u)},l=new MutationObserver(function(){document.activeElement===document.body&&e.unlock()});return l.observe(n,{subtree:!0,childList:!0}),n.addEventListener("mouseover",s),n.addEventListener("mouseout",o),n.addEventListener("focusin",a),n.addEventListener("focusout",c),function(){l.disconnect(),n.removeEventListener("mouseover",s),n.removeEventListener("mouseout",o),n.removeEventListener("focusin",a),n.removeEventListener("focusout",c)}}},[t,e]),p.useEffect(function(){var n;(n=t.current)===null||n===void 0||n.setAttribute("draggable",e.isLock?"false":"true")},[t,e.isLock])},lr={TREE_ITEM:Symbol()},zl=null,Wl=function(t){var e=t.target;if(e instanceof HTMLElement){var n=e.closest('[role="listitem"]');t.currentTarget===n&&(zl=n)}},ma=function(t){return Wl(t)},va=function(t){return Wl(t)},bx=function(t,e){var n=Xe();p.useEffect(function(){var a=e.current;return a==null||a.addEventListener("dragstart",ma),a==null||a.addEventListener("touchstart",va,{passive:!0}),function(){a==null||a.removeEventListener("dragstart",ma),a==null||a.removeEventListener("touchstart",va)}},[e]);var r=_y({type:lr.TREE_ITEM,item:function(a){var c=De({ref:e},t);return n.onDragStart&&n.onDragStart(c,a),c},end:function(a,c){var l=a;n.onDragEnd&&n.onDragEnd(l,c)},canDrag:function(){var a=n.canDrag;return zl!==e.current?!1:a?a(t.id):!0},collect:function(a){return{isDragging:a.isDragging()}}}),i=r[0].isDragging,s=r[1],o=r[2];return[i,s,o]},Tx=function(t){var e=Xe(),n=p.useContext(un),r=Nl({accept:ce([lr.TREE_ITEM],e.extraAcceptTypes,!0),drop:function(c,l){var u=e.rootId,d=e.onDrop,f=n.dropTargetId,h=n.index;l.isOver({shallow:!0})&&f!==void 0&&h!==void 0&&d(ds(c)?c:null,u,h),n.hidePlaceholder()},canDrop:function(c,l){var u=e.rootId;return l.isOver({shallow:!0})?c===void 0?!1:Ke(c,u,e):!1},hover:function(c,l){if(l.isOver({shallow:!0})){var u=e.rootId,d=n.dropTargetId,f=n.index,h=n.showPlaceholder,m=n.hidePlaceholder,g=gi(null,t.current,l,e);if(g===null||!Ke(c,u,e)){m();return}(g.id!==d||g.index!==f)&&h(g.id,g.index)}},collect:function(c){var l=c.getItem();return{isOver:c.isOver({shallow:!0})&&c.canDrop(),dragSource:l}}}),i=r[0],s=i.isOver,o=i.dragSource,a=r[1];return[s,o,a]},Sx=function(t,e){var n=Xe(),r=p.useContext(un),i=Nl({accept:ce([lr.TREE_ITEM],n.extraAcceptTypes,!0),drop:function(l,u){var d=r.dropTargetId,f=r.index;u.isOver({shallow:!0})&&d!==void 0&&f!==void 0&&n.onDrop(ds(l)?l:null,d,f),r.hidePlaceholder()},canDrop:function(l,u){if(u.isOver({shallow:!0})){var d=gi(t,e.current,u,n);return d===null?!1:Ke(l,d.id,n)}return!1},hover:function(l,u){if(u.isOver({shallow:!0})){var d=r.dropTargetId,f=r.index,h=r.showPlaceholder,m=r.hidePlaceholder,g=gi(t,e.current,u,n);if(g===null||!Ke(l,g.id,n)){m();return}(g.id!==d||g.index!==f)&&h(g.id,g.index)}},collect:function(l){var u=l.getItem();return{isOver:l.isOver({shallow:!0})&&l.canDrop(),dragSource:u}}}),s=i[0],o=s.isOver,a=s.dragSource,c=i[1];return[o,a,c]},wx=function(t,e){var n=p.useMemo(function(){return e===!0?t.filter(function(d){return Bn(t,d.id)}).map(function(d){return d.id}):Array.isArray(e)?e:[]},[e]),r=p.useState(n),i=r[0],s=r[1];p.useEffect(function(){return s(n)},[n]);var o=function(d,f){var h=i.includes(d)?i.filter(function(m){return m!==d}):ce(ce([],i,!0),[d],!1);s(h),f&&f(h)},a=function(d){s([]),d&&d([])},c=function(d){var f=t.filter(function(h){return Bn(t,h.id)}).map(function(h){return h.id});s(f),d&&d(f)},l=function(d,f){var h=[];if(Array.isArray(d)){var m=t.filter(function(g){return d.includes(g.id)&&Bn(t,g.id)});h=ce(ce([],i,!0),m.map(function(g){return g.id}),!0).filter(function(g,y,x){return x.indexOf(g)===y})}else h=i.includes(d)?i:ce(ce([],i,!0),[d],!1);s(h),f&&f(h)},u=function(d,f){var h=i.filter(function(m){return Array.isArray(d)?!d.includes(m):m!==d});s(h),f&&f(h)};return[i,{handleToggle:o,handleCloseAll:a,handleOpenAll:c,handleOpen:l,handleClose:u}]},Cx=function(){return Ly(function(t){var e=t.getItemType();return{item:t.getItem(),clientOffset:t.getClientOffset(),isDragging:t.isDragging()&&e===lr.TREE_ITEM}})},Xe=function(){var t=p.useContext(Hl);if(!t)throw new Error("useTreeContext must be used under TreeProvider");return t},Ex=function(t,e){var n=Xe(),r=n.rootId,i=n.rootProps,s=n.classes,o=(s==null?void 0:s.container)||"";return e&&(s!=null&&s.dropTarget)&&(o="".concat(o," ").concat(s.dropTarget)),t===r&&(s!=null&&s.root)&&(o="".concat(o," ").concat(s.root)),t===r&&(i!=null&&i.className)&&(o="".concat(o," ").concat(i.className)),o=o.trim(),o},Dx=function(t,e,n){e.current?n(e):n(t),p.useEffect(function(){e.current?n(e):n(t)},[e.current])},Px=function(t){var e=Xe(),n=p.useContext(un),r=p.useRef(null),i=p.useRef(null),s=e.tree.find(function(E){return E.id===t.id}),o=e.openIds,a=e.classes,c=e.enableAnimateExpand,l=o.includes(t.id),u=bx(s,r),d=u[0],f=u[1],h=u[2],m=Sx(s,r),g=m[0],y=m[1],x=m[2];Dx(r,i,f),Ke(y,t.id,e)&&x(r),p.useEffect(function(){e.dragPreviewRender?h(Yd(),{captureDraggingState:!0}):i.current&&h(r)},[h,e.dragPreviewRender]),xx(r);var b=function(){return e.onToggle(s.id)},T=e.listItemComponent,S=e.canDrag?e.canDrag(t.id):!0,C=n.dropTargetId===t.id,P={depth:t.depth,isOpen:l,isDragging:d,isDropTarget:C,draggable:S,hasChild:Bn(e.tree,t.id),containerRef:r,handleRef:i,onToggle:b},D="";return a!=null&&a.listItem&&(D=typeof a.listItem=="string"?a.listItem:a.listItem(s,P)),g&&(a!=null&&a.dropTarget)&&(D="".concat(D," ").concat(a.dropTarget)),d&&(a!=null&&a.draggingSource)&&(D="".concat(D," ").concat(a.draggingSource)),H.createElement(T,{ref:r,className:D,role:"listitem"},e.render(s,P),c&&P.hasChild&&H.createElement(ix,{isVisible:l},H.createElement(mi,{parentId:t.id,depth:t.depth+1})),!c&&P.hasChild&&l&&H.createElement(mi,{parentId:t.id,depth:t.depth+1}))},ya=function(t){var e=Xe(),n=e.placeholderRender,r=e.placeholderComponent,i=e.classes,s=p.useContext(un),o=Ve(),a=o.getMonitor(),c=a.getItem();if(!n||!c)return null;var l=t.dropTargetId===s.dropTargetId&&(t.index===s.index||t.index===void 0&&t.listCount===s.index),u=a.getTargetIds();return!l||!u.length?null:H.createElement(r,{className:(i==null?void 0:i.placeholder)||""},n(c,{depth:t.depth}))},mi=function(t){var e=Xe(),n=p.useRef(null),r=e.tree.filter(function(g){return g.parent===t.parentId}),i=r,s=typeof e.sort=="function"?e.sort:lx;if(e.insertDroppableFirst){var o=r.filter(function(g){return g.droppable}),a=r.filter(function(g){return!g.droppable});e.sort===!1?i=ce(ce([],o,!0),a,!0):(o=o.sort(s),a=a.sort(s),i=ce(ce([],o,!0),a,!0))}else e.sort!==!1&&(i=r.sort(s));var c=Tx(n),l=c[0],u=c[1],d=c[2];t.parentId===e.rootId&&Ke(u,e.rootId,e)&&d(n);var f=Ex(t.parentId,l),h=e.rootProps||{},m=e.listComponent;return H.createElement(m,De({ref:n,role:"list"},h,{className:f}),i.map(function(g,y){return H.createElement(H.Fragment,{key:g.id},H.createElement(ya,{depth:t.depth,listCount:i.length,dropTargetId:t.parentId,index:y}),H.createElement(Px,{id:g.id,depth:t.depth}))}),H.createElement(ya,{depth:t.depth,listCount:i.length,dropTargetId:t.parentId}))},Ox={height:"100%",left:0,pointerEvents:"none",position:"fixed",top:0,width:"100%",zIndex:100},Mx=function(t){var e=t.clientOffset;if(!e)return{};var n=e.x,r=e.y,i="translate(".concat(n,"px, ").concat(r,"px)");return{pointerEvents:"none",transform:i}},Ix=function(){var t=Xe(),e=Cx(),n=e.isDragging,r=e.clientOffset;return!n||!r?null:H.createElement("div",{style:Ox},H.createElement("div",{style:Mx(e)},t.dragPreviewRender&&t.dragPreviewRender(e)))};function Rx(t,e){return H.createElement(yx,De({},t,{treeRef:e}),t.dragPreviewRender&&H.createElement(Ix,null),H.createElement(mi,{parentId:t.rootId,depth:0}))}var Ax=p.forwardRef(Rx);const Nx="_root_71whx_1",_x="_isSelected_71whx_10",Lx="_expandIconWrapper_71whx_13",kx="_isOpen_71whx_25",jx="_labelGridItem_71whx_29",kt={root:Nx,isSelected:_x,expandIconWrapper:Lx,isOpen:kx,labelGridItem:jx},Vx=t=>{var x;const e=Oe.c(26),n=t.depth*24;let r;e[0]!==t?(r=b=>{b.stopPropagation(),t.onToggle(t.node.id)},e[0]=t,e[1]=r):r=e[1];const i=r;let s;e[2]!==t?(s=()=>t.onSelect(t.node),e[2]=t,e[3]=s):s=e[3];const o=s,a=`tree-node ${kt.root} ${t.isSelected?kt.isSelected:""}`;let c;e[4]!==n?(c={paddingInlineStart:n},e[4]=n,e[5]=c):c=e[5];const l=`${kt.expandIconWrapper} ${t.isOpen?kt.isOpen:""}`;let u;e[6]!==i||e[7]!==t.node.droppable?(u=t.node.droppable&&v.jsx("div",{onClick:i,children:v.jsx(ld,{size:18})}),e[6]=i,e[7]=t.node.droppable,e[8]=u):u=e[8];let d;e[9]!==l||e[10]!==u?(d=v.jsx("div",{className:l,children:u}),e[9]=l,e[10]=u,e[11]=d):d=e[11];const f=((x=t.node.data)==null?void 0:x.icon)??"folder";let h;e[12]!==f?(h=v.jsx(Ei,{name:f}),e[12]=f,e[13]=h):h=e[13];let m;e[14]!==t.node.text?(m=v.jsx("div",{className:kt.labelGridItem,children:v.jsx("span",{children:t.node.text})}),e[14]=t.node.text,e[15]=m):m=e[15];let g;e[16]!==t.loading?(g=t.loading&&v.jsx(wt,{className:"size-4 animate-spin"}),e[16]=t.loading,e[17]=g):g=e[17];let y;return e[18]!==o||e[19]!==g||e[20]!==a||e[21]!==c||e[22]!==d||e[23]!==h||e[24]!==m?(y=v.jsxs("div",{className:a,style:c,onClick:o,children:[d,h,m,g]}),e[18]=o,e[19]=g,e[20]=a,e[21]=c,e[22]=d,e[23]=h,e[24]=m,e[25]=y):y=e[25],y},Fx="_root_m21nb_1",Bx="_icon_m21nb_16",$x="_label_m21nb_17",jr={root:Fx,icon:Bx,label:$x},Ux=t=>{var a;const e=Oe.c(7),n=t.monitorProps.item,r=((a=n.data)==null?void 0:a.icon)??"folder";let i;e[0]!==r?(i=v.jsx("div",{className:jr.icon,children:v.jsx(Ei,{name:r})}),e[0]=r,e[1]=i):i=e[1];let s;e[2]!==n.text?(s=v.jsx("div",{className:jr.label,children:n.text}),e[2]=n.text,e[3]=s):s=e[3];let o;return e[4]!==i||e[5]!==s?(o=v.jsxs("div",{className:jr.root,children:[i,s]}),e[4]=i,e[5]=s,e[6]=o):o=e[6],o},Hx="_app_1musi_1",zx="_draggingSource_1musi_9",Wx="_placeholderContainer_1musi_13",Gx="_dropTarget_1musi_17",On={app:Hx,draggingSource:zx,placeholderContainer:Wx,dropTarget:Gx},Kx="_root_psdhm_1",Yx={root:Kx},Xx=t=>{const e=Oe.c(2),n=t.depth*24;let r;return e[0]!==n?(r=v.jsx("div",{className:Yx.root,style:{left:n}}),e[0]=n,e[1]=r):r=e[1],r},Gl=p.createContext({messages:{},setMessages:()=>{}});function Xn(t){const e=qx(t),n=p.forwardRef((r,i)=>{const{children:s,...o}=r,a=p.Children.toArray(s),c=a.find(Jx);if(c){const l=c.props.children,u=a.map(d=>d===c?p.Children.count(l)>1?p.Children.only(null):p.isValidElement(l)?l.props.children:null:d);return v.jsx(e,{...o,ref:i,children:p.isValidElement(l)?p.cloneElement(l,void 0,u):null})}return v.jsx(e,{...o,ref:i,children:s})});return n.displayName=`${t}.Slot`,n}function qx(t){const e=p.forwardRef((n,r)=>{const{children:i,...s}=n;if(p.isValidElement(i)){const o=eb(i),a=Qx(s,i.props);return i.type!==p.Fragment&&(a.ref=r?Da(r,o):o),p.cloneElement(i,a)}return p.Children.count(i)>1?p.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var Zx=Symbol("radix.slottable");function Jx(t){return p.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===Zx}function Qx(t,e){const n={...e};for(const r in e){const i=t[r],s=e[r];/^on[A-Z]/.test(r)?i&&s?n[r]=(...a)=>{const c=s(...a);return i(...a),c}:i&&(n[r]=i):r==="style"?n[r]={...i,...s}:r==="className"&&(n[r]=[i,s].filter(Boolean).join(" "))}return{...t,...n}}function eb(t){var r,i;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(i=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:i.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var tb=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],le=tb.reduce((t,e)=>{const n=Xn(`Primitive.${e}`),r=p.forwardRef((i,s)=>{const{asChild:o,...a}=i,c=o?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),v.jsx(c,{...a,ref:s})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{});function Kl(t,e){t&&rd.flushSync(()=>t.dispatchEvent(e))}function Yl(t){const e=t+"CollectionProvider",[n,r]=sn(e),[i,s]=n(e,{collectionRef:{current:null},itemMap:new Map}),o=g=>{const{scope:y,children:x}=g,b=H.useRef(null),T=H.useRef(new Map).current;return v.jsx(i,{scope:y,itemMap:T,collectionRef:b,children:x})};o.displayName=e;const a=t+"CollectionSlot",c=Xn(a),l=H.forwardRef((g,y)=>{const{scope:x,children:b}=g,T=s(a,x),S=ve(y,T.collectionRef);return v.jsx(c,{ref:S,children:b})});l.displayName=a;const u=t+"CollectionItemSlot",d="data-radix-collection-item",f=Xn(u),h=H.forwardRef((g,y)=>{const{scope:x,children:b,...T}=g,S=H.useRef(null),C=ve(y,S),P=s(u,x);return H.useEffect(()=>(P.itemMap.set(S,{ref:S,...T}),()=>void P.itemMap.delete(S))),v.jsx(f,{[d]:"",ref:C,children:b})});h.displayName=u;function m(g){const y=s(t+"CollectionConsumer",g);return H.useCallback(()=>{const b=y.collectionRef.current;if(!b)return[];const T=Array.from(b.querySelectorAll(`[${d}]`));return Array.from(y.itemMap.values()).sort((P,D)=>T.indexOf(P.ref.current)-T.indexOf(D.ref.current))},[y.collectionRef,y.itemMap])}return[{Provider:o,Slot:l,ItemSlot:h},m,r]}var nb="DismissableLayer",vi="dismissableLayer.update",rb="dismissableLayer.pointerDownOutside",ib="dismissableLayer.focusOutside",xa,Xl=p.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),ql=p.forwardRef((t,e)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:o,onDismiss:a,...c}=t,l=p.useContext(Xl),[u,d]=p.useState(null),f=(u==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,h]=p.useState({}),m=ve(e,D=>d(D)),g=Array.from(l.layers),[y]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),x=g.indexOf(y),b=u?g.indexOf(u):-1,T=l.layersWithOutsidePointerEventsDisabled.size>0,S=b>=x,C=ab(D=>{const E=D.target,_=[...l.branches].some(N=>N.contains(E));!S||_||(i==null||i(D),o==null||o(D),D.defaultPrevented||a==null||a())},f),P=cb(D=>{const E=D.target;[...l.branches].some(N=>N.contains(E))||(s==null||s(D),o==null||o(D),D.defaultPrevented||a==null||a())},f);return fd(D=>{b===l.layers.size-1&&(r==null||r(D),!D.defaultPrevented&&a&&(D.preventDefault(),a()))},f),p.useEffect(()=>{if(u)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(xa=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(u)),l.layers.add(u),ba(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=xa)}},[u,f,n,l]),p.useEffect(()=>()=>{u&&(l.layers.delete(u),l.layersWithOutsidePointerEventsDisabled.delete(u),ba())},[u,l]),p.useEffect(()=>{const D=()=>h({});return document.addEventListener(vi,D),()=>document.removeEventListener(vi,D)},[]),v.jsx(le.div,{...c,ref:m,style:{pointerEvents:T?S?"auto":"none":void 0,...t.style},onFocusCapture:$(t.onFocusCapture,P.onFocusCapture),onBlurCapture:$(t.onBlurCapture,P.onBlurCapture),onPointerDownCapture:$(t.onPointerDownCapture,C.onPointerDownCapture)})});ql.displayName=nb;var sb="DismissableLayerBranch",ob=p.forwardRef((t,e)=>{const n=p.useContext(Xl),r=p.useRef(null),i=ve(e,r);return p.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),v.jsx(le.div,{...t,ref:i})});ob.displayName=sb;function ab(t,e=globalThis==null?void 0:globalThis.document){const n=ke(t),r=p.useRef(!1),i=p.useRef(()=>{});return p.useEffect(()=>{const s=a=>{if(a.target&&!r.current){let c=function(){Zl(rb,n,l,{discrete:!0})};const l={originalEvent:a};a.pointerType==="touch"?(e.removeEventListener("click",i.current),i.current=c,e.addEventListener("click",i.current,{once:!0})):c()}else e.removeEventListener("click",i.current);r.current=!1},o=window.setTimeout(()=>{e.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(o),e.removeEventListener("pointerdown",s),e.removeEventListener("click",i.current)}},[e,n]),{onPointerDownCapture:()=>r.current=!0}}function cb(t,e=globalThis==null?void 0:globalThis.document){const n=ke(t),r=p.useRef(!1);return p.useEffect(()=>{const i=s=>{s.target&&!r.current&&Zl(ib,n,{originalEvent:s},{discrete:!1})};return e.addEventListener("focusin",i),()=>e.removeEventListener("focusin",i)},[e,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function ba(){const t=new CustomEvent(vi);document.dispatchEvent(t)}function Zl(t,e,n,{discrete:r}){const i=n.originalEvent.target,s=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&i.addEventListener(t,e,{once:!0}),r?Kl(i,s):i.dispatchEvent(s)}var Vr="focusScope.autoFocusOnMount",Fr="focusScope.autoFocusOnUnmount",Ta={bubbles:!1,cancelable:!0},lb="FocusScope",Jl=p.forwardRef((t,e)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:s,...o}=t,[a,c]=p.useState(null),l=ke(i),u=ke(s),d=p.useRef(null),f=ve(e,g=>c(g)),h=p.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;p.useEffect(()=>{if(r){let g=function(T){if(h.paused||!a)return;const S=T.target;a.contains(S)?d.current=S:He(d.current,{select:!0})},y=function(T){if(h.paused||!a)return;const S=T.relatedTarget;S!==null&&(a.contains(S)||He(d.current,{select:!0}))},x=function(T){if(document.activeElement===document.body)for(const C of T)C.removedNodes.length>0&&He(a)};document.addEventListener("focusin",g),document.addEventListener("focusout",y);const b=new MutationObserver(x);return a&&b.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",g),document.removeEventListener("focusout",y),b.disconnect()}}},[r,a,h.paused]),p.useEffect(()=>{if(a){wa.add(h);const g=document.activeElement;if(!a.contains(g)){const x=new CustomEvent(Vr,Ta);a.addEventListener(Vr,l),a.dispatchEvent(x),x.defaultPrevented||(ub(gb(Ql(a)),{select:!0}),document.activeElement===g&&He(a))}return()=>{a.removeEventListener(Vr,l),setTimeout(()=>{const x=new CustomEvent(Fr,Ta);a.addEventListener(Fr,u),a.dispatchEvent(x),x.defaultPrevented||He(g??document.body,{select:!0}),a.removeEventListener(Fr,u),wa.remove(h)},0)}}},[a,l,u,h]);const m=p.useCallback(g=>{if(!n&&!r||h.paused)return;const y=g.key==="Tab"&&!g.altKey&&!g.ctrlKey&&!g.metaKey,x=document.activeElement;if(y&&x){const b=g.currentTarget,[T,S]=db(b);T&&S?!g.shiftKey&&x===S?(g.preventDefault(),n&&He(T,{select:!0})):g.shiftKey&&x===T&&(g.preventDefault(),n&&He(S,{select:!0})):x===b&&g.preventDefault()}},[n,r,h.paused]);return v.jsx(le.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})});Jl.displayName=lb;function ub(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(He(r,{select:e}),document.activeElement!==n)return}function db(t){const e=Ql(t),n=Sa(e,t),r=Sa(e.reverse(),t);return[n,r]}function Ql(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function Sa(t,e){for(const n of t)if(!fb(n,{upTo:e}))return n}function fb(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function hb(t){return t instanceof HTMLInputElement&&"select"in t}function He(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&hb(t)&&e&&t.select()}}var wa=pb();function pb(){let t=[];return{add(e){const n=t[0];e!==n&&(n==null||n.pause()),t=Ca(t,e),t.unshift(e)},remove(e){var n;t=Ca(t,e),(n=t[0])==null||n.resume()}}}function Ca(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}function gb(t){return t.filter(e=>e.tagName!=="A")}var mb="Arrow",eu=p.forwardRef((t,e)=>{const{children:n,width:r=10,height:i=5,...s}=t;return v.jsx(le.svg,{...s,ref:e,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?n:v.jsx("polygon",{points:"0,0 30,0 15,10"})})});eu.displayName=mb;var vb=eu,fs="Popper",[tu,nu]=sn(fs),[yb,ru]=tu(fs),iu=t=>{const{__scopePopper:e,children:n}=t,[r,i]=p.useState(null);return v.jsx(yb,{scope:e,anchor:r,onAnchorChange:i,children:n})};iu.displayName=fs;var su="PopperAnchor",ou=p.forwardRef((t,e)=>{const{__scopePopper:n,virtualRef:r,...i}=t,s=ru(su,n),o=p.useRef(null),a=ve(e,o);return p.useEffect(()=>{s.onAnchorChange((r==null?void 0:r.current)||o.current)}),r?null:v.jsx(le.div,{...i,ref:a})});ou.displayName=su;var hs="PopperContent",[xb,bb]=tu(hs),au=p.forwardRef((t,e)=>{var xe,he,de,Be,Rt,pn;const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:s="center",alignOffset:o=0,arrowPadding:a=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d="partial",hideWhenDetached:f=!1,updatePositionStrategy:h="optimized",onPlaced:m,...g}=t,y=ru(hs,n),[x,b]=p.useState(null),T=ve(e,Je=>b(Je)),[S,C]=p.useState(null),P=hd(S),D=(P==null?void 0:P.width)??0,E=(P==null?void 0:P.height)??0,_=r+(s!=="center"?"-"+s:""),N=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},z=Array.isArray(l)?l:[l],K=z.length>0,re={padding:N,boundary:z.filter(Sb),altBoundary:K},{refs:ne,floatingStyles:ie,placement:Q,isPositioned:B,middlewareData:F}=pd({strategy:"fixed",placement:_,whileElementsMounted:(...Je)=>Sd(...Je,{animationFrame:h==="always"}),elements:{reference:y.anchor},middleware:[gd({mainAxis:i+E,alignmentAxis:o}),c&&md({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?Td():void 0,...re}),c&&vd({...re}),yd({...re,apply:({elements:Je,rects:pt,availableWidth:fr,availableHeight:Qe})=>{const{width:hr,height:gn}=pt.reference,gt=Je.floating.style;gt.setProperty("--radix-popper-available-width",`${fr}px`),gt.setProperty("--radix-popper-available-height",`${Qe}px`),gt.setProperty("--radix-popper-anchor-width",`${hr}px`),gt.setProperty("--radix-popper-anchor-height",`${gn}px`)}}),S&&xd({element:S,padding:a}),wb({arrowWidth:D,arrowHeight:E}),f&&bd({strategy:"referenceHidden",...re})]}),[M,J]=uu(Q),ee=ke(m);Ur(()=>{B&&(ee==null||ee())},[B,ee]);const fe=(xe=F.arrow)==null?void 0:xe.x,qe=(he=F.arrow)==null?void 0:he.y,Fe=((de=F.arrow)==null?void 0:de.centerOffset)!==0,[Ze,Me]=p.useState();return Ur(()=>{x&&Me(window.getComputedStyle(x).zIndex)},[x]),v.jsx("div",{ref:ne.setFloating,"data-radix-popper-content-wrapper":"",style:{...ie,transform:B?ie.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Ze,"--radix-popper-transform-origin":[(Be=F.transformOrigin)==null?void 0:Be.x,(Rt=F.transformOrigin)==null?void 0:Rt.y].join(" "),...((pn=F.hide)==null?void 0:pn.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:v.jsx(xb,{scope:n,placedSide:M,onArrowChange:C,arrowX:fe,arrowY:qe,shouldHideArrow:Fe,children:v.jsx(le.div,{"data-side":M,"data-align":J,...g,ref:T,style:{...g.style,animation:B?void 0:"none"}})})})});au.displayName=hs;var cu="PopperArrow",Tb={top:"bottom",right:"left",bottom:"top",left:"right"},lu=p.forwardRef(function(e,n){const{__scopePopper:r,...i}=e,s=bb(cu,r),o=Tb[s.placedSide];return v.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:v.jsx(vb,{...i,ref:n,style:{...i.style,display:"block"}})})});lu.displayName=cu;function Sb(t){return t!==null}var wb=t=>({name:"transformOrigin",options:t,fn(e){var y,x,b;const{placement:n,rects:r,middlewareData:i}=e,o=((y=i.arrow)==null?void 0:y.centerOffset)!==0,a=o?0:t.arrowWidth,c=o?0:t.arrowHeight,[l,u]=uu(n),d={start:"0%",center:"50%",end:"100%"}[u],f=(((x=i.arrow)==null?void 0:x.x)??0)+a/2,h=(((b=i.arrow)==null?void 0:b.y)??0)+c/2;let m="",g="";return l==="bottom"?(m=o?d:`${f}px`,g=`${-c}px`):l==="top"?(m=o?d:`${f}px`,g=`${r.floating.height+c}px`):l==="right"?(m=`${-c}px`,g=o?d:`${h}px`):l==="left"&&(m=`${r.floating.width+c}px`,g=o?d:`${h}px`),{data:{x:m,y:g}}}});function uu(t){const[e,n="center"]=t.split("-");return[e,n]}var Cb=iu,Eb=ou,Db=au,Pb=lu,Ob="Portal",du=p.forwardRef((t,e)=>{var a;const{container:n,...r}=t,[i,s]=p.useState(!1);Ur(()=>s(!0),[]);const o=n||i&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return o?id.createPortal(v.jsx(le.div,{...r,ref:e}),o):null});du.displayName=Ob;var Br="rovingFocusGroup.onEntryFocus",Mb={bubbles:!1,cancelable:!0},dn="RovingFocusGroup",[yi,fu,Ib]=Yl(dn),[Rb,hu]=sn(dn,[Ib]),[Ab,Nb]=Rb(dn),pu=p.forwardRef((t,e)=>v.jsx(yi.Provider,{scope:t.__scopeRovingFocusGroup,children:v.jsx(yi.Slot,{scope:t.__scopeRovingFocusGroup,children:v.jsx(_b,{...t,ref:e})})}));pu.displayName=dn;var _b=p.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:s,currentTabStopId:o,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:u=!1,...d}=t,f=p.useRef(null),h=ve(e,f),m=Pa(s),[g,y]=Cd({prop:o,defaultProp:a??null,onChange:c,caller:dn}),[x,b]=p.useState(!1),T=ke(l),S=fu(n),C=p.useRef(!1),[P,D]=p.useState(0);return p.useEffect(()=>{const E=f.current;if(E)return E.addEventListener(Br,T),()=>E.removeEventListener(Br,T)},[T]),v.jsx(Ab,{scope:n,orientation:r,dir:m,loop:i,currentTabStopId:g,onItemFocus:p.useCallback(E=>y(E),[y]),onItemShiftTab:p.useCallback(()=>b(!0),[]),onFocusableItemAdd:p.useCallback(()=>D(E=>E+1),[]),onFocusableItemRemove:p.useCallback(()=>D(E=>E-1),[]),children:v.jsx(le.div,{tabIndex:x||P===0?-1:0,"data-orientation":r,...d,ref:h,style:{outline:"none",...t.style},onMouseDown:$(t.onMouseDown,()=>{C.current=!0}),onFocus:$(t.onFocus,E=>{const _=!C.current;if(E.target===E.currentTarget&&_&&!x){const N=new CustomEvent(Br,Mb);if(E.currentTarget.dispatchEvent(N),!N.defaultPrevented){const z=S().filter(Q=>Q.focusable),K=z.find(Q=>Q.active),re=z.find(Q=>Q.id===g),ie=[K,re,...z].filter(Boolean).map(Q=>Q.ref.current);vu(ie,u)}}C.current=!1}),onBlur:$(t.onBlur,()=>b(!1))})})}),gu="RovingFocusGroupItem",mu=p.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:s,children:o,...a}=t,c=wd(),l=s||c,u=Nb(gu,n),d=u.currentTabStopId===l,f=fu(n),{onFocusableItemAdd:h,onFocusableItemRemove:m,currentTabStopId:g}=u;return p.useEffect(()=>{if(r)return h(),()=>m()},[r,h,m]),v.jsx(yi.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:v.jsx(le.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...a,ref:e,onMouseDown:$(t.onMouseDown,y=>{r?u.onItemFocus(l):y.preventDefault()}),onFocus:$(t.onFocus,()=>u.onItemFocus(l)),onKeyDown:$(t.onKeyDown,y=>{if(y.key==="Tab"&&y.shiftKey){u.onItemShiftTab();return}if(y.target!==y.currentTarget)return;const x=jb(y,u.orientation,u.dir);if(x!==void 0){if(y.metaKey||y.ctrlKey||y.altKey||y.shiftKey)return;y.preventDefault();let T=f().filter(S=>S.focusable).map(S=>S.ref.current);if(x==="last")T.reverse();else if(x==="prev"||x==="next"){x==="prev"&&T.reverse();const S=T.indexOf(y.currentTarget);T=u.loop?Vb(T,S+1):T.slice(S+1)}setTimeout(()=>vu(T))}}),children:typeof o=="function"?o({isCurrentTabStop:d,hasTabStop:g!=null}):o})})});mu.displayName=gu;var Lb={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function kb(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function jb(t,e,n){const r=kb(t.key,n);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return Lb[r]}function vu(t,e=!1){const n=document.activeElement;for(const r of t)if(r===n||(r.focus({preventScroll:e}),document.activeElement!==n))return}function Vb(t,e){return t.map((n,r)=>t[(e+r)%t.length])}var Fb=pu,Bb=mu,xi=["Enter"," "],$b=["ArrowDown","PageUp","Home"],yu=["ArrowUp","PageDown","End"],Ub=[...$b,...yu],Hb={ltr:[...xi,"ArrowRight"],rtl:[...xi,"ArrowLeft"]},zb={ltr:["ArrowLeft"],rtl:["ArrowRight"]},fn="Menu",[nn,Wb,Gb]=Yl(fn),[ft,xu]=sn(fn,[Gb,nu,hu]),ur=nu(),bu=hu(),[Kb,ht]=ft(fn),[Yb,hn]=ft(fn),Tu=t=>{const{__scopeMenu:e,open:n=!1,children:r,dir:i,onOpenChange:s,modal:o=!0}=t,a=ur(e),[c,l]=p.useState(null),u=p.useRef(!1),d=ke(s),f=Pa(i);return p.useEffect(()=>{const h=()=>{u.current=!0,document.addEventListener("pointerdown",m,{capture:!0,once:!0}),document.addEventListener("pointermove",m,{capture:!0,once:!0})},m=()=>u.current=!1;return document.addEventListener("keydown",h,{capture:!0}),()=>{document.removeEventListener("keydown",h,{capture:!0}),document.removeEventListener("pointerdown",m,{capture:!0}),document.removeEventListener("pointermove",m,{capture:!0})}},[]),v.jsx(Cb,{...a,children:v.jsx(Kb,{scope:e,open:n,onOpenChange:d,content:c,onContentChange:l,children:v.jsx(Yb,{scope:e,onClose:p.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:f,modal:o,children:r})})})};Tu.displayName=fn;var Xb="MenuAnchor",ps=p.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t,i=ur(n);return v.jsx(Eb,{...i,...r,ref:e})});ps.displayName=Xb;var gs="MenuPortal",[qb,Su]=ft(gs,{forceMount:void 0}),wu=t=>{const{__scopeMenu:e,forceMount:n,children:r,container:i}=t,s=ht(gs,e);return v.jsx(qb,{scope:e,forceMount:n,children:v.jsx(Jn,{present:n||s.open,children:v.jsx(du,{asChild:!0,container:i,children:r})})})};wu.displayName=gs;var Ee="MenuContent",[Zb,ms]=ft(Ee),Cu=p.forwardRef((t,e)=>{const n=Su(Ee,t.__scopeMenu),{forceMount:r=n.forceMount,...i}=t,s=ht(Ee,t.__scopeMenu),o=hn(Ee,t.__scopeMenu);return v.jsx(nn.Provider,{scope:t.__scopeMenu,children:v.jsx(Jn,{present:r||s.open,children:v.jsx(nn.Slot,{scope:t.__scopeMenu,children:o.modal?v.jsx(Jb,{...i,ref:e}):v.jsx(Qb,{...i,ref:e})})})})}),Jb=p.forwardRef((t,e)=>{const n=ht(Ee,t.__scopeMenu),r=p.useRef(null),i=ve(e,r);return p.useEffect(()=>{const s=r.current;if(s)return Ed(s)},[]),v.jsx(vs,{...t,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:$(t.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),Qb=p.forwardRef((t,e)=>{const n=ht(Ee,t.__scopeMenu);return v.jsx(vs,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),eT=Xn("MenuContent.ScrollLock"),vs=p.forwardRef((t,e)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:s,onCloseAutoFocus:o,disableOutsidePointerEvents:a,onEntryFocus:c,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:h,disableOutsideScroll:m,...g}=t,y=ht(Ee,n),x=hn(Ee,n),b=ur(n),T=bu(n),S=Wb(n),[C,P]=p.useState(null),D=p.useRef(null),E=ve(e,D,y.onContentChange),_=p.useRef(0),N=p.useRef(""),z=p.useRef(0),K=p.useRef(null),re=p.useRef("right"),ne=p.useRef(0),ie=m?Pd:p.Fragment,Q=m?{as:eT,allowPinchZoom:!0}:void 0,B=M=>{var xe,he;const J=N.current+M,ee=S().filter(de=>!de.disabled),fe=document.activeElement,qe=(xe=ee.find(de=>de.ref.current===fe))==null?void 0:xe.textValue,Fe=ee.map(de=>de.textValue),Ze=fT(Fe,J,qe),Me=(he=ee.find(de=>de.textValue===Ze))==null?void 0:he.ref.current;(function de(Be){N.current=Be,window.clearTimeout(_.current),Be!==""&&(_.current=window.setTimeout(()=>de(""),1e3))})(J),Me&&setTimeout(()=>Me.focus())};p.useEffect(()=>()=>window.clearTimeout(_.current),[]),Dd();const F=p.useCallback(M=>{var ee,fe;return re.current===((ee=K.current)==null?void 0:ee.side)&&pT(M,(fe=K.current)==null?void 0:fe.area)},[]);return v.jsx(Zb,{scope:n,searchRef:N,onItemEnter:p.useCallback(M=>{F(M)&&M.preventDefault()},[F]),onItemLeave:p.useCallback(M=>{var J;F(M)||((J=D.current)==null||J.focus(),P(null))},[F]),onTriggerLeave:p.useCallback(M=>{F(M)&&M.preventDefault()},[F]),pointerGraceTimerRef:z,onPointerGraceIntentChange:p.useCallback(M=>{K.current=M},[]),children:v.jsx(ie,{...Q,children:v.jsx(Jl,{asChild:!0,trapped:i,onMountAutoFocus:$(s,M=>{var J;M.preventDefault(),(J=D.current)==null||J.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:v.jsx(ql,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:h,children:v.jsx(Fb,{asChild:!0,...T,dir:x.dir,orientation:"vertical",loop:r,currentTabStopId:C,onCurrentTabStopIdChange:P,onEntryFocus:$(c,M=>{x.isUsingKeyboardRef.current||M.preventDefault()}),preventScrollOnEntryFocus:!0,children:v.jsx(Db,{role:"menu","aria-orientation":"vertical","data-state":Bu(y.open),"data-radix-menu-content":"",dir:x.dir,...b,...g,ref:E,style:{outline:"none",...g.style},onKeyDown:$(g.onKeyDown,M=>{const ee=M.target.closest("[data-radix-menu-content]")===M.currentTarget,fe=M.ctrlKey||M.altKey||M.metaKey,qe=M.key.length===1;ee&&(M.key==="Tab"&&M.preventDefault(),!fe&&qe&&B(M.key));const Fe=D.current;if(M.target!==Fe||!Ub.includes(M.key))return;M.preventDefault();const Me=S().filter(xe=>!xe.disabled).map(xe=>xe.ref.current);yu.includes(M.key)&&Me.reverse(),uT(Me)}),onBlur:$(t.onBlur,M=>{M.currentTarget.contains(M.target)||(window.clearTimeout(_.current),N.current="")}),onPointerMove:$(t.onPointerMove,rn(M=>{const J=M.target,ee=ne.current!==M.clientX;if(M.currentTarget.contains(J)&&ee){const fe=M.clientX>ne.current?"right":"left";re.current=fe,ne.current=M.clientX}}))})})})})})})});Cu.displayName=Ee;var tT="MenuGroup",ys=p.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return v.jsx(le.div,{role:"group",...r,ref:e})});ys.displayName=tT;var nT="MenuLabel",Eu=p.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return v.jsx(le.div,{...r,ref:e})});Eu.displayName=nT;var qn="MenuItem",Ea="menu.itemSelect",dr=p.forwardRef((t,e)=>{const{disabled:n=!1,onSelect:r,...i}=t,s=p.useRef(null),o=hn(qn,t.__scopeMenu),a=ms(qn,t.__scopeMenu),c=ve(e,s),l=p.useRef(!1),u=()=>{const d=s.current;if(!n&&d){const f=new CustomEvent(Ea,{bubbles:!0,cancelable:!0});d.addEventListener(Ea,h=>r==null?void 0:r(h),{once:!0}),Kl(d,f),f.defaultPrevented?l.current=!1:o.onClose()}};return v.jsx(Du,{...i,ref:c,disabled:n,onClick:$(t.onClick,u),onPointerDown:d=>{var f;(f=t.onPointerDown)==null||f.call(t,d),l.current=!0},onPointerUp:$(t.onPointerUp,d=>{var f;l.current||(f=d.currentTarget)==null||f.click()}),onKeyDown:$(t.onKeyDown,d=>{const f=a.searchRef.current!=="";n||f&&d.key===" "||xi.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})})});dr.displayName=qn;var Du=p.forwardRef((t,e)=>{const{__scopeMenu:n,disabled:r=!1,textValue:i,...s}=t,o=ms(qn,n),a=bu(n),c=p.useRef(null),l=ve(e,c),[u,d]=p.useState(!1),[f,h]=p.useState("");return p.useEffect(()=>{const m=c.current;m&&h((m.textContent??"").trim())},[s.children]),v.jsx(nn.ItemSlot,{scope:n,disabled:r,textValue:i??f,children:v.jsx(Bb,{asChild:!0,...a,focusable:!r,children:v.jsx(le.div,{role:"menuitem","data-highlighted":u?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...s,ref:l,onPointerMove:$(t.onPointerMove,rn(m=>{r?o.onItemLeave(m):(o.onItemEnter(m),m.defaultPrevented||m.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:$(t.onPointerLeave,rn(m=>o.onItemLeave(m))),onFocus:$(t.onFocus,()=>d(!0)),onBlur:$(t.onBlur,()=>d(!1))})})})}),rT="MenuCheckboxItem",Pu=p.forwardRef((t,e)=>{const{checked:n=!1,onCheckedChange:r,...i}=t;return v.jsx(Au,{scope:t.__scopeMenu,checked:n,children:v.jsx(dr,{role:"menuitemcheckbox","aria-checked":Zn(n)?"mixed":n,...i,ref:e,"data-state":bs(n),onSelect:$(i.onSelect,()=>r==null?void 0:r(Zn(n)?!0:!n),{checkForDefaultPrevented:!1})})})});Pu.displayName=rT;var Ou="MenuRadioGroup",[iT,sT]=ft(Ou,{value:void 0,onValueChange:()=>{}}),Mu=p.forwardRef((t,e)=>{const{value:n,onValueChange:r,...i}=t,s=ke(r);return v.jsx(iT,{scope:t.__scopeMenu,value:n,onValueChange:s,children:v.jsx(ys,{...i,ref:e})})});Mu.displayName=Ou;var Iu="MenuRadioItem",Ru=p.forwardRef((t,e)=>{const{value:n,...r}=t,i=sT(Iu,t.__scopeMenu),s=n===i.value;return v.jsx(Au,{scope:t.__scopeMenu,checked:s,children:v.jsx(dr,{role:"menuitemradio","aria-checked":s,...r,ref:e,"data-state":bs(s),onSelect:$(r.onSelect,()=>{var o;return(o=i.onValueChange)==null?void 0:o.call(i,n)},{checkForDefaultPrevented:!1})})})});Ru.displayName=Iu;var xs="MenuItemIndicator",[Au,oT]=ft(xs,{checked:!1}),Nu=p.forwardRef((t,e)=>{const{__scopeMenu:n,forceMount:r,...i}=t,s=oT(xs,n);return v.jsx(Jn,{present:r||Zn(s.checked)||s.checked===!0,children:v.jsx(le.span,{...i,ref:e,"data-state":bs(s.checked)})})});Nu.displayName=xs;var aT="MenuSeparator",_u=p.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return v.jsx(le.div,{role:"separator","aria-orientation":"horizontal",...r,ref:e})});_u.displayName=aT;var cT="MenuArrow",Lu=p.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t,i=ur(n);return v.jsx(Pb,{...i,...r,ref:e})});Lu.displayName=cT;var lT="MenuSub",[yw,ku]=ft(lT),Ut="MenuSubTrigger",ju=p.forwardRef((t,e)=>{const n=ht(Ut,t.__scopeMenu),r=hn(Ut,t.__scopeMenu),i=ku(Ut,t.__scopeMenu),s=ms(Ut,t.__scopeMenu),o=p.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:c}=s,l={__scopeMenu:t.__scopeMenu},u=p.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return p.useEffect(()=>u,[u]),p.useEffect(()=>{const d=a.current;return()=>{window.clearTimeout(d),c(null)}},[a,c]),v.jsx(ps,{asChild:!0,...l,children:v.jsx(Du,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":i.contentId,"data-state":Bu(n.open),...t,ref:Da(e,i.onTriggerChange),onClick:d=>{var f;(f=t.onClick)==null||f.call(t,d),!(t.disabled||d.defaultPrevented)&&(d.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:$(t.onPointerMove,rn(d=>{s.onItemEnter(d),!d.defaultPrevented&&!t.disabled&&!n.open&&!o.current&&(s.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:$(t.onPointerLeave,rn(d=>{var h,m;u();const f=(h=n.content)==null?void 0:h.getBoundingClientRect();if(f){const g=(m=n.content)==null?void 0:m.dataset.side,y=g==="right",x=y?-5:5,b=f[y?"left":"right"],T=f[y?"right":"left"];s.onPointerGraceIntentChange({area:[{x:d.clientX+x,y:d.clientY},{x:b,y:f.top},{x:T,y:f.top},{x:T,y:f.bottom},{x:b,y:f.bottom}],side:g}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(d),d.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:$(t.onKeyDown,d=>{var h;const f=s.searchRef.current!=="";t.disabled||f&&d.key===" "||Hb[r.dir].includes(d.key)&&(n.onOpenChange(!0),(h=n.content)==null||h.focus(),d.preventDefault())})})})});ju.displayName=Ut;var Vu="MenuSubContent",Fu=p.forwardRef((t,e)=>{const n=Su(Ee,t.__scopeMenu),{forceMount:r=n.forceMount,...i}=t,s=ht(Ee,t.__scopeMenu),o=hn(Ee,t.__scopeMenu),a=ku(Vu,t.__scopeMenu),c=p.useRef(null),l=ve(e,c);return v.jsx(nn.Provider,{scope:t.__scopeMenu,children:v.jsx(Jn,{present:r||s.open,children:v.jsx(nn.Slot,{scope:t.__scopeMenu,children:v.jsx(vs,{id:a.contentId,"aria-labelledby":a.triggerId,...i,ref:l,align:"start",side:o.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:u=>{var d;o.isUsingKeyboardRef.current&&((d=c.current)==null||d.focus()),u.preventDefault()},onCloseAutoFocus:u=>u.preventDefault(),onFocusOutside:$(t.onFocusOutside,u=>{u.target!==a.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:$(t.onEscapeKeyDown,u=>{o.onClose(),u.preventDefault()}),onKeyDown:$(t.onKeyDown,u=>{var h;const d=u.currentTarget.contains(u.target),f=zb[o.dir].includes(u.key);d&&f&&(s.onOpenChange(!1),(h=a.trigger)==null||h.focus(),u.preventDefault())})})})})})});Fu.displayName=Vu;function Bu(t){return t?"open":"closed"}function Zn(t){return t==="indeterminate"}function bs(t){return Zn(t)?"indeterminate":t?"checked":"unchecked"}function uT(t){const e=document.activeElement;for(const n of t)if(n===e||(n.focus(),document.activeElement!==e))return}function dT(t,e){return t.map((n,r)=>t[(e+r)%t.length])}function fT(t,e,n){const i=e.length>1&&Array.from(e).every(l=>l===e[0])?e[0]:e,s=n?t.indexOf(n):-1;let o=dT(t,Math.max(s,0));i.length===1&&(o=o.filter(l=>l!==n));const c=o.find(l=>l.toLowerCase().startsWith(i.toLowerCase()));return c!==n?c:void 0}function hT(t,e){const{x:n,y:r}=t;let i=!1;for(let s=0,o=e.length-1;s<e.length;o=s++){const a=e[s],c=e[o],l=a.x,u=a.y,d=c.x,f=c.y;u>r!=f>r&&n<(d-l)*(r-u)/(f-u)+l&&(i=!i)}return i}function pT(t,e){if(!e)return!1;const n={x:t.clientX,y:t.clientY};return hT(n,e)}function rn(t){return e=>e.pointerType==="mouse"?t(e):void 0}var gT=Tu,mT=ps,vT=wu,yT=Cu,xT=ys,bT=Eu,TT=dr,ST=Pu,wT=Mu,CT=Ru,ET=Nu,DT=_u,PT=Lu,OT=ju,MT=Fu,Ts="ContextMenu",[IT,xw]=sn(Ts,[xu]),ue=xu(),[RT,$u]=IT(Ts),Uu=t=>{const{__scopeContextMenu:e,children:n,onOpenChange:r,dir:i,modal:s=!0}=t,[o,a]=p.useState(!1),c=ue(e),l=ke(r),u=p.useCallback(d=>{a(d),l(d)},[l]);return v.jsx(RT,{scope:e,open:o,onOpenChange:u,modal:s,children:v.jsx(gT,{...c,dir:i,open:o,onOpenChange:u,modal:s,children:n})})};Uu.displayName=Ts;var Hu="ContextMenuTrigger",zu=p.forwardRef((t,e)=>{const{__scopeContextMenu:n,disabled:r=!1,...i}=t,s=$u(Hu,n),o=ue(n),a=p.useRef({x:0,y:0}),c=p.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...a.current})}),l=p.useRef(0),u=p.useCallback(()=>window.clearTimeout(l.current),[]),d=f=>{a.current={x:f.clientX,y:f.clientY},s.onOpenChange(!0)};return p.useEffect(()=>u,[u]),p.useEffect(()=>void(r&&u()),[r,u]),v.jsxs(v.Fragment,{children:[v.jsx(mT,{...o,virtualRef:c}),v.jsx(le.span,{"data-state":s.open?"open":"closed","data-disabled":r?"":void 0,...i,ref:e,style:{WebkitTouchCallout:"none",...t.style},onContextMenu:r?t.onContextMenu:$(t.onContextMenu,f=>{u(),d(f),f.preventDefault()}),onPointerDown:r?t.onPointerDown:$(t.onPointerDown,Mn(f=>{u(),l.current=window.setTimeout(()=>d(f),700)})),onPointerMove:r?t.onPointerMove:$(t.onPointerMove,Mn(u)),onPointerCancel:r?t.onPointerCancel:$(t.onPointerCancel,Mn(u)),onPointerUp:r?t.onPointerUp:$(t.onPointerUp,Mn(u))})]})});zu.displayName=Hu;var AT="ContextMenuPortal",Wu=t=>{const{__scopeContextMenu:e,...n}=t,r=ue(e);return v.jsx(vT,{...r,...n})};Wu.displayName=AT;var Gu="ContextMenuContent",Ku=p.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,i=$u(Gu,n),s=ue(n),o=p.useRef(!1);return v.jsx(yT,{...s,...r,ref:e,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:a=>{var c;(c=t.onCloseAutoFocus)==null||c.call(t,a),!a.defaultPrevented&&o.current&&a.preventDefault(),o.current=!1},onInteractOutside:a=>{var c;(c=t.onInteractOutside)==null||c.call(t,a),!a.defaultPrevented&&!i.modal&&(o.current=!0)},style:{...t.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Ku.displayName=Gu;var NT="ContextMenuGroup",_T=p.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,i=ue(n);return v.jsx(xT,{...i,...r,ref:e})});_T.displayName=NT;var LT="ContextMenuLabel",kT=p.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,i=ue(n);return v.jsx(bT,{...i,...r,ref:e})});kT.displayName=LT;var jT="ContextMenuItem",Yu=p.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,i=ue(n);return v.jsx(TT,{...i,...r,ref:e})});Yu.displayName=jT;var VT="ContextMenuCheckboxItem",FT=p.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,i=ue(n);return v.jsx(ST,{...i,...r,ref:e})});FT.displayName=VT;var BT="ContextMenuRadioGroup",$T=p.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,i=ue(n);return v.jsx(wT,{...i,...r,ref:e})});$T.displayName=BT;var UT="ContextMenuRadioItem",HT=p.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,i=ue(n);return v.jsx(CT,{...i,...r,ref:e})});HT.displayName=UT;var zT="ContextMenuItemIndicator",WT=p.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,i=ue(n);return v.jsx(ET,{...i,...r,ref:e})});WT.displayName=zT;var GT="ContextMenuSeparator",KT=p.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,i=ue(n);return v.jsx(DT,{...i,...r,ref:e})});KT.displayName=GT;var YT="ContextMenuArrow",XT=p.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,i=ue(n);return v.jsx(PT,{...i,...r,ref:e})});XT.displayName=YT;var qT="ContextMenuSubTrigger",ZT=p.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,i=ue(n);return v.jsx(OT,{...i,...r,ref:e})});ZT.displayName=qT;var JT="ContextMenuSubContent",QT=p.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,i=ue(n);return v.jsx(MT,{...i,...r,ref:e,style:{...t.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});QT.displayName=JT;function Mn(t){return e=>e.pointerType!=="mouse"?t(e):void 0}var eS=Uu,tS=zu,nS=Wu,rS=Ku,iS=Yu;function sS(t){const e=Oe.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=v.jsx(eS,{"data-slot":"context-menu",...n}),e[2]=n,e[3]=r):r=e[3],r}function oS(t){const e=Oe.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=v.jsx(tS,{"data-slot":"context-menu-trigger",...n}),e[2]=n,e[3]=r):r=e[3],r}function aS(t){const e=Oe.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=Oa("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-context-menu-content-available-height) min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",n),e[3]=n,e[4]=i):i=e[4];let s;return e[5]!==r||e[6]!==i?(s=v.jsx(nS,{children:v.jsx(rS,{"data-slot":"context-menu-content",className:i,...r})}),e[5]=r,e[6]=i,e[7]=s):s=e[7],s}function In(t){const e=Oe.c(12);let n,r,i,s;e[0]!==t?({className:n,inset:r,variant:s,...i}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=i,e[4]=s):(n=e[1],r=e[2],i=e[3],s=e[4]);const o=s===void 0?"default":s;let a;e[5]!==n?(a=Oa("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",n),e[5]=n,e[6]=a):a=e[6];let c;return e[7]!==r||e[8]!==i||e[9]!==a||e[10]!==o?(c=v.jsx(iS,{"data-slot":"context-menu-item","data-inset":r,"data-variant":o,className:a,...i}),e[7]=r,e[8]=i,e[9]=a,e[10]=o,e[11]=c):c=e[11],c}const cS=t=>{const e=Oe.c(46);let n,r,i,s,o;e[0]!==t?({type:o,callback:n,parentId:s,isNavigation:i,...r}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=i,e[4]=s,e[5]=o):(n=e[1],r=e[2],i=e[3],s=e[4],o=e[5]);const[a,c]=p.useState(!1);let l;e[6]!==n||e[7]!==s||e[8]!==a||e[9]!==o?(l=async _=>{try{(await te.post("",{data:{record:_,parentId:s,targetBlank:a,_method:"select",type:o},_method:"createItem"})).data&&n()}catch(N){console.log(N)}},e[6]=n,e[7]=s,e[8]=a,e[9]=o,e[10]=l):l=e[10];const u=l,d=`grid gap-4 ${r.items.length?"":"opacity-50 pointer-events-none"}`;let f;e[11]!==r.labels.selectTitle?(f=v.jsx(Ct,{children:r.labels.selectTitle}),e[11]=r.labels.selectTitle,e[12]=f):f=e[12];let h;e[13]!==r.labels.selectTitle?(h=v.jsx(bi,{className:"w-full max-w-[170px] cursor-pointer",children:v.jsx(Ti,{placeholder:r.labels.selectTitle})}),e[13]=r.labels.selectTitle,e[14]=h):h=e[14];let m;e[15]!==r.items?(m=r.items.map(lS),e[15]=r.items,e[16]=m):m=e[16];let g;e[17]!==m?(g=v.jsx(wi,{children:m}),e[17]=m,e[18]=g):g=e[18];let y;e[19]!==u||e[20]!==h||e[21]!==g?(y=v.jsxs(Ci,{onValueChange:u,children:[h,g]}),e[19]=u,e[20]=h,e[21]=g,e[22]=y):y=e[22];let x;e[23]!==d||e[24]!==f||e[25]!==y?(x=v.jsxs("div",{className:d,children:[f,y]}),e[23]=d,e[24]=f,e[25]=y,e[26]=x):x=e[26];let b;e[27]!==r.labels.openInNewWindow||e[28]!==i||e[29]!==a?(b=i&&v.jsxs("div",{className:"flex gap-4 items-center",children:[v.jsx(Ma,{id:"targetBlank",checked:a,onCheckedChange:_=>c(!!_),className:"cursor-pointer size-5"}),v.jsx(Ct,{htmlFor:"targetBlank",children:r.labels.openInNewWindow})]}),e[27]=r.labels.openInNewWindow,e[28]=i,e[29]=a,e[30]=b):b=e[30];let T;e[31]!==x||e[32]!==b?(T=v.jsxs("div",{className:"flex gap-4 flex-col",children:[x,b]}),e[31]=x,e[32]=b,e[33]=T):T=e[33];let S;e[34]!==r.labels.OR?(S=v.jsx("div",{className:"mt-8",children:v.jsx("span",{children:v.jsx("b",{children:r.labels.OR})})}),e[34]=r.labels.OR,e[35]=S):S=e[35];let C;e[36]!==r?(C=()=>r.add(r.model),e[36]=r,e[37]=C):C=e[37];let P;e[38]===Symbol.for("react.memo_cache_sentinel")?(P=v.jsx(Ra,{}),e[38]=P):P=e[38];let D;e[39]!==r.labels.createTitle||e[40]!==C?(D=v.jsxs(vt,{className:"mt-8",onClick:C,children:[P,r.labels.createTitle]}),e[39]=r.labels.createTitle,e[40]=C,e[41]=D):D=e[41];let E;return e[42]!==T||e[43]!==S||e[44]!==D?(E=v.jsxs("div",{className:"p-8",children:[T,S,D]}),e[42]=T,e[43]=S,e[44]=D,e[45]=E):E=e[45],E};function lS(t){return v.jsx(Si,{value:t.id.toString(),children:t.name},`${t.id}-${t.name}`)}const Rn=({update:t=!1,type:e,parentId:n,...r})=>{const[i,s]=p.useState({}),[o,a]=p.useState(!1),[c,l]=p.useState(!1);p.useEffect(()=>{r.item?(s({name:r.item.name||"",...Object.fromEntries(r.items.map(f=>[f.name,r.item?r.item[f.name]:""]))}),a(r.item.targetBlank||!1)):(s({name:"",...Object.fromEntries(r.items.map(f=>[f.name,""]))}),a(!1))},[r.item,r.items]);const u=f=>{const{name:h,value:m}=f.target;s(g=>({...g,[h]:m}))},d=async f=>{var h,m;f.preventDefault(),l(!0);try{let g=null;t?(g=await te.put("",{type:(h=r.item)==null?void 0:h.type,modelId:(m=r.item)==null?void 0:m.id,data:{...r.item,...i,targetBlank:o},_method:"updateItem"}),r.callback(g.data.data)):(await te.post("",{data:{...i,targetBlank:o,parentId:n,type:e},_method:"createItem"}),r.callback(null))}catch(g){console.error(g)}finally{l(!1)}};return v.jsxs("div",{className:"p-8",children:[v.jsxs("form",{className:"grid gap-6",id:"group-add",onSubmit:d,children:[v.jsxs("div",{className:"flex gap-4 items-center",children:[v.jsx(Ma,{id:"targetBlank",checked:o,onCheckedChange:f=>a(!!f),className:"cursor-pointer size-5"}),v.jsx(Ct,{htmlFor:"targetBlank",children:r.labels.openInNewWindow})]}),v.jsxs("div",{className:"grid gap-4",children:[v.jsx(Ct,{htmlFor:"name",children:r.labels.title}),v.jsx($r,{required:!0,value:i.name||"",name:"name",placeholder:r.labels.title,onChange:u})]}),r.items.map(f=>v.jsxs("div",{className:"grid gap-4",children:[v.jsx(Ct,{children:f.name}),v.jsx($r,{required:f.required,value:i[f.name]||"",name:f.name,placeholder:f.name,onChange:u})]},f.name))]}),v.jsxs(vt,{className:"mt-8 w-fit",form:"group-add",type:"submit",disabled:c,children:[r.labels.save,c&&v.jsx(wt,{className:"h-4 w-4 animate-spin ml-2"})]})]})},uS=t=>{const e=Oe.c(18),{items:n,onSelect:r}=t,i=p.useContext(Gl),[s,o]=p.useState("");let a;e[0]!==r?(a=x=>{o(x),r(x),o("")},e[0]=r,e[1]=a):a=e[1];const c=a,l=i.messages["Select Item type"];let u;e[2]!==l?(u=v.jsx(Ct,{className:"mb-4",children:l}),e[2]=l,e[3]=u):u=e[3];const d=i.messages["Select Ids"];let f;e[4]!==d?(f=v.jsx(bi,{className:"w-full max-w-[170px] cursor-pointer",children:v.jsx(Ti,{placeholder:d})}),e[4]=d,e[5]=f):f=e[5];let h;e[6]!==n?(h=n.map(dS),e[6]=n,e[7]=h):h=e[7];let m;e[8]!==h?(m=v.jsx(wi,{children:h}),e[8]=h,e[9]=m):m=e[9];let g;e[10]!==c||e[11]!==s||e[12]!==f||e[13]!==m?(g=v.jsxs(Ci,{onValueChange:c,value:s,children:[f,m]}),e[10]=c,e[11]=s,e[12]=f,e[13]=m,e[14]=g):g=e[14];let y;return e[15]!==u||e[16]!==g?(y=v.jsxs("div",{className:"p-8",children:[u,g]}),e[15]=u,e[16]=g,e[17]=y):y=e[17],y};function dS(t){return v.jsx(Si,{value:t.type,children:t.name},`${t.type}-${t.name}`)}const fS=t=>{const e=Oe.c(51),{dialogRef:n,PopupEvent:r,firstRender:i,secondRender:s,popupType:o,addProps:a,editModel:c,popUpTargetBlank:l,isNavigation:u,messages:d,DynamicComponent:f,addLinksGroupProps:h,reloadCatalog:m,itemType:g,parentid:y,addItemProps:x,getAddModelJSON:b,addModel:T,items:S,selectCatalogItem:C}=t;let P;e[0]===Symbol.for("react.memo_cache_sentinel")?(P=v.jsx(Od,{}),e[0]=P):P=e[0];let D;e[1]!==r||e[2]!==i||e[3]!==S||e[4]!==C?(D=r==="create"&&v.jsxs(v.Fragment,{children:[i&&v.jsx(wt,{className:"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 size-8 animate-spin"}),v.jsx(uS,{items:S,onSelect:C})]}),e[1]=r,e[2]=i,e[3]=S,e[4]=C,e[5]=D):D=e[5];let E;e[6]!==f||e[7]!==r||e[8]!==h||e[9]!==a||e[10]!==n||e[11]!==c||e[12]!==i||e[13]!==u||e[14]!==d||e[15]!==l||e[16]!==o||e[17]!==m?(E=r==="update"&&v.jsx("div",{className:"h-full overflow-y-auto mt-5",children:i?v.jsx(wt,{className:"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 size-8 animate-spin"}):v.jsxs(v.Fragment,{children:[o==="model"&&v.jsx(Ps,{page:a,catalog:!0,callback:c,openNewWindowLabel:d["Open in a new window"],openNewWindow:l,isNavigation:u}),o==="navigation.group"&&v.jsx(Rn,{callback:B=>{var F;(F=n.current)==null||F.close(),m(B)},update:!0,type:"group",...h}),o==="navigation.link"&&v.jsx(Rn,{callback:B=>{var F;(F=n.current)==null||F.close(),m(B)},update:!0,type:"link",...h}),o==="component"&&v.jsx(v.Fragment,{children:f})]})}),e[6]=f,e[7]=r,e[8]=h,e[9]=a,e[10]=n,e[11]=c,e[12]=i,e[13]=u,e[14]=d,e[15]=l,e[16]=o,e[17]=m,e[18]=E):E=e[18];let _;e[19]!==D||e[20]!==E?(_=v.jsx(mr,{children:v.jsxs("div",{className:"relative h-full",children:[D,E]})}),e[19]=D,e[20]=E,e[21]=_):_=e[21];let N;e[22]!==s?(N=s&&v.jsx(wt,{className:"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 size-8 animate-spin"}),e[22]=s,e[23]=N):N=e[23];let z;e[24]!==f||e[25]!==r||e[26]!==x||e[27]!==h||e[28]!==n||e[29]!==b||e[30]!==u||e[31]!==g||e[32]!==y||e[33]!==o||e[34]!==m?(z=r==="create"&&v.jsxs(v.Fragment,{children:[o==="model"&&v.jsx(cS,{add:b,callback:()=>{var B;(B=n.current)==null||B.close(),m(null)},type:g??"",parentId:y,isNavigation:u,...x}),o==="navigation.group"&&v.jsx(Rn,{callback:B=>{var F;(F=n.current)==null||F.close(),m(B)},type:"group",parentId:y,...h}),o==="navigation.link"&&v.jsx(Rn,{callback:B=>{var F;(F=n.current)==null||F.close(),m(B)},type:"link",parentId:y,...h}),o==="component"&&v.jsx(v.Fragment,{children:f})]}),e[24]=f,e[25]=r,e[26]=x,e[27]=h,e[28]=n,e[29]=b,e[30]=u,e[31]=g,e[32]=y,e[33]=o,e[34]=m,e[35]=z):z=e[35];let K;e[36]!==N||e[37]!==z?(K=v.jsx(mr,{children:v.jsxs("div",{className:"relative h-full",children:[N,z]})}),e[36]=N,e[37]=z,e[38]=K):K=e[38];const re=d["Open in a new window"];let ne;e[39]!==T||e[40]!==a||e[41]!==u||e[42]!==re?(ne=v.jsx(mr,{children:v.jsx("div",{className:"h-full overflow-y-auto mt-5",children:v.jsx(Ps,{page:a,catalog:!0,callback:T,openNewWindowLabel:re,isNavigation:u})})}),e[39]=T,e[40]=a,e[41]=u,e[42]=re,e[43]=ne):ne=e[43];let ie;e[44]!==_||e[45]!==K||e[46]!==ne?(ie=v.jsxs(Md,{children:[_,K,ne]}),e[44]=_,e[45]=K,e[46]=ne,e[47]=ie):ie=e[47];let Q;return e[48]!==n||e[49]!==ie?(Q=v.jsxs(Id,{ref:n,children:[P,ie]}),e[48]=n,e[49]=ie,e[50]=Q):Q=e[50],Q},hS=()=>{var Cs;const t=p.useRef(null),e=p.useRef(null),[n,r]=p.useState([]),[i,s]=p.useState([]),[o,a]=p.useState({catalogId:"",catalogName:"",catalogSlug:"",idList:[],nodes:[],movingGroupsRootOnly:!1}),[c,l]=p.useState([]),[u,d]=p.useState({}),[f,h]=p.useState(!1),m=p.useRef(null),[g,y]=p.useState({items:[],model:"",labels:{}}),[x,b]=p.useState({items:[],labels:{}}),[T,S]=p.useState(""),[C,P]=p.useState(null),[D,E]=p.useState(null),[_,N]=p.useState(null),[z,K]=p.useState(0),[re,ne]=p.useState(!1),[ie,Q]=p.useState(!1),[B,F]=p.useState(null),[M,J]=p.useState([]),[ee,fe]=p.useState([]),[qe,Fe]=p.useState(!1),[Ze,Me]=p.useState({props:{actions:[],btnBack:{link:"",title:""},btnSave:{title:""},edit:!1,fields:[],notFound:"",postLink:"",search:"",view:!1}}),[xe,he]=p.useState(!1),[de,Be]=p.useState(!1);p.useEffect(()=>{const w=async()=>{const V=await te.post("",{_method:"getCatalog"}),{catalog:L,items:R,toolsActions:W}=V.data;a(L),l(R),r(L.nodes),J(W),Q(L.catalogSlug==="navigation")},I=async()=>{let V=await te.post("",{_method:"getLocales"});d(V.data.data)};(async()=>{try{h(!0),await I(),await w()}catch(V){console.error("Error initializing catalog:",V)}finally{h(!1)}})()},[]);const Rt=w=>{i.find(O=>O.id===w.id)?(K(0),s(i.filter(O=>O.id!==w.id))):(K(w.id),s([...i,w]))},pn=w=>{w.target===w.currentTarget&&s([])},Je=p.useCallback(async(w,{dragSourceId:I,dropTargetId:O})=>{var V;try{const L=w.find(U=>U.id===I),R=O||0,W={data:{reqNode:[{id:L==null?void 0:L.id,parent:R,text:L==null?void 0:L.text,data:L==null?void 0:L.data}],reqParent:{id:R,children:w.filter(U=>U.parent===R).map(U=>({id:U.id,text:U.text,data:U.data})),data:R===0?{id:0}:(V=w.find(U=>U.id===R))==null?void 0:V.data}},_method:"updateTree"};r(w),await te.put("",W)}catch(L){console.error("Error updating tree:",L)}},[n]),pt=p.useCallback(async(w,I)=>{if(I)try{P(w);const O=n.find(R=>R.id===w),L=(await te.post("",{data:O,_method:"getChilds"})).data.data;r(R=>{const W=new Set(R.map(Y=>Y.id)),U=L.filter(Y=>!W.has(Y.id));return U.length===0?R:[...R,...U]})}catch(O){console.error("Error loading child nodes:",O)}finally{P(null)}},[n]),fr=p.useCallback(async()=>{try{const w=await te.post("",{_method:"getCatalog"}),{catalog:I}=w.data;r(O=>{const V=new Map(O.map(U=>[U.id,U])),L=I.nodes,R=O.map(U=>{const Y=L.find(et=>et.id===U.id);return Y&&Y.text!==U.text?Y:U}),W=L.filter(U=>{var Y;return!V.has(U.id)||((Y=V.get(U.id))==null?void 0:Y.text)!==U.text});return W.length===0&&R.length===O.length&&R.every((U,Y)=>U===O[Y])?O:[...R,...W]})}catch(w){console.error("Error reloading catalog:",w)}},[]),Qe=p.useCallback(async w=>{var I,O;w?r(V=>V.map(L=>L.id===w.id?{...L,text:w.name,data:{...L.data,...w}}:L)):(I=i[0])!=null&&I.droppable?((O=t.current)==null||O.open(i[0].id),await pt(i[0].id,!0)):await fr()},[i,pt,r]),hr=p.useCallback(async w=>{var O;E(w),he(!0);const I=await te.post("",{type:w,_method:"getAddTemplate"});Xu(I.data),(O=m.current)==null||O.next(),he(!1)},[z,xe,D]),gn=p.useCallback(async()=>{var w,I,O,V,L,R;try{he(!0);const W=await te.post("",{type:(I=(w=i[0])==null?void 0:w.data)==null?void 0:I.type,modelId:((V=(O=i[0])==null?void 0:O.data)==null?void 0:V.modelId)??null,id:(R=(L=i[0])==null?void 0:L.data)==null?void 0:R.id,_method:"getEditTemplate"});if(W.data)if(W.data.type.includes("navigation"))switch(W.data.type){case"navigation.group":b(W.data.data),S("navigation.group"),he(!1);break;case"navigation.link":b(W.data.data),S("navigation.link"),he(!1);break}else switch(W.data.type){case"model":const U=W.data.data.item,Y=await te.get(`${window.routePrefix}/model/${U.type}/edit/${U.modelId}?without_layout=true`);Me(Y.data),ne(U.targetBlank),S("model"),he(!1);break;default:(async()=>{const mn=(await import(W.data.data.path)).default;F(v.jsx(mn,{callback:vn=>{var yn;(yn=m.current)==null||yn.close(),Qe(vn)},update:!0,item:W.data.data.item},`${W.data.data.id}-${W.data.data.item.name}`))})(),S("component"),he(!1);break}}catch(W){console.log(W)}},[_,i,n,Ze]),gt=p.useCallback(async()=>{if(i.length)try{for(const w of i)if((await te.delete("",{data:w})).data.data.ok){let O=[...n];const V=(L,R)=>{let W=R.filter(Y=>Y.id!==L);return R.filter(Y=>Y.parent===L).forEach(Y=>{W=V(Y.id,W)}),W};i.forEach(L=>{O=V(L.id,O)}),r(O)}}catch(w){console.error("Error deleting node:",w)}finally{s([]),K(0)}},[i,n]),Xu=p.useCallback(w=>{if(w.type.includes("navigation"))switch(w.type){case"model":y(w.data),S("model");break;case"navigation.group":console.log(w.data),b(w.data),S("navigation.group");break;case"navigation.link":b(w.data),S("navigation.link");break}else switch(w.type){case"model":y(w.data),S("model");break;default:(async()=>{const V=(await import(w.data.path)).default;F(v.jsx(V,{parentId:z,callback:L=>{var R;(R=m.current)==null||R.close(),Qe(L)}}))})(),S("component");break}},[_,i,ie]),qu=p.useCallback(async w=>{var O;Be(!0);const I=await te.get(`${window.routePrefix}/model/${w}/add?without_layout=true'`);Me(I.data),(O=m.current)==null||O.next(),Be(!1)},[D]),Zu=p.useCallback(async(w,I)=>{var O;I&&(w.targetBlank=I);try{await te.post("",{data:{record:w,parentId:z,type:D},_method:"createItem"})}catch(V){console.log(V)}finally{(O=m.current)==null||O.close(),Qe()}},[D,i,n]),Ju=p.useCallback(async(w,I)=>{var O,V,L,R,W,U,Y;I&&(w[0].targetBlank=I),w[0].treeId=(V=(O=i[0])==null?void 0:O.data)==null?void 0:V.id;try{const et=await te.put("",{type:(R=(L=i[0])==null?void 0:L.data)==null?void 0:R.type,data:{record:w[0]},modelId:(U=(W=i[0])==null?void 0:W.data)==null?void 0:U.modelId,_method:"updateItem"});r(pr=>{const{modelId:mn,type:vn,name:yn}=et.data.data;return mn===void 0||vn===void 0?(console.warn("No modelId or type in response!"),pr):pr.map(At=>{var Es,Ds;return((Es=At.data)==null?void 0:Es.modelId)===mn&&((Ds=At.data)==null?void 0:Ds.type)===vn?{...At,text:yn,data:{...At.data,...et.data}}:At})})}catch(et){console.error("Error updating model:",et)}finally{(Y=m.current)==null||Y.close()}},[i,r]),Ss=async w=>{if(w.trim())try{const I=await te.post("",{s:w,_method:"search"});console.log(I.data)}catch(I){console.error("Error searching:",I)}},Qu=p.useCallback(cd(Ss,500),[n,Qe]),ed=p.useCallback((w,I)=>{if(w){const O=i.some(V=>V.id===I.id);s([]),O||(Rt(I),td(I))}},[]),td=p.useCallback(async w=>{var I,O;fe([]),Fe(!0);try{const V=await te.post("",{items:[w],type:"context",_method:"getActions"});V.data&&((O=(I=V==null?void 0:V.data)==null?void 0:I.data)!=null&&O.length)&&fe(V.data.data)}catch(V){console.error(V)}finally{Fe(!1)}},[]),ws=p.useCallback(async w=>{var V;const I=M.find(L=>L.id===w)??ee.find(L=>L.id===w);if(!I)return;let O=null;switch(I.type){case"link":O=await te.put("",{actionId:I.id,_method:"getLink"}),O.data&&((V=window.open(`${O.data.data}`,"_blank"))==null||V.focus());break;case"basic":let L={actionID:I.id,items:[i[0]]};try{Os.warning(u["Performing an action..."]),await te.put("",{data:L,_method:"handleAction"})}catch(R){console.error(R)}finally{Os.success(u["Action completed"])}break}},[M,i,ee]);return v.jsx(v.Fragment,{children:f?v.jsxs(v.Fragment,{children:[v.jsx(gr,{className:"h-12 w-1/4 rounded-md"}),v.jsx(gr,{className:"h-12 w-full rounded-md"}),v.jsx(gr,{className:"h-full w-full rounded-md"})]}):v.jsxs(Gl.Provider,{value:{messages:u,setMessages:d},children:[v.jsx(Rd,{position:"top-center",richColors:!0,closeButton:!0}),v.jsxs("div",{className:"flex gap-8 items-center mb-4",children:[v.jsx("h1",{className:"text-[28px] leading-[36px] text-foreground",children:u[o.catalogName]}),o.idList.length>0&&v.jsxs(Ci,{defaultValue:o.catalogId,onValueChange:w=>{sd.get(`${window.routePrefix}/catalog/${o.catalogSlug}/${w}`)},children:[v.jsx(bi,{className:"w-full max-w-[170px] cursor-pointer",children:v.jsx(Ti,{placeholder:u["Select Ids"]})}),v.jsx(wi,{children:o.idList.map(w=>v.jsx(Si,{value:w,children:w},w))})]})]}),v.jsxs("div",{className:"md:grid md:grid-cols-[minmax(70px,_800px)_minmax(150px,_250px)] md:gap-10 justify-between flex flex-col gap-3.5",children:[v.jsxs("div",{className:"flex gap-2",children:[v.jsxs(vt,{variant:"default",size:"sm",className:`w-fit rounded-sm ${i.length===0||i.length===1&&((Cs=i[0])!=null&&Cs.droppable)?"":"opacity-50 pointer-events-none"}`,onClick:()=>{var w;N("create"),(w=m.current)==null||w.open()},children:[v.jsx(Ra,{}),u.create]}),v.jsxs(vt,{variant:"outline",size:"sm",className:`w-fit cursor-pointer rounded-sm ${i.length>1||!i.length?"opacity-50 pointer-events-none":""}`,onClick:()=>{var w;gn(),N("update"),(w=m.current)==null||w.open()},children:[v.jsx(ud,{}),u.Edit]}),v.jsx(dd,{btnTitle:u.Delete,ref:e,variant:"destructive",btnCLass:`w-fit text-white hover ${i.length?"":"opacity-50 pointer-events-none"}`,delModal:{yes:u.Yes,no:u.No,text:u["Are you sure?"]},isLink:!1,handleDelete:gt}),v.jsxs(vt,{variant:"secondary",size:"sm",className:`w-fit cursor-pointer rounded-sm ${i.length?"":"opacity-50 pointer-events-none"}`,onClick:()=>{s([])},children:[v.jsx(Nd,{}),u.Clean]}),v.jsx("div",{className:"ml-4",children:M.map(w=>v.jsxs(vt,{variant:"secondary",size:"sm",onClick:()=>ws(w.id),children:[v.jsx(Ei,{name:w.icon}),w.name]},w.id))})]}),v.jsx("div",{children:v.jsx($r,{type:"search",autoFocus:!1,placeholder:u.Search,className:"w-full max-w-[200px] p-2 border rounded",onChange:w=>{Qu(w.target.value)},onKeyDown:w=>{w.key==="Enter"&&(w.preventDefault(),Ss(w.currentTarget.value))}})})]}),v.jsx("div",{className:"h-full",children:v.jsx(dy,{backend:Wy,options:mx(),children:v.jsx("div",{className:On.app,children:v.jsx(Ax,{ref:t,tree:n,rootId:0,render:(w,{depth:I,isOpen:O,onToggle:V})=>{var L;return v.jsxs(sS,{onOpenChange:R=>ed(R,w),children:[v.jsx(oS,{children:v.jsx(Vx,{node:w,depth:I,isOpen:O,loading:C===w.id,isSelected:!!i.find(R=>R.id===w.id),onToggle:R=>{V(),pt(R,!O)},onSelect:Rt})}),v.jsxs(aS,{children:[v.jsx(In,{className:`${(L=i[0])!=null&&L.droppable?"":"opacity-50 pointer-events-none"}`,onClick:()=>{var R;N("create"),(R=m.current)==null||R.open(),console.log(i[0])},children:u.create}),v.jsx(In,{onClick:()=>{var R;gn(),N("update"),(R=m.current)==null||R.open()},children:u.Edit}),v.jsx(In,{variant:"destructive",onClick:()=>{var R;document.body.removeAttribute("style"),(R=e.current)==null||R.click()},className:i.length?"":"opacity-50 pointer-events-none",children:u.Delete}),qe?v.jsx(wt,{className:"mx-auto size-3 animate-spin"}):ee.map(R=>v.jsx(In,{onClick:()=>ws(R.id),children:R.name},R.id))]})]})},dropTargetOffset:5,insertDroppableFirst:!1,classes:{draggingSource:On.draggingSource,dropTarget:On.dropTarget,placeholder:On.placeholderContainer,root:"py-4"},canDrop:(w,{dragSource:I,dropTargetId:O})=>{if((I==null?void 0:I.parent)===O)return!0},sort:!1,dragPreviewRender:w=>v.jsx(Ux,{monitorProps:w}),onDrop:Je,placeholderRender:(w,{depth:I})=>v.jsx(Xx,{node:w,depth:I}),rootProps:{onClick:pn}})})})}),v.jsx(fS,{dialogRef:m,PopupEvent:_,firstRender:xe,secondRender:de,popupType:T,addProps:Ze,editModel:Ju,popUpTargetBlank:re,isNavigation:ie,messages:u,DynamicComponent:B,addLinksGroupProps:x,reloadCatalog:Qe,itemType:D,parentid:z,addItemProps:g,getAddModelJSON:qu,addModel:Zu,items:c,selectCatalogItem:hr})]})})},pS=[];function bw(){const t=Oe.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=v.jsx(od,{breadcrumbs:pS,children:v.jsx("div",{className:"flex h-full flex-1 flex-col gap-4 rounded-xl p-4",children:v.jsx(hS,{})})}),t[0]=e):e=t[0],e}export{bw as default};