react-beauty-calendar 1.2.10 → 1.3.0

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.
@@ -1,113 +1,113 @@
1
- "use strict";require('./assets/main.css');var kg=Object.defineProperty;var _g=(e,t,n)=>t in e?kg(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Xt=(e,t,n)=>_g(e,typeof t!="symbol"?t+"":t,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("react/jsx-runtime"),E=require("react"),vt=require("react-dom");function wd(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const D=wd(E),Wo=wd(vt);class Ng extends ReferenceError{constructor(t="Calendar instance is not initialized. Ensure the calendar is rendered before calling this method."){super(t),this.name="ReferenceErrorCustom"}}const kc=e=>{let t;const n=new Set,r=(l,u)=>{const d=typeof l=="function"?l(t):l;if(!Object.is(d,t)){const f=t;t=u??(typeof d!="object"||d===null)?d:Object.assign({},t,d),n.forEach(h=>h(t,f))}},o=()=>t,a={setState:r,getState:o,getInitialState:()=>c,subscribe:l=>(n.add(l),()=>n.delete(l))},c=t=e(r,o,a);return a},Ar=e=>e?kc(e):kc,Ig=e=>e;function Ho(e,t=Ig){const n=E.useSyncExternalStore(e.subscribe,()=>t(e.getState()),()=>t(e.getInitialState()));return E.useDebugValue(n),n}const _c=e=>{const t=Ar(e),n=r=>Ho(t,r);return Object.assign(n,t),n},Uo=e=>e?_c(e):_c,Sd={selectedDate:new Date,isBookingLoading:!1,bookingModalState:!1,selectedHour:"",cardsRef:new Map},jg=e=>Ar(t=>({...Sd,...e,clearDraggingBookings:()=>t(n=>({...n,draggingBooking:null})),changeNewBookingStateModal:()=>t({bookingModalState:!0}),openNewBookingModal:(n,r)=>{n&&t({selectedDate:n}),r&&t({selectedHour:r})},setIsBookingLoading:()=>t({isBookingLoading:!0}),setSelectedDate:n=>t(r=>({...r,selectedDate:n})),setSelectedHour:n=>t(r=>({...r,selectedHour:n})),setCardRef:(n,r)=>t(o=>({...o,cardsRef:o.cardsRef.set(n,r)}))})),Cd=6e4,Lg=36e5,Nc=Symbol.for("constructDateFrom");function ea(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&Nc in e?e[Nc](t):e instanceof Date?new e.constructor(t):new Date(t)}function ai(e,t){return ea(e,e)}function Td(e,...t){const n=ea.bind(null,t.find(r=>typeof r=="object"));return t.map(n)}function Vg(e,t,n){const r=ai(e);return r.setTime(r.getTime()+t*Cd),r}function Dd(e){return t=>{const r=(e?Math[e]:Math.trunc)(t);return r===0?0:r}}function Fg(e,t,n){const[r,o]=Td(n==null?void 0:n.in,e,t),s=(+r-+o)/Lg;return Dd(n==null?void 0:n.roundingMethod)(s)}function $g(e,t){return+ai(e)-+ai(t)}function Bg(e,t,n){const r=$g(e,t)/Cd;return Dd(n==null?void 0:n.roundingMethod)(r)}function zg(e,t){const[n,r]=Td(e,t.start,t.end);return{start:n,end:r}}function Wg(e,t){const{start:n,end:r}=zg(t==null?void 0:t.in,e);let o=+n>+r;const s=o?+n:+r,i=o?r:n;i.setMinutes(0,0,0);let a=1;const c=[];for(;+i<=s;)c.push(ea(n,i)),i.setHours(i.getHours()+a);return o?c.reverse():c}function Hg(e,t,n){return Vg(e,-t)}function Ug(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Yg(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,o.get?o:{enumerable:!0,get:function(){return e[r]}})}),n}var mo={exports:{}},Kg=mo.exports,Ic;function Gg(){return Ic||(Ic=1,function(e,t){(function(n,r){e.exports=r()})(Kg,function(){var n=1e3,r=6e4,o=36e5,s="millisecond",i="second",a="minute",c="hour",l="day",u="week",d="month",f="quarter",h="year",S="date",p="Invalid Date",b=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,v=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,m={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(j){var F=["th","st","nd","rd"],N=j%100;return"["+j+(F[(N-20)%10]||F[N]||F[0])+"]"}},g=function(j,F,N){var k=String(j);return!k||k.length>=F?j:""+Array(F+1-k.length).join(N)+j},C={s:g,z:function(j){var F=-j.utcOffset(),N=Math.abs(F),k=Math.floor(N/60),P=N%60;return(F<=0?"+":"-")+g(k,2,"0")+":"+g(P,2,"0")},m:function j(F,N){if(F.date()<N.date())return-j(N,F);var k=12*(N.year()-F.year())+(N.month()-F.month()),P=F.clone().add(k,d),I=N-P<0,A=F.clone().add(k+(I?-1:1),d);return+(-(k+(N-P)/(I?P-A:A-P))||0)},a:function(j){return j<0?Math.ceil(j)||0:Math.floor(j)},p:function(j){return{M:d,y:h,w:u,d:l,D:S,h:c,m:a,s:i,ms:s,Q:f}[j]||String(j||"").toLowerCase().replace(/s$/,"")},u:function(j){return j===void 0}},y="en",M={};M[y]=m;var x="$isDayjsObject",T=function(j){return j instanceof z||!(!j||!j[x])},R=function j(F,N,k){var P;if(!F)return y;if(typeof F=="string"){var I=F.toLowerCase();M[I]&&(P=I),N&&(M[I]=N,P=I);var A=F.split("-");if(!P&&A.length>1)return j(A[0])}else{var V=F.name;M[V]=F,P=V}return!k&&P&&(y=P),P||!k&&y},_=function(j,F){if(T(j))return j.clone();var N=typeof F=="object"?F:{};return N.date=j,N.args=arguments,new z(N)},O=C;O.l=R,O.i=T,O.w=function(j,F){return _(j,{locale:F.$L,utc:F.$u,x:F.$x,$offset:F.$offset})};var z=function(){function j(N){this.$L=R(N.locale,null,!0),this.parse(N),this.$x=this.$x||N.x||{},this[x]=!0}var F=j.prototype;return F.parse=function(N){this.$d=function(k){var P=k.date,I=k.utc;if(P===null)return new Date(NaN);if(O.u(P))return new Date;if(P instanceof Date)return new Date(P);if(typeof P=="string"&&!/Z$/i.test(P)){var A=P.match(b);if(A){var V=A[2]-1||0,W=(A[7]||"0").substring(0,3);return I?new Date(Date.UTC(A[1],V,A[3]||1,A[4]||0,A[5]||0,A[6]||0,W)):new Date(A[1],V,A[3]||1,A[4]||0,A[5]||0,A[6]||0,W)}}return new Date(P)}(N),this.init()},F.init=function(){var N=this.$d;this.$y=N.getFullYear(),this.$M=N.getMonth(),this.$D=N.getDate(),this.$W=N.getDay(),this.$H=N.getHours(),this.$m=N.getMinutes(),this.$s=N.getSeconds(),this.$ms=N.getMilliseconds()},F.$utils=function(){return O},F.isValid=function(){return this.$d.toString()!==p},F.isSame=function(N,k){var P=_(N);return this.startOf(k)<=P&&P<=this.endOf(k)},F.isAfter=function(N,k){return _(N)<this.startOf(k)},F.isBefore=function(N,k){return this.endOf(k)<_(N)},F.$g=function(N,k,P){return O.u(N)?this[k]:this.set(P,N)},F.unix=function(){return Math.floor(this.valueOf()/1e3)},F.valueOf=function(){return this.$d.getTime()},F.startOf=function(N,k){var P=this,I=!!O.u(k)||k,A=O.p(N),V=function(X,U){var ne=O.w(P.$u?Date.UTC(P.$y,U,X):new Date(P.$y,U,X),P);return I?ne:ne.endOf(l)},W=function(X,U){return O.w(P.toDate()[X].apply(P.toDate("s"),(I?[0,0,0,0]:[23,59,59,999]).slice(U)),P)},H=this.$W,L=this.$M,Y=this.$D,K="set"+(this.$u?"UTC":"");switch(A){case h:return I?V(1,0):V(31,11);case d:return I?V(1,L):V(0,L+1);case u:var $=this.$locale().weekStart||0,q=(H<$?H+7:H)-$;return V(I?Y-q:Y+(6-q),L);case l:case S:return W(K+"Hours",0);case c:return W(K+"Minutes",1);case a:return W(K+"Seconds",2);case i:return W(K+"Milliseconds",3);default:return this.clone()}},F.endOf=function(N){return this.startOf(N,!1)},F.$set=function(N,k){var P,I=O.p(N),A="set"+(this.$u?"UTC":""),V=(P={},P[l]=A+"Date",P[S]=A+"Date",P[d]=A+"Month",P[h]=A+"FullYear",P[c]=A+"Hours",P[a]=A+"Minutes",P[i]=A+"Seconds",P[s]=A+"Milliseconds",P)[I],W=I===l?this.$D+(k-this.$W):k;if(I===d||I===h){var H=this.clone().set(S,1);H.$d[V](W),H.init(),this.$d=H.set(S,Math.min(this.$D,H.daysInMonth())).$d}else V&&this.$d[V](W);return this.init(),this},F.set=function(N,k){return this.clone().$set(N,k)},F.get=function(N){return this[O.p(N)]()},F.add=function(N,k){var P,I=this;N=Number(N);var A=O.p(k),V=function(L){var Y=_(I);return O.w(Y.date(Y.date()+Math.round(L*N)),I)};if(A===d)return this.set(d,this.$M+N);if(A===h)return this.set(h,this.$y+N);if(A===l)return V(1);if(A===u)return V(7);var W=(P={},P[a]=r,P[c]=o,P[i]=n,P)[A]||1,H=this.$d.getTime()+N*W;return O.w(H,this)},F.subtract=function(N,k){return this.add(-1*N,k)},F.format=function(N){var k=this,P=this.$locale();if(!this.isValid())return P.invalidDate||p;var I=N||"YYYY-MM-DDTHH:mm:ssZ",A=O.z(this),V=this.$H,W=this.$m,H=this.$M,L=P.weekdays,Y=P.months,K=P.meridiem,$=function(U,ne,B,ie){return U&&(U[ne]||U(k,I))||B[ne].slice(0,ie)},q=function(U){return O.s(V%12||12,U,"0")},X=K||function(U,ne,B){var ie=U<12?"AM":"PM";return B?ie.toLowerCase():ie};return I.replace(v,function(U,ne){return ne||function(B){switch(B){case"YY":return String(k.$y).slice(-2);case"YYYY":return O.s(k.$y,4,"0");case"M":return H+1;case"MM":return O.s(H+1,2,"0");case"MMM":return $(P.monthsShort,H,Y,3);case"MMMM":return $(Y,H);case"D":return k.$D;case"DD":return O.s(k.$D,2,"0");case"d":return String(k.$W);case"dd":return $(P.weekdaysMin,k.$W,L,2);case"ddd":return $(P.weekdaysShort,k.$W,L,3);case"dddd":return L[k.$W];case"H":return String(V);case"HH":return O.s(V,2,"0");case"h":return q(1);case"hh":return q(2);case"a":return X(V,W,!0);case"A":return X(V,W,!1);case"m":return String(W);case"mm":return O.s(W,2,"0");case"s":return String(k.$s);case"ss":return O.s(k.$s,2,"0");case"SSS":return O.s(k.$ms,3,"0");case"Z":return A}return null}(U)||A.replace(":","")})},F.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},F.diff=function(N,k,P){var I,A=this,V=O.p(k),W=_(N),H=(W.utcOffset()-this.utcOffset())*r,L=this-W,Y=function(){return O.m(A,W)};switch(V){case h:I=Y()/12;break;case d:I=Y();break;case f:I=Y()/3;break;case u:I=(L-H)/6048e5;break;case l:I=(L-H)/864e5;break;case c:I=L/o;break;case a:I=L/r;break;case i:I=L/n;break;default:I=L}return P?I:O.a(I)},F.daysInMonth=function(){return this.endOf(d).$D},F.$locale=function(){return M[this.$L]},F.locale=function(N,k){if(!N)return this.$L;var P=this.clone(),I=R(N,k,!0);return I&&(P.$L=I),P},F.clone=function(){return O.w(this.$d,this)},F.toDate=function(){return new Date(this.valueOf())},F.toJSON=function(){return this.isValid()?this.toISOString():null},F.toISOString=function(){return this.$d.toISOString()},F.toString=function(){return this.$d.toUTCString()},j}(),G=z.prototype;return _.prototype=G,[["$ms",s],["$s",i],["$m",a],["$H",c],["$W",l],["$M",d],["$y",h],["$D",S]].forEach(function(j){G[j[1]]=function(F){return this.$g(F,j[0],j[1])}}),_.extend=function(j,F){return j.$i||(j(F,z,_),j.$i=!0),_},_.locale=R,_.isDayjs=T,_.unix=function(j){return _(1e3*j)},_.en=M[y],_.Ls=M,_.p={},_})}(mo)),mo.exports}var qg=Gg();const jc=Ug(qg),oe={DAY:"day",WEEK:"week",TABLE:"table",MONTH:"month"},jt=600,ci=15,ta="00:00",Mn=["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],li=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],Xg=["Domingo","Segunda","Terça","Quarta","Quinta","Sexta","Sábado"],Z={findIndexToStart(e=new Date){const t=li[e.getDay()];return this.findActualDayIndex(t)},findActualDayIndex(e){return li.indexOf(e)},generateWeekDays(e){const t=this.findIndexToStart(e);return{week:new Array(7).fill(0).map((o,s)=>{const i=e||new Date,a=s-t;return new Date(i.getFullYear(),i.getMonth(),i.getDate()+a)})}},generateDays(e,t){const n=[],r=new Date(e.getFullYear(),e.getMonth(),e.getDate()+t);return n.push(r),n},addDay(e,t){return new Date(e.getFullYear(),e.getMonth(),e.getDate()+t)},formatDate(e){return e.split(" ").slice(2,3).join(",").replace(","," | ")},dateTimeAsString(e){const t=String(e.getHours()).padStart(2,"0"),n=String(e.getMinutes()).padStart(2,"0");return`${t}:${n}`},getTimeDiff(e,t){const n=Number(new Date(t))-Number(new Date(e)),r=Math.floor(n/1e3/60),o=Math.floor(r/60),s=r%60;return`${o}:${s.toString().padStart(2,"0")}`},buildFutureDateList(e,t,n=1){const r=(o,s)=>{const i=new Date(o),a=i.getDate()+s+n;return i.setDate(a),i};return Array.from({length:t},(o,s)=>r(e.startAt,s))},bookingTimeRange:(e,t)=>{const n=Z.getTimeDiff(e.startAt,e.finishAt),r=Z.getNewFinishAt(t,n);return{id:e.id,startAt:new Date(t),finishAt:r}},getNewFinishAt(e,t){const n=new Date(e),r=t.split(":"),o=Number(r[0]),s=Number(r[1]);return n.setHours(n.getHours()+o),n.setMinutes(n.getMinutes()+s),n},minuteDifference(e,t){return Bg(e,t)},calculateDaysDifference(e,t){return e.getDate()-t.getDate()},dateAndHourDateToString(e){const t=new Date(e);return`${t.getHours().toLocaleString().padStart(2,"0")}:${t.getMinutes().toLocaleString().padStart(2,"0")}`},shortMonthDescription(...e){return`${Mn[e[0].getMonth()].slice(0,3)} - ${Mn[e[1].getMonth()].slice(0,3)}`},timeDiffInSeconds(e,t){const n=jc(e),r=jc(t);return n.diff(r)/6e4},subtractMinutes(e,t){return Hg(e,t)},addMinuteToHour(e,t){return`${e.split(":")[0]}:${t}`},dateToString(e){return new Date(e).toTimeString()},dateToStringSelected(e){return new Date(e).toDateString()},roundMinutes(e){return e>=15&&e<30?15:e>=30&&e<45?30:e>=45&&e<60?45:0},hourMinutesStringToDate(e){const t=new Date,[n,r]=e.split(":");return t.setHours(Number(n),Number(r)),t},addMinutesToDate(e,t){const n=new Date(e);return n.setHours(n.getHours(),n.getMinutes()+t,n.getMinutes()),n},newDateKey(e,t){const n=new Date(e);return n.setHours(Number(t.split(":")[0])),n.setMinutes(Number(t.split(":")[1])),n.toString()},addMinutesToHour(e,t){const n=Z.hourMinutesStringToDate(e),r=Z.addMinutesToDate(n,t);return Z.dateAndHourDateToString(r)},convertStringTimeToDateFormat(e){const t=new Date,[n,r]=e.split(":");return t.setHours(Number(n),Number(r),0,0),t},isTodayDate(e){const t=new Date,n=e.getDate()===t.getDate(),r=e.getMonth()===t.getMonth(),o=e.getFullYear()===t.getFullYear();return n&&r&&o},firstAndLastWeekDays(e){return{firstDayOfWeek:e[0],lastDayOfWeek:e[e.length-1]}},generateWeekMonthLabel(e){const{firstDayOfWeek:t,lastDayOfWeek:n}=Z.firstAndLastWeekDays(e),r=t.getMonth();return r!==n.getMonth()?Z.shortMonthDescription(t,n):Mn[r]}},Zg=(e,t)=>{const r=Wg({start:new Date(2014,9,6,e),end:new Date(2014,9,6,t)}).sort((o,s)=>{const i=new Date(o).getHours(),a=new Date(s).getHours();return i-a});return Object.values(r).map(o=>`${String(o.getHours()).padStart(2,"0")}:00`)},Ed=1,Md=24,Jg=Z.generateWeekDays(),Qg=(e,t)=>({hours:Zg(Ed,Md),daysOfWeek:Jg.week,timesRendered:new Map,setTodayDay:n=>{const r=Z.generateDays(n,0);return e(o=>({...o,daysOfWeek:r,lastDayOfWeek:r[0]||new Date})),r[0]},todayWeek:n=>{let r=[];return e(o=>{const{week:s}=Z.generateWeekDays(n);return r=s,{...o,daysOfWeek:s}}),r},nextWeek:()=>{const n=Z.addDay(t().getWeek().lastDayOfWeek,1);let r=[];const{week:o}=Z.generateWeekDays(n);return r=o,e(s=>({...s,daysOfWeek:o})),r},previousWeek:()=>{const n=Z.addDay(t().getWeek().firstDayOfWeek,-1);let r=[];const{week:o}=Z.generateWeekDays(n);return r=o,e(s=>({...s,daysOfWeek:o})),r},setDays:n=>{const r=t().daysOfWeek[0];if(!r)return[];const o=Z.generateDays(r,n);return e(s=>({...s,daysOfWeek:o})),o},getWeek:()=>{const n=t().daysOfWeek[0],r=t().daysOfWeek[t().daysOfWeek.length-1];return{firstDayOfWeek:n,lastDayOfWeek:r}},addTimesRendered:(n,r)=>{e(o=>{const s=o.timesRendered;return s.get(r)?{...o}:(s.set(r,n),{...o,timeRenderedPrev:s})})}}),on=e=>{const t=new Date(e.key),n=t.getDate().toString().padStart(2,"0"),r=(t.getMonth()+1).toString().padStart(2,"0");return`${`${t.getFullYear()}-${r}-${n}`};${e.time}`},Tt=Uo((e,t)=>({emptySlotNodes:new Map,selectedNode:"",setEmptySlotNode:(n,r)=>{e(o=>{const s=new Map(o.emptySlotNodes),d=(Fg(new Date(`1970/01/01 ${Md}`),new Date(2014,6,0,Number(Ed),0))+2)*4*7-1;s.size>d&&s.clear();const h=on(r);return s.set(h,n),{...o,emptySlotNodes:s}})},setSelectedNode:n=>{const r=new Map(t().emptySlotNodes),o=t().selectedNode;e(s=>{if(o.length){const i=r.get(o);i&&i.closeEvent()}return{...s,selectedNode:n}})},resetNodes:()=>{e(n=>{const r=new Map(n.emptySlotNodes);return r.clear(),{...n,emptySlotNodes:r}})},resetSelectedNode:()=>e(n=>({...n,selectedNode:""}))})),ui={date:"",startAt:"",finishAt:"",slotStartAt:""},ev=e=>Ar((t,n)=>({...ui,...e,updateForm:r=>t(o=>({...o,...r})),updateDynamicForm:(r,o)=>t(s=>({...s,[r]:o})),updateStartAt:r=>t(o=>({...o,startAt:r})),updateFinishAt:r=>t(o=>({...o,finishAt:r})),updateFinishAtWithOffset:(r,o=15)=>{const s=Z.addMinutesToHour(r,o);return n().updateFinishAt(s),s},updateClient:(r,o)=>t(s=>({...s,client:{id:r,name:o}})),updateDate:r=>t(o=>({...o,date:r})),updatePrevStartAt:r=>t(o=>({...o,slotStartAt:r})),resetForm:()=>t(ui)})),tv=E.createContext(null),Rd=E.createContext(void 0),Lt=()=>{const e=E.use(Rd);if(!e)throw new Error("useBookingModal must be used within a BookingModalProvider");return e},nv=(e,t)=>({users:[],bookingViewType:"week",bookingBulkData:{user:{id:"",profile:{id:"",name:""}},booking:[]},updateUsers:n=>e(r=>({...r,users:n})),setBookingBulkData:n=>e(r=>({...r,bookingBulkData:{...n}})),updatingBookingBulkData:(n,r)=>{e(o=>{const s=o.bookingBulkData.booking.map(i=>new Date(i.startAt).getDate()===r&&n.id===i.id?n:i);return{...o,bookingBulkData:{...o.bookingBulkData,booking:s}}})},resetBookingResponse:()=>e(n=>({...n,bookingResponse:null})),setBookingViewType:n=>e(r=>({...r,bookingViewType:n})),optimisticCardUpdate:(n,r,o,s)=>{const i={...n,startAt:r,finishAt:o},a=new Date(s.day).getDate();t().updatingBookingBulkData(i,a)}}),rv=(e,t)=>({setWeekAndViewType:n=>{const r=t().todayWeek(n);return t().setBookingViewType(oe.WEEK),Z.firstAndLastWeekDays(r)},setTodayDayAndViewType:n=>{const r=t().setTodayDay(n);return t().setBookingViewType(oe.DAY),r}}),_e=Uo()((...e)=>({...Qg(...e),...nv(...e),...rv(...e)})),Pd=()=>{const{setBookingViewType:e,todayWeek:t,setTodayDay:n,daysOfWeek:r,getWeek:o}=_e();return{onViewTypeChange:i=>{switch(i){case oe.DAY:{e(oe.DAY),n(r[0]);break}case oe.WEEK:{e(oe.WEEK),t(o().firstDayOfWeek);break}case oe.TABLE:{e(oe.TABLE),n(o().firstDayOfWeek);break}}}}},Ad=E.createContext(null),Od=e=>{const t=E.use(Ad);if(!t)throw new Error("Missing useMonthDescription must be within a MonthDescriptionProvider");return Ho(t,e)},kd=E.createContext(null),ov=({children:e,ref:t,...n})=>{const r=E.useRef(null);r.current||(r.current=ev(n));const o=s=>{var i;(i=r.current)==null||i.getState().updateFinishAt(s)};return E.useImperativeHandle(t,()=>({updateFinishAt:o})),w.jsx(kd,{value:r.current,children:e})},_d=e=>{const t=E.use(kd);if(!t)throw new Error("Missing useNewEventContextProvider must be within a NewEventProvider");return Ho(t,e)},Yo=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function jn(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function na(e){return"nodeType"in e}function Ie(e){var t,n;return e?jn(e)?e:na(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function ra(e){const{Document:t}=Ie(e);return e instanceof t}function Or(e){return jn(e)?!1:e instanceof Ie(e).HTMLElement}function Nd(e){return e instanceof Ie(e).SVGElement}function Ln(e){return e?jn(e)?e.document:na(e)?ra(e)?e:Or(e)||Nd(e)?e.ownerDocument:document:document:document}const yt=Yo?E.useLayoutEffect:E.useEffect;function Ko(e){const t=E.useRef(e);return yt(()=>{t.current=e}),E.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}function sv(){const e=E.useRef(null),t=E.useCallback((r,o)=>{e.current=setInterval(r,o)},[]),n=E.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function gr(e,t){t===void 0&&(t=[e]);const n=E.useRef(e);return yt(()=>{n.current!==e&&(n.current=e)},t),n}function kr(e,t){const n=E.useRef();return E.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function To(e){const t=Ko(e),n=E.useRef(null),r=E.useCallback(o=>{o!==n.current&&(t==null||t(o,n.current)),n.current=o},[]);return[n,r]}function Do(e){const t=E.useRef();return E.useEffect(()=>{t.current=e},[e]),t.current}let Ds={};function Go(e,t){return E.useMemo(()=>{if(t)return t;const n=Ds[e]==null?0:Ds[e]+1;return Ds[e]=n,e+"-"+n},[e,t])}function Id(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.reduce((s,i)=>{const a=Object.entries(i);for(const[c,l]of a){const u=s[c];u!=null&&(s[c]=u+e*l)}return s},{...t})}}const Rn=Id(1),Eo=Id(-1);function iv(e){return"clientX"in e&&"clientY"in e}function oa(e){if(!e)return!1;const{KeyboardEvent:t}=Ie(e.target);return t&&e instanceof t}function av(e){if(!e)return!1;const{TouchEvent:t}=Ie(e.target);return t&&e instanceof t}function Mo(e){if(av(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return iv(e)?{x:e.clientX,y:e.clientY}:null}const vr=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[vr.Translate.toString(e),vr.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),Lc="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function cv(e){return e.matches(Lc)?e:e.querySelector(Lc)}const lv={display:"none"};function uv(e){let{id:t,value:n}=e;return E.createElement("div",{id:t,style:lv},n)}function dv(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;const o={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return E.createElement("div",{id:t,style:o,role:"status","aria-live":r,"aria-atomic":!0},n)}function fv(){const[e,t]=E.useState("");return{announce:E.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const jd=E.createContext(null);function _r(e){const t=E.useContext(jd);E.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function hv(){const[e]=E.useState(()=>new Set),t=E.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[E.useCallback(r=>{let{type:o,event:s}=r;e.forEach(i=>{var a;return(a=i[o])==null?void 0:a.call(i,s)})},[e]),t]}const pv={draggable:`
2
- To pick up a draggable item, press the space bar.
3
- While dragging, use the arrow keys to move the item.
4
- Press space again to drop the item in its new position, or press escape to cancel.
5
- `},mv={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function gv(e){let{announcements:t=mv,container:n,hiddenTextDescribedById:r,screenReaderInstructions:o=pv}=e;const{announce:s,announcement:i}=fv(),a=Go("DndLiveRegion"),[c,l]=E.useState(!1);if(E.useEffect(()=>{l(!0)},[]),_r(E.useMemo(()=>({onDragStart(d){let{active:f}=d;s(t.onDragStart({active:f}))},onDragMove(d){let{active:f,over:h}=d;t.onDragMove&&s(t.onDragMove({active:f,over:h}))},onDragOver(d){let{active:f,over:h}=d;s(t.onDragOver({active:f,over:h}))},onDragEnd(d){let{active:f,over:h}=d;s(t.onDragEnd({active:f,over:h}))},onDragCancel(d){let{active:f,over:h}=d;s(t.onDragCancel({active:f,over:h}))}}),[s,t])),!c)return null;const u=E.createElement(E.Fragment,null,E.createElement(uv,{id:r,value:o.draggable}),E.createElement(dv,{id:a,announcement:i}));return n?vt.createPortal(u,n):u}var Se;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(Se||(Se={}));function Ro(){}function Vc(e,t){return E.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function vv(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return E.useMemo(()=>[...t].filter(r=>r!=null),[...t])}const tt=Object.freeze({x:0,y:0});function yv(e,t){const n=Mo(e);if(!n)return"0 0";const r={x:(n.x-t.left)/t.width*100,y:(n.y-t.top)/t.height*100};return r.x+"% "+r.y+"%"}function bv(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function xv(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function wv(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),s=Math.min(t.top+t.height,e.top+e.height),i=o-r,a=s-n;if(r<o&&n<s){const c=t.width*t.height,l=e.width*e.height,u=i*a,d=u/(c+l-u);return Number(d.toFixed(4))}return 0}const Sv=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=[];for(const s of r){const{id:i}=s,a=n.get(i);if(a){const c=wv(a,t);c>0&&o.push({id:i,data:{droppableContainer:s,value:c}})}}return o.sort(bv)};function Cv(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function Ld(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:tt}function Tv(e){return function(n){for(var r=arguments.length,o=new Array(r>1?r-1:0),s=1;s<r;s++)o[s-1]=arguments[s];return o.reduce((i,a)=>({...i,top:i.top+e*a.y,bottom:i.bottom+e*a.y,left:i.left+e*a.x,right:i.right+e*a.x}),{...n})}}const Dv=Tv(1);function Vd(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function Ev(e,t,n){const r=Vd(t);if(!r)return e;const{scaleX:o,scaleY:s,x:i,y:a}=r,c=e.left-i-(1-o)*parseFloat(n),l=e.top-a-(1-s)*parseFloat(n.slice(n.indexOf(" ")+1)),u=o?e.width/o:e.width,d=s?e.height/s:e.height;return{width:u,height:d,top:l,right:c+u,bottom:l+d,left:c}}const Mv={ignoreTransform:!1};function Nr(e,t){t===void 0&&(t=Mv);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:l,transformOrigin:u}=Ie(e).getComputedStyle(e);l&&(n=Ev(n,l,u))}const{top:r,left:o,width:s,height:i,bottom:a,right:c}=n;return{top:r,left:o,width:s,height:i,bottom:a,right:c}}function Fc(e){return Nr(e,{ignoreTransform:!0})}function Rv(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function Pv(e,t){return t===void 0&&(t=Ie(e).getComputedStyle(e)),t.position==="fixed"}function Av(e,t){t===void 0&&(t=Ie(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(o=>{const s=t[o];return typeof s=="string"?n.test(s):!1})}function sa(e,t){const n=[];function r(o){if(t!=null&&n.length>=t||!o)return n;if(ra(o)&&o.scrollingElement!=null&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!Or(o)||Nd(o)||n.includes(o))return n;const s=Ie(e).getComputedStyle(o);return o!==e&&Av(o,s)&&n.push(o),Pv(o,s)?n:r(o.parentNode)}return e?r(e):n}function Fd(e){const[t]=sa(e,1);return t??null}function Es(e){return!Yo||!e?null:jn(e)?e:na(e)?ra(e)||e===Ln(e).scrollingElement?window:Or(e)?e:null:null}function $d(e){return jn(e)?e.scrollX:e.scrollLeft}function Bd(e){return jn(e)?e.scrollY:e.scrollTop}function di(e){return{x:$d(e),y:Bd(e)}}var Ce;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(Ce||(Ce={}));function zd(e){return!Yo||!e?!1:e===document.scrollingElement}function Wd(e){const t={x:0,y:0},n=zd(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},o=e.scrollTop<=t.y,s=e.scrollLeft<=t.x,i=e.scrollTop>=r.y,a=e.scrollLeft>=r.x;return{isTop:o,isLeft:s,isBottom:i,isRight:a,maxScroll:r,minScroll:t}}const Ov={x:.2,y:.2};function kv(e,t,n,r,o){let{top:s,left:i,right:a,bottom:c}=n;r===void 0&&(r=10),o===void 0&&(o=Ov);const{isTop:l,isBottom:u,isLeft:d,isRight:f}=Wd(e),h={x:0,y:0},S={x:0,y:0},p={height:t.height*o.y,width:t.width*o.x};return!l&&s<=t.top+p.height?(h.y=Ce.Backward,S.y=r*Math.abs((t.top+p.height-s)/p.height)):!u&&c>=t.bottom-p.height&&(h.y=Ce.Forward,S.y=r*Math.abs((t.bottom-p.height-c)/p.height)),!f&&a>=t.right-p.width?(h.x=Ce.Forward,S.x=r*Math.abs((t.right-p.width-a)/p.width)):!d&&i<=t.left+p.width&&(h.x=Ce.Backward,S.x=r*Math.abs((t.left+p.width-i)/p.width)),{direction:h,speed:S}}function _v(e){if(e===document.scrollingElement){const{innerWidth:s,innerHeight:i}=window;return{top:0,left:0,right:s,bottom:i,width:s,height:i}}const{top:t,left:n,right:r,bottom:o}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:o,width:e.clientWidth,height:e.clientHeight}}function Hd(e){return e.reduce((t,n)=>Rn(t,di(n)),tt)}function Nv(e){return e.reduce((t,n)=>t+$d(n),0)}function Iv(e){return e.reduce((t,n)=>t+Bd(n),0)}function Ud(e,t){if(t===void 0&&(t=Nr),!e)return;const{top:n,left:r,bottom:o,right:s}=t(e);Fd(e)&&(o<=0||s<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const jv=[["x",["left","right"],Nv],["y",["top","bottom"],Iv]];class ia{constructor(t,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const r=sa(n),o=Hd(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[s,i,a]of jv)for(const c of i)Object.defineProperty(this,c,{get:()=>{const l=a(r),u=o[s]-l;return this.rect[c]+u},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class lr{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...n)})},this.target=t}add(t,n,r){var o;(o=this.target)==null||o.addEventListener(t,n,r),this.listeners.push([t,n,r])}}function Lv(e){const{EventTarget:t}=Ie(e);return e instanceof t?e:Ln(e)}function Ms(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t?r>t.y:!1}var Ge;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(Ge||(Ge={}));function $c(e){e.preventDefault()}function Vv(e){e.stopPropagation()}var he;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(he||(he={}));const Yd={start:[he.Space,he.Enter],cancel:[he.Esc],end:[he.Space,he.Enter,he.Tab]},Fv=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case he.Right:return{...n,x:n.x+25};case he.Left:return{...n,x:n.x-25};case he.Down:return{...n,y:n.y+25};case he.Up:return{...n,y:n.y-25}}};class Kd{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:n}}=t;this.props=t,this.listeners=new lr(Ln(n)),this.windowListeners=new lr(Ie(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Ge.Resize,this.handleCancel),this.windowListeners.add(Ge.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Ge.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&Ud(r),n(tt)}handleKeyDown(t){if(oa(t)){const{active:n,context:r,options:o}=this.props,{keyboardCodes:s=Yd,coordinateGetter:i=Fv,scrollBehavior:a="smooth"}=o,{code:c}=t;if(s.end.includes(c)){this.handleEnd(t);return}if(s.cancel.includes(c)){this.handleCancel(t);return}const{collisionRect:l}=r.current,u=l?{x:l.left,y:l.top}:tt;this.referenceCoordinates||(this.referenceCoordinates=u);const d=i(t,{active:n,context:r.current,currentCoordinates:u});if(d){const f=Eo(d,u),h={x:0,y:0},{scrollableAncestors:S}=r.current;for(const p of S){const b=t.code,{isTop:v,isRight:m,isLeft:g,isBottom:C,maxScroll:y,minScroll:M}=Wd(p),x=_v(p),T={x:Math.min(b===he.Right?x.right-x.width/2:x.right,Math.max(b===he.Right?x.left:x.left+x.width/2,d.x)),y:Math.min(b===he.Down?x.bottom-x.height/2:x.bottom,Math.max(b===he.Down?x.top:x.top+x.height/2,d.y))},R=b===he.Right&&!m||b===he.Left&&!g,_=b===he.Down&&!C||b===he.Up&&!v;if(R&&T.x!==d.x){const O=p.scrollLeft+f.x,z=b===he.Right&&O<=y.x||b===he.Left&&O>=M.x;if(z&&!f.y){p.scrollTo({left:O,behavior:a});return}z?h.x=p.scrollLeft-O:h.x=b===he.Right?p.scrollLeft-y.x:p.scrollLeft-M.x,h.x&&p.scrollBy({left:-h.x,behavior:a});break}else if(_&&T.y!==d.y){const O=p.scrollTop+f.y,z=b===he.Down&&O<=y.y||b===he.Up&&O>=M.y;if(z&&!f.x){p.scrollTo({top:O,behavior:a});return}z?h.y=p.scrollTop-O:h.y=b===he.Down?p.scrollTop-y.y:p.scrollTop-M.y,h.y&&p.scrollBy({top:-h.y,behavior:a});break}}this.handleMove(t,Rn(Eo(d,this.referenceCoordinates),h))}}}handleMove(t,n){const{onMove:r}=this.props;t.preventDefault(),r(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}Kd.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=Yd,onActivation:o}=t,{active:s}=n;const{code:i}=e.nativeEvent;if(r.start.includes(i)){const a=s.activatorNode.current;return a&&e.target!==a?!1:(e.preventDefault(),o==null||o({event:e.nativeEvent}),!0)}return!1}}];function Bc(e){return!!(e&&"distance"in e)}function zc(e){return!!(e&&"delay"in e)}class aa{constructor(t,n,r){var o;r===void 0&&(r=Lv(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=n;const{event:s}=t,{target:i}=s;this.props=t,this.events=n,this.document=Ln(i),this.documentListeners=new lr(this.document),this.listeners=new lr(r),this.windowListeners=new lr(Ie(i)),this.initialCoordinates=(o=Mo(s))!=null?o:tt,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:n,bypassActivationConstraint:r}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(Ge.Resize,this.handleCancel),this.windowListeners.add(Ge.DragStart,$c),this.windowListeners.add(Ge.VisibilityChange,this.handleCancel),this.windowListeners.add(Ge.ContextMenu,$c),this.documentListeners.add(Ge.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(zc(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(Bc(n)){this.handlePending(n);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,n){const{active:r,onPending:o}=this.props;o(r,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(Ge.Click,Vv,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Ge.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:r,initialCoordinates:o,props:s}=this,{onMove:i,options:{activationConstraint:a}}=s;if(!o)return;const c=(n=Mo(t))!=null?n:tt,l=Eo(o,c);if(!r&&a){if(Bc(a)){if(a.tolerance!=null&&Ms(l,a.tolerance))return this.handleCancel();if(Ms(l,a.distance))return this.handleStart()}if(zc(a)&&Ms(l,a.tolerance))return this.handleCancel();this.handlePending(a,l);return}t.cancelable&&t.preventDefault(),i(c)}handleEnd(){const{onAbort:t,onEnd:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleCancel(){const{onAbort:t,onCancel:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleKeydown(t){t.code===he.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const $v={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Gd extends aa{constructor(t){const{event:n}=t,r=Ln(n.target);super(t,$v,r)}}Gd.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r==null||r({event:n}),!0)}}];const Bv={move:{name:"mousemove"},end:{name:"mouseup"}};var fi;(function(e){e[e.RightClick=2]="RightClick"})(fi||(fi={}));class qd extends aa{constructor(t){super(t,Bv,Ln(t.event.target))}}qd.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===fi.RightClick?!1:(r==null||r({event:n}),!0)}}];const Rs={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class Xd extends aa{constructor(t){super(t,Rs)}static setup(){return window.addEventListener(Rs.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(Rs.move.name,t)};function t(){}}}Xd.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:o}=n;return o.length>1?!1:(r==null||r({event:n}),!0)}}];var ur;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(ur||(ur={}));var Po;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(Po||(Po={}));function zv(e){let{acceleration:t,activator:n=ur.Pointer,canScroll:r,draggingRect:o,enabled:s,interval:i=5,order:a=Po.TreeOrder,pointerCoordinates:c,scrollableAncestors:l,scrollableAncestorRects:u,delta:d,threshold:f}=e;const h=Hv({delta:d,disabled:!s}),[S,p]=sv(),b=E.useRef({x:0,y:0}),v=E.useRef({x:0,y:0}),m=E.useMemo(()=>{switch(n){case ur.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case ur.DraggableRect:return o}},[n,o,c]),g=E.useRef(null),C=E.useCallback(()=>{const M=g.current;if(!M)return;const x=b.current.x*v.current.x,T=b.current.y*v.current.y;M.scrollBy(x,T)},[]),y=E.useMemo(()=>a===Po.TreeOrder?[...l].reverse():l,[a,l]);E.useEffect(()=>{if(!s||!l.length||!m){p();return}for(const M of y){if((r==null?void 0:r(M))===!1)continue;const x=l.indexOf(M),T=u[x];if(!T)continue;const{direction:R,speed:_}=kv(M,T,m,t,f);for(const O of["x","y"])h[O][R[O]]||(_[O]=0,R[O]=0);if(_.x>0||_.y>0){p(),g.current=M,S(C,i),b.current=_,v.current=R;return}}b.current={x:0,y:0},v.current={x:0,y:0},p()},[t,C,r,p,s,i,JSON.stringify(m),JSON.stringify(h),S,l,y,u,JSON.stringify(f)])}const Wv={x:{[Ce.Backward]:!1,[Ce.Forward]:!1},y:{[Ce.Backward]:!1,[Ce.Forward]:!1}};function Hv(e){let{delta:t,disabled:n}=e;const r=Do(t);return kr(o=>{if(n||!r||!o)return Wv;const s={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[Ce.Backward]:o.x[Ce.Backward]||s.x===-1,[Ce.Forward]:o.x[Ce.Forward]||s.x===1},y:{[Ce.Backward]:o.y[Ce.Backward]||s.y===-1,[Ce.Forward]:o.y[Ce.Forward]||s.y===1}}},[n,t,r])}function Uv(e,t){const n=t!=null?e.get(t):void 0,r=n?n.node.current:null;return kr(o=>{var s;return t==null?null:(s=r??o)!=null?s:null},[r,t])}function Yv(e,t){return E.useMemo(()=>e.reduce((n,r)=>{const{sensor:o}=r,s=o.activators.map(i=>({eventName:i.eventName,handler:t(i.handler,r)}));return[...n,...s]},[]),[e,t])}var yr;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(yr||(yr={}));var hi;(function(e){e.Optimized="optimized"})(hi||(hi={}));const Wc=new Map;function Kv(e,t){let{dragging:n,dependencies:r,config:o}=t;const[s,i]=E.useState(null),{frequency:a,measure:c,strategy:l}=o,u=E.useRef(e),d=b(),f=gr(d),h=E.useCallback(function(v){v===void 0&&(v=[]),!f.current&&i(m=>m===null?v:m.concat(v.filter(g=>!m.includes(g))))},[f]),S=E.useRef(null),p=kr(v=>{if(d&&!n)return Wc;if(!v||v===Wc||u.current!==e||s!=null){const m=new Map;for(let g of e){if(!g)continue;if(s&&s.length>0&&!s.includes(g.id)&&g.rect.current){m.set(g.id,g.rect.current);continue}const C=g.node.current,y=C?new ia(c(C),C):null;g.rect.current=y,y&&m.set(g.id,y)}return m}return v},[e,s,n,d,c]);return E.useEffect(()=>{u.current=e},[e]),E.useEffect(()=>{d||h()},[n,d]),E.useEffect(()=>{s&&s.length>0&&i(null)},[JSON.stringify(s)]),E.useEffect(()=>{d||typeof a!="number"||S.current!==null||(S.current=setTimeout(()=>{h(),S.current=null},a))},[a,d,h,...r]),{droppableRects:p,measureDroppableContainers:h,measuringScheduled:s!=null};function b(){switch(l){case yr.Always:return!1;case yr.BeforeDragging:return n;default:return!n}}}function ca(e,t){return kr(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function Gv(e,t){return ca(e,t)}function qv(e){let{callback:t,disabled:n}=e;const r=Ko(t),o=E.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:s}=window;return new s(r)},[r,n]);return E.useEffect(()=>()=>o==null?void 0:o.disconnect(),[o]),o}function qo(e){let{callback:t,disabled:n}=e;const r=Ko(t),o=E.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:s}=window;return new s(r)},[n]);return E.useEffect(()=>()=>o==null?void 0:o.disconnect(),[o]),o}function Xv(e){return new ia(Nr(e),e)}function Hc(e,t,n){t===void 0&&(t=Xv);const[r,o]=E.useState(null);function s(){o(c=>{if(!e)return null;if(e.isConnected===!1){var l;return(l=c??n)!=null?l:null}const u=t(e);return JSON.stringify(c)===JSON.stringify(u)?c:u})}const i=qv({callback(c){if(e)for(const l of c){const{type:u,target:d}=l;if(u==="childList"&&d instanceof HTMLElement&&d.contains(e)){s();break}}}}),a=qo({callback:s});return yt(()=>{s(),e?(a==null||a.observe(e),i==null||i.observe(document.body,{childList:!0,subtree:!0})):(a==null||a.disconnect(),i==null||i.disconnect())},[e]),r}function Zv(e){const t=ca(e);return Ld(e,t)}const Uc=[];function Jv(e){const t=E.useRef(e),n=kr(r=>e?r&&r!==Uc&&e&&t.current&&e.parentNode===t.current.parentNode?r:sa(e):Uc,[e]);return E.useEffect(()=>{t.current=e},[e]),n}function Qv(e){const[t,n]=E.useState(null),r=E.useRef(e),o=E.useCallback(s=>{const i=Es(s.target);i&&n(a=>a?(a.set(i,di(i)),new Map(a)):null)},[]);return E.useEffect(()=>{const s=r.current;if(e!==s){i(s);const a=e.map(c=>{const l=Es(c);return l?(l.addEventListener("scroll",o,{passive:!0}),[l,di(l)]):null}).filter(c=>c!=null);n(a.length?new Map(a):null),r.current=e}return()=>{i(e),i(s)};function i(a){a.forEach(c=>{const l=Es(c);l==null||l.removeEventListener("scroll",o)})}},[o,e]),E.useMemo(()=>e.length?t?Array.from(t.values()).reduce((s,i)=>Rn(s,i),tt):Hd(e):tt,[e,t])}function Yc(e,t){t===void 0&&(t=[]);const n=E.useRef(null);return E.useEffect(()=>{n.current=null},t),E.useEffect(()=>{const r=e!==tt;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?Eo(e,n.current):tt}function ey(e){E.useEffect(()=>{if(!Yo)return;const t=e.map(n=>{let{sensor:r}=n;return r.setup==null?void 0:r.setup()});return()=>{for(const n of t)n==null||n()}},e.map(t=>{let{sensor:n}=t;return n}))}function ty(e,t){return E.useMemo(()=>e.reduce((n,r)=>{let{eventName:o,handler:s}=r;return n[o]=i=>{s(i,t)},n},{}),[e,t])}function Zd(e){return E.useMemo(()=>e?Rv(e):null,[e])}const Kc=[];function ny(e,t){t===void 0&&(t=Nr);const[n]=e,r=Zd(n?Ie(n):null),[o,s]=E.useState(Kc);function i(){s(()=>e.length?e.map(c=>zd(c)?r:new ia(t(c),c)):Kc)}const a=qo({callback:i});return yt(()=>{a==null||a.disconnect(),i(),e.forEach(c=>a==null?void 0:a.observe(c))},[e]),o}function Jd(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Or(t)?t:e}function ry(e){let{measure:t}=e;const[n,r]=E.useState(null),o=E.useCallback(l=>{for(const{target:u}of l)if(Or(u)){r(d=>{const f=t(u);return d?{...d,width:f.width,height:f.height}:f});break}},[t]),s=qo({callback:o}),i=E.useCallback(l=>{const u=Jd(l);s==null||s.disconnect(),u&&(s==null||s.observe(u)),r(u?t(u):null)},[t,s]),[a,c]=To(i);return E.useMemo(()=>({nodeRef:a,rect:n,setRef:c}),[n,a,c])}const oy=[{sensor:Gd,options:{}},{sensor:Kd,options:{}}],sy={current:{}},go={draggable:{measure:Fc},droppable:{measure:Fc,strategy:yr.WhileDragging,frequency:hi.Optimized},dragOverlay:{measure:Nr}};class dr extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,r;return(n=(r=this.get(t))==null?void 0:r.node.current)!=null?n:void 0}}const iy={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new dr,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Ro},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:go,measureDroppableContainers:Ro,windowRect:null,measuringScheduled:!1},Qd={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Ro,draggableNodes:new Map,over:null,measureDroppableContainers:Ro},Ir=E.createContext(Qd),ef=E.createContext(iy);function ay(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new dr}}}function cy(e,t){switch(t.type){case Se.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case Se.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case Se.DragEnd:case Se.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Se.RegisterDroppable:{const{element:n}=t,{id:r}=n,o=new dr(e.droppable.containers);return o.set(r,n),{...e,droppable:{...e.droppable,containers:o}}}case Se.SetDroppableDisabled:{const{id:n,key:r,disabled:o}=t,s=e.droppable.containers.get(n);if(!s||r!==s.key)return e;const i=new dr(e.droppable.containers);return i.set(n,{...s,disabled:o}),{...e,droppable:{...e.droppable,containers:i}}}case Se.UnregisterDroppable:{const{id:n,key:r}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const s=new dr(e.droppable.containers);return s.delete(n),{...e,droppable:{...e.droppable,containers:s}}}default:return e}}function ly(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:o}=E.useContext(Ir),s=Do(r),i=Do(n==null?void 0:n.id);return E.useEffect(()=>{if(!t&&!r&&s&&i!=null){if(!oa(s)||document.activeElement===s.target)return;const a=o.get(i);if(!a)return;const{activatorNode:c,node:l}=a;if(!c.current&&!l.current)return;requestAnimationFrame(()=>{for(const u of[c.current,l.current]){if(!u)continue;const d=cv(u);if(d){d.focus();break}}})}},[r,t,o,i,s]),null}function tf(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((o,s)=>s({transform:o,...r}),n):n}function uy(e){return E.useMemo(()=>({draggable:{...go.draggable,...e==null?void 0:e.draggable},droppable:{...go.droppable,...e==null?void 0:e.droppable},dragOverlay:{...go.dragOverlay,...e==null?void 0:e.dragOverlay}}),[e==null?void 0:e.draggable,e==null?void 0:e.droppable,e==null?void 0:e.dragOverlay])}function dy(e){let{activeNode:t,measure:n,initialRect:r,config:o=!0}=e;const s=E.useRef(!1),{x:i,y:a}=typeof o=="boolean"?{x:o,y:o}:o;yt(()=>{if(!i&&!a||!t){s.current=!1;return}if(s.current||!r)return;const l=t==null?void 0:t.node.current;if(!l||l.isConnected===!1)return;const u=n(l),d=Ld(u,r);if(i||(d.x=0),a||(d.y=0),s.current=!0,Math.abs(d.x)>0||Math.abs(d.y)>0){const f=Fd(l);f&&f.scrollBy({top:d.y,left:d.x})}},[t,i,a,r,n])}const Xo=E.createContext({...tt,scaleX:1,scaleY:1});var It;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(It||(It={}));const la=E.memo(function(t){var n,r,o,s;let{id:i,accessibility:a,autoScroll:c=!0,children:l,sensors:u=oy,collisionDetection:d=Sv,measuring:f,modifiers:h,...S}=t;const p=E.useReducer(cy,void 0,ay),[b,v]=p,[m,g]=hv(),[C,y]=E.useState(It.Uninitialized),M=C===It.Initialized,{draggable:{active:x,nodes:T,translate:R},droppable:{containers:_}}=b,O=x!=null?T.get(x):null,z=E.useRef({initial:null,translated:null}),G=E.useMemo(()=>{var Me;return x!=null?{id:x,data:(Me=O==null?void 0:O.data)!=null?Me:sy,rect:z}:null},[x,O]),j=E.useRef(null),[F,N]=E.useState(null),[k,P]=E.useState(null),I=gr(S,Object.values(S)),A=Go("DndDescribedBy",i),V=E.useMemo(()=>_.getEnabled(),[_]),W=uy(f),{droppableRects:H,measureDroppableContainers:L,measuringScheduled:Y}=Kv(V,{dragging:M,dependencies:[R.x,R.y],config:W.droppable}),K=Uv(T,x),$=E.useMemo(()=>k?Mo(k):null,[k]),q=Og(),X=Gv(K,W.draggable.measure);dy({activeNode:x!=null?T.get(x):null,config:q.layoutShiftCompensation,initialRect:X,measure:W.draggable.measure});const U=Hc(K,W.draggable.measure,X),ne=Hc(K?K.parentElement:null),B=E.useRef({activatorEvent:null,active:null,activeNode:K,collisionRect:null,collisions:null,droppableRects:H,draggableNodes:T,draggingNode:null,draggingNodeRect:null,droppableContainers:_,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),ie=_.getNodeFor((n=B.current.over)==null?void 0:n.id),pe=ry({measure:W.dragOverlay.measure}),Oe=(r=pe.nodeRef.current)!=null?r:K,Ee=M?(o=pe.rect)!=null?o:U:null,ot=!!(pe.nodeRef.current&&pe.rect),J=Zv(ot?null:U),le=Zd(Oe?Ie(Oe):null),ye=Jv(M?ie??K:null),Ve=ny(ye),He=tf(h,{transform:{x:R.x-J.x,y:R.y-J.y,scaleX:1,scaleY:1},activatorEvent:k,active:G,activeNodeRect:U,containerNodeRect:ne,draggingNodeRect:Ee,over:B.current.over,overlayNodeRect:pe.rect,scrollableAncestors:ye,scrollableAncestorRects:Ve,windowRect:le}),Kn=$?Rn($,R):null,ws=Qv(ye),Mc=Yc(ws),Ss=Yc(ws,[U]),pn=Rn(He,Mc),mn=Ee?Dv(Ee,He):null,Gn=G&&mn?d({active:G,collisionRect:mn,droppableRects:H,droppableContainers:V,pointerCoordinates:Kn}):null,Rc=xv(Gn,"id"),[Et,Pc]=E.useState(null),Eg=ot?He:Rn(He,Ss),Mg=Cv(Eg,(s=Et==null?void 0:Et.rect)!=null?s:null,U),Cs=E.useRef(null),Ac=E.useCallback((Me,Fe)=>{let{sensor:$e,options:Mt}=Fe;if(j.current==null)return;const Ue=T.get(j.current);if(!Ue)return;const Be=Me.nativeEvent,st=new $e({active:j.current,activeNode:Ue,event:Be,options:Mt,context:B,onAbort(Te){if(!T.get(Te))return;const{onDragAbort:it}=I.current,pt={id:Te};it==null||it(pt),m({type:"onDragAbort",event:pt})},onPending(Te,Rt,it,pt){if(!T.get(Te))return;const{onDragPending:Xn}=I.current,Pt={id:Te,constraint:Rt,initialCoordinates:it,offset:pt};Xn==null||Xn(Pt),m({type:"onDragPending",event:Pt})},onStart(Te){const Rt=j.current;if(Rt==null)return;const it=T.get(Rt);if(!it)return;const{onDragStart:pt}=I.current,qn={activatorEvent:Be,active:{id:Rt,data:it.data,rect:z}};vt.unstable_batchedUpdates(()=>{pt==null||pt(qn),y(It.Initializing),v({type:Se.DragStart,initialCoordinates:Te,active:Rt}),m({type:"onDragStart",event:qn}),N(Cs.current),P(Be)})},onMove(Te){v({type:Se.DragMove,coordinates:Te})},onEnd:gn(Se.DragEnd),onCancel:gn(Se.DragCancel)});Cs.current=st;function gn(Te){return async function(){const{active:it,collisions:pt,over:qn,scrollAdjustedTranslate:Xn}=B.current;let Pt=null;if(it&&Xn){const{cancelDrop:Zn}=I.current;Pt={activatorEvent:Be,active:it,collisions:pt,delta:Xn,over:qn},Te===Se.DragEnd&&typeof Zn=="function"&&await Promise.resolve(Zn(Pt))&&(Te=Se.DragCancel)}j.current=null,vt.unstable_batchedUpdates(()=>{v({type:Te}),y(It.Uninitialized),Pc(null),N(null),P(null),Cs.current=null;const Zn=Te===Se.DragEnd?"onDragEnd":"onDragCancel";if(Pt){const Ts=I.current[Zn];Ts==null||Ts(Pt),m({type:Zn,event:Pt})}})}}},[T]),Rg=E.useCallback((Me,Fe)=>($e,Mt)=>{const Ue=$e.nativeEvent,Be=T.get(Mt);if(j.current!==null||!Be||Ue.dndKit||Ue.defaultPrevented)return;const st={active:Be};Me($e,Fe.options,st)===!0&&(Ue.dndKit={capturedBy:Fe.sensor},j.current=Mt,Ac($e,Fe))},[T,Ac]),Oc=Yv(u,Rg);ey(u),yt(()=>{U&&C===It.Initializing&&y(It.Initialized)},[U,C]),E.useEffect(()=>{const{onDragMove:Me}=I.current,{active:Fe,activatorEvent:$e,collisions:Mt,over:Ue}=B.current;if(!Fe||!$e)return;const Be={active:Fe,activatorEvent:$e,collisions:Mt,delta:{x:pn.x,y:pn.y},over:Ue};vt.unstable_batchedUpdates(()=>{Me==null||Me(Be),m({type:"onDragMove",event:Be})})},[pn.x,pn.y]),E.useEffect(()=>{const{active:Me,activatorEvent:Fe,collisions:$e,droppableContainers:Mt,scrollAdjustedTranslate:Ue}=B.current;if(!Me||j.current==null||!Fe||!Ue)return;const{onDragOver:Be}=I.current,st=Mt.get(Rc),gn=st&&st.rect.current?{id:st.id,rect:st.rect.current,data:st.data,disabled:st.disabled}:null,Te={active:Me,activatorEvent:Fe,collisions:$e,delta:{x:Ue.x,y:Ue.y},over:gn};vt.unstable_batchedUpdates(()=>{Pc(gn),Be==null||Be(Te),m({type:"onDragOver",event:Te})})},[Rc]),yt(()=>{B.current={activatorEvent:k,active:G,activeNode:K,collisionRect:mn,collisions:Gn,droppableRects:H,draggableNodes:T,draggingNode:Oe,draggingNodeRect:Ee,droppableContainers:_,over:Et,scrollableAncestors:ye,scrollAdjustedTranslate:pn},z.current={initial:Ee,translated:mn}},[G,K,Gn,mn,T,Oe,Ee,H,_,Et,ye,pn]),zv({...q,delta:R,draggingRect:mn,pointerCoordinates:Kn,scrollableAncestors:ye,scrollableAncestorRects:Ve});const Pg=E.useMemo(()=>({active:G,activeNode:K,activeNodeRect:U,activatorEvent:k,collisions:Gn,containerNodeRect:ne,dragOverlay:pe,draggableNodes:T,droppableContainers:_,droppableRects:H,over:Et,measureDroppableContainers:L,scrollableAncestors:ye,scrollableAncestorRects:Ve,measuringConfiguration:W,measuringScheduled:Y,windowRect:le}),[G,K,U,k,Gn,ne,pe,T,_,H,Et,L,ye,Ve,W,Y,le]),Ag=E.useMemo(()=>({activatorEvent:k,activators:Oc,active:G,activeNodeRect:U,ariaDescribedById:{draggable:A},dispatch:v,draggableNodes:T,over:Et,measureDroppableContainers:L}),[k,Oc,G,U,v,A,T,Et,L]);return E.createElement(jd.Provider,{value:g},E.createElement(Ir.Provider,{value:Ag},E.createElement(ef.Provider,{value:Pg},E.createElement(Xo.Provider,{value:Mg},l)),E.createElement(ly,{disabled:(a==null?void 0:a.restoreFocus)===!1})),E.createElement(gv,{...a,hiddenTextDescribedById:A}));function Og(){const Me=(F==null?void 0:F.autoScrollEnabled)===!1,Fe=typeof c=="object"?c.enabled===!1:c===!1,$e=M&&!Me&&!Fe;return typeof c=="object"?{...c,enabled:$e}:{enabled:$e}}}),fy=E.createContext(null),Gc="button",hy="Draggable";function ua(e){let{id:t,data:n,disabled:r=!1,attributes:o}=e;const s=Go(hy),{activators:i,activatorEvent:a,active:c,activeNodeRect:l,ariaDescribedById:u,draggableNodes:d,over:f}=E.useContext(Ir),{role:h=Gc,roleDescription:S="draggable",tabIndex:p=0}=o??{},b=(c==null?void 0:c.id)===t,v=E.useContext(b?Xo:fy),[m,g]=To(),[C,y]=To(),M=ty(i,t),x=gr(n);yt(()=>(d.set(t,{id:t,key:s,node:m,activatorNode:C,data:x}),()=>{const R=d.get(t);R&&R.key===s&&d.delete(t)}),[d,t]);const T=E.useMemo(()=>({role:h,tabIndex:p,"aria-disabled":r,"aria-pressed":b&&h===Gc?!0:void 0,"aria-roledescription":S,"aria-describedby":u.draggable}),[r,h,p,b,S,u.draggable]);return{active:c,activatorEvent:a,activeNodeRect:l,attributes:T,isDragging:b,listeners:r?void 0:M,node:m,over:f,setNodeRef:g,setActivatorNodeRef:y,transform:v}}function py(){return E.useContext(ef)}const my="Droppable",gy={timeout:25};function Xr(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:o}=e;const s=Go(my),{active:i,dispatch:a,over:c,measureDroppableContainers:l}=E.useContext(Ir),u=E.useRef({disabled:n}),d=E.useRef(!1),f=E.useRef(null),h=E.useRef(null),{disabled:S,updateMeasurementsFor:p,timeout:b}={...gy,...o},v=gr(p??r),m=E.useCallback(()=>{if(!d.current){d.current=!0;return}h.current!=null&&clearTimeout(h.current),h.current=setTimeout(()=>{l(Array.isArray(v.current)?v.current:[v.current]),h.current=null},b)},[b]),g=qo({callback:m,disabled:S||!i}),C=E.useCallback((T,R)=>{g&&(R&&(g.unobserve(R),d.current=!1),T&&g.observe(T))},[g]),[y,M]=To(C),x=gr(t);return E.useEffect(()=>{!g||!y.current||(g.disconnect(),d.current=!1,g.observe(y.current))},[y,g]),E.useEffect(()=>(a({type:Se.RegisterDroppable,element:{id:r,key:s,disabled:n,node:y,rect:f,data:x}}),()=>a({type:Se.UnregisterDroppable,key:s,id:r})),[r]),E.useEffect(()=>{n!==u.current.disabled&&(a({type:Se.SetDroppableDisabled,id:r,key:s,disabled:n}),u.current.disabled=n)},[r,s,n,a]),{active:i,rect:f,isOver:(c==null?void 0:c.id)===r,node:y,over:c,setNodeRef:M}}function vy(e){let{animation:t,children:n}=e;const[r,o]=E.useState(null),[s,i]=E.useState(null),a=Do(n);return!n&&!r&&a&&o(a),yt(()=>{if(!s)return;const c=r==null?void 0:r.key,l=r==null?void 0:r.props.id;if(c==null||l==null){o(null);return}Promise.resolve(t(l,s)).then(()=>{o(null)})},[t,r,s]),E.createElement(E.Fragment,null,n,r?E.cloneElement(r,{ref:i}):null)}const yy={x:0,y:0,scaleX:1,scaleY:1};function by(e){let{children:t}=e;return E.createElement(Ir.Provider,{value:Qd},E.createElement(Xo.Provider,{value:yy},t))}const xy={position:"fixed",touchAction:"none"},wy=e=>oa(e)?"transform 250ms ease":void 0,Sy=E.forwardRef((e,t)=>{let{as:n,activatorEvent:r,adjustScale:o,children:s,className:i,rect:a,style:c,transform:l,transition:u=wy}=e;if(!a)return null;const d=o?l:{...l,scaleX:1,scaleY:1},f={...xy,width:a.width,height:a.height,top:a.top,left:a.left,transform:vr.Transform.toString(d),transformOrigin:o&&r?yv(r,a):void 0,transition:typeof u=="function"?u(r):u,...c};return E.createElement(n,{className:i,style:f,ref:t},s)}),Cy=e=>t=>{let{active:n,dragOverlay:r}=t;const o={},{styles:s,className:i}=e;if(s!=null&&s.active)for(const[a,c]of Object.entries(s.active))c!==void 0&&(o[a]=n.node.style.getPropertyValue(a),n.node.style.setProperty(a,c));if(s!=null&&s.dragOverlay)for(const[a,c]of Object.entries(s.dragOverlay))c!==void 0&&r.node.style.setProperty(a,c);return i!=null&&i.active&&n.node.classList.add(i.active),i!=null&&i.dragOverlay&&r.node.classList.add(i.dragOverlay),function(){for(const[c,l]of Object.entries(o))n.node.style.setProperty(c,l);i!=null&&i.active&&n.node.classList.remove(i.active)}},Ty=e=>{let{transform:{initial:t,final:n}}=e;return[{transform:vr.Transform.toString(t)},{transform:vr.Transform.toString(n)}]},Dy={duration:250,easing:"ease",keyframes:Ty,sideEffects:Cy({styles:{active:{opacity:"0"}}})};function Ey(e){let{config:t,draggableNodes:n,droppableContainers:r,measuringConfiguration:o}=e;return Ko((s,i)=>{if(t===null)return;const a=n.get(s);if(!a)return;const c=a.node.current;if(!c)return;const l=Jd(i);if(!l)return;const{transform:u}=Ie(i).getComputedStyle(i),d=Vd(u);if(!d)return;const f=typeof t=="function"?t:My(t);return Ud(c,o.draggable.measure),f({active:{id:s,data:a.data,node:c,rect:o.draggable.measure(c)},draggableNodes:n,dragOverlay:{node:i,rect:o.dragOverlay.measure(l)},droppableContainers:r,measuringConfiguration:o,transform:d})})}function My(e){const{duration:t,easing:n,sideEffects:r,keyframes:o}={...Dy,...e};return s=>{let{active:i,dragOverlay:a,transform:c,...l}=s;if(!t)return;const u={x:a.rect.left-i.rect.left,y:a.rect.top-i.rect.top},d={scaleX:c.scaleX!==1?i.rect.width*c.scaleX/a.rect.width:1,scaleY:c.scaleY!==1?i.rect.height*c.scaleY/a.rect.height:1},f={x:c.x-u.x,y:c.y-u.y,...d},h=o({...l,active:i,dragOverlay:a,transform:{initial:c,final:f}}),[S]=h,p=h[h.length-1];if(JSON.stringify(S)===JSON.stringify(p))return;const b=r==null?void 0:r({active:i,dragOverlay:a,...l}),v=a.node.animate(h,{duration:t,easing:n,fill:"forwards"});return new Promise(m=>{v.onfinish=()=>{b==null||b(),m()}})}}let qc=0;function Ry(e){return E.useMemo(()=>{if(e!=null)return qc++,qc},[e])}const Py=E.memo(e=>{let{adjustScale:t=!1,children:n,dropAnimation:r,style:o,transition:s,modifiers:i,wrapperElement:a="div",className:c,zIndex:l=999}=e;const{activatorEvent:u,active:d,activeNodeRect:f,containerNodeRect:h,draggableNodes:S,droppableContainers:p,dragOverlay:b,over:v,measuringConfiguration:m,scrollableAncestors:g,scrollableAncestorRects:C,windowRect:y}=py(),M=E.useContext(Xo),x=Ry(d==null?void 0:d.id),T=tf(i,{activatorEvent:u,active:d,activeNodeRect:f,containerNodeRect:h,draggingNodeRect:b.rect,over:v,overlayNodeRect:b.rect,scrollableAncestors:g,scrollableAncestorRects:C,transform:M,windowRect:y}),R=ca(f),_=Ey({config:r,draggableNodes:S,droppableContainers:p,measuringConfiguration:m}),O=R?b.setRef:void 0;return E.createElement(by,null,E.createElement(vy,{animation:_},d&&x?E.createElement(Sy,{key:x,id:d.id,ref:O,as:a,activatorEvent:u,adjustScale:t,className:c,transition:s,rect:R,style:{zIndex:l,...o},transform:T},n):null))});var Ay={cm:!0,mm:!0,in:!0,px:!0,pt:!0,pc:!0,em:!0,ex:!0,ch:!0,rem:!0,vw:!0,vh:!0,vmin:!0,vmax:!0,"%":!0};function pi(e){if(typeof e=="number")return{value:e,unit:"px"};var t,n=(e.match(/^[0-9.]*/)||"").toString();n.includes(".")?t=parseFloat(n):t=parseInt(n,10);var r=(e.match(/[^0-9]*$/)||"").toString();return Ay[r]?{value:t,unit:r}:(console.warn("React Spinners: ".concat(e," is not a valid css value. Defaulting to ").concat(t,"px.")),{value:t,unit:"px"})}function Ps(e){var t=pi(e);return"".concat(t.value).concat(t.unit)}var Oy=function(e,t,n){var r="react-spinners-".concat(e,"-").concat(n);if(typeof window>"u"||!window.document)return r;var o=document.createElement("style");document.head.appendChild(o);var s=o.sheet,i=`
1
+ "use strict";require('./assets/main.css');var kg=Object.defineProperty;var _g=(e,t,n)=>t in e?kg(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Xt=(e,t,n)=>_g(e,typeof t!="symbol"?t+"":t,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const x=require("react/jsx-runtime"),E=require("react"),vt=require("react-dom");function wd(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const D=wd(E),zo=wd(vt);class Ng extends ReferenceError{constructor(t="Calendar instance is not initialized. Ensure the calendar is rendered before calling this method."){super(t),this.name="ReferenceErrorCustom"}}var Ig={cm:!0,mm:!0,in:!0,px:!0,pt:!0,pc:!0,em:!0,ex:!0,ch:!0,rem:!0,vw:!0,vh:!0,vmin:!0,vmax:!0,"%":!0};function ai(e){if(typeof e=="number")return{value:e,unit:"px"};var t,n=(e.match(/^[0-9.]*/)||"").toString();n.includes(".")?t=parseFloat(n):t=parseInt(n,10);var r=(e.match(/[^0-9]*$/)||"").toString();return Ig[r]?{value:t,unit:r}:(console.warn("React Spinners: ".concat(e," is not a valid css value. Defaulting to ").concat(t,"px.")),{value:t,unit:"px"})}function Ds(e){var t=ai(e);return"".concat(t.value).concat(t.unit)}var jg=function(e,t,n){var r="react-spinners-".concat(e,"-").concat(n);if(typeof window>"u"||!window.document)return r;var o=document.createElement("style");document.head.appendChild(o);var s=o.sheet,i=`
6
2
  @keyframes `.concat(r,` {
7
3
  `).concat(t,`
8
4
  }
9
- `);return s&&s.insertRule(i,0),r},Ao=function(){return Ao=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},Ao.apply(this,arguments)},ky=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n},_y=Oy("GridLoader","0% {transform: scale(1)} 50% {transform: scale(0.5); opacity: 0.7} 100% {transform: scale(1); opacity: 1}","grid"),mt=function(e){return Math.random()*e};function Ny(e){var t=e.loading,n=t===void 0?!0:t,r=e.color,o=r===void 0?"#000000":r,s=e.speedMultiplier,i=s===void 0?1:s,a=e.cssOverride,c=a===void 0?{}:a,l=e.size,u=l===void 0?15:l,d=e.margin,f=d===void 0?2:d,h=ky(e,["loading","color","speedMultiplier","cssOverride","size","margin"]),S=pi(u),p=pi(f),b=parseFloat(S.value.toString())*3+parseFloat(p.value.toString())*6,v=Ao({width:"".concat(b).concat(S.unit),fontSize:0,display:"inline-block"},c),m=function(g){return{display:"inline-block",backgroundColor:o,width:"".concat(Ps(u)),height:"".concat(Ps(u)),margin:Ps(f),borderRadius:"100%",animationFillMode:"both",animation:"".concat(_y," ").concat((g/100+.6)/i,"s ").concat(g/100-.2,"s infinite ease")}};return n?D.createElement("span",Ao({style:v},h,{ref:function(g){g&&g.style.setProperty("width","".concat(b).concat(S.unit),"important")}}),D.createElement("span",{style:m(mt(100))}),D.createElement("span",{style:m(mt(100))}),D.createElement("span",{style:m(mt(100))}),D.createElement("span",{style:m(mt(100))}),D.createElement("span",{style:m(mt(100))}),D.createElement("span",{style:m(mt(100))}),D.createElement("span",{style:m(mt(100))}),D.createElement("span",{style:m(mt(100))}),D.createElement("span",{style:m(mt(100))})):null}/**
5
+ `);return s&&s.insertRule(i,0),r},Co=function(){return Co=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},Co.apply(this,arguments)},Lg=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n},Vg=jg("GridLoader","0% {transform: scale(1)} 50% {transform: scale(0.5); opacity: 0.7} 100% {transform: scale(1); opacity: 1}","grid"),mt=function(e){return Math.random()*e};function Fg(e){var t=e.loading,n=t===void 0?!0:t,r=e.color,o=r===void 0?"#000000":r,s=e.speedMultiplier,i=s===void 0?1:s,a=e.cssOverride,c=a===void 0?{}:a,l=e.size,u=l===void 0?15:l,d=e.margin,h=d===void 0?2:d,f=Lg(e,["loading","color","speedMultiplier","cssOverride","size","margin"]),S=ai(u),m=ai(h),w=parseFloat(S.value.toString())*3+parseFloat(m.value.toString())*6,g=Co({width:"".concat(w).concat(S.unit),fontSize:0,display:"inline-block"},c),p=function(v){return{display:"inline-block",backgroundColor:o,width:"".concat(Ds(u)),height:"".concat(Ds(u)),margin:Ds(h),borderRadius:"100%",animationFillMode:"both",animation:"".concat(Vg," ").concat((v/100+.6)/i,"s ").concat(v/100-.2,"s infinite ease")}};return n?D.createElement("span",Co({style:g},f,{ref:function(v){v&&v.style.setProperty("width","".concat(w).concat(S.unit),"important")}}),D.createElement("span",{style:p(mt(100))}),D.createElement("span",{style:p(mt(100))}),D.createElement("span",{style:p(mt(100))}),D.createElement("span",{style:p(mt(100))}),D.createElement("span",{style:p(mt(100))}),D.createElement("span",{style:p(mt(100))}),D.createElement("span",{style:p(mt(100))}),D.createElement("span",{style:p(mt(100))}),D.createElement("span",{style:p(mt(100))})):null}const kc=e=>{let t;const n=new Set,r=(l,u)=>{const d=typeof l=="function"?l(t):l;if(!Object.is(d,t)){const h=t;t=u??(typeof d!="object"||d===null)?d:Object.assign({},t,d),n.forEach(f=>f(t,h))}},o=()=>t,a={setState:r,getState:o,getInitialState:()=>c,subscribe:l=>(n.add(l),()=>n.delete(l))},c=t=e(r,o,a);return a},Ar=e=>e?kc(e):kc,$g=e=>e;function Wo(e,t=$g){const n=E.useSyncExternalStore(e.subscribe,()=>t(e.getState()),()=>t(e.getInitialState()));return E.useDebugValue(n),n}const _c=e=>{const t=Ar(e),n=r=>Wo(t,r);return Object.assign(n,t),n},Ho=e=>e?_c(e):_c,Bg=E.createContext(null),Sd=E.createContext(void 0),Lt=()=>{const e=E.use(Sd);if(!e)throw new Error("useBookingModal must be used within a BookingModalProvider");return e},se={DAY:"day",WEEK:"week",TABLE:"table",MONTH:"month"},zg=(e,t)=>({users:[],bookingViewType:"week",bookingBulkData:{user:{id:"",profile:{id:"",name:""}},booking:[]},updateUsers:n=>e(r=>({...r,users:n})),setBookingBulkData:n=>e(r=>({...r,bookingBulkData:{...n}})),updatingBookingBulkData:(n,r)=>{e(o=>{const s=o.bookingBulkData.booking.map(i=>new Date(i.startAt).getDate()===r&&n.id===i.id?n:i);return{...o,bookingBulkData:{...o.bookingBulkData,booking:s}}})},resetBookingResponse:()=>e(n=>({...n,bookingResponse:null})),setBookingViewType:n=>e(r=>({...r,bookingViewType:n})),optimisticCardUpdate:(n,r,o,s)=>{const i={...n,startAt:r,finishAt:o},a=new Date(s.day).getDate();t().updatingBookingBulkData(i,a)}}),Cd=6e4,Wg=36e5,Nc=Symbol.for("constructDateFrom");function ea(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&Nc in e?e[Nc](t):e instanceof Date?new e.constructor(t):new Date(t)}function ci(e,t){return ea(e,e)}function Td(e,...t){const n=ea.bind(null,t.find(r=>typeof r=="object"));return t.map(n)}function Hg(e,t,n){const r=ci(e);return r.setTime(r.getTime()+t*Cd),r}function Dd(e){return t=>{const r=(e?Math[e]:Math.trunc)(t);return r===0?0:r}}function Ug(e,t,n){const[r,o]=Td(n==null?void 0:n.in,e,t),s=(+r-+o)/Wg;return Dd(n==null?void 0:n.roundingMethod)(s)}function Yg(e,t){return+ci(e)-+ci(t)}function Kg(e,t,n){const r=Yg(e,t)/Cd;return Dd(n==null?void 0:n.roundingMethod)(r)}function Gg(e,t){const[n,r]=Td(e,t.start,t.end);return{start:n,end:r}}function qg(e,t){const{start:n,end:r}=Gg(t==null?void 0:t.in,e);let o=+n>+r;const s=o?+n:+r,i=o?r:n;i.setMinutes(0,0,0);let a=1;const c=[];for(;+i<=s;)c.push(ea(n,i)),i.setHours(i.getHours()+a);return o?c.reverse():c}function Xg(e,t,n){return Hg(e,-t)}function Zg(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Jg(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,o.get?o:{enumerable:!0,get:function(){return e[r]}})}),n}var po={exports:{}},Qg=po.exports,Ic;function ev(){return Ic||(Ic=1,function(e,t){(function(n,r){e.exports=r()})(Qg,function(){var n=1e3,r=6e4,o=36e5,s="millisecond",i="second",a="minute",c="hour",l="day",u="week",d="month",h="quarter",f="year",S="date",m="Invalid Date",w=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,g=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,p={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(j){var F=["th","st","nd","rd"],N=j%100;return"["+j+(F[(N-20)%10]||F[N]||F[0])+"]"}},v=function(j,F,N){var k=String(j);return!k||k.length>=F?j:""+Array(F+1-k.length).join(N)+j},C={s:v,z:function(j){var F=-j.utcOffset(),N=Math.abs(F),k=Math.floor(N/60),P=N%60;return(F<=0?"+":"-")+v(k,2,"0")+":"+v(P,2,"0")},m:function j(F,N){if(F.date()<N.date())return-j(N,F);var k=12*(N.year()-F.year())+(N.month()-F.month()),P=F.clone().add(k,d),I=N-P<0,A=F.clone().add(k+(I?-1:1),d);return+(-(k+(N-P)/(I?P-A:A-P))||0)},a:function(j){return j<0?Math.ceil(j)||0:Math.floor(j)},p:function(j){return{M:d,y:f,w:u,d:l,D:S,h:c,m:a,s:i,ms:s,Q:h}[j]||String(j||"").toLowerCase().replace(/s$/,"")},u:function(j){return j===void 0}},y="en",M={};M[y]=p;var b="$isDayjsObject",T=function(j){return j instanceof z||!(!j||!j[b])},R=function j(F,N,k){var P;if(!F)return y;if(typeof F=="string"){var I=F.toLowerCase();M[I]&&(P=I),N&&(M[I]=N,P=I);var A=F.split("-");if(!P&&A.length>1)return j(A[0])}else{var V=F.name;M[V]=F,P=V}return!k&&P&&(y=P),P||!k&&y},_=function(j,F){if(T(j))return j.clone();var N=typeof F=="object"?F:{};return N.date=j,N.args=arguments,new z(N)},O=C;O.l=R,O.i=T,O.w=function(j,F){return _(j,{locale:F.$L,utc:F.$u,x:F.$x,$offset:F.$offset})};var z=function(){function j(N){this.$L=R(N.locale,null,!0),this.parse(N),this.$x=this.$x||N.x||{},this[b]=!0}var F=j.prototype;return F.parse=function(N){this.$d=function(k){var P=k.date,I=k.utc;if(P===null)return new Date(NaN);if(O.u(P))return new Date;if(P instanceof Date)return new Date(P);if(typeof P=="string"&&!/Z$/i.test(P)){var A=P.match(w);if(A){var V=A[2]-1||0,W=(A[7]||"0").substring(0,3);return I?new Date(Date.UTC(A[1],V,A[3]||1,A[4]||0,A[5]||0,A[6]||0,W)):new Date(A[1],V,A[3]||1,A[4]||0,A[5]||0,A[6]||0,W)}}return new Date(P)}(N),this.init()},F.init=function(){var N=this.$d;this.$y=N.getFullYear(),this.$M=N.getMonth(),this.$D=N.getDate(),this.$W=N.getDay(),this.$H=N.getHours(),this.$m=N.getMinutes(),this.$s=N.getSeconds(),this.$ms=N.getMilliseconds()},F.$utils=function(){return O},F.isValid=function(){return this.$d.toString()!==m},F.isSame=function(N,k){var P=_(N);return this.startOf(k)<=P&&P<=this.endOf(k)},F.isAfter=function(N,k){return _(N)<this.startOf(k)},F.isBefore=function(N,k){return this.endOf(k)<_(N)},F.$g=function(N,k,P){return O.u(N)?this[k]:this.set(P,N)},F.unix=function(){return Math.floor(this.valueOf()/1e3)},F.valueOf=function(){return this.$d.getTime()},F.startOf=function(N,k){var P=this,I=!!O.u(k)||k,A=O.p(N),V=function(X,U){var ne=O.w(P.$u?Date.UTC(P.$y,U,X):new Date(P.$y,U,X),P);return I?ne:ne.endOf(l)},W=function(X,U){return O.w(P.toDate()[X].apply(P.toDate("s"),(I?[0,0,0,0]:[23,59,59,999]).slice(U)),P)},H=this.$W,L=this.$M,Y=this.$D,K="set"+(this.$u?"UTC":"");switch(A){case f:return I?V(1,0):V(31,11);case d:return I?V(1,L):V(0,L+1);case u:var $=this.$locale().weekStart||0,q=(H<$?H+7:H)-$;return V(I?Y-q:Y+(6-q),L);case l:case S:return W(K+"Hours",0);case c:return W(K+"Minutes",1);case a:return W(K+"Seconds",2);case i:return W(K+"Milliseconds",3);default:return this.clone()}},F.endOf=function(N){return this.startOf(N,!1)},F.$set=function(N,k){var P,I=O.p(N),A="set"+(this.$u?"UTC":""),V=(P={},P[l]=A+"Date",P[S]=A+"Date",P[d]=A+"Month",P[f]=A+"FullYear",P[c]=A+"Hours",P[a]=A+"Minutes",P[i]=A+"Seconds",P[s]=A+"Milliseconds",P)[I],W=I===l?this.$D+(k-this.$W):k;if(I===d||I===f){var H=this.clone().set(S,1);H.$d[V](W),H.init(),this.$d=H.set(S,Math.min(this.$D,H.daysInMonth())).$d}else V&&this.$d[V](W);return this.init(),this},F.set=function(N,k){return this.clone().$set(N,k)},F.get=function(N){return this[O.p(N)]()},F.add=function(N,k){var P,I=this;N=Number(N);var A=O.p(k),V=function(L){var Y=_(I);return O.w(Y.date(Y.date()+Math.round(L*N)),I)};if(A===d)return this.set(d,this.$M+N);if(A===f)return this.set(f,this.$y+N);if(A===l)return V(1);if(A===u)return V(7);var W=(P={},P[a]=r,P[c]=o,P[i]=n,P)[A]||1,H=this.$d.getTime()+N*W;return O.w(H,this)},F.subtract=function(N,k){return this.add(-1*N,k)},F.format=function(N){var k=this,P=this.$locale();if(!this.isValid())return P.invalidDate||m;var I=N||"YYYY-MM-DDTHH:mm:ssZ",A=O.z(this),V=this.$H,W=this.$m,H=this.$M,L=P.weekdays,Y=P.months,K=P.meridiem,$=function(U,ne,B,ie){return U&&(U[ne]||U(k,I))||B[ne].slice(0,ie)},q=function(U){return O.s(V%12||12,U,"0")},X=K||function(U,ne,B){var ie=U<12?"AM":"PM";return B?ie.toLowerCase():ie};return I.replace(g,function(U,ne){return ne||function(B){switch(B){case"YY":return String(k.$y).slice(-2);case"YYYY":return O.s(k.$y,4,"0");case"M":return H+1;case"MM":return O.s(H+1,2,"0");case"MMM":return $(P.monthsShort,H,Y,3);case"MMMM":return $(Y,H);case"D":return k.$D;case"DD":return O.s(k.$D,2,"0");case"d":return String(k.$W);case"dd":return $(P.weekdaysMin,k.$W,L,2);case"ddd":return $(P.weekdaysShort,k.$W,L,3);case"dddd":return L[k.$W];case"H":return String(V);case"HH":return O.s(V,2,"0");case"h":return q(1);case"hh":return q(2);case"a":return X(V,W,!0);case"A":return X(V,W,!1);case"m":return String(W);case"mm":return O.s(W,2,"0");case"s":return String(k.$s);case"ss":return O.s(k.$s,2,"0");case"SSS":return O.s(k.$ms,3,"0");case"Z":return A}return null}(U)||A.replace(":","")})},F.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},F.diff=function(N,k,P){var I,A=this,V=O.p(k),W=_(N),H=(W.utcOffset()-this.utcOffset())*r,L=this-W,Y=function(){return O.m(A,W)};switch(V){case f:I=Y()/12;break;case d:I=Y();break;case h:I=Y()/3;break;case u:I=(L-H)/6048e5;break;case l:I=(L-H)/864e5;break;case c:I=L/o;break;case a:I=L/r;break;case i:I=L/n;break;default:I=L}return P?I:O.a(I)},F.daysInMonth=function(){return this.endOf(d).$D},F.$locale=function(){return M[this.$L]},F.locale=function(N,k){if(!N)return this.$L;var P=this.clone(),I=R(N,k,!0);return I&&(P.$L=I),P},F.clone=function(){return O.w(this.$d,this)},F.toDate=function(){return new Date(this.valueOf())},F.toJSON=function(){return this.isValid()?this.toISOString():null},F.toISOString=function(){return this.$d.toISOString()},F.toString=function(){return this.$d.toUTCString()},j}(),G=z.prototype;return _.prototype=G,[["$ms",s],["$s",i],["$m",a],["$H",c],["$W",l],["$M",d],["$y",f],["$D",S]].forEach(function(j){G[j[1]]=function(F){return this.$g(F,j[0],j[1])}}),_.extend=function(j,F){return j.$i||(j(F,z,_),j.$i=!0),_},_.locale=R,_.isDayjs=T,_.unix=function(j){return _(1e3*j)},_.en=M[y],_.Ls=M,_.p={},_})}(po)),po.exports}var tv=ev();const jc=Zg(tv),jt=600,li=15,ta="00:00",Mn=["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],ui=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],nv=["Domingo","Segunda","Terça","Quarta","Quinta","Sexta","Sábado"],Z={findIndexToStart(e=new Date){const t=ui[e.getDay()];return this.findActualDayIndex(t)},findActualDayIndex(e){return ui.indexOf(e)},generateWeekDays(e){const t=this.findIndexToStart(e);return{week:new Array(7).fill(0).map((o,s)=>{const i=e||new Date,a=s-t;return new Date(i.getFullYear(),i.getMonth(),i.getDate()+a)})}},generateDays(e,t){const n=[],r=new Date(e.getFullYear(),e.getMonth(),e.getDate()+t);return n.push(r),n},addDay(e,t){return new Date(e.getFullYear(),e.getMonth(),e.getDate()+t)},formatDate(e){return e.split(" ").slice(2,3).join(",").replace(","," | ")},dateTimeAsString(e){const t=String(e.getHours()).padStart(2,"0"),n=String(e.getMinutes()).padStart(2,"0");return`${t}:${n}`},getTimeDiff(e,t){const n=Number(new Date(t))-Number(new Date(e)),r=Math.floor(n/1e3/60),o=Math.floor(r/60),s=r%60;return`${o}:${s.toString().padStart(2,"0")}`},buildFutureDateList(e,t,n=1){const r=(o,s)=>{const i=new Date(o),a=i.getDate()+s+n;return i.setDate(a),i};return Array.from({length:t},(o,s)=>r(e.startAt,s))},bookingTimeRange:(e,t)=>{const n=Z.getTimeDiff(e.startAt,e.finishAt),r=Z.getNewFinishAt(t,n);return{id:e.id,startAt:new Date(t),finishAt:r}},getNewFinishAt(e,t){const n=new Date(e),r=t.split(":"),o=Number(r[0]),s=Number(r[1]);return n.setHours(n.getHours()+o),n.setMinutes(n.getMinutes()+s),n},minuteDifference(e,t){return Kg(e,t)},calculateDaysDifference(e,t){return e.getDate()-t.getDate()},dateAndHourDateToString(e){const t=new Date(e);return`${t.getHours().toLocaleString().padStart(2,"0")}:${t.getMinutes().toLocaleString().padStart(2,"0")}`},shortMonthDescription(...e){return`${Mn[e[0].getMonth()].slice(0,3)} - ${Mn[e[1].getMonth()].slice(0,3)}`},timeDiffInSeconds(e,t){const n=jc(e),r=jc(t);return n.diff(r)/6e4},subtractMinutes(e,t){return Xg(e,t)},addMinuteToHour(e,t){return`${e.split(":")[0]}:${t}`},dateToString(e){return new Date(e).toTimeString()},dateToStringSelected(e){return new Date(e).toDateString()},roundMinutes(e){return e>=15&&e<30?15:e>=30&&e<45?30:e>=45&&e<60?45:0},hourMinutesStringToDate(e){const t=new Date,[n,r]=e.split(":");return t.setHours(Number(n),Number(r)),t},addMinutesToDate(e,t){const n=new Date(e);return n.setHours(n.getHours(),n.getMinutes()+t,n.getMinutes()),n},newDateKey(e,t){const n=new Date(e);return n.setHours(Number(t.split(":")[0])),n.setMinutes(Number(t.split(":")[1])),n.toString()},addMinutesToHour(e,t){const n=Z.hourMinutesStringToDate(e),r=Z.addMinutesToDate(n,t);return Z.dateAndHourDateToString(r)},convertStringTimeToDateFormat(e){const t=new Date,[n,r]=e.split(":");return t.setHours(Number(n),Number(r),0,0),t},isTodayDate(e){const t=new Date,n=e.getDate()===t.getDate(),r=e.getMonth()===t.getMonth(),o=e.getFullYear()===t.getFullYear();return n&&r&&o},firstAndLastWeekDays(e){return{firstDayOfWeek:e[0],lastDayOfWeek:e[e.length-1]}},generateWeekMonthLabel(e){const{firstDayOfWeek:t,lastDayOfWeek:n}=Z.firstAndLastWeekDays(e),r=t.getMonth();return r!==n.getMonth()?Z.shortMonthDescription(t,n):Mn[r]}},rv=(e,t)=>{const r=qg({start:new Date(2014,9,6,e),end:new Date(2014,9,6,t)}).sort((o,s)=>{const i=new Date(o).getHours(),a=new Date(s).getHours();return i-a});return Object.values(r).map(o=>`${String(o.getHours()).padStart(2,"0")}:00`)},Ed=1,Md=24,ov=Z.generateWeekDays(),sv=(e,t)=>({hours:rv(Ed,Md),daysOfWeek:ov.week,timesRendered:new Map,setTodayDay:n=>{const r=Z.generateDays(n,0);return e(o=>({...o,daysOfWeek:r,lastDayOfWeek:r[0]||new Date})),r[0]},todayWeek:n=>{let r=[];return e(o=>{const{week:s}=Z.generateWeekDays(n);return r=s,{...o,daysOfWeek:s}}),r},nextWeek:()=>{const n=Z.addDay(t().getWeek().lastDayOfWeek,1);let r=[];const{week:o}=Z.generateWeekDays(n);return r=o,e(s=>({...s,daysOfWeek:o})),r},previousWeek:()=>{const n=Z.addDay(t().getWeek().firstDayOfWeek,-1);let r=[];const{week:o}=Z.generateWeekDays(n);return r=o,e(s=>({...s,daysOfWeek:o})),r},setDays:n=>{const r=t().daysOfWeek[0];if(!r)return[];const o=Z.generateDays(r,n);return e(s=>({...s,daysOfWeek:o})),o},getWeek:()=>{const n=t().daysOfWeek[0],r=t().daysOfWeek[t().daysOfWeek.length-1];return{firstDayOfWeek:n,lastDayOfWeek:r}},addTimesRendered:(n,r)=>{e(o=>{const s=o.timesRendered;return s.get(r)?{...o}:(s.set(r,n),{...o,timeRenderedPrev:s})})}}),iv=(e,t)=>({setWeekAndViewType:n=>{const r=t().todayWeek(n);return t().setBookingViewType(se.WEEK),Z.firstAndLastWeekDays(r)},setTodayDayAndViewType:n=>{const r=t().setTodayDay(n);return t().setBookingViewType(se.DAY),r}}),Le=Ho()((...e)=>({...sv(...e),...zg(...e),...iv(...e)})),Rd=()=>{const{setBookingViewType:e,todayWeek:t,setTodayDay:n,daysOfWeek:r,getWeek:o}=Le();return{onViewTypeChange:i=>{switch(i){case se.DAY:{e(se.DAY),n(r[0]);break}case se.WEEK:{e(se.WEEK),t(o().firstDayOfWeek);break}case se.TABLE:{e(se.TABLE),n(o().firstDayOfWeek);break}}}}},Pd=E.createContext(null),Ad=e=>{const t=E.use(Pd);if(!t)throw new Error("Missing useMonthDescription must be within a MonthDescriptionProvider");return Wo(t,e)},di={date:"",startAt:"",finishAt:"",slotStartAt:""},av=e=>Ar((t,n)=>({...di,...e,updateForm:r=>t(o=>({...o,...r})),updateDynamicForm:(r,o)=>t(s=>({...s,[r]:o})),updateStartAt:r=>t(o=>({...o,startAt:r})),updateFinishAt:r=>t(o=>({...o,finishAt:r})),updateFinishAtWithOffset:(r,o=15)=>{const s=Z.addMinutesToHour(r,o);return n().updateFinishAt(s),s},updateClient:(r,o)=>t(s=>({...s,client:{id:r,name:o}})),updateDate:r=>t(o=>({...o,date:r})),updatePrevStartAt:r=>t(o=>({...o,slotStartAt:r})),resetForm:()=>t(di)})),Od=E.createContext(null),cv=({children:e,ref:t,...n})=>{const r=E.useRef(null);r.current||(r.current=av(n));const o=s=>{var i;(i=r.current)==null||i.getState().updateFinishAt(s)};return E.useImperativeHandle(t,()=>({updateFinishAt:o})),x.jsx(Od,{value:r.current,children:e})},kd=e=>{const t=E.use(Od);if(!t)throw new Error("Missing useNewEventContextProvider must be within a NewEventProvider");return Wo(t,e)},_d={selectedDate:new Date,isBookingLoading:!1,bookingModalState:!1,selectedHour:"",cardsRef:new Map},lv=e=>Ar(t=>({..._d,...e,clearDraggingBookings:()=>t(n=>({...n,draggingBooking:null})),changeNewBookingStateModal:()=>t({bookingModalState:!0}),openNewBookingModal:(n,r)=>{n&&t({selectedDate:n}),r&&t({selectedHour:r})},setIsBookingLoading:()=>t({isBookingLoading:!0}),setSelectedDate:n=>t(r=>({...r,selectedDate:n})),setSelectedHour:n=>t(r=>({...r,selectedHour:n})),setCardRef:(n,r)=>t(o=>({...o,cardsRef:o.cardsRef.set(n,r)}))})),uv=({children:e,...t})=>{const n=E.useRef(null);return n.current||(n.current=lv(t)),x.jsx(Bg,{value:n.current,children:e})},dv=({children:e,...t})=>x.jsx(Sd,{value:{...t},children:e}),Nd=E.createContext(null),fv={systemColor:"#000000",isTimeInfoVisible:!0},hv=e=>Ar(t=>({...fv,...e,updateSystemColor:n=>{t(r=>({...r,systemColor:n}))},changeTimeInfoVisibility:n=>{t(r=>({...r,isTimeInfoVisible:n}))}})),pv=({children:e,...t})=>{const n=E.useRef(null);return n.current||(n.current=hv(t)),x.jsx(Nd,{value:n.current,children:e})},Id={month:new Date().getMonth(),fullYear:new Date().getFullYear(),monthMessage:""},mv=e=>Ar((t,n)=>({...e,...Id,updateMonthMessage:r=>{t(o=>({...o,...r}))},updateHeaderDateLabel:r=>{n().updateMonthMessage({month:r.getMonth(),fullYear:r.getFullYear(),monthMessage:Mn[r.getMonth()]})}})),gv=({children:e,...t})=>{const n=E.useRef(null);return n.current||(n.current=mv(t)),x.jsx(Pd,{value:n.current,children:e})},on=e=>{const t=new Date(e.key),n=t.getDate().toString().padStart(2,"0"),r=(t.getMonth()+1).toString().padStart(2,"0");return`${`${t.getFullYear()}-${r}-${n}`};${e.time}`},Tt=Ho((e,t)=>({emptySlotNodes:new Map,selectedNode:"",setEmptySlotNode:(n,r)=>{e(o=>{const s=new Map(o.emptySlotNodes),d=(Ug(new Date(`1970/01/01 ${Md}`),new Date(2014,6,0,Number(Ed),0))+2)*4*7-1;s.size>d&&s.clear();const f=on(r);return s.set(f,n),{...o,emptySlotNodes:s}})},setSelectedNode:n=>{const r=new Map(t().emptySlotNodes),o=t().selectedNode;e(s=>{if(o.length){const i=r.get(o);i&&i.closeEvent()}return{...s,selectedNode:n}})},resetNodes:()=>{e(n=>{const r=new Map(n.emptySlotNodes);return r.clear(),{...n,emptySlotNodes:r}})},resetSelectedNode:()=>e(n=>({...n,selectedNode:""}))})),Uo=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function jn(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function na(e){return"nodeType"in e}function Ne(e){var t,n;return e?jn(e)?e:na(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function ra(e){const{Document:t}=Ne(e);return e instanceof t}function Or(e){return jn(e)?!1:e instanceof Ne(e).HTMLElement}function jd(e){return e instanceof Ne(e).SVGElement}function Ln(e){return e?jn(e)?e.document:na(e)?ra(e)?e:Or(e)||jd(e)?e.ownerDocument:document:document:document}const yt=Uo?E.useLayoutEffect:E.useEffect;function Yo(e){const t=E.useRef(e);return yt(()=>{t.current=e}),E.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}function vv(){const e=E.useRef(null),t=E.useCallback((r,o)=>{e.current=setInterval(r,o)},[]),n=E.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function gr(e,t){t===void 0&&(t=[e]);const n=E.useRef(e);return yt(()=>{n.current!==e&&(n.current=e)},t),n}function kr(e,t){const n=E.useRef();return E.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function To(e){const t=Yo(e),n=E.useRef(null),r=E.useCallback(o=>{o!==n.current&&(t==null||t(o,n.current)),n.current=o},[]);return[n,r]}function Do(e){const t=E.useRef();return E.useEffect(()=>{t.current=e},[e]),t.current}let Es={};function Ko(e,t){return E.useMemo(()=>{if(t)return t;const n=Es[e]==null?0:Es[e]+1;return Es[e]=n,e+"-"+n},[e,t])}function Ld(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.reduce((s,i)=>{const a=Object.entries(i);for(const[c,l]of a){const u=s[c];u!=null&&(s[c]=u+e*l)}return s},{...t})}}const Rn=Ld(1),Eo=Ld(-1);function yv(e){return"clientX"in e&&"clientY"in e}function oa(e){if(!e)return!1;const{KeyboardEvent:t}=Ne(e.target);return t&&e instanceof t}function bv(e){if(!e)return!1;const{TouchEvent:t}=Ne(e.target);return t&&e instanceof t}function Mo(e){if(bv(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return yv(e)?{x:e.clientX,y:e.clientY}:null}const vr=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[vr.Translate.toString(e),vr.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),Lc="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function xv(e){return e.matches(Lc)?e:e.querySelector(Lc)}const wv={display:"none"};function Sv(e){let{id:t,value:n}=e;return E.createElement("div",{id:t,style:wv},n)}function Cv(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;const o={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return E.createElement("div",{id:t,style:o,role:"status","aria-live":r,"aria-atomic":!0},n)}function Tv(){const[e,t]=E.useState("");return{announce:E.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const Vd=E.createContext(null);function _r(e){const t=E.useContext(Vd);E.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function Dv(){const[e]=E.useState(()=>new Set),t=E.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[E.useCallback(r=>{let{type:o,event:s}=r;e.forEach(i=>{var a;return(a=i[o])==null?void 0:a.call(i,s)})},[e]),t]}const Ev={draggable:`
6
+ To pick up a draggable item, press the space bar.
7
+ While dragging, use the arrow keys to move the item.
8
+ Press space again to drop the item in its new position, or press escape to cancel.
9
+ `},Mv={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function Rv(e){let{announcements:t=Mv,container:n,hiddenTextDescribedById:r,screenReaderInstructions:o=Ev}=e;const{announce:s,announcement:i}=Tv(),a=Ko("DndLiveRegion"),[c,l]=E.useState(!1);if(E.useEffect(()=>{l(!0)},[]),_r(E.useMemo(()=>({onDragStart(d){let{active:h}=d;s(t.onDragStart({active:h}))},onDragMove(d){let{active:h,over:f}=d;t.onDragMove&&s(t.onDragMove({active:h,over:f}))},onDragOver(d){let{active:h,over:f}=d;s(t.onDragOver({active:h,over:f}))},onDragEnd(d){let{active:h,over:f}=d;s(t.onDragEnd({active:h,over:f}))},onDragCancel(d){let{active:h,over:f}=d;s(t.onDragCancel({active:h,over:f}))}}),[s,t])),!c)return null;const u=E.createElement(E.Fragment,null,E.createElement(Sv,{id:r,value:o.draggable}),E.createElement(Cv,{id:a,announcement:i}));return n?vt.createPortal(u,n):u}var Se;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(Se||(Se={}));function Ro(){}function Vc(e,t){return E.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function Pv(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return E.useMemo(()=>[...t].filter(r=>r!=null),[...t])}const tt=Object.freeze({x:0,y:0});function Av(e,t){const n=Mo(e);if(!n)return"0 0";const r={x:(n.x-t.left)/t.width*100,y:(n.y-t.top)/t.height*100};return r.x+"% "+r.y+"%"}function Ov(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function kv(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function _v(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),s=Math.min(t.top+t.height,e.top+e.height),i=o-r,a=s-n;if(r<o&&n<s){const c=t.width*t.height,l=e.width*e.height,u=i*a,d=u/(c+l-u);return Number(d.toFixed(4))}return 0}const Nv=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=[];for(const s of r){const{id:i}=s,a=n.get(i);if(a){const c=_v(a,t);c>0&&o.push({id:i,data:{droppableContainer:s,value:c}})}}return o.sort(Ov)};function Iv(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function Fd(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:tt}function jv(e){return function(n){for(var r=arguments.length,o=new Array(r>1?r-1:0),s=1;s<r;s++)o[s-1]=arguments[s];return o.reduce((i,a)=>({...i,top:i.top+e*a.y,bottom:i.bottom+e*a.y,left:i.left+e*a.x,right:i.right+e*a.x}),{...n})}}const Lv=jv(1);function $d(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function Vv(e,t,n){const r=$d(t);if(!r)return e;const{scaleX:o,scaleY:s,x:i,y:a}=r,c=e.left-i-(1-o)*parseFloat(n),l=e.top-a-(1-s)*parseFloat(n.slice(n.indexOf(" ")+1)),u=o?e.width/o:e.width,d=s?e.height/s:e.height;return{width:u,height:d,top:l,right:c+u,bottom:l+d,left:c}}const Fv={ignoreTransform:!1};function Nr(e,t){t===void 0&&(t=Fv);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:l,transformOrigin:u}=Ne(e).getComputedStyle(e);l&&(n=Vv(n,l,u))}const{top:r,left:o,width:s,height:i,bottom:a,right:c}=n;return{top:r,left:o,width:s,height:i,bottom:a,right:c}}function Fc(e){return Nr(e,{ignoreTransform:!0})}function $v(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function Bv(e,t){return t===void 0&&(t=Ne(e).getComputedStyle(e)),t.position==="fixed"}function zv(e,t){t===void 0&&(t=Ne(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(o=>{const s=t[o];return typeof s=="string"?n.test(s):!1})}function sa(e,t){const n=[];function r(o){if(t!=null&&n.length>=t||!o)return n;if(ra(o)&&o.scrollingElement!=null&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!Or(o)||jd(o)||n.includes(o))return n;const s=Ne(e).getComputedStyle(o);return o!==e&&zv(o,s)&&n.push(o),Bv(o,s)?n:r(o.parentNode)}return e?r(e):n}function Bd(e){const[t]=sa(e,1);return t??null}function Ms(e){return!Uo||!e?null:jn(e)?e:na(e)?ra(e)||e===Ln(e).scrollingElement?window:Or(e)?e:null:null}function zd(e){return jn(e)?e.scrollX:e.scrollLeft}function Wd(e){return jn(e)?e.scrollY:e.scrollTop}function fi(e){return{x:zd(e),y:Wd(e)}}var Ce;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(Ce||(Ce={}));function Hd(e){return!Uo||!e?!1:e===document.scrollingElement}function Ud(e){const t={x:0,y:0},n=Hd(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},o=e.scrollTop<=t.y,s=e.scrollLeft<=t.x,i=e.scrollTop>=r.y,a=e.scrollLeft>=r.x;return{isTop:o,isLeft:s,isBottom:i,isRight:a,maxScroll:r,minScroll:t}}const Wv={x:.2,y:.2};function Hv(e,t,n,r,o){let{top:s,left:i,right:a,bottom:c}=n;r===void 0&&(r=10),o===void 0&&(o=Wv);const{isTop:l,isBottom:u,isLeft:d,isRight:h}=Ud(e),f={x:0,y:0},S={x:0,y:0},m={height:t.height*o.y,width:t.width*o.x};return!l&&s<=t.top+m.height?(f.y=Ce.Backward,S.y=r*Math.abs((t.top+m.height-s)/m.height)):!u&&c>=t.bottom-m.height&&(f.y=Ce.Forward,S.y=r*Math.abs((t.bottom-m.height-c)/m.height)),!h&&a>=t.right-m.width?(f.x=Ce.Forward,S.x=r*Math.abs((t.right-m.width-a)/m.width)):!d&&i<=t.left+m.width&&(f.x=Ce.Backward,S.x=r*Math.abs((t.left+m.width-i)/m.width)),{direction:f,speed:S}}function Uv(e){if(e===document.scrollingElement){const{innerWidth:s,innerHeight:i}=window;return{top:0,left:0,right:s,bottom:i,width:s,height:i}}const{top:t,left:n,right:r,bottom:o}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:o,width:e.clientWidth,height:e.clientHeight}}function Yd(e){return e.reduce((t,n)=>Rn(t,fi(n)),tt)}function Yv(e){return e.reduce((t,n)=>t+zd(n),0)}function Kv(e){return e.reduce((t,n)=>t+Wd(n),0)}function Kd(e,t){if(t===void 0&&(t=Nr),!e)return;const{top:n,left:r,bottom:o,right:s}=t(e);Bd(e)&&(o<=0||s<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const Gv=[["x",["left","right"],Yv],["y",["top","bottom"],Kv]];class ia{constructor(t,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const r=sa(n),o=Yd(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[s,i,a]of Gv)for(const c of i)Object.defineProperty(this,c,{get:()=>{const l=a(r),u=o[s]-l;return this.rect[c]+u},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class lr{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...n)})},this.target=t}add(t,n,r){var o;(o=this.target)==null||o.addEventListener(t,n,r),this.listeners.push([t,n,r])}}function qv(e){const{EventTarget:t}=Ne(e);return e instanceof t?e:Ln(e)}function Rs(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t?r>t.y:!1}var Ge;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(Ge||(Ge={}));function $c(e){e.preventDefault()}function Xv(e){e.stopPropagation()}var he;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(he||(he={}));const Gd={start:[he.Space,he.Enter],cancel:[he.Esc],end:[he.Space,he.Enter,he.Tab]},Zv=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case he.Right:return{...n,x:n.x+25};case he.Left:return{...n,x:n.x-25};case he.Down:return{...n,y:n.y+25};case he.Up:return{...n,y:n.y-25}}};class qd{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:n}}=t;this.props=t,this.listeners=new lr(Ln(n)),this.windowListeners=new lr(Ne(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Ge.Resize,this.handleCancel),this.windowListeners.add(Ge.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Ge.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&Kd(r),n(tt)}handleKeyDown(t){if(oa(t)){const{active:n,context:r,options:o}=this.props,{keyboardCodes:s=Gd,coordinateGetter:i=Zv,scrollBehavior:a="smooth"}=o,{code:c}=t;if(s.end.includes(c)){this.handleEnd(t);return}if(s.cancel.includes(c)){this.handleCancel(t);return}const{collisionRect:l}=r.current,u=l?{x:l.left,y:l.top}:tt;this.referenceCoordinates||(this.referenceCoordinates=u);const d=i(t,{active:n,context:r.current,currentCoordinates:u});if(d){const h=Eo(d,u),f={x:0,y:0},{scrollableAncestors:S}=r.current;for(const m of S){const w=t.code,{isTop:g,isRight:p,isLeft:v,isBottom:C,maxScroll:y,minScroll:M}=Ud(m),b=Uv(m),T={x:Math.min(w===he.Right?b.right-b.width/2:b.right,Math.max(w===he.Right?b.left:b.left+b.width/2,d.x)),y:Math.min(w===he.Down?b.bottom-b.height/2:b.bottom,Math.max(w===he.Down?b.top:b.top+b.height/2,d.y))},R=w===he.Right&&!p||w===he.Left&&!v,_=w===he.Down&&!C||w===he.Up&&!g;if(R&&T.x!==d.x){const O=m.scrollLeft+h.x,z=w===he.Right&&O<=y.x||w===he.Left&&O>=M.x;if(z&&!h.y){m.scrollTo({left:O,behavior:a});return}z?f.x=m.scrollLeft-O:f.x=w===he.Right?m.scrollLeft-y.x:m.scrollLeft-M.x,f.x&&m.scrollBy({left:-f.x,behavior:a});break}else if(_&&T.y!==d.y){const O=m.scrollTop+h.y,z=w===he.Down&&O<=y.y||w===he.Up&&O>=M.y;if(z&&!h.x){m.scrollTo({top:O,behavior:a});return}z?f.y=m.scrollTop-O:f.y=w===he.Down?m.scrollTop-y.y:m.scrollTop-M.y,f.y&&m.scrollBy({top:-f.y,behavior:a});break}}this.handleMove(t,Rn(Eo(d,this.referenceCoordinates),f))}}}handleMove(t,n){const{onMove:r}=this.props;t.preventDefault(),r(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}qd.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=Gd,onActivation:o}=t,{active:s}=n;const{code:i}=e.nativeEvent;if(r.start.includes(i)){const a=s.activatorNode.current;return a&&e.target!==a?!1:(e.preventDefault(),o==null||o({event:e.nativeEvent}),!0)}return!1}}];function Bc(e){return!!(e&&"distance"in e)}function zc(e){return!!(e&&"delay"in e)}class aa{constructor(t,n,r){var o;r===void 0&&(r=qv(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=n;const{event:s}=t,{target:i}=s;this.props=t,this.events=n,this.document=Ln(i),this.documentListeners=new lr(this.document),this.listeners=new lr(r),this.windowListeners=new lr(Ne(i)),this.initialCoordinates=(o=Mo(s))!=null?o:tt,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:n,bypassActivationConstraint:r}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(Ge.Resize,this.handleCancel),this.windowListeners.add(Ge.DragStart,$c),this.windowListeners.add(Ge.VisibilityChange,this.handleCancel),this.windowListeners.add(Ge.ContextMenu,$c),this.documentListeners.add(Ge.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(zc(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(Bc(n)){this.handlePending(n);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,n){const{active:r,onPending:o}=this.props;o(r,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(Ge.Click,Xv,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Ge.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:r,initialCoordinates:o,props:s}=this,{onMove:i,options:{activationConstraint:a}}=s;if(!o)return;const c=(n=Mo(t))!=null?n:tt,l=Eo(o,c);if(!r&&a){if(Bc(a)){if(a.tolerance!=null&&Rs(l,a.tolerance))return this.handleCancel();if(Rs(l,a.distance))return this.handleStart()}if(zc(a)&&Rs(l,a.tolerance))return this.handleCancel();this.handlePending(a,l);return}t.cancelable&&t.preventDefault(),i(c)}handleEnd(){const{onAbort:t,onEnd:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleCancel(){const{onAbort:t,onCancel:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleKeydown(t){t.code===he.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const Jv={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Xd extends aa{constructor(t){const{event:n}=t,r=Ln(n.target);super(t,Jv,r)}}Xd.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r==null||r({event:n}),!0)}}];const Qv={move:{name:"mousemove"},end:{name:"mouseup"}};var hi;(function(e){e[e.RightClick=2]="RightClick"})(hi||(hi={}));class Zd extends aa{constructor(t){super(t,Qv,Ln(t.event.target))}}Zd.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===hi.RightClick?!1:(r==null||r({event:n}),!0)}}];const Ps={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class Jd extends aa{constructor(t){super(t,Ps)}static setup(){return window.addEventListener(Ps.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(Ps.move.name,t)};function t(){}}}Jd.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:o}=n;return o.length>1?!1:(r==null||r({event:n}),!0)}}];var ur;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(ur||(ur={}));var Po;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(Po||(Po={}));function ey(e){let{acceleration:t,activator:n=ur.Pointer,canScroll:r,draggingRect:o,enabled:s,interval:i=5,order:a=Po.TreeOrder,pointerCoordinates:c,scrollableAncestors:l,scrollableAncestorRects:u,delta:d,threshold:h}=e;const f=ny({delta:d,disabled:!s}),[S,m]=vv(),w=E.useRef({x:0,y:0}),g=E.useRef({x:0,y:0}),p=E.useMemo(()=>{switch(n){case ur.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case ur.DraggableRect:return o}},[n,o,c]),v=E.useRef(null),C=E.useCallback(()=>{const M=v.current;if(!M)return;const b=w.current.x*g.current.x,T=w.current.y*g.current.y;M.scrollBy(b,T)},[]),y=E.useMemo(()=>a===Po.TreeOrder?[...l].reverse():l,[a,l]);E.useEffect(()=>{if(!s||!l.length||!p){m();return}for(const M of y){if((r==null?void 0:r(M))===!1)continue;const b=l.indexOf(M),T=u[b];if(!T)continue;const{direction:R,speed:_}=Hv(M,T,p,t,h);for(const O of["x","y"])f[O][R[O]]||(_[O]=0,R[O]=0);if(_.x>0||_.y>0){m(),v.current=M,S(C,i),w.current=_,g.current=R;return}}w.current={x:0,y:0},g.current={x:0,y:0},m()},[t,C,r,m,s,i,JSON.stringify(p),JSON.stringify(f),S,l,y,u,JSON.stringify(h)])}const ty={x:{[Ce.Backward]:!1,[Ce.Forward]:!1},y:{[Ce.Backward]:!1,[Ce.Forward]:!1}};function ny(e){let{delta:t,disabled:n}=e;const r=Do(t);return kr(o=>{if(n||!r||!o)return ty;const s={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[Ce.Backward]:o.x[Ce.Backward]||s.x===-1,[Ce.Forward]:o.x[Ce.Forward]||s.x===1},y:{[Ce.Backward]:o.y[Ce.Backward]||s.y===-1,[Ce.Forward]:o.y[Ce.Forward]||s.y===1}}},[n,t,r])}function ry(e,t){const n=t!=null?e.get(t):void 0,r=n?n.node.current:null;return kr(o=>{var s;return t==null?null:(s=r??o)!=null?s:null},[r,t])}function oy(e,t){return E.useMemo(()=>e.reduce((n,r)=>{const{sensor:o}=r,s=o.activators.map(i=>({eventName:i.eventName,handler:t(i.handler,r)}));return[...n,...s]},[]),[e,t])}var yr;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(yr||(yr={}));var pi;(function(e){e.Optimized="optimized"})(pi||(pi={}));const Wc=new Map;function sy(e,t){let{dragging:n,dependencies:r,config:o}=t;const[s,i]=E.useState(null),{frequency:a,measure:c,strategy:l}=o,u=E.useRef(e),d=w(),h=gr(d),f=E.useCallback(function(g){g===void 0&&(g=[]),!h.current&&i(p=>p===null?g:p.concat(g.filter(v=>!p.includes(v))))},[h]),S=E.useRef(null),m=kr(g=>{if(d&&!n)return Wc;if(!g||g===Wc||u.current!==e||s!=null){const p=new Map;for(let v of e){if(!v)continue;if(s&&s.length>0&&!s.includes(v.id)&&v.rect.current){p.set(v.id,v.rect.current);continue}const C=v.node.current,y=C?new ia(c(C),C):null;v.rect.current=y,y&&p.set(v.id,y)}return p}return g},[e,s,n,d,c]);return E.useEffect(()=>{u.current=e},[e]),E.useEffect(()=>{d||f()},[n,d]),E.useEffect(()=>{s&&s.length>0&&i(null)},[JSON.stringify(s)]),E.useEffect(()=>{d||typeof a!="number"||S.current!==null||(S.current=setTimeout(()=>{f(),S.current=null},a))},[a,d,f,...r]),{droppableRects:m,measureDroppableContainers:f,measuringScheduled:s!=null};function w(){switch(l){case yr.Always:return!1;case yr.BeforeDragging:return n;default:return!n}}}function ca(e,t){return kr(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function iy(e,t){return ca(e,t)}function ay(e){let{callback:t,disabled:n}=e;const r=Yo(t),o=E.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:s}=window;return new s(r)},[r,n]);return E.useEffect(()=>()=>o==null?void 0:o.disconnect(),[o]),o}function Go(e){let{callback:t,disabled:n}=e;const r=Yo(t),o=E.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:s}=window;return new s(r)},[n]);return E.useEffect(()=>()=>o==null?void 0:o.disconnect(),[o]),o}function cy(e){return new ia(Nr(e),e)}function Hc(e,t,n){t===void 0&&(t=cy);const[r,o]=E.useState(null);function s(){o(c=>{if(!e)return null;if(e.isConnected===!1){var l;return(l=c??n)!=null?l:null}const u=t(e);return JSON.stringify(c)===JSON.stringify(u)?c:u})}const i=ay({callback(c){if(e)for(const l of c){const{type:u,target:d}=l;if(u==="childList"&&d instanceof HTMLElement&&d.contains(e)){s();break}}}}),a=Go({callback:s});return yt(()=>{s(),e?(a==null||a.observe(e),i==null||i.observe(document.body,{childList:!0,subtree:!0})):(a==null||a.disconnect(),i==null||i.disconnect())},[e]),r}function ly(e){const t=ca(e);return Fd(e,t)}const Uc=[];function uy(e){const t=E.useRef(e),n=kr(r=>e?r&&r!==Uc&&e&&t.current&&e.parentNode===t.current.parentNode?r:sa(e):Uc,[e]);return E.useEffect(()=>{t.current=e},[e]),n}function dy(e){const[t,n]=E.useState(null),r=E.useRef(e),o=E.useCallback(s=>{const i=Ms(s.target);i&&n(a=>a?(a.set(i,fi(i)),new Map(a)):null)},[]);return E.useEffect(()=>{const s=r.current;if(e!==s){i(s);const a=e.map(c=>{const l=Ms(c);return l?(l.addEventListener("scroll",o,{passive:!0}),[l,fi(l)]):null}).filter(c=>c!=null);n(a.length?new Map(a):null),r.current=e}return()=>{i(e),i(s)};function i(a){a.forEach(c=>{const l=Ms(c);l==null||l.removeEventListener("scroll",o)})}},[o,e]),E.useMemo(()=>e.length?t?Array.from(t.values()).reduce((s,i)=>Rn(s,i),tt):Yd(e):tt,[e,t])}function Yc(e,t){t===void 0&&(t=[]);const n=E.useRef(null);return E.useEffect(()=>{n.current=null},t),E.useEffect(()=>{const r=e!==tt;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?Eo(e,n.current):tt}function fy(e){E.useEffect(()=>{if(!Uo)return;const t=e.map(n=>{let{sensor:r}=n;return r.setup==null?void 0:r.setup()});return()=>{for(const n of t)n==null||n()}},e.map(t=>{let{sensor:n}=t;return n}))}function hy(e,t){return E.useMemo(()=>e.reduce((n,r)=>{let{eventName:o,handler:s}=r;return n[o]=i=>{s(i,t)},n},{}),[e,t])}function Qd(e){return E.useMemo(()=>e?$v(e):null,[e])}const Kc=[];function py(e,t){t===void 0&&(t=Nr);const[n]=e,r=Qd(n?Ne(n):null),[o,s]=E.useState(Kc);function i(){s(()=>e.length?e.map(c=>Hd(c)?r:new ia(t(c),c)):Kc)}const a=Go({callback:i});return yt(()=>{a==null||a.disconnect(),i(),e.forEach(c=>a==null?void 0:a.observe(c))},[e]),o}function ef(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Or(t)?t:e}function my(e){let{measure:t}=e;const[n,r]=E.useState(null),o=E.useCallback(l=>{for(const{target:u}of l)if(Or(u)){r(d=>{const h=t(u);return d?{...d,width:h.width,height:h.height}:h});break}},[t]),s=Go({callback:o}),i=E.useCallback(l=>{const u=ef(l);s==null||s.disconnect(),u&&(s==null||s.observe(u)),r(u?t(u):null)},[t,s]),[a,c]=To(i);return E.useMemo(()=>({nodeRef:a,rect:n,setRef:c}),[n,a,c])}const gy=[{sensor:Xd,options:{}},{sensor:qd,options:{}}],vy={current:{}},mo={draggable:{measure:Fc},droppable:{measure:Fc,strategy:yr.WhileDragging,frequency:pi.Optimized},dragOverlay:{measure:Nr}};class dr extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,r;return(n=(r=this.get(t))==null?void 0:r.node.current)!=null?n:void 0}}const yy={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new dr,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Ro},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:mo,measureDroppableContainers:Ro,windowRect:null,measuringScheduled:!1},tf={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Ro,draggableNodes:new Map,over:null,measureDroppableContainers:Ro},Ir=E.createContext(tf),nf=E.createContext(yy);function by(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new dr}}}function xy(e,t){switch(t.type){case Se.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case Se.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case Se.DragEnd:case Se.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Se.RegisterDroppable:{const{element:n}=t,{id:r}=n,o=new dr(e.droppable.containers);return o.set(r,n),{...e,droppable:{...e.droppable,containers:o}}}case Se.SetDroppableDisabled:{const{id:n,key:r,disabled:o}=t,s=e.droppable.containers.get(n);if(!s||r!==s.key)return e;const i=new dr(e.droppable.containers);return i.set(n,{...s,disabled:o}),{...e,droppable:{...e.droppable,containers:i}}}case Se.UnregisterDroppable:{const{id:n,key:r}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const s=new dr(e.droppable.containers);return s.delete(n),{...e,droppable:{...e.droppable,containers:s}}}default:return e}}function wy(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:o}=E.useContext(Ir),s=Do(r),i=Do(n==null?void 0:n.id);return E.useEffect(()=>{if(!t&&!r&&s&&i!=null){if(!oa(s)||document.activeElement===s.target)return;const a=o.get(i);if(!a)return;const{activatorNode:c,node:l}=a;if(!c.current&&!l.current)return;requestAnimationFrame(()=>{for(const u of[c.current,l.current]){if(!u)continue;const d=xv(u);if(d){d.focus();break}}})}},[r,t,o,i,s]),null}function rf(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((o,s)=>s({transform:o,...r}),n):n}function Sy(e){return E.useMemo(()=>({draggable:{...mo.draggable,...e==null?void 0:e.draggable},droppable:{...mo.droppable,...e==null?void 0:e.droppable},dragOverlay:{...mo.dragOverlay,...e==null?void 0:e.dragOverlay}}),[e==null?void 0:e.draggable,e==null?void 0:e.droppable,e==null?void 0:e.dragOverlay])}function Cy(e){let{activeNode:t,measure:n,initialRect:r,config:o=!0}=e;const s=E.useRef(!1),{x:i,y:a}=typeof o=="boolean"?{x:o,y:o}:o;yt(()=>{if(!i&&!a||!t){s.current=!1;return}if(s.current||!r)return;const l=t==null?void 0:t.node.current;if(!l||l.isConnected===!1)return;const u=n(l),d=Fd(u,r);if(i||(d.x=0),a||(d.y=0),s.current=!0,Math.abs(d.x)>0||Math.abs(d.y)>0){const h=Bd(l);h&&h.scrollBy({top:d.y,left:d.x})}},[t,i,a,r,n])}const qo=E.createContext({...tt,scaleX:1,scaleY:1});var It;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(It||(It={}));const la=E.memo(function(t){var n,r,o,s;let{id:i,accessibility:a,autoScroll:c=!0,children:l,sensors:u=gy,collisionDetection:d=Nv,measuring:h,modifiers:f,...S}=t;const m=E.useReducer(xy,void 0,by),[w,g]=m,[p,v]=Dv(),[C,y]=E.useState(It.Uninitialized),M=C===It.Initialized,{draggable:{active:b,nodes:T,translate:R},droppable:{containers:_}}=w,O=b!=null?T.get(b):null,z=E.useRef({initial:null,translated:null}),G=E.useMemo(()=>{var Me;return b!=null?{id:b,data:(Me=O==null?void 0:O.data)!=null?Me:vy,rect:z}:null},[b,O]),j=E.useRef(null),[F,N]=E.useState(null),[k,P]=E.useState(null),I=gr(S,Object.values(S)),A=Ko("DndDescribedBy",i),V=E.useMemo(()=>_.getEnabled(),[_]),W=Sy(h),{droppableRects:H,measureDroppableContainers:L,measuringScheduled:Y}=sy(V,{dragging:M,dependencies:[R.x,R.y],config:W.droppable}),K=ry(T,b),$=E.useMemo(()=>k?Mo(k):null,[k]),q=Og(),X=iy(K,W.draggable.measure);Cy({activeNode:b!=null?T.get(b):null,config:q.layoutShiftCompensation,initialRect:X,measure:W.draggable.measure});const U=Hc(K,W.draggable.measure,X),ne=Hc(K?K.parentElement:null),B=E.useRef({activatorEvent:null,active:null,activeNode:K,collisionRect:null,collisions:null,droppableRects:H,draggableNodes:T,draggingNode:null,draggingNodeRect:null,droppableContainers:_,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),ie=_.getNodeFor((n=B.current.over)==null?void 0:n.id),pe=my({measure:W.dragOverlay.measure}),Oe=(r=pe.nodeRef.current)!=null?r:K,Ee=M?(o=pe.rect)!=null?o:U:null,ot=!!(pe.nodeRef.current&&pe.rect),J=ly(ot?null:U),ce=Qd(Oe?Ne(Oe):null),ye=uy(M?ie??K:null),Ve=py(ye),He=rf(f,{transform:{x:R.x-J.x,y:R.y-J.y,scaleX:1,scaleY:1},activatorEvent:k,active:G,activeNodeRect:U,containerNodeRect:ne,draggingNodeRect:Ee,over:B.current.over,overlayNodeRect:pe.rect,scrollableAncestors:ye,scrollableAncestorRects:Ve,windowRect:ce}),Kn=$?Rn($,R):null,ws=dy(ye),Mc=Yc(ws),Ss=Yc(ws,[U]),pn=Rn(He,Mc),mn=Ee?Lv(Ee,He):null,Gn=G&&mn?d({active:G,collisionRect:mn,droppableRects:H,droppableContainers:V,pointerCoordinates:Kn}):null,Rc=kv(Gn,"id"),[Et,Pc]=E.useState(null),Eg=ot?He:Rn(He,Ss),Mg=Iv(Eg,(s=Et==null?void 0:Et.rect)!=null?s:null,U),Cs=E.useRef(null),Ac=E.useCallback((Me,Fe)=>{let{sensor:$e,options:Mt}=Fe;if(j.current==null)return;const Ue=T.get(j.current);if(!Ue)return;const Be=Me.nativeEvent,st=new $e({active:j.current,activeNode:Ue,event:Be,options:Mt,context:B,onAbort(Te){if(!T.get(Te))return;const{onDragAbort:it}=I.current,pt={id:Te};it==null||it(pt),p({type:"onDragAbort",event:pt})},onPending(Te,Rt,it,pt){if(!T.get(Te))return;const{onDragPending:Xn}=I.current,Pt={id:Te,constraint:Rt,initialCoordinates:it,offset:pt};Xn==null||Xn(Pt),p({type:"onDragPending",event:Pt})},onStart(Te){const Rt=j.current;if(Rt==null)return;const it=T.get(Rt);if(!it)return;const{onDragStart:pt}=I.current,qn={activatorEvent:Be,active:{id:Rt,data:it.data,rect:z}};vt.unstable_batchedUpdates(()=>{pt==null||pt(qn),y(It.Initializing),g({type:Se.DragStart,initialCoordinates:Te,active:Rt}),p({type:"onDragStart",event:qn}),N(Cs.current),P(Be)})},onMove(Te){g({type:Se.DragMove,coordinates:Te})},onEnd:gn(Se.DragEnd),onCancel:gn(Se.DragCancel)});Cs.current=st;function gn(Te){return async function(){const{active:it,collisions:pt,over:qn,scrollAdjustedTranslate:Xn}=B.current;let Pt=null;if(it&&Xn){const{cancelDrop:Zn}=I.current;Pt={activatorEvent:Be,active:it,collisions:pt,delta:Xn,over:qn},Te===Se.DragEnd&&typeof Zn=="function"&&await Promise.resolve(Zn(Pt))&&(Te=Se.DragCancel)}j.current=null,vt.unstable_batchedUpdates(()=>{g({type:Te}),y(It.Uninitialized),Pc(null),N(null),P(null),Cs.current=null;const Zn=Te===Se.DragEnd?"onDragEnd":"onDragCancel";if(Pt){const Ts=I.current[Zn];Ts==null||Ts(Pt),p({type:Zn,event:Pt})}})}}},[T]),Rg=E.useCallback((Me,Fe)=>($e,Mt)=>{const Ue=$e.nativeEvent,Be=T.get(Mt);if(j.current!==null||!Be||Ue.dndKit||Ue.defaultPrevented)return;const st={active:Be};Me($e,Fe.options,st)===!0&&(Ue.dndKit={capturedBy:Fe.sensor},j.current=Mt,Ac($e,Fe))},[T,Ac]),Oc=oy(u,Rg);fy(u),yt(()=>{U&&C===It.Initializing&&y(It.Initialized)},[U,C]),E.useEffect(()=>{const{onDragMove:Me}=I.current,{active:Fe,activatorEvent:$e,collisions:Mt,over:Ue}=B.current;if(!Fe||!$e)return;const Be={active:Fe,activatorEvent:$e,collisions:Mt,delta:{x:pn.x,y:pn.y},over:Ue};vt.unstable_batchedUpdates(()=>{Me==null||Me(Be),p({type:"onDragMove",event:Be})})},[pn.x,pn.y]),E.useEffect(()=>{const{active:Me,activatorEvent:Fe,collisions:$e,droppableContainers:Mt,scrollAdjustedTranslate:Ue}=B.current;if(!Me||j.current==null||!Fe||!Ue)return;const{onDragOver:Be}=I.current,st=Mt.get(Rc),gn=st&&st.rect.current?{id:st.id,rect:st.rect.current,data:st.data,disabled:st.disabled}:null,Te={active:Me,activatorEvent:Fe,collisions:$e,delta:{x:Ue.x,y:Ue.y},over:gn};vt.unstable_batchedUpdates(()=>{Pc(gn),Be==null||Be(Te),p({type:"onDragOver",event:Te})})},[Rc]),yt(()=>{B.current={activatorEvent:k,active:G,activeNode:K,collisionRect:mn,collisions:Gn,droppableRects:H,draggableNodes:T,draggingNode:Oe,draggingNodeRect:Ee,droppableContainers:_,over:Et,scrollableAncestors:ye,scrollAdjustedTranslate:pn},z.current={initial:Ee,translated:mn}},[G,K,Gn,mn,T,Oe,Ee,H,_,Et,ye,pn]),ey({...q,delta:R,draggingRect:mn,pointerCoordinates:Kn,scrollableAncestors:ye,scrollableAncestorRects:Ve});const Pg=E.useMemo(()=>({active:G,activeNode:K,activeNodeRect:U,activatorEvent:k,collisions:Gn,containerNodeRect:ne,dragOverlay:pe,draggableNodes:T,droppableContainers:_,droppableRects:H,over:Et,measureDroppableContainers:L,scrollableAncestors:ye,scrollableAncestorRects:Ve,measuringConfiguration:W,measuringScheduled:Y,windowRect:ce}),[G,K,U,k,Gn,ne,pe,T,_,H,Et,L,ye,Ve,W,Y,ce]),Ag=E.useMemo(()=>({activatorEvent:k,activators:Oc,active:G,activeNodeRect:U,ariaDescribedById:{draggable:A},dispatch:g,draggableNodes:T,over:Et,measureDroppableContainers:L}),[k,Oc,G,U,g,A,T,Et,L]);return E.createElement(Vd.Provider,{value:v},E.createElement(Ir.Provider,{value:Ag},E.createElement(nf.Provider,{value:Pg},E.createElement(qo.Provider,{value:Mg},l)),E.createElement(wy,{disabled:(a==null?void 0:a.restoreFocus)===!1})),E.createElement(Rv,{...a,hiddenTextDescribedById:A}));function Og(){const Me=(F==null?void 0:F.autoScrollEnabled)===!1,Fe=typeof c=="object"?c.enabled===!1:c===!1,$e=M&&!Me&&!Fe;return typeof c=="object"?{...c,enabled:$e}:{enabled:$e}}}),Ty=E.createContext(null),Gc="button",Dy="Draggable";function ua(e){let{id:t,data:n,disabled:r=!1,attributes:o}=e;const s=Ko(Dy),{activators:i,activatorEvent:a,active:c,activeNodeRect:l,ariaDescribedById:u,draggableNodes:d,over:h}=E.useContext(Ir),{role:f=Gc,roleDescription:S="draggable",tabIndex:m=0}=o??{},w=(c==null?void 0:c.id)===t,g=E.useContext(w?qo:Ty),[p,v]=To(),[C,y]=To(),M=hy(i,t),b=gr(n);yt(()=>(d.set(t,{id:t,key:s,node:p,activatorNode:C,data:b}),()=>{const R=d.get(t);R&&R.key===s&&d.delete(t)}),[d,t]);const T=E.useMemo(()=>({role:f,tabIndex:m,"aria-disabled":r,"aria-pressed":w&&f===Gc?!0:void 0,"aria-roledescription":S,"aria-describedby":u.draggable}),[r,f,m,w,S,u.draggable]);return{active:c,activatorEvent:a,activeNodeRect:l,attributes:T,isDragging:w,listeners:r?void 0:M,node:p,over:h,setNodeRef:v,setActivatorNodeRef:y,transform:g}}function Ey(){return E.useContext(nf)}const My="Droppable",Ry={timeout:25};function qr(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:o}=e;const s=Ko(My),{active:i,dispatch:a,over:c,measureDroppableContainers:l}=E.useContext(Ir),u=E.useRef({disabled:n}),d=E.useRef(!1),h=E.useRef(null),f=E.useRef(null),{disabled:S,updateMeasurementsFor:m,timeout:w}={...Ry,...o},g=gr(m??r),p=E.useCallback(()=>{if(!d.current){d.current=!0;return}f.current!=null&&clearTimeout(f.current),f.current=setTimeout(()=>{l(Array.isArray(g.current)?g.current:[g.current]),f.current=null},w)},[w]),v=Go({callback:p,disabled:S||!i}),C=E.useCallback((T,R)=>{v&&(R&&(v.unobserve(R),d.current=!1),T&&v.observe(T))},[v]),[y,M]=To(C),b=gr(t);return E.useEffect(()=>{!v||!y.current||(v.disconnect(),d.current=!1,v.observe(y.current))},[y,v]),E.useEffect(()=>(a({type:Se.RegisterDroppable,element:{id:r,key:s,disabled:n,node:y,rect:h,data:b}}),()=>a({type:Se.UnregisterDroppable,key:s,id:r})),[r]),E.useEffect(()=>{n!==u.current.disabled&&(a({type:Se.SetDroppableDisabled,id:r,key:s,disabled:n}),u.current.disabled=n)},[r,s,n,a]),{active:i,rect:h,isOver:(c==null?void 0:c.id)===r,node:y,over:c,setNodeRef:M}}function Py(e){let{animation:t,children:n}=e;const[r,o]=E.useState(null),[s,i]=E.useState(null),a=Do(n);return!n&&!r&&a&&o(a),yt(()=>{if(!s)return;const c=r==null?void 0:r.key,l=r==null?void 0:r.props.id;if(c==null||l==null){o(null);return}Promise.resolve(t(l,s)).then(()=>{o(null)})},[t,r,s]),E.createElement(E.Fragment,null,n,r?E.cloneElement(r,{ref:i}):null)}const Ay={x:0,y:0,scaleX:1,scaleY:1};function Oy(e){let{children:t}=e;return E.createElement(Ir.Provider,{value:tf},E.createElement(qo.Provider,{value:Ay},t))}const ky={position:"fixed",touchAction:"none"},_y=e=>oa(e)?"transform 250ms ease":void 0,Ny=E.forwardRef((e,t)=>{let{as:n,activatorEvent:r,adjustScale:o,children:s,className:i,rect:a,style:c,transform:l,transition:u=_y}=e;if(!a)return null;const d=o?l:{...l,scaleX:1,scaleY:1},h={...ky,width:a.width,height:a.height,top:a.top,left:a.left,transform:vr.Transform.toString(d),transformOrigin:o&&r?Av(r,a):void 0,transition:typeof u=="function"?u(r):u,...c};return E.createElement(n,{className:i,style:h,ref:t},s)}),Iy=e=>t=>{let{active:n,dragOverlay:r}=t;const o={},{styles:s,className:i}=e;if(s!=null&&s.active)for(const[a,c]of Object.entries(s.active))c!==void 0&&(o[a]=n.node.style.getPropertyValue(a),n.node.style.setProperty(a,c));if(s!=null&&s.dragOverlay)for(const[a,c]of Object.entries(s.dragOverlay))c!==void 0&&r.node.style.setProperty(a,c);return i!=null&&i.active&&n.node.classList.add(i.active),i!=null&&i.dragOverlay&&r.node.classList.add(i.dragOverlay),function(){for(const[c,l]of Object.entries(o))n.node.style.setProperty(c,l);i!=null&&i.active&&n.node.classList.remove(i.active)}},jy=e=>{let{transform:{initial:t,final:n}}=e;return[{transform:vr.Transform.toString(t)},{transform:vr.Transform.toString(n)}]},Ly={duration:250,easing:"ease",keyframes:jy,sideEffects:Iy({styles:{active:{opacity:"0"}}})};function Vy(e){let{config:t,draggableNodes:n,droppableContainers:r,measuringConfiguration:o}=e;return Yo((s,i)=>{if(t===null)return;const a=n.get(s);if(!a)return;const c=a.node.current;if(!c)return;const l=ef(i);if(!l)return;const{transform:u}=Ne(i).getComputedStyle(i),d=$d(u);if(!d)return;const h=typeof t=="function"?t:Fy(t);return Kd(c,o.draggable.measure),h({active:{id:s,data:a.data,node:c,rect:o.draggable.measure(c)},draggableNodes:n,dragOverlay:{node:i,rect:o.dragOverlay.measure(l)},droppableContainers:r,measuringConfiguration:o,transform:d})})}function Fy(e){const{duration:t,easing:n,sideEffects:r,keyframes:o}={...Ly,...e};return s=>{let{active:i,dragOverlay:a,transform:c,...l}=s;if(!t)return;const u={x:a.rect.left-i.rect.left,y:a.rect.top-i.rect.top},d={scaleX:c.scaleX!==1?i.rect.width*c.scaleX/a.rect.width:1,scaleY:c.scaleY!==1?i.rect.height*c.scaleY/a.rect.height:1},h={x:c.x-u.x,y:c.y-u.y,...d},f=o({...l,active:i,dragOverlay:a,transform:{initial:c,final:h}}),[S]=f,m=f[f.length-1];if(JSON.stringify(S)===JSON.stringify(m))return;const w=r==null?void 0:r({active:i,dragOverlay:a,...l}),g=a.node.animate(f,{duration:t,easing:n,fill:"forwards"});return new Promise(p=>{g.onfinish=()=>{w==null||w(),p()}})}}let qc=0;function $y(e){return E.useMemo(()=>{if(e!=null)return qc++,qc},[e])}const By=E.memo(e=>{let{adjustScale:t=!1,children:n,dropAnimation:r,style:o,transition:s,modifiers:i,wrapperElement:a="div",className:c,zIndex:l=999}=e;const{activatorEvent:u,active:d,activeNodeRect:h,containerNodeRect:f,draggableNodes:S,droppableContainers:m,dragOverlay:w,over:g,measuringConfiguration:p,scrollableAncestors:v,scrollableAncestorRects:C,windowRect:y}=Ey(),M=E.useContext(qo),b=$y(d==null?void 0:d.id),T=rf(i,{activatorEvent:u,active:d,activeNodeRect:h,containerNodeRect:f,draggingNodeRect:w.rect,over:g,overlayNodeRect:w.rect,scrollableAncestors:v,scrollableAncestorRects:C,transform:M,windowRect:y}),R=ca(h),_=Vy({config:r,draggableNodes:S,droppableContainers:m,measuringConfiguration:p}),O=R?w.setRef:void 0;return E.createElement(Oy,null,E.createElement(Py,{animation:_},d&&b?E.createElement(Ny,{key:b,id:d.id,ref:O,as:a,activatorEvent:u,adjustScale:t,className:c,transition:s,rect:R,style:{zIndex:l,...o},transform:T},n):null))});/**
10
10
  * @license lucide-react v0.483.0 - ISC
11
11
  *
12
12
  * This source code is licensed under the ISC license.
13
13
  * See the LICENSE file in the root directory of this source tree.
14
- */const Iy=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),nf=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/**
14
+ */const zy=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),of=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/**
15
15
  * @license lucide-react v0.483.0 - ISC
16
16
  *
17
17
  * This source code is licensed under the ISC license.
18
18
  * See the LICENSE file in the root directory of this source tree.
19
- */var jy={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
19
+ */var Wy={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
20
20
  * @license lucide-react v0.483.0 - ISC
21
21
  *
22
22
  * This source code is licensed under the ISC license.
23
23
  * See the LICENSE file in the root directory of this source tree.
24
- */const Ly=E.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:s,iconNode:i,...a},c)=>E.createElement("svg",{ref:c,...jy,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:nf("lucide",o),...a},[...i.map(([l,u])=>E.createElement(l,u)),...Array.isArray(s)?s:[s]]));/**
24
+ */const Hy=E.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:s,iconNode:i,...a},c)=>E.createElement("svg",{ref:c,...Wy,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:of("lucide",o),...a},[...i.map(([l,u])=>E.createElement(l,u)),...Array.isArray(s)?s:[s]]));/**
25
25
  * @license lucide-react v0.483.0 - ISC
26
26
  *
27
27
  * This source code is licensed under the ISC license.
28
28
  * See the LICENSE file in the root directory of this source tree.
29
- */const Ae=(e,t)=>{const n=E.forwardRef(({className:r,...o},s)=>E.createElement(Ly,{ref:s,iconNode:t,className:nf(`lucide-${Iy(e)}`,r),...o}));return n.displayName=`${e}`,n};/**
29
+ */const Ae=(e,t)=>{const n=E.forwardRef(({className:r,...o},s)=>E.createElement(Hy,{ref:s,iconNode:t,className:of(`lucide-${zy(e)}`,r),...o}));return n.displayName=`${e}`,n};/**
30
30
  * @license lucide-react v0.483.0 - ISC
31
31
  *
32
32
  * This source code is licensed under the ISC license.
33
33
  * See the LICENSE file in the root directory of this source tree.
34
- */const Vy=[["path",{d:"m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z",key:"1fy3hk"}]],Fy=Ae("Bookmark",Vy);/**
34
+ */const Uy=[["path",{d:"m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z",key:"1fy3hk"}]],Yy=Ae("Bookmark",Uy);/**
35
35
  * @license lucide-react v0.483.0 - ISC
36
36
  *
37
37
  * This source code is licensed under the ISC license.
38
38
  * See the LICENSE file in the root directory of this source tree.
39
- */const $y=[["path",{d:"m15.2 16.9-.9-.4",key:"1r0w5f"}],["path",{d:"m15.2 19.1-.9.4",key:"j188fs"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"m16.9 15.2-.4-.9",key:"699xu"}],["path",{d:"m16.9 20.8-.4.9",key:"dfjc4z"}],["path",{d:"m19.5 14.3-.4.9",key:"1eb35c"}],["path",{d:"m19.5 21.7-.4-.9",key:"1tonu5"}],["path",{d:"M21 10.5V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h6",key:"11kmuh"}],["path",{d:"m21.7 16.5-.9.4",key:"1knoei"}],["path",{d:"m21.7 19.5-.9-.4",key:"q4dx6b"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 2v4",key:"1cmpym"}],["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}]],By=Ae("CalendarCog",$y);/**
39
+ */const Ky=[["path",{d:"m15.2 16.9-.9-.4",key:"1r0w5f"}],["path",{d:"m15.2 19.1-.9.4",key:"j188fs"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"m16.9 15.2-.4-.9",key:"699xu"}],["path",{d:"m16.9 20.8-.4.9",key:"dfjc4z"}],["path",{d:"m19.5 14.3-.4.9",key:"1eb35c"}],["path",{d:"m19.5 21.7-.4-.9",key:"1tonu5"}],["path",{d:"M21 10.5V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h6",key:"11kmuh"}],["path",{d:"m21.7 16.5-.9.4",key:"1knoei"}],["path",{d:"m21.7 19.5-.9-.4",key:"q4dx6b"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 2v4",key:"1cmpym"}],["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}]],Gy=Ae("CalendarCog",Ky);/**
40
40
  * @license lucide-react v0.483.0 - ISC
41
41
  *
42
42
  * This source code is licensed under the ISC license.
43
43
  * See the LICENSE file in the root directory of this source tree.
44
- */const zy=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 18h.01",key:"lrp35t"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M16 18h.01",key:"kzsmim"}]],Wy=Ae("CalendarDays",zy);/**
44
+ */const qy=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 18h.01",key:"lrp35t"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M16 18h.01",key:"kzsmim"}]],Xy=Ae("CalendarDays",qy);/**
45
45
  * @license lucide-react v0.483.0 - ISC
46
46
  *
47
47
  * This source code is licensed under the ISC license.
48
48
  * See the LICENSE file in the root directory of this source tree.
49
- */const Hy=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],rf=Ae("Check",Hy);/**
49
+ */const Zy=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],sf=Ae("Check",Zy);/**
50
50
  * @license lucide-react v0.483.0 - ISC
51
51
  *
52
52
  * This source code is licensed under the ISC license.
53
53
  * See the LICENSE file in the root directory of this source tree.
54
- */const Uy=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],of=Ae("ChevronDown",Uy);/**
54
+ */const Jy=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],af=Ae("ChevronDown",Jy);/**
55
55
  * @license lucide-react v0.483.0 - ISC
56
56
  *
57
57
  * This source code is licensed under the ISC license.
58
58
  * See the LICENSE file in the root directory of this source tree.
59
- */const Yy=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],Ky=Ae("ChevronLeft",Yy);/**
59
+ */const Qy=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],eb=Ae("ChevronLeft",Qy);/**
60
60
  * @license lucide-react v0.483.0 - ISC
61
61
  *
62
62
  * This source code is licensed under the ISC license.
63
63
  * See the LICENSE file in the root directory of this source tree.
64
- */const Gy=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],qy=Ae("ChevronRight",Gy);/**
64
+ */const tb=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],nb=Ae("ChevronRight",tb);/**
65
65
  * @license lucide-react v0.483.0 - ISC
66
66
  *
67
67
  * This source code is licensed under the ISC license.
68
68
  * See the LICENSE file in the root directory of this source tree.
69
- */const Xy=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],Zy=Ae("ChevronUp",Xy);/**
69
+ */const rb=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],ob=Ae("ChevronUp",rb);/**
70
70
  * @license lucide-react v0.483.0 - ISC
71
71
  *
72
72
  * This source code is licensed under the ISC license.
73
73
  * See the LICENSE file in the root directory of this source tree.
74
- */const Jy=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]],Qy=Ae("CirclePlus",Jy);/**
74
+ */const sb=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]],ib=Ae("CirclePlus",sb);/**
75
75
  * @license lucide-react v0.483.0 - ISC
76
76
  *
77
77
  * This source code is licensed under the ISC license.
78
78
  * See the LICENSE file in the root directory of this source tree.
79
- */const eb=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M7.5 3v18",key:"w0wo6v"}],["path",{d:"M12 3v18",key:"108xh3"}],["path",{d:"M16.5 3v18",key:"10tjh1"}]],tb=Ae("Columns4",eb);/**
79
+ */const ab=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M7.5 3v18",key:"w0wo6v"}],["path",{d:"M12 3v18",key:"108xh3"}],["path",{d:"M16.5 3v18",key:"10tjh1"}]],cb=Ae("Columns4",ab);/**
80
80
  * @license lucide-react v0.483.0 - ISC
81
81
  *
82
82
  * This source code is licensed under the ISC license.
83
83
  * See the LICENSE file in the root directory of this source tree.
84
- */const nb=[["path",{d:"M3 2h18",key:"15qxfx"}],["rect",{width:"18",height:"12",x:"3",y:"6",rx:"2",key:"1439r6"}],["path",{d:"M3 22h18",key:"8prr45"}]],rb=Ae("GalleryVertical",nb);/**
84
+ */const lb=[["path",{d:"M3 2h18",key:"15qxfx"}],["rect",{width:"18",height:"12",x:"3",y:"6",rx:"2",key:"1439r6"}],["path",{d:"M3 22h18",key:"8prr45"}]],ub=Ae("GalleryVertical",lb);/**
85
85
  * @license lucide-react v0.483.0 - ISC
86
86
  *
87
87
  * This source code is licensed under the ISC license.
88
88
  * See the LICENSE file in the root directory of this source tree.
89
- */const ob=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]],sb=Ae("Grid3x3",ob);/**
89
+ */const db=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]],fb=Ae("Grid3x3",db);/**
90
90
  * @license lucide-react v0.483.0 - ISC
91
91
  *
92
92
  * This source code is licensed under the ISC license.
93
93
  * See the LICENSE file in the root directory of this source tree.
94
- */const ib=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],ab=Ae("Pencil",ib);/**
94
+ */const hb=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],pb=Ae("Pencil",hb);/**
95
95
  * @license lucide-react v0.483.0 - ISC
96
96
  *
97
97
  * This source code is licensed under the ISC license.
98
98
  * See the LICENSE file in the root directory of this source tree.
99
- */const cb=[["path",{d:"M12.034 12.681a.498.498 0 0 1 .647-.647l9 3.5a.5.5 0 0 1-.033.943l-3.444 1.068a1 1 0 0 0-.66.66l-1.067 3.443a.5.5 0 0 1-.943.033z",key:"xwnzip"}],["path",{d:"M21 11V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h6",key:"14rsvq"}]],lb=Ae("SquareMousePointer",cb);/**
99
+ */const mb=[["path",{d:"M12.034 12.681a.498.498 0 0 1 .647-.647l9 3.5a.5.5 0 0 1-.033.943l-3.444 1.068a1 1 0 0 0-.66.66l-1.067 3.443a.5.5 0 0 1-.943.033z",key:"xwnzip"}],["path",{d:"M21 11V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h6",key:"14rsvq"}]],gb=Ae("SquareMousePointer",mb);/**
100
100
  * @license lucide-react v0.483.0 - ISC
101
101
  *
102
102
  * This source code is licensed under the ISC license.
103
103
  * See the LICENSE file in the root directory of this source tree.
104
- */const ub=[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]],db=Ae("Trash2",ub);/**
104
+ */const vb=[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]],yb=Ae("Trash2",vb);/**
105
105
  * @license lucide-react v0.483.0 - ISC
106
106
  *
107
107
  * This source code is licensed under the ISC license.
108
108
  * See the LICENSE file in the root directory of this source tree.
109
- */const fb=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],hb=Ae("X",fb);function sf(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=sf(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function af(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=sf(e))&&(r&&(r+=" "),r+=t);return r}const da="-",pb=e=>{const t=gb(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:i=>{const a=i.split(da);return a[0]===""&&a.length!==1&&a.shift(),cf(a,t)||mb(i)},getConflictingClassGroupIds:(i,a)=>{const c=n[i]||[];return a&&r[i]?[...c,...r[i]]:c}}},cf=(e,t)=>{var i;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?cf(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const s=e.join(da);return(i=t.validators.find(({validator:a})=>a(s)))==null?void 0:i.classGroupId},Xc=/^\[(.+)\]$/,mb=e=>{if(Xc.test(e)){const t=Xc.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},gb=e=>{const{theme:t,classGroups:n}=e,r={nextPart:new Map,validators:[]};for(const o in n)mi(n[o],r,o,t);return r},mi=(e,t,n,r)=>{e.forEach(o=>{if(typeof o=="string"){const s=o===""?t:Zc(t,o);s.classGroupId=n;return}if(typeof o=="function"){if(vb(o)){mi(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([s,i])=>{mi(i,Zc(t,s),n,r)})})},Zc=(e,t)=>{let n=e;return t.split(da).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},vb=e=>e.isThemeGetter,yb=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const o=(s,i)=>{n.set(s,i),t++,t>e&&(t=0,r=n,n=new Map)};return{get(s){let i=n.get(s);if(i!==void 0)return i;if((i=r.get(s))!==void 0)return o(s,i),i},set(s,i){n.has(s)?n.set(s,i):o(s,i)}}},gi="!",vi=":",bb=vi.length,xb=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=o=>{const s=[];let i=0,a=0,c=0,l;for(let S=0;S<o.length;S++){let p=o[S];if(i===0&&a===0){if(p===vi){s.push(o.slice(c,S)),c=S+bb;continue}if(p==="/"){l=S;continue}}p==="["?i++:p==="]"?i--:p==="("?a++:p===")"&&a--}const u=s.length===0?o:o.substring(c),d=wb(u),f=d!==u,h=l&&l>c?l-c:void 0;return{modifiers:s,hasImportantModifier:f,baseClassName:d,maybePostfixModifierPosition:h}};if(t){const o=t+vi,s=r;r=i=>i.startsWith(o)?s(i.substring(o.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:i,maybePostfixModifierPosition:void 0}}if(n){const o=r;r=s=>n({className:s,parseClassName:o})}return r},wb=e=>e.endsWith(gi)?e.substring(0,e.length-1):e.startsWith(gi)?e.substring(1):e,Sb=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(r=>[r,!0]));return r=>{if(r.length<=1)return r;const o=[];let s=[];return r.forEach(i=>{i[0]==="["||t[i]?(o.push(...s.sort(),i),s=[]):s.push(i)}),o.push(...s.sort()),o}},Cb=e=>({cache:yb(e.cacheSize),parseClassName:xb(e),sortModifiers:Sb(e),...pb(e)}),Tb=/\s+/,Db=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o,sortModifiers:s}=t,i=[],a=e.trim().split(Tb);let c="";for(let l=a.length-1;l>=0;l-=1){const u=a[l],{isExternal:d,modifiers:f,hasImportantModifier:h,baseClassName:S,maybePostfixModifierPosition:p}=n(u);if(d){c=u+(c.length>0?" "+c:c);continue}let b=!!p,v=r(b?S.substring(0,p):S);if(!v){if(!b){c=u+(c.length>0?" "+c:c);continue}if(v=r(S),!v){c=u+(c.length>0?" "+c:c);continue}b=!1}const m=s(f).join(":"),g=h?m+gi:m,C=g+v;if(i.includes(C))continue;i.push(C);const y=o(v,b);for(let M=0;M<y.length;++M){const x=y[M];i.push(g+x)}c=u+(c.length>0?" "+c:c)}return c};function Eb(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=lf(t))&&(r&&(r+=" "),r+=n);return r}const lf=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=lf(e[r]))&&(n&&(n+=" "),n+=t);return n};function Mb(e,...t){let n,r,o,s=i;function i(c){const l=t.reduce((u,d)=>d(u),e());return n=Cb(l),r=n.cache.get,o=n.cache.set,s=a,a(c)}function a(c){const l=r(c);if(l)return l;const u=Db(c,n);return o(c,u),u}return function(){return s(Eb.apply(null,arguments))}}const we=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},uf=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,df=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Rb=/^\d+\/\d+$/,Pb=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Ab=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Ob=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,kb=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,_b=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,vn=e=>Rb.test(e),se=e=>!!e&&!Number.isNaN(Number(e)),At=e=>!!e&&Number.isInteger(Number(e)),As=e=>e.endsWith("%")&&se(e.slice(0,-1)),gt=e=>Pb.test(e),Nb=()=>!0,Ib=e=>Ab.test(e)&&!Ob.test(e),ff=()=>!1,jb=e=>kb.test(e),Lb=e=>_b.test(e),Vb=e=>!Q(e)&&!ee(e),Fb=e=>Vn(e,mf,ff),Q=e=>uf.test(e),Zt=e=>Vn(e,gf,Ib),Os=e=>Vn(e,Hb,se),Jc=e=>Vn(e,hf,ff),$b=e=>Vn(e,pf,Lb),Zr=e=>Vn(e,vf,jb),ee=e=>df.test(e),Jn=e=>Fn(e,gf),Bb=e=>Fn(e,Ub),Qc=e=>Fn(e,hf),zb=e=>Fn(e,mf),Wb=e=>Fn(e,pf),Jr=e=>Fn(e,vf,!0),Vn=(e,t,n)=>{const r=uf.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Fn=(e,t,n=!1)=>{const r=df.exec(e);return r?r[1]?t(r[1]):n:!1},hf=e=>e==="position"||e==="percentage",pf=e=>e==="image"||e==="url",mf=e=>e==="length"||e==="size"||e==="bg-size",gf=e=>e==="length",Hb=e=>e==="number",Ub=e=>e==="family-name",vf=e=>e==="shadow",Yb=()=>{const e=we("color"),t=we("font"),n=we("text"),r=we("font-weight"),o=we("tracking"),s=we("leading"),i=we("breakpoint"),a=we("container"),c=we("spacing"),l=we("radius"),u=we("shadow"),d=we("inset-shadow"),f=we("text-shadow"),h=we("drop-shadow"),S=we("blur"),p=we("perspective"),b=we("aspect"),v=we("ease"),m=we("animate"),g=()=>["auto","avoid","all","avoid-page","page","left","right","column"],C=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],y=()=>[...C(),ee,Q],M=()=>["auto","hidden","clip","visible","scroll"],x=()=>["auto","contain","none"],T=()=>[ee,Q,c],R=()=>[vn,"full","auto",...T()],_=()=>[At,"none","subgrid",ee,Q],O=()=>["auto",{span:["full",At,ee,Q]},At,ee,Q],z=()=>[At,"auto",ee,Q],G=()=>["auto","min","max","fr",ee,Q],j=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],F=()=>["start","end","center","stretch","center-safe","end-safe"],N=()=>["auto",...T()],k=()=>[vn,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...T()],P=()=>[e,ee,Q],I=()=>[...C(),Qc,Jc,{position:[ee,Q]}],A=()=>["no-repeat",{repeat:["","x","y","space","round"]}],V=()=>["auto","cover","contain",zb,Fb,{size:[ee,Q]}],W=()=>[As,Jn,Zt],H=()=>["","none","full",l,ee,Q],L=()=>["",se,Jn,Zt],Y=()=>["solid","dashed","dotted","double"],K=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],$=()=>[se,As,Qc,Jc],q=()=>["","none",S,ee,Q],X=()=>["none",se,ee,Q],U=()=>["none",se,ee,Q],ne=()=>[se,ee,Q],B=()=>[vn,"full",...T()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[gt],breakpoint:[gt],color:[Nb],container:[gt],"drop-shadow":[gt],ease:["in","out","in-out"],font:[Vb],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[gt],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[gt],shadow:[gt],spacing:["px",se],text:[gt],"text-shadow":[gt],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",vn,Q,ee,b]}],container:["container"],columns:[{columns:[se,Q,ee,a]}],"break-after":[{"break-after":g()}],"break-before":[{"break-before":g()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:y()}],overflow:[{overflow:M()}],"overflow-x":[{"overflow-x":M()}],"overflow-y":[{"overflow-y":M()}],overscroll:[{overscroll:x()}],"overscroll-x":[{"overscroll-x":x()}],"overscroll-y":[{"overscroll-y":x()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:R()}],"inset-x":[{"inset-x":R()}],"inset-y":[{"inset-y":R()}],start:[{start:R()}],end:[{end:R()}],top:[{top:R()}],right:[{right:R()}],bottom:[{bottom:R()}],left:[{left:R()}],visibility:["visible","invisible","collapse"],z:[{z:[At,"auto",ee,Q]}],basis:[{basis:[vn,"full","auto",a,...T()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[se,vn,"auto","initial","none",Q]}],grow:[{grow:["",se,ee,Q]}],shrink:[{shrink:["",se,ee,Q]}],order:[{order:[At,"first","last","none",ee,Q]}],"grid-cols":[{"grid-cols":_()}],"col-start-end":[{col:O()}],"col-start":[{"col-start":z()}],"col-end":[{"col-end":z()}],"grid-rows":[{"grid-rows":_()}],"row-start-end":[{row:O()}],"row-start":[{"row-start":z()}],"row-end":[{"row-end":z()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":G()}],"auto-rows":[{"auto-rows":G()}],gap:[{gap:T()}],"gap-x":[{"gap-x":T()}],"gap-y":[{"gap-y":T()}],"justify-content":[{justify:[...j(),"normal"]}],"justify-items":[{"justify-items":[...F(),"normal"]}],"justify-self":[{"justify-self":["auto",...F()]}],"align-content":[{content:["normal",...j()]}],"align-items":[{items:[...F(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...F(),{baseline:["","last"]}]}],"place-content":[{"place-content":j()}],"place-items":[{"place-items":[...F(),"baseline"]}],"place-self":[{"place-self":["auto",...F()]}],p:[{p:T()}],px:[{px:T()}],py:[{py:T()}],ps:[{ps:T()}],pe:[{pe:T()}],pt:[{pt:T()}],pr:[{pr:T()}],pb:[{pb:T()}],pl:[{pl:T()}],m:[{m:N()}],mx:[{mx:N()}],my:[{my:N()}],ms:[{ms:N()}],me:[{me:N()}],mt:[{mt:N()}],mr:[{mr:N()}],mb:[{mb:N()}],ml:[{ml:N()}],"space-x":[{"space-x":T()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":T()}],"space-y-reverse":["space-y-reverse"],size:[{size:k()}],w:[{w:[a,"screen",...k()]}],"min-w":[{"min-w":[a,"screen","none",...k()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[i]},...k()]}],h:[{h:["screen",...k()]}],"min-h":[{"min-h":["screen","none",...k()]}],"max-h":[{"max-h":["screen",...k()]}],"font-size":[{text:["base",n,Jn,Zt]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,ee,Os]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",As,Q]}],"font-family":[{font:[Bb,Q,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,ee,Q]}],"line-clamp":[{"line-clamp":[se,"none",ee,Os]}],leading:[{leading:[s,...T()]}],"list-image":[{"list-image":["none",ee,Q]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ee,Q]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:P()}],"text-color":[{text:P()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Y(),"wavy"]}],"text-decoration-thickness":[{decoration:[se,"from-font","auto",ee,Zt]}],"text-decoration-color":[{decoration:P()}],"underline-offset":[{"underline-offset":[se,"auto",ee,Q]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:T()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ee,Q]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ee,Q]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:I()}],"bg-repeat":[{bg:A()}],"bg-size":[{bg:V()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},At,ee,Q],radial:["",ee,Q],conic:[At,ee,Q]},Wb,$b]}],"bg-color":[{bg:P()}],"gradient-from-pos":[{from:W()}],"gradient-via-pos":[{via:W()}],"gradient-to-pos":[{to:W()}],"gradient-from":[{from:P()}],"gradient-via":[{via:P()}],"gradient-to":[{to:P()}],rounded:[{rounded:H()}],"rounded-s":[{"rounded-s":H()}],"rounded-e":[{"rounded-e":H()}],"rounded-t":[{"rounded-t":H()}],"rounded-r":[{"rounded-r":H()}],"rounded-b":[{"rounded-b":H()}],"rounded-l":[{"rounded-l":H()}],"rounded-ss":[{"rounded-ss":H()}],"rounded-se":[{"rounded-se":H()}],"rounded-ee":[{"rounded-ee":H()}],"rounded-es":[{"rounded-es":H()}],"rounded-tl":[{"rounded-tl":H()}],"rounded-tr":[{"rounded-tr":H()}],"rounded-br":[{"rounded-br":H()}],"rounded-bl":[{"rounded-bl":H()}],"border-w":[{border:L()}],"border-w-x":[{"border-x":L()}],"border-w-y":[{"border-y":L()}],"border-w-s":[{"border-s":L()}],"border-w-e":[{"border-e":L()}],"border-w-t":[{"border-t":L()}],"border-w-r":[{"border-r":L()}],"border-w-b":[{"border-b":L()}],"border-w-l":[{"border-l":L()}],"divide-x":[{"divide-x":L()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":L()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Y(),"hidden","none"]}],"divide-style":[{divide:[...Y(),"hidden","none"]}],"border-color":[{border:P()}],"border-color-x":[{"border-x":P()}],"border-color-y":[{"border-y":P()}],"border-color-s":[{"border-s":P()}],"border-color-e":[{"border-e":P()}],"border-color-t":[{"border-t":P()}],"border-color-r":[{"border-r":P()}],"border-color-b":[{"border-b":P()}],"border-color-l":[{"border-l":P()}],"divide-color":[{divide:P()}],"outline-style":[{outline:[...Y(),"none","hidden"]}],"outline-offset":[{"outline-offset":[se,ee,Q]}],"outline-w":[{outline:["",se,Jn,Zt]}],"outline-color":[{outline:P()}],shadow:[{shadow:["","none",u,Jr,Zr]}],"shadow-color":[{shadow:P()}],"inset-shadow":[{"inset-shadow":["none",d,Jr,Zr]}],"inset-shadow-color":[{"inset-shadow":P()}],"ring-w":[{ring:L()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:P()}],"ring-offset-w":[{"ring-offset":[se,Zt]}],"ring-offset-color":[{"ring-offset":P()}],"inset-ring-w":[{"inset-ring":L()}],"inset-ring-color":[{"inset-ring":P()}],"text-shadow":[{"text-shadow":["none",f,Jr,Zr]}],"text-shadow-color":[{"text-shadow":P()}],opacity:[{opacity:[se,ee,Q]}],"mix-blend":[{"mix-blend":[...K(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":K()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[se]}],"mask-image-linear-from-pos":[{"mask-linear-from":$()}],"mask-image-linear-to-pos":[{"mask-linear-to":$()}],"mask-image-linear-from-color":[{"mask-linear-from":P()}],"mask-image-linear-to-color":[{"mask-linear-to":P()}],"mask-image-t-from-pos":[{"mask-t-from":$()}],"mask-image-t-to-pos":[{"mask-t-to":$()}],"mask-image-t-from-color":[{"mask-t-from":P()}],"mask-image-t-to-color":[{"mask-t-to":P()}],"mask-image-r-from-pos":[{"mask-r-from":$()}],"mask-image-r-to-pos":[{"mask-r-to":$()}],"mask-image-r-from-color":[{"mask-r-from":P()}],"mask-image-r-to-color":[{"mask-r-to":P()}],"mask-image-b-from-pos":[{"mask-b-from":$()}],"mask-image-b-to-pos":[{"mask-b-to":$()}],"mask-image-b-from-color":[{"mask-b-from":P()}],"mask-image-b-to-color":[{"mask-b-to":P()}],"mask-image-l-from-pos":[{"mask-l-from":$()}],"mask-image-l-to-pos":[{"mask-l-to":$()}],"mask-image-l-from-color":[{"mask-l-from":P()}],"mask-image-l-to-color":[{"mask-l-to":P()}],"mask-image-x-from-pos":[{"mask-x-from":$()}],"mask-image-x-to-pos":[{"mask-x-to":$()}],"mask-image-x-from-color":[{"mask-x-from":P()}],"mask-image-x-to-color":[{"mask-x-to":P()}],"mask-image-y-from-pos":[{"mask-y-from":$()}],"mask-image-y-to-pos":[{"mask-y-to":$()}],"mask-image-y-from-color":[{"mask-y-from":P()}],"mask-image-y-to-color":[{"mask-y-to":P()}],"mask-image-radial":[{"mask-radial":[ee,Q]}],"mask-image-radial-from-pos":[{"mask-radial-from":$()}],"mask-image-radial-to-pos":[{"mask-radial-to":$()}],"mask-image-radial-from-color":[{"mask-radial-from":P()}],"mask-image-radial-to-color":[{"mask-radial-to":P()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":C()}],"mask-image-conic-pos":[{"mask-conic":[se]}],"mask-image-conic-from-pos":[{"mask-conic-from":$()}],"mask-image-conic-to-pos":[{"mask-conic-to":$()}],"mask-image-conic-from-color":[{"mask-conic-from":P()}],"mask-image-conic-to-color":[{"mask-conic-to":P()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:I()}],"mask-repeat":[{mask:A()}],"mask-size":[{mask:V()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ee,Q]}],filter:[{filter:["","none",ee,Q]}],blur:[{blur:q()}],brightness:[{brightness:[se,ee,Q]}],contrast:[{contrast:[se,ee,Q]}],"drop-shadow":[{"drop-shadow":["","none",h,Jr,Zr]}],"drop-shadow-color":[{"drop-shadow":P()}],grayscale:[{grayscale:["",se,ee,Q]}],"hue-rotate":[{"hue-rotate":[se,ee,Q]}],invert:[{invert:["",se,ee,Q]}],saturate:[{saturate:[se,ee,Q]}],sepia:[{sepia:["",se,ee,Q]}],"backdrop-filter":[{"backdrop-filter":["","none",ee,Q]}],"backdrop-blur":[{"backdrop-blur":q()}],"backdrop-brightness":[{"backdrop-brightness":[se,ee,Q]}],"backdrop-contrast":[{"backdrop-contrast":[se,ee,Q]}],"backdrop-grayscale":[{"backdrop-grayscale":["",se,ee,Q]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[se,ee,Q]}],"backdrop-invert":[{"backdrop-invert":["",se,ee,Q]}],"backdrop-opacity":[{"backdrop-opacity":[se,ee,Q]}],"backdrop-saturate":[{"backdrop-saturate":[se,ee,Q]}],"backdrop-sepia":[{"backdrop-sepia":["",se,ee,Q]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":T()}],"border-spacing-x":[{"border-spacing-x":T()}],"border-spacing-y":[{"border-spacing-y":T()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ee,Q]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[se,"initial",ee,Q]}],ease:[{ease:["linear","initial",v,ee,Q]}],delay:[{delay:[se,ee,Q]}],animate:[{animate:["none",m,ee,Q]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[p,ee,Q]}],"perspective-origin":[{"perspective-origin":y()}],rotate:[{rotate:X()}],"rotate-x":[{"rotate-x":X()}],"rotate-y":[{"rotate-y":X()}],"rotate-z":[{"rotate-z":X()}],scale:[{scale:U()}],"scale-x":[{"scale-x":U()}],"scale-y":[{"scale-y":U()}],"scale-z":[{"scale-z":U()}],"scale-3d":["scale-3d"],skew:[{skew:ne()}],"skew-x":[{"skew-x":ne()}],"skew-y":[{"skew-y":ne()}],transform:[{transform:[ee,Q,"","none","gpu","cpu"]}],"transform-origin":[{origin:y()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:B()}],"translate-x":[{"translate-x":B()}],"translate-y":[{"translate-y":B()}],"translate-z":[{"translate-z":B()}],"translate-none":["translate-none"],accent:[{accent:P()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:P()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ee,Q]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":T()}],"scroll-mx":[{"scroll-mx":T()}],"scroll-my":[{"scroll-my":T()}],"scroll-ms":[{"scroll-ms":T()}],"scroll-me":[{"scroll-me":T()}],"scroll-mt":[{"scroll-mt":T()}],"scroll-mr":[{"scroll-mr":T()}],"scroll-mb":[{"scroll-mb":T()}],"scroll-ml":[{"scroll-ml":T()}],"scroll-p":[{"scroll-p":T()}],"scroll-px":[{"scroll-px":T()}],"scroll-py":[{"scroll-py":T()}],"scroll-ps":[{"scroll-ps":T()}],"scroll-pe":[{"scroll-pe":T()}],"scroll-pt":[{"scroll-pt":T()}],"scroll-pr":[{"scroll-pr":T()}],"scroll-pb":[{"scroll-pb":T()}],"scroll-pl":[{"scroll-pl":T()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ee,Q]}],fill:[{fill:["none",...P()]}],"stroke-w":[{stroke:[se,Jn,Zt,Os]}],stroke:[{stroke:["none",...P()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},Kb=Mb(Yb);function ce(...e){return Kb(af(e))}function el(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Zo(...e){return t=>{let n=!1;const r=e.map(o=>{const s=el(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():el(e[o],null)}}}}function fe(...e){return D.useCallback(Zo(...e),e)}function sn(e){const t=qb(e),n=D.forwardRef((r,o)=>{const{children:s,...i}=r,a=D.Children.toArray(s),c=a.find(Zb);if(c){const l=c.props.children,u=a.map(d=>d===c?D.Children.count(l)>1?D.Children.only(null):D.isValidElement(l)?l.props.children:null:d);return w.jsx(t,{...i,ref:o,children:D.isValidElement(l)?D.cloneElement(l,void 0,u):null})}return w.jsx(t,{...i,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}var Gb=sn("Slot");function qb(e){const t=D.forwardRef((n,r)=>{const{children:o,...s}=n;if(D.isValidElement(o)){const i=Qb(o),a=Jb(s,o.props);return o.type!==D.Fragment&&(a.ref=r?Zo(r,i):i),D.cloneElement(o,a)}return D.Children.count(o)>1?D.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var yf=Symbol("radix.slottable");function Xb(e){const t=({children:n})=>w.jsx(w.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=yf,t}function Zb(e){return D.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===yf}function Jb(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{s(...a),o(...a)}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function Qb(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}const tl=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,nl=af,fa=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return nl(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:s}=t,i=Object.keys(o).map(l=>{const u=n==null?void 0:n[l],d=s==null?void 0:s[l];if(u===null)return null;const f=tl(u)||tl(d);return o[l][f]}),a=n&&Object.entries(n).reduce((l,u)=>{let[d,f]=u;return f===void 0||(l[d]=f),l},{}),c=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((l,u)=>{let{class:d,className:f,...h}=u;return Object.entries(h).every(S=>{let[p,b]=S;return Array.isArray(b)?b.includes({...s,...a}[p]):{...s,...a}[p]===b})?[...l,d,f]:l},[]);return nl(e,i,c,n==null?void 0:n.class,n==null?void 0:n.className)},ex=fa("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive cursor-pointer",{variants:{variant:{default:"bg-primary cursor-pointer text-primary-foreground shadow-xs hover:bg-primary/90",destructive:"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50 hover:bg-accent",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}});function an({className:e,variant:t,size:n,asChild:r=!1,...o}){const s=r?Gb:"button";return w.jsx(s,{"data-slot":"button",className:ce(ex({variant:t,size:n,className:e})),...o})}function te(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function Ht(e,t=[]){let n=[];function r(s,i){const a=D.createContext(i),c=n.length;n=[...n,i];const l=d=>{var v;const{scope:f,children:h,...S}=d,p=((v=f==null?void 0:f[e])==null?void 0:v[c])||a,b=D.useMemo(()=>S,Object.values(S));return w.jsx(p.Provider,{value:b,children:h})};l.displayName=s+"Provider";function u(d,f){var p;const h=((p=f==null?void 0:f[e])==null?void 0:p[c])||a,S=D.useContext(h);if(S)return S;if(i!==void 0)return i;throw new Error(`\`${d}\` must be used within \`${s}\``)}return[l,u]}const o=()=>{const s=n.map(i=>D.createContext(i));return function(a){const c=(a==null?void 0:a[e])||s;return D.useMemo(()=>({[`__scope${e}`]:{...a,[e]:c}}),[a,c])}};return o.scopeName=e,[r,tx(o,...t)]}function tx(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const i=r.reduce((a,{useScope:c,scopeName:l})=>{const d=c(s)[`__scope${l}`];return{...a,...d}},{});return D.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}var nx=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],ae=nx.reduce((e,t)=>{const n=sn(`Primitive.${t}`),r=D.forwardRef((o,s)=>{const{asChild:i,...a}=o,c=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),w.jsx(c,{...a,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function bf(e,t){e&&Wo.flushSync(()=>e.dispatchEvent(t))}function Ze(e){const t=D.useRef(e);return D.useEffect(()=>{t.current=e}),D.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function rx(e,t=globalThis==null?void 0:globalThis.document){const n=Ze(e);D.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var ox="DismissableLayer",yi="dismissableLayer.update",sx="dismissableLayer.pointerDownOutside",ix="dismissableLayer.focusOutside",rl,xf=D.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),jr=D.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:i,onDismiss:a,...c}=e,l=D.useContext(xf),[u,d]=D.useState(null),f=(u==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,h]=D.useState({}),S=fe(t,x=>d(x)),p=Array.from(l.layers),[b]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),v=p.indexOf(b),m=u?p.indexOf(u):-1,g=l.layersWithOutsidePointerEventsDisabled.size>0,C=m>=v,y=lx(x=>{const T=x.target,R=[...l.branches].some(_=>_.contains(T));!C||R||(o==null||o(x),i==null||i(x),x.defaultPrevented||a==null||a())},f),M=ux(x=>{const T=x.target;[...l.branches].some(_=>_.contains(T))||(s==null||s(x),i==null||i(x),x.defaultPrevented||a==null||a())},f);return rx(x=>{m===l.layers.size-1&&(r==null||r(x),!x.defaultPrevented&&a&&(x.preventDefault(),a()))},f),D.useEffect(()=>{if(u)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(rl=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(u)),l.layers.add(u),ol(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=rl)}},[u,f,n,l]),D.useEffect(()=>()=>{u&&(l.layers.delete(u),l.layersWithOutsidePointerEventsDisabled.delete(u),ol())},[u,l]),D.useEffect(()=>{const x=()=>h({});return document.addEventListener(yi,x),()=>document.removeEventListener(yi,x)},[]),w.jsx(ae.div,{...c,ref:S,style:{pointerEvents:g?C?"auto":"none":void 0,...e.style},onFocusCapture:te(e.onFocusCapture,M.onFocusCapture),onBlurCapture:te(e.onBlurCapture,M.onBlurCapture),onPointerDownCapture:te(e.onPointerDownCapture,y.onPointerDownCapture)})});jr.displayName=ox;var ax="DismissableLayerBranch",cx=D.forwardRef((e,t)=>{const n=D.useContext(xf),r=D.useRef(null),o=fe(t,r);return D.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),w.jsx(ae.div,{...e,ref:o})});cx.displayName=ax;function lx(e,t=globalThis==null?void 0:globalThis.document){const n=Ze(e),r=D.useRef(!1),o=D.useRef(()=>{});return D.useEffect(()=>{const s=a=>{if(a.target&&!r.current){let c=function(){wf(sx,n,l,{discrete:!0})};const l={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=c,t.addEventListener("click",o.current,{once:!0})):c()}else t.removeEventListener("click",o.current);r.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",s),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function ux(e,t=globalThis==null?void 0:globalThis.document){const n=Ze(e),r=D.useRef(!1);return D.useEffect(()=>{const o=s=>{s.target&&!r.current&&wf(ix,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function ol(){const e=new CustomEvent(yi);document.dispatchEvent(e)}function wf(e,t,n,{discrete:r}){const o=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?bf(o,s):o.dispatchEvent(s)}var Ne=globalThis!=null&&globalThis.document?D.useLayoutEffect:()=>{},dx=D[" useId ".trim().toString()]||(()=>{}),fx=0;function Vt(e){const[t,n]=D.useState(dx());return Ne(()=>{n(r=>r??String(fx++))},[e]),e||(t?`radix-${t}`:"")}const hx=["top","right","bottom","left"],Ft=Math.min,ze=Math.max,Oo=Math.round,Qr=Math.floor,lt=e=>({x:e,y:e}),px={left:"right",right:"left",bottom:"top",top:"bottom"},mx={start:"end",end:"start"};function bi(e,t,n){return ze(e,Ft(t,n))}function bt(e,t){return typeof e=="function"?e(t):e}function xt(e){return e.split("-")[0]}function $n(e){return e.split("-")[1]}function ha(e){return e==="x"?"y":"x"}function pa(e){return e==="y"?"height":"width"}function $t(e){return["top","bottom"].includes(xt(e))?"y":"x"}function ma(e){return ha($t(e))}function gx(e,t,n){n===void 0&&(n=!1);const r=$n(e),o=ma(e),s=pa(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=ko(i)),[i,ko(i)]}function vx(e){const t=ko(e);return[xi(e),t,xi(t)]}function xi(e){return e.replace(/start|end/g,t=>mx[t])}function yx(e,t,n){const r=["left","right"],o=["right","left"],s=["top","bottom"],i=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?s:i;default:return[]}}function bx(e,t,n,r){const o=$n(e);let s=yx(xt(e),n==="start",r);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map(xi)))),s}function ko(e){return e.replace(/left|right|bottom|top/g,t=>px[t])}function xx(e){return{top:0,right:0,bottom:0,left:0,...e}}function Sf(e){return typeof e!="number"?xx(e):{top:e,right:e,bottom:e,left:e}}function _o(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function sl(e,t,n){let{reference:r,floating:o}=e;const s=$t(t),i=ma(t),a=pa(i),c=xt(t),l=s==="y",u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,f=r[a]/2-o[a]/2;let h;switch(c){case"top":h={x:u,y:r.y-o.height};break;case"bottom":h={x:u,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:d};break;case"left":h={x:r.x-o.width,y:d};break;default:h={x:r.x,y:r.y}}switch($n(t)){case"start":h[i]-=f*(n&&l?-1:1);break;case"end":h[i]+=f*(n&&l?-1:1);break}return h}const wx=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,a=s.filter(Boolean),c=await(i.isRTL==null?void 0:i.isRTL(t));let l=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=sl(l,r,c),f=r,h={},S=0;for(let p=0;p<a.length;p++){const{name:b,fn:v}=a[p],{x:m,y:g,data:C,reset:y}=await v({x:u,y:d,initialPlacement:r,placement:f,strategy:o,middlewareData:h,rects:l,platform:i,elements:{reference:e,floating:t}});u=m??u,d=g??d,h={...h,[b]:{...h[b],...C}},y&&S<=50&&(S++,typeof y=="object"&&(y.placement&&(f=y.placement),y.rects&&(l=y.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):y.rects),{x:u,y:d}=sl(l,f,c)),p=-1)}return{x:u,y:d,placement:f,strategy:o,middlewareData:h}};async function br(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:i,elements:a,strategy:c}=e,{boundary:l="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:h=0}=bt(t,e),S=Sf(h),b=a[f?d==="floating"?"reference":"floating":d],v=_o(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(b)))==null||n?b:b.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:l,rootBoundary:u,strategy:c})),m=d==="floating"?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,g=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),C=await(s.isElement==null?void 0:s.isElement(g))?await(s.getScale==null?void 0:s.getScale(g))||{x:1,y:1}:{x:1,y:1},y=_o(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:m,offsetParent:g,strategy:c}):m);return{top:(v.top-y.top+S.top)/C.y,bottom:(y.bottom-v.bottom+S.bottom)/C.y,left:(v.left-y.left+S.left)/C.x,right:(y.right-v.right+S.right)/C.x}}const Sx=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:s,platform:i,elements:a,middlewareData:c}=t,{element:l,padding:u=0}=bt(e,t)||{};if(l==null)return{};const d=Sf(u),f={x:n,y:r},h=ma(o),S=pa(h),p=await i.getDimensions(l),b=h==="y",v=b?"top":"left",m=b?"bottom":"right",g=b?"clientHeight":"clientWidth",C=s.reference[S]+s.reference[h]-f[h]-s.floating[S],y=f[h]-s.reference[h],M=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l));let x=M?M[g]:0;(!x||!await(i.isElement==null?void 0:i.isElement(M)))&&(x=a.floating[g]||s.floating[S]);const T=C/2-y/2,R=x/2-p[S]/2-1,_=Ft(d[v],R),O=Ft(d[m],R),z=_,G=x-p[S]-O,j=x/2-p[S]/2+T,F=bi(z,j,G),N=!c.arrow&&$n(o)!=null&&j!==F&&s.reference[S]/2-(j<z?_:O)-p[S]/2<0,k=N?j<z?j-z:j-G:0;return{[h]:f[h]+k,data:{[h]:F,centerOffset:j-F-k,...N&&{alignmentOffset:k}},reset:N}}}),Cx=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:s,rects:i,initialPlacement:a,platform:c,elements:l}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:S="none",flipAlignment:p=!0,...b}=bt(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const v=xt(o),m=$t(a),g=xt(a)===a,C=await(c.isRTL==null?void 0:c.isRTL(l.floating)),y=f||(g||!p?[ko(a)]:vx(a)),M=S!=="none";!f&&M&&y.push(...bx(a,p,S,C));const x=[a,...y],T=await br(t,b),R=[];let _=((r=s.flip)==null?void 0:r.overflows)||[];if(u&&R.push(T[v]),d){const j=gx(o,i,C);R.push(T[j[0]],T[j[1]])}if(_=[..._,{placement:o,overflows:R}],!R.every(j=>j<=0)){var O,z;const j=(((O=s.flip)==null?void 0:O.index)||0)+1,F=x[j];if(F)return{data:{index:j,overflows:_},reset:{placement:F}};let N=(z=_.filter(k=>k.overflows[0]<=0).sort((k,P)=>k.overflows[1]-P.overflows[1])[0])==null?void 0:z.placement;if(!N)switch(h){case"bestFit":{var G;const k=(G=_.filter(P=>{if(M){const I=$t(P.placement);return I===m||I==="y"}return!0}).map(P=>[P.placement,P.overflows.filter(I=>I>0).reduce((I,A)=>I+A,0)]).sort((P,I)=>P[1]-I[1])[0])==null?void 0:G[0];k&&(N=k);break}case"initialPlacement":N=a;break}if(o!==N)return{reset:{placement:N}}}return{}}}};function il(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function al(e){return hx.some(t=>e[t]>=0)}const Tx=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=bt(e,t);switch(r){case"referenceHidden":{const s=await br(t,{...o,elementContext:"reference"}),i=il(s,n.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:al(i)}}}case"escaped":{const s=await br(t,{...o,altBoundary:!0}),i=il(s,n.floating);return{data:{escapedOffsets:i,escaped:al(i)}}}default:return{}}}}};async function Dx(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=xt(n),a=$n(n),c=$t(n)==="y",l=["left","top"].includes(i)?-1:1,u=s&&c?-1:1,d=bt(t,e);let{mainAxis:f,crossAxis:h,alignmentAxis:S}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof S=="number"&&(h=a==="end"?S*-1:S),c?{x:h*u,y:f*l}:{x:f*l,y:h*u}}const Ex=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:s,placement:i,middlewareData:a}=t,c=await Dx(t,e);return i===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+c.x,y:s+c.y,data:{...c,placement:i}}}}},Mx=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:s=!0,crossAxis:i=!1,limiter:a={fn:b=>{let{x:v,y:m}=b;return{x:v,y:m}}},...c}=bt(e,t),l={x:n,y:r},u=await br(t,c),d=$t(xt(o)),f=ha(d);let h=l[f],S=l[d];if(s){const b=f==="y"?"top":"left",v=f==="y"?"bottom":"right",m=h+u[b],g=h-u[v];h=bi(m,h,g)}if(i){const b=d==="y"?"top":"left",v=d==="y"?"bottom":"right",m=S+u[b],g=S-u[v];S=bi(m,S,g)}const p=a.fn({...t,[f]:h,[d]:S});return{...p,data:{x:p.x-n,y:p.y-r,enabled:{[f]:s,[d]:i}}}}}},Rx=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:s,middlewareData:i}=t,{offset:a=0,mainAxis:c=!0,crossAxis:l=!0}=bt(e,t),u={x:n,y:r},d=$t(o),f=ha(d);let h=u[f],S=u[d];const p=bt(a,t),b=typeof p=="number"?{mainAxis:p,crossAxis:0}:{mainAxis:0,crossAxis:0,...p};if(c){const g=f==="y"?"height":"width",C=s.reference[f]-s.floating[g]+b.mainAxis,y=s.reference[f]+s.reference[g]-b.mainAxis;h<C?h=C:h>y&&(h=y)}if(l){var v,m;const g=f==="y"?"width":"height",C=["top","left"].includes(xt(o)),y=s.reference[d]-s.floating[g]+(C&&((v=i.offset)==null?void 0:v[d])||0)+(C?0:b.crossAxis),M=s.reference[d]+s.reference[g]+(C?0:((m=i.offset)==null?void 0:m[d])||0)-(C?b.crossAxis:0);S<y?S=y:S>M&&(S=M)}return{[f]:h,[d]:S}}}},Px=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:s,platform:i,elements:a}=t,{apply:c=()=>{},...l}=bt(e,t),u=await br(t,l),d=xt(o),f=$n(o),h=$t(o)==="y",{width:S,height:p}=s.floating;let b,v;d==="top"||d==="bottom"?(b=d,v=f===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(v=d,b=f==="end"?"top":"bottom");const m=p-u.top-u.bottom,g=S-u.left-u.right,C=Ft(p-u[b],m),y=Ft(S-u[v],g),M=!t.middlewareData.shift;let x=C,T=y;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(T=g),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(x=m),M&&!f){const _=ze(u.left,0),O=ze(u.right,0),z=ze(u.top,0),G=ze(u.bottom,0);h?T=S-2*(_!==0||O!==0?_+O:ze(u.left,u.right)):x=p-2*(z!==0||G!==0?z+G:ze(u.top,u.bottom))}await c({...t,availableWidth:T,availableHeight:x});const R=await i.getDimensions(a.floating);return S!==R.width||p!==R.height?{reset:{rects:!0}}:{}}}};function Jo(){return typeof window<"u"}function Bn(e){return Cf(e)?(e.nodeName||"").toLowerCase():"#document"}function We(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ht(e){var t;return(t=(Cf(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Cf(e){return Jo()?e instanceof Node||e instanceof We(e).Node:!1}function nt(e){return Jo()?e instanceof Element||e instanceof We(e).Element:!1}function ft(e){return Jo()?e instanceof HTMLElement||e instanceof We(e).HTMLElement:!1}function cl(e){return!Jo()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof We(e).ShadowRoot}function Lr(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=rt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function Ax(e){return["table","td","th"].includes(Bn(e))}function Qo(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function ga(e){const t=va(),n=nt(e)?rt(e):e;return["transform","translate","scale","rotate","perspective"].some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function Ox(e){let t=Bt(e);for(;ft(t)&&!On(t);){if(ga(t))return t;if(Qo(t))return null;t=Bt(t)}return null}function va(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function On(e){return["html","body","#document"].includes(Bn(e))}function rt(e){return We(e).getComputedStyle(e)}function es(e){return nt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Bt(e){if(Bn(e)==="html")return e;const t=e.assignedSlot||e.parentNode||cl(e)&&e.host||ht(e);return cl(t)?t.host:t}function Tf(e){const t=Bt(e);return On(t)?e.ownerDocument?e.ownerDocument.body:e.body:ft(t)&&Lr(t)?t:Tf(t)}function xr(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Tf(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),i=We(o);if(s){const a=wi(i);return t.concat(i,i.visualViewport||[],Lr(o)?o:[],a&&n?xr(a):[])}return t.concat(o,xr(o,[],n))}function wi(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Df(e){const t=rt(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=ft(e),s=o?e.offsetWidth:n,i=o?e.offsetHeight:r,a=Oo(n)!==s||Oo(r)!==i;return a&&(n=s,r=i),{width:n,height:r,$:a}}function ya(e){return nt(e)?e:e.contextElement}function Pn(e){const t=ya(e);if(!ft(t))return lt(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=Df(t);let i=(s?Oo(n.width):n.width)/r,a=(s?Oo(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const kx=lt(0);function Ef(e){const t=We(e);return!va()||!t.visualViewport?kx:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function _x(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==We(e)?!1:t}function cn(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=ya(e);let i=lt(1);t&&(r?nt(r)&&(i=Pn(r)):i=Pn(e));const a=_x(s,n,r)?Ef(s):lt(0);let c=(o.left+a.x)/i.x,l=(o.top+a.y)/i.y,u=o.width/i.x,d=o.height/i.y;if(s){const f=We(s),h=r&&nt(r)?We(r):r;let S=f,p=wi(S);for(;p&&r&&h!==S;){const b=Pn(p),v=p.getBoundingClientRect(),m=rt(p),g=v.left+(p.clientLeft+parseFloat(m.paddingLeft))*b.x,C=v.top+(p.clientTop+parseFloat(m.paddingTop))*b.y;c*=b.x,l*=b.y,u*=b.x,d*=b.y,c+=g,l+=C,S=We(p),p=wi(S)}}return _o({width:u,height:d,x:c,y:l})}function ba(e,t){const n=es(e).scrollLeft;return t?t.left+n:cn(ht(e)).left+n}function Mf(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),o=r.left+t.scrollLeft-(n?0:ba(e,r)),s=r.top+t.scrollTop;return{x:o,y:s}}function Nx(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",i=ht(r),a=t?Qo(t.floating):!1;if(r===i||a&&s)return n;let c={scrollLeft:0,scrollTop:0},l=lt(1);const u=lt(0),d=ft(r);if((d||!d&&!s)&&((Bn(r)!=="body"||Lr(i))&&(c=es(r)),ft(r))){const h=cn(r);l=Pn(r),u.x=h.x+r.clientLeft,u.y=h.y+r.clientTop}const f=i&&!d&&!s?Mf(i,c,!0):lt(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function Ix(e){return Array.from(e.getClientRects())}function jx(e){const t=ht(e),n=es(e),r=e.ownerDocument.body,o=ze(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=ze(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+ba(e);const a=-n.scrollTop;return rt(r).direction==="rtl"&&(i+=ze(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:i,y:a}}function Lx(e,t){const n=We(e),r=ht(e),o=n.visualViewport;let s=r.clientWidth,i=r.clientHeight,a=0,c=0;if(o){s=o.width,i=o.height;const l=va();(!l||l&&t==="fixed")&&(a=o.offsetLeft,c=o.offsetTop)}return{width:s,height:i,x:a,y:c}}function Vx(e,t){const n=cn(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=ft(e)?Pn(e):lt(1),i=e.clientWidth*s.x,a=e.clientHeight*s.y,c=o*s.x,l=r*s.y;return{width:i,height:a,x:c,y:l}}function ll(e,t,n){let r;if(t==="viewport")r=Lx(e,n);else if(t==="document")r=jx(ht(e));else if(nt(t))r=Vx(t,n);else{const o=Ef(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return _o(r)}function Rf(e,t){const n=Bt(e);return n===t||!nt(n)||On(n)?!1:rt(n).position==="fixed"||Rf(n,t)}function Fx(e,t){const n=t.get(e);if(n)return n;let r=xr(e,[],!1).filter(a=>nt(a)&&Bn(a)!=="body"),o=null;const s=rt(e).position==="fixed";let i=s?Bt(e):e;for(;nt(i)&&!On(i);){const a=rt(i),c=ga(i);!c&&a.position==="fixed"&&(o=null),(s?!c&&!o:!c&&a.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||Lr(i)&&!c&&Rf(e,i))?r=r.filter(u=>u!==i):o=a,i=Bt(i)}return t.set(e,r),r}function $x(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[...n==="clippingAncestors"?Qo(t)?[]:Fx(t,this._c):[].concat(n),r],a=i[0],c=i.reduce((l,u)=>{const d=ll(t,u,o);return l.top=ze(d.top,l.top),l.right=Ft(d.right,l.right),l.bottom=Ft(d.bottom,l.bottom),l.left=ze(d.left,l.left),l},ll(t,a,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function Bx(e){const{width:t,height:n}=Df(e);return{width:t,height:n}}function zx(e,t,n){const r=ft(t),o=ht(t),s=n==="fixed",i=cn(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const c=lt(0);if(r||!r&&!s)if((Bn(t)!=="body"||Lr(o))&&(a=es(t)),r){const f=cn(t,!0,s,t);c.x=f.x+t.clientLeft,c.y=f.y+t.clientTop}else o&&(c.x=ba(o));const l=o&&!r&&!s?Mf(o,a):lt(0),u=i.left+a.scrollLeft-c.x-l.x,d=i.top+a.scrollTop-c.y-l.y;return{x:u,y:d,width:i.width,height:i.height}}function ks(e){return rt(e).position==="static"}function ul(e,t){if(!ft(e)||rt(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return ht(e)===n&&(n=n.ownerDocument.body),n}function Pf(e,t){const n=We(e);if(Qo(e))return n;if(!ft(e)){let o=Bt(e);for(;o&&!On(o);){if(nt(o)&&!ks(o))return o;o=Bt(o)}return n}let r=ul(e,t);for(;r&&Ax(r)&&ks(r);)r=ul(r,t);return r&&On(r)&&ks(r)&&!ga(r)?n:r||Ox(e)||n}const Wx=async function(e){const t=this.getOffsetParent||Pf,n=this.getDimensions,r=await n(e.floating);return{reference:zx(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Hx(e){return rt(e).direction==="rtl"}const Ux={convertOffsetParentRelativeRectToViewportRelativeRect:Nx,getDocumentElement:ht,getClippingRect:$x,getOffsetParent:Pf,getElementRects:Wx,getClientRects:Ix,getDimensions:Bx,getScale:Pn,isElement:nt,isRTL:Hx};function Af(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Yx(e,t){let n=null,r;const o=ht(e);function s(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function i(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),s();const l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:h}=l;if(a||t(),!f||!h)return;const S=Qr(d),p=Qr(o.clientWidth-(u+f)),b=Qr(o.clientHeight-(d+h)),v=Qr(u),g={rootMargin:-S+"px "+-p+"px "+-b+"px "+-v+"px",threshold:ze(0,Ft(1,c))||1};let C=!0;function y(M){const x=M[0].intersectionRatio;if(x!==c){if(!C)return i();x?i(!1,x):r=setTimeout(()=>{i(!1,1e-7)},1e3)}x===1&&!Af(l,e.getBoundingClientRect())&&i(),C=!1}try{n=new IntersectionObserver(y,{...g,root:o.ownerDocument})}catch{n=new IntersectionObserver(y,g)}n.observe(e)}return i(!0),s}function Kx(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,l=ya(e),u=o||s?[...l?xr(l):[],...xr(t)]:[];u.forEach(v=>{o&&v.addEventListener("scroll",n,{passive:!0}),s&&v.addEventListener("resize",n)});const d=l&&a?Yx(l,n):null;let f=-1,h=null;i&&(h=new ResizeObserver(v=>{let[m]=v;m&&m.target===l&&h&&(h.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var g;(g=h)==null||g.observe(t)})),n()}),l&&!c&&h.observe(l),h.observe(t));let S,p=c?cn(e):null;c&&b();function b(){const v=cn(e);p&&!Af(p,v)&&n(),p=v,S=requestAnimationFrame(b)}return n(),()=>{var v;u.forEach(m=>{o&&m.removeEventListener("scroll",n),s&&m.removeEventListener("resize",n)}),d==null||d(),(v=h)==null||v.disconnect(),h=null,c&&cancelAnimationFrame(S)}}const Gx=Ex,qx=Mx,Xx=Cx,Zx=Px,Jx=Tx,dl=Sx,Qx=Rx,ew=(e,t,n)=>{const r=new Map,o={platform:Ux,...n},s={...o.platform,_c:r};return wx(e,t,{...o,platform:s})};var vo=typeof document<"u"?E.useLayoutEffect:E.useEffect;function No(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!No(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const s=o[r];if(!(s==="_owner"&&e.$$typeof)&&!No(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function Of(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function fl(e,t){const n=Of(e);return Math.round(t*n)/n}function _s(e){const t=D.useRef(e);return vo(()=>{t.current=e}),t}function tw(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:i}={},transform:a=!0,whileElementsMounted:c,open:l}=e,[u,d]=D.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,h]=D.useState(r);No(f,r)||h(r);const[S,p]=D.useState(null),[b,v]=D.useState(null),m=D.useCallback(P=>{P!==M.current&&(M.current=P,p(P))},[]),g=D.useCallback(P=>{P!==x.current&&(x.current=P,v(P))},[]),C=s||S,y=i||b,M=D.useRef(null),x=D.useRef(null),T=D.useRef(u),R=c!=null,_=_s(c),O=_s(o),z=_s(l),G=D.useCallback(()=>{if(!M.current||!x.current)return;const P={placement:t,strategy:n,middleware:f};O.current&&(P.platform=O.current),ew(M.current,x.current,P).then(I=>{const A={...I,isPositioned:z.current!==!1};j.current&&!No(T.current,A)&&(T.current=A,Wo.flushSync(()=>{d(A)}))})},[f,t,n,O,z]);vo(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(P=>({...P,isPositioned:!1})))},[l]);const j=D.useRef(!1);vo(()=>(j.current=!0,()=>{j.current=!1}),[]),vo(()=>{if(C&&(M.current=C),y&&(x.current=y),C&&y){if(_.current)return _.current(C,y,G);G()}},[C,y,G,_,R]);const F=D.useMemo(()=>({reference:M,floating:x,setReference:m,setFloating:g}),[m,g]),N=D.useMemo(()=>({reference:C,floating:y}),[C,y]),k=D.useMemo(()=>{const P={position:n,left:0,top:0};if(!N.floating)return P;const I=fl(N.floating,u.x),A=fl(N.floating,u.y);return a?{...P,transform:"translate("+I+"px, "+A+"px)",...Of(N.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:I,top:A}},[n,a,N.floating,u.x,u.y]);return D.useMemo(()=>({...u,update:G,refs:F,elements:N,floatingStyles:k}),[u,G,F,N,k])}const nw=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?dl({element:r.current,padding:o}).fn(n):{}:r?dl({element:r,padding:o}).fn(n):{}}}},rw=(e,t)=>({...Gx(e),options:[e,t]}),ow=(e,t)=>({...qx(e),options:[e,t]}),sw=(e,t)=>({...Qx(e),options:[e,t]}),iw=(e,t)=>({...Xx(e),options:[e,t]}),aw=(e,t)=>({...Zx(e),options:[e,t]}),cw=(e,t)=>({...Jx(e),options:[e,t]}),lw=(e,t)=>({...nw(e),options:[e,t]});var uw="Arrow",kf=D.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...s}=e;return w.jsx(ae.svg,{...s,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:w.jsx("polygon",{points:"0,0 30,0 15,10"})})});kf.displayName=uw;var dw=kf;function fw(e){const[t,n]=D.useState(void 0);return Ne(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const s=o[0];let i,a;if("borderBoxSize"in s){const c=s.borderBoxSize,l=Array.isArray(c)?c[0]:c;i=l.inlineSize,a=l.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var xa="Popper",[_f,Ut]=Ht(xa),[hw,Nf]=_f(xa),If=e=>{const{__scopePopper:t,children:n}=e,[r,o]=D.useState(null);return w.jsx(hw,{scope:t,anchor:r,onAnchorChange:o,children:n})};If.displayName=xa;var jf="PopperAnchor",Lf=D.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,s=Nf(jf,n),i=D.useRef(null),a=fe(t,i);return D.useEffect(()=>{s.onAnchorChange((r==null?void 0:r.current)||i.current)}),r?null:w.jsx(ae.div,{...o,ref:a})});Lf.displayName=jf;var wa="PopperContent",[pw,mw]=_f(wa),Vf=D.forwardRef((e,t)=>{var $,q,X,U,ne,B;const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:s="center",alignOffset:i=0,arrowPadding:a=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d="partial",hideWhenDetached:f=!1,updatePositionStrategy:h="optimized",onPlaced:S,...p}=e,b=Nf(wa,n),[v,m]=D.useState(null),g=fe(t,ie=>m(ie)),[C,y]=D.useState(null),M=fw(C),x=(M==null?void 0:M.width)??0,T=(M==null?void 0:M.height)??0,R=r+(s!=="center"?"-"+s:""),_=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},O=Array.isArray(l)?l:[l],z=O.length>0,G={padding:_,boundary:O.filter(vw),altBoundary:z},{refs:j,floatingStyles:F,placement:N,isPositioned:k,middlewareData:P}=tw({strategy:"fixed",placement:R,whileElementsMounted:(...ie)=>Kx(...ie,{animationFrame:h==="always"}),elements:{reference:b.anchor},middleware:[rw({mainAxis:o+T,alignmentAxis:i}),c&&ow({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?sw():void 0,...G}),c&&iw({...G}),aw({...G,apply:({elements:ie,rects:pe,availableWidth:Oe,availableHeight:Ee})=>{const{width:ot,height:J}=pe.reference,le=ie.floating.style;le.setProperty("--radix-popper-available-width",`${Oe}px`),le.setProperty("--radix-popper-available-height",`${Ee}px`),le.setProperty("--radix-popper-anchor-width",`${ot}px`),le.setProperty("--radix-popper-anchor-height",`${J}px`)}}),C&&lw({element:C,padding:a}),yw({arrowWidth:x,arrowHeight:T}),f&&cw({strategy:"referenceHidden",...G})]}),[I,A]=Bf(N),V=Ze(S);Ne(()=>{k&&(V==null||V())},[k,V]);const W=($=P.arrow)==null?void 0:$.x,H=(q=P.arrow)==null?void 0:q.y,L=((X=P.arrow)==null?void 0:X.centerOffset)!==0,[Y,K]=D.useState();return Ne(()=>{v&&K(window.getComputedStyle(v).zIndex)},[v]),w.jsx("div",{ref:j.setFloating,"data-radix-popper-content-wrapper":"",style:{...F,transform:k?F.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Y,"--radix-popper-transform-origin":[(U=P.transformOrigin)==null?void 0:U.x,(ne=P.transformOrigin)==null?void 0:ne.y].join(" "),...((B=P.hide)==null?void 0:B.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:w.jsx(pw,{scope:n,placedSide:I,onArrowChange:y,arrowX:W,arrowY:H,shouldHideArrow:L,children:w.jsx(ae.div,{"data-side":I,"data-align":A,...p,ref:g,style:{...p.style,animation:k?void 0:"none"}})})})});Vf.displayName=wa;var Ff="PopperArrow",gw={top:"bottom",right:"left",bottom:"top",left:"right"},$f=D.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,s=mw(Ff,r),i=gw[s.placedSide];return w.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[i]: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:w.jsx(dw,{...o,ref:n,style:{...o.style,display:"block"}})})});$f.displayName=Ff;function vw(e){return e!==null}var yw=e=>({name:"transformOrigin",options:e,fn(t){var b,v,m;const{placement:n,rects:r,middlewareData:o}=t,i=((b=o.arrow)==null?void 0:b.centerOffset)!==0,a=i?0:e.arrowWidth,c=i?0:e.arrowHeight,[l,u]=Bf(n),d={start:"0%",center:"50%",end:"100%"}[u],f=(((v=o.arrow)==null?void 0:v.x)??0)+a/2,h=(((m=o.arrow)==null?void 0:m.y)??0)+c/2;let S="",p="";return l==="bottom"?(S=i?d:`${f}px`,p=`${-c}px`):l==="top"?(S=i?d:`${f}px`,p=`${r.floating.height+c}px`):l==="right"?(S=`${-c}px`,p=i?d:`${h}px`):l==="left"&&(S=`${r.floating.width+c}px`,p=i?d:`${h}px`),{data:{x:S,y:p}}}});function Bf(e){const[t,n="center"]=e.split("-");return[t,n]}var ts=If,Vr=Lf,ns=Vf,rs=$f,bw="Portal",Fr=D.forwardRef((e,t)=>{var a;const{container:n,...r}=e,[o,s]=D.useState(!1);Ne(()=>s(!0),[]);const i=n||o&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return i?vt.createPortal(w.jsx(ae.div,{...r,ref:t}),i):null});Fr.displayName=bw;function xw(e,t){return D.useReducer((n,r)=>t[n][r]??n,e)}var Dt=e=>{const{present:t,children:n}=e,r=ww(t),o=typeof n=="function"?n({present:r.isPresent}):D.Children.only(n),s=fe(r.ref,Sw(o));return typeof n=="function"||r.isPresent?D.cloneElement(o,{ref:s}):null};Dt.displayName="Presence";function ww(e){const[t,n]=D.useState(),r=D.useRef({}),o=D.useRef(e),s=D.useRef("none"),i=e?"mounted":"unmounted",[a,c]=xw(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return D.useEffect(()=>{const l=eo(r.current);s.current=a==="mounted"?l:"none"},[a]),Ne(()=>{const l=r.current,u=o.current;if(u!==e){const f=s.current,h=eo(l);e?c("MOUNT"):h==="none"||(l==null?void 0:l.display)==="none"?c("UNMOUNT"):c(u&&f!==h?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,c]),Ne(()=>{if(t){let l;const u=t.ownerDocument.defaultView??window,d=h=>{const p=eo(r.current).includes(h.animationName);if(h.target===t&&p&&(c("ANIMATION_END"),!o.current)){const b=t.style.animationFillMode;t.style.animationFillMode="forwards",l=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=b)})}},f=h=>{h.target===t&&(s.current=eo(r.current))};return t.addEventListener("animationstart",f),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{u.clearTimeout(l),t.removeEventListener("animationstart",f),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:D.useCallback(l=>{l&&(r.current=getComputedStyle(l)),n(l)},[])}}function eo(e){return(e==null?void 0:e.animationName)||"none"}function Sw(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function ln({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=Cw({defaultProp:t,onChange:n}),s=e!==void 0,i=s?e:r,a=Ze(n),c=D.useCallback(l=>{if(s){const d=typeof l=="function"?l(e):l;d!==e&&a(d)}else o(l)},[s,e,o,a]);return[i,c]}function Cw({defaultProp:e,onChange:t}){const n=D.useState(e),[r]=n,o=D.useRef(r),s=Ze(t);return D.useEffect(()=>{o.current!==r&&(s(r),o.current=r)},[r,o,s]),n}var Tw="VisuallyHidden",Sa=D.forwardRef((e,t)=>w.jsx(ae.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));Sa.displayName=Tw;var Dw=Sa,[os,_A]=Ht("Tooltip",[Ut]),ss=Ut(),zf="TooltipProvider",Ew=700,Si="tooltip.open",[Mw,Ca]=os(zf),Wf=e=>{const{__scopeTooltip:t,delayDuration:n=Ew,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:s}=e,i=D.useRef(!0),a=D.useRef(!1),c=D.useRef(0);return D.useEffect(()=>{const l=c.current;return()=>window.clearTimeout(l)},[]),w.jsx(Mw,{scope:t,isOpenDelayedRef:i,delayDuration:n,onOpen:D.useCallback(()=>{window.clearTimeout(c.current),i.current=!1},[]),onClose:D.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>i.current=!0,r)},[r]),isPointerInTransitRef:a,onPointerInTransitChange:D.useCallback(l=>{a.current=l},[]),disableHoverableContent:o,children:s})};Wf.displayName=zf;var is="Tooltip",[Rw,$r]=os(is),Hf=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o=!1,onOpenChange:s,disableHoverableContent:i,delayDuration:a}=e,c=Ca(is,e.__scopeTooltip),l=ss(t),[u,d]=D.useState(null),f=Vt(),h=D.useRef(0),S=i??c.disableHoverableContent,p=a??c.delayDuration,b=D.useRef(!1),[v=!1,m]=ln({prop:r,defaultProp:o,onChange:x=>{x?(c.onOpen(),document.dispatchEvent(new CustomEvent(Si))):c.onClose(),s==null||s(x)}}),g=D.useMemo(()=>v?b.current?"delayed-open":"instant-open":"closed",[v]),C=D.useCallback(()=>{window.clearTimeout(h.current),h.current=0,b.current=!1,m(!0)},[m]),y=D.useCallback(()=>{window.clearTimeout(h.current),h.current=0,m(!1)},[m]),M=D.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{b.current=!0,m(!0),h.current=0},p)},[p,m]);return D.useEffect(()=>()=>{h.current&&(window.clearTimeout(h.current),h.current=0)},[]),w.jsx(ts,{...l,children:w.jsx(Rw,{scope:t,contentId:f,open:v,stateAttribute:g,trigger:u,onTriggerChange:d,onTriggerEnter:D.useCallback(()=>{c.isOpenDelayedRef.current?M():C()},[c.isOpenDelayedRef,M,C]),onTriggerLeave:D.useCallback(()=>{S?y():(window.clearTimeout(h.current),h.current=0)},[y,S]),onOpen:C,onClose:y,disableHoverableContent:S,children:n})})};Hf.displayName=is;var Ci="TooltipTrigger",Uf=D.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=$r(Ci,n),s=Ca(Ci,n),i=ss(n),a=D.useRef(null),c=fe(t,a,o.onTriggerChange),l=D.useRef(!1),u=D.useRef(!1),d=D.useCallback(()=>l.current=!1,[]);return D.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),w.jsx(Vr,{asChild:!0,...i,children:w.jsx(ae.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:c,onPointerMove:te(e.onPointerMove,f=>{f.pointerType!=="touch"&&!u.current&&!s.isPointerInTransitRef.current&&(o.onTriggerEnter(),u.current=!0)}),onPointerLeave:te(e.onPointerLeave,()=>{o.onTriggerLeave(),u.current=!1}),onPointerDown:te(e.onPointerDown,()=>{o.open&&o.onClose(),l.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:te(e.onFocus,()=>{l.current||o.onOpen()}),onBlur:te(e.onBlur,o.onClose),onClick:te(e.onClick,o.onClose)})})});Uf.displayName=Ci;var Ta="TooltipPortal",[Pw,Aw]=os(Ta,{forceMount:void 0}),Yf=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:o}=e,s=$r(Ta,t);return w.jsx(Pw,{scope:t,forceMount:n,children:w.jsx(Dt,{present:n||s.open,children:w.jsx(Fr,{asChild:!0,container:o,children:r})})})};Yf.displayName=Ta;var kn="TooltipContent",Kf=D.forwardRef((e,t)=>{const n=Aw(kn,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...s}=e,i=$r(kn,e.__scopeTooltip);return w.jsx(Dt,{present:r||i.open,children:i.disableHoverableContent?w.jsx(Gf,{side:o,...s,ref:t}):w.jsx(Ow,{side:o,...s,ref:t})})}),Ow=D.forwardRef((e,t)=>{const n=$r(kn,e.__scopeTooltip),r=Ca(kn,e.__scopeTooltip),o=D.useRef(null),s=fe(t,o),[i,a]=D.useState(null),{trigger:c,onClose:l}=n,u=o.current,{onPointerInTransitChange:d}=r,f=D.useCallback(()=>{a(null),d(!1)},[d]),h=D.useCallback((S,p)=>{const b=S.currentTarget,v={x:S.clientX,y:S.clientY},m=jw(v,b.getBoundingClientRect()),g=Lw(v,m),C=Vw(p.getBoundingClientRect()),y=$w([...g,...C]);a(y),d(!0)},[d]);return D.useEffect(()=>()=>f(),[f]),D.useEffect(()=>{if(c&&u){const S=b=>h(b,u),p=b=>h(b,c);return c.addEventListener("pointerleave",S),u.addEventListener("pointerleave",p),()=>{c.removeEventListener("pointerleave",S),u.removeEventListener("pointerleave",p)}}},[c,u,h,f]),D.useEffect(()=>{if(i){const S=p=>{const b=p.target,v={x:p.clientX,y:p.clientY},m=(c==null?void 0:c.contains(b))||(u==null?void 0:u.contains(b)),g=!Fw(v,i);m?f():g&&(f(),l())};return document.addEventListener("pointermove",S),()=>document.removeEventListener("pointermove",S)}},[c,u,i,l,f]),w.jsx(Gf,{...e,ref:s})}),[kw,_w]=os(is,{isInside:!1}),Nw=Xb("TooltipContent"),Gf=D.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:s,onPointerDownOutside:i,...a}=e,c=$r(kn,n),l=ss(n),{onClose:u}=c;return D.useEffect(()=>(document.addEventListener(Si,u),()=>document.removeEventListener(Si,u)),[u]),D.useEffect(()=>{if(c.trigger){const d=f=>{const h=f.target;h!=null&&h.contains(c.trigger)&&u()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[c.trigger,u]),w.jsx(jr,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:d=>d.preventDefault(),onDismiss:u,children:w.jsxs(ns,{"data-state":c.stateAttribute,...l,...a,ref:t,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[w.jsx(Nw,{children:r}),w.jsx(kw,{scope:n,isInside:!0,children:w.jsx(Dw,{id:c.contentId,role:"tooltip",children:o||r})})]})})});Kf.displayName=kn;var qf="TooltipArrow",Iw=D.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=ss(n);return _w(qf,n).isInside?null:w.jsx(rs,{...o,...r,ref:t})});Iw.displayName=qf;function jw(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(n,r,o,s)){case s:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function Lw(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function Vw(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}function Fw(e,t){const{x:n,y:r}=e;let o=!1;for(let s=0,i=t.length-1;s<t.length;i=s++){const a=t[s].x,c=t[s].y,l=t[i].x,u=t[i].y;c>r!=u>r&&n<(l-a)*(r-c)/(u-c)+a&&(o=!o)}return o}function $w(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),Bw(t)}function Bw(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const o=e[r];for(;t.length>=2;){const s=t[t.length-1],i=t[t.length-2];if((s.x-i.x)*(o.y-i.y)>=(s.y-i.y)*(o.x-i.x))t.pop();else break}t.push(o)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const o=e[r];for(;n.length>=2;){const s=n[n.length-1],i=n[n.length-2];if((s.x-i.x)*(o.y-i.y)>=(s.y-i.y)*(o.x-i.x))n.pop();else break}n.push(o)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var zw=Wf,Ww=Hf,Hw=Uf,Uw=Yf,Yw=Kf;function Da({delayDuration:e=0,...t}){return w.jsx(zw,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function Xf({...e}){return w.jsx(Da,{children:w.jsx(Ww,{"data-slot":"tooltip",...e})})}function Zf({...e}){return w.jsx(Hw,{"data-slot":"tooltip-trigger",...e})}function Jf({className:e,sideOffset:t=0,children:n,...r}){return w.jsx(Uw,{children:w.jsx(Yw,{"data-slot":"tooltip-content",sideOffset:t,className:ce("bg-primary text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-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 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",e),...r,children:n})})}const Ea=({children:e,content:t})=>w.jsx(Da,{children:w.jsxs(Xf,{children:[w.jsx(Zf,{asChild:!0,children:e}),w.jsx(Jf,{sideOffset:3,side:"bottom",className:"border border-input bg-popover px-2 py-1 text-xs text-muted-foreground",children:t})]})}),hl=e=>Symbol.iterator in e,pl=e=>"entries"in e,ml=(e,t)=>{const n=e instanceof Map?e:new Map(e.entries()),r=t instanceof Map?t:new Map(t.entries());if(n.size!==r.size)return!1;for(const[o,s]of n)if(!Object.is(s,r.get(o)))return!1;return!0},Kw=(e,t)=>{const n=e[Symbol.iterator](),r=t[Symbol.iterator]();let o=n.next(),s=r.next();for(;!o.done&&!s.done;){if(!Object.is(o.value,s.value))return!1;o=n.next(),s=r.next()}return!!o.done&&!!s.done};function Gw(e,t){return Object.is(e,t)?!0:typeof e!="object"||e===null||typeof t!="object"||t===null?!1:!hl(e)||!hl(t)?ml({entries:()=>Object.entries(e)},{entries:()=>Object.entries(t)}):pl(e)&&pl(t)?ml(e,t):Kw(e,t)}function Br(e){const t=E.useRef(void 0);return n=>{const r=e(n);return Gw(t.current,r)?t.current:t.current=r}}function Ma(e){const t=e+"CollectionProvider",[n,r]=Ht(t),[o,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=p=>{const{scope:b,children:v}=p,m=E.useRef(null),g=E.useRef(new Map).current;return w.jsx(o,{scope:b,itemMap:g,collectionRef:m,children:v})};i.displayName=t;const a=e+"CollectionSlot",c=sn(a),l=E.forwardRef((p,b)=>{const{scope:v,children:m}=p,g=s(a,v),C=fe(b,g.collectionRef);return w.jsx(c,{ref:C,children:m})});l.displayName=a;const u=e+"CollectionItemSlot",d="data-radix-collection-item",f=sn(u),h=E.forwardRef((p,b)=>{const{scope:v,children:m,...g}=p,C=E.useRef(null),y=fe(b,C),M=s(u,v);return E.useEffect(()=>(M.itemMap.set(C,{ref:C,...g}),()=>void M.itemMap.delete(C))),w.jsx(f,{[d]:"",ref:y,children:m})});h.displayName=u;function S(p){const b=s(e+"CollectionConsumer",p);return E.useCallback(()=>{const m=b.collectionRef.current;if(!m)return[];const g=Array.from(m.querySelectorAll(`[${d}]`));return Array.from(b.itemMap.values()).sort((M,x)=>g.indexOf(M.ref.current)-g.indexOf(x.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:i,Slot:l,ItemSlot:h},S,r]}var qw=D.createContext(void 0);function Ra(e){const t=D.useContext(qw);return e||t||"ltr"}var Ns=0;function Pa(){D.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??gl()),document.body.insertAdjacentElement("beforeend",e[1]??gl()),Ns++,()=>{Ns===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Ns--}},[])}function gl(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Is="focusScope.autoFocusOnMount",js="focusScope.autoFocusOnUnmount",vl={bubbles:!1,cancelable:!0},Xw="FocusScope",as=D.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:s,...i}=e,[a,c]=D.useState(null),l=Ze(o),u=Ze(s),d=D.useRef(null),f=fe(t,p=>c(p)),h=D.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;D.useEffect(()=>{if(r){let p=function(g){if(h.paused||!a)return;const C=g.target;a.contains(C)?d.current=C:_t(d.current,{select:!0})},b=function(g){if(h.paused||!a)return;const C=g.relatedTarget;C!==null&&(a.contains(C)||_t(d.current,{select:!0}))},v=function(g){if(document.activeElement===document.body)for(const y of g)y.removedNodes.length>0&&_t(a)};document.addEventListener("focusin",p),document.addEventListener("focusout",b);const m=new MutationObserver(v);return a&&m.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",p),document.removeEventListener("focusout",b),m.disconnect()}}},[r,a,h.paused]),D.useEffect(()=>{if(a){bl.add(h);const p=document.activeElement;if(!a.contains(p)){const v=new CustomEvent(Is,vl);a.addEventListener(Is,l),a.dispatchEvent(v),v.defaultPrevented||(Zw(nS(Qf(a)),{select:!0}),document.activeElement===p&&_t(a))}return()=>{a.removeEventListener(Is,l),setTimeout(()=>{const v=new CustomEvent(js,vl);a.addEventListener(js,u),a.dispatchEvent(v),v.defaultPrevented||_t(p??document.body,{select:!0}),a.removeEventListener(js,u),bl.remove(h)},0)}}},[a,l,u,h]);const S=D.useCallback(p=>{if(!n&&!r||h.paused)return;const b=p.key==="Tab"&&!p.altKey&&!p.ctrlKey&&!p.metaKey,v=document.activeElement;if(b&&v){const m=p.currentTarget,[g,C]=Jw(m);g&&C?!p.shiftKey&&v===C?(p.preventDefault(),n&&_t(g,{select:!0})):p.shiftKey&&v===g&&(p.preventDefault(),n&&_t(C,{select:!0})):v===m&&p.preventDefault()}},[n,r,h.paused]);return w.jsx(ae.div,{tabIndex:-1,...i,ref:f,onKeyDown:S})});as.displayName=Xw;function Zw(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(_t(r,{select:t}),document.activeElement!==n)return}function Jw(e){const t=Qf(e),n=yl(t,e),r=yl(t.reverse(),e);return[n,r]}function Qf(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function yl(e,t){for(const n of e)if(!Qw(n,{upTo:t}))return n}function Qw(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function eS(e){return e instanceof HTMLInputElement&&"select"in e}function _t(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&eS(e)&&t&&e.select()}}var bl=tS();function tS(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=xl(e,t),e.unshift(t)},remove(t){var n;e=xl(e,t),(n=e[0])==null||n.resume()}}}function xl(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function nS(e){return e.filter(t=>t.tagName!=="A")}var Ls="rovingFocusGroup.onEntryFocus",rS={bubbles:!1,cancelable:!0},cs="RovingFocusGroup",[Ti,eh,oS]=Ma(cs),[sS,th]=Ht(cs,[oS]),[iS,aS]=sS(cs),nh=D.forwardRef((e,t)=>w.jsx(Ti.Provider,{scope:e.__scopeRovingFocusGroup,children:w.jsx(Ti.Slot,{scope:e.__scopeRovingFocusGroup,children:w.jsx(cS,{...e,ref:t})})}));nh.displayName=cs;var cS=D.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:s,currentTabStopId:i,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:u=!1,...d}=e,f=D.useRef(null),h=fe(t,f),S=Ra(s),[p=null,b]=ln({prop:i,defaultProp:a,onChange:c}),[v,m]=D.useState(!1),g=Ze(l),C=eh(n),y=D.useRef(!1),[M,x]=D.useState(0);return D.useEffect(()=>{const T=f.current;if(T)return T.addEventListener(Ls,g),()=>T.removeEventListener(Ls,g)},[g]),w.jsx(iS,{scope:n,orientation:r,dir:S,loop:o,currentTabStopId:p,onItemFocus:D.useCallback(T=>b(T),[b]),onItemShiftTab:D.useCallback(()=>m(!0),[]),onFocusableItemAdd:D.useCallback(()=>x(T=>T+1),[]),onFocusableItemRemove:D.useCallback(()=>x(T=>T-1),[]),children:w.jsx(ae.div,{tabIndex:v||M===0?-1:0,"data-orientation":r,...d,ref:h,style:{outline:"none",...e.style},onMouseDown:te(e.onMouseDown,()=>{y.current=!0}),onFocus:te(e.onFocus,T=>{const R=!y.current;if(T.target===T.currentTarget&&R&&!v){const _=new CustomEvent(Ls,rS);if(T.currentTarget.dispatchEvent(_),!_.defaultPrevented){const O=C().filter(N=>N.focusable),z=O.find(N=>N.active),G=O.find(N=>N.id===p),F=[z,G,...O].filter(Boolean).map(N=>N.ref.current);sh(F,u)}}y.current=!1}),onBlur:te(e.onBlur,()=>m(!1))})})}),rh="RovingFocusGroupItem",oh=D.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:s,...i}=e,a=Vt(),c=s||a,l=aS(rh,n),u=l.currentTabStopId===c,d=eh(n),{onFocusableItemAdd:f,onFocusableItemRemove:h}=l;return D.useEffect(()=>{if(r)return f(),()=>h()},[r,f,h]),w.jsx(Ti.ItemSlot,{scope:n,id:c,focusable:r,active:o,children:w.jsx(ae.span,{tabIndex:u?0:-1,"data-orientation":l.orientation,...i,ref:t,onMouseDown:te(e.onMouseDown,S=>{r?l.onItemFocus(c):S.preventDefault()}),onFocus:te(e.onFocus,()=>l.onItemFocus(c)),onKeyDown:te(e.onKeyDown,S=>{if(S.key==="Tab"&&S.shiftKey){l.onItemShiftTab();return}if(S.target!==S.currentTarget)return;const p=dS(S,l.orientation,l.dir);if(p!==void 0){if(S.metaKey||S.ctrlKey||S.altKey||S.shiftKey)return;S.preventDefault();let v=d().filter(m=>m.focusable).map(m=>m.ref.current);if(p==="last")v.reverse();else if(p==="prev"||p==="next"){p==="prev"&&v.reverse();const m=v.indexOf(S.currentTarget);v=l.loop?fS(v,m+1):v.slice(m+1)}setTimeout(()=>sh(v))}})})})});oh.displayName=rh;var lS={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function uS(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function dS(e,t,n){const r=uS(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return lS[r]}function sh(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function fS(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var hS=nh,pS=oh,mS=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},yn=new WeakMap,to=new WeakMap,no={},Vs=0,ih=function(e){return e&&(e.host||ih(e.parentNode))},gS=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=ih(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},vS=function(e,t,n,r){var o=gS(t,Array.isArray(e)?e:[e]);no[n]||(no[n]=new WeakMap);var s=no[n],i=[],a=new Set,c=new Set(o),l=function(d){!d||a.has(d)||(a.add(d),l(d.parentNode))};o.forEach(l);var u=function(d){!d||c.has(d)||Array.prototype.forEach.call(d.children,function(f){if(a.has(f))u(f);else try{var h=f.getAttribute(r),S=h!==null&&h!=="false",p=(yn.get(f)||0)+1,b=(s.get(f)||0)+1;yn.set(f,p),s.set(f,b),i.push(f),p===1&&S&&to.set(f,!0),b===1&&f.setAttribute(n,"true"),S||f.setAttribute(r,"true")}catch(v){console.error("aria-hidden: cannot operate on ",f,v)}})};return u(t),a.clear(),Vs++,function(){i.forEach(function(d){var f=yn.get(d)-1,h=s.get(d)-1;yn.set(d,f),s.set(d,h),f||(to.has(d)||d.removeAttribute(r),to.delete(d)),h||d.removeAttribute(n)}),Vs--,Vs||(yn=new WeakMap,yn=new WeakMap,to=new WeakMap,no={})}},Aa=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=mS(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),vS(r,o,n,"aria-hidden")):function(){return null}},ct=function(){return ct=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},ct.apply(this,arguments)};function ah(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function yS(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,s;r<o;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||Array.prototype.slice.call(t))}var yo="right-scroll-bar-position",bo="width-before-scroll-bar",bS="with-scroll-bars-hidden",xS="--removed-body-scroll-bar-size";function Fs(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function wS(e,t){var n=E.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var SS=typeof window<"u"?D.useLayoutEffect:D.useEffect,wl=new WeakMap;function CS(e,t){var n=wS(null,function(r){return e.forEach(function(o){return Fs(o,r)})});return SS(function(){var r=wl.get(n);if(r){var o=new Set(r),s=new Set(e),i=n.current;o.forEach(function(a){s.has(a)||Fs(a,null)}),s.forEach(function(a){o.has(a)||Fs(a,i)})}wl.set(n,e)},[e]),n}function TS(e){return e}function DS(e,t){t===void 0&&(t=TS);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(s){var i=t(s,r);return n.push(i),function(){n=n.filter(function(a){return a!==i})}},assignSyncMedium:function(s){for(r=!0;n.length;){var i=n;n=[],i.forEach(s)}n={push:function(a){return s(a)},filter:function(){return n}}},assignMedium:function(s){r=!0;var i=[];if(n.length){var a=n;n=[],a.forEach(s),i=n}var c=function(){var u=i;i=[],u.forEach(s)},l=function(){return Promise.resolve().then(c)};l(),n={push:function(u){i.push(u),l()},filter:function(u){return i=i.filter(u),n}}}};return o}function ES(e){e===void 0&&(e={});var t=DS(null);return t.options=ct({async:!0,ssr:!1},e),t}var ch=function(e){var t=e.sideCar,n=ah(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return D.createElement(r,ct({},n))};ch.isSideCarExport=!0;function MS(e,t){return e.useMedium(t),ch}var lh=ES(),$s=function(){},ls=D.forwardRef(function(e,t){var n=D.useRef(null),r=D.useState({onScrollCapture:$s,onWheelCapture:$s,onTouchMoveCapture:$s}),o=r[0],s=r[1],i=e.forwardProps,a=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,h=e.noIsolation,S=e.inert,p=e.allowPinchZoom,b=e.as,v=b===void 0?"div":b,m=e.gapMode,g=ah(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),C=f,y=CS([n,t]),M=ct(ct({},g),o);return D.createElement(D.Fragment,null,u&&D.createElement(C,{sideCar:lh,removeScrollBar:l,shards:d,noIsolation:h,inert:S,setCallbacks:s,allowPinchZoom:!!p,lockRef:n,gapMode:m}),i?D.cloneElement(D.Children.only(a),ct(ct({},M),{ref:y})):D.createElement(v,ct({},M,{className:c,ref:y}),a))});ls.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};ls.classNames={fullWidth:bo,zeroRight:yo};var RS=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function PS(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=RS();return t&&e.setAttribute("nonce",t),e}function AS(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function OS(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var kS=function(){var e=0,t=null;return{add:function(n){e==0&&(t=PS())&&(AS(t,n),OS(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},_S=function(){var e=kS();return function(t,n){D.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},uh=function(){var e=_S(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},NS={left:0,top:0,right:0,gap:0},Bs=function(e){return parseInt(e||"",10)||0},IS=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[Bs(n),Bs(r),Bs(o)]},jS=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return NS;var t=IS(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},LS=uh(),An="data-scroll-locked",VS=function(e,t,n,r){var o=e.left,s=e.top,i=e.right,a=e.gap;return n===void 0&&(n="margin"),`
110
- .`.concat(bS,` {
109
+ */const bb=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],xb=Ae("X",bb);function cf(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=cf(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function lf(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=cf(e))&&(r&&(r+=" "),r+=t);return r}const da="-",wb=e=>{const t=Cb(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:i=>{const a=i.split(da);return a[0]===""&&a.length!==1&&a.shift(),uf(a,t)||Sb(i)},getConflictingClassGroupIds:(i,a)=>{const c=n[i]||[];return a&&r[i]?[...c,...r[i]]:c}}},uf=(e,t)=>{var i;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?uf(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const s=e.join(da);return(i=t.validators.find(({validator:a})=>a(s)))==null?void 0:i.classGroupId},Xc=/^\[(.+)\]$/,Sb=e=>{if(Xc.test(e)){const t=Xc.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},Cb=e=>{const{theme:t,classGroups:n}=e,r={nextPart:new Map,validators:[]};for(const o in n)mi(n[o],r,o,t);return r},mi=(e,t,n,r)=>{e.forEach(o=>{if(typeof o=="string"){const s=o===""?t:Zc(t,o);s.classGroupId=n;return}if(typeof o=="function"){if(Tb(o)){mi(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([s,i])=>{mi(i,Zc(t,s),n,r)})})},Zc=(e,t)=>{let n=e;return t.split(da).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},Tb=e=>e.isThemeGetter,Db=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const o=(s,i)=>{n.set(s,i),t++,t>e&&(t=0,r=n,n=new Map)};return{get(s){let i=n.get(s);if(i!==void 0)return i;if((i=r.get(s))!==void 0)return o(s,i),i},set(s,i){n.has(s)?n.set(s,i):o(s,i)}}},gi="!",vi=":",Eb=vi.length,Mb=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=o=>{const s=[];let i=0,a=0,c=0,l;for(let S=0;S<o.length;S++){let m=o[S];if(i===0&&a===0){if(m===vi){s.push(o.slice(c,S)),c=S+Eb;continue}if(m==="/"){l=S;continue}}m==="["?i++:m==="]"?i--:m==="("?a++:m===")"&&a--}const u=s.length===0?o:o.substring(c),d=Rb(u),h=d!==u,f=l&&l>c?l-c:void 0;return{modifiers:s,hasImportantModifier:h,baseClassName:d,maybePostfixModifierPosition:f}};if(t){const o=t+vi,s=r;r=i=>i.startsWith(o)?s(i.substring(o.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:i,maybePostfixModifierPosition:void 0}}if(n){const o=r;r=s=>n({className:s,parseClassName:o})}return r},Rb=e=>e.endsWith(gi)?e.substring(0,e.length-1):e.startsWith(gi)?e.substring(1):e,Pb=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(r=>[r,!0]));return r=>{if(r.length<=1)return r;const o=[];let s=[];return r.forEach(i=>{i[0]==="["||t[i]?(o.push(...s.sort(),i),s=[]):s.push(i)}),o.push(...s.sort()),o}},Ab=e=>({cache:Db(e.cacheSize),parseClassName:Mb(e),sortModifiers:Pb(e),...wb(e)}),Ob=/\s+/,kb=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o,sortModifiers:s}=t,i=[],a=e.trim().split(Ob);let c="";for(let l=a.length-1;l>=0;l-=1){const u=a[l],{isExternal:d,modifiers:h,hasImportantModifier:f,baseClassName:S,maybePostfixModifierPosition:m}=n(u);if(d){c=u+(c.length>0?" "+c:c);continue}let w=!!m,g=r(w?S.substring(0,m):S);if(!g){if(!w){c=u+(c.length>0?" "+c:c);continue}if(g=r(S),!g){c=u+(c.length>0?" "+c:c);continue}w=!1}const p=s(h).join(":"),v=f?p+gi:p,C=v+g;if(i.includes(C))continue;i.push(C);const y=o(g,w);for(let M=0;M<y.length;++M){const b=y[M];i.push(v+b)}c=u+(c.length>0?" "+c:c)}return c};function _b(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=df(t))&&(r&&(r+=" "),r+=n);return r}const df=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=df(e[r]))&&(n&&(n+=" "),n+=t);return n};function Nb(e,...t){let n,r,o,s=i;function i(c){const l=t.reduce((u,d)=>d(u),e());return n=Ab(l),r=n.cache.get,o=n.cache.set,s=a,a(c)}function a(c){const l=r(c);if(l)return l;const u=kb(c,n);return o(c,u),u}return function(){return s(_b.apply(null,arguments))}}const we=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},ff=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,hf=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Ib=/^\d+\/\d+$/,jb=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Lb=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Vb=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Fb=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,$b=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,vn=e=>Ib.test(e),oe=e=>!!e&&!Number.isNaN(Number(e)),At=e=>!!e&&Number.isInteger(Number(e)),As=e=>e.endsWith("%")&&oe(e.slice(0,-1)),gt=e=>jb.test(e),Bb=()=>!0,zb=e=>Lb.test(e)&&!Vb.test(e),pf=()=>!1,Wb=e=>Fb.test(e),Hb=e=>$b.test(e),Ub=e=>!Q(e)&&!ee(e),Yb=e=>Vn(e,vf,pf),Q=e=>ff.test(e),Zt=e=>Vn(e,yf,zb),Os=e=>Vn(e,Zb,oe),Jc=e=>Vn(e,mf,pf),Kb=e=>Vn(e,gf,Hb),Xr=e=>Vn(e,bf,Wb),ee=e=>hf.test(e),Jn=e=>Fn(e,yf),Gb=e=>Fn(e,Jb),Qc=e=>Fn(e,mf),qb=e=>Fn(e,vf),Xb=e=>Fn(e,gf),Zr=e=>Fn(e,bf,!0),Vn=(e,t,n)=>{const r=ff.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Fn=(e,t,n=!1)=>{const r=hf.exec(e);return r?r[1]?t(r[1]):n:!1},mf=e=>e==="position"||e==="percentage",gf=e=>e==="image"||e==="url",vf=e=>e==="length"||e==="size"||e==="bg-size",yf=e=>e==="length",Zb=e=>e==="number",Jb=e=>e==="family-name",bf=e=>e==="shadow",Qb=()=>{const e=we("color"),t=we("font"),n=we("text"),r=we("font-weight"),o=we("tracking"),s=we("leading"),i=we("breakpoint"),a=we("container"),c=we("spacing"),l=we("radius"),u=we("shadow"),d=we("inset-shadow"),h=we("text-shadow"),f=we("drop-shadow"),S=we("blur"),m=we("perspective"),w=we("aspect"),g=we("ease"),p=we("animate"),v=()=>["auto","avoid","all","avoid-page","page","left","right","column"],C=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],y=()=>[...C(),ee,Q],M=()=>["auto","hidden","clip","visible","scroll"],b=()=>["auto","contain","none"],T=()=>[ee,Q,c],R=()=>[vn,"full","auto",...T()],_=()=>[At,"none","subgrid",ee,Q],O=()=>["auto",{span:["full",At,ee,Q]},At,ee,Q],z=()=>[At,"auto",ee,Q],G=()=>["auto","min","max","fr",ee,Q],j=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],F=()=>["start","end","center","stretch","center-safe","end-safe"],N=()=>["auto",...T()],k=()=>[vn,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...T()],P=()=>[e,ee,Q],I=()=>[...C(),Qc,Jc,{position:[ee,Q]}],A=()=>["no-repeat",{repeat:["","x","y","space","round"]}],V=()=>["auto","cover","contain",qb,Yb,{size:[ee,Q]}],W=()=>[As,Jn,Zt],H=()=>["","none","full",l,ee,Q],L=()=>["",oe,Jn,Zt],Y=()=>["solid","dashed","dotted","double"],K=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],$=()=>[oe,As,Qc,Jc],q=()=>["","none",S,ee,Q],X=()=>["none",oe,ee,Q],U=()=>["none",oe,ee,Q],ne=()=>[oe,ee,Q],B=()=>[vn,"full",...T()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[gt],breakpoint:[gt],color:[Bb],container:[gt],"drop-shadow":[gt],ease:["in","out","in-out"],font:[Ub],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[gt],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[gt],shadow:[gt],spacing:["px",oe],text:[gt],"text-shadow":[gt],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",vn,Q,ee,w]}],container:["container"],columns:[{columns:[oe,Q,ee,a]}],"break-after":[{"break-after":v()}],"break-before":[{"break-before":v()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:y()}],overflow:[{overflow:M()}],"overflow-x":[{"overflow-x":M()}],"overflow-y":[{"overflow-y":M()}],overscroll:[{overscroll:b()}],"overscroll-x":[{"overscroll-x":b()}],"overscroll-y":[{"overscroll-y":b()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:R()}],"inset-x":[{"inset-x":R()}],"inset-y":[{"inset-y":R()}],start:[{start:R()}],end:[{end:R()}],top:[{top:R()}],right:[{right:R()}],bottom:[{bottom:R()}],left:[{left:R()}],visibility:["visible","invisible","collapse"],z:[{z:[At,"auto",ee,Q]}],basis:[{basis:[vn,"full","auto",a,...T()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[oe,vn,"auto","initial","none",Q]}],grow:[{grow:["",oe,ee,Q]}],shrink:[{shrink:["",oe,ee,Q]}],order:[{order:[At,"first","last","none",ee,Q]}],"grid-cols":[{"grid-cols":_()}],"col-start-end":[{col:O()}],"col-start":[{"col-start":z()}],"col-end":[{"col-end":z()}],"grid-rows":[{"grid-rows":_()}],"row-start-end":[{row:O()}],"row-start":[{"row-start":z()}],"row-end":[{"row-end":z()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":G()}],"auto-rows":[{"auto-rows":G()}],gap:[{gap:T()}],"gap-x":[{"gap-x":T()}],"gap-y":[{"gap-y":T()}],"justify-content":[{justify:[...j(),"normal"]}],"justify-items":[{"justify-items":[...F(),"normal"]}],"justify-self":[{"justify-self":["auto",...F()]}],"align-content":[{content:["normal",...j()]}],"align-items":[{items:[...F(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...F(),{baseline:["","last"]}]}],"place-content":[{"place-content":j()}],"place-items":[{"place-items":[...F(),"baseline"]}],"place-self":[{"place-self":["auto",...F()]}],p:[{p:T()}],px:[{px:T()}],py:[{py:T()}],ps:[{ps:T()}],pe:[{pe:T()}],pt:[{pt:T()}],pr:[{pr:T()}],pb:[{pb:T()}],pl:[{pl:T()}],m:[{m:N()}],mx:[{mx:N()}],my:[{my:N()}],ms:[{ms:N()}],me:[{me:N()}],mt:[{mt:N()}],mr:[{mr:N()}],mb:[{mb:N()}],ml:[{ml:N()}],"space-x":[{"space-x":T()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":T()}],"space-y-reverse":["space-y-reverse"],size:[{size:k()}],w:[{w:[a,"screen",...k()]}],"min-w":[{"min-w":[a,"screen","none",...k()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[i]},...k()]}],h:[{h:["screen",...k()]}],"min-h":[{"min-h":["screen","none",...k()]}],"max-h":[{"max-h":["screen",...k()]}],"font-size":[{text:["base",n,Jn,Zt]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,ee,Os]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",As,Q]}],"font-family":[{font:[Gb,Q,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,ee,Q]}],"line-clamp":[{"line-clamp":[oe,"none",ee,Os]}],leading:[{leading:[s,...T()]}],"list-image":[{"list-image":["none",ee,Q]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ee,Q]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:P()}],"text-color":[{text:P()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Y(),"wavy"]}],"text-decoration-thickness":[{decoration:[oe,"from-font","auto",ee,Zt]}],"text-decoration-color":[{decoration:P()}],"underline-offset":[{"underline-offset":[oe,"auto",ee,Q]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:T()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ee,Q]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ee,Q]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:I()}],"bg-repeat":[{bg:A()}],"bg-size":[{bg:V()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},At,ee,Q],radial:["",ee,Q],conic:[At,ee,Q]},Xb,Kb]}],"bg-color":[{bg:P()}],"gradient-from-pos":[{from:W()}],"gradient-via-pos":[{via:W()}],"gradient-to-pos":[{to:W()}],"gradient-from":[{from:P()}],"gradient-via":[{via:P()}],"gradient-to":[{to:P()}],rounded:[{rounded:H()}],"rounded-s":[{"rounded-s":H()}],"rounded-e":[{"rounded-e":H()}],"rounded-t":[{"rounded-t":H()}],"rounded-r":[{"rounded-r":H()}],"rounded-b":[{"rounded-b":H()}],"rounded-l":[{"rounded-l":H()}],"rounded-ss":[{"rounded-ss":H()}],"rounded-se":[{"rounded-se":H()}],"rounded-ee":[{"rounded-ee":H()}],"rounded-es":[{"rounded-es":H()}],"rounded-tl":[{"rounded-tl":H()}],"rounded-tr":[{"rounded-tr":H()}],"rounded-br":[{"rounded-br":H()}],"rounded-bl":[{"rounded-bl":H()}],"border-w":[{border:L()}],"border-w-x":[{"border-x":L()}],"border-w-y":[{"border-y":L()}],"border-w-s":[{"border-s":L()}],"border-w-e":[{"border-e":L()}],"border-w-t":[{"border-t":L()}],"border-w-r":[{"border-r":L()}],"border-w-b":[{"border-b":L()}],"border-w-l":[{"border-l":L()}],"divide-x":[{"divide-x":L()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":L()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Y(),"hidden","none"]}],"divide-style":[{divide:[...Y(),"hidden","none"]}],"border-color":[{border:P()}],"border-color-x":[{"border-x":P()}],"border-color-y":[{"border-y":P()}],"border-color-s":[{"border-s":P()}],"border-color-e":[{"border-e":P()}],"border-color-t":[{"border-t":P()}],"border-color-r":[{"border-r":P()}],"border-color-b":[{"border-b":P()}],"border-color-l":[{"border-l":P()}],"divide-color":[{divide:P()}],"outline-style":[{outline:[...Y(),"none","hidden"]}],"outline-offset":[{"outline-offset":[oe,ee,Q]}],"outline-w":[{outline:["",oe,Jn,Zt]}],"outline-color":[{outline:P()}],shadow:[{shadow:["","none",u,Zr,Xr]}],"shadow-color":[{shadow:P()}],"inset-shadow":[{"inset-shadow":["none",d,Zr,Xr]}],"inset-shadow-color":[{"inset-shadow":P()}],"ring-w":[{ring:L()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:P()}],"ring-offset-w":[{"ring-offset":[oe,Zt]}],"ring-offset-color":[{"ring-offset":P()}],"inset-ring-w":[{"inset-ring":L()}],"inset-ring-color":[{"inset-ring":P()}],"text-shadow":[{"text-shadow":["none",h,Zr,Xr]}],"text-shadow-color":[{"text-shadow":P()}],opacity:[{opacity:[oe,ee,Q]}],"mix-blend":[{"mix-blend":[...K(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":K()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[oe]}],"mask-image-linear-from-pos":[{"mask-linear-from":$()}],"mask-image-linear-to-pos":[{"mask-linear-to":$()}],"mask-image-linear-from-color":[{"mask-linear-from":P()}],"mask-image-linear-to-color":[{"mask-linear-to":P()}],"mask-image-t-from-pos":[{"mask-t-from":$()}],"mask-image-t-to-pos":[{"mask-t-to":$()}],"mask-image-t-from-color":[{"mask-t-from":P()}],"mask-image-t-to-color":[{"mask-t-to":P()}],"mask-image-r-from-pos":[{"mask-r-from":$()}],"mask-image-r-to-pos":[{"mask-r-to":$()}],"mask-image-r-from-color":[{"mask-r-from":P()}],"mask-image-r-to-color":[{"mask-r-to":P()}],"mask-image-b-from-pos":[{"mask-b-from":$()}],"mask-image-b-to-pos":[{"mask-b-to":$()}],"mask-image-b-from-color":[{"mask-b-from":P()}],"mask-image-b-to-color":[{"mask-b-to":P()}],"mask-image-l-from-pos":[{"mask-l-from":$()}],"mask-image-l-to-pos":[{"mask-l-to":$()}],"mask-image-l-from-color":[{"mask-l-from":P()}],"mask-image-l-to-color":[{"mask-l-to":P()}],"mask-image-x-from-pos":[{"mask-x-from":$()}],"mask-image-x-to-pos":[{"mask-x-to":$()}],"mask-image-x-from-color":[{"mask-x-from":P()}],"mask-image-x-to-color":[{"mask-x-to":P()}],"mask-image-y-from-pos":[{"mask-y-from":$()}],"mask-image-y-to-pos":[{"mask-y-to":$()}],"mask-image-y-from-color":[{"mask-y-from":P()}],"mask-image-y-to-color":[{"mask-y-to":P()}],"mask-image-radial":[{"mask-radial":[ee,Q]}],"mask-image-radial-from-pos":[{"mask-radial-from":$()}],"mask-image-radial-to-pos":[{"mask-radial-to":$()}],"mask-image-radial-from-color":[{"mask-radial-from":P()}],"mask-image-radial-to-color":[{"mask-radial-to":P()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":C()}],"mask-image-conic-pos":[{"mask-conic":[oe]}],"mask-image-conic-from-pos":[{"mask-conic-from":$()}],"mask-image-conic-to-pos":[{"mask-conic-to":$()}],"mask-image-conic-from-color":[{"mask-conic-from":P()}],"mask-image-conic-to-color":[{"mask-conic-to":P()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:I()}],"mask-repeat":[{mask:A()}],"mask-size":[{mask:V()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ee,Q]}],filter:[{filter:["","none",ee,Q]}],blur:[{blur:q()}],brightness:[{brightness:[oe,ee,Q]}],contrast:[{contrast:[oe,ee,Q]}],"drop-shadow":[{"drop-shadow":["","none",f,Zr,Xr]}],"drop-shadow-color":[{"drop-shadow":P()}],grayscale:[{grayscale:["",oe,ee,Q]}],"hue-rotate":[{"hue-rotate":[oe,ee,Q]}],invert:[{invert:["",oe,ee,Q]}],saturate:[{saturate:[oe,ee,Q]}],sepia:[{sepia:["",oe,ee,Q]}],"backdrop-filter":[{"backdrop-filter":["","none",ee,Q]}],"backdrop-blur":[{"backdrop-blur":q()}],"backdrop-brightness":[{"backdrop-brightness":[oe,ee,Q]}],"backdrop-contrast":[{"backdrop-contrast":[oe,ee,Q]}],"backdrop-grayscale":[{"backdrop-grayscale":["",oe,ee,Q]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[oe,ee,Q]}],"backdrop-invert":[{"backdrop-invert":["",oe,ee,Q]}],"backdrop-opacity":[{"backdrop-opacity":[oe,ee,Q]}],"backdrop-saturate":[{"backdrop-saturate":[oe,ee,Q]}],"backdrop-sepia":[{"backdrop-sepia":["",oe,ee,Q]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":T()}],"border-spacing-x":[{"border-spacing-x":T()}],"border-spacing-y":[{"border-spacing-y":T()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ee,Q]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[oe,"initial",ee,Q]}],ease:[{ease:["linear","initial",g,ee,Q]}],delay:[{delay:[oe,ee,Q]}],animate:[{animate:["none",p,ee,Q]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[m,ee,Q]}],"perspective-origin":[{"perspective-origin":y()}],rotate:[{rotate:X()}],"rotate-x":[{"rotate-x":X()}],"rotate-y":[{"rotate-y":X()}],"rotate-z":[{"rotate-z":X()}],scale:[{scale:U()}],"scale-x":[{"scale-x":U()}],"scale-y":[{"scale-y":U()}],"scale-z":[{"scale-z":U()}],"scale-3d":["scale-3d"],skew:[{skew:ne()}],"skew-x":[{"skew-x":ne()}],"skew-y":[{"skew-y":ne()}],transform:[{transform:[ee,Q,"","none","gpu","cpu"]}],"transform-origin":[{origin:y()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:B()}],"translate-x":[{"translate-x":B()}],"translate-y":[{"translate-y":B()}],"translate-z":[{"translate-z":B()}],"translate-none":["translate-none"],accent:[{accent:P()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:P()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ee,Q]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":T()}],"scroll-mx":[{"scroll-mx":T()}],"scroll-my":[{"scroll-my":T()}],"scroll-ms":[{"scroll-ms":T()}],"scroll-me":[{"scroll-me":T()}],"scroll-mt":[{"scroll-mt":T()}],"scroll-mr":[{"scroll-mr":T()}],"scroll-mb":[{"scroll-mb":T()}],"scroll-ml":[{"scroll-ml":T()}],"scroll-p":[{"scroll-p":T()}],"scroll-px":[{"scroll-px":T()}],"scroll-py":[{"scroll-py":T()}],"scroll-ps":[{"scroll-ps":T()}],"scroll-pe":[{"scroll-pe":T()}],"scroll-pt":[{"scroll-pt":T()}],"scroll-pr":[{"scroll-pr":T()}],"scroll-pb":[{"scroll-pb":T()}],"scroll-pl":[{"scroll-pl":T()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ee,Q]}],fill:[{fill:["none",...P()]}],"stroke-w":[{stroke:[oe,Jn,Zt,Os]}],stroke:[{stroke:["none",...P()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},ex=Nb(Qb);function de(...e){return ex(lf(e))}function el(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Xo(...e){return t=>{let n=!1;const r=e.map(o=>{const s=el(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():el(e[o],null)}}}}function fe(...e){return D.useCallback(Xo(...e),e)}function sn(e){const t=nx(e),n=D.forwardRef((r,o)=>{const{children:s,...i}=r,a=D.Children.toArray(s),c=a.find(ox);if(c){const l=c.props.children,u=a.map(d=>d===c?D.Children.count(l)>1?D.Children.only(null):D.isValidElement(l)?l.props.children:null:d);return x.jsx(t,{...i,ref:o,children:D.isValidElement(l)?D.cloneElement(l,void 0,u):null})}return x.jsx(t,{...i,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}var tx=sn("Slot");function nx(e){const t=D.forwardRef((n,r)=>{const{children:o,...s}=n;if(D.isValidElement(o)){const i=ix(o),a=sx(s,o.props);return o.type!==D.Fragment&&(a.ref=r?Xo(r,i):i),D.cloneElement(o,a)}return D.Children.count(o)>1?D.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var xf=Symbol("radix.slottable");function rx(e){const t=({children:n})=>x.jsx(x.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=xf,t}function ox(e){return D.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===xf}function sx(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{s(...a),o(...a)}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function ix(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}const tl=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,nl=lf,fa=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return nl(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:s}=t,i=Object.keys(o).map(l=>{const u=n==null?void 0:n[l],d=s==null?void 0:s[l];if(u===null)return null;const h=tl(u)||tl(d);return o[l][h]}),a=n&&Object.entries(n).reduce((l,u)=>{let[d,h]=u;return h===void 0||(l[d]=h),l},{}),c=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((l,u)=>{let{class:d,className:h,...f}=u;return Object.entries(f).every(S=>{let[m,w]=S;return Array.isArray(w)?w.includes({...s,...a}[m]):{...s,...a}[m]===w})?[...l,d,h]:l},[]);return nl(e,i,c,n==null?void 0:n.class,n==null?void 0:n.className)},ax=fa("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive cursor-pointer",{variants:{variant:{default:"bg-primary cursor-pointer text-primary-foreground shadow-xs hover:bg-primary/90",destructive:"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50 hover:bg-accent",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}});function an({className:e,variant:t,size:n,asChild:r=!1,...o}){const s=r?tx:"button";return x.jsx(s,{"data-slot":"button",className:de(ax({variant:t,size:n,className:e})),...o})}function te(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function Ht(e,t=[]){let n=[];function r(s,i){const a=D.createContext(i),c=n.length;n=[...n,i];const l=d=>{var g;const{scope:h,children:f,...S}=d,m=((g=h==null?void 0:h[e])==null?void 0:g[c])||a,w=D.useMemo(()=>S,Object.values(S));return x.jsx(m.Provider,{value:w,children:f})};l.displayName=s+"Provider";function u(d,h){var m;const f=((m=h==null?void 0:h[e])==null?void 0:m[c])||a,S=D.useContext(f);if(S)return S;if(i!==void 0)return i;throw new Error(`\`${d}\` must be used within \`${s}\``)}return[l,u]}const o=()=>{const s=n.map(i=>D.createContext(i));return function(a){const c=(a==null?void 0:a[e])||s;return D.useMemo(()=>({[`__scope${e}`]:{...a,[e]:c}}),[a,c])}};return o.scopeName=e,[r,cx(o,...t)]}function cx(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const i=r.reduce((a,{useScope:c,scopeName:l})=>{const d=c(s)[`__scope${l}`];return{...a,...d}},{});return D.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}var lx=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],ae=lx.reduce((e,t)=>{const n=sn(`Primitive.${t}`),r=D.forwardRef((o,s)=>{const{asChild:i,...a}=o,c=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),x.jsx(c,{...a,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function wf(e,t){e&&zo.flushSync(()=>e.dispatchEvent(t))}function Ze(e){const t=D.useRef(e);return D.useEffect(()=>{t.current=e}),D.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function ux(e,t=globalThis==null?void 0:globalThis.document){const n=Ze(e);D.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var dx="DismissableLayer",yi="dismissableLayer.update",fx="dismissableLayer.pointerDownOutside",hx="dismissableLayer.focusOutside",rl,Sf=D.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),jr=D.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:i,onDismiss:a,...c}=e,l=D.useContext(Sf),[u,d]=D.useState(null),h=(u==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,f]=D.useState({}),S=fe(t,b=>d(b)),m=Array.from(l.layers),[w]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),g=m.indexOf(w),p=u?m.indexOf(u):-1,v=l.layersWithOutsidePointerEventsDisabled.size>0,C=p>=g,y=gx(b=>{const T=b.target,R=[...l.branches].some(_=>_.contains(T));!C||R||(o==null||o(b),i==null||i(b),b.defaultPrevented||a==null||a())},h),M=vx(b=>{const T=b.target;[...l.branches].some(_=>_.contains(T))||(s==null||s(b),i==null||i(b),b.defaultPrevented||a==null||a())},h);return ux(b=>{p===l.layers.size-1&&(r==null||r(b),!b.defaultPrevented&&a&&(b.preventDefault(),a()))},h),D.useEffect(()=>{if(u)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(rl=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(u)),l.layers.add(u),ol(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=rl)}},[u,h,n,l]),D.useEffect(()=>()=>{u&&(l.layers.delete(u),l.layersWithOutsidePointerEventsDisabled.delete(u),ol())},[u,l]),D.useEffect(()=>{const b=()=>f({});return document.addEventListener(yi,b),()=>document.removeEventListener(yi,b)},[]),x.jsx(ae.div,{...c,ref:S,style:{pointerEvents:v?C?"auto":"none":void 0,...e.style},onFocusCapture:te(e.onFocusCapture,M.onFocusCapture),onBlurCapture:te(e.onBlurCapture,M.onBlurCapture),onPointerDownCapture:te(e.onPointerDownCapture,y.onPointerDownCapture)})});jr.displayName=dx;var px="DismissableLayerBranch",mx=D.forwardRef((e,t)=>{const n=D.useContext(Sf),r=D.useRef(null),o=fe(t,r);return D.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),x.jsx(ae.div,{...e,ref:o})});mx.displayName=px;function gx(e,t=globalThis==null?void 0:globalThis.document){const n=Ze(e),r=D.useRef(!1),o=D.useRef(()=>{});return D.useEffect(()=>{const s=a=>{if(a.target&&!r.current){let c=function(){Cf(fx,n,l,{discrete:!0})};const l={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=c,t.addEventListener("click",o.current,{once:!0})):c()}else t.removeEventListener("click",o.current);r.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",s),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function vx(e,t=globalThis==null?void 0:globalThis.document){const n=Ze(e),r=D.useRef(!1);return D.useEffect(()=>{const o=s=>{s.target&&!r.current&&Cf(hx,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function ol(){const e=new CustomEvent(yi);document.dispatchEvent(e)}function Cf(e,t,n,{discrete:r}){const o=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?wf(o,s):o.dispatchEvent(s)}var _e=globalThis!=null&&globalThis.document?D.useLayoutEffect:()=>{},yx=D[" useId ".trim().toString()]||(()=>{}),bx=0;function Vt(e){const[t,n]=D.useState(yx());return _e(()=>{n(r=>r??String(bx++))},[e]),e||(t?`radix-${t}`:"")}const xx=["top","right","bottom","left"],Ft=Math.min,ze=Math.max,Ao=Math.round,Jr=Math.floor,lt=e=>({x:e,y:e}),wx={left:"right",right:"left",bottom:"top",top:"bottom"},Sx={start:"end",end:"start"};function bi(e,t,n){return ze(e,Ft(t,n))}function bt(e,t){return typeof e=="function"?e(t):e}function xt(e){return e.split("-")[0]}function $n(e){return e.split("-")[1]}function ha(e){return e==="x"?"y":"x"}function pa(e){return e==="y"?"height":"width"}function $t(e){return["top","bottom"].includes(xt(e))?"y":"x"}function ma(e){return ha($t(e))}function Cx(e,t,n){n===void 0&&(n=!1);const r=$n(e),o=ma(e),s=pa(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=Oo(i)),[i,Oo(i)]}function Tx(e){const t=Oo(e);return[xi(e),t,xi(t)]}function xi(e){return e.replace(/start|end/g,t=>Sx[t])}function Dx(e,t,n){const r=["left","right"],o=["right","left"],s=["top","bottom"],i=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?s:i;default:return[]}}function Ex(e,t,n,r){const o=$n(e);let s=Dx(xt(e),n==="start",r);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map(xi)))),s}function Oo(e){return e.replace(/left|right|bottom|top/g,t=>wx[t])}function Mx(e){return{top:0,right:0,bottom:0,left:0,...e}}function Tf(e){return typeof e!="number"?Mx(e):{top:e,right:e,bottom:e,left:e}}function ko(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function sl(e,t,n){let{reference:r,floating:o}=e;const s=$t(t),i=ma(t),a=pa(i),c=xt(t),l=s==="y",u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,h=r[a]/2-o[a]/2;let f;switch(c){case"top":f={x:u,y:r.y-o.height};break;case"bottom":f={x:u,y:r.y+r.height};break;case"right":f={x:r.x+r.width,y:d};break;case"left":f={x:r.x-o.width,y:d};break;default:f={x:r.x,y:r.y}}switch($n(t)){case"start":f[i]-=h*(n&&l?-1:1);break;case"end":f[i]+=h*(n&&l?-1:1);break}return f}const Rx=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,a=s.filter(Boolean),c=await(i.isRTL==null?void 0:i.isRTL(t));let l=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=sl(l,r,c),h=r,f={},S=0;for(let m=0;m<a.length;m++){const{name:w,fn:g}=a[m],{x:p,y:v,data:C,reset:y}=await g({x:u,y:d,initialPlacement:r,placement:h,strategy:o,middlewareData:f,rects:l,platform:i,elements:{reference:e,floating:t}});u=p??u,d=v??d,f={...f,[w]:{...f[w],...C}},y&&S<=50&&(S++,typeof y=="object"&&(y.placement&&(h=y.placement),y.rects&&(l=y.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):y.rects),{x:u,y:d}=sl(l,h,c)),m=-1)}return{x:u,y:d,placement:h,strategy:o,middlewareData:f}};async function br(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:i,elements:a,strategy:c}=e,{boundary:l="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:h=!1,padding:f=0}=bt(t,e),S=Tf(f),w=a[h?d==="floating"?"reference":"floating":d],g=ko(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(w)))==null||n?w:w.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:l,rootBoundary:u,strategy:c})),p=d==="floating"?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,v=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),C=await(s.isElement==null?void 0:s.isElement(v))?await(s.getScale==null?void 0:s.getScale(v))||{x:1,y:1}:{x:1,y:1},y=ko(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:p,offsetParent:v,strategy:c}):p);return{top:(g.top-y.top+S.top)/C.y,bottom:(y.bottom-g.bottom+S.bottom)/C.y,left:(g.left-y.left+S.left)/C.x,right:(y.right-g.right+S.right)/C.x}}const Px=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:s,platform:i,elements:a,middlewareData:c}=t,{element:l,padding:u=0}=bt(e,t)||{};if(l==null)return{};const d=Tf(u),h={x:n,y:r},f=ma(o),S=pa(f),m=await i.getDimensions(l),w=f==="y",g=w?"top":"left",p=w?"bottom":"right",v=w?"clientHeight":"clientWidth",C=s.reference[S]+s.reference[f]-h[f]-s.floating[S],y=h[f]-s.reference[f],M=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l));let b=M?M[v]:0;(!b||!await(i.isElement==null?void 0:i.isElement(M)))&&(b=a.floating[v]||s.floating[S]);const T=C/2-y/2,R=b/2-m[S]/2-1,_=Ft(d[g],R),O=Ft(d[p],R),z=_,G=b-m[S]-O,j=b/2-m[S]/2+T,F=bi(z,j,G),N=!c.arrow&&$n(o)!=null&&j!==F&&s.reference[S]/2-(j<z?_:O)-m[S]/2<0,k=N?j<z?j-z:j-G:0;return{[f]:h[f]+k,data:{[f]:F,centerOffset:j-F-k,...N&&{alignmentOffset:k}},reset:N}}}),Ax=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:s,rects:i,initialPlacement:a,platform:c,elements:l}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:h,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:S="none",flipAlignment:m=!0,...w}=bt(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const g=xt(o),p=$t(a),v=xt(a)===a,C=await(c.isRTL==null?void 0:c.isRTL(l.floating)),y=h||(v||!m?[Oo(a)]:Tx(a)),M=S!=="none";!h&&M&&y.push(...Ex(a,m,S,C));const b=[a,...y],T=await br(t,w),R=[];let _=((r=s.flip)==null?void 0:r.overflows)||[];if(u&&R.push(T[g]),d){const j=Cx(o,i,C);R.push(T[j[0]],T[j[1]])}if(_=[..._,{placement:o,overflows:R}],!R.every(j=>j<=0)){var O,z;const j=(((O=s.flip)==null?void 0:O.index)||0)+1,F=b[j];if(F)return{data:{index:j,overflows:_},reset:{placement:F}};let N=(z=_.filter(k=>k.overflows[0]<=0).sort((k,P)=>k.overflows[1]-P.overflows[1])[0])==null?void 0:z.placement;if(!N)switch(f){case"bestFit":{var G;const k=(G=_.filter(P=>{if(M){const I=$t(P.placement);return I===p||I==="y"}return!0}).map(P=>[P.placement,P.overflows.filter(I=>I>0).reduce((I,A)=>I+A,0)]).sort((P,I)=>P[1]-I[1])[0])==null?void 0:G[0];k&&(N=k);break}case"initialPlacement":N=a;break}if(o!==N)return{reset:{placement:N}}}return{}}}};function il(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function al(e){return xx.some(t=>e[t]>=0)}const Ox=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=bt(e,t);switch(r){case"referenceHidden":{const s=await br(t,{...o,elementContext:"reference"}),i=il(s,n.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:al(i)}}}case"escaped":{const s=await br(t,{...o,altBoundary:!0}),i=il(s,n.floating);return{data:{escapedOffsets:i,escaped:al(i)}}}default:return{}}}}};async function kx(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=xt(n),a=$n(n),c=$t(n)==="y",l=["left","top"].includes(i)?-1:1,u=s&&c?-1:1,d=bt(t,e);let{mainAxis:h,crossAxis:f,alignmentAxis:S}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof S=="number"&&(f=a==="end"?S*-1:S),c?{x:f*u,y:h*l}:{x:h*l,y:f*u}}const _x=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:s,placement:i,middlewareData:a}=t,c=await kx(t,e);return i===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+c.x,y:s+c.y,data:{...c,placement:i}}}}},Nx=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:s=!0,crossAxis:i=!1,limiter:a={fn:w=>{let{x:g,y:p}=w;return{x:g,y:p}}},...c}=bt(e,t),l={x:n,y:r},u=await br(t,c),d=$t(xt(o)),h=ha(d);let f=l[h],S=l[d];if(s){const w=h==="y"?"top":"left",g=h==="y"?"bottom":"right",p=f+u[w],v=f-u[g];f=bi(p,f,v)}if(i){const w=d==="y"?"top":"left",g=d==="y"?"bottom":"right",p=S+u[w],v=S-u[g];S=bi(p,S,v)}const m=a.fn({...t,[h]:f,[d]:S});return{...m,data:{x:m.x-n,y:m.y-r,enabled:{[h]:s,[d]:i}}}}}},Ix=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:s,middlewareData:i}=t,{offset:a=0,mainAxis:c=!0,crossAxis:l=!0}=bt(e,t),u={x:n,y:r},d=$t(o),h=ha(d);let f=u[h],S=u[d];const m=bt(a,t),w=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(c){const v=h==="y"?"height":"width",C=s.reference[h]-s.floating[v]+w.mainAxis,y=s.reference[h]+s.reference[v]-w.mainAxis;f<C?f=C:f>y&&(f=y)}if(l){var g,p;const v=h==="y"?"width":"height",C=["top","left"].includes(xt(o)),y=s.reference[d]-s.floating[v]+(C&&((g=i.offset)==null?void 0:g[d])||0)+(C?0:w.crossAxis),M=s.reference[d]+s.reference[v]+(C?0:((p=i.offset)==null?void 0:p[d])||0)-(C?w.crossAxis:0);S<y?S=y:S>M&&(S=M)}return{[h]:f,[d]:S}}}},jx=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:s,platform:i,elements:a}=t,{apply:c=()=>{},...l}=bt(e,t),u=await br(t,l),d=xt(o),h=$n(o),f=$t(o)==="y",{width:S,height:m}=s.floating;let w,g;d==="top"||d==="bottom"?(w=d,g=h===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(g=d,w=h==="end"?"top":"bottom");const p=m-u.top-u.bottom,v=S-u.left-u.right,C=Ft(m-u[w],p),y=Ft(S-u[g],v),M=!t.middlewareData.shift;let b=C,T=y;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(T=v),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(b=p),M&&!h){const _=ze(u.left,0),O=ze(u.right,0),z=ze(u.top,0),G=ze(u.bottom,0);f?T=S-2*(_!==0||O!==0?_+O:ze(u.left,u.right)):b=m-2*(z!==0||G!==0?z+G:ze(u.top,u.bottom))}await c({...t,availableWidth:T,availableHeight:b});const R=await i.getDimensions(a.floating);return S!==R.width||m!==R.height?{reset:{rects:!0}}:{}}}};function Zo(){return typeof window<"u"}function Bn(e){return Df(e)?(e.nodeName||"").toLowerCase():"#document"}function We(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ht(e){var t;return(t=(Df(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Df(e){return Zo()?e instanceof Node||e instanceof We(e).Node:!1}function nt(e){return Zo()?e instanceof Element||e instanceof We(e).Element:!1}function ft(e){return Zo()?e instanceof HTMLElement||e instanceof We(e).HTMLElement:!1}function cl(e){return!Zo()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof We(e).ShadowRoot}function Lr(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=rt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function Lx(e){return["table","td","th"].includes(Bn(e))}function Jo(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function ga(e){const t=va(),n=nt(e)?rt(e):e;return["transform","translate","scale","rotate","perspective"].some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function Vx(e){let t=Bt(e);for(;ft(t)&&!On(t);){if(ga(t))return t;if(Jo(t))return null;t=Bt(t)}return null}function va(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function On(e){return["html","body","#document"].includes(Bn(e))}function rt(e){return We(e).getComputedStyle(e)}function Qo(e){return nt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Bt(e){if(Bn(e)==="html")return e;const t=e.assignedSlot||e.parentNode||cl(e)&&e.host||ht(e);return cl(t)?t.host:t}function Ef(e){const t=Bt(e);return On(t)?e.ownerDocument?e.ownerDocument.body:e.body:ft(t)&&Lr(t)?t:Ef(t)}function xr(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Ef(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),i=We(o);if(s){const a=wi(i);return t.concat(i,i.visualViewport||[],Lr(o)?o:[],a&&n?xr(a):[])}return t.concat(o,xr(o,[],n))}function wi(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Mf(e){const t=rt(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=ft(e),s=o?e.offsetWidth:n,i=o?e.offsetHeight:r,a=Ao(n)!==s||Ao(r)!==i;return a&&(n=s,r=i),{width:n,height:r,$:a}}function ya(e){return nt(e)?e:e.contextElement}function Pn(e){const t=ya(e);if(!ft(t))return lt(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=Mf(t);let i=(s?Ao(n.width):n.width)/r,a=(s?Ao(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const Fx=lt(0);function Rf(e){const t=We(e);return!va()||!t.visualViewport?Fx:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function $x(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==We(e)?!1:t}function cn(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=ya(e);let i=lt(1);t&&(r?nt(r)&&(i=Pn(r)):i=Pn(e));const a=$x(s,n,r)?Rf(s):lt(0);let c=(o.left+a.x)/i.x,l=(o.top+a.y)/i.y,u=o.width/i.x,d=o.height/i.y;if(s){const h=We(s),f=r&&nt(r)?We(r):r;let S=h,m=wi(S);for(;m&&r&&f!==S;){const w=Pn(m),g=m.getBoundingClientRect(),p=rt(m),v=g.left+(m.clientLeft+parseFloat(p.paddingLeft))*w.x,C=g.top+(m.clientTop+parseFloat(p.paddingTop))*w.y;c*=w.x,l*=w.y,u*=w.x,d*=w.y,c+=v,l+=C,S=We(m),m=wi(S)}}return ko({width:u,height:d,x:c,y:l})}function ba(e,t){const n=Qo(e).scrollLeft;return t?t.left+n:cn(ht(e)).left+n}function Pf(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),o=r.left+t.scrollLeft-(n?0:ba(e,r)),s=r.top+t.scrollTop;return{x:o,y:s}}function Bx(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",i=ht(r),a=t?Jo(t.floating):!1;if(r===i||a&&s)return n;let c={scrollLeft:0,scrollTop:0},l=lt(1);const u=lt(0),d=ft(r);if((d||!d&&!s)&&((Bn(r)!=="body"||Lr(i))&&(c=Qo(r)),ft(r))){const f=cn(r);l=Pn(r),u.x=f.x+r.clientLeft,u.y=f.y+r.clientTop}const h=i&&!d&&!s?Pf(i,c,!0):lt(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+h.x,y:n.y*l.y-c.scrollTop*l.y+u.y+h.y}}function zx(e){return Array.from(e.getClientRects())}function Wx(e){const t=ht(e),n=Qo(e),r=e.ownerDocument.body,o=ze(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=ze(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+ba(e);const a=-n.scrollTop;return rt(r).direction==="rtl"&&(i+=ze(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:i,y:a}}function Hx(e,t){const n=We(e),r=ht(e),o=n.visualViewport;let s=r.clientWidth,i=r.clientHeight,a=0,c=0;if(o){s=o.width,i=o.height;const l=va();(!l||l&&t==="fixed")&&(a=o.offsetLeft,c=o.offsetTop)}return{width:s,height:i,x:a,y:c}}function Ux(e,t){const n=cn(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=ft(e)?Pn(e):lt(1),i=e.clientWidth*s.x,a=e.clientHeight*s.y,c=o*s.x,l=r*s.y;return{width:i,height:a,x:c,y:l}}function ll(e,t,n){let r;if(t==="viewport")r=Hx(e,n);else if(t==="document")r=Wx(ht(e));else if(nt(t))r=Ux(t,n);else{const o=Rf(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return ko(r)}function Af(e,t){const n=Bt(e);return n===t||!nt(n)||On(n)?!1:rt(n).position==="fixed"||Af(n,t)}function Yx(e,t){const n=t.get(e);if(n)return n;let r=xr(e,[],!1).filter(a=>nt(a)&&Bn(a)!=="body"),o=null;const s=rt(e).position==="fixed";let i=s?Bt(e):e;for(;nt(i)&&!On(i);){const a=rt(i),c=ga(i);!c&&a.position==="fixed"&&(o=null),(s?!c&&!o:!c&&a.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||Lr(i)&&!c&&Af(e,i))?r=r.filter(u=>u!==i):o=a,i=Bt(i)}return t.set(e,r),r}function Kx(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[...n==="clippingAncestors"?Jo(t)?[]:Yx(t,this._c):[].concat(n),r],a=i[0],c=i.reduce((l,u)=>{const d=ll(t,u,o);return l.top=ze(d.top,l.top),l.right=Ft(d.right,l.right),l.bottom=Ft(d.bottom,l.bottom),l.left=ze(d.left,l.left),l},ll(t,a,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function Gx(e){const{width:t,height:n}=Mf(e);return{width:t,height:n}}function qx(e,t,n){const r=ft(t),o=ht(t),s=n==="fixed",i=cn(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const c=lt(0);if(r||!r&&!s)if((Bn(t)!=="body"||Lr(o))&&(a=Qo(t)),r){const h=cn(t,!0,s,t);c.x=h.x+t.clientLeft,c.y=h.y+t.clientTop}else o&&(c.x=ba(o));const l=o&&!r&&!s?Pf(o,a):lt(0),u=i.left+a.scrollLeft-c.x-l.x,d=i.top+a.scrollTop-c.y-l.y;return{x:u,y:d,width:i.width,height:i.height}}function ks(e){return rt(e).position==="static"}function ul(e,t){if(!ft(e)||rt(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return ht(e)===n&&(n=n.ownerDocument.body),n}function Of(e,t){const n=We(e);if(Jo(e))return n;if(!ft(e)){let o=Bt(e);for(;o&&!On(o);){if(nt(o)&&!ks(o))return o;o=Bt(o)}return n}let r=ul(e,t);for(;r&&Lx(r)&&ks(r);)r=ul(r,t);return r&&On(r)&&ks(r)&&!ga(r)?n:r||Vx(e)||n}const Xx=async function(e){const t=this.getOffsetParent||Of,n=this.getDimensions,r=await n(e.floating);return{reference:qx(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Zx(e){return rt(e).direction==="rtl"}const Jx={convertOffsetParentRelativeRectToViewportRelativeRect:Bx,getDocumentElement:ht,getClippingRect:Kx,getOffsetParent:Of,getElementRects:Xx,getClientRects:zx,getDimensions:Gx,getScale:Pn,isElement:nt,isRTL:Zx};function kf(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Qx(e,t){let n=null,r;const o=ht(e);function s(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function i(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),s();const l=e.getBoundingClientRect(),{left:u,top:d,width:h,height:f}=l;if(a||t(),!h||!f)return;const S=Jr(d),m=Jr(o.clientWidth-(u+h)),w=Jr(o.clientHeight-(d+f)),g=Jr(u),v={rootMargin:-S+"px "+-m+"px "+-w+"px "+-g+"px",threshold:ze(0,Ft(1,c))||1};let C=!0;function y(M){const b=M[0].intersectionRatio;if(b!==c){if(!C)return i();b?i(!1,b):r=setTimeout(()=>{i(!1,1e-7)},1e3)}b===1&&!kf(l,e.getBoundingClientRect())&&i(),C=!1}try{n=new IntersectionObserver(y,{...v,root:o.ownerDocument})}catch{n=new IntersectionObserver(y,v)}n.observe(e)}return i(!0),s}function ew(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,l=ya(e),u=o||s?[...l?xr(l):[],...xr(t)]:[];u.forEach(g=>{o&&g.addEventListener("scroll",n,{passive:!0}),s&&g.addEventListener("resize",n)});const d=l&&a?Qx(l,n):null;let h=-1,f=null;i&&(f=new ResizeObserver(g=>{let[p]=g;p&&p.target===l&&f&&(f.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var v;(v=f)==null||v.observe(t)})),n()}),l&&!c&&f.observe(l),f.observe(t));let S,m=c?cn(e):null;c&&w();function w(){const g=cn(e);m&&!kf(m,g)&&n(),m=g,S=requestAnimationFrame(w)}return n(),()=>{var g;u.forEach(p=>{o&&p.removeEventListener("scroll",n),s&&p.removeEventListener("resize",n)}),d==null||d(),(g=f)==null||g.disconnect(),f=null,c&&cancelAnimationFrame(S)}}const tw=_x,nw=Nx,rw=Ax,ow=jx,sw=Ox,dl=Px,iw=Ix,aw=(e,t,n)=>{const r=new Map,o={platform:Jx,...n},s={...o.platform,_c:r};return Rx(e,t,{...o,platform:s})};var go=typeof document<"u"?E.useLayoutEffect:E.useEffect;function _o(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!_o(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const s=o[r];if(!(s==="_owner"&&e.$$typeof)&&!_o(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function _f(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function fl(e,t){const n=_f(e);return Math.round(t*n)/n}function _s(e){const t=D.useRef(e);return go(()=>{t.current=e}),t}function cw(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:i}={},transform:a=!0,whileElementsMounted:c,open:l}=e,[u,d]=D.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,f]=D.useState(r);_o(h,r)||f(r);const[S,m]=D.useState(null),[w,g]=D.useState(null),p=D.useCallback(P=>{P!==M.current&&(M.current=P,m(P))},[]),v=D.useCallback(P=>{P!==b.current&&(b.current=P,g(P))},[]),C=s||S,y=i||w,M=D.useRef(null),b=D.useRef(null),T=D.useRef(u),R=c!=null,_=_s(c),O=_s(o),z=_s(l),G=D.useCallback(()=>{if(!M.current||!b.current)return;const P={placement:t,strategy:n,middleware:h};O.current&&(P.platform=O.current),aw(M.current,b.current,P).then(I=>{const A={...I,isPositioned:z.current!==!1};j.current&&!_o(T.current,A)&&(T.current=A,zo.flushSync(()=>{d(A)}))})},[h,t,n,O,z]);go(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(P=>({...P,isPositioned:!1})))},[l]);const j=D.useRef(!1);go(()=>(j.current=!0,()=>{j.current=!1}),[]),go(()=>{if(C&&(M.current=C),y&&(b.current=y),C&&y){if(_.current)return _.current(C,y,G);G()}},[C,y,G,_,R]);const F=D.useMemo(()=>({reference:M,floating:b,setReference:p,setFloating:v}),[p,v]),N=D.useMemo(()=>({reference:C,floating:y}),[C,y]),k=D.useMemo(()=>{const P={position:n,left:0,top:0};if(!N.floating)return P;const I=fl(N.floating,u.x),A=fl(N.floating,u.y);return a?{...P,transform:"translate("+I+"px, "+A+"px)",..._f(N.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:I,top:A}},[n,a,N.floating,u.x,u.y]);return D.useMemo(()=>({...u,update:G,refs:F,elements:N,floatingStyles:k}),[u,G,F,N,k])}const lw=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?dl({element:r.current,padding:o}).fn(n):{}:r?dl({element:r,padding:o}).fn(n):{}}}},uw=(e,t)=>({...tw(e),options:[e,t]}),dw=(e,t)=>({...nw(e),options:[e,t]}),fw=(e,t)=>({...iw(e),options:[e,t]}),hw=(e,t)=>({...rw(e),options:[e,t]}),pw=(e,t)=>({...ow(e),options:[e,t]}),mw=(e,t)=>({...sw(e),options:[e,t]}),gw=(e,t)=>({...lw(e),options:[e,t]});var vw="Arrow",Nf=D.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...s}=e;return x.jsx(ae.svg,{...s,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:x.jsx("polygon",{points:"0,0 30,0 15,10"})})});Nf.displayName=vw;var yw=Nf;function bw(e){const[t,n]=D.useState(void 0);return _e(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const s=o[0];let i,a;if("borderBoxSize"in s){const c=s.borderBoxSize,l=Array.isArray(c)?c[0]:c;i=l.inlineSize,a=l.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var xa="Popper",[If,Ut]=Ht(xa),[xw,jf]=If(xa),Lf=e=>{const{__scopePopper:t,children:n}=e,[r,o]=D.useState(null);return x.jsx(xw,{scope:t,anchor:r,onAnchorChange:o,children:n})};Lf.displayName=xa;var Vf="PopperAnchor",Ff=D.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,s=jf(Vf,n),i=D.useRef(null),a=fe(t,i);return D.useEffect(()=>{s.onAnchorChange((r==null?void 0:r.current)||i.current)}),r?null:x.jsx(ae.div,{...o,ref:a})});Ff.displayName=Vf;var wa="PopperContent",[ww,Sw]=If(wa),$f=D.forwardRef((e,t)=>{var $,q,X,U,ne,B;const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:s="center",alignOffset:i=0,arrowPadding:a=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d="partial",hideWhenDetached:h=!1,updatePositionStrategy:f="optimized",onPlaced:S,...m}=e,w=jf(wa,n),[g,p]=D.useState(null),v=fe(t,ie=>p(ie)),[C,y]=D.useState(null),M=bw(C),b=(M==null?void 0:M.width)??0,T=(M==null?void 0:M.height)??0,R=r+(s!=="center"?"-"+s:""),_=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},O=Array.isArray(l)?l:[l],z=O.length>0,G={padding:_,boundary:O.filter(Tw),altBoundary:z},{refs:j,floatingStyles:F,placement:N,isPositioned:k,middlewareData:P}=cw({strategy:"fixed",placement:R,whileElementsMounted:(...ie)=>ew(...ie,{animationFrame:f==="always"}),elements:{reference:w.anchor},middleware:[uw({mainAxis:o+T,alignmentAxis:i}),c&&dw({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?fw():void 0,...G}),c&&hw({...G}),pw({...G,apply:({elements:ie,rects:pe,availableWidth:Oe,availableHeight:Ee})=>{const{width:ot,height:J}=pe.reference,ce=ie.floating.style;ce.setProperty("--radix-popper-available-width",`${Oe}px`),ce.setProperty("--radix-popper-available-height",`${Ee}px`),ce.setProperty("--radix-popper-anchor-width",`${ot}px`),ce.setProperty("--radix-popper-anchor-height",`${J}px`)}}),C&&gw({element:C,padding:a}),Dw({arrowWidth:b,arrowHeight:T}),h&&mw({strategy:"referenceHidden",...G})]}),[I,A]=Wf(N),V=Ze(S);_e(()=>{k&&(V==null||V())},[k,V]);const W=($=P.arrow)==null?void 0:$.x,H=(q=P.arrow)==null?void 0:q.y,L=((X=P.arrow)==null?void 0:X.centerOffset)!==0,[Y,K]=D.useState();return _e(()=>{g&&K(window.getComputedStyle(g).zIndex)},[g]),x.jsx("div",{ref:j.setFloating,"data-radix-popper-content-wrapper":"",style:{...F,transform:k?F.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Y,"--radix-popper-transform-origin":[(U=P.transformOrigin)==null?void 0:U.x,(ne=P.transformOrigin)==null?void 0:ne.y].join(" "),...((B=P.hide)==null?void 0:B.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:x.jsx(ww,{scope:n,placedSide:I,onArrowChange:y,arrowX:W,arrowY:H,shouldHideArrow:L,children:x.jsx(ae.div,{"data-side":I,"data-align":A,...m,ref:v,style:{...m.style,animation:k?void 0:"none"}})})})});$f.displayName=wa;var Bf="PopperArrow",Cw={top:"bottom",right:"left",bottom:"top",left:"right"},zf=D.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,s=Sw(Bf,r),i=Cw[s.placedSide];return x.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[i]: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:x.jsx(yw,{...o,ref:n,style:{...o.style,display:"block"}})})});zf.displayName=Bf;function Tw(e){return e!==null}var Dw=e=>({name:"transformOrigin",options:e,fn(t){var w,g,p;const{placement:n,rects:r,middlewareData:o}=t,i=((w=o.arrow)==null?void 0:w.centerOffset)!==0,a=i?0:e.arrowWidth,c=i?0:e.arrowHeight,[l,u]=Wf(n),d={start:"0%",center:"50%",end:"100%"}[u],h=(((g=o.arrow)==null?void 0:g.x)??0)+a/2,f=(((p=o.arrow)==null?void 0:p.y)??0)+c/2;let S="",m="";return l==="bottom"?(S=i?d:`${h}px`,m=`${-c}px`):l==="top"?(S=i?d:`${h}px`,m=`${r.floating.height+c}px`):l==="right"?(S=`${-c}px`,m=i?d:`${f}px`):l==="left"&&(S=`${r.floating.width+c}px`,m=i?d:`${f}px`),{data:{x:S,y:m}}}});function Wf(e){const[t,n="center"]=e.split("-");return[t,n]}var es=Lf,Vr=Ff,ts=$f,ns=zf,Ew="Portal",Fr=D.forwardRef((e,t)=>{var a;const{container:n,...r}=e,[o,s]=D.useState(!1);_e(()=>s(!0),[]);const i=n||o&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return i?vt.createPortal(x.jsx(ae.div,{...r,ref:t}),i):null});Fr.displayName=Ew;function Mw(e,t){return D.useReducer((n,r)=>t[n][r]??n,e)}var Dt=e=>{const{present:t,children:n}=e,r=Rw(t),o=typeof n=="function"?n({present:r.isPresent}):D.Children.only(n),s=fe(r.ref,Pw(o));return typeof n=="function"||r.isPresent?D.cloneElement(o,{ref:s}):null};Dt.displayName="Presence";function Rw(e){const[t,n]=D.useState(),r=D.useRef({}),o=D.useRef(e),s=D.useRef("none"),i=e?"mounted":"unmounted",[a,c]=Mw(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return D.useEffect(()=>{const l=Qr(r.current);s.current=a==="mounted"?l:"none"},[a]),_e(()=>{const l=r.current,u=o.current;if(u!==e){const h=s.current,f=Qr(l);e?c("MOUNT"):f==="none"||(l==null?void 0:l.display)==="none"?c("UNMOUNT"):c(u&&h!==f?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,c]),_e(()=>{if(t){let l;const u=t.ownerDocument.defaultView??window,d=f=>{const m=Qr(r.current).includes(f.animationName);if(f.target===t&&m&&(c("ANIMATION_END"),!o.current)){const w=t.style.animationFillMode;t.style.animationFillMode="forwards",l=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=w)})}},h=f=>{f.target===t&&(s.current=Qr(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{u.clearTimeout(l),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:D.useCallback(l=>{l&&(r.current=getComputedStyle(l)),n(l)},[])}}function Qr(e){return(e==null?void 0:e.animationName)||"none"}function Pw(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function ln({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=Aw({defaultProp:t,onChange:n}),s=e!==void 0,i=s?e:r,a=Ze(n),c=D.useCallback(l=>{if(s){const d=typeof l=="function"?l(e):l;d!==e&&a(d)}else o(l)},[s,e,o,a]);return[i,c]}function Aw({defaultProp:e,onChange:t}){const n=D.useState(e),[r]=n,o=D.useRef(r),s=Ze(t);return D.useEffect(()=>{o.current!==r&&(s(r),o.current=r)},[r,o,s]),n}var Ow="VisuallyHidden",Sa=D.forwardRef((e,t)=>x.jsx(ae.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));Sa.displayName=Ow;var kw=Sa,[rs,kA]=Ht("Tooltip",[Ut]),os=Ut(),Hf="TooltipProvider",_w=700,Si="tooltip.open",[Nw,Ca]=rs(Hf),Uf=e=>{const{__scopeTooltip:t,delayDuration:n=_w,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:s}=e,i=D.useRef(!0),a=D.useRef(!1),c=D.useRef(0);return D.useEffect(()=>{const l=c.current;return()=>window.clearTimeout(l)},[]),x.jsx(Nw,{scope:t,isOpenDelayedRef:i,delayDuration:n,onOpen:D.useCallback(()=>{window.clearTimeout(c.current),i.current=!1},[]),onClose:D.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>i.current=!0,r)},[r]),isPointerInTransitRef:a,onPointerInTransitChange:D.useCallback(l=>{a.current=l},[]),disableHoverableContent:o,children:s})};Uf.displayName=Hf;var ss="Tooltip",[Iw,$r]=rs(ss),Yf=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o=!1,onOpenChange:s,disableHoverableContent:i,delayDuration:a}=e,c=Ca(ss,e.__scopeTooltip),l=os(t),[u,d]=D.useState(null),h=Vt(),f=D.useRef(0),S=i??c.disableHoverableContent,m=a??c.delayDuration,w=D.useRef(!1),[g=!1,p]=ln({prop:r,defaultProp:o,onChange:b=>{b?(c.onOpen(),document.dispatchEvent(new CustomEvent(Si))):c.onClose(),s==null||s(b)}}),v=D.useMemo(()=>g?w.current?"delayed-open":"instant-open":"closed",[g]),C=D.useCallback(()=>{window.clearTimeout(f.current),f.current=0,w.current=!1,p(!0)},[p]),y=D.useCallback(()=>{window.clearTimeout(f.current),f.current=0,p(!1)},[p]),M=D.useCallback(()=>{window.clearTimeout(f.current),f.current=window.setTimeout(()=>{w.current=!0,p(!0),f.current=0},m)},[m,p]);return D.useEffect(()=>()=>{f.current&&(window.clearTimeout(f.current),f.current=0)},[]),x.jsx(es,{...l,children:x.jsx(Iw,{scope:t,contentId:h,open:g,stateAttribute:v,trigger:u,onTriggerChange:d,onTriggerEnter:D.useCallback(()=>{c.isOpenDelayedRef.current?M():C()},[c.isOpenDelayedRef,M,C]),onTriggerLeave:D.useCallback(()=>{S?y():(window.clearTimeout(f.current),f.current=0)},[y,S]),onOpen:C,onClose:y,disableHoverableContent:S,children:n})})};Yf.displayName=ss;var Ci="TooltipTrigger",Kf=D.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=$r(Ci,n),s=Ca(Ci,n),i=os(n),a=D.useRef(null),c=fe(t,a,o.onTriggerChange),l=D.useRef(!1),u=D.useRef(!1),d=D.useCallback(()=>l.current=!1,[]);return D.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),x.jsx(Vr,{asChild:!0,...i,children:x.jsx(ae.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:c,onPointerMove:te(e.onPointerMove,h=>{h.pointerType!=="touch"&&!u.current&&!s.isPointerInTransitRef.current&&(o.onTriggerEnter(),u.current=!0)}),onPointerLeave:te(e.onPointerLeave,()=>{o.onTriggerLeave(),u.current=!1}),onPointerDown:te(e.onPointerDown,()=>{o.open&&o.onClose(),l.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:te(e.onFocus,()=>{l.current||o.onOpen()}),onBlur:te(e.onBlur,o.onClose),onClick:te(e.onClick,o.onClose)})})});Kf.displayName=Ci;var Ta="TooltipPortal",[jw,Lw]=rs(Ta,{forceMount:void 0}),Gf=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:o}=e,s=$r(Ta,t);return x.jsx(jw,{scope:t,forceMount:n,children:x.jsx(Dt,{present:n||s.open,children:x.jsx(Fr,{asChild:!0,container:o,children:r})})})};Gf.displayName=Ta;var kn="TooltipContent",qf=D.forwardRef((e,t)=>{const n=Lw(kn,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...s}=e,i=$r(kn,e.__scopeTooltip);return x.jsx(Dt,{present:r||i.open,children:i.disableHoverableContent?x.jsx(Xf,{side:o,...s,ref:t}):x.jsx(Vw,{side:o,...s,ref:t})})}),Vw=D.forwardRef((e,t)=>{const n=$r(kn,e.__scopeTooltip),r=Ca(kn,e.__scopeTooltip),o=D.useRef(null),s=fe(t,o),[i,a]=D.useState(null),{trigger:c,onClose:l}=n,u=o.current,{onPointerInTransitChange:d}=r,h=D.useCallback(()=>{a(null),d(!1)},[d]),f=D.useCallback((S,m)=>{const w=S.currentTarget,g={x:S.clientX,y:S.clientY},p=Ww(g,w.getBoundingClientRect()),v=Hw(g,p),C=Uw(m.getBoundingClientRect()),y=Kw([...v,...C]);a(y),d(!0)},[d]);return D.useEffect(()=>()=>h(),[h]),D.useEffect(()=>{if(c&&u){const S=w=>f(w,u),m=w=>f(w,c);return c.addEventListener("pointerleave",S),u.addEventListener("pointerleave",m),()=>{c.removeEventListener("pointerleave",S),u.removeEventListener("pointerleave",m)}}},[c,u,f,h]),D.useEffect(()=>{if(i){const S=m=>{const w=m.target,g={x:m.clientX,y:m.clientY},p=(c==null?void 0:c.contains(w))||(u==null?void 0:u.contains(w)),v=!Yw(g,i);p?h():v&&(h(),l())};return document.addEventListener("pointermove",S),()=>document.removeEventListener("pointermove",S)}},[c,u,i,l,h]),x.jsx(Xf,{...e,ref:s})}),[Fw,$w]=rs(ss,{isInside:!1}),Bw=rx("TooltipContent"),Xf=D.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:s,onPointerDownOutside:i,...a}=e,c=$r(kn,n),l=os(n),{onClose:u}=c;return D.useEffect(()=>(document.addEventListener(Si,u),()=>document.removeEventListener(Si,u)),[u]),D.useEffect(()=>{if(c.trigger){const d=h=>{const f=h.target;f!=null&&f.contains(c.trigger)&&u()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[c.trigger,u]),x.jsx(jr,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:d=>d.preventDefault(),onDismiss:u,children:x.jsxs(ts,{"data-state":c.stateAttribute,...l,...a,ref:t,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[x.jsx(Bw,{children:r}),x.jsx(Fw,{scope:n,isInside:!0,children:x.jsx(kw,{id:c.contentId,role:"tooltip",children:o||r})})]})})});qf.displayName=kn;var Zf="TooltipArrow",zw=D.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=os(n);return $w(Zf,n).isInside?null:x.jsx(ns,{...o,...r,ref:t})});zw.displayName=Zf;function Ww(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(n,r,o,s)){case s:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function Hw(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function Uw(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}function Yw(e,t){const{x:n,y:r}=e;let o=!1;for(let s=0,i=t.length-1;s<t.length;i=s++){const a=t[s].x,c=t[s].y,l=t[i].x,u=t[i].y;c>r!=u>r&&n<(l-a)*(r-c)/(u-c)+a&&(o=!o)}return o}function Kw(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),Gw(t)}function Gw(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const o=e[r];for(;t.length>=2;){const s=t[t.length-1],i=t[t.length-2];if((s.x-i.x)*(o.y-i.y)>=(s.y-i.y)*(o.x-i.x))t.pop();else break}t.push(o)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const o=e[r];for(;n.length>=2;){const s=n[n.length-1],i=n[n.length-2];if((s.x-i.x)*(o.y-i.y)>=(s.y-i.y)*(o.x-i.x))n.pop();else break}n.push(o)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var qw=Uf,Xw=Yf,Zw=Kf,Jw=Gf,Qw=qf;function Da({delayDuration:e=0,...t}){return x.jsx(qw,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function Jf({...e}){return x.jsx(Da,{children:x.jsx(Xw,{"data-slot":"tooltip",...e})})}function Qf({...e}){return x.jsx(Zw,{"data-slot":"tooltip-trigger",...e})}function eh({className:e,sideOffset:t=0,children:n,...r}){return x.jsx(Jw,{children:x.jsx(Qw,{"data-slot":"tooltip-content",sideOffset:t,className:de("bg-primary text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-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 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",e),...r,children:n})})}const Ea=({children:e,content:t})=>x.jsx(Da,{children:x.jsxs(Jf,{children:[x.jsx(Qf,{asChild:!0,children:e}),x.jsx(eh,{sideOffset:3,side:"bottom",className:"border border-input bg-popover px-2 py-1 text-xs text-muted-foreground",children:t})]})}),hl=e=>Symbol.iterator in e,pl=e=>"entries"in e,ml=(e,t)=>{const n=e instanceof Map?e:new Map(e.entries()),r=t instanceof Map?t:new Map(t.entries());if(n.size!==r.size)return!1;for(const[o,s]of n)if(!Object.is(s,r.get(o)))return!1;return!0},eS=(e,t)=>{const n=e[Symbol.iterator](),r=t[Symbol.iterator]();let o=n.next(),s=r.next();for(;!o.done&&!s.done;){if(!Object.is(o.value,s.value))return!1;o=n.next(),s=r.next()}return!!o.done&&!!s.done};function tS(e,t){return Object.is(e,t)?!0:typeof e!="object"||e===null||typeof t!="object"||t===null?!1:!hl(e)||!hl(t)?ml({entries:()=>Object.entries(e)},{entries:()=>Object.entries(t)}):pl(e)&&pl(t)?ml(e,t):eS(e,t)}function is(e){const t=E.useRef(void 0);return n=>{const r=e(n);return tS(t.current,r)?t.current:t.current=r}}function Ma(e){const t=e+"CollectionProvider",[n,r]=Ht(t),[o,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=m=>{const{scope:w,children:g}=m,p=E.useRef(null),v=E.useRef(new Map).current;return x.jsx(o,{scope:w,itemMap:v,collectionRef:p,children:g})};i.displayName=t;const a=e+"CollectionSlot",c=sn(a),l=E.forwardRef((m,w)=>{const{scope:g,children:p}=m,v=s(a,g),C=fe(w,v.collectionRef);return x.jsx(c,{ref:C,children:p})});l.displayName=a;const u=e+"CollectionItemSlot",d="data-radix-collection-item",h=sn(u),f=E.forwardRef((m,w)=>{const{scope:g,children:p,...v}=m,C=E.useRef(null),y=fe(w,C),M=s(u,g);return E.useEffect(()=>(M.itemMap.set(C,{ref:C,...v}),()=>void M.itemMap.delete(C))),x.jsx(h,{[d]:"",ref:y,children:p})});f.displayName=u;function S(m){const w=s(e+"CollectionConsumer",m);return E.useCallback(()=>{const p=w.collectionRef.current;if(!p)return[];const v=Array.from(p.querySelectorAll(`[${d}]`));return Array.from(w.itemMap.values()).sort((M,b)=>v.indexOf(M.ref.current)-v.indexOf(b.ref.current))},[w.collectionRef,w.itemMap])}return[{Provider:i,Slot:l,ItemSlot:f},S,r]}var nS=D.createContext(void 0);function Ra(e){const t=D.useContext(nS);return e||t||"ltr"}var Ns=0;function Pa(){D.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??gl()),document.body.insertAdjacentElement("beforeend",e[1]??gl()),Ns++,()=>{Ns===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Ns--}},[])}function gl(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Is="focusScope.autoFocusOnMount",js="focusScope.autoFocusOnUnmount",vl={bubbles:!1,cancelable:!0},rS="FocusScope",as=D.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:s,...i}=e,[a,c]=D.useState(null),l=Ze(o),u=Ze(s),d=D.useRef(null),h=fe(t,m=>c(m)),f=D.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;D.useEffect(()=>{if(r){let m=function(v){if(f.paused||!a)return;const C=v.target;a.contains(C)?d.current=C:_t(d.current,{select:!0})},w=function(v){if(f.paused||!a)return;const C=v.relatedTarget;C!==null&&(a.contains(C)||_t(d.current,{select:!0}))},g=function(v){if(document.activeElement===document.body)for(const y of v)y.removedNodes.length>0&&_t(a)};document.addEventListener("focusin",m),document.addEventListener("focusout",w);const p=new MutationObserver(g);return a&&p.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",w),p.disconnect()}}},[r,a,f.paused]),D.useEffect(()=>{if(a){bl.add(f);const m=document.activeElement;if(!a.contains(m)){const g=new CustomEvent(Is,vl);a.addEventListener(Is,l),a.dispatchEvent(g),g.defaultPrevented||(oS(lS(th(a)),{select:!0}),document.activeElement===m&&_t(a))}return()=>{a.removeEventListener(Is,l),setTimeout(()=>{const g=new CustomEvent(js,vl);a.addEventListener(js,u),a.dispatchEvent(g),g.defaultPrevented||_t(m??document.body,{select:!0}),a.removeEventListener(js,u),bl.remove(f)},0)}}},[a,l,u,f]);const S=D.useCallback(m=>{if(!n&&!r||f.paused)return;const w=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,g=document.activeElement;if(w&&g){const p=m.currentTarget,[v,C]=sS(p);v&&C?!m.shiftKey&&g===C?(m.preventDefault(),n&&_t(v,{select:!0})):m.shiftKey&&g===v&&(m.preventDefault(),n&&_t(C,{select:!0})):g===p&&m.preventDefault()}},[n,r,f.paused]);return x.jsx(ae.div,{tabIndex:-1,...i,ref:h,onKeyDown:S})});as.displayName=rS;function oS(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(_t(r,{select:t}),document.activeElement!==n)return}function sS(e){const t=th(e),n=yl(t,e),r=yl(t.reverse(),e);return[n,r]}function th(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function yl(e,t){for(const n of e)if(!iS(n,{upTo:t}))return n}function iS(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function aS(e){return e instanceof HTMLInputElement&&"select"in e}function _t(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&aS(e)&&t&&e.select()}}var bl=cS();function cS(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=xl(e,t),e.unshift(t)},remove(t){var n;e=xl(e,t),(n=e[0])==null||n.resume()}}}function xl(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function lS(e){return e.filter(t=>t.tagName!=="A")}var Ls="rovingFocusGroup.onEntryFocus",uS={bubbles:!1,cancelable:!0},cs="RovingFocusGroup",[Ti,nh,dS]=Ma(cs),[fS,rh]=Ht(cs,[dS]),[hS,pS]=fS(cs),oh=D.forwardRef((e,t)=>x.jsx(Ti.Provider,{scope:e.__scopeRovingFocusGroup,children:x.jsx(Ti.Slot,{scope:e.__scopeRovingFocusGroup,children:x.jsx(mS,{...e,ref:t})})}));oh.displayName=cs;var mS=D.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:s,currentTabStopId:i,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:u=!1,...d}=e,h=D.useRef(null),f=fe(t,h),S=Ra(s),[m=null,w]=ln({prop:i,defaultProp:a,onChange:c}),[g,p]=D.useState(!1),v=Ze(l),C=nh(n),y=D.useRef(!1),[M,b]=D.useState(0);return D.useEffect(()=>{const T=h.current;if(T)return T.addEventListener(Ls,v),()=>T.removeEventListener(Ls,v)},[v]),x.jsx(hS,{scope:n,orientation:r,dir:S,loop:o,currentTabStopId:m,onItemFocus:D.useCallback(T=>w(T),[w]),onItemShiftTab:D.useCallback(()=>p(!0),[]),onFocusableItemAdd:D.useCallback(()=>b(T=>T+1),[]),onFocusableItemRemove:D.useCallback(()=>b(T=>T-1),[]),children:x.jsx(ae.div,{tabIndex:g||M===0?-1:0,"data-orientation":r,...d,ref:f,style:{outline:"none",...e.style},onMouseDown:te(e.onMouseDown,()=>{y.current=!0}),onFocus:te(e.onFocus,T=>{const R=!y.current;if(T.target===T.currentTarget&&R&&!g){const _=new CustomEvent(Ls,uS);if(T.currentTarget.dispatchEvent(_),!_.defaultPrevented){const O=C().filter(N=>N.focusable),z=O.find(N=>N.active),G=O.find(N=>N.id===m),F=[z,G,...O].filter(Boolean).map(N=>N.ref.current);ah(F,u)}}y.current=!1}),onBlur:te(e.onBlur,()=>p(!1))})})}),sh="RovingFocusGroupItem",ih=D.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:s,...i}=e,a=Vt(),c=s||a,l=pS(sh,n),u=l.currentTabStopId===c,d=nh(n),{onFocusableItemAdd:h,onFocusableItemRemove:f}=l;return D.useEffect(()=>{if(r)return h(),()=>f()},[r,h,f]),x.jsx(Ti.ItemSlot,{scope:n,id:c,focusable:r,active:o,children:x.jsx(ae.span,{tabIndex:u?0:-1,"data-orientation":l.orientation,...i,ref:t,onMouseDown:te(e.onMouseDown,S=>{r?l.onItemFocus(c):S.preventDefault()}),onFocus:te(e.onFocus,()=>l.onItemFocus(c)),onKeyDown:te(e.onKeyDown,S=>{if(S.key==="Tab"&&S.shiftKey){l.onItemShiftTab();return}if(S.target!==S.currentTarget)return;const m=yS(S,l.orientation,l.dir);if(m!==void 0){if(S.metaKey||S.ctrlKey||S.altKey||S.shiftKey)return;S.preventDefault();let g=d().filter(p=>p.focusable).map(p=>p.ref.current);if(m==="last")g.reverse();else if(m==="prev"||m==="next"){m==="prev"&&g.reverse();const p=g.indexOf(S.currentTarget);g=l.loop?bS(g,p+1):g.slice(p+1)}setTimeout(()=>ah(g))}})})})});ih.displayName=sh;var gS={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function vS(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function yS(e,t,n){const r=vS(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return gS[r]}function ah(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function bS(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var xS=oh,wS=ih,SS=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},yn=new WeakMap,eo=new WeakMap,to={},Vs=0,ch=function(e){return e&&(e.host||ch(e.parentNode))},CS=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=ch(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},TS=function(e,t,n,r){var o=CS(t,Array.isArray(e)?e:[e]);to[n]||(to[n]=new WeakMap);var s=to[n],i=[],a=new Set,c=new Set(o),l=function(d){!d||a.has(d)||(a.add(d),l(d.parentNode))};o.forEach(l);var u=function(d){!d||c.has(d)||Array.prototype.forEach.call(d.children,function(h){if(a.has(h))u(h);else try{var f=h.getAttribute(r),S=f!==null&&f!=="false",m=(yn.get(h)||0)+1,w=(s.get(h)||0)+1;yn.set(h,m),s.set(h,w),i.push(h),m===1&&S&&eo.set(h,!0),w===1&&h.setAttribute(n,"true"),S||h.setAttribute(r,"true")}catch(g){console.error("aria-hidden: cannot operate on ",h,g)}})};return u(t),a.clear(),Vs++,function(){i.forEach(function(d){var h=yn.get(d)-1,f=s.get(d)-1;yn.set(d,h),s.set(d,f),h||(eo.has(d)||d.removeAttribute(r),eo.delete(d)),f||d.removeAttribute(n)}),Vs--,Vs||(yn=new WeakMap,yn=new WeakMap,eo=new WeakMap,to={})}},Aa=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=SS(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),TS(r,o,n,"aria-hidden")):function(){return null}},ct=function(){return ct=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},ct.apply(this,arguments)};function lh(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function DS(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,s;r<o;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||Array.prototype.slice.call(t))}var vo="right-scroll-bar-position",yo="width-before-scroll-bar",ES="with-scroll-bars-hidden",MS="--removed-body-scroll-bar-size";function Fs(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function RS(e,t){var n=E.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var PS=typeof window<"u"?D.useLayoutEffect:D.useEffect,wl=new WeakMap;function AS(e,t){var n=RS(null,function(r){return e.forEach(function(o){return Fs(o,r)})});return PS(function(){var r=wl.get(n);if(r){var o=new Set(r),s=new Set(e),i=n.current;o.forEach(function(a){s.has(a)||Fs(a,null)}),s.forEach(function(a){o.has(a)||Fs(a,i)})}wl.set(n,e)},[e]),n}function OS(e){return e}function kS(e,t){t===void 0&&(t=OS);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(s){var i=t(s,r);return n.push(i),function(){n=n.filter(function(a){return a!==i})}},assignSyncMedium:function(s){for(r=!0;n.length;){var i=n;n=[],i.forEach(s)}n={push:function(a){return s(a)},filter:function(){return n}}},assignMedium:function(s){r=!0;var i=[];if(n.length){var a=n;n=[],a.forEach(s),i=n}var c=function(){var u=i;i=[],u.forEach(s)},l=function(){return Promise.resolve().then(c)};l(),n={push:function(u){i.push(u),l()},filter:function(u){return i=i.filter(u),n}}}};return o}function _S(e){e===void 0&&(e={});var t=kS(null);return t.options=ct({async:!0,ssr:!1},e),t}var uh=function(e){var t=e.sideCar,n=lh(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return D.createElement(r,ct({},n))};uh.isSideCarExport=!0;function NS(e,t){return e.useMedium(t),uh}var dh=_S(),$s=function(){},ls=D.forwardRef(function(e,t){var n=D.useRef(null),r=D.useState({onScrollCapture:$s,onWheelCapture:$s,onTouchMoveCapture:$s}),o=r[0],s=r[1],i=e.forwardProps,a=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,h=e.sideCar,f=e.noIsolation,S=e.inert,m=e.allowPinchZoom,w=e.as,g=w===void 0?"div":w,p=e.gapMode,v=lh(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),C=h,y=AS([n,t]),M=ct(ct({},v),o);return D.createElement(D.Fragment,null,u&&D.createElement(C,{sideCar:dh,removeScrollBar:l,shards:d,noIsolation:f,inert:S,setCallbacks:s,allowPinchZoom:!!m,lockRef:n,gapMode:p}),i?D.cloneElement(D.Children.only(a),ct(ct({},M),{ref:y})):D.createElement(g,ct({},M,{className:c,ref:y}),a))});ls.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};ls.classNames={fullWidth:yo,zeroRight:vo};var IS=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function jS(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=IS();return t&&e.setAttribute("nonce",t),e}function LS(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function VS(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var FS=function(){var e=0,t=null;return{add:function(n){e==0&&(t=jS())&&(LS(t,n),VS(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},$S=function(){var e=FS();return function(t,n){D.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},fh=function(){var e=$S(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},BS={left:0,top:0,right:0,gap:0},Bs=function(e){return parseInt(e||"",10)||0},zS=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[Bs(n),Bs(r),Bs(o)]},WS=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return BS;var t=zS(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},HS=fh(),An="data-scroll-locked",US=function(e,t,n,r){var o=e.left,s=e.top,i=e.right,a=e.gap;return n===void 0&&(n="margin"),`
110
+ .`.concat(ES,` {
111
111
  overflow: hidden `).concat(r,`;
112
112
  padding-right: `).concat(a,"px ").concat(r,`;
113
113
  }
@@ -124,47 +124,47 @@
124
124
  `),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),`
125
125
  }
126
126
 
127
- .`).concat(yo,` {
127
+ .`).concat(vo,` {
128
128
  right: `).concat(a,"px ").concat(r,`;
129
129
  }
130
130
 
131
- .`).concat(bo,` {
131
+ .`).concat(yo,` {
132
132
  margin-right: `).concat(a,"px ").concat(r,`;
133
133
  }
134
134
 
135
- .`).concat(yo," .").concat(yo,` {
135
+ .`).concat(vo," .").concat(vo,` {
136
136
  right: 0 `).concat(r,`;
137
137
  }
138
138
 
139
- .`).concat(bo," .").concat(bo,` {
139
+ .`).concat(yo," .").concat(yo,` {
140
140
  margin-right: 0 `).concat(r,`;
141
141
  }
142
142
 
143
143
  body[`).concat(An,`] {
144
- `).concat(xS,": ").concat(a,`px;
144
+ `).concat(MS,": ").concat(a,`px;
145
145
  }
146
- `)},Sl=function(){var e=parseInt(document.body.getAttribute(An)||"0",10);return isFinite(e)?e:0},FS=function(){D.useEffect(function(){return document.body.setAttribute(An,(Sl()+1).toString()),function(){var e=Sl()-1;e<=0?document.body.removeAttribute(An):document.body.setAttribute(An,e.toString())}},[])},$S=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;FS();var s=D.useMemo(function(){return jS(o)},[o]);return D.createElement(LS,{styles:VS(s,!t,o,n?"":"!important")})},Di=!1;if(typeof window<"u")try{var ro=Object.defineProperty({},"passive",{get:function(){return Di=!0,!0}});window.addEventListener("test",ro,ro),window.removeEventListener("test",ro,ro)}catch{Di=!1}var bn=Di?{passive:!1}:!1,BS=function(e){return e.tagName==="TEXTAREA"},dh=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!BS(e)&&n[t]==="visible")},zS=function(e){return dh(e,"overflowY")},WS=function(e){return dh(e,"overflowX")},Cl=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=fh(e,r);if(o){var s=hh(e,r),i=s[1],a=s[2];if(i>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},HS=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},US=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},fh=function(e,t){return e==="v"?zS(t):WS(t)},hh=function(e,t){return e==="v"?HS(t):US(t)},YS=function(e,t){return e==="h"&&t==="rtl"?-1:1},KS=function(e,t,n,r,o){var s=YS(e,window.getComputedStyle(t).direction),i=s*r,a=n.target,c=t.contains(a),l=!1,u=i>0,d=0,f=0;do{var h=hh(e,a),S=h[0],p=h[1],b=h[2],v=p-b-s*S;(S||v)&&fh(e,a)&&(d+=v,f+=S),a instanceof ShadowRoot?a=a.host:a=a.parentNode}while(!c&&a!==document.body||c&&(t.contains(a)||t===a));return(u&&Math.abs(d)<1||!u&&Math.abs(f)<1)&&(l=!0),l},oo=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Tl=function(e){return[e.deltaX,e.deltaY]},Dl=function(e){return e&&"current"in e?e.current:e},GS=function(e,t){return e[0]===t[0]&&e[1]===t[1]},qS=function(e){return`
146
+ `)},Sl=function(){var e=parseInt(document.body.getAttribute(An)||"0",10);return isFinite(e)?e:0},YS=function(){D.useEffect(function(){return document.body.setAttribute(An,(Sl()+1).toString()),function(){var e=Sl()-1;e<=0?document.body.removeAttribute(An):document.body.setAttribute(An,e.toString())}},[])},KS=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;YS();var s=D.useMemo(function(){return WS(o)},[o]);return D.createElement(HS,{styles:US(s,!t,o,n?"":"!important")})},Di=!1;if(typeof window<"u")try{var no=Object.defineProperty({},"passive",{get:function(){return Di=!0,!0}});window.addEventListener("test",no,no),window.removeEventListener("test",no,no)}catch{Di=!1}var bn=Di?{passive:!1}:!1,GS=function(e){return e.tagName==="TEXTAREA"},hh=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!GS(e)&&n[t]==="visible")},qS=function(e){return hh(e,"overflowY")},XS=function(e){return hh(e,"overflowX")},Cl=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=ph(e,r);if(o){var s=mh(e,r),i=s[1],a=s[2];if(i>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},ZS=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},JS=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},ph=function(e,t){return e==="v"?qS(t):XS(t)},mh=function(e,t){return e==="v"?ZS(t):JS(t)},QS=function(e,t){return e==="h"&&t==="rtl"?-1:1},e0=function(e,t,n,r,o){var s=QS(e,window.getComputedStyle(t).direction),i=s*r,a=n.target,c=t.contains(a),l=!1,u=i>0,d=0,h=0;do{var f=mh(e,a),S=f[0],m=f[1],w=f[2],g=m-w-s*S;(S||g)&&ph(e,a)&&(d+=g,h+=S),a instanceof ShadowRoot?a=a.host:a=a.parentNode}while(!c&&a!==document.body||c&&(t.contains(a)||t===a));return(u&&Math.abs(d)<1||!u&&Math.abs(h)<1)&&(l=!0),l},ro=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Tl=function(e){return[e.deltaX,e.deltaY]},Dl=function(e){return e&&"current"in e?e.current:e},t0=function(e,t){return e[0]===t[0]&&e[1]===t[1]},n0=function(e){return`
147
147
  .block-interactivity-`.concat(e,` {pointer-events: none;}
148
148
  .allow-interactivity-`).concat(e,` {pointer-events: all;}
149
- `)},XS=0,xn=[];function ZS(e){var t=D.useRef([]),n=D.useRef([0,0]),r=D.useRef(),o=D.useState(XS++)[0],s=D.useState(uh)[0],i=D.useRef(e);D.useEffect(function(){i.current=e},[e]),D.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var p=yS([e.lockRef.current],(e.shards||[]).map(Dl),!0).filter(Boolean);return p.forEach(function(b){return b.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),p.forEach(function(b){return b.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=D.useCallback(function(p,b){if("touches"in p&&p.touches.length===2||p.type==="wheel"&&p.ctrlKey)return!i.current.allowPinchZoom;var v=oo(p),m=n.current,g="deltaX"in p?p.deltaX:m[0]-v[0],C="deltaY"in p?p.deltaY:m[1]-v[1],y,M=p.target,x=Math.abs(g)>Math.abs(C)?"h":"v";if("touches"in p&&x==="h"&&M.type==="range")return!1;var T=Cl(x,M);if(!T)return!0;if(T?y=x:(y=x==="v"?"h":"v",T=Cl(x,M)),!T)return!1;if(!r.current&&"changedTouches"in p&&(g||C)&&(r.current=y),!y)return!0;var R=r.current||y;return KS(R,b,p,R==="h"?g:C)},[]),c=D.useCallback(function(p){var b=p;if(!(!xn.length||xn[xn.length-1]!==s)){var v="deltaY"in b?Tl(b):oo(b),m=t.current.filter(function(y){return y.name===b.type&&(y.target===b.target||b.target===y.shadowParent)&&GS(y.delta,v)})[0];if(m&&m.should){b.cancelable&&b.preventDefault();return}if(!m){var g=(i.current.shards||[]).map(Dl).filter(Boolean).filter(function(y){return y.contains(b.target)}),C=g.length>0?a(b,g[0]):!i.current.noIsolation;C&&b.cancelable&&b.preventDefault()}}},[]),l=D.useCallback(function(p,b,v,m){var g={name:p,delta:b,target:v,should:m,shadowParent:JS(v)};t.current.push(g),setTimeout(function(){t.current=t.current.filter(function(C){return C!==g})},1)},[]),u=D.useCallback(function(p){n.current=oo(p),r.current=void 0},[]),d=D.useCallback(function(p){l(p.type,Tl(p),p.target,a(p,e.lockRef.current))},[]),f=D.useCallback(function(p){l(p.type,oo(p),p.target,a(p,e.lockRef.current))},[]);D.useEffect(function(){return xn.push(s),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener("wheel",c,bn),document.addEventListener("touchmove",c,bn),document.addEventListener("touchstart",u,bn),function(){xn=xn.filter(function(p){return p!==s}),document.removeEventListener("wheel",c,bn),document.removeEventListener("touchmove",c,bn),document.removeEventListener("touchstart",u,bn)}},[]);var h=e.removeScrollBar,S=e.inert;return D.createElement(D.Fragment,null,S?D.createElement(s,{styles:qS(o)}):null,h?D.createElement($S,{gapMode:e.gapMode}):null)}function JS(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const QS=MS(lh,ZS);var us=D.forwardRef(function(e,t){return D.createElement(ls,ct({},e,{ref:t,sideCar:QS}))});us.classNames=ls.classNames;var Ei=["Enter"," "],e0=["ArrowDown","PageUp","Home"],ph=["ArrowUp","PageDown","End"],t0=[...e0,...ph],n0={ltr:[...Ei,"ArrowRight"],rtl:[...Ei,"ArrowLeft"]},r0={ltr:["ArrowLeft"],rtl:["ArrowRight"]},zr="Menu",[wr,o0,s0]=Ma(zr),[dn,mh]=Ht(zr,[s0,Ut,th]),ds=Ut(),gh=th(),[i0,fn]=dn(zr),[a0,Wr]=dn(zr),vh=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:s,modal:i=!0}=e,a=ds(t),[c,l]=D.useState(null),u=D.useRef(!1),d=Ze(s),f=Ra(o);return D.useEffect(()=>{const h=()=>{u.current=!0,document.addEventListener("pointerdown",S,{capture:!0,once:!0}),document.addEventListener("pointermove",S,{capture:!0,once:!0})},S=()=>u.current=!1;return document.addEventListener("keydown",h,{capture:!0}),()=>{document.removeEventListener("keydown",h,{capture:!0}),document.removeEventListener("pointerdown",S,{capture:!0}),document.removeEventListener("pointermove",S,{capture:!0})}},[]),w.jsx(ts,{...a,children:w.jsx(i0,{scope:t,open:n,onOpenChange:d,content:c,onContentChange:l,children:w.jsx(a0,{scope:t,onClose:D.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:f,modal:i,children:r})})})};vh.displayName=zr;var c0="MenuAnchor",Oa=D.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=ds(n);return w.jsx(Vr,{...o,...r,ref:t})});Oa.displayName=c0;var ka="MenuPortal",[l0,yh]=dn(ka,{forceMount:void 0}),bh=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,s=fn(ka,t);return w.jsx(l0,{scope:t,forceMount:n,children:w.jsx(Dt,{present:n||s.open,children:w.jsx(Fr,{asChild:!0,container:o,children:r})})})};bh.displayName=ka;var qe="MenuContent",[u0,_a]=dn(qe),xh=D.forwardRef((e,t)=>{const n=yh(qe,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,s=fn(qe,e.__scopeMenu),i=Wr(qe,e.__scopeMenu);return w.jsx(wr.Provider,{scope:e.__scopeMenu,children:w.jsx(Dt,{present:r||s.open,children:w.jsx(wr.Slot,{scope:e.__scopeMenu,children:i.modal?w.jsx(d0,{...o,ref:t}):w.jsx(f0,{...o,ref:t})})})})}),d0=D.forwardRef((e,t)=>{const n=fn(qe,e.__scopeMenu),r=D.useRef(null),o=fe(t,r);return D.useEffect(()=>{const s=r.current;if(s)return Aa(s)},[]),w.jsx(Na,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:te(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),f0=D.forwardRef((e,t)=>{const n=fn(qe,e.__scopeMenu);return w.jsx(Na,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),h0=sn("MenuContent.ScrollLock"),Na=D.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:s,onCloseAutoFocus:i,disableOutsidePointerEvents:a,onEntryFocus:c,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:h,disableOutsideScroll:S,...p}=e,b=fn(qe,n),v=Wr(qe,n),m=ds(n),g=gh(n),C=o0(n),[y,M]=D.useState(null),x=D.useRef(null),T=fe(t,x,b.onContentChange),R=D.useRef(0),_=D.useRef(""),O=D.useRef(0),z=D.useRef(null),G=D.useRef("right"),j=D.useRef(0),F=S?us:D.Fragment,N=S?{as:h0,allowPinchZoom:!0}:void 0,k=I=>{var $,q;const A=_.current+I,V=C().filter(X=>!X.disabled),W=document.activeElement,H=($=V.find(X=>X.ref.current===W))==null?void 0:$.textValue,L=V.map(X=>X.textValue),Y=D0(L,A,H),K=(q=V.find(X=>X.textValue===Y))==null?void 0:q.ref.current;(function X(U){_.current=U,window.clearTimeout(R.current),U!==""&&(R.current=window.setTimeout(()=>X(""),1e3))})(A),K&&setTimeout(()=>K.focus())};D.useEffect(()=>()=>window.clearTimeout(R.current),[]),Pa();const P=D.useCallback(I=>{var V,W;return G.current===((V=z.current)==null?void 0:V.side)&&M0(I,(W=z.current)==null?void 0:W.area)},[]);return w.jsx(u0,{scope:n,searchRef:_,onItemEnter:D.useCallback(I=>{P(I)&&I.preventDefault()},[P]),onItemLeave:D.useCallback(I=>{var A;P(I)||((A=x.current)==null||A.focus(),M(null))},[P]),onTriggerLeave:D.useCallback(I=>{P(I)&&I.preventDefault()},[P]),pointerGraceTimerRef:O,onPointerGraceIntentChange:D.useCallback(I=>{z.current=I},[]),children:w.jsx(F,{...N,children:w.jsx(as,{asChild:!0,trapped:o,onMountAutoFocus:te(s,I=>{var A;I.preventDefault(),(A=x.current)==null||A.focus({preventScroll:!0})}),onUnmountAutoFocus:i,children:w.jsx(jr,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:h,children:w.jsx(hS,{asChild:!0,...g,dir:v.dir,orientation:"vertical",loop:r,currentTabStopId:y,onCurrentTabStopIdChange:M,onEntryFocus:te(c,I=>{v.isUsingKeyboardRef.current||I.preventDefault()}),preventScrollOnEntryFocus:!0,children:w.jsx(ns,{role:"menu","aria-orientation":"vertical","data-state":jh(b.open),"data-radix-menu-content":"",dir:v.dir,...m,...p,ref:T,style:{outline:"none",...p.style},onKeyDown:te(p.onKeyDown,I=>{const V=I.target.closest("[data-radix-menu-content]")===I.currentTarget,W=I.ctrlKey||I.altKey||I.metaKey,H=I.key.length===1;V&&(I.key==="Tab"&&I.preventDefault(),!W&&H&&k(I.key));const L=x.current;if(I.target!==L||!t0.includes(I.key))return;I.preventDefault();const K=C().filter($=>!$.disabled).map($=>$.ref.current);ph.includes(I.key)&&K.reverse(),C0(K)}),onBlur:te(e.onBlur,I=>{I.currentTarget.contains(I.target)||(window.clearTimeout(R.current),_.current="")}),onPointerMove:te(e.onPointerMove,Sr(I=>{const A=I.target,V=j.current!==I.clientX;if(I.currentTarget.contains(A)&&V){const W=I.clientX>j.current?"right":"left";G.current=W,j.current=I.clientX}}))})})})})})})});xh.displayName=qe;var p0="MenuGroup",Ia=D.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return w.jsx(ae.div,{role:"group",...r,ref:t})});Ia.displayName=p0;var m0="MenuLabel",wh=D.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return w.jsx(ae.div,{...r,ref:t})});wh.displayName=m0;var Io="MenuItem",El="menu.itemSelect",fs=D.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,s=D.useRef(null),i=Wr(Io,e.__scopeMenu),a=_a(Io,e.__scopeMenu),c=fe(t,s),l=D.useRef(!1),u=()=>{const d=s.current;if(!n&&d){const f=new CustomEvent(El,{bubbles:!0,cancelable:!0});d.addEventListener(El,h=>r==null?void 0:r(h),{once:!0}),bf(d,f),f.defaultPrevented?l.current=!1:i.onClose()}};return w.jsx(Sh,{...o,ref:c,disabled:n,onClick:te(e.onClick,u),onPointerDown:d=>{var f;(f=e.onPointerDown)==null||f.call(e,d),l.current=!0},onPointerUp:te(e.onPointerUp,d=>{var f;l.current||(f=d.currentTarget)==null||f.click()}),onKeyDown:te(e.onKeyDown,d=>{const f=a.searchRef.current!=="";n||f&&d.key===" "||Ei.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})})});fs.displayName=Io;var Sh=D.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...s}=e,i=_a(Io,n),a=gh(n),c=D.useRef(null),l=fe(t,c),[u,d]=D.useState(!1),[f,h]=D.useState("");return D.useEffect(()=>{const S=c.current;S&&h((S.textContent??"").trim())},[s.children]),w.jsx(wr.ItemSlot,{scope:n,disabled:r,textValue:o??f,children:w.jsx(pS,{asChild:!0,...a,focusable:!r,children:w.jsx(ae.div,{role:"menuitem","data-highlighted":u?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...s,ref:l,onPointerMove:te(e.onPointerMove,Sr(S=>{r?i.onItemLeave(S):(i.onItemEnter(S),S.defaultPrevented||S.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:te(e.onPointerLeave,Sr(S=>i.onItemLeave(S))),onFocus:te(e.onFocus,()=>d(!0)),onBlur:te(e.onBlur,()=>d(!1))})})})}),g0="MenuCheckboxItem",Ch=D.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...o}=e;return w.jsx(Rh,{scope:e.__scopeMenu,checked:n,children:w.jsx(fs,{role:"menuitemcheckbox","aria-checked":jo(n)?"mixed":n,...o,ref:t,"data-state":La(n),onSelect:te(o.onSelect,()=>r==null?void 0:r(jo(n)?!0:!n),{checkForDefaultPrevented:!1})})})});Ch.displayName=g0;var Th="MenuRadioGroup",[v0,y0]=dn(Th,{value:void 0,onValueChange:()=>{}}),Dh=D.forwardRef((e,t)=>{const{value:n,onValueChange:r,...o}=e,s=Ze(r);return w.jsx(v0,{scope:e.__scopeMenu,value:n,onValueChange:s,children:w.jsx(Ia,{...o,ref:t})})});Dh.displayName=Th;var Eh="MenuRadioItem",Mh=D.forwardRef((e,t)=>{const{value:n,...r}=e,o=y0(Eh,e.__scopeMenu),s=n===o.value;return w.jsx(Rh,{scope:e.__scopeMenu,checked:s,children:w.jsx(fs,{role:"menuitemradio","aria-checked":s,...r,ref:t,"data-state":La(s),onSelect:te(r.onSelect,()=>{var i;return(i=o.onValueChange)==null?void 0:i.call(o,n)},{checkForDefaultPrevented:!1})})})});Mh.displayName=Eh;var ja="MenuItemIndicator",[Rh,b0]=dn(ja,{checked:!1}),Ph=D.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...o}=e,s=b0(ja,n);return w.jsx(Dt,{present:r||jo(s.checked)||s.checked===!0,children:w.jsx(ae.span,{...o,ref:t,"data-state":La(s.checked)})})});Ph.displayName=ja;var x0="MenuSeparator",Ah=D.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return w.jsx(ae.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});Ah.displayName=x0;var w0="MenuArrow",Oh=D.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=ds(n);return w.jsx(rs,{...o,...r,ref:t})});Oh.displayName=w0;var S0="MenuSub",[NA,kh]=dn(S0),ir="MenuSubTrigger",_h=D.forwardRef((e,t)=>{const n=fn(ir,e.__scopeMenu),r=Wr(ir,e.__scopeMenu),o=kh(ir,e.__scopeMenu),s=_a(ir,e.__scopeMenu),i=D.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:c}=s,l={__scopeMenu:e.__scopeMenu},u=D.useCallback(()=>{i.current&&window.clearTimeout(i.current),i.current=null},[]);return D.useEffect(()=>u,[u]),D.useEffect(()=>{const d=a.current;return()=>{window.clearTimeout(d),c(null)}},[a,c]),w.jsx(Oa,{asChild:!0,...l,children:w.jsx(Sh,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":jh(n.open),...e,ref:Zo(t,o.onTriggerChange),onClick:d=>{var f;(f=e.onClick)==null||f.call(e,d),!(e.disabled||d.defaultPrevented)&&(d.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:te(e.onPointerMove,Sr(d=>{s.onItemEnter(d),!d.defaultPrevented&&!e.disabled&&!n.open&&!i.current&&(s.onPointerGraceIntentChange(null),i.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:te(e.onPointerLeave,Sr(d=>{var h,S;u();const f=(h=n.content)==null?void 0:h.getBoundingClientRect();if(f){const p=(S=n.content)==null?void 0:S.dataset.side,b=p==="right",v=b?-5:5,m=f[b?"left":"right"],g=f[b?"right":"left"];s.onPointerGraceIntentChange({area:[{x:d.clientX+v,y:d.clientY},{x:m,y:f.top},{x:g,y:f.top},{x:g,y:f.bottom},{x:m,y:f.bottom}],side:p}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(d),d.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:te(e.onKeyDown,d=>{var h;const f=s.searchRef.current!=="";e.disabled||f&&d.key===" "||n0[r.dir].includes(d.key)&&(n.onOpenChange(!0),(h=n.content)==null||h.focus(),d.preventDefault())})})})});_h.displayName=ir;var Nh="MenuSubContent",Ih=D.forwardRef((e,t)=>{const n=yh(qe,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,s=fn(qe,e.__scopeMenu),i=Wr(qe,e.__scopeMenu),a=kh(Nh,e.__scopeMenu),c=D.useRef(null),l=fe(t,c);return w.jsx(wr.Provider,{scope:e.__scopeMenu,children:w.jsx(Dt,{present:r||s.open,children:w.jsx(wr.Slot,{scope:e.__scopeMenu,children:w.jsx(Na,{id:a.contentId,"aria-labelledby":a.triggerId,...o,ref:l,align:"start",side:i.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:u=>{var d;i.isUsingKeyboardRef.current&&((d=c.current)==null||d.focus()),u.preventDefault()},onCloseAutoFocus:u=>u.preventDefault(),onFocusOutside:te(e.onFocusOutside,u=>{u.target!==a.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:te(e.onEscapeKeyDown,u=>{i.onClose(),u.preventDefault()}),onKeyDown:te(e.onKeyDown,u=>{var h;const d=u.currentTarget.contains(u.target),f=r0[i.dir].includes(u.key);d&&f&&(s.onOpenChange(!1),(h=a.trigger)==null||h.focus(),u.preventDefault())})})})})})});Ih.displayName=Nh;function jh(e){return e?"open":"closed"}function jo(e){return e==="indeterminate"}function La(e){return jo(e)?"indeterminate":e?"checked":"unchecked"}function C0(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function T0(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function D0(e,t,n){const o=t.length>1&&Array.from(t).every(l=>l===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let i=T0(e,Math.max(s,0));o.length===1&&(i=i.filter(l=>l!==n));const c=i.find(l=>l.toLowerCase().startsWith(o.toLowerCase()));return c!==n?c:void 0}function E0(e,t){const{x:n,y:r}=e;let o=!1;for(let s=0,i=t.length-1;s<t.length;i=s++){const a=t[s].x,c=t[s].y,l=t[i].x,u=t[i].y;c>r!=u>r&&n<(l-a)*(r-c)/(u-c)+a&&(o=!o)}return o}function M0(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return E0(n,t)}function Sr(e){return t=>t.pointerType==="mouse"?e(t):void 0}var R0=vh,P0=Oa,A0=bh,O0=xh,k0=Ia,_0=wh,N0=fs,I0=Ch,j0=Dh,L0=Mh,V0=Ph,F0=Ah,$0=Oh,B0=_h,z0=Ih,Va="DropdownMenu",[W0,IA]=Ht(Va,[mh]),je=mh(),[H0,Lh]=W0(Va),Vh=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:o,defaultOpen:s,onOpenChange:i,modal:a=!0}=e,c=je(t),l=D.useRef(null),[u=!1,d]=ln({prop:o,defaultProp:s,onChange:i});return w.jsx(H0,{scope:t,triggerId:Vt(),triggerRef:l,contentId:Vt(),open:u,onOpenChange:d,onOpenToggle:D.useCallback(()=>d(f=>!f),[d]),modal:a,children:w.jsx(R0,{...c,open:u,onOpenChange:d,dir:r,modal:a,children:n})})};Vh.displayName=Va;var Fh="DropdownMenuTrigger",$h=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=e,s=Lh(Fh,n),i=je(n);return w.jsx(P0,{asChild:!0,...i,children:w.jsx(ae.button,{type:"button",id:s.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":s.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...o,ref:Zo(t,s.triggerRef),onPointerDown:te(e.onPointerDown,a=>{!r&&a.button===0&&a.ctrlKey===!1&&(s.onOpenToggle(),s.open||a.preventDefault())}),onKeyDown:te(e.onKeyDown,a=>{r||(["Enter"," "].includes(a.key)&&s.onOpenToggle(),a.key==="ArrowDown"&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});$h.displayName=Fh;var U0="DropdownMenuPortal",Bh=e=>{const{__scopeDropdownMenu:t,...n}=e,r=je(t);return w.jsx(A0,{...r,...n})};Bh.displayName=U0;var zh="DropdownMenuContent",Wh=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Lh(zh,n),s=je(n),i=D.useRef(!1);return w.jsx(O0,{id:o.contentId,"aria-labelledby":o.triggerId,...s,...r,ref:t,onCloseAutoFocus:te(e.onCloseAutoFocus,a=>{var c;i.current||(c=o.triggerRef.current)==null||c.focus(),i.current=!1,a.preventDefault()}),onInteractOutside:te(e.onInteractOutside,a=>{const c=a.detail.originalEvent,l=c.button===0&&c.ctrlKey===!0,u=c.button===2||l;(!o.modal||u)&&(i.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Wh.displayName=zh;var Y0="DropdownMenuGroup",K0=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=je(n);return w.jsx(k0,{...o,...r,ref:t})});K0.displayName=Y0;var G0="DropdownMenuLabel",Hh=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=je(n);return w.jsx(_0,{...o,...r,ref:t})});Hh.displayName=G0;var q0="DropdownMenuItem",Uh=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=je(n);return w.jsx(N0,{...o,...r,ref:t})});Uh.displayName=q0;var X0="DropdownMenuCheckboxItem",Yh=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=je(n);return w.jsx(I0,{...o,...r,ref:t})});Yh.displayName=X0;var Z0="DropdownMenuRadioGroup",J0=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=je(n);return w.jsx(j0,{...o,...r,ref:t})});J0.displayName=Z0;var Q0="DropdownMenuRadioItem",eC=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=je(n);return w.jsx(L0,{...o,...r,ref:t})});eC.displayName=Q0;var tC="DropdownMenuItemIndicator",Kh=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=je(n);return w.jsx(V0,{...o,...r,ref:t})});Kh.displayName=tC;var nC="DropdownMenuSeparator",Gh=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=je(n);return w.jsx(F0,{...o,...r,ref:t})});Gh.displayName=nC;var rC="DropdownMenuArrow",oC=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=je(n);return w.jsx($0,{...o,...r,ref:t})});oC.displayName=rC;var sC="DropdownMenuSubTrigger",iC=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=je(n);return w.jsx(B0,{...o,...r,ref:t})});iC.displayName=sC;var aC="DropdownMenuSubContent",cC=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=je(n);return w.jsx(z0,{...o,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});cC.displayName=aC;var lC=Vh,uC=$h,dC=Bh,fC=Wh,hC=Hh,pC=Uh,mC=Yh,gC=Kh,vC=Gh;function Fa({...e}){return w.jsx(lC,{"data-slot":"dropdown-menu",...e})}function $a({...e}){return w.jsx(uC,{"data-slot":"dropdown-menu-trigger",...e})}function Ba({className:e,sideOffset:t=4,...n}){return w.jsx(dC,{children:w.jsx(fC,{"data-slot":"dropdown-menu-content",sideOffset:t,style:{zIndex:100},className:ce("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-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",e),...n})})}function Ml({className:e,inset:t,variant:n="default",...r}){return w.jsx(pC,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":n,className:ce("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",e),...r})}function yC({className:e,children:t,checked:n,...r}){return w.jsxs(mC,{"data-slot":"dropdown-menu-checkbox-item",className:ce("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),checked:n,...r,children:[w.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:w.jsx(gC,{children:w.jsx(rf,{className:"size-4"})})}),t]})}function bC({className:e,inset:t,...n}){return w.jsx(hC,{"data-slot":"dropdown-menu-label","data-inset":t,className:ce("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",e),...n})}function xC({className:e,...t}){return w.jsx(vC,{"data-slot":"dropdown-menu-separator",className:ce("bg-border -mx-1 my-1 h-px",e),...t})}var wC="Label",qh=D.forwardRef((e,t)=>w.jsx(ae.label,{...e,ref:t,onMouseDown:n=>{var o;n.target.closest("button, input, select, textarea")||((o=e.onMouseDown)==null||o.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));qh.displayName=wC;var SC=qh;function CC({className:e,...t}){return w.jsx(SC,{"data-slot":"label",className:ce("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...t})}const TC={isDragging:!1},hn=Uo(e=>({...TC,updateIsDragging:t=>e(n=>({...n,isDragging:t}))})),DC=({onClose:e,side:t,onOpenChange:n,buttonTrigger:r,modal:o=!1,children:s})=>{const[i,a]=E.useState({x:0,y:0}),c=hn(Br(p=>p.updateIsDragging)),{attributes:l,listeners:u,setNodeRef:d,transform:f,setActivatorNodeRef:h}=ua({id:"booking_info",data:{type:"another"}}),S={transform:`translate3d(${i.x+((f==null?void 0:f.x)||0)}px, ${i.y+((f==null?void 0:f.y)||0)}px, 0)`};return _r({onDragStart(){c(!0)},onDragEnd(p){if(p.active.id){const{y:b,x:v}=i;a({x:v+((f==null?void 0:f.x)||0),y:b+((f==null?void 0:f.y)||0)}),c(!1)}}}),w.jsxs(Fa,{dir:"ltr",modal:o,open:!0,onOpenChange:n,children:[w.jsx($a,{asChild:!0,children:r||w.jsx("div",{})}),w.jsxs(Ba,{ref:d,style:{...S,zIndex:50,width:"25rem"},forceMount:!0,avoidCollisions:!0,side:t,sticky:"always",updatePositionStrategy:"always",...l,children:[w.jsxs("div",{className:"dropdownLabelContent",children:[w.jsx(CC,{ref:h,className:"dropdownLabelContent_dropdownLabel",...u,children:"Appointment"}),w.jsx(hb,{className:"dropdownLabelContent_close",onClick:e})]}),s]})]})},Xh=({modal:e=!1,side:t,onClose:n,onOpenChange:r,buttonTrigger:o,ref:s})=>{const[i,a]=E.useState(!1),{createBookingModal:c}=Lt(),l=()=>{a(!1),n==null||n()},u=d=>{a(d),r==null||r(d)};return E.useImperativeHandle(s,()=>({showCreationModal:()=>a(!0),closeModal:()=>a(!1),isModalOpen:()=>i})),w.jsx(w.Fragment,{children:i&&w.jsx(la,{children:w.jsx(DC,{onClose:l,onOpenChange:u,modal:e,side:t,buttonTrigger:o,children:c})})})},EC=()=>{const{bookingViewType:e,daysOfWeek:t}=_e(),{setTodayDay:n,setBookingViewType:r}=_e(),{updateMonthMessage:o,updateHeaderDateLabel:s}=Od(b=>b),{onViewTypeChange:i}=Pd(),{onHeaderDayClick:a}=Lt(),{resetSelectedNode:c,resetNodes:l}=Tt(b=>b),u=E.useRef(null),d=()=>u.current,f=()=>{var b;(b=d())==null||b.showCreationModal()},h=E.useCallback(b=>{const v=()=>{r(oe.WEEK),i(oe.WEEK)},m=()=>e===oe.DAY;if(a==null||a(b,e),m())return v();const g=n(b);if(!g)return;const C={month:g.getMonth(),fullYear:g.getFullYear(),monthMessage:Mn[g.getMonth()]};o(C),r(oe.DAY)},[e,n,o,r]),S=e===oe.TABLE?{justifySelf:"start"}:{},p=E.useMemo(()=>{const b=v=>new Date(v).toDateString()===new Date().toDateString();return t.map(v=>{const m=li[new Date(v).getDay()];return w.jsx("th",{className:ce("daysOfWeek",e!==oe.DAY&&"daysOfWeek_day"),children:w.jsxs("div",{style:{...S,maxWidth:e===oe.DAY?"11rem":void 0},className:"daysOfWeek_parent",children:[w.jsx("span",{className:ce(b(v)&&"daysOfWeek_day_today_title"),children:m}),w.jsx("div",{style:{width:"100%"},children:w.jsx("button",{type:"button",className:ce("daysOfWeek_day",b(v)?"daysOfWeek_day_today":"daysOfWeek_day_rest"),onClick:()=>h(v),children:Z.formatDate(v.toDateString())})})]})},m)})},[t,h,e]);return E.useEffect(()=>{switch(e){case oe.DAY:{l(),c(),s(t[0]);break}case oe.WEEK:{const b=Z.generateWeekMonthLabel(t);o({monthMessage:b})}}},[t]),w.jsxs(w.Fragment,{children:[w.jsx("table",{className:"daysOfWeek_emptySlot_table",children:w.jsx("tbody",{children:w.jsxs("tr",{children:[w.jsx("th",{style:S,className:"calendarHeader",children:w.jsx("div",{className:"daysOfWeek_emptySlot",children:w.jsx(Ea,{content:"createNewBookingLabel",children:w.jsx(an,{variant:"ghost",onClick:f,children:w.jsx(Qy,{})})})})},"emptyBlocks"),p]})})}),w.jsx(Xh,{modal:!0,ref:u})]})},MC=({handleWeekChange:e})=>w.jsxs("div",{className:"header_day_actions",children:[w.jsx(an,{className:"header_day_actions_button",variant:"ghost",size:"lg",onClick:()=>e("previous"),children:w.jsx(Ky,{className:"header_day_actions_button_icon"})}),w.jsx(an,{className:"header_day_actions_button",variant:"ghost",size:"lg",onClick:()=>e("next"),children:w.jsx(qy,{className:"header_day_actions_button_icon"})})]}),RC=({onClick:e})=>w.jsx(Ea,{content:"Today",children:w.jsx(an,{variant:"ghost",onClick:e,children:w.jsx(lb,{style:{paddingTop:"0.8px"}})})}),PC={capitalize(e){return`${this.returnFirstChar(e)}${e.slice(1,e.length)}`},returnFirstChar(e){return e.charAt(0).toUpperCase()}},AC=({code:e})=>w.jsx("p",{className:"text-sm text-muted-foreground",children:w.jsxs("kbd",{className:"pointer-events-none inline-flex h-5 select-none items-center gap-1 rounded border bg-muted px-1.5 font-mono text-[10px] font-medium text-muted-foreground opacity-100",children:[w.jsx("span",{className:"text-xs",children:"⌘"}),e]})}),OC={[oe.DAY]:w.jsx(rb,{width:"90%"}),[oe.WEEK]:w.jsx(tb,{width:"90%"}),[oe.TABLE]:w.jsx(Wy,{width:"90%"}),[oe.MONTH]:w.jsx(sb,{width:"90%"})},Rl=()=>{const{bookingViewType:e}=_e(),{onViewTypeChange:t}=Pd(),{viewModes:n}=Lt(),r=E.useCallback(a=>a===e?"custom":"outline",[e]),o=E.useCallback(a=>{a!==e&&t(a)},[t]),s=E.useMemo(()=>n.map(a=>({variant:r(a),icon:OC[a],events:c=>o(c),label:a})),[n,o,r]),i=E.useMemo(()=>{const a=s.find(c=>c.label===e);if(a)return a.icon},[e,s]);return w.jsxs(Fa,{children:[w.jsx($a,{children:w.jsx(Ea,{content:"Calendar Modes",children:w.jsx(an,{variant:"ghost",asChild:!0,children:i||w.jsx(By,{className:"w-full h-full"})})})}),w.jsx(Ba,{children:s.map(a=>w.jsxs(yC,{checked:a.label===e,onCheckedChange:()=>a.events(a.label),className:"flex flex-row justify-between gap-6",children:[w.jsxs("div",{className:"flex flex-row gap-4",children:[a.icon,w.jsx("div",{children:PC.capitalize(a.label)})]}),w.jsx(AC,{code:"o"})]},a.label))})]})},kC=566,_C=()=>{const{todayWeek:e,bookingViewType:t,setTodayDay:n,nextWeek:r,previousWeek:o,setDays:s}=_e(),{resetSelectedNode:i,resetNodes:a}=Tt(y=>y),{onTodayClick:c,onDayChange:l}=Lt(),{fullYear:u,monthMessage:d}=Od(y=>y),[f,h]=E.useState(!1),S=()=>{const y=new Date;switch(c(y),t){case oe.TABLE:case oe.DAY:{n(y);break}default:{e();break}}},p=()=>s(1),b=()=>s(-1),v=y=>y==="next"?r():o(),m=y=>y==="next"?p():b(),g=y=>{switch(a(),i(),t){case oe.TABLE:case oe.DAY:{const M=m(y);l(M,y);break}case oe.WEEK:{const M=v(y),{firstDayOfWeek:x,lastDayOfWeek:T}=Z.firstAndLastWeekDays(M);l([x,T],y);break}}};E.useEffect(()=>{e()},[e]),E.useEffect(()=>{const y=()=>{if(typeof window>"u")return!1;window.innerWidth<=kC?h(!0):h(!1)};return y(),window.addEventListener("resize",y),()=>window.removeEventListener("resize",y)},[]);const C=w.jsxs("div",{className:"header_actions",children:[w.jsx(MC,{handleWeekChange:g}),w.jsx(RC,{onClick:S})]});return w.jsx(w.Fragment,{children:f?w.jsxs("div",{className:"headerCalendar_mobile",children:[w.jsx("div",{className:"headerCalendar_mobile_month",children:w.jsxs("span",{className:"headerCalendar_mobile_month_span",children:[d," ",u]})}),w.jsxs("div",{className:"headerCalendar_mobile_actions",children:[C,w.jsx(Rl,{})]})]}):w.jsxs("div",{className:"headerCalendar",children:[w.jsx("div",{className:"headerCalendar_actions",children:C}),w.jsx("div",{className:"headerCalendar_month",children:w.jsxs("span",{className:"headerCalendar_month_span",children:[d," ",u]})}),w.jsx(Rl,{})]})})};function NC({className:e,...t}){return w.jsx("div",{"data-slot":"table-container",className:"relative w-full z-10 overflow-hidden",children:w.jsx("table",{"data-slot":"table",className:ce("w-full caption-bottom text-sm",e),...t})})}function IC({className:e,...t}){return w.jsx("td",{"data-slot":"table-cell",className:ce("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t})}const Mi={resizeBookingNorthId:e=>e!=null&&e.overflow?{startAt:e.startAt,id:e.id}:e,resizeBookingSouthId:e=>e!=null&&e.overflow?{finishAt:e.finishAt,id:e.id}:e,resetToFirstHourNextDay:e=>{const t=new Date(e.startAt);return t.setHours(0,0,0,0),t.setDate(e.finishAt.getDate()),t}},Ri=({booking:e,slotData:t,events:n,style:r,ref:o})=>{if(!e||!t||!t)return;const{day:s,hour:i}=t,[a,c]=E.useState(e),l=d=>d<="11:30",u=(d,f)=>{const h=Z.dateAndHourDateToString(new Date(d.finishAt));return Z.isTodayDate(f)&&l(h)?{backgroundColor:"#000000c0"}:{backgroundColor:"#000456c0"}};return E.useEffect(()=>{e&&c(e)},[e]),E.useImperativeHandle(o,()=>({updateBooking:d=>c(d)})),w.jsx("div",{className:"booking_card_content_container",style:{...u(a,new Date(s.split(":")[1])),...r},onPointerUp:n==null?void 0:n.onClick,children:w.jsx("div",{className:"booking_card_content",children:w.jsx("p",{className:"booking_info",children:`${Z.dateAndHourDateToString(a.startAt)} - ${Z.dateAndHourDateToString(a.finishAt)}`})})},`${s}-${i}`)};function jC(e,t,n){const r={...e};return t.top+e.y<=n.top?r.y=n.top-t.top:t.bottom+e.y>=n.top+n.height&&(r.y=n.top+n.height-t.bottom),t.left+e.x<=n.left?r.x=n.left-t.left:t.right+e.x>=n.left+n.width&&(r.x=n.left+n.width-t.right),r}const LC=e=>{let{transform:t,draggingNodeRect:n,windowRect:r}=e;return!n||!r?t:jC(t,n,r)},Zh=E.createContext({});function VC(e){const t=E.useRef(null);return t.current===null&&(t.current=e()),t.current}const za=typeof window<"u",FC=za?E.useLayoutEffect:E.useEffect,Wa=E.createContext(null);function Ha(e,t){e.indexOf(t)===-1&&e.push(t)}function Ua(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const wt=(e,t,n)=>n>t?t:n<e?e:n;let zn=()=>{},St=()=>{};process.env.NODE_ENV!=="production"&&(zn=(e,t)=>{!e&&typeof console<"u"&&console.warn(t)},St=(e,t)=>{if(!e)throw new Error(t)});const Ct={},Jh=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function Qh(e){return typeof e=="object"&&e!==null}const ep=e=>/^0[^.\s]+$/u.test(e);function Ya(e){let t;return()=>(t===void 0&&(t=e()),t)}const Xe=e=>e,$C=(e,t)=>n=>t(e(n)),Hr=(...e)=>e.reduce($C),Cr=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r};class Ka{constructor(){this.subscriptions=[]}add(t){return Ha(this.subscriptions,t),()=>Ua(this.subscriptions,t)}notify(t,n,r){const o=this.subscriptions.length;if(o)if(o===1)this.subscriptions[0](t,n,r);else for(let s=0;s<o;s++){const i=this.subscriptions[s];i&&i(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const et=e=>e*1e3,ut=e=>e/1e3;function tp(e,t){return t?e*(1e3/t):0}const Pl=new Set;function Ga(e,t,n){e||Pl.has(t)||(console.warn(t),Pl.add(t))}const np=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,BC=1e-7,zC=12;function WC(e,t,n,r,o){let s,i,a=0;do i=t+(n-t)/2,s=np(i,r,o)-e,s>0?n=i:t=i;while(Math.abs(s)>BC&&++a<zC);return i}function Ur(e,t,n,r){if(e===t&&n===r)return Xe;const o=s=>WC(s,0,1,e,n);return s=>s===0||s===1?s:np(o(s),t,r)}const rp=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,op=e=>t=>1-e(1-t),sp=Ur(.33,1.53,.69,.99),qa=op(sp),ip=rp(qa),ap=e=>(e*=2)<1?.5*qa(e):.5*(2-Math.pow(2,-10*(e-1))),Xa=e=>1-Math.sin(Math.acos(e)),cp=op(Xa),lp=rp(Xa),HC=Ur(.42,0,1,1),UC=Ur(0,0,.58,1),up=Ur(.42,0,.58,1),YC=e=>Array.isArray(e)&&typeof e[0]!="number",dp=e=>Array.isArray(e)&&typeof e[0]=="number",Al={linear:Xe,easeIn:HC,easeInOut:up,easeOut:UC,circIn:Xa,circInOut:lp,circOut:cp,backIn:qa,backInOut:ip,backOut:sp,anticipate:ap},KC=e=>typeof e=="string",Ol=e=>{if(dp(e)){St(e.length===4,"Cubic bezier arrays must contain four numerical values.");const[t,n,r,o]=e;return Ur(t,n,r,o)}else if(KC(e))return St(Al[e]!==void 0,`Invalid easing type '${e}'`),Al[e];return e},so=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"],kl={value:null};function GC(e,t){let n=new Set,r=new Set,o=!1,s=!1;const i=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1},c=0;function l(d){i.has(d)&&(u.schedule(d),e()),c++,d(a)}const u={schedule:(d,f=!1,h=!1)=>{const p=h&&o?n:r;return f&&i.add(d),p.has(d)||p.add(d),d},cancel:d=>{r.delete(d),i.delete(d)},process:d=>{if(a=d,o){s=!0;return}o=!0,[n,r]=[r,n],n.forEach(l),t&&kl.value&&kl.value.frameloop[t].push(c),c=0,n.clear(),o=!1,s&&(s=!1,u.process(d))}};return u}const qC=40;function fp(e,t){let n=!1,r=!0;const o={delta:0,timestamp:0,isProcessing:!1},s=()=>n=!0,i=so.reduce((g,C)=>(g[C]=GC(s,t?C:void 0),g),{}),{setup:a,read:c,resolveKeyframes:l,preUpdate:u,update:d,preRender:f,render:h,postRender:S}=i,p=()=>{const g=Ct.useManualTiming?o.timestamp:performance.now();n=!1,Ct.useManualTiming||(o.delta=r?1e3/60:Math.max(Math.min(g-o.timestamp,qC),1)),o.timestamp=g,o.isProcessing=!0,a.process(o),c.process(o),l.process(o),u.process(o),d.process(o),f.process(o),h.process(o),S.process(o),o.isProcessing=!1,n&&t&&(r=!1,e(p))},b=()=>{n=!0,r=!0,o.isProcessing||e(p)};return{schedule:so.reduce((g,C)=>{const y=i[C];return g[C]=(M,x=!1,T=!1)=>(n||b(),y.schedule(M,x,T)),g},{}),cancel:g=>{for(let C=0;C<so.length;C++)i[so[C]].cancel(g)},state:o,steps:i}}const{schedule:ve,cancel:zt,state:De,steps:zs}=fp(typeof requestAnimationFrame<"u"?requestAnimationFrame:Xe,!0);let xo;function XC(){xo=void 0}const Le={now:()=>(xo===void 0&&Le.set(De.isProcessing||Ct.useManualTiming?De.timestamp:performance.now()),xo),set:e=>{xo=e,queueMicrotask(XC)}},hp=e=>t=>typeof t=="string"&&t.startsWith(e),Za=hp("--"),ZC=hp("var(--"),Ja=e=>ZC(e)?JC.test(e.split("/*")[0].trim()):!1,JC=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Wn={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Tr={...Wn,transform:e=>wt(0,1,e)},io={...Wn,default:1},fr=e=>Math.round(e*1e5)/1e5,Qa=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function QC(e){return e==null}const eT=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,ec=(e,t)=>n=>!!(typeof n=="string"&&eT.test(n)&&n.startsWith(e)||t&&!QC(n)&&Object.prototype.hasOwnProperty.call(n,t)),pp=(e,t,n)=>r=>{if(typeof r!="string")return r;const[o,s,i,a]=r.match(Qa);return{[e]:parseFloat(o),[t]:parseFloat(s),[n]:parseFloat(i),alpha:a!==void 0?parseFloat(a):1}},tT=e=>wt(0,255,e),Ws={...Wn,transform:e=>Math.round(tT(e))},en={test:ec("rgb","red"),parse:pp("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+Ws.transform(e)+", "+Ws.transform(t)+", "+Ws.transform(n)+", "+fr(Tr.transform(r))+")"};function nT(e){let t="",n="",r="",o="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),o=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),o=e.substring(4,5),t+=t,n+=n,r+=r,o+=o),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:o?parseInt(o,16)/255:1}}const Pi={test:ec("#"),parse:nT,transform:en.transform},Yr=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Nt=Yr("deg"),dt=Yr("%"),re=Yr("px"),rT=Yr("vh"),oT=Yr("vw"),_l={...dt,parse:e=>dt.parse(e)/100,transform:e=>dt.transform(e*100)},wn={test:ec("hsl","hue"),parse:pp("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+dt.transform(fr(t))+", "+dt.transform(fr(n))+", "+fr(Tr.transform(r))+")"},Re={test:e=>en.test(e)||Pi.test(e)||wn.test(e),parse:e=>en.test(e)?en.parse(e):wn.test(e)?wn.parse(e):Pi.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?en.transform(e):wn.transform(e)},sT=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function iT(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(Qa))==null?void 0:t.length)||0)+(((n=e.match(sT))==null?void 0:n.length)||0)>0}const mp="number",gp="color",aT="var",cT="var(",Nl="${}",lT=/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 Dr(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},o=[];let s=0;const a=t.replace(lT,c=>(Re.test(c)?(r.color.push(s),o.push(gp),n.push(Re.parse(c))):c.startsWith(cT)?(r.var.push(s),o.push(aT),n.push(c)):(r.number.push(s),o.push(mp),n.push(parseFloat(c))),++s,Nl)).split(Nl);return{values:n,split:a,indexes:r,types:o}}function vp(e){return Dr(e).values}function yp(e){const{split:t,types:n}=Dr(e),r=t.length;return o=>{let s="";for(let i=0;i<r;i++)if(s+=t[i],o[i]!==void 0){const a=n[i];a===mp?s+=fr(o[i]):a===gp?s+=Re.transform(o[i]):s+=o[i]}return s}}const uT=e=>typeof e=="number"?0:e;function dT(e){const t=vp(e);return yp(e)(t.map(uT))}const Wt={test:iT,parse:vp,createTransformer:yp,getAnimatableNone:dT};function Hs(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function fT({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let o=0,s=0,i=0;if(!t)o=s=i=n;else{const a=n<.5?n*(1+t):n+t-n*t,c=2*n-a;o=Hs(c,a,e+1/3),s=Hs(c,a,e),i=Hs(c,a,e-1/3)}return{red:Math.round(o*255),green:Math.round(s*255),blue:Math.round(i*255),alpha:r}}function Lo(e,t){return n=>n>0?t:e}const ge=(e,t,n)=>e+(t-e)*n,Us=(e,t,n)=>{const r=e*e,o=n*(t*t-r)+r;return o<0?0:Math.sqrt(o)},hT=[Pi,en,wn],pT=e=>hT.find(t=>t.test(e));function Il(e){const t=pT(e);if(zn(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`),!t)return!1;let n=t.parse(e);return t===wn&&(n=fT(n)),n}const jl=(e,t)=>{const n=Il(e),r=Il(t);if(!n||!r)return Lo(e,t);const o={...n};return s=>(o.red=Us(n.red,r.red,s),o.green=Us(n.green,r.green,s),o.blue=Us(n.blue,r.blue,s),o.alpha=ge(n.alpha,r.alpha,s),en.transform(o))},Ai=new Set(["none","hidden"]);function mT(e,t){return Ai.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function gT(e,t){return n=>ge(e,t,n)}function tc(e){return typeof e=="number"?gT:typeof e=="string"?Ja(e)?Lo:Re.test(e)?jl:bT:Array.isArray(e)?bp:typeof e=="object"?Re.test(e)?jl:vT:Lo}function bp(e,t){const n=[...e],r=n.length,o=e.map((s,i)=>tc(s)(s,t[i]));return s=>{for(let i=0;i<r;i++)n[i]=o[i](s);return n}}function vT(e,t){const n={...e,...t},r={};for(const o in n)e[o]!==void 0&&t[o]!==void 0&&(r[o]=tc(e[o])(e[o],t[o]));return o=>{for(const s in r)n[s]=r[s](o);return n}}function yT(e,t){const n=[],r={color:0,var:0,number:0};for(let o=0;o<t.values.length;o++){const s=t.types[o],i=e.indexes[s][r[s]],a=e.values[i]??0;n[o]=a,r[s]++}return n}const bT=(e,t)=>{const n=Wt.createTransformer(t),r=Dr(e),o=Dr(t);return r.indexes.var.length===o.indexes.var.length&&r.indexes.color.length===o.indexes.color.length&&r.indexes.number.length>=o.indexes.number.length?Ai.has(e)&&!o.values.length||Ai.has(t)&&!r.values.length?mT(e,t):Hr(bp(yT(r,o),o.values),n):(zn(!0,`Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`),Lo(e,t))};function xp(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?ge(e,t,n):tc(e)(e,t)}const xT=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>ve.update(t,n),stop:()=>zt(t),now:()=>De.isProcessing?De.timestamp:Le.now()}},wp=(e,t,n=10)=>{let r="";const o=Math.max(Math.round(t/n),2);for(let s=0;s<o;s++)r+=e(s/(o-1))+", ";return`linear(${r.substring(0,r.length-2)})`},Vo=2e4;function nc(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<Vo;)t+=n,r=e.next(t);return t>=Vo?1/0:t}function wT(e,t=100,n){const r=n({...e,keyframes:[0,t]}),o=Math.min(nc(r),Vo);return{type:"keyframes",ease:s=>r.next(o*s).value/t,duration:ut(o)}}const ST=5;function Sp(e,t,n){const r=Math.max(t-ST,0);return tp(n-e(r),t-r)}const me={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},Ll=.001;function CT({duration:e=me.duration,bounce:t=me.bounce,velocity:n=me.velocity,mass:r=me.mass}){let o,s;zn(e<=et(me.maxDuration),"Spring duration must be 10 seconds or less");let i=1-t;i=wt(me.minDamping,me.maxDamping,i),e=wt(me.minDuration,me.maxDuration,ut(e)),i<1?(o=l=>{const u=l*i,d=u*e,f=u-n,h=Oi(l,i),S=Math.exp(-d);return Ll-f/h*S},s=l=>{const d=l*i*e,f=d*n+n,h=Math.pow(i,2)*Math.pow(l,2)*e,S=Math.exp(-d),p=Oi(Math.pow(l,2),i);return(-o(l)+Ll>0?-1:1)*((f-h)*S)/p}):(o=l=>{const u=Math.exp(-l*e),d=(l-n)*e+1;return-.001+u*d},s=l=>{const u=Math.exp(-l*e),d=(n-l)*(e*e);return u*d});const a=5/e,c=DT(o,s,a);if(e=et(e),isNaN(c))return{stiffness:me.stiffness,damping:me.damping,duration:e};{const l=Math.pow(c,2)*r;return{stiffness:l,damping:i*2*Math.sqrt(r*l),duration:e}}}const TT=12;function DT(e,t,n){let r=n;for(let o=1;o<TT;o++)r=r-e(r)/t(r);return r}function Oi(e,t){return e*Math.sqrt(1-t*t)}const ET=["duration","bounce"],MT=["stiffness","damping","mass"];function Vl(e,t){return t.some(n=>e[n]!==void 0)}function RT(e){let t={velocity:me.velocity,stiffness:me.stiffness,damping:me.damping,mass:me.mass,isResolvedFromDuration:!1,...e};if(!Vl(e,MT)&&Vl(e,ET))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),o=r*r,s=2*wt(.05,1,1-(e.bounce||0))*Math.sqrt(o);t={...t,mass:me.mass,stiffness:o,damping:s}}else{const n=CT(e);t={...t,...n,mass:me.mass},t.isResolvedFromDuration=!0}return t}function Fo(e=me.visualDuration,t=me.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:o}=n;const s=n.keyframes[0],i=n.keyframes[n.keyframes.length-1],a={done:!1,value:s},{stiffness:c,damping:l,mass:u,duration:d,velocity:f,isResolvedFromDuration:h}=RT({...n,velocity:-ut(n.velocity||0)}),S=f||0,p=l/(2*Math.sqrt(c*u)),b=i-s,v=ut(Math.sqrt(c/u)),m=Math.abs(b)<5;r||(r=m?me.restSpeed.granular:me.restSpeed.default),o||(o=m?me.restDelta.granular:me.restDelta.default);let g;if(p<1){const y=Oi(v,p);g=M=>{const x=Math.exp(-p*v*M);return i-x*((S+p*v*b)/y*Math.sin(y*M)+b*Math.cos(y*M))}}else if(p===1)g=y=>i-Math.exp(-v*y)*(b+(S+v*b)*y);else{const y=v*Math.sqrt(p*p-1);g=M=>{const x=Math.exp(-p*v*M),T=Math.min(y*M,300);return i-x*((S+p*v*b)*Math.sinh(T)+y*b*Math.cosh(T))/y}}const C={calculatedDuration:h&&d||null,next:y=>{const M=g(y);if(h)a.done=y>=d;else{let x=y===0?S:0;p<1&&(x=y===0?et(S):Sp(g,y,M));const T=Math.abs(x)<=r,R=Math.abs(i-M)<=o;a.done=T&&R}return a.value=a.done?i:M,a},toString:()=>{const y=Math.min(nc(C),Vo),M=wp(x=>C.next(y*x).value,y,30);return y+"ms "+M},toTransition:()=>{}};return C}Fo.applyToOptions=e=>{const t=wT(e,100,Fo);return e.ease=t.ease,e.duration=et(t.duration),e.type="keyframes",e};function ki({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:o=10,bounceStiffness:s=500,modifyTarget:i,min:a,max:c,restDelta:l=.5,restSpeed:u}){const d=e[0],f={done:!1,value:d},h=T=>a!==void 0&&T<a||c!==void 0&&T>c,S=T=>a===void 0?c:c===void 0||Math.abs(a-T)<Math.abs(c-T)?a:c;let p=n*t;const b=d+p,v=i===void 0?b:i(b);v!==b&&(p=v-d);const m=T=>-p*Math.exp(-T/r),g=T=>v+m(T),C=T=>{const R=m(T),_=g(T);f.done=Math.abs(R)<=l,f.value=f.done?v:_};let y,M;const x=T=>{h(f.value)&&(y=T,M=Fo({keyframes:[f.value,S(f.value)],velocity:Sp(g,T,f.value),damping:o,stiffness:s,restDelta:l,restSpeed:u}))};return x(0),{calculatedDuration:null,next:T=>{let R=!1;return!M&&y===void 0&&(R=!0,C(T),x(T)),y!==void 0&&T>=y?M.next(T-y):(!R&&C(T),f)}}}function PT(e,t,n){const r=[],o=n||Ct.mix||xp,s=e.length-1;for(let i=0;i<s;i++){let a=o(e[i],e[i+1]);if(t){const c=Array.isArray(t)?t[i]||Xe:t;a=Hr(c,a)}r.push(a)}return r}function AT(e,t,{clamp:n=!0,ease:r,mixer:o}={}){const s=e.length;if(St(s===t.length,"Both input and output ranges must be the same length"),s===1)return()=>t[0];if(s===2&&t[0]===t[1])return()=>t[1];const i=e[0]===e[1];e[0]>e[s-1]&&(e=[...e].reverse(),t=[...t].reverse());const a=PT(t,r,o),c=a.length,l=u=>{if(i&&u<e[0])return t[0];let d=0;if(c>1)for(;d<e.length-2&&!(u<e[d+1]);d++);const f=Cr(e[d],e[d+1],u);return a[d](f)};return n?u=>l(wt(e[0],e[s-1],u)):l}function OT(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const o=Cr(0,t,r);e.push(ge(n,1,o))}}function kT(e){const t=[0];return OT(t,e.length-1),t}function _T(e,t){return e.map(n=>n*t)}function NT(e,t){return e.map(()=>t||up).splice(0,e.length-1)}function Sn({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const o=YC(r)?r.map(Ol):Ol(r),s={done:!1,value:t[0]},i=_T(n&&n.length===t.length?n:kT(t),e),a=AT(i,t,{ease:Array.isArray(o)?o:NT(t,o)});return{calculatedDuration:e,next:c=>(s.value=a(c),s.done=c>=e,s)}}const IT=e=>e!==null;function rc(e,{repeat:t,repeatType:n="loop"},r,o=1){const s=e.filter(IT),a=o<0||t&&n!=="loop"&&t%2===1?0:s.length-1;return!a||r===void 0?s[a]:r}const jT={decay:ki,inertia:ki,tween:Sn,keyframes:Sn,spring:Fo};function Cp(e){typeof e.type=="string"&&(e.type=jT[e.type])}class oc{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,n){return this.finished.then(t,n)}}const LT=e=>e/100;class sc extends oc{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=(n=!0)=>{var r,o;if(n){const{motionValue:s}=this.options;s&&s.updatedAt!==Le.now()&&this.tick(Le.now())}this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(o=(r=this.options).onStop)==null||o.call(r))},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;Cp(t);const{type:n=Sn,repeat:r=0,repeatDelay:o=0,repeatType:s,velocity:i=0}=t;let{keyframes:a}=t;const c=n||Sn;process.env.NODE_ENV!=="production"&&c!==Sn&&St(a.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${a}`),c!==Sn&&typeof a[0]!="number"&&(this.mixKeyframes=Hr(LT,xp(a[0],a[1])),a=[0,100]);const l=c({...t,keyframes:a});s==="mirror"&&(this.mirroredGenerator=c({...t,keyframes:[...a].reverse(),velocity:-i})),l.calculatedDuration===null&&(l.calculatedDuration=nc(l));const{calculatedDuration:u}=l;this.calculatedDuration=u,this.resolvedDuration=u+o,this.totalDuration=this.resolvedDuration*(r+1)-o,this.generator=l}updateTime(t){const n=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(t,n=!1){const{generator:r,totalDuration:o,mixKeyframes:s,mirroredGenerator:i,resolvedDuration:a,calculatedDuration:c}=this;if(this.startTime===null)return r.next(0);const{delay:l=0,keyframes:u,repeat:d,repeatType:f,repeatDelay:h,type:S,onUpdate:p,finalKeyframe:b}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-o/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const v=this.currentTime-l*(this.playbackSpeed>=0?1:-1),m=this.playbackSpeed>=0?v<0:v>o;this.currentTime=Math.max(v,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=o);let g=this.currentTime,C=r;if(d){const T=Math.min(this.currentTime,o)/a;let R=Math.floor(T),_=T%1;!_&&T>=1&&(_=1),_===1&&R--,R=Math.min(R,d+1),!!(R%2)&&(f==="reverse"?(_=1-_,h&&(_-=h/a)):f==="mirror"&&(C=i)),g=wt(0,1,_)*a}const y=m?{done:!1,value:u[0]}:C.next(g);s&&(y.value=s(y.value));let{done:M}=y;!m&&c!==null&&(M=this.playbackSpeed>=0?this.currentTime>=o:this.currentTime<=0);const x=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&M);return x&&S!==ki&&(y.value=rc(u,this.options,b,this.speed)),p&&p(y.value),x&&this.finish(),y}then(t,n){return this.finished.then(t,n)}get duration(){return ut(this.calculatedDuration)}get time(){return ut(this.currentTime)}set time(t){var n;t=et(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),(n=this.driver)==null||n.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(Le.now());const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=ut(this.currentTime))}play(){var o,s;if(this.isStopped)return;const{driver:t=xT,startTime:n}=this.options;this.driver||(this.driver=t(i=>this.tick(i))),(s=(o=this.options).onPlay)==null||s.call(o);const r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=n??r),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(Le.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var t,n;this.notifyFinished(),this.teardown(),this.state="finished",(n=(t=this.options).onComplete)==null||n.call(t)}cancel(){var t,n;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(n=(t=this.options).onCancel)==null||n.call(t)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){var n;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(n=this.driver)==null||n.stop(),t.observe(this)}}function VT(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const tn=e=>e*180/Math.PI,_i=e=>{const t=tn(Math.atan2(e[1],e[0]));return Ni(t)},FT={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:_i,rotateZ:_i,skewX:e=>tn(Math.atan(e[1])),skewY:e=>tn(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Ni=e=>(e=e%360,e<0&&(e+=360),e),Fl=_i,$l=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),Bl=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),$T={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:$l,scaleY:Bl,scale:e=>($l(e)+Bl(e))/2,rotateX:e=>Ni(tn(Math.atan2(e[6],e[5]))),rotateY:e=>Ni(tn(Math.atan2(-e[2],e[0]))),rotateZ:Fl,rotate:Fl,skewX:e=>tn(Math.atan(e[4])),skewY:e=>tn(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function Ii(e){return e.includes("scale")?1:0}function ji(e,t){if(!e||e==="none")return Ii(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,o;if(n)r=$T,o=n;else{const a=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=FT,o=a}if(!o)return Ii(t);const s=r[t],i=o[1].split(",").map(zT);return typeof s=="function"?s(i):i[s]}const BT=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return ji(n,t)};function zT(e){return parseFloat(e.trim())}const Hn=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Un=new Set(Hn),zl=e=>e===Wn||e===re,WT=new Set(["x","y","z"]),HT=Hn.filter(e=>!WT.has(e));function UT(e){const t=[];return HT.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const nn={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>ji(t,"x"),y:(e,{transform:t})=>ji(t,"y")};nn.translateX=nn.x;nn.translateY=nn.y;const rn=new Set;let Li=!1,Vi=!1,Fi=!1;function Tp(){if(Vi){const e=Array.from(rn).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const o=UT(r);o.length&&(n.set(r,o),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const o=n.get(r);o&&o.forEach(([s,i])=>{var a;(a=r.getValue(s))==null||a.set(i)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}Vi=!1,Li=!1,rn.forEach(e=>e.complete(Fi)),rn.clear()}function Dp(){rn.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Vi=!0)})}function YT(){Fi=!0,Dp(),Tp(),Fi=!1}class ic{constructor(t,n,r,o,s,i=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=o,this.element=s,this.isAsync=i}scheduleResolve(){this.state="scheduled",this.isAsync?(rn.add(this),Li||(Li=!0,ve.read(Dp),ve.resolveKeyframes(Tp))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:o}=this;if(t[0]===null){const s=o==null?void 0:o.get(),i=t[t.length-1];if(s!==void 0)t[0]=s;else if(r&&n){const a=r.readValue(n,i);a!=null&&(t[0]=a)}t[0]===void 0&&(t[0]=i),o&&s===void 0&&o.set(t[0])}VT(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),rn.delete(this)}cancel(){this.state==="scheduled"&&(rn.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const KT=e=>e.startsWith("--");function GT(e,t,n){KT(t)?e.style.setProperty(t,n):e.style[t]=n}const qT=Ya(()=>window.ScrollTimeline!==void 0),XT={};function ZT(e,t){const n=Ya(e);return()=>XT[t]??n()}const Ep=ZT(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),ar=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,Wl={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:ar([0,.65,.55,1]),circOut:ar([.55,0,1,.45]),backIn:ar([.31,.01,.66,-.59]),backOut:ar([.33,1.53,.69,.99])};function Mp(e,t){if(e)return typeof e=="function"?Ep()?wp(e,t):"ease-out":dp(e)?ar(e):Array.isArray(e)?e.map(n=>Mp(n,t)||Wl.easeOut):Wl[e]}function JT(e,t,n,{delay:r=0,duration:o=300,repeat:s=0,repeatType:i="loop",ease:a="easeOut",times:c}={},l=void 0){const u={[t]:n};c&&(u.offset=c);const d=Mp(a,o);Array.isArray(d)&&(u.easing=d);const f={delay:r,duration:o,easing:Array.isArray(d)?"linear":d,fill:"both",iterations:s+1,direction:i==="reverse"?"alternate":"normal"};return l&&(f.pseudoElement=l),e.animate(u,f)}function Rp(e){return typeof e=="function"&&"applyToOptions"in e}function QT({type:e,...t}){return Rp(e)&&Ep()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class eD extends oc{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,!t)return;const{element:n,name:r,keyframes:o,pseudoElement:s,allowFlatten:i=!1,finalKeyframe:a,onComplete:c}=t;this.isPseudoElement=!!s,this.allowFlatten=i,this.options=t,St(typeof t.type!="string",`animateMini doesn't support "type" as a string. Did you mean to import { spring } from "motion"?`);const l=QT(t);this.animation=JT(n,r,o,l,s),l.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!s){const u=rc(o,this.options,a,this.speed);this.updateMotionValue?this.updateMotionValue(u):GT(n,r,u),this.animation.cancel()}c==null||c(),this.notifyFinished()}}play(){this.isStopped||(this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var t,n;(n=(t=this.animation).finish)==null||n.call(t)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var t,n;this.isPseudoElement||(n=(t=this.animation).commitStyles)==null||n.call(t)}get duration(){var n,r;const t=((r=(n=this.animation.effect)==null?void 0:n.getComputedTiming)==null?void 0:r.call(n).duration)||0;return ut(Number(t))}get time(){return ut(Number(this.animation.currentTime)||0)}set time(t){this.finishedTime=null,this.animation.currentTime=et(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(t){this.animation.startTime=t}attachTimeline({timeline:t,observe:n}){var r;return this.allowFlatten&&((r=this.animation.effect)==null||r.updateTiming({easing:"linear"})),this.animation.onfinish=null,t&&qT()?(this.animation.timeline=t,Xe):n(this)}}const Pp={anticipate:ap,backInOut:ip,circInOut:lp};function tD(e){return e in Pp}function nD(e){typeof e.ease=="string"&&tD(e.ease)&&(e.ease=Pp[e.ease])}const Hl=10;class rD extends eD{constructor(t){nD(t),Cp(t),super(t),t.startTime&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:r,onComplete:o,element:s,...i}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const a=new sc({...i,autoplay:!1}),c=et(this.finishedTime??this.time);n.setWithVelocity(a.sample(c-Hl).value,a.sample(c).value,Hl),a.stop()}}const Ul=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Wt.test(e)||e==="0")&&!e.startsWith("url("));function oD(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function sD(e,t,n,r){const o=e[0];if(o===null)return!1;if(t==="display"||t==="visibility")return!0;const s=e[e.length-1],i=Ul(o,t),a=Ul(s,t);return zn(i===a,`You are trying to animate ${t} from "${o}" to "${s}". ${o} is not an animatable value - to enable this animation set ${o} to a value animatable to ${s} via the \`style\` property.`),!i||!a?!1:oD(e)||(n==="spring"||Rp(n))&&r}function Ap(e){return Qh(e)&&"offsetHeight"in e}const iD=new Set(["opacity","clipPath","filter","transform"]),aD=Ya(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function cD(e){var l;const{motionValue:t,name:n,repeatDelay:r,repeatType:o,damping:s,type:i}=e;if(!Ap((l=t==null?void 0:t.owner)==null?void 0:l.current))return!1;const{onUpdate:a,transformTemplate:c}=t.owner.getProps();return aD()&&n&&iD.has(n)&&(n!=="transform"||!c)&&!a&&!r&&o!=="mirror"&&s!==0&&i!=="inertia"}const lD=40;class uD extends oc{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:o=0,repeatDelay:s=0,repeatType:i="loop",keyframes:a,name:c,motionValue:l,element:u,...d}){var S;super(),this.stop=()=>{var p,b;this._animation&&(this._animation.stop(),(p=this.stopTimeline)==null||p.call(this)),(b=this.keyframeResolver)==null||b.cancel()},this.createdAt=Le.now();const f={autoplay:t,delay:n,type:r,repeat:o,repeatDelay:s,repeatType:i,name:c,motionValue:l,element:u,...d},h=(u==null?void 0:u.KeyframeResolver)||ic;this.keyframeResolver=new h(a,(p,b,v)=>this.onKeyframesResolved(p,b,f,!v),c,l,u),(S=this.keyframeResolver)==null||S.scheduleResolve()}onKeyframesResolved(t,n,r,o){this.keyframeResolver=void 0;const{name:s,type:i,velocity:a,delay:c,isHandoff:l,onUpdate:u}=r;this.resolvedAt=Le.now(),sD(t,s,i,a)||((Ct.instantAnimations||!c)&&(u==null||u(rc(t,r,n))),t[0]=t[t.length-1],r.duration=0,r.repeat=0);const f={startTime:o?this.resolvedAt?this.resolvedAt-this.createdAt>lD?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:t},h=!l&&cD(f)?new rD({...f,element:f.motionValue.owner.current}):new sc(f);h.finished.then(()=>this.notifyFinished()).catch(Xe),this.pendingTimeline&&(this.stopTimeline=h.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=h}get finished(){return this._animation?this.animation.finished:this._finished}then(t,n){return this.finished.finally(t).then(()=>{})}get animation(){var t;return this._animation||((t=this.keyframeResolver)==null||t.resume(),YT()),this._animation}get duration(){return this.animation.duration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var t;this._animation&&this.animation.cancel(),(t=this.keyframeResolver)==null||t.cancel()}}const dD=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function fD(e){const t=dD.exec(e);if(!t)return[,];const[,n,r,o]=t;return[`--${n??r}`,o]}const hD=4;function Op(e,t,n=1){St(n<=hD,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`);const[r,o]=fD(e);if(!r)return;const s=window.getComputedStyle(t).getPropertyValue(r);if(s){const i=s.trim();return Jh(i)?parseFloat(i):i}return Ja(o)?Op(o,t,n+1):o}function ac(e,t){return(e==null?void 0:e[t])??(e==null?void 0:e.default)??e}const kp=new Set(["width","height","top","left","right","bottom",...Hn]),pD={test:e=>e==="auto",parse:e=>e},_p=e=>t=>t.test(e),Np=[Wn,re,dt,Nt,oT,rT,pD],Yl=e=>Np.find(_p(e));function mD(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||ep(e):!0}const gD=new Set(["brightness","contrast","saturate","opacity"]);function vD(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(Qa)||[];if(!r)return e;const o=n.replace(r,"");let s=gD.has(t)?1:0;return r!==n&&(s*=100),t+"("+s+o+")"}const yD=/\b([a-z-]*)\(.*?\)/gu,$i={...Wt,getAnimatableNone:e=>{const t=e.match(yD);return t?t.map(vD).join(" "):e}},Kl={...Wn,transform:Math.round},bD={rotate:Nt,rotateX:Nt,rotateY:Nt,rotateZ:Nt,scale:io,scaleX:io,scaleY:io,scaleZ:io,skew:Nt,skewX:Nt,skewY:Nt,distance:re,translateX:re,translateY:re,translateZ:re,x:re,y:re,z:re,perspective:re,transformPerspective:re,opacity:Tr,originX:_l,originY:_l,originZ:re},cc={borderWidth:re,borderTopWidth:re,borderRightWidth:re,borderBottomWidth:re,borderLeftWidth:re,borderRadius:re,radius:re,borderTopLeftRadius:re,borderTopRightRadius:re,borderBottomRightRadius:re,borderBottomLeftRadius:re,width:re,maxWidth:re,height:re,maxHeight:re,top:re,right:re,bottom:re,left:re,padding:re,paddingTop:re,paddingRight:re,paddingBottom:re,paddingLeft:re,margin:re,marginTop:re,marginRight:re,marginBottom:re,marginLeft:re,backgroundPositionX:re,backgroundPositionY:re,...bD,zIndex:Kl,fillOpacity:Tr,strokeOpacity:Tr,numOctaves:Kl},xD={...cc,color:Re,backgroundColor:Re,outlineColor:Re,fill:Re,stroke:Re,borderColor:Re,borderTopColor:Re,borderRightColor:Re,borderBottomColor:Re,borderLeftColor:Re,filter:$i,WebkitFilter:$i},Ip=e=>xD[e];function jp(e,t){let n=Ip(e);return n!==$i&&(n=Wt),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const wD=new Set(["auto","none","0"]);function SD(e,t,n){let r=0,o;for(;r<e.length&&!o;){const s=e[r];typeof s=="string"&&!wD.has(s)&&Dr(s).values.length&&(o=e[r]),r++}if(o&&n)for(const s of t)e[s]=jp(n,o)}class CD extends ic{constructor(t,n,r,o,s){super(t,n,r,o,s,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let c=0;c<t.length;c++){let l=t[c];if(typeof l=="string"&&(l=l.trim(),Ja(l))){const u=Op(l,n.current);u!==void 0&&(t[c]=u),c===t.length-1&&(this.finalKeyframe=l)}}if(this.resolveNoneKeyframes(),!kp.has(r)||t.length!==2)return;const[o,s]=t,i=Yl(o),a=Yl(s);if(i!==a)if(zl(i)&&zl(a))for(let c=0;c<t.length;c++){const l=t[c];typeof l=="string"&&(t[c]=parseFloat(l))}else nn[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let o=0;o<t.length;o++)(t[o]===null||mD(t[o]))&&r.push(o);r.length&&SD(t,r,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=nn[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const o=n[n.length-1];o!==void 0&&t.getValue(r,o).jump(o,!1)}measureEndState(){var a;const{element:t,name:n,unresolvedKeyframes:r}=this;if(!t||!t.current)return;const o=t.getValue(n);o&&o.jump(this.measuredOrigin,!1);const s=r.length-1,i=r[s];r[s]=nn[n](t.measureViewportBox(),window.getComputedStyle(t.current)),i!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=i),(a=this.removedTransforms)!=null&&a.length&&this.removedTransforms.forEach(([c,l])=>{t.getValue(c).set(l)}),this.resolveNoneKeyframes()}}function TD(e,t,n){if(e instanceof EventTarget)return[e];if(typeof e=="string"){let r=document;const o=(n==null?void 0:n[e])??r.querySelectorAll(e);return o?Array.from(o):[]}return Array.from(e)}const Gl=30,DD=e=>!isNaN(parseFloat(e));class ED{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,o=!0)=>{var i,a;const s=Le.now();if(this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&((i=this.events.change)==null||i.notify(this.current),this.dependents))for(const c of this.dependents)c.dirty();o&&((a=this.events.renderRequest)==null||a.notify(this.current))},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=Le.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=DD(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return process.env.NODE_ENV!=="production"&&Ga(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new Ka);const r=this.events[t].add(n);return t==="change"?()=>{r(),ve.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var t;(t=this.events.change)==null||t.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=Le.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>Gl)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,Gl);return tp(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(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(){var t,n;(t=this.dependents)==null||t.clear(),(n=this.events.destroy)==null||n.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function _n(e,t){return new ED(e,t)}const Lp=(e,t)=>t&&typeof e=="number"?t.transform(e):e,{schedule:lc}=fp(queueMicrotask,!1),Je={x:!1,y:!1};function Vp(){return Je.x||Je.y}function MD(e){return e==="x"||e==="y"?Je[e]?null:(Je[e]=!0,()=>{Je[e]=!1}):Je.x||Je.y?null:(Je.x=Je.y=!0,()=>{Je.x=Je.y=!1})}function Fp(e,t){const n=TD(e),r=new AbortController,o={passive:!0,...t,signal:r.signal};return[n,o,()=>r.abort()]}function ql(e){return!(e.pointerType==="touch"||Vp())}function RD(e,t,n={}){const[r,o,s]=Fp(e,n),i=a=>{if(!ql(a))return;const{target:c}=a,l=t(c,a);if(typeof l!="function"||!c)return;const u=d=>{ql(d)&&(l(d),c.removeEventListener("pointerleave",u))};c.addEventListener("pointerleave",u,o)};return r.forEach(a=>{a.addEventListener("pointerenter",i,o)}),s}const $p=(e,t)=>t?e===t?!0:$p(e,t.parentElement):!1,uc=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,PD=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function AD(e){return PD.has(e.tagName)||e.tabIndex!==-1}const wo=new WeakSet;function Xl(e){return t=>{t.key==="Enter"&&e(t)}}function Ys(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const OD=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=Xl(()=>{if(wo.has(n))return;Ys(n,"down");const o=Xl(()=>{Ys(n,"up")}),s=()=>Ys(n,"cancel");n.addEventListener("keyup",o,t),n.addEventListener("blur",s,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function Zl(e){return uc(e)&&!Vp()}function kD(e,t,n={}){const[r,o,s]=Fp(e,n),i=a=>{const c=a.currentTarget;if(!Zl(a))return;wo.add(c);const l=t(c,a),u=(h,S)=>{window.removeEventListener("pointerup",d),window.removeEventListener("pointercancel",f),wo.has(c)&&wo.delete(c),Zl(h)&&typeof l=="function"&&l(h,{success:S})},d=h=>{u(h,c===window||c===document||n.useGlobalTarget||$p(c,h.target))},f=h=>{u(h,!1)};window.addEventListener("pointerup",d,o),window.addEventListener("pointercancel",f,o)};return r.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",i,o),Ap(a)&&(a.addEventListener("focus",l=>OD(l,o)),!AD(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),s}function Bp(e){return Qh(e)&&"ownerSVGElement"in e}function _D(e){return Bp(e)&&e.tagName==="svg"}const Pe=e=>!!(e&&e.getVelocity),ND=[...Np,Re,Wt],ID=e=>ND.find(_p(e)),zp=E.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function jD(e=!0){const t=E.useContext(Wa);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:o}=t,s=E.useId();E.useEffect(()=>{if(e)return o(s)},[e]);const i=E.useCallback(()=>e&&r&&r(s),[s,r,e]);return!n&&r?[!1,i]:[!0]}const Wp=E.createContext({strict:!1}),Jl={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"]},Nn={};for(const e in Jl)Nn[e]={isEnabled:t=>Jl[e].some(n=>!!t[n])};function LD(e){for(const t in e)Nn[t]={...Nn[t],...e[t]}}const VD=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 $o(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||VD.has(e)}let Hp=e=>!$o(e);function FD(e){e&&(Hp=t=>t.startsWith("on")?!$o(t):e(t))}try{FD(require("@emotion/is-prop-valid").default)}catch{}function $D(e,t,n){const r={};for(const o in e)o==="values"&&typeof e.values=="object"||(Hp(o)||n===!0&&$o(o)||!t&&!$o(o)||e.draggable&&o.startsWith("onDrag"))&&(r[o]=e[o]);return r}function BD(e){if(typeof Proxy>"u")return e;const t=new Map,n=(...r)=>(process.env.NODE_ENV!=="production"&&Ga(!1,"motion() is deprecated. Use motion.create() instead."),e(...r));return new Proxy(n,{get:(r,o)=>o==="create"?e:(t.has(o)||t.set(o,e(o)),t.get(o))})}const hs=E.createContext({});function ps(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function Er(e){return typeof e=="string"||Array.isArray(e)}const dc=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],fc=["initial",...dc];function ms(e){return ps(e.animate)||fc.some(t=>Er(e[t]))}function Up(e){return!!(ms(e)||e.variants)}function zD(e,t){if(ms(e)){const{initial:n,animate:r}=e;return{initial:n===!1||Er(n)?n:void 0,animate:Er(r)?r:void 0}}return e.inherit!==!1?t:{}}function WD(e){const{initial:t,animate:n}=zD(e,E.useContext(hs));return E.useMemo(()=>({initial:t,animate:n}),[Ql(t),Ql(n)])}function Ql(e){return Array.isArray(e)?e.join(" "):e}const HD=Symbol.for("motionComponentSymbol");function Cn(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function UD(e,t,n){return E.useCallback(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):Cn(n)&&(n.current=r))},[t])}const hc=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),YD="framerAppearId",Yp="data-"+hc(YD),Kp=E.createContext({});function KD(e,t,n,r,o){var p,b;const{visualElement:s}=E.useContext(hs),i=E.useContext(Wp),a=E.useContext(Wa),c=E.useContext(zp).reducedMotion,l=E.useRef(null);r=r||i.renderer,!l.current&&r&&(l.current=r(e,{visualState:t,parent:s,props:n,presenceContext:a,blockInitialAnimation:a?a.initial===!1:!1,reducedMotionConfig:c}));const u=l.current,d=E.useContext(Kp);u&&!u.projection&&o&&(u.type==="html"||u.type==="svg")&&GD(l.current,n,o,d);const f=E.useRef(!1);E.useInsertionEffect(()=>{u&&f.current&&u.update(n,a)});const h=n[Yp],S=E.useRef(!!h&&!((p=window.MotionHandoffIsComplete)!=null&&p.call(window,h))&&((b=window.MotionHasOptimisedAnimation)==null?void 0:b.call(window,h)));return FC(()=>{u&&(f.current=!0,window.MotionIsMounted=!0,u.updateFeatures(),lc.render(u.render),S.current&&u.animationState&&u.animationState.animateChanges())}),E.useEffect(()=>{u&&(!S.current&&u.animationState&&u.animationState.animateChanges(),S.current&&(queueMicrotask(()=>{var v;(v=window.MotionHandoffMarkAsComplete)==null||v.call(window,h)}),S.current=!1))}),u}function GD(e,t,n,r){const{layoutId:o,layout:s,drag:i,dragConstraints:a,layoutScroll:c,layoutRoot:l,layoutCrossfade:u}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:Gp(e.parent)),e.projection.setOptions({layoutId:o,layout:s,alwaysMeasureLayout:!!i||a&&Cn(a),visualElement:e,animationType:typeof s=="string"?s:"both",initialPromotionConfig:r,crossfade:u,layoutScroll:c,layoutRoot:l})}function Gp(e){if(e)return e.options.allowProjection!==!1?e.projection:Gp(e.parent)}function qD({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:o}){e&&LD(e);function s(a,c){let l;const u={...E.useContext(zp),...a,layoutId:XD(a)},{isStatic:d}=u,f=WD(a),h=r(a,d);if(!d&&za){ZD(u,e);const S=JD(u);l=S.MeasureLayout,f.visualElement=KD(o,h,u,t,S.ProjectionNode)}return w.jsxs(hs.Provider,{value:f,children:[l&&f.visualElement?w.jsx(l,{visualElement:f.visualElement,...u}):null,n(o,a,UD(h,f.visualElement,c),h,d,f.visualElement)]})}s.displayName=`motion.${typeof o=="string"?o:`create(${o.displayName??o.name??""})`}`;const i=E.forwardRef(s);return i[HD]=o,i}function XD({layoutId:e}){const t=E.useContext(Zh).id;return t&&e!==void 0?t+"-"+e:e}function ZD(e,t){const n=E.useContext(Wp).strict;if(process.env.NODE_ENV!=="production"&&t&&n){const r="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";e.ignoreStrict?zn(!1,r):St(!1,r)}}function JD(e){const{drag:t,layout:n}=Nn;if(!t&&!n)return{};const r={...t,...n};return{MeasureLayout:t!=null&&t.isEnabled(e)||n!=null&&n.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}const Mr={};function QD(e){for(const t in e)Mr[t]=e[t],Za(t)&&(Mr[t].isCSSVariable=!0)}function qp(e,{layout:t,layoutId:n}){return Un.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!Mr[e]||e==="opacity")}const eE={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},tE=Hn.length;function nE(e,t,n){let r="",o=!0;for(let s=0;s<tE;s++){const i=Hn[s],a=e[i];if(a===void 0)continue;let c=!0;if(typeof a=="number"?c=a===(i.startsWith("scale")?1:0):c=parseFloat(a)===0,!c||n){const l=Lp(a,cc[i]);if(!c){o=!1;const u=eE[i]||i;r+=`${u}(${l}) `}n&&(t[i]=l)}}return r=r.trim(),n?r=n(t,o?"":r):o&&(r="none"),r}function pc(e,t,n){const{style:r,vars:o,transformOrigin:s}=e;let i=!1,a=!1;for(const c in t){const l=t[c];if(Un.has(c)){i=!0;continue}else if(Za(c)){o[c]=l;continue}else{const u=Lp(l,cc[c]);c.startsWith("origin")?(a=!0,s[c]=u):r[c]=u}}if(t.transform||(i||n?r.transform=nE(t,e.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 mc=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Xp(e,t,n){for(const r in t)!Pe(t[r])&&!qp(r,n)&&(e[r]=t[r])}function rE({transformTemplate:e},t){return E.useMemo(()=>{const n=mc();return pc(n,t,e),Object.assign({},n.vars,n.style)},[t])}function oE(e,t){const n=e.style||{},r={};return Xp(r,n,e),Object.assign(r,rE(e,t)),r}function sE(e,t){const n={},r=oE(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const iE={offset:"stroke-dashoffset",array:"stroke-dasharray"},aE={offset:"strokeDashoffset",array:"strokeDasharray"};function cE(e,t,n=1,r=0,o=!0){e.pathLength=1;const s=o?iE:aE;e[s.offset]=re.transform(-r);const i=re.transform(t),a=re.transform(n);e[s.array]=`${i} ${a}`}function Zp(e,{attrX:t,attrY:n,attrScale:r,pathLength:o,pathSpacing:s=1,pathOffset:i=0,...a},c,l,u){if(pc(e,a,l),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:d,style:f}=e;d.transform&&(f.transform=d.transform,delete d.transform),(f.transform||d.transformOrigin)&&(f.transformOrigin=d.transformOrigin??"50% 50%",delete d.transformOrigin),f.transform&&(f.transformBox=(u==null?void 0:u.transformBox)??"fill-box",delete d.transformBox),t!==void 0&&(d.x=t),n!==void 0&&(d.y=n),r!==void 0&&(d.scale=r),o!==void 0&&cE(d,o,s,i,!1)}const Jp=()=>({...mc(),attrs:{}}),Qp=e=>typeof e=="string"&&e.toLowerCase()==="svg";function lE(e,t,n,r){const o=E.useMemo(()=>{const s=Jp();return Zp(s,t,Qp(r),e.transformTemplate,e.style),{...s.attrs,style:{...s.style}}},[t]);if(e.style){const s={};Xp(s,e.style,e),o.style={...s,...o.style}}return o}const uE=["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 gc(e){return typeof e!="string"||e.includes("-")?!1:!!(uE.indexOf(e)>-1||/[A-Z]/u.test(e))}function dE(e=!1){return(n,r,o,{latestValues:s},i)=>{const c=(gc(n)?lE:sE)(r,s,i,n),l=$D(r,typeof n=="string",e),u=n!==E.Fragment?{...l,...c,ref:o}:{},{children:d}=r,f=E.useMemo(()=>Pe(d)?d.get():d,[d]);return E.createElement(n,{...u,children:f})}}function eu(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function vc(e,t,n,r){if(typeof t=="function"){const[o,s]=eu(r);t=t(n!==void 0?n:e.custom,o,s)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[o,s]=eu(r);t=t(n!==void 0?n:e.custom,o,s)}return t}function So(e){return Pe(e)?e.get():e}function fE({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,o){return{latestValues:hE(n,r,o,e),renderState:t()}}const em=e=>(t,n)=>{const r=E.useContext(hs),o=E.useContext(Wa),s=()=>fE(e,t,r,o);return n?s():VC(s)};function hE(e,t,n,r){const o={},s=r(e,{});for(const f in s)o[f]=So(s[f]);let{initial:i,animate:a}=e;const c=ms(e),l=Up(e);t&&l&&!c&&e.inherit!==!1&&(i===void 0&&(i=t.initial),a===void 0&&(a=t.animate));let u=n?n.initial===!1:!1;u=u||i===!1;const d=u?a:i;if(d&&typeof d!="boolean"&&!ps(d)){const f=Array.isArray(d)?d:[d];for(let h=0;h<f.length;h++){const S=vc(e,f[h]);if(S){const{transitionEnd:p,transition:b,...v}=S;for(const m in v){let g=v[m];if(Array.isArray(g)){const C=u?g.length-1:0;g=g[C]}g!==null&&(o[m]=g)}for(const m in p)o[m]=p[m]}}}return o}function yc(e,t,n){var s;const{style:r}=e,o={};for(const i in r)(Pe(r[i])||t.style&&Pe(t.style[i])||qp(i,e)||((s=n==null?void 0:n.getValue(i))==null?void 0:s.liveStyle)!==void 0)&&(o[i]=r[i]);return o}const pE={useVisualState:em({scrapeMotionValuesFromProps:yc,createRenderState:mc})};function tm(e,t,n){const r=yc(e,t,n);for(const o in e)if(Pe(e[o])||Pe(t[o])){const s=Hn.indexOf(o)!==-1?"attr"+o.charAt(0).toUpperCase()+o.substring(1):o;r[s]=e[o]}return r}const mE={useVisualState:em({scrapeMotionValuesFromProps:tm,createRenderState:Jp})};function gE(e,t){return function(r,{forwardMotionProps:o}={forwardMotionProps:!1}){const i={...gc(r)?mE:pE,preloadedFeatures:e,useRender:dE(o),createVisualElement:t,Component:r};return qD(i)}}function Rr(e,t,n){const r=e.getProps();return vc(r,t,n!==void 0?n:r.custom,e)}const Bi=e=>Array.isArray(e);function vE(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,_n(n))}function yE(e){return Bi(e)?e[e.length-1]||0:e}function bE(e,t){const n=Rr(e,t);let{transitionEnd:r={},transition:o={},...s}=n||{};s={...s,...r};for(const i in s){const a=yE(s[i]);vE(e,i,a)}}function xE(e){return!!(Pe(e)&&e.add)}function zi(e,t){const n=e.getValue("willChange");if(xE(n))return n.add(t);if(!n&&Ct.WillChange){const r=new Ct.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function nm(e){return e.props[Yp]}const wE=e=>e!==null;function SE(e,{repeat:t,repeatType:n="loop"},r){const o=e.filter(wE),s=t&&n!=="loop"&&t%2===1?0:o.length-1;return o[s]}const CE={type:"spring",stiffness:500,damping:25,restSpeed:10},TE=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),DE={type:"keyframes",duration:.8},EE={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},ME=(e,{keyframes:t})=>t.length>2?DE:Un.has(e)?e.startsWith("scale")?TE(t[1]):CE:EE;function RE({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:o,repeat:s,repeatType:i,repeatDelay:a,from:c,elapsed:l,...u}){return!!Object.keys(u).length}const bc=(e,t,n,r={},o,s)=>i=>{const a=ac(r,e)||{},c=a.delay||r.delay||0;let{elapsed:l=0}=r;l=l-et(c);const u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-l,onUpdate:f=>{t.set(f),a.onUpdate&&a.onUpdate(f)},onComplete:()=>{i(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:s?void 0:o};RE(a)||Object.assign(u,ME(e,u)),u.duration&&(u.duration=et(u.duration)),u.repeatDelay&&(u.repeatDelay=et(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)),(Ct.instantAnimations||Ct.skipAnimations)&&(d=!0,u.duration=0,u.delay=0),u.allowFlatten=!a.type&&!a.ease,d&&!s&&t.get()!==void 0){const f=SE(u.keyframes,a);if(f!==void 0){ve.update(()=>{u.onUpdate(f),u.onComplete()});return}}return a.isSync?new sc(u):new uD(u)};function PE({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function rm(e,t,{delay:n=0,transitionOverride:r,type:o}={}){let{transition:s=e.getDefaultTransition(),transitionEnd:i,...a}=t;r&&(s=r);const c=[],l=o&&e.animationState&&e.animationState.getState()[o];for(const u in a){const d=e.getValue(u,e.latestValues[u]??null),f=a[u];if(f===void 0||l&&PE(l,u))continue;const h={delay:n,...ac(s||{},u)},S=d.get();if(S!==void 0&&!d.isAnimating&&!Array.isArray(f)&&f===S&&!h.velocity)continue;let p=!1;if(window.MotionHandoffAnimation){const v=nm(e);if(v){const m=window.MotionHandoffAnimation(v,u,ve);m!==null&&(h.startTime=m,p=!0)}}zi(e,u),d.start(bc(u,d,f,e.shouldReduceMotion&&kp.has(u)?{type:!1}:h,e,p));const b=d.animation;b&&c.push(b)}return i&&Promise.all(c).then(()=>{ve.update(()=>{i&&bE(e,i)})}),c}function Wi(e,t,n={}){var c;const r=Rr(e,t,n.type==="exit"?(c=e.presenceContext)==null?void 0:c.custom:void 0);let{transition:o=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(o=n.transitionOverride);const s=r?()=>Promise.all(rm(e,r,n)):()=>Promise.resolve(),i=e.variantChildren&&e.variantChildren.size?(l=0)=>{const{delayChildren:u=0,staggerChildren:d,staggerDirection:f}=o;return AE(e,t,u+l,d,f,n)}:()=>Promise.resolve(),{when:a}=o;if(a){const[l,u]=a==="beforeChildren"?[s,i]:[i,s];return l().then(()=>u())}else return Promise.all([s(),i(n.delay)])}function AE(e,t,n=0,r=0,o=1,s){const i=[],a=(e.variantChildren.size-1)*r,c=o===1?(l=0)=>l*r:(l=0)=>a-l*r;return Array.from(e.variantChildren).sort(OE).forEach((l,u)=>{l.notify("AnimationStart",t),i.push(Wi(l,t,{...s,delay:n+c(u)}).then(()=>l.notify("AnimationComplete",t)))}),Promise.all(i)}function OE(e,t){return e.sortNodePosition(t)}function kE(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const o=t.map(s=>Wi(e,s,n));r=Promise.all(o)}else if(typeof t=="string")r=Wi(e,t,n);else{const o=typeof t=="function"?Rr(e,t,n.custom):t;r=Promise.all(rm(e,o,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}function om(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}const _E=fc.length;function sm(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?sm(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<_E;n++){const r=fc[n],o=e.props[r];(Er(o)||o===!1)&&(t[r]=o)}return t}const NE=[...dc].reverse(),IE=dc.length;function jE(e){return t=>Promise.all(t.map(({animation:n,options:r})=>kE(e,n,r)))}function LE(e){let t=jE(e),n=tu(),r=!0;const o=c=>(l,u)=>{var f;const d=Rr(e,u,c==="exit"?(f=e.presenceContext)==null?void 0:f.custom:void 0);if(d){const{transition:h,transitionEnd:S,...p}=d;l={...l,...p,...S}}return l};function s(c){t=c(e)}function i(c){const{props:l}=e,u=sm(e.parent)||{},d=[],f=new Set;let h={},S=1/0;for(let b=0;b<IE;b++){const v=NE[b],m=n[v],g=l[v]!==void 0?l[v]:u[v],C=Er(g),y=v===c?m.isActive:null;y===!1&&(S=b);let M=g===u[v]&&g!==l[v]&&C;if(M&&r&&e.manuallyAnimateOnMount&&(M=!1),m.protectedKeys={...h},!m.isActive&&y===null||!g&&!m.prevProp||ps(g)||typeof g=="boolean")continue;const x=VE(m.prevProp,g);let T=x||v===c&&m.isActive&&!M&&C||b>S&&C,R=!1;const _=Array.isArray(g)?g:[g];let O=_.reduce(o(v),{});y===!1&&(O={});const{prevResolvedValues:z={}}=m,G={...z,...O},j=k=>{T=!0,f.has(k)&&(R=!0,f.delete(k)),m.needsAnimating[k]=!0;const P=e.getValue(k);P&&(P.liveStyle=!1)};for(const k in G){const P=O[k],I=z[k];if(h.hasOwnProperty(k))continue;let A=!1;Bi(P)&&Bi(I)?A=!om(P,I):A=P!==I,A?P!=null?j(k):f.add(k):P!==void 0&&f.has(k)?j(k):m.protectedKeys[k]=!0}m.prevProp=g,m.prevResolvedValues=O,m.isActive&&(h={...h,...O}),r&&e.blockInitialAnimation&&(T=!1),T&&(!(M&&x)||R)&&d.push(..._.map(k=>({animation:k,options:{type:v}})))}if(f.size){const b={};if(typeof l.initial!="boolean"){const v=Rr(e,Array.isArray(l.initial)?l.initial[0]:l.initial);v&&v.transition&&(b.transition=v.transition)}f.forEach(v=>{const m=e.getBaseTarget(v),g=e.getValue(v);g&&(g.liveStyle=!0),b[v]=m??null}),d.push({animation:b})}let p=!!d.length;return r&&(l.initial===!1||l.initial===l.animate)&&!e.manuallyAnimateOnMount&&(p=!1),r=!1,p?t(d):Promise.resolve()}function a(c,l){var d;if(n[c].isActive===l)return Promise.resolve();(d=e.variantChildren)==null||d.forEach(f=>{var h;return(h=f.animationState)==null?void 0:h.setActive(c,l)}),n[c].isActive=l;const u=i(c);for(const f in n)n[f].protectedKeys={};return u}return{animateChanges:i,setActive:a,setAnimateFunction:s,getState:()=>n,reset:()=>{n=tu(),r=!0}}}function VE(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!om(t,e):!1}function Jt(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function tu(){return{animate:Jt(!0),whileInView:Jt(),whileHover:Jt(),whileTap:Jt(),whileDrag:Jt(),whileFocus:Jt(),exit:Jt()}}class Yt{constructor(t){this.isMounted=!1,this.node=t}update(){}}class FE extends Yt{constructor(t){super(t),t.animationState||(t.animationState=LE(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();ps(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)==null||t.call(this)}}let $E=0;class BE extends Yt{constructor(){super(...arguments),this.id=$E++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;const o=this.node.animationState.setActive("exit",!t);n&&!t&&o.then(()=>{n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const zE={animation:{Feature:FE},exit:{Feature:BE}};function Pr(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function Kr(e){return{point:{x:e.pageX,y:e.pageY}}}const WE=e=>t=>uc(t)&&e(t,Kr(t));function hr(e,t,n,r){return Pr(e,t,WE(n),r)}function im({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function HE({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function UE(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}const am=1e-4,YE=1-am,KE=1+am,cm=.01,GE=0-cm,qE=0+cm;function ke(e){return e.max-e.min}function XE(e,t,n){return Math.abs(e-t)<=n}function nu(e,t,n,r=.5){e.origin=r,e.originPoint=ge(t.min,t.max,e.origin),e.scale=ke(n)/ke(t),e.translate=ge(n.min,n.max,e.origin)-e.originPoint,(e.scale>=YE&&e.scale<=KE||isNaN(e.scale))&&(e.scale=1),(e.translate>=GE&&e.translate<=qE||isNaN(e.translate))&&(e.translate=0)}function pr(e,t,n,r){nu(e.x,t.x,n.x,r?r.originX:void 0),nu(e.y,t.y,n.y,r?r.originY:void 0)}function ru(e,t,n){e.min=n.min+t.min,e.max=e.min+ke(t)}function ZE(e,t,n){ru(e.x,t.x,n.x),ru(e.y,t.y,n.y)}function ou(e,t,n){e.min=t.min-n.min,e.max=e.min+ke(t)}function mr(e,t,n){ou(e.x,t.x,n.x),ou(e.y,t.y,n.y)}const su=()=>({translate:0,scale:1,origin:0,originPoint:0}),Tn=()=>({x:su(),y:su()}),iu=()=>({min:0,max:0}),xe=()=>({x:iu(),y:iu()});function Ke(e){return[e("x"),e("y")]}function Ks(e){return e===void 0||e===1}function Hi({scale:e,scaleX:t,scaleY:n}){return!Ks(e)||!Ks(t)||!Ks(n)}function Qt(e){return Hi(e)||lm(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function lm(e){return au(e.x)||au(e.y)}function au(e){return e&&e!=="0%"}function Bo(e,t,n){const r=e-n,o=t*r;return n+o}function cu(e,t,n,r,o){return o!==void 0&&(e=Bo(e,o,r)),Bo(e,n,r)+t}function Ui(e,t=0,n=1,r,o){e.min=cu(e.min,t,n,r,o),e.max=cu(e.max,t,n,r,o)}function um(e,{x:t,y:n}){Ui(e.x,t.translate,t.scale,t.originPoint),Ui(e.y,n.translate,n.scale,n.originPoint)}const lu=.999999999999,uu=1.0000000000001;function JE(e,t,n,r=!1){const o=n.length;if(!o)return;t.x=t.y=1;let s,i;for(let a=0;a<o;a++){s=n[a],i=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&&En(e,{x:-s.scroll.offset.x,y:-s.scroll.offset.y}),i&&(t.x*=i.x.scale,t.y*=i.y.scale,um(e,i)),r&&Qt(s.latestValues)&&En(e,s.latestValues))}t.x<uu&&t.x>lu&&(t.x=1),t.y<uu&&t.y>lu&&(t.y=1)}function Dn(e,t){e.min=e.min+t,e.max=e.max+t}function du(e,t,n,r,o=.5){const s=ge(e.min,e.max,o);Ui(e,t,n,s,r)}function En(e,t){du(e.x,t.x,t.scaleX,t.scale,t.originX),du(e.y,t.y,t.scaleY,t.scale,t.originY)}function dm(e,t){return im(UE(e.getBoundingClientRect(),t))}function QE(e,t,n){const r=dm(e,n),{scroll:o}=t;return o&&(Dn(r.x,o.offset.x),Dn(r.y,o.offset.y)),r}const fm=({current:e})=>e?e.ownerDocument.defaultView:null,fu=(e,t)=>Math.abs(e-t);function eM(e,t){const n=fu(e.x,t.x),r=fu(e.y,t.y);return Math.sqrt(n**2+r**2)}class hm{constructor(t,n,{transformPagePoint:r,contextWindow:o,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=qs(this.lastMoveEventInfo,this.history),f=this.startEvent!==null,h=eM(d.offset,{x:0,y:0})>=3;if(!f&&!h)return;const{point:S}=d,{timestamp:p}=De;this.history.push({...S,timestamp:p});const{onStart:b,onMove:v}=this.handlers;f||(b&&b(this.lastMoveEvent,d),this.startEvent=this.lastMoveEvent),v&&v(this.lastMoveEvent,d)},this.handlePointerMove=(d,f)=>{this.lastMoveEvent=d,this.lastMoveEventInfo=Gs(f,this.transformPagePoint),ve.update(this.updatePoint,!0)},this.handlePointerUp=(d,f)=>{this.end();const{onEnd:h,onSessionEnd:S,resumeAnimation:p}=this.handlers;if(this.dragSnapToOrigin&&p&&p(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const b=qs(d.type==="pointercancel"?this.lastMoveEventInfo:Gs(f,this.transformPagePoint),this.history);this.startEvent&&h&&h(d,b),S&&S(d,b)},!uc(t))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=r,this.contextWindow=o||window;const i=Kr(t),a=Gs(i,this.transformPagePoint),{point:c}=a,{timestamp:l}=De;this.history=[{...c,timestamp:l}];const{onSessionStart:u}=n;u&&u(t,qs(a,this.history)),this.removeListeners=Hr(hr(this.contextWindow,"pointermove",this.handlePointerMove),hr(this.contextWindow,"pointerup",this.handlePointerUp),hr(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),zt(this.updatePoint)}}function Gs(e,t){return t?{point:t(e.point)}:e}function hu(e,t){return{x:e.x-t.x,y:e.y-t.y}}function qs({point:e},t){return{point:e,delta:hu(e,pm(t)),offset:hu(e,tM(t)),velocity:nM(t,.1)}}function tM(e){return e[0]}function pm(e){return e[e.length-1]}function nM(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const o=pm(e);for(;n>=0&&(r=e[n],!(o.timestamp-r.timestamp>et(t)));)n--;if(!r)return{x:0,y:0};const s=ut(o.timestamp-r.timestamp);if(s===0)return{x:0,y:0};const i={x:(o.x-r.x)/s,y:(o.y-r.y)/s};return i.x===1/0&&(i.x=0),i.y===1/0&&(i.y=0),i}function rM(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?ge(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?ge(n,e,r.max):Math.min(e,n)),e}function pu(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function oM(e,{top:t,left:n,bottom:r,right:o}){return{x:pu(e.x,n,o),y:pu(e.y,t,r)}}function mu(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function sM(e,t){return{x:mu(e.x,t.x),y:mu(e.y,t.y)}}function iM(e,t){let n=.5;const r=ke(e),o=ke(t);return o>r?n=Cr(t.min,t.max-r,e.min):r>o&&(n=Cr(e.min,e.max-o,t.min)),wt(0,1,n)}function aM(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const Yi=.35;function cM(e=Yi){return e===!1?e=0:e===!0&&(e=Yi),{x:gu(e,"left","right"),y:gu(e,"top","bottom")}}function gu(e,t,n){return{min:vu(e,t),max:vu(e,n)}}function vu(e,t){return typeof e=="number"?e:e[t]||0}const lM=new WeakMap;class uM{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=xe(),this.visualElement=t}start(t,{snapToCursor:n=!1}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const o=u=>{const{dragSnapToOrigin:d}=this.getProps();d?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(Kr(u).point)},s=(u,d)=>{const{drag:f,dragPropagation:h,onDragStart:S}=this.getProps();if(f&&!h&&(this.openDragLock&&this.openDragLock(),this.openDragLock=MD(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),Ke(b=>{let v=this.getAxisMotionValue(b).get()||0;if(dt.test(v)){const{projection:m}=this.visualElement;if(m&&m.layout){const g=m.layout.layoutBox[b];g&&(v=ke(g)*(parseFloat(v)/100))}}this.originPoint[b]=v}),S&&ve.postRender(()=>S(u,d)),zi(this.visualElement,"transform");const{animationState:p}=this.visualElement;p&&p.setActive("whileDrag",!0)},i=(u,d)=>{const{dragPropagation:f,dragDirectionLock:h,onDirectionLock:S,onDrag:p}=this.getProps();if(!f&&!this.openDragLock)return;const{offset:b}=d;if(h&&this.currentDirection===null){this.currentDirection=dM(b),this.currentDirection!==null&&S&&S(this.currentDirection);return}this.updateAxis("x",d.point,b),this.updateAxis("y",d.point,b),this.visualElement.render(),p&&p(u,d)},a=(u,d)=>this.stop(u,d),c=()=>Ke(u=>{var d;return this.getAnimationState(u)==="paused"&&((d=this.getAxisMotionValue(u).animation)==null?void 0:d.play())}),{dragSnapToOrigin:l}=this.getProps();this.panSession=new hm(t,{onSessionStart:o,onStart:s,onMove:i,onSessionEnd:a,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:l,contextWindow:fm(this.visualElement)})}stop(t,n){const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:o}=n;this.startAnimation(o);const{onDragEnd:s}=this.getProps();s&&ve.postRender(()=>s(t,n))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.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(t,n,r){const{drag:o}=this.getProps();if(!r||!ao(t,o,this.currentDirection))return;const s=this.getAxisMotionValue(t);let i=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(i=rM(i,this.constraints[t],this.elastic[t])),s.set(i)}resolveConstraints(){var s;const{dragConstraints:t,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(s=this.visualElement.projection)==null?void 0:s.layout,o=this.constraints;t&&Cn(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=oM(r.layoutBox,t):this.constraints=!1,this.elastic=cM(n),o!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&Ke(i=>{this.constraints!==!1&&this.getAxisMotionValue(i)&&(this.constraints[i]=aM(r.layoutBox[i],this.constraints[i]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Cn(t))return!1;const r=t.current;St(r!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");const{projection:o}=this.visualElement;if(!o||!o.layout)return!1;const s=QE(r,o.root,this.visualElement.getTransformPagePoint());let i=sM(o.layout.layoutBox,s);if(n){const a=n(HE(i));this.hasMutatedConstraints=!!a,a&&(i=im(a))}return i}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:o,dragTransition:s,dragSnapToOrigin:i,onDragTransitionEnd:a}=this.getProps(),c=this.constraints||{},l=Ke(u=>{if(!ao(u,n,this.currentDirection))return;let d=c&&c[u]||{};i&&(d={min:0,max:0});const f=o?200:1e6,h=o?40:1e7,S={type:"inertia",velocity:r?t[u]:0,bounceStiffness:f,bounceDamping:h,timeConstant:750,restDelta:1,restSpeed:10,...s,...d};return this.startAxisValueAnimation(u,S)});return Promise.all(l).then(a)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return zi(this.visualElement,t),r.start(bc(t,r,0,n,this.visualElement,!1))}stopAnimation(){Ke(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Ke(t=>{var n;return(n=this.getAxisMotionValue(t).animation)==null?void 0:n.pause()})}getAnimationState(t){var n;return(n=this.getAxisMotionValue(t).animation)==null?void 0:n.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),o=r[n];return o||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){Ke(n=>{const{drag:r}=this.getProps();if(!ao(n,r,this.currentDirection))return;const{projection:o}=this.visualElement,s=this.getAxisMotionValue(n);if(o&&o.layout){const{min:i,max:a}=o.layout.layoutBox[n];s.set(t[n]-ge(i,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!Cn(n)||!r||!this.constraints)return;this.stopAnimation();const o={x:0,y:0};Ke(i=>{const a=this.getAxisMotionValue(i);if(a&&this.constraints!==!1){const c=a.get();o[i]=iM({min:c,max:c},this.constraints[i])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),Ke(i=>{if(!ao(i,t,null))return;const a=this.getAxisMotionValue(i),{min:c,max:l}=this.constraints[i];a.set(ge(c,l,o[i]))})}addListeners(){if(!this.visualElement.current)return;lM.set(this.visualElement,this);const t=this.visualElement.current,n=hr(t,"pointerdown",c=>{const{drag:l,dragListener:u=!0}=this.getProps();l&&u&&this.start(c)}),r=()=>{const{dragConstraints:c}=this.getProps();Cn(c)&&c.current&&(this.constraints=this.resolveRefConstraints())},{projection:o}=this.visualElement,s=o.addEventListener("measure",r);o&&!o.layout&&(o.root&&o.root.updateScroll(),o.updateLayout()),ve.read(r);const i=Pr(window,"resize",()=>this.scalePositionWithinConstraints()),a=o.addEventListener("didUpdate",({delta:c,hasLayoutChanged:l})=>{this.isDragging&&l&&(Ke(u=>{const d=this.getAxisMotionValue(u);d&&(this.originPoint[u]+=c[u].translate,d.set(d.get()+c[u].translate))}),this.visualElement.render())});return()=>{i(),n(),s(),a&&a()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:o=!1,dragConstraints:s=!1,dragElastic:i=Yi,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:o,dragConstraints:s,dragElastic:i,dragMomentum:a}}}function ao(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function dM(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class fM extends Yt{constructor(t){super(t),this.removeGroupControls=Xe,this.removeListeners=Xe,this.controls=new uM(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Xe}unmount(){this.removeGroupControls(),this.removeListeners()}}const yu=e=>(t,n)=>{e&&ve.postRender(()=>e(t,n))};class hM extends Yt{constructor(){super(...arguments),this.removePointerDownListener=Xe}onPointerDown(t){this.session=new hm(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:fm(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:o}=this.node.getProps();return{onSessionStart:yu(t),onStart:yu(n),onMove:r,onEnd:(s,i)=>{delete this.session,o&&ve.postRender(()=>o(s,i))}}}mount(){this.removePointerDownListener=hr(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const Co={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function bu(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Qn={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(re.test(e))e=parseFloat(e);else return e;const n=bu(e,t.target.x),r=bu(e,t.target.y);return`${n}% ${r}%`}},pM={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,o=Wt.parse(e);if(o.length>5)return r;const s=Wt.createTransformer(e),i=typeof o[0]!="number"?1:0,a=n.x.scale*t.x,c=n.y.scale*t.y;o[0+i]/=a,o[1+i]/=c;const l=ge(a,c,.5);return typeof o[2+i]=="number"&&(o[2+i]/=l),typeof o[3+i]=="number"&&(o[3+i]/=l),s(o)}};class mM extends E.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:o}=this.props,{projection:s}=t;QD(gM),s&&(n.group&&n.group.add(s),r&&r.register&&o&&r.register(s),s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,onExitComplete:()=>this.safeToRemove()})),Co.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:o,isPresent:s}=this.props,{projection:i}=r;return i&&(i.isPresent=s,o||t.layoutDependency!==n||n===void 0||t.isPresent!==s?i.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?i.promote():i.relegate()||ve.postRender(()=>{const a=i.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),lc.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:o}=t;o&&(o.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(o),r&&r.deregister&&r.deregister(o))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function mm(e){const[t,n]=jD(),r=E.useContext(Zh);return w.jsx(mM,{...e,layoutGroup:r,switchLayoutGroup:E.useContext(Kp),isPresent:t,safeToRemove:n})}const gM={borderRadius:{...Qn,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Qn,borderTopRightRadius:Qn,borderBottomLeftRadius:Qn,borderBottomRightRadius:Qn,boxShadow:pM};function vM(e,t,n){const r=Pe(e)?e:_n(e);return r.start(bc("",r,t,n)),r.animation}const yM=(e,t)=>e.depth-t.depth;class bM{constructor(){this.children=[],this.isDirty=!1}add(t){Ha(this.children,t),this.isDirty=!0}remove(t){Ua(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(yM),this.isDirty=!1,this.children.forEach(t)}}function xM(e,t){const n=Le.now(),r=({timestamp:o})=>{const s=o-n;s>=t&&(zt(r),e(s-t))};return ve.setup(r,!0),()=>zt(r)}const gm=["TopLeft","TopRight","BottomLeft","BottomRight"],wM=gm.length,xu=e=>typeof e=="string"?parseFloat(e):e,wu=e=>typeof e=="number"||re.test(e);function SM(e,t,n,r,o,s){o?(e.opacity=ge(0,n.opacity??1,CM(r)),e.opacityExit=ge(t.opacity??1,0,TM(r))):s&&(e.opacity=ge(t.opacity??1,n.opacity??1,r));for(let i=0;i<wM;i++){const a=`border${gm[i]}Radius`;let c=Su(t,a),l=Su(n,a);if(c===void 0&&l===void 0)continue;c||(c=0),l||(l=0),c===0||l===0||wu(c)===wu(l)?(e[a]=Math.max(ge(xu(c),xu(l),r),0),(dt.test(l)||dt.test(c))&&(e[a]+="%")):e[a]=l}(t.rotate||n.rotate)&&(e.rotate=ge(t.rotate||0,n.rotate||0,r))}function Su(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const CM=vm(0,.5,cp),TM=vm(.5,.95,Xe);function vm(e,t,n){return r=>r<e?0:r>t?1:n(Cr(e,t,r))}function Cu(e,t){e.min=t.min,e.max=t.max}function Ye(e,t){Cu(e.x,t.x),Cu(e.y,t.y)}function Tu(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function Du(e,t,n,r,o){return e-=t,e=Bo(e,1/n,r),o!==void 0&&(e=Bo(e,1/o,r)),e}function DM(e,t=0,n=1,r=.5,o,s=e,i=e){if(dt.test(t)&&(t=parseFloat(t),t=ge(i.min,i.max,t/100)-i.min),typeof t!="number")return;let a=ge(s.min,s.max,r);e===s&&(a-=t),e.min=Du(e.min,t,n,a,o),e.max=Du(e.max,t,n,a,o)}function Eu(e,t,[n,r,o],s,i){DM(e,t[n],t[r],t[o],t.scale,s,i)}const EM=["x","scaleX","originX"],MM=["y","scaleY","originY"];function Mu(e,t,n,r){Eu(e.x,t,EM,n?n.x:void 0,r?r.x:void 0),Eu(e.y,t,MM,n?n.y:void 0,r?r.y:void 0)}function Ru(e){return e.translate===0&&e.scale===1}function ym(e){return Ru(e.x)&&Ru(e.y)}function Pu(e,t){return e.min===t.min&&e.max===t.max}function RM(e,t){return Pu(e.x,t.x)&&Pu(e.y,t.y)}function Au(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function bm(e,t){return Au(e.x,t.x)&&Au(e.y,t.y)}function Ou(e){return ke(e.x)/ke(e.y)}function ku(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class PM{constructor(){this.members=[]}add(t){Ha(this.members,t),t.scheduleRender()}remove(t){if(Ua(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(o=>t===o);if(n===0)return!1;let r;for(let o=n;o>=0;o--){const s=this.members[o];if(s.isPresent!==!1){r=s;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:o}=t.options;o===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function AM(e,t,n){let r="";const o=e.x.translate/t.x,s=e.y.translate/t.y,i=(n==null?void 0:n.z)||0;if((o||s||i)&&(r=`translate3d(${o}px, ${s}px, ${i}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:l,rotate:u,rotateX:d,rotateY:f,skewX:h,skewY:S}=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) `),S&&(r+=`skewY(${S}deg) `)}const a=e.x.scale*t.x,c=e.y.scale*t.y;return(a!==1||c!==1)&&(r+=`scale(${a}, ${c})`),r||"none"}const Xs=["","X","Y","Z"],OM={visibility:"hidden"},kM=1e3;let _M=0;function Zs(e,t,n,r){const{latestValues:o}=t;o[e]&&(n[e]=o[e],t.setStaticValue(e,0),r&&(r[e]=0))}function xm(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=nm(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:o,layoutId:s}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",ve,!(o||s))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&xm(r)}function wm({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:o}){return class{constructor(i={},a=t==null?void 0:t()){this.id=_M++,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,this.nodes.forEach(jM),this.nodes.forEach(BM),this.nodes.forEach(zM),this.nodes.forEach(LM)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=i,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 bM)}addEventListener(i,a){return this.eventHandlers.has(i)||this.eventHandlers.set(i,new Ka),this.eventHandlers.get(i).add(a)}notifyListeners(i,...a){const c=this.eventHandlers.get(i);c&&c.notify(...a)}hasListeners(i){return this.eventHandlers.has(i)}mount(i){if(this.instance)return;this.isSVG=Bp(i)&&!_D(i),this.instance=i;const{layoutId:a,layout:c,visualElement:l}=this.options;if(l&&!l.current&&l.mount(i),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(c||a)&&(this.isLayoutDirty=!0),e){let u;const d=()=>this.root.updateBlockedByResize=!1;e(i,()=>{this.root.updateBlockedByResize=!0,u&&u(),u=xM(d,250),Co.hasAnimatedSinceResize&&(Co.hasAnimatedSinceResize=!1,this.nodes.forEach(Nu))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&l&&(a||c)&&this.addEventListener("didUpdate",({delta:u,hasLayoutChanged:d,hasRelativeLayoutChanged:f,layout:h})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const S=this.options.transition||l.getDefaultTransition()||KM,{onLayoutAnimationStart:p,onLayoutAnimationComplete:b}=l.getProps(),v=!this.targetLayout||!bm(this.targetLayout,h),m=!d&&f;if(this.options.layoutRoot||this.resumeFrom||m||d&&(v||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(u,m);const g={...ac(S,"layout"),onPlay:p,onComplete:b};(l.shouldReduceMotion||this.options.layoutRoot)&&(g.delay=0,g.type=!1),this.startAnimation(g)}else d||Nu(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=h})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const i=this.getStack();i&&i.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),zt(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(WM),this.animationId++)}getTransformTemplate(){const{visualElement:i}=this.options;return i&&i.getProps().transformTemplate}willUpdate(i=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&xm(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(),i&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(_u);return}this.isUpdating||this.nodes.forEach(FM),this.isUpdating=!1,this.nodes.forEach($M),this.nodes.forEach(NM),this.nodes.forEach(IM),this.clearAllSnapshots();const a=Le.now();De.delta=wt(0,1e3/60,a-De.timestamp),De.timestamp=a,De.isProcessing=!0,zs.update.process(De),zs.preRender.process(De),zs.render.process(De),De.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,lc.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(VM),this.sharedNodes.forEach(HM)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,ve.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){ve.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!ke(this.snapshot.measuredBox.x)&&!ke(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let c=0;c<this.path.length;c++)this.path[c].updateScroll();const i=this.layout;this.layout=this.measure(!1),this.layoutCorrected=xe(),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,i?i.layoutBox:void 0)}updateScroll(i="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===i&&(a=!1),a&&this.instance){const c=r(this.instance);this.scroll={animationId:this.root.animationId,phase:i,isRoot:c,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:c}}}resetTransform(){if(!o)return;const i=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!ym(this.projectionDelta),c=this.getTransformTemplate(),l=c?c(this.latestValues,""):void 0,u=l!==this.prevTransformTemplateValue;i&&this.instance&&(a||Qt(this.latestValues)||u)&&(o(this.instance,l),this.shouldResetTransform=!1,this.scheduleRender())}measure(i=!0){const a=this.measurePageBox();let c=this.removeElementScroll(a);return i&&(c=this.removeTransform(c)),GM(c),{animationId:this.root.animationId,measuredBox:a,layoutBox:c,latestValues:{},source:this.id}}measurePageBox(){var l;const{visualElement:i}=this.options;if(!i)return xe();const a=i.measureViewportBox();if(!(((l=this.scroll)==null?void 0:l.wasRoot)||this.path.some(qM))){const{scroll:u}=this.root;u&&(Dn(a.x,u.offset.x),Dn(a.y,u.offset.y))}return a}removeElementScroll(i){var c;const a=xe();if(Ye(a,i),(c=this.scroll)!=null&&c.wasRoot)return a;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&&Ye(a,i),Dn(a.x,d.offset.x),Dn(a.y,d.offset.y))}return a}applyTransform(i,a=!1){const c=xe();Ye(c,i);for(let l=0;l<this.path.length;l++){const u=this.path[l];!a&&u.options.layoutScroll&&u.scroll&&u!==u.root&&En(c,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),Qt(u.latestValues)&&En(c,u.latestValues)}return Qt(this.latestValues)&&En(c,this.latestValues),c}removeTransform(i){const a=xe();Ye(a,i);for(let c=0;c<this.path.length;c++){const l=this.path[c];if(!l.instance||!Qt(l.latestValues))continue;Hi(l.latestValues)&&l.updateSnapshot();const u=xe(),d=l.measurePageBox();Ye(u,d),Mu(a,l.latestValues,l.snapshot?l.snapshot.layoutBox:void 0,u)}return Qt(this.latestValues)&&Mu(a,this.latestValues),a}setTargetDelta(i){this.targetDelta=i,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(i){this.options={...this.options,...i,crossfade:i.crossfade!==void 0?i.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!==De.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(i=!1){var f;const a=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=a.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=a.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=a.isSharedProjectionDirty);const c=!!this.resumingFrom||this!==a;if(!(i||c&&this.isSharedProjectionDirty||this.isProjectionDirty||(f=this.parent)!=null&&f.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:u,layoutId:d}=this.options;if(!(!this.layout||!(u||d))){if(this.resolvedRelativeTargetAt=De.timestamp,!this.targetDelta&&!this.relativeTarget){const h=this.getClosestProjectingParent();h&&h.layout&&this.animationProgress!==1?(this.relativeParent=h,this.forceRelativeParentToResolveTarget(),this.relativeTarget=xe(),this.relativeTargetOrigin=xe(),mr(this.relativeTargetOrigin,this.layout.layoutBox,h.layout.layoutBox),Ye(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=xe(),this.targetWithTransforms=xe()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),ZE(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Ye(this.target,this.layout.layoutBox),um(this.target,this.targetDelta)):Ye(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=xe(),this.relativeTargetOrigin=xe(),mr(this.relativeTargetOrigin,this.target,h.target),Ye(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(!(!this.parent||Hi(this.parent.latestValues)||lm(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 S;const i=this.getLead(),a=!!this.resumingFrom||this!==i;let c=!0;if((this.isProjectionDirty||(S=this.parent)!=null&&S.isProjectionDirty)&&(c=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(c=!1),this.resolvedRelativeTargetAt===De.timestamp&&(c=!1),c)return;const{layout:l,layoutId:u}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(l||u))return;Ye(this.layoutCorrected,this.layout.layoutBox);const d=this.treeScale.x,f=this.treeScale.y;JE(this.layoutCorrected,this.treeScale,this.path,a),i.layout&&!i.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(i.target=i.layout.layoutBox,i.targetWithTransforms=xe());const{target:h}=i;if(!h){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Tu(this.prevProjectionDelta.x,this.projectionDelta.x),Tu(this.prevProjectionDelta.y,this.projectionDelta.y)),pr(this.projectionDelta,this.layoutCorrected,h,this.latestValues),(this.treeScale.x!==d||this.treeScale.y!==f||!ku(this.projectionDelta.x,this.prevProjectionDelta.x)||!ku(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",h))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(i=!0){var a;if((a=this.options.visualElement)==null||a.scheduleRender(),i){const c=this.getStack();c&&c.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Tn(),this.projectionDelta=Tn(),this.projectionDeltaWithTransform=Tn()}setAnimationOrigin(i,a=!1){const c=this.snapshot,l=c?c.latestValues:{},u={...this.latestValues},d=Tn();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const f=xe(),h=c?c.source:void 0,S=this.layout?this.layout.source:void 0,p=h!==S,b=this.getStack(),v=!b||b.members.length<=1,m=!!(p&&!v&&this.options.crossfade===!0&&!this.path.some(YM));this.animationProgress=0;let g;this.mixTargetDelta=C=>{const y=C/1e3;Iu(d.x,i.x,y),Iu(d.y,i.y,y),this.setTargetDelta(d),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(mr(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox),UM(this.relativeTarget,this.relativeTargetOrigin,f,y),g&&RM(this.relativeTarget,g)&&(this.isProjectionDirty=!1),g||(g=xe()),Ye(g,this.relativeTarget)),p&&(this.animationValues=u,SM(u,l,this.latestValues,y,m,v)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=y},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(i){var a,c,l;this.notifyListeners("animationStart"),(a=this.currentAnimation)==null||a.stop(!1),(l=(c=this.resumingFrom)==null?void 0:c.currentAnimation)==null||l.stop(!1),this.pendingAnimation&&(zt(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=ve.update(()=>{Co.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=_n(0)),this.currentAnimation=vM(this.motionValue,[0,1e3],{...i,isSync:!0,onUpdate:u=>{this.mixTargetDelta(u),i.onUpdate&&i.onUpdate(u)},onStop:()=>{},onComplete:()=>{i.onComplete&&i.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 i=this.getStack();i&&i.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(kM),this.currentAnimation.stop(!1)),this.completeAnimation()}applyTransformsToTarget(){const i=this.getLead();let{targetWithTransforms:a,target:c,layout:l,latestValues:u}=i;if(!(!a||!c||!l)){if(this!==i&&this.layout&&l&&Sm(this.options.animationType,this.layout.layoutBox,l.layoutBox)){c=this.target||xe();const d=ke(this.layout.layoutBox.x);c.x.min=i.target.x.min,c.x.max=c.x.min+d;const f=ke(this.layout.layoutBox.y);c.y.min=i.target.y.min,c.y.max=c.y.min+f}Ye(a,c),En(a,u),pr(this.projectionDeltaWithTransform,this.layoutCorrected,a,u)}}registerSharedNode(i,a){this.sharedNodes.has(i)||this.sharedNodes.set(i,new PM),this.sharedNodes.get(i).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 i=this.getStack();return i?i.lead===this:!0}getLead(){var a;const{layoutId:i}=this.options;return i?((a=this.getStack())==null?void 0:a.lead)||this:this}getPrevLead(){var a;const{layoutId:i}=this.options;return i?(a=this.getStack())==null?void 0:a.prevLead:void 0}getStack(){const{layoutId:i}=this.options;if(i)return this.root.sharedNodes.get(i)}promote({needsReset:i,transition:a,preserveFollowOpacity:c}={}){const l=this.getStack();l&&l.promote(this,c),i&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const i=this.getStack();return i?i.relegate(this):!1}resetSkewAndRotation(){const{visualElement:i}=this.options;if(!i)return;let a=!1;const{latestValues:c}=i;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(a=!0),!a)return;const l={};c.z&&Zs("z",i,l,this.animationValues);for(let u=0;u<Xs.length;u++)Zs(`rotate${Xs[u]}`,i,l,this.animationValues),Zs(`skew${Xs[u]}`,i,l,this.animationValues);i.render();for(const u in l)i.setStaticValue(u,l[u]),this.animationValues&&(this.animationValues[u]=l[u]);i.scheduleRender()}getProjectionStyles(i){if(!this.instance||this.isSVG)return;if(!this.isVisible)return OM;const a={visibility:""},c=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,a.opacity="",a.pointerEvents=So(i==null?void 0:i.pointerEvents)||"",a.transform=c?c(this.latestValues,""):"none",a;const l=this.getLead();if(!this.projectionDelta||!this.layout||!l.target){const h={};return this.options.layoutId&&(h.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,h.pointerEvents=So(i==null?void 0:i.pointerEvents)||""),this.hasProjected&&!Qt(this.latestValues)&&(h.transform=c?c({},""):"none",this.hasProjected=!1),h}const u=l.animationValues||l.latestValues;this.applyTransformsToTarget(),a.transform=AM(this.projectionDeltaWithTransform,this.treeScale,u),c&&(a.transform=c(u,a.transform));const{x:d,y:f}=this.projectionDelta;a.transformOrigin=`${d.origin*100}% ${f.origin*100}% 0`,l.animationValues?a.opacity=l===this?u.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:u.opacityExit:a.opacity=l===this?u.opacity!==void 0?u.opacity:"":u.opacityExit!==void 0?u.opacityExit:0;for(const h in Mr){if(u[h]===void 0)continue;const{correct:S,applyTo:p,isCSSVariable:b}=Mr[h],v=a.transform==="none"?u[h]:S(u[h],l);if(p){const m=p.length;for(let g=0;g<m;g++)a[p[g]]=v}else b?this.options.visualElement.renderState.vars[h]=v:a[h]=v}return this.options.layoutId&&(a.pointerEvents=l===this?So(i==null?void 0:i.pointerEvents)||"":"none"),a}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(i=>{var a;return(a=i.currentAnimation)==null?void 0:a.stop(!1)}),this.root.nodes.forEach(_u),this.root.sharedNodes.clear()}}}function NM(e){e.updateLayout()}function IM(e){var n;const t=((n=e.resumeFrom)==null?void 0:n.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:o}=e.layout,{animationType:s}=e.options,i=t.source!==e.layout.source;s==="size"?Ke(d=>{const f=i?t.measuredBox[d]:t.layoutBox[d],h=ke(f);f.min=r[d].min,f.max=f.min+h}):Sm(s,t.layoutBox,r)&&Ke(d=>{const f=i?t.measuredBox[d]:t.layoutBox[d],h=ke(r[d]);f.max=f.min+h,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[d].max=e.relativeTarget[d].min+h)});const a=Tn();pr(a,r,t.layoutBox);const c=Tn();i?pr(c,e.applyTransform(o,!0),t.measuredBox):pr(c,r,t.layoutBox);const l=!ym(a);let u=!1;if(!e.resumeFrom){const d=e.getClosestProjectingParent();if(d&&!d.resumeFrom){const{snapshot:f,layout:h}=d;if(f&&h){const S=xe();mr(S,t.layoutBox,f.layoutBox);const p=xe();mr(p,r,h.layoutBox),bm(S,p)||(u=!0),d.options.layoutRoot&&(e.relativeTarget=p,e.relativeTargetOrigin=S,e.relativeParent=d)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:t,delta:c,layoutDelta:a,hasLayoutChanged:l,hasRelativeLayoutChanged:u})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function jM(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function LM(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function VM(e){e.clearSnapshot()}function _u(e){e.clearMeasurements()}function FM(e){e.isLayoutDirty=!1}function $M(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Nu(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function BM(e){e.resolveTargetDelta()}function zM(e){e.calcProjection()}function WM(e){e.resetSkewAndRotation()}function HM(e){e.removeLeadSnapshot()}function Iu(e,t,n){e.translate=ge(t.translate,0,n),e.scale=ge(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function ju(e,t,n,r){e.min=ge(t.min,n.min,r),e.max=ge(t.max,n.max,r)}function UM(e,t,n,r){ju(e.x,t.x,n.x,r),ju(e.y,t.y,n.y,r)}function YM(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const KM={duration:.45,ease:[.4,0,.1,1]},Lu=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Vu=Lu("applewebkit/")&&!Lu("chrome/")?Math.round:Xe;function Fu(e){e.min=Vu(e.min),e.max=Vu(e.max)}function GM(e){Fu(e.x),Fu(e.y)}function Sm(e,t,n){return e==="position"||e==="preserve-aspect"&&!XE(Ou(t),Ou(n),.2)}function qM(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const XM=wm({attachResizeListener:(e,t)=>Pr(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Js={current:void 0},Cm=wm({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Js.current){const e=new XM({});e.mount(window),e.setOptions({layoutScroll:!0}),Js.current=e}return Js.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),ZM={pan:{Feature:hM},drag:{Feature:fM,ProjectionNode:Cm,MeasureLayout:mm}};function $u(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const o="onHover"+n,s=r[o];s&&ve.postRender(()=>s(t,Kr(t)))}class JM extends Yt{mount(){const{current:t}=this.node;t&&(this.unmount=RD(t,(n,r)=>($u(this.node,r,"Start"),o=>$u(this.node,o,"End"))))}unmount(){}}class QM extends Yt{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!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=Hr(Pr(this.node.current,"focus",()=>this.onFocus()),Pr(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Bu(e,t,n){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const o="onTap"+(n==="End"?"":n),s=r[o];s&&ve.postRender(()=>s(t,Kr(t)))}class eR extends Yt{mount(){const{current:t}=this.node;t&&(this.unmount=kD(t,(n,r)=>(Bu(this.node,r,"Start"),(o,{success:s})=>Bu(this.node,o,s?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const Ki=new WeakMap,Qs=new WeakMap,tR=e=>{const t=Ki.get(e.target);t&&t(e)},nR=e=>{e.forEach(tR)};function rR({root:e,...t}){const n=e||document;Qs.has(n)||Qs.set(n,{});const r=Qs.get(n),o=JSON.stringify(t);return r[o]||(r[o]=new IntersectionObserver(nR,{root:e,...t})),r[o]}function oR(e,t,n){const r=rR(t);return Ki.set(e,n),r.observe(e),()=>{Ki.delete(e),r.unobserve(e)}}const sR={some:0,all:1};class iR extends Yt{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:o="some",once:s}=t,i={root:n?n.current:void 0,rootMargin:r,threshold:typeof o=="number"?o:sR[o]},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 oR(this.node.current,i,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(aR(t,n))&&this.startObserver()}unmount(){}}function aR({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const cR={inView:{Feature:iR},tap:{Feature:eR},focus:{Feature:QM},hover:{Feature:JM}},lR={layout:{ProjectionNode:Cm,MeasureLayout:mm}},Gi={current:null},Tm={current:!1};function uR(){if(Tm.current=!0,!!za)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Gi.current=e.matches;e.addListener(t),t()}else Gi.current=!1}const dR=new WeakMap;function fR(e,t,n){for(const r in t){const o=t[r],s=n[r];if(Pe(o))e.addValue(r,o);else if(Pe(s))e.addValue(r,_n(o,{owner:e}));else if(s!==o)if(e.hasValue(r)){const i=e.getValue(r);i.liveStyle===!0?i.jump(o):i.hasAnimated||i.set(o)}else{const i=e.getStaticValue(r);e.addValue(r,_n(i!==void 0?i:o,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const zu=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class hR{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:o,blockInitialAnimation:s,visualState:i},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=ic,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 f=Le.now();this.renderScheduledAt<f&&(this.renderScheduledAt=f,ve.render(this.render,!1,!0))};const{latestValues:c,renderState:l}=i;this.latestValues=c,this.baseTarget={...c},this.initialValues=n.initial?{...c}:{},this.renderState=l,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=o,this.options=a,this.blockInitialAnimation=!!s,this.isControllingVariants=ms(n),this.isVariantNode=Up(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:u,...d}=this.scrapeMotionValuesFromProps(n,{},this);for(const f in d){const h=d[f];c[f]!==void 0&&Pe(h)&&h.set(c[f],!1)}}mount(t){this.current=t,dR.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,r)=>this.bindToMotionValue(r,n)),Tm.current||uR(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:Gi.current,process.env.NODE_ENV!=="production"&&Ga(this.shouldReduceMotion!==!0,"You have Reduced Motion enabled on your device. Animations may not appear as expected."),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),zt(this.notifyUpdate),zt(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const r=Un.has(t);r&&this.onBindTransform&&this.onBindTransform();const o=n.on("change",a=>{this.latestValues[t]=a,this.props.onUpdate&&ve.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0)}),s=n.on("renderRequest",this.scheduleRender);let i;window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{o(),s(),i&&i(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in Nn){const n=Nn[t];if(!n)continue;const{isEnabled:r,Feature:o}=n;if(!this.features[t]&&o&&r(this.props)&&(this.features[t]=new o(this)),this.features[t]){const s=this.features[t];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):xe()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<zu.length;r++){const o=zu[r];this.propEventSubscriptions[o]&&(this.propEventSubscriptions[o](),delete this.propEventSubscriptions[o]);const s="on"+o,i=t[s];i&&(this.propEventSubscriptions[o]=this.on(o,i))}this.prevMotionValues=fR(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]: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(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=_n(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){let r=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return r!=null&&(typeof r=="string"&&(Jh(r)||ep(r))?r=parseFloat(r):!ID(r)&&Wt.test(n)&&(r=jp(t,n)),this.setBaseTarget(t,Pe(r)?r.get():r)),Pe(r)?r.get():r}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var s;const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const i=vc(this.props,n,(s=this.presenceContext)==null?void 0:s.custom);i&&(r=i[t])}if(n&&r!==void 0)return r;const o=this.getBaseTargetFromProps(this.props,t);return o!==void 0&&!Pe(o)?o:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new Ka),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class Dm extends hR{constructor(){super(...arguments),this.KeyframeResolver=CD}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Pe(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function Em(e,{style:t,vars:n},r,o){Object.assign(e.style,t,o&&o.getProjectionStyles(r));for(const s in n)e.style.setProperty(s,n[s])}function pR(e){return window.getComputedStyle(e)}class mR extends Dm{constructor(){super(...arguments),this.type="html",this.renderInstance=Em}readValueFromInstance(t,n){var r;if(Un.has(n))return(r=this.projection)!=null&&r.isProjecting?Ii(n):BT(t,n);{const o=pR(t),s=(Za(n)?o.getPropertyValue(n):o[n])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(t,{transformPagePoint:n}){return dm(t,n)}build(t,n,r){pc(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return yc(t,n,r)}}const Mm=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 gR(e,t,n,r){Em(e,t,void 0,r);for(const o in t.attrs)e.setAttribute(Mm.has(o)?o:hc(o),t.attrs[o])}class vR extends Dm{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=xe}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Un.has(n)){const r=Ip(n);return r&&r.default||0}return n=Mm.has(n)?n:hc(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return tm(t,n,r)}build(t,n,r){Zp(t,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,n,r,o){gR(t,n,r,o)}mount(t){this.isSVGTag=Qp(t.tagName),super.mount(t)}}const yR=(e,t)=>gc(e)?new vR(t):new mR(t,{allowProjection:e!==E.Fragment}),bR=gE({...zE,...cR,...ZM,...lR},yR),xR=BD(bR),wR=({children:e})=>w.jsx(Py,{modifiers:[LC],dropAnimation:{duration:500,easing:"cubic-bezier(0.18, 0.67, 0.6, 1.22)"},className:"Draggable dragging",children:w.jsx(xR.div,{style:{height:"100%",width:"100%",border:"2px solid #f6543b",borderRadius:"8px",boxShadow:"0 0 0 4px rgba(246, 140, 59, 0.2), 0 4px 12px rgba(228, 3, 3, 0.15)"},initial:{scale:.7,opacity:0},animate:{scale:1,opacity:1},transition:{duration:.4,ease:[.22,1,.36,1],mass:.5},children:e})}),xc=Uo(e=>({startAt:"",booking:null,slotData:null,updateStartAt:t=>e(n=>({...n,startAt:t})),updateBooking:t=>{e(n=>{var r;return(t==null?void 0:t.startAt)!==((r=n.booking)==null?void 0:r.startAt)?{...n,booking:t}:n})},updateSlotData:t=>{e(n=>({...n,slotData:t}))}})),SR=-Math.abs(1.98),Rm=({booking:e,onAddTime:t,onAddStartTime:n,onSubTime:r,starter:o=!1})=>{const[s,i]=E.useState({height:jt,width:jt}),[a,c]=E.useState(0),l=(M,x)=>{const T=Z.timeDiffInSeconds(M,x),R=Math.ceil(T/ci);return-Math.abs((R-1)*2)},[u,d]=E.useState(o?l(e.finishAt,e.startAt):0),f=M=>M===-Math.abs(0)||M===0,h=()=>Z.timeDiffInSeconds(e.finishAt,e.startAt)===ci,S=async M=>{if(M.includes("n")){const x=v(e.startAt,"add");if(h())return;c(T=>T+2),n&&n(x)}else{const x=b(e.finishAt,"add");d(T=>f(T)?SR:T-2),t&&t(x)}},p=async M=>{if(M.includes("n")){const T=v(e.startAt,"remove");c(R=>R-2),n&&n(T);return}const x=b(e.finishAt,"remove");h()||(d(T=>T+2),r&&r(x))},b=(M,x)=>{const T=new Date(M),R=T.getMinutes();return x==="add"&&T.setMinutes(R+15),x==="remove"&&T.setMinutes(R-15),T},v=(M,x)=>{const T=new Date(M),R=T.getMinutes();return x==="add"&&T.setMinutes(R+15),x==="remove"&&T.setMinutes(R-15),T};return{state:s,setState:i,resetState:()=>{i({height:jt,width:jt})},resetHeightStyle:()=>{d(0)},heightStyle:u,topHeightIncrement:a,onResize:(M,{size:x,handle:T})=>{switch(M.stopPropagation(),M.preventDefault(),T){case"se":case"s":{i(R=>(Number(R.height)<Number(x.height)&&S(["s","se"]),Number(R.height)>Number(x.height)&&p(["s","se"]),{...R,height:x.height}));break}case"n":{i(R=>Math.abs(Number(x.height-Number(R.height)))<10?{...R,height:x.height}:(+(R.height<Number(x.height))&&p(["n"]),+(R.height>Number(x.height))&&S(["n"]),{...R,height:x.height}));break}}},updateHeightStyle:(M,x)=>{d(l(M,x))}}};var wc="Popover",[Pm,LA]=Ht(wc,[Ut]),Gr=Ut(),[CR,Kt]=Pm(wc),Am=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:o,onOpenChange:s,modal:i=!1}=e,a=Gr(t),c=D.useRef(null),[l,u]=D.useState(!1),[d=!1,f]=ln({prop:r,defaultProp:o,onChange:s});return w.jsx(ts,{...a,children:w.jsx(CR,{scope:t,contentId:Vt(),triggerRef:c,open:d,onOpenChange:f,onOpenToggle:D.useCallback(()=>f(h=>!h),[f]),hasCustomAnchor:l,onCustomAnchorAdd:D.useCallback(()=>u(!0),[]),onCustomAnchorRemove:D.useCallback(()=>u(!1),[]),modal:i,children:n})})};Am.displayName=wc;var Om="PopoverAnchor",km=D.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Kt(Om,n),s=Gr(n),{onCustomAnchorAdd:i,onCustomAnchorRemove:a}=o;return D.useEffect(()=>(i(),()=>a()),[i,a]),w.jsx(Vr,{...s,...r,ref:t})});km.displayName=Om;var _m="PopoverTrigger",Nm=D.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Kt(_m,n),s=Gr(n),i=fe(t,o.triggerRef),a=w.jsx(ae.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Fm(o.open),...r,ref:i,onClick:te(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?a:w.jsx(Vr,{asChild:!0,...s,children:a})});Nm.displayName=_m;var Sc="PopoverPortal",[TR,DR]=Pm(Sc,{forceMount:void 0}),Im=e=>{const{__scopePopover:t,forceMount:n,children:r,container:o}=e,s=Kt(Sc,t);return w.jsx(TR,{scope:t,forceMount:n,children:w.jsx(Dt,{present:n||s.open,children:w.jsx(Fr,{asChild:!0,container:o,children:r})})})};Im.displayName=Sc;var In="PopoverContent",jm=D.forwardRef((e,t)=>{const n=DR(In,e.__scopePopover),{forceMount:r=n.forceMount,...o}=e,s=Kt(In,e.__scopePopover);return w.jsx(Dt,{present:r||s.open,children:s.modal?w.jsx(MR,{...o,ref:t}):w.jsx(RR,{...o,ref:t})})});jm.displayName=In;var ER=sn("PopoverContent.RemoveScroll"),MR=D.forwardRef((e,t)=>{const n=Kt(In,e.__scopePopover),r=D.useRef(null),o=fe(t,r),s=D.useRef(!1);return D.useEffect(()=>{const i=r.current;if(i)return Aa(i)},[]),w.jsx(us,{as:ER,allowPinchZoom:!0,children:w.jsx(Lm,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:te(e.onCloseAutoFocus,i=>{var a;i.preventDefault(),s.current||(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:te(e.onPointerDownOutside,i=>{const a=i.detail.originalEvent,c=a.button===0&&a.ctrlKey===!0,l=a.button===2||c;s.current=l},{checkForDefaultPrevented:!1}),onFocusOutside:te(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1})})})}),RR=D.forwardRef((e,t)=>{const n=Kt(In,e.__scopePopover),r=D.useRef(!1),o=D.useRef(!1);return w.jsx(Lm,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var i,a;(i=e.onCloseAutoFocus)==null||i.call(e,s),s.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),s.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:s=>{var c,l;(c=e.onInteractOutside)==null||c.call(e,s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const i=s.target;((l=n.triggerRef.current)==null?void 0:l.contains(i))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&o.current&&s.preventDefault()}})}),Lm=D.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:s,disableOutsidePointerEvents:i,onEscapeKeyDown:a,onPointerDownOutside:c,onFocusOutside:l,onInteractOutside:u,...d}=e,f=Kt(In,n),h=Gr(n);return Pa(),w.jsx(as,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:s,children:w.jsx(jr,{asChild:!0,disableOutsidePointerEvents:i,onInteractOutside:u,onEscapeKeyDown:a,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>f.onOpenChange(!1),children:w.jsx(ns,{"data-state":Fm(f.open),role:"dialog",id:f.contentId,...h,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),Vm="PopoverClose",PR=D.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Kt(Vm,n);return w.jsx(ae.button,{type:"button",...r,ref:t,onClick:te(e.onClick,()=>o.onOpenChange(!1))})});PR.displayName=Vm;var AR="PopoverArrow",OR=D.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Gr(n);return w.jsx(rs,{...o,...r,ref:t})});OR.displayName=AR;function Fm(e){return e?"open":"closed"}var kR=Am,_R=km,NR=Nm,IR=Im,jR=jm;function LR({...e}){return w.jsx(kR,{"data-slot":"popover",...e})}function VR({...e}){return w.jsx(NR,{"data-slot":"popover-trigger",...e})}function FR({className:e,align:t="center",sideOffset:n=4,...r}){return w.jsx(IR,{children:w.jsx(jR,{"data-slot":"popover-content",align:t,sideOffset:n,className:ce("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 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",e),...r})})}function $R({...e}){return w.jsx(_R,{"data-slot":"popover-anchor",...e})}var BR="Toggle",$m=D.forwardRef((e,t)=>{const{pressed:n,defaultPressed:r=!1,onPressedChange:o,...s}=e,[i=!1,a]=ln({prop:n,onChange:o,defaultProp:r});return w.jsx(ae.button,{type:"button","aria-pressed":i,"data-state":i?"on":"off","data-disabled":e.disabled?"":void 0,...s,ref:t,onClick:te(e.onClick,()=>{e.disabled||a(!i)})})});$m.displayName=BR;var zR=$m;const WR=fa("inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium hover:bg-muted hover:text-muted-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none transition-[color,box-shadow] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive whitespace-nowrap",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent shadow-xs hover:bg-accent hover:text-accent-foreground"},size:{default:"h-9 px-2 min-w-9",sm:"h-8 px-1.5 min-w-8",lg:"h-10 px-2.5 min-w-10"}},defaultVariants:{variant:"default",size:"default"}});function HR({className:e,variant:t,size:n,...r}){return w.jsx(zR,{"data-slot":"toggle",className:ce(WR({variant:t,size:n,className:e})),...r})}const UR=()=>{const[e,t]=E.useState(!1);return w.jsx(Da,{children:w.jsxs(Xf,{children:[w.jsx(Zf,{asChild:!0,children:w.jsx("div",{children:w.jsx(HR,{className:"group size-10 p-0 hover:bg-indigo-50 hover:text-indigo-500 data-[state=on]:bg-indigo-50 data-[state=on]:text-indigo-500","aria-label":"Bookmark this",variant:e?"default":"outline",pressed:e,onPressedChange:t,children:w.jsx(Fy,{size:16,strokeWidth:2,"aria-hidden":"true"})})})}),w.jsx(Jf,{className:"border border-input bg-popover px-2 py-1 text-xs text-muted-foreground",children:w.jsx("p",{children:e?"Remove bookmark":"Bookmark this"})})]})})};function Wu(e,[t,n]){return Math.min(n,Math.max(t,e))}function YR(e){const t=D.useRef({value:e,previous:e});return D.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var KR=[" ","Enter","ArrowUp","ArrowDown"],GR=[" ","Enter"],qr="Select",[gs,vs,qR]=Ma(qr),[Yn,VA]=Ht(qr,[qR,Ut]),ys=Ut(),[XR,Gt]=Yn(qr),[ZR,JR]=Yn(qr),Bm=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:s,value:i,defaultValue:a,onValueChange:c,dir:l,name:u,autoComplete:d,disabled:f,required:h,form:S}=e,p=ys(t),[b,v]=D.useState(null),[m,g]=D.useState(null),[C,y]=D.useState(!1),M=Ra(l),[x=!1,T]=ln({prop:r,defaultProp:o,onChange:s}),[R,_]=ln({prop:i,defaultProp:a,onChange:c}),O=D.useRef(null),z=b?S||!!b.closest("form"):!0,[G,j]=D.useState(new Set),F=Array.from(G).map(N=>N.props.value).join(";");return w.jsx(ts,{...p,children:w.jsxs(XR,{required:h,scope:t,trigger:b,onTriggerChange:v,valueNode:m,onValueNodeChange:g,valueNodeHasChildren:C,onValueNodeHasChildrenChange:y,contentId:Vt(),value:R,onValueChange:_,open:x,onOpenChange:T,dir:M,triggerPointerDownPosRef:O,disabled:f,children:[w.jsx(gs.Provider,{scope:t,children:w.jsx(ZR,{scope:e.__scopeSelect,onNativeOptionAdd:D.useCallback(N=>{j(k=>new Set(k).add(N))},[]),onNativeOptionRemove:D.useCallback(N=>{j(k=>{const P=new Set(k);return P.delete(N),P})},[]),children:n})}),z?w.jsxs(ug,{"aria-hidden":!0,required:h,tabIndex:-1,name:u,autoComplete:d,value:R,onChange:N=>_(N.target.value),disabled:f,form:S,children:[R===void 0?w.jsx("option",{value:""}):null,Array.from(G)]},F):null]})})};Bm.displayName=qr;var zm="SelectTrigger",Wm=D.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,s=ys(n),i=Gt(zm,n),a=i.disabled||r,c=fe(t,i.onTriggerChange),l=vs(n),u=D.useRef("touch"),[d,f,h]=dg(p=>{const b=l().filter(g=>!g.disabled),v=b.find(g=>g.value===i.value),m=fg(b,p,v);m!==void 0&&i.onValueChange(m.value)}),S=p=>{a||(i.onOpenChange(!0),h()),p&&(i.triggerPointerDownPosRef.current={x:Math.round(p.pageX),y:Math.round(p.pageY)})};return w.jsx(Vr,{asChild:!0,...s,children:w.jsx(ae.button,{type:"button",role:"combobox","aria-controls":i.contentId,"aria-expanded":i.open,"aria-required":i.required,"aria-autocomplete":"none",dir:i.dir,"data-state":i.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":lg(i.value)?"":void 0,...o,ref:c,onClick:te(o.onClick,p=>{p.currentTarget.focus(),u.current!=="mouse"&&S(p)}),onPointerDown:te(o.onPointerDown,p=>{u.current=p.pointerType;const b=p.target;b.hasPointerCapture(p.pointerId)&&b.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&p.pointerType==="mouse"&&(S(p),p.preventDefault())}),onKeyDown:te(o.onKeyDown,p=>{const b=d.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&f(p.key),!(b&&p.key===" ")&&KR.includes(p.key)&&(S(),p.preventDefault())})})})});Wm.displayName=zm;var Hm="SelectValue",Um=D.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:s,placeholder:i="",...a}=e,c=Gt(Hm,n),{onValueNodeHasChildrenChange:l}=c,u=s!==void 0,d=fe(t,c.onValueNodeChange);return Ne(()=>{l(u)},[l,u]),w.jsx(ae.span,{...a,ref:d,style:{pointerEvents:"none"},children:lg(c.value)?w.jsx(w.Fragment,{children:i}):s})});Um.displayName=Hm;var QR="SelectIcon",Ym=D.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return w.jsx(ae.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})});Ym.displayName=QR;var eP="SelectPortal",Km=e=>w.jsx(Fr,{asChild:!0,...e});Km.displayName=eP;var un="SelectContent",Gm=D.forwardRef((e,t)=>{const n=Gt(un,e.__scopeSelect),[r,o]=D.useState();if(Ne(()=>{o(new DocumentFragment)},[]),!n.open){const s=r;return s?Wo.createPortal(w.jsx(qm,{scope:e.__scopeSelect,children:w.jsx(gs.Slot,{scope:e.__scopeSelect,children:w.jsx("div",{children:e.children})})}),s):null}return w.jsx(Xm,{...e,ref:t})});Gm.displayName=un;var Qe=10,[qm,qt]=Yn(un),tP="SelectContentImpl",nP=sn("SelectContent.RemoveScroll"),Xm=D.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:s,onPointerDownOutside:i,side:a,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:h,sticky:S,hideWhenDetached:p,avoidCollisions:b,...v}=e,m=Gt(un,n),[g,C]=D.useState(null),[y,M]=D.useState(null),x=fe(t,$=>C($)),[T,R]=D.useState(null),[_,O]=D.useState(null),z=vs(n),[G,j]=D.useState(!1),F=D.useRef(!1);D.useEffect(()=>{if(g)return Aa(g)},[g]),Pa();const N=D.useCallback($=>{const[q,...X]=z().map(B=>B.ref.current),[U]=X.slice(-1),ne=document.activeElement;for(const B of $)if(B===ne||(B==null||B.scrollIntoView({block:"nearest"}),B===q&&y&&(y.scrollTop=0),B===U&&y&&(y.scrollTop=y.scrollHeight),B==null||B.focus(),document.activeElement!==ne))return},[z,y]),k=D.useCallback(()=>N([T,g]),[N,T,g]);D.useEffect(()=>{G&&k()},[G,k]);const{onOpenChange:P,triggerPointerDownPosRef:I}=m;D.useEffect(()=>{if(g){let $={x:0,y:0};const q=U=>{var ne,B;$={x:Math.abs(Math.round(U.pageX)-(((ne=I.current)==null?void 0:ne.x)??0)),y:Math.abs(Math.round(U.pageY)-(((B=I.current)==null?void 0:B.y)??0))}},X=U=>{$.x<=10&&$.y<=10?U.preventDefault():g.contains(U.target)||P(!1),document.removeEventListener("pointermove",q),I.current=null};return I.current!==null&&(document.addEventListener("pointermove",q),document.addEventListener("pointerup",X,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",q),document.removeEventListener("pointerup",X,{capture:!0})}}},[g,P,I]),D.useEffect(()=>{const $=()=>P(!1);return window.addEventListener("blur",$),window.addEventListener("resize",$),()=>{window.removeEventListener("blur",$),window.removeEventListener("resize",$)}},[P]);const[A,V]=dg($=>{const q=z().filter(ne=>!ne.disabled),X=q.find(ne=>ne.ref.current===document.activeElement),U=fg(q,$,X);U&&setTimeout(()=>U.ref.current.focus())}),W=D.useCallback(($,q,X)=>{const U=!F.current&&!X;(m.value!==void 0&&m.value===q||U)&&(R($),U&&(F.current=!0))},[m.value]),H=D.useCallback(()=>g==null?void 0:g.focus(),[g]),L=D.useCallback(($,q,X)=>{const U=!F.current&&!X;(m.value!==void 0&&m.value===q||U)&&O($)},[m.value]),Y=r==="popper"?qi:Zm,K=Y===qi?{side:a,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:h,sticky:S,hideWhenDetached:p,avoidCollisions:b}:{};return w.jsx(qm,{scope:n,content:g,viewport:y,onViewportChange:M,itemRefCallback:W,selectedItem:T,onItemLeave:H,itemTextRefCallback:L,focusSelectedItem:k,selectedItemText:_,position:r,isPositioned:G,searchRef:A,children:w.jsx(us,{as:nP,allowPinchZoom:!0,children:w.jsx(as,{asChild:!0,trapped:m.open,onMountAutoFocus:$=>{$.preventDefault()},onUnmountAutoFocus:te(o,$=>{var q;(q=m.trigger)==null||q.focus({preventScroll:!0}),$.preventDefault()}),children:w.jsx(jr,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:$=>$.preventDefault(),onDismiss:()=>m.onOpenChange(!1),children:w.jsx(Y,{role:"listbox",id:m.contentId,"data-state":m.open?"open":"closed",dir:m.dir,onContextMenu:$=>$.preventDefault(),...v,...K,onPlaced:()=>j(!0),ref:x,style:{display:"flex",flexDirection:"column",outline:"none",...v.style},onKeyDown:te(v.onKeyDown,$=>{const q=$.ctrlKey||$.altKey||$.metaKey;if($.key==="Tab"&&$.preventDefault(),!q&&$.key.length===1&&V($.key),["ArrowUp","ArrowDown","Home","End"].includes($.key)){let U=z().filter(ne=>!ne.disabled).map(ne=>ne.ref.current);if(["ArrowUp","End"].includes($.key)&&(U=U.slice().reverse()),["ArrowUp","ArrowDown"].includes($.key)){const ne=$.target,B=U.indexOf(ne);U=U.slice(B+1)}setTimeout(()=>N(U)),$.preventDefault()}})})})})})})});Xm.displayName=tP;var rP="SelectItemAlignedPosition",Zm=D.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,s=Gt(un,n),i=qt(un,n),[a,c]=D.useState(null),[l,u]=D.useState(null),d=fe(t,x=>u(x)),f=vs(n),h=D.useRef(!1),S=D.useRef(!0),{viewport:p,selectedItem:b,selectedItemText:v,focusSelectedItem:m}=i,g=D.useCallback(()=>{if(s.trigger&&s.valueNode&&a&&l&&p&&b&&v){const x=s.trigger.getBoundingClientRect(),T=l.getBoundingClientRect(),R=s.valueNode.getBoundingClientRect(),_=v.getBoundingClientRect();if(s.dir!=="rtl"){const ne=_.left-T.left,B=R.left-ne,ie=x.left-B,pe=x.width+ie,Oe=Math.max(pe,T.width),Ee=window.innerWidth-Qe,ot=Wu(B,[Qe,Math.max(Qe,Ee-Oe)]);a.style.minWidth=pe+"px",a.style.left=ot+"px"}else{const ne=T.right-_.right,B=window.innerWidth-R.right-ne,ie=window.innerWidth-x.right-B,pe=x.width+ie,Oe=Math.max(pe,T.width),Ee=window.innerWidth-Qe,ot=Wu(B,[Qe,Math.max(Qe,Ee-Oe)]);a.style.minWidth=pe+"px",a.style.right=ot+"px"}const O=f(),z=window.innerHeight-Qe*2,G=p.scrollHeight,j=window.getComputedStyle(l),F=parseInt(j.borderTopWidth,10),N=parseInt(j.paddingTop,10),k=parseInt(j.borderBottomWidth,10),P=parseInt(j.paddingBottom,10),I=F+N+G+P+k,A=Math.min(b.offsetHeight*5,I),V=window.getComputedStyle(p),W=parseInt(V.paddingTop,10),H=parseInt(V.paddingBottom,10),L=x.top+x.height/2-Qe,Y=z-L,K=b.offsetHeight/2,$=b.offsetTop+K,q=F+N+$,X=I-q;if(q<=L){const ne=O.length>0&&b===O[O.length-1].ref.current;a.style.bottom="0px";const B=l.clientHeight-p.offsetTop-p.offsetHeight,ie=Math.max(Y,K+(ne?H:0)+B+k),pe=q+ie;a.style.height=pe+"px"}else{const ne=O.length>0&&b===O[0].ref.current;a.style.top="0px";const ie=Math.max(L,F+p.offsetTop+(ne?W:0)+K)+X;a.style.height=ie+"px",p.scrollTop=q-L+p.offsetTop}a.style.margin=`${Qe}px 0`,a.style.minHeight=A+"px",a.style.maxHeight=z+"px",r==null||r(),requestAnimationFrame(()=>h.current=!0)}},[f,s.trigger,s.valueNode,a,l,p,b,v,s.dir,r]);Ne(()=>g(),[g]);const[C,y]=D.useState();Ne(()=>{l&&y(window.getComputedStyle(l).zIndex)},[l]);const M=D.useCallback(x=>{x&&S.current===!0&&(g(),m==null||m(),S.current=!1)},[g,m]);return w.jsx(sP,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:h,onScrollButtonChange:M,children:w.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:C},children:w.jsx(ae.div,{...o,ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});Zm.displayName=rP;var oP="SelectPopperPosition",qi=D.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=Qe,...s}=e,i=ys(n);return w.jsx(ns,{...i,...s,ref:t,align:r,collisionPadding:o,style:{boxSizing:"border-box",...s.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});qi.displayName=oP;var[sP,Cc]=Yn(un,{}),Xi="SelectViewport",Jm=D.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...o}=e,s=qt(Xi,n),i=Cc(Xi,n),a=fe(t,s.onViewportChange),c=D.useRef(0);return w.jsxs(w.Fragment,{children:[w.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),w.jsx(gs.Slot,{scope:n,children:w.jsx(ae.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:te(o.onScroll,l=>{const u=l.currentTarget,{contentWrapper:d,shouldExpandOnScrollRef:f}=i;if(f!=null&&f.current&&d){const h=Math.abs(c.current-u.scrollTop);if(h>0){const S=window.innerHeight-Qe*2,p=parseFloat(d.style.minHeight),b=parseFloat(d.style.height),v=Math.max(p,b);if(v<S){const m=v+h,g=Math.min(S,m),C=m-g;d.style.height=g+"px",d.style.bottom==="0px"&&(u.scrollTop=C>0?C:0,d.style.justifyContent="flex-end")}}}c.current=u.scrollTop})})})]})});Jm.displayName=Xi;var Qm="SelectGroup",[iP,aP]=Yn(Qm),cP=D.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Vt();return w.jsx(iP,{scope:n,id:o,children:w.jsx(ae.div,{role:"group","aria-labelledby":o,...r,ref:t})})});cP.displayName=Qm;var eg="SelectLabel",lP=D.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=aP(eg,n);return w.jsx(ae.div,{id:o.id,...r,ref:t})});lP.displayName=eg;var zo="SelectItem",[uP,tg]=Yn(zo),ng=D.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:s,...i}=e,a=Gt(zo,n),c=qt(zo,n),l=a.value===r,[u,d]=D.useState(s??""),[f,h]=D.useState(!1),S=fe(t,m=>{var g;return(g=c.itemRefCallback)==null?void 0:g.call(c,m,r,o)}),p=Vt(),b=D.useRef("touch"),v=()=>{o||(a.onValueChange(r),a.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return w.jsx(uP,{scope:n,value:r,disabled:o,textId:p,isSelected:l,onItemTextChange:D.useCallback(m=>{d(g=>g||((m==null?void 0:m.textContent)??"").trim())},[]),children:w.jsx(gs.ItemSlot,{scope:n,value:r,disabled:o,textValue:u,children:w.jsx(ae.div,{role:"option","aria-labelledby":p,"data-highlighted":f?"":void 0,"aria-selected":l&&f,"data-state":l?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...i,ref:S,onFocus:te(i.onFocus,()=>h(!0)),onBlur:te(i.onBlur,()=>h(!1)),onClick:te(i.onClick,()=>{b.current!=="mouse"&&v()}),onPointerUp:te(i.onPointerUp,()=>{b.current==="mouse"&&v()}),onPointerDown:te(i.onPointerDown,m=>{b.current=m.pointerType}),onPointerMove:te(i.onPointerMove,m=>{var g;b.current=m.pointerType,o?(g=c.onItemLeave)==null||g.call(c):b.current==="mouse"&&m.currentTarget.focus({preventScroll:!0})}),onPointerLeave:te(i.onPointerLeave,m=>{var g;m.currentTarget===document.activeElement&&((g=c.onItemLeave)==null||g.call(c))}),onKeyDown:te(i.onKeyDown,m=>{var C;((C=c.searchRef)==null?void 0:C.current)!==""&&m.key===" "||(GR.includes(m.key)&&v(),m.key===" "&&m.preventDefault())})})})})});ng.displayName=zo;var cr="SelectItemText",rg=D.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...s}=e,i=Gt(cr,n),a=qt(cr,n),c=tg(cr,n),l=JR(cr,n),[u,d]=D.useState(null),f=fe(t,v=>d(v),c.onItemTextChange,v=>{var m;return(m=a.itemTextRefCallback)==null?void 0:m.call(a,v,c.value,c.disabled)}),h=u==null?void 0:u.textContent,S=D.useMemo(()=>w.jsx("option",{value:c.value,disabled:c.disabled,children:h},c.value),[c.disabled,c.value,h]),{onNativeOptionAdd:p,onNativeOptionRemove:b}=l;return Ne(()=>(p(S),()=>b(S)),[p,b,S]),w.jsxs(w.Fragment,{children:[w.jsx(ae.span,{id:c.textId,...s,ref:f}),c.isSelected&&i.valueNode&&!i.valueNodeHasChildren?Wo.createPortal(s.children,i.valueNode):null]})});rg.displayName=cr;var og="SelectItemIndicator",sg=D.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return tg(og,n).isSelected?w.jsx(ae.span,{"aria-hidden":!0,...r,ref:t}):null});sg.displayName=og;var Zi="SelectScrollUpButton",ig=D.forwardRef((e,t)=>{const n=qt(Zi,e.__scopeSelect),r=Cc(Zi,e.__scopeSelect),[o,s]=D.useState(!1),i=fe(t,r.onScrollButtonChange);return Ne(()=>{if(n.viewport&&n.isPositioned){let a=function(){const l=c.scrollTop>0;s(l)};const c=n.viewport;return a(),c.addEventListener("scroll",a),()=>c.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),o?w.jsx(cg,{...e,ref:i,onAutoScroll:()=>{const{viewport:a,selectedItem:c}=n;a&&c&&(a.scrollTop=a.scrollTop-c.offsetHeight)}}):null});ig.displayName=Zi;var Ji="SelectScrollDownButton",ag=D.forwardRef((e,t)=>{const n=qt(Ji,e.__scopeSelect),r=Cc(Ji,e.__scopeSelect),[o,s]=D.useState(!1),i=fe(t,r.onScrollButtonChange);return Ne(()=>{if(n.viewport&&n.isPositioned){let a=function(){const l=c.scrollHeight-c.clientHeight,u=Math.ceil(c.scrollTop)<l;s(u)};const c=n.viewport;return a(),c.addEventListener("scroll",a),()=>c.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),o?w.jsx(cg,{...e,ref:i,onAutoScroll:()=>{const{viewport:a,selectedItem:c}=n;a&&c&&(a.scrollTop=a.scrollTop+c.offsetHeight)}}):null});ag.displayName=Ji;var cg=D.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,s=qt("SelectScrollButton",n),i=D.useRef(null),a=vs(n),c=D.useCallback(()=>{i.current!==null&&(window.clearInterval(i.current),i.current=null)},[]);return D.useEffect(()=>()=>c(),[c]),Ne(()=>{var u;const l=a().find(d=>d.ref.current===document.activeElement);(u=l==null?void 0:l.ref.current)==null||u.scrollIntoView({block:"nearest"})},[a]),w.jsx(ae.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:te(o.onPointerDown,()=>{i.current===null&&(i.current=window.setInterval(r,50))}),onPointerMove:te(o.onPointerMove,()=>{var l;(l=s.onItemLeave)==null||l.call(s),i.current===null&&(i.current=window.setInterval(r,50))}),onPointerLeave:te(o.onPointerLeave,()=>{c()})})}),dP="SelectSeparator",fP=D.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return w.jsx(ae.div,{"aria-hidden":!0,...r,ref:t})});fP.displayName=dP;var Qi="SelectArrow",hP=D.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=ys(n),s=Gt(Qi,n),i=qt(Qi,n);return s.open&&i.position==="popper"?w.jsx(rs,{...o,...r,ref:t}):null});hP.displayName=Qi;function lg(e){return e===""||e===void 0}var ug=D.forwardRef((e,t)=>{const{value:n,...r}=e,o=D.useRef(null),s=fe(t,o),i=YR(n);return D.useEffect(()=>{const a=o.current,c=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(c,"value").set;if(i!==n&&u){const d=new Event("change",{bubbles:!0});u.call(a,n),a.dispatchEvent(d)}},[i,n]),w.jsx(Sa,{asChild:!0,children:w.jsx("select",{...r,ref:s,defaultValue:n})})});ug.displayName="BubbleSelect";function dg(e){const t=Ze(e),n=D.useRef(""),r=D.useRef(0),o=D.useCallback(i=>{const a=n.current+i;t(a),function c(l){n.current=l,window.clearTimeout(r.current),l!==""&&(r.current=window.setTimeout(()=>c(""),1e3))}(a)},[t]),s=D.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return D.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,s]}function fg(e,t,n){const o=t.length>1&&Array.from(t).every(l=>l===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let i=pP(e,Math.max(s,0));o.length===1&&(i=i.filter(l=>l!==n));const c=i.find(l=>l.textValue.toLowerCase().startsWith(o.toLowerCase()));return c!==n?c:void 0}function pP(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var mP=Bm,gP=Wm,vP=Um,yP=Ym,bP=Km,xP=Gm,wP=Jm,SP=ng,CP=rg,TP=sg,DP=ig,EP=ag;function MP({...e}){return w.jsx(mP,{"data-slot":"select",...e})}function RP({...e}){return w.jsx(vP,{"data-slot":"select-value",...e})}function PP({className:e,size:t="default",children:n,...r}){return w.jsxs(gP,{"data-slot":"select-trigger","data-size":t,className:ce("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r,children:[n,w.jsx(yP,{asChild:!0,children:w.jsx(of,{className:"size-4 opacity-50"})})]})}function AP({className:e,children:t,position:n="popper",...r}){return w.jsx(bP,{children:w.jsxs(xP,{"data-slot":"select-content",className:ce("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 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:[w.jsx(kP,{}),w.jsx(wP,{className:ce("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),w.jsx(_P,{})]})})}function OP({className:e,children:t,...n}){return w.jsxs(SP,{"data-slot":"select-item",className:ce("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...n,children:[w.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:w.jsx(TP,{children:w.jsx(rf,{className:"size-4"})})}),w.jsx(CP,{children:t})]})}function kP({className:e,...t}){return w.jsx(DP,{"data-slot":"select-scroll-up-button",className:ce("flex cursor-default items-center justify-center py-1",e),...t,children:w.jsx(Zy,{className:"size-4"})})}function _P({className:e,...t}){return w.jsx(EP,{"data-slot":"select-scroll-down-button",className:ce("flex cursor-default items-center justify-center py-1",e),...t,children:w.jsx(of,{className:"size-4"})})}const NP=({options:e,onChange:t})=>w.jsxs(MP,{onValueChange:n=>t(n),defaultValue:e[1].text,children:[w.jsx(PP,{className:"w-[180px]",children:w.jsx(RP,{placeholder:"view"})}),w.jsx(AP,{children:e.map(n=>w.jsx(OP,{value:n.text,children:n.text},n.text))})]}),IP=[{text:"teste1",onClick:()=>console.log("teste1")},{text:"teste2",onClick:()=>console.log("teste2")}],jP=5,LP=0,VP=({side:e,xAxis:t,yAxis:n,updatePosition:r,children:o})=>{const{attributes:s,listeners:i,setNodeRef:a,transform:c,setActivatorNodeRef:l}=ua({id:"booking-info-id",data:{type:"booking-info-options"}}),u=hn(f=>f.updateIsDragging),d={transform:`translate3d(${t+((c==null?void 0:c.x)||0)}px, ${n+((c==null?void 0:c.y)||0)}px, 0)`};return _r({onDragStart(){u(!0)},onDragEnd(f){f.active.id&&r(c)}}),w.jsx(FR,{ref:a,updatePositionStrategy:"optimized",side:e,align:"start",sticky:"always",sideOffset:jP,alignOffset:LP,style:{...d,width:"25rem"},children:w.jsxs("div",{className:"grid gap-3",children:[w.jsx("input",{type:"text",style:{position:"absolute",opacity:0,height:0,width:0}}),w.jsxs("div",{className:"flex justify-end gap-1",children:[w.jsx("div",{ref:l,className:"w-full cursor-move",...s,...i}),w.jsx(UR,{}),w.jsx(an,{type:"button",variant:"outline",size:"icon",children:w.jsx(ab,{className:"h-3 w-3"})}),w.jsx(an,{type:"button",variant:"outline",size:"icon",onClick:()=>{},children:w.jsx(db,{className:"h-3 w-3"})}),w.jsx(NP,{options:IP,onChange:()=>{}})]}),o]})})},Hu={xAxis:0,yAxis:0},hg=({isEditingOpen:e,side:t,booking:n,onOpenChange:r,children:o})=>{const[s,i]=E.useState({...Hu}),a=hn(h=>h.updateIsDragging),c=E.useMemo(()=>`${Z.dateAndHourDateToString(n.startAt)} - ${Z.dateAndHourDateToString(n.finishAt)}`,[n.startAt,n.finishAt]),l=E.useMemo(()=>{const h=new Date(n.startAt),S=h.getDate(),p=h.getDay(),b=Mn[h.getMonth()];return w.jsx("span",{children:`${Xg[p]}, ${S} ${b}`})},[n.startAt]),u=()=>({backgroundColor:""}),d=h=>{h||console.info("No transform info to show "),i({xAxis:s.xAxis+((h==null?void 0:h.x)||0),yAxis:s.yAxis+((h==null?void 0:h.y)||0)})};_r({onDragStart(h){const S=h.active.data.current,p=h.active.id,b=S.type==="booking-info-options";p&&b&&a(!0)}});const f=h=>{h===!1&&i({...Hu}),r(h)};return w.jsxs(LR,{open:e,onOpenChange:f,defaultOpen:!1,children:[w.jsx($R,{style:{width:"100%"},children:w.jsx(VR,{asChild:!0,children:o})}),w.jsx(la,{children:w.jsx(VP,{side:t,xAxis:s.xAxis,yAxis:s.yAxis,updatePosition:d,children:w.jsxs("div",{className:"bookingCard_content",children:[w.jsx("span",{style:u(),className:"flex h-4 w-4 translate-y-0 rounded-sm"}),w.jsx("div",{className:"space-y-1",children:w.jsxs("p",{className:"text-sm text-muted-foreground",children:[l," | ",c]})})]})})})]})};hg.displayName="BookingInfoOptions";var er={exports:{}},tr={},nr={exports:{}},ei={},co={exports:{}},lo={exports:{}},ue={};/** @license React v16.13.1
149
+ `)},r0=0,xn=[];function o0(e){var t=D.useRef([]),n=D.useRef([0,0]),r=D.useRef(),o=D.useState(r0++)[0],s=D.useState(fh)[0],i=D.useRef(e);D.useEffect(function(){i.current=e},[e]),D.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var m=DS([e.lockRef.current],(e.shards||[]).map(Dl),!0).filter(Boolean);return m.forEach(function(w){return w.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),m.forEach(function(w){return w.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=D.useCallback(function(m,w){if("touches"in m&&m.touches.length===2||m.type==="wheel"&&m.ctrlKey)return!i.current.allowPinchZoom;var g=ro(m),p=n.current,v="deltaX"in m?m.deltaX:p[0]-g[0],C="deltaY"in m?m.deltaY:p[1]-g[1],y,M=m.target,b=Math.abs(v)>Math.abs(C)?"h":"v";if("touches"in m&&b==="h"&&M.type==="range")return!1;var T=Cl(b,M);if(!T)return!0;if(T?y=b:(y=b==="v"?"h":"v",T=Cl(b,M)),!T)return!1;if(!r.current&&"changedTouches"in m&&(v||C)&&(r.current=y),!y)return!0;var R=r.current||y;return e0(R,w,m,R==="h"?v:C)},[]),c=D.useCallback(function(m){var w=m;if(!(!xn.length||xn[xn.length-1]!==s)){var g="deltaY"in w?Tl(w):ro(w),p=t.current.filter(function(y){return y.name===w.type&&(y.target===w.target||w.target===y.shadowParent)&&t0(y.delta,g)})[0];if(p&&p.should){w.cancelable&&w.preventDefault();return}if(!p){var v=(i.current.shards||[]).map(Dl).filter(Boolean).filter(function(y){return y.contains(w.target)}),C=v.length>0?a(w,v[0]):!i.current.noIsolation;C&&w.cancelable&&w.preventDefault()}}},[]),l=D.useCallback(function(m,w,g,p){var v={name:m,delta:w,target:g,should:p,shadowParent:s0(g)};t.current.push(v),setTimeout(function(){t.current=t.current.filter(function(C){return C!==v})},1)},[]),u=D.useCallback(function(m){n.current=ro(m),r.current=void 0},[]),d=D.useCallback(function(m){l(m.type,Tl(m),m.target,a(m,e.lockRef.current))},[]),h=D.useCallback(function(m){l(m.type,ro(m),m.target,a(m,e.lockRef.current))},[]);D.useEffect(function(){return xn.push(s),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:h}),document.addEventListener("wheel",c,bn),document.addEventListener("touchmove",c,bn),document.addEventListener("touchstart",u,bn),function(){xn=xn.filter(function(m){return m!==s}),document.removeEventListener("wheel",c,bn),document.removeEventListener("touchmove",c,bn),document.removeEventListener("touchstart",u,bn)}},[]);var f=e.removeScrollBar,S=e.inert;return D.createElement(D.Fragment,null,S?D.createElement(s,{styles:n0(o)}):null,f?D.createElement(KS,{gapMode:e.gapMode}):null)}function s0(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const i0=NS(dh,o0);var us=D.forwardRef(function(e,t){return D.createElement(ls,ct({},e,{ref:t,sideCar:i0}))});us.classNames=ls.classNames;var Ei=["Enter"," "],a0=["ArrowDown","PageUp","Home"],gh=["ArrowUp","PageDown","End"],c0=[...a0,...gh],l0={ltr:[...Ei,"ArrowRight"],rtl:[...Ei,"ArrowLeft"]},u0={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Br="Menu",[wr,d0,f0]=Ma(Br),[dn,vh]=Ht(Br,[f0,Ut,rh]),ds=Ut(),yh=rh(),[h0,fn]=dn(Br),[p0,zr]=dn(Br),bh=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:s,modal:i=!0}=e,a=ds(t),[c,l]=D.useState(null),u=D.useRef(!1),d=Ze(s),h=Ra(o);return D.useEffect(()=>{const f=()=>{u.current=!0,document.addEventListener("pointerdown",S,{capture:!0,once:!0}),document.addEventListener("pointermove",S,{capture:!0,once:!0})},S=()=>u.current=!1;return document.addEventListener("keydown",f,{capture:!0}),()=>{document.removeEventListener("keydown",f,{capture:!0}),document.removeEventListener("pointerdown",S,{capture:!0}),document.removeEventListener("pointermove",S,{capture:!0})}},[]),x.jsx(es,{...a,children:x.jsx(h0,{scope:t,open:n,onOpenChange:d,content:c,onContentChange:l,children:x.jsx(p0,{scope:t,onClose:D.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:h,modal:i,children:r})})})};bh.displayName=Br;var m0="MenuAnchor",Oa=D.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=ds(n);return x.jsx(Vr,{...o,...r,ref:t})});Oa.displayName=m0;var ka="MenuPortal",[g0,xh]=dn(ka,{forceMount:void 0}),wh=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,s=fn(ka,t);return x.jsx(g0,{scope:t,forceMount:n,children:x.jsx(Dt,{present:n||s.open,children:x.jsx(Fr,{asChild:!0,container:o,children:r})})})};wh.displayName=ka;var qe="MenuContent",[v0,_a]=dn(qe),Sh=D.forwardRef((e,t)=>{const n=xh(qe,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,s=fn(qe,e.__scopeMenu),i=zr(qe,e.__scopeMenu);return x.jsx(wr.Provider,{scope:e.__scopeMenu,children:x.jsx(Dt,{present:r||s.open,children:x.jsx(wr.Slot,{scope:e.__scopeMenu,children:i.modal?x.jsx(y0,{...o,ref:t}):x.jsx(b0,{...o,ref:t})})})})}),y0=D.forwardRef((e,t)=>{const n=fn(qe,e.__scopeMenu),r=D.useRef(null),o=fe(t,r);return D.useEffect(()=>{const s=r.current;if(s)return Aa(s)},[]),x.jsx(Na,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:te(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),b0=D.forwardRef((e,t)=>{const n=fn(qe,e.__scopeMenu);return x.jsx(Na,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),x0=sn("MenuContent.ScrollLock"),Na=D.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:s,onCloseAutoFocus:i,disableOutsidePointerEvents:a,onEntryFocus:c,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:h,onDismiss:f,disableOutsideScroll:S,...m}=e,w=fn(qe,n),g=zr(qe,n),p=ds(n),v=yh(n),C=d0(n),[y,M]=D.useState(null),b=D.useRef(null),T=fe(t,b,w.onContentChange),R=D.useRef(0),_=D.useRef(""),O=D.useRef(0),z=D.useRef(null),G=D.useRef("right"),j=D.useRef(0),F=S?us:D.Fragment,N=S?{as:x0,allowPinchZoom:!0}:void 0,k=I=>{var $,q;const A=_.current+I,V=C().filter(X=>!X.disabled),W=document.activeElement,H=($=V.find(X=>X.ref.current===W))==null?void 0:$.textValue,L=V.map(X=>X.textValue),Y=k0(L,A,H),K=(q=V.find(X=>X.textValue===Y))==null?void 0:q.ref.current;(function X(U){_.current=U,window.clearTimeout(R.current),U!==""&&(R.current=window.setTimeout(()=>X(""),1e3))})(A),K&&setTimeout(()=>K.focus())};D.useEffect(()=>()=>window.clearTimeout(R.current),[]),Pa();const P=D.useCallback(I=>{var V,W;return G.current===((V=z.current)==null?void 0:V.side)&&N0(I,(W=z.current)==null?void 0:W.area)},[]);return x.jsx(v0,{scope:n,searchRef:_,onItemEnter:D.useCallback(I=>{P(I)&&I.preventDefault()},[P]),onItemLeave:D.useCallback(I=>{var A;P(I)||((A=b.current)==null||A.focus(),M(null))},[P]),onTriggerLeave:D.useCallback(I=>{P(I)&&I.preventDefault()},[P]),pointerGraceTimerRef:O,onPointerGraceIntentChange:D.useCallback(I=>{z.current=I},[]),children:x.jsx(F,{...N,children:x.jsx(as,{asChild:!0,trapped:o,onMountAutoFocus:te(s,I=>{var A;I.preventDefault(),(A=b.current)==null||A.focus({preventScroll:!0})}),onUnmountAutoFocus:i,children:x.jsx(jr,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:h,onDismiss:f,children:x.jsx(xS,{asChild:!0,...v,dir:g.dir,orientation:"vertical",loop:r,currentTabStopId:y,onCurrentTabStopIdChange:M,onEntryFocus:te(c,I=>{g.isUsingKeyboardRef.current||I.preventDefault()}),preventScrollOnEntryFocus:!0,children:x.jsx(ts,{role:"menu","aria-orientation":"vertical","data-state":Vh(w.open),"data-radix-menu-content":"",dir:g.dir,...p,...m,ref:T,style:{outline:"none",...m.style},onKeyDown:te(m.onKeyDown,I=>{const V=I.target.closest("[data-radix-menu-content]")===I.currentTarget,W=I.ctrlKey||I.altKey||I.metaKey,H=I.key.length===1;V&&(I.key==="Tab"&&I.preventDefault(),!W&&H&&k(I.key));const L=b.current;if(I.target!==L||!c0.includes(I.key))return;I.preventDefault();const K=C().filter($=>!$.disabled).map($=>$.ref.current);gh.includes(I.key)&&K.reverse(),A0(K)}),onBlur:te(e.onBlur,I=>{I.currentTarget.contains(I.target)||(window.clearTimeout(R.current),_.current="")}),onPointerMove:te(e.onPointerMove,Sr(I=>{const A=I.target,V=j.current!==I.clientX;if(I.currentTarget.contains(A)&&V){const W=I.clientX>j.current?"right":"left";G.current=W,j.current=I.clientX}}))})})})})})})});Sh.displayName=qe;var w0="MenuGroup",Ia=D.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return x.jsx(ae.div,{role:"group",...r,ref:t})});Ia.displayName=w0;var S0="MenuLabel",Ch=D.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return x.jsx(ae.div,{...r,ref:t})});Ch.displayName=S0;var No="MenuItem",El="menu.itemSelect",fs=D.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,s=D.useRef(null),i=zr(No,e.__scopeMenu),a=_a(No,e.__scopeMenu),c=fe(t,s),l=D.useRef(!1),u=()=>{const d=s.current;if(!n&&d){const h=new CustomEvent(El,{bubbles:!0,cancelable:!0});d.addEventListener(El,f=>r==null?void 0:r(f),{once:!0}),wf(d,h),h.defaultPrevented?l.current=!1:i.onClose()}};return x.jsx(Th,{...o,ref:c,disabled:n,onClick:te(e.onClick,u),onPointerDown:d=>{var h;(h=e.onPointerDown)==null||h.call(e,d),l.current=!0},onPointerUp:te(e.onPointerUp,d=>{var h;l.current||(h=d.currentTarget)==null||h.click()}),onKeyDown:te(e.onKeyDown,d=>{const h=a.searchRef.current!=="";n||h&&d.key===" "||Ei.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})})});fs.displayName=No;var Th=D.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...s}=e,i=_a(No,n),a=yh(n),c=D.useRef(null),l=fe(t,c),[u,d]=D.useState(!1),[h,f]=D.useState("");return D.useEffect(()=>{const S=c.current;S&&f((S.textContent??"").trim())},[s.children]),x.jsx(wr.ItemSlot,{scope:n,disabled:r,textValue:o??h,children:x.jsx(wS,{asChild:!0,...a,focusable:!r,children:x.jsx(ae.div,{role:"menuitem","data-highlighted":u?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...s,ref:l,onPointerMove:te(e.onPointerMove,Sr(S=>{r?i.onItemLeave(S):(i.onItemEnter(S),S.defaultPrevented||S.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:te(e.onPointerLeave,Sr(S=>i.onItemLeave(S))),onFocus:te(e.onFocus,()=>d(!0)),onBlur:te(e.onBlur,()=>d(!1))})})})}),C0="MenuCheckboxItem",Dh=D.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...o}=e;return x.jsx(Ah,{scope:e.__scopeMenu,checked:n,children:x.jsx(fs,{role:"menuitemcheckbox","aria-checked":Io(n)?"mixed":n,...o,ref:t,"data-state":La(n),onSelect:te(o.onSelect,()=>r==null?void 0:r(Io(n)?!0:!n),{checkForDefaultPrevented:!1})})})});Dh.displayName=C0;var Eh="MenuRadioGroup",[T0,D0]=dn(Eh,{value:void 0,onValueChange:()=>{}}),Mh=D.forwardRef((e,t)=>{const{value:n,onValueChange:r,...o}=e,s=Ze(r);return x.jsx(T0,{scope:e.__scopeMenu,value:n,onValueChange:s,children:x.jsx(Ia,{...o,ref:t})})});Mh.displayName=Eh;var Rh="MenuRadioItem",Ph=D.forwardRef((e,t)=>{const{value:n,...r}=e,o=D0(Rh,e.__scopeMenu),s=n===o.value;return x.jsx(Ah,{scope:e.__scopeMenu,checked:s,children:x.jsx(fs,{role:"menuitemradio","aria-checked":s,...r,ref:t,"data-state":La(s),onSelect:te(r.onSelect,()=>{var i;return(i=o.onValueChange)==null?void 0:i.call(o,n)},{checkForDefaultPrevented:!1})})})});Ph.displayName=Rh;var ja="MenuItemIndicator",[Ah,E0]=dn(ja,{checked:!1}),Oh=D.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...o}=e,s=E0(ja,n);return x.jsx(Dt,{present:r||Io(s.checked)||s.checked===!0,children:x.jsx(ae.span,{...o,ref:t,"data-state":La(s.checked)})})});Oh.displayName=ja;var M0="MenuSeparator",kh=D.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return x.jsx(ae.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});kh.displayName=M0;var R0="MenuArrow",_h=D.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=ds(n);return x.jsx(ns,{...o,...r,ref:t})});_h.displayName=R0;var P0="MenuSub",[_A,Nh]=dn(P0),ir="MenuSubTrigger",Ih=D.forwardRef((e,t)=>{const n=fn(ir,e.__scopeMenu),r=zr(ir,e.__scopeMenu),o=Nh(ir,e.__scopeMenu),s=_a(ir,e.__scopeMenu),i=D.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:c}=s,l={__scopeMenu:e.__scopeMenu},u=D.useCallback(()=>{i.current&&window.clearTimeout(i.current),i.current=null},[]);return D.useEffect(()=>u,[u]),D.useEffect(()=>{const d=a.current;return()=>{window.clearTimeout(d),c(null)}},[a,c]),x.jsx(Oa,{asChild:!0,...l,children:x.jsx(Th,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":Vh(n.open),...e,ref:Xo(t,o.onTriggerChange),onClick:d=>{var h;(h=e.onClick)==null||h.call(e,d),!(e.disabled||d.defaultPrevented)&&(d.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:te(e.onPointerMove,Sr(d=>{s.onItemEnter(d),!d.defaultPrevented&&!e.disabled&&!n.open&&!i.current&&(s.onPointerGraceIntentChange(null),i.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:te(e.onPointerLeave,Sr(d=>{var f,S;u();const h=(f=n.content)==null?void 0:f.getBoundingClientRect();if(h){const m=(S=n.content)==null?void 0:S.dataset.side,w=m==="right",g=w?-5:5,p=h[w?"left":"right"],v=h[w?"right":"left"];s.onPointerGraceIntentChange({area:[{x:d.clientX+g,y:d.clientY},{x:p,y:h.top},{x:v,y:h.top},{x:v,y:h.bottom},{x:p,y:h.bottom}],side:m}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(d),d.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:te(e.onKeyDown,d=>{var f;const h=s.searchRef.current!=="";e.disabled||h&&d.key===" "||l0[r.dir].includes(d.key)&&(n.onOpenChange(!0),(f=n.content)==null||f.focus(),d.preventDefault())})})})});Ih.displayName=ir;var jh="MenuSubContent",Lh=D.forwardRef((e,t)=>{const n=xh(qe,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,s=fn(qe,e.__scopeMenu),i=zr(qe,e.__scopeMenu),a=Nh(jh,e.__scopeMenu),c=D.useRef(null),l=fe(t,c);return x.jsx(wr.Provider,{scope:e.__scopeMenu,children:x.jsx(Dt,{present:r||s.open,children:x.jsx(wr.Slot,{scope:e.__scopeMenu,children:x.jsx(Na,{id:a.contentId,"aria-labelledby":a.triggerId,...o,ref:l,align:"start",side:i.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:u=>{var d;i.isUsingKeyboardRef.current&&((d=c.current)==null||d.focus()),u.preventDefault()},onCloseAutoFocus:u=>u.preventDefault(),onFocusOutside:te(e.onFocusOutside,u=>{u.target!==a.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:te(e.onEscapeKeyDown,u=>{i.onClose(),u.preventDefault()}),onKeyDown:te(e.onKeyDown,u=>{var f;const d=u.currentTarget.contains(u.target),h=u0[i.dir].includes(u.key);d&&h&&(s.onOpenChange(!1),(f=a.trigger)==null||f.focus(),u.preventDefault())})})})})})});Lh.displayName=jh;function Vh(e){return e?"open":"closed"}function Io(e){return e==="indeterminate"}function La(e){return Io(e)?"indeterminate":e?"checked":"unchecked"}function A0(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function O0(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function k0(e,t,n){const o=t.length>1&&Array.from(t).every(l=>l===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let i=O0(e,Math.max(s,0));o.length===1&&(i=i.filter(l=>l!==n));const c=i.find(l=>l.toLowerCase().startsWith(o.toLowerCase()));return c!==n?c:void 0}function _0(e,t){const{x:n,y:r}=e;let o=!1;for(let s=0,i=t.length-1;s<t.length;i=s++){const a=t[s].x,c=t[s].y,l=t[i].x,u=t[i].y;c>r!=u>r&&n<(l-a)*(r-c)/(u-c)+a&&(o=!o)}return o}function N0(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return _0(n,t)}function Sr(e){return t=>t.pointerType==="mouse"?e(t):void 0}var I0=bh,j0=Oa,L0=wh,V0=Sh,F0=Ia,$0=Ch,B0=fs,z0=Dh,W0=Mh,H0=Ph,U0=Oh,Y0=kh,K0=_h,G0=Ih,q0=Lh,Va="DropdownMenu",[X0,NA]=Ht(Va,[vh]),Ie=vh(),[Z0,Fh]=X0(Va),$h=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:o,defaultOpen:s,onOpenChange:i,modal:a=!0}=e,c=Ie(t),l=D.useRef(null),[u=!1,d]=ln({prop:o,defaultProp:s,onChange:i});return x.jsx(Z0,{scope:t,triggerId:Vt(),triggerRef:l,contentId:Vt(),open:u,onOpenChange:d,onOpenToggle:D.useCallback(()=>d(h=>!h),[d]),modal:a,children:x.jsx(I0,{...c,open:u,onOpenChange:d,dir:r,modal:a,children:n})})};$h.displayName=Va;var Bh="DropdownMenuTrigger",zh=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=e,s=Fh(Bh,n),i=Ie(n);return x.jsx(j0,{asChild:!0,...i,children:x.jsx(ae.button,{type:"button",id:s.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":s.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...o,ref:Xo(t,s.triggerRef),onPointerDown:te(e.onPointerDown,a=>{!r&&a.button===0&&a.ctrlKey===!1&&(s.onOpenToggle(),s.open||a.preventDefault())}),onKeyDown:te(e.onKeyDown,a=>{r||(["Enter"," "].includes(a.key)&&s.onOpenToggle(),a.key==="ArrowDown"&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});zh.displayName=Bh;var J0="DropdownMenuPortal",Wh=e=>{const{__scopeDropdownMenu:t,...n}=e,r=Ie(t);return x.jsx(L0,{...r,...n})};Wh.displayName=J0;var Hh="DropdownMenuContent",Uh=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Fh(Hh,n),s=Ie(n),i=D.useRef(!1);return x.jsx(V0,{id:o.contentId,"aria-labelledby":o.triggerId,...s,...r,ref:t,onCloseAutoFocus:te(e.onCloseAutoFocus,a=>{var c;i.current||(c=o.triggerRef.current)==null||c.focus(),i.current=!1,a.preventDefault()}),onInteractOutside:te(e.onInteractOutside,a=>{const c=a.detail.originalEvent,l=c.button===0&&c.ctrlKey===!0,u=c.button===2||l;(!o.modal||u)&&(i.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Uh.displayName=Hh;var Q0="DropdownMenuGroup",eC=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ie(n);return x.jsx(F0,{...o,...r,ref:t})});eC.displayName=Q0;var tC="DropdownMenuLabel",Yh=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ie(n);return x.jsx($0,{...o,...r,ref:t})});Yh.displayName=tC;var nC="DropdownMenuItem",Kh=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ie(n);return x.jsx(B0,{...o,...r,ref:t})});Kh.displayName=nC;var rC="DropdownMenuCheckboxItem",Gh=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ie(n);return x.jsx(z0,{...o,...r,ref:t})});Gh.displayName=rC;var oC="DropdownMenuRadioGroup",sC=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ie(n);return x.jsx(W0,{...o,...r,ref:t})});sC.displayName=oC;var iC="DropdownMenuRadioItem",aC=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ie(n);return x.jsx(H0,{...o,...r,ref:t})});aC.displayName=iC;var cC="DropdownMenuItemIndicator",qh=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ie(n);return x.jsx(U0,{...o,...r,ref:t})});qh.displayName=cC;var lC="DropdownMenuSeparator",Xh=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ie(n);return x.jsx(Y0,{...o,...r,ref:t})});Xh.displayName=lC;var uC="DropdownMenuArrow",dC=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ie(n);return x.jsx(K0,{...o,...r,ref:t})});dC.displayName=uC;var fC="DropdownMenuSubTrigger",hC=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ie(n);return x.jsx(G0,{...o,...r,ref:t})});hC.displayName=fC;var pC="DropdownMenuSubContent",mC=D.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ie(n);return x.jsx(q0,{...o,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});mC.displayName=pC;var gC=$h,vC=zh,yC=Wh,bC=Uh,xC=Yh,wC=Kh,SC=Gh,CC=qh,TC=Xh;function Fa({...e}){return x.jsx(gC,{"data-slot":"dropdown-menu",...e})}function $a({...e}){return x.jsx(vC,{"data-slot":"dropdown-menu-trigger",...e})}function Ba({className:e,sideOffset:t=4,...n}){return x.jsx(yC,{children:x.jsx(bC,{"data-slot":"dropdown-menu-content",sideOffset:t,style:{zIndex:100},className:de("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-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",e),...n})})}function Ml({className:e,inset:t,variant:n="default",...r}){return x.jsx(wC,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":n,className:de("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",e),...r})}function DC({className:e,children:t,checked:n,...r}){return x.jsxs(SC,{"data-slot":"dropdown-menu-checkbox-item",className:de("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),checked:n,...r,children:[x.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:x.jsx(CC,{children:x.jsx(sf,{className:"size-4"})})}),t]})}function EC({className:e,inset:t,...n}){return x.jsx(xC,{"data-slot":"dropdown-menu-label","data-inset":t,className:de("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",e),...n})}function MC({className:e,...t}){return x.jsx(TC,{"data-slot":"dropdown-menu-separator",className:de("bg-border -mx-1 my-1 h-px",e),...t})}var RC="Label",Zh=D.forwardRef((e,t)=>x.jsx(ae.label,{...e,ref:t,onMouseDown:n=>{var o;n.target.closest("button, input, select, textarea")||((o=e.onMouseDown)==null||o.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));Zh.displayName=RC;var PC=Zh;function AC({className:e,...t}){return x.jsx(PC,{"data-slot":"label",className:de("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...t})}const OC={isDragging:!1},hn=Ho(e=>({...OC,updateIsDragging:t=>e(n=>({...n,isDragging:t}))})),kC=({onClose:e,side:t,onOpenChange:n,buttonTrigger:r,modal:o=!1,children:s})=>{const[i,a]=E.useState({x:0,y:0}),c=hn(is(m=>m.updateIsDragging)),{attributes:l,listeners:u,setNodeRef:d,transform:h,setActivatorNodeRef:f}=ua({id:"booking_info",data:{type:"another"}}),S={transform:`translate3d(${i.x+((h==null?void 0:h.x)||0)}px, ${i.y+((h==null?void 0:h.y)||0)}px, 0)`};return _r({onDragStart(){c(!0)},onDragEnd(m){if(m.active.id){const{y:w,x:g}=i;a({x:g+((h==null?void 0:h.x)||0),y:w+((h==null?void 0:h.y)||0)}),c(!1)}}}),x.jsxs(Fa,{dir:"ltr",modal:o,open:!0,onOpenChange:n,children:[x.jsx($a,{asChild:!0,children:r||x.jsx("div",{})}),x.jsxs(Ba,{ref:d,style:{...S,zIndex:100,width:"25rem"},forceMount:!0,avoidCollisions:!0,side:t,sticky:"always",updatePositionStrategy:"always",...l,children:[x.jsxs("div",{className:"dropdownLabelContent",children:[x.jsx(AC,{ref:f,className:"dropdownLabelContent_dropdownLabel",...u,children:"Appointment"}),x.jsx(xb,{className:"dropdownLabelContent_close",onClick:e})]}),s]})]})},Jh=({modal:e=!1,side:t,onClose:n,onOpenChange:r,buttonTrigger:o,ref:s})=>{const[i,a]=E.useState(!1),{createBookingModal:c}=Lt(),l=()=>{a(!1),n==null||n()},u=d=>{a(d),r==null||r(d)};return E.useImperativeHandle(s,()=>({showCreationModal:()=>a(!0),closeModal:()=>a(!1),isModalOpen:()=>i})),x.jsx(x.Fragment,{children:i&&x.jsx(la,{children:x.jsx(kC,{onClose:l,onOpenChange:u,modal:e,side:t,buttonTrigger:o,children:c})})})},_C=({children:e})=>{const{bookingViewType:t,daysOfWeek:n}=Le(),{setTodayDay:r,setBookingViewType:o}=Le(),{updateMonthMessage:s,updateHeaderDateLabel:i}=Ad(g=>g),{onViewTypeChange:a}=Rd(),{onHeaderDayClick:c}=Lt(),{resetSelectedNode:l,resetNodes:u}=Tt(g=>g),d=E.useRef(null),h=()=>d.current,f=()=>{var g;(g=h())==null||g.showCreationModal()},S=E.useCallback(g=>{const p=()=>{o(se.WEEK),a(se.WEEK)},v=()=>t===se.DAY;if(c==null||c(g,t),v())return p();const C=r(g);if(!C)return;const y={month:C.getMonth(),fullYear:C.getFullYear(),monthMessage:Mn[C.getMonth()]};s(y),o(se.DAY)},[t,r,s,o]),m=t===se.TABLE?{justifySelf:"start"}:{},w=E.useMemo(()=>{const g=p=>new Date(p).toDateString()===new Date().toDateString();return n.map(p=>{const v=ui[new Date(p).getDay()];return x.jsx("th",{className:de("daysOfWeek"),children:x.jsxs("div",{style:{...m,maxWidth:t===se.DAY?"11rem":void 0},className:"daysOfWeek_parent",children:[x.jsx("span",{className:de(g(p)&&"daysOfWeek_day_today_title"),children:v}),x.jsx("div",{style:{width:"100%"},children:x.jsx("button",{type:"button",className:de(g(p)?"daysOfWeek_day_today":"daysOfWeek_day_rest"),onClick:()=>S(p),children:Z.formatDate(p.toDateString())})})]})},v)})},[n,S,t]);return E.useEffect(()=>{switch(t){case se.DAY:{u(),l(),i(n[0]);break}case se.WEEK:{const g=Z.generateWeekMonthLabel(n);s({monthMessage:g})}}},[n]),x.jsxs(x.Fragment,{children:[x.jsxs("table",{className:"daysOfWeek_table",children:[x.jsx("thead",{children:x.jsxs("tr",{children:[x.jsx("th",{style:{...m,zIndex:100},className:"time-col",children:x.jsx("div",{className:"daysOfWeek_emptySlot",children:x.jsx(Ea,{content:"createNewBookingLabel",children:x.jsx(an,{variant:"ghost",onClick:f,children:x.jsx(ib,{})})})})},"emptyBlocks"),w]})}),e]}),x.jsx(Jh,{modal:!0,ref:d})]})};function NC({className:e,...t}){return x.jsx("td",{"data-slot":"table-cell",className:de("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t})}const Mi={resizeBookingNorthId:e=>e!=null&&e.overflow?{startAt:e.startAt,id:e.id}:e,resizeBookingSouthId:e=>e!=null&&e.overflow?{finishAt:e.finishAt,id:e.id}:e,resetToFirstHourNextDay:e=>{const t=new Date(e.startAt);return t.setHours(0,0,0,0),t.setDate(e.finishAt.getDate()),t}},IC={capitalize(e){return`${this.returnFirstChar(e)}${e.slice(1,e.length)}`},returnFirstChar(e){return e.charAt(0).toUpperCase()}},Ri=({booking:e,slotData:t,events:n,style:r,ref:o})=>{if(!e||!t||!t)return;const{day:s,hour:i}=t,[a,c]=E.useState(e),l=d=>d<="11:30",u=(d,h)=>{const f=Z.dateAndHourDateToString(new Date(d.finishAt));return Z.isTodayDate(h)&&l(f)?{backgroundColor:"#000000c0"}:{backgroundColor:"#000456c0"}};return E.useEffect(()=>{e&&c(e)},[e]),E.useImperativeHandle(o,()=>({updateBooking:d=>c(d)})),x.jsx("div",{className:"booking_card_content_container",style:{...u(a,new Date(s.split(":")[1])),...r},onPointerUp:n==null?void 0:n.onClick,children:x.jsx("div",{className:"booking_card_content",children:x.jsx("p",{className:"booking_info",children:`${Z.dateAndHourDateToString(a.startAt)} - ${Z.dateAndHourDateToString(a.finishAt)}`})})},`${s}-${i}`)};function jC(e,t,n){const r={...e};return t.top+e.y<=n.top?r.y=n.top-t.top:t.bottom+e.y>=n.top+n.height&&(r.y=n.top+n.height-t.bottom),t.left+e.x<=n.left?r.x=n.left-t.left:t.right+e.x>=n.left+n.width&&(r.x=n.left+n.width-t.right),r}const LC=e=>{let{transform:t,draggingNodeRect:n,windowRect:r}=e;return!n||!r?t:jC(t,n,r)},Qh=E.createContext({});function VC(e){const t=E.useRef(null);return t.current===null&&(t.current=e()),t.current}const za=typeof window<"u",FC=za?E.useLayoutEffect:E.useEffect,Wa=E.createContext(null);function Ha(e,t){e.indexOf(t)===-1&&e.push(t)}function Ua(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const wt=(e,t,n)=>n>t?t:n<e?e:n;let zn=()=>{},St=()=>{};process.env.NODE_ENV!=="production"&&(zn=(e,t)=>{!e&&typeof console<"u"&&console.warn(t)},St=(e,t)=>{if(!e)throw new Error(t)});const Ct={},ep=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function tp(e){return typeof e=="object"&&e!==null}const np=e=>/^0[^.\s]+$/u.test(e);function Ya(e){let t;return()=>(t===void 0&&(t=e()),t)}const Xe=e=>e,$C=(e,t)=>n=>t(e(n)),Wr=(...e)=>e.reduce($C),Cr=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r};class Ka{constructor(){this.subscriptions=[]}add(t){return Ha(this.subscriptions,t),()=>Ua(this.subscriptions,t)}notify(t,n,r){const o=this.subscriptions.length;if(o)if(o===1)this.subscriptions[0](t,n,r);else for(let s=0;s<o;s++){const i=this.subscriptions[s];i&&i(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const et=e=>e*1e3,ut=e=>e/1e3;function rp(e,t){return t?e*(1e3/t):0}const Rl=new Set;function Ga(e,t,n){e||Rl.has(t)||(console.warn(t),Rl.add(t))}const op=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,BC=1e-7,zC=12;function WC(e,t,n,r,o){let s,i,a=0;do i=t+(n-t)/2,s=op(i,r,o)-e,s>0?n=i:t=i;while(Math.abs(s)>BC&&++a<zC);return i}function Hr(e,t,n,r){if(e===t&&n===r)return Xe;const o=s=>WC(s,0,1,e,n);return s=>s===0||s===1?s:op(o(s),t,r)}const sp=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,ip=e=>t=>1-e(1-t),ap=Hr(.33,1.53,.69,.99),qa=ip(ap),cp=sp(qa),lp=e=>(e*=2)<1?.5*qa(e):.5*(2-Math.pow(2,-10*(e-1))),Xa=e=>1-Math.sin(Math.acos(e)),up=ip(Xa),dp=sp(Xa),HC=Hr(.42,0,1,1),UC=Hr(0,0,.58,1),fp=Hr(.42,0,.58,1),YC=e=>Array.isArray(e)&&typeof e[0]!="number",hp=e=>Array.isArray(e)&&typeof e[0]=="number",Pl={linear:Xe,easeIn:HC,easeInOut:fp,easeOut:UC,circIn:Xa,circInOut:dp,circOut:up,backIn:qa,backInOut:cp,backOut:ap,anticipate:lp},KC=e=>typeof e=="string",Al=e=>{if(hp(e)){St(e.length===4,"Cubic bezier arrays must contain four numerical values.");const[t,n,r,o]=e;return Hr(t,n,r,o)}else if(KC(e))return St(Pl[e]!==void 0,`Invalid easing type '${e}'`),Pl[e];return e},oo=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"],Ol={value:null};function GC(e,t){let n=new Set,r=new Set,o=!1,s=!1;const i=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1},c=0;function l(d){i.has(d)&&(u.schedule(d),e()),c++,d(a)}const u={schedule:(d,h=!1,f=!1)=>{const m=f&&o?n:r;return h&&i.add(d),m.has(d)||m.add(d),d},cancel:d=>{r.delete(d),i.delete(d)},process:d=>{if(a=d,o){s=!0;return}o=!0,[n,r]=[r,n],n.forEach(l),t&&Ol.value&&Ol.value.frameloop[t].push(c),c=0,n.clear(),o=!1,s&&(s=!1,u.process(d))}};return u}const qC=40;function pp(e,t){let n=!1,r=!0;const o={delta:0,timestamp:0,isProcessing:!1},s=()=>n=!0,i=oo.reduce((v,C)=>(v[C]=GC(s,t?C:void 0),v),{}),{setup:a,read:c,resolveKeyframes:l,preUpdate:u,update:d,preRender:h,render:f,postRender:S}=i,m=()=>{const v=Ct.useManualTiming?o.timestamp:performance.now();n=!1,Ct.useManualTiming||(o.delta=r?1e3/60:Math.max(Math.min(v-o.timestamp,qC),1)),o.timestamp=v,o.isProcessing=!0,a.process(o),c.process(o),l.process(o),u.process(o),d.process(o),h.process(o),f.process(o),S.process(o),o.isProcessing=!1,n&&t&&(r=!1,e(m))},w=()=>{n=!0,r=!0,o.isProcessing||e(m)};return{schedule:oo.reduce((v,C)=>{const y=i[C];return v[C]=(M,b=!1,T=!1)=>(n||w(),y.schedule(M,b,T)),v},{}),cancel:v=>{for(let C=0;C<oo.length;C++)i[oo[C]].cancel(v)},state:o,steps:i}}const{schedule:ve,cancel:zt,state:De,steps:zs}=pp(typeof requestAnimationFrame<"u"?requestAnimationFrame:Xe,!0);let bo;function XC(){bo=void 0}const je={now:()=>(bo===void 0&&je.set(De.isProcessing||Ct.useManualTiming?De.timestamp:performance.now()),bo),set:e=>{bo=e,queueMicrotask(XC)}},mp=e=>t=>typeof t=="string"&&t.startsWith(e),Za=mp("--"),ZC=mp("var(--"),Ja=e=>ZC(e)?JC.test(e.split("/*")[0].trim()):!1,JC=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Wn={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Tr={...Wn,transform:e=>wt(0,1,e)},so={...Wn,default:1},fr=e=>Math.round(e*1e5)/1e5,Qa=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function QC(e){return e==null}const eT=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,ec=(e,t)=>n=>!!(typeof n=="string"&&eT.test(n)&&n.startsWith(e)||t&&!QC(n)&&Object.prototype.hasOwnProperty.call(n,t)),gp=(e,t,n)=>r=>{if(typeof r!="string")return r;const[o,s,i,a]=r.match(Qa);return{[e]:parseFloat(o),[t]:parseFloat(s),[n]:parseFloat(i),alpha:a!==void 0?parseFloat(a):1}},tT=e=>wt(0,255,e),Ws={...Wn,transform:e=>Math.round(tT(e))},en={test:ec("rgb","red"),parse:gp("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+Ws.transform(e)+", "+Ws.transform(t)+", "+Ws.transform(n)+", "+fr(Tr.transform(r))+")"};function nT(e){let t="",n="",r="",o="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),o=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),o=e.substring(4,5),t+=t,n+=n,r+=r,o+=o),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:o?parseInt(o,16)/255:1}}const Pi={test:ec("#"),parse:nT,transform:en.transform},Ur=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Nt=Ur("deg"),dt=Ur("%"),re=Ur("px"),rT=Ur("vh"),oT=Ur("vw"),kl={...dt,parse:e=>dt.parse(e)/100,transform:e=>dt.transform(e*100)},wn={test:ec("hsl","hue"),parse:gp("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+dt.transform(fr(t))+", "+dt.transform(fr(n))+", "+fr(Tr.transform(r))+")"},Re={test:e=>en.test(e)||Pi.test(e)||wn.test(e),parse:e=>en.test(e)?en.parse(e):wn.test(e)?wn.parse(e):Pi.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?en.transform(e):wn.transform(e)},sT=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function iT(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(Qa))==null?void 0:t.length)||0)+(((n=e.match(sT))==null?void 0:n.length)||0)>0}const vp="number",yp="color",aT="var",cT="var(",_l="${}",lT=/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 Dr(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},o=[];let s=0;const a=t.replace(lT,c=>(Re.test(c)?(r.color.push(s),o.push(yp),n.push(Re.parse(c))):c.startsWith(cT)?(r.var.push(s),o.push(aT),n.push(c)):(r.number.push(s),o.push(vp),n.push(parseFloat(c))),++s,_l)).split(_l);return{values:n,split:a,indexes:r,types:o}}function bp(e){return Dr(e).values}function xp(e){const{split:t,types:n}=Dr(e),r=t.length;return o=>{let s="";for(let i=0;i<r;i++)if(s+=t[i],o[i]!==void 0){const a=n[i];a===vp?s+=fr(o[i]):a===yp?s+=Re.transform(o[i]):s+=o[i]}return s}}const uT=e=>typeof e=="number"?0:e;function dT(e){const t=bp(e);return xp(e)(t.map(uT))}const Wt={test:iT,parse:bp,createTransformer:xp,getAnimatableNone:dT};function Hs(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function fT({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let o=0,s=0,i=0;if(!t)o=s=i=n;else{const a=n<.5?n*(1+t):n+t-n*t,c=2*n-a;o=Hs(c,a,e+1/3),s=Hs(c,a,e),i=Hs(c,a,e-1/3)}return{red:Math.round(o*255),green:Math.round(s*255),blue:Math.round(i*255),alpha:r}}function jo(e,t){return n=>n>0?t:e}const ge=(e,t,n)=>e+(t-e)*n,Us=(e,t,n)=>{const r=e*e,o=n*(t*t-r)+r;return o<0?0:Math.sqrt(o)},hT=[Pi,en,wn],pT=e=>hT.find(t=>t.test(e));function Nl(e){const t=pT(e);if(zn(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`),!t)return!1;let n=t.parse(e);return t===wn&&(n=fT(n)),n}const Il=(e,t)=>{const n=Nl(e),r=Nl(t);if(!n||!r)return jo(e,t);const o={...n};return s=>(o.red=Us(n.red,r.red,s),o.green=Us(n.green,r.green,s),o.blue=Us(n.blue,r.blue,s),o.alpha=ge(n.alpha,r.alpha,s),en.transform(o))},Ai=new Set(["none","hidden"]);function mT(e,t){return Ai.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function gT(e,t){return n=>ge(e,t,n)}function tc(e){return typeof e=="number"?gT:typeof e=="string"?Ja(e)?jo:Re.test(e)?Il:bT:Array.isArray(e)?wp:typeof e=="object"?Re.test(e)?Il:vT:jo}function wp(e,t){const n=[...e],r=n.length,o=e.map((s,i)=>tc(s)(s,t[i]));return s=>{for(let i=0;i<r;i++)n[i]=o[i](s);return n}}function vT(e,t){const n={...e,...t},r={};for(const o in n)e[o]!==void 0&&t[o]!==void 0&&(r[o]=tc(e[o])(e[o],t[o]));return o=>{for(const s in r)n[s]=r[s](o);return n}}function yT(e,t){const n=[],r={color:0,var:0,number:0};for(let o=0;o<t.values.length;o++){const s=t.types[o],i=e.indexes[s][r[s]],a=e.values[i]??0;n[o]=a,r[s]++}return n}const bT=(e,t)=>{const n=Wt.createTransformer(t),r=Dr(e),o=Dr(t);return r.indexes.var.length===o.indexes.var.length&&r.indexes.color.length===o.indexes.color.length&&r.indexes.number.length>=o.indexes.number.length?Ai.has(e)&&!o.values.length||Ai.has(t)&&!r.values.length?mT(e,t):Wr(wp(yT(r,o),o.values),n):(zn(!0,`Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`),jo(e,t))};function Sp(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?ge(e,t,n):tc(e)(e,t)}const xT=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>ve.update(t,n),stop:()=>zt(t),now:()=>De.isProcessing?De.timestamp:je.now()}},Cp=(e,t,n=10)=>{let r="";const o=Math.max(Math.round(t/n),2);for(let s=0;s<o;s++)r+=e(s/(o-1))+", ";return`linear(${r.substring(0,r.length-2)})`},Lo=2e4;function nc(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<Lo;)t+=n,r=e.next(t);return t>=Lo?1/0:t}function wT(e,t=100,n){const r=n({...e,keyframes:[0,t]}),o=Math.min(nc(r),Lo);return{type:"keyframes",ease:s=>r.next(o*s).value/t,duration:ut(o)}}const ST=5;function Tp(e,t,n){const r=Math.max(t-ST,0);return rp(n-e(r),t-r)}const me={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},jl=.001;function CT({duration:e=me.duration,bounce:t=me.bounce,velocity:n=me.velocity,mass:r=me.mass}){let o,s;zn(e<=et(me.maxDuration),"Spring duration must be 10 seconds or less");let i=1-t;i=wt(me.minDamping,me.maxDamping,i),e=wt(me.minDuration,me.maxDuration,ut(e)),i<1?(o=l=>{const u=l*i,d=u*e,h=u-n,f=Oi(l,i),S=Math.exp(-d);return jl-h/f*S},s=l=>{const d=l*i*e,h=d*n+n,f=Math.pow(i,2)*Math.pow(l,2)*e,S=Math.exp(-d),m=Oi(Math.pow(l,2),i);return(-o(l)+jl>0?-1:1)*((h-f)*S)/m}):(o=l=>{const u=Math.exp(-l*e),d=(l-n)*e+1;return-.001+u*d},s=l=>{const u=Math.exp(-l*e),d=(n-l)*(e*e);return u*d});const a=5/e,c=DT(o,s,a);if(e=et(e),isNaN(c))return{stiffness:me.stiffness,damping:me.damping,duration:e};{const l=Math.pow(c,2)*r;return{stiffness:l,damping:i*2*Math.sqrt(r*l),duration:e}}}const TT=12;function DT(e,t,n){let r=n;for(let o=1;o<TT;o++)r=r-e(r)/t(r);return r}function Oi(e,t){return e*Math.sqrt(1-t*t)}const ET=["duration","bounce"],MT=["stiffness","damping","mass"];function Ll(e,t){return t.some(n=>e[n]!==void 0)}function RT(e){let t={velocity:me.velocity,stiffness:me.stiffness,damping:me.damping,mass:me.mass,isResolvedFromDuration:!1,...e};if(!Ll(e,MT)&&Ll(e,ET))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),o=r*r,s=2*wt(.05,1,1-(e.bounce||0))*Math.sqrt(o);t={...t,mass:me.mass,stiffness:o,damping:s}}else{const n=CT(e);t={...t,...n,mass:me.mass},t.isResolvedFromDuration=!0}return t}function Vo(e=me.visualDuration,t=me.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:o}=n;const s=n.keyframes[0],i=n.keyframes[n.keyframes.length-1],a={done:!1,value:s},{stiffness:c,damping:l,mass:u,duration:d,velocity:h,isResolvedFromDuration:f}=RT({...n,velocity:-ut(n.velocity||0)}),S=h||0,m=l/(2*Math.sqrt(c*u)),w=i-s,g=ut(Math.sqrt(c/u)),p=Math.abs(w)<5;r||(r=p?me.restSpeed.granular:me.restSpeed.default),o||(o=p?me.restDelta.granular:me.restDelta.default);let v;if(m<1){const y=Oi(g,m);v=M=>{const b=Math.exp(-m*g*M);return i-b*((S+m*g*w)/y*Math.sin(y*M)+w*Math.cos(y*M))}}else if(m===1)v=y=>i-Math.exp(-g*y)*(w+(S+g*w)*y);else{const y=g*Math.sqrt(m*m-1);v=M=>{const b=Math.exp(-m*g*M),T=Math.min(y*M,300);return i-b*((S+m*g*w)*Math.sinh(T)+y*w*Math.cosh(T))/y}}const C={calculatedDuration:f&&d||null,next:y=>{const M=v(y);if(f)a.done=y>=d;else{let b=y===0?S:0;m<1&&(b=y===0?et(S):Tp(v,y,M));const T=Math.abs(b)<=r,R=Math.abs(i-M)<=o;a.done=T&&R}return a.value=a.done?i:M,a},toString:()=>{const y=Math.min(nc(C),Lo),M=Cp(b=>C.next(y*b).value,y,30);return y+"ms "+M},toTransition:()=>{}};return C}Vo.applyToOptions=e=>{const t=wT(e,100,Vo);return e.ease=t.ease,e.duration=et(t.duration),e.type="keyframes",e};function ki({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:o=10,bounceStiffness:s=500,modifyTarget:i,min:a,max:c,restDelta:l=.5,restSpeed:u}){const d=e[0],h={done:!1,value:d},f=T=>a!==void 0&&T<a||c!==void 0&&T>c,S=T=>a===void 0?c:c===void 0||Math.abs(a-T)<Math.abs(c-T)?a:c;let m=n*t;const w=d+m,g=i===void 0?w:i(w);g!==w&&(m=g-d);const p=T=>-m*Math.exp(-T/r),v=T=>g+p(T),C=T=>{const R=p(T),_=v(T);h.done=Math.abs(R)<=l,h.value=h.done?g:_};let y,M;const b=T=>{f(h.value)&&(y=T,M=Vo({keyframes:[h.value,S(h.value)],velocity:Tp(v,T,h.value),damping:o,stiffness:s,restDelta:l,restSpeed:u}))};return b(0),{calculatedDuration:null,next:T=>{let R=!1;return!M&&y===void 0&&(R=!0,C(T),b(T)),y!==void 0&&T>=y?M.next(T-y):(!R&&C(T),h)}}}function PT(e,t,n){const r=[],o=n||Ct.mix||Sp,s=e.length-1;for(let i=0;i<s;i++){let a=o(e[i],e[i+1]);if(t){const c=Array.isArray(t)?t[i]||Xe:t;a=Wr(c,a)}r.push(a)}return r}function AT(e,t,{clamp:n=!0,ease:r,mixer:o}={}){const s=e.length;if(St(s===t.length,"Both input and output ranges must be the same length"),s===1)return()=>t[0];if(s===2&&t[0]===t[1])return()=>t[1];const i=e[0]===e[1];e[0]>e[s-1]&&(e=[...e].reverse(),t=[...t].reverse());const a=PT(t,r,o),c=a.length,l=u=>{if(i&&u<e[0])return t[0];let d=0;if(c>1)for(;d<e.length-2&&!(u<e[d+1]);d++);const h=Cr(e[d],e[d+1],u);return a[d](h)};return n?u=>l(wt(e[0],e[s-1],u)):l}function OT(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const o=Cr(0,t,r);e.push(ge(n,1,o))}}function kT(e){const t=[0];return OT(t,e.length-1),t}function _T(e,t){return e.map(n=>n*t)}function NT(e,t){return e.map(()=>t||fp).splice(0,e.length-1)}function Sn({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const o=YC(r)?r.map(Al):Al(r),s={done:!1,value:t[0]},i=_T(n&&n.length===t.length?n:kT(t),e),a=AT(i,t,{ease:Array.isArray(o)?o:NT(t,o)});return{calculatedDuration:e,next:c=>(s.value=a(c),s.done=c>=e,s)}}const IT=e=>e!==null;function rc(e,{repeat:t,repeatType:n="loop"},r,o=1){const s=e.filter(IT),a=o<0||t&&n!=="loop"&&t%2===1?0:s.length-1;return!a||r===void 0?s[a]:r}const jT={decay:ki,inertia:ki,tween:Sn,keyframes:Sn,spring:Vo};function Dp(e){typeof e.type=="string"&&(e.type=jT[e.type])}class oc{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,n){return this.finished.then(t,n)}}const LT=e=>e/100;class sc extends oc{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=(n=!0)=>{var r,o;if(n){const{motionValue:s}=this.options;s&&s.updatedAt!==je.now()&&this.tick(je.now())}this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(o=(r=this.options).onStop)==null||o.call(r))},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;Dp(t);const{type:n=Sn,repeat:r=0,repeatDelay:o=0,repeatType:s,velocity:i=0}=t;let{keyframes:a}=t;const c=n||Sn;process.env.NODE_ENV!=="production"&&c!==Sn&&St(a.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${a}`),c!==Sn&&typeof a[0]!="number"&&(this.mixKeyframes=Wr(LT,Sp(a[0],a[1])),a=[0,100]);const l=c({...t,keyframes:a});s==="mirror"&&(this.mirroredGenerator=c({...t,keyframes:[...a].reverse(),velocity:-i})),l.calculatedDuration===null&&(l.calculatedDuration=nc(l));const{calculatedDuration:u}=l;this.calculatedDuration=u,this.resolvedDuration=u+o,this.totalDuration=this.resolvedDuration*(r+1)-o,this.generator=l}updateTime(t){const n=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(t,n=!1){const{generator:r,totalDuration:o,mixKeyframes:s,mirroredGenerator:i,resolvedDuration:a,calculatedDuration:c}=this;if(this.startTime===null)return r.next(0);const{delay:l=0,keyframes:u,repeat:d,repeatType:h,repeatDelay:f,type:S,onUpdate:m,finalKeyframe:w}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-o/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const g=this.currentTime-l*(this.playbackSpeed>=0?1:-1),p=this.playbackSpeed>=0?g<0:g>o;this.currentTime=Math.max(g,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=o);let v=this.currentTime,C=r;if(d){const T=Math.min(this.currentTime,o)/a;let R=Math.floor(T),_=T%1;!_&&T>=1&&(_=1),_===1&&R--,R=Math.min(R,d+1),!!(R%2)&&(h==="reverse"?(_=1-_,f&&(_-=f/a)):h==="mirror"&&(C=i)),v=wt(0,1,_)*a}const y=p?{done:!1,value:u[0]}:C.next(v);s&&(y.value=s(y.value));let{done:M}=y;!p&&c!==null&&(M=this.playbackSpeed>=0?this.currentTime>=o:this.currentTime<=0);const b=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&M);return b&&S!==ki&&(y.value=rc(u,this.options,w,this.speed)),m&&m(y.value),b&&this.finish(),y}then(t,n){return this.finished.then(t,n)}get duration(){return ut(this.calculatedDuration)}get time(){return ut(this.currentTime)}set time(t){var n;t=et(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),(n=this.driver)==null||n.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(je.now());const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=ut(this.currentTime))}play(){var o,s;if(this.isStopped)return;const{driver:t=xT,startTime:n}=this.options;this.driver||(this.driver=t(i=>this.tick(i))),(s=(o=this.options).onPlay)==null||s.call(o);const r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=n??r),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(je.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var t,n;this.notifyFinished(),this.teardown(),this.state="finished",(n=(t=this.options).onComplete)==null||n.call(t)}cancel(){var t,n;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(n=(t=this.options).onCancel)==null||n.call(t)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){var n;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(n=this.driver)==null||n.stop(),t.observe(this)}}function VT(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const tn=e=>e*180/Math.PI,_i=e=>{const t=tn(Math.atan2(e[1],e[0]));return Ni(t)},FT={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:_i,rotateZ:_i,skewX:e=>tn(Math.atan(e[1])),skewY:e=>tn(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Ni=e=>(e=e%360,e<0&&(e+=360),e),Vl=_i,Fl=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),$l=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),$T={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Fl,scaleY:$l,scale:e=>(Fl(e)+$l(e))/2,rotateX:e=>Ni(tn(Math.atan2(e[6],e[5]))),rotateY:e=>Ni(tn(Math.atan2(-e[2],e[0]))),rotateZ:Vl,rotate:Vl,skewX:e=>tn(Math.atan(e[4])),skewY:e=>tn(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function Ii(e){return e.includes("scale")?1:0}function ji(e,t){if(!e||e==="none")return Ii(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,o;if(n)r=$T,o=n;else{const a=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=FT,o=a}if(!o)return Ii(t);const s=r[t],i=o[1].split(",").map(zT);return typeof s=="function"?s(i):i[s]}const BT=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return ji(n,t)};function zT(e){return parseFloat(e.trim())}const Hn=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Un=new Set(Hn),Bl=e=>e===Wn||e===re,WT=new Set(["x","y","z"]),HT=Hn.filter(e=>!WT.has(e));function UT(e){const t=[];return HT.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const nn={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>ji(t,"x"),y:(e,{transform:t})=>ji(t,"y")};nn.translateX=nn.x;nn.translateY=nn.y;const rn=new Set;let Li=!1,Vi=!1,Fi=!1;function Ep(){if(Vi){const e=Array.from(rn).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const o=UT(r);o.length&&(n.set(r,o),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const o=n.get(r);o&&o.forEach(([s,i])=>{var a;(a=r.getValue(s))==null||a.set(i)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}Vi=!1,Li=!1,rn.forEach(e=>e.complete(Fi)),rn.clear()}function Mp(){rn.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Vi=!0)})}function YT(){Fi=!0,Mp(),Ep(),Fi=!1}class ic{constructor(t,n,r,o,s,i=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=o,this.element=s,this.isAsync=i}scheduleResolve(){this.state="scheduled",this.isAsync?(rn.add(this),Li||(Li=!0,ve.read(Mp),ve.resolveKeyframes(Ep))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:o}=this;if(t[0]===null){const s=o==null?void 0:o.get(),i=t[t.length-1];if(s!==void 0)t[0]=s;else if(r&&n){const a=r.readValue(n,i);a!=null&&(t[0]=a)}t[0]===void 0&&(t[0]=i),o&&s===void 0&&o.set(t[0])}VT(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),rn.delete(this)}cancel(){this.state==="scheduled"&&(rn.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const KT=e=>e.startsWith("--");function GT(e,t,n){KT(t)?e.style.setProperty(t,n):e.style[t]=n}const qT=Ya(()=>window.ScrollTimeline!==void 0),XT={};function ZT(e,t){const n=Ya(e);return()=>XT[t]??n()}const Rp=ZT(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),ar=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,zl={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:ar([0,.65,.55,1]),circOut:ar([.55,0,1,.45]),backIn:ar([.31,.01,.66,-.59]),backOut:ar([.33,1.53,.69,.99])};function Pp(e,t){if(e)return typeof e=="function"?Rp()?Cp(e,t):"ease-out":hp(e)?ar(e):Array.isArray(e)?e.map(n=>Pp(n,t)||zl.easeOut):zl[e]}function JT(e,t,n,{delay:r=0,duration:o=300,repeat:s=0,repeatType:i="loop",ease:a="easeOut",times:c}={},l=void 0){const u={[t]:n};c&&(u.offset=c);const d=Pp(a,o);Array.isArray(d)&&(u.easing=d);const h={delay:r,duration:o,easing:Array.isArray(d)?"linear":d,fill:"both",iterations:s+1,direction:i==="reverse"?"alternate":"normal"};return l&&(h.pseudoElement=l),e.animate(u,h)}function Ap(e){return typeof e=="function"&&"applyToOptions"in e}function QT({type:e,...t}){return Ap(e)&&Rp()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class eD extends oc{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,!t)return;const{element:n,name:r,keyframes:o,pseudoElement:s,allowFlatten:i=!1,finalKeyframe:a,onComplete:c}=t;this.isPseudoElement=!!s,this.allowFlatten=i,this.options=t,St(typeof t.type!="string",`animateMini doesn't support "type" as a string. Did you mean to import { spring } from "motion"?`);const l=QT(t);this.animation=JT(n,r,o,l,s),l.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!s){const u=rc(o,this.options,a,this.speed);this.updateMotionValue?this.updateMotionValue(u):GT(n,r,u),this.animation.cancel()}c==null||c(),this.notifyFinished()}}play(){this.isStopped||(this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var t,n;(n=(t=this.animation).finish)==null||n.call(t)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var t,n;this.isPseudoElement||(n=(t=this.animation).commitStyles)==null||n.call(t)}get duration(){var n,r;const t=((r=(n=this.animation.effect)==null?void 0:n.getComputedTiming)==null?void 0:r.call(n).duration)||0;return ut(Number(t))}get time(){return ut(Number(this.animation.currentTime)||0)}set time(t){this.finishedTime=null,this.animation.currentTime=et(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(t){this.animation.startTime=t}attachTimeline({timeline:t,observe:n}){var r;return this.allowFlatten&&((r=this.animation.effect)==null||r.updateTiming({easing:"linear"})),this.animation.onfinish=null,t&&qT()?(this.animation.timeline=t,Xe):n(this)}}const Op={anticipate:lp,backInOut:cp,circInOut:dp};function tD(e){return e in Op}function nD(e){typeof e.ease=="string"&&tD(e.ease)&&(e.ease=Op[e.ease])}const Wl=10;class rD extends eD{constructor(t){nD(t),Dp(t),super(t),t.startTime&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:r,onComplete:o,element:s,...i}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const a=new sc({...i,autoplay:!1}),c=et(this.finishedTime??this.time);n.setWithVelocity(a.sample(c-Wl).value,a.sample(c).value,Wl),a.stop()}}const Hl=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Wt.test(e)||e==="0")&&!e.startsWith("url("));function oD(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function sD(e,t,n,r){const o=e[0];if(o===null)return!1;if(t==="display"||t==="visibility")return!0;const s=e[e.length-1],i=Hl(o,t),a=Hl(s,t);return zn(i===a,`You are trying to animate ${t} from "${o}" to "${s}". ${o} is not an animatable value - to enable this animation set ${o} to a value animatable to ${s} via the \`style\` property.`),!i||!a?!1:oD(e)||(n==="spring"||Ap(n))&&r}function kp(e){return tp(e)&&"offsetHeight"in e}const iD=new Set(["opacity","clipPath","filter","transform"]),aD=Ya(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function cD(e){var l;const{motionValue:t,name:n,repeatDelay:r,repeatType:o,damping:s,type:i}=e;if(!kp((l=t==null?void 0:t.owner)==null?void 0:l.current))return!1;const{onUpdate:a,transformTemplate:c}=t.owner.getProps();return aD()&&n&&iD.has(n)&&(n!=="transform"||!c)&&!a&&!r&&o!=="mirror"&&s!==0&&i!=="inertia"}const lD=40;class uD extends oc{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:o=0,repeatDelay:s=0,repeatType:i="loop",keyframes:a,name:c,motionValue:l,element:u,...d}){var S;super(),this.stop=()=>{var m,w;this._animation&&(this._animation.stop(),(m=this.stopTimeline)==null||m.call(this)),(w=this.keyframeResolver)==null||w.cancel()},this.createdAt=je.now();const h={autoplay:t,delay:n,type:r,repeat:o,repeatDelay:s,repeatType:i,name:c,motionValue:l,element:u,...d},f=(u==null?void 0:u.KeyframeResolver)||ic;this.keyframeResolver=new f(a,(m,w,g)=>this.onKeyframesResolved(m,w,h,!g),c,l,u),(S=this.keyframeResolver)==null||S.scheduleResolve()}onKeyframesResolved(t,n,r,o){this.keyframeResolver=void 0;const{name:s,type:i,velocity:a,delay:c,isHandoff:l,onUpdate:u}=r;this.resolvedAt=je.now(),sD(t,s,i,a)||((Ct.instantAnimations||!c)&&(u==null||u(rc(t,r,n))),t[0]=t[t.length-1],r.duration=0,r.repeat=0);const h={startTime:o?this.resolvedAt?this.resolvedAt-this.createdAt>lD?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:t},f=!l&&cD(h)?new rD({...h,element:h.motionValue.owner.current}):new sc(h);f.finished.then(()=>this.notifyFinished()).catch(Xe),this.pendingTimeline&&(this.stopTimeline=f.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=f}get finished(){return this._animation?this.animation.finished:this._finished}then(t,n){return this.finished.finally(t).then(()=>{})}get animation(){var t;return this._animation||((t=this.keyframeResolver)==null||t.resume(),YT()),this._animation}get duration(){return this.animation.duration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var t;this._animation&&this.animation.cancel(),(t=this.keyframeResolver)==null||t.cancel()}}const dD=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function fD(e){const t=dD.exec(e);if(!t)return[,];const[,n,r,o]=t;return[`--${n??r}`,o]}const hD=4;function _p(e,t,n=1){St(n<=hD,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`);const[r,o]=fD(e);if(!r)return;const s=window.getComputedStyle(t).getPropertyValue(r);if(s){const i=s.trim();return ep(i)?parseFloat(i):i}return Ja(o)?_p(o,t,n+1):o}function ac(e,t){return(e==null?void 0:e[t])??(e==null?void 0:e.default)??e}const Np=new Set(["width","height","top","left","right","bottom",...Hn]),pD={test:e=>e==="auto",parse:e=>e},Ip=e=>t=>t.test(e),jp=[Wn,re,dt,Nt,oT,rT,pD],Ul=e=>jp.find(Ip(e));function mD(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||np(e):!0}const gD=new Set(["brightness","contrast","saturate","opacity"]);function vD(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(Qa)||[];if(!r)return e;const o=n.replace(r,"");let s=gD.has(t)?1:0;return r!==n&&(s*=100),t+"("+s+o+")"}const yD=/\b([a-z-]*)\(.*?\)/gu,$i={...Wt,getAnimatableNone:e=>{const t=e.match(yD);return t?t.map(vD).join(" "):e}},Yl={...Wn,transform:Math.round},bD={rotate:Nt,rotateX:Nt,rotateY:Nt,rotateZ:Nt,scale:so,scaleX:so,scaleY:so,scaleZ:so,skew:Nt,skewX:Nt,skewY:Nt,distance:re,translateX:re,translateY:re,translateZ:re,x:re,y:re,z:re,perspective:re,transformPerspective:re,opacity:Tr,originX:kl,originY:kl,originZ:re},cc={borderWidth:re,borderTopWidth:re,borderRightWidth:re,borderBottomWidth:re,borderLeftWidth:re,borderRadius:re,radius:re,borderTopLeftRadius:re,borderTopRightRadius:re,borderBottomRightRadius:re,borderBottomLeftRadius:re,width:re,maxWidth:re,height:re,maxHeight:re,top:re,right:re,bottom:re,left:re,padding:re,paddingTop:re,paddingRight:re,paddingBottom:re,paddingLeft:re,margin:re,marginTop:re,marginRight:re,marginBottom:re,marginLeft:re,backgroundPositionX:re,backgroundPositionY:re,...bD,zIndex:Yl,fillOpacity:Tr,strokeOpacity:Tr,numOctaves:Yl},xD={...cc,color:Re,backgroundColor:Re,outlineColor:Re,fill:Re,stroke:Re,borderColor:Re,borderTopColor:Re,borderRightColor:Re,borderBottomColor:Re,borderLeftColor:Re,filter:$i,WebkitFilter:$i},Lp=e=>xD[e];function Vp(e,t){let n=Lp(e);return n!==$i&&(n=Wt),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const wD=new Set(["auto","none","0"]);function SD(e,t,n){let r=0,o;for(;r<e.length&&!o;){const s=e[r];typeof s=="string"&&!wD.has(s)&&Dr(s).values.length&&(o=e[r]),r++}if(o&&n)for(const s of t)e[s]=Vp(n,o)}class CD extends ic{constructor(t,n,r,o,s){super(t,n,r,o,s,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let c=0;c<t.length;c++){let l=t[c];if(typeof l=="string"&&(l=l.trim(),Ja(l))){const u=_p(l,n.current);u!==void 0&&(t[c]=u),c===t.length-1&&(this.finalKeyframe=l)}}if(this.resolveNoneKeyframes(),!Np.has(r)||t.length!==2)return;const[o,s]=t,i=Ul(o),a=Ul(s);if(i!==a)if(Bl(i)&&Bl(a))for(let c=0;c<t.length;c++){const l=t[c];typeof l=="string"&&(t[c]=parseFloat(l))}else nn[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let o=0;o<t.length;o++)(t[o]===null||mD(t[o]))&&r.push(o);r.length&&SD(t,r,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=nn[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const o=n[n.length-1];o!==void 0&&t.getValue(r,o).jump(o,!1)}measureEndState(){var a;const{element:t,name:n,unresolvedKeyframes:r}=this;if(!t||!t.current)return;const o=t.getValue(n);o&&o.jump(this.measuredOrigin,!1);const s=r.length-1,i=r[s];r[s]=nn[n](t.measureViewportBox(),window.getComputedStyle(t.current)),i!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=i),(a=this.removedTransforms)!=null&&a.length&&this.removedTransforms.forEach(([c,l])=>{t.getValue(c).set(l)}),this.resolveNoneKeyframes()}}function TD(e,t,n){if(e instanceof EventTarget)return[e];if(typeof e=="string"){let r=document;const o=(n==null?void 0:n[e])??r.querySelectorAll(e);return o?Array.from(o):[]}return Array.from(e)}const Kl=30,DD=e=>!isNaN(parseFloat(e));class ED{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,o=!0)=>{var i,a;const s=je.now();if(this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&((i=this.events.change)==null||i.notify(this.current),this.dependents))for(const c of this.dependents)c.dirty();o&&((a=this.events.renderRequest)==null||a.notify(this.current))},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=je.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=DD(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return process.env.NODE_ENV!=="production"&&Ga(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new Ka);const r=this.events[t].add(n);return t==="change"?()=>{r(),ve.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var t;(t=this.events.change)==null||t.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=je.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>Kl)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,Kl);return rp(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(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(){var t,n;(t=this.dependents)==null||t.clear(),(n=this.events.destroy)==null||n.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function _n(e,t){return new ED(e,t)}const Fp=(e,t)=>t&&typeof e=="number"?t.transform(e):e,{schedule:lc}=pp(queueMicrotask,!1),Je={x:!1,y:!1};function $p(){return Je.x||Je.y}function MD(e){return e==="x"||e==="y"?Je[e]?null:(Je[e]=!0,()=>{Je[e]=!1}):Je.x||Je.y?null:(Je.x=Je.y=!0,()=>{Je.x=Je.y=!1})}function Bp(e,t){const n=TD(e),r=new AbortController,o={passive:!0,...t,signal:r.signal};return[n,o,()=>r.abort()]}function Gl(e){return!(e.pointerType==="touch"||$p())}function RD(e,t,n={}){const[r,o,s]=Bp(e,n),i=a=>{if(!Gl(a))return;const{target:c}=a,l=t(c,a);if(typeof l!="function"||!c)return;const u=d=>{Gl(d)&&(l(d),c.removeEventListener("pointerleave",u))};c.addEventListener("pointerleave",u,o)};return r.forEach(a=>{a.addEventListener("pointerenter",i,o)}),s}const zp=(e,t)=>t?e===t?!0:zp(e,t.parentElement):!1,uc=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,PD=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function AD(e){return PD.has(e.tagName)||e.tabIndex!==-1}const xo=new WeakSet;function ql(e){return t=>{t.key==="Enter"&&e(t)}}function Ys(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const OD=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=ql(()=>{if(xo.has(n))return;Ys(n,"down");const o=ql(()=>{Ys(n,"up")}),s=()=>Ys(n,"cancel");n.addEventListener("keyup",o,t),n.addEventListener("blur",s,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function Xl(e){return uc(e)&&!$p()}function kD(e,t,n={}){const[r,o,s]=Bp(e,n),i=a=>{const c=a.currentTarget;if(!Xl(a))return;xo.add(c);const l=t(c,a),u=(f,S)=>{window.removeEventListener("pointerup",d),window.removeEventListener("pointercancel",h),xo.has(c)&&xo.delete(c),Xl(f)&&typeof l=="function"&&l(f,{success:S})},d=f=>{u(f,c===window||c===document||n.useGlobalTarget||zp(c,f.target))},h=f=>{u(f,!1)};window.addEventListener("pointerup",d,o),window.addEventListener("pointercancel",h,o)};return r.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",i,o),kp(a)&&(a.addEventListener("focus",l=>OD(l,o)),!AD(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),s}function Wp(e){return tp(e)&&"ownerSVGElement"in e}function _D(e){return Wp(e)&&e.tagName==="svg"}const Pe=e=>!!(e&&e.getVelocity),ND=[...jp,Re,Wt],ID=e=>ND.find(Ip(e)),Hp=E.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function jD(e=!0){const t=E.useContext(Wa);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:o}=t,s=E.useId();E.useEffect(()=>{if(e)return o(s)},[e]);const i=E.useCallback(()=>e&&r&&r(s),[s,r,e]);return!n&&r?[!1,i]:[!0]}const Up=E.createContext({strict:!1}),Zl={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"]},Nn={};for(const e in Zl)Nn[e]={isEnabled:t=>Zl[e].some(n=>!!t[n])};function LD(e){for(const t in e)Nn[t]={...Nn[t],...e[t]}}const VD=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 Fo(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||VD.has(e)}let Yp=e=>!Fo(e);function FD(e){e&&(Yp=t=>t.startsWith("on")?!Fo(t):e(t))}try{FD(require("@emotion/is-prop-valid").default)}catch{}function $D(e,t,n){const r={};for(const o in e)o==="values"&&typeof e.values=="object"||(Yp(o)||n===!0&&Fo(o)||!t&&!Fo(o)||e.draggable&&o.startsWith("onDrag"))&&(r[o]=e[o]);return r}function BD(e){if(typeof Proxy>"u")return e;const t=new Map,n=(...r)=>(process.env.NODE_ENV!=="production"&&Ga(!1,"motion() is deprecated. Use motion.create() instead."),e(...r));return new Proxy(n,{get:(r,o)=>o==="create"?e:(t.has(o)||t.set(o,e(o)),t.get(o))})}const hs=E.createContext({});function ps(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function Er(e){return typeof e=="string"||Array.isArray(e)}const dc=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],fc=["initial",...dc];function ms(e){return ps(e.animate)||fc.some(t=>Er(e[t]))}function Kp(e){return!!(ms(e)||e.variants)}function zD(e,t){if(ms(e)){const{initial:n,animate:r}=e;return{initial:n===!1||Er(n)?n:void 0,animate:Er(r)?r:void 0}}return e.inherit!==!1?t:{}}function WD(e){const{initial:t,animate:n}=zD(e,E.useContext(hs));return E.useMemo(()=>({initial:t,animate:n}),[Jl(t),Jl(n)])}function Jl(e){return Array.isArray(e)?e.join(" "):e}const HD=Symbol.for("motionComponentSymbol");function Cn(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function UD(e,t,n){return E.useCallback(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):Cn(n)&&(n.current=r))},[t])}const hc=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),YD="framerAppearId",Gp="data-"+hc(YD),qp=E.createContext({});function KD(e,t,n,r,o){var m,w;const{visualElement:s}=E.useContext(hs),i=E.useContext(Up),a=E.useContext(Wa),c=E.useContext(Hp).reducedMotion,l=E.useRef(null);r=r||i.renderer,!l.current&&r&&(l.current=r(e,{visualState:t,parent:s,props:n,presenceContext:a,blockInitialAnimation:a?a.initial===!1:!1,reducedMotionConfig:c}));const u=l.current,d=E.useContext(qp);u&&!u.projection&&o&&(u.type==="html"||u.type==="svg")&&GD(l.current,n,o,d);const h=E.useRef(!1);E.useInsertionEffect(()=>{u&&h.current&&u.update(n,a)});const f=n[Gp],S=E.useRef(!!f&&!((m=window.MotionHandoffIsComplete)!=null&&m.call(window,f))&&((w=window.MotionHasOptimisedAnimation)==null?void 0:w.call(window,f)));return FC(()=>{u&&(h.current=!0,window.MotionIsMounted=!0,u.updateFeatures(),lc.render(u.render),S.current&&u.animationState&&u.animationState.animateChanges())}),E.useEffect(()=>{u&&(!S.current&&u.animationState&&u.animationState.animateChanges(),S.current&&(queueMicrotask(()=>{var g;(g=window.MotionHandoffMarkAsComplete)==null||g.call(window,f)}),S.current=!1))}),u}function GD(e,t,n,r){const{layoutId:o,layout:s,drag:i,dragConstraints:a,layoutScroll:c,layoutRoot:l,layoutCrossfade:u}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:Xp(e.parent)),e.projection.setOptions({layoutId:o,layout:s,alwaysMeasureLayout:!!i||a&&Cn(a),visualElement:e,animationType:typeof s=="string"?s:"both",initialPromotionConfig:r,crossfade:u,layoutScroll:c,layoutRoot:l})}function Xp(e){if(e)return e.options.allowProjection!==!1?e.projection:Xp(e.parent)}function qD({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:o}){e&&LD(e);function s(a,c){let l;const u={...E.useContext(Hp),...a,layoutId:XD(a)},{isStatic:d}=u,h=WD(a),f=r(a,d);if(!d&&za){ZD(u,e);const S=JD(u);l=S.MeasureLayout,h.visualElement=KD(o,f,u,t,S.ProjectionNode)}return x.jsxs(hs.Provider,{value:h,children:[l&&h.visualElement?x.jsx(l,{visualElement:h.visualElement,...u}):null,n(o,a,UD(f,h.visualElement,c),f,d,h.visualElement)]})}s.displayName=`motion.${typeof o=="string"?o:`create(${o.displayName??o.name??""})`}`;const i=E.forwardRef(s);return i[HD]=o,i}function XD({layoutId:e}){const t=E.useContext(Qh).id;return t&&e!==void 0?t+"-"+e:e}function ZD(e,t){const n=E.useContext(Up).strict;if(process.env.NODE_ENV!=="production"&&t&&n){const r="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";e.ignoreStrict?zn(!1,r):St(!1,r)}}function JD(e){const{drag:t,layout:n}=Nn;if(!t&&!n)return{};const r={...t,...n};return{MeasureLayout:t!=null&&t.isEnabled(e)||n!=null&&n.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}const Mr={};function QD(e){for(const t in e)Mr[t]=e[t],Za(t)&&(Mr[t].isCSSVariable=!0)}function Zp(e,{layout:t,layoutId:n}){return Un.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!Mr[e]||e==="opacity")}const eE={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},tE=Hn.length;function nE(e,t,n){let r="",o=!0;for(let s=0;s<tE;s++){const i=Hn[s],a=e[i];if(a===void 0)continue;let c=!0;if(typeof a=="number"?c=a===(i.startsWith("scale")?1:0):c=parseFloat(a)===0,!c||n){const l=Fp(a,cc[i]);if(!c){o=!1;const u=eE[i]||i;r+=`${u}(${l}) `}n&&(t[i]=l)}}return r=r.trim(),n?r=n(t,o?"":r):o&&(r="none"),r}function pc(e,t,n){const{style:r,vars:o,transformOrigin:s}=e;let i=!1,a=!1;for(const c in t){const l=t[c];if(Un.has(c)){i=!0;continue}else if(Za(c)){o[c]=l;continue}else{const u=Fp(l,cc[c]);c.startsWith("origin")?(a=!0,s[c]=u):r[c]=u}}if(t.transform||(i||n?r.transform=nE(t,e.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 mc=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Jp(e,t,n){for(const r in t)!Pe(t[r])&&!Zp(r,n)&&(e[r]=t[r])}function rE({transformTemplate:e},t){return E.useMemo(()=>{const n=mc();return pc(n,t,e),Object.assign({},n.vars,n.style)},[t])}function oE(e,t){const n=e.style||{},r={};return Jp(r,n,e),Object.assign(r,rE(e,t)),r}function sE(e,t){const n={},r=oE(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const iE={offset:"stroke-dashoffset",array:"stroke-dasharray"},aE={offset:"strokeDashoffset",array:"strokeDasharray"};function cE(e,t,n=1,r=0,o=!0){e.pathLength=1;const s=o?iE:aE;e[s.offset]=re.transform(-r);const i=re.transform(t),a=re.transform(n);e[s.array]=`${i} ${a}`}function Qp(e,{attrX:t,attrY:n,attrScale:r,pathLength:o,pathSpacing:s=1,pathOffset:i=0,...a},c,l,u){if(pc(e,a,l),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:d,style:h}=e;d.transform&&(h.transform=d.transform,delete d.transform),(h.transform||d.transformOrigin)&&(h.transformOrigin=d.transformOrigin??"50% 50%",delete d.transformOrigin),h.transform&&(h.transformBox=(u==null?void 0:u.transformBox)??"fill-box",delete d.transformBox),t!==void 0&&(d.x=t),n!==void 0&&(d.y=n),r!==void 0&&(d.scale=r),o!==void 0&&cE(d,o,s,i,!1)}const em=()=>({...mc(),attrs:{}}),tm=e=>typeof e=="string"&&e.toLowerCase()==="svg";function lE(e,t,n,r){const o=E.useMemo(()=>{const s=em();return Qp(s,t,tm(r),e.transformTemplate,e.style),{...s.attrs,style:{...s.style}}},[t]);if(e.style){const s={};Jp(s,e.style,e),o.style={...s,...o.style}}return o}const uE=["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 gc(e){return typeof e!="string"||e.includes("-")?!1:!!(uE.indexOf(e)>-1||/[A-Z]/u.test(e))}function dE(e=!1){return(n,r,o,{latestValues:s},i)=>{const c=(gc(n)?lE:sE)(r,s,i,n),l=$D(r,typeof n=="string",e),u=n!==E.Fragment?{...l,...c,ref:o}:{},{children:d}=r,h=E.useMemo(()=>Pe(d)?d.get():d,[d]);return E.createElement(n,{...u,children:h})}}function Ql(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function vc(e,t,n,r){if(typeof t=="function"){const[o,s]=Ql(r);t=t(n!==void 0?n:e.custom,o,s)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[o,s]=Ql(r);t=t(n!==void 0?n:e.custom,o,s)}return t}function wo(e){return Pe(e)?e.get():e}function fE({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,o){return{latestValues:hE(n,r,o,e),renderState:t()}}const nm=e=>(t,n)=>{const r=E.useContext(hs),o=E.useContext(Wa),s=()=>fE(e,t,r,o);return n?s():VC(s)};function hE(e,t,n,r){const o={},s=r(e,{});for(const h in s)o[h]=wo(s[h]);let{initial:i,animate:a}=e;const c=ms(e),l=Kp(e);t&&l&&!c&&e.inherit!==!1&&(i===void 0&&(i=t.initial),a===void 0&&(a=t.animate));let u=n?n.initial===!1:!1;u=u||i===!1;const d=u?a:i;if(d&&typeof d!="boolean"&&!ps(d)){const h=Array.isArray(d)?d:[d];for(let f=0;f<h.length;f++){const S=vc(e,h[f]);if(S){const{transitionEnd:m,transition:w,...g}=S;for(const p in g){let v=g[p];if(Array.isArray(v)){const C=u?v.length-1:0;v=v[C]}v!==null&&(o[p]=v)}for(const p in m)o[p]=m[p]}}}return o}function yc(e,t,n){var s;const{style:r}=e,o={};for(const i in r)(Pe(r[i])||t.style&&Pe(t.style[i])||Zp(i,e)||((s=n==null?void 0:n.getValue(i))==null?void 0:s.liveStyle)!==void 0)&&(o[i]=r[i]);return o}const pE={useVisualState:nm({scrapeMotionValuesFromProps:yc,createRenderState:mc})};function rm(e,t,n){const r=yc(e,t,n);for(const o in e)if(Pe(e[o])||Pe(t[o])){const s=Hn.indexOf(o)!==-1?"attr"+o.charAt(0).toUpperCase()+o.substring(1):o;r[s]=e[o]}return r}const mE={useVisualState:nm({scrapeMotionValuesFromProps:rm,createRenderState:em})};function gE(e,t){return function(r,{forwardMotionProps:o}={forwardMotionProps:!1}){const i={...gc(r)?mE:pE,preloadedFeatures:e,useRender:dE(o),createVisualElement:t,Component:r};return qD(i)}}function Rr(e,t,n){const r=e.getProps();return vc(r,t,n!==void 0?n:r.custom,e)}const Bi=e=>Array.isArray(e);function vE(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,_n(n))}function yE(e){return Bi(e)?e[e.length-1]||0:e}function bE(e,t){const n=Rr(e,t);let{transitionEnd:r={},transition:o={},...s}=n||{};s={...s,...r};for(const i in s){const a=yE(s[i]);vE(e,i,a)}}function xE(e){return!!(Pe(e)&&e.add)}function zi(e,t){const n=e.getValue("willChange");if(xE(n))return n.add(t);if(!n&&Ct.WillChange){const r=new Ct.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function om(e){return e.props[Gp]}const wE=e=>e!==null;function SE(e,{repeat:t,repeatType:n="loop"},r){const o=e.filter(wE),s=t&&n!=="loop"&&t%2===1?0:o.length-1;return o[s]}const CE={type:"spring",stiffness:500,damping:25,restSpeed:10},TE=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),DE={type:"keyframes",duration:.8},EE={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},ME=(e,{keyframes:t})=>t.length>2?DE:Un.has(e)?e.startsWith("scale")?TE(t[1]):CE:EE;function RE({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:o,repeat:s,repeatType:i,repeatDelay:a,from:c,elapsed:l,...u}){return!!Object.keys(u).length}const bc=(e,t,n,r={},o,s)=>i=>{const a=ac(r,e)||{},c=a.delay||r.delay||0;let{elapsed:l=0}=r;l=l-et(c);const u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-l,onUpdate:h=>{t.set(h),a.onUpdate&&a.onUpdate(h)},onComplete:()=>{i(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:s?void 0:o};RE(a)||Object.assign(u,ME(e,u)),u.duration&&(u.duration=et(u.duration)),u.repeatDelay&&(u.repeatDelay=et(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)),(Ct.instantAnimations||Ct.skipAnimations)&&(d=!0,u.duration=0,u.delay=0),u.allowFlatten=!a.type&&!a.ease,d&&!s&&t.get()!==void 0){const h=SE(u.keyframes,a);if(h!==void 0){ve.update(()=>{u.onUpdate(h),u.onComplete()});return}}return a.isSync?new sc(u):new uD(u)};function PE({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function sm(e,t,{delay:n=0,transitionOverride:r,type:o}={}){let{transition:s=e.getDefaultTransition(),transitionEnd:i,...a}=t;r&&(s=r);const c=[],l=o&&e.animationState&&e.animationState.getState()[o];for(const u in a){const d=e.getValue(u,e.latestValues[u]??null),h=a[u];if(h===void 0||l&&PE(l,u))continue;const f={delay:n,...ac(s||{},u)},S=d.get();if(S!==void 0&&!d.isAnimating&&!Array.isArray(h)&&h===S&&!f.velocity)continue;let m=!1;if(window.MotionHandoffAnimation){const g=om(e);if(g){const p=window.MotionHandoffAnimation(g,u,ve);p!==null&&(f.startTime=p,m=!0)}}zi(e,u),d.start(bc(u,d,h,e.shouldReduceMotion&&Np.has(u)?{type:!1}:f,e,m));const w=d.animation;w&&c.push(w)}return i&&Promise.all(c).then(()=>{ve.update(()=>{i&&bE(e,i)})}),c}function Wi(e,t,n={}){var c;const r=Rr(e,t,n.type==="exit"?(c=e.presenceContext)==null?void 0:c.custom:void 0);let{transition:o=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(o=n.transitionOverride);const s=r?()=>Promise.all(sm(e,r,n)):()=>Promise.resolve(),i=e.variantChildren&&e.variantChildren.size?(l=0)=>{const{delayChildren:u=0,staggerChildren:d,staggerDirection:h}=o;return AE(e,t,u+l,d,h,n)}:()=>Promise.resolve(),{when:a}=o;if(a){const[l,u]=a==="beforeChildren"?[s,i]:[i,s];return l().then(()=>u())}else return Promise.all([s(),i(n.delay)])}function AE(e,t,n=0,r=0,o=1,s){const i=[],a=(e.variantChildren.size-1)*r,c=o===1?(l=0)=>l*r:(l=0)=>a-l*r;return Array.from(e.variantChildren).sort(OE).forEach((l,u)=>{l.notify("AnimationStart",t),i.push(Wi(l,t,{...s,delay:n+c(u)}).then(()=>l.notify("AnimationComplete",t)))}),Promise.all(i)}function OE(e,t){return e.sortNodePosition(t)}function kE(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const o=t.map(s=>Wi(e,s,n));r=Promise.all(o)}else if(typeof t=="string")r=Wi(e,t,n);else{const o=typeof t=="function"?Rr(e,t,n.custom):t;r=Promise.all(sm(e,o,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}function im(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}const _E=fc.length;function am(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?am(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<_E;n++){const r=fc[n],o=e.props[r];(Er(o)||o===!1)&&(t[r]=o)}return t}const NE=[...dc].reverse(),IE=dc.length;function jE(e){return t=>Promise.all(t.map(({animation:n,options:r})=>kE(e,n,r)))}function LE(e){let t=jE(e),n=eu(),r=!0;const o=c=>(l,u)=>{var h;const d=Rr(e,u,c==="exit"?(h=e.presenceContext)==null?void 0:h.custom:void 0);if(d){const{transition:f,transitionEnd:S,...m}=d;l={...l,...m,...S}}return l};function s(c){t=c(e)}function i(c){const{props:l}=e,u=am(e.parent)||{},d=[],h=new Set;let f={},S=1/0;for(let w=0;w<IE;w++){const g=NE[w],p=n[g],v=l[g]!==void 0?l[g]:u[g],C=Er(v),y=g===c?p.isActive:null;y===!1&&(S=w);let M=v===u[g]&&v!==l[g]&&C;if(M&&r&&e.manuallyAnimateOnMount&&(M=!1),p.protectedKeys={...f},!p.isActive&&y===null||!v&&!p.prevProp||ps(v)||typeof v=="boolean")continue;const b=VE(p.prevProp,v);let T=b||g===c&&p.isActive&&!M&&C||w>S&&C,R=!1;const _=Array.isArray(v)?v:[v];let O=_.reduce(o(g),{});y===!1&&(O={});const{prevResolvedValues:z={}}=p,G={...z,...O},j=k=>{T=!0,h.has(k)&&(R=!0,h.delete(k)),p.needsAnimating[k]=!0;const P=e.getValue(k);P&&(P.liveStyle=!1)};for(const k in G){const P=O[k],I=z[k];if(f.hasOwnProperty(k))continue;let A=!1;Bi(P)&&Bi(I)?A=!im(P,I):A=P!==I,A?P!=null?j(k):h.add(k):P!==void 0&&h.has(k)?j(k):p.protectedKeys[k]=!0}p.prevProp=v,p.prevResolvedValues=O,p.isActive&&(f={...f,...O}),r&&e.blockInitialAnimation&&(T=!1),T&&(!(M&&b)||R)&&d.push(..._.map(k=>({animation:k,options:{type:g}})))}if(h.size){const w={};if(typeof l.initial!="boolean"){const g=Rr(e,Array.isArray(l.initial)?l.initial[0]:l.initial);g&&g.transition&&(w.transition=g.transition)}h.forEach(g=>{const p=e.getBaseTarget(g),v=e.getValue(g);v&&(v.liveStyle=!0),w[g]=p??null}),d.push({animation:w})}let m=!!d.length;return r&&(l.initial===!1||l.initial===l.animate)&&!e.manuallyAnimateOnMount&&(m=!1),r=!1,m?t(d):Promise.resolve()}function a(c,l){var d;if(n[c].isActive===l)return Promise.resolve();(d=e.variantChildren)==null||d.forEach(h=>{var f;return(f=h.animationState)==null?void 0:f.setActive(c,l)}),n[c].isActive=l;const u=i(c);for(const h in n)n[h].protectedKeys={};return u}return{animateChanges:i,setActive:a,setAnimateFunction:s,getState:()=>n,reset:()=>{n=eu(),r=!0}}}function VE(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!im(t,e):!1}function Jt(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function eu(){return{animate:Jt(!0),whileInView:Jt(),whileHover:Jt(),whileTap:Jt(),whileDrag:Jt(),whileFocus:Jt(),exit:Jt()}}class Yt{constructor(t){this.isMounted=!1,this.node=t}update(){}}class FE extends Yt{constructor(t){super(t),t.animationState||(t.animationState=LE(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();ps(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)==null||t.call(this)}}let $E=0;class BE extends Yt{constructor(){super(...arguments),this.id=$E++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;const o=this.node.animationState.setActive("exit",!t);n&&!t&&o.then(()=>{n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const zE={animation:{Feature:FE},exit:{Feature:BE}};function Pr(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function Yr(e){return{point:{x:e.pageX,y:e.pageY}}}const WE=e=>t=>uc(t)&&e(t,Yr(t));function hr(e,t,n,r){return Pr(e,t,WE(n),r)}function cm({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function HE({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function UE(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}const lm=1e-4,YE=1-lm,KE=1+lm,um=.01,GE=0-um,qE=0+um;function ke(e){return e.max-e.min}function XE(e,t,n){return Math.abs(e-t)<=n}function tu(e,t,n,r=.5){e.origin=r,e.originPoint=ge(t.min,t.max,e.origin),e.scale=ke(n)/ke(t),e.translate=ge(n.min,n.max,e.origin)-e.originPoint,(e.scale>=YE&&e.scale<=KE||isNaN(e.scale))&&(e.scale=1),(e.translate>=GE&&e.translate<=qE||isNaN(e.translate))&&(e.translate=0)}function pr(e,t,n,r){tu(e.x,t.x,n.x,r?r.originX:void 0),tu(e.y,t.y,n.y,r?r.originY:void 0)}function nu(e,t,n){e.min=n.min+t.min,e.max=e.min+ke(t)}function ZE(e,t,n){nu(e.x,t.x,n.x),nu(e.y,t.y,n.y)}function ru(e,t,n){e.min=t.min-n.min,e.max=e.min+ke(t)}function mr(e,t,n){ru(e.x,t.x,n.x),ru(e.y,t.y,n.y)}const ou=()=>({translate:0,scale:1,origin:0,originPoint:0}),Tn=()=>({x:ou(),y:ou()}),su=()=>({min:0,max:0}),xe=()=>({x:su(),y:su()});function Ke(e){return[e("x"),e("y")]}function Ks(e){return e===void 0||e===1}function Hi({scale:e,scaleX:t,scaleY:n}){return!Ks(e)||!Ks(t)||!Ks(n)}function Qt(e){return Hi(e)||dm(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function dm(e){return iu(e.x)||iu(e.y)}function iu(e){return e&&e!=="0%"}function $o(e,t,n){const r=e-n,o=t*r;return n+o}function au(e,t,n,r,o){return o!==void 0&&(e=$o(e,o,r)),$o(e,n,r)+t}function Ui(e,t=0,n=1,r,o){e.min=au(e.min,t,n,r,o),e.max=au(e.max,t,n,r,o)}function fm(e,{x:t,y:n}){Ui(e.x,t.translate,t.scale,t.originPoint),Ui(e.y,n.translate,n.scale,n.originPoint)}const cu=.999999999999,lu=1.0000000000001;function JE(e,t,n,r=!1){const o=n.length;if(!o)return;t.x=t.y=1;let s,i;for(let a=0;a<o;a++){s=n[a],i=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&&En(e,{x:-s.scroll.offset.x,y:-s.scroll.offset.y}),i&&(t.x*=i.x.scale,t.y*=i.y.scale,fm(e,i)),r&&Qt(s.latestValues)&&En(e,s.latestValues))}t.x<lu&&t.x>cu&&(t.x=1),t.y<lu&&t.y>cu&&(t.y=1)}function Dn(e,t){e.min=e.min+t,e.max=e.max+t}function uu(e,t,n,r,o=.5){const s=ge(e.min,e.max,o);Ui(e,t,n,s,r)}function En(e,t){uu(e.x,t.x,t.scaleX,t.scale,t.originX),uu(e.y,t.y,t.scaleY,t.scale,t.originY)}function hm(e,t){return cm(UE(e.getBoundingClientRect(),t))}function QE(e,t,n){const r=hm(e,n),{scroll:o}=t;return o&&(Dn(r.x,o.offset.x),Dn(r.y,o.offset.y)),r}const pm=({current:e})=>e?e.ownerDocument.defaultView:null,du=(e,t)=>Math.abs(e-t);function eM(e,t){const n=du(e.x,t.x),r=du(e.y,t.y);return Math.sqrt(n**2+r**2)}class mm{constructor(t,n,{transformPagePoint:r,contextWindow:o,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=qs(this.lastMoveEventInfo,this.history),h=this.startEvent!==null,f=eM(d.offset,{x:0,y:0})>=3;if(!h&&!f)return;const{point:S}=d,{timestamp:m}=De;this.history.push({...S,timestamp:m});const{onStart:w,onMove:g}=this.handlers;h||(w&&w(this.lastMoveEvent,d),this.startEvent=this.lastMoveEvent),g&&g(this.lastMoveEvent,d)},this.handlePointerMove=(d,h)=>{this.lastMoveEvent=d,this.lastMoveEventInfo=Gs(h,this.transformPagePoint),ve.update(this.updatePoint,!0)},this.handlePointerUp=(d,h)=>{this.end();const{onEnd:f,onSessionEnd:S,resumeAnimation:m}=this.handlers;if(this.dragSnapToOrigin&&m&&m(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const w=qs(d.type==="pointercancel"?this.lastMoveEventInfo:Gs(h,this.transformPagePoint),this.history);this.startEvent&&f&&f(d,w),S&&S(d,w)},!uc(t))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=r,this.contextWindow=o||window;const i=Yr(t),a=Gs(i,this.transformPagePoint),{point:c}=a,{timestamp:l}=De;this.history=[{...c,timestamp:l}];const{onSessionStart:u}=n;u&&u(t,qs(a,this.history)),this.removeListeners=Wr(hr(this.contextWindow,"pointermove",this.handlePointerMove),hr(this.contextWindow,"pointerup",this.handlePointerUp),hr(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),zt(this.updatePoint)}}function Gs(e,t){return t?{point:t(e.point)}:e}function fu(e,t){return{x:e.x-t.x,y:e.y-t.y}}function qs({point:e},t){return{point:e,delta:fu(e,gm(t)),offset:fu(e,tM(t)),velocity:nM(t,.1)}}function tM(e){return e[0]}function gm(e){return e[e.length-1]}function nM(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const o=gm(e);for(;n>=0&&(r=e[n],!(o.timestamp-r.timestamp>et(t)));)n--;if(!r)return{x:0,y:0};const s=ut(o.timestamp-r.timestamp);if(s===0)return{x:0,y:0};const i={x:(o.x-r.x)/s,y:(o.y-r.y)/s};return i.x===1/0&&(i.x=0),i.y===1/0&&(i.y=0),i}function rM(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?ge(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?ge(n,e,r.max):Math.min(e,n)),e}function hu(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function oM(e,{top:t,left:n,bottom:r,right:o}){return{x:hu(e.x,n,o),y:hu(e.y,t,r)}}function pu(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function sM(e,t){return{x:pu(e.x,t.x),y:pu(e.y,t.y)}}function iM(e,t){let n=.5;const r=ke(e),o=ke(t);return o>r?n=Cr(t.min,t.max-r,e.min):r>o&&(n=Cr(e.min,e.max-o,t.min)),wt(0,1,n)}function aM(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const Yi=.35;function cM(e=Yi){return e===!1?e=0:e===!0&&(e=Yi),{x:mu(e,"left","right"),y:mu(e,"top","bottom")}}function mu(e,t,n){return{min:gu(e,t),max:gu(e,n)}}function gu(e,t){return typeof e=="number"?e:e[t]||0}const lM=new WeakMap;class uM{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=xe(),this.visualElement=t}start(t,{snapToCursor:n=!1}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const o=u=>{const{dragSnapToOrigin:d}=this.getProps();d?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(Yr(u).point)},s=(u,d)=>{const{drag:h,dragPropagation:f,onDragStart:S}=this.getProps();if(h&&!f&&(this.openDragLock&&this.openDragLock(),this.openDragLock=MD(h),!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),Ke(w=>{let g=this.getAxisMotionValue(w).get()||0;if(dt.test(g)){const{projection:p}=this.visualElement;if(p&&p.layout){const v=p.layout.layoutBox[w];v&&(g=ke(v)*(parseFloat(g)/100))}}this.originPoint[w]=g}),S&&ve.postRender(()=>S(u,d)),zi(this.visualElement,"transform");const{animationState:m}=this.visualElement;m&&m.setActive("whileDrag",!0)},i=(u,d)=>{const{dragPropagation:h,dragDirectionLock:f,onDirectionLock:S,onDrag:m}=this.getProps();if(!h&&!this.openDragLock)return;const{offset:w}=d;if(f&&this.currentDirection===null){this.currentDirection=dM(w),this.currentDirection!==null&&S&&S(this.currentDirection);return}this.updateAxis("x",d.point,w),this.updateAxis("y",d.point,w),this.visualElement.render(),m&&m(u,d)},a=(u,d)=>this.stop(u,d),c=()=>Ke(u=>{var d;return this.getAnimationState(u)==="paused"&&((d=this.getAxisMotionValue(u).animation)==null?void 0:d.play())}),{dragSnapToOrigin:l}=this.getProps();this.panSession=new mm(t,{onSessionStart:o,onStart:s,onMove:i,onSessionEnd:a,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:l,contextWindow:pm(this.visualElement)})}stop(t,n){const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:o}=n;this.startAnimation(o);const{onDragEnd:s}=this.getProps();s&&ve.postRender(()=>s(t,n))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.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(t,n,r){const{drag:o}=this.getProps();if(!r||!io(t,o,this.currentDirection))return;const s=this.getAxisMotionValue(t);let i=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(i=rM(i,this.constraints[t],this.elastic[t])),s.set(i)}resolveConstraints(){var s;const{dragConstraints:t,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(s=this.visualElement.projection)==null?void 0:s.layout,o=this.constraints;t&&Cn(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=oM(r.layoutBox,t):this.constraints=!1,this.elastic=cM(n),o!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&Ke(i=>{this.constraints!==!1&&this.getAxisMotionValue(i)&&(this.constraints[i]=aM(r.layoutBox[i],this.constraints[i]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Cn(t))return!1;const r=t.current;St(r!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");const{projection:o}=this.visualElement;if(!o||!o.layout)return!1;const s=QE(r,o.root,this.visualElement.getTransformPagePoint());let i=sM(o.layout.layoutBox,s);if(n){const a=n(HE(i));this.hasMutatedConstraints=!!a,a&&(i=cm(a))}return i}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:o,dragTransition:s,dragSnapToOrigin:i,onDragTransitionEnd:a}=this.getProps(),c=this.constraints||{},l=Ke(u=>{if(!io(u,n,this.currentDirection))return;let d=c&&c[u]||{};i&&(d={min:0,max:0});const h=o?200:1e6,f=o?40:1e7,S={type:"inertia",velocity:r?t[u]:0,bounceStiffness:h,bounceDamping:f,timeConstant:750,restDelta:1,restSpeed:10,...s,...d};return this.startAxisValueAnimation(u,S)});return Promise.all(l).then(a)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return zi(this.visualElement,t),r.start(bc(t,r,0,n,this.visualElement,!1))}stopAnimation(){Ke(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Ke(t=>{var n;return(n=this.getAxisMotionValue(t).animation)==null?void 0:n.pause()})}getAnimationState(t){var n;return(n=this.getAxisMotionValue(t).animation)==null?void 0:n.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),o=r[n];return o||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){Ke(n=>{const{drag:r}=this.getProps();if(!io(n,r,this.currentDirection))return;const{projection:o}=this.visualElement,s=this.getAxisMotionValue(n);if(o&&o.layout){const{min:i,max:a}=o.layout.layoutBox[n];s.set(t[n]-ge(i,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!Cn(n)||!r||!this.constraints)return;this.stopAnimation();const o={x:0,y:0};Ke(i=>{const a=this.getAxisMotionValue(i);if(a&&this.constraints!==!1){const c=a.get();o[i]=iM({min:c,max:c},this.constraints[i])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),Ke(i=>{if(!io(i,t,null))return;const a=this.getAxisMotionValue(i),{min:c,max:l}=this.constraints[i];a.set(ge(c,l,o[i]))})}addListeners(){if(!this.visualElement.current)return;lM.set(this.visualElement,this);const t=this.visualElement.current,n=hr(t,"pointerdown",c=>{const{drag:l,dragListener:u=!0}=this.getProps();l&&u&&this.start(c)}),r=()=>{const{dragConstraints:c}=this.getProps();Cn(c)&&c.current&&(this.constraints=this.resolveRefConstraints())},{projection:o}=this.visualElement,s=o.addEventListener("measure",r);o&&!o.layout&&(o.root&&o.root.updateScroll(),o.updateLayout()),ve.read(r);const i=Pr(window,"resize",()=>this.scalePositionWithinConstraints()),a=o.addEventListener("didUpdate",({delta:c,hasLayoutChanged:l})=>{this.isDragging&&l&&(Ke(u=>{const d=this.getAxisMotionValue(u);d&&(this.originPoint[u]+=c[u].translate,d.set(d.get()+c[u].translate))}),this.visualElement.render())});return()=>{i(),n(),s(),a&&a()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:o=!1,dragConstraints:s=!1,dragElastic:i=Yi,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:o,dragConstraints:s,dragElastic:i,dragMomentum:a}}}function io(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function dM(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class fM extends Yt{constructor(t){super(t),this.removeGroupControls=Xe,this.removeListeners=Xe,this.controls=new uM(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Xe}unmount(){this.removeGroupControls(),this.removeListeners()}}const vu=e=>(t,n)=>{e&&ve.postRender(()=>e(t,n))};class hM extends Yt{constructor(){super(...arguments),this.removePointerDownListener=Xe}onPointerDown(t){this.session=new mm(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:pm(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:o}=this.node.getProps();return{onSessionStart:vu(t),onStart:vu(n),onMove:r,onEnd:(s,i)=>{delete this.session,o&&ve.postRender(()=>o(s,i))}}}mount(){this.removePointerDownListener=hr(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const So={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function yu(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Qn={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(re.test(e))e=parseFloat(e);else return e;const n=yu(e,t.target.x),r=yu(e,t.target.y);return`${n}% ${r}%`}},pM={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,o=Wt.parse(e);if(o.length>5)return r;const s=Wt.createTransformer(e),i=typeof o[0]!="number"?1:0,a=n.x.scale*t.x,c=n.y.scale*t.y;o[0+i]/=a,o[1+i]/=c;const l=ge(a,c,.5);return typeof o[2+i]=="number"&&(o[2+i]/=l),typeof o[3+i]=="number"&&(o[3+i]/=l),s(o)}};class mM extends E.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:o}=this.props,{projection:s}=t;QD(gM),s&&(n.group&&n.group.add(s),r&&r.register&&o&&r.register(s),s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,onExitComplete:()=>this.safeToRemove()})),So.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:o,isPresent:s}=this.props,{projection:i}=r;return i&&(i.isPresent=s,o||t.layoutDependency!==n||n===void 0||t.isPresent!==s?i.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?i.promote():i.relegate()||ve.postRender(()=>{const a=i.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),lc.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:o}=t;o&&(o.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(o),r&&r.deregister&&r.deregister(o))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function vm(e){const[t,n]=jD(),r=E.useContext(Qh);return x.jsx(mM,{...e,layoutGroup:r,switchLayoutGroup:E.useContext(qp),isPresent:t,safeToRemove:n})}const gM={borderRadius:{...Qn,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Qn,borderTopRightRadius:Qn,borderBottomLeftRadius:Qn,borderBottomRightRadius:Qn,boxShadow:pM};function vM(e,t,n){const r=Pe(e)?e:_n(e);return r.start(bc("",r,t,n)),r.animation}const yM=(e,t)=>e.depth-t.depth;class bM{constructor(){this.children=[],this.isDirty=!1}add(t){Ha(this.children,t),this.isDirty=!0}remove(t){Ua(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(yM),this.isDirty=!1,this.children.forEach(t)}}function xM(e,t){const n=je.now(),r=({timestamp:o})=>{const s=o-n;s>=t&&(zt(r),e(s-t))};return ve.setup(r,!0),()=>zt(r)}const ym=["TopLeft","TopRight","BottomLeft","BottomRight"],wM=ym.length,bu=e=>typeof e=="string"?parseFloat(e):e,xu=e=>typeof e=="number"||re.test(e);function SM(e,t,n,r,o,s){o?(e.opacity=ge(0,n.opacity??1,CM(r)),e.opacityExit=ge(t.opacity??1,0,TM(r))):s&&(e.opacity=ge(t.opacity??1,n.opacity??1,r));for(let i=0;i<wM;i++){const a=`border${ym[i]}Radius`;let c=wu(t,a),l=wu(n,a);if(c===void 0&&l===void 0)continue;c||(c=0),l||(l=0),c===0||l===0||xu(c)===xu(l)?(e[a]=Math.max(ge(bu(c),bu(l),r),0),(dt.test(l)||dt.test(c))&&(e[a]+="%")):e[a]=l}(t.rotate||n.rotate)&&(e.rotate=ge(t.rotate||0,n.rotate||0,r))}function wu(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const CM=bm(0,.5,up),TM=bm(.5,.95,Xe);function bm(e,t,n){return r=>r<e?0:r>t?1:n(Cr(e,t,r))}function Su(e,t){e.min=t.min,e.max=t.max}function Ye(e,t){Su(e.x,t.x),Su(e.y,t.y)}function Cu(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function Tu(e,t,n,r,o){return e-=t,e=$o(e,1/n,r),o!==void 0&&(e=$o(e,1/o,r)),e}function DM(e,t=0,n=1,r=.5,o,s=e,i=e){if(dt.test(t)&&(t=parseFloat(t),t=ge(i.min,i.max,t/100)-i.min),typeof t!="number")return;let a=ge(s.min,s.max,r);e===s&&(a-=t),e.min=Tu(e.min,t,n,a,o),e.max=Tu(e.max,t,n,a,o)}function Du(e,t,[n,r,o],s,i){DM(e,t[n],t[r],t[o],t.scale,s,i)}const EM=["x","scaleX","originX"],MM=["y","scaleY","originY"];function Eu(e,t,n,r){Du(e.x,t,EM,n?n.x:void 0,r?r.x:void 0),Du(e.y,t,MM,n?n.y:void 0,r?r.y:void 0)}function Mu(e){return e.translate===0&&e.scale===1}function xm(e){return Mu(e.x)&&Mu(e.y)}function Ru(e,t){return e.min===t.min&&e.max===t.max}function RM(e,t){return Ru(e.x,t.x)&&Ru(e.y,t.y)}function Pu(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function wm(e,t){return Pu(e.x,t.x)&&Pu(e.y,t.y)}function Au(e){return ke(e.x)/ke(e.y)}function Ou(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class PM{constructor(){this.members=[]}add(t){Ha(this.members,t),t.scheduleRender()}remove(t){if(Ua(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(o=>t===o);if(n===0)return!1;let r;for(let o=n;o>=0;o--){const s=this.members[o];if(s.isPresent!==!1){r=s;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:o}=t.options;o===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function AM(e,t,n){let r="";const o=e.x.translate/t.x,s=e.y.translate/t.y,i=(n==null?void 0:n.z)||0;if((o||s||i)&&(r=`translate3d(${o}px, ${s}px, ${i}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:l,rotate:u,rotateX:d,rotateY:h,skewX:f,skewY:S}=n;l&&(r=`perspective(${l}px) ${r}`),u&&(r+=`rotate(${u}deg) `),d&&(r+=`rotateX(${d}deg) `),h&&(r+=`rotateY(${h}deg) `),f&&(r+=`skewX(${f}deg) `),S&&(r+=`skewY(${S}deg) `)}const a=e.x.scale*t.x,c=e.y.scale*t.y;return(a!==1||c!==1)&&(r+=`scale(${a}, ${c})`),r||"none"}const Xs=["","X","Y","Z"],OM={visibility:"hidden"},kM=1e3;let _M=0;function Zs(e,t,n,r){const{latestValues:o}=t;o[e]&&(n[e]=o[e],t.setStaticValue(e,0),r&&(r[e]=0))}function Sm(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=om(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:o,layoutId:s}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",ve,!(o||s))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&Sm(r)}function Cm({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:o}){return class{constructor(i={},a=t==null?void 0:t()){this.id=_M++,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,this.nodes.forEach(jM),this.nodes.forEach(BM),this.nodes.forEach(zM),this.nodes.forEach(LM)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=i,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 bM)}addEventListener(i,a){return this.eventHandlers.has(i)||this.eventHandlers.set(i,new Ka),this.eventHandlers.get(i).add(a)}notifyListeners(i,...a){const c=this.eventHandlers.get(i);c&&c.notify(...a)}hasListeners(i){return this.eventHandlers.has(i)}mount(i){if(this.instance)return;this.isSVG=Wp(i)&&!_D(i),this.instance=i;const{layoutId:a,layout:c,visualElement:l}=this.options;if(l&&!l.current&&l.mount(i),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(c||a)&&(this.isLayoutDirty=!0),e){let u;const d=()=>this.root.updateBlockedByResize=!1;e(i,()=>{this.root.updateBlockedByResize=!0,u&&u(),u=xM(d,250),So.hasAnimatedSinceResize&&(So.hasAnimatedSinceResize=!1,this.nodes.forEach(_u))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&l&&(a||c)&&this.addEventListener("didUpdate",({delta:u,hasLayoutChanged:d,hasRelativeLayoutChanged:h,layout:f})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const S=this.options.transition||l.getDefaultTransition()||KM,{onLayoutAnimationStart:m,onLayoutAnimationComplete:w}=l.getProps(),g=!this.targetLayout||!wm(this.targetLayout,f),p=!d&&h;if(this.options.layoutRoot||this.resumeFrom||p||d&&(g||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(u,p);const v={...ac(S,"layout"),onPlay:m,onComplete:w};(l.shouldReduceMotion||this.options.layoutRoot)&&(v.delay=0,v.type=!1),this.startAnimation(v)}else d||_u(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=f})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const i=this.getStack();i&&i.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),zt(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(WM),this.animationId++)}getTransformTemplate(){const{visualElement:i}=this.options;return i&&i.getProps().transformTemplate}willUpdate(i=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Sm(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(),i&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(ku);return}this.isUpdating||this.nodes.forEach(FM),this.isUpdating=!1,this.nodes.forEach($M),this.nodes.forEach(NM),this.nodes.forEach(IM),this.clearAllSnapshots();const a=je.now();De.delta=wt(0,1e3/60,a-De.timestamp),De.timestamp=a,De.isProcessing=!0,zs.update.process(De),zs.preRender.process(De),zs.render.process(De),De.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,lc.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(VM),this.sharedNodes.forEach(HM)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,ve.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){ve.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!ke(this.snapshot.measuredBox.x)&&!ke(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let c=0;c<this.path.length;c++)this.path[c].updateScroll();const i=this.layout;this.layout=this.measure(!1),this.layoutCorrected=xe(),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,i?i.layoutBox:void 0)}updateScroll(i="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===i&&(a=!1),a&&this.instance){const c=r(this.instance);this.scroll={animationId:this.root.animationId,phase:i,isRoot:c,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:c}}}resetTransform(){if(!o)return;const i=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!xm(this.projectionDelta),c=this.getTransformTemplate(),l=c?c(this.latestValues,""):void 0,u=l!==this.prevTransformTemplateValue;i&&this.instance&&(a||Qt(this.latestValues)||u)&&(o(this.instance,l),this.shouldResetTransform=!1,this.scheduleRender())}measure(i=!0){const a=this.measurePageBox();let c=this.removeElementScroll(a);return i&&(c=this.removeTransform(c)),GM(c),{animationId:this.root.animationId,measuredBox:a,layoutBox:c,latestValues:{},source:this.id}}measurePageBox(){var l;const{visualElement:i}=this.options;if(!i)return xe();const a=i.measureViewportBox();if(!(((l=this.scroll)==null?void 0:l.wasRoot)||this.path.some(qM))){const{scroll:u}=this.root;u&&(Dn(a.x,u.offset.x),Dn(a.y,u.offset.y))}return a}removeElementScroll(i){var c;const a=xe();if(Ye(a,i),(c=this.scroll)!=null&&c.wasRoot)return a;for(let l=0;l<this.path.length;l++){const u=this.path[l],{scroll:d,options:h}=u;u!==this.root&&d&&h.layoutScroll&&(d.wasRoot&&Ye(a,i),Dn(a.x,d.offset.x),Dn(a.y,d.offset.y))}return a}applyTransform(i,a=!1){const c=xe();Ye(c,i);for(let l=0;l<this.path.length;l++){const u=this.path[l];!a&&u.options.layoutScroll&&u.scroll&&u!==u.root&&En(c,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),Qt(u.latestValues)&&En(c,u.latestValues)}return Qt(this.latestValues)&&En(c,this.latestValues),c}removeTransform(i){const a=xe();Ye(a,i);for(let c=0;c<this.path.length;c++){const l=this.path[c];if(!l.instance||!Qt(l.latestValues))continue;Hi(l.latestValues)&&l.updateSnapshot();const u=xe(),d=l.measurePageBox();Ye(u,d),Eu(a,l.latestValues,l.snapshot?l.snapshot.layoutBox:void 0,u)}return Qt(this.latestValues)&&Eu(a,this.latestValues),a}setTargetDelta(i){this.targetDelta=i,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(i){this.options={...this.options,...i,crossfade:i.crossfade!==void 0?i.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!==De.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(i=!1){var h;const a=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=a.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=a.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=a.isSharedProjectionDirty);const c=!!this.resumingFrom||this!==a;if(!(i||c&&this.isSharedProjectionDirty||this.isProjectionDirty||(h=this.parent)!=null&&h.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:u,layoutId:d}=this.options;if(!(!this.layout||!(u||d))){if(this.resolvedRelativeTargetAt=De.timestamp,!this.targetDelta&&!this.relativeTarget){const f=this.getClosestProjectingParent();f&&f.layout&&this.animationProgress!==1?(this.relativeParent=f,this.forceRelativeParentToResolveTarget(),this.relativeTarget=xe(),this.relativeTargetOrigin=xe(),mr(this.relativeTargetOrigin,this.layout.layoutBox,f.layout.layoutBox),Ye(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=xe(),this.targetWithTransforms=xe()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),ZE(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Ye(this.target,this.layout.layoutBox),fm(this.target,this.targetDelta)):Ye(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget)){this.attemptToResolveRelativeTarget=!1;const f=this.getClosestProjectingParent();f&&!!f.resumingFrom==!!this.resumingFrom&&!f.options.layoutScroll&&f.target&&this.animationProgress!==1?(this.relativeParent=f,this.forceRelativeParentToResolveTarget(),this.relativeTarget=xe(),this.relativeTargetOrigin=xe(),mr(this.relativeTargetOrigin,this.target,f.target),Ye(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(!(!this.parent||Hi(this.parent.latestValues)||dm(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 S;const i=this.getLead(),a=!!this.resumingFrom||this!==i;let c=!0;if((this.isProjectionDirty||(S=this.parent)!=null&&S.isProjectionDirty)&&(c=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(c=!1),this.resolvedRelativeTargetAt===De.timestamp&&(c=!1),c)return;const{layout:l,layoutId:u}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(l||u))return;Ye(this.layoutCorrected,this.layout.layoutBox);const d=this.treeScale.x,h=this.treeScale.y;JE(this.layoutCorrected,this.treeScale,this.path,a),i.layout&&!i.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(i.target=i.layout.layoutBox,i.targetWithTransforms=xe());const{target:f}=i;if(!f){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Cu(this.prevProjectionDelta.x,this.projectionDelta.x),Cu(this.prevProjectionDelta.y,this.projectionDelta.y)),pr(this.projectionDelta,this.layoutCorrected,f,this.latestValues),(this.treeScale.x!==d||this.treeScale.y!==h||!Ou(this.projectionDelta.x,this.prevProjectionDelta.x)||!Ou(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",f))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(i=!0){var a;if((a=this.options.visualElement)==null||a.scheduleRender(),i){const c=this.getStack();c&&c.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Tn(),this.projectionDelta=Tn(),this.projectionDeltaWithTransform=Tn()}setAnimationOrigin(i,a=!1){const c=this.snapshot,l=c?c.latestValues:{},u={...this.latestValues},d=Tn();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const h=xe(),f=c?c.source:void 0,S=this.layout?this.layout.source:void 0,m=f!==S,w=this.getStack(),g=!w||w.members.length<=1,p=!!(m&&!g&&this.options.crossfade===!0&&!this.path.some(YM));this.animationProgress=0;let v;this.mixTargetDelta=C=>{const y=C/1e3;Nu(d.x,i.x,y),Nu(d.y,i.y,y),this.setTargetDelta(d),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(mr(h,this.layout.layoutBox,this.relativeParent.layout.layoutBox),UM(this.relativeTarget,this.relativeTargetOrigin,h,y),v&&RM(this.relativeTarget,v)&&(this.isProjectionDirty=!1),v||(v=xe()),Ye(v,this.relativeTarget)),m&&(this.animationValues=u,SM(u,l,this.latestValues,y,p,g)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=y},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(i){var a,c,l;this.notifyListeners("animationStart"),(a=this.currentAnimation)==null||a.stop(!1),(l=(c=this.resumingFrom)==null?void 0:c.currentAnimation)==null||l.stop(!1),this.pendingAnimation&&(zt(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=ve.update(()=>{So.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=_n(0)),this.currentAnimation=vM(this.motionValue,[0,1e3],{...i,isSync:!0,onUpdate:u=>{this.mixTargetDelta(u),i.onUpdate&&i.onUpdate(u)},onStop:()=>{},onComplete:()=>{i.onComplete&&i.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 i=this.getStack();i&&i.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(kM),this.currentAnimation.stop(!1)),this.completeAnimation()}applyTransformsToTarget(){const i=this.getLead();let{targetWithTransforms:a,target:c,layout:l,latestValues:u}=i;if(!(!a||!c||!l)){if(this!==i&&this.layout&&l&&Tm(this.options.animationType,this.layout.layoutBox,l.layoutBox)){c=this.target||xe();const d=ke(this.layout.layoutBox.x);c.x.min=i.target.x.min,c.x.max=c.x.min+d;const h=ke(this.layout.layoutBox.y);c.y.min=i.target.y.min,c.y.max=c.y.min+h}Ye(a,c),En(a,u),pr(this.projectionDeltaWithTransform,this.layoutCorrected,a,u)}}registerSharedNode(i,a){this.sharedNodes.has(i)||this.sharedNodes.set(i,new PM),this.sharedNodes.get(i).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 i=this.getStack();return i?i.lead===this:!0}getLead(){var a;const{layoutId:i}=this.options;return i?((a=this.getStack())==null?void 0:a.lead)||this:this}getPrevLead(){var a;const{layoutId:i}=this.options;return i?(a=this.getStack())==null?void 0:a.prevLead:void 0}getStack(){const{layoutId:i}=this.options;if(i)return this.root.sharedNodes.get(i)}promote({needsReset:i,transition:a,preserveFollowOpacity:c}={}){const l=this.getStack();l&&l.promote(this,c),i&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const i=this.getStack();return i?i.relegate(this):!1}resetSkewAndRotation(){const{visualElement:i}=this.options;if(!i)return;let a=!1;const{latestValues:c}=i;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(a=!0),!a)return;const l={};c.z&&Zs("z",i,l,this.animationValues);for(let u=0;u<Xs.length;u++)Zs(`rotate${Xs[u]}`,i,l,this.animationValues),Zs(`skew${Xs[u]}`,i,l,this.animationValues);i.render();for(const u in l)i.setStaticValue(u,l[u]),this.animationValues&&(this.animationValues[u]=l[u]);i.scheduleRender()}getProjectionStyles(i){if(!this.instance||this.isSVG)return;if(!this.isVisible)return OM;const a={visibility:""},c=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,a.opacity="",a.pointerEvents=wo(i==null?void 0:i.pointerEvents)||"",a.transform=c?c(this.latestValues,""):"none",a;const l=this.getLead();if(!this.projectionDelta||!this.layout||!l.target){const f={};return this.options.layoutId&&(f.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,f.pointerEvents=wo(i==null?void 0:i.pointerEvents)||""),this.hasProjected&&!Qt(this.latestValues)&&(f.transform=c?c({},""):"none",this.hasProjected=!1),f}const u=l.animationValues||l.latestValues;this.applyTransformsToTarget(),a.transform=AM(this.projectionDeltaWithTransform,this.treeScale,u),c&&(a.transform=c(u,a.transform));const{x:d,y:h}=this.projectionDelta;a.transformOrigin=`${d.origin*100}% ${h.origin*100}% 0`,l.animationValues?a.opacity=l===this?u.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:u.opacityExit:a.opacity=l===this?u.opacity!==void 0?u.opacity:"":u.opacityExit!==void 0?u.opacityExit:0;for(const f in Mr){if(u[f]===void 0)continue;const{correct:S,applyTo:m,isCSSVariable:w}=Mr[f],g=a.transform==="none"?u[f]:S(u[f],l);if(m){const p=m.length;for(let v=0;v<p;v++)a[m[v]]=g}else w?this.options.visualElement.renderState.vars[f]=g:a[f]=g}return this.options.layoutId&&(a.pointerEvents=l===this?wo(i==null?void 0:i.pointerEvents)||"":"none"),a}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(i=>{var a;return(a=i.currentAnimation)==null?void 0:a.stop(!1)}),this.root.nodes.forEach(ku),this.root.sharedNodes.clear()}}}function NM(e){e.updateLayout()}function IM(e){var n;const t=((n=e.resumeFrom)==null?void 0:n.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:o}=e.layout,{animationType:s}=e.options,i=t.source!==e.layout.source;s==="size"?Ke(d=>{const h=i?t.measuredBox[d]:t.layoutBox[d],f=ke(h);h.min=r[d].min,h.max=h.min+f}):Tm(s,t.layoutBox,r)&&Ke(d=>{const h=i?t.measuredBox[d]:t.layoutBox[d],f=ke(r[d]);h.max=h.min+f,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[d].max=e.relativeTarget[d].min+f)});const a=Tn();pr(a,r,t.layoutBox);const c=Tn();i?pr(c,e.applyTransform(o,!0),t.measuredBox):pr(c,r,t.layoutBox);const l=!xm(a);let u=!1;if(!e.resumeFrom){const d=e.getClosestProjectingParent();if(d&&!d.resumeFrom){const{snapshot:h,layout:f}=d;if(h&&f){const S=xe();mr(S,t.layoutBox,h.layoutBox);const m=xe();mr(m,r,f.layoutBox),wm(S,m)||(u=!0),d.options.layoutRoot&&(e.relativeTarget=m,e.relativeTargetOrigin=S,e.relativeParent=d)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:t,delta:c,layoutDelta:a,hasLayoutChanged:l,hasRelativeLayoutChanged:u})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function jM(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function LM(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function VM(e){e.clearSnapshot()}function ku(e){e.clearMeasurements()}function FM(e){e.isLayoutDirty=!1}function $M(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function _u(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function BM(e){e.resolveTargetDelta()}function zM(e){e.calcProjection()}function WM(e){e.resetSkewAndRotation()}function HM(e){e.removeLeadSnapshot()}function Nu(e,t,n){e.translate=ge(t.translate,0,n),e.scale=ge(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function Iu(e,t,n,r){e.min=ge(t.min,n.min,r),e.max=ge(t.max,n.max,r)}function UM(e,t,n,r){Iu(e.x,t.x,n.x,r),Iu(e.y,t.y,n.y,r)}function YM(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const KM={duration:.45,ease:[.4,0,.1,1]},ju=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Lu=ju("applewebkit/")&&!ju("chrome/")?Math.round:Xe;function Vu(e){e.min=Lu(e.min),e.max=Lu(e.max)}function GM(e){Vu(e.x),Vu(e.y)}function Tm(e,t,n){return e==="position"||e==="preserve-aspect"&&!XE(Au(t),Au(n),.2)}function qM(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const XM=Cm({attachResizeListener:(e,t)=>Pr(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Js={current:void 0},Dm=Cm({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Js.current){const e=new XM({});e.mount(window),e.setOptions({layoutScroll:!0}),Js.current=e}return Js.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),ZM={pan:{Feature:hM},drag:{Feature:fM,ProjectionNode:Dm,MeasureLayout:vm}};function Fu(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const o="onHover"+n,s=r[o];s&&ve.postRender(()=>s(t,Yr(t)))}class JM extends Yt{mount(){const{current:t}=this.node;t&&(this.unmount=RD(t,(n,r)=>(Fu(this.node,r,"Start"),o=>Fu(this.node,o,"End"))))}unmount(){}}class QM extends Yt{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!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=Wr(Pr(this.node.current,"focus",()=>this.onFocus()),Pr(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function $u(e,t,n){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const o="onTap"+(n==="End"?"":n),s=r[o];s&&ve.postRender(()=>s(t,Yr(t)))}class eR extends Yt{mount(){const{current:t}=this.node;t&&(this.unmount=kD(t,(n,r)=>($u(this.node,r,"Start"),(o,{success:s})=>$u(this.node,o,s?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const Ki=new WeakMap,Qs=new WeakMap,tR=e=>{const t=Ki.get(e.target);t&&t(e)},nR=e=>{e.forEach(tR)};function rR({root:e,...t}){const n=e||document;Qs.has(n)||Qs.set(n,{});const r=Qs.get(n),o=JSON.stringify(t);return r[o]||(r[o]=new IntersectionObserver(nR,{root:e,...t})),r[o]}function oR(e,t,n){const r=rR(t);return Ki.set(e,n),r.observe(e),()=>{Ki.delete(e),r.unobserve(e)}}const sR={some:0,all:1};class iR extends Yt{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:o="some",once:s}=t,i={root:n?n.current:void 0,rootMargin:r,threshold:typeof o=="number"?o:sR[o]},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(),h=l?u:d;h&&h(c)};return oR(this.node.current,i,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(aR(t,n))&&this.startObserver()}unmount(){}}function aR({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const cR={inView:{Feature:iR},tap:{Feature:eR},focus:{Feature:QM},hover:{Feature:JM}},lR={layout:{ProjectionNode:Dm,MeasureLayout:vm}},Gi={current:null},Em={current:!1};function uR(){if(Em.current=!0,!!za)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Gi.current=e.matches;e.addListener(t),t()}else Gi.current=!1}const dR=new WeakMap;function fR(e,t,n){for(const r in t){const o=t[r],s=n[r];if(Pe(o))e.addValue(r,o);else if(Pe(s))e.addValue(r,_n(o,{owner:e}));else if(s!==o)if(e.hasValue(r)){const i=e.getValue(r);i.liveStyle===!0?i.jump(o):i.hasAnimated||i.set(o)}else{const i=e.getStaticValue(r);e.addValue(r,_n(i!==void 0?i:o,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const Bu=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class hR{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:o,blockInitialAnimation:s,visualState:i},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=ic,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=je.now();this.renderScheduledAt<h&&(this.renderScheduledAt=h,ve.render(this.render,!1,!0))};const{latestValues:c,renderState:l}=i;this.latestValues=c,this.baseTarget={...c},this.initialValues=n.initial?{...c}:{},this.renderState=l,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=o,this.options=a,this.blockInitialAnimation=!!s,this.isControllingVariants=ms(n),this.isVariantNode=Kp(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:u,...d}=this.scrapeMotionValuesFromProps(n,{},this);for(const h in d){const f=d[h];c[h]!==void 0&&Pe(f)&&f.set(c[h],!1)}}mount(t){this.current=t,dR.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,r)=>this.bindToMotionValue(r,n)),Em.current||uR(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:Gi.current,process.env.NODE_ENV!=="production"&&Ga(this.shouldReduceMotion!==!0,"You have Reduced Motion enabled on your device. Animations may not appear as expected."),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),zt(this.notifyUpdate),zt(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const r=Un.has(t);r&&this.onBindTransform&&this.onBindTransform();const o=n.on("change",a=>{this.latestValues[t]=a,this.props.onUpdate&&ve.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0)}),s=n.on("renderRequest",this.scheduleRender);let i;window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{o(),s(),i&&i(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in Nn){const n=Nn[t];if(!n)continue;const{isEnabled:r,Feature:o}=n;if(!this.features[t]&&o&&r(this.props)&&(this.features[t]=new o(this)),this.features[t]){const s=this.features[t];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):xe()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<Bu.length;r++){const o=Bu[r];this.propEventSubscriptions[o]&&(this.propEventSubscriptions[o](),delete this.propEventSubscriptions[o]);const s="on"+o,i=t[s];i&&(this.propEventSubscriptions[o]=this.on(o,i))}this.prevMotionValues=fR(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]: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(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=_n(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){let r=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return r!=null&&(typeof r=="string"&&(ep(r)||np(r))?r=parseFloat(r):!ID(r)&&Wt.test(n)&&(r=Vp(t,n)),this.setBaseTarget(t,Pe(r)?r.get():r)),Pe(r)?r.get():r}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var s;const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const i=vc(this.props,n,(s=this.presenceContext)==null?void 0:s.custom);i&&(r=i[t])}if(n&&r!==void 0)return r;const o=this.getBaseTargetFromProps(this.props,t);return o!==void 0&&!Pe(o)?o:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new Ka),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class Mm extends hR{constructor(){super(...arguments),this.KeyframeResolver=CD}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Pe(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function Rm(e,{style:t,vars:n},r,o){Object.assign(e.style,t,o&&o.getProjectionStyles(r));for(const s in n)e.style.setProperty(s,n[s])}function pR(e){return window.getComputedStyle(e)}class mR extends Mm{constructor(){super(...arguments),this.type="html",this.renderInstance=Rm}readValueFromInstance(t,n){var r;if(Un.has(n))return(r=this.projection)!=null&&r.isProjecting?Ii(n):BT(t,n);{const o=pR(t),s=(Za(n)?o.getPropertyValue(n):o[n])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(t,{transformPagePoint:n}){return hm(t,n)}build(t,n,r){pc(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return yc(t,n,r)}}const Pm=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 gR(e,t,n,r){Rm(e,t,void 0,r);for(const o in t.attrs)e.setAttribute(Pm.has(o)?o:hc(o),t.attrs[o])}class vR extends Mm{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=xe}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Un.has(n)){const r=Lp(n);return r&&r.default||0}return n=Pm.has(n)?n:hc(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return rm(t,n,r)}build(t,n,r){Qp(t,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,n,r,o){gR(t,n,r,o)}mount(t){this.isSVGTag=tm(t.tagName),super.mount(t)}}const yR=(e,t)=>gc(e)?new vR(t):new mR(t,{allowProjection:e!==E.Fragment}),bR=gE({...zE,...cR,...ZM,...lR},yR),xR=BD(bR),wR=({children:e})=>x.jsx(By,{modifiers:[LC],dropAnimation:{duration:500,easing:"cubic-bezier(0.18, 0.67, 0.6, 1.22)"},className:"Draggable dragging",children:x.jsx(xR.div,{style:{height:"100%",width:"100%",border:"2px solid #f6543b",borderRadius:"8px",boxShadow:"0 0 0 4px rgba(246, 140, 59, 0.2), 0 4px 12px rgba(228, 3, 3, 0.15)"},initial:{scale:.7,opacity:0},animate:{scale:1,opacity:1},transition:{duration:.4,ease:[.22,1,.36,1],mass:.5},children:e})}),xc=Ho(e=>({startAt:"",booking:null,slotData:null,updateStartAt:t=>e(n=>({...n,startAt:t})),updateBooking:t=>{e(n=>{var r;return(t==null?void 0:t.startAt)!==((r=n.booking)==null?void 0:r.startAt)?{...n,booking:t}:n})},updateSlotData:t=>{e(n=>({...n,slotData:t}))}})),SR=-Math.abs(1.98),Am=({booking:e,onAddTime:t,onAddStartTime:n,onSubTime:r,starter:o=!1})=>{const[s,i]=E.useState({height:jt,width:jt}),[a,c]=E.useState(0),l=(M,b)=>{const T=Z.timeDiffInSeconds(M,b),R=Math.ceil(T/li);return-Math.abs((R-1)*2)},[u,d]=E.useState(o?l(e.finishAt,e.startAt):0),h=M=>M===-Math.abs(0)||M===0,f=()=>Z.timeDiffInSeconds(e.finishAt,e.startAt)===li,S=async M=>{if(M.includes("n")){const b=g(e.startAt,"add");if(f())return;c(T=>T+2),n&&n(b)}else{const b=w(e.finishAt,"add");d(T=>h(T)?SR:T-2),t&&t(b)}},m=async M=>{if(M.includes("n")){const T=g(e.startAt,"remove");c(R=>R-2),n&&n(T);return}const b=w(e.finishAt,"remove");f()||(d(T=>T+2),r&&r(b))},w=(M,b)=>{const T=new Date(M),R=T.getMinutes();return b==="add"&&T.setMinutes(R+15),b==="remove"&&T.setMinutes(R-15),T},g=(M,b)=>{const T=new Date(M),R=T.getMinutes();return b==="add"&&T.setMinutes(R+15),b==="remove"&&T.setMinutes(R-15),T};return{state:s,setState:i,resetState:()=>{i({height:jt,width:jt})},resetHeightStyle:()=>{d(0)},heightStyle:u,topHeightIncrement:a,onResize:(M,{size:b,handle:T})=>{switch(M.stopPropagation(),M.preventDefault(),T){case"se":case"s":{i(R=>(Number(R.height)<Number(b.height)&&S(["s","se"]),Number(R.height)>Number(b.height)&&m(["s","se"]),{...R,height:b.height}));break}case"n":{i(R=>Math.abs(Number(b.height-Number(R.height)))<10?{...R,height:b.height}:(+(R.height<Number(b.height))&&m(["n"]),+(R.height>Number(b.height))&&S(["n"]),{...R,height:b.height}));break}}},updateHeightStyle:(M,b)=>{d(l(M,b))}}};var wc="Popover",[Om,jA]=Ht(wc,[Ut]),Kr=Ut(),[CR,Kt]=Om(wc),km=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:o,onOpenChange:s,modal:i=!1}=e,a=Kr(t),c=D.useRef(null),[l,u]=D.useState(!1),[d=!1,h]=ln({prop:r,defaultProp:o,onChange:s});return x.jsx(es,{...a,children:x.jsx(CR,{scope:t,contentId:Vt(),triggerRef:c,open:d,onOpenChange:h,onOpenToggle:D.useCallback(()=>h(f=>!f),[h]),hasCustomAnchor:l,onCustomAnchorAdd:D.useCallback(()=>u(!0),[]),onCustomAnchorRemove:D.useCallback(()=>u(!1),[]),modal:i,children:n})})};km.displayName=wc;var _m="PopoverAnchor",Nm=D.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Kt(_m,n),s=Kr(n),{onCustomAnchorAdd:i,onCustomAnchorRemove:a}=o;return D.useEffect(()=>(i(),()=>a()),[i,a]),x.jsx(Vr,{...s,...r,ref:t})});Nm.displayName=_m;var Im="PopoverTrigger",jm=D.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Kt(Im,n),s=Kr(n),i=fe(t,o.triggerRef),a=x.jsx(ae.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Bm(o.open),...r,ref:i,onClick:te(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?a:x.jsx(Vr,{asChild:!0,...s,children:a})});jm.displayName=Im;var Sc="PopoverPortal",[TR,DR]=Om(Sc,{forceMount:void 0}),Lm=e=>{const{__scopePopover:t,forceMount:n,children:r,container:o}=e,s=Kt(Sc,t);return x.jsx(TR,{scope:t,forceMount:n,children:x.jsx(Dt,{present:n||s.open,children:x.jsx(Fr,{asChild:!0,container:o,children:r})})})};Lm.displayName=Sc;var In="PopoverContent",Vm=D.forwardRef((e,t)=>{const n=DR(In,e.__scopePopover),{forceMount:r=n.forceMount,...o}=e,s=Kt(In,e.__scopePopover);return x.jsx(Dt,{present:r||s.open,children:s.modal?x.jsx(MR,{...o,ref:t}):x.jsx(RR,{...o,ref:t})})});Vm.displayName=In;var ER=sn("PopoverContent.RemoveScroll"),MR=D.forwardRef((e,t)=>{const n=Kt(In,e.__scopePopover),r=D.useRef(null),o=fe(t,r),s=D.useRef(!1);return D.useEffect(()=>{const i=r.current;if(i)return Aa(i)},[]),x.jsx(us,{as:ER,allowPinchZoom:!0,children:x.jsx(Fm,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:te(e.onCloseAutoFocus,i=>{var a;i.preventDefault(),s.current||(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:te(e.onPointerDownOutside,i=>{const a=i.detail.originalEvent,c=a.button===0&&a.ctrlKey===!0,l=a.button===2||c;s.current=l},{checkForDefaultPrevented:!1}),onFocusOutside:te(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1})})})}),RR=D.forwardRef((e,t)=>{const n=Kt(In,e.__scopePopover),r=D.useRef(!1),o=D.useRef(!1);return x.jsx(Fm,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var i,a;(i=e.onCloseAutoFocus)==null||i.call(e,s),s.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),s.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:s=>{var c,l;(c=e.onInteractOutside)==null||c.call(e,s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const i=s.target;((l=n.triggerRef.current)==null?void 0:l.contains(i))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&o.current&&s.preventDefault()}})}),Fm=D.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:s,disableOutsidePointerEvents:i,onEscapeKeyDown:a,onPointerDownOutside:c,onFocusOutside:l,onInteractOutside:u,...d}=e,h=Kt(In,n),f=Kr(n);return Pa(),x.jsx(as,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:s,children:x.jsx(jr,{asChild:!0,disableOutsidePointerEvents:i,onInteractOutside:u,onEscapeKeyDown:a,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>h.onOpenChange(!1),children:x.jsx(ts,{"data-state":Bm(h.open),role:"dialog",id:h.contentId,...f,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),$m="PopoverClose",PR=D.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Kt($m,n);return x.jsx(ae.button,{type:"button",...r,ref:t,onClick:te(e.onClick,()=>o.onOpenChange(!1))})});PR.displayName=$m;var AR="PopoverArrow",OR=D.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Kr(n);return x.jsx(ns,{...o,...r,ref:t})});OR.displayName=AR;function Bm(e){return e?"open":"closed"}var kR=km,_R=Nm,NR=jm,IR=Lm,jR=Vm;function LR({...e}){return x.jsx(kR,{"data-slot":"popover",...e})}function VR({...e}){return x.jsx(NR,{"data-slot":"popover-trigger",...e})}function FR({className:e,align:t="center",sideOffset:n=4,...r}){return x.jsx(IR,{children:x.jsx(jR,{"data-slot":"popover-content",align:t,sideOffset:n,className:de("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 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",e),...r})})}function $R({...e}){return x.jsx(_R,{"data-slot":"popover-anchor",...e})}var BR="Toggle",zm=D.forwardRef((e,t)=>{const{pressed:n,defaultPressed:r=!1,onPressedChange:o,...s}=e,[i=!1,a]=ln({prop:n,onChange:o,defaultProp:r});return x.jsx(ae.button,{type:"button","aria-pressed":i,"data-state":i?"on":"off","data-disabled":e.disabled?"":void 0,...s,ref:t,onClick:te(e.onClick,()=>{e.disabled||a(!i)})})});zm.displayName=BR;var zR=zm;const WR=fa("inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium hover:bg-muted hover:text-muted-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none transition-[color,box-shadow] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive whitespace-nowrap",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent shadow-xs hover:bg-accent hover:text-accent-foreground"},size:{default:"h-9 px-2 min-w-9",sm:"h-8 px-1.5 min-w-8",lg:"h-10 px-2.5 min-w-10"}},defaultVariants:{variant:"default",size:"default"}});function HR({className:e,variant:t,size:n,...r}){return x.jsx(zR,{"data-slot":"toggle",className:de(WR({variant:t,size:n,className:e})),...r})}const UR=()=>{const[e,t]=E.useState(!1);return x.jsx(Da,{children:x.jsxs(Jf,{children:[x.jsx(Qf,{asChild:!0,children:x.jsx("div",{children:x.jsx(HR,{className:"group size-10 p-0 hover:bg-indigo-50 hover:text-indigo-500 data-[state=on]:bg-indigo-50 data-[state=on]:text-indigo-500","aria-label":"Bookmark this",variant:e?"default":"outline",pressed:e,onPressedChange:t,children:x.jsx(Yy,{size:16,strokeWidth:2,"aria-hidden":"true"})})})}),x.jsx(eh,{className:"border border-input bg-popover px-2 py-1 text-xs text-muted-foreground",children:x.jsx("p",{children:e?"Remove bookmark":"Bookmark this"})})]})})};function zu(e,[t,n]){return Math.min(n,Math.max(t,e))}function YR(e){const t=D.useRef({value:e,previous:e});return D.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var KR=[" ","Enter","ArrowUp","ArrowDown"],GR=[" ","Enter"],Gr="Select",[gs,vs,qR]=Ma(Gr),[Yn,LA]=Ht(Gr,[qR,Ut]),ys=Ut(),[XR,Gt]=Yn(Gr),[ZR,JR]=Yn(Gr),Wm=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:s,value:i,defaultValue:a,onValueChange:c,dir:l,name:u,autoComplete:d,disabled:h,required:f,form:S}=e,m=ys(t),[w,g]=D.useState(null),[p,v]=D.useState(null),[C,y]=D.useState(!1),M=Ra(l),[b=!1,T]=ln({prop:r,defaultProp:o,onChange:s}),[R,_]=ln({prop:i,defaultProp:a,onChange:c}),O=D.useRef(null),z=w?S||!!w.closest("form"):!0,[G,j]=D.useState(new Set),F=Array.from(G).map(N=>N.props.value).join(";");return x.jsx(es,{...m,children:x.jsxs(XR,{required:f,scope:t,trigger:w,onTriggerChange:g,valueNode:p,onValueNodeChange:v,valueNodeHasChildren:C,onValueNodeHasChildrenChange:y,contentId:Vt(),value:R,onValueChange:_,open:b,onOpenChange:T,dir:M,triggerPointerDownPosRef:O,disabled:h,children:[x.jsx(gs.Provider,{scope:t,children:x.jsx(ZR,{scope:e.__scopeSelect,onNativeOptionAdd:D.useCallback(N=>{j(k=>new Set(k).add(N))},[]),onNativeOptionRemove:D.useCallback(N=>{j(k=>{const P=new Set(k);return P.delete(N),P})},[]),children:n})}),z?x.jsxs(fg,{"aria-hidden":!0,required:f,tabIndex:-1,name:u,autoComplete:d,value:R,onChange:N=>_(N.target.value),disabled:h,form:S,children:[R===void 0?x.jsx("option",{value:""}):null,Array.from(G)]},F):null]})})};Wm.displayName=Gr;var Hm="SelectTrigger",Um=D.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,s=ys(n),i=Gt(Hm,n),a=i.disabled||r,c=fe(t,i.onTriggerChange),l=vs(n),u=D.useRef("touch"),[d,h,f]=hg(m=>{const w=l().filter(v=>!v.disabled),g=w.find(v=>v.value===i.value),p=pg(w,m,g);p!==void 0&&i.onValueChange(p.value)}),S=m=>{a||(i.onOpenChange(!0),f()),m&&(i.triggerPointerDownPosRef.current={x:Math.round(m.pageX),y:Math.round(m.pageY)})};return x.jsx(Vr,{asChild:!0,...s,children:x.jsx(ae.button,{type:"button",role:"combobox","aria-controls":i.contentId,"aria-expanded":i.open,"aria-required":i.required,"aria-autocomplete":"none",dir:i.dir,"data-state":i.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":dg(i.value)?"":void 0,...o,ref:c,onClick:te(o.onClick,m=>{m.currentTarget.focus(),u.current!=="mouse"&&S(m)}),onPointerDown:te(o.onPointerDown,m=>{u.current=m.pointerType;const w=m.target;w.hasPointerCapture(m.pointerId)&&w.releasePointerCapture(m.pointerId),m.button===0&&m.ctrlKey===!1&&m.pointerType==="mouse"&&(S(m),m.preventDefault())}),onKeyDown:te(o.onKeyDown,m=>{const w=d.current!=="";!(m.ctrlKey||m.altKey||m.metaKey)&&m.key.length===1&&h(m.key),!(w&&m.key===" ")&&KR.includes(m.key)&&(S(),m.preventDefault())})})})});Um.displayName=Hm;var Ym="SelectValue",Km=D.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:s,placeholder:i="",...a}=e,c=Gt(Ym,n),{onValueNodeHasChildrenChange:l}=c,u=s!==void 0,d=fe(t,c.onValueNodeChange);return _e(()=>{l(u)},[l,u]),x.jsx(ae.span,{...a,ref:d,style:{pointerEvents:"none"},children:dg(c.value)?x.jsx(x.Fragment,{children:i}):s})});Km.displayName=Ym;var QR="SelectIcon",Gm=D.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return x.jsx(ae.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})});Gm.displayName=QR;var eP="SelectPortal",qm=e=>x.jsx(Fr,{asChild:!0,...e});qm.displayName=eP;var un="SelectContent",Xm=D.forwardRef((e,t)=>{const n=Gt(un,e.__scopeSelect),[r,o]=D.useState();if(_e(()=>{o(new DocumentFragment)},[]),!n.open){const s=r;return s?zo.createPortal(x.jsx(Zm,{scope:e.__scopeSelect,children:x.jsx(gs.Slot,{scope:e.__scopeSelect,children:x.jsx("div",{children:e.children})})}),s):null}return x.jsx(Jm,{...e,ref:t})});Xm.displayName=un;var Qe=10,[Zm,qt]=Yn(un),tP="SelectContentImpl",nP=sn("SelectContent.RemoveScroll"),Jm=D.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:s,onPointerDownOutside:i,side:a,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:h,collisionPadding:f,sticky:S,hideWhenDetached:m,avoidCollisions:w,...g}=e,p=Gt(un,n),[v,C]=D.useState(null),[y,M]=D.useState(null),b=fe(t,$=>C($)),[T,R]=D.useState(null),[_,O]=D.useState(null),z=vs(n),[G,j]=D.useState(!1),F=D.useRef(!1);D.useEffect(()=>{if(v)return Aa(v)},[v]),Pa();const N=D.useCallback($=>{const[q,...X]=z().map(B=>B.ref.current),[U]=X.slice(-1),ne=document.activeElement;for(const B of $)if(B===ne||(B==null||B.scrollIntoView({block:"nearest"}),B===q&&y&&(y.scrollTop=0),B===U&&y&&(y.scrollTop=y.scrollHeight),B==null||B.focus(),document.activeElement!==ne))return},[z,y]),k=D.useCallback(()=>N([T,v]),[N,T,v]);D.useEffect(()=>{G&&k()},[G,k]);const{onOpenChange:P,triggerPointerDownPosRef:I}=p;D.useEffect(()=>{if(v){let $={x:0,y:0};const q=U=>{var ne,B;$={x:Math.abs(Math.round(U.pageX)-(((ne=I.current)==null?void 0:ne.x)??0)),y:Math.abs(Math.round(U.pageY)-(((B=I.current)==null?void 0:B.y)??0))}},X=U=>{$.x<=10&&$.y<=10?U.preventDefault():v.contains(U.target)||P(!1),document.removeEventListener("pointermove",q),I.current=null};return I.current!==null&&(document.addEventListener("pointermove",q),document.addEventListener("pointerup",X,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",q),document.removeEventListener("pointerup",X,{capture:!0})}}},[v,P,I]),D.useEffect(()=>{const $=()=>P(!1);return window.addEventListener("blur",$),window.addEventListener("resize",$),()=>{window.removeEventListener("blur",$),window.removeEventListener("resize",$)}},[P]);const[A,V]=hg($=>{const q=z().filter(ne=>!ne.disabled),X=q.find(ne=>ne.ref.current===document.activeElement),U=pg(q,$,X);U&&setTimeout(()=>U.ref.current.focus())}),W=D.useCallback(($,q,X)=>{const U=!F.current&&!X;(p.value!==void 0&&p.value===q||U)&&(R($),U&&(F.current=!0))},[p.value]),H=D.useCallback(()=>v==null?void 0:v.focus(),[v]),L=D.useCallback(($,q,X)=>{const U=!F.current&&!X;(p.value!==void 0&&p.value===q||U)&&O($)},[p.value]),Y=r==="popper"?qi:Qm,K=Y===qi?{side:a,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:h,collisionPadding:f,sticky:S,hideWhenDetached:m,avoidCollisions:w}:{};return x.jsx(Zm,{scope:n,content:v,viewport:y,onViewportChange:M,itemRefCallback:W,selectedItem:T,onItemLeave:H,itemTextRefCallback:L,focusSelectedItem:k,selectedItemText:_,position:r,isPositioned:G,searchRef:A,children:x.jsx(us,{as:nP,allowPinchZoom:!0,children:x.jsx(as,{asChild:!0,trapped:p.open,onMountAutoFocus:$=>{$.preventDefault()},onUnmountAutoFocus:te(o,$=>{var q;(q=p.trigger)==null||q.focus({preventScroll:!0}),$.preventDefault()}),children:x.jsx(jr,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:$=>$.preventDefault(),onDismiss:()=>p.onOpenChange(!1),children:x.jsx(Y,{role:"listbox",id:p.contentId,"data-state":p.open?"open":"closed",dir:p.dir,onContextMenu:$=>$.preventDefault(),...g,...K,onPlaced:()=>j(!0),ref:b,style:{display:"flex",flexDirection:"column",outline:"none",...g.style},onKeyDown:te(g.onKeyDown,$=>{const q=$.ctrlKey||$.altKey||$.metaKey;if($.key==="Tab"&&$.preventDefault(),!q&&$.key.length===1&&V($.key),["ArrowUp","ArrowDown","Home","End"].includes($.key)){let U=z().filter(ne=>!ne.disabled).map(ne=>ne.ref.current);if(["ArrowUp","End"].includes($.key)&&(U=U.slice().reverse()),["ArrowUp","ArrowDown"].includes($.key)){const ne=$.target,B=U.indexOf(ne);U=U.slice(B+1)}setTimeout(()=>N(U)),$.preventDefault()}})})})})})})});Jm.displayName=tP;var rP="SelectItemAlignedPosition",Qm=D.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,s=Gt(un,n),i=qt(un,n),[a,c]=D.useState(null),[l,u]=D.useState(null),d=fe(t,b=>u(b)),h=vs(n),f=D.useRef(!1),S=D.useRef(!0),{viewport:m,selectedItem:w,selectedItemText:g,focusSelectedItem:p}=i,v=D.useCallback(()=>{if(s.trigger&&s.valueNode&&a&&l&&m&&w&&g){const b=s.trigger.getBoundingClientRect(),T=l.getBoundingClientRect(),R=s.valueNode.getBoundingClientRect(),_=g.getBoundingClientRect();if(s.dir!=="rtl"){const ne=_.left-T.left,B=R.left-ne,ie=b.left-B,pe=b.width+ie,Oe=Math.max(pe,T.width),Ee=window.innerWidth-Qe,ot=zu(B,[Qe,Math.max(Qe,Ee-Oe)]);a.style.minWidth=pe+"px",a.style.left=ot+"px"}else{const ne=T.right-_.right,B=window.innerWidth-R.right-ne,ie=window.innerWidth-b.right-B,pe=b.width+ie,Oe=Math.max(pe,T.width),Ee=window.innerWidth-Qe,ot=zu(B,[Qe,Math.max(Qe,Ee-Oe)]);a.style.minWidth=pe+"px",a.style.right=ot+"px"}const O=h(),z=window.innerHeight-Qe*2,G=m.scrollHeight,j=window.getComputedStyle(l),F=parseInt(j.borderTopWidth,10),N=parseInt(j.paddingTop,10),k=parseInt(j.borderBottomWidth,10),P=parseInt(j.paddingBottom,10),I=F+N+G+P+k,A=Math.min(w.offsetHeight*5,I),V=window.getComputedStyle(m),W=parseInt(V.paddingTop,10),H=parseInt(V.paddingBottom,10),L=b.top+b.height/2-Qe,Y=z-L,K=w.offsetHeight/2,$=w.offsetTop+K,q=F+N+$,X=I-q;if(q<=L){const ne=O.length>0&&w===O[O.length-1].ref.current;a.style.bottom="0px";const B=l.clientHeight-m.offsetTop-m.offsetHeight,ie=Math.max(Y,K+(ne?H:0)+B+k),pe=q+ie;a.style.height=pe+"px"}else{const ne=O.length>0&&w===O[0].ref.current;a.style.top="0px";const ie=Math.max(L,F+m.offsetTop+(ne?W:0)+K)+X;a.style.height=ie+"px",m.scrollTop=q-L+m.offsetTop}a.style.margin=`${Qe}px 0`,a.style.minHeight=A+"px",a.style.maxHeight=z+"px",r==null||r(),requestAnimationFrame(()=>f.current=!0)}},[h,s.trigger,s.valueNode,a,l,m,w,g,s.dir,r]);_e(()=>v(),[v]);const[C,y]=D.useState();_e(()=>{l&&y(window.getComputedStyle(l).zIndex)},[l]);const M=D.useCallback(b=>{b&&S.current===!0&&(v(),p==null||p(),S.current=!1)},[v,p]);return x.jsx(sP,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:f,onScrollButtonChange:M,children:x.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:C},children:x.jsx(ae.div,{...o,ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});Qm.displayName=rP;var oP="SelectPopperPosition",qi=D.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=Qe,...s}=e,i=ys(n);return x.jsx(ts,{...i,...s,ref:t,align:r,collisionPadding:o,style:{boxSizing:"border-box",...s.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});qi.displayName=oP;var[sP,Cc]=Yn(un,{}),Xi="SelectViewport",eg=D.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...o}=e,s=qt(Xi,n),i=Cc(Xi,n),a=fe(t,s.onViewportChange),c=D.useRef(0);return x.jsxs(x.Fragment,{children:[x.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),x.jsx(gs.Slot,{scope:n,children:x.jsx(ae.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:te(o.onScroll,l=>{const u=l.currentTarget,{contentWrapper:d,shouldExpandOnScrollRef:h}=i;if(h!=null&&h.current&&d){const f=Math.abs(c.current-u.scrollTop);if(f>0){const S=window.innerHeight-Qe*2,m=parseFloat(d.style.minHeight),w=parseFloat(d.style.height),g=Math.max(m,w);if(g<S){const p=g+f,v=Math.min(S,p),C=p-v;d.style.height=v+"px",d.style.bottom==="0px"&&(u.scrollTop=C>0?C:0,d.style.justifyContent="flex-end")}}}c.current=u.scrollTop})})})]})});eg.displayName=Xi;var tg="SelectGroup",[iP,aP]=Yn(tg),cP=D.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Vt();return x.jsx(iP,{scope:n,id:o,children:x.jsx(ae.div,{role:"group","aria-labelledby":o,...r,ref:t})})});cP.displayName=tg;var ng="SelectLabel",lP=D.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=aP(ng,n);return x.jsx(ae.div,{id:o.id,...r,ref:t})});lP.displayName=ng;var Bo="SelectItem",[uP,rg]=Yn(Bo),og=D.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:s,...i}=e,a=Gt(Bo,n),c=qt(Bo,n),l=a.value===r,[u,d]=D.useState(s??""),[h,f]=D.useState(!1),S=fe(t,p=>{var v;return(v=c.itemRefCallback)==null?void 0:v.call(c,p,r,o)}),m=Vt(),w=D.useRef("touch"),g=()=>{o||(a.onValueChange(r),a.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return x.jsx(uP,{scope:n,value:r,disabled:o,textId:m,isSelected:l,onItemTextChange:D.useCallback(p=>{d(v=>v||((p==null?void 0:p.textContent)??"").trim())},[]),children:x.jsx(gs.ItemSlot,{scope:n,value:r,disabled:o,textValue:u,children:x.jsx(ae.div,{role:"option","aria-labelledby":m,"data-highlighted":h?"":void 0,"aria-selected":l&&h,"data-state":l?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...i,ref:S,onFocus:te(i.onFocus,()=>f(!0)),onBlur:te(i.onBlur,()=>f(!1)),onClick:te(i.onClick,()=>{w.current!=="mouse"&&g()}),onPointerUp:te(i.onPointerUp,()=>{w.current==="mouse"&&g()}),onPointerDown:te(i.onPointerDown,p=>{w.current=p.pointerType}),onPointerMove:te(i.onPointerMove,p=>{var v;w.current=p.pointerType,o?(v=c.onItemLeave)==null||v.call(c):w.current==="mouse"&&p.currentTarget.focus({preventScroll:!0})}),onPointerLeave:te(i.onPointerLeave,p=>{var v;p.currentTarget===document.activeElement&&((v=c.onItemLeave)==null||v.call(c))}),onKeyDown:te(i.onKeyDown,p=>{var C;((C=c.searchRef)==null?void 0:C.current)!==""&&p.key===" "||(GR.includes(p.key)&&g(),p.key===" "&&p.preventDefault())})})})})});og.displayName=Bo;var cr="SelectItemText",sg=D.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...s}=e,i=Gt(cr,n),a=qt(cr,n),c=rg(cr,n),l=JR(cr,n),[u,d]=D.useState(null),h=fe(t,g=>d(g),c.onItemTextChange,g=>{var p;return(p=a.itemTextRefCallback)==null?void 0:p.call(a,g,c.value,c.disabled)}),f=u==null?void 0:u.textContent,S=D.useMemo(()=>x.jsx("option",{value:c.value,disabled:c.disabled,children:f},c.value),[c.disabled,c.value,f]),{onNativeOptionAdd:m,onNativeOptionRemove:w}=l;return _e(()=>(m(S),()=>w(S)),[m,w,S]),x.jsxs(x.Fragment,{children:[x.jsx(ae.span,{id:c.textId,...s,ref:h}),c.isSelected&&i.valueNode&&!i.valueNodeHasChildren?zo.createPortal(s.children,i.valueNode):null]})});sg.displayName=cr;var ig="SelectItemIndicator",ag=D.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return rg(ig,n).isSelected?x.jsx(ae.span,{"aria-hidden":!0,...r,ref:t}):null});ag.displayName=ig;var Zi="SelectScrollUpButton",cg=D.forwardRef((e,t)=>{const n=qt(Zi,e.__scopeSelect),r=Cc(Zi,e.__scopeSelect),[o,s]=D.useState(!1),i=fe(t,r.onScrollButtonChange);return _e(()=>{if(n.viewport&&n.isPositioned){let a=function(){const l=c.scrollTop>0;s(l)};const c=n.viewport;return a(),c.addEventListener("scroll",a),()=>c.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),o?x.jsx(ug,{...e,ref:i,onAutoScroll:()=>{const{viewport:a,selectedItem:c}=n;a&&c&&(a.scrollTop=a.scrollTop-c.offsetHeight)}}):null});cg.displayName=Zi;var Ji="SelectScrollDownButton",lg=D.forwardRef((e,t)=>{const n=qt(Ji,e.__scopeSelect),r=Cc(Ji,e.__scopeSelect),[o,s]=D.useState(!1),i=fe(t,r.onScrollButtonChange);return _e(()=>{if(n.viewport&&n.isPositioned){let a=function(){const l=c.scrollHeight-c.clientHeight,u=Math.ceil(c.scrollTop)<l;s(u)};const c=n.viewport;return a(),c.addEventListener("scroll",a),()=>c.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),o?x.jsx(ug,{...e,ref:i,onAutoScroll:()=>{const{viewport:a,selectedItem:c}=n;a&&c&&(a.scrollTop=a.scrollTop+c.offsetHeight)}}):null});lg.displayName=Ji;var ug=D.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,s=qt("SelectScrollButton",n),i=D.useRef(null),a=vs(n),c=D.useCallback(()=>{i.current!==null&&(window.clearInterval(i.current),i.current=null)},[]);return D.useEffect(()=>()=>c(),[c]),_e(()=>{var u;const l=a().find(d=>d.ref.current===document.activeElement);(u=l==null?void 0:l.ref.current)==null||u.scrollIntoView({block:"nearest"})},[a]),x.jsx(ae.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:te(o.onPointerDown,()=>{i.current===null&&(i.current=window.setInterval(r,50))}),onPointerMove:te(o.onPointerMove,()=>{var l;(l=s.onItemLeave)==null||l.call(s),i.current===null&&(i.current=window.setInterval(r,50))}),onPointerLeave:te(o.onPointerLeave,()=>{c()})})}),dP="SelectSeparator",fP=D.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return x.jsx(ae.div,{"aria-hidden":!0,...r,ref:t})});fP.displayName=dP;var Qi="SelectArrow",hP=D.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=ys(n),s=Gt(Qi,n),i=qt(Qi,n);return s.open&&i.position==="popper"?x.jsx(ns,{...o,...r,ref:t}):null});hP.displayName=Qi;function dg(e){return e===""||e===void 0}var fg=D.forwardRef((e,t)=>{const{value:n,...r}=e,o=D.useRef(null),s=fe(t,o),i=YR(n);return D.useEffect(()=>{const a=o.current,c=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(c,"value").set;if(i!==n&&u){const d=new Event("change",{bubbles:!0});u.call(a,n),a.dispatchEvent(d)}},[i,n]),x.jsx(Sa,{asChild:!0,children:x.jsx("select",{...r,ref:s,defaultValue:n})})});fg.displayName="BubbleSelect";function hg(e){const t=Ze(e),n=D.useRef(""),r=D.useRef(0),o=D.useCallback(i=>{const a=n.current+i;t(a),function c(l){n.current=l,window.clearTimeout(r.current),l!==""&&(r.current=window.setTimeout(()=>c(""),1e3))}(a)},[t]),s=D.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return D.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,s]}function pg(e,t,n){const o=t.length>1&&Array.from(t).every(l=>l===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let i=pP(e,Math.max(s,0));o.length===1&&(i=i.filter(l=>l!==n));const c=i.find(l=>l.textValue.toLowerCase().startsWith(o.toLowerCase()));return c!==n?c:void 0}function pP(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var mP=Wm,gP=Um,vP=Km,yP=Gm,bP=qm,xP=Xm,wP=eg,SP=og,CP=sg,TP=ag,DP=cg,EP=lg;function MP({...e}){return x.jsx(mP,{"data-slot":"select",...e})}function RP({...e}){return x.jsx(vP,{"data-slot":"select-value",...e})}function PP({className:e,size:t="default",children:n,...r}){return x.jsxs(gP,{"data-slot":"select-trigger","data-size":t,className:de("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r,children:[n,x.jsx(yP,{asChild:!0,children:x.jsx(af,{className:"size-4 opacity-50"})})]})}function AP({className:e,children:t,position:n="popper",...r}){return x.jsx(bP,{children:x.jsxs(xP,{"data-slot":"select-content",className:de("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 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:[x.jsx(kP,{}),x.jsx(wP,{className:de("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),x.jsx(_P,{})]})})}function OP({className:e,children:t,...n}){return x.jsxs(SP,{"data-slot":"select-item",className:de("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...n,children:[x.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:x.jsx(TP,{children:x.jsx(sf,{className:"size-4"})})}),x.jsx(CP,{children:t})]})}function kP({className:e,...t}){return x.jsx(DP,{"data-slot":"select-scroll-up-button",className:de("flex cursor-default items-center justify-center py-1",e),...t,children:x.jsx(ob,{className:"size-4"})})}function _P({className:e,...t}){return x.jsx(EP,{"data-slot":"select-scroll-down-button",className:de("flex cursor-default items-center justify-center py-1",e),...t,children:x.jsx(af,{className:"size-4"})})}const NP=({options:e,onChange:t})=>x.jsxs(MP,{onValueChange:n=>t(n),defaultValue:e[1].text,children:[x.jsx(PP,{className:"w-[180px]",children:x.jsx(RP,{placeholder:"view"})}),x.jsx(AP,{children:e.map(n=>x.jsx(OP,{value:n.text,children:n.text},n.text))})]}),IP=[{text:"teste1",onClick:()=>console.log("teste1")},{text:"teste2",onClick:()=>console.log("teste2")}],jP=5,LP=0,VP=({side:e,xAxis:t,yAxis:n,updatePosition:r,children:o})=>{const{attributes:s,listeners:i,setNodeRef:a,transform:c,setActivatorNodeRef:l}=ua({id:"booking-info-id",data:{type:"booking-info-options"}}),u=hn(h=>h.updateIsDragging),d={transform:`translate3d(${t+((c==null?void 0:c.x)||0)}px, ${n+((c==null?void 0:c.y)||0)}px, 0)`};return _r({onDragStart(){u(!0)},onDragEnd(h){h.active.id&&r(c)}}),x.jsx(FR,{ref:a,updatePositionStrategy:"optimized",side:e,align:"start",sticky:"always",sideOffset:jP,alignOffset:LP,style:{...d,width:"25rem"},children:x.jsxs("div",{className:"grid gap-3",children:[x.jsx("input",{type:"text",style:{position:"absolute",opacity:0,height:0,width:0}}),x.jsxs("div",{className:"flex justify-end gap-1",children:[x.jsx("div",{ref:l,className:"w-full cursor-move",...s,...i}),x.jsx(UR,{}),x.jsx(an,{type:"button",variant:"outline",size:"icon",children:x.jsx(pb,{className:"h-3 w-3"})}),x.jsx(an,{type:"button",variant:"outline",size:"icon",onClick:()=>{},children:x.jsx(yb,{className:"h-3 w-3"})}),x.jsx(NP,{options:IP,onChange:()=>{}})]}),o]})})},Wu={xAxis:0,yAxis:0},mg=({isEditingOpen:e,side:t,booking:n,onOpenChange:r,children:o})=>{const[s,i]=E.useState({...Wu}),a=hn(f=>f.updateIsDragging),c=E.useMemo(()=>`${Z.dateAndHourDateToString(n.startAt)} - ${Z.dateAndHourDateToString(n.finishAt)}`,[n.startAt,n.finishAt]),l=E.useMemo(()=>{const f=new Date(n.startAt),S=f.getDate(),m=f.getDay(),w=Mn[f.getMonth()];return x.jsx("span",{children:`${nv[m]}, ${S} ${w}`})},[n.startAt]),u=()=>({backgroundColor:""}),d=f=>{f||console.info("No transform info to show "),i({xAxis:s.xAxis+((f==null?void 0:f.x)||0),yAxis:s.yAxis+((f==null?void 0:f.y)||0)})};_r({onDragStart(f){const S=f.active.data.current,m=f.active.id,w=S.type==="booking-info-options";m&&w&&a(!0)}});const h=f=>{f===!1&&i({...Wu}),r(f)};return x.jsxs(LR,{open:e,onOpenChange:h,defaultOpen:!1,children:[x.jsx($R,{style:{width:"100%"},children:x.jsx(VR,{asChild:!0,children:o})}),x.jsx(la,{children:x.jsx(VP,{side:t,xAxis:s.xAxis,yAxis:s.yAxis,updatePosition:d,children:x.jsxs("div",{className:"bookingCard_content",children:[x.jsx("span",{style:u(),className:"flex h-4 w-4 translate-y-0 rounded-sm"}),x.jsx("div",{className:"space-y-1",children:x.jsxs("p",{className:"text-sm text-muted-foreground",children:[l," | ",c]})})]})})})]})};mg.displayName="BookingInfoOptions";var er={exports:{}},tr={},nr={exports:{}},ei={},ao={exports:{}},co={exports:{}},le={};/** @license React v16.13.1
150
150
  * react-is.production.min.js
151
151
  *
152
152
  * Copyright (c) Facebook, Inc. and its affiliates.
153
153
  *
154
154
  * This source code is licensed under the MIT license found in the
155
155
  * LICENSE file in the root directory of this source tree.
156
- */var Uu;function FP(){if(Uu)return ue;Uu=1;var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,s=e?Symbol.for("react.profiler"):60114,i=e?Symbol.for("react.provider"):60109,a=e?Symbol.for("react.context"):60110,c=e?Symbol.for("react.async_mode"):60111,l=e?Symbol.for("react.concurrent_mode"):60111,u=e?Symbol.for("react.forward_ref"):60112,d=e?Symbol.for("react.suspense"):60113,f=e?Symbol.for("react.suspense_list"):60120,h=e?Symbol.for("react.memo"):60115,S=e?Symbol.for("react.lazy"):60116,p=e?Symbol.for("react.block"):60121,b=e?Symbol.for("react.fundamental"):60117,v=e?Symbol.for("react.responder"):60118,m=e?Symbol.for("react.scope"):60119;function g(y){if(typeof y=="object"&&y!==null){var M=y.$$typeof;switch(M){case t:switch(y=y.type,y){case c:case l:case r:case s:case o:case d:return y;default:switch(y=y&&y.$$typeof,y){case a:case u:case S:case h:case i:return y;default:return M}}case n:return M}}}function C(y){return g(y)===l}return ue.AsyncMode=c,ue.ConcurrentMode=l,ue.ContextConsumer=a,ue.ContextProvider=i,ue.Element=t,ue.ForwardRef=u,ue.Fragment=r,ue.Lazy=S,ue.Memo=h,ue.Portal=n,ue.Profiler=s,ue.StrictMode=o,ue.Suspense=d,ue.isAsyncMode=function(y){return C(y)||g(y)===c},ue.isConcurrentMode=C,ue.isContextConsumer=function(y){return g(y)===a},ue.isContextProvider=function(y){return g(y)===i},ue.isElement=function(y){return typeof y=="object"&&y!==null&&y.$$typeof===t},ue.isForwardRef=function(y){return g(y)===u},ue.isFragment=function(y){return g(y)===r},ue.isLazy=function(y){return g(y)===S},ue.isMemo=function(y){return g(y)===h},ue.isPortal=function(y){return g(y)===n},ue.isProfiler=function(y){return g(y)===s},ue.isStrictMode=function(y){return g(y)===o},ue.isSuspense=function(y){return g(y)===d},ue.isValidElementType=function(y){return typeof y=="string"||typeof y=="function"||y===r||y===l||y===s||y===o||y===d||y===f||typeof y=="object"&&y!==null&&(y.$$typeof===S||y.$$typeof===h||y.$$typeof===i||y.$$typeof===a||y.$$typeof===u||y.$$typeof===b||y.$$typeof===v||y.$$typeof===m||y.$$typeof===p)},ue.typeOf=g,ue}var de={};/** @license React v16.13.1
156
+ */var Hu;function FP(){if(Hu)return le;Hu=1;var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,s=e?Symbol.for("react.profiler"):60114,i=e?Symbol.for("react.provider"):60109,a=e?Symbol.for("react.context"):60110,c=e?Symbol.for("react.async_mode"):60111,l=e?Symbol.for("react.concurrent_mode"):60111,u=e?Symbol.for("react.forward_ref"):60112,d=e?Symbol.for("react.suspense"):60113,h=e?Symbol.for("react.suspense_list"):60120,f=e?Symbol.for("react.memo"):60115,S=e?Symbol.for("react.lazy"):60116,m=e?Symbol.for("react.block"):60121,w=e?Symbol.for("react.fundamental"):60117,g=e?Symbol.for("react.responder"):60118,p=e?Symbol.for("react.scope"):60119;function v(y){if(typeof y=="object"&&y!==null){var M=y.$$typeof;switch(M){case t:switch(y=y.type,y){case c:case l:case r:case s:case o:case d:return y;default:switch(y=y&&y.$$typeof,y){case a:case u:case S:case f:case i:return y;default:return M}}case n:return M}}}function C(y){return v(y)===l}return le.AsyncMode=c,le.ConcurrentMode=l,le.ContextConsumer=a,le.ContextProvider=i,le.Element=t,le.ForwardRef=u,le.Fragment=r,le.Lazy=S,le.Memo=f,le.Portal=n,le.Profiler=s,le.StrictMode=o,le.Suspense=d,le.isAsyncMode=function(y){return C(y)||v(y)===c},le.isConcurrentMode=C,le.isContextConsumer=function(y){return v(y)===a},le.isContextProvider=function(y){return v(y)===i},le.isElement=function(y){return typeof y=="object"&&y!==null&&y.$$typeof===t},le.isForwardRef=function(y){return v(y)===u},le.isFragment=function(y){return v(y)===r},le.isLazy=function(y){return v(y)===S},le.isMemo=function(y){return v(y)===f},le.isPortal=function(y){return v(y)===n},le.isProfiler=function(y){return v(y)===s},le.isStrictMode=function(y){return v(y)===o},le.isSuspense=function(y){return v(y)===d},le.isValidElementType=function(y){return typeof y=="string"||typeof y=="function"||y===r||y===l||y===s||y===o||y===d||y===h||typeof y=="object"&&y!==null&&(y.$$typeof===S||y.$$typeof===f||y.$$typeof===i||y.$$typeof===a||y.$$typeof===u||y.$$typeof===w||y.$$typeof===g||y.$$typeof===p||y.$$typeof===m)},le.typeOf=v,le}var ue={};/** @license React v16.13.1
157
157
  * react-is.development.js
158
158
  *
159
159
  * Copyright (c) Facebook, Inc. and its affiliates.
160
160
  *
161
161
  * This source code is licensed under the MIT license found in the
162
162
  * LICENSE file in the root directory of this source tree.
163
- */var Yu;function $P(){return Yu||(Yu=1,process.env.NODE_ENV!=="production"&&function(){var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,s=e?Symbol.for("react.profiler"):60114,i=e?Symbol.for("react.provider"):60109,a=e?Symbol.for("react.context"):60110,c=e?Symbol.for("react.async_mode"):60111,l=e?Symbol.for("react.concurrent_mode"):60111,u=e?Symbol.for("react.forward_ref"):60112,d=e?Symbol.for("react.suspense"):60113,f=e?Symbol.for("react.suspense_list"):60120,h=e?Symbol.for("react.memo"):60115,S=e?Symbol.for("react.lazy"):60116,p=e?Symbol.for("react.block"):60121,b=e?Symbol.for("react.fundamental"):60117,v=e?Symbol.for("react.responder"):60118,m=e?Symbol.for("react.scope"):60119;function g(B){return typeof B=="string"||typeof B=="function"||B===r||B===l||B===s||B===o||B===d||B===f||typeof B=="object"&&B!==null&&(B.$$typeof===S||B.$$typeof===h||B.$$typeof===i||B.$$typeof===a||B.$$typeof===u||B.$$typeof===b||B.$$typeof===v||B.$$typeof===m||B.$$typeof===p)}function C(B){if(typeof B=="object"&&B!==null){var ie=B.$$typeof;switch(ie){case t:var pe=B.type;switch(pe){case c:case l:case r:case s:case o:case d:return pe;default:var Oe=pe&&pe.$$typeof;switch(Oe){case a:case u:case S:case h:case i:return Oe;default:return ie}}case n:return ie}}}var y=c,M=l,x=a,T=i,R=t,_=u,O=r,z=S,G=h,j=n,F=s,N=o,k=d,P=!1;function I(B){return P||(P=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),A(B)||C(B)===c}function A(B){return C(B)===l}function V(B){return C(B)===a}function W(B){return C(B)===i}function H(B){return typeof B=="object"&&B!==null&&B.$$typeof===t}function L(B){return C(B)===u}function Y(B){return C(B)===r}function K(B){return C(B)===S}function $(B){return C(B)===h}function q(B){return C(B)===n}function X(B){return C(B)===s}function U(B){return C(B)===o}function ne(B){return C(B)===d}de.AsyncMode=y,de.ConcurrentMode=M,de.ContextConsumer=x,de.ContextProvider=T,de.Element=R,de.ForwardRef=_,de.Fragment=O,de.Lazy=z,de.Memo=G,de.Portal=j,de.Profiler=F,de.StrictMode=N,de.Suspense=k,de.isAsyncMode=I,de.isConcurrentMode=A,de.isContextConsumer=V,de.isContextProvider=W,de.isElement=H,de.isForwardRef=L,de.isFragment=Y,de.isLazy=K,de.isMemo=$,de.isPortal=q,de.isProfiler=X,de.isStrictMode=U,de.isSuspense=ne,de.isValidElementType=g,de.typeOf=C}()),de}var Ku;function pg(){return Ku||(Ku=1,process.env.NODE_ENV==="production"?lo.exports=FP():lo.exports=$P()),lo.exports}/*
163
+ */var Uu;function $P(){return Uu||(Uu=1,process.env.NODE_ENV!=="production"&&function(){var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,s=e?Symbol.for("react.profiler"):60114,i=e?Symbol.for("react.provider"):60109,a=e?Symbol.for("react.context"):60110,c=e?Symbol.for("react.async_mode"):60111,l=e?Symbol.for("react.concurrent_mode"):60111,u=e?Symbol.for("react.forward_ref"):60112,d=e?Symbol.for("react.suspense"):60113,h=e?Symbol.for("react.suspense_list"):60120,f=e?Symbol.for("react.memo"):60115,S=e?Symbol.for("react.lazy"):60116,m=e?Symbol.for("react.block"):60121,w=e?Symbol.for("react.fundamental"):60117,g=e?Symbol.for("react.responder"):60118,p=e?Symbol.for("react.scope"):60119;function v(B){return typeof B=="string"||typeof B=="function"||B===r||B===l||B===s||B===o||B===d||B===h||typeof B=="object"&&B!==null&&(B.$$typeof===S||B.$$typeof===f||B.$$typeof===i||B.$$typeof===a||B.$$typeof===u||B.$$typeof===w||B.$$typeof===g||B.$$typeof===p||B.$$typeof===m)}function C(B){if(typeof B=="object"&&B!==null){var ie=B.$$typeof;switch(ie){case t:var pe=B.type;switch(pe){case c:case l:case r:case s:case o:case d:return pe;default:var Oe=pe&&pe.$$typeof;switch(Oe){case a:case u:case S:case f:case i:return Oe;default:return ie}}case n:return ie}}}var y=c,M=l,b=a,T=i,R=t,_=u,O=r,z=S,G=f,j=n,F=s,N=o,k=d,P=!1;function I(B){return P||(P=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),A(B)||C(B)===c}function A(B){return C(B)===l}function V(B){return C(B)===a}function W(B){return C(B)===i}function H(B){return typeof B=="object"&&B!==null&&B.$$typeof===t}function L(B){return C(B)===u}function Y(B){return C(B)===r}function K(B){return C(B)===S}function $(B){return C(B)===f}function q(B){return C(B)===n}function X(B){return C(B)===s}function U(B){return C(B)===o}function ne(B){return C(B)===d}ue.AsyncMode=y,ue.ConcurrentMode=M,ue.ContextConsumer=b,ue.ContextProvider=T,ue.Element=R,ue.ForwardRef=_,ue.Fragment=O,ue.Lazy=z,ue.Memo=G,ue.Portal=j,ue.Profiler=F,ue.StrictMode=N,ue.Suspense=k,ue.isAsyncMode=I,ue.isConcurrentMode=A,ue.isContextConsumer=V,ue.isContextProvider=W,ue.isElement=H,ue.isForwardRef=L,ue.isFragment=Y,ue.isLazy=K,ue.isMemo=$,ue.isPortal=q,ue.isProfiler=X,ue.isStrictMode=U,ue.isSuspense=ne,ue.isValidElementType=v,ue.typeOf=C}()),ue}var Yu;function gg(){return Yu||(Yu=1,process.env.NODE_ENV==="production"?co.exports=FP():co.exports=$P()),co.exports}/*
164
164
  object-assign
165
165
  (c) Sindre Sorhus
166
166
  @license MIT
167
- */var ti,Gu;function BP(){if(Gu)return ti;Gu=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function r(s){if(s==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(s)}function o(){try{if(!Object.assign)return!1;var s=new String("abc");if(s[5]="de",Object.getOwnPropertyNames(s)[0]==="5")return!1;for(var i={},a=0;a<10;a++)i["_"+String.fromCharCode(a)]=a;var c=Object.getOwnPropertyNames(i).map(function(u){return i[u]});if(c.join("")!=="0123456789")return!1;var l={};return"abcdefghijklmnopqrst".split("").forEach(function(u){l[u]=u}),Object.keys(Object.assign({},l)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return ti=o()?Object.assign:function(s,i){for(var a,c=r(s),l,u=1;u<arguments.length;u++){a=Object(arguments[u]);for(var d in a)t.call(a,d)&&(c[d]=a[d]);if(e){l=e(a);for(var f=0;f<l.length;f++)n.call(a,l[f])&&(c[l[f]]=a[l[f]])}}return c},ti}var ni,qu;function Tc(){if(qu)return ni;qu=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return ni=e,ni}var ri,Xu;function mg(){return Xu||(Xu=1,ri=Function.call.bind(Object.prototype.hasOwnProperty)),ri}var oi,Zu;function zP(){if(Zu)return oi;Zu=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=Tc(),n={},r=mg();e=function(s){var i="Warning: "+s;typeof console<"u"&&console.error(i);try{throw new Error(i)}catch{}}}function o(s,i,a,c,l){if(process.env.NODE_ENV!=="production"){for(var u in s)if(r(s,u)){var d;try{if(typeof s[u]!="function"){var f=Error((c||"React class")+": "+a+" type `"+u+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof s[u]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw f.name="Invariant Violation",f}d=s[u](i,u,c,a,null,t)}catch(S){d=S}if(d&&!(d instanceof Error)&&e((c||"React class")+": type specification of "+a+" `"+u+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof d+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),d instanceof Error&&!(d.message in n)){n[d.message]=!0;var h=l?l():"";e("Failed "+a+" type: "+d.message+(h??""))}}}}return o.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},oi=o,oi}var si,Ju;function WP(){if(Ju)return si;Ju=1;var e=pg(),t=BP(),n=Tc(),r=mg(),o=zP(),s=function(){};process.env.NODE_ENV!=="production"&&(s=function(a){var c="Warning: "+a;typeof console<"u"&&console.error(c);try{throw new Error(c)}catch{}});function i(){return null}return si=function(a,c){var l=typeof Symbol=="function"&&Symbol.iterator,u="@@iterator";function d(A){var V=A&&(l&&A[l]||A[u]);if(typeof V=="function")return V}var f="<<anonymous>>",h={array:v("array"),bigint:v("bigint"),bool:v("boolean"),func:v("function"),number:v("number"),object:v("object"),string:v("string"),symbol:v("symbol"),any:m(),arrayOf:g,element:C(),elementType:y(),instanceOf:M,node:_(),objectOf:T,oneOf:x,oneOfType:R,shape:z,exact:G};function S(A,V){return A===V?A!==0||1/A===1/V:A!==A&&V!==V}function p(A,V){this.message=A,this.data=V&&typeof V=="object"?V:{},this.stack=""}p.prototype=Error.prototype;function b(A){if(process.env.NODE_ENV!=="production")var V={},W=0;function H(Y,K,$,q,X,U,ne){if(q=q||f,U=U||$,ne!==n){if(c){var B=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw B.name="Invariant Violation",B}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var ie=q+":"+$;!V[ie]&&W<3&&(s("You are manually calling a React.PropTypes validation function for the `"+U+"` prop on `"+q+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),V[ie]=!0,W++)}}return K[$]==null?Y?K[$]===null?new p("The "+X+" `"+U+"` is marked as required "+("in `"+q+"`, but its value is `null`.")):new p("The "+X+" `"+U+"` is marked as required in "+("`"+q+"`, but its value is `undefined`.")):null:A(K,$,q,X,U)}var L=H.bind(null,!1);return L.isRequired=H.bind(null,!0),L}function v(A){function V(W,H,L,Y,K,$){var q=W[H],X=N(q);if(X!==A){var U=k(q);return new p("Invalid "+Y+" `"+K+"` of type "+("`"+U+"` supplied to `"+L+"`, expected ")+("`"+A+"`."),{expectedType:A})}return null}return b(V)}function m(){return b(i)}function g(A){function V(W,H,L,Y,K){if(typeof A!="function")return new p("Property `"+K+"` of component `"+L+"` has invalid PropType notation inside arrayOf.");var $=W[H];if(!Array.isArray($)){var q=N($);return new p("Invalid "+Y+" `"+K+"` of type "+("`"+q+"` supplied to `"+L+"`, expected an array."))}for(var X=0;X<$.length;X++){var U=A($,X,L,Y,K+"["+X+"]",n);if(U instanceof Error)return U}return null}return b(V)}function C(){function A(V,W,H,L,Y){var K=V[W];if(!a(K)){var $=N(K);return new p("Invalid "+L+" `"+Y+"` of type "+("`"+$+"` supplied to `"+H+"`, expected a single ReactElement."))}return null}return b(A)}function y(){function A(V,W,H,L,Y){var K=V[W];if(!e.isValidElementType(K)){var $=N(K);return new p("Invalid "+L+" `"+Y+"` of type "+("`"+$+"` supplied to `"+H+"`, expected a single ReactElement type."))}return null}return b(A)}function M(A){function V(W,H,L,Y,K){if(!(W[H]instanceof A)){var $=A.name||f,q=I(W[H]);return new p("Invalid "+Y+" `"+K+"` of type "+("`"+q+"` supplied to `"+L+"`, expected ")+("instance of `"+$+"`."))}return null}return b(V)}function x(A){if(!Array.isArray(A))return process.env.NODE_ENV!=="production"&&(arguments.length>1?s("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):s("Invalid argument supplied to oneOf, expected an array.")),i;function V(W,H,L,Y,K){for(var $=W[H],q=0;q<A.length;q++)if(S($,A[q]))return null;var X=JSON.stringify(A,function(ne,B){var ie=k(B);return ie==="symbol"?String(B):B});return new p("Invalid "+Y+" `"+K+"` of value `"+String($)+"` "+("supplied to `"+L+"`, expected one of "+X+"."))}return b(V)}function T(A){function V(W,H,L,Y,K){if(typeof A!="function")return new p("Property `"+K+"` of component `"+L+"` has invalid PropType notation inside objectOf.");var $=W[H],q=N($);if(q!=="object")return new p("Invalid "+Y+" `"+K+"` of type "+("`"+q+"` supplied to `"+L+"`, expected an object."));for(var X in $)if(r($,X)){var U=A($,X,L,Y,K+"."+X,n);if(U instanceof Error)return U}return null}return b(V)}function R(A){if(!Array.isArray(A))return process.env.NODE_ENV!=="production"&&s("Invalid argument supplied to oneOfType, expected an instance of array."),i;for(var V=0;V<A.length;V++){var W=A[V];if(typeof W!="function")return s("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+P(W)+" at index "+V+"."),i}function H(L,Y,K,$,q){for(var X=[],U=0;U<A.length;U++){var ne=A[U],B=ne(L,Y,K,$,q,n);if(B==null)return null;B.data&&r(B.data,"expectedType")&&X.push(B.data.expectedType)}var ie=X.length>0?", expected one of type ["+X.join(", ")+"]":"";return new p("Invalid "+$+" `"+q+"` supplied to "+("`"+K+"`"+ie+"."))}return b(H)}function _(){function A(V,W,H,L,Y){return j(V[W])?null:new p("Invalid "+L+" `"+Y+"` supplied to "+("`"+H+"`, expected a ReactNode."))}return b(A)}function O(A,V,W,H,L){return new p((A||"React class")+": "+V+" type `"+W+"."+H+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+L+"`.")}function z(A){function V(W,H,L,Y,K){var $=W[H],q=N($);if(q!=="object")return new p("Invalid "+Y+" `"+K+"` of type `"+q+"` "+("supplied to `"+L+"`, expected `object`."));for(var X in A){var U=A[X];if(typeof U!="function")return O(L,Y,K,X,k(U));var ne=U($,X,L,Y,K+"."+X,n);if(ne)return ne}return null}return b(V)}function G(A){function V(W,H,L,Y,K){var $=W[H],q=N($);if(q!=="object")return new p("Invalid "+Y+" `"+K+"` of type `"+q+"` "+("supplied to `"+L+"`, expected `object`."));var X=t({},W[H],A);for(var U in X){var ne=A[U];if(r(A,U)&&typeof ne!="function")return O(L,Y,K,U,k(ne));if(!ne)return new p("Invalid "+Y+" `"+K+"` key `"+U+"` supplied to `"+L+"`.\nBad object: "+JSON.stringify(W[H],null," ")+`
168
- Valid keys: `+JSON.stringify(Object.keys(A),null," "));var B=ne($,U,L,Y,K+"."+U,n);if(B)return B}return null}return b(V)}function j(A){switch(typeof A){case"number":case"string":case"undefined":return!0;case"boolean":return!A;case"object":if(Array.isArray(A))return A.every(j);if(A===null||a(A))return!0;var V=d(A);if(V){var W=V.call(A),H;if(V!==A.entries){for(;!(H=W.next()).done;)if(!j(H.value))return!1}else for(;!(H=W.next()).done;){var L=H.value;if(L&&!j(L[1]))return!1}}else return!1;return!0;default:return!1}}function F(A,V){return A==="symbol"?!0:V?V["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&V instanceof Symbol:!1}function N(A){var V=typeof A;return Array.isArray(A)?"array":A instanceof RegExp?"object":F(V,A)?"symbol":V}function k(A){if(typeof A>"u"||A===null)return""+A;var V=N(A);if(V==="object"){if(A instanceof Date)return"date";if(A instanceof RegExp)return"regexp"}return V}function P(A){var V=k(A);switch(V){case"array":case"object":return"an "+V;case"boolean":case"date":case"regexp":return"a "+V;default:return V}}function I(A){return!A.constructor||!A.constructor.name?f:A.constructor.name}return h.checkPropTypes=o,h.resetWarningCache=o.resetWarningCache,h.PropTypes=h,h},si}var ii,Qu;function HP(){if(Qu)return ii;Qu=1;var e=Tc();function t(){}function n(){}return n.resetWarningCache=t,ii=function(){function r(i,a,c,l,u,d){if(d!==e){var f=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw f.name="Invariant Violation",f}}r.isRequired=r;function o(){return r}var s={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:o,element:r,elementType:r,instanceOf:o,node:r,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:n,resetWarningCache:t};return s.PropTypes=s,s},ii}var ed;function bs(){if(ed)return co.exports;if(ed=1,process.env.NODE_ENV!=="production"){var e=pg(),t=!0;co.exports=WP()(e.isElement,t)}else co.exports=HP()();return co.exports}function gg(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=gg(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function td(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=gg(e))&&(r&&(r+=" "),r+=t);return r}const UP=Object.freeze(Object.defineProperty({__proto__:null,clsx:td,default:td},Symbol.toStringTag,{value:"Module"})),YP=Yg(UP);var be={},Ot={},nd;function xs(){if(nd)return Ot;nd=1,Object.defineProperty(Ot,"__esModule",{value:!0}),Ot.dontSetMe=o,Ot.findInArray=e,Ot.int=r,Ot.isFunction=t,Ot.isNum=n;function e(s,i){for(let a=0,c=s.length;a<c;a++)if(i.apply(i,[s[a],a,s]))return s[a]}function t(s){return typeof s=="function"||Object.prototype.toString.call(s)==="[object Function]"}function n(s){return typeof s=="number"&&!isNaN(s)}function r(s){return parseInt(s,10)}function o(s,i,a){if(s[i])return new Error("Invalid prop ".concat(i," passed to ").concat(a," - do not set this, set it on the child."))}return Ot}var kt={},rd;function KP(){if(rd)return kt;rd=1,Object.defineProperty(kt,"__esModule",{value:!0}),kt.browserPrefixToKey=n,kt.browserPrefixToStyle=r,kt.default=void 0,kt.getPrefix=t;const e=["Moz","Webkit","O","ms"];function t(){var s;let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"transform";if(typeof window>"u")return"";const a=(s=window.document)===null||s===void 0||(s=s.documentElement)===null||s===void 0?void 0:s.style;if(!a||i in a)return"";for(let c=0;c<e.length;c++)if(n(i,e[c])in a)return e[c];return""}function n(s,i){return i?"".concat(i).concat(o(s)):s}function r(s,i){return i?"-".concat(i.toLowerCase(),"-").concat(s):s}function o(s){let i="",a=!0;for(let c=0;c<s.length;c++)a?(i+=s[c].toUpperCase(),a=!1):s[c]==="-"?a=!0:i+=s[c];return i}return kt.default=t(),kt}var od;function Dc(){if(od)return be;od=1,Object.defineProperty(be,"__esModule",{value:!0}),be.addClassName=y,be.addEvent=a,be.addUserSelectStyles=g,be.createCSSTransform=S,be.createSVGTransform=p,be.getTouch=v,be.getTouchIdentifier=m,be.getTranslation=b,be.innerHeight=d,be.innerWidth=f,be.matchesSelector=s,be.matchesSelectorAndParentsTo=i,be.offsetXYFromParent=h,be.outerHeight=l,be.outerWidth=u,be.removeClassName=M,be.removeEvent=c,be.removeUserSelectStyles=C;var e=xs(),t=r(KP());function n(x){if(typeof WeakMap!="function")return null;var T=new WeakMap,R=new WeakMap;return(n=function(_){return _?R:T})(x)}function r(x,T){if(x&&x.__esModule)return x;if(x===null||typeof x!="object"&&typeof x!="function")return{default:x};var R=n(T);if(R&&R.has(x))return R.get(x);var _={},O=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var z in x)if(z!=="default"&&Object.prototype.hasOwnProperty.call(x,z)){var G=O?Object.getOwnPropertyDescriptor(x,z):null;G&&(G.get||G.set)?Object.defineProperty(_,z,G):_[z]=x[z]}return _.default=x,R&&R.set(x,_),_}let o="";function s(x,T){return o||(o=(0,e.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(R){return(0,e.isFunction)(x[R])})),(0,e.isFunction)(x[o])?x[o](T):!1}function i(x,T,R){let _=x;do{if(s(_,T))return!0;if(_===R)return!1;_=_.parentNode}while(_);return!1}function a(x,T,R,_){if(!x)return;const O={capture:!0,..._};x.addEventListener?x.addEventListener(T,R,O):x.attachEvent?x.attachEvent("on"+T,R):x["on"+T]=R}function c(x,T,R,_){if(!x)return;const O={capture:!0,..._};x.removeEventListener?x.removeEventListener(T,R,O):x.detachEvent?x.detachEvent("on"+T,R):x["on"+T]=null}function l(x){let T=x.clientHeight;const R=x.ownerDocument.defaultView.getComputedStyle(x);return T+=(0,e.int)(R.borderTopWidth),T+=(0,e.int)(R.borderBottomWidth),T}function u(x){let T=x.clientWidth;const R=x.ownerDocument.defaultView.getComputedStyle(x);return T+=(0,e.int)(R.borderLeftWidth),T+=(0,e.int)(R.borderRightWidth),T}function d(x){let T=x.clientHeight;const R=x.ownerDocument.defaultView.getComputedStyle(x);return T-=(0,e.int)(R.paddingTop),T-=(0,e.int)(R.paddingBottom),T}function f(x){let T=x.clientWidth;const R=x.ownerDocument.defaultView.getComputedStyle(x);return T-=(0,e.int)(R.paddingLeft),T-=(0,e.int)(R.paddingRight),T}function h(x,T,R){const O=T===T.ownerDocument.body?{left:0,top:0}:T.getBoundingClientRect(),z=(x.clientX+T.scrollLeft-O.left)/R,G=(x.clientY+T.scrollTop-O.top)/R;return{x:z,y:G}}function S(x,T){const R=b(x,T,"px");return{[(0,t.browserPrefixToKey)("transform",t.default)]:R}}function p(x,T){return b(x,T,"")}function b(x,T,R){let{x:_,y:O}=x,z="translate(".concat(_).concat(R,",").concat(O).concat(R,")");if(T){const G="".concat(typeof T.x=="string"?T.x:T.x+R),j="".concat(typeof T.y=="string"?T.y:T.y+R);z="translate(".concat(G,", ").concat(j,")")+z}return z}function v(x,T){return x.targetTouches&&(0,e.findInArray)(x.targetTouches,R=>T===R.identifier)||x.changedTouches&&(0,e.findInArray)(x.changedTouches,R=>T===R.identifier)}function m(x){if(x.targetTouches&&x.targetTouches[0])return x.targetTouches[0].identifier;if(x.changedTouches&&x.changedTouches[0])return x.changedTouches[0].identifier}function g(x){if(!x)return;let T=x.getElementById("react-draggable-style-el");T||(T=x.createElement("style"),T.type="text/css",T.id="react-draggable-style-el",T.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
167
+ */var ti,Ku;function BP(){if(Ku)return ti;Ku=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function r(s){if(s==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(s)}function o(){try{if(!Object.assign)return!1;var s=new String("abc");if(s[5]="de",Object.getOwnPropertyNames(s)[0]==="5")return!1;for(var i={},a=0;a<10;a++)i["_"+String.fromCharCode(a)]=a;var c=Object.getOwnPropertyNames(i).map(function(u){return i[u]});if(c.join("")!=="0123456789")return!1;var l={};return"abcdefghijklmnopqrst".split("").forEach(function(u){l[u]=u}),Object.keys(Object.assign({},l)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return ti=o()?Object.assign:function(s,i){for(var a,c=r(s),l,u=1;u<arguments.length;u++){a=Object(arguments[u]);for(var d in a)t.call(a,d)&&(c[d]=a[d]);if(e){l=e(a);for(var h=0;h<l.length;h++)n.call(a,l[h])&&(c[l[h]]=a[l[h]])}}return c},ti}var ni,Gu;function Tc(){if(Gu)return ni;Gu=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return ni=e,ni}var ri,qu;function vg(){return qu||(qu=1,ri=Function.call.bind(Object.prototype.hasOwnProperty)),ri}var oi,Xu;function zP(){if(Xu)return oi;Xu=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=Tc(),n={},r=vg();e=function(s){var i="Warning: "+s;typeof console<"u"&&console.error(i);try{throw new Error(i)}catch{}}}function o(s,i,a,c,l){if(process.env.NODE_ENV!=="production"){for(var u in s)if(r(s,u)){var d;try{if(typeof s[u]!="function"){var h=Error((c||"React class")+": "+a+" type `"+u+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof s[u]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw h.name="Invariant Violation",h}d=s[u](i,u,c,a,null,t)}catch(S){d=S}if(d&&!(d instanceof Error)&&e((c||"React class")+": type specification of "+a+" `"+u+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof d+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),d instanceof Error&&!(d.message in n)){n[d.message]=!0;var f=l?l():"";e("Failed "+a+" type: "+d.message+(f??""))}}}}return o.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},oi=o,oi}var si,Zu;function WP(){if(Zu)return si;Zu=1;var e=gg(),t=BP(),n=Tc(),r=vg(),o=zP(),s=function(){};process.env.NODE_ENV!=="production"&&(s=function(a){var c="Warning: "+a;typeof console<"u"&&console.error(c);try{throw new Error(c)}catch{}});function i(){return null}return si=function(a,c){var l=typeof Symbol=="function"&&Symbol.iterator,u="@@iterator";function d(A){var V=A&&(l&&A[l]||A[u]);if(typeof V=="function")return V}var h="<<anonymous>>",f={array:g("array"),bigint:g("bigint"),bool:g("boolean"),func:g("function"),number:g("number"),object:g("object"),string:g("string"),symbol:g("symbol"),any:p(),arrayOf:v,element:C(),elementType:y(),instanceOf:M,node:_(),objectOf:T,oneOf:b,oneOfType:R,shape:z,exact:G};function S(A,V){return A===V?A!==0||1/A===1/V:A!==A&&V!==V}function m(A,V){this.message=A,this.data=V&&typeof V=="object"?V:{},this.stack=""}m.prototype=Error.prototype;function w(A){if(process.env.NODE_ENV!=="production")var V={},W=0;function H(Y,K,$,q,X,U,ne){if(q=q||h,U=U||$,ne!==n){if(c){var B=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw B.name="Invariant Violation",B}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var ie=q+":"+$;!V[ie]&&W<3&&(s("You are manually calling a React.PropTypes validation function for the `"+U+"` prop on `"+q+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),V[ie]=!0,W++)}}return K[$]==null?Y?K[$]===null?new m("The "+X+" `"+U+"` is marked as required "+("in `"+q+"`, but its value is `null`.")):new m("The "+X+" `"+U+"` is marked as required in "+("`"+q+"`, but its value is `undefined`.")):null:A(K,$,q,X,U)}var L=H.bind(null,!1);return L.isRequired=H.bind(null,!0),L}function g(A){function V(W,H,L,Y,K,$){var q=W[H],X=N(q);if(X!==A){var U=k(q);return new m("Invalid "+Y+" `"+K+"` of type "+("`"+U+"` supplied to `"+L+"`, expected ")+("`"+A+"`."),{expectedType:A})}return null}return w(V)}function p(){return w(i)}function v(A){function V(W,H,L,Y,K){if(typeof A!="function")return new m("Property `"+K+"` of component `"+L+"` has invalid PropType notation inside arrayOf.");var $=W[H];if(!Array.isArray($)){var q=N($);return new m("Invalid "+Y+" `"+K+"` of type "+("`"+q+"` supplied to `"+L+"`, expected an array."))}for(var X=0;X<$.length;X++){var U=A($,X,L,Y,K+"["+X+"]",n);if(U instanceof Error)return U}return null}return w(V)}function C(){function A(V,W,H,L,Y){var K=V[W];if(!a(K)){var $=N(K);return new m("Invalid "+L+" `"+Y+"` of type "+("`"+$+"` supplied to `"+H+"`, expected a single ReactElement."))}return null}return w(A)}function y(){function A(V,W,H,L,Y){var K=V[W];if(!e.isValidElementType(K)){var $=N(K);return new m("Invalid "+L+" `"+Y+"` of type "+("`"+$+"` supplied to `"+H+"`, expected a single ReactElement type."))}return null}return w(A)}function M(A){function V(W,H,L,Y,K){if(!(W[H]instanceof A)){var $=A.name||h,q=I(W[H]);return new m("Invalid "+Y+" `"+K+"` of type "+("`"+q+"` supplied to `"+L+"`, expected ")+("instance of `"+$+"`."))}return null}return w(V)}function b(A){if(!Array.isArray(A))return process.env.NODE_ENV!=="production"&&(arguments.length>1?s("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):s("Invalid argument supplied to oneOf, expected an array.")),i;function V(W,H,L,Y,K){for(var $=W[H],q=0;q<A.length;q++)if(S($,A[q]))return null;var X=JSON.stringify(A,function(ne,B){var ie=k(B);return ie==="symbol"?String(B):B});return new m("Invalid "+Y+" `"+K+"` of value `"+String($)+"` "+("supplied to `"+L+"`, expected one of "+X+"."))}return w(V)}function T(A){function V(W,H,L,Y,K){if(typeof A!="function")return new m("Property `"+K+"` of component `"+L+"` has invalid PropType notation inside objectOf.");var $=W[H],q=N($);if(q!=="object")return new m("Invalid "+Y+" `"+K+"` of type "+("`"+q+"` supplied to `"+L+"`, expected an object."));for(var X in $)if(r($,X)){var U=A($,X,L,Y,K+"."+X,n);if(U instanceof Error)return U}return null}return w(V)}function R(A){if(!Array.isArray(A))return process.env.NODE_ENV!=="production"&&s("Invalid argument supplied to oneOfType, expected an instance of array."),i;for(var V=0;V<A.length;V++){var W=A[V];if(typeof W!="function")return s("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+P(W)+" at index "+V+"."),i}function H(L,Y,K,$,q){for(var X=[],U=0;U<A.length;U++){var ne=A[U],B=ne(L,Y,K,$,q,n);if(B==null)return null;B.data&&r(B.data,"expectedType")&&X.push(B.data.expectedType)}var ie=X.length>0?", expected one of type ["+X.join(", ")+"]":"";return new m("Invalid "+$+" `"+q+"` supplied to "+("`"+K+"`"+ie+"."))}return w(H)}function _(){function A(V,W,H,L,Y){return j(V[W])?null:new m("Invalid "+L+" `"+Y+"` supplied to "+("`"+H+"`, expected a ReactNode."))}return w(A)}function O(A,V,W,H,L){return new m((A||"React class")+": "+V+" type `"+W+"."+H+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+L+"`.")}function z(A){function V(W,H,L,Y,K){var $=W[H],q=N($);if(q!=="object")return new m("Invalid "+Y+" `"+K+"` of type `"+q+"` "+("supplied to `"+L+"`, expected `object`."));for(var X in A){var U=A[X];if(typeof U!="function")return O(L,Y,K,X,k(U));var ne=U($,X,L,Y,K+"."+X,n);if(ne)return ne}return null}return w(V)}function G(A){function V(W,H,L,Y,K){var $=W[H],q=N($);if(q!=="object")return new m("Invalid "+Y+" `"+K+"` of type `"+q+"` "+("supplied to `"+L+"`, expected `object`."));var X=t({},W[H],A);for(var U in X){var ne=A[U];if(r(A,U)&&typeof ne!="function")return O(L,Y,K,U,k(ne));if(!ne)return new m("Invalid "+Y+" `"+K+"` key `"+U+"` supplied to `"+L+"`.\nBad object: "+JSON.stringify(W[H],null," ")+`
168
+ Valid keys: `+JSON.stringify(Object.keys(A),null," "));var B=ne($,U,L,Y,K+"."+U,n);if(B)return B}return null}return w(V)}function j(A){switch(typeof A){case"number":case"string":case"undefined":return!0;case"boolean":return!A;case"object":if(Array.isArray(A))return A.every(j);if(A===null||a(A))return!0;var V=d(A);if(V){var W=V.call(A),H;if(V!==A.entries){for(;!(H=W.next()).done;)if(!j(H.value))return!1}else for(;!(H=W.next()).done;){var L=H.value;if(L&&!j(L[1]))return!1}}else return!1;return!0;default:return!1}}function F(A,V){return A==="symbol"?!0:V?V["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&V instanceof Symbol:!1}function N(A){var V=typeof A;return Array.isArray(A)?"array":A instanceof RegExp?"object":F(V,A)?"symbol":V}function k(A){if(typeof A>"u"||A===null)return""+A;var V=N(A);if(V==="object"){if(A instanceof Date)return"date";if(A instanceof RegExp)return"regexp"}return V}function P(A){var V=k(A);switch(V){case"array":case"object":return"an "+V;case"boolean":case"date":case"regexp":return"a "+V;default:return V}}function I(A){return!A.constructor||!A.constructor.name?h:A.constructor.name}return f.checkPropTypes=o,f.resetWarningCache=o.resetWarningCache,f.PropTypes=f,f},si}var ii,Ju;function HP(){if(Ju)return ii;Ju=1;var e=Tc();function t(){}function n(){}return n.resetWarningCache=t,ii=function(){function r(i,a,c,l,u,d){if(d!==e){var h=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw h.name="Invariant Violation",h}}r.isRequired=r;function o(){return r}var s={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:o,element:r,elementType:r,instanceOf:o,node:r,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:n,resetWarningCache:t};return s.PropTypes=s,s},ii}var Qu;function bs(){if(Qu)return ao.exports;if(Qu=1,process.env.NODE_ENV!=="production"){var e=gg(),t=!0;ao.exports=WP()(e.isElement,t)}else ao.exports=HP()();return ao.exports}function yg(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=yg(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function ed(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=yg(e))&&(r&&(r+=" "),r+=t);return r}const UP=Object.freeze(Object.defineProperty({__proto__:null,clsx:ed,default:ed},Symbol.toStringTag,{value:"Module"})),YP=Jg(UP);var be={},Ot={},td;function xs(){if(td)return Ot;td=1,Object.defineProperty(Ot,"__esModule",{value:!0}),Ot.dontSetMe=o,Ot.findInArray=e,Ot.int=r,Ot.isFunction=t,Ot.isNum=n;function e(s,i){for(let a=0,c=s.length;a<c;a++)if(i.apply(i,[s[a],a,s]))return s[a]}function t(s){return typeof s=="function"||Object.prototype.toString.call(s)==="[object Function]"}function n(s){return typeof s=="number"&&!isNaN(s)}function r(s){return parseInt(s,10)}function o(s,i,a){if(s[i])return new Error("Invalid prop ".concat(i," passed to ").concat(a," - do not set this, set it on the child."))}return Ot}var kt={},nd;function KP(){if(nd)return kt;nd=1,Object.defineProperty(kt,"__esModule",{value:!0}),kt.browserPrefixToKey=n,kt.browserPrefixToStyle=r,kt.default=void 0,kt.getPrefix=t;const e=["Moz","Webkit","O","ms"];function t(){var s;let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"transform";if(typeof window>"u")return"";const a=(s=window.document)===null||s===void 0||(s=s.documentElement)===null||s===void 0?void 0:s.style;if(!a||i in a)return"";for(let c=0;c<e.length;c++)if(n(i,e[c])in a)return e[c];return""}function n(s,i){return i?"".concat(i).concat(o(s)):s}function r(s,i){return i?"-".concat(i.toLowerCase(),"-").concat(s):s}function o(s){let i="",a=!0;for(let c=0;c<s.length;c++)a?(i+=s[c].toUpperCase(),a=!1):s[c]==="-"?a=!0:i+=s[c];return i}return kt.default=t(),kt}var rd;function Dc(){if(rd)return be;rd=1,Object.defineProperty(be,"__esModule",{value:!0}),be.addClassName=y,be.addEvent=a,be.addUserSelectStyles=v,be.createCSSTransform=S,be.createSVGTransform=m,be.getTouch=g,be.getTouchIdentifier=p,be.getTranslation=w,be.innerHeight=d,be.innerWidth=h,be.matchesSelector=s,be.matchesSelectorAndParentsTo=i,be.offsetXYFromParent=f,be.outerHeight=l,be.outerWidth=u,be.removeClassName=M,be.removeEvent=c,be.removeUserSelectStyles=C;var e=xs(),t=r(KP());function n(b){if(typeof WeakMap!="function")return null;var T=new WeakMap,R=new WeakMap;return(n=function(_){return _?R:T})(b)}function r(b,T){if(b&&b.__esModule)return b;if(b===null||typeof b!="object"&&typeof b!="function")return{default:b};var R=n(T);if(R&&R.has(b))return R.get(b);var _={},O=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var z in b)if(z!=="default"&&Object.prototype.hasOwnProperty.call(b,z)){var G=O?Object.getOwnPropertyDescriptor(b,z):null;G&&(G.get||G.set)?Object.defineProperty(_,z,G):_[z]=b[z]}return _.default=b,R&&R.set(b,_),_}let o="";function s(b,T){return o||(o=(0,e.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(R){return(0,e.isFunction)(b[R])})),(0,e.isFunction)(b[o])?b[o](T):!1}function i(b,T,R){let _=b;do{if(s(_,T))return!0;if(_===R)return!1;_=_.parentNode}while(_);return!1}function a(b,T,R,_){if(!b)return;const O={capture:!0,..._};b.addEventListener?b.addEventListener(T,R,O):b.attachEvent?b.attachEvent("on"+T,R):b["on"+T]=R}function c(b,T,R,_){if(!b)return;const O={capture:!0,..._};b.removeEventListener?b.removeEventListener(T,R,O):b.detachEvent?b.detachEvent("on"+T,R):b["on"+T]=null}function l(b){let T=b.clientHeight;const R=b.ownerDocument.defaultView.getComputedStyle(b);return T+=(0,e.int)(R.borderTopWidth),T+=(0,e.int)(R.borderBottomWidth),T}function u(b){let T=b.clientWidth;const R=b.ownerDocument.defaultView.getComputedStyle(b);return T+=(0,e.int)(R.borderLeftWidth),T+=(0,e.int)(R.borderRightWidth),T}function d(b){let T=b.clientHeight;const R=b.ownerDocument.defaultView.getComputedStyle(b);return T-=(0,e.int)(R.paddingTop),T-=(0,e.int)(R.paddingBottom),T}function h(b){let T=b.clientWidth;const R=b.ownerDocument.defaultView.getComputedStyle(b);return T-=(0,e.int)(R.paddingLeft),T-=(0,e.int)(R.paddingRight),T}function f(b,T,R){const O=T===T.ownerDocument.body?{left:0,top:0}:T.getBoundingClientRect(),z=(b.clientX+T.scrollLeft-O.left)/R,G=(b.clientY+T.scrollTop-O.top)/R;return{x:z,y:G}}function S(b,T){const R=w(b,T,"px");return{[(0,t.browserPrefixToKey)("transform",t.default)]:R}}function m(b,T){return w(b,T,"")}function w(b,T,R){let{x:_,y:O}=b,z="translate(".concat(_).concat(R,",").concat(O).concat(R,")");if(T){const G="".concat(typeof T.x=="string"?T.x:T.x+R),j="".concat(typeof T.y=="string"?T.y:T.y+R);z="translate(".concat(G,", ").concat(j,")")+z}return z}function g(b,T){return b.targetTouches&&(0,e.findInArray)(b.targetTouches,R=>T===R.identifier)||b.changedTouches&&(0,e.findInArray)(b.changedTouches,R=>T===R.identifier)}function p(b){if(b.targetTouches&&b.targetTouches[0])return b.targetTouches[0].identifier;if(b.changedTouches&&b.changedTouches[0])return b.changedTouches[0].identifier}function v(b){if(!b)return;let T=b.getElementById("react-draggable-style-el");T||(T=b.createElement("style"),T.type="text/css",T.id="react-draggable-style-el",T.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
169
169
  `,T.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;}
170
- `,x.getElementsByTagName("head")[0].appendChild(T)),x.body&&y(x.body,"react-draggable-transparent-selection")}function C(x){if(x)try{if(x.body&&M(x.body,"react-draggable-transparent-selection"),x.selection)x.selection.empty();else{const T=(x.defaultView||window).getSelection();T&&T.type!=="Caret"&&T.removeAllRanges()}}catch{}}function y(x,T){x.classList?x.classList.add(T):x.className.match(new RegExp("(?:^|\\s)".concat(T,"(?!\\S)")))||(x.className+=" ".concat(T))}function M(x,T){x.classList?x.classList.remove(T):x.className=x.className.replace(new RegExp("(?:^|\\s)".concat(T,"(?!\\S)"),"g"),"")}return be}var at={},sd;function vg(){if(sd)return at;sd=1,Object.defineProperty(at,"__esModule",{value:!0}),at.canDragX=o,at.canDragY=s,at.createCoreData=a,at.createDraggableData=c,at.getBoundPosition=n,at.getControlPosition=i,at.snapToGrid=r;var e=xs(),t=Dc();function n(d,f,h){if(!d.props.bounds)return[f,h];let{bounds:S}=d.props;S=typeof S=="string"?S:l(S);const p=u(d);if(typeof S=="string"){const{ownerDocument:b}=p,v=b.defaultView;let m;if(S==="parent"?m=p.parentNode:m=b.querySelector(S),!(m instanceof v.HTMLElement))throw new Error('Bounds selector "'+S+'" could not find an element.');const g=m,C=v.getComputedStyle(p),y=v.getComputedStyle(g);S={left:-p.offsetLeft+(0,e.int)(y.paddingLeft)+(0,e.int)(C.marginLeft),top:-p.offsetTop+(0,e.int)(y.paddingTop)+(0,e.int)(C.marginTop),right:(0,t.innerWidth)(g)-(0,t.outerWidth)(p)-p.offsetLeft+(0,e.int)(y.paddingRight)-(0,e.int)(C.marginRight),bottom:(0,t.innerHeight)(g)-(0,t.outerHeight)(p)-p.offsetTop+(0,e.int)(y.paddingBottom)-(0,e.int)(C.marginBottom)}}return(0,e.isNum)(S.right)&&(f=Math.min(f,S.right)),(0,e.isNum)(S.bottom)&&(h=Math.min(h,S.bottom)),(0,e.isNum)(S.left)&&(f=Math.max(f,S.left)),(0,e.isNum)(S.top)&&(h=Math.max(h,S.top)),[f,h]}function r(d,f,h){const S=Math.round(f/d[0])*d[0],p=Math.round(h/d[1])*d[1];return[S,p]}function o(d){return d.props.axis==="both"||d.props.axis==="x"}function s(d){return d.props.axis==="both"||d.props.axis==="y"}function i(d,f,h){const S=typeof f=="number"?(0,t.getTouch)(d,f):null;if(typeof f=="number"&&!S)return null;const p=u(h),b=h.props.offsetParent||p.offsetParent||p.ownerDocument.body;return(0,t.offsetXYFromParent)(S||d,b,h.props.scale)}function a(d,f,h){const S=!(0,e.isNum)(d.lastX),p=u(d);return S?{node:p,deltaX:0,deltaY:0,lastX:f,lastY:h,x:f,y:h}:{node:p,deltaX:f-d.lastX,deltaY:h-d.lastY,lastX:d.lastX,lastY:d.lastY,x:f,y:h}}function c(d,f){const h=d.props.scale;return{node:f.node,x:d.state.x+f.deltaX/h,y:d.state.y+f.deltaY/h,deltaX:f.deltaX/h,deltaY:f.deltaY/h,lastX:d.state.x,lastY:d.state.y}}function l(d){return{left:d.left,top:d.top,right:d.right,bottom:d.bottom}}function u(d){const f=d.findDOMNode();if(!f)throw new Error("<DraggableCore>: Unmounted during event!");return f}return at}var rr={},uo={},id;function yg(){if(id)return uo;id=1,Object.defineProperty(uo,"__esModule",{value:!0}),uo.default=e;function e(){}return uo}var ad;function GP(){if(ad)return rr;ad=1,Object.defineProperty(rr,"__esModule",{value:!0}),rr.default=void 0;var e=l(E),t=a(bs()),n=a(vt),r=Dc(),o=vg(),s=xs(),i=a(yg());function a(b){return b&&b.__esModule?b:{default:b}}function c(b){if(typeof WeakMap!="function")return null;var v=new WeakMap,m=new WeakMap;return(c=function(g){return g?m:v})(b)}function l(b,v){if(b&&b.__esModule)return b;if(b===null||typeof b!="object"&&typeof b!="function")return{default:b};var m=c(v);if(m&&m.has(b))return m.get(b);var g={},C=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var y in b)if(y!=="default"&&Object.prototype.hasOwnProperty.call(b,y)){var M=C?Object.getOwnPropertyDescriptor(b,y):null;M&&(M.get||M.set)?Object.defineProperty(g,y,M):g[y]=b[y]}return g.default=b,m&&m.set(b,g),g}function u(b,v,m){return v=d(v),v in b?Object.defineProperty(b,v,{value:m,enumerable:!0,configurable:!0,writable:!0}):b[v]=m,b}function d(b){var v=f(b,"string");return typeof v=="symbol"?v:String(v)}function f(b,v){if(typeof b!="object"||b===null)return b;var m=b[Symbol.toPrimitive];if(m!==void 0){var g=m.call(b,v);if(typeof g!="object")return g;throw new TypeError("@@toPrimitive must return a primitive value.")}return(v==="string"?String:Number)(b)}const h={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let S=h.mouse,p=class extends e.Component{constructor(){super(...arguments),u(this,"dragging",!1),u(this,"lastX",NaN),u(this,"lastY",NaN),u(this,"touchIdentifier",null),u(this,"mounted",!1),u(this,"handleDragStart",v=>{if(this.props.onMouseDown(v),!this.props.allowAnyClick&&typeof v.button=="number"&&v.button!==0)return!1;const m=this.findDOMNode();if(!m||!m.ownerDocument||!m.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:g}=m;if(this.props.disabled||!(v.target instanceof g.defaultView.Node)||this.props.handle&&!(0,r.matchesSelectorAndParentsTo)(v.target,this.props.handle,m)||this.props.cancel&&(0,r.matchesSelectorAndParentsTo)(v.target,this.props.cancel,m))return;v.type==="touchstart"&&v.preventDefault();const C=(0,r.getTouchIdentifier)(v);this.touchIdentifier=C;const y=(0,o.getControlPosition)(v,C,this);if(y==null)return;const{x:M,y:x}=y,T=(0,o.createCoreData)(this,M,x);(0,i.default)("DraggableCore: handleDragStart: %j",T),(0,i.default)("calling",this.props.onStart),!(this.props.onStart(v,T)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&(0,r.addUserSelectStyles)(g),this.dragging=!0,this.lastX=M,this.lastY=x,(0,r.addEvent)(g,S.move,this.handleDrag),(0,r.addEvent)(g,S.stop,this.handleDragStop))}),u(this,"handleDrag",v=>{const m=(0,o.getControlPosition)(v,this.touchIdentifier,this);if(m==null)return;let{x:g,y:C}=m;if(Array.isArray(this.props.grid)){let x=g-this.lastX,T=C-this.lastY;if([x,T]=(0,o.snapToGrid)(this.props.grid,x,T),!x&&!T)return;g=this.lastX+x,C=this.lastY+T}const y=(0,o.createCoreData)(this,g,C);if((0,i.default)("DraggableCore: handleDrag: %j",y),this.props.onDrag(v,y)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const T=document.createEvent("MouseEvents");T.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(T)}return}this.lastX=g,this.lastY=C}),u(this,"handleDragStop",v=>{if(!this.dragging)return;const m=(0,o.getControlPosition)(v,this.touchIdentifier,this);if(m==null)return;let{x:g,y:C}=m;if(Array.isArray(this.props.grid)){let T=g-this.lastX||0,R=C-this.lastY||0;[T,R]=(0,o.snapToGrid)(this.props.grid,T,R),g=this.lastX+T,C=this.lastY+R}const y=(0,o.createCoreData)(this,g,C);if(this.props.onStop(v,y)===!1||this.mounted===!1)return!1;const x=this.findDOMNode();x&&this.props.enableUserSelectHack&&(0,r.removeUserSelectStyles)(x.ownerDocument),(0,i.default)("DraggableCore: handleDragStop: %j",y),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,x&&((0,i.default)("DraggableCore: Removing handlers"),(0,r.removeEvent)(x.ownerDocument,S.move,this.handleDrag),(0,r.removeEvent)(x.ownerDocument,S.stop,this.handleDragStop))}),u(this,"onMouseDown",v=>(S=h.mouse,this.handleDragStart(v))),u(this,"onMouseUp",v=>(S=h.mouse,this.handleDragStop(v))),u(this,"onTouchStart",v=>(S=h.touch,this.handleDragStart(v))),u(this,"onTouchEnd",v=>(S=h.touch,this.handleDragStop(v)))}componentDidMount(){this.mounted=!0;const v=this.findDOMNode();v&&(0,r.addEvent)(v,h.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const v=this.findDOMNode();if(v){const{ownerDocument:m}=v;(0,r.removeEvent)(m,h.mouse.move,this.handleDrag),(0,r.removeEvent)(m,h.touch.move,this.handleDrag),(0,r.removeEvent)(m,h.mouse.stop,this.handleDragStop),(0,r.removeEvent)(m,h.touch.stop,this.handleDragStop),(0,r.removeEvent)(v,h.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,r.removeUserSelectStyles)(m)}}findDOMNode(){var v,m;return(v=this.props)!==null&&v!==void 0&&v.nodeRef?(m=this.props)===null||m===void 0||(m=m.nodeRef)===null||m===void 0?void 0:m.current:n.default.findDOMNode(this)}render(){return e.cloneElement(e.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};return rr.default=p,u(p,"displayName","DraggableCore"),u(p,"propTypes",{allowAnyClick:t.default.bool,children:t.default.node.isRequired,disabled:t.default.bool,enableUserSelectHack:t.default.bool,offsetParent:function(b,v){if(b[v]&&b[v].nodeType!==1)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:t.default.arrayOf(t.default.number),handle:t.default.string,cancel:t.default.string,nodeRef:t.default.object,onStart:t.default.func,onDrag:t.default.func,onStop:t.default.func,onMouseDown:t.default.func,scale:t.default.number,className:s.dontSetMe,style:s.dontSetMe,transform:s.dontSetMe}),u(p,"defaultProps",{allowAnyClick:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1}),rr}var cd;function qP(){return cd||(cd=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"DraggableCore",{enumerable:!0,get:function(){return c.default}}),e.default=void 0;var t=f(E),n=u(bs()),r=u(vt),o=u(YP),s=Dc(),i=vg(),a=xs(),c=u(GP()),l=u(yg());function u(m){return m&&m.__esModule?m:{default:m}}function d(m){if(typeof WeakMap!="function")return null;var g=new WeakMap,C=new WeakMap;return(d=function(y){return y?C:g})(m)}function f(m,g){if(m&&m.__esModule)return m;if(m===null||typeof m!="object"&&typeof m!="function")return{default:m};var C=d(g);if(C&&C.has(m))return C.get(m);var y={},M=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var x in m)if(x!=="default"&&Object.prototype.hasOwnProperty.call(m,x)){var T=M?Object.getOwnPropertyDescriptor(m,x):null;T&&(T.get||T.set)?Object.defineProperty(y,x,T):y[x]=m[x]}return y.default=m,C&&C.set(m,y),y}function h(){return h=Object.assign?Object.assign.bind():function(m){for(var g=1;g<arguments.length;g++){var C=arguments[g];for(var y in C)Object.prototype.hasOwnProperty.call(C,y)&&(m[y]=C[y])}return m},h.apply(this,arguments)}function S(m,g,C){return g=p(g),g in m?Object.defineProperty(m,g,{value:C,enumerable:!0,configurable:!0,writable:!0}):m[g]=C,m}function p(m){var g=b(m,"string");return typeof g=="symbol"?g:String(g)}function b(m,g){if(typeof m!="object"||m===null)return m;var C=m[Symbol.toPrimitive];if(C!==void 0){var y=C.call(m,g);if(typeof y!="object")return y;throw new TypeError("@@toPrimitive must return a primitive value.")}return(g==="string"?String:Number)(m)}class v extends t.Component{static getDerivedStateFromProps(g,C){let{position:y}=g,{prevPropsPosition:M}=C;return y&&(!M||y.x!==M.x||y.y!==M.y)?((0,l.default)("Draggable: getDerivedStateFromProps %j",{position:y,prevPropsPosition:M}),{x:y.x,y:y.y,prevPropsPosition:{...y}}):null}constructor(g){super(g),S(this,"onDragStart",(C,y)=>{if((0,l.default)("Draggable: onDragStart: %j",y),this.props.onStart(C,(0,i.createDraggableData)(this,y))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),S(this,"onDrag",(C,y)=>{if(!this.state.dragging)return!1;(0,l.default)("Draggable: onDrag: %j",y);const M=(0,i.createDraggableData)(this,y),x={x:M.x,y:M.y,slackX:0,slackY:0};if(this.props.bounds){const{x:R,y:_}=x;x.x+=this.state.slackX,x.y+=this.state.slackY;const[O,z]=(0,i.getBoundPosition)(this,x.x,x.y);x.x=O,x.y=z,x.slackX=this.state.slackX+(R-x.x),x.slackY=this.state.slackY+(_-x.y),M.x=x.x,M.y=x.y,M.deltaX=x.x-this.state.x,M.deltaY=x.y-this.state.y}if(this.props.onDrag(C,M)===!1)return!1;this.setState(x)}),S(this,"onDragStop",(C,y)=>{if(!this.state.dragging||this.props.onStop(C,(0,i.createDraggableData)(this,y))===!1)return!1;(0,l.default)("Draggable: onDragStop: %j",y);const x={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x:R,y:_}=this.props.position;x.x=R,x.y=_}this.setState(x)}),this.state={dragging:!1,dragged:!1,x:g.position?g.position.x:g.defaultPosition.x,y:g.position?g.position.y:g.defaultPosition.y,prevPropsPosition:{...g.position},slackX:0,slackY:0,isElementSVG:!1},g.position&&!(g.onDrag||g.onStop)&&console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){typeof window.SVGElement<"u"&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.setState({dragging:!1})}findDOMNode(){var g,C;return(g=(C=this.props)===null||C===void 0||(C=C.nodeRef)===null||C===void 0?void 0:C.current)!==null&&g!==void 0?g:r.default.findDOMNode(this)}render(){const{axis:g,bounds:C,children:y,defaultPosition:M,defaultClassName:x,defaultClassNameDragging:T,defaultClassNameDragged:R,position:_,positionOffset:O,scale:z,...G}=this.props;let j={},F=null;const k=!!!_||this.state.dragging,P=_||M,I={x:(0,i.canDragX)(this)&&k?this.state.x:P.x,y:(0,i.canDragY)(this)&&k?this.state.y:P.y};this.state.isElementSVG?F=(0,s.createSVGTransform)(I,O):j=(0,s.createCSSTransform)(I,O);const A=(0,o.default)(y.props.className||"",x,{[T]:this.state.dragging,[R]:this.state.dragged});return t.createElement(c.default,h({},G,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),t.cloneElement(t.Children.only(y),{className:A,style:{...y.props.style,...j},transform:F}))}}e.default=v,S(v,"displayName","Draggable"),S(v,"propTypes",{...c.default.propTypes,axis:n.default.oneOf(["both","x","y","none"]),bounds:n.default.oneOfType([n.default.shape({left:n.default.number,right:n.default.number,top:n.default.number,bottom:n.default.number}),n.default.string,n.default.oneOf([!1])]),defaultClassName:n.default.string,defaultClassNameDragging:n.default.string,defaultClassNameDragged:n.default.string,defaultPosition:n.default.shape({x:n.default.number,y:n.default.number}),positionOffset:n.default.shape({x:n.default.oneOfType([n.default.number,n.default.string]),y:n.default.oneOfType([n.default.number,n.default.string])}),position:n.default.shape({x:n.default.number,y:n.default.number}),className:a.dontSetMe,style:a.dontSetMe,transform:a.dontSetMe}),S(v,"defaultProps",{...c.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})}(ei)),ei}var ld;function bg(){if(ld)return nr.exports;ld=1;const{default:e,DraggableCore:t}=qP();return nr.exports=e,nr.exports.default=e,nr.exports.DraggableCore=t,nr.exports}var fo={},ud;function XP(){if(ud)return fo;ud=1,fo.__esModule=!0,fo.cloneElement=a;var e=t(E);function t(c){return c&&c.__esModule?c:{default:c}}function n(c,l){var u=Object.keys(c);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(c);l&&(d=d.filter(function(f){return Object.getOwnPropertyDescriptor(c,f).enumerable})),u.push.apply(u,d)}return u}function r(c){for(var l=1;l<arguments.length;l++){var u=arguments[l]!=null?arguments[l]:{};l%2?n(Object(u),!0).forEach(function(d){o(c,d,u[d])}):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(u)):n(Object(u)).forEach(function(d){Object.defineProperty(c,d,Object.getOwnPropertyDescriptor(u,d))})}return c}function o(c,l,u){return l=s(l),l in c?Object.defineProperty(c,l,{value:u,enumerable:!0,configurable:!0,writable:!0}):c[l]=u,c}function s(c){var l=i(c,"string");return typeof l=="symbol"?l:String(l)}function i(c,l){if(typeof c!="object"||c===null)return c;var u=c[Symbol.toPrimitive];if(u!==void 0){var d=u.call(c,l);if(typeof d!="object")return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return(l==="string"?String:Number)(c)}function a(c,l){return l.style&&c.props.style&&(l.style=r(r({},c.props.style),l.style)),l.className&&c.props.className&&(l.className=c.props.className+" "+l.className),e.default.cloneElement(c,l)}return fo}var or={},dd;function xg(){if(dd)return or;dd=1,or.__esModule=!0,or.resizableProps=void 0;var e=t(bs());bg();function t(r){return r&&r.__esModule?r:{default:r}}var n={axis:e.default.oneOf(["both","x","y","none"]),className:e.default.string,children:e.default.element.isRequired,draggableOpts:e.default.shape({allowAnyClick:e.default.bool,cancel:e.default.string,children:e.default.node,disabled:e.default.bool,enableUserSelectHack:e.default.bool,offsetParent:e.default.node,grid:e.default.arrayOf(e.default.number),handle:e.default.string,nodeRef:e.default.object,onStart:e.default.func,onDrag:e.default.func,onStop:e.default.func,onMouseDown:e.default.func,scale:e.default.number}),height:function(){for(var o=arguments.length,s=new Array(o),i=0;i<o;i++)s[i]=arguments[i];var a=s[0];if(a.axis==="both"||a.axis==="y"){var c;return(c=e.default.number).isRequired.apply(c,s)}return e.default.number.apply(e.default,s)},handle:e.default.oneOfType([e.default.node,e.default.func]),handleSize:e.default.arrayOf(e.default.number),lockAspectRatio:e.default.bool,maxConstraints:e.default.arrayOf(e.default.number),minConstraints:e.default.arrayOf(e.default.number),onResizeStop:e.default.func,onResizeStart:e.default.func,onResize:e.default.func,resizeHandles:e.default.arrayOf(e.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),transformScale:e.default.number,width:function(){for(var o=arguments.length,s=new Array(o),i=0;i<o;i++)s[i]=arguments[i];var a=s[0];if(a.axis==="both"||a.axis==="x"){var c;return(c=e.default.number).isRequired.apply(c,s)}return e.default.number.apply(e.default,s)}};return or.resizableProps=n,or}var fd;function wg(){if(fd)return tr;fd=1,tr.__esModule=!0,tr.default=void 0;var e=i(E),t=bg(),n=XP(),r=xg(),o=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function s(v){if(typeof WeakMap!="function")return null;var m=new WeakMap,g=new WeakMap;return(s=function(y){return y?g:m})(v)}function i(v,m){if(v&&v.__esModule)return v;if(v===null||typeof v!="object"&&typeof v!="function")return{default:v};var g=s(m);if(g&&g.has(v))return g.get(v);var C={},y=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var M in v)if(M!=="default"&&Object.prototype.hasOwnProperty.call(v,M)){var x=y?Object.getOwnPropertyDescriptor(v,M):null;x&&(x.get||x.set)?Object.defineProperty(C,M,x):C[M]=v[M]}return C.default=v,g&&g.set(v,C),C}function a(){return a=Object.assign?Object.assign.bind():function(v){for(var m=1;m<arguments.length;m++){var g=arguments[m];for(var C in g)Object.prototype.hasOwnProperty.call(g,C)&&(v[C]=g[C])}return v},a.apply(this,arguments)}function c(v,m){if(v==null)return{};var g={},C=Object.keys(v),y,M;for(M=0;M<C.length;M++)y=C[M],!(m.indexOf(y)>=0)&&(g[y]=v[y]);return g}function l(v,m){var g=Object.keys(v);if(Object.getOwnPropertySymbols){var C=Object.getOwnPropertySymbols(v);m&&(C=C.filter(function(y){return Object.getOwnPropertyDescriptor(v,y).enumerable})),g.push.apply(g,C)}return g}function u(v){for(var m=1;m<arguments.length;m++){var g=arguments[m]!=null?arguments[m]:{};m%2?l(Object(g),!0).forEach(function(C){d(v,C,g[C])}):Object.getOwnPropertyDescriptors?Object.defineProperties(v,Object.getOwnPropertyDescriptors(g)):l(Object(g)).forEach(function(C){Object.defineProperty(v,C,Object.getOwnPropertyDescriptor(g,C))})}return v}function d(v,m,g){return m=f(m),m in v?Object.defineProperty(v,m,{value:g,enumerable:!0,configurable:!0,writable:!0}):v[m]=g,v}function f(v){var m=h(v,"string");return typeof m=="symbol"?m:String(m)}function h(v,m){if(typeof v!="object"||v===null)return v;var g=v[Symbol.toPrimitive];if(g!==void 0){var C=g.call(v,m);if(typeof C!="object")return C;throw new TypeError("@@toPrimitive must return a primitive value.")}return(m==="string"?String:Number)(v)}function S(v,m){v.prototype=Object.create(m.prototype),v.prototype.constructor=v,p(v,m)}function p(v,m){return p=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(C,y){return C.__proto__=y,C},p(v,m)}var b=function(v){S(m,v);function m(){for(var C,y=arguments.length,M=new Array(y),x=0;x<y;x++)M[x]=arguments[x];return C=v.call.apply(v,[this].concat(M))||this,C.handleRefs={},C.lastHandleRect=null,C.slack=null,C}var g=m.prototype;return g.componentWillUnmount=function(){this.resetData()},g.resetData=function(){this.lastHandleRect=this.slack=null},g.runConstraints=function(y,M){var x=this.props,T=x.minConstraints,R=x.maxConstraints,_=x.lockAspectRatio;if(!T&&!R&&!_)return[y,M];if(_){var O=this.props.width/this.props.height,z=y-this.props.width,G=M-this.props.height;Math.abs(z)>Math.abs(G*O)?M=y/O:y=M*O}var j=y,F=M,N=this.slack||[0,0],k=N[0],P=N[1];return y+=k,M+=P,T&&(y=Math.max(T[0],y),M=Math.max(T[1],M)),R&&(y=Math.min(R[0],y),M=Math.min(R[1],M)),this.slack=[k+(j-y),P+(F-M)],[y,M]},g.resizeHandler=function(y,M){var x=this;return function(T,R){var _=R.node,O=R.deltaX,z=R.deltaY;y==="onResizeStart"&&x.resetData();var G=(x.props.axis==="both"||x.props.axis==="x")&&M!=="n"&&M!=="s",j=(x.props.axis==="both"||x.props.axis==="y")&&M!=="e"&&M!=="w";if(!(!G&&!j)){var F=M[0],N=M[M.length-1],k=_.getBoundingClientRect();if(x.lastHandleRect!=null){if(N==="w"){var P=k.left-x.lastHandleRect.left;O+=P}if(F==="n"){var I=k.top-x.lastHandleRect.top;z+=I}}x.lastHandleRect=k,N==="w"&&(O=-O),F==="n"&&(z=-z);var A=x.props.width+(G?O/x.props.transformScale:0),V=x.props.height+(j?z/x.props.transformScale:0),W=x.runConstraints(A,V);A=W[0],V=W[1];var H=A!==x.props.width||V!==x.props.height,L=typeof x.props[y]=="function"?x.props[y]:null,Y=y==="onResize"&&!H;L&&!Y&&(T.persist==null||T.persist(),L(T,{node:_,size:{width:A,height:V},handle:M})),y==="onResizeStop"&&x.resetData()}}},g.renderResizeHandle=function(y,M){var x=this.props.handle;if(!x)return e.createElement("span",{className:"react-resizable-handle react-resizable-handle-"+y,ref:M});if(typeof x=="function")return x(y,M);var T=typeof x.type=="string",R=u({ref:M},T?{}:{handleAxis:y});return e.cloneElement(x,R)},g.render=function(){var y=this,M=this.props,x=M.children,T=M.className,R=M.draggableOpts;M.width,M.height,M.handle,M.handleSize,M.lockAspectRatio,M.axis,M.minConstraints,M.maxConstraints,M.onResize,M.onResizeStop,M.onResizeStart;var _=M.resizeHandles;M.transformScale;var O=c(M,o);return(0,n.cloneElement)(x,u(u({},O),{},{className:(T?T+" ":"")+"react-resizable",children:[].concat(x.props.children,_.map(function(z){var G,j=(G=y.handleRefs[z])!=null?G:y.handleRefs[z]=e.createRef();return e.createElement(t.DraggableCore,a({},R,{nodeRef:j,key:"resizableHandle-"+z,onStop:y.resizeHandler("onResizeStop",z),onStart:y.resizeHandler("onResizeStart",z),onDrag:y.resizeHandler("onResize",z)}),y.renderResizeHandle(z,j))}))}))},m}(e.Component);return tr.default=b,b.propTypes=r.resizableProps,b.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1},tr}var sr={},hd;function ZP(){if(hd)return sr;hd=1,sr.__esModule=!0,sr.default=void 0;var e=a(E),t=s(bs()),n=s(wg()),r=xg(),o=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function s(m){return m&&m.__esModule?m:{default:m}}function i(m){if(typeof WeakMap!="function")return null;var g=new WeakMap,C=new WeakMap;return(i=function(M){return M?C:g})(m)}function a(m,g){if(m&&m.__esModule)return m;if(m===null||typeof m!="object"&&typeof m!="function")return{default:m};var C=i(g);if(C&&C.has(m))return C.get(m);var y={},M=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var x in m)if(x!=="default"&&Object.prototype.hasOwnProperty.call(m,x)){var T=M?Object.getOwnPropertyDescriptor(m,x):null;T&&(T.get||T.set)?Object.defineProperty(y,x,T):y[x]=m[x]}return y.default=m,C&&C.set(m,y),y}function c(){return c=Object.assign?Object.assign.bind():function(m){for(var g=1;g<arguments.length;g++){var C=arguments[g];for(var y in C)Object.prototype.hasOwnProperty.call(C,y)&&(m[y]=C[y])}return m},c.apply(this,arguments)}function l(m,g){var C=Object.keys(m);if(Object.getOwnPropertySymbols){var y=Object.getOwnPropertySymbols(m);g&&(y=y.filter(function(M){return Object.getOwnPropertyDescriptor(m,M).enumerable})),C.push.apply(C,y)}return C}function u(m){for(var g=1;g<arguments.length;g++){var C=arguments[g]!=null?arguments[g]:{};g%2?l(Object(C),!0).forEach(function(y){d(m,y,C[y])}):Object.getOwnPropertyDescriptors?Object.defineProperties(m,Object.getOwnPropertyDescriptors(C)):l(Object(C)).forEach(function(y){Object.defineProperty(m,y,Object.getOwnPropertyDescriptor(C,y))})}return m}function d(m,g,C){return g=f(g),g in m?Object.defineProperty(m,g,{value:C,enumerable:!0,configurable:!0,writable:!0}):m[g]=C,m}function f(m){var g=h(m,"string");return typeof g=="symbol"?g:String(g)}function h(m,g){if(typeof m!="object"||m===null)return m;var C=m[Symbol.toPrimitive];if(C!==void 0){var y=C.call(m,g);if(typeof y!="object")return y;throw new TypeError("@@toPrimitive must return a primitive value.")}return(g==="string"?String:Number)(m)}function S(m,g){if(m==null)return{};var C={},y=Object.keys(m),M,x;for(x=0;x<y.length;x++)M=y[x],!(g.indexOf(M)>=0)&&(C[M]=m[M]);return C}function p(m,g){m.prototype=Object.create(g.prototype),m.prototype.constructor=m,b(m,g)}function b(m,g){return b=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(y,M){return y.__proto__=M,y},b(m,g)}var v=function(m){p(g,m);function g(){for(var y,M=arguments.length,x=new Array(M),T=0;T<M;T++)x[T]=arguments[T];return y=m.call.apply(m,[this].concat(x))||this,y.state={width:y.props.width,height:y.props.height,propsWidth:y.props.width,propsHeight:y.props.height},y.onResize=function(R,_){var O=_.size;y.props.onResize?(R.persist==null||R.persist(),y.setState(O,function(){return y.props.onResize&&y.props.onResize(R,_)})):y.setState(O)},y}g.getDerivedStateFromProps=function(M,x){return x.propsWidth!==M.width||x.propsHeight!==M.height?{width:M.width,height:M.height,propsWidth:M.width,propsHeight:M.height}:null};var C=g.prototype;return C.render=function(){var M=this.props,x=M.handle,T=M.handleSize;M.onResize;var R=M.onResizeStart,_=M.onResizeStop,O=M.draggableOpts,z=M.minConstraints,G=M.maxConstraints,j=M.lockAspectRatio,F=M.axis;M.width,M.height;var N=M.resizeHandles,k=M.style,P=M.transformScale,I=S(M,o);return e.createElement(n.default,{axis:F,draggableOpts:O,handle:x,handleSize:T,height:this.state.height,lockAspectRatio:j,maxConstraints:G,minConstraints:z,onResizeStart:R,onResize:this.onResize,onResizeStop:_,resizeHandles:N,transformScale:P,width:this.state.width},e.createElement("div",c({},I,{style:u(u({},k),{},{width:this.state.width+"px",height:this.state.height+"px"})})))},g}(e.Component);return sr.default=v,v.propTypes=u(u({},r.resizableProps),{},{children:t.default.element}),sr}var pd;function JP(){return pd||(pd=1,er.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")},er.exports.Resizable=wg().default,er.exports.ResizableBox=ZP().default),er.exports}var Sg=JP();const md=({booking:e,slotData:t,customClasses:n,hoveringAdditionalCardId:r="",children:o,ref:s})=>{const[i,a]=E.useState(!1),c=_e(Br(y=>y.bookingViewType)),{updateIsDragging:l,isDragging:u}=hn(y=>y),{attributes:d,listeners:f,setNodeRef:h,isDragging:S,transform:p}=ua({id:e.id,data:{type:"booking-slots",booking:e,slotData:t},disabled:e.disabledResize==="full"||e.disabledResize==="half"||e.startAt.getDate()!==e.finishAt.getDate()}),b=p?{transform:`translate3d(${p.x}px, ${p.y}px, 0)`}:void 0;_r({onDragStart:()=>v(),onDragAbort:()=>m(),onDragCancel:()=>m(),onDragEnd:()=>m()});const v=E.useCallback(()=>{l(!0)},[]),m=E.useCallback(()=>{l(!1)},[]),g=E.useMemo(()=>({cursor:u?"ns-resize":"pointer",width:c===oe.DAY?"99%":"100%"}),[u,c]),C=(y,M)=>r!=null&&r.length?y===M:!1;if(E.useImperativeHandle(s,()=>({changeCurrentCardResize:()=>a(y=>!y)})),!S)return w.jsx("div",{ref:h,className:ce("cardContent_render",(i||C(r,e.id))&&"cardContent_render_dragging",n),style:{...b,...g},...f,...d,children:o},e.id)};function QP(e,t){const n=e>new Date(t.startAt),r=e<new Date(t.finishAt);return n&&r}const eA={calculateOverlappingBookings:(e,t)=>{const n=t.filter(o=>{const s=new Date(o.startAt).getDate(),i=e.startAt.getDate();return s===i&&o.id!==e.id});let r=0;for(const o of n)QP(e.startAt,o)&&r++;return r}},Ec=({bookingInit:e,slotData:t,heightStyle:n,topHeightIncrement:r,customClasses:o,bookingViewType:s,resizableParam:i,events:a,open:c=!0,lastCard:l,half:u,cardContentRef:d,cardsQuantity:f,cardIndex:h,hoveringAdditionalCardId:S,ref:p})=>{var H;const b=hn(Br(L=>L.updateIsDragging)),{emptySlotNodes:v}=Tt(),{bookings:m,onCardResizeEnd:g}=Lt(),[C,y]=E.useState(""),M=E.useRef(null),x=E.useMemo(()=>s===oe.DAY?{width:"99%"}:{width:"100%"},[s]),T=(L,Y)=>{var K;R("show-handle",!0),i!=null&&i.onResizeStart&&i.onResizeStart(L,Y),(K=M.current)==null||K.changeCurrentCardResize()},R=(L="",Y=!1)=>{y(L),b(Y)},_=(L,Y)=>{var K;(K=M.current)==null||K.changeCurrentCardResize(),R(),Y.handle.includes("n")&&g(Mi.resizeBookingNorthId(e)),Y.handle.includes("s")&&g(Mi.resizeBookingSouthId(e)),i!=null&&i.onResizeStop&&i.onResizeStop(L,Y)},O=E.useMemo(()=>eA.calculateOverlappingBookings(e,m),[e,m]),z=E.useMemo(()=>ce(i==null?void 0:i.customClass,C,u&&O>0&&"",u?"":O>0&&"inner_cards_parent",l&&O&&u&&"inner_cards_parent_last_card_disable",l&&O&&"inner_cards_parent_last_card",l&&O===2&&"inner_cards_parent_last_card_layer_2",O===1&&!u&&"inner_cards_parent_1_layer",O===2&&"inner_cards_parent_2_layer",u&&O===3&&"inner_cards_parent_resizable_layer_3_half inner_cards_parent_3_layer_half",O===3&&"inner_cards_parent_resizable_layer_3 inner_cards_parent_3_layer"),[i,C,u,O,l]),G=L=>L===0?"8rem":"4rem",j=E.useMemo(()=>u&&h===0&&f===3||u&&h===1&&f===3?G(h):O===2?"0.8rem":l&&O===1?"0.2rem":l&&O?"1rem":O===1?"0.4rem":0,[u,l,O,h,f]),F=E.useMemo(()=>u&&h===0&&f===3&&!O?"0rem":u&&h===0&&f===3?"0.4rem":u&&h===1&&f===3?"5rem":l&&f===3?"9rem":l?"6.5rem":0,[u,l,h,O,f]),N=E.useMemo(()=>u&&f===3&&(u&&h===0||u&&h===1)||u&&l&&f===3||u&&l?{inset:`${r}rem ${j} ${n}rem ${F}`}:u&&f===3||u?{inset:`${r}rem 6.5rem ${n}rem ${j}`}:{inset:`${r||0}rem ${j} ${n}rem`},[u,O,n,r,h,f,j,F]),k=(L,Y)=>{const K=v.get(Y);K==null||K.hoveringAdditionalCard(L.id)},P=L=>{const Y=v.get(L);Y==null||Y.clearHoveringCard()},I=(L,Y)=>{({mouseenter:()=>k(e,L),mouseleave:()=>P(L)}[Y]||(()=>console.warn(`Unhandled event type: ${Y}`)))()},A=L=>{const Y=L.toDateString();return on({key:Y,time:ta})},V=L=>{const Y=Z.calculateDaysDifference(e.finishAt,e.startAt);if(Y===1){I(A(e.finishAt),L);return}const K=Z.buildFutureDateList(e,Y);for(const $ of K)I(A($),L)},W=L=>{const Y=L.type;if(e!=null&&e.nodes)for(const K of e.nodes)I(K,Y);V(Y)};if(E.useEffect(()=>()=>{a!=null&&a.onUnmount&&a.onUnmount()},[]),E.useImperativeHandle(d,()=>({changeCurrentCardResize:()=>{var L;(L=M.current)==null||L.changeCurrentCardResize()}})),!c&&!e.finishAt)return null;if((H=i==null?void 0:i.state)!=null&&H.height){const{state:L,onResize:Y,resizeHandle:K=["s","n"]}=i,$=()=>{switch(e==null?void 0:e.disabledResize){case"full":return[];case"half":return["s"];default:return K}};return w.jsx(Sg.Resizable,{className:ce(z),height:L==null?void 0:L.height,width:L==null?void 0:L.width,onResize:Y,onResizeStart:T,onResizeStop:_,resizeHandles:$(),draggableOpts:{grid:[35,35]},handleSize:[20,20],maxConstraints:[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY],transformScale:1,children:w.jsx("div",{className:"card_content_core",style:{...N},onMouseEnter:W,onMouseLeave:W,onBlur:()=>{},children:w.jsx(md,{ref:M,booking:e,slotData:t,layerCount:O,half:u,hoveringAdditionalCardId:S,children:w.jsx(Ri,{booking:e,slotData:t,events:{onClick:a==null?void 0:a.onClick}})},e.id)})})}return w.jsx("div",{ref:p,className:"card_content_core",style:{...x,...N},children:w.jsx(md,{customClasses:o,booking:e,slotData:t,children:w.jsx(Ri,{booking:e,slotData:t,events:{onClick:a==null?void 0:a.onClick}})})})},gd=({booking:e,slotData:t,cardsQuantity:n=1,cardIndex:r=0,lastCard:o=!1,half:s=!1,hoveringAdditionalCardId:i,ref:a})=>{const{bookingViewType:c}=_e(),[l,u]=E.useState({...e});E.useEffect(()=>{e&&u(e)},[e]);const[d,f]=E.useState(!1),h=E.useRef("left"),S=()=>{const M=t.day.split(":")[0].trim();if(c===oe.DAY)h.current="top";else switch(M){case"Mon":case"Sun":h.current="right";break;default:h.current="left";break}f(!0)},p=async M=>{try{u(x=>({...x,finishAt:M}))}catch(x){console.log(x)}},b=async M=>{u(x=>({...x,startAt:M}))},v=async M=>{try{u(x=>({...x,finishAt:M}))}catch(x){console.log(x)}},{state:m,heightStyle:g,topHeightIncrement:C,onResize:y}=Rm({booking:l,onAddTime:p,onAddStartTime:b,onSubTime:v,starter:!0});return E.useImperativeHandle(a,()=>({bookingId:e.id}),[e.id]),w.jsx(hg,{booking:l,onOpenChange:f,side:c===oe.DAY?"top":"left",isEditingOpen:d,children:w.jsx(Ec,{resizableParam:{state:m,onResize:y,resizeHandle:["s","n"]},customClasses:"Draggable",bookingInit:l,bookingViewType:c,slotData:t,topHeightIncrement:C,heightStyle:g,events:{onClick:S},half:s,lastCard:o,cardsQuantity:n,cardIndex:r,hoveringAdditionalCardId:i})})},vd=({bookings:e,blockTimeString:t,slotData:n,hoveringAdditionalCardId:r})=>{if(!e||!(n!=null&&n.day)&&!(n!=null&&n.hour)||!t)return null;const o=E.useMemo(()=>e.filter(s=>Z.dateAndHourDateToString(new Date(s.startAt)).split(":")[1]===t),[e,t]);if(!(!o||!(o!=null&&o.length)))return o.length===1?w.jsx(gd,{booking:o[0],slotData:n,hoveringAdditionalCardId:r}):w.jsx(w.Fragment,{children:o.map((s,i)=>w.jsx(gd,{booking:s,half:!0,slotData:n,lastCard:o.length-1===i,cardsQuantity:o.length,cardIndex:i,hoveringAdditionalCardId:r},s.id))})},Cg=E.createContext(null),tA=e=>{const t=E.use(Cg);if(!t)throw new Error("useConfig must be used within a ConfigContext");return Ho(t,e)},nA=-Math.abs(1.98),rA={DOWN:"DOWN"},oA=({booking:e,onAddTime:t,onStartAtChange:n,onSubTime:r,starter:o=!1})=>{const[s,i]=E.useState({height:jt,width:jt}),[a,c]=E.useState(0),l=(x,T)=>{const R=Z.timeDiffInSeconds(x,T),_=Math.ceil(R/ci);return-Math.abs((_-1)*2)},[u,d]=E.useState(o?l(e.finishAt,e.startAt):0),f=x=>x===-Math.abs(0)||x===0,h=async x=>{console.log("addTime"),console.log("direction",x);const T=v(e.finishAt,"add");d(R=>f(R)?nA:R-2),t&&t(T)},S=async()=>{const x=v(e.finishAt,"remove");d(T=>T+2),r&&r(x)},p=async()=>{const x=m(e.startAt,"remove");c(T=>T-2),n&&n(x)},b=async()=>{const x=m(e.startAt,"add");c(T=>T+2),n&&n(x)},v=(x,T)=>{const R=new Date(x),_=R.getMinutes();return T==="add"&&R.setMinutes(_+15),T==="remove"&&R.setMinutes(_-15),R},m=(x,T)=>{const R=new Date(x),_=R.getMinutes();return T==="add"&&R.setMinutes(_+15),T==="remove"&&R.setMinutes(_-15),R};return{state:s,setState:i,resetState:()=>{i({height:jt,width:jt})},resetHeightStyle:()=>{d(0)},heightStyle:u,topHeightIncrement:a,onResize:(x,{size:T})=>{x.stopPropagation(),x.preventDefault();const R=T.height;i(_=>(_.height<R&&(a!==0?b():h(rA.DOWN)),_.height>R&&(R<600?p():S()),{..._,height:R}))},updateHeightStyle:(x,T)=>{d(l(x,T))}}},sA=E.forwardRef(({slotData:e,events:{onClick:t,renderPreviewCard:n}},r)=>{const[o,s]=E.useState(!1),[i,a]=E.useState(e.time),[c,l]=E.useState(Z.addMinutesToHour(i,15)),{isDragging:u}=hn(k=>k),d=_e(k=>k.bookingViewType),{systemColor:f,isTimeInfoVisible:h}=tA(k=>k),[S,p]=E.useState(!1),[b,v]=E.useState(!1),m=E.useRef(null),g=b?{backgroundColor:"white",border:"none"}:{},C=E.useMemo(()=>({id:"dragging_booking_preview",startAt:Z.convertStringTimeToDateFormat(i),finishAt:Z.convertStringTimeToDateFormat(c)}),[c,i]),y=()=>{p(!0),v(!0),n()},M=()=>{p(!1),t(c,i)};E.useEffect(()=>{var k;S&&((k=m.current)==null||k.changeCurrentCardResize())},[S]);const{state:x,resetState:T,resetHeightStyle:R,heightStyle:_,onResize:O,updateHeightStyle:z,topHeightIncrement:G}=oA({booking:C,onAddTime:k=>{console.log("onAddTime date time",k),l(Z.dateTimeAsString(k))},onStartAtChange:k=>{console.log("onStartAtChange date time",k),a(Z.dateTimeAsString(k))},onSubTime:k=>{console.log("onSubTime date time",k),l(Z.dateTimeAsString(k))}}),j=()=>{},F=()=>{l(Z.addMinutesToHour(e.time,15))},N=()=>{v(!1),F(),T(),R()};if(E.useEffect(()=>{if(!c||!i)return;const k=Z.convertStringTimeToDateFormat(c),P=Z.convertStringTimeToDateFormat(e.time);Number.isNaN(k)||Number.isNaN(P)||!(k instanceof Date)||!(P instanceof Date)||z(k,P)},[c,i]),E.useImperativeHandle(r,()=>({show:()=>s(!0),hide:()=>s(!1),changeIsOpen:k=>s(k),reset:N}),[]),!!o)return w.jsx("div",{style:{...g,border:h&&!u?`1.5px solid ${f}`:"none"},className:ce("timeInfo_core",g),children:w.jsx(Sg.Resizable,{className:"slot-resizable",height:x.height,width:x.width,onResizeStart:y,onResizeStop:M,onResize:O,resizeHandles:["se"],draggableOpts:{grid:[35,35]},handleSize:[30,30],maxConstraints:[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY],transformScale:1,children:b?w.jsx("div",{className:"timeInfo_core_dragging",children:w.jsx(Ec,{bookingInit:C,bookingViewType:d,slotData:{day:new Date().toISOString(),hour:"09:00"},topHeightIncrement:G,heightStyle:_,cardContentRef:m,resizableParam:{state:x,onResize:O,customClass:"show-handle"},events:{onUnmount:j}})}):w.jsx("div",{className:"timeInfo_core_timeParent",children:!u&&w.jsx("span",{className:"timeInfo_core_timeParent_time",style:{color:f,display:h?"initial":"none"},children:e.time})})})})}),ho=({slotData:e,blockTimeString:t,dayHour:n,slotPosition:r,disabledCss:o,events:s,bookings:i,children:a,ref:c})=>{const{isDragging:l,updateIsDragging:u}=hn(J=>J),{emptySlotNodes:d,setSelectedNode:f}=Tt(),{onModalClose:h,onSlotClick:S}=Lt(),{startAt:p,finishAt:b,updateDate:v,updateStartAt:m,updateFinishAtWithOffset:g}=_d(J=>J),C=_e(J=>J.bookingViewType),[y,M]=E.useState(!1),[x,T]=E.useState(!1),[R,_]=E.useState([]),[O,z]=E.useState(""),G=E.useRef(null),j=E.useRef(null),F=E.useRef(null),N=J=>{_(le=>le.filter(ye=>ye.id!==J.id))},k=(J,le,ye=!1)=>{const Ve=new Date(J.finishAt);Ve.setHours(24,0);const He=[{id:J.id,finishAt:ye?Ve:J.finishAt,overflow:!0,startAt:Mi.resetToFirstHourNextDay(J),disabledResize:ye?"full":"half",nodes:le}];_(He)},P=()=>F.current,I=()=>{var J;(J=F.current)==null||J.isModalOpen()},A=()=>{var J;(J=P())==null||J.showCreationModal()},V=()=>{var J;(J=j.current)==null||J.show()},W=()=>{var J;(J=j.current)==null||J.hide()},H=J=>{var le;(le=j.current)==null||le.changeIsOpen(J)},L=E.useMemo(()=>({id:"dragging_booking_preview",startAt:Z.convertStringTimeToDateFormat(p),finishAt:Z.convertStringTimeToDateFormat(b)}),[b,p]),{updateHeightStyle:Y,heightStyle:K}=Rm({booking:L}),$=(J,le)=>!le||!(le!=null&&le.length)?!1:!!le.find(ye=>Z.dateTimeAsString(ye.startAt)===J),q=E.useCallback(()=>{if($(e.time,i)||l||I()||y)return;s.onMouseEnterEvent()===r&&V()},[r,l,y,s,R,i]),X=J=>{var Ve,He;console.log("onCloseCreationModal"),(Ve=j.current)==null||Ve.reset();const le=on(e),ye=d==null?void 0:d.get(le);ye&&ye.closeEvent(),h==null||h(),J==null||J.stopPropagation(),J==null||J.preventDefault(),(He=P())==null||He.closeModal()},U=J=>{J||X(),M(J),H(J)},ne=E.useCallback((J,le)=>{if(l&&!J)return;u(!1);const{time:ye,key:Ve}=e,He=on({key:Ve,time:le||ye}),Kn=d==null?void 0:d.get(He);f(He),Kn&&Kn.showEvent(le||ye),v(Ve);const Ss=g(J||ye,J?0:15);S({slotData:e,finishTime:Ss}),A()},[e,d,l,S,g]),B=()=>{l||I()||W()},ie=o.length||x?o:"hovering_slotTrigger_core",pe=E.useCallback(()=>{const{time:J,key:le}=e;u(!0),T(!0),v(le),m(J),g(J)},[g,e,v,u,m]),Oe=()=>{A()},Ee=E.useCallback(()=>{T(!1)},[]),ot=()=>{setTimeout(()=>{W(),A(),M(!0)},0)};return E.useEffect(()=>{l?document.body.style.cursor="ns-resize":document.body.style.cursor="default"},[l]),E.useEffect(()=>{if(!b||!p)return;const J=Z.convertStringTimeToDateFormat(b),le=Z.convertStringTimeToDateFormat(p);Number.isNaN(J)||Number.isNaN(le)||!(J instanceof Date)||!(le instanceof Date)||Y(J,le)},[b,p]),E.useEffect(()=>{if(!y){W();return}G!=null&&G.current&&G.current.scrollIntoView({behavior:"smooth",block:"center"})},[y]),E.useEffect(()=>{i!=null&&i.length&&W(),x&&V()},[i,x]),E.useEffect(()=>{x&&V()},[x]),E.useImperativeHandle(c,()=>({showEvent:J=>{m(J),ot()},closeEvent:()=>{var J;(J=P())==null||J.closeModal(),M(!1),W(),Ee()},onOpenCloseChange:J=>{H(J),M(J),Ee()},addAdditionalBooking:k,removeFromAdditionalBooking:N,hoveringAdditionalCard:J=>{z(J)},clearHoveringCard:()=>{z("")}})),w.jsxs(w.Fragment,{children:[w.jsxs("div",{ref:e.ref,style:{borderBottom:r==="fourth"?"1px solid #8080807a":"",...e.style},className:ce("slotTrigger_core",C===oe.DAY&&"slotTrigger_core_day",ie),onMouseOver:q,onMouseLeave:B,onFocus:()=>{},children:[w.jsx(sA,{ref:j,slotData:e,events:{onClick:ne,openOptions:Oe,renderPreviewCard:pe,resetPrevView:Ee}}),a,y&&w.jsx(Ec,{ref:G,bookingInit:L,bookingViewType:C,slotData:{day:new Date().toISOString(),hour:"09:00"},hoveringAdditionalCardId:O,heightStyle:K}),w.jsx(vd,{hoveringAdditionalCardId:O,bookings:R,blockTimeString:"00",slotData:n}),w.jsx(vd,{hoveringAdditionalCardId:O,bookings:i,blockTimeString:t,slotData:n})]},e.key),w.jsx(Xh,{ref:F,onClose:X,onOpenChange:U,buttonTrigger:w.jsx("div",{},e.key),side:C===oe.DAY?"top":"right"})]})};var iA="Separator",yd="horizontal",aA=["horizontal","vertical"],Tg=D.forwardRef((e,t)=>{const{decorative:n,orientation:r=yd,...o}=e,s=cA(r)?r:yd,a=n?{role:"none"}:{"aria-orientation":s==="vertical"?s:void 0,role:"separator"};return w.jsx(ae.div,{"data-orientation":s,...a,...o,ref:t})});Tg.displayName=iA;function cA(e){return aA.includes(e)}var lA=Tg;function uA({className:e,orientation:t="horizontal",decorative:n=!0,...r}){return w.jsx(lA,{"data-slot":"separator-root",decorative:n,orientation:t,className:ce("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",e),...r})}const dA=fa("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function fA({className:e,variant:t,...n}){return w.jsx("div",{className:ce(dA({variant:t}),e),...n})}const hA=({dateToRender:e,isFirstDay:t})=>w.jsx("div",{style:{left:t?"3px":"10px"},className:"first_day_slot",children:w.jsx("span",{children:w.jsx(fA,{children:e})})});class pA{constructor(){Xt(this,"positionBasedOnSeconds",t=>{const[,n]=t.split(":");if(!t.length)return-3;const r=Number(n);return this.normalizingMinutes(r)});Xt(this,"normalizingMinutes",t=>t>=0&&t<=15?t*2:t>15&&t<30?(t-15)*2:t>=30&&t<=59?t-30:-3);Xt(this,"isInitialMinute",t=>t>=0&&t<=8);Xt(this,"isSameHour",(t,n)=>n.split(":")[0]===t)}}class mA{constructor(){Xt(this,"is15MinLess",t=>{const n=new Date,[r,o]=t.split(":"),s=new Date(n.getFullYear(),n.getMonth(),n.getDate(),Number(r),Number(o),0),i=new Date(n),a=Z.roundMinutes(n.getMinutes());i.setHours(n.getHours(),a,0,0);const c=Z.minuteDifference(s,i);return c>30||c<-30});Xt(this,"normalizeDateNow",t=>{const n=t.getHours(),r=Z.roundMinutes(t.getMinutes());return`${n.toString().padStart(2,"0")}:${r.toString().padStart(2,"0")}`})}}const po=({color:e="#000",isFirstDay:t,slotData:n})=>{const{timesRendered:r,bookingViewType:o}=_e(),[s,i]=E.useState(""),[a,c]=E.useState(!1),[l,u]=E.useState(!1),d=E.useMemo(()=>{const m=new Date,g=new Date(n.key);return g.getDay()===m.getDay()&&g.getDate()===m.getDate()},[n.key]),f=m=>{i(m)},h=()=>{c(!0)},S=()=>{c(!1)},p=E.useMemo(()=>new pA().positionBasedOnSeconds(s),[n.time,s,r]),b=E.useMemo(()=>t?"101%":o===oe.DAY?"102%":"104%",[t,o]),v=E.useMemo(()=>d?{top:`${p-2}px`,left:t?"-1px":"-3px",width:t?"101%":"104%"}:{top:`${p-1}px`,left:t?"-1px":"0px",width:b},[d,t,b,p]);if(E.useEffect(()=>{const m=n.time,g=new mA,C=()=>{const M=new Date,x=g.normalizeDateNow(M),T=Z.dateAndHourDateToString(M);s!==T&&f(T),u(x===m)};let y;return g.is15MinLess(m)||(y=setInterval(()=>C(),1e3)),()=>clearInterval(y)},[n.time,s]),!!l)return w.jsxs("div",{style:{...v},className:ce("timeIndicator_today",d&&b,d&&"timeIndicator_today_circle"),onMouseEnter:h,onMouseOut:S,onBlur:()=>{},children:[w.jsx(uA,{className:"focus-effect",style:{height:d?"4px":"2px",backgroundColor:e}}),a&&w.jsx(hA,{isFirstDay:t,dateToRender:s})]})},bd=({bookings:e,first:t,second:n,third:r,fourth:o,disabledCss:s,firstDay:i,dayHour:a})=>{const{setEmptySlotNode:c,emptySlotNodes:l}=Tt(),u=E.useCallback((p,b)=>{if(!p)return;const v=on(b);l.get(v)||c(p,b)},[c,l]),d=(p,b)=>{const v=p.toDateString();return on({key:v,time:b?Z.dateTimeAsString(b):ta})},f=E.useCallback(p=>{const b=d(p);return l.get(b)},[l]),h=(p,b,v)=>{const m=Z.buildFutureDateList(p,b);for(let g=0;g<m.length;g++){const C=f(m[g]);if(!C)return;C.addAdditionalBooking(p,v,g!==m.length-1)}},S=E.useCallback(()=>{if(e!=null&&e.length)for(const p of e){const b=Z.calculateDaysDifference(p.finishAt,p.startAt),m=Z.buildFutureDateList(p,b+1,0).map((g,C)=>d(g,C===0?p.startAt:void 0)).filter(g=>g!==void 0);if(b===1){const g=f(p.finishAt);if(!g)return;g.addAdditionalBooking(p,m);return}h(p,b,m)}},[e,f,h]);return E.useEffect(()=>{e!=null&&e.length&&S()},[e,l,S]),w.jsxs(w.Fragment,{children:[w.jsx(ho,{ref:p=>u(p,{key:t.key,time:t.time}),slotData:t,disabledCss:s,events:{onMouseEnterEvent:()=>"first"},slotPosition:"first",dayHour:a,bookings:e,blockTimeString:"00",children:w.jsx(po,{isFirstDay:i,slotData:t})}),w.jsx(ho,{ref:p=>u(p,{key:n.key,time:n.time}),slotData:n,disabledCss:s,events:{onMouseEnterEvent:()=>"second"},slotPosition:"second",dayHour:a,bookings:e,blockTimeString:"15",children:w.jsx(po,{isFirstDay:i,slotData:n})}),w.jsx(ho,{ref:p=>u(p,{key:r.key,time:r.time}),slotData:r,disabledCss:s,events:{onMouseEnterEvent:()=>"third"},slotPosition:"third",dayHour:a,bookings:e,blockTimeString:"30",children:w.jsx(po,{isFirstDay:i,slotData:r})}),w.jsx(ho,{ref:p=>u(p,{key:o.key,time:o.time}),slotData:o,disabledCss:s,events:{onMouseEnterEvent:()=>"fourth"},slotPosition:"fourth",dayHour:a,bookings:e,blockTimeString:"45",children:w.jsx(po,{isFirstDay:i,slotData:o})})]})},gA=E.memo(({firstDay:e,booking:t,dayHour:n,disabledCss:r,firstBlockTimeData:o,secondBlockTimeData:s,thirdBlockTimeData:i,fourthBlockTimeData:a})=>{const{day:c,hour:l}=n,u=E.useMemo(()=>t.filter(d=>{const f=Z.dateAndHourDateToString(d.startAt),h=new Date(d.startAt).getDate(),S=new Date(c).getDate(),p=l.split(":")[0];return f.split(":")[0]===p&&h===S}),[t,n]);return u.length?w.jsx(bd,{dayHour:n,bookings:u,first:o,second:s,third:i,fourth:a,disabledCss:r,firstDay:e}):w.jsx(bd,{dayHour:n,first:o,second:s,third:i,fourth:a,disabledCss:r,firstDay:e})}),vA=({dayHour:e,firstDay:t,bookingBulk:n})=>{const r=E.useRef(""),o=xc(y=>y.updateStartAt),{bookingViewType:s}=_e(Br(y=>({bookingViewType:y.bookingViewType}))),i=E.useMemo(()=>Z.addMinuteToHour(e.hour,15),[e.hour]),a=E.useMemo(()=>Z.addMinuteToHour(e.hour,30),[e.hour]),c=E.useMemo(()=>Z.addMinuteToHour(e.hour,45),[e.hour]),{isOver:l,setNodeRef:u}=Xr({id:`${Z.newDateKey(e.day,e.hour)}`,data:{accepts:["booking-slots"]}}),{isOver:d,setNodeRef:f}=Xr({id:`${Z.newDateKey(e.day,i)}`,data:{accepts:["booking-slots"]}}),{isOver:h,setNodeRef:S}=Xr({id:`${Z.newDateKey(e.day,a)}`,data:{accepts:["booking-slots"]}}),{isOver:p,setNodeRef:b}=Xr({id:`${Z.newDateKey(e.day,c)}`,data:{accepts:["booking-slots"]}});E.useEffect(()=>{l&&o(`${Z.newDateKey(e.day,e.hour)}`),d&&o(`${Z.newDateKey(e.day,i)}`),h&&o(`${Z.newDateKey(e.day,a)}`),p&&o(`${Z.newDateKey(e.day,c)}`)},[l,d,h,p]);const v=E.useMemo(()=>({ref:u,style:{backgroundColor:l?"#0066ff":""},key:Z.newDateKey(e.day,e.hour),time:e.hour}),[e.day,l,e.hour,u]),m=E.useMemo(()=>({ref:f,style:{backgroundColor:d?"#0066ff":""},key:Z.newDateKey(e.day,i),time:i}),[e.day,d,i,f]),g=E.useMemo(()=>({ref:S,style:{backgroundColor:h?"#0066ff":""},key:Z.newDateKey(e.day,a),time:a}),[e.day,h,a,S]),C=E.useMemo(()=>({ref:b,style:{backgroundColor:p?"#0066ff":""},key:Z.newDateKey(e.day,c),time:c}),[e.day,c,p,b]);return w.jsx("td",{className:ce("slot",s===oe.WEEK&&"slotWeek"),children:w.jsx(gA,{booking:n,dayHour:e,firstDay:t,disabledCss:r.current,firstBlockTimeData:v,secondBlockTimeData:m,thirdBlockTimeData:g,fourthBlockTimeData:C})},`${e.day}-${e.hour}-slot`)},yA=({hour:e,ref:t})=>{const n="Set lunch interval",r="Remove lunch interval",o="Hour options",s=E.useRef(null),i="border-solid hover:border-b-2 hover:border-b-purple-600 border-b-white",a=()=>{s!=null&&s.current&&s.current.setAttribute("class",ce("activateVisibilityTime",i))};return E.useImperativeHandle(t,()=>({setActivateHour:a})),w.jsxs(Fa,{children:[w.jsx($a,{children:w.jsx("span",{ref:s,className:ce(i),children:e})}),w.jsxs(Ba,{children:[w.jsx(bC,{children:o}),w.jsx(xC,{}),w.jsx(Ml,{children:n}),w.jsx(Ml,{children:r})]})]})},bA=()=>{const{hours:e,daysOfWeek:t,bookingViewType:n,bookingBulkData:r,addTimesRendered:o}=_e(Br(C=>({addTimesRendered:C.addTimesRendered,bookingBulkData:C.bookingBulkData,bookingViewType:C.bookingViewType,daysOfWeek:C.daysOfWeek,hours:C.hours}))),{selectedNode:s,emptySlotNodes:i}=Tt(),{finishAt:a,updateFinishAtWithOffset:c}=_d(C=>C),{booking:l,slotData:u,startAt:d}=xc(C=>C),[f]=E.useState({startAt:"12:00",finishAt:"12:30"}),h=E.useRef(null),S=E.useCallback((C,y)=>{C&&o(C,y)},[o]),p=E.useMemo(()=>n===oe.DAY?{maxWidth:"5rem",padding:0,minWidth:"4rem"}:{},[n]),b=E.useMemo(()=>({borderLeft:"none",backgroundColor:"white"}),[]),v=E.useMemo(()=>s.split(";")[1],[s]),m=E.useMemo(()=>{if(l&&u)return w.jsx(Ri,{ref:h,style:{borderRadius:"0.25rem"},booking:l,slotData:u})},[l,u]);return E.useEffect(()=>{if(s){const C=i.get(s);C==null||C.showEvent(v)}},[s,i]),E.useEffect(()=>{v===a&&c(v)},[s,a]),E.useEffect(()=>{if(l&&d&&(h!=null&&h.current)){const C=Z.bookingTimeRange(l,d);h.current.updateBooking(C)}},[l,d]),E.useMemo(()=>{const C=y=>y===0;return w.jsxs("div",{className:ce("calendarCore",n===oe.WEEK&&"calendarCore_max"),children:[w.jsx(NC,{children:w.jsx("tbody",{children:e.map(y=>w.jsxs("tr",{children:[w.jsx(IC,{style:{...b,...p,padding:0,position:"relative"},className:"calendarCore_cell",children:w.jsx("div",{className:"calendarCore_actions",children:w.jsx(yA,{ref:M=>S(M,y),hour:y})})},`${y}-hour`),t.map((M,x)=>w.jsx(vA,{dayHour:{day:String(M),hour:y},lunchTimeBlock:f,firstDay:C(x),bookingBulk:r.booking},`${M}-${y}-slot-content`))]},`${y}-content`))})}),w.jsx(wR,{children:m})]})},[p,e,b,r.booking,S,n,t,t.length,m])},xA=({children:e})=>{const{resetSelectedNode:t,resetNodes:n}=Tt(o=>o),r=_e(o=>o.bookingViewType);switch(E.useEffect(()=>{(r===oe.DAY||r===oe.WEEK)&&(t(),n())},[r,n,t]),r){case oe.DAY:case oe.WEEK:return e;default:return null}},wA=({children:e,...t})=>{const n=E.useRef(null);return n.current||(n.current=jg(t)),w.jsx(tv,{value:n.current,children:e})},SA=({children:e,...t})=>w.jsx(Rd,{value:{...t},children:e}),CA={systemColor:"#000000",isTimeInfoVisible:!0},TA=e=>Ar(t=>({...CA,...e,updateSystemColor:n=>{t(r=>({...r,systemColor:n}))},changeTimeInfoVisibility:n=>{t(r=>({...r,isTimeInfoVisible:n}))}})),DA=({children:e,...t})=>{const n=E.useRef(null);return n.current||(n.current=TA(t)),w.jsx(Cg,{value:n.current,children:e})},Dg={month:new Date().getMonth(),fullYear:new Date().getFullYear(),monthMessage:""},EA=e=>Ar((t,n)=>({...e,...Dg,updateMonthMessage:r=>{t(o=>({...o,...r}))},updateHeaderDateLabel:r=>{n().updateMonthMessage({month:r.getMonth(),fullYear:r.getFullYear(),monthMessage:Mn[r.getMonth()]})}})),MA=({children:e,...t})=>{const n=E.useRef(null);return n.current||(n.current=EA(t)),w.jsx(Ad,{value:n.current,children:e})},RA={id:"user-123",profile:{id:"profile-123",name:"Diego",email:"jane.smith@example.com"},createdAt:new Date,updatedAt:new Date},xd={distance:5},PA=({isLoading:e})=>{const{bookings:t}=Lt(),n=vv(Vc(qd,{activationConstraint:xd}),Vc(Xd,{activationConstraint:xd})),{setBookingBulkData:r,optimisticCardUpdate:o}=_e(),{onCardDropCallback:s}=Lt(),{emptySlotNodes:i}=Tt(),{updateBooking:a,updateSlotData:c}=xc(p=>p),l=E.useCallback(p=>{const{active:b}=p;b.data.current&&(a(b.data.current.booking),c(b.data.current.slotData)),b.id},[a,c]),u=E.useCallback((p,b)=>{const v=on({key:b.toDateString(),time:ta}),m=i.get(v);if(!m){console.warn("SlotNode not found:",v);return}m.removeFromAdditionalBooking(p)},[i]),d=p=>{const b=Z.calculateDaysDifference(p.finishAt,p.startAt),v=Z.buildFutureDateList(p,b);for(const m of v)u(p,m)},f=async(p,b,v)=>{try{const{startAt:m,finishAt:g}=Z.bookingTimeRange(p,b);o(p,m,g,v),await s(p,b,v,{id:p.id,startAt:m,finishAt:g}),d(p)}catch(m){console.warn(m)}},h=p=>{const{over:b,active:v}=p;if(b&&v){const m=b.data.current,g=v.data.current;if(g&&m&&m.accepts.includes(g.type)&&g.booking.id&&b.id){const C=t.find(y=>y.id===g.booking.id);if(!C)return;f(C,String(b.id),g.slotData),c(null),a(null)}}},S={position:"absolute",top:"50%",left:"50%",transform:"translate('-50%', '-50%')",zIndex:100};return E.useEffect(()=>{r({user:RA,booking:t})},[t,r]),w.jsxs("div",{className:"calendarHolder",children:[w.jsx(MA,{...Dg,children:w.jsxs("div",{className:"calendarHolder_parent",children:[w.jsx(_C,{}),w.jsxs("div",{className:"calendarHolder_parent_content",children:[w.jsx(EC,{}),w.jsx(xA,{children:w.jsx(la,{onDragEnd:h,onDragStart:l,sensors:n,children:w.jsx(bA,{})})})]})]})}),w.jsx(Ny,{color:"#000000aa",loading:e,cssOverride:S,size:15,"aria-label":"Loading Spinner","data-testid":"GridLoader"})]})},AA=({viewModes:e,createBookingModal:t,onChangeViewType:n,onCardDropCallback:r,onCardResizeEnd:o,onDayChange:s,onHeaderDayClick:i,onTodayClick:a,onSlotClick:c,onModalClose:l,bookings:u,isTimeInfoVisible:d,systemColor:f,ref:h})=>{const[S,p]=E.useState(!1),b=E.useRef(null),{setBookingViewType:v,setWeekAndViewType:m,setTodayDayAndViewType:g,bookingViewType:C,setTodayDay:y,todayWeek:M}=_e(),{setSelectedNode:x}=Tt(O=>O),T=O=>{var z;(z=b==null?void 0:b.current)==null||z.updateFinishAt(O)},R=O=>{y(new Date(O))},_=O=>{M(new Date(O))};return E.useImperativeHandle(h,()=>({updateViewType:O=>v(O),updateWeekAndViewType:O=>m(O),updateTodayDayAndViewType:O=>g(O),updateSelectedNode:O=>{setTimeout(()=>{x(O)},10)},updateFinishAt:O=>T(O),changeLoading:O=>p(O),goToDay:O=>R(O),goToWeek:O=>_(O)})),E.useEffect(()=>{n(C)},[C]),w.jsx(DA,{isTimeInfoVisible:d,systemColor:f,children:w.jsx(wA,{...Sd,children:w.jsx(SA,{createBookingModal:t,viewModes:e,onHeaderDayClick:i,onTodayClick:a,onCardDropCallback:r,onCardResizeEnd:o,onDayChange:s,onSlotClick:c,onModalClose:l,bookings:u,children:w.jsx(ov,{ref:b,...ui,children:w.jsx(PA,{isLoading:S})})})})})},OA=e=>{const t=E.useRef(null),n=()=>{if(!(t!=null&&t.current))throw new Ng};return{getCalendar:()=>w.jsx(AA,{ref:t,...e}),updateViewType:f=>{var h;n(),(h=t.current)==null||h.updateViewType(f)},updateWeekAndViewType:f=>{var h;return n(),(h=t.current)==null?void 0:h.updateWeekAndViewType(f)},updateTodayDayAndViewType:f=>{var h;return n(),(h=t.current)==null?void 0:h.updateTodayDayAndViewType(f)},updateSelectedNode:f=>{var h;n(),(h=t.current)==null||h.updateSelectedNode(f)},updateFinishAt:f=>{var h;n(),(h=t.current)==null||h.updateFinishAt(f)},changeLoading:f=>{var h;n(),(h=t.current)==null||h.changeLoading(f)},goToDay:f=>{var h;n(),(h=t.current)==null||h.goToDay(f)},goToWeek:f=>{var h;n(),(h=t.current)==null||h.goToWeek(f)}}};exports.useCalendarInstance=OA;
170
+ `,b.getElementsByTagName("head")[0].appendChild(T)),b.body&&y(b.body,"react-draggable-transparent-selection")}function C(b){if(b)try{if(b.body&&M(b.body,"react-draggable-transparent-selection"),b.selection)b.selection.empty();else{const T=(b.defaultView||window).getSelection();T&&T.type!=="Caret"&&T.removeAllRanges()}}catch{}}function y(b,T){b.classList?b.classList.add(T):b.className.match(new RegExp("(?:^|\\s)".concat(T,"(?!\\S)")))||(b.className+=" ".concat(T))}function M(b,T){b.classList?b.classList.remove(T):b.className=b.className.replace(new RegExp("(?:^|\\s)".concat(T,"(?!\\S)"),"g"),"")}return be}var at={},od;function bg(){if(od)return at;od=1,Object.defineProperty(at,"__esModule",{value:!0}),at.canDragX=o,at.canDragY=s,at.createCoreData=a,at.createDraggableData=c,at.getBoundPosition=n,at.getControlPosition=i,at.snapToGrid=r;var e=xs(),t=Dc();function n(d,h,f){if(!d.props.bounds)return[h,f];let{bounds:S}=d.props;S=typeof S=="string"?S:l(S);const m=u(d);if(typeof S=="string"){const{ownerDocument:w}=m,g=w.defaultView;let p;if(S==="parent"?p=m.parentNode:p=w.querySelector(S),!(p instanceof g.HTMLElement))throw new Error('Bounds selector "'+S+'" could not find an element.');const v=p,C=g.getComputedStyle(m),y=g.getComputedStyle(v);S={left:-m.offsetLeft+(0,e.int)(y.paddingLeft)+(0,e.int)(C.marginLeft),top:-m.offsetTop+(0,e.int)(y.paddingTop)+(0,e.int)(C.marginTop),right:(0,t.innerWidth)(v)-(0,t.outerWidth)(m)-m.offsetLeft+(0,e.int)(y.paddingRight)-(0,e.int)(C.marginRight),bottom:(0,t.innerHeight)(v)-(0,t.outerHeight)(m)-m.offsetTop+(0,e.int)(y.paddingBottom)-(0,e.int)(C.marginBottom)}}return(0,e.isNum)(S.right)&&(h=Math.min(h,S.right)),(0,e.isNum)(S.bottom)&&(f=Math.min(f,S.bottom)),(0,e.isNum)(S.left)&&(h=Math.max(h,S.left)),(0,e.isNum)(S.top)&&(f=Math.max(f,S.top)),[h,f]}function r(d,h,f){const S=Math.round(h/d[0])*d[0],m=Math.round(f/d[1])*d[1];return[S,m]}function o(d){return d.props.axis==="both"||d.props.axis==="x"}function s(d){return d.props.axis==="both"||d.props.axis==="y"}function i(d,h,f){const S=typeof h=="number"?(0,t.getTouch)(d,h):null;if(typeof h=="number"&&!S)return null;const m=u(f),w=f.props.offsetParent||m.offsetParent||m.ownerDocument.body;return(0,t.offsetXYFromParent)(S||d,w,f.props.scale)}function a(d,h,f){const S=!(0,e.isNum)(d.lastX),m=u(d);return S?{node:m,deltaX:0,deltaY:0,lastX:h,lastY:f,x:h,y:f}:{node:m,deltaX:h-d.lastX,deltaY:f-d.lastY,lastX:d.lastX,lastY:d.lastY,x:h,y:f}}function c(d,h){const f=d.props.scale;return{node:h.node,x:d.state.x+h.deltaX/f,y:d.state.y+h.deltaY/f,deltaX:h.deltaX/f,deltaY:h.deltaY/f,lastX:d.state.x,lastY:d.state.y}}function l(d){return{left:d.left,top:d.top,right:d.right,bottom:d.bottom}}function u(d){const h=d.findDOMNode();if(!h)throw new Error("<DraggableCore>: Unmounted during event!");return h}return at}var rr={},lo={},sd;function xg(){if(sd)return lo;sd=1,Object.defineProperty(lo,"__esModule",{value:!0}),lo.default=e;function e(){}return lo}var id;function GP(){if(id)return rr;id=1,Object.defineProperty(rr,"__esModule",{value:!0}),rr.default=void 0;var e=l(E),t=a(bs()),n=a(vt),r=Dc(),o=bg(),s=xs(),i=a(xg());function a(w){return w&&w.__esModule?w:{default:w}}function c(w){if(typeof WeakMap!="function")return null;var g=new WeakMap,p=new WeakMap;return(c=function(v){return v?p:g})(w)}function l(w,g){if(w&&w.__esModule)return w;if(w===null||typeof w!="object"&&typeof w!="function")return{default:w};var p=c(g);if(p&&p.has(w))return p.get(w);var v={},C=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var y in w)if(y!=="default"&&Object.prototype.hasOwnProperty.call(w,y)){var M=C?Object.getOwnPropertyDescriptor(w,y):null;M&&(M.get||M.set)?Object.defineProperty(v,y,M):v[y]=w[y]}return v.default=w,p&&p.set(w,v),v}function u(w,g,p){return g=d(g),g in w?Object.defineProperty(w,g,{value:p,enumerable:!0,configurable:!0,writable:!0}):w[g]=p,w}function d(w){var g=h(w,"string");return typeof g=="symbol"?g:String(g)}function h(w,g){if(typeof w!="object"||w===null)return w;var p=w[Symbol.toPrimitive];if(p!==void 0){var v=p.call(w,g);if(typeof v!="object")return v;throw new TypeError("@@toPrimitive must return a primitive value.")}return(g==="string"?String:Number)(w)}const f={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let S=f.mouse,m=class extends e.Component{constructor(){super(...arguments),u(this,"dragging",!1),u(this,"lastX",NaN),u(this,"lastY",NaN),u(this,"touchIdentifier",null),u(this,"mounted",!1),u(this,"handleDragStart",g=>{if(this.props.onMouseDown(g),!this.props.allowAnyClick&&typeof g.button=="number"&&g.button!==0)return!1;const p=this.findDOMNode();if(!p||!p.ownerDocument||!p.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:v}=p;if(this.props.disabled||!(g.target instanceof v.defaultView.Node)||this.props.handle&&!(0,r.matchesSelectorAndParentsTo)(g.target,this.props.handle,p)||this.props.cancel&&(0,r.matchesSelectorAndParentsTo)(g.target,this.props.cancel,p))return;g.type==="touchstart"&&g.preventDefault();const C=(0,r.getTouchIdentifier)(g);this.touchIdentifier=C;const y=(0,o.getControlPosition)(g,C,this);if(y==null)return;const{x:M,y:b}=y,T=(0,o.createCoreData)(this,M,b);(0,i.default)("DraggableCore: handleDragStart: %j",T),(0,i.default)("calling",this.props.onStart),!(this.props.onStart(g,T)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&(0,r.addUserSelectStyles)(v),this.dragging=!0,this.lastX=M,this.lastY=b,(0,r.addEvent)(v,S.move,this.handleDrag),(0,r.addEvent)(v,S.stop,this.handleDragStop))}),u(this,"handleDrag",g=>{const p=(0,o.getControlPosition)(g,this.touchIdentifier,this);if(p==null)return;let{x:v,y:C}=p;if(Array.isArray(this.props.grid)){let b=v-this.lastX,T=C-this.lastY;if([b,T]=(0,o.snapToGrid)(this.props.grid,b,T),!b&&!T)return;v=this.lastX+b,C=this.lastY+T}const y=(0,o.createCoreData)(this,v,C);if((0,i.default)("DraggableCore: handleDrag: %j",y),this.props.onDrag(g,y)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const T=document.createEvent("MouseEvents");T.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(T)}return}this.lastX=v,this.lastY=C}),u(this,"handleDragStop",g=>{if(!this.dragging)return;const p=(0,o.getControlPosition)(g,this.touchIdentifier,this);if(p==null)return;let{x:v,y:C}=p;if(Array.isArray(this.props.grid)){let T=v-this.lastX||0,R=C-this.lastY||0;[T,R]=(0,o.snapToGrid)(this.props.grid,T,R),v=this.lastX+T,C=this.lastY+R}const y=(0,o.createCoreData)(this,v,C);if(this.props.onStop(g,y)===!1||this.mounted===!1)return!1;const b=this.findDOMNode();b&&this.props.enableUserSelectHack&&(0,r.removeUserSelectStyles)(b.ownerDocument),(0,i.default)("DraggableCore: handleDragStop: %j",y),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,b&&((0,i.default)("DraggableCore: Removing handlers"),(0,r.removeEvent)(b.ownerDocument,S.move,this.handleDrag),(0,r.removeEvent)(b.ownerDocument,S.stop,this.handleDragStop))}),u(this,"onMouseDown",g=>(S=f.mouse,this.handleDragStart(g))),u(this,"onMouseUp",g=>(S=f.mouse,this.handleDragStop(g))),u(this,"onTouchStart",g=>(S=f.touch,this.handleDragStart(g))),u(this,"onTouchEnd",g=>(S=f.touch,this.handleDragStop(g)))}componentDidMount(){this.mounted=!0;const g=this.findDOMNode();g&&(0,r.addEvent)(g,f.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const g=this.findDOMNode();if(g){const{ownerDocument:p}=g;(0,r.removeEvent)(p,f.mouse.move,this.handleDrag),(0,r.removeEvent)(p,f.touch.move,this.handleDrag),(0,r.removeEvent)(p,f.mouse.stop,this.handleDragStop),(0,r.removeEvent)(p,f.touch.stop,this.handleDragStop),(0,r.removeEvent)(g,f.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,r.removeUserSelectStyles)(p)}}findDOMNode(){var g,p;return(g=this.props)!==null&&g!==void 0&&g.nodeRef?(p=this.props)===null||p===void 0||(p=p.nodeRef)===null||p===void 0?void 0:p.current:n.default.findDOMNode(this)}render(){return e.cloneElement(e.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};return rr.default=m,u(m,"displayName","DraggableCore"),u(m,"propTypes",{allowAnyClick:t.default.bool,children:t.default.node.isRequired,disabled:t.default.bool,enableUserSelectHack:t.default.bool,offsetParent:function(w,g){if(w[g]&&w[g].nodeType!==1)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:t.default.arrayOf(t.default.number),handle:t.default.string,cancel:t.default.string,nodeRef:t.default.object,onStart:t.default.func,onDrag:t.default.func,onStop:t.default.func,onMouseDown:t.default.func,scale:t.default.number,className:s.dontSetMe,style:s.dontSetMe,transform:s.dontSetMe}),u(m,"defaultProps",{allowAnyClick:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1}),rr}var ad;function qP(){return ad||(ad=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"DraggableCore",{enumerable:!0,get:function(){return c.default}}),e.default=void 0;var t=h(E),n=u(bs()),r=u(vt),o=u(YP),s=Dc(),i=bg(),a=xs(),c=u(GP()),l=u(xg());function u(p){return p&&p.__esModule?p:{default:p}}function d(p){if(typeof WeakMap!="function")return null;var v=new WeakMap,C=new WeakMap;return(d=function(y){return y?C:v})(p)}function h(p,v){if(p&&p.__esModule)return p;if(p===null||typeof p!="object"&&typeof p!="function")return{default:p};var C=d(v);if(C&&C.has(p))return C.get(p);var y={},M=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var b in p)if(b!=="default"&&Object.prototype.hasOwnProperty.call(p,b)){var T=M?Object.getOwnPropertyDescriptor(p,b):null;T&&(T.get||T.set)?Object.defineProperty(y,b,T):y[b]=p[b]}return y.default=p,C&&C.set(p,y),y}function f(){return f=Object.assign?Object.assign.bind():function(p){for(var v=1;v<arguments.length;v++){var C=arguments[v];for(var y in C)Object.prototype.hasOwnProperty.call(C,y)&&(p[y]=C[y])}return p},f.apply(this,arguments)}function S(p,v,C){return v=m(v),v in p?Object.defineProperty(p,v,{value:C,enumerable:!0,configurable:!0,writable:!0}):p[v]=C,p}function m(p){var v=w(p,"string");return typeof v=="symbol"?v:String(v)}function w(p,v){if(typeof p!="object"||p===null)return p;var C=p[Symbol.toPrimitive];if(C!==void 0){var y=C.call(p,v);if(typeof y!="object")return y;throw new TypeError("@@toPrimitive must return a primitive value.")}return(v==="string"?String:Number)(p)}class g extends t.Component{static getDerivedStateFromProps(v,C){let{position:y}=v,{prevPropsPosition:M}=C;return y&&(!M||y.x!==M.x||y.y!==M.y)?((0,l.default)("Draggable: getDerivedStateFromProps %j",{position:y,prevPropsPosition:M}),{x:y.x,y:y.y,prevPropsPosition:{...y}}):null}constructor(v){super(v),S(this,"onDragStart",(C,y)=>{if((0,l.default)("Draggable: onDragStart: %j",y),this.props.onStart(C,(0,i.createDraggableData)(this,y))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),S(this,"onDrag",(C,y)=>{if(!this.state.dragging)return!1;(0,l.default)("Draggable: onDrag: %j",y);const M=(0,i.createDraggableData)(this,y),b={x:M.x,y:M.y,slackX:0,slackY:0};if(this.props.bounds){const{x:R,y:_}=b;b.x+=this.state.slackX,b.y+=this.state.slackY;const[O,z]=(0,i.getBoundPosition)(this,b.x,b.y);b.x=O,b.y=z,b.slackX=this.state.slackX+(R-b.x),b.slackY=this.state.slackY+(_-b.y),M.x=b.x,M.y=b.y,M.deltaX=b.x-this.state.x,M.deltaY=b.y-this.state.y}if(this.props.onDrag(C,M)===!1)return!1;this.setState(b)}),S(this,"onDragStop",(C,y)=>{if(!this.state.dragging||this.props.onStop(C,(0,i.createDraggableData)(this,y))===!1)return!1;(0,l.default)("Draggable: onDragStop: %j",y);const b={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x:R,y:_}=this.props.position;b.x=R,b.y=_}this.setState(b)}),this.state={dragging:!1,dragged:!1,x:v.position?v.position.x:v.defaultPosition.x,y:v.position?v.position.y:v.defaultPosition.y,prevPropsPosition:{...v.position},slackX:0,slackY:0,isElementSVG:!1},v.position&&!(v.onDrag||v.onStop)&&console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){typeof window.SVGElement<"u"&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.setState({dragging:!1})}findDOMNode(){var v,C;return(v=(C=this.props)===null||C===void 0||(C=C.nodeRef)===null||C===void 0?void 0:C.current)!==null&&v!==void 0?v:r.default.findDOMNode(this)}render(){const{axis:v,bounds:C,children:y,defaultPosition:M,defaultClassName:b,defaultClassNameDragging:T,defaultClassNameDragged:R,position:_,positionOffset:O,scale:z,...G}=this.props;let j={},F=null;const k=!!!_||this.state.dragging,P=_||M,I={x:(0,i.canDragX)(this)&&k?this.state.x:P.x,y:(0,i.canDragY)(this)&&k?this.state.y:P.y};this.state.isElementSVG?F=(0,s.createSVGTransform)(I,O):j=(0,s.createCSSTransform)(I,O);const A=(0,o.default)(y.props.className||"",b,{[T]:this.state.dragging,[R]:this.state.dragged});return t.createElement(c.default,f({},G,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),t.cloneElement(t.Children.only(y),{className:A,style:{...y.props.style,...j},transform:F}))}}e.default=g,S(g,"displayName","Draggable"),S(g,"propTypes",{...c.default.propTypes,axis:n.default.oneOf(["both","x","y","none"]),bounds:n.default.oneOfType([n.default.shape({left:n.default.number,right:n.default.number,top:n.default.number,bottom:n.default.number}),n.default.string,n.default.oneOf([!1])]),defaultClassName:n.default.string,defaultClassNameDragging:n.default.string,defaultClassNameDragged:n.default.string,defaultPosition:n.default.shape({x:n.default.number,y:n.default.number}),positionOffset:n.default.shape({x:n.default.oneOfType([n.default.number,n.default.string]),y:n.default.oneOfType([n.default.number,n.default.string])}),position:n.default.shape({x:n.default.number,y:n.default.number}),className:a.dontSetMe,style:a.dontSetMe,transform:a.dontSetMe}),S(g,"defaultProps",{...c.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})}(ei)),ei}var cd;function wg(){if(cd)return nr.exports;cd=1;const{default:e,DraggableCore:t}=qP();return nr.exports=e,nr.exports.default=e,nr.exports.DraggableCore=t,nr.exports}var uo={},ld;function XP(){if(ld)return uo;ld=1,uo.__esModule=!0,uo.cloneElement=a;var e=t(E);function t(c){return c&&c.__esModule?c:{default:c}}function n(c,l){var u=Object.keys(c);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(c);l&&(d=d.filter(function(h){return Object.getOwnPropertyDescriptor(c,h).enumerable})),u.push.apply(u,d)}return u}function r(c){for(var l=1;l<arguments.length;l++){var u=arguments[l]!=null?arguments[l]:{};l%2?n(Object(u),!0).forEach(function(d){o(c,d,u[d])}):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(u)):n(Object(u)).forEach(function(d){Object.defineProperty(c,d,Object.getOwnPropertyDescriptor(u,d))})}return c}function o(c,l,u){return l=s(l),l in c?Object.defineProperty(c,l,{value:u,enumerable:!0,configurable:!0,writable:!0}):c[l]=u,c}function s(c){var l=i(c,"string");return typeof l=="symbol"?l:String(l)}function i(c,l){if(typeof c!="object"||c===null)return c;var u=c[Symbol.toPrimitive];if(u!==void 0){var d=u.call(c,l);if(typeof d!="object")return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return(l==="string"?String:Number)(c)}function a(c,l){return l.style&&c.props.style&&(l.style=r(r({},c.props.style),l.style)),l.className&&c.props.className&&(l.className=c.props.className+" "+l.className),e.default.cloneElement(c,l)}return uo}var or={},ud;function Sg(){if(ud)return or;ud=1,or.__esModule=!0,or.resizableProps=void 0;var e=t(bs());wg();function t(r){return r&&r.__esModule?r:{default:r}}var n={axis:e.default.oneOf(["both","x","y","none"]),className:e.default.string,children:e.default.element.isRequired,draggableOpts:e.default.shape({allowAnyClick:e.default.bool,cancel:e.default.string,children:e.default.node,disabled:e.default.bool,enableUserSelectHack:e.default.bool,offsetParent:e.default.node,grid:e.default.arrayOf(e.default.number),handle:e.default.string,nodeRef:e.default.object,onStart:e.default.func,onDrag:e.default.func,onStop:e.default.func,onMouseDown:e.default.func,scale:e.default.number}),height:function(){for(var o=arguments.length,s=new Array(o),i=0;i<o;i++)s[i]=arguments[i];var a=s[0];if(a.axis==="both"||a.axis==="y"){var c;return(c=e.default.number).isRequired.apply(c,s)}return e.default.number.apply(e.default,s)},handle:e.default.oneOfType([e.default.node,e.default.func]),handleSize:e.default.arrayOf(e.default.number),lockAspectRatio:e.default.bool,maxConstraints:e.default.arrayOf(e.default.number),minConstraints:e.default.arrayOf(e.default.number),onResizeStop:e.default.func,onResizeStart:e.default.func,onResize:e.default.func,resizeHandles:e.default.arrayOf(e.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),transformScale:e.default.number,width:function(){for(var o=arguments.length,s=new Array(o),i=0;i<o;i++)s[i]=arguments[i];var a=s[0];if(a.axis==="both"||a.axis==="x"){var c;return(c=e.default.number).isRequired.apply(c,s)}return e.default.number.apply(e.default,s)}};return or.resizableProps=n,or}var dd;function Cg(){if(dd)return tr;dd=1,tr.__esModule=!0,tr.default=void 0;var e=i(E),t=wg(),n=XP(),r=Sg(),o=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function s(g){if(typeof WeakMap!="function")return null;var p=new WeakMap,v=new WeakMap;return(s=function(y){return y?v:p})(g)}function i(g,p){if(g&&g.__esModule)return g;if(g===null||typeof g!="object"&&typeof g!="function")return{default:g};var v=s(p);if(v&&v.has(g))return v.get(g);var C={},y=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var M in g)if(M!=="default"&&Object.prototype.hasOwnProperty.call(g,M)){var b=y?Object.getOwnPropertyDescriptor(g,M):null;b&&(b.get||b.set)?Object.defineProperty(C,M,b):C[M]=g[M]}return C.default=g,v&&v.set(g,C),C}function a(){return a=Object.assign?Object.assign.bind():function(g){for(var p=1;p<arguments.length;p++){var v=arguments[p];for(var C in v)Object.prototype.hasOwnProperty.call(v,C)&&(g[C]=v[C])}return g},a.apply(this,arguments)}function c(g,p){if(g==null)return{};var v={},C=Object.keys(g),y,M;for(M=0;M<C.length;M++)y=C[M],!(p.indexOf(y)>=0)&&(v[y]=g[y]);return v}function l(g,p){var v=Object.keys(g);if(Object.getOwnPropertySymbols){var C=Object.getOwnPropertySymbols(g);p&&(C=C.filter(function(y){return Object.getOwnPropertyDescriptor(g,y).enumerable})),v.push.apply(v,C)}return v}function u(g){for(var p=1;p<arguments.length;p++){var v=arguments[p]!=null?arguments[p]:{};p%2?l(Object(v),!0).forEach(function(C){d(g,C,v[C])}):Object.getOwnPropertyDescriptors?Object.defineProperties(g,Object.getOwnPropertyDescriptors(v)):l(Object(v)).forEach(function(C){Object.defineProperty(g,C,Object.getOwnPropertyDescriptor(v,C))})}return g}function d(g,p,v){return p=h(p),p in g?Object.defineProperty(g,p,{value:v,enumerable:!0,configurable:!0,writable:!0}):g[p]=v,g}function h(g){var p=f(g,"string");return typeof p=="symbol"?p:String(p)}function f(g,p){if(typeof g!="object"||g===null)return g;var v=g[Symbol.toPrimitive];if(v!==void 0){var C=v.call(g,p);if(typeof C!="object")return C;throw new TypeError("@@toPrimitive must return a primitive value.")}return(p==="string"?String:Number)(g)}function S(g,p){g.prototype=Object.create(p.prototype),g.prototype.constructor=g,m(g,p)}function m(g,p){return m=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(C,y){return C.__proto__=y,C},m(g,p)}var w=function(g){S(p,g);function p(){for(var C,y=arguments.length,M=new Array(y),b=0;b<y;b++)M[b]=arguments[b];return C=g.call.apply(g,[this].concat(M))||this,C.handleRefs={},C.lastHandleRect=null,C.slack=null,C}var v=p.prototype;return v.componentWillUnmount=function(){this.resetData()},v.resetData=function(){this.lastHandleRect=this.slack=null},v.runConstraints=function(y,M){var b=this.props,T=b.minConstraints,R=b.maxConstraints,_=b.lockAspectRatio;if(!T&&!R&&!_)return[y,M];if(_){var O=this.props.width/this.props.height,z=y-this.props.width,G=M-this.props.height;Math.abs(z)>Math.abs(G*O)?M=y/O:y=M*O}var j=y,F=M,N=this.slack||[0,0],k=N[0],P=N[1];return y+=k,M+=P,T&&(y=Math.max(T[0],y),M=Math.max(T[1],M)),R&&(y=Math.min(R[0],y),M=Math.min(R[1],M)),this.slack=[k+(j-y),P+(F-M)],[y,M]},v.resizeHandler=function(y,M){var b=this;return function(T,R){var _=R.node,O=R.deltaX,z=R.deltaY;y==="onResizeStart"&&b.resetData();var G=(b.props.axis==="both"||b.props.axis==="x")&&M!=="n"&&M!=="s",j=(b.props.axis==="both"||b.props.axis==="y")&&M!=="e"&&M!=="w";if(!(!G&&!j)){var F=M[0],N=M[M.length-1],k=_.getBoundingClientRect();if(b.lastHandleRect!=null){if(N==="w"){var P=k.left-b.lastHandleRect.left;O+=P}if(F==="n"){var I=k.top-b.lastHandleRect.top;z+=I}}b.lastHandleRect=k,N==="w"&&(O=-O),F==="n"&&(z=-z);var A=b.props.width+(G?O/b.props.transformScale:0),V=b.props.height+(j?z/b.props.transformScale:0),W=b.runConstraints(A,V);A=W[0],V=W[1];var H=A!==b.props.width||V!==b.props.height,L=typeof b.props[y]=="function"?b.props[y]:null,Y=y==="onResize"&&!H;L&&!Y&&(T.persist==null||T.persist(),L(T,{node:_,size:{width:A,height:V},handle:M})),y==="onResizeStop"&&b.resetData()}}},v.renderResizeHandle=function(y,M){var b=this.props.handle;if(!b)return e.createElement("span",{className:"react-resizable-handle react-resizable-handle-"+y,ref:M});if(typeof b=="function")return b(y,M);var T=typeof b.type=="string",R=u({ref:M},T?{}:{handleAxis:y});return e.cloneElement(b,R)},v.render=function(){var y=this,M=this.props,b=M.children,T=M.className,R=M.draggableOpts;M.width,M.height,M.handle,M.handleSize,M.lockAspectRatio,M.axis,M.minConstraints,M.maxConstraints,M.onResize,M.onResizeStop,M.onResizeStart;var _=M.resizeHandles;M.transformScale;var O=c(M,o);return(0,n.cloneElement)(b,u(u({},O),{},{className:(T?T+" ":"")+"react-resizable",children:[].concat(b.props.children,_.map(function(z){var G,j=(G=y.handleRefs[z])!=null?G:y.handleRefs[z]=e.createRef();return e.createElement(t.DraggableCore,a({},R,{nodeRef:j,key:"resizableHandle-"+z,onStop:y.resizeHandler("onResizeStop",z),onStart:y.resizeHandler("onResizeStart",z),onDrag:y.resizeHandler("onResize",z)}),y.renderResizeHandle(z,j))}))}))},p}(e.Component);return tr.default=w,w.propTypes=r.resizableProps,w.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1},tr}var sr={},fd;function ZP(){if(fd)return sr;fd=1,sr.__esModule=!0,sr.default=void 0;var e=a(E),t=s(bs()),n=s(Cg()),r=Sg(),o=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function s(p){return p&&p.__esModule?p:{default:p}}function i(p){if(typeof WeakMap!="function")return null;var v=new WeakMap,C=new WeakMap;return(i=function(M){return M?C:v})(p)}function a(p,v){if(p&&p.__esModule)return p;if(p===null||typeof p!="object"&&typeof p!="function")return{default:p};var C=i(v);if(C&&C.has(p))return C.get(p);var y={},M=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var b in p)if(b!=="default"&&Object.prototype.hasOwnProperty.call(p,b)){var T=M?Object.getOwnPropertyDescriptor(p,b):null;T&&(T.get||T.set)?Object.defineProperty(y,b,T):y[b]=p[b]}return y.default=p,C&&C.set(p,y),y}function c(){return c=Object.assign?Object.assign.bind():function(p){for(var v=1;v<arguments.length;v++){var C=arguments[v];for(var y in C)Object.prototype.hasOwnProperty.call(C,y)&&(p[y]=C[y])}return p},c.apply(this,arguments)}function l(p,v){var C=Object.keys(p);if(Object.getOwnPropertySymbols){var y=Object.getOwnPropertySymbols(p);v&&(y=y.filter(function(M){return Object.getOwnPropertyDescriptor(p,M).enumerable})),C.push.apply(C,y)}return C}function u(p){for(var v=1;v<arguments.length;v++){var C=arguments[v]!=null?arguments[v]:{};v%2?l(Object(C),!0).forEach(function(y){d(p,y,C[y])}):Object.getOwnPropertyDescriptors?Object.defineProperties(p,Object.getOwnPropertyDescriptors(C)):l(Object(C)).forEach(function(y){Object.defineProperty(p,y,Object.getOwnPropertyDescriptor(C,y))})}return p}function d(p,v,C){return v=h(v),v in p?Object.defineProperty(p,v,{value:C,enumerable:!0,configurable:!0,writable:!0}):p[v]=C,p}function h(p){var v=f(p,"string");return typeof v=="symbol"?v:String(v)}function f(p,v){if(typeof p!="object"||p===null)return p;var C=p[Symbol.toPrimitive];if(C!==void 0){var y=C.call(p,v);if(typeof y!="object")return y;throw new TypeError("@@toPrimitive must return a primitive value.")}return(v==="string"?String:Number)(p)}function S(p,v){if(p==null)return{};var C={},y=Object.keys(p),M,b;for(b=0;b<y.length;b++)M=y[b],!(v.indexOf(M)>=0)&&(C[M]=p[M]);return C}function m(p,v){p.prototype=Object.create(v.prototype),p.prototype.constructor=p,w(p,v)}function w(p,v){return w=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(y,M){return y.__proto__=M,y},w(p,v)}var g=function(p){m(v,p);function v(){for(var y,M=arguments.length,b=new Array(M),T=0;T<M;T++)b[T]=arguments[T];return y=p.call.apply(p,[this].concat(b))||this,y.state={width:y.props.width,height:y.props.height,propsWidth:y.props.width,propsHeight:y.props.height},y.onResize=function(R,_){var O=_.size;y.props.onResize?(R.persist==null||R.persist(),y.setState(O,function(){return y.props.onResize&&y.props.onResize(R,_)})):y.setState(O)},y}v.getDerivedStateFromProps=function(M,b){return b.propsWidth!==M.width||b.propsHeight!==M.height?{width:M.width,height:M.height,propsWidth:M.width,propsHeight:M.height}:null};var C=v.prototype;return C.render=function(){var M=this.props,b=M.handle,T=M.handleSize;M.onResize;var R=M.onResizeStart,_=M.onResizeStop,O=M.draggableOpts,z=M.minConstraints,G=M.maxConstraints,j=M.lockAspectRatio,F=M.axis;M.width,M.height;var N=M.resizeHandles,k=M.style,P=M.transformScale,I=S(M,o);return e.createElement(n.default,{axis:F,draggableOpts:O,handle:b,handleSize:T,height:this.state.height,lockAspectRatio:j,maxConstraints:G,minConstraints:z,onResizeStart:R,onResize:this.onResize,onResizeStop:_,resizeHandles:N,transformScale:P,width:this.state.width},e.createElement("div",c({},I,{style:u(u({},k),{},{width:this.state.width+"px",height:this.state.height+"px"})})))},v}(e.Component);return sr.default=g,g.propTypes=u(u({},r.resizableProps),{},{children:t.default.element}),sr}var hd;function JP(){return hd||(hd=1,er.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")},er.exports.Resizable=Cg().default,er.exports.ResizableBox=ZP().default),er.exports}var Tg=JP();const pd=({booking:e,slotData:t,customClasses:n,hoveringAdditionalCardId:r="",children:o,ref:s})=>{const[i,a]=E.useState(!1),c=Le(is(y=>y.bookingViewType)),{updateIsDragging:l,isDragging:u}=hn(y=>y),{attributes:d,listeners:h,setNodeRef:f,isDragging:S,transform:m}=ua({id:e.id,data:{type:"booking-slots",booking:e,slotData:t},disabled:e.disabledResize==="full"||e.disabledResize==="half"||e.startAt.getDate()!==e.finishAt.getDate()}),w=m?{transform:`translate3d(${m.x}px, ${m.y}px, 0)`}:void 0;_r({onDragStart:()=>g(),onDragAbort:()=>p(),onDragCancel:()=>p(),onDragEnd:()=>p()});const g=E.useCallback(()=>{l(!0)},[]),p=E.useCallback(()=>{l(!1)},[]),v=E.useMemo(()=>({cursor:u?"ns-resize":"pointer",width:c===se.DAY?"99%":"100%"}),[u,c]),C=(y,M)=>r!=null&&r.length?y===M:!1;if(E.useImperativeHandle(s,()=>({changeCurrentCardResize:()=>a(y=>!y)})),!S)return x.jsx("div",{ref:f,className:de("cardContent_render",(i||C(r,e.id))&&"cardContent_render_dragging",n),style:{...w,...v},...h,...d,children:o},e.id)};function QP(e,t){const n=e>new Date(t.startAt),r=e<new Date(t.finishAt);return n&&r}const eA={calculateOverlappingBookings:(e,t)=>{const n=t.filter(o=>{const s=new Date(o.startAt).getDate(),i=e.startAt.getDate();return s===i&&o.id!==e.id});let r=0;for(const o of n)QP(e.startAt,o)&&r++;return r}},Ec=({bookingInit:e,slotData:t,heightStyle:n,topHeightIncrement:r,customClasses:o,bookingViewType:s,resizableParam:i,events:a,open:c=!0,lastCard:l,half:u,cardContentRef:d,cardsQuantity:h,cardIndex:f,hoveringAdditionalCardId:S,ref:m})=>{var H;const w=hn(is(L=>L.updateIsDragging)),{emptySlotNodes:g}=Tt(),{bookings:p,onCardResizeEnd:v}=Lt(),[C,y]=E.useState(""),M=E.useRef(null),b=E.useMemo(()=>s===se.DAY?{width:"99%"}:{width:"100%"},[s]),T=(L,Y)=>{var K;R("show-handle",!0),i!=null&&i.onResizeStart&&i.onResizeStart(L,Y),(K=M.current)==null||K.changeCurrentCardResize()},R=(L="",Y=!1)=>{y(L),w(Y)},_=(L,Y)=>{var K;(K=M.current)==null||K.changeCurrentCardResize(),R(),Y.handle.includes("n")&&v(Mi.resizeBookingNorthId(e)),Y.handle.includes("s")&&v(Mi.resizeBookingSouthId(e)),i!=null&&i.onResizeStop&&i.onResizeStop(L,Y)},O=E.useMemo(()=>eA.calculateOverlappingBookings(e,p),[e,p]),z=E.useMemo(()=>de(i==null?void 0:i.customClass,C,u&&O>0&&"",u?"":O>0&&"inner_cards_parent",l&&O&&u&&"inner_cards_parent_last_card_disable",l&&O&&"inner_cards_parent_last_card",l&&O===2&&"inner_cards_parent_last_card_layer_2",O===1&&!u&&"inner_cards_parent_1_layer",O===2&&"inner_cards_parent_2_layer",u&&O===3&&"inner_cards_parent_resizable_layer_3_half inner_cards_parent_3_layer_half",O===3&&"inner_cards_parent_resizable_layer_3 inner_cards_parent_3_layer"),[i,C,u,O,l]),G=L=>L===0?"8rem":"4rem",j=E.useMemo(()=>u&&f===0&&h===3||u&&f===1&&h===3?G(f):O===2?"0.8rem":l&&O===1?"0.2rem":l&&O?"1rem":O===1?"0.4rem":0,[u,l,O,f,h]),F=E.useMemo(()=>u&&f===0&&h===3&&!O?"0rem":u&&f===0&&h===3?"0.4rem":u&&f===1&&h===3?"5rem":l&&h===3?"9rem":l?"6.5rem":0,[u,l,f,O,h]),N=E.useMemo(()=>u&&h===3&&(u&&f===0||u&&f===1)||u&&l&&h===3||u&&l?{inset:`${r}rem ${j} ${n}rem ${F}`}:u&&h===3||u?{inset:`${r}rem 6.5rem ${n}rem ${j}`}:{inset:`${r||0}rem ${j} ${n}rem`},[u,O,n,r,f,h,j,F]),k=(L,Y)=>{const K=g.get(Y);K==null||K.hoveringAdditionalCard(L.id)},P=L=>{const Y=g.get(L);Y==null||Y.clearHoveringCard()},I=(L,Y)=>{({mouseenter:()=>k(e,L),mouseleave:()=>P(L)}[Y]||(()=>console.warn(`Unhandled event type: ${Y}`)))()},A=L=>{const Y=L.toDateString();return on({key:Y,time:ta})},V=L=>{const Y=Z.calculateDaysDifference(e.finishAt,e.startAt);if(Y===1){I(A(e.finishAt),L);return}const K=Z.buildFutureDateList(e,Y);for(const $ of K)I(A($),L)},W=L=>{const Y=L.type;if(e!=null&&e.nodes)for(const K of e.nodes)I(K,Y);V(Y)};if(E.useEffect(()=>()=>{a!=null&&a.onUnmount&&a.onUnmount()},[]),E.useImperativeHandle(d,()=>({changeCurrentCardResize:()=>{var L;(L=M.current)==null||L.changeCurrentCardResize()}})),!c&&!e.finishAt)return null;if((H=i==null?void 0:i.state)!=null&&H.height){const{state:L,onResize:Y,resizeHandle:K=["s","n"]}=i,$=()=>{switch(e==null?void 0:e.disabledResize){case"full":return[];case"half":return["s"];default:return K}};return x.jsx(Tg.Resizable,{className:de(z),height:L==null?void 0:L.height,width:L==null?void 0:L.width,onResize:Y,onResizeStart:T,onResizeStop:_,resizeHandles:$(),draggableOpts:{grid:[35,35]},handleSize:[20,20],maxConstraints:[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY],transformScale:1,children:x.jsx("div",{className:"card_content_core",style:{...N},onMouseEnter:W,onMouseLeave:W,onBlur:()=>{},children:x.jsx(pd,{ref:M,booking:e,slotData:t,layerCount:O,half:u,hoveringAdditionalCardId:S,children:x.jsx(Ri,{booking:e,slotData:t,events:{onClick:a==null?void 0:a.onClick}})},e.id)})})}return x.jsx("div",{ref:m,className:"card_content_core",style:{...b,...N},children:x.jsx(pd,{customClasses:o,booking:e,slotData:t,children:x.jsx(Ri,{booking:e,slotData:t,events:{onClick:a==null?void 0:a.onClick}})})})},md=({booking:e,slotData:t,cardsQuantity:n=1,cardIndex:r=0,lastCard:o=!1,half:s=!1,hoveringAdditionalCardId:i,ref:a})=>{const{bookingViewType:c}=Le(),[l,u]=E.useState({...e});E.useEffect(()=>{e&&u(e)},[e]);const[d,h]=E.useState(!1),f=E.useRef("left"),S=()=>{const M=t.day.split(":")[0].trim();if(c===se.DAY)f.current="top";else switch(M){case"Mon":case"Sun":f.current="right";break;default:f.current="left";break}h(!0)},m=async M=>{try{u(b=>({...b,finishAt:M}))}catch(b){console.log(b)}},w=async M=>{u(b=>({...b,startAt:M}))},g=async M=>{try{u(b=>({...b,finishAt:M}))}catch(b){console.log(b)}},{state:p,heightStyle:v,topHeightIncrement:C,onResize:y}=Am({booking:l,onAddTime:m,onAddStartTime:w,onSubTime:g,starter:!0});return E.useImperativeHandle(a,()=>({bookingId:e.id}),[e.id]),x.jsx(mg,{booking:l,onOpenChange:h,side:c===se.DAY?"top":"left",isEditingOpen:d,children:x.jsx(Ec,{resizableParam:{state:p,onResize:y,resizeHandle:["s","n"]},customClasses:"Draggable",bookingInit:l,bookingViewType:c,slotData:t,topHeightIncrement:C,heightStyle:v,events:{onClick:S},half:s,lastCard:o,cardsQuantity:n,cardIndex:r,hoveringAdditionalCardId:i})})},gd=({bookings:e,blockTimeString:t,slotData:n,hoveringAdditionalCardId:r})=>{if(!e||!(n!=null&&n.day)&&!(n!=null&&n.hour)||!t)return null;const o=E.useMemo(()=>e.filter(s=>Z.dateAndHourDateToString(new Date(s.startAt)).split(":")[1]===t),[e,t]);if(!(!o||!(o!=null&&o.length)))return o.length===1?x.jsx(md,{booking:o[0],slotData:n,hoveringAdditionalCardId:r}):x.jsx(x.Fragment,{children:o.map((s,i)=>x.jsx(md,{booking:s,half:!0,slotData:n,lastCard:o.length-1===i,cardsQuantity:o.length,cardIndex:i,hoveringAdditionalCardId:r},s.id))})},tA=e=>{const t=E.use(Nd);if(!t)throw new Error("useConfig must be used within a ConfigContext");return Wo(t,e)},nA=-Math.abs(1.98),rA={DOWN:"DOWN"},oA=({booking:e,onAddTime:t,onStartAtChange:n,onSubTime:r,starter:o=!1})=>{const[s,i]=E.useState({height:jt,width:jt}),[a,c]=E.useState(0),l=(b,T)=>{const R=Z.timeDiffInSeconds(b,T),_=Math.ceil(R/li);return-Math.abs((_-1)*2)},[u,d]=E.useState(o?l(e.finishAt,e.startAt):0),h=b=>b===-Math.abs(0)||b===0,f=async b=>{console.log("addTime"),console.log("direction",b);const T=g(e.finishAt,"add");d(R=>h(R)?nA:R-2),t&&t(T)},S=async()=>{const b=g(e.finishAt,"remove");d(T=>T+2),r&&r(b)},m=async()=>{const b=p(e.startAt,"remove");c(T=>T-2),n&&n(b)},w=async()=>{const b=p(e.startAt,"add");c(T=>T+2),n&&n(b)},g=(b,T)=>{const R=new Date(b),_=R.getMinutes();return T==="add"&&R.setMinutes(_+15),T==="remove"&&R.setMinutes(_-15),R},p=(b,T)=>{const R=new Date(b),_=R.getMinutes();return T==="add"&&R.setMinutes(_+15),T==="remove"&&R.setMinutes(_-15),R};return{state:s,setState:i,resetState:()=>{i({height:jt,width:jt})},resetHeightStyle:()=>{d(0)},heightStyle:u,topHeightIncrement:a,onResize:(b,{size:T})=>{b.stopPropagation(),b.preventDefault();const R=T.height;i(_=>(_.height<R&&(a!==0?w():f(rA.DOWN)),_.height>R&&(R<600?m():S()),{..._,height:R}))},updateHeightStyle:(b,T)=>{d(l(b,T))}}},sA=E.forwardRef(({slotData:e,events:{onClick:t,renderPreviewCard:n}},r)=>{const[o,s]=E.useState(!1),[i,a]=E.useState(e.time),[c,l]=E.useState(Z.addMinutesToHour(i,15)),{isDragging:u}=hn(k=>k),d=Le(k=>k.bookingViewType),{systemColor:h,isTimeInfoVisible:f}=tA(k=>k),[S,m]=E.useState(!1),[w,g]=E.useState(!1),p=E.useRef(null),v=w?{backgroundColor:"white",border:"none"}:{},C=E.useMemo(()=>({id:"dragging_booking_preview",startAt:Z.convertStringTimeToDateFormat(i),finishAt:Z.convertStringTimeToDateFormat(c)}),[c,i]),y=()=>{m(!0),g(!0),n()},M=()=>{m(!1),t(c,i)};E.useEffect(()=>{var k;S&&((k=p.current)==null||k.changeCurrentCardResize())},[S]);const{state:b,resetState:T,resetHeightStyle:R,heightStyle:_,onResize:O,updateHeightStyle:z,topHeightIncrement:G}=oA({booking:C,onAddTime:k=>{console.log("onAddTime date time",k),l(Z.dateTimeAsString(k))},onStartAtChange:k=>{console.log("onStartAtChange date time",k),a(Z.dateTimeAsString(k))},onSubTime:k=>{console.log("onSubTime date time",k),l(Z.dateTimeAsString(k))}}),j=()=>{},F=()=>{l(Z.addMinutesToHour(e.time,15))},N=()=>{g(!1),F(),T(),R()};if(E.useEffect(()=>{if(!c||!i)return;const k=Z.convertStringTimeToDateFormat(c),P=Z.convertStringTimeToDateFormat(e.time);Number.isNaN(k)||Number.isNaN(P)||!(k instanceof Date)||!(P instanceof Date)||z(k,P)},[c,i]),E.useImperativeHandle(r,()=>({show:()=>s(!0),hide:()=>s(!1),changeIsOpen:k=>s(k),reset:N}),[]),!!o)return x.jsx("div",{style:{...v,border:f&&!u?`1.5px solid ${h}`:"none"},className:de("timeInfo_core",v),children:x.jsx(Tg.Resizable,{className:"slot-resizable",height:b.height,width:b.width,onResizeStart:y,onResizeStop:M,onResize:O,resizeHandles:["se"],draggableOpts:{grid:[35,35]},handleSize:[30,30],maxConstraints:[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY],transformScale:1,children:w?x.jsx("div",{className:"timeInfo_core_dragging",children:x.jsx(Ec,{bookingInit:C,bookingViewType:d,slotData:{day:new Date().toISOString(),hour:"09:00"},topHeightIncrement:G,heightStyle:_,cardContentRef:p,resizableParam:{state:b,onResize:O,customClass:"show-handle"},events:{onUnmount:j}})}):x.jsx("div",{className:"timeInfo_core_timeParent",children:!u&&x.jsx("span",{className:"timeInfo_core_timeParent_time",style:{color:h,display:f?"initial":"none"},children:e.time})})})})}),fo=({slotData:e,blockTimeString:t,dayHour:n,slotPosition:r,disabledCss:o,events:s,bookings:i,children:a,ref:c})=>{const{isDragging:l,updateIsDragging:u}=hn(J=>J),{emptySlotNodes:d,setSelectedNode:h}=Tt(),{onModalClose:f,onSlotClick:S}=Lt(),{startAt:m,finishAt:w,updateDate:g,updateStartAt:p,updateFinishAtWithOffset:v}=kd(J=>J),C=Le(J=>J.bookingViewType),[y,M]=E.useState(!1),[b,T]=E.useState(!1),[R,_]=E.useState([]),[O,z]=E.useState(""),G=E.useRef(null),j=E.useRef(null),F=E.useRef(null),N=J=>{_(ce=>ce.filter(ye=>ye.id!==J.id))},k=(J,ce,ye=!1)=>{const Ve=new Date(J.finishAt);Ve.setHours(24,0);const He=[{id:J.id,finishAt:ye?Ve:J.finishAt,overflow:!0,startAt:Mi.resetToFirstHourNextDay(J),disabledResize:ye?"full":"half",nodes:ce}];_(He)},P=()=>F.current,I=()=>{var J;(J=F.current)==null||J.isModalOpen()},A=()=>{var J;(J=P())==null||J.showCreationModal()},V=()=>{var J;(J=j.current)==null||J.show()},W=()=>{var J;(J=j.current)==null||J.hide()},H=J=>{var ce;(ce=j.current)==null||ce.changeIsOpen(J)},L=E.useMemo(()=>({id:"dragging_booking_preview",startAt:Z.convertStringTimeToDateFormat(m),finishAt:Z.convertStringTimeToDateFormat(w)}),[w,m]),{updateHeightStyle:Y,heightStyle:K}=Am({booking:L}),$=(J,ce)=>!ce||!(ce!=null&&ce.length)?!1:!!ce.find(ye=>Z.dateTimeAsString(ye.startAt)===J),q=E.useCallback(()=>{if($(e.time,i)||l||I()||y)return;s.onMouseEnterEvent()===r&&V()},[r,l,y,s,R,i]),X=J=>{var Ve,He;console.log("onCloseCreationModal"),(Ve=j.current)==null||Ve.reset();const ce=on(e),ye=d==null?void 0:d.get(ce);ye&&ye.closeEvent(),f==null||f(),J==null||J.stopPropagation(),J==null||J.preventDefault(),(He=P())==null||He.closeModal()},U=J=>{J||X(),M(J),H(J)},ne=E.useCallback((J,ce)=>{if(l&&!J)return;u(!1);const{time:ye,key:Ve}=e,He=on({key:Ve,time:ce||ye}),Kn=d==null?void 0:d.get(He);h(He),Kn&&Kn.showEvent(ce||ye),g(Ve);const Ss=v(J||ye,J?0:15);S({slotData:e,finishTime:Ss}),A()},[e,d,l,S,v]),B=()=>{l||I()||W()},ie=o.length||b?o:"hovering_slotTrigger_core",pe=E.useCallback(()=>{const{time:J,key:ce}=e;u(!0),T(!0),g(ce),p(J),v(J)},[v,e,g,u,p]),Oe=()=>{A()},Ee=E.useCallback(()=>{T(!1)},[]),ot=()=>{setTimeout(()=>{W(),A(),M(!0)},0)};return E.useEffect(()=>{l?document.body.style.cursor="ns-resize":document.body.style.cursor="default"},[l]),E.useEffect(()=>{if(!w||!m)return;const J=Z.convertStringTimeToDateFormat(w),ce=Z.convertStringTimeToDateFormat(m);Number.isNaN(J)||Number.isNaN(ce)||!(J instanceof Date)||!(ce instanceof Date)||Y(J,ce)},[w,m]),E.useEffect(()=>{if(!y){W();return}G!=null&&G.current&&G.current.scrollIntoView({behavior:"smooth",block:"center"})},[y]),E.useEffect(()=>{i!=null&&i.length&&W(),b&&V()},[i,b]),E.useEffect(()=>{b&&V()},[b]),E.useImperativeHandle(c,()=>({showEvent:J=>{p(J),ot()},closeEvent:()=>{var J;(J=P())==null||J.closeModal(),M(!1),W(),Ee()},onOpenCloseChange:J=>{H(J),M(J),Ee()},addAdditionalBooking:k,removeFromAdditionalBooking:N,hoveringAdditionalCard:J=>{z(J)},clearHoveringCard:()=>{z("")}})),x.jsxs(x.Fragment,{children:[x.jsxs("div",{ref:e.ref,style:{borderBottom:r==="fourth"?"1px solid #8080807a":"",...e.style},className:de("slotTrigger_core",C===se.DAY&&"slotTrigger_core_day",ie),onMouseOver:q,onMouseLeave:B,onFocus:()=>{},children:[x.jsx(sA,{ref:j,slotData:e,events:{onClick:ne,openOptions:Oe,renderPreviewCard:pe,resetPrevView:Ee}}),a,y&&x.jsx(Ec,{ref:G,bookingInit:L,bookingViewType:C,slotData:{day:new Date().toISOString(),hour:"09:00"},hoveringAdditionalCardId:O,heightStyle:K}),x.jsx(gd,{hoveringAdditionalCardId:O,bookings:R,blockTimeString:"00",slotData:n}),x.jsx(gd,{hoveringAdditionalCardId:O,bookings:i,blockTimeString:t,slotData:n})]},e.key),x.jsx(Jh,{ref:F,onClose:X,onOpenChange:U,buttonTrigger:x.jsx("div",{},e.key),side:C===se.DAY?"top":"right"})]})};var iA="Separator",vd="horizontal",aA=["horizontal","vertical"],Dg=D.forwardRef((e,t)=>{const{decorative:n,orientation:r=vd,...o}=e,s=cA(r)?r:vd,a=n?{role:"none"}:{"aria-orientation":s==="vertical"?s:void 0,role:"separator"};return x.jsx(ae.div,{"data-orientation":s,...a,...o,ref:t})});Dg.displayName=iA;function cA(e){return aA.includes(e)}var lA=Dg;function uA({className:e,orientation:t="horizontal",decorative:n=!0,...r}){return x.jsx(lA,{"data-slot":"separator-root",decorative:n,orientation:t,className:de("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",e),...r})}const dA=fa("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function fA({className:e,variant:t,...n}){return x.jsx("div",{className:de(dA({variant:t}),e),...n})}const hA=({dateToRender:e,isFirstDay:t})=>x.jsx("div",{style:{left:t?"3px":"10px"},className:"first_day_slot",children:x.jsx("span",{children:x.jsx(fA,{children:e})})});class pA{constructor(){Xt(this,"positionBasedOnSeconds",t=>{const[,n]=t.split(":");if(!t.length)return-3;const r=Number(n);return this.normalizingMinutes(r)});Xt(this,"normalizingMinutes",t=>t>=0&&t<=15?t*2:t>15&&t<30?(t-15)*2:t>=30&&t<=59?t-30:-3);Xt(this,"isInitialMinute",t=>t>=0&&t<=8);Xt(this,"isSameHour",(t,n)=>n.split(":")[0]===t)}}class mA{constructor(){Xt(this,"is15MinLess",t=>{const n=new Date,[r,o]=t.split(":"),s=new Date(n.getFullYear(),n.getMonth(),n.getDate(),Number(r),Number(o),0),i=new Date(n),a=Z.roundMinutes(n.getMinutes());i.setHours(n.getHours(),a,0,0);const c=Z.minuteDifference(s,i);return c>30||c<-30});Xt(this,"normalizeDateNow",t=>{const n=t.getHours(),r=Z.roundMinutes(t.getMinutes());return`${n.toString().padStart(2,"0")}:${r.toString().padStart(2,"0")}`})}}const ho=({color:e="#000",isFirstDay:t,slotData:n})=>{const{timesRendered:r,bookingViewType:o}=Le(),[s,i]=E.useState(""),[a,c]=E.useState(!1),[l,u]=E.useState(!1),d=E.useMemo(()=>{const p=new Date,v=new Date(n.key);return v.getDay()===p.getDay()&&v.getDate()===p.getDate()},[n.key]),h=p=>{i(p)},f=()=>{c(!0)},S=()=>{c(!1)},m=E.useMemo(()=>new pA().positionBasedOnSeconds(s),[n.time,s,r]),w=E.useMemo(()=>t?"101%":o===se.DAY?"102%":"100%",[t,o]),g=E.useMemo(()=>d?{top:`${m-2}px`,left:t?"-1px":"-3px",width:"101%"}:{top:`${m-1}px`,left:t?"-1px":"0px",width:w},[d,t,w,m]);if(E.useEffect(()=>{const p=n.time,v=new mA,C=()=>{const M=new Date,b=v.normalizeDateNow(M),T=Z.dateAndHourDateToString(M);s!==T&&h(T),u(b===p)};let y;return v.is15MinLess(p)||(y=setInterval(()=>C(),1e3)),()=>clearInterval(y)},[n.time,s]),!!l)return x.jsxs("div",{style:{...g},className:de("timeIndicator_today",d&&w,d&&"timeIndicator_today_circle"),onMouseEnter:f,onMouseOut:S,onBlur:()=>{},children:[x.jsx(uA,{className:"focus-effect",style:{height:d?"4px":"2px",backgroundColor:e}}),a&&x.jsx(hA,{isFirstDay:t,dateToRender:s})]})},yd=({bookings:e,first:t,second:n,third:r,fourth:o,disabledCss:s,firstDay:i,dayHour:a})=>{const{setEmptySlotNode:c,emptySlotNodes:l}=Tt(),u=E.useCallback((m,w)=>{if(!m)return;const g=on(w);l.get(g)||c(m,w)},[c,l]),d=(m,w)=>{const g=m.toDateString();return on({key:g,time:w?Z.dateTimeAsString(w):ta})},h=E.useCallback(m=>{const w=d(m);return l.get(w)},[l]),f=(m,w,g)=>{const p=Z.buildFutureDateList(m,w);for(let v=0;v<p.length;v++){const C=h(p[v]);if(!C)return;C.addAdditionalBooking(m,g,v!==p.length-1)}},S=E.useCallback(()=>{if(e!=null&&e.length)for(const m of e){const w=Z.calculateDaysDifference(m.finishAt,m.startAt),p=Z.buildFutureDateList(m,w+1,0).map((v,C)=>d(v,C===0?m.startAt:void 0)).filter(v=>v!==void 0);if(w===1){const v=h(m.finishAt);if(!v)return;v.addAdditionalBooking(m,p);return}f(m,w,p)}},[e,h,f]);return E.useEffect(()=>{e!=null&&e.length&&S()},[e,l,S]),x.jsxs(x.Fragment,{children:[x.jsx(fo,{ref:m=>u(m,{key:t.key,time:t.time}),slotData:t,disabledCss:s,events:{onMouseEnterEvent:()=>"first"},slotPosition:"first",dayHour:a,bookings:e,blockTimeString:"00",children:x.jsx(ho,{isFirstDay:i,slotData:t})}),x.jsx(fo,{ref:m=>u(m,{key:n.key,time:n.time}),slotData:n,disabledCss:s,events:{onMouseEnterEvent:()=>"second"},slotPosition:"second",dayHour:a,bookings:e,blockTimeString:"15",children:x.jsx(ho,{isFirstDay:i,slotData:n})}),x.jsx(fo,{ref:m=>u(m,{key:r.key,time:r.time}),slotData:r,disabledCss:s,events:{onMouseEnterEvent:()=>"third"},slotPosition:"third",dayHour:a,bookings:e,blockTimeString:"30",children:x.jsx(ho,{isFirstDay:i,slotData:r})}),x.jsx(fo,{ref:m=>u(m,{key:o.key,time:o.time}),slotData:o,disabledCss:s,events:{onMouseEnterEvent:()=>"fourth"},slotPosition:"fourth",dayHour:a,bookings:e,blockTimeString:"45",children:x.jsx(ho,{isFirstDay:i,slotData:o})})]})},gA=E.memo(({firstDay:e,booking:t,dayHour:n,disabledCss:r,firstBlockTimeData:o,secondBlockTimeData:s,thirdBlockTimeData:i,fourthBlockTimeData:a})=>{const{day:c,hour:l}=n,u=E.useMemo(()=>t.filter(d=>{const h=Z.dateAndHourDateToString(d.startAt),f=new Date(d.startAt).getDate(),S=new Date(c).getDate(),m=l.split(":")[0];return h.split(":")[0]===m&&f===S}),[t,n]);return u.length?x.jsx(yd,{dayHour:n,bookings:u,first:o,second:s,third:i,fourth:a,disabledCss:r,firstDay:e}):x.jsx(yd,{dayHour:n,first:o,second:s,third:i,fourth:a,disabledCss:r,firstDay:e})}),vA=({dayHour:e,firstDay:t,bookingBulk:n})=>{const r=E.useRef(""),o=xc(C=>C.updateStartAt),s=E.useMemo(()=>Z.addMinuteToHour(e.hour,15),[e.hour]),i=E.useMemo(()=>Z.addMinuteToHour(e.hour,30),[e.hour]),a=E.useMemo(()=>Z.addMinuteToHour(e.hour,45),[e.hour]),{isOver:c,setNodeRef:l}=qr({id:`${Z.newDateKey(e.day,e.hour)}`,data:{accepts:["booking-slots"]}}),{isOver:u,setNodeRef:d}=qr({id:`${Z.newDateKey(e.day,s)}`,data:{accepts:["booking-slots"]}}),{isOver:h,setNodeRef:f}=qr({id:`${Z.newDateKey(e.day,i)}`,data:{accepts:["booking-slots"]}}),{isOver:S,setNodeRef:m}=qr({id:`${Z.newDateKey(e.day,a)}`,data:{accepts:["booking-slots"]}});E.useEffect(()=>{c&&o(`${Z.newDateKey(e.day,e.hour)}`),u&&o(`${Z.newDateKey(e.day,s)}`),h&&o(`${Z.newDateKey(e.day,i)}`),S&&o(`${Z.newDateKey(e.day,a)}`)},[c,u,h,S]);const w=E.useMemo(()=>({ref:l,style:{backgroundColor:c?"#0066ff":""},key:Z.newDateKey(e.day,e.hour),time:e.hour}),[e.day,c,e.hour,l]),g=E.useMemo(()=>({ref:d,style:{backgroundColor:u?"#0066ff":""},key:Z.newDateKey(e.day,s),time:s}),[e.day,u,s,d]),p=E.useMemo(()=>({ref:f,style:{backgroundColor:h?"#0066ff":""},key:Z.newDateKey(e.day,i),time:i}),[e.day,h,i,f]),v=E.useMemo(()=>({ref:m,style:{backgroundColor:S?"#0066ff":""},key:Z.newDateKey(e.day,a),time:a}),[e.day,a,S,m]);return x.jsx("td",{className:"slot",children:x.jsx(gA,{booking:n,dayHour:e,firstDay:t,disabledCss:r.current,firstBlockTimeData:w,secondBlockTimeData:g,thirdBlockTimeData:p,fourthBlockTimeData:v})},`${e.day}-${e.hour}-slot`)},yA=({hour:e,ref:t})=>{const n="Set lunch interval",r="Remove lunch interval",o="Hour options",s=E.useRef(null),i="border-solid hover:border-b-2 hover:border-b-purple-600 border-b-white",a=()=>{s!=null&&s.current&&s.current.setAttribute("class",de("activateVisibilityTime",i))};return E.useImperativeHandle(t,()=>({setActivateHour:a})),x.jsxs(Fa,{children:[x.jsx($a,{children:x.jsx("span",{ref:s,className:de(i),children:e})}),x.jsxs(Ba,{children:[x.jsx(EC,{children:o}),x.jsx(MC,{}),x.jsx(Ml,{children:n}),x.jsx(Ml,{children:r})]})]})},bA=()=>{const{hours:e,daysOfWeek:t,bookingViewType:n,bookingBulkData:r,addTimesRendered:o}=Le(is(C=>({addTimesRendered:C.addTimesRendered,bookingBulkData:C.bookingBulkData,bookingViewType:C.bookingViewType,daysOfWeek:C.daysOfWeek,hours:C.hours}))),{selectedNode:s,emptySlotNodes:i}=Tt(),{finishAt:a,updateFinishAtWithOffset:c}=kd(C=>C),{booking:l,slotData:u,startAt:d}=xc(C=>C),[h]=E.useState({startAt:"12:00",finishAt:"12:30"}),f=E.useRef(null),S=E.useCallback((C,y)=>{C&&o(C,y)},[o]),m=E.useMemo(()=>n===se.DAY?{maxWidth:"5rem",padding:0,minWidth:"4rem"}:{},[n]),w=E.useMemo(()=>({borderLeft:"none",backgroundColor:"white"}),[]),g=E.useMemo(()=>s.split(";")[1],[s]),p=E.useMemo(()=>{if(l&&u)return x.jsx(Ri,{ref:f,style:{borderRadius:"0.25rem"},booking:l,slotData:u})},[l,u]);return E.useEffect(()=>{if(s){const C=i.get(s);C==null||C.showEvent(g)}},[s,i]),E.useEffect(()=>{g===a&&c(g)},[s,a]),E.useEffect(()=>{if(l&&d&&(f!=null&&f.current)){const C=Z.bookingTimeRange(l,d);f.current.updateBooking(C)}},[l,d]),E.useMemo(()=>{const C=y=>y===0;return x.jsxs(x.Fragment,{children:[x.jsx("tbody",{children:e.map(y=>x.jsxs("tr",{children:[x.jsx(NC,{style:{...w,...m},className:"time-col",children:x.jsx("div",{className:"calendarCore_actions",children:x.jsx(yA,{ref:M=>S(M,y),hour:y})})},`${y}-hour`),t.map((M,b)=>x.jsx(vA,{dayHour:{day:String(M),hour:y},lunchTimeBlock:h,firstDay:C(b),bookingBulk:r.booking},`${M}-${y}-slot-content`))]},`${y}-content`))}),x.jsx(wR,{children:p})]})},[m,e,w,r.booking,S,n,t,t.length,p])},xA=({children:e})=>{const{resetSelectedNode:t,resetNodes:n}=Tt(o=>o),r=Le(o=>o.bookingViewType);switch(E.useEffect(()=>{(r===se.DAY||r===se.WEEK)&&(t(),n())},[r,n,t]),r){case se.DAY:case se.WEEK:return e;default:return null}},wA={id:"user-123",profile:{id:"profile-123",name:"Diego",email:"jane.smith@example.com"},createdAt:new Date,updatedAt:new Date},bd={distance:5},SA=()=>{const{bookings:e}=Lt(),t=Pv(Vc(Zd,{activationConstraint:bd}),Vc(Jd,{activationConstraint:bd})),{setBookingBulkData:n,optimisticCardUpdate:r}=Le(),{onCardDropCallback:o}=Lt(),{emptySlotNodes:s}=Tt(),{updateBooking:i,updateSlotData:a}=xc(f=>f),c=E.useCallback(f=>{const{active:S}=f;S.data.current&&(i(S.data.current.booking),a(S.data.current.slotData)),S.id},[i,a]),l=E.useCallback((f,S)=>{const m=on({key:S.toDateString(),time:ta}),w=s.get(m);if(!w){console.warn("SlotNode not found:",m);return}w.removeFromAdditionalBooking(f)},[s]),u=f=>{const S=Z.calculateDaysDifference(f.finishAt,f.startAt),m=Z.buildFutureDateList(f,S);for(const w of m)l(f,w)},d=async(f,S,m)=>{try{const{startAt:w,finishAt:g}=Z.bookingTimeRange(f,S);r(f,w,g,m),await o(f,S,m,{id:f.id,startAt:w,finishAt:g}),u(f)}catch(w){console.warn(w)}},h=f=>{const{over:S,active:m}=f;if(S&&m){const w=S.data.current,g=m.data.current;if(g&&w&&w.accepts.includes(g.type)&&g.booking.id&&S.id){const p=e.find(v=>v.id===g.booking.id);if(!p)return;d(p,String(S.id),g.slotData),a(null),i(null)}}};return E.useEffect(()=>{n({user:wA,booking:e})},[e,n]),x.jsx("div",{className:"calendar-wrapper",children:x.jsx(_C,{children:x.jsx(xA,{children:x.jsx(la,{onDragEnd:h,onDragStart:c,sensors:t,children:x.jsx(bA,{})})})})})},CA=({handleWeekChange:e})=>x.jsxs("div",{className:"header_day_actions",children:[x.jsx(an,{className:"header_day_actions_button",variant:"ghost",size:"lg",onClick:()=>e("previous"),children:x.jsx(eb,{className:"header_day_actions_button_icon"})}),x.jsx(an,{className:"header_day_actions_button",variant:"ghost",size:"lg",onClick:()=>e("next"),children:x.jsx(nb,{className:"header_day_actions_button_icon"})})]}),TA=({onClick:e})=>x.jsx(Ea,{content:"Today",children:x.jsx(an,{variant:"ghost",onClick:e,children:x.jsx(gb,{style:{paddingTop:"0.8px"}})})}),DA=({code:e})=>x.jsx("p",{className:"text-sm text-muted-foreground",children:x.jsxs("kbd",{className:"pointer-events-none inline-flex h-5 select-none items-center gap-1 rounded border bg-muted px-1.5 font-mono text-[10px] font-medium text-muted-foreground opacity-100",children:[x.jsx("span",{className:"text-xs",children:"⌘"}),e]})}),EA={[se.DAY]:x.jsx(ub,{width:"90%"}),[se.WEEK]:x.jsx(cb,{width:"90%"}),[se.TABLE]:x.jsx(Xy,{width:"90%"}),[se.MONTH]:x.jsx(fb,{width:"90%"})},xd=()=>{const{bookingViewType:e}=Le(),{onViewTypeChange:t}=Rd(),{viewModes:n}=Lt(),r=E.useCallback(a=>a===e?"custom":"outline",[e]),o=E.useCallback(a=>{a!==e&&t(a)},[t]),s=E.useMemo(()=>n.map(a=>({variant:r(a),icon:EA[a],events:c=>o(c),label:a})),[n,o,r]),i=E.useMemo(()=>{const a=s.find(c=>c.label===e);if(a)return a.icon},[e,s]);return x.jsxs(Fa,{children:[x.jsx($a,{children:x.jsx(Ea,{content:"Calendar Modes",children:x.jsx(an,{variant:"ghost",asChild:!0,children:i||x.jsx(Gy,{className:"w-full h-full"})})})}),x.jsx(Ba,{children:s.map(a=>x.jsxs(DC,{checked:a.label===e,onCheckedChange:()=>a.events(a.label),className:"flex flex-row justify-between gap-6",children:[x.jsxs("div",{className:"flex flex-row gap-4",children:[a.icon,x.jsx("div",{children:IC.capitalize(a.label)})]}),x.jsx(DA,{code:"o"})]},a.label))})]})},MA=566,RA=()=>{const{todayWeek:e,bookingViewType:t,setTodayDay:n,nextWeek:r,previousWeek:o,setDays:s}=Le(),{resetSelectedNode:i,resetNodes:a}=Tt(y=>y),{onTodayClick:c,onDayChange:l}=Lt(),{fullYear:u,monthMessage:d}=Ad(y=>y),[h,f]=E.useState(!1),S=()=>{const y=new Date;switch(c(y),t){case se.TABLE:case se.DAY:{n(y);break}default:{e();break}}},m=()=>s(1),w=()=>s(-1),g=y=>y==="next"?r():o(),p=y=>y==="next"?m():w(),v=y=>{switch(a(),i(),t){case se.TABLE:case se.DAY:{const M=p(y);l(M,y);break}case se.WEEK:{const M=g(y),{firstDayOfWeek:b,lastDayOfWeek:T}=Z.firstAndLastWeekDays(M);l([b,T],y);break}}};E.useEffect(()=>{e()},[e]),E.useEffect(()=>{const y=()=>{if(typeof window>"u")return!1;window.innerWidth<=MA?f(!0):f(!1)};return y(),window.addEventListener("resize",y),()=>window.removeEventListener("resize",y)},[]);const C=x.jsxs("div",{className:"header_actions",children:[x.jsx(CA,{handleWeekChange:v}),x.jsx(TA,{onClick:S})]});return x.jsx(x.Fragment,{children:h?x.jsxs("div",{className:"headerCalendar_mobile",children:[x.jsx("div",{className:"headerCalendar_mobile_month",children:x.jsxs("span",{className:"headerCalendar_mobile_month_span",children:[d," ",u]})}),x.jsxs("div",{className:"headerCalendar_mobile_actions",children:[C,x.jsx(xd,{})]})]}):x.jsxs("div",{className:"headerCalendar",children:[x.jsx("div",{className:"headerCalendar_actions",children:C}),x.jsx("div",{className:"headerCalendar_month",children:x.jsxs("span",{className:"headerCalendar_month_span",children:[d," ",u]})}),x.jsx(xd,{})]})})},PA=({viewModes:e,createBookingModal:t,onChangeViewType:n,onCardDropCallback:r,onCardResizeEnd:o,onDayChange:s,onHeaderDayClick:i,onTodayClick:a,onSlotClick:c,onModalClose:l,bookings:u,isTimeInfoVisible:d,systemColor:h,ref:f})=>{const[S,m]=E.useState(!1),w=E.useRef(null),{setBookingViewType:g,setWeekAndViewType:p,setTodayDayAndViewType:v,bookingViewType:C,setTodayDay:y,todayWeek:M}=Le(),{setSelectedNode:b}=Tt(O=>O),T=O=>{var z;(z=w==null?void 0:w.current)==null||z.updateFinishAt(O)},R=O=>{y(new Date(O))},_=O=>{M(new Date(O))};return E.useImperativeHandle(f,()=>({updateViewType:O=>g(O),updateWeekAndViewType:O=>p(O),updateTodayDayAndViewType:O=>v(O),updateSelectedNode:O=>{setTimeout(()=>{b(O)},10)},updateFinishAt:O=>T(O),changeLoading:O=>m(O),goToDay:O=>R(O),goToWeek:O=>_(O)})),E.useEffect(()=>{n(C)},[C]),x.jsx(pv,{isTimeInfoVisible:d,systemColor:h,children:x.jsx(uv,{..._d,children:x.jsx(dv,{createBookingModal:t,viewModes:e,onHeaderDayClick:i,onTodayClick:a,onCardDropCallback:r,onCardResizeEnd:o,onDayChange:s,onSlotClick:c,onModalClose:l,bookings:u,children:x.jsx(cv,{ref:w,...di,children:x.jsxs(gv,{...Id,children:[x.jsx(RA,{}),x.jsx(SA,{}),x.jsx(Fg,{color:"#000000aa",loading:S,cssOverride:{position:"absolute",top:"50%",left:"50%",transform:"translate('-50%', '-50%')",zIndex:100},size:15,"aria-label":"Loading Spinner","data-testid":"GridLoader"})]})})})})})},AA=e=>{const t=E.useRef(null),n=()=>{if(!(t!=null&&t.current))throw new Ng};return{getCalendar:()=>x.jsx(PA,{ref:t,...e}),updateViewType:h=>{var f;n(),(f=t.current)==null||f.updateViewType(h)},updateWeekAndViewType:h=>{var f;return n(),(f=t.current)==null?void 0:f.updateWeekAndViewType(h)},updateTodayDayAndViewType:h=>{var f;return n(),(f=t.current)==null?void 0:f.updateTodayDayAndViewType(h)},updateSelectedNode:h=>{var f;n(),(f=t.current)==null||f.updateSelectedNode(h)},updateFinishAt:h=>{var f;n(),(f=t.current)==null||f.updateFinishAt(h)},changeLoading:h=>{var f;n(),(f=t.current)==null||f.changeLoading(h)},goToDay:h=>{var f;n(),(f=t.current)==null||f.goToDay(h)},goToWeek:h=>{var f;n(),(f=t.current)==null||f.goToWeek(h)}}};exports.useCalendarInstance=AA;