diff --git a/assets/index-CL6diYI0.js b/assets/index-Buof-60y.js similarity index 98% rename from assets/index-CL6diYI0.js rename to assets/index-Buof-60y.js index 7a57fa6..6039894 100644 --- a/assets/index-CL6diYI0.js +++ b/assets/index-Buof-60y.js @@ -135,4 +135,4 @@ For more information, see https://radix-ui.com/primitives/docs/components/${t.do * See the LICENSE file in the root directory of this source tree. */const uE=aE("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),$h=Ih,cE=zh,dE=Dh,Fh=w.forwardRef(({className:e,...t},n)=>C.jsx(Xu,{ref:n,className:He("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));Fh.displayName=Xu.displayName;const Zu=w.forwardRef(({className:e,children:t,...n},r)=>C.jsxs(dE,{children:[C.jsx(Fh,{}),C.jsxs(Qu,{ref:r,className:He("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 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-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...n,children:[t,C.jsxs(jh,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[C.jsx(uE,{className:"h-4 w-4"}),C.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Zu.displayName=Qu.displayName;const Ju=({className:e,...t})=>C.jsx("div",{className:He("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Ju.displayName="DialogHeader";const ec=w.forwardRef(({className:e,...t},n)=>C.jsx(Ku,{ref:n,className:He("text-lg font-semibold leading-none tracking-tight",e),...t}));ec.displayName=Ku.displayName;const tc=w.forwardRef(({className:e,...t},n)=>C.jsx(qu,{ref:n,className:He("text-sm text-muted-foreground",e),...t}));tc.displayName=qu.displayName;const Bh=w.forwardRef(({className:e,type:t,...n},r)=>C.jsx("input",{type:t,className:He("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:r,...n}));Bh.displayName="Input";const ki=e=>typeof e=="number"&&!isNaN(e),Mn=e=>typeof e=="string",Qe=e=>typeof e=="function",_o=e=>Mn(e)||Qe(e)?e:null,ja=e=>w.isValidElement(e)||Mn(e)||Qe(e)||ki(e);function fE(e,t,n){n===void 0&&(n=300);const{scrollHeight:r,style:o}=e;requestAnimationFrame(()=>{o.minHeight="initial",o.height=r+"px",o.transition=`all ${n}ms`,requestAnimationFrame(()=>{o.height="0",o.padding="0",o.margin="0",setTimeout(t,n)})})}function zl(e){let{enter:t,exit:n,appendPosition:r=!1,collapse:o=!0,collapseDuration:l=300}=e;return function(s){let{children:a,position:u,preventExitTransition:c,done:d,nodeRef:f,isIn:p,playToast:y}=s;const S=r?`${t}--${u}`:t,g=r?`${n}--${u}`:n,E=w.useRef(0);return w.useLayoutEffect(()=>{const m=f.current,h=S.split(" "),v=x=>{x.target===f.current&&(y(),m.removeEventListener("animationend",v),m.removeEventListener("animationcancel",v),E.current===0&&x.type!=="animationcancel"&&m.classList.remove(...h))};m.classList.add(...h),m.addEventListener("animationend",v),m.addEventListener("animationcancel",v)},[]),w.useEffect(()=>{const m=f.current,h=()=>{m.removeEventListener("animationend",h),o?fE(m,d,l):d()};p||(c?h():(E.current=1,m.className+=` ${g}`,m.addEventListener("animationend",h)))},[p]),M.createElement(M.Fragment,null,a)}}function Jd(e,t){return e!=null?{content:e.content,containerId:e.props.containerId,id:e.props.toastId,theme:e.props.theme,type:e.props.type,data:e.props.data||{},isLoading:e.props.isLoading,icon:e.props.icon,status:t}:{}}const ze=new Map;let Ni=[];const Aa=new Set,pE=e=>Aa.forEach(t=>t(e)),Vh=()=>ze.size>0;function Wh(e,t){var n;if(t)return!((n=ze.get(t))==null||!n.isToastActive(e));let r=!1;return ze.forEach(o=>{o.isToastActive(e)&&(r=!0)}),r}function Uh(e,t){ja(e)&&(Vh()||Ni.push({content:e,options:t}),ze.forEach(n=>{n.buildToast(e,t)}))}function ef(e,t){ze.forEach(n=>{t!=null&&t!=null&&t.containerId?(t==null?void 0:t.containerId)===n.id&&n.toggle(e,t==null?void 0:t.id):n.toggle(e,t==null?void 0:t.id)})}function mE(e){const{subscribe:t,getSnapshot:n,setProps:r}=w.useRef(function(l){const s=l.containerId||1;return{subscribe(a){const u=function(d,f,p){let y=1,S=0,g=[],E=[],m=[],h=f;const v=new Map,x=new Set,T=()=>{m=Array.from(v.values()),x.forEach(b=>b())},_=b=>{E=b==null?[]:E.filter(k=>k!==b),T()},P=b=>{const{toastId:k,onOpen:N,updateId:R,children:L}=b.props,O=R==null;b.staleId&&v.delete(b.staleId),v.set(k,b),E=[...E,b.props.toastId].filter($=>$!==b.staleId),T(),p(Jd(b,O?"added":"updated")),O&&Qe(N)&&N(w.isValidElement(L)&&L.props)};return{id:d,props:h,observe:b=>(x.add(b),()=>x.delete(b)),toggle:(b,k)=>{v.forEach(N=>{k!=null&&k!==N.props.toastId||Qe(N.toggle)&&N.toggle(b)})},removeToast:_,toasts:v,clearQueue:()=>{S-=g.length,g=[]},buildToast:(b,k)=>{if((X=>{let{containerId:oe,toastId:le,updateId:Ee}=X;const ye=oe?oe!==d:d!==1,Ne=v.has(le)&&Ee==null;return ye||Ne})(k))return;const{toastId:N,updateId:R,data:L,staleId:O,delay:$}=k,B=()=>{_(N)},G=R==null;G&&S++;const U={...h,style:h.toastStyle,key:y++,...Object.fromEntries(Object.entries(k).filter(X=>{let[oe,le]=X;return le!=null})),toastId:N,updateId:R,data:L,closeToast:B,isIn:!1,className:_o(k.className||h.toastClassName),bodyClassName:_o(k.bodyClassName||h.bodyClassName),progressClassName:_o(k.progressClassName||h.progressClassName),autoClose:!k.isLoading&&(I=k.autoClose,D=h.autoClose,I===!1||ki(I)&&I>0?I:D),deleteToast(){const X=v.get(N),{onClose:oe,children:le}=X.props;Qe(oe)&&oe(w.isValidElement(le)&&le.props),p(Jd(X,"removed")),v.delete(N),S--,S<0&&(S=0),g.length>0?P(g.shift()):T()}};var I,D;U.closeButton=h.closeButton,k.closeButton===!1||ja(k.closeButton)?U.closeButton=k.closeButton:k.closeButton===!0&&(U.closeButton=!ja(h.closeButton)||h.closeButton);let j=b;w.isValidElement(b)&&!Mn(b.type)?j=w.cloneElement(b,{closeToast:B,toastProps:U,data:L}):Qe(b)&&(j=b({closeToast:B,toastProps:U,data:L}));const V={content:j,props:U,staleId:O};h.limit&&h.limit>0&&S>h.limit&&G?g.push(V):ki($)?setTimeout(()=>{P(V)},$):P(V)},setProps(b){h=b},setToggle:(b,k)=>{v.get(b).toggle=k},isToastActive:b=>E.some(k=>k===b),getSnapshot:()=>m}}(s,l,pE);ze.set(s,u);const c=u.observe(a);return Ni.forEach(d=>Uh(d.content,d.options)),Ni=[],()=>{c(),ze.delete(s)}},setProps(a){var u;(u=ze.get(s))==null||u.setProps(a)},getSnapshot(){var a;return(a=ze.get(s))==null?void 0:a.getSnapshot()}}}(e)).current;r(e);const o=w.useSyncExternalStore(t,n,n);return{getToastToRender:function(l){if(!o)return[];const s=new Map;return e.newestOnTop&&o.reverse(),o.forEach(a=>{const{position:u}=a.props;s.has(u)||s.set(u,[]),s.get(u).push(a)}),Array.from(s,a=>l(a[0],a[1]))},isToastActive:Wh,count:o==null?void 0:o.length}}function hE(e){const[t,n]=w.useState(!1),[r,o]=w.useState(!1),l=w.useRef(null),s=w.useRef({start:0,delta:0,removalDistance:0,canCloseOnClick:!0,canDrag:!1,didMove:!1}).current,{autoClose:a,pauseOnHover:u,closeToast:c,onClick:d,closeOnClick:f}=e;var p,y;function S(){n(!0)}function g(){n(!1)}function E(v){const x=l.current;s.canDrag&&x&&(s.didMove=!0,t&&g(),s.delta=e.draggableDirection==="x"?v.clientX-s.start:v.clientY-s.start,s.start!==v.clientX&&(s.canCloseOnClick=!1),x.style.transform=`translate3d(${e.draggableDirection==="x"?`${s.delta}px, var(--y)`:`0, calc(${s.delta}px + var(--y))`},0)`,x.style.opacity=""+(1-Math.abs(s.delta/s.removalDistance)))}function m(){document.removeEventListener("pointermove",E),document.removeEventListener("pointerup",m);const v=l.current;if(s.canDrag&&s.didMove&&v){if(s.canDrag=!1,Math.abs(s.delta)>s.removalDistance)return o(!0),e.closeToast(),void e.collapseAll();v.style.transition="transform 0.2s, opacity 0.2s",v.style.removeProperty("transform"),v.style.removeProperty("opacity")}}(y=ze.get((p={id:e.toastId,containerId:e.containerId,fn:n}).containerId||1))==null||y.setToggle(p.id,p.fn),w.useEffect(()=>{if(e.pauseOnFocusLoss)return document.hasFocus()||g(),window.addEventListener("focus",S),window.addEventListener("blur",g),()=>{window.removeEventListener("focus",S),window.removeEventListener("blur",g)}},[e.pauseOnFocusLoss]);const h={onPointerDown:function(v){if(e.draggable===!0||e.draggable===v.pointerType){s.didMove=!1,document.addEventListener("pointermove",E),document.addEventListener("pointerup",m);const x=l.current;s.canCloseOnClick=!0,s.canDrag=!0,x.style.transition="none",e.draggableDirection==="x"?(s.start=v.clientX,s.removalDistance=x.offsetWidth*(e.draggablePercent/100)):(s.start=v.clientY,s.removalDistance=x.offsetHeight*(e.draggablePercent===80?1.5*e.draggablePercent:e.draggablePercent)/100)}},onPointerUp:function(v){const{top:x,bottom:T,left:_,right:P}=l.current.getBoundingClientRect();v.nativeEvent.type!=="touchend"&&e.pauseOnHover&&v.clientX>=_&&v.clientX<=P&&v.clientY>=x&&v.clientY<=T?g():S()}};return a&&u&&(h.onMouseEnter=g,e.stacked||(h.onMouseLeave=S)),f&&(h.onClick=v=>{d&&d(v),s.canCloseOnClick&&c()}),{playToast:S,pauseToast:g,isRunning:t,preventExitTransition:r,toastRef:l,eventHandlers:h}}function vE(e){let{delay:t,isRunning:n,closeToast:r,type:o="default",hide:l,className:s,style:a,controlledProgress:u,progress:c,rtl:d,isIn:f,theme:p}=e;const y=l||u&&c===0,S={...a,animationDuration:`${t}ms`,animationPlayState:n?"running":"paused"};u&&(S.transform=`scaleX(${c})`);const g=Lt("Toastify__progress-bar",u?"Toastify__progress-bar--controlled":"Toastify__progress-bar--animated",`Toastify__progress-bar-theme--${p}`,`Toastify__progress-bar--${o}`,{"Toastify__progress-bar--rtl":d}),E=Qe(s)?s({rtl:d,type:o,defaultClassName:g}):Lt(g,s),m={[u&&c>=1?"onTransitionEnd":"onAnimationEnd"]:u&&c<1?null:()=>{f&&r()}};return M.createElement("div",{className:"Toastify__progress-bar--wrp","data-hidden":y},M.createElement("div",{className:`Toastify__progress-bar--bg Toastify__progress-bar-theme--${p} Toastify__progress-bar--${o}`}),M.createElement("div",{role:"progressbar","aria-hidden":y?"true":"false","aria-label":"notification timer",className:E,style:S,...m}))}let gE=1;const Hh=()=>""+gE++;function yE(e){return e&&(Mn(e.toastId)||ki(e.toastId))?e.toastId:Hh()}function si(e,t){return Uh(e,t),t.toastId}function fl(e,t){return{...t,type:t&&t.type||e,toastId:yE(t)}}function ao(e){return(t,n)=>si(t,fl(e,n))}function Q(e,t){return si(e,fl("default",t))}Q.loading=(e,t)=>si(e,fl("default",{isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1,...t})),Q.promise=function(e,t,n){let r,{pending:o,error:l,success:s}=t;o&&(r=Mn(o)?Q.loading(o,n):Q.loading(o.render,{...n,...o}));const a={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},u=(d,f,p)=>{if(f==null)return void Q.dismiss(r);const y={type:d,...a,...n,data:p},S=Mn(f)?{render:f}:f;return r?Q.update(r,{...y,...S}):Q(S.render,{...y,...S}),p},c=Qe(e)?e():e;return c.then(d=>u("success",s,d)).catch(d=>u("error",l,d)),c},Q.success=ao("success"),Q.info=ao("info"),Q.error=ao("error"),Q.warning=ao("warning"),Q.warn=Q.warning,Q.dark=(e,t)=>si(e,fl("default",{theme:"dark",...t})),Q.dismiss=function(e){(function(t){var n;if(Vh()){if(t==null||Mn(n=t)||ki(n))ze.forEach(r=>{r.removeToast(t)});else if(t&&("containerId"in t||"id"in t)){const r=ze.get(t.containerId);r?r.removeToast(t.id):ze.forEach(o=>{o.removeToast(t.id)})}}else Ni=Ni.filter(r=>t!=null&&r.options.toastId!==t)})(e)},Q.clearWaitingQueue=function(e){e===void 0&&(e={}),ze.forEach(t=>{!t.props.limit||e.containerId&&t.id!==e.containerId||t.clearQueue()})},Q.isActive=Wh,Q.update=function(e,t){t===void 0&&(t={});const n=((r,o)=>{var l;let{containerId:s}=o;return(l=ze.get(s||1))==null?void 0:l.toasts.get(r)})(e,t);if(n){const{props:r,content:o}=n,l={delay:100,...r,...t,toastId:t.toastId||e,updateId:Hh()};l.toastId!==e&&(l.staleId=e);const s=l.render||o;delete l.render,si(s,l)}},Q.done=e=>{Q.update(e,{progress:1})},Q.onChange=function(e){return Aa.add(e),()=>{Aa.delete(e)}},Q.play=e=>ef(!0,e),Q.pause=e=>ef(!1,e);const wE=typeof window<"u"?w.useLayoutEffect:w.useEffect,uo=e=>{let{theme:t,type:n,isLoading:r,...o}=e;return M.createElement("svg",{viewBox:"0 0 24 24",width:"100%",height:"100%",fill:t==="colored"?"currentColor":`var(--toastify-icon-color-${n})`,...o})},_s={info:function(e){return M.createElement(uo,{...e},M.createElement("path",{d:"M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z"}))},warning:function(e){return M.createElement(uo,{...e},M.createElement("path",{d:"M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z"}))},success:function(e){return M.createElement(uo,{...e},M.createElement("path",{d:"M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z"}))},error:function(e){return M.createElement(uo,{...e},M.createElement("path",{d:"M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z"}))},spinner:function(){return M.createElement("div",{className:"Toastify__spinner"})}},xE=e=>{const{isRunning:t,preventExitTransition:n,toastRef:r,eventHandlers:o,playToast:l}=hE(e),{closeButton:s,children:a,autoClose:u,onClick:c,type:d,hideProgressBar:f,closeToast:p,transition:y,position:S,className:g,style:E,bodyClassName:m,bodyStyle:h,progressClassName:v,progressStyle:x,updateId:T,role:_,progress:P,rtl:b,toastId:k,deleteToast:N,isIn:R,isLoading:L,closeOnClick:O,theme:$}=e,B=Lt("Toastify__toast",`Toastify__toast-theme--${$}`,`Toastify__toast--${d}`,{"Toastify__toast--rtl":b},{"Toastify__toast--close-on-click":O}),G=Qe(g)?g({rtl:b,position:S,type:d,defaultClassName:B}):Lt(B,g),U=function(V){let{theme:X,type:oe,isLoading:le,icon:Ee}=V,ye=null;const Ne={theme:X,type:oe};return Ee===!1||(Qe(Ee)?ye=Ee({...Ne,isLoading:le}):w.isValidElement(Ee)?ye=w.cloneElement(Ee,Ne):le?ye=_s.spinner():(xn=>xn in _s)(oe)&&(ye=_s[oe](Ne))),ye}(e),I=!!P||!u,D={closeToast:p,type:d,theme:$};let j=null;return s===!1||(j=Qe(s)?s(D):w.isValidElement(s)?w.cloneElement(s,D):function(V){let{closeToast:X,theme:oe,ariaLabel:le="close"}=V;return M.createElement("button",{className:`Toastify__close-button Toastify__close-button--${oe}`,type:"button",onClick:Ee=>{Ee.stopPropagation(),X(Ee)},"aria-label":le},M.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},M.createElement("path",{fillRule:"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"})))}(D)),M.createElement(y,{isIn:R,done:N,position:S,preventExitTransition:n,nodeRef:r,playToast:l},M.createElement("div",{id:k,onClick:c,"data-in":R,className:G,...o,style:E,ref:r},M.createElement("div",{...R&&{role:_},className:Qe(m)?m({type:d}):Lt("Toastify__toast-body",m),style:h},U!=null&&M.createElement("div",{className:Lt("Toastify__toast-icon",{"Toastify--animate-icon Toastify__zoom-enter":!L})},U),M.createElement("div",null,a)),j,M.createElement(vE,{...T&&!I?{key:`pb-${T}`}:{},rtl:b,theme:$,delay:u,isRunning:t,isIn:R,closeToast:p,hide:f,type:d,style:x,className:v,controlledProgress:I,progress:P||0})))},Dl=function(e,t){return t===void 0&&(t=!1),{enter:`Toastify--animate Toastify__${e}-enter`,exit:`Toastify--animate Toastify__${e}-exit`,appendPosition:t}},SE=zl(Dl("bounce",!0));zl(Dl("slide",!0));zl(Dl("zoom"));zl(Dl("flip"));const EE={position:"top-right",transition:SE,autoClose:5e3,closeButton:!0,pauseOnHover:!0,pauseOnFocusLoss:!0,draggable:"touch",draggablePercent:80,draggableDirection:"x",role:"alert",theme:"light"};function CE(e){let t={...EE,...e};const n=e.stacked,[r,o]=w.useState(!0),l=w.useRef(null),{getToastToRender:s,isToastActive:a,count:u}=mE(t),{className:c,style:d,rtl:f,containerId:p}=t;function y(g){const E=Lt("Toastify__toast-container",`Toastify__toast-container--${g}`,{"Toastify__toast-container--rtl":f});return Qe(c)?c({position:g,rtl:f,defaultClassName:E}):Lt(E,_o(c))}function S(){n&&(o(!0),Q.play())}return wE(()=>{if(n){var g;const E=l.current.querySelectorAll('[data-in="true"]'),m=12,h=(g=t.position)==null?void 0:g.includes("top");let v=0,x=0;Array.from(E).reverse().forEach((T,_)=>{const P=T;P.classList.add("Toastify__toast--stacked"),_>0&&(P.dataset.collapsed=`${r}`),P.dataset.pos||(P.dataset.pos=h?"top":"bot");const b=v*(r?.2:1)+(r?0:m*_);P.style.setProperty("--y",`${h?b:-1*b}px`),P.style.setProperty("--g",`${m}`),P.style.setProperty("--s",""+(1-(r?x:0))),v+=P.offsetHeight,x+=.025})}},[r,u,n]),M.createElement("div",{ref:l,className:"Toastify",id:p,onMouseEnter:()=>{n&&(o(!1),Q.pause())},onMouseLeave:S},s((g,E)=>{const m=E.length?{...d}:{...d,pointerEvents:"none"};return M.createElement("div",{className:y(g),style:m,key:`container-${g}`},E.map(h=>{let{content:v,props:x}=h;return M.createElement(xE,{...x,stacked:n,collapseAll:S,isIn:a(x.toastId,x.containerId),style:x.style,key:`toast-${x.key}`},v)}))}))}function TE(){const[e,t]=w.useState(!1),[n,r]=w.useState([]),[o,l]=w.useState(!1),[s,a]=w.useState(""),u=async d=>{if(!d){r([]);return}l(!0);try{const f=await fetch(`https://api.themoviedb.org/3/search/movie?api_key=4c1eef5a8d388386187a3426bc2345be&query=${encodeURIComponent(d)}`);f.ok||Q.error("Something went wrong");const p=await f.json();r(p.results||[])}catch(f){Q.error(f),console.error("Error fetching movies:",f),r([])}finally{l(!1)}},c=d=>{const f=d.target.value;a(f),u(f)};return w.useEffect(()=>{const d=f=>{f.key==="j"&&(f.metaKey||f.ctrlKey)&&(f.preventDefault(),t(p=>!p))};return document.addEventListener("keydown",d),()=>document.removeEventListener("keydown",d)},[]),C.jsx(C.Fragment,{children:C.jsxs($h,{open:e,onOpenChange:t,children:[C.jsx(cE,{asChild:!0,children:C.jsxs("div",{onClick:()=>t(!0),className:" hover:bg-zinc-800 w-full lg:w-80 cursor-pointer rounded-md border border-zinc-800 bg-zinc-900 p-1 flex items-center justify-between",children:[C.jsx("p",{className:"ml-3 text-sm text-zinc-400",children:"Search movies..."}),C.jsx("p",{className:"text-sm text-muted-foreground flex items-center",children:C.jsxs("kbd",{className:"pointer-events-none inline-flex select-none items-center gap-1 rounded border bg-muted px-1.5 font-mono text-[10px] font-medium text-muted-foreground",children:[C.jsx("span",{className:"text-xs",children:"⌘"}),"J"]})})]})}),C.jsxs(Zu,{children:[C.jsxs(Ju,{children:[C.jsx(ec,{children:"Movie Search"}),C.jsx(tc,{children:"Type to search for a movie"})]}),C.jsx(Bh,{type:"text",placeholder:"Type a movie name...",value:s,onChange:c,className:"w-full mt-2 mb-4"}),n.length===0?C.jsx("p",{className:"text-center text-gray-500",children:"No results found."}):C.jsx("div",{className:"mt-2 max-h-60 overflow-y-auto",children:n.map(d=>{const f=d.poster_path?`https://image.tmdb.org/t/p/w92${d.poster_path}`:"https://via.placeholder.com/92",p=d.release_date?new Date(d.release_date).getFullYear():"N/A";return C.jsxs(il,{to:`/movie/${d.id}`,className:"p-1 mt-1 hover:bg-zinc-900 cursor-pointer flex items-center rounded-md",onClick:()=>{console.log("Selected movie:",d.title),t(!1)},children:[C.jsx("img",{src:f,alt:d.title,className:"w-12 h-18 object-cover rounded-md mr-2"}),C.jsxs("div",{children:[C.jsx("p",{className:"text-sm",children:d.title}),C.jsx("p",{className:"text-xs text-gray-500",children:p})]})]},d.id)})})]})]})})}const bE=()=>C.jsxs("div",{className:"fixed z-50 top-0 left-0 w-full p-4 bg-zinc-950/90 px-5 border-b-1 bg-opacity-50 backdrop-blur-sm border-b border-zinc-800 py-3 flex items-center justify-between",children:[C.jsx(il,{to:"/",children:C.jsx("div",{children:C.jsxs("h1",{className:" text-zinc-50 font-semibold ",children:[C.jsx("span",{className:" px-3 py-1 bg-zinc-50 text-zinc-900 rounded-l-md",children:"R"}),C.jsx("span",{className:" ml-1 px-3 py-1 bg-zinc-50 text-zinc-900 rounded-r-md",children:"Flix"})]})})}),C.jsxs("div",{className:"flex items-center gap-4",children:[C.jsx(TE,{}),C.jsx(il,{to:"/watchlist",children:C.jsx("i",{className:"text-gray-400 hover:text-white transition-colors",children:C.jsx(kx,{size:25})})})]})]});function PE(e){return Tt({tag:"svg",attr:{viewBox:"0 0 496 512"},child:[{tag:"path",attr:{d:"M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3zm44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3.7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9 1.6 1 3.6.7 4.3-.7.7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3.7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3.7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z"},child:[]}]})(e)}function kE(e){return Tt({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M380.9 97.1C339 55.1 283.2 32 223.9 32c-122.4 0-222 99.6-222 222 0 39.1 10.2 77.3 29.6 111L0 480l117.7-30.9c32.4 17.7 68.9 27 106.1 27h.1c122.3 0 224.1-99.6 224.1-222 0-59.3-25.2-115-67.1-157zm-157 341.6c-33.2 0-65.7-8.9-94-25.7l-6.7-4-69.8 18.3L72 359.2l-4.4-7c-18.5-29.4-28.2-63.3-28.2-98.2 0-101.7 82.8-184.5 184.6-184.5 49.3 0 95.6 19.2 130.4 54.1 34.8 34.9 56.2 81.2 56.1 130.5 0 101.8-84.9 184.6-186.6 184.6zm101.2-138.2c-5.5-2.8-32.8-16.2-37.9-18-5.1-1.9-8.8-2.8-12.5 2.8-3.7 5.6-14.3 18-17.6 21.8-3.2 3.7-6.5 4.2-12 1.4-32.6-16.3-54-29.1-75.5-66-5.7-9.8 5.7-9.1 16.3-30.3 1.8-3.7.9-6.9-.5-9.7-1.4-2.8-12.5-30.1-17.1-41.2-4.5-10.8-9.1-9.3-12.5-9.5-3.2-.2-6.9-.2-10.6-.2-3.7 0-9.7 1.4-14.8 6.9-5.1 5.6-19.4 19-19.4 46.3 0 27.3 19.9 53.7 22.6 57.4 2.8 3.7 39.1 59.7 94.8 83.8 35.2 15.2 49 16.5 66.6 13.9 10.7-1.6 32.8-13.4 37.4-26.4 4.6-13 4.6-24.1 3.2-26.4-1.3-2.5-5-3.9-10.5-6.6z"},child:[]}]})(e)}function NE(e){return Tt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M216 0h80c13.3 0 24 10.7 24 24v168h87.7c17.8 0 26.7 21.5 14.1 34.1L269.7 378.3c-7.5 7.5-19.8 7.5-27.3 0L90.1 226.1c-12.6-12.6-3.7-34.1 14.1-34.1H192V24c0-13.3 10.7-24 24-24zm296 376v112c0 13.3-10.7 24-24 24H24c-13.3 0-24-10.7-24-24V376c0-13.3 10.7-24 24-24h146.7l49 49c20.1 20.1 52.5 20.1 72.6 0l49-49H488c13.3 0 24 10.7 24 24zm-124 88c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20zm64 0c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20z"},child:[]}]})(e)}function _E(e){return Tt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M502.3 190.8c3.9-3.1 9.7-.2 9.7 4.7V400c0 26.5-21.5 48-48 48H48c-26.5 0-48-21.5-48-48V195.6c0-5 5.7-7.8 9.7-4.7 22.4 17.4 52.1 39.5 154.1 113.6 21.1 15.4 56.7 47.8 92.2 47.6 35.7.3 72-32.8 92.3-47.6 102-74.1 131.6-96.3 154-113.7zM256 320c23.2.4 56.6-29.2 73.4-41.4 132.7-96.3 142.8-104.7 173.4-128.7 5.8-4.5 9.2-11.5 9.2-18.9v-19c0-26.5-21.5-48-48-48H48C21.5 64 0 85.5 0 112v19c0 7.4 3.4 14.3 9.2 18.9 30.6 23.9 40.7 32.4 173.4 128.7 16.8 12.2 50.2 41.8 73.4 41.4z"},child:[]}]})(e)}function ME(e){return Tt({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M424.4 214.7L72.4 6.6C43.8-10.3 0 6.1 0 47.9V464c0 37.5 40.7 60.1 72.4 41.3l352-208c31.4-18.5 31.5-64.1 0-82.6z"},child:[]}]})(e)}function OE(e){return Tt({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M352 320c-22.608 0-43.387 7.819-59.79 20.895l-102.486-64.054a96.551 96.551 0 0 0 0-41.683l102.486-64.054C308.613 184.181 329.392 192 352 192c53.019 0 96-42.981 96-96S405.019 0 352 0s-96 42.981-96 96c0 7.158.79 14.13 2.276 20.841L155.79 180.895C139.387 167.819 118.608 160 96 160c-53.019 0-96 42.981-96 96s42.981 96 96 96c22.608 0 43.387-7.819 59.79-20.895l102.486 64.054A96.301 96.301 0 0 0 256 416c0 53.019 42.981 96 96 96s96-42.981 96-96-42.981-96-96-96z"},child:[]}]})(e)}function RE(){return C.jsx("footer",{className:"bg-zinc-900 text-white py-8 px-4 mt-10 sticky",children:C.jsxs("div",{className:"container mx-auto flex flex-col items-center justify-center space-y-4",children:[C.jsx("h1",{className:"text-lg font-semibold",children:"Connect with me"}),C.jsxs("div",{className:"flex space-x-6",children:[C.jsx("a",{href:"https://github.com/RanjanWorks",target:"_blank",rel:"noopener noreferrer",className:"text-gray-400 hover:text-white transition-colors",children:C.jsx(PE,{size:28})}),C.jsx("a",{href:"mailto:kashyapranjan9977@gmail.com",className:"text-gray-400 hover:text-white transition-colors",children:C.jsx(_E,{size:28})}),C.jsx("a",{href:"https://wa.me/+916266245085",target:"_blank",rel:"noopener noreferrer",className:"text-gray-400 hover:text-white transition-colors",children:C.jsx(kE,{size:28})})]}),C.jsxs("p",{className:"text-sm text-gray-500",children:["© ",new Date().getFullYear()," Ranjan Kashyap. All rights reserved."]})]})})}const LE=()=>C.jsxs(C.Fragment,{children:[C.jsx(bE,{}),C.jsx("div",{className:"mt-14",children:C.jsx(Hy,{})}),C.jsx(RE,{})]});function IE(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}const Gh=M.createContext({drawerRef:{current:null},overlayRef:{current:null},onPress:()=>{},onRelease:()=>{},onDrag:()=>{},onNestedDrag:()=>{},onNestedOpenChange:()=>{},onNestedRelease:()=>{},openProp:void 0,dismissible:!1,isOpen:!1,isDragging:!1,keyboardIsOpen:{current:!1},snapPointsOffset:null,snapPoints:null,handleOnly:!1,modal:!1,shouldFade:!1,activeSnapPoint:null,onOpenChange:()=>{},setActiveSnapPoint:()=>{},closeDrawer:()=>{},direction:"bottom",shouldAnimate:{current:!0},shouldScaleBackground:!1,setBackgroundColorOnScale:!0,noBodyStyles:!1,container:null,autoFocus:!1}),Or=()=>{const e=M.useContext(Gh);if(!e)throw new Error("useDrawerContext must be used within a Drawer.Root");return e};IE(`[data-vaul-drawer]{touch-action:none;will-change:transform;transition:transform .5s cubic-bezier(.32, .72, 0, 1);animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=open]{animation-name:slideFromBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=closed]{animation-name:slideToBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=open]{animation-name:slideFromTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=closed]{animation-name:slideToTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=open]{animation-name:slideFromLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=closed]{animation-name:slideToLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=open]{animation-name:slideFromRight}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=closed]{animation-name:slideToRight}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--initial-transform,100%),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--initial-transform,100%),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-overlay][data-vaul-snap-points=false]{animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-overlay][data-vaul-snap-points=false][data-state=open]{animation-name:fadeIn}[data-vaul-overlay][data-state=closed]{animation-name:fadeOut}[data-vaul-animate=false]{animation:none!important}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:0;transition:opacity .5s cubic-bezier(.32, .72, 0, 1)}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:1}[data-vaul-drawer]:not([data-vaul-custom-container=true])::after{content:'';position:absolute;background:inherit;background-color:inherit}[data-vaul-drawer][data-vaul-drawer-direction=top]::after{top:initial;bottom:100%;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=bottom]::after{top:100%;bottom:initial;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=left]::after{left:initial;right:100%;top:0;bottom:0;width:200%}[data-vaul-drawer][data-vaul-drawer-direction=right]::after{left:100%;right:initial;top:0;bottom:0;width:200%}[data-vaul-overlay][data-vaul-snap-points=true]:not([data-vaul-snap-points-overlay=true]):not( [data-state=closed] -){opacity:0}[data-vaul-overlay][data-vaul-snap-points-overlay=true]{opacity:1}[data-vaul-handle]{display:block;position:relative;opacity:.7;background:#e2e2e4;margin-left:auto;margin-right:auto;height:5px;width:32px;border-radius:1rem;touch-action:pan-y}[data-vaul-handle]:active,[data-vaul-handle]:hover{opacity:1}[data-vaul-handle-hitarea]{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:max(100%,2.75rem);height:max(100%,2.75rem);touch-action:inherit}@media (hover:hover) and (pointer:fine){[data-vaul-drawer]{user-select:none}}@media (pointer:fine){[data-vaul-handle-hitarea]:{width:100%;height:100%}}@keyframes fadeIn{from{opacity:0}to{opacity:1}}@keyframes fadeOut{to{opacity:0}}@keyframes slideFromBottom{from{transform:translate3d(0,var(--initial-transform,100%),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToBottom{to{transform:translate3d(0,var(--initial-transform,100%),0)}}@keyframes slideFromTop{from{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToTop{to{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}}@keyframes slideFromLeft{from{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToLeft{to{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}}@keyframes slideFromRight{from{transform:translate3d(var(--initial-transform,100%),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToRight{to{transform:translate3d(var(--initial-transform,100%),0,0)}}`);function zE(){const e=navigator.userAgent;return typeof window<"u"&&(/Firefox/.test(e)&&/Mobile/.test(e)||/FxiOS/.test(e))}function DE(){return nc(/^Mac/)}function jE(){return nc(/^iPhone/)}function tf(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function AE(){return nc(/^iPad/)||DE()&&navigator.maxTouchPoints>1}function Yh(){return jE()||AE()}function nc(e){return typeof window<"u"&&window.navigator!=null?e.test(window.navigator.platform):void 0}const $E=24,FE=typeof window<"u"?w.useLayoutEffect:w.useEffect;function nf(...e){return(...t)=>{for(let n of e)typeof n=="function"&&n(...t)}}const Ms=typeof document<"u"&&window.visualViewport;function rf(e){let t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function Xh(e){for(rf(e)&&(e=e.parentElement);e&&!rf(e);)e=e.parentElement;return e||document.scrollingElement||document.documentElement}const BE=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);let co=0,Os;function VE(e={}){let{isDisabled:t}=e;FE(()=>{if(!t)return co++,co===1&&Yh()&&(Os=WE()),()=>{co--,co===0&&(Os==null||Os())}},[t])}function WE(){let e,t=0,n=f=>{e=Xh(f.target),!(e===document.documentElement&&e===document.body)&&(t=f.changedTouches[0].pageY)},r=f=>{if(!e||e===document.documentElement||e===document.body){f.preventDefault();return}let p=f.changedTouches[0].pageY,y=e.scrollTop,S=e.scrollHeight-e.clientHeight;S!==0&&((y<=0&&p>t||y>=S&&p{let p=f.target;$a(p)&&p!==document.activeElement&&(f.preventDefault(),p.style.transform="translateY(-2000px)",p.focus(),requestAnimationFrame(()=>{p.style.transform=""}))},l=f=>{let p=f.target;$a(p)&&(p.style.transform="translateY(-2000px)",requestAnimationFrame(()=>{p.style.transform="",Ms&&(Ms.height{of(p)}):Ms.addEventListener("resize",()=>of(p),{once:!0}))}))},s=()=>{window.scrollTo(0,0)},a=window.pageXOffset,u=window.pageYOffset,c=nf(UE(document.documentElement,"paddingRight",`${window.innerWidth-document.documentElement.clientWidth}px`));window.scrollTo(0,0);let d=nf(Ur(document,"touchstart",n,{passive:!1,capture:!0}),Ur(document,"touchmove",r,{passive:!1,capture:!0}),Ur(document,"touchend",o,{passive:!1,capture:!0}),Ur(document,"focus",l,!0),Ur(window,"scroll",s));return()=>{c(),d(),window.scrollTo(a,u)}}function UE(e,t,n){let r=e.style[t];return e.style[t]=n,()=>{e.style[t]=r}}function Ur(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function of(e){let t=document.scrollingElement||document.documentElement;for(;e&&e!==t;){let n=Xh(e);if(n!==document.documentElement&&n!==document.body&&n!==e){let r=n.getBoundingClientRect().top,o=e.getBoundingClientRect().top,l=e.getBoundingClientRect().bottom;const s=n.getBoundingClientRect().bottom+$E;l>s&&(n.scrollTop+=o-r)}e=n.parentElement}}function $a(e){return e instanceof HTMLInputElement&&!BE.has(e.type)||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&e.isContentEditable}function HE(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function GE(...e){return t=>e.forEach(n=>HE(n,t))}function Qh(...e){return w.useCallback(GE(...e),e)}const Kh=new WeakMap;function we(e,t,n=!1){if(!e||!(e instanceof HTMLElement))return;let r={};Object.entries(t).forEach(([o,l])=>{if(o.startsWith("--")){e.style.setProperty(o,l);return}r[o]=e.style[o],e.style[o]=l}),!n&&Kh.set(e,r)}function YE(e,t){if(!e||!(e instanceof HTMLElement))return;let n=Kh.get(e);n&&(e.style[t]=n[t])}const ve=e=>{switch(e){case"top":case"bottom":return!0;case"left":case"right":return!1;default:return e}};function fo(e,t){if(!e)return null;const n=window.getComputedStyle(e),r=n.transform||n.webkitTransform||n.mozTransform;let o=r.match(/^matrix3d\((.+)\)$/);return o?parseFloat(o[1].split(", ")[ve(t)?13:12]):(o=r.match(/^matrix\((.+)\)$/),o?parseFloat(o[1].split(", ")[ve(t)?5:4]):null)}function XE(e){return 8*(Math.log(e+1)-2)}function Rs(e,t){if(!e)return()=>{};const n=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=n}}function QE(...e){return(...t)=>{for(const n of e)typeof n=="function"&&n(...t)}}const ae={DURATION:.5,EASE:[.32,.72,0,1]},qh=.4,KE=.25,qE=100,Zh=8,En=16,Fa=26,Ls="vaul-dragging";function Jh(e){const t=M.useRef(e);return M.useEffect(()=>{t.current=e}),M.useMemo(()=>(...n)=>t.current==null?void 0:t.current.call(t,...n),[])}function ZE({defaultProp:e,onChange:t}){const n=M.useState(e),[r]=n,o=M.useRef(r),l=Jh(t);return M.useEffect(()=>{o.current!==r&&(l(r),o.current=r)},[r,o,l]),n}function ev({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=ZE({defaultProp:t,onChange:n}),l=e!==void 0,s=l?e:r,a=Jh(n),u=M.useCallback(c=>{if(l){const f=typeof c=="function"?c(e):c;f!==e&&a(f)}else o(c)},[l,e,o,a]);return[s,u]}function JE({activeSnapPointProp:e,setActiveSnapPointProp:t,snapPoints:n,drawerRef:r,overlayRef:o,fadeFromIndex:l,onSnapPointChange:s,direction:a="bottom",container:u,snapToSequentialPoint:c}){const[d,f]=ev({prop:e,defaultProp:n==null?void 0:n[0],onChange:t}),[p,y]=M.useState(typeof window<"u"?{innerWidth:window.innerWidth,innerHeight:window.innerHeight}:void 0);M.useEffect(()=>{function P(){y({innerWidth:window.innerWidth,innerHeight:window.innerHeight})}return window.addEventListener("resize",P),()=>window.removeEventListener("resize",P)},[]);const S=M.useMemo(()=>d===(n==null?void 0:n[n.length-1])||null,[n,d]),g=M.useMemo(()=>{var P;return(P=n==null?void 0:n.findIndex(b=>b===d))!=null?P:null},[n,d]),E=n&&n.length>0&&(l||l===0)&&!Number.isNaN(l)&&n[l]===d||!n,m=M.useMemo(()=>{const P=u?{width:u.getBoundingClientRect().width,height:u.getBoundingClientRect().height}:typeof window<"u"?{width:window.innerWidth,height:window.innerHeight}:{width:0,height:0};var b;return(b=n==null?void 0:n.map(k=>{const N=typeof k=="string";let R=0;if(N&&(R=parseInt(k,10)),ve(a)){const O=N?R:p?k*P.height:0;return p?a==="bottom"?P.height-O:-P.height+O:O}const L=N?R:p?k*P.width:0;return p?a==="right"?P.width-L:-P.width+L:L}))!=null?b:[]},[n,p,u]),h=M.useMemo(()=>g!==null?m==null?void 0:m[g]:null,[m,g]),v=M.useCallback(P=>{var b;const k=(b=m==null?void 0:m.findIndex(N=>N===P))!=null?b:null;s(k),we(r.current,{transition:`transform ${ae.DURATION}s cubic-bezier(${ae.EASE.join(",")})`,transform:ve(a)?`translate3d(0, ${P}px, 0)`:`translate3d(${P}px, 0, 0)`}),m&&k!==m.length-1&&l!==void 0&&k!==l&&k{if(d||e){var P;const b=(P=n==null?void 0:n.findIndex(k=>k===e||k===d))!=null?P:-1;m&&b!==-1&&typeof m[b]=="number"&&v(m[b])}},[d,e,n,m,v]);function x({draggedDistance:P,closeDrawer:b,velocity:k,dismissible:N}){if(l===void 0)return;const R=a==="bottom"||a==="right"?(h??0)-P:(h??0)+P,L=g===l-1,O=g===0,$=P>0;if(L&&we(o.current,{transition:`opacity ${ae.DURATION}s cubic-bezier(${ae.EASE.join(",")})`}),!c&&k>2&&!$){N?b():v(m[0]);return}if(!c&&k>2&&$&&m&&n){v(m[n.length-1]);return}const B=m==null?void 0:m.reduce((U,I)=>typeof U!="number"||typeof I!="number"?U:Math.abs(I-R)qh&&Math.abs(P)0&&S&&n){v(m[n.length-1]);return}if(O&&U<0&&N&&b(),g===null)return;v(m[g+U]);return}v(B)}function T({draggedDistance:P}){if(h===null)return;const b=a==="bottom"||a==="right"?h-P:h+P;(a==="bottom"||a==="right")&&bm[m.length-1]||we(r.current,{transform:ve(a)?`translate3d(0, ${b}px, 0)`:`translate3d(${b}px, 0, 0)`})}function _(P,b){if(!n||typeof g!="number"||!m||l===void 0)return null;const k=g===l-1;if(g>=l&&b)return 0;if(k&&!b)return 1;if(!E&&!k)return null;const R=k?g+1:g-1,L=k?m[R]-m[R-1]:m[R+1]-m[R],O=P/Math.abs(L);return k?1-O:O}return{isLastSnapPoint:S,activeSnapPoint:d,shouldFade:E,getPercentageDragged:_,setActiveSnapPoint:f,activeSnapPointIndex:g,onRelease:x,onDrag:T,snapPointsOffset:m}}const e2=()=>()=>{};function t2(){const{direction:e,isOpen:t,shouldScaleBackground:n,setBackgroundColorOnScale:r,noBodyStyles:o}=Or(),l=M.useRef(null),s=w.useMemo(()=>document.body.style.backgroundColor,[]);function a(){return(window.innerWidth-Fa)/window.innerWidth}M.useEffect(()=>{if(t&&n){l.current&&clearTimeout(l.current);const u=document.querySelector("[data-vaul-drawer-wrapper]")||document.querySelector("[vaul-drawer-wrapper]");if(!u)return;QE(r&&!o?Rs(document.body,{background:"black"}):e2,Rs(u,{transformOrigin:ve(e)?"top":"left",transitionProperty:"transform, border-radius",transitionDuration:`${ae.DURATION}s`,transitionTimingFunction:`cubic-bezier(${ae.EASE.join(",")})`}));const c=Rs(u,{borderRadius:`${Zh}px`,overflow:"hidden",...ve(e)?{transform:`scale(${a()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`}:{transform:`scale(${a()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`}});return()=>{c(),l.current=window.setTimeout(()=>{s?document.body.style.background=s:document.body.style.removeProperty("background")},ae.DURATION*1e3)}}},[t,n,s])}let Hr=null;function n2({isOpen:e,modal:t,nested:n,hasBeenOpened:r,preventScrollRestoration:o,noBodyStyles:l}){const[s,a]=M.useState(()=>typeof window<"u"?window.location.href:""),u=M.useRef(0),c=M.useCallback(()=>{if(tf()&&Hr===null&&e&&!l){Hr={position:document.body.style.position,top:document.body.style.top,left:document.body.style.left,height:document.body.style.height,right:"unset"};const{scrollX:f,innerHeight:p}=window;document.body.style.setProperty("position","fixed","important"),Object.assign(document.body.style,{top:`${-u.current}px`,left:`${-f}px`,right:"0px",height:"auto"}),window.setTimeout(()=>window.requestAnimationFrame(()=>{const y=p-window.innerHeight;y&&u.current>=p&&(document.body.style.top=`${-(u.current+y)}px`)}),300)}},[e]),d=M.useCallback(()=>{if(tf()&&Hr!==null&&!l){const f=-parseInt(document.body.style.top,10),p=-parseInt(document.body.style.left,10);Object.assign(document.body.style,Hr),window.requestAnimationFrame(()=>{if(o&&s!==window.location.href){a(window.location.href);return}window.scrollTo(p,f)}),Hr=null}},[s]);return M.useEffect(()=>{function f(){u.current=window.scrollY}return f(),window.addEventListener("scroll",f),()=>{window.removeEventListener("scroll",f)}},[]),M.useEffect(()=>{if(t)return()=>{typeof document>"u"||document.querySelector("[data-vaul-drawer]")||d()}},[t,d]),M.useEffect(()=>{n||!r||(e?(!window.matchMedia("(display-mode: standalone)").matches&&c(),t||window.setTimeout(()=>{d()},500)):d())},[e,r,s,t,n,c,d]),{restorePositionSetting:d}}function tv({open:e,onOpenChange:t,children:n,onDrag:r,onRelease:o,snapPoints:l,shouldScaleBackground:s=!1,setBackgroundColorOnScale:a=!0,closeThreshold:u=KE,scrollLockTimeout:c=qE,dismissible:d=!0,handleOnly:f=!1,fadeFromIndex:p=l&&l.length-1,activeSnapPoint:y,setActiveSnapPoint:S,fixed:g,modal:E=!0,onClose:m,nested:h,noBodyStyles:v=!1,direction:x="bottom",defaultOpen:T=!1,disablePreventScroll:_=!0,snapToSequentialPoint:P=!1,preventScrollRestoration:b=!1,repositionInputs:k=!0,onAnimationEnd:N,container:R,autoFocus:L=!1}){var O,$;const[B=!1,G]=ev({defaultProp:T,prop:e,onChange:F=>{t==null||t(F),!F&&!h&&wv(),setTimeout(()=>{N==null||N(F)},ae.DURATION*1e3),F&&!E&&typeof window<"u"&&window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"}),F||(document.body.style.pointerEvents="auto")}}),[U,I]=M.useState(!1),[D,j]=M.useState(!1),[V,X]=M.useState(!1),oe=M.useRef(null),le=M.useRef(null),Ee=M.useRef(null),ye=M.useRef(null),Ne=M.useRef(null),xn=M.useRef(!1),jl=M.useRef(null),Al=M.useRef(0),Wn=M.useRef(!1),rc=M.useRef(!T),ic=M.useRef(0),H=M.useRef(null),oc=M.useRef(((O=H.current)==null?void 0:O.getBoundingClientRect().height)||0),lc=M.useRef((($=H.current)==null?void 0:$.getBoundingClientRect().width)||0),$l=M.useRef(0),mv=M.useCallback(F=>{l&&F===Rr.length-1&&(le.current=new Date)},[]),{activeSnapPoint:hv,activeSnapPointIndex:Un,setActiveSnapPoint:sc,onRelease:vv,snapPointsOffset:Rr,onDrag:gv,shouldFade:ac,getPercentageDragged:yv}=JE({snapPoints:l,activeSnapPointProp:y,setActiveSnapPointProp:S,drawerRef:H,fadeFromIndex:p,overlayRef:oe,onSnapPointChange:mv,direction:x,container:R,snapToSequentialPoint:P});VE({isDisabled:!B||D||!E||V||!U||!k||!_});const{restorePositionSetting:wv}=n2({isOpen:B,modal:E,nested:h??!1,hasBeenOpened:U,preventScrollRestoration:b,noBodyStyles:v});function Di(){return(window.innerWidth-Fa)/window.innerWidth}function xv(F){var Z,ee;!d&&!l||H.current&&!H.current.contains(F.target)||(oc.current=((Z=H.current)==null?void 0:Z.getBoundingClientRect().height)||0,lc.current=((ee=H.current)==null?void 0:ee.getBoundingClientRect().width)||0,j(!0),Ee.current=new Date,Yh()&&window.addEventListener("touchend",()=>xn.current=!1,{once:!0}),F.target.setPointerCapture(F.pointerId),Al.current=ve(x)?F.pageY:F.pageX)}function uc(F,Z){var ee;let q=F;const me=(ee=window.getSelection())==null?void 0:ee.toString(),$e=H.current?fo(H.current,x):null,Le=new Date;if(q.tagName==="SELECT"||q.hasAttribute("data-vaul-no-drag")||q.closest("[data-vaul-no-drag]"))return!1;if(x==="right"||x==="left")return!0;if(le.current&&Le.getTime()-le.current.getTime()<500)return!1;if($e!==null&&(x==="bottom"?$e>0:$e<0))return!0;if(me&&me.length>0)return!1;if(Ne.current&&Le.getTime()-Ne.current.getTime()q.clientHeight){if(q.scrollTop!==0)return Ne.current=new Date,!1;if(q.getAttribute("role")==="dialog")return!0}q=q.parentNode}return!0}function Sv(F){if(H.current&&D){const Z=x==="bottom"||x==="right"?1:-1,ee=(Al.current-(ve(x)?F.pageY:F.pageX))*Z,q=ee>0,me=l&&!d&&!q;if(me&&Un===0)return;const $e=Math.abs(ee),Le=document.querySelector("[data-vaul-drawer-wrapper]"),Vt=x==="bottom"||x==="top"?oc.current:lc.current;let st=$e/Vt;const Sn=yv($e,q);if(Sn!==null&&(st=Sn),me&&st>=1||!xn.current&&!uc(F.target,q))return;if(H.current.classList.add(Ls),xn.current=!0,we(H.current,{transition:"none"}),we(oe.current,{transition:"none"}),l&&gv({draggedDistance:ee}),q&&!l){const gt=XE(ee),ji=Math.min(gt*-1,0)*Z;we(H.current,{transform:ve(x)?`translate3d(0, ${ji}px, 0)`:`translate3d(${ji}px, 0, 0)`});return}const Wt=1-st;if((ac||p&&Un===p-1)&&(r==null||r(F,st),we(oe.current,{opacity:`${Wt}`,transition:"none"},!0)),Le&&oe.current&&s){const gt=Math.min(Di()+st*(1-Di()),1),ji=8-st*8,dc=Math.max(0,14-st*14);we(Le,{borderRadius:`${ji}px`,transform:ve(x)?`scale(${gt}) translate3d(0, ${dc}px, 0)`:`scale(${gt}) translate3d(${dc}px, 0, 0)`,transition:"none"},!0)}if(!l){const gt=$e*Z;we(H.current,{transform:ve(x)?`translate3d(0, ${gt}px, 0)`:`translate3d(${gt}px, 0, 0)`})}}}M.useEffect(()=>{window.requestAnimationFrame(()=>{rc.current=!0})},[]),M.useEffect(()=>{var F;function Z(){if(!H.current||!k)return;const ee=document.activeElement;if($a(ee)||Wn.current){var q;const me=((q=window.visualViewport)==null?void 0:q.height)||0,$e=window.innerHeight;let Le=$e-me;const Vt=H.current.getBoundingClientRect().height||0,st=Vt>$e*.8;$l.current||($l.current=Vt);const Sn=H.current.getBoundingClientRect().top;if(Math.abs(ic.current-Le)>60&&(Wn.current=!Wn.current),l&&l.length>0&&Rr&&Un){const Wt=Rr[Un]||0;Le+=Wt}if(ic.current=Le,Vt>me||Wn.current){const Wt=H.current.getBoundingClientRect().height;let gt=Wt;Wt>me&&(gt=me-(st?Sn:Fa)),g?H.current.style.height=`${Wt-Math.max(Le,0)}px`:H.current.style.height=`${Math.max(gt,me-Sn)}px`}else zE()||(H.current.style.height=`${$l.current}px`);l&&l.length>0&&!Wn.current?H.current.style.bottom="0px":H.current.style.bottom=`${Math.max(Le,0)}px`}}return(F=window.visualViewport)==null||F.addEventListener("resize",Z),()=>{var ee;return(ee=window.visualViewport)==null?void 0:ee.removeEventListener("resize",Z)}},[Un,l,Rr]);function Lr(F){Ev(),m==null||m(),F||G(!1),setTimeout(()=>{l&&sc(l[0])},ae.DURATION*1e3)}function cc(){if(!H.current)return;const F=document.querySelector("[data-vaul-drawer-wrapper]"),Z=fo(H.current,x);we(H.current,{transform:"translate3d(0, 0, 0)",transition:`transform ${ae.DURATION}s cubic-bezier(${ae.EASE.join(",")})`}),we(oe.current,{transition:`opacity ${ae.DURATION}s cubic-bezier(${ae.EASE.join(",")})`,opacity:"1"}),s&&Z&&Z>0&&B&&we(F,{borderRadius:`${Zh}px`,overflow:"hidden",...ve(x)?{transform:`scale(${Di()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`,transformOrigin:"top"}:{transform:`scale(${Di()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`,transformOrigin:"left"},transitionProperty:"transform, border-radius",transitionDuration:`${ae.DURATION}s`,transitionTimingFunction:`cubic-bezier(${ae.EASE.join(",")})`},!0)}function Ev(){!D||!H.current||(H.current.classList.remove(Ls),xn.current=!1,j(!1),ye.current=new Date)}function Cv(F){if(!D||!H.current)return;H.current.classList.remove(Ls),xn.current=!1,j(!1),ye.current=new Date;const Z=fo(H.current,x);if(!F||!uc(F.target,!1)||!Z||Number.isNaN(Z)||Ee.current===null)return;const ee=ye.current.getTime()-Ee.current.getTime(),q=Al.current-(ve(x)?F.pageY:F.pageX),me=Math.abs(q)/ee;if(me>.05&&(X(!0),setTimeout(()=>{X(!1)},200)),l){vv({draggedDistance:q*(x==="bottom"||x==="right"?1:-1),closeDrawer:Lr,velocity:me,dismissible:d}),o==null||o(F,!0);return}if(x==="bottom"||x==="right"?q>0:q<0){cc(),o==null||o(F,!0);return}if(me>qh){Lr(),o==null||o(F,!1);return}var $e;const Le=Math.min(($e=H.current.getBoundingClientRect().height)!=null?$e:0,window.innerHeight);var Vt;const st=Math.min((Vt=H.current.getBoundingClientRect().width)!=null?Vt:0,window.innerWidth),Sn=x==="left"||x==="right";if(Math.abs(Z)>=(Sn?st:Le)*u){Lr(),o==null||o(F,!1);return}o==null||o(F,!0),cc()}M.useEffect(()=>(B&&(we(document.documentElement,{scrollBehavior:"auto"}),le.current=new Date),()=>{YE(document.documentElement,"scrollBehavior")}),[B]);function Tv(F){const Z=F?(window.innerWidth-En)/window.innerWidth:1,ee=F?-En:0;jl.current&&window.clearTimeout(jl.current),we(H.current,{transition:`transform ${ae.DURATION}s cubic-bezier(${ae.EASE.join(",")})`,transform:ve(x)?`scale(${Z}) translate3d(0, ${ee}px, 0)`:`scale(${Z}) translate3d(${ee}, 0, 0)`}),!F&&H.current&&(jl.current=setTimeout(()=>{const q=fo(H.current,x);we(H.current,{transition:"none",transform:ve(x)?`translate3d(0, ${q}px, 0)`:`translate3d(${q}px, 0, 0)`})},500))}function bv(F,Z){if(Z<0)return;const ee=(window.innerWidth-En)/window.innerWidth,q=ee+Z*(1-ee),me=-En+Z*En;we(H.current,{transform:ve(x)?`scale(${q}) translate3d(0, ${me}px, 0)`:`scale(${q}) translate3d(${me}px, 0, 0)`,transition:"none"})}function Pv(F,Z){const ee=ve(x)?window.innerHeight:window.innerWidth,q=Z?(ee-En)/ee:1,me=Z?-En:0;Z&&we(H.current,{transition:`transform ${ae.DURATION}s cubic-bezier(${ae.EASE.join(",")})`,transform:ve(x)?`scale(${q}) translate3d(0, ${me}px, 0)`:`scale(${q}) translate3d(${me}px, 0, 0)`})}return M.useEffect(()=>{E||window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"})},[E]),M.createElement(Ih,{defaultOpen:T,onOpenChange:F=>{!d&&!F||(F?I(!0):Lr(!0),G(F))},open:B},M.createElement(Gh.Provider,{value:{activeSnapPoint:hv,snapPoints:l,setActiveSnapPoint:sc,drawerRef:H,overlayRef:oe,onOpenChange:t,onPress:xv,onRelease:Cv,onDrag:Sv,dismissible:d,shouldAnimate:rc,handleOnly:f,isOpen:B,isDragging:D,shouldFade:ac,closeDrawer:Lr,onNestedDrag:bv,onNestedOpenChange:Tv,onNestedRelease:Pv,keyboardIsOpen:Wn,modal:E,snapPointsOffset:Rr,activeSnapPointIndex:Un,direction:x,shouldScaleBackground:s,setBackgroundColorOnScale:a,noBodyStyles:v,container:R,autoFocus:L}},n))}const nv=M.forwardRef(function({...e},t){const{overlayRef:n,snapPoints:r,onRelease:o,shouldFade:l,isOpen:s,modal:a,shouldAnimate:u}=Or(),c=Qh(t,n),d=r&&r.length>0;if(!a)return null;const f=M.useCallback(p=>o(p),[o]);return M.createElement(Xu,{onMouseUp:f,ref:c,"data-vaul-overlay":"","data-vaul-snap-points":s&&d?"true":"false","data-vaul-snap-points-overlay":s&&l?"true":"false","data-vaul-animate":u!=null&&u.current?"true":"false",...e})});nv.displayName="Drawer.Overlay";const rv=M.forwardRef(function({onPointerDownOutside:e,style:t,onOpenAutoFocus:n,...r},o){const{drawerRef:l,onPress:s,onRelease:a,onDrag:u,keyboardIsOpen:c,snapPointsOffset:d,activeSnapPointIndex:f,modal:p,isOpen:y,direction:S,snapPoints:g,container:E,handleOnly:m,shouldAnimate:h,autoFocus:v}=Or(),[x,T]=M.useState(!1),_=Qh(o,l),P=M.useRef(null),b=M.useRef(null),k=M.useRef(!1),N=g&&g.length>0;t2();const R=(O,$,B=0)=>{if(k.current)return!0;const G=Math.abs(O.y),U=Math.abs(O.x),I=U>G,D=["bottom","right"].includes($)?1:-1;if($==="left"||$==="right"){if(!(O.x*D<0)&&U>=0&&U<=B)return I}else if(!(O.y*D<0)&&G>=0&&G<=B)return!I;return k.current=!0,!0};M.useEffect(()=>{N&&window.requestAnimationFrame(()=>{T(!0)})},[]);function L(O){P.current=null,k.current=!1,a(O)}return M.createElement(Qu,{"data-vaul-drawer-direction":S,"data-vaul-drawer":"","data-vaul-delayed-snap-points":x?"true":"false","data-vaul-snap-points":y&&N?"true":"false","data-vaul-custom-container":E?"true":"false","data-vaul-animate":h!=null&&h.current?"true":"false",...r,ref:_,style:d&&d.length>0?{"--snap-point-height":`${d[f??0]}px`,...t}:t,onPointerDown:O=>{m||(r.onPointerDown==null||r.onPointerDown.call(r,O),P.current={x:O.pageX,y:O.pageY},s(O))},onOpenAutoFocus:O=>{n==null||n(O),v||O.preventDefault()},onPointerDownOutside:O=>{if(e==null||e(O),!p||O.defaultPrevented){O.preventDefault();return}c.current&&(c.current=!1)},onFocusOutside:O=>{if(!p){O.preventDefault();return}},onPointerMove:O=>{if(b.current=O,m||(r.onPointerMove==null||r.onPointerMove.call(r,O),!P.current))return;const $=O.pageY-P.current.y,B=O.pageX-P.current.x,G=O.pointerType==="touch"?10:2;R({x:B,y:$},S,G)?u(O):(Math.abs(B)>G||Math.abs($)>G)&&(P.current=null)},onPointerUp:O=>{r.onPointerUp==null||r.onPointerUp.call(r,O),P.current=null,k.current=!1,a(O)},onPointerOut:O=>{r.onPointerOut==null||r.onPointerOut.call(r,O),L(b.current)},onContextMenu:O=>{r.onContextMenu==null||r.onContextMenu.call(r,O),b.current&&L(b.current)}})});rv.displayName="Drawer.Content";const r2=250,i2=120,iv=M.forwardRef(function({preventCycle:e=!1,children:t,...n},r){const{closeDrawer:o,isDragging:l,snapPoints:s,activeSnapPoint:a,setActiveSnapPoint:u,dismissible:c,handleOnly:d,isOpen:f,onPress:p,onDrag:y}=Or(),S=M.useRef(null),g=M.useRef(!1);function E(){if(g.current){v();return}window.setTimeout(()=>{m()},i2)}function m(){if(l||e||g.current){v();return}if(v(),!s||s.length===0){c||o();return}if(a===s[s.length-1]&&c){o();return}const T=s.findIndex(P=>P===a);if(T===-1)return;const _=s[T+1];u(_)}function h(){S.current=window.setTimeout(()=>{g.current=!0},r2)}function v(){S.current&&window.clearTimeout(S.current),g.current=!1}return M.createElement("div",{onClick:E,onPointerCancel:v,onPointerDown:x=>{d&&p(x),h()},onPointerMove:x=>{d&&y(x)},ref:r,"data-vaul-drawer-visible":f?"true":"false","data-vaul-handle":"","aria-hidden":"true",...n},M.createElement("span",{"data-vaul-handle-hitarea":"","aria-hidden":"true"},t))});iv.displayName="Drawer.Handle";function o2({onDrag:e,onOpenChange:t,...n}){const{onNestedDrag:r,onNestedOpenChange:o,onNestedRelease:l}=Or();if(!r)throw new Error("Drawer.NestedRoot must be placed in another drawer");return M.createElement(tv,{nested:!0,onClose:()=>{o(!1)},onDrag:(s,a)=>{r(s,a),e==null||e(s,a)},onOpenChange:s=>{s&&o(s)},onRelease:l,...n})}function l2(e){const t=Or(),{container:n=t.container,...r}=e;return M.createElement(Dh,{container:n,...r})}const vt={Root:tv,NestedRoot:o2,Content:rv,Overlay:nv,Trigger:zh,Portal:l2,Handle:iv,Close:jh,Title:Ku,Description:qu},ov=({shouldScaleBackground:e=!0,...t})=>C.jsx(vt.Root,{shouldScaleBackground:e,...t});ov.displayName="Drawer";const s2=vt.Trigger,a2=vt.Portal,u2=vt.Close,lv=w.forwardRef(({className:e,...t},n)=>C.jsx(vt.Overlay,{ref:n,className:He("fixed inset-0 z-50 bg-black/80",e),...t}));lv.displayName=vt.Overlay.displayName;const sv=w.forwardRef(({className:e,children:t,...n},r)=>C.jsxs(a2,{children:[C.jsx(lv,{}),C.jsxs(vt.Content,{ref:r,className:He("fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border bg-background",e),...n,children:[C.jsx("div",{className:"mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted"}),t]})]}));sv.displayName="DrawerContent";const av=({className:e,...t})=>C.jsx("div",{className:He("grid gap-1.5 p-4 text-center sm:text-left",e),...t});av.displayName="DrawerHeader";const uv=({className:e,...t})=>C.jsx("div",{className:He("mt-auto flex flex-col gap-2 p-4",e),...t});uv.displayName="DrawerFooter";const cv=w.forwardRef(({className:e,...t},n)=>C.jsx(vt.Title,{ref:n,className:He("text-lg font-semibold leading-none tracking-tight",e),...t}));cv.displayName=vt.Title.displayName;const dv=w.forwardRef(({className:e,...t},n)=>C.jsx(vt.Description,{ref:n,className:He("text-sm text-muted-foreground",e),...t}));dv.displayName=vt.Description.displayName;function fv(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;ttypeof e=="boolean"?"".concat(e):e===0?"0":e,sf=c2,d2=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return sf(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:l}=t,s=Object.keys(o).map(c=>{const d=n==null?void 0:n[c],f=l==null?void 0:l[c];if(d===null)return null;const p=lf(d)||lf(f);return o[c][p]}),a=n&&Object.entries(n).reduce((c,d)=>{let[f,p]=d;return p===void 0||(c[f]=p),c},{}),u=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,d)=>{let{class:f,className:p,...y}=d;return Object.entries(y).every(S=>{let[g,E]=S;return Array.isArray(E)?E.includes({...l,...a}[g]):{...l,...a}[g]===E})?[...c,f,p]:c},[]);return sf(e,s,u,n==null?void 0:n.class,n==null?void 0:n.className)},f2=d2("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),Ba=w.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...o},l)=>{const s=r?Rl:"button";return C.jsx(s,{className:He(f2({variant:t,size:n,className:e})),ref:l,...o})});Ba.displayName="Button";var po=function(e,t){return et?1:0},af=function(e){return e.reduce(function(t,n){return t+n},0)},p2=function(){function e(n){this.colors=n}var t=e.prototype;return t.palette=function(){return this.colors},t.map=function(n){return n},e}(),m2=function(){function e(l,s,a){return(l<<10)+(s<<5)+a}function t(l){var s=[],a=!1;function u(){s.sort(l),a=!0}return{push:function(c){s.push(c),a=!1},peek:function(c){return a||u(),c===void 0&&(c=s.length-1),s[c]},pop:function(){return a||u(),s.pop()},size:function(){return s.length},map:function(c){return s.map(c)},debug:function(){return a||u(),s}}}function n(l,s,a,u,c,d,f){var p=this;p.r1=l,p.r2=s,p.g1=a,p.g2=u,p.b1=c,p.b2=d,p.histo=f}function r(){this.vboxes=new t(function(l,s){return po(l.vbox.count()*l.vbox.volume(),s.vbox.count()*s.vbox.volume())})}function o(l,s){if(s.count()){var a=s.r2-s.r1+1,u=s.g2-s.g1+1,c=Math.max.apply(null,[a,u,s.b2-s.b1+1]);if(s.count()==1)return[s.copy()];var d,f,p,y,S=0,g=[],E=[];if(c==a)for(d=s.r1;d<=s.r2;d++){for(y=0,f=s.g1;f<=s.g2;f++)for(p=s.b1;p<=s.b2;p++)y+=l[e(d,f,p)]||0;g[d]=S+=y}else if(c==u)for(d=s.g1;d<=s.g2;d++){for(y=0,f=s.r1;f<=s.r2;f++)for(p=s.b1;p<=s.b2;p++)y+=l[e(f,d,p)]||0;g[d]=S+=y}else for(d=s.b1;d<=s.b2;d++){for(y=0,f=s.r1;f<=s.r2;f++)for(p=s.g1;p<=s.g2;p++)y+=l[e(f,p,d)]||0;g[d]=S+=y}return g.forEach(function(m,h){E[h]=S-m}),function(m){var h,v,x,T,_,P=m+"1",b=m+"2",k=0;for(d=s[P];d<=s[b];d++)if(g[d]>S/2){for(x=s.copy(),T=s.copy(),_=(h=d-s[P])<=(v=s[b]-d)?Math.min(s[b]-1,~~(d+v/2)):Math.max(s[P],~~(d-1-h/2));!g[_];)_++;for(k=E[_];!k&&g[_-1];)k=E[--_];return x[b]=_,T[P]=x[b]+1,[x,T]}}(c==a?"r":c==u?"g":"b")}}return n.prototype={volume:function(l){var s=this;return s._volume&&!l||(s._volume=(s.r2-s.r1+1)*(s.g2-s.g1+1)*(s.b2-s.b1+1)),s._volume},count:function(l){var s=this,a=s.histo;if(!s._count_set||l){var u,c,d,f=0;for(u=s.r1;u<=s.r2;u++)for(c=s.g1;c<=s.g2;c++)for(d=s.b1;d<=s.b2;d++)f+=a[e(u,c,d)]||0;s._count=f,s._count_set=!0}return s._count},copy:function(){var l=this;return new n(l.r1,l.r2,l.g1,l.g2,l.b1,l.b2,l.histo)},avg:function(l){var s=this,a=s.histo;if(!s._avg||l){var u,c,d,f,p=0,y=0,S=0,g=0;if(s.r1===s.r2&&s.g1===s.g2&&s.b1===s.b2)s._avg=[s.r1<<3,s.g1<<3,s.b1<<3];else{for(c=s.r1;c<=s.r2;c++)for(d=s.g1;d<=s.g2;d++)for(f=s.b1;f<=s.b2;f++)p+=u=a[e(c,d,f)]||0,y+=u*(c+.5)*8,S+=u*(d+.5)*8,g+=u*(f+.5)*8;s._avg=p?[~~(y/p),~~(S/p),~~(g/p)]:[~~(8*(s.r1+s.r2+1)/2),~~(8*(s.g1+s.g2+1)/2),~~(8*(s.b1+s.b2+1)/2)]}}return s._avg},contains:function(l){var s=this,a=l[0]>>3;return gval=l[1]>>3,bval=l[2]>>3,a>=s.r1&&a<=s.r2&&gval>=s.g1&&gval<=s.g2&&bval>=s.b1&&bval<=s.b2}},r.prototype={push:function(l){this.vboxes.push({vbox:l,color:l.avg()})},palette:function(){return this.vboxes.map(function(l){return l.color})},size:function(){return this.vboxes.size()},map:function(l){for(var s=this.vboxes,a=0;a251&&u[1]>251&&u[2]>251&&(l[a].color=[255,255,255])}},{quantize:function(l,s){if(!Number.isInteger(s)||s<1||s>256)throw new Error("Invalid maximum color count. It must be an integer between 1 and 256.");if(!l.length||s<2||s>256||!l.length||s<2||s>256)return!1;for(var a=[],u=new Set,c=0;c>3,T[1]>>3,T[2]>>3),x[v]=(x[v]||0)+1}),x}(l);p.forEach(function(){});var y=function(h,v){var x,T,_,P=1e6,b=0,k=1e6,N=0,R=1e6,L=0;return h.forEach(function(O){(x=O[0]>>3)b&&(b=x),(T=O[1]>>3)N&&(N=T),(_=O[2]>>3)L&&(L=_)}),new n(P,b,k,N,R,L,v)}(l,p),S=new t(function(h,v){return po(h.count(),v.count())});function g(h,v){for(var x,T=h.size(),_=0;_<1e3;){if(T>=v||_++>1e3)return;if((x=h.pop()).count()){var P=o(p,x),b=P[0],k=P[1];if(!b)return;h.push(b),k&&(h.push(k),T++)}else h.push(x),_++}}S.push(y),g(S,.75*s);for(var E=new t(function(h,v){return po(h.count()*h.volume(),v.count()*v.volume())});S.size();)E.push(S.pop());g(E,s);for(var m=new r;E.size();)m.push(E.pop());return m}}}().quantize,pv=function(e){this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"),this.width=this.canvas.width=e.naturalWidth,this.height=this.canvas.height=e.naturalHeight,this.context.drawImage(e,0,0,this.width,this.height)};pv.prototype.getImageData=function(){return this.context.getImageData(0,0,this.width,this.height)};var Kn=function(){};Kn.prototype.getColor=function(e,t){return t===void 0&&(t=10),this.getPalette(e,5,t)[0]},Kn.prototype.getPalette=function(e,t,n){var r=function(a){var u=a.colorCount,c=a.quality;if(u!==void 0&&Number.isInteger(u)){if(u===1)throw new Error("colorCount should be between 2 and 20. To get one color, call getColor() instead of getPalette()");u=Math.max(u,2),u=Math.min(u,20)}else u=10;return(c===void 0||!Number.isInteger(c)||c<1)&&(c=10),{colorCount:u,quality:c}}({colorCount:t,quality:n}),o=new pv(e),l=function(a,u,c){for(var d,f,p,y,S,g=a,E=[],m=0;m=125)&&(f>250&&p>250&&y>250||E.push([f,p,y]));return E}(o.getImageData().data,o.width*o.height,r.quality),s=m2(l,r.colorCount);return s?s.palette():null},Kn.prototype.getColorFromUrl=function(e,t,n){var r=this,o=document.createElement("img");o.addEventListener("load",function(){var l=r.getPalette(o,5,n);t(l[0],e)}),o.src=e},Kn.prototype.getImageData=function(e,t){var n=new XMLHttpRequest;n.open("GET",e,!0),n.responseType="arraybuffer",n.onload=function(){if(this.status==200){var r=new Uint8Array(this.response);i=r.length;for(var o=new Array(i),l=0;lnew Promise((t,n)=>{const r=new Kn,o=new Image;o.crossOrigin="anonymous",o.src=e,o.onload=()=>{try{const l=r.getColor(o);t(l)}catch{n("Failed to extract dominant color")}},o.onerror=()=>n("Image failed to load")}),v2=e=>((r,o,l)=>{const s=[r,o,l].map(a=>(a/=255,a<=.03928?a/12.92:Math.pow((a+.055)/1.055,2.4)));return s[0]*.2126+s[1]*.7152+s[2]*.0722})(e[0],e[1],e[2])>.5?"black":"white";function g2(){const{id:e}=My(),[t,n]=w.useState(null),[r,o]=w.useState([]),[l,s]=w.useState(null),[a,u]=w.useState(!0),[c,d]=w.useState(!1),[f,p]=w.useState(!1),[y,S]=w.useState(""),[g,E]=w.useState("white"),[m,h]=w.useState(!1),v="site:filmyzilla.com.by";w.useEffect(()=>{JSON.parse(localStorage.getItem("playlist").includes(e))?h(!0):h(!1)},[e]),w.useEffect(()=>{window.scrollTo(0,0)},[e]);const x=()=>{if(t!=null&&t.title){p(!1);const k=`${t.title} ${v}`,N=`https://www.google.com/search?q=${encodeURIComponent(k)}`;window.open(N,"_blank")}},T=()=>{p(!1)},_=async()=>{if(navigator.share&&t)try{await navigator.share({title:t.title,text:t.overview,url:window.location.href}),console.log("Movie shared successfully")}catch(k){console.error("Error sharing movie:",k)}else Q.error("Sharing is not supported in your browser")},P=k=>{const N=Math.floor(k/60),R=k%60;return`${N>0?`${N}h`:""} ${R>0?`${R}m`:""}`.trim()};w.useEffect(()=>{(async()=>{try{const R=await(await fetch(`https://api.themoviedb.org/3/movie/${e}?api_key=4c1eef5a8d388386187a3426bc2345be`)).json(),L=`https://image.tmdb.org/t/p/w500/${R.poster_path}?not-from-cache-please`;h2(L).then(I=>{let D=`rgb(${I[0]}, ${I[1]}, ${I[2]})`;S(D);const j=v2(I);E(j)}).catch(I=>{Q.error("Unable to get CLR"),console.error(I)}),n(R);const $=await(await fetch(`https://api.themoviedb.org/3/movie/${e}/similar?api_key=4c1eef5a8d388386187a3426bc2345be`)).json();o($.results);const U=(await(await fetch(`https://api.themoviedb.org/3/movie/${e}/videos?api_key=4c1eef5a8d388386187a3426bc2345be`)).json()).results.filter(I=>I.type==="Trailer"&&I.site==="YouTube");U.length>0&&s(`https://www.youtube.com/embed/${U[0].key}`),u(!1)}catch(N){Q.error(N),console.error("Error fetching movie details:",N),u(!1)}})()},[e]);const b=k=>{const N=JSON.parse(localStorage.getItem("playlist"))||[];N.includes(k)?Q.error("Already Added"):(N.push(k),localStorage.setItem("playlist",JSON.stringify(N)),h(!0),Q.success("Added to watchlist"))};return a?C.jsxs("div",{className:"relative grid grid-cols-1 lg:grid-cols-3 gap-2 p-5 mt-14 lg:py-8 shadow-md text-white",children:[C.jsx("div",{className:"relative flex justify-center items-center rounded-lg bg-cover bg-center",children:C.jsx(kt,{className:"w-full h-80 rounded-lg"})}),C.jsxs("div",{className:"relative z-10 flex flex-col gap-3 col-span-2",children:[C.jsxs("div",{className:"flex flex-col",children:[C.jsx(kt,{className:"w-3/4 h-8 mb-3"}),C.jsx(kt,{className:"w-2/3 h-6"})]}),C.jsxs("div",{className:"my-5 flex items-center gap-2",children:[C.jsx(kt,{className:"w-10 h-10 rounded-full"}),C.jsx(kt,{className:"w-10 h-10 rounded-full"}),C.jsx(kt,{className:"h-10 w-32 rounded-full"})]}),C.jsxs("div",{className:"mt-5",children:[C.jsx(kt,{className:"w-3/4 h-6 mb-2"}),C.jsx(kt,{className:"w-full h-4"})]})]}),C.jsx("div",{style:{background:`${y}`},className:"absolute inset-0 w-full h-full -z-5"})]}):C.jsxs(C.Fragment,{children:[C.jsxs("div",{style:{backgroundImage:`url(https://image.tmdb.org/t/p/w780/${t.backdrop_path})`,backgroundSize:"cover",color:`${g}`},className:"relative grid grid-cols-1 lg:grid-cols-3 gap-2 p-5 mt-14 lg:py-8 shadow-md ",children:[C.jsx("div",{className:"relative flex justify-center items-center rounded-lg bg-cover bg-center shadow-lg",children:C.jsx("img",{className:" relative z-10 lg:w-2/3 h-auto max-w-xs sm:max-w-sm md:max-w-md lg:max-w-lg rounded-lg",src:`https://image.tmdb.org/t/p/w500/${t.poster_path}`,alt:t.title})}),C.jsxs("div",{className:"relative z-10 flex flex-col gap-3 col-span-2",children:[C.jsxs("div",{className:"flex flex-col",children:[C.jsxs("h1",{className:"text-2xl sm:text-3xl lg:text-4xl font-semibold",children:[t.title," (",t.release_date.split("-")[0],")"]}),C.jsxs("p",{className:"text-sm lg:text-base",children:[t.original_language.toUpperCase()," |"," ",t.genres.map(k=>k.name).join(", ")," |"," ",P(t.runtime)]})]}),C.jsxs("div",{className:"my-2 flex items-center gap-2",children:[C.jsxs("div",{children:[C.jsx("div",{className:"w-10 h-10 rounded-full bg-zinc-50 text-zinc-900 flex items-center justify-center cursor-pointer",onClick:()=>p(!0),children:C.jsx(NE,{})}),C.jsx($h,{open:f,onOpenChange:p,children:C.jsx(Zu,{children:C.jsxs(Ju,{children:[C.jsx(ec,{children:"Confirm Redirect"}),C.jsxs(tc,{children:["You are being redirected to a new website. Do you want to continue?",C.jsxs("span",{className:"flex items-center justify-end mt-5 gap-2",children:[C.jsx(Ba,{onClick:T,variant:"outline",children:"Cancel"}),C.jsx(Ba,{onClick:x,children:"Confirm"})]})]})]})})})]}),C.jsx("div",{onClick:()=>{b(t.id)},className:"w-10 h-10 rounded-full bg-zinc-50 text-zinc-900 flex items-center justify-center cursor-pointer",children:m?C.jsx(bx,{}):C.jsx(Px,{})}),C.jsx("div",{onClick:_,className:"w-10 h-10 rounded-full bg-zinc-50 text-zinc-900 flex items-center justify-center cursor-pointer",children:C.jsx(OE,{})}),C.jsx("div",{className:" h-10 px-4 gap-2 rounded-full bg-zinc-50 text-zinc-900 flex items-center justify-center cursor-pointer",children:C.jsxs(ov,{children:[C.jsxs(s2,{className:"flex items-center gap-2",onClick:()=>d(!0),children:[" ",C.jsx(ME,{}),"Play Trailer"]}),C.jsxs(sv,{children:[C.jsxs(av,{children:[C.jsx(cv,{children:"Watch Trailer"}),C.jsxs(dv,{children:["Watch the trailer for ",t.title]}),c&&l?C.jsx("iframe",{width:"100%",height:"315",src:`${l}?autoplay=1`,title:"Movie Trailer",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0}):C.jsx("p",{children:"Trailer not available."})]}),C.jsx(uv,{children:C.jsx(u2,{onClick:()=>d(!1)})})]})]})})]}),C.jsxs("div",{children:[C.jsx("p",{className:"text-sm lg:text-base italic",children:t.tagline}),C.jsx("p",{className:"font-semibold text-xl",children:"Overview"}),C.jsx("p",{className:"text-base lg:text-lg leading-relaxed",children:t.overview})]}),C.jsxs("div",{children:["IMDB RATING |"," ",C.jsxs("span",{className:"bg-zinc-50 text-zinc-900 px-2 rounded-md",children:[" ",t.vote_average,"/10"]})]})]}),C.jsx("div",{style:{background:`${y}`,opacity:".9"},className:"absolute inset-0 w-full h-full -z-5 backdrop-blur-sm"})]}),C.jsxs("div",{className:"p-5",children:[r.length>0&&C.jsx(Kt,{title:"Related Movies"}),C.jsx("div",{className:"grid grid-cols-3 lg:grid-cols-6 gap-5 text-white",children:r.map(k=>C.jsx(Wu,{movie:k},k.id))})]})]})}const y2=()=>{const[e,t]=w.useState([]),[n,r]=w.useState(!0);w.useEffect(()=>{(async()=>{const s=JSON.parse(localStorage.getItem("playlist"))||[];try{const a=s.map(c=>fetch(`https://api.themoviedb.org/3/movie/${c}?api_key=4c1eef5a8d388386187a3426bc2345be`).then(d=>d.json())),u=await Promise.all(a);t(u),r(!1)}catch(a){console.error("Error fetching movie data:",a),Q.error(a),r(!1)}})()},[]);const o=l=>{const a=(JSON.parse(localStorage.getItem("playlist"))||[]).filter(u=>u!==l);localStorage.setItem("playlist",JSON.stringify(a)),t(e.filter(u=>u.id!==l))};return n?C.jsx("p",{className:"p-5",children:"Loading your playlist..."}):C.jsx("div",{className:"p-5",children:e.length>0?C.jsxs(C.Fragment,{children:[C.jsx(Kt,{title:"Your Watchlist"}),C.jsx("div",{className:"grid grid-cols-3 lg:grid-cols-6 gap-5 text-white",children:e.map(l=>C.jsx(Wu,{cancel:!0,movie:l,onRemoveFromWatchlist:o},l.id))})]}):C.jsx("div",{className:"text-center text-xl text-gray-400",children:"No movies found in your watchlist."})})};function w2(){return C.jsx(t1,{children:C.jsx(Yy,{children:C.jsxs(Kr,{path:"/",element:C.jsx(LE,{}),children:[C.jsx(Kr,{index:!0,element:C.jsx(Mx,{})}),C.jsx(Kr,{path:"/movie/:id",element:C.jsx(g2,{})}),C.jsx(Kr,{path:"/watchlist",element:C.jsx(y2,{})}),"\\"]})})})}Cm(document.getElementById("root")).render(C.jsxs(w.StrictMode,{children:[C.jsx(w2,{}),C.jsx(CE,{theme:"dark"})]})); +){opacity:0}[data-vaul-overlay][data-vaul-snap-points-overlay=true]{opacity:1}[data-vaul-handle]{display:block;position:relative;opacity:.7;background:#e2e2e4;margin-left:auto;margin-right:auto;height:5px;width:32px;border-radius:1rem;touch-action:pan-y}[data-vaul-handle]:active,[data-vaul-handle]:hover{opacity:1}[data-vaul-handle-hitarea]{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:max(100%,2.75rem);height:max(100%,2.75rem);touch-action:inherit}@media (hover:hover) and (pointer:fine){[data-vaul-drawer]{user-select:none}}@media (pointer:fine){[data-vaul-handle-hitarea]:{width:100%;height:100%}}@keyframes fadeIn{from{opacity:0}to{opacity:1}}@keyframes fadeOut{to{opacity:0}}@keyframes slideFromBottom{from{transform:translate3d(0,var(--initial-transform,100%),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToBottom{to{transform:translate3d(0,var(--initial-transform,100%),0)}}@keyframes slideFromTop{from{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToTop{to{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}}@keyframes slideFromLeft{from{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToLeft{to{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}}@keyframes slideFromRight{from{transform:translate3d(var(--initial-transform,100%),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToRight{to{transform:translate3d(var(--initial-transform,100%),0,0)}}`);function zE(){const e=navigator.userAgent;return typeof window<"u"&&(/Firefox/.test(e)&&/Mobile/.test(e)||/FxiOS/.test(e))}function DE(){return nc(/^Mac/)}function jE(){return nc(/^iPhone/)}function tf(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function AE(){return nc(/^iPad/)||DE()&&navigator.maxTouchPoints>1}function Yh(){return jE()||AE()}function nc(e){return typeof window<"u"&&window.navigator!=null?e.test(window.navigator.platform):void 0}const $E=24,FE=typeof window<"u"?w.useLayoutEffect:w.useEffect;function nf(...e){return(...t)=>{for(let n of e)typeof n=="function"&&n(...t)}}const Ms=typeof document<"u"&&window.visualViewport;function rf(e){let t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function Xh(e){for(rf(e)&&(e=e.parentElement);e&&!rf(e);)e=e.parentElement;return e||document.scrollingElement||document.documentElement}const BE=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);let co=0,Os;function VE(e={}){let{isDisabled:t}=e;FE(()=>{if(!t)return co++,co===1&&Yh()&&(Os=WE()),()=>{co--,co===0&&(Os==null||Os())}},[t])}function WE(){let e,t=0,n=f=>{e=Xh(f.target),!(e===document.documentElement&&e===document.body)&&(t=f.changedTouches[0].pageY)},r=f=>{if(!e||e===document.documentElement||e===document.body){f.preventDefault();return}let p=f.changedTouches[0].pageY,y=e.scrollTop,S=e.scrollHeight-e.clientHeight;S!==0&&((y<=0&&p>t||y>=S&&p{let p=f.target;$a(p)&&p!==document.activeElement&&(f.preventDefault(),p.style.transform="translateY(-2000px)",p.focus(),requestAnimationFrame(()=>{p.style.transform=""}))},l=f=>{let p=f.target;$a(p)&&(p.style.transform="translateY(-2000px)",requestAnimationFrame(()=>{p.style.transform="",Ms&&(Ms.height{of(p)}):Ms.addEventListener("resize",()=>of(p),{once:!0}))}))},s=()=>{window.scrollTo(0,0)},a=window.pageXOffset,u=window.pageYOffset,c=nf(UE(document.documentElement,"paddingRight",`${window.innerWidth-document.documentElement.clientWidth}px`));window.scrollTo(0,0);let d=nf(Ur(document,"touchstart",n,{passive:!1,capture:!0}),Ur(document,"touchmove",r,{passive:!1,capture:!0}),Ur(document,"touchend",o,{passive:!1,capture:!0}),Ur(document,"focus",l,!0),Ur(window,"scroll",s));return()=>{c(),d(),window.scrollTo(a,u)}}function UE(e,t,n){let r=e.style[t];return e.style[t]=n,()=>{e.style[t]=r}}function Ur(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function of(e){let t=document.scrollingElement||document.documentElement;for(;e&&e!==t;){let n=Xh(e);if(n!==document.documentElement&&n!==document.body&&n!==e){let r=n.getBoundingClientRect().top,o=e.getBoundingClientRect().top,l=e.getBoundingClientRect().bottom;const s=n.getBoundingClientRect().bottom+$E;l>s&&(n.scrollTop+=o-r)}e=n.parentElement}}function $a(e){return e instanceof HTMLInputElement&&!BE.has(e.type)||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&e.isContentEditable}function HE(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function GE(...e){return t=>e.forEach(n=>HE(n,t))}function Qh(...e){return w.useCallback(GE(...e),e)}const Kh=new WeakMap;function we(e,t,n=!1){if(!e||!(e instanceof HTMLElement))return;let r={};Object.entries(t).forEach(([o,l])=>{if(o.startsWith("--")){e.style.setProperty(o,l);return}r[o]=e.style[o],e.style[o]=l}),!n&&Kh.set(e,r)}function YE(e,t){if(!e||!(e instanceof HTMLElement))return;let n=Kh.get(e);n&&(e.style[t]=n[t])}const ve=e=>{switch(e){case"top":case"bottom":return!0;case"left":case"right":return!1;default:return e}};function fo(e,t){if(!e)return null;const n=window.getComputedStyle(e),r=n.transform||n.webkitTransform||n.mozTransform;let o=r.match(/^matrix3d\((.+)\)$/);return o?parseFloat(o[1].split(", ")[ve(t)?13:12]):(o=r.match(/^matrix\((.+)\)$/),o?parseFloat(o[1].split(", ")[ve(t)?5:4]):null)}function XE(e){return 8*(Math.log(e+1)-2)}function Rs(e,t){if(!e)return()=>{};const n=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=n}}function QE(...e){return(...t)=>{for(const n of e)typeof n=="function"&&n(...t)}}const ae={DURATION:.5,EASE:[.32,.72,0,1]},qh=.4,KE=.25,qE=100,Zh=8,En=16,Fa=26,Ls="vaul-dragging";function Jh(e){const t=M.useRef(e);return M.useEffect(()=>{t.current=e}),M.useMemo(()=>(...n)=>t.current==null?void 0:t.current.call(t,...n),[])}function ZE({defaultProp:e,onChange:t}){const n=M.useState(e),[r]=n,o=M.useRef(r),l=Jh(t);return M.useEffect(()=>{o.current!==r&&(l(r),o.current=r)},[r,o,l]),n}function ev({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=ZE({defaultProp:t,onChange:n}),l=e!==void 0,s=l?e:r,a=Jh(n),u=M.useCallback(c=>{if(l){const f=typeof c=="function"?c(e):c;f!==e&&a(f)}else o(c)},[l,e,o,a]);return[s,u]}function JE({activeSnapPointProp:e,setActiveSnapPointProp:t,snapPoints:n,drawerRef:r,overlayRef:o,fadeFromIndex:l,onSnapPointChange:s,direction:a="bottom",container:u,snapToSequentialPoint:c}){const[d,f]=ev({prop:e,defaultProp:n==null?void 0:n[0],onChange:t}),[p,y]=M.useState(typeof window<"u"?{innerWidth:window.innerWidth,innerHeight:window.innerHeight}:void 0);M.useEffect(()=>{function P(){y({innerWidth:window.innerWidth,innerHeight:window.innerHeight})}return window.addEventListener("resize",P),()=>window.removeEventListener("resize",P)},[]);const S=M.useMemo(()=>d===(n==null?void 0:n[n.length-1])||null,[n,d]),g=M.useMemo(()=>{var P;return(P=n==null?void 0:n.findIndex(b=>b===d))!=null?P:null},[n,d]),E=n&&n.length>0&&(l||l===0)&&!Number.isNaN(l)&&n[l]===d||!n,m=M.useMemo(()=>{const P=u?{width:u.getBoundingClientRect().width,height:u.getBoundingClientRect().height}:typeof window<"u"?{width:window.innerWidth,height:window.innerHeight}:{width:0,height:0};var b;return(b=n==null?void 0:n.map(k=>{const N=typeof k=="string";let R=0;if(N&&(R=parseInt(k,10)),ve(a)){const O=N?R:p?k*P.height:0;return p?a==="bottom"?P.height-O:-P.height+O:O}const L=N?R:p?k*P.width:0;return p?a==="right"?P.width-L:-P.width+L:L}))!=null?b:[]},[n,p,u]),h=M.useMemo(()=>g!==null?m==null?void 0:m[g]:null,[m,g]),v=M.useCallback(P=>{var b;const k=(b=m==null?void 0:m.findIndex(N=>N===P))!=null?b:null;s(k),we(r.current,{transition:`transform ${ae.DURATION}s cubic-bezier(${ae.EASE.join(",")})`,transform:ve(a)?`translate3d(0, ${P}px, 0)`:`translate3d(${P}px, 0, 0)`}),m&&k!==m.length-1&&l!==void 0&&k!==l&&k{if(d||e){var P;const b=(P=n==null?void 0:n.findIndex(k=>k===e||k===d))!=null?P:-1;m&&b!==-1&&typeof m[b]=="number"&&v(m[b])}},[d,e,n,m,v]);function x({draggedDistance:P,closeDrawer:b,velocity:k,dismissible:N}){if(l===void 0)return;const R=a==="bottom"||a==="right"?(h??0)-P:(h??0)+P,L=g===l-1,O=g===0,$=P>0;if(L&&we(o.current,{transition:`opacity ${ae.DURATION}s cubic-bezier(${ae.EASE.join(",")})`}),!c&&k>2&&!$){N?b():v(m[0]);return}if(!c&&k>2&&$&&m&&n){v(m[n.length-1]);return}const B=m==null?void 0:m.reduce((U,I)=>typeof U!="number"||typeof I!="number"?U:Math.abs(I-R)qh&&Math.abs(P)0&&S&&n){v(m[n.length-1]);return}if(O&&U<0&&N&&b(),g===null)return;v(m[g+U]);return}v(B)}function T({draggedDistance:P}){if(h===null)return;const b=a==="bottom"||a==="right"?h-P:h+P;(a==="bottom"||a==="right")&&bm[m.length-1]||we(r.current,{transform:ve(a)?`translate3d(0, ${b}px, 0)`:`translate3d(${b}px, 0, 0)`})}function _(P,b){if(!n||typeof g!="number"||!m||l===void 0)return null;const k=g===l-1;if(g>=l&&b)return 0;if(k&&!b)return 1;if(!E&&!k)return null;const R=k?g+1:g-1,L=k?m[R]-m[R-1]:m[R+1]-m[R],O=P/Math.abs(L);return k?1-O:O}return{isLastSnapPoint:S,activeSnapPoint:d,shouldFade:E,getPercentageDragged:_,setActiveSnapPoint:f,activeSnapPointIndex:g,onRelease:x,onDrag:T,snapPointsOffset:m}}const e2=()=>()=>{};function t2(){const{direction:e,isOpen:t,shouldScaleBackground:n,setBackgroundColorOnScale:r,noBodyStyles:o}=Or(),l=M.useRef(null),s=w.useMemo(()=>document.body.style.backgroundColor,[]);function a(){return(window.innerWidth-Fa)/window.innerWidth}M.useEffect(()=>{if(t&&n){l.current&&clearTimeout(l.current);const u=document.querySelector("[data-vaul-drawer-wrapper]")||document.querySelector("[vaul-drawer-wrapper]");if(!u)return;QE(r&&!o?Rs(document.body,{background:"black"}):e2,Rs(u,{transformOrigin:ve(e)?"top":"left",transitionProperty:"transform, border-radius",transitionDuration:`${ae.DURATION}s`,transitionTimingFunction:`cubic-bezier(${ae.EASE.join(",")})`}));const c=Rs(u,{borderRadius:`${Zh}px`,overflow:"hidden",...ve(e)?{transform:`scale(${a()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`}:{transform:`scale(${a()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`}});return()=>{c(),l.current=window.setTimeout(()=>{s?document.body.style.background=s:document.body.style.removeProperty("background")},ae.DURATION*1e3)}}},[t,n,s])}let Hr=null;function n2({isOpen:e,modal:t,nested:n,hasBeenOpened:r,preventScrollRestoration:o,noBodyStyles:l}){const[s,a]=M.useState(()=>typeof window<"u"?window.location.href:""),u=M.useRef(0),c=M.useCallback(()=>{if(tf()&&Hr===null&&e&&!l){Hr={position:document.body.style.position,top:document.body.style.top,left:document.body.style.left,height:document.body.style.height,right:"unset"};const{scrollX:f,innerHeight:p}=window;document.body.style.setProperty("position","fixed","important"),Object.assign(document.body.style,{top:`${-u.current}px`,left:`${-f}px`,right:"0px",height:"auto"}),window.setTimeout(()=>window.requestAnimationFrame(()=>{const y=p-window.innerHeight;y&&u.current>=p&&(document.body.style.top=`${-(u.current+y)}px`)}),300)}},[e]),d=M.useCallback(()=>{if(tf()&&Hr!==null&&!l){const f=-parseInt(document.body.style.top,10),p=-parseInt(document.body.style.left,10);Object.assign(document.body.style,Hr),window.requestAnimationFrame(()=>{if(o&&s!==window.location.href){a(window.location.href);return}window.scrollTo(p,f)}),Hr=null}},[s]);return M.useEffect(()=>{function f(){u.current=window.scrollY}return f(),window.addEventListener("scroll",f),()=>{window.removeEventListener("scroll",f)}},[]),M.useEffect(()=>{if(t)return()=>{typeof document>"u"||document.querySelector("[data-vaul-drawer]")||d()}},[t,d]),M.useEffect(()=>{n||!r||(e?(!window.matchMedia("(display-mode: standalone)").matches&&c(),t||window.setTimeout(()=>{d()},500)):d())},[e,r,s,t,n,c,d]),{restorePositionSetting:d}}function tv({open:e,onOpenChange:t,children:n,onDrag:r,onRelease:o,snapPoints:l,shouldScaleBackground:s=!1,setBackgroundColorOnScale:a=!0,closeThreshold:u=KE,scrollLockTimeout:c=qE,dismissible:d=!0,handleOnly:f=!1,fadeFromIndex:p=l&&l.length-1,activeSnapPoint:y,setActiveSnapPoint:S,fixed:g,modal:E=!0,onClose:m,nested:h,noBodyStyles:v=!1,direction:x="bottom",defaultOpen:T=!1,disablePreventScroll:_=!0,snapToSequentialPoint:P=!1,preventScrollRestoration:b=!1,repositionInputs:k=!0,onAnimationEnd:N,container:R,autoFocus:L=!1}){var O,$;const[B=!1,G]=ev({defaultProp:T,prop:e,onChange:F=>{t==null||t(F),!F&&!h&&wv(),setTimeout(()=>{N==null||N(F)},ae.DURATION*1e3),F&&!E&&typeof window<"u"&&window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"}),F||(document.body.style.pointerEvents="auto")}}),[U,I]=M.useState(!1),[D,j]=M.useState(!1),[V,X]=M.useState(!1),oe=M.useRef(null),le=M.useRef(null),Ee=M.useRef(null),ye=M.useRef(null),Ne=M.useRef(null),xn=M.useRef(!1),jl=M.useRef(null),Al=M.useRef(0),Wn=M.useRef(!1),rc=M.useRef(!T),ic=M.useRef(0),H=M.useRef(null),oc=M.useRef(((O=H.current)==null?void 0:O.getBoundingClientRect().height)||0),lc=M.useRef((($=H.current)==null?void 0:$.getBoundingClientRect().width)||0),$l=M.useRef(0),mv=M.useCallback(F=>{l&&F===Rr.length-1&&(le.current=new Date)},[]),{activeSnapPoint:hv,activeSnapPointIndex:Un,setActiveSnapPoint:sc,onRelease:vv,snapPointsOffset:Rr,onDrag:gv,shouldFade:ac,getPercentageDragged:yv}=JE({snapPoints:l,activeSnapPointProp:y,setActiveSnapPointProp:S,drawerRef:H,fadeFromIndex:p,overlayRef:oe,onSnapPointChange:mv,direction:x,container:R,snapToSequentialPoint:P});VE({isDisabled:!B||D||!E||V||!U||!k||!_});const{restorePositionSetting:wv}=n2({isOpen:B,modal:E,nested:h??!1,hasBeenOpened:U,preventScrollRestoration:b,noBodyStyles:v});function Di(){return(window.innerWidth-Fa)/window.innerWidth}function xv(F){var Z,ee;!d&&!l||H.current&&!H.current.contains(F.target)||(oc.current=((Z=H.current)==null?void 0:Z.getBoundingClientRect().height)||0,lc.current=((ee=H.current)==null?void 0:ee.getBoundingClientRect().width)||0,j(!0),Ee.current=new Date,Yh()&&window.addEventListener("touchend",()=>xn.current=!1,{once:!0}),F.target.setPointerCapture(F.pointerId),Al.current=ve(x)?F.pageY:F.pageX)}function uc(F,Z){var ee;let q=F;const me=(ee=window.getSelection())==null?void 0:ee.toString(),$e=H.current?fo(H.current,x):null,Le=new Date;if(q.tagName==="SELECT"||q.hasAttribute("data-vaul-no-drag")||q.closest("[data-vaul-no-drag]"))return!1;if(x==="right"||x==="left")return!0;if(le.current&&Le.getTime()-le.current.getTime()<500)return!1;if($e!==null&&(x==="bottom"?$e>0:$e<0))return!0;if(me&&me.length>0)return!1;if(Ne.current&&Le.getTime()-Ne.current.getTime()q.clientHeight){if(q.scrollTop!==0)return Ne.current=new Date,!1;if(q.getAttribute("role")==="dialog")return!0}q=q.parentNode}return!0}function Sv(F){if(H.current&&D){const Z=x==="bottom"||x==="right"?1:-1,ee=(Al.current-(ve(x)?F.pageY:F.pageX))*Z,q=ee>0,me=l&&!d&&!q;if(me&&Un===0)return;const $e=Math.abs(ee),Le=document.querySelector("[data-vaul-drawer-wrapper]"),Vt=x==="bottom"||x==="top"?oc.current:lc.current;let st=$e/Vt;const Sn=yv($e,q);if(Sn!==null&&(st=Sn),me&&st>=1||!xn.current&&!uc(F.target,q))return;if(H.current.classList.add(Ls),xn.current=!0,we(H.current,{transition:"none"}),we(oe.current,{transition:"none"}),l&&gv({draggedDistance:ee}),q&&!l){const gt=XE(ee),ji=Math.min(gt*-1,0)*Z;we(H.current,{transform:ve(x)?`translate3d(0, ${ji}px, 0)`:`translate3d(${ji}px, 0, 0)`});return}const Wt=1-st;if((ac||p&&Un===p-1)&&(r==null||r(F,st),we(oe.current,{opacity:`${Wt}`,transition:"none"},!0)),Le&&oe.current&&s){const gt=Math.min(Di()+st*(1-Di()),1),ji=8-st*8,dc=Math.max(0,14-st*14);we(Le,{borderRadius:`${ji}px`,transform:ve(x)?`scale(${gt}) translate3d(0, ${dc}px, 0)`:`scale(${gt}) translate3d(${dc}px, 0, 0)`,transition:"none"},!0)}if(!l){const gt=$e*Z;we(H.current,{transform:ve(x)?`translate3d(0, ${gt}px, 0)`:`translate3d(${gt}px, 0, 0)`})}}}M.useEffect(()=>{window.requestAnimationFrame(()=>{rc.current=!0})},[]),M.useEffect(()=>{var F;function Z(){if(!H.current||!k)return;const ee=document.activeElement;if($a(ee)||Wn.current){var q;const me=((q=window.visualViewport)==null?void 0:q.height)||0,$e=window.innerHeight;let Le=$e-me;const Vt=H.current.getBoundingClientRect().height||0,st=Vt>$e*.8;$l.current||($l.current=Vt);const Sn=H.current.getBoundingClientRect().top;if(Math.abs(ic.current-Le)>60&&(Wn.current=!Wn.current),l&&l.length>0&&Rr&&Un){const Wt=Rr[Un]||0;Le+=Wt}if(ic.current=Le,Vt>me||Wn.current){const Wt=H.current.getBoundingClientRect().height;let gt=Wt;Wt>me&&(gt=me-(st?Sn:Fa)),g?H.current.style.height=`${Wt-Math.max(Le,0)}px`:H.current.style.height=`${Math.max(gt,me-Sn)}px`}else zE()||(H.current.style.height=`${$l.current}px`);l&&l.length>0&&!Wn.current?H.current.style.bottom="0px":H.current.style.bottom=`${Math.max(Le,0)}px`}}return(F=window.visualViewport)==null||F.addEventListener("resize",Z),()=>{var ee;return(ee=window.visualViewport)==null?void 0:ee.removeEventListener("resize",Z)}},[Un,l,Rr]);function Lr(F){Ev(),m==null||m(),F||G(!1),setTimeout(()=>{l&&sc(l[0])},ae.DURATION*1e3)}function cc(){if(!H.current)return;const F=document.querySelector("[data-vaul-drawer-wrapper]"),Z=fo(H.current,x);we(H.current,{transform:"translate3d(0, 0, 0)",transition:`transform ${ae.DURATION}s cubic-bezier(${ae.EASE.join(",")})`}),we(oe.current,{transition:`opacity ${ae.DURATION}s cubic-bezier(${ae.EASE.join(",")})`,opacity:"1"}),s&&Z&&Z>0&&B&&we(F,{borderRadius:`${Zh}px`,overflow:"hidden",...ve(x)?{transform:`scale(${Di()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`,transformOrigin:"top"}:{transform:`scale(${Di()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`,transformOrigin:"left"},transitionProperty:"transform, border-radius",transitionDuration:`${ae.DURATION}s`,transitionTimingFunction:`cubic-bezier(${ae.EASE.join(",")})`},!0)}function Ev(){!D||!H.current||(H.current.classList.remove(Ls),xn.current=!1,j(!1),ye.current=new Date)}function Cv(F){if(!D||!H.current)return;H.current.classList.remove(Ls),xn.current=!1,j(!1),ye.current=new Date;const Z=fo(H.current,x);if(!F||!uc(F.target,!1)||!Z||Number.isNaN(Z)||Ee.current===null)return;const ee=ye.current.getTime()-Ee.current.getTime(),q=Al.current-(ve(x)?F.pageY:F.pageX),me=Math.abs(q)/ee;if(me>.05&&(X(!0),setTimeout(()=>{X(!1)},200)),l){vv({draggedDistance:q*(x==="bottom"||x==="right"?1:-1),closeDrawer:Lr,velocity:me,dismissible:d}),o==null||o(F,!0);return}if(x==="bottom"||x==="right"?q>0:q<0){cc(),o==null||o(F,!0);return}if(me>qh){Lr(),o==null||o(F,!1);return}var $e;const Le=Math.min(($e=H.current.getBoundingClientRect().height)!=null?$e:0,window.innerHeight);var Vt;const st=Math.min((Vt=H.current.getBoundingClientRect().width)!=null?Vt:0,window.innerWidth),Sn=x==="left"||x==="right";if(Math.abs(Z)>=(Sn?st:Le)*u){Lr(),o==null||o(F,!1);return}o==null||o(F,!0),cc()}M.useEffect(()=>(B&&(we(document.documentElement,{scrollBehavior:"auto"}),le.current=new Date),()=>{YE(document.documentElement,"scrollBehavior")}),[B]);function Tv(F){const Z=F?(window.innerWidth-En)/window.innerWidth:1,ee=F?-En:0;jl.current&&window.clearTimeout(jl.current),we(H.current,{transition:`transform ${ae.DURATION}s cubic-bezier(${ae.EASE.join(",")})`,transform:ve(x)?`scale(${Z}) translate3d(0, ${ee}px, 0)`:`scale(${Z}) translate3d(${ee}, 0, 0)`}),!F&&H.current&&(jl.current=setTimeout(()=>{const q=fo(H.current,x);we(H.current,{transition:"none",transform:ve(x)?`translate3d(0, ${q}px, 0)`:`translate3d(${q}px, 0, 0)`})},500))}function bv(F,Z){if(Z<0)return;const ee=(window.innerWidth-En)/window.innerWidth,q=ee+Z*(1-ee),me=-En+Z*En;we(H.current,{transform:ve(x)?`scale(${q}) translate3d(0, ${me}px, 0)`:`scale(${q}) translate3d(${me}px, 0, 0)`,transition:"none"})}function Pv(F,Z){const ee=ve(x)?window.innerHeight:window.innerWidth,q=Z?(ee-En)/ee:1,me=Z?-En:0;Z&&we(H.current,{transition:`transform ${ae.DURATION}s cubic-bezier(${ae.EASE.join(",")})`,transform:ve(x)?`scale(${q}) translate3d(0, ${me}px, 0)`:`scale(${q}) translate3d(${me}px, 0, 0)`})}return M.useEffect(()=>{E||window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"})},[E]),M.createElement(Ih,{defaultOpen:T,onOpenChange:F=>{!d&&!F||(F?I(!0):Lr(!0),G(F))},open:B},M.createElement(Gh.Provider,{value:{activeSnapPoint:hv,snapPoints:l,setActiveSnapPoint:sc,drawerRef:H,overlayRef:oe,onOpenChange:t,onPress:xv,onRelease:Cv,onDrag:Sv,dismissible:d,shouldAnimate:rc,handleOnly:f,isOpen:B,isDragging:D,shouldFade:ac,closeDrawer:Lr,onNestedDrag:bv,onNestedOpenChange:Tv,onNestedRelease:Pv,keyboardIsOpen:Wn,modal:E,snapPointsOffset:Rr,activeSnapPointIndex:Un,direction:x,shouldScaleBackground:s,setBackgroundColorOnScale:a,noBodyStyles:v,container:R,autoFocus:L}},n))}const nv=M.forwardRef(function({...e},t){const{overlayRef:n,snapPoints:r,onRelease:o,shouldFade:l,isOpen:s,modal:a,shouldAnimate:u}=Or(),c=Qh(t,n),d=r&&r.length>0;if(!a)return null;const f=M.useCallback(p=>o(p),[o]);return M.createElement(Xu,{onMouseUp:f,ref:c,"data-vaul-overlay":"","data-vaul-snap-points":s&&d?"true":"false","data-vaul-snap-points-overlay":s&&l?"true":"false","data-vaul-animate":u!=null&&u.current?"true":"false",...e})});nv.displayName="Drawer.Overlay";const rv=M.forwardRef(function({onPointerDownOutside:e,style:t,onOpenAutoFocus:n,...r},o){const{drawerRef:l,onPress:s,onRelease:a,onDrag:u,keyboardIsOpen:c,snapPointsOffset:d,activeSnapPointIndex:f,modal:p,isOpen:y,direction:S,snapPoints:g,container:E,handleOnly:m,shouldAnimate:h,autoFocus:v}=Or(),[x,T]=M.useState(!1),_=Qh(o,l),P=M.useRef(null),b=M.useRef(null),k=M.useRef(!1),N=g&&g.length>0;t2();const R=(O,$,B=0)=>{if(k.current)return!0;const G=Math.abs(O.y),U=Math.abs(O.x),I=U>G,D=["bottom","right"].includes($)?1:-1;if($==="left"||$==="right"){if(!(O.x*D<0)&&U>=0&&U<=B)return I}else if(!(O.y*D<0)&&G>=0&&G<=B)return!I;return k.current=!0,!0};M.useEffect(()=>{N&&window.requestAnimationFrame(()=>{T(!0)})},[]);function L(O){P.current=null,k.current=!1,a(O)}return M.createElement(Qu,{"data-vaul-drawer-direction":S,"data-vaul-drawer":"","data-vaul-delayed-snap-points":x?"true":"false","data-vaul-snap-points":y&&N?"true":"false","data-vaul-custom-container":E?"true":"false","data-vaul-animate":h!=null&&h.current?"true":"false",...r,ref:_,style:d&&d.length>0?{"--snap-point-height":`${d[f??0]}px`,...t}:t,onPointerDown:O=>{m||(r.onPointerDown==null||r.onPointerDown.call(r,O),P.current={x:O.pageX,y:O.pageY},s(O))},onOpenAutoFocus:O=>{n==null||n(O),v||O.preventDefault()},onPointerDownOutside:O=>{if(e==null||e(O),!p||O.defaultPrevented){O.preventDefault();return}c.current&&(c.current=!1)},onFocusOutside:O=>{if(!p){O.preventDefault();return}},onPointerMove:O=>{if(b.current=O,m||(r.onPointerMove==null||r.onPointerMove.call(r,O),!P.current))return;const $=O.pageY-P.current.y,B=O.pageX-P.current.x,G=O.pointerType==="touch"?10:2;R({x:B,y:$},S,G)?u(O):(Math.abs(B)>G||Math.abs($)>G)&&(P.current=null)},onPointerUp:O=>{r.onPointerUp==null||r.onPointerUp.call(r,O),P.current=null,k.current=!1,a(O)},onPointerOut:O=>{r.onPointerOut==null||r.onPointerOut.call(r,O),L(b.current)},onContextMenu:O=>{r.onContextMenu==null||r.onContextMenu.call(r,O),b.current&&L(b.current)}})});rv.displayName="Drawer.Content";const r2=250,i2=120,iv=M.forwardRef(function({preventCycle:e=!1,children:t,...n},r){const{closeDrawer:o,isDragging:l,snapPoints:s,activeSnapPoint:a,setActiveSnapPoint:u,dismissible:c,handleOnly:d,isOpen:f,onPress:p,onDrag:y}=Or(),S=M.useRef(null),g=M.useRef(!1);function E(){if(g.current){v();return}window.setTimeout(()=>{m()},i2)}function m(){if(l||e||g.current){v();return}if(v(),!s||s.length===0){c||o();return}if(a===s[s.length-1]&&c){o();return}const T=s.findIndex(P=>P===a);if(T===-1)return;const _=s[T+1];u(_)}function h(){S.current=window.setTimeout(()=>{g.current=!0},r2)}function v(){S.current&&window.clearTimeout(S.current),g.current=!1}return M.createElement("div",{onClick:E,onPointerCancel:v,onPointerDown:x=>{d&&p(x),h()},onPointerMove:x=>{d&&y(x)},ref:r,"data-vaul-drawer-visible":f?"true":"false","data-vaul-handle":"","aria-hidden":"true",...n},M.createElement("span",{"data-vaul-handle-hitarea":"","aria-hidden":"true"},t))});iv.displayName="Drawer.Handle";function o2({onDrag:e,onOpenChange:t,...n}){const{onNestedDrag:r,onNestedOpenChange:o,onNestedRelease:l}=Or();if(!r)throw new Error("Drawer.NestedRoot must be placed in another drawer");return M.createElement(tv,{nested:!0,onClose:()=>{o(!1)},onDrag:(s,a)=>{r(s,a),e==null||e(s,a)},onOpenChange:s=>{s&&o(s)},onRelease:l,...n})}function l2(e){const t=Or(),{container:n=t.container,...r}=e;return M.createElement(Dh,{container:n,...r})}const vt={Root:tv,NestedRoot:o2,Content:rv,Overlay:nv,Trigger:zh,Portal:l2,Handle:iv,Close:jh,Title:Ku,Description:qu},ov=({shouldScaleBackground:e=!0,...t})=>C.jsx(vt.Root,{shouldScaleBackground:e,...t});ov.displayName="Drawer";const s2=vt.Trigger,a2=vt.Portal,u2=vt.Close,lv=w.forwardRef(({className:e,...t},n)=>C.jsx(vt.Overlay,{ref:n,className:He("fixed inset-0 z-50 bg-black/80",e),...t}));lv.displayName=vt.Overlay.displayName;const sv=w.forwardRef(({className:e,children:t,...n},r)=>C.jsxs(a2,{children:[C.jsx(lv,{}),C.jsxs(vt.Content,{ref:r,className:He("fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border bg-background",e),...n,children:[C.jsx("div",{className:"mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted"}),t]})]}));sv.displayName="DrawerContent";const av=({className:e,...t})=>C.jsx("div",{className:He("grid gap-1.5 p-4 text-center sm:text-left",e),...t});av.displayName="DrawerHeader";const uv=({className:e,...t})=>C.jsx("div",{className:He("mt-auto flex flex-col gap-2 p-4",e),...t});uv.displayName="DrawerFooter";const cv=w.forwardRef(({className:e,...t},n)=>C.jsx(vt.Title,{ref:n,className:He("text-lg font-semibold leading-none tracking-tight",e),...t}));cv.displayName=vt.Title.displayName;const dv=w.forwardRef(({className:e,...t},n)=>C.jsx(vt.Description,{ref:n,className:He("text-sm text-muted-foreground",e),...t}));dv.displayName=vt.Description.displayName;function fv(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;ttypeof e=="boolean"?"".concat(e):e===0?"0":e,sf=c2,d2=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return sf(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:l}=t,s=Object.keys(o).map(c=>{const d=n==null?void 0:n[c],f=l==null?void 0:l[c];if(d===null)return null;const p=lf(d)||lf(f);return o[c][p]}),a=n&&Object.entries(n).reduce((c,d)=>{let[f,p]=d;return p===void 0||(c[f]=p),c},{}),u=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,d)=>{let{class:f,className:p,...y}=d;return Object.entries(y).every(S=>{let[g,E]=S;return Array.isArray(E)?E.includes({...l,...a}[g]):{...l,...a}[g]===E})?[...c,f,p]:c},[]);return sf(e,s,u,n==null?void 0:n.class,n==null?void 0:n.className)},f2=d2("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),Ba=w.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...o},l)=>{const s=r?Rl:"button";return C.jsx(s,{className:He(f2({variant:t,size:n,className:e})),ref:l,...o})});Ba.displayName="Button";var po=function(e,t){return et?1:0},af=function(e){return e.reduce(function(t,n){return t+n},0)},p2=function(){function e(n){this.colors=n}var t=e.prototype;return t.palette=function(){return this.colors},t.map=function(n){return n},e}(),m2=function(){function e(l,s,a){return(l<<10)+(s<<5)+a}function t(l){var s=[],a=!1;function u(){s.sort(l),a=!0}return{push:function(c){s.push(c),a=!1},peek:function(c){return a||u(),c===void 0&&(c=s.length-1),s[c]},pop:function(){return a||u(),s.pop()},size:function(){return s.length},map:function(c){return s.map(c)},debug:function(){return a||u(),s}}}function n(l,s,a,u,c,d,f){var p=this;p.r1=l,p.r2=s,p.g1=a,p.g2=u,p.b1=c,p.b2=d,p.histo=f}function r(){this.vboxes=new t(function(l,s){return po(l.vbox.count()*l.vbox.volume(),s.vbox.count()*s.vbox.volume())})}function o(l,s){if(s.count()){var a=s.r2-s.r1+1,u=s.g2-s.g1+1,c=Math.max.apply(null,[a,u,s.b2-s.b1+1]);if(s.count()==1)return[s.copy()];var d,f,p,y,S=0,g=[],E=[];if(c==a)for(d=s.r1;d<=s.r2;d++){for(y=0,f=s.g1;f<=s.g2;f++)for(p=s.b1;p<=s.b2;p++)y+=l[e(d,f,p)]||0;g[d]=S+=y}else if(c==u)for(d=s.g1;d<=s.g2;d++){for(y=0,f=s.r1;f<=s.r2;f++)for(p=s.b1;p<=s.b2;p++)y+=l[e(f,d,p)]||0;g[d]=S+=y}else for(d=s.b1;d<=s.b2;d++){for(y=0,f=s.r1;f<=s.r2;f++)for(p=s.g1;p<=s.g2;p++)y+=l[e(f,p,d)]||0;g[d]=S+=y}return g.forEach(function(m,h){E[h]=S-m}),function(m){var h,v,x,T,_,P=m+"1",b=m+"2",k=0;for(d=s[P];d<=s[b];d++)if(g[d]>S/2){for(x=s.copy(),T=s.copy(),_=(h=d-s[P])<=(v=s[b]-d)?Math.min(s[b]-1,~~(d+v/2)):Math.max(s[P],~~(d-1-h/2));!g[_];)_++;for(k=E[_];!k&&g[_-1];)k=E[--_];return x[b]=_,T[P]=x[b]+1,[x,T]}}(c==a?"r":c==u?"g":"b")}}return n.prototype={volume:function(l){var s=this;return s._volume&&!l||(s._volume=(s.r2-s.r1+1)*(s.g2-s.g1+1)*(s.b2-s.b1+1)),s._volume},count:function(l){var s=this,a=s.histo;if(!s._count_set||l){var u,c,d,f=0;for(u=s.r1;u<=s.r2;u++)for(c=s.g1;c<=s.g2;c++)for(d=s.b1;d<=s.b2;d++)f+=a[e(u,c,d)]||0;s._count=f,s._count_set=!0}return s._count},copy:function(){var l=this;return new n(l.r1,l.r2,l.g1,l.g2,l.b1,l.b2,l.histo)},avg:function(l){var s=this,a=s.histo;if(!s._avg||l){var u,c,d,f,p=0,y=0,S=0,g=0;if(s.r1===s.r2&&s.g1===s.g2&&s.b1===s.b2)s._avg=[s.r1<<3,s.g1<<3,s.b1<<3];else{for(c=s.r1;c<=s.r2;c++)for(d=s.g1;d<=s.g2;d++)for(f=s.b1;f<=s.b2;f++)p+=u=a[e(c,d,f)]||0,y+=u*(c+.5)*8,S+=u*(d+.5)*8,g+=u*(f+.5)*8;s._avg=p?[~~(y/p),~~(S/p),~~(g/p)]:[~~(8*(s.r1+s.r2+1)/2),~~(8*(s.g1+s.g2+1)/2),~~(8*(s.b1+s.b2+1)/2)]}}return s._avg},contains:function(l){var s=this,a=l[0]>>3;return gval=l[1]>>3,bval=l[2]>>3,a>=s.r1&&a<=s.r2&&gval>=s.g1&&gval<=s.g2&&bval>=s.b1&&bval<=s.b2}},r.prototype={push:function(l){this.vboxes.push({vbox:l,color:l.avg()})},palette:function(){return this.vboxes.map(function(l){return l.color})},size:function(){return this.vboxes.size()},map:function(l){for(var s=this.vboxes,a=0;a251&&u[1]>251&&u[2]>251&&(l[a].color=[255,255,255])}},{quantize:function(l,s){if(!Number.isInteger(s)||s<1||s>256)throw new Error("Invalid maximum color count. It must be an integer between 1 and 256.");if(!l.length||s<2||s>256||!l.length||s<2||s>256)return!1;for(var a=[],u=new Set,c=0;c>3,T[1]>>3,T[2]>>3),x[v]=(x[v]||0)+1}),x}(l);p.forEach(function(){});var y=function(h,v){var x,T,_,P=1e6,b=0,k=1e6,N=0,R=1e6,L=0;return h.forEach(function(O){(x=O[0]>>3)b&&(b=x),(T=O[1]>>3)N&&(N=T),(_=O[2]>>3)L&&(L=_)}),new n(P,b,k,N,R,L,v)}(l,p),S=new t(function(h,v){return po(h.count(),v.count())});function g(h,v){for(var x,T=h.size(),_=0;_<1e3;){if(T>=v||_++>1e3)return;if((x=h.pop()).count()){var P=o(p,x),b=P[0],k=P[1];if(!b)return;h.push(b),k&&(h.push(k),T++)}else h.push(x),_++}}S.push(y),g(S,.75*s);for(var E=new t(function(h,v){return po(h.count()*h.volume(),v.count()*v.volume())});S.size();)E.push(S.pop());g(E,s);for(var m=new r;E.size();)m.push(E.pop());return m}}}().quantize,pv=function(e){this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"),this.width=this.canvas.width=e.naturalWidth,this.height=this.canvas.height=e.naturalHeight,this.context.drawImage(e,0,0,this.width,this.height)};pv.prototype.getImageData=function(){return this.context.getImageData(0,0,this.width,this.height)};var Kn=function(){};Kn.prototype.getColor=function(e,t){return t===void 0&&(t=10),this.getPalette(e,5,t)[0]},Kn.prototype.getPalette=function(e,t,n){var r=function(a){var u=a.colorCount,c=a.quality;if(u!==void 0&&Number.isInteger(u)){if(u===1)throw new Error("colorCount should be between 2 and 20. To get one color, call getColor() instead of getPalette()");u=Math.max(u,2),u=Math.min(u,20)}else u=10;return(c===void 0||!Number.isInteger(c)||c<1)&&(c=10),{colorCount:u,quality:c}}({colorCount:t,quality:n}),o=new pv(e),l=function(a,u,c){for(var d,f,p,y,S,g=a,E=[],m=0;m=125)&&(f>250&&p>250&&y>250||E.push([f,p,y]));return E}(o.getImageData().data,o.width*o.height,r.quality),s=m2(l,r.colorCount);return s?s.palette():null},Kn.prototype.getColorFromUrl=function(e,t,n){var r=this,o=document.createElement("img");o.addEventListener("load",function(){var l=r.getPalette(o,5,n);t(l[0],e)}),o.src=e},Kn.prototype.getImageData=function(e,t){var n=new XMLHttpRequest;n.open("GET",e,!0),n.responseType="arraybuffer",n.onload=function(){if(this.status==200){var r=new Uint8Array(this.response);i=r.length;for(var o=new Array(i),l=0;lnew Promise((t,n)=>{const r=new Kn,o=new Image;o.crossOrigin="anonymous",o.src=e,o.onload=()=>{try{const l=r.getColor(o);t(l)}catch{n("Failed to extract dominant color")}},o.onerror=()=>n("Image failed to load")}),v2=e=>((r,o,l)=>{const s=[r,o,l].map(a=>(a/=255,a<=.03928?a/12.92:Math.pow((a+.055)/1.055,2.4)));return s[0]*.2126+s[1]*.7152+s[2]*.0722})(e[0],e[1],e[2])>.5?"black":"white";function g2(){const{id:e}=My(),[t,n]=w.useState(null),[r,o]=w.useState([]),[l,s]=w.useState(null),[a,u]=w.useState(!0),[c,d]=w.useState(!1),[f,p]=w.useState(!1),[y,S]=w.useState(""),[g,E]=w.useState("white"),[m,h]=w.useState(!1),v="site:filmyzilla.com.by";w.useEffect(()=>{(JSON.parse(localStorage.getItem("playlist"))||[]).includes(e)?h(!0):h(!1)},[e]),w.useEffect(()=>{window.scrollTo(0,0)},[e]);const x=()=>{if(t!=null&&t.title){p(!1);const k=`${t.title} ${v}`,N=`https://www.google.com/search?q=${encodeURIComponent(k)}`;window.open(N,"_blank")}},T=()=>{p(!1)},_=async()=>{if(navigator.share&&t)try{await navigator.share({title:t.title,text:t.overview,url:window.location.href}),console.log("Movie shared successfully")}catch(k){console.error("Error sharing movie:",k)}else Q.error("Sharing is not supported in your browser")},P=k=>{const N=Math.floor(k/60),R=k%60;return`${N>0?`${N}h`:""} ${R>0?`${R}m`:""}`.trim()};w.useEffect(()=>{(async()=>{try{const R=await(await fetch(`https://api.themoviedb.org/3/movie/${e}?api_key=4c1eef5a8d388386187a3426bc2345be`)).json(),L=`https://image.tmdb.org/t/p/w500/${R.poster_path}?not-from-cache-please`;h2(L).then(I=>{let D=`rgb(${I[0]}, ${I[1]}, ${I[2]})`;S(D);const j=v2(I);E(j)}).catch(I=>{Q.error("Unable to get CLR"),console.error(I)}),n(R);const $=await(await fetch(`https://api.themoviedb.org/3/movie/${e}/similar?api_key=4c1eef5a8d388386187a3426bc2345be`)).json();o($.results);const U=(await(await fetch(`https://api.themoviedb.org/3/movie/${e}/videos?api_key=4c1eef5a8d388386187a3426bc2345be`)).json()).results.filter(I=>I.type==="Trailer"&&I.site==="YouTube");U.length>0&&s(`https://www.youtube.com/embed/${U[0].key}`),u(!1)}catch(N){Q.error(N),console.error("Error fetching movie details:",N),u(!1)}})()},[e]);const b=k=>{const N=JSON.parse(localStorage.getItem("playlist"))||[];N.includes(k)?Q.error("Already Added"):(N.push(k),localStorage.setItem("playlist",JSON.stringify(N)),h(!0),Q.success("Added to watchlist"))};return a?C.jsxs("div",{className:"relative grid grid-cols-1 lg:grid-cols-3 gap-2 p-5 mt-14 lg:py-8 shadow-md text-white",children:[C.jsx("div",{className:"relative flex justify-center items-center rounded-lg bg-cover bg-center",children:C.jsx(kt,{className:"w-full h-80 rounded-lg"})}),C.jsxs("div",{className:"relative z-10 flex flex-col gap-3 col-span-2",children:[C.jsxs("div",{className:"flex flex-col",children:[C.jsx(kt,{className:"w-3/4 h-8 mb-3"}),C.jsx(kt,{className:"w-2/3 h-6"})]}),C.jsxs("div",{className:"my-5 flex items-center gap-2",children:[C.jsx(kt,{className:"w-10 h-10 rounded-full"}),C.jsx(kt,{className:"w-10 h-10 rounded-full"}),C.jsx(kt,{className:"h-10 w-32 rounded-full"})]}),C.jsxs("div",{className:"mt-5",children:[C.jsx(kt,{className:"w-3/4 h-6 mb-2"}),C.jsx(kt,{className:"w-full h-4"})]})]}),C.jsx("div",{style:{background:`${y}`},className:"absolute inset-0 w-full h-full -z-5"})]}):C.jsxs(C.Fragment,{children:[C.jsxs("div",{style:{backgroundImage:`url(https://image.tmdb.org/t/p/w780/${t.backdrop_path})`,backgroundSize:"cover",color:`${g}`},className:"relative grid grid-cols-1 lg:grid-cols-3 gap-2 p-5 mt-14 lg:py-8 shadow-md ",children:[C.jsx("div",{className:"relative flex justify-center items-center rounded-lg bg-cover bg-center shadow-lg",children:C.jsx("img",{className:" relative z-10 lg:w-2/3 h-auto max-w-xs sm:max-w-sm md:max-w-md lg:max-w-lg rounded-lg",src:`https://image.tmdb.org/t/p/w500/${t.poster_path}`,alt:t.title})}),C.jsxs("div",{className:"relative z-10 flex flex-col gap-3 col-span-2",children:[C.jsxs("div",{className:"flex flex-col",children:[C.jsxs("h1",{className:"text-2xl sm:text-3xl lg:text-4xl font-semibold",children:[t.title," (",t.release_date.split("-")[0],")"]}),C.jsxs("p",{className:"text-sm lg:text-base",children:[t.original_language.toUpperCase()," |"," ",t.genres.map(k=>k.name).join(", ")," |"," ",P(t.runtime)]})]}),C.jsxs("div",{className:"my-2 flex items-center gap-2",children:[C.jsxs("div",{children:[C.jsx("div",{className:"w-10 h-10 rounded-full bg-zinc-50 text-zinc-900 flex items-center justify-center cursor-pointer",onClick:()=>p(!0),children:C.jsx(NE,{})}),C.jsx($h,{open:f,onOpenChange:p,children:C.jsx(Zu,{children:C.jsxs(Ju,{children:[C.jsx(ec,{children:"Confirm Redirect"}),C.jsxs(tc,{children:["You are being redirected to a new website. Do you want to continue?",C.jsxs("span",{className:"flex items-center justify-end mt-5 gap-2",children:[C.jsx(Ba,{onClick:T,variant:"outline",children:"Cancel"}),C.jsx(Ba,{onClick:x,children:"Confirm"})]})]})]})})})]}),C.jsx("div",{onClick:()=>{b(t.id)},className:"w-10 h-10 rounded-full bg-zinc-50 text-zinc-900 flex items-center justify-center cursor-pointer",children:m?C.jsx(bx,{}):C.jsx(Px,{})}),C.jsx("div",{onClick:_,className:"w-10 h-10 rounded-full bg-zinc-50 text-zinc-900 flex items-center justify-center cursor-pointer",children:C.jsx(OE,{})}),C.jsx("div",{className:" h-10 px-4 gap-2 rounded-full bg-zinc-50 text-zinc-900 flex items-center justify-center cursor-pointer",children:C.jsxs(ov,{children:[C.jsxs(s2,{className:"flex items-center gap-2",onClick:()=>d(!0),children:[" ",C.jsx(ME,{}),"Play Trailer"]}),C.jsxs(sv,{children:[C.jsxs(av,{children:[C.jsx(cv,{children:"Watch Trailer"}),C.jsxs(dv,{children:["Watch the trailer for ",t.title]}),c&&l?C.jsx("iframe",{width:"100%",height:"315",src:`${l}?autoplay=1`,title:"Movie Trailer",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0}):C.jsx("p",{children:"Trailer not available."})]}),C.jsx(uv,{children:C.jsx(u2,{onClick:()=>d(!1)})})]})]})})]}),C.jsxs("div",{children:[C.jsx("p",{className:"text-sm lg:text-base italic",children:t.tagline}),C.jsx("p",{className:"font-semibold text-xl",children:"Overview"}),C.jsx("p",{className:"text-base lg:text-lg leading-relaxed",children:t.overview})]}),C.jsxs("div",{children:["IMDB RATING |"," ",C.jsxs("span",{className:"bg-zinc-50 text-zinc-900 px-2 rounded-md",children:[" ",t.vote_average,"/10"]})]})]}),C.jsx("div",{style:{background:`${y}`,opacity:".9"},className:"absolute inset-0 w-full h-full -z-5 backdrop-blur-sm"})]}),C.jsxs("div",{className:"p-5",children:[r.length>0&&C.jsx(Kt,{title:"Related Movies"}),C.jsx("div",{className:"grid grid-cols-3 lg:grid-cols-6 gap-5 text-white",children:r.map(k=>C.jsx(Wu,{movie:k},k.id))})]})]})}const y2=()=>{const[e,t]=w.useState([]),[n,r]=w.useState(!0);w.useEffect(()=>{(async()=>{const s=JSON.parse(localStorage.getItem("playlist"))||[];try{const a=s.map(c=>fetch(`https://api.themoviedb.org/3/movie/${c}?api_key=4c1eef5a8d388386187a3426bc2345be`).then(d=>d.json())),u=await Promise.all(a);t(u),r(!1)}catch(a){console.error("Error fetching movie data:",a),Q.error(a),r(!1)}})()},[]);const o=l=>{const a=(JSON.parse(localStorage.getItem("playlist"))||[]).filter(u=>u!==l);localStorage.setItem("playlist",JSON.stringify(a)),t(e.filter(u=>u.id!==l))};return n?C.jsx("p",{className:"p-5",children:"Loading your playlist..."}):C.jsx("div",{className:"p-5",children:e.length>0?C.jsxs(C.Fragment,{children:[C.jsx(Kt,{title:"Your Watchlist"}),C.jsx("div",{className:"grid grid-cols-3 lg:grid-cols-6 gap-5 text-white",children:e.map(l=>C.jsx(Wu,{cancel:!0,movie:l,onRemoveFromWatchlist:o},l.id))})]}):C.jsx("div",{className:"text-center text-xl text-gray-400",children:"No movies found in your watchlist."})})};function w2(){return C.jsx(t1,{children:C.jsx(Yy,{children:C.jsxs(Kr,{path:"/",element:C.jsx(LE,{}),children:[C.jsx(Kr,{index:!0,element:C.jsx(Mx,{})}),C.jsx(Kr,{path:"/movie/:id",element:C.jsx(g2,{})}),C.jsx(Kr,{path:"/watchlist",element:C.jsx(y2,{})}),"\\"]})})})}Cm(document.getElementById("root")).render(C.jsxs(w.StrictMode,{children:[C.jsx(w2,{}),C.jsx(CE,{theme:"dark"})]})); diff --git a/index.html b/index.html index 9d25285..7a4af91 100644 --- a/index.html +++ b/index.html @@ -32,7 +32,7 @@ name="twitter:image" content="https://opengraph.b-cdn.net/production/images/7c6ce8aa-5046-4500-9570-38751586a02d.png?token=LhDNCahdnKHj6I98kQ892TIwOWIMiureEjWxkFXDpEE&height=630&width=1200&expires=33267305174" /> - +